summaryrefslogtreecommitdiff
path: root/libavcodec/tta.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-05
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* tta: convert to new channel layout APIAnton Khirnov2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/tta: Cleanup generically on init failureAndreas Rheinhardt2022-02-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/thread: Don't use ThreadFrame when unnecessaryAndreas Rheinhardt2022-02-09
| | | | | | | | | | | | | | | | | | | | | | | The majority of frame-threaded decoders (mainly the intra-only) need exactly one part of ThreadFrame: The AVFrame. They don't need the owners nor the progress, yet they had to use it because ff_thread_(get|release)_buffer() requires it. This commit changes this and makes these functions work with ordinary AVFrames; the decoders that need the extra fields for progress use ff_thread_(get|release)_ext_buffer() which work exactly as ff_thread_(get|release)_buffer() used to do. This also avoids some unnecessary allocations of progress AVBuffers, namely for H.264 and HEVC film grain frames: These frames are not used for synchronization and therefore don't need a ThreadFrame. Also move the ThreadFrame structure as well as ff_thread_ref_frame() to threadframe.h, the header for frame-threaded decoders with inter-frame dependencies. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/tta: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: set AV_CODEC_CAP_CHANNEL_CONF on decoders which set their own channelsHendrik Leppkes2020-12-10
| | | | | | | | | | | | The decoders in this set either have a fixed channel count, or read it from the bitstream, and thus do not require the channel count as external information. Fixes various regressions since 81503ac58a763a36b1f57264013b1e76acb62b68, which requires a valid channel count for decoders which do not set this capability. Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov2020-04-10
| | | | | | | | | | | | | | | | init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once).
* avformat/matroskadec: avcodec/tta: Set extradata_size to 22Andreas Rheinhardt2019-12-04
| | | | | | | | | | | | | | | Up until c4e0e314, the seek table has been included in the tta extradata, so that the size of said extradata was 22 (the size of a TTA1 header) + 4 * number of frames. The decoder rejected anything below a size of 30 and so the Matroska demuxer exported 30 byte long extradata, of which only 18 were set (it ignores a CRC-32 and simply leaves it at 0). But this is unnecessary since said commit, so reduce the size to 22. Furthermore, replace 30 by 22 in a comment about the extradata size in libavcodec/tta.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/tta: Fix integer overflow in predictionMichael Niedermayer2019-08-29
| | | | | | | | Fixes: signed integer overflow: -395281576 + -1827578048 cannot be represented in type 'int' Fixes: 16038/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5646109705240576 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tta: Limit decoder to 16 channelsMichael Niedermayer2019-07-08
| | | | | | | | | | libtta 2.3 has a limit of 6 channels, so 16 is substantially above the "official" already Fixes: OOM Fixes: 15249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5643988125614080 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tta: Fix undefined shiftMichael Niedermayer2019-06-26
| | | | | | | | Fixes: left shift of negative value -4483 Fixes: 15256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5738691617619968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/tta: Don't try to read more than MIN_CACHE_BITS bitsJames Almer2017-04-07
| | | | | | | This fixes assertion failures introduced in 4fbb56acbe. Reviewed-by: michaelni Reviewed-by: durandal_1707
* Merge commit '4adbb44ad154cec05e87de60bb827a13c0fe87df'James Almer2017-04-06
|\ | | | | | | | | | | | | * commit '4adbb44ad154cec05e87de60bb827a13c0fe87df': tta: avoid undefined shifts Merged-by: James Almer <jamrial@gmail.com>
| * tta: avoid undefined shiftsAnton Khirnov2016-11-25
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * tta: use get_unary() instead of a custom implementationAnton Khirnov2016-11-25
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/ttadsp: cosmeticsJames Almer2016-08-06
| | | | | | | | | | | | | | Clean some header includes and use the same naming scheme as in ttaencdsp Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit 'b668662939de3a02454cfc9ba3e6d10b87527a40'Clément Bœsch2016-06-29
|\| | | | | | | | | | | | | | | | | | | * commit 'b668662939de3a02454cfc9ba3e6d10b87527a40': get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes The merge commit also includes changes for libavcodec/interplayacm.c and libavcodec/truemotion2rt.c Merged-by: Clément Bœsch <clement@stupeflix.com>
| * get_bits: Move BITSTREAM_READER_LE definition before all relevant #includesDiego Biurrun2016-06-07
| | | | | | | | | | | | | | This avoids the danger that get_bits.h might get indirectly #included before BITSTREAM_READER_LE is defined. Also sort headers into canonical order where appropriate.
* | avcodec/tta: Un-break build without threadsMichael Niedermayer2015-10-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: use HAVE_THREADS header guards to silence -Wunused-functionGanesh Ajjanagadde2015-10-04
| | | | | | | | | | | | | | | | | | | | When compiled with --disable-pthreads, e.g http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7, a bunch of -Wunused-functions are reported due to missing header guards around threading related functions. This patch should silence such warnings. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avcodec/tta: Check init_get_bits8() for failureMichael Niedermayer2015-09-04
| | | | | | | | | | | | Fixes: CID1322319 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | 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>
* | avcodec/tta: Use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2014-11-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/tta: fix macro ()Michael Niedermayer2014-06-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/tta: use av_malloc(z)_array()Michael Niedermayer2014-04-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | tta: split off hybrid filter processing as ttadspJames Almer2014-02-13
| | | | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '23a211cbba0b7c9ee694040031b2e5da1be54a00'Michael Niedermayer2013-10-28
|\| | | | | | | | | | | | | | | | | | | | | * commit '23a211cbba0b7c9ee694040031b2e5da1be54a00': lavc: change all decoders to behave consistently with AV_EF_CRCCHECK. Conflicts: libavcodec/avcodec.h libavcodec/tta.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: change all decoders to behave consistently with AV_EF_CRCCHECK.Anton Khirnov2013-10-28
| | | | | | | | | | | | Just crccheck prints a warning, crccheck+explode returns an error. Also document this behavior.
* | Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'Michael Niedermayer2013-10-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2': cosmetics: Group .name and .long_name together in codec/format declarations Conflicts: libavcodec/8svx.c libavcodec/alac.c libavcodec/cljr.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/dpxenc.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/ffv1dec.c libavcodec/flacdec.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/g726.c libavcodec/gif.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopencore-amr.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/libvo-amrwbenc.c libavcodec/libvorbisenc.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/ljpegenc.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpeg4videodec.c libavcodec/msmpeg4dec.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/proresdec_lgpl.c libavcodec/proresenc_kostya.c libavcodec/ra144enc.c libavcodec/rawdec.c libavcodec/rv10.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tta.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/wavpack.c libavcodec/xbmenc.c libavcodec/yop.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun2013-10-03
| |
* | avcodec/tta: use init_get_bits8()Michael Niedermayer2013-08-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc: copy AVCodecContext for threadsPaul B Mahol2013-06-13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavc: add ONLY_IF_THREADS_ENABLED where it is missingPaul B Mahol2013-06-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | ttadec: frame multi-threading supportPaul B Mahol2013-06-05
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | tta: use interger instead of pointer to iterate output samples for 24-bit casePaul B Mahol2013-06-02
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | tta: move GetBitContext out of private contextPaul B Mahol2013-06-02
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | tta: move code that will be shared with encoder to separate filePaul B Mahol2013-06-02
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | tta: use get_unary()Paul B Mahol2013-06-01
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | tta: stop checking header checksum in extradataPaul B Mahol2013-05-31
| | | | | | | | | | | | It's redundant now as check in done in demuxer instead. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | tta: remove pointless codePaul B Mahol2013-05-30
| | | | | | | | | | Checking seek table crc in decoder is pointless, as seek table is not used in decoder anyway, so also stop storing seek table into extradata.
* | lavc/tta: use init_get_bits8()Paul B Mahol2013-05-29
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'Michael Niedermayer2013-05-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110': vf_aspect: use the name 's' for the pointer to the private context Remove commented-out debug #define cruft Conflicts: libavcodec/4xm.c libavcodec/dvdsubdec.c libavcodec/ituh263dec.c libavcodec/mpeg12.c libavfilter/avfilter.c libavfilter/vf_aspect.c libavfilter/vf_fieldorder.c libavformat/rtmpproto.c Merged-by: Michael Niedermayer <michaelni@gmx.at>