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

Kostya kostya.shishkov
Mon Dec 15 08:25:51 CET 2008


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.
 
> -- 
> M?ns Rullg?rd




More information about the ffmpeg-devel mailing list