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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed May 8 01:41:44 EEST 2019


On 07.05.2019, at 01:33, Lynne <dev at lynne.ee> wrote:

> May 6, 2019, 11:41 PM by barsnick at gmx.net:
> 
>> On Mon, May 06, 2019 at 02:23:26 +0200, Lynne wrote:
>> 
>>> This allowed for the exptabs to be computed just once on startup and
>>> stored in a global array.
>>> 
>> 
>> I have no real understanding of this, but:
>> Would there be a desire for a static implementation as well, for those
>> using "-enable-hardcoded-tables" (CONFIG_HARDCODED_TABLES)? Just
>> wondering whether that's esoteric, optional, or really nice to have.
>> 
>> Moritz
>> 
> 
> Not really, its just nicer, saves 64 bytes per context and some time on subsequent inits,
> and might help with SIMD because more can be hardcoded into the assembly.
> I don't think the hardcoded tables flag helps much nowadays, binary size seems more
> important to users shipping the libraries. Also it might improve precision somewhat
> for floats if the compiling machine has a different libc than the user's machine, and the
> sin/cos approximations used on the compiling machine's libc are worse.

It's a bit of a special case, but it also helps memory usage when many instances of FFmpeg run on the same machine.
.rodata sections will be shared, whereas runtime-initialized sections will cause copy-on-write at initialization, and unless deduplication is possible and enabled (which has other costs) will use memory for each instance.
It can also be swapped out or executed in-place for systems that support that, reducing memory usage of those tables to 0.


More information about the ffmpeg-devel mailing list