VA-API  2.13.0.pre1
va_dec_av1.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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_AV1_H
33 #define VA_DEC_AV1_H
34 
35 #include <stdint.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
56  struct {
62  uint32_t lst_support : 2;
63  /* Reserved for future use. */
64  uint32_t reserved : 30;
65  } bits;
66  uint32_t value;
68 
80 typedef struct _VASegmentationStructAV1 {
81  union {
82  struct {
90  uint32_t enabled : 1;
96  uint32_t update_map : 1;
102  uint32_t temporal_update : 1;
108  uint32_t update_data : 1;
109 
111  uint32_t reserved : 28;
112  } bits;
113  uint32_t value;
114  } segment_info_fields;
115 
137  int16_t feature_data[8][8];
138 
144  uint8_t feature_mask[8];
145 
147  uint32_t va_reserved[VA_PADDING_LOW];
148 
150 
153 typedef struct _VAFilmGrainStructAV1 {
154  union {
155  struct {
160  uint32_t apply_grain : 1;
161  uint32_t chroma_scaling_from_luma : 1;
162  uint32_t grain_scaling_minus_8 : 2;
163  uint32_t ar_coeff_lag : 2;
164  uint32_t ar_coeff_shift_minus_6 : 2;
165  uint32_t grain_scale_shift : 2;
166  uint32_t overlap_flag : 1;
167  uint32_t clip_to_restricted_range : 1;
169  uint32_t reserved : 20;
170  } bits;
171  uint32_t value;
172  } film_grain_info_fields;
173 
174  uint16_t grain_seed;
175  /* value range [0..14] */
176  uint8_t num_y_points;
177  uint8_t point_y_value[14];
178  uint8_t point_y_scaling[14];
179  /* value range [0..10] */
180  uint8_t num_cb_points;
181  uint8_t point_cb_value[10];
182  uint8_t point_cb_scaling[10];
183  /* value range [0..10] */
184  uint8_t num_cr_points;
185  uint8_t point_cr_value[10];
186  uint8_t point_cr_scaling[10];
187  /* value range [-128..127] */
188  int8_t ar_coeffs_y[24];
189  int8_t ar_coeffs_cb[25];
190  int8_t ar_coeffs_cr[25];
191  uint8_t cb_mult;
192  uint8_t cb_luma_mult;
193  uint16_t cb_offset;
194  uint8_t cr_mult;
195  uint8_t cr_luma_mult;
196  uint16_t cr_offset;
197 
199  uint32_t va_reserved[VA_PADDING_LOW];
200 
202 
203 typedef enum {
215 
216 typedef struct _VAWarpedMotionParamsAV1{
217 
219  VAAV1TransformationType wmtype;
220 
226  int32_t wmmat[8];
227 
228  /* valid or invalid on affine set */
229  uint8_t invalid;
230 
232  uint32_t va_reserved[VA_PADDING_LOW];
233 
234 } VAWarpedMotionParamsAV1;
235 
243 typedef struct _VADecPictureParameterBufferAV1
244 {
252  uint8_t profile;
253 
254  uint8_t order_hint_bits_minus_1;
255 
262  uint8_t bit_depth_idx;
263 
266 
267  union {
268  struct {
269  uint32_t still_picture : 1;
270  uint32_t use_128x128_superblock : 1;
271  uint32_t enable_filter_intra : 1;
272  uint32_t enable_intra_edge_filter : 1;
273 
276  uint32_t enable_masked_compound : 1;
277 
278  uint32_t enable_dual_filter : 1;
279  uint32_t enable_order_hint : 1;
280  uint32_t enable_jnt_comp : 1;
281  uint32_t enable_cdef : 1;
282  uint32_t mono_chrome : 1;
283  uint32_t color_range : 1;
284  uint32_t subsampling_x : 1;
285  uint32_t subsampling_y : 1;
286  va_deprecated uint32_t chroma_sample_position : 1;
287  uint32_t film_grain_params_present : 1;
289  uint32_t reserved : 16;
290  } fields;
291  uint32_t value;
292  } seq_info_fields;
293 
299  VASurfaceID current_frame;
300 
306 
312 
331  VASurfaceID *anchor_frames_list;
332 
339  uint16_t frame_height_minus1;
340 
346  uint16_t output_frame_height_in_tiles_minus_1;
347 
357  VASurfaceID ref_frame_map[8];
358 
369  uint8_t ref_frame_idx[7];
370 
379 
380  uint8_t order_hint;
381 
382  VASegmentationStructAV1 seg_info;
383  VAFilmGrainStructAV1 film_grain_info;
384 
390  uint8_t tile_cols;
391  uint8_t tile_rows;
392 
393  /* The width/height of a tile minus 1 in units of superblocks. Though the
394  * maximum number of tiles is 64, since ones of the last tile are computed
395  * from ones of the other tiles and frame_width/height, they are not
396  * necessarily specified.
397  */
398  uint16_t width_in_sbs_minus_1[63];
399  uint16_t height_in_sbs_minus_1[63];
400 
406 
407  /* specify the tile index for context updating */
408  uint16_t context_update_tile_id;
409 
410  union
411  {
412  struct
413  {
427  uint32_t frame_type : 2;
428  uint32_t show_frame : 1;
429  uint32_t showable_frame : 1;
430  uint32_t error_resilient_mode : 1;
431  uint32_t disable_cdf_update : 1;
432  uint32_t allow_screen_content_tools : 1;
433  uint32_t force_integer_mv : 1;
434  uint32_t allow_intrabc : 1;
435  uint32_t use_superres : 1;
436  uint32_t allow_high_precision_mv : 1;
437  uint32_t is_motion_mode_switchable : 1;
438  uint32_t use_ref_frame_mvs : 1;
439  /* disable_frame_end_update_cdf is coded as refresh_frame_context. */
440  uint32_t disable_frame_end_update_cdf : 1;
441  uint32_t uniform_tile_spacing_flag : 1;
442  uint32_t allow_warped_motion : 1;
444  uint32_t large_scale_tile : 1;
445 
447  uint32_t reserved : 15;
448  } bits;
449  uint32_t value;
450  } pic_info_fields;
451 
457 
461  uint8_t interp_filter;
462 
466  uint8_t filter_level[2];
467 
471  uint8_t filter_level_u;
472  uint8_t filter_level_v;
473 
474  union
475  {
476  struct
477  {
481  uint8_t sharpness_level : 3;
482  uint8_t mode_ref_delta_enabled : 1;
483  uint8_t mode_ref_delta_update : 1;
484 
486  uint8_t reserved : 3;
487  } bits;
488  uint8_t value;
489  } loop_filter_info_fields;
490 
495  int8_t ref_deltas[8];
496 
501  int8_t mode_deltas[2];
502 
508  uint8_t base_qindex;
512  int8_t y_dc_delta_q;
516  int8_t u_dc_delta_q;
520  int8_t u_ac_delta_q;
524  int8_t v_dc_delta_q;
528  int8_t v_ac_delta_q;
529 
532  union
533  {
534  struct
535  {
536  uint16_t using_qmatrix : 1;
541  uint16_t qm_y : 4;
542  uint16_t qm_u : 4;
543  uint16_t qm_v : 4;
544 
546  uint16_t reserved : 3;
547  } bits;
548  uint16_t value;
549  } qmatrix_fields;
550 
551  union
552  {
553  struct
554  {
557  uint32_t delta_q_present_flag : 1;
558  uint32_t log2_delta_q_res : 2;
559 
562  uint32_t delta_lf_present_flag : 1;
563  uint32_t log2_delta_lf_res : 2;
564 
567  uint32_t delta_lf_multi : 1;
568 
572  uint32_t tx_mode : 2;
573 
574  /* AV1 frame reference mode semantic */
575  uint32_t reference_select : 1;
576 
577  uint32_t reduced_tx_set_used : 1;
578 
579  uint32_t skip_mode_present : 1;
580 
582  uint32_t reserved : 20;
583  } bits;
584  uint32_t value;
585  } mode_control_fields;
586 
589  /* value range [0..3] */
591  /* value range [0..3] */
592  uint8_t cdef_bits;
593 
608  /* value range [0..63] */
609  uint8_t cdef_y_strengths[8];
610  /* value range [0..63] */
611  uint8_t cdef_uv_strengths[8];
612 
615  union
616  {
617  struct
618  {
619  uint16_t yframe_restoration_type : 2;
620  uint16_t cbframe_restoration_type : 2;
621  uint16_t crframe_restoration_type : 2;
622  uint16_t lr_unit_shift : 2;
623  uint16_t lr_uv_shift : 1;
624 
626  uint16_t reserved : 7;
627  } bits;
628  uint16_t value;
629  } loop_restoration_fields;
630 
633  VAWarpedMotionParamsAV1 wm[7];
634 
638  uint32_t va_reserved[VA_PADDING_MEDIUM];
640 
641 
658 typedef struct _VASliceParameterBufferAV1
659 {
666  uint32_t slice_data_size;
674  uint32_t slice_data_flag;
675 
676  uint16_t tile_row;
677  uint16_t tile_column;
678 
679  va_deprecated uint16_t tg_start;
680  va_deprecated uint16_t tg_end;
687 
693 
697  uint32_t va_reserved[VA_PADDING_LOW];
699 
700 
703 #ifdef __cplusplus
704 }
705 #endif
706 
707 #endif /* VA_DEC_AV1_H */
AV1 Decoding Picture Parameter Buffer Structure.
Definition: va_dec_av1.h:80
uint32_t enabled
Definition: va_dec_av1.h:90
uint32_t temporal_update
Definition: va_dec_av1.h:102
uint8_t base_qindex
quantization
Definition: va_dec_av1.h:508
uint8_t filter_level_u
chroma loop filter levels. value range [0..63].
Definition: va_dec_av1.h:471
uint8_t primary_ref_frame
primary reference frame index Index into ref_frame_idx[], specifying which reference frame contains p...
Definition: va_dec_av1.h:378
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:169
Definition: va_dec_av1.h:211
int8_t v_ac_delta_q
V AC delta from Y AC value range [-64..63].
Definition: va_dec_av1.h:528
uint32_t delta_q_present_flag
delta_q parameters
Definition: va_dec_av1.h:557
uint32_t delta_lf_multi
CONFIG_LOOPFILTER_LEVEL.
Definition: va_dec_av1.h:567
uint32_t slice_data_flag
Definition: va_dec_av1.h:674
Definition: va_dec_av1.h:205
int8_t u_dc_delta_q
U DC delta from Y AC value range [-64..63].
Definition: va_dec_av1.h:516
uint32_t update_map
Definition: va_dec_av1.h:96
VASurfaceID * anchor_frames_list
anchor frame list for large scale tile For large scale tile applications, the anchor frames could com...
Definition: va_dec_av1.h:331
VASurfaceID current_frame
Picture level information.
Definition: va_dec_av1.h:299
uint32_t slice_data_size
The byte count of current tile in the bitstream buffer, starting from first byte of the buffer...
Definition: va_dec_av1.h:666
uint8_t anchor_frame_idx
anchor frame index for large scale tile. index into an array AnchorFrames of the frames that the tile...
Definition: va_dec_av1.h:686
uint32_t slice_data_offset
Definition: va_dec_av1.h:670
uint32_t delta_lf_present_flag
delta_lf parameters
Definition: va_dec_av1.h:562
uint16_t tile_idx_in_tile_list
tile index in the tile list. Valid only when large_scale_tile is enabled. Driver uses this field to d...
Definition: va_dec_av1.h:692
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:582
uint32_t frame_type
flags for current picture same syntax and semantic as those in AV1 code
Definition: va_dec_av1.h:427
uint16_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:546
uint8_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:486
uint8_t profile
sequence level information
Definition: va_dec_av1.h:252
uint16_t qm_y
qm level value range [0..15] Invalid if using_qmatrix equals 0.
Definition: va_dec_av1.h:541
VASurfaceID current_display_picture
display buffer of current picture Used for film grain applied decoded picture. Valid only when apply_...
Definition: va_dec_av1.h:305
uint32_t tx_mode
read_tx_mode value range [0..2]
Definition: va_dec_av1.h:572
uint16_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:626
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:111
Definition: va_dec_av1.h:209
uint32_t update_data
Definition: va_dec_av1.h:108
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:447
int8_t y_dc_delta_q
Y DC delta from Y AC value range [-64..63].
Definition: va_dec_av1.h:512
AV1 Slice Parameter Buffer Structure.
Definition: va_dec_av1.h:658
uint8_t cdef_damping_minus_3
CDEF parameters.
Definition: va_dec_av1.h:590
VAAV1TransformationType
Definition: va_dec_av1.h:203
uint8_t tile_cols
tile structure When uniform_tile_spacing_flag == 1, width_in_sbs_minus_1[] and height_in_sbs_minus_1[...
Definition: va_dec_av1.h:390
Definition: va_dec_av1.h:55
uint8_t interp_filter
Interpolation filter. value range [0..4].
Definition: va_dec_av1.h:461
#define VA_PADDING_LOW
Definition: va.h:358
uint8_t anchor_frames_num
number of anchor frames for large scale tile This parameter gives the number of entries of anchor_fra...
Definition: va_dec_av1.h:311
uint16_t tile_count_minus_1
number of tiles minus 1 in large scale tile list Same as AV1 semantic element. Valid only when large_...
Definition: va_dec_av1.h:405
uint8_t superres_scale_denominator
Supper resolution scale denominator. When use_superres=1, superres_scale_denominator must be in the r...
Definition: va_dec_av1.h:456
uint8_t sharpness_level
flags for reference pictures same syntax and semantic as those in AV1 code
Definition: va_dec_av1.h:481
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:289
uint16_t output_frame_width_in_tiles_minus_1
Output frame buffer size in unit of tiles Valid only when large_scale_tile equals 1...
Definition: va_dec_av1.h:345
Definition: va_dec_av1.h:213
uint32_t lst_support
Definition: va_dec_av1.h:62
uint8_t matrix_coefficients
corresponds to AV1 spec variable of the same name.
Definition: va_dec_av1.h:265
uint8_t bit_depth_idx
bit depth index value range [0..2] 0 - bit depth 8; 1 - bit depth 10; 2 - bit depth 12; ...
Definition: va_dec_av1.h:262
Definition: va_dec_av1.h:207
uint32_t large_scale_tile
indicate if current frame in large scale tile mode
Definition: va_dec_av1.h:444
uint32_t apply_grain
Specify whether or not film grain is applied on current frame. If set to 0, all the rest parameters s...
Definition: va_dec_av1.h:160
uint32_t enable_interintra_compound
Definition: va_dec_av1.h:275
uint16_t frame_width_minus1
Picture resolution minus 1 Picture original resolution. If SuperRes is enabled, this is the upscaled ...
Definition: va_dec_av1.h:338
AV1 Decoding Picture Parameter Buffer Structure.
Definition: va_dec_av1.h:243
int8_t v_dc_delta_q
V DC delta from Y AC value range [-64..63].
Definition: va_dec_av1.h:524
Film Grain Information.
Definition: va_dec_av1.h:153
int8_t u_ac_delta_q
U AC delta from Y AC value range [-64..63].
Definition: va_dec_av1.h:520