[FFmpeg-devel] [PATCH 1/4] lavu/float_dsp: add double-precision scalar product

James Almer jamrial at gmail.com
Wed May 29 19:04:10 EEST 2024


On 5/29/2024 12:51 PM, Rémi Denis-Courmont wrote:
> Le keskiviikkona 29. toukokuuta 2024, 18.44.13 EEST Andreas Rheinhardt a écrit
> :
>>> +static double ff_scalarproduct_double_c(const double *v1,
> 
>> Don't use an ff_ prefix for a static function.
> 
> I can see over 300 such identifiers in the code base (many but not all inline),
> and I don't see why that would be a problem.
> 
>>> +
>>> +    /**
>>> +     * Calculate the scalar product of two vectors of doubles.
>>> +     *
>>> +     * @param v1  first vector
>>> +     * @param v2  second vector
>>
>> Are these supposed to obey additional alignment beyond that imposed by
>> double?
> 
> The C and RISC-V implementations require the natural alignment of double, 64-
> bit. If somebody wants to increase the required alignment(s), they are free to
> audit the call sites and update the comments accordingly, since this won't be
> an ABI break.

Current users seem to all pass AVFrame audio buffers, so 32 byte 
alignment should be fine. And length should be a multiple of 16. So 
basically, same as all other double dsp functions in floatdsp.


More information about the ffmpeg-devel mailing list