summaryrefslogtreecommitdiffstats
path: root/libavcodec/aac.h
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/aacdec_fixed: Provide context to av_log()Michael Niedermayer2019-01-011-1/+1
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Parse and drop gain control data, so that SSR packets decode.Dale Curtis2018-02-211-0/+2
| | | | | | | | | | | | | | This will result in poor quality audio for SSR streams, but they will at least demux and decode without error; partially fixing ticket #1693. This pulls in the decode_gain_control() function from the ffmpeg summer-of-code repo (original author Maxim Gavrilov) at svn://svn.mplayerhq.hu/soc/aac/aac.c with some minor modifications and adds AOT_AAC_SSR to decode_audio_specific_config_gb(). Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Co-authored-by: Maxim Gavrilov <maxim.gavrilov@gmail.com>
* avcodec/aac: Add floating point 960/120 MDCT windowPaul B Mahol2017-08-241-0/+3
| | | | | Co-Authored-By: Alex Converse <alex.converse@gmail.com> Co-Authored-By: Rostislav Pehlivanov <atomnuker@gmail.com>
* imdct15: rename to mdct15 and add a forward transformRostislav Pehlivanov2017-02-141-2/+2
| | | | | | | Handles strides (needed for Opus transients), does pre-reindexing and folding without needing a copy. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* avcodec/aac_tablegen: get rid of hardcoded tables entirelyGanesh Ajjanagadde2015-11-281-0/+2
| | | | | | | | | | 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>
* aacenc: add support for encoding files using Long Term PredictionRostislav Pehlivanov2015-10-171-0/+2
| | | | | | | | | | | | | | | | | | | Long Term Prediction allows for prediction of spectral coefficients via the previously decoded time-dependent samples. This feature works well with harmonic content 2 or more frames long, like speech, human or non-human, piano music or any constant tones at very low bitrates. It should be noted that the current coder is highly efficient and the rate control system is unable to encode files at extremely low bitrates (less than 14kbps seems to be impossible) so this extension isn't capable of optimum operation. Dramatic difference is observable with some types of audio and speech but for the most part the audiable differences are subtle. The spectrum looks better however so the encoder is able to harvest the additional bits that this feature provies, should the user choose to enable it. So it's best to enable this feature only if encoding at the absolutely lowest bitrate that the encoder is capable of.
* AAC encoder: Extensive improvementsClaudio Freire2015-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finalizes merging of the work in the patches in ticket #2686. Improvements to twoloop and RC logic are extensive. The non-exhaustive list of twoloop improvments includes: - Tweaks to distortion limits on the RD optimization phase of twoloop - Deeper search in twoloop - PNS information marking to let twoloop decide when to use it (turned out having the decision made separately wasn't working) - Tonal band detection and priorization - Better band energy conservation rules - Strict hole avoidance For rate control: - Use psymodel's bit allocation to allow proper use of the bit reservoir. Don't work against the bit reservoir by moving lambda in the opposite direction when psymodel decides to allocate more/less bits to a frame. - Retry the encode if the effective rate lies outside a reasonable margin of psymodel's allocation or the selected ABR. - Log average lambda at the end. Useful info for everyone, but especially for tuning of the various encoder constants that relate to lambda feedback. Psy: - Do not apply lowpass with a FIR filter, instead just let the coder zero bands above the cutoff. The FIR filter induces group delay, and while zeroing bands causes ripple, it's lost in the quantization noise. - Experimental VBR bit allocation code - Tweak automatic lowpass filter threshold to maximize audio bandwidth at all bitrates while still providing acceptable, stable quality. I/S: - Phase decision fixes. Unrelated to #2686, but the bugs only surfaced when the merge was finalized. Measure I/S band energy accounting for phase, and prevent I/S and M/S from being applied both. PNS: - Avoid marking short bands with PNS when they're part of a window group in which there's a large variation of energy from one window to the next. PNS can't preserve those and the effect is extremely noticeable. M/S: - Implement BMLD protection similar to the specified in ISO-IEC/13818:7-2003, Appendix C Section 6.1. Since M/S decision doesn't conform to section 6.1, a different method had to be implemented, but should provide equivalent protection. - Move the decision logic closer to the method specified in ISO-IEC/13818:7-2003, Appendix C Section 6.1. Specifically, make sure M/S needs less bits than dual stereo. - Don't apply M/S in bands that are using I/S Now, this of course needed adjustments in the compare targets and fuzz factors of the AAC encoder's fate tests, but if wondering why the targets go up (more distortion), consider the previous coder was using too many bits on LF content (far more than required by psy), and thus those signals will now be more distorted, not less. The extra distortion isn't audible though, I carried extensive ABX testing to make sure. A very similar patch was also extensively tested by Kamendo2 in the context of #2686.
* aac: remove now-unused redundant arrayRostislav Pehlivanov2015-08-291-1/+0
| | | | | | | | | This commit removes the array which was made redundant with the last commit. The current prediction system gets the quantization error directly (and without the single-frame delay) in the search_for_pred function. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* aacenc_pred: rework the way prediction is doneRostislav Pehlivanov2015-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit completely alters the algorithm of prediction. The original commit which introduced prediction was completely incorrect to even remotely care about what the actual coefficients contain or whether any options were enabled. Not my actual fault. This commit treats prediction the way the decoder does and expects to do: like lossy encryption. Everything related to prediction now happens at the very end but just before quantization and encoding of coefficients. On the decoder side, prediction happens before anything has had a chance to even access the coefficients. Also the original implementation had problems because it actually touched the band_type of special bands which already had their scalefactor indices marked and it's a wonder the asserion wasn't triggered when transmitting those. Overall, this now drastically increases audio quality and you should think about enabling it if you don't plan on playing anything encoded on really old low power ultra-embedded devices since they might not support decoding of prediction or AAC-Main. Though the specifications were written ages ago and as times change so do the FLOPS. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* aacenc: implement the complete AAC-Main profileRostislav Pehlivanov2015-08-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This commit finalizes AAC-Main profile encoding support by implementing all mandatory and optional tools available in the specifications and current decoders. The AAC-Main profile reqires that prediction support be present (although decoders don't require it to be enabled) for an encoder to be deemed capable of AAC-Main encoding, as well as TNS, PNS and IS, all of which were implemented with previous commits or earlier of this year. Users are encouraged to test the new functionality using either -profile:a aac_main or -aac_pred 1, the former of which will enable the prediction option by default and the latter will change the profile to AAC-Main. No other options shall be changed by enabling either, it's currently up to the users to decide what's best. The current implementation works best using M/S and/or IS, so users are also welcome to enable both options and any other options (TNS, PNS) for maximum quality. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* aacenc_tns: implement temporal noise shapingRostislav Pehlivanov2015-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | This commit implements temporal noise shaping support in the encoder, along with an -aac_tns option to toggle it on or off (off by default for now). TNS will increase audio quality and reduce quantization noise by applying a multitap FIR filter across allowed coefficients and transmit side information to the decoder so it could create an inverse filter. Users are encouraged to test the new functionality by enabling -aac_tns 1 during encoding. No major bugs are observable at this time so after a while if no new problems appear and if the current implementation is deemed of high enough quality and stability it will be enabled by default, possibly at the same time the encoder has its experimental flag removed and becomes the standard aac encoder in ffmpeg. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* aaccoder: move the quantization functions to a separate fileRostislav Pehlivanov2015-08-211-0/+1
| | | | | | | | | | | This commit moves the quantizer to a separate header file. This allows the quantizer to be used from a separate files outside of aaccoder without having to put another function pointer and will result in a slight speedup as the compiler can do more optimizations. This is required for commits following. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* AAC Encoder: clipping avoidanceClaudio Freire2015-07-271-0/+4
| | | | | | | | | | | | | | | | | Avoid clipping due to quantization noise to produce audible artifacts, by detecting near-clipping signals and both attenuating them a little and encoding escape-encoded bands (usually the loudest) rounding towards zero instead of nearest, which tends to decrease overall energy and thus clipping. Currently fate tests measure numerical error so this change makes tests using asynth (which are near clipping) report higher error not less, because of window attenuation. Yet, they sound better, not worse (albeit subtle, other samples aren't subtle at all). Only measuring psychoacoustically weighted error would make for a representative test, so that will be left for a future patch. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Implementation of AAC_fixed_decoder (SBR-module)Djordje Pesut2015-07-201-51/+1
| | | | | | | Add fixed poind code. Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec: Implementation of AAC_fixed_decoder (LC-module) [3/4]Djordje Pesut2015-07-091-21/+59
| | | | | | | Add fixed point implementation Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* libavcodec: Implementation of AAC_fixed_decoder (LC-module) [2/4]Jovan Zelincevic2015-07-091-0/+23
| | | | | | | Add fixed point implementation of functions for generating tables Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* aac: add additional fields needed by the encoder for intensity stereoRostislav Pehlivanov2015-06-281-2/+7
| | | | | | This commit adds additional fields which are used by the native encoder to add intensity stereo support. It also adds some clarifying statements to the comments for the codebooks. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* aacenc: Adjust the initial offset for PNS valuesRostislav Pehlivanov2015-04-141-0/+1
| | | | | | | | | This commit adjusts the intial offset for PNS values, introduced with commit f7f71b5795d708763eb0c55fe5e2cb051b2b69f4 earlier. This commit shifts the value in such a way that no further offsets are required in the aaccoder.c file. Earlier version of the PNS patch had 2 offsets in both the aaccoder and aacenc. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* aacenc: Add support for Perceptual Noise Substitution energy valuesRostislav Pehlivanov2015-04-131-0/+3
| | | | | | | | | | | | This commit implements support for writing the noise energy values used in PNS. The difference between regular scalefactors and noise energy values is that the latter require a small preamble (NOISE_PRE + energy_value_diff) to be written as the first noise-containing band. Any following noise energy values use the previous one to base their "diff" on. Ordinary scalefactors remain unchanged other than that they ignore the noise values. This commit should not change anything by itself, the following commits will bring it in use. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* AAC: Fix M/S stereo encodingClaudio Freire2015-03-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a pointer arithmetic bug in adjust_frame_information that resulted in heavily corrupted audio when using M/S encoding. Also, a backup copy of untransformed coefficients has to be kept around or attempts at re-processing the frame (which happens when hevavily overspending bits during transients) will result in re-encoding of the coefficients and subsequent corruption of the resulting stream. A/B testing shows the bug as corrected, but still cannot prove that M/S coding is a win at least in numbers. Limited listening tests do show improvement on M/S encoded samples in lower bitrates, but they're hidden among the other artifacts that remain to be corrected in the encoder. Some of the regressions flagged in the report do show poor stereo image (but not buggy), so M/S encoding is clearly not good enough yet to be defaulted to auto. In numbers, Patched against Unpatched, stereo_mode auto: Files: 114 Bitrates: 6 Tests: 683 Serious Regressions: 0 (0%) Regressions: 0 (0%) Improvements: 227 (33%) Big improvements: 92 (13%) Worst regression - mybloodrusts.wv - 256k - StdDev: 28.61 pSNR: -0.43 maxdiff: 1372.00 Best improvement - 60.wv - 384k - StdDev: -369.57 pSNR: 45.02 maxdiff: -13322.00 Average - StdDev: -80.56 pSNR: 2.49 maxdiff: -8858.00 Patched against Unpatched stereo_mode ms_off shows no difference. Patched stereo_mode auto vs Unpatched stereo_mode ms_off shows a small average improvement, just not too significant: Serious Regressions: 0 (0%) Regressions: 10 (1%) Improvements: 45 (6%) Big improvements: 2 (0%) Worst regression - Illinois.wv - 256k - StdDev: 33.20 pSNR: -2.03 maxdiff: 477.00 Best improvement - song_of_circomstances.flac - 384k - StdDev: -3.97 pSNR: 7.61 maxdiff: -826.00 Average - StdDev: -10.25 pSNR: 0.20 maxdiff: -281.00 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'ee964145b5d229571e00bf6883a44189d02babe2'Michael Niedermayer2015-02-281-2/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ee964145b5d229571e00bf6883a44189d02babe2': lavc: remove unused traces of fmtconvert usage Conflicts: libavcodec/aac.h libavcodec/aacdec.c libavcodec/atrac3.c libavcodec/vorbisdec.c libavcodec/wma.c libavcodec/wma.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: remove unused traces of fmtconvert usageAnton Khirnov2015-02-281-2/+0
| | | | | | | | | | Those decoders have been switched to float output and so do not use fmtconvert anymore.
* | Merge commit 'd615187f74ddf3413778a8b5b7ae17255b0df88e'Michael Niedermayer2015-02-041-0/+2
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'd615187f74ddf3413778a8b5b7ae17255b0df88e': aacdec: Support for ER AAC ELD 480. Conflicts: libavcodec/aacdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aacdec: Support for ER AAC ELD 480.Alex Converse2015-02-031-0/+2
| | | | | | | | Based in part on work from Niel van der Westhuizen <espes@pequalsnp.com>.
* | avcodec/aacdec: Use avpriv_float_dsp_alloc()Michael Niedermayer2014-12-021-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/aacdec: Skip processing channel elements which have not been presentMichael Niedermayer2014-11-091-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/aacdec: warn user when remapping streams.Benoit Fouet2014-10-241-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/aac: fix () in IS_CODEBOOK_UNSIGNED macroMichael Niedermayer2014-05-251-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-231-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * qatar/master: aac: Add support for Enhanced AAC Low Delay (ER AAC ELD). Conflicts: Changelog libavcodec/aacdec.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aac: Add support for Enhanced AAC Low Delay (ER AAC ELD).Alex Converse2013-10-231-1/+1
| | | | | | | | | | This does not include support for LD SBR, epTool, data resilience, nor the 960 transform family.
* | Merge commit '1914e6f010b3320025c7b692aaea51d9b9a992a8'Michael Niedermayer2013-09-191-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit '1914e6f010b3320025c7b692aaea51d9b9a992a8': aacdec: Add support for LD (Low Delay) AAC Conflicts: Changelog libavcodec/aacdec.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aacdec: Add support for LD (Low Delay) AACAlex Converse2013-09-181-0/+1
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-07-261-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | * qatar/master: miscellaneous typo fixes Conflicts: configure libavformat/avisynth.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * miscellaneous typo fixesDiego Biurrun2013-07-251-1/+1
| |
* | Revert "aacdec: Reconfigure output as needed, disable ↵Michael Niedermayer2013-03-081-5/+0
| | | | | | | | | | | | | | | | pop_output_configuration()" This reverts commit 60dbf2eff92f8aa4683b6dcaba9e694890258ade. This is not needed anymore, Ticket 1694 has been fixed differently
* | aacdec: Reconfigure output as needed, disable pop_output_configuration()Michael Niedermayer2013-03-071-0/+5
| | | | | | | | | | | | Fixes Ticket1694 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'c242bbd8b6939507a1a6fb64101b0553d92d303f'Michael Niedermayer2013-02-261-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c242bbd8b6939507a1a6fb64101b0553d92d303f': Remove unnecessary dsputil.h #includes Conflicts: libavcodec/ffv1.c libavcodec/h261dec.c libavcodec/h261enc.c libavcodec/h264pred.c libavcodec/lpc.h libavcodec/mjpegdec.c libavcodec/rectangle.h libavcodec/x86/idct_sse2_xvid.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove unnecessary dsputil.h #includesDiego Biurrun2013-02-261-1/+0
| |
* | mips: optimization for float aac decoder (sbr module)Mirjana Vulin2013-02-211-2/+0
| | | | | | | | | | Signed-off-by: Mirjana Vulin <mvulin@mips.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e57daa876bf0cf50782550e366e589441cd8c2bd'Michael Niedermayer2013-02-131-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e57daa876bf0cf50782550e366e589441cd8c2bd': adpcm: decode directly to the user-provided AVFrame ac3: decode directly to the user-provided AVFrame aac: decode directly to the user-provided AVFrame 8svx: decode directly to the user-provided AVFrame Conflicts: libavcodec/8svx.c libavcodec/ac3dec.c libavcodec/adpcm.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aac: decode directly to the user-provided AVFrameJustin Ruggles2013-02-121-1/+1
| |
* | mips: optimization for float aac decoder (core module)Mirjana Vulin2013-01-311-2/+16
| | | | | | | | | | Signed-off-by: Mirjana Vulin <mvulin@mips.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '73b704ac609d83e0be124589f24efd9b94947cf9'Michael Niedermayer2013-01-231-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '73b704ac609d83e0be124589f24efd9b94947cf9': arm: Add some missing header #includes floatdsp: move scalarproduct_float from dsputil to avfloatdsp. Conflicts: libavcodec/acelp_pitch_delay.c libavcodec/amrnbdec.c libavcodec/amrwbdec.c libavcodec/ra288.c libavcodec/x86/dsputil_mmx.c libavutil/x86/float_dsp.asm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * floatdsp: move scalarproduct_float from dsputil to avfloatdsp.Ronald S. Bultje2013-01-221-1/+0
| | | | | | | | This makes the aac decoder and all voice codecs independent of dsputil.
* | aacdec: make dual mono mode selectable through AVOptions too.Michael Niedermayer2012-12-301-0/+2
| | | | | | | | | | | | Based on patch by Akihiro Tsukada Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacdec: simplify dmonoMichael Niedermayer2012-12-301-2/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3d3cf6745e2a5dc9c377244454c3186d75b177fa'Michael Niedermayer2012-11-261-3/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '3d3cf6745e2a5dc9c377244454c3186d75b177fa': aacdec: use float planar sample format for output Conflicts: libavcodec/aacdec.c libavcodec/aacsbr.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aacdec: use float planar sample format for outputJustin Ruggles2012-11-251-3/+4
| |
* | Merge commit '1cd432e167b1a80853760c89a33606e2b5f229c2'Michael Niedermayer2012-10-191-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud