VA-API  2.19.0
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 {
251  uint8_t profile;
252 
253  uint8_t order_hint_bits_minus_1;
254 
261  uint8_t bit_depth_idx;
262 
265 
266  union {
267  struct {
268  uint32_t still_picture : 1;
269  uint32_t use_128x128_superblock : 1;
270  uint32_t enable_filter_intra : 1;
271  uint32_t enable_intra_edge_filter : 1;
272 
275  uint32_t enable_masked_compound : 1;
276 
277  uint32_t enable_dual_filter : 1;
278  uint32_t enable_order_hint : 1;
279  uint32_t enable_jnt_comp : 1;
280  uint32_t enable_cdef : 1;
281  uint32_t mono_chrome : 1;
282  uint32_t color_range : 1;
283  uint32_t subsampling_x : 1;
284  uint32_t subsampling_y : 1;
285  va_deprecated uint32_t chroma_sample_position : 1;
286  uint32_t film_grain_params_present : 1;
288  uint32_t reserved : 16;
289  } fields;
290  uint32_t value;
291  } seq_info_fields;
292 
298  VASurfaceID current_frame;
299 
305 
311 
330  VASurfaceID *anchor_frames_list;
331 
338  uint16_t frame_height_minus1;
339 
345  uint16_t output_frame_height_in_tiles_minus_1;
346 
356  VASurfaceID ref_frame_map[8];
357 
368  uint8_t ref_frame_idx[7];
369 
378 
379  uint8_t order_hint;
380 
381  VASegmentationStructAV1 seg_info;
382  VAFilmGrainStructAV1 film_grain_info;
383 
389  uint8_t tile_cols;
390  uint8_t tile_rows;
391 
392  /* The width/height of a tile minus 1 in units of superblocks. Though the
393  * maximum number of tiles is 64, since ones of the last tile are computed
394  * from ones of the other tiles and frame_width/height, they are not
395  * necessarily specified.
396  */
397  uint16_t width_in_sbs_minus_1[63];
398  uint16_t height_in_sbs_minus_1[63];
399 
405 
406  /* specify the tile index for context updating */
407  uint16_t context_update_tile_id;
408 
409  union {
410  struct {
424  uint32_t frame_type : 2;
425  uint32_t show_frame : 1;
426  uint32_t showable_frame : 1;
427  uint32_t error_resilient_mode : 1;
428  uint32_t disable_cdf_update : 1;
429  uint32_t allow_screen_content_tools : 1;
430  uint32_t force_integer_mv : 1;
431  uint32_t allow_intrabc : 1;
432  uint32_t use_superres : 1;
433  uint32_t allow_high_precision_mv : 1;
434  uint32_t is_motion_mode_switchable : 1;
435  uint32_t use_ref_frame_mvs : 1;
436  /* disable_frame_end_update_cdf is coded as refresh_frame_context. */
437  uint32_t disable_frame_end_update_cdf : 1;
438  uint32_t uniform_tile_spacing_flag : 1;
439  uint32_t allow_warped_motion : 1;
441  uint32_t large_scale_tile : 1;
442 
444  uint32_t reserved : 15;
445  } bits;
446  uint32_t value;
447  } pic_info_fields;
448 
454 
458  uint8_t interp_filter;
459 
463  uint8_t filter_level[2];
464 
468  uint8_t filter_level_u;
469  uint8_t filter_level_v;
470 
471  union {
472  struct {
476  uint8_t sharpness_level : 3;
477  uint8_t mode_ref_delta_enabled : 1;
478  uint8_t mode_ref_delta_update : 1;
479 
481  uint8_t reserved : 3;
482  } bits;
483  uint8_t value;
484  } loop_filter_info_fields;
485 
490  int8_t ref_deltas[8];
491 
496  int8_t mode_deltas[2];
497 
503  uint8_t base_qindex;
507  int8_t y_dc_delta_q;
511  int8_t u_dc_delta_q;
515  int8_t u_ac_delta_q;
519  int8_t v_dc_delta_q;
523  int8_t v_ac_delta_q;
524 
527  union {
528  struct {
529  uint16_t using_qmatrix : 1;
534  uint16_t qm_y : 4;
535  uint16_t qm_u : 4;
536  uint16_t qm_v : 4;
537 
539  uint16_t reserved : 3;
540  } bits;
541  uint16_t value;
542  } qmatrix_fields;
543 
544  union {
545  struct {
548  uint32_t delta_q_present_flag : 1;
549  uint32_t log2_delta_q_res : 2;
550 
553  uint32_t delta_lf_present_flag : 1;
554  uint32_t log2_delta_lf_res : 2;
555 
558  uint32_t delta_lf_multi : 1;
559 
563  uint32_t tx_mode : 2;
564 
565  /* AV1 frame reference mode semantic */
566  uint32_t reference_select : 1;
567 
568  uint32_t reduced_tx_set_used : 1;
569 
570  uint32_t skip_mode_present : 1;
571 
573  uint32_t reserved : 20;
574  } bits;
575  uint32_t value;
576  } mode_control_fields;
577 
580  /* value range [0..3] */
582  /* value range [0..3] */
583  uint8_t cdef_bits;
584 
599  /* value range [0..63] */
600  uint8_t cdef_y_strengths[8];
601  /* value range [0..63] */
602  uint8_t cdef_uv_strengths[8];
603 
606  union {
607  struct {
608  uint16_t yframe_restoration_type : 2;
609  uint16_t cbframe_restoration_type : 2;
610  uint16_t crframe_restoration_type : 2;
611  uint16_t lr_unit_shift : 2;
612  uint16_t lr_uv_shift : 1;
613 
615  uint16_t reserved : 7;
616  } bits;
617  uint16_t value;
618  } loop_restoration_fields;
619 
622  VAWarpedMotionParamsAV1 wm[7];
623 
627  uint32_t va_reserved[VA_PADDING_MEDIUM];
629 
630 
647 typedef struct _VASliceParameterBufferAV1 {
654  uint32_t slice_data_size;
662  uint32_t slice_data_flag;
663 
664  uint16_t tile_row;
665  uint16_t tile_column;
666 
667  va_deprecated uint16_t tg_start;
668  va_deprecated uint16_t tg_end;
675 
681 
685  uint32_t va_reserved[VA_PADDING_LOW];
687 
688 
691 #ifdef __cplusplus
692 }
693 #endif
694 
695 #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:503
uint32_t enable_interintra_compound
Definition: va_dec_av1.h:274
uint8_t filter_level_u
chroma loop filter levels. value range [0..63].
Definition: va_dec_av1.h:468
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:377
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:523
uint16_t qm_y
qm level value range [0..15] Invalid if using_qmatrix equals 0.
Definition: va_dec_av1.h:534
uint32_t slice_data_flag
Definition: va_dec_av1.h:662
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:511
uint32_t delta_q_present_flag
delta_q parameters
Definition: va_dec_av1.h:548
uint32_t delta_lf_present_flag
delta_lf parameters
Definition: va_dec_av1.h:553
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:330
VASurfaceID current_frame
Picture level information.
Definition: va_dec_av1.h:298
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:654
uint8_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:481
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:674
uint32_t slice_data_offset
Definition: va_dec_av1.h:658
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:680
uint32_t delta_lf_multi
CONFIG_LOOPFILTER_LEVEL.
Definition: va_dec_av1.h:558
uint32_t frame_type
flags for current picture same syntax and semantic as those in AV1 code
Definition: va_dec_av1.h:424
uint8_t profile
sequence level information
Definition: va_dec_av1.h:251
uint32_t tx_mode
read_tx_mode value range [0..2]
Definition: va_dec_av1.h:563
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:304
uint32_t large_scale_tile
indicate if current frame in large scale tile mode
Definition: va_dec_av1.h:441
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:573
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:288
int8_t y_dc_delta_q
Y DC delta from Y AC value range [-64..63].
Definition: va_dec_av1.h:507
AV1 Slice Parameter Buffer Structure.
Definition: va_dec_av1.h:647
uint8_t cdef_damping_minus_3
CDEF parameters.
Definition: va_dec_av1.h:581
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:389
Definition: va_dec_av1.h:55
uint8_t interp_filter
Interpolation filter. value range [0..4].
Definition: va_dec_av1.h:458
#define VA_PADDING_LOW
Definition: va.h:359
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:444
uint16_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:615
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:310
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:404
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:453
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:344
Definition: va_dec_av1.h:213
uint32_t lst_support
Definition: va_dec_av1.h:62
uint16_t reserved
Reserved bytes for future use, must be zero.
Definition: va_dec_av1.h:539
uint8_t matrix_coefficients
corresponds to AV1 spec variable of the same name.
Definition: va_dec_av1.h:264
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:261
Definition: va_dec_av1.h:207
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
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:337
uint8_t sharpness_level
flags for reference pictures same syntax and semantic as those in AV1 code
Definition: va_dec_av1.h:476
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:519
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:515