[FFmpeg-devel] [PATCH 3/6] avcodec/aacdec_fixed: Move fixed-point sinewin tables to its only user

Lynne dev at lynne.ee
Fri Jan 29 10:19:26 EET 2021


Jan 28, 2021, 17:26 by andreas.rheinhardt at gmail.com:

> The fixed-point AAC decoder is the only user of the fixed-point sinewin
> tables from sinewin; and it only uses a few of them (about 10% when
> counting by size). This means that guarding initializing these tables by
> an AVOnce (as done in 3719122065863f701026632f610175980d42b05a) is
> unnecessary for them. Furthermore the array of pointers to the
> individual arrays is also unneeded.
>
> Therefore this commit moves these tables directly into aacdec_fixed.c;
> this is done by ridding the original sinewin.h and sinewin_tablegen.h
> headers completely of any fixed-point code at the cost of a bit of
> duplicated code (the alternative is an ugly ifdef-mess).
>
> This saves about 58KB from the binary when using hardcoded tables (as
> these tables are hardcoded in this scenario); when not using hardcoded
> tables, most of these savings only affect the .bss segment, but the rest
> (< 1KB) contains relocations (i.e. savings in .data.rel.ro).
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  configure                              |  2 +-
>  libavcodec/Makefile                    |  4 +-
>  libavcodec/aacdec_fixed.c              |  2 +-
>  libavcodec/aacdec_template.c           | 27 +++++------
>  libavcodec/sinewin.c                   |  1 -
>  libavcodec/sinewin.h                   | 13 ++---
>  libavcodec/sinewin_fixed.c             | 21 --------
>  libavcodec/sinewin_fixed_tablegen.c    | 22 ++++++++-
>  libavcodec/sinewin_fixed_tablegen.h    | 67 ++++++++++++++++++++++++++
>  libavcodec/sinewin_tablegen.c          | 25 +++++++++-
>  libavcodec/sinewin_tablegen.h          | 33 +++++--------
>  libavcodec/sinewin_tablegen_template.c | 55 ---------------------
>  12 files changed, 143 insertions(+), 129 deletions(-)
>  delete mode 100644 libavcodec/sinewin_fixed.c
>  create mode 100644 libavcodec/sinewin_fixed_tablegen.h
>  delete mode 100644 libavcodec/sinewin_tablegen_template.c
>

LGTM, could you go ahead and push this whenever possible?


More information about the ffmpeg-devel mailing list