VA-API  2.22.0
va_enc_vp9.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2015 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
33 #ifndef VA_ENC_VP9_H
34 #define VA_ENC_VP9_H
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
58 typedef struct _VACodedBufferVP9Status {
64  uint16_t base_qp_index;
65 
71 
78 
79  /* suggested next frame width */
80  uint16_t next_frame_width;
81 
82  /* suggested next frame height */
83  uint16_t next_frame_height;
84 
86  uint32_t va_reserved[VA_PADDING_LOW];
88 
95 typedef struct _VAEncSequenceParameterBufferVP9 {
104  /* maximum frame width in pixels for the whole sequence */
105  uint32_t max_frame_width;
106 
107  /* maximum frame height in pixels for the whole sequence */
108  uint32_t max_frame_height;
109 
110  /* auto keyframe placement, non-zero means enable auto keyframe placement */
111  uint32_t kf_auto;
112 
113  /* keyframe minimum interval */
114  uint32_t kf_min_dist;
115 
116  /* keyframe maximum interval */
117  uint32_t kf_max_dist;
118 
119 
120  /* RC related fields. RC modes are set with VAConfigAttribRateControl */
121  /* For VP9, CBR implies HRD conformance and VBR implies no HRD conformance */
122 
134  uint32_t bits_per_second;
135 
136  /* Period between key frames */
137  uint32_t intra_period;
138 
140  uint32_t va_reserved[VA_PADDING_LOW];
142 
143 
150 typedef struct _VAEncPictureParameterBufferVP9 {
157  /* raw source frame width in pixels */
158  uint32_t frame_width_src;
159  /* raw source frame height in pixels */
160  uint32_t frame_height_src;
161 
162  /* to be encoded frame width in pixels */
163  uint32_t frame_width_dst;
164  /* to be encoded frame height in pixels */
165  uint32_t frame_height_dst;
166 
167  /* surface to store reconstructed frame, not used for enc only case */
168  VASurfaceID reconstructed_frame;
169 
181  VASurfaceID reference_frames[8];
182 
183  /* buffer to store coded data */
184  VABufferID coded_buf;
185 
186  union {
187  struct {
188  /* force this frame to be a keyframe */
189  uint32_t force_kf : 1;
190 
198  uint32_t ref_frame_ctrl_l0 : 3;
199  uint32_t ref_frame_ctrl_l1 : 3;
200 
205  uint32_t ref_last_idx : 3;
206 
210  uint32_t ref_last_sign_bias : 1;
211 
216  uint32_t ref_gf_idx : 3;
217 
221  uint32_t ref_gf_sign_bias : 1;
222 
227  uint32_t ref_arf_idx : 3;
228 
232  uint32_t ref_arf_sign_bias : 1;
233 
234  /* The temporal id the frame belongs to */
235  uint32_t temporal_id : 8;
236 
237  uint32_t reserved : 5;
238  } bits;
239  uint32_t value;
240  } ref_flags;
241 
242  union {
243  struct {
248  uint32_t frame_type : 1;
249 
254  uint32_t show_frame : 1;
255 
260  uint32_t error_resilient_mode : 1;
261 
267  uint32_t intra_only : 1;
268 
274 
282  uint32_t mcomp_filter_type : 3;
283  uint32_t frame_parallel_decoding_mode : 1;
284  uint32_t reset_frame_context : 2;
285  uint32_t refresh_frame_context : 1;
286  uint32_t frame_context_idx : 2;
287  uint32_t segmentation_enabled : 1;
288 
289  /* corresponds to variable temporal_update in VP9 code.
290  * Indicates whether Segment ID is from bitstream or from previous
291  * frame.
292  * 0: Segment ID from bitstream
293  * 1: Segment ID from previous frame
294  */
295  uint32_t segmentation_temporal_update : 1;
296 
297  /* corresponds to variable update_mb_segmentation_map in VP9 code.
298  * Indicates how hardware determines segmentation ID
299  * 0: intra block - segment id is 0;
300  * inter block - segment id from previous frame
301  * 1: intra block - segment id from bitstream (app or GPU decides)
302  * inter block - depends on segmentation_temporal_update
303  */
304  uint32_t segmentation_update_map : 1;
305 
323  uint32_t lossless_mode : 1;
324 
334  uint32_t comp_prediction_mode : 2;
335 
343  uint32_t auto_segmentation : 1;
344 
351  uint32_t super_frame_flag : 1;
352 
353  uint32_t reserved : 10;
354  } bits;
355  uint32_t value;
356  } pic_flags;
357 
362 
366  uint8_t luma_ac_qindex;
367 
372 
377 
382 
386  uint8_t filter_level;
387 
393 
400  int8_t ref_lf_delta[4];
401 
408  int8_t mode_lf_delta[2];
409 
420 
429 
435 
441 
447 
455 
462 
463 
468  uint8_t log2_tile_rows;
469 
475 
494 
501 
509 
511  uint32_t va_reserved[VA_PADDING_MEDIUM];
513 
514 
518 typedef struct _VAEncSegParamVP9 {
519  union {
520  struct {
526 
536  uint8_t segment_reference : 2;
537 
543 
544  uint8_t reserved : 4;
545 
546  } bits;
547  uint8_t value;
548  } seg_flags;
549 
555 
561 
563  uint32_t va_reserved[VA_PADDING_LOW];
565 
575 typedef struct _VAEncMiscParameterTypeVP9PerSegmantParam {
579  VAEncSegParamVP9 seg_data[8];
580 
582  uint32_t va_reserved[VA_PADDING_LOW];
584 
585 
599 #ifdef __cplusplus
600 }
601 #endif
602 
603 #endif /* VA_ENC_VP9_H */
#define VA_PADDING_LOW
Definition: va.h:360
VAGenericID VABufferID
Definition: va.h:2019
VP9 Encoding Status Data Buffer Structure.
Definition: va_enc_vp9.h:58
uint8_t long_term_indication
Definition: va_enc_vp9.h:77
uint16_t base_qp_index
Definition: va_enc_vp9.h:64
uint8_t loop_filter_level
Definition: va_enc_vp9.h:70
Definition: va_enc_vp9.h:575
VP9 Encoding Picture Parameter Buffer Structure.
Definition: va_enc_vp9.h:150
uint32_t ref_gf_idx
GOLDEN Reference Frame index Specifies the index to RefFrameList[] which points to the Golden referen...
Definition: va_enc_vp9.h:216
uint8_t sharpness_level
Definition: va_enc_vp9.h:392
uint32_t skip_frames_size
When skip_frame_flag = 1, the size of the skipped frames in bits. It includes only the skipped frames...
Definition: va_enc_vp9.h:508
uint16_t bit_offset_qindex
Definition: va_enc_vp9.h:440
uint16_t bit_offset_first_partition_size
Definition: va_enc_vp9.h:446
uint32_t lossless_mode
Specifies if the picture is coded in lossless mode.
Definition: va_enc_vp9.h:323
uint16_t bit_offset_ref_lf_delta
Definition: va_enc_vp9.h:419
uint32_t ref_last_idx
Last Reference Frame index Specifies the index to RefFrameList[] which points to the LAST reference f...
Definition: va_enc_vp9.h:205
uint8_t log2_tile_rows
log2 of number of tile rows Corresponds to the same VP9 syntax element in frame header....
Definition: va_enc_vp9.h:468
uint32_t allow_high_precision_mv
Indicate high precision mode for Motion Vector prediction 0: normal mode 1: high precision mode.
Definition: va_enc_vp9.h:273
uint16_t bit_offset_segmentation
Definition: va_enc_vp9.h:454
int8_t luma_dc_qindex_delta
Definition: va_enc_vp9.h:371
uint8_t log2_tile_columns
log2 of number of tile columns Corresponds to the same VP9 syntax element in frame header....
Definition: va_enc_vp9.h:474
uint32_t super_frame_flag
Indicate super frame syntax should be inserted 0 current frame is not encapsulated in super frame str...
Definition: va_enc_vp9.h:351
uint32_t intra_only
Indicate intra-only for inter pictures. Must be 0 for key frames. 0: inter frame use both intra and i...
Definition: va_enc_vp9.h:267
uint8_t filter_level
filter level Corresponds to the same VP9 syntax element in frame header.
Definition: va_enc_vp9.h:386
int8_t chroma_dc_qindex_delta
Definition: va_enc_vp9.h:381
uint32_t auto_segmentation
Indicate how segmentation is specified 0 application specifies segmentation partitioning and relevant...
Definition: va_enc_vp9.h:343
uint32_t comp_prediction_mode
MV prediction mode. Corresponds to VP9 variable with same name. comp_prediction_mode = 0: single pred...
Definition: va_enc_vp9.h:334
uint32_t ref_last_sign_bias
Specifies the Sign Bias of the LAST reference frame. It corresponds to ref_frame_sign_bias[LAST_FRAME...
Definition: va_enc_vp9.h:210
uint16_t bit_size_segmentation
length in bit of segmentation portion from the location in bit stream where segmentation_enabled synt...
Definition: va_enc_vp9.h:461
uint8_t skip_frame_flag
indicate frame-skip happens Application may choose to drop/skip one or mulitple encoded frames or to-...
Definition: va_enc_vp9.h:493
uint8_t luma_ac_qindex
Base Q index in the VP9 term. Added with per segment delta Q index to get Q index of Luma AC.
Definition: va_enc_vp9.h:366
uint8_t refresh_frame_flags
indicate which frames in DPB should be refreshed. same syntax and semantic as in VP9 code.
Definition: va_enc_vp9.h:361
uint32_t show_frame
show_frame 0: current frame is not for display 1: current frame is for display
Definition: va_enc_vp9.h:254
uint32_t frame_type
Definition: va_enc_vp9.h:248
uint32_t ref_arf_idx
Alternate Reference Frame index Specifies the index to RefFrameList[] which points to the Alternate r...
Definition: va_enc_vp9.h:227
uint32_t ref_frame_ctrl_l0
Indiates which frames to be used as reference. (Ref_frame_ctrl & 0x01) ? 1: last frame as reference f...
Definition: va_enc_vp9.h:198
uint16_t bit_offset_mode_lf_delta
Definition: va_enc_vp9.h:428
uint32_t frame_width_src
Definition: va_enc_vp9.h:158
uint32_t ref_gf_sign_bias
Specifies the Sign Bias of the GOLDEN reference frame. It corresponds to ref_frame_sign_bias[GOLDEN_F...
Definition: va_enc_vp9.h:221
uint32_t error_resilient_mode
Definition: va_enc_vp9.h:260
uint32_t ref_arf_sign_bias
Specifies the Sign Bias of the ALTERNATE reference frame. It corresponds to ref_frame_sign_bias[ALTRE...
Definition: va_enc_vp9.h:232
uint8_t number_skip_frames
The number of frames skipped prior to the current frame. It includes only the skipped frames that wer...
Definition: va_enc_vp9.h:500
uint32_t mcomp_filter_type
Motion Compensation Filter type 0: eight-tap (only this mode is supported now.) 1: eight-tap-smooth 2...
Definition: va_enc_vp9.h:282
uint16_t bit_offset_lf_level
Definition: va_enc_vp9.h:434
int8_t chroma_ac_qindex_delta
Definition: va_enc_vp9.h:376
Per segment parameters.
Definition: va_enc_vp9.h:518
uint8_t segment_reference_skipped
Indicates if per segment skip mode is enabled. Corresponding to variable feature_enabled when j == SE...
Definition: va_enc_vp9.h:542
int8_t segment_lf_level_delta
Specifies per segment Loop Filter Delta. Must be 0 when segmentation_enabled == 0....
Definition: va_enc_vp9.h:554
int16_t segment_qindex_delta
Specifies per segment QIndex Delta. Must be 0 when segmentation_enabled == 0. value range: [-255....
Definition: va_enc_vp9.h:560
uint8_t segment_reference_enabled
Indicates if per segment reference frame indicator is enabled. Corresponding to variable feature_enab...
Definition: va_enc_vp9.h:525
uint8_t segment_reference
Specifies per segment reference indication. 0: reserved 1: Last ref 2: golden 3: altref Value can be ...
Definition: va_enc_vp9.h:536
VP9 Encoding Sequence Parameter Buffer Structure.
Definition: va_enc_vp9.h:95
uint32_t max_frame_width
Frame size note: Picture resolution may change frame by frame. Application needs to allocate surfaces...
Definition: va_enc_vp9.h:105
uint32_t bits_per_second
Definition: va_enc_vp9.h:134