VA-API  2.8.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 {
53  /* frame width in pixels */
54  uint32_t frame_width;
55  /* frame height in pixels */
56  uint32_t frame_height;
57  /* horizontal scale */
58  uint32_t frame_width_scale;
59  /* vertical scale */
60  uint32_t frame_height_scale;
61 
62  /* whether to enable error resilience features */
63  uint32_t error_resilient;
64  /* auto keyframe placement, non-zero means enable auto keyframe placement */
65  uint32_t kf_auto;
66  /* keyframe minimum interval */
67  uint32_t kf_min_dist;
68  /* keyframe maximum interval */
69  uint32_t kf_max_dist;
70 
71 
72  /* RC related fields. RC modes are set with VAConfigAttribRateControl */
73  /* For VP8, CBR implies HRD conformance and VBR implies no HRD conformance */
74 
86  uint32_t bits_per_second;
87  /* Period between I frames. */
88  uint32_t intra_period;
89 
90  /* reference and reconstructed frame buffers
91  * Used for driver auto reference management when configured through
92  * VAConfigAttribEncAutoReference.
93  */
94  VASurfaceID reference_frames[4];
95 
97  uint32_t va_reserved[VA_PADDING_LOW];
99 
100 
107 typedef struct _VAEncPictureParameterBufferVP8
108 {
109  /* surface to store reconstructed frame */
110  VASurfaceID reconstructed_frame;
111 
112  /*
113  * surfaces to store reference frames in non auto reference mode
114  * VA_INVALID_SURFACE can be used to denote an invalid reference frame.
115  */
116  VASurfaceID ref_last_frame;
117  VASurfaceID ref_gf_frame;
118  VASurfaceID ref_arf_frame;
119 
120  /* buffer to store coded data */
121  VABufferID coded_buf;
122 
123  union {
124  struct {
125  /* force this frame to be a keyframe */
126  uint32_t force_kf : 1;
127  /* don't reference the last frame */
128  uint32_t no_ref_last : 1;
129  /* don't reference the golden frame */
130  uint32_t no_ref_gf : 1;
131  /* don't reference the alternate reference frame */
132  uint32_t no_ref_arf : 1;
133  /* The temporal id the frame belongs to. */
134  uint32_t temporal_id : 8;
144  uint32_t first_ref : 2;
145  uint32_t second_ref : 2;
147  uint32_t reserved : 16;
148  } bits;
149  uint32_t value;
150  } ref_flags;
151 
152  union {
153  struct {
154  /* version */
155  uint32_t frame_type : 1;
156  uint32_t version : 3;
157  /* show_frame */
158  uint32_t show_frame : 1;
159  /* color_space */
160  uint32_t color_space : 1;
161  /* 0: bicubic, 1: bilinear, other: none */
162  uint32_t recon_filter_type : 2;
163  /* 0: no loop fitler, 1: simple loop filter */
164  uint32_t loop_filter_type : 2;
165  /* 0: disabled, 1: normal, 2: simple */
166  uint32_t auto_partitions : 1;
167  /* same as log2_nbr_of_dct_partitions in frame header syntax */
168  uint32_t num_token_partitions : 2;
169 
178  uint32_t clamping_type : 1;
179  /* indicate segmentation is enabled for the current frame. */
180  uint32_t segmentation_enabled : 1;
202  uint32_t refresh_entropy_probs : 1;
206  uint32_t refresh_golden_frame : 1;
216  uint32_t refresh_last : 1;
220  uint32_t copy_buffer_to_golden : 2;
228  uint32_t sign_bias_golden : 1;
233  uint32_t sign_bias_alternate : 1;
238  uint32_t mb_no_coeff_skip : 1;
248  uint32_t forced_lf_adjustment : 1;
249  uint32_t reserved : 2;
250  } bits;
251  uint32_t value;
252  } pic_flags;
253 
260  int8_t loop_filter_level[4];
261 
267  int8_t ref_lf_delta[4];
268 
274  int8_t mode_lf_delta[4];
275 
281 
288 
297 
299  uint32_t va_reserved[VA_PADDING_LOW];
301 
302 
312 typedef struct _VAEncMBMapBufferVP8
313 {
318  uint32_t num_mbs;
322  uint8_t *mb_segment_id;
323 
325  uint32_t va_reserved[VA_PADDING_LOW];
327 
328 
337 typedef struct _VAQMatrixBufferVP8
338 {
339  uint16_t quantization_index[4];
340  int16_t quantization_index_delta[5];
341 
343  uint32_t va_reserved[VA_PADDING_LOW];
345 
346 
347 
350 #ifdef __cplusplus
351 }
352 #endif
353 
354 #endif /* VA_ENC_VP8_H */
VP8 MB Segmentation ID Buffer.
Definition: va_enc_vp8.h:312
uint32_t num_mbs
Definition: va_enc_vp8.h:318
uint32_t sign_bias_alternate
Definition: va_enc_vp8.h:233
VP8 Encoding Sequence Parameter Buffer Structure.
Definition: va_enc_vp8.h:51
uint32_t update_segment_feature_data
Definition: va_enc_vp8.h:190
VP8 Encoding Picture Parameter Buffer Structure.
Definition: va_enc_vp8.h:107
uint8_t * mb_segment_id
Definition: va_enc_vp8.h:322
uint8_t sharpness_level
Definition: va_enc_vp8.h:280
uint32_t copy_buffer_to_alternate
Definition: va_enc_vp8.h:224
uint32_t forced_lf_adjustment
Definition: va_enc_vp8.h:248
uint32_t copy_buffer_to_golden
Definition: va_enc_vp8.h:220
uint32_t sign_bias_golden
Definition: va_enc_vp8.h:228
uint32_t loop_filter_adj_enable
Definition: va_enc_vp8.h:195
VAGenericID VABufferID
Definition: va.h:1647
uint32_t reserved
Reserved for future use, must be zero.
Definition: va_enc_vp8.h:147
VP8 Quantization Matrix Buffer Structure.
Definition: va_enc_vp8.h:337
uint32_t refresh_entropy_probs
Definition: va_enc_vp8.h:202
uint32_t clamping_type
Definition: va_enc_vp8.h:178
uint32_t refresh_golden_frame
Definition: va_enc_vp8.h:206
uint32_t first_ref
Definition: va_enc_vp8.h:144
#define VA_PADDING_LOW
Definition: va.h:260
uint8_t clamp_qindex_high
Definition: va_enc_vp8.h:287
uint32_t update_mb_segmentation_map
Definition: va_enc_vp8.h:185
uint32_t refresh_last
Definition: va_enc_vp8.h:216
uint32_t mb_no_coeff_skip
Definition: va_enc_vp8.h:238
uint8_t clamp_qindex_low
Definition: va_enc_vp8.h:296
uint32_t refresh_alternate_frame
Definition: va_enc_vp8.h:211
uint32_t bits_per_second
Definition: va_enc_vp8.h:86