VA-API  2.13.0.pre1
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
59 {
65  uint16_t base_qp_index;
66 
72 
79 
80  /* suggested next frame width */
81  uint16_t next_frame_width;
82 
83  /* suggested next frame height */
84  uint16_t next_frame_height;
85 
87  uint32_t va_reserved[VA_PADDING_LOW];
89 
96 typedef struct _VAEncSequenceParameterBufferVP9
97 {
106  /* maximum frame width in pixels for the whole sequence */
107  uint32_t max_frame_width;
108 
109  /* maximum frame height in pixels for the whole sequence */
110  uint32_t max_frame_height;
111 
112  /* auto keyframe placement, non-zero means enable auto keyframe placement */
113  uint32_t kf_auto;
114 
115  /* keyframe minimum interval */
116  uint32_t kf_min_dist;
117 
118  /* keyframe maximum interval */
119  uint32_t kf_max_dist;
120 
121 
122  /* RC related fields. RC modes are set with VAConfigAttribRateControl */
123  /* For VP9, CBR implies HRD conformance and VBR implies no HRD conformance */
124 
136  uint32_t bits_per_second;
137 
138  /* Period between key frames */
139  uint32_t intra_period;
140 
142  uint32_t va_reserved[VA_PADDING_LOW];
144 
145 
152 typedef struct _VAEncPictureParameterBufferVP9
153 {
160  /* raw source frame width in pixels */
161  uint32_t frame_width_src;
162  /* raw source frame height in pixels */
163  uint32_t frame_height_src;
164 
165  /* to be encoded frame width in pixels */
166  uint32_t frame_width_dst;
167  /* to be encoded frame height in pixels */
168  uint32_t frame_height_dst;
169 
170  /* surface to store reconstructed frame, not used for enc only case */
171  VASurfaceID reconstructed_frame;
172 
184  VASurfaceID reference_frames[8];
185 
186  /* buffer to store coded data */
187  VABufferID coded_buf;
188 
189  union {
190  struct {
191  /* force this frame to be a keyframe */
192  uint32_t force_kf : 1;
193 
201  uint32_t ref_frame_ctrl_l0 : 3;
202  uint32_t ref_frame_ctrl_l1 : 3;
203 
208  uint32_t ref_last_idx : 3;
209 
213  uint32_t ref_last_sign_bias : 1;
214 
219  uint32_t ref_gf_idx : 3;
220 
224  uint32_t ref_gf_sign_bias : 1;
225 
230  uint32_t ref_arf_idx : 3;
231 
235  uint32_t ref_arf_sign_bias : 1;
236 
237  /* The temporal id the frame belongs to */
238  uint32_t temporal_id : 8;
239 
240  uint32_t reserved : 5;
241  } bits;
242  uint32_t value;
243  } ref_flags;
244 
245  union {
246  struct {
251  uint32_t frame_type : 1;
252 
257  uint32_t show_frame : 1;
258 
263  uint32_t error_resilient_mode : 1;
264 
270  uint32_t intra_only : 1;
271 
277 
285  uint32_t mcomp_filter_type : 3;
286  uint32_t frame_parallel_decoding_mode : 1;
287  uint32_t reset_frame_context : 2;
288  uint32_t refresh_frame_context : 1;
289  uint32_t frame_context_idx : 2;
290  uint32_t segmentation_enabled : 1;
291 
292  /* corresponds to variable temporal_update in VP9 code.
293  * Indicates whether Segment ID is from bitstream or from previous
294  * frame.
295  * 0: Segment ID from bitstream
296  * 1: Segment ID from previous frame
297  */
298  uint32_t segmentation_temporal_update : 1;
299 
300  /* corresponds to variable update_mb_segmentation_map in VP9 code.
301  * Indicates how hardware determines segmentation ID
302  * 0: intra block - segment id is 0;
303  * inter block - segment id from previous frame
304  * 1: intra block - segment id from bitstream (app or GPU decides)
305  * inter block - depends on segmentation_temporal_update
306  */
307  uint32_t segmentation_update_map : 1;
308 
326  uint32_t lossless_mode : 1;
327 
337  uint32_t comp_prediction_mode : 2;
338 
346  uint32_t auto_segmentation : 1;
347 
354  uint32_t super_frame_flag : 1;
355 
356  uint32_t reserved : 10;
357  } bits;
358  uint32_t value;
359  } pic_flags;
360 
365 
369  uint8_t luma_ac_qindex;
370 
375 
380 
385 
389  uint8_t filter_level;
390 
396 
403  int8_t ref_lf_delta[4];
404 
411  int8_t mode_lf_delta[2];
412 
423 
432 
438 
444 
450 
458 
465 
466 
471  uint8_t log2_tile_rows;
472 
478 
497 
504 
512 
514  uint32_t va_reserved[VA_PADDING_MEDIUM];
516 
517 
521 typedef struct _VAEncSegParamVP9
522 {
523  union {
524  struct {
530 
540  uint8_t segment_reference : 2;
541 
547 
548  uint8_t reserved : 4;
549 
550  } bits;
551  uint8_t value;
552  } seg_flags;
553 
559 
565 
567  uint32_t va_reserved[VA_PADDING_LOW];
569 
579 typedef struct _VAEncMiscParameterTypeVP9PerSegmantParam
580 {
584  VAEncSegParamVP9 seg_data[8];
585 
587  uint32_t va_reserved[VA_PADDING_LOW];
589 
590 
604 #ifdef __cplusplus
605 }
606 #endif
607 
608 #endif /* VA_ENC_VP9_H */
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:270
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:107
uint32_t auto_segmentation
Indicate how segmentation is specified 0 application specifies segmentation partitioning and relevant...
Definition: va_enc_vp9.h:346
int8_t chroma_dc_qindex_delta
Definition: va_enc_vp9.h:384
int8_t luma_dc_qindex_delta
Definition: va_enc_vp9.h:374
uint16_t bit_offset_mode_lf_delta
Definition: va_enc_vp9.h:431
uint32_t error_resilient_mode
Definition: va_enc_vp9.h:263
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:564
Per segment parameters.
Definition: va_enc_vp9.h:521
uint8_t loop_filter_level
Definition: va_enc_vp9.h:71
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:364
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:477
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:503
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:276
uint32_t lossless_mode
Specifies if the picture is coded in lossless mode.
Definition: va_enc_vp9.h:326
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:546
uint8_t filter_level
filter level Corresponds to the same VP9 syntax element in frame header.
Definition: va_enc_vp9.h:389
VAGenericID VABufferID
Definition: va.h:1926
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:511
Definition: va_enc_vp9.h:579
uint32_t bits_per_second
Definition: va_enc_vp9.h:136
uint16_t base_qp_index
Definition: va_enc_vp9.h:65
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:219
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:208
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:496
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:213
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:464
uint16_t bit_offset_ref_lf_delta
Definition: va_enc_vp9.h:422
VP9 Encoding Status Data Buffer Structure.
Definition: va_enc_vp9.h:58
uint8_t segment_reference_enabled
Indicates if per segment reference frame indicator is enabled. Corresponding to variable feature_enab...
Definition: va_enc_vp9.h:529
uint8_t log2_tile_rows
log2 of number of tile rows Corresponds to the same VP9 syntax element in frame header. value range [0..2]
Definition: va_enc_vp9.h:471
uint16_t bit_offset_qindex
Definition: va_enc_vp9.h:443
uint8_t long_term_indication
Definition: va_enc_vp9.h:78
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:369
uint16_t bit_offset_first_partition_size
Definition: va_enc_vp9.h:449
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:201
uint8_t sharpness_level
Definition: va_enc_vp9.h:395
uint32_t frame_width_src
Definition: va_enc_vp9.h:161
#define VA_PADDING_LOW
Definition: va.h:358
int8_t segment_lf_level_delta
Specifies per segment Loop Filter Delta. Must be 0 when segmentation_enabled == 0. value range: [-63..63].
Definition: va_enc_vp9.h:558
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:540
VP9 Encoding Sequence Parameter Buffer Structure.
Definition: va_enc_vp9.h:96
uint32_t frame_type
Definition: va_enc_vp9.h:251
VP9 Encoding Picture Parameter Buffer Structure.
Definition: va_enc_vp9.h:152
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:224
uint16_t bit_offset_segmentation
Definition: va_enc_vp9.h:457
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:337
int8_t chroma_ac_qindex_delta
Definition: va_enc_vp9.h:379
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:235
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:285
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:354
uint16_t bit_offset_lf_level
Definition: va_enc_vp9.h:437
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:230
uint32_t show_frame
show_frame 0: current frame is not for display 1: current frame is for display
Definition: va_enc_vp9.h:257