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

Måns Rullgård mans
Mon Dec 15 10:38:46 CET 2008


Kostya <kostya.shishkov at gmail.com> writes:

> 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.

Quite true.  Then, why is the celp code not using it?

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list