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

Vladimir Voroshilov voroshil
Sat Jun 6 15:06:40 CEST 2009


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;
}
=======================

instead of

===========================
typedef G729Format {
  int mr_energy;
}

typedef G729Context{
  int format;
}

G729Format formats = {
 {1},
 {3}
};

decode()
{
 some_routine(formats[ctx->format].mr_energy)
}
init()
{
 if (sample_rate== 1)
  ctx->format = 1;
 else if (sample_rate == 2)
  ctx->format = 2;
}
===========================

Am i right ?
If so, I need "sample_rate" member in context instead of "format" in this case.
Assuming i understand you right, i fixed the patch.

-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Initialization-routine.122.patch
Type: text/x-diff
Size: 1913 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090606/d97a8e01/attachment.patch>



More information about the ffmpeg-devel mailing list