[FFmpeg-devel] [PATCH] G.729 initialization routine (skeleton)

Michael Niedermayer michaelni
Sat Jun 6 17:26:18 CEST 2009


On Sat, Jun 06, 2009 at 08:06:40PM +0700, Vladimir Voroshilov wrote:
> 2009/6/6 Michael Niedermayer <michaelni at gmx.at>:
> > On Sat, Jun 06, 2009 at 12:56:01PM +0700, Vladimir Voroshilov wrote:
> >> 2009/6/6 Diego Biurrun <diego at biurrun.de>:
> >> > On Sat, Jun 06, 2009 at 01:01:02AM +0200, Stefano Sabatini wrote:
> >> >> On date Friday 2009-06-05 14:24:39 +0700, Vladimir Voroshilov encoded:
> >> >> >
> >> >> > --- ffmpeg-r19088.orig/libavcodec/g729dec.c
> >> >> > +++ ffmpeg-r19088.mod/libavcodec/g729dec.c
> >> >> > @@ -97,11 +107,45 @@ static inline int g729_get_parity(uint8_t value)
> >> >> > + ? ? ? ?av_log(avctx, AV_LOG_ERROR, "Sample rate %d is not supported.\n", avctx->sample_rate);
> >> >>
> >> >> I'd prefer avoid the point at the end of the message sentences.
> >> >
> >> > The period is correct and should stay.
> >> >
> >>
> >> Updated.
> >>
> >> --
> >> Regards,
> >> Vladimir Voroshilov ? ? mailto:voroshil at gmail.com
> >> JID: voroshil at gmail.com, voroshil at jabber.ru
> >> ICQ: 95587719
> >
> >> ?g729dec.c | ? ?4 ++--
> >> ?1 file changed, 2 insertions(+), 2 deletions(-)
> >> 128407c0d1fc403fcfa76fad10f8960f465f2601 ?0002-Convert-structure-names-to-FFmpeg-style.120.patch
> >> From 751dbbcdb4eb8ee964d852158c5d46c9e5fa5322 Mon Sep 17 00:00:00 2001
> >> From: Vladimir Voroshilov <voroshil at gmail.com>
> >> Date: Sat, 6 Jun 2009 08:13:27 +0700
> >> Subject: [PATCH] Convert structure names to FFmpeg style
> >
> > ok
> >
> 
> Applied.
> 
> > [...]
> >
> >> ?g729dec.c | ? 44 ++++++++++++++++++++++++++++++++++++++++++++
> >> ?1 file changed, 44 insertions(+)
> >> 7fb0041bf877436433beb0dba0e65d3e280840b6 ?0003-Initialization-routine.120.patch
> >> From a6a15f1e45df2c11700d24e3b1c195bd04ee73f1 Mon Sep 17 00:00:00 2001
> >> From: Vladimir Voroshilov <voroshil at gmail.com>
> >> Date: Fri, 5 Jun 2009 00:47:25 +0700
> >> Subject: [PATCH] Initialization routine
> >>
> >>
> >> diff --git ffmpeg-r19120.orig/libavcodec/g729dec.c ffmpeg-r19120.mod/libavcodec/g729dec.c
> >> index f224a37..dd55895 100644
> >> --- ffmpeg-r19120.orig/libavcodec/g729dec.c
> >> +++ ffmpeg-r19120.mod/libavcodec/g729dec.c
> >> @@ -81,6 +81,16 @@ typedef struct {
> >> ? ? ?int mr_energy;
> >> ?} G729FormatDescription;
> >>
> >
> >> +typedef enum {
> >> + ? ?FORMAT_G729_8K = 0,
> >> + ? ?FORMAT_G729_4K4,
> >> +} G729Formats;
> >
> > this can be replaced by direct sample_rate checks in the code
> 
> You suggest using:
> 
> ========================
> typedef G729Context{
>   int mr_energy
> }
> 
> decode()
> {
>  some_routine(ctx->mr_energy);
> }
> init ()
> {
>  if (sample_rate== 1)
>   ctx->mr_energy = 1;
>  else if (sample_rate == 2)
>   ctx->mr_energy = 3;
> }
> =======================

no 1 and 2 are no sample rates
your code did check AVCodecContext.sample_rate and then sets format
based on it and then checks format everywhere, you can check sample_rate
directly
please remove the intermediate step not rename it

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090606/00e71807/attachment.pgp>



More information about the ffmpeg-devel mailing list