[FFmpeg-devel] [PATCH] dot_product() static non-inline in a header

Michael Niedermayer michaelni
Tue Dec 16 01:34:13 CET 2008


On Mon, Dec 15, 2008 at 10:24:19PM +0100, Aurelien Jacobs wrote:
> Kostya wrote:
> 
> > On Sun, Dec 14, 2008 at 11:37:20PM +0000, M?ns Rullg?rd wrote:
> > [...]
> > > > +++ libavcodec/celp_math.c	(working copy)
> > > > @@ -196,6 +196,17 @@
> > > >      return (power_int << 15) + value;
> > > >  }
> > > >  
> > > > +int ff_dot_product(const int16_t* a, const int16_t* b, int length, int shift)
> > > > +{
> > > > +    int sum = 0;
> > > > +    int i;
> > > > +
> > > > +    for(i=0; i<length; i++)
> > > > +        sum += (a[i] * b[i]) >> shift;
> > > > +
> > > > +    return sum;
> > > > +}
> > > 
> > > This looks generic enough that it should probably be moved to
> > > something like dsputils.  It is also trivially simdable.
> > 
> > No, we have scalarproduct_int16() in DSPContext already which has the same
> > syntax and does the same thing. Also it has AltiVec and SSE2 implementations.
> 
> True !
> Attached patch uses scalarproduct_int16() and removes ff_dot_product().
> It is not really tested as ff_acelp_decode_gain_code() is currently unused.
> But it should be OK anyway.

ok assuming one of the *celp devels says its ok (they can linkely easily
test)

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- 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/20081216/e4a8f5f6/attachment.pgp>



More information about the ffmpeg-devel mailing list