[FFmpeg-devel] Make ff_acelp_lsp2lpc() more generic

Michael Niedermayer michaelni
Wed Jun 16 17:41:20 CEST 2010


On Wed, Jun 16, 2010 at 02:36:44PM +0100, M?ns Rullg?rd wrote:
> Mohamed Naufal <naufal11 at gmail.com> writes:
> 
> > Hi
> >
> > The attached patch allows using the function by both G.729 & G.723.1.
> >
> > -void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
> > +void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order, int shift, int rounder, int sign)
> >  {
> >      int i;
> >      int f1[lp_half_order+1]; // (3.22)
> > @@ -103,9 +103,10 @@ void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
> >          int ff1 = f1[i] + f1[i-1]; // (3.22)
> >          int ff2 = f2[i] - f2[i-1]; // (3.22)
> >  
> > -        ff1 += 1 << 10; // for rounding
> > -        lp[i]    = (ff1 + ff2) >> 11; // divide by 2 and (3.22) -> (3.12)
> > -        lp[(lp_half_order << 1) + 1 - i] = (ff1 - ff2) >> 11; // divide by 2 and (3.22) -> (3.12)
> > +        ff1 += rounder; // for rounding
> > +        // divide by 2 and scale
> > +        lp[i]    =                         av_clip_int16(sign * av_clip_int16((ff1 + ff2) >> (shift + 1)));
> > +        lp[(lp_half_order << 1) + 1 - i] = av_clip_int16(sign * av_clip_int16((ff1 - ff2) >> (shift + 1)));
> 
> That clipping will probably have a severe performance impact.  Did you
> benchmark this?

also, some of the cliping is clearly unneeded
and we need to find out of what remains is needed

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/20100616/5cbf387e/attachment.pgp>



More information about the ffmpeg-devel mailing list