summaryrefslogtreecommitdiff
path: root/libavcodec/aac_tablegen.h
Commit message (Collapse)AuthorAge
* avcodec/aac_tablegen: get rid of hardcoded tables entirelyGanesh Ajjanagadde2015-11-28
| | | | | | | | | | Commit 96786a12f6df26990bbe7c0ca4592b3731724469 makes runtime initialization cheap. Tested with FATE, with/without --enable-hardcoded-tables. Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avcodec/aac_tablegen: make exp2_lut staticGanesh Ajjanagadde2015-11-27
| | | | | Suggested-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avcodec/aac_tablegen: speed up table initializationGanesh Ajjanagadde2015-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This speeds up aac_tablegen to a ludicruous degree (~97%), i.e to the point where it can be argued that runtime initialization can always be done instead of hard-coded tables. The only cost is essentially a trivial increase in the stack size. Even if one does not care about this, the patch also improves accuracy as detailed below. Performance: Benchmark obtained by looping 10^4 times over ff_aac_tableinit. Sample benchmark (x86-64, Haswell, GNU/Linux): old: 1295292 decicycles in ff_aac_tableinit, 512 runs, 0 skips 1275981 decicycles in ff_aac_tableinit, 1024 runs, 0 skips 1272932 decicycles in ff_aac_tableinit, 2048 runs, 0 skips 1262164 decicycles in ff_aac_tableinit, 4096 runs, 0 skips 1256720 decicycles in ff_aac_tableinit, 8192 runs, 0 skips new: 21112 decicycles in ff_aac_tableinit, 511 runs, 1 skips 21269 decicycles in ff_aac_tableinit, 1023 runs, 1 skips 21352 decicycles in ff_aac_tableinit, 2043 runs, 5 skips 21386 decicycles in ff_aac_tableinit, 4080 runs, 16 skips 21299 decicycles in ff_aac_tableinit, 8173 runs, 19 skips Accuracy: The previous code was resulting in needless loss of accuracy due to the pow being called in succession. As an illustration of this: ff_aac_pow34sf_tab[3] old : 0.000000000007598092294225 new : 0.000000000007598091426864 real: 0.000000000007598091778545 truncated to float old : 0.000000000007598092294225 new : 0.000000000007598091426864 real: 0.000000000007598091426864 showing that the old value was not correctly rounded. This affects a large number of elements of the array. Patch tested with FATE. Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* aacenc: move the generation of ff_aac_pow34sf_tab[]Rostislav Pehlivanov2015-07-21
| | | | | | | | | | | | This commit moves the generation of ff_aac_pow34sf_tab[] out of the encoder and into the table generator. The original commit log for this table in 2011 actually mentions that it should be moved outside but this never happened. This is the first commit which cleans up the encoder a little. Reviewed-by: Claudio Freire <klaussfreire@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Add av_cold to table generation functions.Reimar Döffinger2014-08-31
| | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* Merge commit '4a2ef39442bf7f0150db07a1fbfcf8286e4d44a3'Michael Niedermayer2013-07-26
|\ | | | | | | | | | | | | | | | | | | * commit '4a2ef39442bf7f0150db07a1fbfcf8286e4d44a3': cosmetics: Add '0' to float constants ending in '.'. Conflicts: libavcodec/ra288.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Add '0' to float constants ending in '.'.Diego Biurrun2013-07-25
| |
* | Merge commit '1cd432e167b1a80853760c89a33606e2b5f229c2'Michael Niedermayer2012-10-19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1cd432e167b1a80853760c89a33606e2b5f229c2': configure: fix libcdio check rtsp: Allow setting the reordering buffer size via an AVOption rtsp: Vertically align a constant definition rtp: Update the check for distinguishing between RTP and RTCP aac: fix build with hardcoded tables fate: dependencies for screen codec tests riff: Move functions around to be covered by appropriate #ifdefs Conflicts: configure tests/fate/screen.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aac: fix build with hardcoded tablesMans Rullgard2012-10-18
| | | | | | | | | | | | | | | | | | | | | | aac_tablegen.h includes aac.h for the POW_SF2_ZERO definition, but this also pulls in a raft of other headers, some of which are not safe to use in code built with the host compiler. Moving POW_SF2_ZERO to aac_tablegen_decl.h, where the declaration of the array it relates to already resides, fixes the problems. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-06-08
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (28 commits) Remove some non-compiling debug messages. ffplay: Fix non-compiling debug printf and replace it by av_dlog. H264: x86 predict init cosmetics. ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder. Move E-AC-3 encoder functions to a separate eac3enc.c file. ac3enc: remove convenience macro, #define DEBUG ac3enc: remove unused #define vc1: re-initialize tables after width/height change. APIchanges: fill-in git commit hash for av_get_bytes_per_sample() addition samplefmt: add av_get_bytes_per_sample() iirfilter: fix biquad filter coefficients. swscale: remove duplicate conversion routine in swScale(). swscale: add yuv2planar/packed function typedefs. swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers. swscale: reindent x86 init code. swscale: extract SWS_FULL_CHR_H_INT conditional into init code. swscale: cosmetics. swscale: remove alp/chr/lumSrcOffset. swscale: un-special-case yuv2yuvX16_c(). shorten: Remove stray DEBUG #define and corresponding av_dlog statement. ... Conflicts: doc/APIchanges libavcodec/ac3enc.c libavutil/avutil.h libavutil/samplefmt.c libswscale/swscale.c libswscale/swscale_internal.h libswscale/x86/swscale_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Drop unnecessary directory prefixes from #include directives.Diego Biurrun2011-06-07
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-05-22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-21
| | | | | | | | | | Add missing multiple inclusion guards; clean up #endif comments; add missing library prefixes; keep guard names consistent.
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-04-28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: vorbisdec: Rename silly "class_" variable to plain "class". simple_idct_alpha: Drop some useless casts. Simplify av_log_missing_feature(). ac3enc: remove check for mismatching channels and channel_layout If AVCodecContext.channels is 0 and AVCodecContext.channel_layout is non-zero, set channels based on channel_layout. If AVCodecContext.channel_layout and AVCodecContext.channels are both non-zero, check to make sure they do not contradict eachother. cosmetics: indentation Check AVCodec.supported_samplerates and AVCodec.channel_layouts in avcodec_open(). aacdec: remove sf_scale and sf_offset. aacdec: use a scale of 2 in the LTP MDCT rather than doubling the coefficient table values from the spec. Define POW_SF2_ZERO in aac.h and use for ff_aac_pow2sf_tabp[] offsets instead of hardcoding 200 everywhere. Large intensity stereo and PNS indices are legal. Clip them instead of erroring out. A magnitude of 100 corresponds to 2^25 so the will most likely result in clipped output anyway. qpeg: use reget_buffer() in decode_frame() ultimotion: use reget_buffer() in ulti_decode_frame() smacker: remove unnecessary call to avctx->release_buffer in decode_frame() avparser: don't av_malloc(0). Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Define POW_SF2_ZERO in aac.h and use for ff_aac_pow2sf_tabp[] offsets insteadAlex Converse2011-04-27
| | | | | | | | of hardcoding 200 everywhere.
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Remove unnecessary ../ from include directivesMåns Rullgård2010-06-26
| | | | Originally committed as revision 23806 to svn://svn.ffmpeg.org/ffmpeg/trunk
* aactab: Tablegenify ff_aac_pow2sf_tab.Alex Converse2010-06-23
Originally committed as revision 23740 to svn://svn.ffmpeg.org/ffmpeg/trunk