[FFmpeg-devel] [PATCH] Common ACELP routines (3/3) - LPC decoding routines
Michael Niedermayer
michaelni
Thu Apr 24 02:21:25 CEST 2008
On Thu, Apr 24, 2008 at 02:53:33AM +0700, Vladimir Voroshilov wrote:
> Michael Niedermayer wrote:
[...]
>
> >
> > [...]
> > > +void ff_acelp_reorder_lsf(int16_t* lsfq, int16_t lsfq_min_distance, int16_t lsfq_min, int16_t lsfq_max)
> > > +{
> > > + int i;
> > > +
> > > + lsfq[0] = FFMAX(lsfq[0], lsfq_min); //Is warning required ?
> > > +
> > > + for(i=0;i<9; i++)
> > > + lsfq[i+1] = FFMAX(lsfq[i+1], lsfq[i] + lsfq_min_distance);
> >
> > simplification stolen from soc/amrnbdec.c:
> >
> > for(i=0; i<10; i++){
> > lsf[i] = FFMAX(lsf[i], lsf_min);
> > lsf_min = lsf[i] + min_distance;
> > }
> >
> > also id make lsfq_min_distance and lsfq_min/max int
> >
> > ahh, and reorder_lsf() in soc/amrnbdec.c is buggy (uninitalized var)
>
> It also assumes that LSFs already ordered.
> G.729 explicitly sorts them.
> Should i put sorting code inside routine?
If its fast for the case that they are already sorted ...
[...]
> +/**
> + * \brief decodes polynomial coefficients from LSP
> + * \param f [out] (Q24) decoded polynomial coefficients
> + * \param lsp (Q15) LSP coefficients
> + */
> +static void lsp2poly(int* f, const int16_t* lsp)
> +{
> + int i, j;
> +
> + f[0] = 0x1000000; // 1.0 in Q24
> + f[1] = -lsp[0] << 10; // *2 and Q15 -> Q24
> +
> + for(i=2; i<=5; i++)
> + {
> + f[i] = f[i-2];
> +
> + for(j=i; j>1; j--)
> +#ifdef G729_BITEXACT
> + f[j] -= (mul_24_15(f[j-1]>>1, lsp[2*i-2])<<2) - f[j-2];
> +#else
> + f[j] -= (mul_24_15(f[j-1], lsp[2*i-2])<<1) - f[j-2];
Does this need the cliping from mul_24_15() ? or can it be replaced
by a simple * (int64_t) ?
[....]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No great genius has ever existed without some touch of madness. -- Aristotle
-------------- 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/20080424/fae5566a/attachment.pgp>
More information about the ffmpeg-devel
mailing list