[FFmpeg-devel] [PATCH 2/2] imdct15: replace the FFT with a faster PFA FFT algorithm

Peter Barfuss bofh.h4x at gmail.com
Wed Jan 4 16:14:57 EET 2017


First off, many thanks.

> +    const int inv_1 = l_ptwo << ((4 - b_ptwo) & 3);
> +    const int inv_2 = 0xeeeeeeef & ((1U << b_ptwo) - 1);

It would be nice to add a comment here that the expression for inv_1
is (2^b_ptwo)^-1 mod 15 and inv_2 is 15^-1 mod 2^b_ptwo. (A general
PFA FFT would need to use extended Euclidean algorithm here, but
because both cases are fixed, it simplifies to these expressions. I
have a sketch of a proof (basically solving the relevant diophantine
equation you get) in case anyone is nervous, though it's easy to
verify by hand for 1 < b_ptwo < 18, which are all the cases that
ffmpeg's power-of-two FFT currently supports).

Rest of patch seems good.

-Peter


More information about the ffmpeg-devel mailing list