[FFmpeg-devel] [PATCH] G.729 Pitch delay decoding & frame erasure case
Vladimir Voroshilov
voroshil
Thu Jun 25 13:58:25 CEST 2009
2009/6/25 Michael Niedermayer <michaelni at gmx.at>:
> On Wed, Jun 24, 2009 at 01:02:27PM +0700, Vladimir Voroshilov wrote:
>> Code in first patch decodes pitch delay from adaptive-codebook index.
>>
>> Code in second patch calculates pitch delay when frame erasure is
>> detected (it is small,
>> i can join both patches if you wish).
> [...]
>> @@ -305,6 +310,20 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
>> ? ? ? ? ?gc_1st_index ?= get_bits(&gb, format.gc_1st_index_bits);
>> ? ? ? ? ?gc_2nd_index ?= get_bits(&gb, format.gc_2nd_index_bits);
>>
>> + ? ? ? ?if (!i && bad_pitch)
>> + ? ? ? ? ? ?pitch_delay_3x ? = 3 * ctx->pitch_delay_int_prev;
>> + ? ? ? ?else if(!i)
>> + ? ? ? ? ? ?pitch_delay_3x = ff_acelp_decode_8bit_to_1st_delay3(ac_index);
>> + ? ? ? ?else if(i && packet_type == FORMAT_G729D_6K4)
>> + ? ? ? ? ? ?pitch_delay_3x = ff_acelp_decode_4bit_to_2nd_delay3(ac_index,
>> + ? ? ? ? ? ? ? ? ? ?av_clip(ctx->pitch_delay_int_prev-5,PITCH_DELAY_MIN,PITCH_DELAY_MAX-9));
>> + ? ? ? ?else
>> + ? ? ? ? ? ?pitch_delay_3x = ff_acelp_decode_5_6_bit_to_2nd_delay3(ac_index,
>> + ? ? ? ? ? ? ? ? ? ?av_clip(ctx->pitch_delay_int_prev - 5, PITCH_DELAY_MIN, PITCH_DELAY_MAX - 9));
>
> if(!i){
> ? ?if(bad_pitch)
> ? ?else
> }else{
> ? ?if(packet_type == FORMAT_G729D_6K4)
> ? ?else
> }
>
> and you format your duplicated code inconsistently
Fixed both.
P.S. Due to wrong patch order this patch uses undefined value "packet_type".
I have separate patch for it, of course. Is usage of this variable ok?
Related patch (small) can be posted here or in separate thread ?
--
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: 0005-Pitch-delay-decoding.172.patch
Type: text/x-diff
Size: 2983 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090625/dbe5cb77/attachment.patch>
More information about the ffmpeg-devel
mailing list