[FFmpeg-devel] [PATCH] QCELP decoder

Måns Rullgård mans
Wed Oct 29 03:07:53 CET 2008


Michael Niedermayer <michaelni at gmx.at> writes:

> On Tue, Oct 28, 2008 at 04:26:36PM -0700, Kenan Gillet wrote:
>> On Oct 24, 2008, at 6:00 PM, Michael Niedermayer wrote:
> [...]
>> >
>> >> Index: libavcodec/celp_math.c
>> >> ===================================================================
>> >> --- libavcodec/celp_math.c	(revision 0)
>> >> +++ libavcodec/celp_math.c	(revision 0)
>> >> @@ -0,0 +1,40 @@
>> >> +/*
>> > [...]
>> >> + */
>> >> +
>> >> +/**
>> >> + * returns the dot product.
>> >> + * @param a input data array
>> >> + * @param b input data array
>> >> + * @param length number of elements
>> >> + *
>> >> + * @return dot product = sum of elementwise products
>> >> + */
>> >> +float ff_dot_product(const float* a, const float* b, int length)
>> >> +{
>> >> +    float sum = 0;
>> >> +    int i;
>> >> +
>> >> +    for(i=0; i<length; i++)
>> >> +        sum += (a[i] * b[i]);
>> >> +
>> >> +    return sum;
>> >> +}
>> >
>> > superflous () and a dot product is not a celp specific thing
>> > the doxy belongs in the header not the c file
>> 
>> done,
>> should it go in libavutil/mathematic.[ch] or somewhere else ?
>
> hmm, good question ...
> iam slightly against libavutil/mathematic.[ch] though as libavutil should
> stay simple and such loop is so trivial that it would border on bloat for
> libavutil IMHO

That operation can be trivially simdified, and already exists for int16.

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




More information about the ffmpeg-devel mailing list