[FFmpeg-devel] [PATCH 0/4] fftw exploration (WIP)

Ganesh Ajjanagadde gajjanag at gmail.com
Fri Mar 25 17:29:56 CET 2016


On Fri, Mar 25, 2016 at 8:23 AM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> On Fri, Mar 25, 2016 at 3:34 PM, Ganesh Ajjanagadde <gajjanag at gmail.com> wrote:
>> On Fri, Mar 25, 2016 at 12:35 AM, Clément Bœsch <u at pkh.me> wrote:
>>> On Thu, Mar 24, 2016 at 05:50:48PM -0700, Ganesh Ajjanagadde wrote:
>>>> Ganesh Ajjanagadde (4):
>>>>   configure: add fftw3 detection
>>>>   lavc/fftw: add initial fftw wrapper
>>>>   lavc/fft-test: add FFTW3 tests
>>>>   lavc/fft-test: update benchmark code
>>>>
>>>
>>> Why?
>>>
>>> Using an external library for such an essential component sounds like
>>> madness to me.
>>
>> I don't really understand. It is an opt-in dependency, and does not
>> have to be used. Seems like I don't really understand the FFmpeg
>> philosophy; there are a ton of optional libs in configure. FFT is not
>> used in all codecs, so I view it on the same lines as having things
>> like libopus based decoding instead of native FFmpeg decoding, the
>> multiple AAC encoders/decoders, the duplicate prores stuff, libnut on
>> top of the native demuxer, etc, etc.
>>
>
> The way I see it, external libraries should only be used if they
> provide actual features (for example new formats not otherwise
> supported, or access to hardware de/encoders), or a higher quality
> (ie. for encoders).
> Using external libraries for small performance gains seems rather
> overkill, resulting in code rot and maintenance burden.

Depends on if it is small or not. Yes, in many codecs, FFT's are short
length ones, e.g 512. However, on long lengths, e.g 8192+, as seen
from the benches, there are sometimes 2x variations at the moment.

>
> If performance is the only reason one might want an external library,
> then its a much better idea to try to optimize the code we have, that
> way more people automatically benefit from this, and we avoid this
> complexity.

I see some points to this, but note also that ensuring that avfft
remains fast as new instruction sets roll along (e.g AVX-512) is also
a maintainence burden. Assuming FFTW is still actively developed
(which it is atm: https://github.com/FFTW/fftw3), they take care of
this aspect of the burden. It is even available on windows AFAIK,
since Julia uses it.

Furthermore, fundamentally all projects specialize in one way or
another. FFmpeg is specialized to multimedia, fftw to the task of
computing fft's, etc. This is why we have library ecosystems, etc.

>
> - Hendrik
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list