1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
Commit Graph

46 Commits

Author SHA1 Message Date
Lynne
998aa66a10
av1dec: add AV1_REF_FRAME_NONE 2024-03-25 08:54:18 +01:00
Mark Thompson
cafb4c5548 lavc/cbs_av1: Save more frame ordering information
This is wanted by the Vulkan decoder.
2024-03-25 08:32:04 +01:00
Fei Wang
6c3a5d625f avcodec/cbs_av1: Add tx mode enum values
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2023-09-22 13:15:00 +08:00
Andreas Rheinhardt
8238bc0b5e avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines
These defines are also used in other contexts than just AVCodecContext
ones, e.g. in libavformat. Furthermore, given that these defines are
public, the AV-prefix is the right one, so deprecate (and not just move)
the FF-macros.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-07 00:39:02 +02:00
Lynne
6ec58ff820
cbs_av1: expose tile col/row starts in SBs 2023-05-29 00:41:59 +02:00
Mark Thompson
dce6cf2c36 cbs_av1: Don't reject unknown metadata
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.
2023-05-17 19:38:45 +00:00
Mark Thompson
bee912cb63 cbs_av1: Add tracing headers for metadata types
Make it a little easier to interpret metadata in trace output.
2023-05-17 19:38:45 +00:00
James Almer
6759983bdc avcodec/cbs_av1: add valid range of values for num_units_in_decoding_tick
The spec states "num_units_in_decoding_tick shall be greater than 0".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-14 17:09:38 -03:00
Mark Thompson
aaa49a7a42 cbs_av1: Remove constraint on MDCV luminance values
While desiring min to be less than max feels entirely sensible,
unfortunately the standard does not actually have this requirement.
2023-01-24 21:41:55 +00:00
Fei Wang
e7ff5722b1 cbs_av1: fix incorrect data type
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>
2021-10-16 19:00:43 -03:00
James Almer
aea80e2273 avcodec/cbs_av1: split film grain param fields into their own struct
Cosmetic change in preparation for the following patches.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-30 19:12:39 -03:00
James Almer
0cccb5fb14 avcodec/cbs_av1: remove dead code
The other branch already covers cases where enable_order_hint is true
and frame is of type Inter.
Regression since ddb0e4fecd

