summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_av1.h
Commit message (Collapse)AuthorAge
* avcodec/cbs_av1: add an option to select an operating pointJames Almer2021-01-04
| | | | | | | | | This implements the function drop_obu() as defined in Setion 6.2.1 from the spec. In a reading only scenario, units that belong to an operating point the caller doesn't want should not be parsed. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: split film grain param fields into their own structJames Almer2020-11-30
| | | | | | Cosmetic change in preparation for the following patches. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add a range check to tg_endJames Almer2020-11-11
| | | | | | | | | | | 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 segmentation parameters from reference framesJames Almer2020-10-28
| | | | | | | | | 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-28
| | | | | | | | | 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>
* cbs: Ensure that reference fields always follow the associated pointerMark Thompson2020-09-02
| | | | | Having these together allows us to find both pointers given the address of only one of them.
* avcodec/cbs_av1: add OrderHint to CodedBitstreamAV1ContextJames Almer2020-08-25
| | | | | | This follows the spec and will come in handy in a following commit. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix storage size for render_{width,height}_minus_1James Almer2020-08-23
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "avcodec/cbs_av1: keep separate reference frame state for reading and ↵James Almer2020-07-16
| | | | | | | | writing" This reverts commit 4e2bef6a82b356772a5919c51c9be1530268bd79. It's no longer needed now that all the bsfs use separate contexts for reading and writing.
* avcodec/cbs_av1: add missing valid range of values for num_cb_points and ↵James Almer2019-12-19
| | | | | | | | | 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-13
| | | | | | | | | | | | | "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: fix array size for ar_coeffs_cb_plus_128 and ↵James Almer2019-12-11
| | | | | | | | | | | | | | | | | | | | | | ar_coeffs_cr_plus_128 Taking into account the code fb(2, ar_coeff_lag); num_pos_luma = 2 * current->ar_coeff_lag * (current->ar_coeff_lag + 1); if (current->num_y_points) num_pos_chroma = num_pos_luma + 1; else num_pos_chroma = num_pos_luma; Max value for ar_coeff_lag is 3 (two bits), for num_pos_luma 24, and for num_pos_chroma 25. Both ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128 may have up to num_pos_chroma values. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: rename enable_intraintra_compound flagFei Wang2019-12-11
| | | | | | | | 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>
* avcodec/cbs_av1: keep separate reference frame state for reading and writingJames Almer2019-11-18
| | | | | | | | | | | In scearios where a Temporal Unit is written right after reading it using the same CBS context (av1_metadata, av1_frame_merge, etc), the reference frame state used by the writer must not be the state that's the result of the reader having already parsed the current frame in question. This fixes writing Switch frames, and frames using short ref signaling. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs: Factor out common code for writing unitsAndreas Rheinhardt2019-11-17
| | | | | | | | | | | | | | | | | All cbs-functions to write units share a common pattern: 1. They check whether they have a write buffer (that is used to store the unit's data until the needed size becomes known after writing the unit when a dedicated buffer will be allocated). 2. They use this buffer for a PutBitContext. 3. The (codec-specific) writing takes place through the PutBitContext. 4. The return value is checked. AVERROR(ENOSPC) here always indicates that the buffer was too small and leads to a reallocation of said buffer. 5. The final buffer will be allocated and the data copied. This commit factors this common code out in a single function in cbs.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cbs_av1: add support for Scalability MetadataJames Almer2019-04-16
| | | | | 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-14
| | | | | | | 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: fix parsing delta_frame_id_minus1James Almer2018-12-20
| | | | | | | | | | 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>
* avcodec/cbs_av1: fix storage size for segmentation_params feature_value fieldsJames Almer2018-11-14
| | | | | | | The valid range is -255 to 255. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_av1: Support redundant frame headersMark Thompson2018-11-05
|
* avcodec/cbs_av1: fix decoder/encoder_buffer_delay variable typesJames Almer2018-11-04
| | | | | | | | buffer_delay_length_minus_1 is five bits long, meaning decode_buffer_delay and encoder_buffer_delay can have values up to 32 bits long. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix parsing frame_size_with_refsJames Almer2018-10-27
| | | | | | | | | | 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-26