summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_h265_syntax_template.c
Commit message (Collapse)AuthorAge
* avcodec/cbs_h265: support general_profile_idc 11James Almer2021-09-22
| | | | | | | And fix support for general_profile_idc 9 and 10. Defined in ITU-T H.265 (V6). Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265_syntax_template: Limit ↵Michael Niedermayer2021-09-21
| | | | | | | | | | | sps_num_palette_predictor_initializer_minus1 to 127 Fixes: index 128 out of bounds for type 'uint16_t [128]' Fixes: 38651/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6296416058736640 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>
* cbs_h265: add support for Film Grain Characteristics SEI messageJames Almer2021-08-06
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_h265: Detect more reference combinations which would overflow the DPBMark Thompson2021-03-12
| | | | | | | | | | | | | | | | | | | | | In total, the number of short term references (from the selected short term ref pic set), the number of long term references (combining both the used candidates from the SPS and those defined in the slice header) and the number of instances of the current picture (usually one, but can be two if current picture reference is enabled) must never exceed the size of the DPB. This is a generalisation of the condition associated with num_long_term_pics in 7.4.7.1. We use this to apply tighter bounds to the number of long term pictures referred to in the slice header, and also to detect the invalid case where the second reference to the current picture would not fit in the DPB (this case can't be detected earlier because an STRPS with 15 pictures can still be valid in the same stream when used with a different PPS which does not require two DPB slots for the current picture). Fixes: 24913/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6261760693370880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Tested-by: Michael Niedermayer <michael@niedermayer.cc>
* cbs_h2645: Merge SEI message handling in common between codecsMark Thompson2021-01-21
|
* hevc: Use common SEI typesMark Thompson2021-01-21
|
* cbs_h2645: Merge SEI messages in common between codecsMark Thompson2021-01-21
| | | | | Make a new template file for common SEI messages - this will also apply to H.266.
* avcodec/cbs_h265: fix undef SEI_TYPE_XNuo Mi2021-01-11
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265: set default VUI parameters when ↵James Almer2020-06-25
| | | | | | | | | | vui_parameters_present_flag is false Based on cbs_h264 code. Should fix ticket #8752. Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_h265: Fix use of an uninitialized variableMartin Storsjö2020-05-22
| | | | | | | This fixes test failures in fate-cbs-hevc-* in certain configurations since c53f9f436440be4e18. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/cbs_h265_syntax_template: Limit num_long_term_pics more strictlyMichael Niedermayer2020-05-21
| | | | | | | | | The limit is based on hevcdec.c Fixes: 20854/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-5160442882424832 Fixes: out of array access Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* cbs_h265: Ensure that a predicted RPS doesn't contain too many picturesMark Thompson2020-05-20
| | | | | | | | | If the RPS we are predicting from has maximum size then at least one of the pictures in it must be discarded before adding the current one. Also revert 588114cea4ee434c9c61353ed91ffc817d2965f5, which added now-redundant checks for the special case of a too-large RPS with all pictures being in the same direction from the current one.
* avcodec/cbs_h265: add missing support for reserved_payload_extension_data ↵James Almer2020-05-03
| | | | | | | | | | SEI bits Fixes ticket #8622 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265: move the payload_extension_present check into its own functionJames Almer2020-05-03
| | | | | | Will be reused in the following patch. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265: rename H265RawPSExtensionData to H265RawExtensionDataJames Almer2020-05-03
| | | | | | So that NAL types other than Parameter Set ones may use it. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265: fix writing extension_data bitsJames Almer2020-04-30
| | | | | | We only care about the right most bit. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265_syntax_template: Check num_negative/positive_pics when ↵Michael Niedermayer2020-04-26
| | | | | | | | | | inter_ref_pic_set_prediction_flag is set Fixes: out of array access Fixes: 20446/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-5707770718584832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hevc, h2645_parse: Fix HEVC NAL unit names and constantsAndreas Rheinhardt2020-03-24
| | | | | | | | | | | This commit fixes the names and constants of the reserved NAL units with nal_unit_type 22 resp. 23. They were "IRAP_IRAP_VLC2x", but are actually "RSV_IRAP_VLC2x". This also required a change to cbs_h265_syntax_template.c. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc/cbs_h2645_syntax_template: Fix memleakAndriy Gelman2019-12-16
| | | | | | | | | | | | | | | | | payload_count is used to track the number of SEI payloads. It is also used to free the SEIs in cbs_h264_free_sei()/cbs_h265_free_sei(). Currently, payload_count is set after for loop is completed. Hence if there is an error and the function exits, the payload remains zero causing a memleak. This commit keeps track of payload_count inside the for loop to fix the issue. Note that that the contents of current are initialized with av_mallocz() so there is no need to zero initialize payload_count. Found-by: libFuzzer Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/cbs_h265: add support for Alpha Channel Info SEI messagesJames Almer2019-07-20
| | | | | | | As defined in sections F.14.2.8 and F.14.3.8 Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h2645: use the fixed() macro for forbidden_zero_bitJames Almer2019-04-28
| | | | | | | | This follows the spec definition, and removes a field from the relevant structs. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h2645: add macros to read and write fields with no custom range ↵James Almer2019-04-28
| | | | | | | of values Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265: fix storage type for time_offset_value in Time Code SEIJames Almer2019-04-16
| | | | | | | | The spec defines it as an array of signed values, inferred to 0 when not present. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_h265: Fix Time Code SEI syntaxAndreas Rheinhardt2018-12-02
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* cbs_h265: Add a lot more SEI parsing supportMark Thompson2018-11-18
| | | | | | Supports both prefix and suffix SEI, decoding all of the common SEI types and some more obscure ones. Most of this is tested by the existing tests in fate.
* cbs_h265: Add PTL parsing for sublayersMark Thompson2018-11-11
| | | | | With fate test using the SLPPLP_A_VIDYO_2 conformance file, which contains two sublayers with full PTL information.
* cbs_h265: Add PTL parsing for Main 10 Still Picture profileMark Thompson2018-10-31
| | | | This was added in the 2018 version of the standard.
* cbs_h265: read/write content light level information SEI messageHaihao Xiang2018-05-10
| | | | Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* cbs_h265: read/write HEVC PREFIX SEIHaihao Xiang2018-05-10
| | | | | | | | Similar to H264, cbs_h265_{read, write}_nal_unit() can handle HEVC prefix SEI NAL units. Currently mastering display colour volume SEI message is added only, we may add more SEI message if needed later Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* cbs: Add support for array subscripts in trace outputMark Thompson2018-05-02
| | | | This makes the trace output for arrays significantly nicer.
* cbs_h2645: Simplify representation of fixed valuesMark Thompson2018-05-01
|
* cbs_h265: Use helper macro for maximum values of fixed-width elementsMark Thompson2018-03-18
| | | | | Apply the same logic as the previous patch to H.265. There are no cases which currently overflow here, but this is still more consistent.
* lavc: Add coded bitstream read/write support for H.265Mark Thompson2017-10-17
(cherry picked from commit 867381b8b51fa21fa2b8f071f508f3d39cc9c1f0) (cherry picked from commit f763489364416bb6866adc4f4a96012dd2ca1bd0) (cherry picked from commit 067a9ddeb8feff1f724856f0054930c55219f76b)