summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
Commit message (Collapse)AuthorAge
...
| * hevcdec: move the MD5 context out of HEVCSEIPictureHash back into HEVCContextAnton Khirnov2017-05-20
| | | | | | | | | | | | | | 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-09
| | | | | | | | | | | | | | | | | | | | 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-29
| | | | | | | | | | | | | | | | | | | | | | | | 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-31
| |
| * hevc: Mark as having threadsafe initDerek Buitenhuis2017-01-19
| | | | | | | | | | 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-12
| |
| * hevcdec: add P010 support for D3D11VASteve Lhomme2017-01-09
| | | | | | | | | | | | | | 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-19
| | | | | | | | | | 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-28
| | | | | | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* | 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>
* | avcodec/hevcdec: hevc_await_progress: declare |y| only if used.Wan-Teh Chang2017-07-21
| | | | | | | | | | | | | | | | 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-05
| | | | | | | | | | | | | | | | | | 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>
* | hevcdec: properly export some side data with frame threadingwm42017-06-30
| | | | | | | | | | | | | | | | | | | | | | I noticed this with mastering display data. If frame threading is enabled, this side data is exported only for some frames. It turns out it's not properly propagated to the worker threads. I didn't touch A53 captions, because that involves memory allocation and freeing the data as side data is exported. Micro bump so that API users can detect the bug fix.
* | hevc: Add support for alternative transfer characterics SEIVittorio Giovara2017-06-28
| | | | | | | | | | | | | | | | | | | | 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>
* | avcodec/hevcdec: do basic validity check on delta_chroma_weight and offsetMichael Niedermayer2017-06-27
| | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 2147483520 + 128 cannot be represented in type 'int' Fixes: 2385/clusterfuzz-testcase-minimized-6594333576790016 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dxva: add support for new dxva2 and d3d11 hwaccel APIswm42017-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Merges Libav commit f9e7a2f95a7194a8736cc1416a03a1a0155a3e9f. Also adds untested VP9 support. The check for DXVA2 COBJs is removed. Just update your MinGW to something newer than a 5 year old release. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/hevcdec: Do not check the first ff_init_cabac_decoder() call in ↵Michael Niedermayer2017-06-25
| | | | | | | | | | | | | | | | | | | | | | hls_decode_entry_wpp() for failure The result of the call is not used in any testcase but breaks some cases if its failure is considered. Fixes regression found by jamrial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/hevcdec: Use error path if init_get_bits8() failsMichael Niedermayer2017-06-24
| | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/hevcdec: check ff_init_cabac_decoder() for failureMichael Niedermayer2017-06-24
| | | | | | | | | | | | | | | | | | Fixes: runtime error: left shift of 1965559808 by 4 places cannot be represented in type 'int' Fixes: 2333/clusterfuzz-testcase-minimized-5223935677300736 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/hevcdec: Check beta and tc offset in hls_slice_header()Michael Niedermayer2017-06-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/hevcdec: Fix signed integer overflow in decode_lt_rps()Michael Niedermayer2017-06-17
| | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 2147483647 + 6 cannot be represented in type 'int' Fixes: 2263/clusterfuzz-testcase-minimized-4800359627227136 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: Check nb_spsMichael Niedermayer2017-06-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/hevcdec: export cropping information instead of handling it internallyJames Almer2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This merges commit a02ae1c6837a54ed9e7735da2b1f789b2f4b6e13 from libav, originally written by Anton Khirnov and skipped in fc63d5ceb357c4b760cb02772de0b50d0557140f. libavcodec/hevc_parser.c | 6 ++++-- libavcodec/hevc_ps.c | 31 ++++++++++++------------------- libavcodec/hevc_ps.h | 2 -- libavcodec/hevc_refs.c | 18 +++++------------- libavcodec/hevcdec.c | 7 ++++--- libavcodec/hevcdec.h | 2 -- 6 files changed, 25 insertions(+), 41 deletions(-) Signed-off-by: James Almer <jamrial@gmail.com>
* | hevc: fix race condition in max_ra/seq_decode.Ronald S. Bultje2017-05-25
| | | | | | | | | | | | | | | | | | | | These variables are shared between frame threads, but they are updated post-setup_finished() if a EOB/EOS slice type occurs. Moving the EOB/EOS slices to the next frame thread instance (by parsing them leading into the next picture instead of trailing behind the last picture) effectively prevents this race condition. This fixes tsan failures on hevc-conformance-NoOutPrior_A_Qualcomm_1.
* | avcodec/hevc_parse: decode SEI message NALUs in extradataJames Almer2017-05-05
| | | | | | | | | | | | | | | | | | | | They may be available in hvcc style extradata. Based on a patch by Hendrik Leppkes. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Aaron Levinson <alevinsn@aracnet.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/hevcdec: remove HEVCContext usage from ff_hevc_compute_poc()James Almer2017-05-05
| | | | | | | | | | | | | | | | Move it to hevc_ps as well. This is in preparation for a following patch. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Aaron Levinson <alevinsn@aracnet.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/hevcdec: remove HEVCContext usage from hevc_seiJames Almer2017-05-05
| | | | | | | | | | | | | | | | Based on the H264 SEI implementation. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Aaron Levinson <alevinsn@aracnet.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | lavc/hevcdec: fix invalid use of ff_get_format()Clément Bœsch2017-04-26
| | | | | | | | | | | | Regression since 76cc100afba25308eaa909acd8804cc0b42057f6. Spotted-by: James Almer <jamrial@gmail.com>
* | Merge commit '373fd76b4dbd9aa03ed28e502f33f2ca8c1ce19a'Clément Bœsch2017-04-26
|\| | | | | | | | | | | | | * commit '373fd76b4dbd9aa03ed28e502f33f2ca8c1ce19a': hevcdec: do not set decoder-global SPS prematurely Merged-by: Clément Bœsch <u@pkh.me>
| * hevcdec: do not set decoder-global SPS prematurelyAnton Khirnov2016-12-19
| | | | | | | | | | | | | | | | It should only be set after the decoder state has been fully initialized for using that SPS. Fixes possible invalid reads on get_format() failure. CC: libav-stable@libav.org
* | Merge commit '86157e6db2c7a9222f77fa7e7f50fb9aebc3aa81'Clément Bœsch2017-04-26
|\| | | | | | | | | | | | | | | | | | | | | * commit '86157e6db2c7a9222f77fa7e7f50fb9aebc3aa81': hevc: decouple calling get_format() from exporting the SPS parameters See 786032cad8ecabe577d9cff0356da6e9e9488a2d (which has been reverted and replaced with Anton's version to reduce diffs between the two projects). Merged-by: Clément Bœsch <u@pkh.me>
| * hevc: decouple calling get_format() from exporting the SPS parametersAnton Khirnov2016-12-14
| | | | | | | | | | This makes sure ff_get_format() does not get called unnecessarily from update_thread_context().
| * hevc: Eliminate pointless variable indirectionDiego Biurrun2016-11-30
| |
| * hevc: Support extradata changes from multiple stsdVittorio Giovara2016-11-08
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * hevc: Allow parsing external extradata buffersVittorio Giovara2016-11-08
| |
| * hevc: Move hevc_decode_extradata before frame decodingVittorio Giovara2016-11-08
| | | | | | | | | | | | Avoids a forward-declaration in the following commit. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * hevc: factor out a repeated conditionAnton Khirnov2016-10-21
| |
* | avcodec/hevcdec: remove duplicate extradata parsing functionJames Almer2017-04-09
| | | | | | | | | | | | | | | | | | Use ff_hevc_decode_extradata() instead, which correctly only tries to decode parameter set NAL units and not any other NAL that may be present in extradata. Reviewed-by: nevcairiel Signed-off-by: James Almer <jamrial@gmail.com>
* | lavc: Add Content Light Level side metadata found in HEVCSteve Lhomme2017-04-06
| | | | | | | | | | | | These data are necessary when transmitting HDR over HDMI. Signed-off-by: James Almer <jamrial@gmail.com>
* | hevc: only write to max_ra and pocTid0 in the first slice.Ronald S. Bultje2017-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Values from subsequent values are guaranteed to be identical (since poc and nal_unit_type are checked to be the same between slices), so this doesn't affect output in any way, but does resolve the remaining reported race conditions (by tsan) in fate-hevc. In practice, this fixes tsan warnings like this: WARNING: ThreadSanitizer: data race (pid=25334) Read of size 4 at 0x7d9c0001adcc by main thread (mutexes: write M1386): #0 hevc_update_thread_context src/libavcodec/hevcdec.c:3310 (ffmpeg+0x000000b41c7c) [..] Previous write of size 4 at 0x7d9c0001adcc by thread T1 (mutexes: write M1383): #0 hls_slice_header src/libavcodec/hevcdec.c:596 (ffmpeg+0x000000b43a22)
* | hevc: initialize no_rasl_output_flag in hevc_frame_start().Ronald S. Bultje2017-03-28
| | | | | | | | This prevents a race condition in files with multiple slices per frame.
* | Merge commit '0bfdcce4d42a6e654c00ea5f9237dc987626457f'James Almer2017-03-23
|\| | | | | | | | | | | | | * commit '0bfdcce4d42a6e654c00ea5f9237dc987626457f': hevc: move the SliceType enum to hevc.h Merged-by: James Almer <jamrial@gmail.com>
| * hevc: move the SliceType enum to hevc.hAnton Khirnov2016-10-21
| | | | | | | | | | Those values are decoder-independent and are also use by the VA-API encoder.
* | Merge commit 'f6e2f8a9ffda2247bffba991450990d075ea68e3'James Almer2017-03-23
|\| | | | | | | | | | | | | * commit 'f6e2f8a9ffda2247bffba991450990d075ea68e3': hevcdec: move parameter set parsing into a separate header Merged-by: James Almer <jamrial@gmail.com>
| * hevcdec: move parameter set parsing into a separate headerAnton Khirnov2016-10-16
| | | | | | | | | | This code is independent from the decoder, so it makes more sense for it to to have its own header.
* | Merge commit '150c896a9e46b23b97debb0a5f66fbaeaa32f153'James Almer2017-03-23
|\| | | | | | | | | | | | | * commit '150c896a9e46b23b97debb0a5f66fbaeaa32f153': hevcdec: split ff_hevc_diag_scan* declarations into a separate header Merged-by: James Almer <jamrial@gmail.com>
| * hevcdec: split ff_hevc_diag_scan* declarations into a separate headerAnton Khirnov2016-10-16
| | | | | | | | This will be useful in the following commits.
* | Merge commit 'c359d624d3efc3fd1d83210d78c4152bd329b765'James Almer2017-03-23
|\| | | | | | | | | | | | | * commit 'c359d624d3efc3fd1d83210d78c4152bd329b765': hevcdec: move decoder-independent declarations into a separate header Merged-by: James Almer <jamrial@gmail.com>
| * hevcdec: move decoder-independent declarations into a separate headerAnton Khirnov2016-10-16
| | | | | | | | | | | | | | This way they can be reused by other code without including the whole decoder-specific hevcdec.h Also, add the HEVC_ prefix to them, since similarly named values exist for H.264 as well and are sometimes used in the same code.
* | Merge commit '4abe3b049d987420eb891f74a35af2cebbf52144'Clément Bœsch2017-03-23
|/ | | | | | | * commit '4abe3b049d987420eb891f74a35af2cebbf52144': hevc: rename hevc.[ch] to hevcdec.[ch] Merged-by: Clément Bœsch <u@pkh.me>