summaryrefslogtreecommitdiff
path: root/libavcodec/hapdec.c
Commit message (Collapse)AuthorAge
* avcodec: use the new AVFrame key_frame flag in all decoders and encodersJames Almer2023-05-04
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-03
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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/hapdec: use the common texturedsp decode functionMarton Balint2022-04-10
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* 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>
* 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>
* avcodec/hapdec: Remove always-false checkAndreas Rheinhardt2022-02-09
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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/hapdec: Change compressed_offset to unsigned 32bitMichael Niedermayer2021-02-20
| | | | | | | | | | | Fixes: out of array access Fixes: 29345/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5401813482340352 Fixes: 30745/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5762798221131776 Suggested-by: Anton 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/hapdec: Check tex_size more strictly and before using itMichael Niedermayer2020-05-10
| | | | | | | | | Fixes: OOM Fixes: 20774/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5678608951803904 Fixes: 20956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5713643025203200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hapdec: Add codec_tags listMichael Niedermayer2020-01-22
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hap : move parse_section_header to hap.c in order to be use by new ↵Martin Vignali2018-03-13
| | | | bsf filter
* avcodec/hapdec : use gray8 for HapAlphaOnly decoding instead of RGB0Martin Vignali2017-11-25
|
* avcodec/hapdec : add support for hapqa decodingMartin Vignali2017-11-21
|
* avcodec/hapdec : indent after previous commitMartin Vignali2017-11-21
|
* avcodec/hapdec : reorganize code before adding multi-texture decodingMartin Vignali2017-11-21
|
* libavcodec/hapdec : add support HapAlphaOnlyMartin Vignali2017-09-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hap: consistent name for codecTom Butterworth2016-11-04
| | | | | | | "Vidvox Hap", not "Vidvox Hap encoder" or "Vidvox Hap decoder". Fixes bad name in "ffmpeg -codecs", matches other codec naming. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* hapdec: remove unused memory.h includeJosh de Kock2016-07-29
| | | | | | Most systems have this, so it isn't really a problem to include it even if it's not used, but some do not have memory.h as it is non-standard. Since it's unused just remove it anyway.
* lavc/hapdec: Use correct no-transparency colour space.Carl Eugen Hoyos2015-10-24
| | | | Reviewed-by: Tom Butterworth
* avcodec/hapdec: Check section_size for non negativity in parse_section_header()Michael Niedermayer2015-09-05
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '3ee217853a6741b829a2683f49c590618891b1ab'Michael Niedermayer2015-07-27
|\ | | | | | | | | | | | | | | | | | | | | | | | | * commit '3ee217853a6741b829a2683f49c590618891b1ab': Support the Hap chunked frame format Conflicts: libavcodec/hap.h libavcodec/hapdec.c libavcodec/version.h See: c7e6443441ed5c1b5f64067dfbf4956bc2c6acbb Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * Support the Hap chunked frame formatTom Butterworth2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '43dd004747fa697396b47d034a80e069facbea09'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | * commit '43dd004747fa697396b47d034a80e069facbea09': hap: Move some per-stream setup into decoder init rather than per-frame Conflicts: libavcodec/hapdec.c See: 6074956fa1d2617ac602e49931b06df0a751370e Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * hap: Move some per-stream setup into decoder init rather than per-frameTom Butterworth2015-07-27
| | | | | | | | | | | | | | This change will reject frames with a texture type which does not match the stream description. 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>
| * snappy: Refactor so ff_snappy_uncompress() uses an existing bufferTom Butterworth2015-07-23
| | | | | | | | | | | | Some uses of Snappy require uncompressing to positions within an existing buffer. Also adds a function to get the uncompressed length of Snappy data.
* | avcodec/hapdec: Check that there is sufficient input dataMichael Niedermayer2015-07-24
| | | | | | | | | | | | | | Fixes Ticket4729 Found-by: ami_stuff Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'ae5a8dca675ee544178225256893e679b750cb63'Michael Niedermayer2015-07-23
|\| | | | | | | | | | | | | | | | | | | * commit 'ae5a8dca675ee544178225256893e679b750cb63': hap: Fix slice size computation Conflicts: libavcodec/hapdec.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * hap: Fix slice size computationTom Butterworth2015-07-23
| | | | | | | | | | | | | | | | A bug was introduced in 977105407cae55876041dddbf4ce0934cdd4cd6c whereby when frame height wasn't divisible by the number of threads, pixels would be omitted from the bottom rows during decode. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Support the Hap chunked frame formatTom Butterworth2015-07-22
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '977105407cae55876041dddbf4ce0934cdd4cd6c'Michael Niedermayer2015-07-21
|\| | | | | | | | | | | | | * commit '977105407cae55876041dddbf4ce0934cdd4cd6c': hap: Decode using optimal slices sizes Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * hap: Decode using optimal slices sizesLuca Barbato2015-07-21
| | | | | | | | | | | | | | Enjoy some cache locality and use less threads. About 5x speedup (from 60ms to 12ms to decode a 4k frame). Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec/hapdec: log reason for failure when texture type doesn't match streamTom Butterworth2015-07-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/hapdec: don't log texture format every frame, do it once per decode ↵Tom Butterworth2015-07-21
| | | | | | | | | | | | session Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/snappy: refactor so ff_snappy_uncompress uses an existing bufferTom Butterworth2015-07-16
| | | | | | | | | | | | Some uses of Snappy require uncompressing to positions within an existing buffer. Also adds a function to get the uncompressed length of Snappy data. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/hap: move some per-stream setup into decoder init rather than per-frameTom Butterworth2015-07-16
| | | | | | | | | | | | This change will reject frames with a texture type which doesn't match the stream description. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/hapenc: Silence a warning for multithreaded encoding.Carl Eugen Hoyos2015-06-30
| |
* | Merge commit '7ca3e5203f133eb41a0b5c3a1d753a7427ba72e7'Michael Niedermayer2015-06-22
|/ | | | | | | | | | | | | | * commit '7ca3e5203f133eb41a0b5c3a1d753a7427ba72e7': Hap decoder and encoder Conflicts: Changelog configure doc/general.texi libavcodec/allcodecs.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Hap decoder and encoderVittorio Giovara2015-06-22
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>