summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_av1_syntax_template.c
Commit message (Collapse)AuthorAgeFilesLines
* cbs_av1: Don't reject unknown metadataMark Thompson2023-05-171-2/+24
| | | | | | | Accept it and pass it through unchanged. The standard requires that decoders ignore unknown metadata, and indeed this is tested by some of the Argon coverage streams.
* cbs_av1: Add tracing headers for metadata typesMark Thompson2023-05-171-0/+10
| | | | Make it a little easier to interpret metadata in trace output.
* avcodec/cbs_av1: add valid range of values for num_units_in_decoding_tickJames Almer2023-05-141-1/+1
| | | | | | The spec states "num_units_in_decoding_tick shall be greater than 0". Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_av1: Remove constraint on MDCV luminance valuesMark Thompson2023-01-241-5/+2
| | | | | While desiring min to be less than max feels entirely sensible, unfortunately the standard does not actually have this requirement.
* cbs_av1: fix incorrect data typeFei Wang2021-10-161-1/+1
| | | | | | | | Since order_hint_bits_minus_1 range is 0~7, cur_frame_hint can be most 128. And similar return value for cbs_av1_get_relative_dist. So if plus them and use int8_t for the result may lose its precision. Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* avcodec/cbs_av1: split film grain param fields into their own structJames Almer2020-11-301-4/+5
| | | | | | Cosmetic change in preparation for the following patches. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: remove dead codeJames Almer2020-11-131-3/+0
| | | | | | | | | | The other branch already covers cases where enable_order_hint is true and frame is of type Inter. Regression since ddb0e4fecdef24e8c7b90fa0a41d13e642ea732f Fixes Coverity issues #1469194 and #1469195. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add a range check to tg_endJames Almer2020-11-111-2/+6
| | | | | | | | | | | Section 6.10.1 of the AV1 spec states: It is a requirement of bitstream conformance that the value of tg_start is equal to the value of TileNum at the point that tile_group_obu is invoked. It is a requirement of bitstream conformance that the value of tg_end is greater than or equal to tg_start. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: infer ref_order_hint when not coded in the bitstreamJames Almer2020-11-111-2/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: infer segmentation parameters from reference framesJames Almer2020-10-281-3/+26
| | | | | | | | | Partially implements setup_past_independence() and load_previous(). These ensures they are always set, even if the values were not coded in the input bitstream and will not be coded in the output bitstream. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: infer loop filter delta parameters from reference framesJames Almer2020-10-281-9/+41
| | | | | | | | | Partially implements setup_past_independence() and load_previous(). These ensures they are always set, even if the values were not coded in the input bitstream and will not be coded in the output bitstream. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add missing frame restoration type enum valuesFei Wang2020-09-021-1/+1
| | | | | Signed-off-by: Fei Wang <fei.w.wang@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_av1: Fill tile width/height values when uniform_tile_spacing_flag is setMark Thompson2020-09-021-0/+9
| | | | | | They are not explicitly in the bitstream in this case, but it is helpful to be able to use these values without always needing to check the flag beforehand.
* avcodec/cbs_av1: fix setting FrameWidth in frame_size_with_refs()James Almer2020-08-251-1/+1
| | | | | | | | | | | | | | | | Section 5.9.7 of the spec states UpscaledWidth = RefUpscaledWidth[ ref_frame_idx[ i ] ] FrameWidth = UpscaledWidth FrameHeight = RefFrameHeight[ ref_frame_idx[ i ] ] RenderWidth = RefRenderWidth[ ref_frame_idx[ i ] ] RenderHeight = RefRenderHeight[ ref_frame_idx[ i ] ] Meaning FrameWidth must not be set to RefFrameWidth[ ref_frame_idx[ i ] ] like we're currently doing. Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: use a more appropiate AV1ReferenceFrameState pointer ↵James Almer2020-08-251-16/+16
| | | | | | | | variable name frame is more commonly used for AV1RawFrameHeader and AV1RawFrame. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix handling reference frames on show_existing_frame framesJames Almer2020-08-251-18/+24
| | | | | | | | Implement Section 7.21 "Reference frame loading process" and Section 7.20 "Reference frame update process" for show_existing_frame frames, as required by the definition in Section 7.4 "Decode frame wrapup process". Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: infer frame_type in show_existing_frame frames earlierJames Almer2020-08-251-2/+2
| | | | | | This follows the spec and will come in handy in the next commit. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add OrderHint to CodedBitstreamAV1ContextJames Almer2020-08-251-4/+5
| | | | | | This follows the spec and will come in handy in a following commit. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: infer frame_type when parsing a show_existing_frame frameJames Almer2020-08-231-0/+1
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: infer frame sizes when not coded in the bitstreamJames Almer2020-08-231-10/+33
| | | | | | | This makes them available for all frames within a Temporal Unit. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_av1: Fix test for presence of buffer_removal_time elementMark Thompson2020-08-231-1/+1
| | | | | The frame must be in both the spatial and temporal layers for the operating point, not just one of them.
* avcodec/cbs_av1: always store temporal_id and spatial_id in ↵James Almer2020-08-231-0/+7
| | | | | | | | | CodedBitstreamAV1Context Also infer them when not coded in the bitstream. Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1_syntax_template: Set seen_frame_header only after ↵Michael Niedermayer2020-03-061-2/+0
| | | | | | | | | | successfull uncompressed_header() Fixes: assertion failure Fixes: 19301/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_FRAME_MERGE_fuzzer-5743212006473728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cbs_av1: add missing value constrains to point_y_value, ↵James Almer2020-02-131-3/+12
| | | | | | | | | | | point_cb_value and point_cr_value If i is greater than 0, it is a requirement of bitstream conformance that point_y_value[ i ] is greater than point_y_value[ i - 1 ]. If i is greater than 0, it is a requirement of bitstream conformance that point_cb_value[ i ] is greater than point_cb_value[ i - 1 ]. If i is greater than 0, it is a requirement of bitstream conformance that point_cr_value[ i ] is greater than point_cr_value[ i - 1 ]. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1_syntax_template: Remove unused variableAndreas Rheinhardt2020-01-241-1/+0
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add missing valid range of values for num_cb_points and ↵James Almer2019-12-191-2/+2
| | | | | | | | | num_cr_points It is a requirement of bitstream conformance that num_cr_points is less than or equal to 10. It is a requirement of bitstream conformance that num_cb_points is less than or equal to 10. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1_syntax_template: Check num_y_pointsMichael Niedermayer2019-12-131-1/+1
| | | | | | | | | | | | | "It is a requirement of bitstream conformance that num_y_points is less than or equal to 14." Fixes: index 24 out of bounds for type 'uint8_t [24]' Fixes: 19282/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_FRAME_MERGE_fuzzer-5747424845103104 Note, also needs a23dd33606d5 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: jamrial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cbs_av1: rename enable_intraintra_compound flagFei Wang2019-12-111-2/+2
| | | | | | | | rename enable_intraintra_compound to enable_interintra_compound, which keep same as AV1 sepc(v1.0.0-errata1). Signed-off-by: Fei Wang <fei.w.wang@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "avcodec/cbs_av1_syntax_template: Check ref_frame_idx before use"James Almer2019-12-011-4/+3
| | | | | | | | This reverts commit 8174e5c77d8a94b57b6b1bcbb90728cf8b08ab6b. It's no longer needed after the previous commit. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: implement missing set_frame_refs() functionJames Almer2019-12-011-10/+112
| | | | | | | | | Defined in Section 7.8 This finishes implementing support for frames using frame_refs_short_signaling. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix reading reference order hint in skip_mode_params()James Almer2019-11-161-2/+2
| | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1_syntax_template: Check ref_frame_idx before useMichael Niedermayer2019-08-051-3/+4
| | | | | | | | | | Fixes: index -1 out of bounds for type 'AV1ReferenceFrameState [8]' Fixes: 16079/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5758807440883712 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> See: [FFmpeg-devel] [PATCH 05/13] avcodec/cbs_av1_syntax_template: Check ref_frame_idx before use Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/cbs_av1: add missing value range constrains to timecode Metadata OBUJames Almer2019-04-281-6/+8
| | | | | | | Also infer the value time_offset_length as 0 when it's not present. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add support for Scalability MetadataJames Almer2019-04-161-2/+54
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add support for Padding OBUsJames Almer2019-04-141-0/+24
| | | | | | | Based on itut_t35 Matadata OBU parsing code. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add a function to strip trailing zeroes from a buffer sizeJames Almer2019-04-141-9/+1
| | | | | | | Factor it out from cbs_av1_read_metadata_itut_t35() Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix range of values for Mastering Display Color Volume ↵James Almer2019-03-251-5/+8
| | | | | | Metadata OBUs Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix parsing delta_frame_id_minus1James Almer2018-12-201-2/+2
| | | | | | | | | | delta_frame_id_minus1 is not a single value in the bitstream, and can store values up to 17 bits wide. Fixes parsing files with frame ids. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_av1: Support redundant frame headersMark Thompson2018-11-051-7/+75
|
* avcodec/cbs_av1: fix parsing frame_size_with_refsJames Almer2018-10-271-3/+3
| | | | | | | | | | found_ref is not a single value in the bitstream. Fixes parsing files with frame size changes. Based on code from cbs_vp9. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: Add coded bitstream read/write support for AV1Mark Thompson2018-09-261-0/+1694