[FFmpeg-devel] [PATCH v2 161/162] avcodec/mpegaudiodec: Hardcode tables to save space
Michael Niedermayer
michael at niedermayer.cc
Sat Nov 28 17:31:33 EET 2020
On Fri, Nov 27, 2020 at 08:56:46PM +0100, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > On Fri, Nov 20, 2020 at 08:33:26AM +0100, Andreas Rheinhardt wrote:
> >> The csa_tables (which always consist of 32 entries of four byte each,
> >> but the type depends upon whether the decoder is fixed or
> >> floating-point) are currently initialized once during decoder
> >> initialization; yet it turns out that this is actually no benefit: The
> >> code used to initialize these tables takes up 153 (fixed point) and 122
> >> (floating point) bytes when compiled with GCC 9.3 with -O3 on x64, so it
> >> is better to just hardcode these tables.
> >>
> >> Essentially the same applies to the is_tables: They have a size or 128
> >> each and the code to initialize them occupies 149 (fixed point) resp.
> >> 140 (floating point) bytes. So hardcode them, too.
> >
> > Is it intended not to use CONFIG_HARDCODED_TABLES ?
> >
> Yes. It makes no sense to ever generate the tables at runtime if the
> code for this takes more space than the tables itself.
>
> > also if the code generating the tables is removed then it should be made
> > easy to re-build the tables. That would be in the spirit of the *GPL
> > (to be able to change and rebuild a binary\H table
> > for potentially a different use)
> >
> How about I refer to the git history for that? (I don't even have the
> mp3-spec, so I don't know on what part of it these tables are based.)
thats probably ok, maybe make the reference so it would work even with a
different VCS. (i assume the commit title is uniqe then it together with the
git hash would achieve this)
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20201128/e7fa482a/attachment.sig>
More information about the ffmpeg-devel
mailing list