VA-API  2.13.0.pre1
va_dec_vp8.h
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_DEC_VP8_H
33 #define VA_DEC_VP8_H
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
51 typedef struct _VABoolCoderContextVPX
52 {
53  /* partition 0 "range" */
54  uint8_t range;
55  /* partition 0 "value" */
56  uint8_t value;
57  /*
58  * 'partition 0 number of shifts before an output byte is available'
59  * it is the number of remaining bits in 'value' for decoding, range [0, 7].
60  */
61 
62  uint8_t count;
64 
72 typedef struct _VAPictureParameterBufferVP8
73 {
74  /* frame width in pixels */
75  uint32_t frame_width;
76  /* frame height in pixels */
77  uint32_t frame_height;
78 
79  /* specifies the "last" reference frame */
80  VASurfaceID last_ref_frame;
81  /* specifies the "golden" reference frame */
82  VASurfaceID golden_ref_frame;
83  /* specifies the "alternate" referrence frame */
84  VASurfaceID alt_ref_frame;
85  /* specifies the out-of-loop deblocked frame, not used currently */
86  VASurfaceID out_of_loop_frame;
87 
88  union {
89  struct {
90  /* same as key_frame in bitstream syntax, 0 means a key frame */
91  uint32_t key_frame : 1;
92  /* same as version in bitstream syntax */
93  uint32_t version : 3;
94  /* same as segmentation_enabled in bitstream syntax */
95  uint32_t segmentation_enabled : 1;
96  /* same as update_mb_segmentation_map in bitstream syntax */
97  uint32_t update_mb_segmentation_map : 1;
98  /* same as update_segment_feature_data in bitstream syntax */
99  uint32_t update_segment_feature_data : 1;
100  /* same as filter_type in bitstream syntax */
101  uint32_t filter_type : 1;
102  /* same as sharpness_level in bitstream syntax */
103  uint32_t sharpness_level : 3;
104  /* same as loop_filter_adj_enable in bitstream syntax */
105  uint32_t loop_filter_adj_enable : 1;
106  /* same as mode_ref_lf_delta_update in bitstream syntax */
107  uint32_t mode_ref_lf_delta_update : 1;
108  /* same as sign_bias_golden in bitstream syntax */
109  uint32_t sign_bias_golden : 1;
110  /* same as sign_bias_alternate in bitstream syntax */
111  uint32_t sign_bias_alternate : 1;
112  /* same as mb_no_coeff_skip in bitstream syntax */
113  uint32_t mb_no_coeff_skip : 1;
114  /* flag to indicate that loop filter should be disabled */
115  uint32_t loop_filter_disable : 1;
116  } bits;
117  uint32_t value;
118  } pic_fields;
119 
120  /*
121  * probabilities of the segment_id decoding tree and same as
122  * mb_segment_tree_probs in the spec.
123  */
124  uint8_t mb_segment_tree_probs[3];
125 
126  /* Post-adjustment loop filter levels for the 4 segments */
127  uint8_t loop_filter_level[4];
128  /* loop filter deltas for reference frame based MB level adjustment */
129  int8_t loop_filter_deltas_ref_frame[4];
130  /* loop filter deltas for coding mode based MB level adjustment */
131  int8_t loop_filter_deltas_mode[4];
132 
133  /* same as prob_skip_false in bitstream syntax */
134  uint8_t prob_skip_false;
135  /* same as prob_intra in bitstream syntax */
136  uint8_t prob_intra;
137  /* same as prob_last in bitstream syntax */
138  uint8_t prob_last;
139  /* same as prob_gf in bitstream syntax */
140  uint8_t prob_gf;
141 
142  /*
143  * list of 4 probabilities of the luma intra prediction mode decoding
144  * tree and same as y_mode_probs in frame header
145  */
146  uint8_t y_mode_probs[4];
147  /*
148  * list of 3 probabilities of the chroma intra prediction mode decoding
149  * tree and same as uv_mode_probs in frame header
150  */
151  uint8_t uv_mode_probs[3];
152  /*
153  * updated mv decoding probabilities and same as mv_probs in
154  * frame header
155  */
156  uint8_t mv_probs[2][19];
157 
158  VABoolCoderContextVPX bool_coder_ctx;
159 
161  uint32_t va_reserved[VA_PADDING_LOW];
163 
172 typedef struct _VASliceParameterBufferVP8
173 {
174  /*
175  * number of bytes in the slice data buffer for the partitions
176  */
177  uint32_t slice_data_size;
178  /*
179  * offset to the first byte of partition data (control partition)
180  */
181  uint32_t slice_data_offset;
182  /*
183  * see VA_SLICE_DATA_FLAG_XXX definitions
184  */
185  uint32_t slice_data_flag;
186  /*
187  * offset to the first bit of MB from the first byte of partition data(slice_data_offset)
188  */
189  uint32_t macroblock_offset;
190 
191  /*
192  * Partitions
193  * (1<<log2_nbr_of_dct_partitions)+1, count both control partition (frame header) and toke partition
194  */
195  uint8_t num_of_partitions;
196  /*
197  * partition_size[0] is remaining bytes of control partition after parsed by application.
198  * exclude current byte for the remaining bits in bool_coder_ctx.
199  * exclude the uncompress data chunk since first_part_size 'excluding the uncompressed data chunk'
200  */
201  uint32_t partition_size[9];
202 
204  uint32_t va_reserved[VA_PADDING_LOW];
206 
221 typedef struct _VAProbabilityDataBufferVP8
222 {
223  uint8_t dct_coeff_probs[4][8][3][11];
224 
226  uint32_t va_reserved[VA_PADDING_LOW];
228 
236 typedef struct _VAIQMatrixBufferVP8
237 {
238  /*
239  * array first dimensional is segment and 2nd dimensional is Q index
240  * all Q indexs should be clipped to be range [0, 127]
241  */
242  uint16_t quantization_index[4][6];
243 
245  uint32_t va_reserved[VA_PADDING_LOW];
247 
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 #endif /* VA_DEC_VP8_H */
VP8 Inverse Quantization Matrix Buffer Structure.
Definition: va_dec_vp8.h:236
VPX Bool Coder Context structure.
Definition: va_dec_vp8.h:51
VP8 Decoding Picture Parameter Buffer Structure.
Definition: va_dec_vp8.h:72
VP8 Coefficient Probability Data Buffer Structure.
Definition: va_dec_vp8.h:221
#define VA_PADDING_LOW
Definition: va.h:358
VP8 Slice Parameter Buffer Structure.
Definition: va_dec_vp8.h:172