[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [4/7] - G.729 core

Vladimir Voroshilov voroshil
Wed Sep 3 20:01:07 CEST 2008


2008/9/3 Michael Niedermayer <michaelni at gmx.at>:
> On Wed, Sep 03, 2008 at 12:51:30AM +0700, Vladimir Voroshilov wrote:
> [...]
>> >> +
>> >> +            /* Decode the fixed-codebook gain. */
>> >> +            ctx->gain_code = ff_acelp_decode_gain_code(
>> >> +                    gain_corr_factor,
>> >> +                    fc,
>> >> +                    formats[ctx->format].mr_energy,
>> >> +                    ctx->quant_energy,
>> >> +                    ma_prediction_coeff,
>> >> +                    ctx->subframe_size,
>> >> +                    4);
>> >> +            ff_acelp_update_past_gain(ctx->quant_energy, gain_corr_factor, 2, ctx->frame_erasure);
>> >> +        }
>> >
>> > ff_acelp_update_past_gain can be factored out of the if/else
>>
>> Splitting was done especially for moving gain_corr_factor variable
>> inside "if" statement.
>> Otherwise  one of the following is required to avoid compiler warning:
>>
>> 1. "=0"  before loop.
>> 2. "=0" inside loop in frame erasure case
>
> i think it fits best inside the if() to complement the other in else

Hopefully i understood you correctly. Those peace of code looks enough clean.

>
>
>>
>> In both cases those fact that this variable is not used between loop
>> iterations is unclear
>> So i preferred to split the call to routine and explicitly pass zero
>> in frame erasure case cases.
>>
>>
>> P.S. How should i apply ok'ed chunks (since they are not standalone
>> parts of code)?
>
>> As in your reply, without any routine headers, if/else statements/parenthesis ?
>
> yes, the file isnt compiled yet

Ok.

Updated patch is attached.
1. removed all postfilter-related code from it (as long as build
environment) - will be posted later
as separate patches.
2. duplicated entries in format table removed.



-- 
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: 0002-G729-decoder.93.patch
Type: text/x-diff
Size: 19602 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080904/d8fbd991/attachment.patch>



More information about the ffmpeg-devel mailing list