develop/projects/rocdecode/api/rocdecode/rocdecode.h Source File

develop/projects/rocdecode/api/rocdecode/rocdecode.h Source File#

rocDecode: develop/projects/rocdecode/api/rocdecode/rocdecode.h Source File
rocdecode.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2023 - 2026 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 
42 #if defined(__cplusplus)
43 extern "C" {
44 #endif // __cplusplus
45 
46 /*********************************************************************************/
49 /*********************************************************************************/
50 
51 typedef void *rocDecDecoderHandle;
52 
53 /*********************************************************************************/
58 /*********************************************************************************/
59 typedef enum rocDecStatus_enum {
60  ROCDEC_DEVICE_INVALID = -1,
61  ROCDEC_CONTEXT_INVALID = -2,
62  ROCDEC_RUNTIME_ERROR = -3,
63  ROCDEC_OUTOF_MEMORY = -4,
64  ROCDEC_INVALID_PARAMETER = -5,
65  ROCDEC_NOT_IMPLEMENTED = -6,
66  ROCDEC_NOT_INITIALIZED = -7,
67  ROCDEC_NOT_SUPPORTED = -8,
68  ROCDEC_SUCCESS = 0,
69 } rocDecStatus;
70 
71 /*********************************************************************************/
76 /*********************************************************************************/
77 typedef enum rocDecVideoCodec_enum {
88  // Uncompressed YUV
89  rocDecVideoCodec_YUV420 = (('I' << 24) | ('Y' << 16) | ('U' << 8) | ('V')),
90  rocDecVideoCodec_YV12 = (('Y' << 24) | ('V' << 16) | ('1' << 8) | ('2')),
91  rocDecVideoCodec_NV12 = (('N' << 24) | ('V' << 16) | ('1' << 8) | ('2')),
92  rocDecVideoCodec_YUYV = (('Y' << 24) | ('U' << 16) | ('Y' << 8) | ('V')),
93  rocDecVideoCodec_UYVY = (('U' << 24) | ('Y' << 16) | ('V' << 8) | ('Y'))
94 } rocDecVideoCodec;
95 
96 /*********************************************************************************/
103 /*********************************************************************************/
122 } rocDecVideoSurfaceFormat;
123 
124 /**************************************************************************************************************/
131 /**************************************************************************************************************/
137 } rocDecVideoChromaFormat;
138 
139 /*************************************************************************/
144 /*************************************************************************/
145 typedef enum rocDecodeStatus_enum {
146  rocDecodeStatus_Invalid = 0, // Decode status is not valid
147  rocDecodeStatus_InProgress = 1, // Decode is in progress
148  rocDecodeStatus_Success = 2, // Decode is completed without any errors
149  // 3 to 7 enums are reserved for future use
150  rocDecodeStatus_Error = 8, // Decode is completed with an error (error is not concealed)
151  rocDecodeStatus_Error_Concealed = 9, // Decode is completed with an error and error is concealed
152  rocDecodeStatus_Displaying = 10, // Decode is completed, displaying in progress
153 } rocDecDecodeStatus;
154 
155 /**************************************************************************************************************/
159 /**************************************************************************************************************/
160 typedef struct _RocdecDecodeCaps {
161  uint8_t device_id;
162  rocDecVideoCodec codec_type;
163  rocDecVideoChromaFormat chroma_format;
164  uint32_t bit_depth_minus_8;
165  uint32_t reserved_1[3];
166  uint8_t is_supported;
167  uint8_t num_decoders;
169  uint32_t max_width;
170  uint32_t max_height;
171  uint16_t min_width;
172  uint16_t min_height;
173  uint32_t reserved_2[6];
175 
176 /**************************************************************************************************************/
180 /**************************************************************************************************************/
181 typedef struct _RocDecoderCreateInfo {
182  uint8_t device_id;
184  uint32_t width;
185  uint32_t height;
187  rocDecVideoCodec codec_type;
188  rocDecVideoChromaFormat chroma_format;
189  uint32_t bit_depth_minus_8;
190  uint32_t intra_decode_only;
195  uint32_t max_width;
196  uint32_t max_height;
197  struct {
198  int16_t left;
199  int16_t top;
200  int16_t right;
201  int16_t bottom;
203  rocDecVideoSurfaceFormat output_format;
204  uint32_t target_width;
205  uint32_t target_height;
207  struct {
208  int16_t left;
209  int16_t top;
210  int16_t right;
211  int16_t bottom;
212  } target_rect;
214  uint32_t reserved_2[4];
216 
217 /*********************************************************************************************************/
222 /*********************************************************************************************************/
223 typedef struct _RocdecDecodeStatus {
224  rocDecDecodeStatus decode_status;
225  uint32_t reserved[31];
226  void *p_reserved[8];
228 
229 /****************************************************/
234 /****************************************************/
236  uint32_t width;
237  uint32_t height;
238  uint32_t target_width;
239  uint32_t target_height;
241  uint32_t bit_depth_minus_8;
242  uint32_t reserved_1[11];
243  struct {
244  int16_t left;
245  int16_t top;
246  int16_t right;
247  int16_t bottom;
249  struct {
250  int16_t left;
251  int16_t top;
252  int16_t right;
253  int16_t bottom;
254  } target_rect;
256  uint32_t reserved_2[11];
258 
259 /*********************************************************/
264 /*********************************************************/
265 typedef struct _RocdecAvcPicture {
266  int pic_idx;
267  uint32_t frame_idx;
268  uint32_t flags;
271  uint32_t reserved[4];
273 
274 /* flags in RocdecAvcPicture could be OR of the following */
275 #define RocdecAvcPicture_FLAGS_INVALID 0x00000001
276 #define RocdecAvcPicture_FLAGS_TOP_FIELD 0x00000002
277 #define RocdecAvcPicture_FLAGS_BOTTOM_FIELD 0x00000004
278 #define RocdecAvcPicture_FLAGS_SHORT_TERM_REFERENCE 0x00000008
279 #define RocdecAvcPicture_FLAGS_LONG_TERM_REFERENCE 0x00000010
280 #define RocdecAvcPicture_FLAGS_NON_EXISTING 0x00000020
281 
282 /*********************************************************/
287 /*********************************************************/
288 typedef struct _RocdecHevcPicture {
289  int pic_idx;
292 
295  int poc;
296  uint32_t flags;
297  uint32_t reserved[4];
299 
300 /* flags in RocdecHevcPicture could be OR of the following */
301 #define RocdecHevcPicture_INVALID 0x00000001
305 #define RocdecHevcPicture_FIELD_PIC 0x00000002
310 #define RocdecHevcPicture_BOTTOM_FIELD 0x00000004
312 #define RocdecHevcPicture_LONG_TERM_REFERENCE 0x00000008
327 #define RocdecHevcPicture_RPS_ST_CURR_BEFORE 0x00000010
332 #define RocdecHevcPicture_RPS_ST_CURR_AFTER 0x00000020
337 #define RocdecHevcPicture_RPS_LT_CURR 0x00000040
338 
339 /***********************************************************/
344 /***********************************************************/
345 typedef struct _RocdecJPEGPicParams {
346  int reserved;
348 
349 /***********************************************************/
354 /***********************************************************/
355 typedef struct _RocdecMpeg2QMatrix {
356  int32_t load_intra_quantiser_matrix;
357  int32_t load_non_intra_quantiser_matrix;
358  int32_t load_chroma_intra_quantiser_matrix;
359  int32_t load_chroma_non_intra_quantiser_matrix;
360  uint8_t intra_quantiser_matrix[64];
361  uint8_t non_intra_quantiser_matrix[64];
362  uint8_t chroma_intra_quantiser_matrix[64];
363  uint8_t chroma_non_intra_quantiser_matrix[64];
365 
366 /***********************************************************/
371 /***********************************************************/
372 typedef struct _RocdecMpeg2PicParams {
373  uint16_t horizontal_size;
374  uint16_t vertical_size;
375  uint32_t forward_reference_pic; // surface_id for forward reference
376  uint32_t backward_reference_picture; // surface_id for backward reference
377  /* meanings of the following fields are the same as in the standard */
378  int32_t picture_coding_type;
379  int32_t f_code; /* pack all four fcode into this */
380  union {
381  struct {
382  uint32_t intra_dc_precision : 2;
383  uint32_t picture_structure : 2;
384  uint32_t top_field_first : 1;
385  uint32_t frame_pred_frame_dct : 1;
386  uint32_t concealment_motion_vectors : 1;
387  uint32_t q_scale_type : 1;
388  uint32_t intra_vlc_format : 1;
389  uint32_t alternate_scan : 1;
390  uint32_t repeat_first_field : 1;
391  uint32_t progressive_frame : 1;
392  uint32_t is_first_field : 1; // indicate whether the current field is the first field for field picture
393  } bits;
394  uint32_t value;
395  } picture_coding_extension;
396 
397  RocdecMpeg2QMatrix q_matrix;
398  uint32_t reserved[4];
400 
401 /***********************************************************/
406 /***********************************************************/
407 typedef struct _RocdecVc1PicParams {
408  int reserved;
410 
411 /***********************************************************/
417 /***********************************************************/
418 typedef struct _RocdecAvcPicParams {
419  RocdecAvcPicture curr_pic;
420  RocdecAvcPicture ref_frames[16]; /* in DPB */
421  uint16_t picture_width_in_mbs_minus1;
422  uint16_t picture_height_in_mbs_minus1;
423  uint8_t bit_depth_luma_minus8;
424  uint8_t bit_depth_chroma_minus8;
425  uint8_t num_ref_frames;
426  union {
427  struct {
428  uint32_t chroma_format_idc : 2;
429  uint32_t residual_colour_transform_flag : 1;
430  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
431  uint32_t frame_mbs_only_flag : 1;
432  uint32_t mb_adaptive_frame_field_flag : 1;
433  uint32_t direct_8x8_inference_flag : 1;
434  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
435  uint32_t log2_max_frame_num_minus4 : 4;
436  uint32_t pic_order_cnt_type : 2;
437  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
438  uint32_t delta_pic_order_always_zero_flag : 1;
439  } bits;
440  uint32_t value;
441  } seq_fields;
442 
443  // FMO/ASO
444  uint8_t num_slice_groups_minus1;
445  uint8_t slice_group_map_type;
446  uint16_t slice_group_change_rate_minus1;
447  int8_t pic_init_qp_minus26;
448  int8_t pic_init_qs_minus26;
449  int8_t chroma_qp_index_offset;
450  int8_t second_chroma_qp_index_offset;
451  union {
452  struct {
453  uint32_t entropy_coding_mode_flag : 1;
454  uint32_t weighted_pred_flag : 1;
455  uint32_t weighted_bipred_idc : 2;
456  uint32_t transform_8x8_mode_flag : 1;
457  uint32_t field_pic_flag : 1;
458  uint32_t constrained_intra_pred_flag : 1;
459  uint32_t pic_order_present_flag : 1;
460  uint32_t deblocking_filter_control_present_flag : 1;
461  uint32_t redundant_pic_cnt_present_flag : 1;
462  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
463  } bits;
464  uint32_t value;
465  } pic_fields;
466  uint16_t frame_num;
467 
468  uint32_t reserved[8];
470 
471 /***********************************************************/
476 /***********************************************************/
477 typedef struct _RocdecAvcSliceParams {
478  uint32_t slice_data_size; // slice size in bytes
479  uint32_t slice_data_offset; // byte offset of the current slice in the slice data buffer
480  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
492  uint16_t first_mb_in_slice;
493  uint8_t slice_type;
494  uint8_t direct_spatial_mv_pred_flag;
495  uint8_t num_ref_idx_l0_active_minus1;
496  uint8_t num_ref_idx_l1_active_minus1;
497  uint8_t cabac_init_idc;
498  int8_t slice_qp_delta;
499  uint8_t disable_deblocking_filter_idc;
500  int8_t slice_alpha_c0_offset_div2;
501  int8_t slice_beta_offset_div2;
502  RocdecAvcPicture ref_pic_list_0[32]; // 8.2.4.2
503  RocdecAvcPicture ref_pic_list_1[32]; // 8.2.4.2
504  uint8_t luma_log2_weight_denom;
505  uint8_t chroma_log2_weight_denom;
506  uint8_t luma_weight_l0_flag;
507  int16_t luma_weight_l0[32];
508  int16_t luma_offset_l0[32];
509  uint8_t chroma_weight_l0_flag;
510  int16_t chroma_weight_l0[32][2];
511  int16_t chroma_offset_l0[32][2];
512  uint8_t luma_weight_l1_flag;
513  int16_t luma_weight_l1[32];
514  int16_t luma_offset_l1[32];
515  uint8_t chroma_weight_l1_flag;
516  int16_t chroma_weight_l1[32][2];
517  int16_t chroma_offset_l1[32][2];
518  uint32_t reserved[4];
520 
521 /***********************************************************/
526 /***********************************************************/
527 typedef struct _RocdecAvcIQMatrix {
529  uint8_t scaling_list_4x4[6][16];
531  uint8_t scaling_list_8x8[2][64];
533  uint32_t reserved[4];
535 
536 /***********************************************************/
541 /***********************************************************/
542 typedef struct _RocdecHevcPicParams {
543  RocdecHevcPicture curr_pic;
544  RocdecHevcPicture ref_frames[15]; /* reference frame list in DPB */
545  uint16_t picture_width_in_luma_samples;
546  uint16_t picture_height_in_luma_samples;
547  union {
548  struct {
550  uint32_t chroma_format_idc : 2;
551  uint32_t separate_colour_plane_flag : 1;
552  uint32_t pcm_enabled_flag : 1;
553  uint32_t scaling_list_enabled_flag : 1;
554  uint32_t transform_skip_enabled_flag : 1;
555  uint32_t amp_enabled_flag : 1;
556  uint32_t strong_intra_smoothing_enabled_flag : 1;
557  uint32_t sign_data_hiding_enabled_flag : 1;
558  uint32_t constrained_intra_pred_flag : 1;
559  uint32_t cu_qp_delta_enabled_flag : 1;
560  uint32_t weighted_pred_flag : 1;
561  uint32_t weighted_bipred_flag : 1;
562  uint32_t transquant_bypass_enabled_flag : 1;
563  uint32_t tiles_enabled_flag : 1;
564  uint32_t entropy_coding_sync_enabled_flag : 1;
565  uint32_t pps_loop_filter_across_slices_enabled_flag : 1;
566  uint32_t loop_filter_across_tiles_enabled_flag : 1;
567  uint32_t pcm_loop_filter_disabled_flag : 1;
571  uint32_t no_bi_pred_flag : 1;
572  uint32_t reserved_bits : 11;
573  } bits;
574  uint32_t value;
575  } pic_fields;
576 
579  uint8_t bit_depth_luma_minus8;
580  uint8_t bit_depth_chroma_minus8;
581  uint8_t pcm_sample_bit_depth_luma_minus1;
582  uint8_t pcm_sample_bit_depth_chroma_minus1;
583  uint8_t log2_min_luma_coding_block_size_minus3;
584  uint8_t log2_diff_max_min_luma_coding_block_size;
585  uint8_t log2_min_luma_transform_block_size_minus2;
586  uint8_t log2_diff_max_min_luma_transform_block_size;
587  uint8_t log2_min_pcm_luma_coding_block_size_minus3;
588  uint8_t log2_diff_max_min_pcm_luma_coding_block_size;
589  uint8_t max_transform_hierarchy_depth_intra;
590  uint8_t max_transform_hierarchy_depth_inter;
591  int8_t init_qp_minus26;
592  uint8_t diff_cu_qp_delta_depth;
593  int8_t pps_cb_qp_offset;
594  int8_t pps_cr_qp_offset;
595  uint8_t log2_parallel_merge_level_minus2;
596  uint8_t num_tile_columns_minus1;
597  uint8_t num_tile_rows_minus1;
602  uint16_t column_width_minus1[19];
603  uint16_t row_height_minus1[21];
604 
605  union {
606  struct {
609  uint32_t long_term_ref_pics_present_flag : 1;
610  uint32_t sps_temporal_mvp_enabled_flag : 1;
611  uint32_t cabac_init_present_flag : 1;
612  uint32_t output_flag_present_flag : 1;
613  uint32_t dependent_slice_segments_enabled_flag : 1;
614  uint32_t pps_slice_chroma_qp_offsets_present_flag : 1;
615  uint32_t sample_adaptive_offset_enabled_flag : 1;
616  uint32_t deblocking_filter_override_enabled_flag : 1;
617  uint32_t pps_disable_deblocking_filter_flag : 1;
618  uint32_t slice_segment_header_extension_present_flag : 1;
619 
621  uint32_t rap_pic_flag : 1;
623  uint32_t idr_pic_flag : 1;
625  uint32_t intra_pic_flag : 1;
626 
627  uint32_t reserved_bits : 18;
628  } bits;
629  uint32_t value;
630  } slice_parsing_fields;
631 
634  uint8_t num_short_term_ref_pic_sets;
635  uint8_t num_long_term_ref_pic_sps;
636  uint8_t num_ref_idx_l0_default_active_minus1;
637  uint8_t num_ref_idx_l1_default_active_minus1;
638  int8_t pps_beta_offset_div2;
639  int8_t pps_tc_offset_div2;
640  uint8_t num_extra_slice_header_bits;
651  uint32_t st_rps_bits;
652  uint32_t reserved[8];
654 
655 /***********************************************************/
660 /***********************************************************/
661 typedef struct _RocdecHevcSliceParams {
665  uint32_t slice_data_size;
669  uint32_t slice_data_flag;
688  uint8_t ref_pic_list[2][15];
689  union {
690  uint32_t value;
691  struct {
693  uint32_t last_slice_of_pic : 1;
696  uint32_t slice_type : 2;
697  uint32_t color_plane_id : 2;
698  uint32_t slice_sao_luma_flag : 1;
699  uint32_t slice_sao_chroma_flag : 1;
700  uint32_t mvd_l1_zero_flag : 1;
701  uint32_t cabac_init_flag : 1;
702  uint32_t slice_temporal_mvp_enabled_flag : 1;
703  uint32_t slice_deblocking_filter_disabled_flag : 1;
704  uint32_t collocated_from_l0_flag : 1;
705  uint32_t slice_loop_filter_across_slices_enabled_flag : 1;
706  uint32_t reserved : 18;
707  } fields;
708  } long_slice_flags;
709 
712  uint8_t num_ref_idx_l0_active_minus1;
713  uint8_t num_ref_idx_l1_active_minus1;
714  int8_t slice_qp_delta;
715  int8_t slice_cb_qp_offset;
716  int8_t slice_cr_qp_offset;
717  int8_t slice_beta_offset_div2;
718  int8_t slice_tc_offset_div2;
719  uint8_t luma_log2_weight_denom;
720  int8_t delta_chroma_log2_weight_denom;
721  int8_t delta_luma_weight_l0[15];
722  int8_t luma_offset_l0[15];
723  int8_t delta_chroma_weight_l0[15][2];
725  int8_t chroma_offset_l0[15][2];
728  int8_t luma_offset_l1[15];
729  int8_t delta_chroma_weight_l1[15][2];
731  int8_t chroma_offset_l1[15][2];
734  uint16_t num_entry_point_offsets;
735  uint16_t entry_offset_to_subset_array;
738 
739  uint32_t reserved[2];
741 
742 /***********************************************************/
751 /***********************************************************/
752 typedef struct _RocdecHevcIQMatrix {
758  uint8_t scaling_list_4x4[6][16];
764  uint8_t scaling_list_8x8[6][64];
770  uint8_t scaling_list_16x16[6][64];
776  uint8_t scaling_list_32x32[2][64];
791  uint32_t reserved[4];
793 
794 /***********************************************************/
799 /***********************************************************/
800 typedef struct _RocdecVp9PicParams {
804  uint16_t frame_width;
808  uint16_t frame_height;
809 
818  uint32_t reference_frames[8];
819 
820  union {
821  struct {
825  uint32_t subsampling_x : 1;
826  uint32_t subsampling_y : 1;
827  uint32_t frame_type : 1;
828  uint32_t show_frame : 1;
829  uint32_t error_resilient_mode : 1;
830  uint32_t intra_only : 1;
831  uint32_t allow_high_precision_mv : 1;
832  uint32_t mcomp_filter_type : 3;
833  uint32_t frame_parallel_decoding_mode : 1;
834  uint32_t reset_frame_context : 2;
835  uint32_t refresh_frame_context : 1;
836  uint32_t frame_context_idx : 2;
837  uint32_t segmentation_enabled : 1;
838 
846 
851  uint32_t last_ref_frame : 3;
860  uint32_t golden_ref_frame : 3;
869  uint32_t alt_ref_frame : 3;
882  uint32_t lossless_flag : 1;
883  } bits;
884  uint32_t value;
885  } pic_fields;
886 
887  /* following parameters have same syntax with those in VP9 code */
888  uint8_t filter_level;
889  uint8_t sharpness_level;
890 
894  uint8_t log2_tile_rows;
908 
913 
919  uint8_t segment_pred_probs[3];
920 
924  uint8_t profile;
925 
929  uint8_t bit_depth;
930 
932  uint32_t va_reserved[8];
933 
935 
941  union {
942  struct {
957  uint16_t segment_reference : 2;
963  } fields;
964  uint16_t value;
965  } segment_flags;
966 
971  uint8_t filter_level[4][2];
992 
994  uint32_t va_reserved[4];
995 
997 
998 /***********************************************************/
1003 /***********************************************************/
1004 typedef struct _RocdecVp9SliceParams {
1019 
1024 
1026  uint32_t va_reserved[4];
1027 
1029 
1033  union {
1034  struct {
1042  uint32_t enabled : 1;
1048  uint32_t update_map : 1;
1054  uint32_t temporal_update : 1;
1060  uint32_t update_data : 1;
1061 
1063  uint32_t reserved : 28;
1064  } bits;
1065  uint32_t value;
1066  } segment_info_fields;
1067 
1089  int16_t feature_data[8][8];
1090 
1096  uint8_t feature_mask[8];
1097 
1099  uint32_t reserved[4];
1101 
1105  union {
1106  struct {
1111  uint32_t apply_grain : 1;
1112  uint32_t chroma_scaling_from_luma : 1;
1113  uint32_t grain_scaling_minus_8 : 2;
1114  uint32_t ar_coeff_lag : 2;
1115  uint32_t ar_coeff_shift_minus_6 : 2;
1116  uint32_t grain_scale_shift : 2;
1117  uint32_t overlap_flag : 1;
1118  uint32_t clip_to_restricted_range : 1;
1120  uint32_t reserved : 20;
1121  } bits;
1122  uint32_t value;
1123  } film_grain_info_fields;
1124 
1125  uint16_t grain_seed;
1126  /* value range [0..14] */
1127  uint8_t num_y_points;
1128  uint8_t point_y_value[14];
1129  uint8_t point_y_scaling[14];
1130  /* value range [0..10] */
1131  uint8_t num_cb_points;
1132  uint8_t point_cb_value[10];
1133  uint8_t point_cb_scaling[10];
1134  /* value range [0..10] */
1135  uint8_t num_cr_points;
1136  uint8_t point_cr_value[10];
1137  uint8_t point_cr_scaling[10];
1138  /* value range [-128..127] */
1139  int8_t ar_coeffs_y[24];
1140  int8_t ar_coeffs_cb[25];
1141  int8_t ar_coeffs_cr[25];
1142  uint8_t cb_mult;
1143  uint8_t cb_luma_mult;
1144  uint16_t cb_offset;
1145  uint8_t cr_mult;
1146  uint8_t cr_luma_mult;
1147  uint16_t cr_offset;
1148 
1150  uint32_t reserved[4];
1152 
1153 typedef enum {
1165 
1169 
1175  int32_t wmmat[8];
1176 
1177  /* valid or invalid on affine set */
1178  uint8_t invalid;
1179 
1181  uint32_t reserved[4];
1183 
1184 /***********************************************************/
1189 /***********************************************************/
1190 typedef struct _RocdecAV1PicParams {
1196  uint8_t profile;
1197 
1198  uint8_t order_hint_bits_minus_1;
1199 
1206  uint8_t bit_depth_idx;
1207 
1210 
1211  union {
1212  struct {
1213  uint32_t still_picture : 1;
1214  uint32_t use_128x128_superblock : 1;
1215  uint32_t enable_filter_intra : 1;
1216  uint32_t enable_intra_edge_filter : 1;
1217 
1220  uint32_t enable_masked_compound : 1;
1221 
1222  uint32_t enable_dual_filter : 1;
1223  uint32_t enable_order_hint : 1;
1224  uint32_t enable_jnt_comp : 1;
1225  uint32_t enable_cdef : 1;
1226  uint32_t mono_chrome : 1;
1227  uint32_t color_range : 1;
1228  uint32_t subsampling_x : 1;
1229  uint32_t subsampling_y : 1;
1230  uint32_t chroma_sample_position : 1;
1231  uint32_t film_grain_params_present : 1;
1233  uint32_t reserved : 16;
1234  } fields;
1235  uint32_t value;
1236  } seq_info_fields;
1237 
1244 
1250 
1256 
1276 
1283  uint16_t frame_height_minus1;
1284 
1290  uint16_t output_frame_height_in_tiles_minus_1;
1291 
1302 
1313  uint8_t ref_frame_idx[7];
1314 
1323  uint8_t order_hint;
1324 
1325  RocdecAv1SegmentationStruct seg_info;
1326  RocdecAv1FilmGrainStruct film_grain_info;
1327 
1333  uint8_t tile_cols;
1334  uint8_t tile_rows;
1335 
1336  /* The width/height of a tile minus 1 in units of superblocks. Though the
1337  * maximum number of tiles is 64, since ones of the last tile are computed
1338  * from ones of the other tiles and frame_width/height, they are not
1339  * necessarily specified.
1340  */
1341  uint16_t width_in_sbs_minus_1[63];
1342  uint16_t height_in_sbs_minus_1[63];
1343 
1349 
1350  /* specify the tile index for context updating */
1351  uint16_t context_update_tile_id;
1352 
1353  union {
1357  struct {
1367  uint32_t frame_type : 2;
1368  uint32_t show_frame : 1;
1369  uint32_t showable_frame : 1;
1370  uint32_t error_resilient_mode : 1;
1371  uint32_t disable_cdf_update : 1;
1372  uint32_t allow_screen_content_tools : 1;
1373  uint32_t force_integer_mv : 1;
1374  uint32_t allow_intrabc : 1;
1375  uint32_t use_superres : 1;
1376  uint32_t allow_high_precision_mv : 1;
1377  uint32_t is_motion_mode_switchable : 1;
1378  uint32_t use_ref_frame_mvs : 1;
1379  /* disable_frame_end_update_cdf is coded as refresh_frame_context. */
1380  uint32_t disable_frame_end_update_cdf : 1;
1381  uint32_t uniform_tile_spacing_flag : 1;
1382  uint32_t allow_warped_motion : 1;
1384  uint32_t large_scale_tile : 1;
1385 
1387  uint32_t reserved : 15;
1388  } bits;
1389  uint32_t value;
1390  } pic_info_fields;
1391 
1397 
1401  uint8_t interp_filter;
1402 
1406  uint8_t filter_level[2];
1407 
1412  uint8_t filter_level_v;
1413 
1414  union {
1415  struct {
1419  uint8_t sharpness_level : 3;
1420  uint8_t mode_ref_delta_enabled : 1;
1421  uint8_t mode_ref_delta_update : 1;
1422 
1424  uint8_t reserved : 3;
1425  } bits;
1426  uint8_t value;
1427  } loop_filter_info_fields;
1428 
1433  int8_t ref_deltas[8];
1434 
1439  int8_t mode_deltas[2];
1440 
1446  uint8_t base_qindex;
1467 
1470  union {
1471  struct {
1472  uint16_t using_qmatrix : 1;
1477  uint16_t qm_y : 4;
1478  uint16_t qm_u : 4;
1479  uint16_t qm_v : 4;
1480 
1482  uint16_t reserved : 3;
1483  } bits;
1484  uint16_t value;
1486 
1487  union {
1488  struct {
1491  uint32_t delta_q_present_flag : 1;
1492  uint32_t log2_delta_q_res : 2;
1493 
1497  uint32_t log2_delta_lf_res : 2;
1498 
1501  uint32_t delta_lf_multi : 1;
1502 
1506  uint32_t tx_mode : 2;
1507 
1508  /* AV1 frame reference mode semantic */
1509  uint32_t reference_select : 1;
1510 
1511  uint32_t reduced_tx_set_used : 1;
1512 
1513  uint32_t skip_mode_present : 1;
1514 
1516  uint32_t reserved : 20;
1517  } bits;
1518  uint32_t value;
1519  } mode_control_fields;
1520 
1523  /* value range [0..3] */
1525  /* value range [0..3] */
1526  uint8_t cdef_bits;
1527 
1542  /* value range [0..63] */
1543  uint8_t cdef_y_strengths[8];
1544  /* value range [0..63] */
1545  uint8_t cdef_uv_strengths[8];
1546 
1549  union {
1550  struct {
1551  uint16_t yframe_restoration_type : 2;
1552  uint16_t cbframe_restoration_type : 2;
1553  uint16_t crframe_restoration_type : 2;
1554  uint16_t lr_unit_shift : 2;
1555  uint16_t lr_uv_shift : 1;
1556 
1558  uint16_t reserved : 7;
1559  } bits;
1560  uint16_t value;
1562 
1566 
1570  uint32_t reserved[8];
1572 
1573 /***********************************************************/
1581 /***********************************************************/
1582 typedef struct _RocdecAv1SliceParams {
1597 
1598  uint16_t tile_row;
1599  uint16_t tile_column;
1600 
1601  uint16_t tg_start;
1602  uint16_t tg_end;
1603 
1610 
1616 
1618  uint32_t reserved[4];
1620 
1621 /******************************************************************************************/
1627 /******************************************************************************************/
1628 typedef struct _RocdecPicParams {
1635  // Bitstream data
1637  const uint8_t *bitstream_data;
1638  uint32_t num_slices;
1642  uint32_t reserved[30];
1644  // IN: Codec-specific data
1645  union {
1647  RocdecAvcPicParams avc;
1648  RocdecHevcPicParams hevc;
1649  RocdecVc1PicParams vc1;
1650  RocdecJPEGPicParams jpeg;
1651  RocdecVp9PicParams vp9;
1652  RocdecAv1PicParams av1;
1653  uint32_t codec_reserved[256];
1654  } pic_params;
1655 
1658  union {
1659  // Todo: Add slice params defines for other codecs.
1660  RocdecAvcSliceParams *avc;
1661  RocdecHevcSliceParams *hevc;
1662  RocdecVp9SliceParams *vp9;
1663  RocdecAv1SliceParams *av1;
1665 
1666  union {
1667  // Todo: Added IQ matrix defines for other codecs.
1668  RocdecAvcIQMatrix avc;
1669  RocdecHevcIQMatrix hevc;
1670  } iq_matrix;
1671 } RocdecPicParams;
1672 
1673 /******************************************************/
1678 /******************************************************/
1679 typedef struct _RocdecProcParams {
1682  uint32_t reserved_flags[2];
1684  // The fields below are used for raw YUV input
1685  uint64_t raw_input_dptr;
1686  uint32_t raw_input_pitch;
1687  uint32_t raw_input_format;
1688  uint64_t raw_output_dptr;
1689  uint32_t raw_output_pitch;
1691  uint32_t reserved[16];
1693 
1694 /*****************************************************************************************************/
1698 /*****************************************************************************************************/
1699 extern rocDecStatus ROCDECAPI rocDecCreateDecoder(rocDecDecoderHandle *decoder_handle, RocDecoderCreateInfo *decoder_create_info);
1700 
1701 /*****************************************************************************************************/
1705 /*****************************************************************************************************/
1706 extern rocDecStatus ROCDECAPI rocDecDestroyDecoder(rocDecDecoderHandle decoder_handle);
1707 
1708 /**********************************************************************************************************************/
1715 /**********************************************************************************************************************/
1716 extern rocDecStatus ROCDECAPI rocDecGetDecoderCaps(RocdecDecodeCaps *decode_caps);
1717 
1718 /*****************************************************************************************************/
1723 /*****************************************************************************************************/
1724 extern rocDecStatus ROCDECAPI rocDecDecodeFrame(rocDecDecoderHandle decoder_handle, RocdecPicParams *pic_params);
1725 
1726 /************************************************************************************************************/
1733 /************************************************************************************************************/
1734 extern rocDecStatus ROCDECAPI rocDecGetDecodeStatus(rocDecDecoderHandle decoder_handle, int pic_idx, RocdecDecodeStatus *decode_status);
1735 
1736 /*********************************************************************************************************/
1741 /*********************************************************************************************************/
1742 extern rocDecStatus ROCDECAPI rocDecReconfigureDecoder(rocDecDecoderHandle decoder_handle, RocdecReconfigureDecoderInfo *reconfig_params);
1743 
1744 /************************************************************************************************************************/
1754 /************************************************************************************************************************/
1755 extern rocDecStatus ROCDECAPI rocDecGetVideoFrame(rocDecDecoderHandle decoder_handle, int pic_idx,
1756  void *dev_mem_ptr[3], uint32_t *horizontal_pitch,
1757  RocdecProcParams *vid_postproc_params);
1758 
1759 /*****************************************************************************************************/
1763 /*****************************************************************************************************/
1764 extern const char *ROCDECAPI rocDecGetErrorName(rocDecStatus rocdec_status);
1765 
1766 #ifdef __cplusplus
1767 }
1768 #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:295
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:77
@ rocDecVideoCodec_NV12
Definition: rocdecode.h:91
@ rocDecVideoCodec_YV12
Definition: rocdecode.h:90
@ rocDecVideoCodec_YUV420
Definition: rocdecode.h:89
@ rocDecVideoCodec_UYVY
Definition: rocdecode.h:93
@ rocDecVideoCodec_YUYV
Definition: rocdecode.h:92
@ rocDecVideoCodec_AV1
Definition: rocdecode.h:83
@ rocDecVideoCodec_MPEG4
Definition: rocdecode.h:80
@ rocDecVideoCodec_HEVC
Definition: rocdecode.h:82
@ rocDecVideoCodec_MPEG1
Definition: rocdecode.h:78
@ rocDecVideoCodec_JPEG
Definition: rocdecode.h:86
@ rocDecVideoCodec_VP9
Definition: rocdecode.h:85
@ rocDecVideoCodec_AVC
Definition: rocdecode.h:81
@ rocDecVideoCodec_MPEG2
Definition: rocdecode.h:79
@ rocDecVideoCodec_VP8
Definition: rocdecode.h:84
@ rocDecVideoCodec_NumCodecs
Definition: rocdecode.h:87
struct _RocdecAv1SegmentationStruct RocdecAv1SegmentationStruct
Segmentation Information for AV1.
rocDecVideoSurfaceFormat_enum
Definition: rocdecode.h:104
@ rocDecVideoSurfaceFormat_Native
Definition: rocdecode.h:117
@ rocDecVideoSurfaceFormat_YUV420
Definition: rocdecode.h:111
@ rocDecVideoSurfaceFormat_YUV422
Definition: rocdecode.h:114
@ rocDecVideoSurfaceFormat_YUV444_16Bit
Definition: rocdecode.h:109
@ rocDecVideoSurfaceFormat_YUV420_16Bit
Definition: rocdecode.h:112
@ rocDecVideoSurfaceFormat_P016
Definition: rocdecode.h:106
@ rocDecVideoSurfaceFormat_NV12
Definition: rocdecode.h:105
@ rocDecVideoSurfaceFormat_YUV422_16Bit
Definition: rocdecode.h:115
@ rocDecVideoSurfaceFormat_YUV444
Definition: rocdecode.h:108
struct _RocdecAv1FilmGrainStruct RocdecAv1FilmGrainStruct
Film Grain Information for AV1.
void * rocDecDecoderHandle
Definition: rocdecode.h:51
rocDecVideoChromaFormat_enum
Definition: rocdecode.h:132
@ rocDecVideoChromaFormat_422
Definition: rocdecode.h:135
@ rocDecVideoChromaFormat_444
Definition: rocdecode.h:136
@ rocDecVideoChromaFormat_420
Definition: rocdecode.h:134
@ rocDecVideoChromaFormat_Monochrome
Definition: rocdecode.h:133
struct _RocdecVp9SegmentParameter RocdecVp9SegmentParameter
VP9 Segmentation Parameter Data Structure This structure is configured to be the same as VA-API VASeg...
RocdecAv1TransformationType
Definition: rocdecode.h:1153
@ RocdecAv1TransformationTranslation
Definition: rocdecode.h:1157
@ RocdecAv1TransformationAffine
Definition: rocdecode.h:1161
@ RocdecAv1TransformationCount
Definition: rocdecode.h:1163
@ RocdecAv1TransformationRotzoom
Definition: rocdecode.h:1159
@ RocdecAv1TransformationIdentity
Definition: rocdecode.h:1155
Definition: rocdecode.h:181
uint32_t height
Definition: rocdecode.h:185
uint32_t width
Definition: rocdecode.h:184
uint32_t target_width
Definition: rocdecode.h:204
uint32_t max_height
Definition: rocdecode.h:196
uint32_t bit_depth_minus_8
Definition: rocdecode.h:189
uint32_t num_output_surfaces
Definition: rocdecode.h:206
uint8_t device_id
Definition: rocdecode.h:182
struct _RocDecoderCreateInfo::@1 target_rect
rocDecVideoChromaFormat chroma_format
Definition: rocdecode.h:188
uint32_t num_decode_surfaces
Definition: rocdecode.h:186
rocDecVideoCodec codec_type
Definition: rocdecode.h:187
uint32_t max_width
Definition: rocdecode.h:195
rocDecVideoSurfaceFormat output_format
Definition: rocdecode.h:203
uint32_t target_height
Definition: rocdecode.h:205
struct _RocDecoderCreateInfo::@0 display_rect
uint32_t intra_decode_only
Definition: rocdecode.h:190
uint32_t reserved_2[4]
Definition: rocdecode.h:214
Definition: rocdecode.h:1190
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:1458
uint8_t filter_level_u
chroma loop filter levels. value range [0..63].
Definition: rocdecode.h:1411
int ref_frame_map[8]
Surface indices of reference frames in DPB.
Definition: rocdecode.h:1301
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:1333
uint8_t matrix_coefficients
corresponds to AV1 spec variable of the same name.
Definition: rocdecode.h:1209
uint8_t sharpness_level
flags for reference pictures same syntax and semantic as those in AV1 code
Definition: rocdecode.h:1419
int8_t u_dc_delta_q
U DC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1454
uint16_t qm_y
qm level value range [0..15] Invalid if using_qmatrix equals 0.
Definition: rocdecode.h:1477
int8_t ref_deltas[8]
The adjustment needed for the filter level based on the chosen reference frame. value range [-64....
Definition: rocdecode.h:1433
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:1206
uint32_t tx_mode
read_tx_mode value range [0..2]
Definition: rocdecode.h:1506
uint16_t frame_width_minus1
Picture resolution minus 1 Picture original resolution. If SuperRes is enabled, this is the upscaled ...
Definition: rocdecode.h:1282
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:1255
uint8_t cdef_y_strengths[8]
Definition: rocdecode.h:1543
int8_t v_ac_delta_q
V AC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1466
int8_t v_dc_delta_q
V DC delta from Y AC value range [-64..63].
Definition: rocdecode.h:1462
uint8_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1424
uint8_t primary_ref_frame
primary reference frame index Index into ref_frame_idx[], specifying which reference frame contains p...
Definition: rocdecode.h:1322
uint32_t enable_interintra_compound
Definition: rocdecode.h:1219
int current_frame
Picture level information.
Definition: rocdecode.h:1243
uint8_t cdef_damping_minus_3
CDEF parameters.
Definition: rocdecode.h:1524
uint8_t profile
sequence level information
Definition: rocdecode.h:1196
uint8_t ref_frame_idx[7]
Reference frame indices.
Definition: rocdecode.h:1313
uint8_t filter_level[2]
luma loop filter levels. value range [0..63].
Definition: rocdecode.h:1406
uint16_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1482
uint32_t delta_q_present_flag
delta_q parameters
Definition: rocdecode.h:1491
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:1289
uint32_t large_scale_tile
indicate if current frame in large scale tile mode
Definition: rocdecode.h:1384
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:1439
uint8_t superres_scale_denominator
Supper resolution scale denominator. When use_superres=1, superres_scale_denominator must be in the r...
Definition: rocdecode.h:1396
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:1367
uint32_t delta_lf_multi
CONFIG_LOOPFILTER_LEVEL.
Definition: rocdecode.h:1501
uint32_t delta_lf_present_flag
delta_lf parameters
Definition: rocdecode.h:1496
uint8_t base_qindex
quantization
Definition: rocdecode.h:1446
RocdecAv1WarpedMotionParams wm[7]
global motion
Definition: rocdecode.h:1565
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:1450
int current_display_picture
display buffer of current picture Used for film grain applied decoded picture. Valid only when apply_...
Definition: rocdecode.h:1249
uint8_t interp_filter
Interpolation filter. value range [0..4].
Definition: rocdecode.h:1401
int * anchor_frames_list
anchor frame list for large scale tile For large scale tile applications, the anchor frames could com...
Definition: rocdecode.h:1275
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:1348
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1233
Film Grain Information for AV1.
Definition: rocdecode.h:1104
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:1111
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1120
Segmentation Information for AV1.
Definition: rocdecode.h:1032
uint32_t enabled
Definition: rocdecode.h:1042
uint32_t temporal_update
Definition: rocdecode.h:1054
int16_t feature_data[8][8]
Segmentation parameters for current frame. feature_data[segment_id][feature_id] where segment_id has ...
Definition: rocdecode.h:1089
uint32_t update_map
Definition: rocdecode.h:1048
uint32_t reserved
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1063
uint32_t update_data
Definition: rocdecode.h:1060
uint8_t feature_mask[8]
indicates if a feature is enabled or not. Each bit field itself is the feature_id....
Definition: rocdecode.h:1096
Definition: rocdecode.h:1582
uint32_t slice_data_flag
Definition: rocdecode.h:1596
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:1609
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:1588
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:1615
uint32_t slice_data_offset
Definition: rocdecode.h:1592
uint32_t reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1618
Definition: rocdecode.h:1166
RocdecAv1TransformationType wmtype
Specify the type of warped motion.
Definition: rocdecode.h:1168
int32_t wmmat[8]
Specify warp motion parameters wm.wmmat[] corresponds to gm_params[][] in spec. Details in AV1 spec s...
Definition: rocdecode.h:1175
uint32_t reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1181
Definition: rocdecode.h:527
uint8_t scaling_list_8x8[2][64]
8x8 scaling list, in raster scan order.
Definition: rocdecode.h:531
uint32_t reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:533
uint8_t scaling_list_4x4[6][16]
4x4 scaling list, in raster scan order.
Definition: rocdecode.h:529
Definition: rocdecode.h:418
Definition: rocdecode.h:265
int32_t top_field_order_cnt
Definition: rocdecode.h:269
int pic_idx
Definition: rocdecode.h:266
uint32_t flags
Definition: rocdecode.h:268
int32_t bottom_field_order_cnt
Definition: rocdecode.h:270
uint32_t frame_idx
Definition: rocdecode.h:267
Definition: rocdecode.h:477
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the beginning of slice_data().
Definition: rocdecode.h:491
Definition: rocdecode.h:160
uint16_t min_width
Definition: rocdecode.h:171
uint32_t reserved_1[3]
Definition: rocdecode.h:165
uint32_t reserved_2[6]
Definition: rocdecode.h:173
uint8_t num_decoders
Definition: rocdecode.h:167
rocDecVideoCodec codec_type
Definition: rocdecode.h:162
uint8_t device_id
Definition: rocdecode.h:161
uint16_t min_height
Definition: rocdecode.h:172
uint32_t max_width
Definition: rocdecode.h:169
rocDecVideoChromaFormat chroma_format
Definition: rocdecode.h:163
uint16_t output_format_mask
Definition: rocdecode.h:168
uint8_t is_supported
Definition: rocdecode.h:166
uint32_t max_height
Definition: rocdecode.h:170
uint32_t bit_depth_minus_8
Definition: rocdecode.h:164
Definition: rocdecode.h:223
Definition: rocdecode.h:752
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:764
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:758
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:790
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:770
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:783
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:776
Definition: rocdecode.h:542
uint16_t column_width_minus1[19]
Definition: rocdecode.h:602
uint32_t idr_pic_flag
Definition: rocdecode.h:623
uint32_t chroma_format_idc
Definition: rocdecode.h:550
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:651
uint32_t no_bi_pred_flag
Definition: rocdecode.h:571
uint32_t intra_pic_flag
Definition: rocdecode.h:625
uint8_t sps_max_dec_pic_buffering_minus1
Definition: rocdecode.h:578
uint32_t no_pic_reordering_flag
Definition: rocdecode.h:569
uint32_t lists_modification_present_flag
Definition: rocdecode.h:608
uint32_t rap_pic_flag
Definition: rocdecode.h:621
uint8_t log2_max_pic_order_cnt_lsb_minus4
Definition: rocdecode.h:633
Definition: rocdecode.h:288
uint32_t flags
Definition: rocdecode.h:296
int pic_idx
Definition: rocdecode.h:289
uint32_t reserved[4]
Definition: rocdecode.h:297
Definition: rocdecode.h:661
uint32_t slice_segment_address
Definition: rocdecode.h:682
uint32_t slice_data_flag
Slice data buffer flags. See VA_SLICE_DATA_FLAG_XXX.
Definition: rocdecode.h:669
uint8_t five_minus_max_num_merge_cand
Definition: rocdecode.h:733
uint32_t slice_data_offset
The offset to the NAL unit header for this slice.
Definition: rocdecode.h:667
uint32_t last_slice_of_pic
Definition: rocdecode.h:693
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:665
int8_t delta_luma_weight_l1[15]
Definition: rocdecode.h:727
int8_t chroma_offset_l1[15][2]
Definition: rocdecode.h:731
int8_t chroma_offset_l0[15][2]
Definition: rocdecode.h:725
uint16_t slice_data_num_emu_prevn_bytes
Number of emulation prevention bytes in slice header.
Definition: rocdecode.h:737
uint8_t collocated_ref_idx
Definition: rocdecode.h:711
uint8_t ref_pic_list[2][15]
index into ReferenceFrames[] ref_pic_list[0][] corresponds to RefPicList0[] of HEVC variable....
Definition: rocdecode.h:688
uint32_t dependent_slice_segment_flag
Definition: rocdecode.h:695
uint32_t slice_data_byte_offset
Byte offset from NAL unit header to the beginning of slice_data().
Definition: rocdecode.h:680
Definition: rocdecode.h:345
Definition: rocdecode.h:372
Definition: rocdecode.h:355
Definition: rocdecode.h:1628
uint32_t reserved[30]
Definition: rocdecode.h:1642
union _RocdecPicParams::@37 slice_params
Variable size array. The user should allocate one slice param struct for each slice.
RocdecMpeg2PicParams mpeg2
Definition: rocdecode.h:1646
int bottom_field_flag
Definition: rocdecode.h:1633
int intra_pic_flag
Definition: rocdecode.h:1641
int pic_height
Definition: rocdecode.h:1630
int ref_pic_flag
Definition: rocdecode.h:1640
const uint8_t * bitstream_data
Definition: rocdecode.h:1637
uint32_t num_slices
Definition: rocdecode.h:1638
int curr_pic_idx
Definition: rocdecode.h:1631
int field_pic_flag
Definition: rocdecode.h:1632
uint32_t bitstream_data_len
Definition: rocdecode.h:1636
int second_field
Definition: rocdecode.h:1634
int pic_width
Definition: rocdecode.h:1629
Definition: rocdecode.h:1679
uint32_t raw_input_format
Definition: rocdecode.h:1687
uint64_t raw_output_dptr
Definition: rocdecode.h:1688
uint32_t raw_output_pitch
Definition: rocdecode.h:1689
int progressive_frame
Definition: rocdecode.h:1680
uint64_t raw_input_dptr
Definition: rocdecode.h:1685
uint32_t reserved_flags[2]
Definition: rocdecode.h:1682
uint32_t raw_input_pitch
Definition: rocdecode.h:1686
uint32_t raw_output_format
Definition: rocdecode.h:1690
uint32_t reserved[16]
Definition: rocdecode.h:1691
int top_field_first
Definition: rocdecode.h:1681
Definition: rocdecode.h:235
uint32_t target_width
Definition: rocdecode.h:238
struct _RocdecReconfigureDecoderInfo::@3 target_rect
uint32_t num_decode_surfaces
Definition: rocdecode.h:240
uint32_t height
Definition: rocdecode.h:237
uint32_t bit_depth_minus_8
Definition: rocdecode.h:241
uint32_t width
Definition: rocdecode.h:236
struct _RocdecReconfigureDecoderInfo::@2 display_rect
uint32_t reserved_1[11]
Definition: rocdecode.h:242
uint32_t reserved_2[11]
Definition: rocdecode.h:256
uint32_t target_height
Definition: rocdecode.h:239
Definition: rocdecode.h:407
Definition: rocdecode.h:800
uint32_t reference_frames[8]
Surface indices of reference frames in DPB.
Definition: rocdecode.h:818
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:855
uint32_t segmentation_update_map
corresponds to variable update_mb_segmentation_map in VP9 code.
Definition: rocdecode.h:845
uint16_t frame_width
picture width Picture original resolution. The value may not be multiple of 8.
Definition: rocdecode.h:804
uint8_t profile
VP9 Profile definition value range [0..3].
Definition: rocdecode.h:924
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:894
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:860
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:851
uint32_t segmentation_temporal_update
corresponds to variable temporal_update in VP9 code.
Definition: rocdecode.h:841
uint8_t mb_segment_tree_probs[7]
Definition: rocdecode.h:918
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:873
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:898
uint32_t alt_ref_frame
Index of reference_frames[] and points to the ALTERNATE reference frame. Corresponds to active_ref_id...
Definition: rocdecode.h:869
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:882
uint32_t subsampling_x
flags for current picture same syntax and semantic as those in VP9 code
Definition: rocdecode.h:825
uint32_t va_reserved[8]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:932
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:864
uint8_t bit_depth
VP9 bit depth per sample same for both luma and chroma samples.
Definition: rocdecode.h:929
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:907
uint16_t first_partition_size
The byte count of compressed header the bitstream buffer, which corresponds to syntax first_partition...
Definition: rocdecode.h:912
uint16_t frame_height
picture height Picture original resolution. The value may not be multiple of 8.
Definition: rocdecode.h:808
VP9 Segmentation Parameter Data Structure This structure is configured to be the same as VA-API VASeg...
Definition: rocdecode.h:940
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:971
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:981
uint32_t va_reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:994
uint16_t segment_reference
Specifies per segment reference indication. 0: reserved 1: Last ref 2: golden 3: altref Value can be ...
Definition: rocdecode.h:957
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:991
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:976
uint16_t segment_reference_skipped
Indicates if per segment skip feature is enabled. Corresponding to variable feature_enabled when j ==...
Definition: rocdecode.h:962
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:986
uint16_t segment_reference_enabled
Indicates if per segment reference frame indicator is enabled. Corresponding to variable feature_enab...
Definition: rocdecode.h:948
Definition: rocdecode.h:1004
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:1010
RocdecVp9SegmentParameter seg_param[8]
per segment information
Definition: rocdecode.h:1023
uint32_t slice_data_flag
Definition: rocdecode.h:1018
uint32_t va_reserved[4]
Reserved bytes for future use, must be zero.
Definition: rocdecode.h:1026
uint32_t slice_data_offset
Definition: rocdecode.h:1014