[FFmpeg-devel] [PATCH] G.729 Pitch delay decoding & frame erasure case

Michael Niedermayer michaelni
Thu Jun 25 11:56:36 CEST 2009


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


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

It is not what we do, but why we do it that matters.
-------------- 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/20090625/f0ddfacf/attachment.pgp>



More information about the ffmpeg-devel mailing list