[FFmpeg-devel] [PATCH v2] libavutil: add an FFT & MDCT implementation

Lynne dev at lynne.ee
Tue May 14 20:17:51 EEST 2019


May 14, 2019, 5:55 PM by onemda at gmail.com:

> On 5/10/19, Lynne <> dev at lynne.ee <mailto:dev at lynne.ee>> > wrote:
>
>> Patch updated again.
>> Made some more cleanups to the transforms, the tables and the main context.
>> API changed again, now the init function populates the function pointer for
>> transform.
>> I decided that having a separate function would encourage bad usage (e.g.
>> calling
>> the function every time before doing a transform rather than storing the
>> pointer) when
>> we're trying to avoid the overhead of function calls.
>> Also adjusted file names to match the API.
>>
>
> LGTM, going to apply soon.
>

I've attached the latest version. Not much changed, just some cleaning up, twiddle
adjustments to prepare for SIMD and making the scale argument a const.
I've removed AV_TX_NB, wasn't used, if needed it can be added without breaking the API.
Added #include <stddef.h> to tx.h as ptrdiff_t is defined there.

One thing to know when using it as an MDCT is that unlike ff_mdct_init where the
window size is required (e.g. for a 1024 sample MDCT you'd put in 2048 since that's
your window size), here the frame size is used, so you'd put in a length of 1024 for
a 1024 sample MDCT (which has a window size of 2048 samples).
Not sure if it makes more sense in general, but we can't change behavior after its
pushed as it would break the API.

I've attached a diff which replaces the MDCT in aacenc, vorbisdec/enc, atrac9dec and
opusdec/enc with this one for testing. Passes FATE.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libavutil-add-an-FFT-MDCT-implementation.patch
Type: text/x-diff
Size: 38943 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190514/95e22fff/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: replace_mdct.diff
Type: text/x-diff
Size: 17525 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190514/95e22fff/attachment.diff>


More information about the ffmpeg-devel mailing list