summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/hevcdec: Check s->ref in the md5 path similar to hwaccelMichael Niedermayer2022-09-261-1/+1
| | | | | | | | | | | | | This is somewhat redundant with the is_decoded check. Maybe there is a nicer solution Fixes: Null pointer dereference Fixes: 49584/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5297367351427072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3b51e1992289383aa9f083c88e153e34b6412c89) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: Check slice_cb_qp_offset / slice_cr_qp_offsetMichael Niedermayer2021-02-021-0/+5
| | | | | | | | | | Fixes: signed integer overflow: 29 + 2147483640 cannot be represented in type 'int' Fixes: 25413/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5697909331591168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 106f11f68af643ad1f372b840d38a0a30c6e9bcf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/hevc: Add poc_msb_present filed in LongTermRPSXu Guangxin2020-05-271-3/+2
| | | | | | | | | | delta_poc_msb_present_flag is needed in find_ref_idx() to indicate whether MSB of POC should be taken into account. Details in 8.3.2. Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-261-1/+1
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov2020-04-101-22/+7
| | | | | | | | | | | | | | | | 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).
* lavc: replace AVCodecInternal.allocate_progress with an internal capAnton Khirnov2020-04-101-3/+2
| | | | This is a constant codec property, so a capability flag is more appropriate.
* lavc/hevcdec: add 4:2:2 8-bit/10-bit VAAPI decode supportLinjie Fu2020-02-241-0/+6
| | | | | | Add decode support for 4:2:2 8-bt and 10-bit HEVC Range Extension clips. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc/h2645_parse: Don't automatically remove nuh_layer_id > 0 packetsAndriy Gelman2020-01-171-1/+1
| | | | | | | | | | | | | | | | | | | HEVC standard supports multi-layer streams (ITU-T H.265 02/2018 Annex F). Each NAL unit belongs to a particular layer defined by nuh_layer_id in the header. Currently, all NAL units that do not belong to a base layer are automatically removed in ff_h2645_packet_split(). Some data may therefore be lost when future filters/decoders are designed to support multi-layer streams. A better approach is to forward nuh_layer_id > 0 packets and let blocks down the chain decide how to process them. The condition to remove packets has been moved to hevcdec and cbs. Found-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: keep closed captions in sync between multiple thread contextsJames Almer2019-12-211-0/+7
| | | | | | | Based on h264 code. Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevc_sei: switch to AVBufferRef buffer for a53 captionLimin Wang2019-12-201-8/+8
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: Fix memleak of a53_captionMichael Niedermayer2019-09-161-0/+3
| | | | | | | Fixes: 15295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5675655187922944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: repeat character in skipedMichael Niedermayer2019-09-161-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: Check delta_luma_weight_l0/1Michael Niedermayer2019-08-131-0/+4
| | | | | | | | | Fixes: signed integer overflow: 1 + 2147483647 cannot be represented in type 'int' Fixes: 16041/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5685680656613376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: set the SEI parameters early on the AVCodecContextSteve Lhomme2019-07-141-10/+11
| | | | | | | | | It's better to do it before the buffers are actually created. At least in VLC we currently don't support changing some parameters dynamically easily so we don't use the information if it comes after the buffer are created. Co-authored-by: James Almer <jamrial@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: Declare that VDPAU can handle HEVC 4:4:4 contentManojGuptaBonda2019-05-051-1/+8
| | | | | | The latest generation video decoder on the Turing chips supports decoding HEVC 4:4:4. This change adds AV_PIX_FMT_VDPAU as a valid format for HEVC 4:4:4 8 bit.
* avcodec/hevcdec: Avoid only partly skiping duplicate first slicesMichael Niedermayer2019-03-271-4/+10
| | | | | | | | | | | | Fixes: NULL pointer dereference and out of array access Fixes: 13871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5746167087890432 Fixes: 13845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5650370728034304 This also fixes the return code for explode mode Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: decode at most one slice reporting being the first in the ↵James Almer2019-03-201-0/+4
| | | | | | | | | | picture Fixes deadlocks when decoding packets containing more than one of the aforementioned slices when using frame threads. Tested-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/nvdec: Add support for decoding HEVC 4:4:4 contentPhilip Langdale2019-02-161-0/+3
| | | | | | | | | | | | | The latest generation video decoder on the Turing chips supports decoding HEVC 4:4:4. Supporting this is relatively straight-forward; we need to account for the different chroma format and pick the right output and sw formats at the right times. There was one bug which was the hard-coded assumption that the first chroma plane would be half-height; I fixed this to use the actual shift value on the plane. We also need to pass the SPS and PPS range extension flags.
* h2645_parse: Make ff_h2645_packet_split reference-compatibleAndreas Rheinhardt2019-01-231-1/+1
| | | | | | | This is in preparation for a patch for cbs_h2645. Now the packet's rbsp_buffer can be owned by an AVBuffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
* avcodec/hevcdec: Check for overlapping slicesMichael Niedermayer2018-12-011-0/+4
| | | | | | | | Fixes: Timeout Fixes: 10108/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6222384351674368 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.Jun Zhao2018-08-101-2/+6
| | | | | | | add ONLY_IF_THREADS_ENABLED where it is missing. Signed-off-by: Jun Zhao <mypopydev@gmail.com> Reviewed-by: James Almer <jamrial@gmail.com>
* lavc/hevcdec: Treat clean random access nals as keyframes for -skip_frame.Carl Eugen Hoyos2018-05-271-1/+1
| | | | | | Fixes ticket #7227. Reviewed-by: Mark Thompson
* avcodec/hevcdec: Declare that nvdec supports 12bit decodingPhilip Langdale2018-03-021-0/+5
|
* avcodec/hevcdec: Check luma/chroma_log2_weight_denomMichael Niedermayer2018-02-181-3/+9
| | | | | | | | Fixes: signed integer overflow: 3 + 2147483647 cannot be represented in type 'int' Fixes: 5888/clusterfuzz-testcase-minimized-5634701067812864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: use ff_hevc_uninit_parameter_sets()James Almer2018-01-211-9/+1
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/hevcdec: implement skip_framesfan52017-12-201-1/+15
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa'James Almer2017-11-291-0/+7
|\ | | | | | | | | | | | | * commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa': stereo3d: Support view type for frame sequence type Merged-by: James Almer <jamrial@gmail.com>
| * stereo3d: Support view type for frame sequence typeVittorio Giovara2017-11-281-0/+7
| | | | | | | | | | | | Implement detection in h264 and hevc and insertion in framepack filter. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavc: Add hardware config metadata for decoders supporting hardware outputMark Thompson2017-11-261-0/+25
| | | | | | | | | | | | | | | | | | This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
* | avcodec/hevc: implement new decode_params callback for VideoToolboxAman Gupta2017-11-131-0/+32
| | | | | | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* | Merge commit 'b90fdb2c7199cc8b0e8d994fafba1fb4dc181d88'James Almer2017-11-101-0/+7
|\ \ | |/ | | | | | | | | | | | | | | * commit 'b90fdb2c7199cc8b0e8d994fafba1fb4dc181d88': hevcdec: add a CUVID hwaccel Adapted for ffmpeg by Timo Rothenpieler. Merged-by: James Almer <jamrial@gmail.com>
| * hevcdec: add a CUVID hwaccelAnton Khirnov2017-07-281-1/+8
| |
* | Merge commit '00fd914d4912322212e924c15f325cebf2fde8d3'James Almer2017-11-101-4/+5
|\ \ | |/ | | | | | | | | | | * commit '00fd914d4912322212e924c15f325cebf2fde8d3': hevcdec: set the active SPS before calling get_format() Merged-by: James Almer <jamrial@gmail.com>
| * hevcdec: set the active SPS before calling get_format()Anton Khirnov2017-07-281-4/+5
| | | | | | | | This way the SPS is available to the hwaccel init code.
| * hevc: Make sure to update the current frame transfer characteristicVittorio Giovara2017-07-211-1/+1
| | | | | | | | | | | | | | Otherwise the first decoded frame will still be tagged with the original transfer instead of the alternative one. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * hevc: Add support for alternative transfer characterics SEIVittorio Giovara2017-06-281-0/+6
| | | | | | | | | | | | | | | | | | | | The use of this SEI is for backward compatibility in HLG HDR systems: older devices that cannot interpret the "arib-std-b67" transfer will get the compatible transfer (usually bt709 or bt2020) from the VUI, while newer devices that can interpret HDR will read the SEI and use its value instead. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * dxva: add support for new dxva2 and d3d11 hwaccel APIswm42017-06-081-1/+2
| | | | | | | | | | | | | | | | | | | | This also adds support to avconv (which is trivial due to the new hwaccel API being generic enough). The new decoder setup code in dxva2.c is significantly based on work by Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'c3f0357bdf7d3c542aad2c58b94184b9f56edc41'James Almer2017-10-311-6/+6
|\ \ | |/ | | | | | | | | | | * commit 'c3f0357bdf7d3c542aad2c58b94184b9f56edc41': hevcdec: move the MD5 context out of HEVCSEIPictureHash back into HEVCContext Merged-by: James Almer <jamrial@gmail.com>
| * hevcdec: move the MD5 context out of HEVCSEIPictureHash back into HEVCContextAnton Khirnov2017-05-201-6/+6
| | | | | | | | | | | | | | HEVCSEIPictureHash should store only the information extracted from the bitstream and exported to the higher layer (the decoder or the parser). The MD5 context is allocated, used and freed by this higher layer, so it makes more sense for it to also be stored there.
| * hevcdec: remove HEVCContext usage from hevc_seiJames Almer2017-05-091-23/+26
| | | | | | | | | | | | | | | | | | | | Based on the H264 SEI implementation. This will be mainly useful once support for SEI messages that can be used by the hevc parser are implemented, like Picture Timing. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * hevcdec: Use LOCAL_ALIGNED_* for declaring local variables with alignmentMartin Storsjö2017-03-291-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | Not all compilers can do alignment larger than the normal stack alignment for variables on the stack. In these cases, the LOCAL_ALIGNED_* macros produce the workaround alignment wrapper consisting of a padded array and a pointer variable. This fixes the hevc fate tests on RVCT/ARMCC after adding IDCT assembly that actually assumes/relies on this alignment. Signed-off-by: Martin Storsjö <martin@martin.st>
| * golomb: Convert to the new bitstream readerDiego Biurrun2017-01-311-1/+1
| |
| * hevc: Mark as having threadsafe initDerek Buitenhuis2017-01-191-1/+1
| | | | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * hevcdec: export cropping information instead of handling it internallyAnton Khirnov2017-01-121-3/+4
| |
| * hevcdec: add P010 support for D3D11VASteve Lhomme2017-01-091-3/+3
| | | | | | | | | | | | | | Given it's the same API than DVXA2 I don't know why the same output was not enabled for both. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * hevcdec: add a VAAPI hwaccelAnton Khirnov2016-12-191-1/+5
| | | | | | | | | | Partially based on a patch by Timo Rothenpieler <timo@rothenpieler.org>. Additional scaling list handling fix by Jun Zhao <mypopydev@gmail.com>.
* | avcodec/videotoolbox: add hevc supportAman Gupta2017-09-281-1/+11
| | | | | | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* | hevc: Make sure to update the current frame transfer characteristicVittorio Giovara2017-07-211-1/+1
| | | | | | | | | | | | | | Otherwise the first decoded frame will still be tagged with the original transfer instead of the alternative one. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/hevcdec: hevc_await_progress: declare |y| only if used.Wan-Teh Chang2017-07-211-2/+3
| | | | | | | | | | | | | | | | hevc_await_progress() uses the variable |y| only inside the "if" block. So |y| only needs to be declared and initialized in that block. Signed-off-by: Wan-Teh Chang <wtc@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/hevcdec: do not let updated extradata corrupt stateMichael Niedermayer2017-07-051-4/+4
| | | | | | | | | | | | | | | | | | Fixes: out of array access Fixes: 2451/clusterfuzz-testcase-minimized-4781613957251072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>