summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudio_tablegen.h
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mpegaudio_tablegen: Make exponential LUT sharedAndreas Rheinhardt2020-12-081-21/+1
| | | | | | | | | | | | | | | | 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>
* avcodec/mpegaudio_tablegen: Don't inappropriately use static arrayAndreas Rheinhardt2020-12-081-1/+1
| | | | | | | | | Each invocation of this function is only entered once, so using a static array makes no sense (and given that the whole array is reinitialized at the beginning of this function, it wouldn't even make sense if the function were called multiple times). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudio_tablegen: Avoid write-only buffersAndreas Rheinhardt2020-12-081-0/+18
| | | | | | | | | | | | | | | | | | | | | 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>
* avcodec/mpegaudio_tablegen: Add (), fix fateMichael Niedermayer2015-12-021-2/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegaudio_tablegen: more dynamic table creation speedupsGanesh Ajjanagadde2015-12-011-7/+15
| | | | | | | | | | | | | | | | | | | | This further speeds up runtime initialization, with identical generated tables. Sample benchmark (x86-64, Haswell, GNU/Linux): old: 34441423 decicycles in mpegaudio_tableinit, 8192 runs, 0 skips new: 10776291 decicycles in mpegaudio_tableinit, 8192 runs, 0 skips Most low hanging fruit is taken care of here. For some idea, note that 83,064 array elements totalling 233,722 bytes need to be initialized. Thus, with this patch, we average ~ 12.9 cycles per element or ~ 4.6 cycles per byte. Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avcodec/mpegaudio_tablegen: speed up dynamic table creationGanesh Ajjanagadde2015-12-011-6/+13
| | | | | | | | | | | | | | | | | | | 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>
* Add av_cold to table generation functions.Reimar Döffinger2014-08-311-1/+2
| | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* avcodec/mpegaudio_tablegen: fix build with hardcoded tablesMichael Niedermayer2013-10-241-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavcodec/mpegaudio_tablegen: clip value before castingMichael Niedermayer2013-10-221-1/+1
| | | | | | Avoids FPE on alpha Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/mpegaudio_tablegen: remove dead branchMichael Niedermayer2013-10-151-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec: improve precission for cbrtf() emulationMichael Niedermayer2013-10-151-2/+2
| | | | | | | | cbrtf() took floats but it represented 1/3 exactly and even if not more precission should be better in theory for the table generation Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mpegaudio_tablegen: Don't use llrintDerek Buitenhuis2013-10-151-1/+2
| | | | | | | | You cannot count on it being present on all systems, and you cannot include libm.h in a host tool, so just hard code a baseline implementation. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* tablegen: Don't use cbrtf in host toolsDerek Buitenhuis2013-10-151-2/+4
| | | | | | | | You cannot count on them being present on all systems, and you cannot include libm.h in a host tool, so just hard code baseline implementations. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* mpegaudio_tablegen: try to fix hardcoded tablesMichael Niedermayer2012-08-021-0/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mp3dec: adjust IMDCT scaling to avoid overflowsMichael Niedermayer2012-08-021-2/+2
| | | | | | Fixes ticket268 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-05-221-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: ffmpeg: get rid of the -vglobal option. dct32: Add AVX implementation of 32-point DCT dct32: Change pass 6 permutation to allow for AVX implementation dct32: port SSE 32-point DCT to YASM multiple inclusion guard cleanup avio: document buffer must created with av_malloc() and friends avio: check AVIOContext malloc failure swscale: point out an alternative to sws_getContext svq3: Do initialization after parsing the extradata add changelog entries for 0.7_beta2 mp3lame: add #include required for AV_RB32 macro. Conflicts: Changelog libavcodec/svq3.c libavcodec/x86/dct32_sse.c libavfilter/vsrc_buffer.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * multiple inclusion guard cleanupDiego Biurrun2011-05-211-3/+3
| | | | | | | | | | Add missing multiple inclusion guards; clean up #endif comments; add missing library prefixes; keep guard names consistent.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-05-181-4/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * mpegaudio: add _fixed suffix to some namesMans Rullgard2011-05-171-4/+4
| | | | | | | | | | | | | | | | 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>
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-05-101-0/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpegaudiodec: group #includes more sanely mpegaudio: remove #if 0 blocks ffmpeg.c: reset avoptions after each input/output file. ffmpeg.c: store per-output stream sws flags. mpegaudio: remove CONFIG_MPEGAUDIO_HP option mpegtsenc: Clear st->priv_data when freeing it udp: Fix receiving RTP data over multicast rtpproto: Remove an unused variable regtest: fix wma tests NOT pulled: mpegaudio: remove CONFIG_AUDIO_NONSHORT regtest: separate flags for encoding and decoding Conflicts: ffmpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegaudio: remove CONFIG_MPEGAUDIO_HP optionMans Rullgard2011-05-091-0/+2
| | | | | | | | | | | | | | The low quality mode is off by default and never tested. The high quality mode is also plenty fast enough. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* mathematics.h no longer needs config.h, so update tablegen code andReimar Döffinger2010-06-211-2/+0
| | | | | | documentation to use it where appropriate. Originally committed as revision 23680 to svn://svn.ffmpeg.org/ffmpeg/trunk
* float based mp1/mp2/mp3 decoders.Michael Niedermayer2010-05-111-0/+4
| | | | Originally committed as revision 23095 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Revert "Add required header #include to fix 'make checkheaders'."Måns Rullgård2009-11-261-1/+0
| | | | | | | config.h must not be included in that file. The table generator runs on the host system, but config.h describes the target. Originally committed as revision 20620 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: K&R style, prettyprintingDiego Biurrun2009-11-261-13/+13
| | | | Originally committed as revision 20619 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add required header #include to fix 'make checkheaders'.Diego Biurrun2009-11-251-0/+1
| | | | Originally committed as revision 20612 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove unused variable.Michael Niedermayer2009-11-081-1/+0
| | | | | | 1l for me if it wherent sunday and i could buy cola. Originally committed as revision 20477 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Simpliy exp*table init, based on patch by reimar.Michael Niedermayer2009-11-071-8/+8
| | | | Originally committed as revision 20470 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix out-of-tree builds with --enable-hardcoded-tablesReimar Döffinger2009-10-281-1/+1
| | | | Originally committed as revision 20404 to svn://svn.ffmpeg.org/ffmpeg/trunk
* 10l, fix incorrect endif comment.Reimar Döffinger2009-10-281-1/+1
| | | | Originally committed as revision 20401 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add support for hardcoding the mpegaudiodec tables.Reimar Döffinger2009-10-281-0/+68
Reduces .bss size by about 194 kB. Originally committed as revision 20400 to svn://svn.ffmpeg.org/ffmpeg/trunk