summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
Commit message (Collapse)AuthorAge
* avcodec/hevcdec: fix a return error valueJames Almer2021-02-12
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: add some missing allocation checksJames Almer2021-02-11
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: check that the local context list was allocated before ↵James Almer2021-02-11
| | | | | | | | | | | | | | | | | | | dereferencing it Since the decoder is not flagged as init cleanup capable, hevc_decode_free() is being called manually if the hevc_decode_extradata() call fails at the end of hevc_decode_init(). In a frame threading scenario, however, if AVCodec->init() returns an error, ff_frame_thread_free() will be called regardless of the above flag being set or not, resulting in hevc_decode_free() being called a second time for the same context. Workaround this by ensuring pointers are not dereferenced if they are NULL, and set the decoder as init cleanup capable while at it. Fixes ticket #9099. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: fix stat_coeff save/load for ↵Xu Guangxin2021-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | persistent_rice_adaptation_enabled_flag It's required by the 9.3.1 TableStatCoeff* section. Following clips have this feature: WPP_HIGH_TP_444_8BIT_RExt_Apple_2.bit Bitdepth_A_RExt_Sony_1.bin Bitdepth_B_RExt_Sony_1.bin EXTPREC_HIGHTHROUGHPUT_444_16_INTRA_10BIT_RExt_Sony_1.bit EXTPREC_HIGHTHROUGHPUT_444_16_INTRA_12BIT_RExt_Sony_1.bit EXTPREC_HIGHTHROUGHPUT_444_16_INTRA_8BIT_RExt_Sony_1.bit EXTPREC_MAIN_444_16_INTRA_10BIT_RExt_Sony_1.bit EXTPREC_MAIN_444_16_INTRA_12BIT_RExt_Sony_1.bit EXTPREC_MAIN_444_16_INTRA_8BIT_RExt_Sony_1.bit WPP_AND_TILE_10Bit422Test_HIGH_TP_444_10BIT_RExt_Apple_2.bit WPP_AND_TILE_AND_CABAC_BYPASS_ALIGN_0_HIGH_TP_444_14BIT_RExt_Apple_2.bit WPP_AND_TILE_AND_CABAC_BYPASS_ALIGN_1_HIGH_TP_444_14BIT_RExt_Apple_2.bit WPP_AND_TILE_HIGH_TP_444_8BIT_RExt_Apple_2.bit you can download them from: https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/RExt/ Signed-off-by: Xu Guangxin <oddstone@gmail.com> Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
* Mark some pointers as constAndreas Rheinhardt2021-01-01
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hevcdec: dynamic allocate sList and HEVClcListNuo Mi2020-12-10
| | | | | | | | | following comandline will crash the ffmpeg ffmpeg -threads 17 -thread_type slice -i WPP_A_ericsson_MAIN_2.bit out.yuv -y the HEVCContext->sList size is MAX_NB_THREADS(16), any > 16 thread number will crash the application Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec/hevc_sei: add support for HDR10+ metadataMohammad Izadi2020-12-05
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: Check slice_cb_qp_offset / slice_cr_qp_offsetMichael Niedermayer2020-10-15
| | | | | | | | 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>
* hevcdec: use av_buffer_replace() to simplify codeAnton Khirnov2020-09-28
|
* avcodec/hevcdec: sync User Data Unregistered SEI buffers across threadsJames Almer2020-09-23
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: sync SEI derived AVCodecContext fields across threadsJames Almer2020-09-23
| | | | | | | Fixes ticket #8610. Found-by: Pavel Koshevoy <pkoshevoy@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: use av_timecode_make_smpte_tc_string2 in hevc and h264 decoderMarton Balint2020-09-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/hevcdec: Add VDPAU to list of supported formatsManojGuptaBonda2020-07-09
| | | | | | | | | | | | | | Added VDPAU to list of supported formats for HEVC10 and 12 bit formats also added 42010 bit to surface_parameters and new VDP chroma formats to VDPAUPixFmtMaps Add HEVC 420 10/12 Bit and 444 10/12 Bit support for VDPAU YUV444P10 is defined as the 444 surface with 10bit valid data in LSBs but H/w returns Data in MSBs Hence if we map output as YUV444p16 it is filtering out the LSB to convert to p10 format. Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/hevcdec: add timecode metadataLimin Wang2020-07-09
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/hevcdec: create AVFrame side data from HEVC timecodes like H.264Limin Wang2020-06-28
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/hevc: export chroma sample locationHendrik Leppkes2020-06-24
|
* avcodec/hevc_sei: add support for user data unregistered SEI messageLimin Wang2020-06-15
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavc/hevc: Add poc_msb_present filed in LongTermRPSXu Guangxin2020-05-27
| | | | | | | | | | 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-26
| | | | | 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-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).
* lavc: replace AVCodecInternal.allocate_progress with an internal capAnton Khirnov2020-04-10
| | | | 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-24
| | | | | | 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-17
| | | | | | | | | | | | | | | | | | | 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-21
| | | | | | | 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-20
| | | | | 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-16
| | | | | | | 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-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevcdec: Check delta_luma_weight_l0/1Michael Niedermayer2019-08-13
| | | | | | | | | 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-14
| | | | | | | | | 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-05
| | | | | | 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-27
| | | | | | | | | | | | 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-20
| | | | | | | | | | 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-16
| | | | | | | | | | | | | 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-23
| | | | | | | 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-01
| | | | | | | | 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-10
| | | | | | | 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-27
| | | | | | Fixes ticket #7227. Reviewed-by: Mark Thompson
* avcodec/hevcdec: Declare that nvdec supports 12bit decodingPhilip Langdale2018-03-02
|
* avcodec/hevcdec: Check luma/chroma_log2_weight_denomMichael Niedermayer2018-02-18
| | | | | | | | 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-21
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/hevcdec: implement skip_framesfan52017-12-20
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa'James Almer2017-11-29
|\ | | | | | | | | | | | | * 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-28
| | | | | | | | | | | | 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-26
| | | | | | | | | | | | | | | | | | 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-13
| | | | | | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* | Merge commit 'b90fdb2c7199cc8b0e8d994fafba1fb4dc181d88'James Almer2017-11-10
|\| | | | | | | | | | | | | | | | | * 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-28
| |
* | Merge commit '00fd914d4912322212e924c15f325cebf2fde8d3'James Almer2017-11-10
|\| | | | | | | | | | | | | * 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-28
| | | | | | | | This way the SPS is available to the hwaccel init code.
| * hevc: Make sure to update the current frame transfer characteristicVittorio Giovara2017-07-21
| | | | | | | | | | | | | | 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>