35 #if !defined(__CUDA_VIDEO_H__)
36 #define __CUDA_VIDEO_H__
38 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
39 #if (CUDA_VERSION >= 3020) && (!defined(CUDA_FORCE_API_VERSION) || (CUDA_FORCE_API_VERSION >= 3020))
40 #define __CUVID_DEVPTR64
44 #if defined(__cplusplus)
48 #if defined(__CYGWIN__)
66 typedef enum cudaVideoCodec_enum {
91 typedef enum cudaVideoSurfaceFormat_enum {
100 typedef enum cudaVideoDeinterlaceMode_enum {
110 typedef enum cudaVideoChromaFormat_enum {
121 typedef enum cudaVideoCreateFlags_enum {
132 typedef struct _CUVIDDECODECREATEINFO
141 tcu_ulong Reserved1[4];
168 tcu_ulong Reserved2[5];
175 typedef struct _CUVIDH264DPBENTRY
182 int FieldOrderCnt[2];
189 typedef struct _CUVIDH264MVCEXT
197 int InterViewRefsL0[16];
198 int InterViewRefsL1[16];
205 typedef struct _CUVIDH264SVCEXT
246 typedef struct _CUVIDH264PICPARAMS
277 int CurrFieldOrderCnt[2];
281 unsigned char WeightScale4x4[6][16];
282 unsigned char WeightScale8x8[2][64];
294 unsigned int Reserved[12];
308 typedef struct _CUVIDMPEG2PICPARAMS
324 unsigned char QuantMatrixIntra[64];
325 unsigned char QuantMatrixInter[64];
343 typedef struct _CUVIDMPEG4PICPARAMS
368 unsigned char QuantMatrixIntra[64];
369 unsigned char QuantMatrixInter[64];
377 typedef struct _CUVIDVC1PICPARAMS
421 typedef struct _CUVIDJPEGPICPARAMS
431 typedef struct _CUVIDHEVCPICPARAMS
465 unsigned char reserved1[14];
504 unsigned short column_width_minus1[21];
505 unsigned short row_height_minus1[21];
506 unsigned int reserved3[15];
517 int PicOrderCntVal[16];
518 unsigned char IsLongTerm[16];
519 unsigned char RefPicSetStCurrBefore[8];
520 unsigned char RefPicSetStCurrAfter[8];
521 unsigned char RefPicSetLtCurr[8];
522 unsigned char RefPicSetInterLayer0[8];
523 unsigned char RefPicSetInterLayer1[8];
524 unsigned int reserved4[12];
527 unsigned char ScalingList4x4[6][16];
528 unsigned char ScalingList8x8[6][64];
529 unsigned char ScalingList16x16[6][64];
530 unsigned char ScalingList32x32[2][64];
531 unsigned char ScalingListDCCoeff16x16[6];
532 unsigned char ScalingListDCCoeff32x32[2];
540 typedef struct _CUVIDVP8PICPARAMS
551 unsigned char frame_type : 1;
554 unsigned char update_mb_segmentation_data : 1;
555 unsigned char Reserved2Bits : 2;
559 unsigned char Reserved1[4];
560 unsigned int Reserved2[3];
567 typedef struct _CUVIDVP9PICPARAMS
579 unsigned short frameContextIdx : 2;
580 unsigned short frameType : 1;
581 unsigned short showFrame : 1;
582 unsigned short errorResilient : 1;
583 unsigned short frameParallelDecoding : 1;
584 unsigned short subSamplingX : 1;
585 unsigned short subSamplingY : 1;
586 unsigned short intraOnly : 1;
587 unsigned short allow_high_precision_mv : 1;
588 unsigned short refreshEntropyProbs : 1;
589 unsigned short reserved2Bits : 2;
593 unsigned char refFrameSignBias[4];
604 unsigned char segmentEnabled : 1;
605 unsigned char segmentMapUpdate : 1;
606 unsigned char segmentMapTemporalUpdate : 1;
607 unsigned char segmentFeatureMode : 1;
608 unsigned char reserved4Bits : 4;
611 unsigned char segmentFeatureEnable[8][4];
612 short segmentFeatureData[8][4];
613 unsigned char mb_segment_tree_probs[7];
614 unsigned char segment_pred_probs[3];
615 unsigned char reservedSegment16Bits[2];
622 unsigned int activeRefIdx[3];
625 unsigned int mbRefLfDelta[4];
626 unsigned int mbModeLfDelta[2];
629 unsigned int reserved128Bits[4];
638 typedef struct _CUVIDPICPARAMS
653 unsigned int Reserved[30];
664 unsigned int CodecReserved[1024];
673 typedef struct _CUVIDPROCPARAMS
687 unsigned int Reserved[48];
736 #if !defined(__CUVID_DEVPTR64) || defined(__CUVID_INTERNAL)
742 unsigned int *pDevPtr,
unsigned int *pPitch,
752 #if defined(WIN64) || defined(_WIN64) || defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
757 typedef CUresult CUDAAPI tcuvidMapVideoFrame64(CUvideodecoder hDecoder,
int nPicIdx,
unsigned long long *pDevPtr,
764 typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder,
unsigned long long DevPtr);
766 #if defined(__CUVID_DEVPTR64) && !defined(__CUVID_INTERNAL)
767 #define tcuvidMapVideoFrame tcuvidMapVideoFrame64
768 #define tcuvidUnmapVideoFrame tcuvidUnmapVideoFrame64
811 #if defined(__cplusplus)
815 #endif // __CUDA_VIDEO_H__
short scaled_ref_layer_bottom_offset
unsigned char loop_filter_across_tiles_enabled_flag
int ref_pic_flag
Set to 1 for I,P frames.
int PicWidthInMbs
Coded Frame Size.
unsigned char bitDepthMinus8Luma
unsigned char deblocking_filter_override_enabled_flag
short scaled_ref_layer_right_offset
int num_ref_idx_l0_active_minus1
int unpaired_field
Input only contains one field (2nd field is invalid)
signed char pps_tc_offset_div2
unsigned int raw_input_format
Reserved for future use (set to zero)
int num_ref_idx_l1_active_minus1
tcu_ulong ulNumOutputSurfaces
Maximum number of output surfaces simultaneously mapped.
unsigned char num_tile_columns_minus1
short scaled_ref_layer_top_offset
unsigned char log2_max_pic_order_cnt_lsb_minus4
unsigned char uniform_spacing_flag
unsigned char num_ref_idx_l0_default_active_minus1
unsigned char bit_depth_chroma_minus8
unsigned char diff_cu_qp_delta_depth
unsigned char num_long_term_ref_pics_sps
int is_long_term
0=short term reference, 1=long term reference
unsigned short Reserved16Bits
unsigned char pcm_enabled_flag
struct _CUVIDPICPARAMS * pNextLayer
Points to the picparams for the next layer to be decoded.
unsigned char IrapPicFlag
struct _CUcontextlock_st * CUvideoctxlock
unsigned char inter_view_flag
int log2_max_pic_order_cnt_lsb_minus4
int FrameIdx
frame_num(short-term) or LongTermFrameIdx(long-term)
unsigned char dependent_slice_segments_enabled_flag
int field_pic_flag
0=frame picture, 1=field picture
static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx)
unsigned char chroma_phase_y_plus1
unsigned char residual_colour_transform_flag
unsigned char GoldenRefIdx
CUresult CUDAAPI tcuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags)
Use dedicated video engines directly.
const unsigned char * pMb2SliceGroupMap
unsigned char loop_filter_across_slices_enabled_flag
unsigned char wFrameTagFlags
unsigned char pcm_sample_bit_depth_luma_minus1
int second_chroma_qp_index_offset
cudaVideoDeinterlaceMode DeinterlaceMode
cudaVideoDeinterlaceMode_XXX
unsigned char bit_depth_luma_minus8
signed char pps_cr_qp_offset
unsigned char log2_min_luma_coding_block_size_minus3
unsigned char tcoeff_level_prediction_flag
cudaVideoCodec CodecType
cudaVideoCodec_XXX
unsigned char bit_depth_chroma_minus8
int NumBitsForShortTermRPSInSlice
unsigned char modeRefLfEnabled
cudaVideoSurfaceFormat OutputFormat
cudaVideoSurfaceFormat_XXX
unsigned char constrained_intra_pred_flag
int ForwardRefIdx
Picture index of forward reference (P/B-frames)
int BackwardRefIdx
Picture index of backward reference (B-frames)
int video_object_layer_width
int delta_pic_order_always_zero_flag
tcu_ulong ulTargetWidth
Post-processed Output Width (Should be aligned to 2)
int PicIdx
picture index of reference frame
int intra_pic_flag
Set to 1 for I,BI frames.
unsigned char store_ref_base_pic_flag
signed char pic_init_qs_minus26
int full_pel_forward_vector
unsigned char num_inter_view_refs_l1
unsigned char pcm_loop_filter_disabled_flag
unsigned int first_partition_size
int constrained_intra_pred_flag
CUvideoctxlock vidLock
If non-NULL, context lock used for synchronizing ownership of the cuda context.
unsigned char log2_tile_columns
unsigned char num_ref_idx_l1_default_active_minus1
unsigned char slice_group_map_type
unsigned char fmo_aso_enable
unsigned long long slice_group_map_addr
unsigned int frameTagSize
int bRefBaseLayer
whether to store ref base pic
unsigned int raw_output_pitch
Reserved for future use (set to zero)
unsigned char log2_parallel_merge_level_minus2
Weave both fields (no deinterlacing)
int not_existing
non-existing reference frame (corresponding PicIdx should be set to -1)
int deblocking_filter_control_present_flag
unsigned char MVCReserved8Bits
int CurrPicIdx
Output index of the current picture.
unsigned char sample_adaptive_offset_enabled_flag
CUresult CUDAAPI tcuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx, unsigned int *pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS *pVPP)
unsigned char weighted_pred_flag
unsigned char pcm_sample_bit_depth_chroma_minus1
Use a CUDA-based decoder if faster than dedicated engines (requires a valid vidLock object for multi-...
unsigned char long_term_ref_pics_present_flag
unsigned char extended_spatial_scalability_idc
unsigned char profile_idc
unsigned char transform_skip_enabled_flag
unsigned int nNumSlices
Number of slices in this picture.
int FrameHeightInMbs
Coded Frame Height.
unsigned short reserved16Bits
unsigned char separate_colour_plane_flag
int log2_max_frame_num_minus4
CUresult CUDAAPI tcuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx)
int resync_marker_disable
unsigned char entropy_coding_sync_enabled_flag
unsigned char loopFilterLevel
int intra_pic_flag
This picture is entirely intra coded.
unsigned char bitDepthMinus8Chroma
int progressive_frame
Input is progressive (deinterlace_mode will be ignored)
unsigned char scaling_list_enable_flag
int FrameHeight
Actual frame height.
tcu_ulong ulCreationFlags
Decoder creation flags (cudaVideoCreateFlags_XXX)
int pic_order_present_flag
int second_field
Output the second field (ignored if deinterlace mode is Weave)
unsigned int mcomp_filter_type
unsigned char log2_diff_max_min_pcm_luma_coding_block_size
Default operation mode: use dedicated video engines.
unsigned char num_tile_rows_minus1
unsigned int reserved_zero
Reserved (set to zero)
int ref_pic_flag
This picture is a reference picture.
signed char pps_beta_offset_div2
int top_field_first
Input frame is top field first (1st field is top, 2nd field is bottom)
int progressive_fcm
Progressive frame.
const unsigned int * pSliceDataOffsets
nNumSlices entries, contains offset of each slice within the bitstream data buffer ...
unsigned short DPBEntryValidFlag
int bottom_field_flag
0=top field, 1=bottom field (ignored if field_pic_flag=0)
unsigned char slice_header_restriction_flag
unsigned long long raw_output_dptr
Reserved for future use (set to zero)
unsigned char num_extra_slice_header_bits
int vop_time_increment_bitcount
unsigned char tiles_enabled_flag
short scaled_ref_layer_left_offset
unsigned char log2_min_pcm_luma_coding_block_size_minus3
unsigned char qpprime_y_zero_transform_bypass_flag
tcu_ulong ulNumDecodeSurfaces
Maximum number of internal decode surfaces.
unsigned char inter_layer_deblocking_filter_control_present_flag
CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr)
signed char inter_layer_slice_alpha_c0_offset_div2
int pic_height_in_luma_samples
CUresult CUDAAPI tcuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags)
unsigned int resetFrameContext
CUresult CUDAAPI tcuvidCtxLockDestroy(CUvideoctxlock lck)
unsigned char slice_segment_header_extension_present_flag
int NumDeltaPocsOfRefRpsIdx
unsigned char pps_deblocking_filter_disabled_flag
unsigned char Reserved8BitsA
unsigned char amp_enabled_flag
unsigned char sps_temporal_mvp_enabled_flag
const unsigned char * pBitstreamData
Ptr to bitstream data for this picture (slice-layer)
unsigned int slice_group_change_rate_minus1
unsigned char log2_tile_rows
unsigned char loopFilterSharpness
unsigned char lists_modification_present_flag
unsigned char log2_diff_max_min_transform_block_size
unsigned char Reserved8BitsB
int video_object_layer_height
unsigned char num_inter_view_refs_l0
unsigned char max_transform_hierarchy_depth_inter
int entropy_coding_mode_flag
unsigned char pps_slice_chroma_qp_offsets_present_flag
int transform_8x8_mode_flag
tcu_ulong ulWidth
Coded Sequence Width.
unsigned char num_slice_groups_minus1
unsigned char output_flag_present_flag
signed char pps_cb_qp_offset
CUresult CUDAAPI tcuvidDestroyDecoder(CUvideodecoder hDecoder)
int concealment_motion_vectors
CUVIDMPEG2PICPARAMS mpeg2
Also used for MPEG-1.
int redundant_pic_cnt_present_flag
int used_for_reference
0=unused, 1=top_field, 2=bottom_field, 3=both_fields
int direct_8x8_inference_flag
unsigned char bit_depth_luma_minus8
signed char init_qp_minus26
unsigned char weighted_bipred_flag
unsigned int offsetToDctParts
unsigned char adaptive_tcoeff_level_prediction_flag
unsigned char chroma_phase_x_plus1_flag
CUresult CUDAAPI tcuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams)
Go through DXVA internally if possible (requires D3D9 interop)
unsigned char transquant_bypass_enabled_flag
int pic_width_in_luma_samples
CUVIDMPEG4PICPARAMS mpeg4
unsigned int reserved_flags
Reserved for future use (set to zero)
unsigned char log2_diff_max_min_luma_coding_block_size
tcu_ulong ulHeight
Coded Sequence Height.
unsigned char cabac_init_present_flag
unsigned char cu_qp_delta_enabled_flag
unsigned char max_transform_hierarchy_depth_intra
cudaVideoChromaFormat ChromaFormat
cudaVideoChromaFormat_XXX (only 4:2:0 is currently supported)
tcu_ulong ulTargetHeight
Post-processed Output Height (Should be aligbed to 2)
unsigned char GoldenRefIdx
unsigned char disable_inter_layer_deblocking_filter_idc
int second_field
Second field of a complementary field pair.
unsigned char sign_data_hiding_enabled_flag
unsigned char strong_intra_smoothing_enabled_flag
unsigned long long raw_input_dptr
Input CUdeviceptr for raw YUV extensions.
CUresult CUDAAPI tcuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci)
int chroma_qp_index_offset
int alternate_vertical_scan_flag
unsigned char ref_layer_chroma_phase_y_plus1
int FrameWidth
Actual frame width.
unsigned int nBitstreamDataLen
Number of bytes in bitstream data buffer.
int full_pel_backward_vector
unsigned char log2_min_transform_block_size_minus2
unsigned char ref_layer_chroma_phase_x_plus1_flag
unsigned char constrained_intra_resampling_flag
unsigned char num_short_term_ref_pic_sets
signed char inter_layer_slice_beta_offset_div2
unsigned int raw_input_pitch
pitch in bytes of raw YUV input (should be aligned appropriately)