summaryrefslogtreecommitdiff
path: root/libavcodec/aacpsy.c
Commit message (Collapse)AuthorAge
* avcodec/aacpsy: Clear the correct pointerMichael Niedermayer2015-06-01
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '074a1b37325bf6d1483fc23ebf1255e78d998339'Michael Niedermayer2015-06-01
|\ | | | | | | | | | | | | | | | | | | * commit '074a1b37325bf6d1483fc23ebf1255e78d998339': aacpsy: Check memory allocation Conflicts: libavcodec/aacpsy.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aacpsy: Check memory allocationVittorio Giovara2015-05-31
| |
| * aacpsy: correct calculation of minath in psy_3gpp_initAndreas Cadhalpun2015-05-05
| | | | | | | | | | | | | | | | | | | | | | | | The minimum of the ath(x, ATH_ADD) function depends on ATH_ADD. This patch uses the first order approximation to determine it. For ATH_ADD = 4 this results in the value at 3407.06812 (-5.24241638) not the one at 3410 (-5.24237967). CC: libav-stabl@libav.org Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | aacpsy: correct calculation of minath in psy_3gpp_initAndreas Cadhalpun2015-04-22
| | | | | | | | | | | | | | | | | | | | | | | | The minimum of the ath(x, ATH_ADD) function depends on ATH_ADD. This patch uses the first order approximation to determine it. For ATH_ADD = 4 this results in the value at 3407.06812 (-5.24241638) not the one at 3410 (-5.24237967). Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Approved-by: Claudio Freire <klaussfreire@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacpsy: avoid psy_band->threshold becoming NaNAndreas Cadhalpun2015-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If band->thr is 0.0f, the division is undefined, making norm_fac not a number or infinity, which causes psy_band->threshold to become NaN. This is passed on to other variables until it finally reaches sce->sf_idx and is converted to an integer (-2147483648). This causes a segmentation fault when it is used as array index. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Reviewed-by: Claudio Freire <klaussfreire@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/aacpsy: Fix AAC Psy PE reduction calculation when multiple ↵Claudio Freire2015-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iterations are required This is a small change, but it does have a big impact on bit allocation. all the regressions marked in the report have no audible difference (I didn't check them all though), but the improvements can be heard. This affects mostly high bit rates. It's related to issue #2686. In the report, A is the patched version, B is unpatched, all comparisons show deltas in the form (A-B), so a positive pSNR delta means a better quality in the patched version, and negative a regression. Regressions are only considered for pSNR deltas below -1db, they're considered serious below -6db. All measurements were done with tiny_psnr. The summary of the report inline for quick reading: Files: 58 Bitrates: 6 Tests: 347 Serious Regressions: 0 (0%) Regressions: 10 (2%) Improvements: 54 (15%) Big improvements: 26 (7%) Worst regression - sine_tester.flac - 384k - StdDev: 1.68 pSNR: -3.05 maxdiff: -178.00 Best improvement - 07 - Bound.flac - 384k - StdDev: -1700.05 pSNR: 20.64 maxdiff: -29595.00 Average - StdDev: -55.67 pSNR: 1.20 maxdiff: -1593.00 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0': avcodec: Don't anonymously typedef structs Conflicts: libavcodec/alac.c libavcodec/cinepak.c libavcodec/cscd.c libavcodec/dcadec.c libavcodec/g723_1.c libavcodec/gif.c libavcodec/iff.c libavcodec/kgv1dec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/ra288.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
| * aacenc: Fix a rounding bug in aacpsy channel bitrate computationClaudio Freire2013-05-14
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec/aacpsy: Use av_mallocz_array()Michael Niedermayer2014-06-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487'Michael Niedermayer2013-05-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487': avcodec: Add av_cold attributes to init functions missing them Conflicts: libavcodec/aacpsy.c libavcodec/atrac3.c libavcodec/dvdsubdec.c libavcodec/ffv1.c libavcodec/ffv1enc.c libavcodec/h261enc.c libavcodec/h264_parser.c libavcodec/h264dsp.c libavcodec/h264pred.c libavcodec/libschroedingerenc.c libavcodec/libxvid_rc.c libavcodec/mpeg12.c libavcodec/mpeg12enc.c libavcodec/proresdsp.c libavcodec/rangecoder.c libavcodec/videodsp.c libavcodec/x86/proresdsp_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Add av_cold attributes to init functions missing themDiego Biurrun2013-05-04
| |
* | AAC encoder: Fixed a rounding bug in psy's channel bitrate computation.Claudio Freire2013-05-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'a5f8873620ce502d37d0cc3ef93ada2ea8fb8de7'Michael Niedermayer2013-05-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a5f8873620ce502d37d0cc3ef93ada2ea8fb8de7': silly typo fixes Conflicts: doc/protocols.texi libavcodec/aacpsy.c libavformat/utils.c tools/patcheck Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * silly typo fixesDiego Biurrun2013-05-03
| |
* | mips: Optimization of AAC psychoacoustic model functionsBojan Zivkovic2013-03-23
| | | | | | | | | | | | Signed-off-by: Bojan Zivkovic <bojan@mips.com> Reviewed-by: Nedeljko Babic <Nedeljko.Babic@imgtec.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavcodec: changed mathematical functions in aacpsy.cBojan Zivkovic2013-03-07
| | | | | | | | | | | | | | | | | | This patch changes existing mathematical functions with faster ones. Speeds up encoding more than 10%. Tested on x86 and MIPS platforms. Signed-off-by: Bojan Zivkovic <bojan@mips.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '511cf612ac979f536fd65e14603a87ca5ad435f3'Michael Niedermayer2012-12-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '511cf612ac979f536fd65e14603a87ca5ad435f3': miscellaneous typo fixes Conflicts: libavcodec/4xm.c libavcodec/lagarith.c libavcodec/parser.c libavcodec/ratecontrol.c libavcodec/shorten.c libavcodec/vda_h264.c libavformat/dvenc.c libavformat/wtv.c tools/patcheck Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * miscellaneous typo fixesDiego Biurrun2012-12-21
| |
* | aacpsy: psy_3gpp_analyze_channel() handle energy == 0Michael Niedermayer2012-09-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacpsy: calc_reduction_3gpp() handle active_lines = 0Michael Niedermayer2012-09-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacpsy: use exp2(f) instead of pow(f)(2,...)Michael Niedermayer2012-09-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacenc: new default cutoffMichael Niedermayer2012-07-29
| | | | | | | | | | | | | | Improves subjective quality Formula and testing by: kamedo2 <fujisakihir90@yahoo.co.jp> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacpsy: fix "may be used uninitialized" warningMichael Niedermayer2012-05-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: asf: only set index_read if the index contained entries. cabac: add overread protection to BRANCHLESS_GET_CABAC(). cabac: increment jump locations by one in callers of BRANCHLESS_GET_CABAC(). cabac: remove unused argument from BRANCHLESS_GET_CABAC_UPDATE(). cabac: use struct+offset instead of memory operand in BRANCHLESS_GET_CABAC(). h264: add overread protection to get_cabac_bypass_sign_x86(). h264: reindent get_cabac_bypass_sign_x86(). h264: use struct offsets in get_cabac_bypass_sign_x86(). h264: fix overreads in cabac reader. wmall: fix seeking. lagarith: fix buffer overreads. dvdec: drop unnecessary dv_tablegen.h #include build: fix doc generation errors in parallel builds Replace memset(0) by zero initializations. faandct: Remove FAAN_POSTSCALE define and related code. dvenc: print allowed profiles if the video doesn't conform to any of them. avcodec_encode_{audio,video}: only reallocate output packet when it has non-zero size. FATE: add a test for vp8 with changing frame size. fate: add kgv1 fate test. oggdec: calculate correct timestamps in Ogg/FLAC Conflicts: libavcodec/4xm.c libavcodec/cook.c libavcodec/dvdata.c libavcodec/dvdsubdec.c libavcodec/lagarith.c libavcodec/lagarithrac.c libavcodec/utils.c tests/fate/video.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace memset(0) by zero initializations.Diego Biurrun2012-03-28
| | | | | | | | Also remove one pointless zero initialization in rangecoder.c.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Remove ffmpeg. aacenc: Simplify windowing aacenc: Move saved overlap samples to the beginning of the same buffer as incoming samples. aacenc: Deinterleave input samples before processing. aacenc: Store channel count in AACEncContext. aacenc: Move Q^3/4 calculation to it's own table aacenc: Request normalized float samples instead of converting s16 samples to float. aacpsy: Replace an if with FFMAX in LAME windowing. aacenc: cosmetics, replace 'rd' with 'bits' in codebook_trellis_rate to make it more clear what is being calculated. aacpsy: cosmetics, change a FIXME to a NOTE about subshort comparisons aacenc: cosmetics: move init() and end() to the bottom of the file. aacenc: aac_encode_init() cleanup XWD encoder and decoder vc1: don't read the interpfrm and bfraction elements for interlaced frames mxfdec: fix memleak on mxf_read_close() westwood: split the AUD and VQA demuxers into separate files. Conflicts: .gitignore Changelog Makefile configure doc/ffmpeg.texi ffmpeg.c libavcodec/Makefile libavcodec/aacenc.c libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/version.h libavformat/Makefile libavformat/img2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aacenc: Deinterleave input samples before processing.Nathan Caldwell2012-01-23
| | | | | | | | Signed-off-by: Alex Converse <alex.converse@gmail.com>
| * aacenc: Request normalized float samples instead of converting s16 samples ↵Nathan Caldwell2012-01-23
| | | | | | | | | | | | to float. Signed-off-by: Alex Converse <alex.converse@gmail.com>
| * aacpsy: Replace an if with FFMAX in LAME windowing.Nathan Caldwell2012-01-23
| | | | | | | | Signed-off-by: Alex Converse <alex.converse@gmail.com>
| * aacpsy: cosmetics, change a FIXME to a NOTE about subshort comparisonsNathan Caldwell2012-01-23
| | | | | | | | | | | | Also fix a typo. Signed-off-by: Alex Converse <alex.converse@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: doxygen: misc consistency, spelling and wording fixes vcr1: drop unnecessary emms_c() calls without MMX code Replace all uses of av_close_input_file() with avformat_close_input(). lavf: add avformat_close_input(). lavf: deprecate av_close_input_stream(). lavf doxy: add some basic demuxing documentation. lavf doxy: add some general lavf information. lavf doxy: add misc utility functions to a group. lavf doxy: add av_guess_codec/format to the encoding group. lavf doxy: add core functions to a doxy group. Add basic libavdevice documentation. lavc: convert error_recognition to err_recognition. avconv: update -map option help text x86: Require 7 registers for the cabac asm x86: bswap: remove test for bswap instruction bswap: make generic implementation more compiler-friendly h264: remove useless cast proresdec: fix decode_slice() prototype Conflicts: configure doc/APIchanges ffprobe.c libavcodec/avcodec.h libavcodec/celp_math.h libavcodec/h264.c libavfilter/src_movie.c libavformat/anm.c libavformat/avformat.h libavformat/version.h libavutil/avstring.h libavutil/bswap.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * doxygen: misc consistency, spelling and wording fixesDiego Biurrun2011-12-12
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-06-30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rational-test: Add proper main() declaration to fix gcc warnings. configure: Add vdpau and dxva2 to configure results output. Remove unused, never built libavutil/pca.[ch] matroskadec: forward parsing errors to caller. av_find_stream_info: simplify EAGAIN handling. aacenc: Fix determination of Mid/Side Mode. psymodel: Remove the single channel analysis function aacenc: Implement dummy channel group analysis that just calls the single channel analysis for each channel. psymodel: Add channels and channel groups to the psymodel. ARM: remove check for PLD instruction fate: move amr[nw]b test rules into separate files ogg: fix double free when finding length of small chained oggs. swscale: implement >8bit scaling support. build: fix creation of tools dir with make 3.81 build: Mark all-yes Makefile target as phony. pixfmt: fix YUV422/444 wrong endian comment build: create output directories as needed Add new yuv444 pixfmts to avcodec_align_dimensions2 Conflicts: Makefile configure libavutil/pca.c libavutil/pca.h libavutil/pixfmt.h libswscale/swscale.c libswscale/utils.c libswscale/x86/swscale_template.c tests/ref/lavfi/pixdesc tests/ref/lavfi/pixfmts_copy tests/ref/lavfi/pixfmts_null tests/ref/lavfi/pixfmts_scale tests/ref/lavfi/pixfmts_vflip Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * psymodel: Remove the single channel analysis functionNathan Caldwell2011-06-29
| |
| * aacenc: Implement dummy channel group analysis that just calls the single ↵Nathan Caldwell2011-06-29
| | | | | | | | channel analysis for each channel.
| * psymodel: Add channels and channel groups to the psymodel.Nathan Caldwell2011-06-29
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-06-26
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: ARM: silence some annoying armcc warnings ffplay: Remove unused-but-set channels variable from update_sample_display(). build: Add DEP_LIBS dependency directly to the shared library build rule. build: Remove multiple inclusion guards from config.mak. build: Remove redundant config.mak includes from subdirectory Makefiles. aacenc: Mark psy_3gpp_window() as av_unused. Conflicts: configure Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aacenc: Mark psy_3gpp_window() as av_unused.Diego Biurrun2011-06-25
| | | | | | | | | | It is intentionally left in to allow adding 3GPP-style windowing in the future. Marking it av_unused silences an annoying unused function warning.
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-04-24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Handle unicode file names on windows rtp: Rename the open/close functions to alloc/free Lowercase all ff* program names. Refer to ff* tools by their lowercase names. NOT Pulled Replace more FFmpeg instances by Libav or ffmpeg. Replace `` by $() syntax in shell scripts. patcheck: Allow overiding grep program(s) through environment variables. NOT Pulled Remove stray libavcore and _g binary references. vorbis: Rename decoder/encoder files to follow general file naming scheme. aacenc: Fix whitespace after last commit. cook: Fix small typo in av_log_ask_for_sample message. aacenc: Finish 3GPP psymodel analysis for non mid/side cases. Remove RDFT dependency from AAC decoder. Add some debug log messages to AAC extradata Fix mov debug (u)int64_t format strings. bswap: use native types for av_bwap16(). doc: FLV muxing is supported. applehttp: Handle AES-128 encrypted streams Add a protocol handler for AES CBC decryption with PKCS7 padding doc: Mention that DragonFly BSD requires __BSD_VISIBLE set Conflicts: ffplay.c ffprobe.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aacenc: Fix whitespace after last commit.Nathan Caldwell2011-04-23
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * aacenc: Finish 3GPP psymodel analysis for non mid/side cases.Nathan Caldwell2011-04-23
| | | | | | | | | | | | | | | | | | There is still are still a few sections missing relating to TNS (not present) and mid/side (contains other bugs). Overall this improves quality, and vastly improves rate-control. Signed-off-by: Martin Storsjö <martin@martin.st>
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* aacenc: 10l, missed a reference when refactoring the psymodel.Nathan Caldwell2011-03-17
|
* aacenc: cosmetics, indentation, and comment clarificationNathan Caldwell2011-03-16
| | | | | Correct bad indentation in aaccoder Clarify and correct comments in 3GPP psymodel, other cosmetics.
* aacenc: Refactor the parts of the AAC psymodel.Nathan Caldwell2011-03-16
| | | | | | | | | | | 3GPP: Remove ffac from and move min_snr out of AacPsyBand. Rearrange AacPsyCoeffs to make it easier to implement energy spreading. Rename the band[] array to bands[] Copy energies and thresholds at the end of analysis. LAME: Use a loop instead of an if chain in LAME windowing.
* aacenc: Correct spreading calculation for high spreading.Nathan Caldwell2010-11-01
| | | | | | | | | | | | | | | | | | | | The 3GPP spec uses the following calculation for high spreading: thr'_spr = max(thr_scaled, s_h(n) * thr_scaled(n-1)) where, n is defined as the current band, and s_h() is defined as "[...] the distance of adjacent bands in Bark and a constant slope that is 15 dB/Bark [...]". This is a little ambiguous as you would assume you want the Bark width of the previous band for this calculation. However, this assumption appears to be incorrect, and you really want the Bark width of the current band. Coincidentally this is exactly what the spec calls for! =P This noticeably improves Tom's Diner at low bitrates (I tested at 64kbps, with mid/side disabled). Patch by: Nathan Caldwell <saintdev@gmail.com> Originally committed as revision 25622 to svn://svn.ffmpeg.org/ffmpeg/trunk
* aacenc: cosmetics: Swap spreading_hi/low name to match the 3GPP spec.Nathan Caldwell2010-11-01
| | | | | | Patch by: Nathan Caldwell <saintdev@gmail.com> Originally committed as revision 25621 to svn://svn.ffmpeg.org/ffmpeg/trunk
* aacenc: Remove energy 'normalization' modification from the 3GPP psymodelNathan Caldwell2010-10-27
| | | | | | | | | | | | This greatly improves bitrate handling. You will now get within a few kbps of your requested bitrate instead of 20-40kbps higher. There is absolutely no analog to this line in the 3GPP spec, that I can find. patch by Nathan Caldwell saintdev (at) gmail Originally committed as revision 25589 to svn://svn.ffmpeg.org/ffmpeg/trunk