VA-API  2.22.0
va_enc_vp8.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2012 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 
32 #ifndef VA_ENC_VP8_H
33 #define VA_ENC_VP8_H
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
51 typedef struct _VAEncSequenceParameterBufferVP8 {
52  /* frame width in pixels */
53  uint32_t frame_width;
54  /* frame height in pixels */
55  uint32_t frame_height;
56  /* horizontal scale */
57  uint32_t frame_width_scale;
58  /* vertical scale */
59  uint32_t frame_height_scale;
60 
61  /* whether to enable error resilience features */
62  uint32_t error_resilient;
63  /* auto keyframe placement, non-zero means enable auto keyframe placement */
64  uint32_t kf_auto;
65  /* keyframe minimum interval */
66  uint32_t kf_min_dist;
67  /* keyframe maximum interval */
68  uint32_t kf_max_dist;
69 
70 
71  /* RC related fields. RC modes are set with VAConfigAttribRateControl */
72  /* For VP8, CBR implies HRD conformance and VBR implies no HRD conformance */
73 
85  uint32_t bits_per_second;
86  /* Period between I frames. */
87  uint32_t intra_period;
88 
89  /* reference and reconstructed frame buffers
90  * Used for driver auto reference management when configured through
91  * VAConfigAttribEncAutoReference.
92  */
93  VASurfaceID reference_frames[4];
94 
96  uint32_t va_reserved[VA_PADDING_LOW];
98 
99 
106 typedef struct _VAEncPictureParameterBufferVP8 {
107  /* surface to store reconstructed frame */
108  VASurfaceID reconstructed_frame;
109 
110  /*
111  * surfaces to store reference frames in non auto reference mode
112  * VA_INVALID_SURFACE can be used to denote an invalid reference frame.
113  */
114  VASurfaceID ref_last_frame;
115  VASurfaceID ref_gf_frame;
116  VASurfaceID ref_arf_frame;
117 
118  /* buffer to store coded data */
119  VABufferID coded_buf;
120 
121  union {
122  struct {
123  /* force this frame to be a keyframe */
124  uint32_t force_kf : 1;
125  /* don't reference the last frame */
126  uint32_t no_ref_last : 1;
127  /* don't reference the golden frame */
128  uint32_t no_ref_gf : 1;
129  /* don't reference the alternate reference frame */
130  uint32_t no_ref_arf : 1;
131  /* The temporal id the frame belongs to. */
132  uint32_t temporal_id : 8;
142  uint32_t first_ref : 2;
143  uint32_t second_ref : 2;
145  uint32_t reserved : 16;
146  } bits;
147  uint32_t value;
148  } ref_flags;
149 
150  union {
151  struct {
152  /* version */
153  uint32_t frame_type : 1;
154  uint32_t version : 3;
155  /* show_frame */
156  uint32_t show_frame : 1;
157  /* color_space */
158  uint32_t color_space : 1;
159  /* 0: bicubic, 1: bilinear, other: none */
160  uint32_t recon_filter_type : 2;
161  /* 0: no loop fitler, 1: simple loop filter */
162  uint32_t loop_filter_type : 2;
163  /* 0: disabled, 1: normal, 2: simple */
164  uint32_t auto_partitions : 1;
165  /* same as log2_nbr_of_dct_partitions in frame header syntax */
166  uint32_t num_token_partitions : 2;
167 
176  uint32_t clamping_type : 1;
177  /* indicate segmentation is enabled for the current frame. */
178  uint32_t segmentation_enabled : 1;
200  uint32_t refresh_entropy_probs : 1;
204  uint32_t refresh_golden_frame : 1;
214  uint32_t refresh_last : 1;
218  uint32_t copy_buffer_to_golden : 2;
226  uint32_t sign_bias_golden : 1;
231  uint32_t sign_bias_alternate : 1;
236  uint32_t mb_no_coeff_skip : 1;
246  uint32_t forced_lf_adjustment : 1;
247  uint32_t reserved : 2;
248  } bits;
249  uint32_t value;
250  } pic_flags;
251 
258  int8_t loop_filter_level[4];
259 
265  int8_t ref_lf_delta[4];
266 
272  int8_t mode_lf_delta[4];
273 
279 
286 
295 
297  uint32_t va_reserved[VA_PADDING_LOW];
299 
300 
310 typedef struct _VAEncMBMapBufferVP8 {
315  uint32_t num_mbs;
319  uint8_t *mb_segment_id;
320 
322  uint32_t va_reserved[VA_PADDING_LOW];
324 
325 
334 typedef struct _VAQMatrixBufferVP8 {
335  uint16_t quantization_index[4];
336  int16_t quantization_index_delta[5];
337 
339  uint32_t va_reserved[VA_PADDING_LOW];
341 
342 
343 
346 #ifdef __cplusplus
347 }
348 #endif
349 
350 #endif /* VA_ENC_VP8_H */
#define VA_PADDING_LOW
Definition: va.h:360
VAGenericID VABufferID
Definition: va.h:2019
VP8 MB Segmentation ID Buffer.
Definition: va_enc_vp8.h:310
uint32_t num_mbs
Definition: va_enc_vp8.h:315
uint8_t * mb_segment_id
Definition: va_enc_vp8.h:319
VP8 Encoding Picture Parameter Buffer Structure.
Definition: va_enc_vp8.h:106
uint32_t reserved
Reserved for future use, must be zero.
Definition: va_enc_vp8.h:145
uint32_t refresh_entropy_probs
Definition: va_enc_vp8.h:200
uint32_t first_ref
Definition: va_enc_vp8.h:142
uint8_t clamp_qindex_low
Definition: va_enc_vp8.h:294
uint8_t sharpness_level
Definition: va_enc_vp8.h:278
uint32_t sign_bias_alternate
Definition: va_enc_vp8.h:231
uint32_t sign_bias_golden
Definition: va_enc_vp8.h:226
uint32_t clamping_type
Definition: va_enc_vp8.h:176
uint8_t clamp_qindex_high
Definition: va_enc_vp8.h:285
uint32_t update_mb_segmentation_map
Definition: va_enc_vp8.h:183
uint32_t update_segment_feature_data
Definition: va_enc_vp8.h:188
uint32_t forced_lf_adjustment
Definition: va_enc_vp8.h:246
uint32_t refresh_alternate_frame
Definition: va_enc_vp8.h:209
uint32_t copy_buffer_to_golden
Definition: va_enc_vp8.h:218
uint32_t copy_buffer_to_alternate
Definition: va_enc_vp8.h:222
uint32_t loop_filter_adj_enable
Definition: va_enc_vp8.h:193
uint32_t refresh_last
Definition: va_enc_vp8.h:214
uint32_t mb_no_coeff_skip
Definition: va_enc_vp8.h:236
uint32_t refresh_golden_frame
Definition: va_enc_vp8.h:204
VP8 Encoding Sequence Parameter Buffer Structure.
Definition: va_enc_vp8.h:51
uint32_t bits_per_second
Definition: va_enc_vp8.h:85
VP8 Quantization Matrix Buffer Structure.
Definition: va_enc_vp8.h:334