[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [2/7] - pitch lag decoding

Michael Niedermayer michaelni
Fri May 23 20:19:54 CEST 2008


On Sat, May 24, 2008 at 12:11:16AM +0700, Vladimir Voroshilov wrote:
> 2008/5/18 Michael Niedermayer <michaelni at gmx.at>:
> > On Sun, May 18, 2008 at 08:25:54AM +0700, Vladimir Voroshilov wrote:
> >> 2008/5/18 Michael Niedermayer <michaelni at gmx.at>:
> >> > On Wed, May 14, 2008 at 12:12:26AM +0700, Vladimir Voroshilov wrote:
> >> >> 2008/5/12 Michael Niedermayer <michaelni at gmx.at>:
> >> >> >
> >> >> > On Sun, May 11, 2008 at 09:42:26PM +0700, Vladimir Voroshilov wrote:
> >> >> >  > 2008/5/10 Michael Niedermayer <michaelni at gmx.at>:
> >> >>
> > [...]
> >> >> +void ff_acelp_update_past_gain_erasure(int16_t *quant_energy, int ma_pred_order)
> >> >> +{
> >> >> +    int avg_gain=quant_energy[ma_pred_order-1]; // (5.10)
> >> >> +    int i;
> >> >> +
> >> >> +    /* 4.4.3 of G.729, Equation 95 */
> >> >> +    for(i=ma_pred_order-1; i>0; i--)
> >> >> +    {
> >> >> +        avg_gain       += quant_energy[i-1];
> >> >> +        quant_energy[i] = quant_energy[i-1];
> >> >> +    }
> >> >> +#ifdef G729_BITEXACT
> >> >> +    if(ma_pred_order == 4)
> >> >> +    quant_energy[0] = FFMAX(avg_gain >> 2, -10240) - 4096; // -10 and -4 in (5.10)
> >> >> +    else
> >> >> +#endif
> >> >> +    quant_energy[0] = FFMAX(avg_gain / ma_pred_order, -10240) - 4096; // -10 and -4 in (5.10)
> >> >> +}
> >> >
> >> > Is this function used anywhere with a ma_pred_order != 4 ?
> >>
> >> in fixed-point SIPR 16k (i still keeping it synced with common routines)
> >> with ma_pred_order == 2
> >
> > quant_energy[0] = FFMAX(avg_gain >> log2_ma_pred_order, -10240) - 4096; // -10 and -4 in (5.10)
> >
> > ?
> 
> This will require either additional parameter (ma_pred_order,
> log2_ma_pred_order - duplication ?) or explicit call to av_log2.
> Neither of the cases looks good for me.

pass just log2_ma_pred_order as argument
and use 1<<log2_ma_pred_order at the point where ma_pred_order is needed

ill review rest of the patch soon

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

Thouse who are best at talking, realize last or never when they are wrong.
-------------- 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/20080523/60438981/attachment.pgp>



More information about the ffmpeg-devel mailing list