Fixes Coverity issues #1469194 and #1469195.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-13 20:36:06 -03:00
James Almer
a876bc9c17 avcodec/cbs_av1: add a range check to tg_end
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>
2020-11-11 10:23:01 -03:00
James Almer
ddb0e4fecd avcodec/cbs_av1: infer ref_order_hint when not coded in the bitstream
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-11 10:17:24 -03:00
James Almer
5ed9f8c66c avcodec/cbs_av1: infer segmentation parameters from reference frames
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>
2020-10-28 11:26:25 -03:00
James Almer
5d1238f77f avcodec/cbs_av1: infer loop filter delta parameters from reference frames
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>
2020-10-28 11:26:25 -03:00
Fei Wang
bf6db5732c avcodec/cbs_av1: add missing frame restoration type enum values
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-09-02 12:33:02 -03:00
Mark Thompson
2a19232c19 cbs_av1: Fill tile width/height values when uniform_tile_spacing_flag is set
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.
2020-09-02 00:00:57 +01:00
James Almer
98f7e0081b avcodec/cbs_av1: fix setting FrameWidth in frame_size_with_refs()
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>
2020-08-25 18:46:06 -03:00
James Almer
97819f15a8 avcodec/cbs_av1: use a more appropiate AV1ReferenceFrameState pointer variable name
frame is more commonly used for AV1RawFrameHeader and AV1RawFrame.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 14:53:42 -03:00
James Almer
e76b4b2a6b avcodec/cbs_av1: fix handling reference frames on show_existing_frame frames
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>
2020-08-25 14:49:33 -03:00
James Almer
afbe9ebac7 avcodec/cbs_av1: infer frame_type in show_existing_frame frames earlier
This follows the spec and will come in handy in the next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 14:49:33 -03:00
James Almer
e3ed0ce32a avcodec/cbs_av1: add OrderHint to CodedBitstreamAV1Context
This follows the spec and will come in handy in a following commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 14:49:33 -03:00
James Almer
6c20207dce avcodec/cbs_av1: infer frame_type when parsing a show_existing_frame frame
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-23 20:53:58 -03:00
James Almer
f1e92ee36b avcodec/cbs_av1: infer frame sizes when not coded in the bitstream
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>
2020-08-23 20:37:12 -03:00
Mark Thompson
b567cb8d0b cbs_av1: Fix test for presence of buffer_removal_time element
The frame must be in both the spatial and temporal layers for the
operating point, not just one of them.
2020-08-23 18:43:58 +01:00
James Almer
994d2567f1 avcodec/cbs_av1: always store temporal_id and spatial_id in CodedBitstreamAV1Context
Also infer them when not coded in the bitstream.

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-23 14:34:32 -03:00
Michael Niedermayer
a2e4879432 avcodec/cbs_av1_syntax_template: Set seen_frame_header only after 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>
2020-03-06 00:58:31 +01:00
James Almer
6d37ca8a4e avcodec/cbs_av1: add missing value constrains to point_y_value, 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>
2020-02-13 20:23:45 -03:00
Andreas Rheinhardt
1ab302da6e avcodec/cbs_av1_syntax_template: Remove unused variable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-01-24 20:03:47 -03:00
James Almer
8887991a31 avcodec/cbs_av1: add missing valid range of values for num_cb_points and 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>
2019-12-19 01:04:10 -03:00
Michael Niedermayer
bbe27890ff avcodec/cbs_av1_syntax_template: Check num_y_points
"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 a23dd33606

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>
2019-12-13 23:52:19 +01:00
Fei Wang
5fc3099caf avcodec/cbs_av1: rename enable_intraintra_compound flag
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>
2019-12-11 16:23:38 -03:00
James Almer
553c1431ac Revert "avcodec/cbs_av1_syntax_template: Check ref_frame_idx before use"
This reverts commit 8174e5c77d.

It's no longer needed after the previous commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-12-01 16:53:11 -03:00
James Almer
eced91afa5 avcodec/cbs_av1: implement missing set_frame_refs() function
Defined in Section 7.8

This finishes implementing support for frames using
frame_refs_short_signaling.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-12-01 16:53:11 -03:00
James Almer
2703068110 avcodec/cbs_av1: fix reading reference order hint in skip_mode_params()
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-11-16 15:56:36 -03:00
Michael Niedermayer
8174e5c77d avcodec/cbs_av1_syntax_template: Check ref_frame_idx before use
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>
2019-08-05 17:53:14 +02:00
James Almer
67f9d3f461 avcodec/cbs_av1: add missing value range constrains to timecode Metadata OBU
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>
2019-04-28 19:48:45 -03:00
James Almer
cfe220332a avcodec/cbs_av1: add support for Scalability Metadata
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-16 19:23:17 -03:00
James Almer
1f260d7285 avcodec/cbs_av1: add support for Padding OBUs
Based on itut_t35 Matadata OBU parsing code.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-14 14:51:51 -03:00
James Almer
62074b8f85 avcodec/cbs_av1: add a function to strip trailing zeroes from a buffer size
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>
2019-04-14 14:51:51 -03:00
James Almer
40490b3a63 avcodec/cbs_av1: fix range of values for Mastering Display Color Volume Metadata OBUs
Signed-off-by: James Almer <jamrial@gmail.com>
2019-03-25 11:26:26 -03:00
James Almer
064f9505f4 avcodec/cbs_av1: fix parsing delta_frame_id_minus1
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>
2018-12-20 17:57:10 -03:00
Mark Thompson
f5894178fb cbs_av1: Support redundant frame headers 2018-11-05 23:00:59 +00:00
James Almer
99ef8b8afd avcodec/cbs_av1: fix parsing frame_size_with_refs
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>
2018-10-27 16:06:36 -03:00
Mark Thompson
c8c81ac502 lavc: Add coded bitstream read/write support for AV1 2018-09-26 23:27:53 +01:00