summaryrefslogtreecommitdiff
path: root/libavcodec/atrac3.c
Commit message (Collapse)AuthorAge
* avcodec/atrac3: increase max block align sizePaul B Mahol2020-11-21
| | | | | Fixes decoding of lossy part of advanced lossless atrac3. Regression since f09151fff9c754fbc1d2560adf18b14957f8b181
* avcodec/atrac3: Use least max_depth for get_vlc2()Andreas Rheinhardt2020-10-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/atrac3: Inline constantsAndreas Rheinhardt2020-10-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/atrac3: Don't use too big VLC tablesAndreas Rheinhardt2020-10-27
| | | | | | | | | The longest code of any of the VLC tables used is eight bits long, so using nine bits long VLC tables is wasteful. Furthermore, there are only seven VLC tables used, yet the code up until now made it look like there should be eight. This has been corrected, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/atrac3: Avoid indirection when calling float dsp functionAndreas Rheinhardt2020-09-18
| | | | | | | Do this by only keeping the only function pointer from the AVFloatDSPContext that is needed lateron. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/atrac3: Cleanup generically after init failureAndreas Rheinhardt2020-09-18
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/atrac3: Check for huge block alignsMichael Niedermayer2019-11-20
| | | | | | | | | | | | | The largest documented frame size = block align is 1024 bytes (https://wiki.multimedia.cx/index.php/ATRAC3) Without a limit this can allocate arbitrary memory and trigger OOM Fixes: OOM Fixes: 18337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3_fuzzer-5763861478637568 Fixes: 18556/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3AL_fuzzer-5646183334936576 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/atrac3: Check block_alignMichael Niedermayer2019-09-26
| | | | | | | | | Fixes: Infinite loop Fixes: 17620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3_fuzzer-5086123012915200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/atrac3: Check init_get_bits8() for failureMichael Niedermayer2017-03-30
| | | | | | | | This is more for correctness than actually fixing a missing error path Fixes CID1399967 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/atrac3: Constify a pointer declaration.Carl Eugen Hoyos2017-02-11
| | | | Silences an "assignment discards ‘const’ qualifier" warning.
* avcodec: add ATRAC Advanced Lossless decodersPaul B Mahol2017-02-11
| | | | | | Only lossy part is decoded for now. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/atrac3: Add multichannel joint stereo ATRAC3bnnm2017-02-01
| | | | | | | | | | | | | | | | | | | | | | Multichannel joint stereo simply interleaves stereo pairs (6ch: 2ch + 2ch + 2ch), so each pair is decoded separatedly. *** To test my changes, I converted examples to wav with ffmpeg.exe (old and new), and compared them to see they are byte-exact. Regular 2ch files (JS and normal) were straightforward to test. For multichannel, to check each JS pair is correctly decoded separatedly I did: - manually demux 6ch.msf into 3 pairs and convert them (2ch_1.wav + 2ch_2.wav + 2ch_3.wav) - convert the 6ch.msf file to wav (with my changes) - manually demux the 6ch.wav into 3 pairs (6ch_d1.wav + 6ch_d2.wav + 6ch_d3.wav) - compare each pair (ex. 2ch_3.wav vs 6ch_d3.wav): all pairs are byte-exact. The new code just processes each JS pair separatedly, there are no algorithm changes. It could be improved a bit but I'm not sure about typical styles. I've only seen 6ch .MSF (probably the AT3 spec only supports 2ch audio). Signed-off-by: bnnm <bananaman255@gmail.com>
* avcodec/atrac3: allow 6 channels (non-joint stereo)bnnm2017-01-20
| | | | | | | | Raises max channels to 6 (for non joint-stereo only), there is no difference decoding 1 or N discrete channels. Fixes trac issue #5840 Signed-off-by: bnnm <bananaman255@gmail.com>
* avcodec/atrac3: pass AVCodecContext to av_log if availablePaul B Mahol2016-04-14
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-27
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'ee964145b5d229571e00bf6883a44189d02babe2'Michael Niedermayer2015-02-28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-28
| | | | | | | | | | Those decoders have been switched to float output and so do not use fmtconvert anymore.
* | avcodec/atrac3: Use avpriv_float_dsp_alloc()Michael Niedermayer2014-11-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/atrac3: use av_freep(), do not leave stale pointers in memoryMichael Niedermayer2014-10-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * atrac3: Better name for IMDCT window initializationMaxim Poliakovski2013-10-10
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * atrac3: Remove unused gain compensation tablesMaxim Poliakovski2013-10-10
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/atrac3: Use av_mallocz_array()Michael Niedermayer2014-05-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | atrac3: Better name for imdct window initializationMaxim Poliakovski2013-10-10
| | | | | | | | | | | | Patch by Diego Biurrun. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | atrac3: Remove unused gain compensation tablesMaxim Poliakovski2013-10-10
| | | | | | | | | | | | Patch by Diego Biurrun. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-03
|\| | | | | | | | | | | | | | | | | | | | | | | * qatar/master: atrac3: Generalize gain compensation code Conflicts: libavcodec/atrac.c libavcodec/atrac.h libavcodec/atrac3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * atrac3: Generalize gain compensation codeMaxim Poliakovski2013-10-03
| | | | | | | | | | | | Move it to the ATRAC common code, to reuse in the upcoming ATRAC3+ decoder. Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * Use correct Doxygen syntaxDiego Biurrun2013-10-03
| |
* | Merge commit 'be0b4c70ec40d7f9ac8e416a4379d4a387421184'Michael Niedermayer2013-10-03
|\| | | | | | | | | | | | | | | | | | | * commit 'be0b4c70ec40d7f9ac8e416a4379d4a387421184': atrac3: Replace a silly counter variable name with plain 'j' Conflicts: libavcodec/atrac3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * atrac3: Replace a silly counter variable name with plain 'j'Diego Biurrun2013-10-03
| |
* | atrac3: Generalize gain compensation codeMaxim Poliakovski2013-10-02
| | | | | | | | | | | | | | Move it to the ATRAC common code, so it can be reused in the umpcoming ATRAC3+ decoder. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | atrac3/decode_gain_control: cosmeticsMaxim Poliakovski2013-10-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | atrac3: rename num_gain_data to num_pointsMaxim Poliakovski2013-10-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | atrac3: Rename GainInfo to AtracGainInfoMaxim Poliakovski2013-10-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '7df9e693a34c84c698da60426c78140c950f95ed'Michael Niedermayer2013-09-03
|\| | | | | | | | | | | | | * commit '7df9e693a34c84c698da60426c78140c950f95ed': cosmetics: Fix ATRAC codec name spelling Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Fix ATRAC codec name spellingDiego Biurrun2013-09-02
| |
* | Merge commit 'bbf6a4aa20bfe3d7869b2218e66063602dfb8aa7'Michael Niedermayer2013-07-10
|\| | | | | | | | | | | | | | | | | | | * commit 'bbf6a4aa20bfe3d7869b2218e66063602dfb8aa7': imc: Catch a division by zero atrac3: Error on impossible encoding/channel combinations See: 13451f5520ce6b0afde861b2285dda659f8d4fb4 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * atrac3: Error on impossible encoding/channel combinationsLuca Barbato2013-07-09
| | | | | | | | | | | | | | Joint stereo encoded mono is impossible. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
| * atrac3: set the getbits context the right buffer_endLuca Barbato2013-07-09
| | | | | | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
| * atrac3: fix error handlingLuca Barbato2013-07-09
| | | | | | | | | | | | | | decode_tonal_components returns a proper AVERROR. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* | atrac3: fix error handlingLuca Barbato2013-07-10
| | | | | | | | | | | | | | decode_tonal_components returns a proper AVERROR. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind 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
| |
* | Merge commit 'ca6c3f2c53be70aa3c38e8f1292809db89ea1ba6'Michael Niedermayer2013-03-16
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'ca6c3f2c53be70aa3c38e8f1292809db89ea1ba6': lzo: fix overflow checking in copy_backptr() flacdec: simplify bounds checking in flac_probe() atrac3: avoid oversized shifting in decode_bytes() Conflicts: libavformat/flacdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>