FFmpeg
cbs_vp9.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVCODEC_CBS_VP9_H
20 #define AVCODEC_CBS_VP9_H
21 
22 #include <stddef.h>
23 #include <stdint.h>
24 
25 #include "cbs.h"
26 
27 
28 // Miscellaneous constants (section 3).
29 enum {
31 
34 
37 
40 };
41 
42 // Frame types (section 7.2).
43 enum {
46 };
47 
48 // Frame sync bytes (section 7.2.1).
49 enum {
53 };
54 
55 // Color space values (section 7.2.2).
56 enum {
65 };
66 
67 // Reference frame types (section 7.4.12).
68 enum {
73 };
74 
75 // Superframe properties (section B.3).
76 enum {
78 
80 };
81 
82 
83 typedef struct VP9RawFrameHeader {
87 
90 
94 
95  // Color config.
101 
103 
106 
109 
111 
114 
116 
117  // Frame/render size.
124 
125  // Interpolation filter.
128 
129  // Loop filter params.
138 
139  // Quantization params.
141  int8_t delta_q_y_dc;
144 
145  // Segmentation params.
156 
157  // Tile info.
160 
163 
164 typedef struct VP9RawFrame {
166 
168  size_t data_size;
170 } VP9RawFrame;
171 
172 typedef struct VP9RawSuperframeIndex {
178 
179 typedef struct VP9RawSuperframe {
183 
184 typedef struct VP9ReferenceFrameState {
185  int frame_width; // RefFrameWidth
186  int frame_height; // RefFrameHeight
187  int subsampling_x; // RefSubsamplingX
188  int subsampling_y; // RefSubsamplingY
189  int bit_depth; // RefBitDepth
191 
192 typedef struct CodedBitstreamVP9Context {
193  int profile;
194 
195  // Frame dimensions in 8x8 mode info blocks.
196  uint16_t mi_cols;
197  uint16_t mi_rows;
198  // Frame dimensions in 64x64 superblocks.
199  uint16_t sb64_cols;
200  uint16_t sb64_rows;
201 
204 
208 
211 
212 
213 #endif /* AVCODEC_CBS_VP9_H */
VP9_CS_RESERVED
@ VP9_CS_RESERVED
Definition: cbs_vp9.h:63
VP9RawFrameHeader::show_frame
uint8_t show_frame
Definition: cbs_vp9.h:92
VP9RawFrameHeader::intra_only
uint8_t intra_only
Definition: cbs_vp9.h:104
VP9RawFrame::data_size
size_t data_size
Definition: cbs_vp9.h:168
VP9_CS_BT_601
@ VP9_CS_BT_601
Definition: cbs_vp9.h:58
VP9RawFrameHeader::ref_frame_idx
uint8_t ref_frame_idx[VP9_REFS_PER_FRAME]
Definition: cbs_vp9.h:107
VP9RawFrameHeader::delta_q_uv_dc
int8_t delta_q_uv_dc
Definition: cbs_vp9.h:142
VP9RawFrameHeader::loop_filter_mode_deltas
int8_t loop_filter_mode_deltas[2]
Definition: cbs_vp9.h:137
CodedBitstreamVP9Context::frame_width
int frame_width
Definition: cbs_vp9.h:202
VP9_CS_SMPTE_240
@ VP9_CS_SMPTE_240
Definition: cbs_vp9.h:61
VP9RawFrameHeader::header_size_in_bytes
uint16_t header_size_in_bytes
Definition: cbs_vp9.h:161
VP9RawFrameHeader::tile_rows_log2
uint8_t tile_rows_log2
Definition: cbs_vp9.h:159
VP9_GOLDEN_FRAME
@ VP9_GOLDEN_FRAME
Definition: cbs_vp9.h:71
VP9RawFrameHeader::profile_high_bit
uint8_t profile_high_bit
Definition: cbs_vp9.h:86
VP9RawFrameHeader::error_resilient_mode
uint8_t error_resilient_mode
Definition: cbs_vp9.h:93
VP9RawFrameHeader::frame_context_idx
uint8_t frame_context_idx
Definition: cbs_vp9.h:115
CodedBitstreamVP9Context::sb64_rows
uint16_t sb64_rows
Definition: cbs_vp9.h:200
VP9RawSuperframeIndex::frame_sizes
uint32_t frame_sizes[VP9_MAX_FRAMES_IN_SUPERFRAME]
Definition: cbs_vp9.h:176
VP9RawSuperframe
Definition: cbs_vp9.h:179
VP9RawFrameHeader::render_and_frame_size_different
uint8_t render_and_frame_size_different
Definition: cbs_vp9.h:121
cbs.h
VP9RawFrameHeader::raw_interpolation_filter_type
uint8_t raw_interpolation_filter_type
Definition: cbs_vp9.h:127
VP9RawFrameHeader::frame_to_show_map_idx
uint8_t frame_to_show_map_idx
Definition: cbs_vp9.h:89
CodedBitstreamVP9Context::ref
VP9ReferenceFrameState ref[VP9_NUM_REF_FRAMES]
Definition: cbs_vp9.h:209
VP9RawFrameHeader::subsampling_y
uint8_t subsampling_y
Definition: cbs_vp9.h:100
VP9_FRAME_SYNC_1
@ VP9_FRAME_SYNC_1
Definition: cbs_vp9.h:51
VP9_NUM_REF_FRAMES
@ VP9_NUM_REF_FRAMES
Definition: cbs_vp9.h:35
VP9RawFrame::data_ref
AVBufferRef * data_ref
Definition: cbs_vp9.h:169
VP9_REFS_PER_FRAME
@ VP9_REFS_PER_FRAME
Definition: cbs_vp9.h:30
VP9RawFrameHeader::frame_height_minus_1
uint16_t frame_height_minus_1
Definition: cbs_vp9.h:120
VP9RawFrameHeader::render_height_minus_1
uint16_t render_height_minus_1
Definition: cbs_vp9.h:123
VP9ReferenceFrameState::subsampling_y
int subsampling_y
Definition: cbs_vp9.h:188
VP9RawFrameHeader::subsampling_x
uint8_t subsampling_x
Definition: cbs_vp9.h:99
VP9RawFrameHeader::found_ref
uint8_t found_ref[VP9_REFS_PER_FRAME]
Definition: cbs_vp9.h:118
VP9_MAX_FRAMES_IN_SUPERFRAME
@ VP9_MAX_FRAMES_IN_SUPERFRAME
Definition: cbs_vp9.h:77
VP9RawSuperframe::frames
VP9RawFrame frames[VP9_MAX_FRAMES_IN_SUPERFRAME]
Definition: cbs_vp9.h:180
VP9_SUPERFRAME_MARKER
@ VP9_SUPERFRAME_MARKER
Definition: cbs_vp9.h:79
VP9ReferenceFrameState
Definition: cbs_vp9.h:184
VP9ReferenceFrameState::subsampling_x
int subsampling_x
Definition: cbs_vp9.h:187
VP9RawFrameHeader::segmentation_tree_probs
uint8_t segmentation_tree_probs[7]
Definition: cbs_vp9.h:148
VP9RawFrameHeader::ten_or_twelve_bit
uint8_t ten_or_twelve_bit
Definition: cbs_vp9.h:96
VP9RawFrameHeader
Definition: cbs_vp9.h:83
CodedBitstreamVP9Context::mi_rows
uint16_t mi_rows
Definition: cbs_vp9.h:197
VP9RawSuperframeIndex::frames_in_superframe_minus_1
uint8_t frames_in_superframe_minus_1
Definition: cbs_vp9.h:175
VP9RawFrameHeader::refresh_frame_context
uint8_t refresh_frame_context
Definition: cbs_vp9.h:112
VP9_FRAME_SYNC_2
@ VP9_FRAME_SYNC_2
Definition: cbs_vp9.h:52
CodedBitstreamVP9Context::mi_cols
uint16_t mi_cols
Definition: cbs_vp9.h:196
VP9_NON_KEY_FRAME
@ VP9_NON_KEY_FRAME
Definition: cbs_vp9.h:45
VP9RawFrameHeader::show_existing_frame
uint8_t show_existing_frame
Definition: cbs_vp9.h:88
CodedBitstreamVP9Context::subsampling_y
uint8_t subsampling_y
Definition: cbs_vp9.h:206
VP9RawSuperframeIndex
Definition: cbs_vp9.h:172
VP9RawFrameHeader::feature_value
uint8_t feature_value[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
Definition: cbs_vp9.h:154
VP9RawSuperframeIndex::bytes_per_framesize_minus_1
uint8_t bytes_per_framesize_minus_1
Definition: cbs_vp9.h:174
VP9RawFrameHeader::profile_low_bit
uint8_t profile_low_bit
Definition: cbs_vp9.h:85
VP9_LAST_FRAME
@ VP9_LAST_FRAME
Definition: cbs_vp9.h:70
VP9_CS_BT_709
@ VP9_CS_BT_709
Definition: cbs_vp9.h:59
VP9RawFrameHeader::ref_frame_sign_bias
uint8_t ref_frame_sign_bias[VP9_MAX_REF_FRAMES]
Definition: cbs_vp9.h:108
VP9RawFrame
Definition: cbs_vp9.h:164
VP9RawFrameHeader::delta_q_y_dc
int8_t delta_q_y_dc
Definition: cbs_vp9.h:141
VP9RawFrameHeader::frame_marker
uint8_t frame_marker
Definition: cbs_vp9.h:84
VP9RawFrameHeader::segmentation_temporal_update
uint8_t segmentation_temporal_update
Definition: cbs_vp9.h:149
VP9RawFrameHeader::segmentation_update_map
uint8_t segmentation_update_map
Definition: cbs_vp9.h:147
VP9RawFrame::header
VP9RawFrameHeader header
Definition: cbs_vp9.h:165
VP9RawFrameHeader::loop_filter_ref_deltas
int8_t loop_filter_ref_deltas[VP9_MAX_REF_FRAMES]
Definition: cbs_vp9.h:135
VP9_CS_SMPTE_170
@ VP9_CS_SMPTE_170
Definition: cbs_vp9.h:60
CodedBitstreamVP9Context::bit_depth
int bit_depth
Definition: cbs_vp9.h:207
CodedBitstreamVP9Context::profile
int profile
Definition: cbs_vp9.h:193
VP9RawFrameHeader::frame_parallel_decoding_mode
uint8_t frame_parallel_decoding_mode
Definition: cbs_vp9.h:113
VP9RawFrameHeader::feature_sign
uint8_t feature_sign[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
Definition: cbs_vp9.h:155
VP9_CS_RGB
@ VP9_CS_RGB
Definition: cbs_vp9.h:64
CodedBitstreamVP9Context
Definition: cbs_vp9.h:192
VP9_KEY_FRAME
@ VP9_KEY_FRAME
Definition: cbs_vp9.h:44
VP9RawFrameHeader::is_filter_switchable
uint8_t is_filter_switchable
Definition: cbs_vp9.h:126
VP9_MAX_TILE_WIDTH_B64
@ VP9_MAX_TILE_WIDTH_B64
Definition: cbs_vp9.h:33
VP9RawFrameHeader::feature_enabled
uint8_t feature_enabled[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
Definition: cbs_vp9.h:153
VP9_ALTREF_FRAME
@ VP9_ALTREF_FRAME
Definition: cbs_vp9.h:72
VP9_CS_BT_2020
@ VP9_CS_BT_2020
Definition: cbs_vp9.h:62
VP9RawFrameHeader::segmentation_abs_or_delta_update
uint8_t segmentation_abs_or_delta_update
Definition: cbs_vp9.h:152
CodedBitstreamVP9Context::subsampling_x
uint8_t subsampling_x
Definition: cbs_vp9.h:205
VP9RawFrameHeader::delta_q_uv_ac
int8_t delta_q_uv_ac
Definition: cbs_vp9.h:143
VP9RawFrameHeader::color_range
uint8_t color_range
Definition: cbs_vp9.h:98
VP9RawFrameHeader::tile_cols_log2
uint8_t tile_cols_log2
Definition: cbs_vp9.h:158
VP9RawFrameHeader::segmentation_pred_prob
uint8_t segmentation_pred_prob[3]
Definition: cbs_vp9.h:150
VP9RawFrameHeader::base_q_idx
uint8_t base_q_idx
Definition: cbs_vp9.h:140
CodedBitstreamVP9Context::frame_height
int frame_height
Definition: cbs_vp9.h:203
uint8_t
uint8_t
Definition: audio_convert.c:194
VP9RawFrameHeader::reset_frame_context
uint8_t reset_frame_context
Definition: cbs_vp9.h:105
VP9RawFrameHeader::frame_type
uint8_t frame_type
Definition: cbs_vp9.h:91
VP9ReferenceFrameState::frame_width
int frame_width
Definition: cbs_vp9.h:185
VP9RawFrame::data
uint8_t * data
Definition: cbs_vp9.h:167
VP9RawFrameHeader::loop_filter_sharpness
uint8_t loop_filter_sharpness
Definition: cbs_vp9.h:131
VP9_MIN_TILE_WIDTH_B64
@ VP9_MIN_TILE_WIDTH_B64
Definition: cbs_vp9.h:32
VP9RawFrameHeader::update_ref_delta
uint8_t update_ref_delta[VP9_MAX_REF_FRAMES]
Definition: cbs_vp9.h:134
VP9RawFrameHeader::frame_width_minus_1
uint16_t frame_width_minus_1
Definition: cbs_vp9.h:119
VP9_CS_UNKNOWN
@ VP9_CS_UNKNOWN
Definition: cbs_vp9.h:57
VP9RawSuperframe::index
VP9RawSuperframeIndex index
Definition: cbs_vp9.h:181
VP9RawSuperframeIndex::superframe_marker
uint8_t superframe_marker
Definition: cbs_vp9.h:173
VP9RawFrameHeader::render_width_minus_1
uint16_t render_width_minus_1
Definition: cbs_vp9.h:122
VP9RawFrameHeader::color_space
uint8_t color_space
Definition: cbs_vp9.h:97
VP9_MAX_REF_FRAMES
@ VP9_MAX_REF_FRAMES
Definition: cbs_vp9.h:36
VP9RawFrameHeader::segmentation_enabled
uint8_t segmentation_enabled
Definition: cbs_vp9.h:146
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:81
VP9_SEG_LVL_MAX
@ VP9_SEG_LVL_MAX
Definition: cbs_vp9.h:39
VP9RawFrameHeader::segmentation_update_data
uint8_t segmentation_update_data
Definition: cbs_vp9.h:151
VP9RawFrameHeader::loop_filter_delta_enabled
uint8_t loop_filter_delta_enabled
Definition: cbs_vp9.h:132
CodedBitstreamVP9Context::sb64_cols
uint16_t sb64_cols
Definition: cbs_vp9.h:199
VP9RawFrameHeader::update_mode_delta
uint8_t update_mode_delta[2]
Definition: cbs_vp9.h:136
VP9RawFrameHeader::allow_high_precision_mv
uint8_t allow_high_precision_mv
Definition: cbs_vp9.h:110
VP9ReferenceFrameState::frame_height
int frame_height
Definition: cbs_vp9.h:186
VP9RawFrameHeader::loop_filter_delta_update
uint8_t loop_filter_delta_update
Definition: cbs_vp9.h:133
VP9RawFrameHeader::loop_filter_level
uint8_t loop_filter_level
Definition: cbs_vp9.h:130
VP9_FRAME_SYNC_0
@ VP9_FRAME_SYNC_0
Definition: cbs_vp9.h:50
VP9RawFrameHeader::refresh_frame_flags
uint8_t refresh_frame_flags
Definition: cbs_vp9.h:102
VP9_INTRA_FRAME
@ VP9_INTRA_FRAME
Definition: cbs_vp9.h:69
VP9ReferenceFrameState::bit_depth
int bit_depth
Definition: cbs_vp9.h:189
VP9_MAX_SEGMENTS
@ VP9_MAX_SEGMENTS
Definition: cbs_vp9.h:38