1
0
Fork 0
Commit Graph

12 Commits

Author SHA1 Message Date
Andreas Rheinhardt d5d1c697bd avcodec/mpegaudio_tablegen: Make exponential LUT shared
Both the fixed as well as the floating point mpegaudio decoders use
LUTs of type int8_t and uint32_t with 32K entries each; these tables
are completely the same, yet they are not shared. This commit makes
them shared. When both fixed as well as floating point decoders are
enabled, this saves 160KiB from the bss segment for a normal build
(translating into 160KiB less memory usage if both a shared as well as
a floating point decoder have actually been used) and 160KiB from the
binary for a build with hardcoded tables.

It also means that the code to create said LUTs is no longer duplicated
(for a normal build).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-08 17:51:47 +01:00
Andreas Rheinhardt 22140374c8 avcodec/mpegaudio_tablegen: Avoid write-only buffers
The mpegaudio_tablegen header contains code to initialize several
tables; it is included in both the fixed as well as the floating point
mpegaudio decoders and some of these tables are only used by the fixed
resp. floating point decoders; yet both types are always initialized,
leaving the compiler to figure out that one of them is unused.

GCC 9.3 fails at this (even with -O3):
$ readelf -s mpegaudiodec_fixed.o|grep _float
    28: 0000000000001660 32768 OBJECT  LOCAL  DEFAULT    4 expval_table_float
An actually unused table (expval_table_fixed/float) of size 32KiB is kept
and initialized (the reason for this is probably that this table is read
from, namely to initialize another table: exp_table_fixed/float; of course
the float resp. fixed tables are not used in the fixed resp. floating point
decoder).

Therefore #ifdef the unneeded tables away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-08 17:51:47 +01:00
Hendrik Leppkes 42a9aead85 avcodec: include tablegen compat header before the tablegen functionality 2015-12-04 14:49:38 +01:00
Ganesh Ajjanagadde 16d4c28cbb avcodec/mpegaudio_tablegen: speed up dynamic table creation
This does some miscellaneous stuff mainly avoiding the usage of pow to
achieve significant speedups. This is not speed critical, but is
unnecessary latency and cycles wasted for a user.

All tables tested and are identical to the old ones
(bit-exact even in floating point case).

Sample benchmark (x86-64, Haswell, GNU/Linux):
old:
102329530 decicycles in mpegaudio_tableinit,       1 runs,      0 skips

new:
34111900 decicycles in mpegaudio_tableinit,       1 runs,      0 skips

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-01 19:05:19 -05:00
Michael Niedermayer b4bcd1e2f1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix compilation of iirfilter-test.
  libx264: handle closed GOP codec flag
  lavf: remove duplicate assignment in avformat_alloc_context.
  lavf: use designated initializers for AVClasses.
  flvdec: clenup debug code
  asfdec: fix possible overread on broken files.
  asfdec: do not fall back to binary/generic search
  asfdec: reindent after previous commit c7bd5ed
  asfdec: fallback to binary search internally
  mpegaudio: add _fixed suffix to some names
  Modify x86util.asm to ease transitioning to 10-bit H.264 assembly.
  dct: build dct32 as separate object files
  qdm2: include correct header for rdft

Conflicts:
	ffpresets/libx264-fast.ffpreset
	ffpresets/libx264-fast_firstpass.ffpreset
	ffpresets/libx264-faster.ffpreset
	ffpresets/libx264-faster_firstpass.ffpreset
	ffpresets/libx264-medium.ffpreset
	ffpresets/libx264-medium_firstpass.ffpreset
	ffpresets/libx264-placebo.ffpreset
	ffpresets/libx264-placebo_firstpass.ffpreset
	ffpresets/libx264-slow.ffpreset
	ffpresets/libx264-slow_firstpass.ffpreset
	ffpresets/libx264-slower.ffpreset
	ffpresets/libx264-slower_firstpass.ffpreset
	ffpresets/libx264-superfast.ffpreset
	ffpresets/libx264-superfast_firstpass.ffpreset
	ffpresets/libx264-ultrafast.ffpreset
	ffpresets/libx264-ultrafast_firstpass.ffpreset
	ffpresets/libx264-veryfast.ffpreset
	ffpresets/libx264-veryfast_firstpass.ffpreset
	ffpresets/libx264-veryslow.ffpreset
	ffpresets/libx264-veryslow_firstpass.ffpreset
	libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-18 05:42:42 +02:00
Mans Rullgard 4bac1bbc3b mpegaudio: add _fixed suffix to some names
This adds a _fixed suffix to the fixed-point versions of things
with both float and fixed-point variants.  This makes it more
consistent with other dual-implementation things, e.g. fft.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-17 20:17:36 +01:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Diego Pettenò 350120d269 tablegen: implement and use WRITE_ARRAY macros
Two macros (WRITE_ARRAY and WRITE_ARRAY_2D) take the prefix (modifiers)
(not all tables are static, and they might not be constant either), the
type, and the name of the array. It'll be copied with same name and type,
and with the correct size of the currently-defined object.

Originally committed as revision 23821 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-27 12:21:12 +00:00
Diego Pettenò ac014798ff tableprint: use the type name as-is for the functions' names.
This drops one parameter from the functions' macros, and require structures
to be typedeffed, but ensures that it is possible to map 1-to-1 the type to
the function name.

Originally committed as revision 23820 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-27 12:20:39 +00:00
Michael Kostylev 3e48d792b6 Fix mpegaudio tablegen.
Patch by Michael Kostylev, michael D kostylev A gmail

Originally committed as revision 23106 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-05-13 10:02:48 +00:00
Reimar Döffinger 8eaa6e0e04 Change/simplify the tableprint/tablegen API.
Originally committed as revision 22761 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-01 17:11:47 +00:00
Reimar Döffinger eadaa00c6f Add support for hardcoding the mpegaudiodec tables.
Reduces .bss size by about 194 kB.

Originally committed as revision 20400 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-28 18:42:52 +00:00