develop/api/rocdecode.h Source File

develop/api/rocdecode.h Source File#

rocDecode: develop/api/rocdecode.h Source File
rocdecode.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 #ifndef ROCDECAPI
24 #if defined(_WIN32)
25 #define ROCDECAPI __stdcall // for future: only linux is supported in this version
26 #else
27 #define ROCDECAPI
28 #endif
29 #endif
30 
31 #pragma once
32 #include "hip/hip_runtime.h"
33 #include "rocdecode_version.h"
34 
43 #if defined(__cplusplus)
44 extern "C" {
45 #endif // __cplusplus
46 
47 /*********************************************************************************/
50 /*********************************************************************************/
51 
52 typedef void *rocDecDecoderHandle;
53 
54 /*********************************************************************************/
59 /*********************************************************************************/
60 typedef enum rocDecStatus_enum {
61  ROCDEC_DEVICE_INVALID = -1,
62  ROCDEC_CONTEXT_INVALID = -2,
63  ROCDEC_RUNTIME_ERROR = -3,
64  ROCDEC_OUTOF_MEMORY = -4,
65  ROCDEC_INVALID_PARAMETER = -5,
66  ROCDEC_NOT_IMPLEMENTED = -6,
67  ROCDEC_NOT_INITIALIZED = -7,
68  ROCDEC_NOT_SUPPORTED = -8,
69  ROCDEC_SUCCESS = 0,
70 } rocDecStatus;
71 
72 /*********************************************************************************/
77 /*********************************************************************************/
78 typedef enum rocDecVideoCodec_enum {
89  // Uncompressed YUV
90  rocDecVideoCodec_YUV420 = (('I' << 24) | ('Y' << 16) | ('U' << 8) | ('V')),
91  rocDecVideoCodec_YV12 = (('Y' << 24) | ('V' << 16) | ('1' << 8) | ('2')),
92  rocDecVideoCodec_NV12 = (('N' << 24) | ('V' << 16) | ('1' << 8) | ('2')),
93  rocDecVideoCodec_YUYV = (('Y' << 24) | ('U' << 16) | ('Y' << 8) | ('V')),
94  rocDecVideoCodec_UYVY = (('U' << 24) | ('Y' << 16) | ('V' << 8) | ('Y'))
95 } rocDecVideoCodec;
96 
97 /*********************************************************************************/
102 /*********************************************************************************/
113 } rocDecVideoSurfaceFormat;
114 
115 /**************************************************************************************************************/
120 /**************************************************************************************************************/
126 } rocDecVideoChromaFormat;
127 
128 /*************************************************************************/
133 /*************************************************************************/
134 typedef enum rocDecodeStatus_enum {
135  rocDecodeStatus_Invalid = 0, // Decode status is not valid
136  rocDecodeStatus_InProgress = 1, // Decode is in progress
137  rocDecodeStatus_Success = 2, // Decode is completed without any errors
138  // 3 to 7 enums are reserved for future use
139  rocDecodeStatus_Error = 8, // Decode is completed with an error (error is not concealed)
140  rocDecodeStatus_Error_Concealed = 9, // Decode is completed with an error and error is concealed
141  rocDecodeStatus_Displaying = 10, // Decode is completed, displaying in progress
142 } rocDecDecodeStatus;
143 
144 /**************************************************************************************************************/
148 /**************************************************************************************************************/
149 typedef struct _RocdecDecodeCaps {
150  uint8_t device_id;
151  rocDecVideoCodec codec_type;
152  rocDecVideoChromaFormat chroma_format;
153  uint32_t bit_depth_minus_8;
154  uint32_t reserved_1[3];
155  uint8_t is_supported;
156  uint8_t num_decoders;
158  uint32_t max_width;
159  uint32_t max_height;
160  uint16_t min_width;
161  uint16_t min_height;
162  uint32_t reserved_2[6];
164 
165 /**************************************************************************************************************/
169 /**************************************************************************************************************/
170 typedef struct _RocDecoderCreateInfo {
171  uint8_t device_id;
173  uint32_t width;
174  uint32_t height;
176  rocDecVideoCodec codec_type;
177  rocDecVideoChromaFormat chroma_format;
178  uint32_t bit_depth_minus_8;
179  uint32_t intra_decode_only;
184  uint32_t max_width;
185  uint32_t max_height;
186  struct {
187  int16_t left;
188  int16_t top;
189  int16_t right;
190  int16_t bottom;
192  rocDecVideoSurfaceFormat output_format;
193  uint32_t target_width;
194  uint32_t target_height;
196  struct {
197  int16_t left;
198  int16_t top;
199  int16_t right;
200  int16_t bottom;
201  } target_rect;
203  uint32_t reserved_2[4];
205 
206 /*********************************************************************************************************/
211 /*********************************************************************************************************/
212 typedef struct _RocdecDecodeStatus {
213  rocDecDecodeStatus decode_status;
214  uint32_t reserved[31];
215  void *p_reserved[8];
217 
218 /****************************************************/
223 /****************************************************/
225  uint32_t width;
226  uint32_t height;
227  uint32_t target_width;
228  uint32_t target_height;
230  uint32_t reserved_1[12];
231  struct {
232  int16_t left;
233  int16_t top;
234  int16_t right;
235  int16_t bottom;
237  struct {
238  int16_t left;
239  int16_t top;
240  int16_t right;
241  int16_t bottom;
242  } target_rect;
244  uint32_t reserved_2[11];
246 
247 /*********************************************************/
252 /*********************************************************/
253 typedef struct _RocdecAvcPicture {
254  int pic_idx;
255  uint32_t frame_idx;
256  uint32_t flags;
259  uint32_t reserved[4];
261 
262 /* flags in RocdecAvcPicture could be OR of the following */
263 #define RocdecAvcPicture_FLAGS_INVALID 0x00000001
264 #define RocdecAvcPicture_FLAGS_TOP_FIELD 0x00000002
265 #define RocdecAvcPicture_FLAGS_BOTTOM_FIELD 0x00000004
266 #define RocdecAvcPicture_FLAGS_SHORT_TERM_REFERENCE 0x00000008
267 #define RocdecAvcPicture_FLAGS_LONG_TERM_REFERENCE 0x00000010
268 #define RocdecAvcPicture_FLAGS_NON_EXISTING 0x00000020
269 
270 /*********************************************************/
275 /*********************************************************/
276 typedef struct _RocdecHevcPicture {
277  int pic_idx;
280 
283  int poc;
284  uint32_t flags;
285  uint32_t reserved[4];
287 
288 /* flags in RocdecHevcPicture could be OR of the following */
289 #define RocdecHevcPicture_INVALID 0x00000001
293 #define RocdecHevcPicture_FIELD_PIC 0x00000002
298 #define RocdecHevcPicture_BOTTOM_FIELD 0x00000004
300 #define RocdecHevcPicture_LONG_TERM_REFERENCE 0x00000008
315 #define RocdecHevcPicture_RPS_ST_CURR_BEFORE 0x00000010
320 #define RocdecHevcPicture_RPS_ST_CURR_AFTER 0x00000020
325 #define RocdecHevcPicture_RPS_LT_CURR 0x00000040
326 
327 /***********************************************************/
332 /***********************************************************/
333 typedef struct _RocdecJPEGPicParams {
334  int reserved;
336 
337 /***********************************************************/
342 /***********************************************************/
343 typedef struct _RocdecMpeg2QMatrix {
344  int32_t load_intra_quantiser_matrix;
345  int32_t load_non_intra_quantiser_matrix;
346  int32_t load_chroma_intra_quantiser_matrix;
347  int32_t load_chroma_non_intra_quantiser_matrix;
348  uint8_t intra_quantiser_matrix[64];
349  uint8_t non_intra_quantiser_matrix[64];
350  uint8_t chroma_intra_quantiser_matrix[64];
351  uint8_t chroma_non_intra_quantiser_matrix[64];
353 
354 /***********************************************************/
359 /***********************************************************/
360 typedef struct _RocdecMpeg2PicParams {
361  uint16_t horizontal_size;
362  uint16_t vertical_size;
363  uint32_t forward_reference_pic; // surface_id for forward reference
364  uint32_t backward_reference_picture; // surface_id for backward reference
365  /* meanings of the following fields are the same as in the standard */
366  int32_t picture_coding_type;
367  int32_t f_code; /* pack all four fcode into this */
368  union {
369  struct {
370  uint32_t intra_dc_precision : 2;
371  uint32_t picture_structure : 2;
372  uint32_t top_field_first : 1;
373  uint32_t frame_pred_frame_dct : 1;
374  uint32_t concealment_motion_vectors : 1;
375  uint32_t q_scale_type : 1;
376  uint32_t intra_vlc_format : 1;
377  uint32_t alternate_scan : 1;
378  uint32_t repeat_first_field : 1;
379  uint32_t progressive_frame : 1;
380  uint32_t is_first_field : 1; // indicate whether the current field is the first field for field picture
381  } bits;
382  uint32_t value;
383  } picture_coding_extension;
384 
385  RocdecMpeg2QMatrix q_matrix;
386  uint32_t reserved[4];
388 
389 /***********************************************************/
394 /***********************************************************/
395 typedef struct _RocdecVc1PicParams {
396  int reserved;
398 
399 /***********************************************************/
405 /***********************************************************/
406 typedef struct _RocdecAvcPicParams {
407  RocdecAvcPicture curr_pic;
408  RocdecAvcPicture ref_frames[16]; /* in DPB */
409  uint16_t picture_width_in_mbs_minus1;
410  uint16_t picture_height_in_mbs_minus1;
411  uint8_t bit_depth_luma_minus8;
412  uint8_t bit_depth_chroma_minus8;
413  uint8_t num_ref_frames;
414  union {
415  struct {
416  uint32_t chroma_format_idc : 2;
417  uint32_t residual_colour_transform_flag : 1;
418  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
419  uint32_t frame_mbs_only_flag : 1;
420  uint32_t mb_adaptive_frame_field_flag : 1;
421  uint32_t direct_8x8_inference_flag : 1;
422  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
423  uint32_t log2_max_frame_num_minus4 : 4;
424  uint32_t pic_order_cnt_type : 2;
425  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
426  uint32_t delta_pic_order_always_zero_flag : 1;
427  } bits;
428  uint32_t value;
429  } seq_fields;
430 
431  // FMO/ASO
432  uint8_t num_slice_groups_minus1;
433  uint8_t slice_group_map_type;
434  uint16_t slice_group_change_rate_minus1;
435  int8_t pic_init_qp_minus26;
436  int8_t pic_init_qs_minus26;
437  int8_t chroma_qp_index_offset;
438  int8_t second_chroma_qp_index_offset;
439  union {
440  struct {
441  uint32_t entropy_coding_mode_flag : 1;
442  uint32_t weighted_pred_flag : 1;
443  uint32_t weighted_bipred_idc : 2;
444  uint32_t transform_8x8_mode_flag : 1;
445  uint32_t field_pic_flag : 1;
446  uint32_t constrained_intra_pred_flag : 1;
447  uint32_t pic_order_present_flag : 1;
448  uint32_t deblocking_filter_control_present_flag : 1;
449  uint32_t redundant_pic_cnt_present_flag : 1;
450  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
451  } bits;
452  uint32_t value;
453  } pic_fields;
454  uint16_t frame_num;
455 
456  uint32_t reserved[8];
458 
459 /***********************************************************/
464 /***********************************************************/
465 typedef struct _RocdecAvcSliceParams {
466  uint32_t slice_data_size; // slice size in bytes
467  uint32_t slice_data_offset; // byte offset of the current slice in the slice data buffer
468  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
480  uint16_t first_mb_in_slice;
481  uint8_t slice_type;
482  uint8_t direct_spatial_mv_pred_flag;
483  uint8_t num_ref_idx_l0_active_minus1;
484  uint8_t num_ref_idx_l1_active_minus1;
485  uint8_t cabac_init_idc;
486  int8_t slice_qp_delta;
487  uint8_t disable_deblocking_filter_idc;
488  int8_t slice_alpha_c0_offset_div2;
489  int8_t slice_beta_offset_div2;
490  RocdecAvcPicture ref_pic_list_0[32]; // 8.2.4.2
491  RocdecAvcPicture ref_pic_list_1[32]; // 8.2.4.2
492  uint8_t luma_log2_weight_denom;
493  uint8_t chroma_log2_weight_denom;
494  uint8_t luma_weight_l0_flag;
495  int16_t luma_weight_l0[32];
496  int16_t luma_offset_l0[32];
497  uint8_t chroma_weight_l0_flag;
498  int16_t chroma_weight_l0[32][2];
499  int16_t chroma_offset_l0[32][2];
500  uint8_t luma_weight_l1_flag;
501  int16_t luma_weight_l1[32];
502  int16_t luma_offset_l1[32];
503  uint8_t chroma_weight_l1_flag;
504  int16_t chroma_weight_l1[32][2];
505  int16_t chroma_offset_l1[32][2];
506  uint32_t reserved[4];
508 
509 /***********************************************************/
514 /***********************************************************/
515 typedef struct _RocdecAvcIQMatrix {
517  uint8_t scaling_list_4x4[6][16];
519  uint8_t scaling_list_8x8[2][64];
521  uint32_t reserved[4];
523 
524 /***********************************************************/
529 /***********************************************************/
530 typedef struct _RocdecHevcPicParams {
531  RocdecHevcPicture curr_pic;
532  RocdecHevcPicture ref_frames[15]; /* reference frame list in DPB */
533  uint16_t picture_width_in_luma_samples;
534  uint16_t picture_height_in_luma_samples;
535  union {
536  struct {
538  uint32_t chroma_format_idc : 2;
539  uint32_t separate_colour_plane_flag : 1;
540  uint32_t pcm_enabled_flag : 1;
541  uint32_t scaling_list_enabled_flag : 1;
542  uint32_t transform_skip_enabled_flag : 1;
543  uint32_t amp_enabled_flag : 1;
544  uint32_t strong_intra_smoothing_enabled_flag : 1;
545  uint32_t sign_data_hiding_enabled_flag : 1;
546  uint32_t constrained_intra_pred_flag : 1;
547  uint32_t cu_qp_delta_enabled_flag : 1;
548  uint32_t weighted_pred_flag : 1;
549  uint32_t weighted_bipred_flag : 1;
550  uint32_t transquant_bypass_enabled_flag : 1;
551  uint32_t tiles_enabled_flag : 1;
552  uint32_t entropy_coding_sync_enabled_flag : 1;
553  uint32_t pps_loop_filter_across_slices_enabled_flag : 1;
554  uint32_t loop_filter_across_tiles_enabled_flag : 1;
555  uint32_t pcm_loop_filter_disabled_flag : 1;
559  uint32_t no_bi_pred_flag : 1;
560  uint32_t reserved_bits : 11;
561  } bits;
562  uint32_t value;
563  } pic_fields;
564 
567  uint8_t bit_depth_luma_minus8;
568  uint8_t bit_depth_chroma_minus8;
569  uint8_t pcm_sample_bit_depth_luma_minus1;
570  uint8_t pcm_sample_bit_depth_chroma_minus1;
571  uint8_t log2_min_luma_coding_block_size_minus3;
572  uint8_t log2_diff_max_min_luma_coding_block_size;
573  uint8_t log2_min_transform_block_size_minus2;
574  uint8_t log2_diff_max_min_transform_block_size;
575  uint8_t log2_min_pcm_luma_coding_block_size_minus3;
576  uint8_t log2_diff_max_min_pcm_luma_coding_block_size;
577  uint8_t max_transform_hierarchy_depth_intra;
578  uint8_t max_transform_hierarchy_depth_inter;
579  int8_t init_qp_minus26;
580  uint8_t diff_cu_qp_delta_depth;
581  int8_t pps_cb_qp_offset;
582  int8_t pps_cr_qp_offset;
583  uint8_t log2_parallel_merge_level_minus2;
584  uint8_t num_tile_columns_minus1;
585  uint8_t num_tile_rows_minus1;
590  uint16_t column_width_minus1[19];
591  uint16_t row_height_minus1[21];
592 
593  union {
594  struct {
597  uint32_t long_term_ref_pics_present_flag : 1;
598  uint32_t sps_temporal_mvp_enabled_flag : 1;
599  uint32_t cabac_init_present_flag : 1;
600  uint32_t output_flag_present_flag : 1;
601  uint32_t dependent_slice_segments_enabled_flag : 1;
602  uint32_t pps_slice_chroma_qp_offsets_present_flag : 1;
603  uint32_t sample_adaptive_offset_enabled_flag : 1;
604  uint32_t deblocking_filter_override_enabled_flag : 1;
605  uint32_t pps_disable_deblocking_filter_flag : 1;
606  uint32_t slice_segment_header_extension_present_flag : 1;
607 
609  uint32_t rap_pic_flag : 1;
611  uint32_t idr_pic_flag : 1;
613  uint32_t intra_pic_flag : 1;
614 
615  uint32_t reserved_bits : 18;
616  } bits;
617  uint32_t value;
618  } slice_parsing_fields;
619 
622  uint8_t num_short_term_ref_pic_sets;
623  uint8_t num_long_term_ref_pic_sps;
624  uint8_t num_ref_idx_l0_default_active_minus1;
625  uint8_t num_ref_idx_l1_default_active_minus1;
626  int8_t pps_beta_offset_div2;
627  int8_t pps_tc_offset_div2;
628  uint8_t num_extra_slice_header_bits;
639  uint32_t st_rps_bits;
640  uint32_t reserved[8];
642 
643 /***********************************************************/
648 /***********************************************************/
649 typedef struct _RocdecHevcSliceParams {
653  uint32_t slice_data_size;
657  uint32_t slice_data_flag;
676  uint8_t ref_pic_list[2][15];
677  union {
678  uint32_t value;
679  struct {
681  uint32_t last_slice_of_pic : 1;
684  uint32_t slice_type : 2;
685  uint32_t color_plane_id : 2;
686  uint32_t slice_sao_luma_flag : 1;
687  uint32_t slice_sao_chroma_flag : 1;
688  uint32_t mvd_l1_zero_flag : 1;
689  uint32_t cabac_init_flag : 1;
690  uint32_t slice_temporal_mvp_enabled_flag : 1;
691  uint32_t slice_deblocking_filter_disabled_flag : 1;
692  uint32_t collocated_from_l0_flag : 1;
693  uint32_t slice_loop_filter_across_slices_enabled_flag : 1;
694  uint32_t reserved : 18;
695  } fields;
696  } long_slice_flags;
697 
700  uint8_t num_ref_idx_l0_active_minus1;
701  uint8_t num_ref_idx_l1_active_minus1;
702  int8_t slice_qp_delta;
703  int8_t slice_cb_qp_offset;
704  int8_t slice_cr_qp_offset;
705  int8_t slice_beta_offset_div2;
706  int8_t slice_tc_offset_div2;
707  uint8_t luma_log2_weight_denom;
708  int8_t delta_chroma_log2_weight_denom;
709  int8_t delta_luma_weight_l0[15];
710  int8_t luma_offset_l0[15];
711  int8_t delta_chroma_weight_l0[15][2];
713  int8_t chroma_offset_l0[15][2];
716  int8_t luma_offset_l1[15];
717  int8_t delta_chroma_weight_l1[15][2];
719  int8_t chroma_offset_l1[15][2];
722  uint16_t num_entry_point_offsets;
723  uint16_t entry_offset_to_subset_array;
726 
727  uint32_t reserved[2];
729 
730 /***********************************************************/
739 /***********************************************************/
740 typedef struct _RocdecHevcIQMatrix {
746  uint8_t scaling_list_4x4[6][16];
752  uint8_t scaling_list_8x8[6][64];
758  uint8_t scaling_list_16x16[6][64];
764  uint8_t scaling_list_32x32[2][64];
779  uint32_t reserved[4];
781 
782 /***********************************************************/
787 /***********************************************************/
788 typedef struct _RocdecVp9PicParams {
792  uint16_t frame_width;
796  uint16_t frame_height;
797 
806  uint32_t reference_frames[8];
807 
808  union {
809  struct {
813  uint32_t subsampling_x : 1;
814  uint32_t subsampling_y : 1;
815  uint32_t frame_type : 1;
816  uint32_t show_frame : 1;
817  uint32_t error_resilient_mode : 1;
818  uint32_t intra_only : 1;
819  uint32_t allow_high_precision_mv : 1;
820  uint32_t mcomp_filter_type : 3;
821  uint32_t frame_parallel_decoding_mode : 1;
822  uint32_t reset_frame_context : 2;
823  uint32_t refresh_frame_context : 1;
824  uint32_t frame_context_idx : 2;
825  uint32_t segmentation_enabled : 1;
826 
834 
839  uint32_t last_ref_frame : 3;
848  uint32_t golden_ref_frame : 3;
857  uint32_t alt_ref_frame : 3;
870  uint32_t lossless_flag : 1;
871  } bits;
872  uint32_t value;
873  } pic_fields;
874 
875  /* following parameters have same syntax with those in VP9 code */
876  uint8_t filter_level;
877  uint8_t sharpness_level;
878 
882  uint8_t log2_tile_rows;
896 
901 
907  uint8_t segment_pred_probs[3];
908 
912  uint8_t profile;
913 
917  uint8_t bit_depth;
918 
920  uint32_t va_reserved[8];
921 
923 
929  union {
930  struct {
945  uint16_t segment_reference : 2;
951  } fields;
952  uint16_t value;
953  } segment_flags;
954 
959  uint8_t filter_level[4][2];
980 
982  uint32_t va_reserved[4];
983 
985 
986 /***********************************************************/
991 /***********************************************************/
992 typedef struct _RocdecVp9SliceParams {
998  uint32_t slice_data_size;
1007 
1012 
1014  uint32_t va_reserved[4];
1015 
1017 
1021  union {
1022  struct {
1030  uint32_t enabled : 1;
1036  uint32_t update_map : 1;
1042  uint32_t temporal_update : 1;
1048  uint32_t update_data : 1;
1049 
1051  uint32_t reserved : 28;
1052  } bits;
1053  uint32_t value;
1054  } segment_info_fields;
1055 
1077  int16_t feature_data[8][8];
1078 
1084  uint8_t feature_mask[8];
1085 
1087  uint32_t reserved[4];
1089 
1093  union {
1094  struct {
1099  uint32_t apply_grain : 1;
1100  uint32_t chroma_scaling_from_luma : 1;
1101  uint32_t grain_scaling_minus_8 : 2;
1102  uint32_t ar_coeff_lag : 2;
1103  uint32_t ar_coeff_shift_minus_6 : 2;
1104  uint32_t grain_scale_shift : 2;
1105  uint32_t overlap_flag : 1;
1106  uint32_t clip_to_restricted_range : 1;
1108  uint32_t reserved : 20;
1109  } bits;
1110  uint32_t value;
1111  } film_grain_info_fields;
1112 
1113  uint16_t grain_seed;
1114  /* value range [0..14] */
1115  uint8_t num_y_points;
1116  uint8_t point_y_value[14];
1117  uint8_t point_y_scaling[14];
1118  /* value range [0..10] */
1119  uint8_t num_cb_points;
1120  uint8_t point_cb_value[10];
1121  uint8_t point_cb_scaling[10];
1122  /* value range [0..10] */
1123  uint8_t num_cr_points;
1124  uint8_t point_cr_value[10];
1125  uint8_t point_cr_scaling[10];
1126  /* value range [-128..127] */
1127  int8_t ar_coeffs_y[24];
1128  int8_t ar_coeffs_cb[25];
1129  int8_t ar_coeffs_cr[25];
1130  uint8_t cb_mult;
1131  uint8_t cb_luma_mult;
1132  uint16_t cb_offset;
1133  uint8_t cr_mult;
1134  uint8_t cr_luma_mult;
1135  uint16_t cr_offset;
1136 
1138  uint32_t reserved[4];
1140 
1141 typedef enum {
1153 
1157 
1163  int32_t wmmat[8];
1164 
1165  /* valid or invalid on affine set */
1166  uint8_t invalid;
1167 
1169  uint32_t reserved[4];
1171 
1172 /***********************************************************/
1177 /***********************************************************/
1178 typedef struct _RocdecAV1PicParams {
1184  uint8_t profile;
1185 
1186  uint8_t order_hint_bits_minus_1;
1187 
1194  uint8_t bit_depth_idx;
1195 
1198 
1199  union {
1200  struct {
1201  uint32_t still_picture : 1;
1202  uint32_t use_128x128_superblock : 1;
1203  uint32_t enable_filter_intra : 1;
1204  uint32_t enable_intra_edge_filter : 1;
1205 
1208  uint32_t enable_masked_compound : 1;
1209 
1210  uint32_t enable_dual_filter : 1;
1211  uint32_t enable_order_hint : 1;
1212  uint32_t enable_jnt_comp : 1;
1213  uint32_t enable_cdef : 1;
1214  uint32_t mono_chrome : 1;
1215  uint32_t color_range : 1;
1216  uint32_t subsampling_x : 1;
1217  uint32_t subsampling_y : 1;
1218  uint32_t chroma_sample_position : 1;
1219  uint32_t film_grain_params_present : 1;
1221  uint32_t reserved : 16;
1222  } fields;
1223  uint32_t value;
1224  } seq_info_fields;
1225 
1232 
1238 
1244 
1264 
1271  uint16_t frame_height_minus1;
1272 
1278  uint16_t output_frame_height_in_tiles_minus_1;
1279 
1290 
1301  uint8_t ref_frame_idx[7];
1302 
1311  uint8_t order_hint;
1312 
1313  RocdecAv1SegmentationStruct seg_info;
1314  RocdecAv1FilmGrainStruct film_grain_info;
1315 
1321  uint8_t tile_cols;
1322  uint8_t tile_rows;
1323 
1324  /* The width/height of a tile minus 1 in units of superblocks. Though the
1325  * maximum number of tiles is 64, since ones of the last tile are computed
1326  * from ones of the other tiles and frame_width/height, they are not
1327  * necessarily specified.
1328  */
1329  uint16_t width_in_sbs_minus_1[63];
1330  uint16_t height_in_sbs_minus_1[63];
1331 
1337 
1338  /* specify the tile index for context updating */
1339  uint16_t context_update_tile_id;
1340 
1341  union {
1345  struct {
1355  uint32_t frame_type : 2;
1356  uint32_t show_frame : 1;
1357  uint32_t showable_frame : 1;
1358  uint32_t error_resilient_mode : 1;
1359  uint32_t disable_cdf_update : 1;
1360  uint32_t allow_screen_content_tools : 1;
1361  uint32_t force_integer_mv : 1;
1362  uint32_t allow_intrabc : 1;
1363  uint32_t use_superres : 1;
1364  uint32_t allow_high_precision_mv : 1;
1365  uint32_t is_motion_mode_switchable : 1;
1366  uint32_t use_ref_frame_mvs : 1;
1367  /* disable_frame_end_update_cdf is coded as refresh_frame_context. */
1368  uint32_t disable_frame_end_update_cdf : 1;
1369  uint32_t uniform_tile_spacing_flag : 1;
1370  uint32_t allow_warped_motion : 1;
1372  uint32_t large_scale_tile : 1;
1373 
1375  uint32_t reserved : 15;
1376  } bits;
1377  uint32_t value;
1378  } pic_info_fields;
1379 
1385 
1389  uint8_t interp_filter;
1390 
1394  uint8_t filter_level[2];
1395 
1400  uint8_t filter_level_v;
1401 
1402  union {
1403  struct {
1407  uint8_t sharpness_level : 3;
1408  uint8_t mode_ref_delta_enabled : 1;
1409  uint8_t mode_ref_delta_update : 1;
1410 
1412  uint8_t reserved : 3;
1413  } bits;
1414  uint8_t value;
1415  } loop_filter_info_fields;
1416 
1421  int8_t ref_deltas[8];
1422 
1427  int8_t mode_deltas[2];
1428 
1434  uint8_t base_qindex;
1455 
1458  union {
1459  struct {
1460  uint16_t using_qmatrix : 1;
1465  uint16_t qm_y : 4;
1466  uint16_t qm_u : 4;
1467  uint16_t qm_v : 4;
1468 
1470  uint16_t reserved : 3;
1471  } bits;
1472  uint16_t value;
1474 
1475  union {
1476  struct {
1479  uint32_t delta_q_present_flag : 1;
1480  uint32_t log2_delta_q_res : 2;
1481 
1485  uint32_t log2_delta_lf_res : 2;
1486 
1489  uint32_t delta_lf_multi : 1;
1490 
1494  uint32_t tx_mode : 2;
1495 
1496  /* AV1 frame reference mode semantic */
1497  uint32_t reference_select : 1;
1498 
1499  uint32_t reduced_tx_set_used : 1;
1500 
1501  uint32_t skip_mode_present : 1;
1502 
1504  uint32_t reserved : 20;
1505  } bits;
1506  uint32_t value;
1507  } mode_control_fields;
1508 
1511  /* value range [0..3] */
1513  /* value range [0..3] */
1514  uint8_t cdef_bits;
1515 
1530  /* value range [0..63] */
1531  uint8_t cdef_y_strengths[8];
1532  /* value range [0..63] */
1533  uint8_t cdef_uv_strengths[8];
1534 
1537  union {
1538  struct {
1539  uint16_t yframe_restoration_type : 2;
1540  uint16_t cbframe_restoration_type : 2;
1541  uint16_t crframe_restoration_type : 2;
1542  uint16_t lr_unit_shift : 2;
1543  uint16_t lr_uv_shift : 1;
1544 
1546  uint16_t reserved : 7;
1547  } bits;
1548  uint16_t value;
1550 
1554 
1558  uint32_t reserved[8];
1560 
1561 /***********************************************************/
1569 /***********************************************************/
1570 typedef struct _RocdecAv1SliceParams {
1585 
1586  uint16_t tile_row;
1587  uint16_t tile_column;
1588 
1589  uint16_t tg_start;
1590  uint16_t tg_end;
1591 
1598 
1604 
1606  uint32_t reserved[4];
1608 
1609 /******************************************************************************************/
1615 /******************************************************************************************/
1616 typedef struct _RocdecPicParams {
1623  // Bitstream data
1625  const uint8_t *bitstream_data;
1626  uint32_t num_slices;
1630  uint32_t reserved[30];
1632  // IN: Codec-specific data
1633  union {
1635  RocdecAvcPicParams avc;
1636  RocdecHevcPicParams hevc;
1637  RocdecVc1PicParams vc1;
1638  RocdecJPEGPicParams jpeg;
1639  RocdecVp9PicParams vp9;
1640  RocdecAv1PicParams av1;
1641  uint32_t codec_reserved[256];
1642  } pic_params;
1643 
1646  union {
1647  // Todo: Add slice params defines for other codecs.
1648  RocdecAvcSliceParams *avc;
1649  RocdecHevcSliceParams *hevc;
1650  RocdecVp9SliceParams *vp9;
1651  RocdecAv1SliceParams *av1;
1653 
1654  union {
1655  // Todo: Added IQ matrix defines for other codecs.
1656  RocdecAvcIQMatrix avc;
1657  RocdecHevcIQMatrix hevc;
1658  } iq_matrix;
1659 } RocdecPicParams;
1660 
1661 /******************************************************/
1666 /******************************************************/
1667 typedef struct _RocdecProcParams {
1670  uint32_t reserved_flags[2];
1672  // The fields below are used for raw YUV input
1673  uint64_t raw_input_dptr;
1674  uint32_t raw_input_pitch;
1675  uint32_t raw_input_format;
1676  uint64_t raw_output_dptr;
1677  uint32_t raw_output_pitch;
1679  uint32_t reserved[16];
1681 
1682 /*****************************************************************************************************/
1686 /*****************************************************************************************************/
1687 extern rocDecStatus ROCDECAPI rocDecCreateDecoder(rocDecDecoderHandle *decoder_handle, RocDecoderCreateInfo *decoder_create_info);
1688 
1689 /*****************************************************************************************************/
1693 /*****************************************************************************************************/
1694 extern rocDecStatus ROCDECAPI rocDecDestroyDecoder(rocDecDecoderHandle decoder_handle);
1695 
1696 /**********************************************************************************************************************/
1703 /**********************************************************************************************************************/
1704 extern rocDecStatus ROCDECAPI rocDecGetDecoderCaps(RocdecDecodeCaps *decode_caps);
1705 
1706 /*****************************************************************************************************/
1711 /*****************************************************************************************************/
1712 extern rocDecStatus ROCDECAPI rocDecDecodeFrame(rocDecDecoderHandle decoder_handle, RocdecPicParams *pic_params);
1713 
1714 /************************************************************************************************************/
1720 /************************************************************************************************************/
1721 extern rocDecStatus ROCDECAPI rocDecGetDecodeStatus(rocDecDecoderHandle decoder_handle, int pic_idx, RocdecDecodeStatus *decode_status);
1722 
1723 /*********************************************************************************************************/
1728 /*********************************************************************************************************/
1729 extern rocDecStatus ROCDECAPI rocDecReconfigureDecoder(rocDecDecoderHandle decoder_handle, RocdecReconfigureDecoderInfo *reconfig_params);
1730 
1731 /************************************************************************************************************************/
1739 /************************************************************************************************************************/
1740 extern rocDecStatus ROCDECAPI rocDecGetVideoFrame(rocDecDecoderHandle decoder_handle, int pic_idx,
1741  void *dev_mem_ptr[3], uint32_t *horizontal_pitch,
1742  RocdecProcParams *vid_postproc_params);
1743 
1744 /*****************************************************************************************************/
1748 /*****************************************************************************************************/
1749 extern const char *ROCDECAPI rocDecGetErrorName(rocDecStatus rocdec_status);
1750 
1751 #ifdef __cplusplus
1752 }
1753 #endif
rocDecStatus ROCDECAPI rocDecCreateDecoder(rocDecDecoderHandle *decoder_handle, RocDecoderCreateInfo *decoder_create_info)
rocDecStatus ROCDECAPI rocDecReconfigureDecoder(rocDecDecoderHandle decoder_handle, RocdecReconfigureDecoderInfo *reconfig_params)
int poc
picture order count. ! in HEVC, POCs for top and bottom fields of same picture should take different ...
Definition: rocdecode.h:283
rocDecStatus ROCDECAPI rocDecDecodeFrame(rocDecDecoderHandle decoder_handle, RocdecPicParams *pic_params)
rocDecStatus ROCDECAPI rocDecDestroyDecoder(rocDecDecoderHandle decoder_handle)
const char *ROCDECAPI rocDecGetErrorName(rocDecStatus rocdec_status)
rocDecStatus ROCDECAPI rocDecGetDecodeStatus(rocDecDecoderHandle decoder_handle, int pic_idx, RocdecDecodeStatus *decode_status)
rocDecVideoCodec_enum
Definition: rocdecode.h:78
@ rocDecVideoCodec_NV12
Definition: rocdecode.h:92
@ rocDecVideoCodec_YV12
Definition: rocdecode.h:91
@ rocDecVideoCodec_YUV420
Definition: rocdecode.h:90
@ rocDecVideoCodec_UYVY
Definition: rocdecode.h:94
@ rocDecVideoCodec_YUYV
Definition: rocdecode.h:93
@ rocDecVideoCodec_AV1
Definition: rocdecode.h:84
@ rocDecVideoCodec_MPEG4
Definition: rocdecode.h:81
@ rocDecVideoCodec_HEVC
Definition: rocdecode.h:83
@ rocDecVideoCodec_MPEG1
Definition: rocdecode.h:79
@ rocDecVideoCodec_JPEG
Definition: rocdecode.h:87
@ rocDecVideoCodec_VP9
Definition: rocdecode.h:86
@ rocDecVideoCodec_AVC
Definition: rocdecode.h:82
@ rocDecVideoCodec_MPEG2
Definition: rocdecode.h:80
@ rocDecVideoCodec_VP8
Definition: rocdecode.h:85
@ rocDecVideoCodec_NumCodecs
Definition: rocdecode.h:88
struct _RocdecAv1SegmentationStruct RocdecAv1SegmentationStruct
Segmentation Information for AV1.
rocDecVideoSurfaceFormat_enum
Definition: rocdecode.h:103
@ rocDecVideoSurfaceFormat_YUV420
Definition: rocdecode.h:110
@ rocDecVideoSurfaceFormat_YUV444_16Bit
Definition: rocdecode.h:108
@ rocDecVideoSurfaceFormat_YUV420_16Bit
Definition: rocdecode.h:111
@ rocDecVideoSurfaceFormat_P016
Definition: rocdecode.h:105
@ rocDecVideoSurfaceFormat_NV12
Definition: rocdecode.h:104
@ rocDecVideoSurfaceFormat_YUV444
Definition: rocdecode.h:107
struct _RocdecAv1FilmGrainStruct RocdecAv1FilmGrainStruct
Film Grain Information for AV1.
void * rocDecDecoderHandle
Definition: rocdecode.h:52
rocDecVideoChromaFormat_enum
Definition: rocdecode.h:121
@ rocDecVideoChromaFormat_422
Definition: rocdecode.h:124
@ rocDecVideoChromaFormat_444
Definition: rocdecode.h:125
@ rocDecVideoChromaFormat_420
Definition: rocdecode.h:123
@ rocDecVideoChromaFormat_Monochrome
Definition: rocdecode.h:122
struct _RocdecVp9SegmentParameter RocdecVp9SegmentParameter
VP9 Segmentation Parameter Data Structure This structure is configured to be the same as VA-API VASeg...
RocdecAv1TransformationType
Definition: rocdecode.h:1141
@ RocdecAv1TransformationTranslation
Definition: rocdecode.h:1145
@ RocdecAv1TransformationAffine
Definition: rocdecode.h:1149
@ RocdecAv1TransformationCount
Definition: rocdecode.h:1151
@ RocdecAv1TransformationRotzoom
Definition: rocdecode.h:1147
@ RocdecAv1TransformationIdentity
Definition: rocdecode.h:1143
Definition: rocdecode.h:170
uint32_t height
Definition: rocdecode.h:174
uint32_t width
Definition: rocdecode.h:173
uint32_t target_width
Definition: rocdecode.h:193
uint32_t max_height
Definition: rocdecode.h:185
uint32_t bit_depth_minus_8
Definition: rocdecode.h:178
uint32_t num_output_surfaces
Definition: rocdecode.h:195
uint8_t device_id
Definition: rocdecode.h:171
struct _RocDecoderCreateInfo::@1 target_rect
rocDecVideoChromaFormat chroma_format
Definition: rocdecode.h:177
uint32_t num_decode_surfaces
Definition: rocdecode.h:175
rocDecVideoCodec codec_type
Definition: rocdecode.h:176
uint32_t max_width
Definition: rocdecode.h:184
rocDecVideoSurfaceFormat output_format
Definition: rocdecode.h:192
uint32_t target_height
Definition: rocdecode.h:194
struct _RocDecoderCreateInfo::@0 display_rect
uint32_t intra_decode_only
Definition: rocdecode.h:179
uint32_t reserved_2[4]
Definition: rocdecode.h:203
Definition: rocdecode.h:1178
union _RocdecAV1PicParams::@29 loop_restoration_fields
loop restoration parameters
int8_t u_ac_delta_q
U AC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1446
uint8_t filter_level_u
chroma loop filter levels. value range [0..63].
Definition: rocdecode.h:1399
int ref_frame_map[8]
Surface indices of reference frames in DPB.
Definition: rocdecode.h:1289
uint8_t tile_cols
tile structure When uniform_tile_spacing_flag == 1, width_in_sbs_minus_1[] and height_in_sbs_minus_1[...
Definition: rocdecode.h:1321
uint8_t matrix_coefficients
corresponds to AV1 spec variable of the same name.
Definition: rocdecode.h:1197
uint8_t sharpness_level
flags for reference pictures same syntax and semantic as those in AV1 code
Definition: rocdecode.h:1407
int8_t u_dc_delta_q
U DC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1442
uint16_t qm_y
qm level value range [0..15] Invalid if using_qmatrix equals 0.
Definition: rocdecode.h:1465
int8_t ref_deltas[8]
The adjustment needed for the filter level based on the chosen reference frame. value range [-64....
Definition: rocdecode.h:1421
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: rocdecode.h:1194
uint32_t tx_mode
read_tx_mode value range [0..2]
Definition: rocdecode.h:1494
uint16_t frame_width_minus1
Picture resolution minus 1 Picture original resolution. If SuperRes is enabled, this is the upscaled ...
Definition: rocdecode.h:1270
uint8_t anchor_frames_num
number of anchor frames for large scale tile This parameter gives the number of entries of anchor_fra...
Definition: rocdecode.h:1243
uint8_t cdef_y_strengths[8]
Definition: rocdecode.h:1531
int8_t v_ac_delta_q
V AC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1454
int8_t v_dc_delta_q
V DC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1450
uint8_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1412
uint8_t primary_ref_frame
primary reference frame index Index into ref_frame_idx[], specifying which reference frame contains p...
Definition: rocdecode.h:1310
uint32_t enable_interintra_compound
Definition: rocdecode.h:1207
int current_frame
Picture level information.
Definition: rocdecode.h:1231
uint8_t cdef_damping_minus_3
CDEF parameters.
Definition: rocdecode.h:1512
uint8_t profile
sequence level information
Definition: rocdecode.h:1184
uint8_t ref_frame_idx[7]
Reference frame indices.
Definition: rocdecode.h:1301
uint8_t filter_level[2]
luma loop filter levels. value range [0..63].
Definition: rocdecode.h:1394
uint16_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1470
uint32_t delta_q_present_flag
delta_q parameters
Definition: rocdecode.h:1479
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: rocdecode.h:1277
uint32_t large_scale_tile
indicate if current frame in large scale tile mode
Definition: rocdecode.h:1372
union _RocdecAV1PicParams::@27 qmatrix_fields
quantization_matrix
int8_t mode_deltas[2]
The adjustment needed for the filter level based on the chosen mode. value range [-64....
Definition: rocdecode.h:1427
uint8_t superres_scale_denominator
Supper resolution scale denominator. When use_superres=1, superres_scale_denominator must be in the r...
Definition: rocdecode.h:1384
uint32_t frame_type
Frame Type: 0: KEY_FRAME; 1: INTER_FRAME; 2: INTRA_ONLY_FRAME; 3: SWITCH_FRAME For SWITCH_FRAME,...
Definition: rocdecode.h:1355
uint32_t delta_lf_multi
CONFIG_LOOPFILTER_LEVEL.
Definition: rocdecode.h:1489
uint32_t delta_lf_present_flag
delta_lf parameters
Definition: rocdecode.h:1484
uint8_t base_qindex
quantization
Definition: rocdecode.h:1434
RocdecAv1WarpedMotionParams wm[7]
global motion
Definition: rocdecode.h:1553
struct _RocdecAV1PicParams::@25::@31 bits
flags for current picture same syntax and semantic as those in AV1 code
int8_t y_dc_delta_q
Y DC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1438
int current_display_picture
display buffer of current picture Used for film grain applied decoded picture. Valid only when apply_...
Definition: rocdecode.h:1237
uint8_t interp_filter
Interpolation filter. value range [0..4].
Definition: rocdecode.h:1389
int * anchor_frames_list
anchor frame list for large scale tile For large scale tile applications, the anchor frames could com...
Definition: rocdecode.h:1263
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: rocdecode.h:1336
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1221
Film Grain Information for AV1.
Definition: rocdecode.h:1092
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: rocdecode.h:1099
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1108
Segmentation Information for AV1.
Definition: rocdecode.h:1020
uint32_t enabled
Definition: rocdecode.h:1030
uint32_t temporal_update
Definition: rocdecode.h:1042
int16_t feature_data[8][8]
Segmentation parameters for current frame. feature_data[segment_id][feature_id] where segment_id has ...
Definition: rocdecode.h:1077
uint32_t update_map
Definition: rocdecode.h:1036
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1051
uint32_t update_data
Definition: rocdecode.h:1048
uint8_t feature_mask[8]
indicates if a feature is enabled or not. Each bit field itself is the feature_id....
Definition: rocdecode.h:1084
Definition: rocdecode.h:1570
uint32_t slice_data_flag
Definition: rocdecode.h:1584
uint8_t anchor_frame_idx
anchor frame index for large scale tile. index into an array AnchorFrames of the frames that the tile...
Definition: rocdecode.h:1597
uint32_t slice_data_size
The byte count of current tile in the bitstream buffer, starting from first byte of the buffer....
Definition: rocdecode.h:1576
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: rocdecode.h:1603
uint32_t slice_data_offset
Definition: rocdecode.h:1580
uint32_t reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1606
Definition: rocdecode.h:1154
RocdecAv1TransformationType wmtype
Specify the type of warped motion.
Definition: rocdecode.h:1156
int32_t wmmat[8]
Specify warp motion parameters wm.wmmat[] corresponds to gm_params[][] in spec. Details in AV1 spec s...
Definition: rocdecode.h:1163
uint32_t reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1169
Definition: rocdecode.h:515
uint8_t scaling_list_8x8[2][64]
8x8 scaling list, in raster scan order.
Definition: rocdecode.h:519
uint32_t reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:521
uint8_t scaling_list_4x4[6][16]
4x4 scaling list, in raster scan order.
Definition: rocdecode.h:517
Definition: rocdecode.h:406
Definition: rocdecode.h:253
int32_t top_field_order_cnt
Definition: rocdecode.h:257
int pic_idx
Definition: rocdecode.h:254
uint32_t flags
Definition: rocdecode.h:256
int32_t bottom_field_order_cnt
Definition: rocdecode.h:258
uint32_t frame_idx
Definition: rocdecode.h:255
Definition: rocdecode.h:465
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition: rocdecode.h:479
Definition: rocdecode.h:149
uint16_t min_width
Definition: rocdecode.h:160
uint32_t reserved_1[3]
Definition: rocdecode.h:154
uint32_t reserved_2[6]
Definition: rocdecode.h:162
uint8_t num_decoders
Definition: rocdecode.h:156
rocDecVideoCodec codec_type
Definition: rocdecode.h:151
uint8_t device_id
Definition: rocdecode.h:150
uint16_t min_height
Definition: rocdecode.h:161
uint32_t max_width
Definition: rocdecode.h:158
rocDecVideoChromaFormat chroma_format
Definition: rocdecode.h:152
uint16_t output_format_mask
Definition: rocdecode.h:157
uint8_t is_supported
Definition: rocdecode.h:155
uint32_t max_height
Definition: rocdecode.h:159
uint32_t bit_depth_minus_8
Definition: rocdecode.h:153
Definition: rocdecode.h:212
Definition: rocdecode.h:740
uint8_t scaling_list_8x8[6][64]
8x8 scaling, correspongs i = 1, MatrixID is in the range of 0 to 5, inclusive. And j is in the range ...
Definition: rocdecode.h:752
uint8_t scaling_list_4x4[6][16]
4x4 scaling, correspongs i = 0, MatrixID is in the range of 0 to 5, inclusive. And j is in the range ...
Definition: rocdecode.h:746
uint8_t scaling_list_dc_32x32[2]
DC values of the 32x32 scaling lists, corresponds to HEVC spec syntax scaling_list_dc_coef_minus8[ si...
Definition: rocdecode.h:778
uint8_t scaling_list_16x16[6][64]
16x16 scaling, correspongs i = 2, MatrixID is in the range of 0 to 5, inclusive. And j is in the rang...
Definition: rocdecode.h:758
uint8_t scaling_list_dc_16x16[6]
DC values of the 16x16 scaling lists, corresponds to HEVC spec syntax scaling_list_dc_coef_minus8[ si...
Definition: rocdecode.h:771
uint8_t scaling_list_32x32[2][64]
32x32 scaling, correspongs i = 3, MatrixID is in the range of 0 to 1, inclusive. And j is in the rang...
Definition: rocdecode.h:764
Definition: rocdecode.h:530
uint16_t column_width_minus1[19]
Definition: rocdecode.h:590
uint32_t idr_pic_flag
Definition: rocdecode.h:611
uint32_t chroma_format_idc
Definition: rocdecode.h:538
uint32_t st_rps_bits
number of bits that structure short_term_ref_pic_set( num_short_term_ref_pic_sets ) takes in slice se...
Definition: rocdecode.h:639
uint32_t no_bi_pred_flag
Definition: rocdecode.h:559
uint32_t intra_pic_flag
Definition: rocdecode.h:613
uint8_t sps_max_dec_pic_buffering_minus1
Definition: rocdecode.h:566
uint32_t no_pic_reordering_flag
Definition: rocdecode.h:557
uint32_t lists_modification_present_flag
Definition: rocdecode.h:596
uint32_t rap_pic_flag
Definition: rocdecode.h:609
uint8_t log2_max_pic_order_cnt_lsb_minus4
Definition: rocdecode.h:621
Definition: rocdecode.h:276
uint32_t flags
Definition: rocdecode.h:284
int pic_idx
Definition: rocdecode.h:277
uint32_t reserved[4]
Definition: rocdecode.h:285
Definition: rocdecode.h:649
uint32_t slice_segment_address
Definition: rocdecode.h:670
uint32_t slice_data_flag
Slice data buffer flags. See VA_SLICE_DATA_FLAG_XXX.
Definition: rocdecode.h:657
uint8_t five_minus_max_num_merge_cand
Definition: rocdecode.h:721
uint32_t slice_data_offset
The offset to the NAL unit header for this slice.
Definition: rocdecode.h:655
uint32_t last_slice_of_pic
Definition: rocdecode.h:681
uint32_t slice_data_size
Number of bytes in the slice data buffer for this slice counting from and including NAL unit header.
Definition: rocdecode.h:653
int8_t delta_luma_weight_l1[15]
Definition: rocdecode.h:715
int8_t chroma_offset_l1[15][2]
Definition: rocdecode.h:719
int8_t chroma_offset_l0[15][2]
Definition: rocdecode.h:713
uint16_t slice_data_num_emu_prevn_bytes
Number of emulation prevention bytes in slice header.
Definition: rocdecode.h:725
uint8_t collocated_ref_idx
Definition: rocdecode.h:699
uint8_t ref_pic_list[2][15]
index into ReferenceFrames[] ref_pic_list[0][] corresponds to RefPicList0[] of HEVC variable....
Definition: rocdecode.h:676
uint32_t dependent_slice_segment_flag
Definition: rocdecode.h:683
uint32_t slice_data_byte_offset
Byte offset from NAL unit header to the begining of slice_data().
Definition: rocdecode.h:668
Definition: rocdecode.h:333
Definition: rocdecode.h:360
Definition: rocdecode.h:343
Definition: rocdecode.h:1616
uint32_t reserved[30]
Definition: rocdecode.h:1630
union _RocdecPicParams::@37 slice_params
Variable size array. The user should allocate one slice param struct for each slice.
RocdecMpeg2PicParams mpeg2
Definition: rocdecode.h:1634
int bottom_field_flag
Definition: rocdecode.h:1621
int intra_pic_flag
Definition: rocdecode.h:1629
int pic_height
Definition: rocdecode.h:1618
int ref_pic_flag
Definition: rocdecode.h:1628
const uint8_t * bitstream_data
Definition: rocdecode.h:1625
uint32_t num_slices
Definition: rocdecode.h:1626
int curr_pic_idx
Definition: rocdecode.h:1619
int field_pic_flag
Definition: rocdecode.h:1620
uint32_t bitstream_data_len
Definition: rocdecode.h:1624
int second_field
Definition: rocdecode.h:1622
int pic_width
Definition: rocdecode.h:1617
Definition: rocdecode.h:1667
uint32_t raw_input_format
Definition: rocdecode.h:1675
uint64_t raw_output_dptr
Definition: rocdecode.h:1676
uint32_t raw_output_pitch
Definition: rocdecode.h:1677
int progressive_frame
Definition: rocdecode.h:1668
uint64_t raw_input_dptr
Definition: rocdecode.h:1673
uint32_t reserved_flags[2]
Definition: rocdecode.h:1670
uint32_t raw_input_pitch
Definition: rocdecode.h:1674
uint32_t raw_output_format
Definition: rocdecode.h:1678
uint32_t reserved[16]
Definition: rocdecode.h:1679
int top_field_first
Definition: rocdecode.h:1669
Definition: rocdecode.h:224
uint32_t target_width
Definition: rocdecode.h:227
struct _RocdecReconfigureDecoderInfo::@3 target_rect
uint32_t num_decode_surfaces
Definition: rocdecode.h:229
uint32_t height
Definition: rocdecode.h:226
uint32_t width
Definition: rocdecode.h:225
struct _RocdecReconfigureDecoderInfo::@2 display_rect
uint32_t reserved_1[12]
Definition: rocdecode.h:230
uint32_t reserved_2[11]
Definition: rocdecode.h:244
uint32_t target_height
Definition: rocdecode.h:228
Definition: rocdecode.h:395
Definition: rocdecode.h:788
uint32_t reference_frames[8]
Surface indices of reference frames in DPB.
Definition: rocdecode.h:806
uint32_t last_ref_frame_sign_bias
Sign Bias of the LAST reference frame. It corresponds to ref_frame_sign_bias[LAST_FRAME] in VP9 code.
Definition: rocdecode.h:843
uint32_t segmentation_update_map
corresponds to variable update_mb_segmentation_map in VP9 code.
Definition: rocdecode.h:833
uint16_t frame_width
picture width Picture original resolution. The value may not be multiple of 8.
Definition: rocdecode.h:792
uint8_t profile
VP9 Profile definition value range [0..3].
Definition: rocdecode.h:912
uint8_t log2_tile_rows
number of tile rows specified by (1 << log2_tile_rows). It corresponds the variable with same name in...
Definition: rocdecode.h:882
uint32_t golden_ref_frame
Index of reference_frames[] and points to the GOLDERN reference frame. It corresponds to active_ref_i...
Definition: rocdecode.h:848
uint32_t last_ref_frame
Index of reference_frames[] and points to the LAST reference frame. It corresponds to active_ref_idx[...
Definition: rocdecode.h:839
uint32_t segmentation_temporal_update
corresponds to variable temporal_update in VP9 code.
Definition: rocdecode.h:829
uint8_t mb_segment_tree_probs[7]
Definition: rocdecode.h:906
uint32_t alt_ref_frame_sign_bias
Sign Bias of the ALTERNATE reference frame. Corresponds to ref_frame_sign_bias[ALTREF_FRAME] in VP9 c...
Definition: rocdecode.h:861
uint8_t log2_tile_columns
number of tile columns specified by (1 << log2_tile_columns). It corresponds the variable with same n...
Definition: rocdecode.h:886
uint32_t alt_ref_frame
Index of reference_frames[] and points to the ALTERNATE reference frame. Corresponds to active_ref_id...
Definition: rocdecode.h:857
uint32_t lossless_flag
Lossless Mode LosslessFlag = base_qindex == 0 && y_dc_delta_q == 0 && uv_dc_delta_q == 0 && uv_ac_del...
Definition: rocdecode.h:870
uint32_t subsampling_x
flags for current picture same syntax and semantic as those in VP9 code
Definition: rocdecode.h:813
uint32_t va_reserved[8]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:920
uint32_t golden_ref_frame_sign_bias
Sign Bias of the GOLDERN reference frame. Corresponds to ref_frame_sign_bias[GOLDERN_FRAME] in VP9 co...
Definition: rocdecode.h:852
uint8_t bit_depth
VP9 bit depth per sample same for both luma and chroma samples.
Definition: rocdecode.h:917
uint8_t frame_header_length_in_bytes
Number of bytes taken up by the uncompressed frame header, which corresponds to byte length of functi...
Definition: rocdecode.h:895
uint16_t first_partition_size
The byte count of compressed header the bitstream buffer, which corresponds to syntax first_partition...
Definition: rocdecode.h:900
uint16_t frame_height
picture height Picture original resolution. The value may not be multiple of 8.
Definition: rocdecode.h:796
VP9 Segmentation Parameter Data Structure This structure is configured to be the same as VA-API VASeg...
Definition: rocdecode.h:928
uint8_t filter_level[4][2]
Specifies the filter level information per segment. The value corresponds to variable lfi->lvl[seg][r...
Definition: rocdecode.h:959
int16_t luma_dc_quant_scale
Specifies per segment Luma DC quantization scale. Corresponding to y_dequant[qindex][0] in vp9_mb_ini...
Definition: rocdecode.h:969
uint32_t va_reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:982
uint16_t segment_reference
Specifies per segment reference indication. 0: reserved 1: Last ref 2: golden 3: altref Value can be ...
Definition: rocdecode.h:945
int16_t chroma_dc_quant_scale
Specifies per segment Chroma DC quantization scale. Corresponding to uv_dequant[qindex][0] in vp9_mb_...
Definition: rocdecode.h:979
int16_t luma_ac_quant_scale
Specifies per segment Luma AC quantization scale. Corresponding to y_dequant[qindex][1] in vp9_mb_ini...
Definition: rocdecode.h:964
uint16_t segment_reference_skipped
Indicates if per segment skip feature is enabled. Corresponding to variable feature_enabled when j ==...
Definition: rocdecode.h:950
int16_t chroma_ac_quant_scale
Specifies per segment Chroma AC quantization scale. Corresponding to uv_dequant[qindex][1] in vp9_mb_...
Definition: rocdecode.h:974
uint16_t segment_reference_enabled
Indicates if per segment reference frame indicator is enabled. Corresponding to variable feature_enab...
Definition: rocdecode.h:936
Definition: rocdecode.h:992
uint32_t slice_data_size
The byte count of current frame in the bitstream buffer, starting from first byte of the buffer....
Definition: rocdecode.h:998
RocdecVp9SegmentParameter seg_param[8]
per segment information
Definition: rocdecode.h:1011
uint32_t slice_data_flag
Definition: rocdecode.h:1006
uint32_t va_reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1014
uint32_t slice_data_offset
Definition: rocdecode.h:1002