docs-6.1.1/api/rocdecode.h Source File

docs-6.1.1/api/rocdecode.h Source File#

rocDecode: docs-6.1.1/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 
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 /*********************************************************************************/
110 } rocDecVideoSurfaceFormat;
111 
112 /**************************************************************************************************************/
117 /**************************************************************************************************************/
123 } rocDecVideoChromaFormat;
124 
125 
126 /*************************************************************************/
131 /*************************************************************************/
132 typedef enum rocDecodeStatus_enum {
133  rocDecodeStatus_Invalid = 0, // Decode status is not valid
134  rocDecodeStatus_InProgress = 1, // Decode is in progress
135  rocDecodeStatus_Success = 2, // Decode is completed without any errors
136  // 3 to 7 enums are reserved for future use
137  rocDecodeStatus_Error = 8, // Decode is completed with an error (error is not concealed)
138  rocDecodeStatus_Error_Concealed = 9, // Decode is completed with an error and error is concealed
139  rocDecodeStatus_Displaying = 10, // Decode is completed, displaying in progress
140 } rocDecDecodeStatus;
141 
142 /**************************************************************************************************************/
146 /**************************************************************************************************************/
147 typedef struct _RocdecDecodeCaps {
148  uint8_t device_id;
149  rocDecVideoCodec codec_type;
150  rocDecVideoChromaFormat chroma_format;
151  uint32_t bit_depth_minus_8;
152  uint32_t reserved_1[3];
153  uint8_t is_supported;
154  uint8_t num_decoders;
156  uint32_t max_width;
157  uint32_t max_height;
158  uint16_t min_width;
159  uint16_t min_height;
160  uint32_t reserved_2[6];
162 
163 /**************************************************************************************************************/
167 /**************************************************************************************************************/
168 typedef struct _RocDecoderCreateInfo {
169  uint8_t device_id;
171  uint32_t width;
172  uint32_t height;
174  rocDecVideoCodec codec_type;
175  rocDecVideoChromaFormat chroma_format;
176  uint32_t bit_depth_minus_8;
177  uint32_t intra_decode_only;
182  uint32_t max_width;
183  uint32_t max_height;
184  struct {
185  int16_t left;
186  int16_t top;
187  int16_t right;
188  int16_t bottom;
190  rocDecVideoSurfaceFormat output_format;
191  uint32_t target_width;
192  uint32_t target_height;
194  struct {
195  int16_t left;
196  int16_t top;
197  int16_t right;
198  int16_t bottom;
199  } target_rect;
201  uint32_t reserved_2[4];
203 
204 /*********************************************************************************************************/
209 /*********************************************************************************************************/
210 typedef struct _RocdecDecodeStatus {
211  rocDecDecodeStatus decode_status;
212  uint32_t reserved[31];
213  void *p_reserved[8];
215 
216 /****************************************************/
221 /****************************************************/
223  uint32_t width;
224  uint32_t height;
225  uint32_t target_width;
226  uint32_t target_height;
228  uint32_t reserved_1[12];
229  struct {
230  int16_t left;
231  int16_t top;
232  int16_t right;
233  int16_t bottom;
235  struct {
236  int16_t left;
237  int16_t top;
238  int16_t right;
239  int16_t bottom;
240  } target_rect;
242  uint32_t reserved_2[11];
244 
245 /*********************************************************/
250 /*********************************************************/
251 typedef struct _RocdecAvcPicture {
252  int pic_idx;
253  uint32_t frame_idx;
254  uint32_t flags;
257  uint32_t reserved[4];
259 
260 /* flags in RocdecAvcPicture could be OR of the following */
261 #define RocdecAvcPicture_FLAGS_INVALID 0x00000001
262 #define RocdecAvcPicture_FLAGS_TOP_FIELD 0x00000002
263 #define RocdecAvcPicture_FLAGS_BOTTOM_FIELD 0x00000004
264 #define RocdecAvcPicture_FLAGS_SHORT_TERM_REFERENCE 0x00000008
265 #define RocdecAvcPicture_FLAGS_LONG_TERM_REFERENCE 0x00000010
266 #define RocdecAvcPicture_FLAGS_NON_EXISTING 0x00000020
267 
268 /*********************************************************/
273 /*********************************************************/
274 typedef struct _RocdecHevcPicture {
275  int pic_idx;
278 
281  int poc;
282  uint32_t flags;
283  uint32_t reserved[4];
285 
286 /* flags in RocdecHevcPicture could be OR of the following */
287 #define RocdecHevcPicture_INVALID 0x00000001
291 #define RocdecHevcPicture_FIELD_PIC 0x00000002
296 #define RocdecHevcPicture_BOTTOM_FIELD 0x00000004
298 #define RocdecHevcPicture_LONG_TERM_REFERENCE 0x00000008
313 #define RocdecHevcPicture_RPS_ST_CURR_BEFORE 0x00000010
318 #define RocdecHevcPicture_RPS_ST_CURR_AFTER 0x00000020
323 #define RocdecHevcPicture_RPS_LT_CURR 0x00000040
324 
325 /***********************************************************/
330 /***********************************************************/
331 typedef struct _RocdecJPEGPicParams {
332  int reserved;
334 
335 /***********************************************************/
340 /***********************************************************/
341 typedef struct _RocdecMpeg2QMatrix {
342  int32_t load_intra_quantiser_matrix;
343  int32_t load_non_intra_quantiser_matrix;
344  int32_t load_chroma_intra_quantiser_matrix;
345  int32_t load_chroma_non_intra_quantiser_matrix;
346  uint8_t intra_quantiser_matrix[64];
347  uint8_t non_intra_quantiser_matrix[64];
348  uint8_t chroma_intra_quantiser_matrix[64];
349  uint8_t chroma_non_intra_quantiser_matrix[64];
351 
352 /***********************************************************/
357 /***********************************************************/
358 typedef struct _RocdecMpeg2PicParams {
359  uint16_t horizontal_size;
360  uint16_t vertical_size;
361  uint32_t forward_reference_pic; // surface_id for forward reference
362  uint32_t backward_reference_picture; // surface_id for backward reference
363  /* meanings of the following fields are the same as in the standard */
364  int32_t picture_coding_type;
365  int32_t f_code; /* pack all four fcode into this */
366  union {
367  struct {
368  uint32_t intra_dc_precision : 2;
369  uint32_t picture_structure : 2;
370  uint32_t top_field_first : 1;
371  uint32_t frame_pred_frame_dct : 1;
372  uint32_t concealment_motion_vectors : 1;
373  uint32_t q_scale_type : 1;
374  uint32_t intra_vlc_format : 1;
375  uint32_t alternate_scan : 1;
376  uint32_t repeat_first_field : 1;
377  uint32_t progressive_frame : 1;
378  uint32_t is_first_field : 1; // indicate whether the current field is the first field for field picture
379  } bits;
380  uint32_t value;
381  } picture_coding_extension;
382 
383  RocdecMpeg2QMatrix q_matrix;
384  uint32_t reserved[4];
386 
387 /***********************************************************/
392 /***********************************************************/
393 typedef struct _RocdecVc1PicParams {
394  int reserved;
396 
397 /***********************************************************/
403 /***********************************************************/
404 typedef struct _RocdecAvcPicParams {
405  RocdecAvcPicture curr_pic;
406  RocdecAvcPicture ref_frames[16]; /* in DPB */
407  uint16_t picture_width_in_mbs_minus1;
408  uint16_t picture_height_in_mbs_minus1;
409  uint8_t bit_depth_luma_minus8;
410  uint8_t bit_depth_chroma_minus8;
411  uint8_t num_ref_frames;
412  union {
413  struct {
414  uint32_t chroma_format_idc : 2;
415  uint32_t residual_colour_transform_flag : 1;
416  uint32_t gaps_in_frame_num_value_allowed_flag : 1;
417  uint32_t frame_mbs_only_flag : 1;
418  uint32_t mb_adaptive_frame_field_flag : 1;
419  uint32_t direct_8x8_inference_flag : 1;
420  uint32_t MinLumaBiPredSize8x8 : 1; /* see A.3.3.2 */
421  uint32_t log2_max_frame_num_minus4 : 4;
422  uint32_t pic_order_cnt_type : 2;
423  uint32_t log2_max_pic_order_cnt_lsb_minus4 : 4;
424  uint32_t delta_pic_order_always_zero_flag : 1;
425  } bits;
426  uint32_t value;
427  } seq_fields;
428 
429  // FMO/ASO
430  uint8_t num_slice_groups_minus1;
431  uint8_t slice_group_map_type;
432  uint16_t slice_group_change_rate_minus1;
433  int8_t pic_init_qp_minus26;
434  int8_t pic_init_qs_minus26;
435  int8_t chroma_qp_index_offset;
436  int8_t second_chroma_qp_index_offset;
437  union {
438  struct {
439  uint32_t entropy_coding_mode_flag : 1;
440  uint32_t weighted_pred_flag : 1;
441  uint32_t weighted_bipred_idc : 2;
442  uint32_t transform_8x8_mode_flag : 1;
443  uint32_t field_pic_flag : 1;
444  uint32_t constrained_intra_pred_flag : 1;
445  uint32_t pic_order_present_flag : 1;
446  uint32_t deblocking_filter_control_present_flag : 1;
447  uint32_t redundant_pic_cnt_present_flag : 1;
448  uint32_t reference_pic_flag : 1; /* nal_ref_idc != 0 */
449  } bits;
450  uint32_t value;
451  } pic_fields;
452  uint16_t frame_num;
453 
454  uint32_t reserved[8];
456 
457 /***********************************************************/
462 /***********************************************************/
463 typedef struct _RocdecAvcSliceParams {
464  uint32_t slice_data_size; // slice size in bytes
465  uint32_t slice_data_offset; // byte offset of the current slice in the slice data buffer
466  uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
478 
479  uint16_t first_mb_in_slice;
480  uint8_t slice_type;
481  uint8_t direct_spatial_mv_pred_flag;
482  uint8_t num_ref_idx_l0_active_minus1;
483  uint8_t num_ref_idx_l1_active_minus1;
484  uint8_t cabac_init_idc;
485  int8_t slice_qp_delta;
486  uint8_t disable_deblocking_filter_idc;
487  int8_t slice_alpha_c0_offset_div2;
488  int8_t slice_beta_offset_div2;
489  RocdecAvcPicture ref_pic_list_0[32]; // 8.2.4.2
490  RocdecAvcPicture ref_pic_list_1[32]; // 8.2.4.2
491  uint8_t luma_log2_weight_denom;
492  uint8_t chroma_log2_weight_denom;
493  uint8_t luma_weight_l0_flag;
494  int16_t luma_weight_l0[32];
495  int16_t luma_offset_l0[32];
496  uint8_t chroma_weight_l0_flag;
497  int16_t chroma_weight_l0[32][2];
498  int16_t chroma_offset_l0[32][2];
499  uint8_t luma_weight_l1_flag;
500  int16_t luma_weight_l1[32];
501  int16_t luma_offset_l1[32];
502  uint8_t chroma_weight_l1_flag;
503  int16_t chroma_weight_l1[32][2];
504  int16_t chroma_offset_l1[32][2];
505 
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];
520 
522  uint32_t reserved[4];
524 
525 /***********************************************************/
530 /***********************************************************/
531 typedef struct _RocdecHevcPicParams {
532  RocdecHevcPicture curr_pic;
533  RocdecHevcPicture ref_frames[15]; /* reference frame list in DPB */
534  uint16_t picture_width_in_luma_samples;
535  uint16_t picture_height_in_luma_samples;
536  union {
537  struct {
539  uint32_t chroma_format_idc : 2;
540  uint32_t separate_colour_plane_flag : 1;
541  uint32_t pcm_enabled_flag : 1;
542  uint32_t scaling_list_enabled_flag : 1;
543  uint32_t transform_skip_enabled_flag : 1;
544  uint32_t amp_enabled_flag : 1;
545  uint32_t strong_intra_smoothing_enabled_flag : 1;
546  uint32_t sign_data_hiding_enabled_flag : 1;
547  uint32_t constrained_intra_pred_flag : 1;
548  uint32_t cu_qp_delta_enabled_flag : 1;
549  uint32_t weighted_pred_flag : 1;
550  uint32_t weighted_bipred_flag : 1;
551  uint32_t transquant_bypass_enabled_flag : 1;
552  uint32_t tiles_enabled_flag : 1;
553  uint32_t entropy_coding_sync_enabled_flag : 1;
554  uint32_t pps_loop_filter_across_slices_enabled_flag : 1;
555  uint32_t loop_filter_across_tiles_enabled_flag : 1;
556  uint32_t pcm_loop_filter_disabled_flag : 1;
560  uint32_t no_bi_pred_flag : 1;
561  uint32_t reserved_bits : 11;
562  } bits;
563  uint32_t value;
564  } pic_fields;
565 
568  uint8_t bit_depth_luma_minus8;
569  uint8_t bit_depth_chroma_minus8;
570  uint8_t pcm_sample_bit_depth_luma_minus1;
571  uint8_t pcm_sample_bit_depth_chroma_minus1;
572  uint8_t log2_min_luma_coding_block_size_minus3;
573  uint8_t log2_diff_max_min_luma_coding_block_size;
574  uint8_t log2_min_transform_block_size_minus2;
575  uint8_t log2_diff_max_min_transform_block_size;
576  uint8_t log2_min_pcm_luma_coding_block_size_minus3;
577  uint8_t log2_diff_max_min_pcm_luma_coding_block_size;
578  uint8_t max_transform_hierarchy_depth_intra;
579  uint8_t max_transform_hierarchy_depth_inter;
580  int8_t init_qp_minus26;
581  uint8_t diff_cu_qp_delta_depth;
582  int8_t pps_cb_qp_offset;
583  int8_t pps_cr_qp_offset;
584  uint8_t log2_parallel_merge_level_minus2;
585  uint8_t num_tile_columns_minus1;
586  uint8_t num_tile_rows_minus1;
591  uint16_t column_width_minus1[19];
592  uint16_t row_height_minus1[21];
593 
594  union {
595  struct {
598  uint32_t long_term_ref_pics_present_flag : 1;
599  uint32_t sps_temporal_mvp_enabled_flag : 1;
600  uint32_t cabac_init_present_flag : 1;
601  uint32_t output_flag_present_flag : 1;
602  uint32_t dependent_slice_segments_enabled_flag : 1;
603  uint32_t pps_slice_chroma_qp_offsets_present_flag : 1;
604  uint32_t sample_adaptive_offset_enabled_flag : 1;
605  uint32_t deblocking_filter_override_enabled_flag : 1;
606  uint32_t pps_disable_deblocking_filter_flag : 1;
607  uint32_t slice_segment_header_extension_present_flag : 1;
608 
610  uint32_t rap_pic_flag : 1;
612  uint32_t idr_pic_flag : 1;
614  uint32_t intra_pic_flag : 1;
615 
616  uint32_t reserved_bits : 18;
617  } bits;
618  uint32_t value;
619  } slice_parsing_fields;
620 
623  uint8_t num_short_term_ref_pic_sets;
624  uint8_t num_long_term_ref_pic_sps;
625  uint8_t num_ref_idx_l0_default_active_minus1;
626  uint8_t num_ref_idx_l1_default_active_minus1;
627  int8_t pps_beta_offset_div2;
628  int8_t pps_tc_offset_div2;
629  uint8_t num_extra_slice_header_bits;
640  uint32_t st_rps_bits;
641 
642  uint32_t reserved[8];
644 
645 /***********************************************************/
650 /***********************************************************/
651 typedef struct _RocdecHevcSliceParams {
655  uint32_t slice_data_size;
659  uint32_t slice_data_flag;
678  uint8_t ref_pic_list[2][15];
679  union {
680  uint32_t value;
681  struct {
683  uint32_t last_slice_of_pic : 1;
686  uint32_t slice_type : 2;
687  uint32_t color_plane_id : 2;
688  uint32_t slice_sao_luma_flag : 1;
689  uint32_t slice_sao_chroma_flag : 1;
690  uint32_t mvd_l1_zero_flag : 1;
691  uint32_t cabac_init_flag : 1;
692  uint32_t slice_temporal_mvp_enabled_flag : 1;
693  uint32_t slice_deblocking_filter_disabled_flag : 1;
694  uint32_t collocated_from_l0_flag : 1;
695  uint32_t slice_loop_filter_across_slices_enabled_flag : 1;
696  uint32_t reserved : 18;
697  } fields;
698  } long_slice_flags;
699 
702  uint8_t num_ref_idx_l0_active_minus1;
703  uint8_t num_ref_idx_l1_active_minus1;
704  int8_t slice_qp_delta;
705  int8_t slice_cb_qp_offset;
706  int8_t slice_cr_qp_offset;
707  int8_t slice_beta_offset_div2;
708  int8_t slice_tc_offset_div2;
709  uint8_t luma_log2_weight_denom;
710  int8_t delta_chroma_log2_weight_denom;
711  int8_t delta_luma_weight_l0[15];
712  int8_t luma_offset_l0[15];
713  int8_t delta_chroma_weight_l0[15][2];
715  int8_t chroma_offset_l0[15][2];
718  int8_t luma_offset_l1[15];
719  int8_t delta_chroma_weight_l1[15][2];
721  int8_t chroma_offset_l1[15][2];
724  uint16_t num_entry_point_offsets;
725  uint16_t entry_offset_to_subset_array;
728 
729  uint32_t reserved[2];
731 
732 /***********************************************************/
741 /***********************************************************/
742 typedef struct _RocdecHevcIQMatrix {
748  uint8_t scaling_list_4x4[6][16];
754  uint8_t scaling_list_8x8[6][64];
760  uint8_t scaling_list_16x16[6][64];
766  uint8_t scaling_list_32x32[2][64];
781 
782  uint32_t reserved[4];
784 
785 /******************************************************************************************/
791 /******************************************************************************************/
792 typedef struct _RocdecPicParams {
793  int pic_width;
799  // Bitstream data
801  const uint8_t *bitstream_data;
802  uint32_t num_slices;
806  uint32_t reserved[30];
808  // IN: Codec-specific data
809  union {
811  RocdecAvcPicParams avc;
812  RocdecHevcPicParams hevc;
813  RocdecVc1PicParams vc1;
814  RocdecJPEGPicParams jpeg;
815  uint32_t codec_reserved[256];
816  } pic_params;
817 
820  union {
821  // Todo: Add slice params defines for other codecs.
823  RocdecHevcSliceParams *hevc;
825 
826  union {
827  // Todo: Added IQ matrix defines for other codecs.
828  RocdecAvcIQMatrix avc;
829  RocdecHevcIQMatrix hevc;
830  } iq_matrix;
832 
833 /******************************************************/
838 /******************************************************/
839 typedef struct _RocdecProcParams
840 {
843  uint32_t reserved_flags[2];
845  // The fields below are used for raw YUV input
846  uint64_t raw_input_dptr;
847  uint32_t raw_input_pitch;
848  uint32_t raw_input_format;
849  uint64_t raw_output_dptr;
850  uint32_t raw_output_pitch;
851  uint32_t raw_output_format;
852  uint32_t reserved[16];
854 
855 /*****************************************************************************************************/
859 /*****************************************************************************************************/
860 extern rocDecStatus ROCDECAPI rocDecCreateDecoder(rocDecDecoderHandle *decoder_handle, RocDecoderCreateInfo *decoder_create_info);
861 
862 /*****************************************************************************************************/
866 /*****************************************************************************************************/
867 extern rocDecStatus ROCDECAPI rocDecDestroyDecoder(rocDecDecoderHandle decoder_handle);
868 
869 /**********************************************************************************************************************/
876 /**********************************************************************************************************************/
877 extern rocDecStatus ROCDECAPI rocDecGetDecoderCaps(RocdecDecodeCaps *decode_caps);
878 
879 /*****************************************************************************************************/
884 /*****************************************************************************************************/
885 extern rocDecStatus ROCDECAPI rocDecDecodeFrame(rocDecDecoderHandle decoder_handle, RocdecPicParams *pic_params);
886 
887 /************************************************************************************************************/
893 /************************************************************************************************************/
894 extern rocDecStatus ROCDECAPI rocDecGetDecodeStatus(rocDecDecoderHandle decoder_handle, int pic_idx, RocdecDecodeStatus* decode_status);
895 
896 /*********************************************************************************************************/
901 /*********************************************************************************************************/
902 extern rocDecStatus ROCDECAPI rocDecReconfigureDecoder(rocDecDecoderHandle decoder_handle, RocdecReconfigureDecoderInfo *reconfig_params);
903 
904 /************************************************************************************************************************/
911 /************************************************************************************************************************/
912 extern rocDecStatus ROCDECAPI rocDecGetVideoFrame(rocDecDecoderHandle decoder_handle, int pic_idx,
913  void *dev_mem_ptr[3], uint32_t (&horizontal_pitch)[3],
914  RocdecProcParams *vid_postproc_params);
915 
916 /*****************************************************************************************************/
920 /*****************************************************************************************************/
921 extern const char* ROCDECAPI rocDecGetErrorName(rocDecStatus rocdec_status);
922 
923 #ifdef __cplusplus
924 }
925 #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:281
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
rocDecVideoSurfaceFormat_enum
Definition: rocdecode.h:103
@ rocDecVideoSurfaceFormat_YUV444_16Bit
Definition: rocdecode.h:108
@ rocDecVideoSurfaceFormat_P016
Definition: rocdecode.h:105
@ rocDecVideoSurfaceFormat_NV12
Definition: rocdecode.h:104
@ rocDecVideoSurfaceFormat_YUV444
Definition: rocdecode.h:107
void * rocDecDecoderHandle
Definition: rocdecode.h:52
rocDecVideoChromaFormat_enum
Definition: rocdecode.h:118
@ rocDecVideoChromaFormat_422
Definition: rocdecode.h:121
@ rocDecVideoChromaFormat_444
Definition: rocdecode.h:122
@ rocDecVideoChromaFormat_420
Definition: rocdecode.h:120
@ rocDecVideoChromaFormat_Monochrome
Definition: rocdecode.h:119
Definition: rocdecode.h:168
uint32_t height
Definition: rocdecode.h:172
uint32_t width
Definition: rocdecode.h:171
uint32_t target_width
Definition: rocdecode.h:191
uint32_t max_height
Definition: rocdecode.h:183
uint32_t bit_depth_minus_8
Definition: rocdecode.h:176
uint32_t num_output_surfaces
Definition: rocdecode.h:193
uint8_t device_id
Definition: rocdecode.h:169
struct _RocDecoderCreateInfo::@1 target_rect
rocDecVideoChromaFormat chroma_format
Definition: rocdecode.h:175
uint32_t num_decode_surfaces
Definition: rocdecode.h:173
rocDecVideoCodec codec_type
Definition: rocdecode.h:174
uint32_t max_width
Definition: rocdecode.h:182
rocDecVideoSurfaceFormat output_format
Definition: rocdecode.h:190
uint32_t target_height
Definition: rocdecode.h:192
struct _RocDecoderCreateInfo::@0 display_rect
uint32_t intra_decode_only
Definition: rocdecode.h:177
uint32_t reserved_2[4]
Definition: rocdecode.h:201
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:522
uint8_t scaling_list_4x4[6][16]
4x4 scaling list, in raster scan order.
Definition: rocdecode.h:517
Definition: rocdecode.h:404
Definition: rocdecode.h:251
int32_t top_field_order_cnt
Definition: rocdecode.h:255
int pic_idx
Definition: rocdecode.h:252
uint32_t flags
Definition: rocdecode.h:254
int32_t bottom_field_order_cnt
Definition: rocdecode.h:256
uint32_t frame_idx
Definition: rocdecode.h:253
Definition: rocdecode.h:463
uint16_t slice_data_bit_offset
Bit offset from NAL Header Unit to the begining of slice_data().
Definition: rocdecode.h:477
Definition: rocdecode.h:147
uint16_t min_width
Definition: rocdecode.h:158
uint32_t reserved_1[3]
Definition: rocdecode.h:152
uint32_t reserved_2[6]
Definition: rocdecode.h:160
uint8_t num_decoders
Definition: rocdecode.h:154
rocDecVideoCodec codec_type
Definition: rocdecode.h:149
uint8_t device_id
Definition: rocdecode.h:148
uint16_t min_height
Definition: rocdecode.h:159
uint32_t max_width
Definition: rocdecode.h:156
rocDecVideoChromaFormat chroma_format
Definition: rocdecode.h:150
uint16_t output_format_mask
Definition: rocdecode.h:155
uint8_t is_supported
Definition: rocdecode.h:153
uint32_t max_height
Definition: rocdecode.h:157
uint32_t bit_depth_minus_8
Definition: rocdecode.h:151
Definition: rocdecode.h:210
Definition: rocdecode.h:742
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:754
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:748
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:780
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:760
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:773
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:766
Definition: rocdecode.h:531
uint16_t column_width_minus1[19]
Definition: rocdecode.h:591
uint32_t idr_pic_flag
Definition: rocdecode.h:612
uint32_t chroma_format_idc
Definition: rocdecode.h:539
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:640
uint32_t no_bi_pred_flag
Definition: rocdecode.h:560
uint32_t intra_pic_flag
Definition: rocdecode.h:614
uint8_t sps_max_dec_pic_buffering_minus1
Definition: rocdecode.h:567
uint32_t no_pic_reordering_flag
Definition: rocdecode.h:558
uint32_t lists_modification_present_flag
Definition: rocdecode.h:597
uint32_t rap_pic_flag
Definition: rocdecode.h:610
uint8_t log2_max_pic_order_cnt_lsb_minus4
Definition: rocdecode.h:622
Definition: rocdecode.h:274
uint32_t flags
Definition: rocdecode.h:282
int pic_idx
Definition: rocdecode.h:275
uint32_t reserved[4]
Definition: rocdecode.h:283
Definition: rocdecode.h:651
uint32_t slice_segment_address
Definition: rocdecode.h:672
uint32_t slice_data_flag
Slice data buffer flags. See VA_SLICE_DATA_FLAG_XXX.
Definition: rocdecode.h:659
uint8_t five_minus_max_num_merge_cand
Definition: rocdecode.h:723
uint32_t slice_data_offset
The offset to the NAL unit header for this slice.
Definition: rocdecode.h:657
uint32_t last_slice_of_pic
Definition: rocdecode.h:683
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:655
int8_t delta_luma_weight_l1[15]
Definition: rocdecode.h:717
int8_t chroma_offset_l1[15][2]
Definition: rocdecode.h:721
int8_t chroma_offset_l0[15][2]
Definition: rocdecode.h:715
uint16_t slice_data_num_emu_prevn_bytes
Number of emulation prevention bytes in slice header.
Definition: rocdecode.h:727
uint8_t collocated_ref_idx
Definition: rocdecode.h:701
uint8_t ref_pic_list[2][15]
index into ReferenceFrames[] ref_pic_list[0][] corresponds to RefPicList0[] of HEVC variable....
Definition: rocdecode.h:678
uint32_t dependent_slice_segment_flag
Definition: rocdecode.h:685
uint32_t slice_data_byte_offset
Byte offset from NAL unit header to the begining of slice_data().
Definition: rocdecode.h:670
Definition: rocdecode.h:331
Definition: rocdecode.h:358
Definition: rocdecode.h:341
Definition: rocdecode.h:792
uint32_t reserved[30]
Definition: rocdecode.h:806
RocdecMpeg2PicParams mpeg2
Definition: rocdecode.h:810
int bottom_field_flag
Definition: rocdecode.h:797
union _RocdecPicParams::@17 slice_params
Variable size array. The user should allocate one slice param struct for each slice.
int intra_pic_flag
Definition: rocdecode.h:805
int pic_height
Definition: rocdecode.h:794
int ref_pic_flag
Definition: rocdecode.h:804
const uint8_t * bitstream_data
Definition: rocdecode.h:801
uint32_t num_slices
Definition: rocdecode.h:802
int curr_pic_idx
Definition: rocdecode.h:795
int field_pic_flag
Definition: rocdecode.h:796
uint32_t bitstream_data_len
Definition: rocdecode.h:800
int second_field
Definition: rocdecode.h:798
int pic_width
Definition: rocdecode.h:793
Definition: rocdecode.h:840
uint32_t raw_input_format
Definition: rocdecode.h:848
uint64_t raw_output_dptr
Definition: rocdecode.h:849
uint32_t raw_output_pitch
Definition: rocdecode.h:850
int progressive_frame
Definition: rocdecode.h:841
uint64_t raw_input_dptr
Definition: rocdecode.h:846
uint32_t reserved_flags[2]
Definition: rocdecode.h:843
uint32_t raw_input_pitch
Definition: rocdecode.h:847
uint32_t raw_output_format
Definition: rocdecode.h:851
uint32_t reserved[16]
Definition: rocdecode.h:852
int top_field_first
Definition: rocdecode.h:842
Definition: rocdecode.h:222
uint32_t target_width
Definition: rocdecode.h:225
struct _RocdecReconfigureDecoderInfo::@3 target_rect
uint32_t num_decode_surfaces
Definition: rocdecode.h:227
uint32_t height
Definition: rocdecode.h:224
uint32_t width
Definition: rocdecode.h:223
struct _RocdecReconfigureDecoderInfo::@2 display_rect
uint32_t reserved_1[12]
Definition: rocdecode.h:228
uint32_t reserved_2[11]
Definition: rocdecode.h:242
uint32_t target_height
Definition: rocdecode.h:226
Definition: rocdecode.h:393