NVIDIA DRIVE OS Linux SDK API Reference

5.2.0 Release
For Test and Development only
nvmedia_viddec.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  */
7 
15 #ifndef NVMEDIA_VIDDEC_H
16 #define NVMEDIA_VIDDEC_H
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include "nvmedia_common_decode.h"
23 #include "nvmedia_core.h"
24 #include "nvmedia_video.h"
25 
43 #define NVMEDIA_VIDEODEC_VERSION_MAJOR 1
44 
45 #define NVMEDIA_VIDEODEC_VERSION_MINOR 12
46 
50 typedef struct{
52  uint32_t hwClockValue;
54  uint16_t decode_error;
56  uint32_t decoded_mbs;
58  uint32_t concealed_mbs; // number of macroblocks concealed
60  uint32_t decoding_status;
62  uint32_t hwDecodeTime;
64 
68 typedef enum {
78 
82 typedef enum {
94 
98 typedef enum {
110 
114 typedef struct {
116  uint16_t mbNum;
120  int16_t mv_for_x;
122  int16_t mv_for_y;
124  int16_t mv_bac_x;
126  int16_t mv_bac_y;
128  uint8_t qp;
134 
138 typedef struct{
142  uint32_t mbCount;
148 
158 typedef struct{
160  uint32_t uRingEntryIdx;
162  uint32_t uErrorRefPOC;
166 
170 typedef struct {
174  uint16_t width;
176  uint16_t height;
178  uint16_t maxReferences;
182  struct NvMediaVideoDecoderPriv_ *decoderPriv;
184 
185 
198 #define NVMEDIA_VIDEO_DECODER_10BIT_DECODE (1U<<0)
199 
205 #define NVMEDIA_VIDEO_DECODER_PIXEL_REC_2020 (1U<<1)
206 
212 #define NVMEDIA_VIDEO_DECODER_OUTPUT_16BIT_SURFACES (1U<<2)
213 
219 #define NVMEDIA_VIDEO_DECODER_ENABLE_AES (1U<<3)
220 
226 #define NVMEDIA_VIDEO_DECODER_NV24_OUTPUT (1U<<4)
227 
233 #define NVMEDIA_VIDEO_DECODER_PROFILING (1U<<5)
234 
240 #define NVMEDIA_VIDEO_DECODER_DUMP_MV (1U<<6)
241 
255  NvMediaVersion *version
256 );
257 
305  const NvMediaDevice *device,
306  NvMediaVideoCodec codec,
307  uint16_t width,
308  uint16_t height,
309  uint16_t maxReferences,
310  uint64_t maxBitstreamSize,
311  uint8_t inputBuffering,
312  uint32_t flags,
313  NvMediaDecoderInstanceId instanceId
314 );
315 
319 void
321  const NvMediaVideoDecoder *decoder
322 );
323 
324 
334 void
336  const NvMediaVideoDecoder *decoder
337 );
338 
371  const NvMediaVideoDecoder *decoder,
372  const NvMediaVideoSurface *target,
373  const NvMediaPictureInfo *pictureInfo,
374  const void *encryptParams,
375  uint32_t numBitstreamBuffers,
376  const NvMediaBitstreamBuffer *bitstreams,
377  NvMediaVideoDecodeStats *FrameStatsDump,
378  NvMediaDecoderInstanceId instanceId
379 );
380 
408  const NvMediaVideoDecoder *decoder,
409  const NvMediaVideoSurface *target,
410  const NvMediaSliceDecodeData *sliceDecData
411 );
412 
413 
464  const NvMediaVideoDecoder *decoder,
465  uint32_t ringEntryIdx,
466  NvMediaVideoDecodeFrameStatus *FrameStatus
467 );
468 
479  const NvMediaVideoDecoder *decoder,
480  void *backupdates
481 );
482 
483 /*
484  * \defgroup history_nvmedia_viddec History
485  * Provides change history for the NvMedia Video Decode API.
486  *
487  * \section history_nvmedia_viddec Version History
488  *
489  * <b> Version 1.0 </b> March 21, 2017
490  * - Initial release
491  *
492  * <b> Version 1.1 </b> April 07, 2017
493  * - Added hwClockValue in \ref NvMediaVideoDecodeFrameStatus
494  * - Rename NvMediaVideoBackwardUpdates to \ref NvMediaVideoDecoderGetBackwardUpdates
495  *
496  * <b> Version 1.2 </b> April 18, 2017
497  * - Deprecated NvMediaVideoDecoderCreate() and NvMediaVideoDecoderRender()
498  * - Added \ref NvMediaVideoDecoderGetVersion()
499  * - Added device and instance ID parameters to \ref NvMediaVideoDecoderCreateEx()
500  * - Added instanceId parameter to \ref NvMediaVideoDecoderRenderEx()
501  * - Added instanceId to \ref NvMediaVideoDecoder object
502  * - Changed to use standard data types
503  *
504  * <b> Version 1.3 </b> May 17, 2017
505  * - Added deprecated warning message for \ref NvMediaVideoDecoderSetAttributes
506  *
507  * <b> Version 1.4 </b> June 05, 2017
508  * - Removed \ref -NvMediaVideoDecoderCopySliceData interface
509  * - Added \ref NvMediaVideoDecoderSliceDecode interface
510  * - Added \ref NvMediaSliceDecodeData structure required for
511  * \ref NvMediaVideoDecoderSliceDecode argument.
512  *
513  * <b> Version 1.5 </b> June 15, 2017
514  * - Deprecated \ref NvMediaVideoDecoderSetAttributes()
515  *
516  * <b> Version 1.6 </b> July 04, 2017
517  * - Added \ref NvMedia_MB_Type_enum enumerator
518  * - Added \ref NvMedia_MB_Part_enum enumerator
519  * - Added qp, mb_type and mb_part to \ref NvMediaMotionVectorMB_Metadata structure
520  *
521  * <b> Version 1.7 </b> Dec 14, 2018
522  * - Defined Macro constants as unsigned to fix MISRA issues
523  * - Fix MISRA violations 21.1 and 21.2
524  *
525  * <b> Version 1.8 </b> January 15, 2019
526  * - Fix MISRA violations 8.13
527  *
528  * <b> Version 1.9 </b> Feb 11, 2019
529  * - Added opaque handle for decoder
530  * internal usage into video decoder object
531  * - Fix MISRA violations 11.3
532  * - Fix MISRA violations 8.13
533  *
534  * <b> Version 1.10 </b> Feb 28, 2019
535  * - Added required header include nvmedia_core.h
536  *
537  * <b> Version 1.11 </b> July 10, 2019
538  * - Header include nvmedia_common.h is replaced with nvmedia_common_decode.h
539  *
540  * <b> Version 1.12 </b> August 20, 2019
541  * - Added New API \ref NvMediaVideoDecoderUnRegisterPinnedSurfaces for
542  * Unpinning of Pinned Surfaces.
543  */
544 
547 #ifdef __cplusplus
548 }; /* extern "C" */
549 #endif
550 
551 #endif /* NVMEDIA_VIDDEC_H */
NvMediaVideoDecoder::maxReferences
uint16_t maxReferences
Maximum number of reference pictures.
Definition: nvmedia_viddec.h:178
NvMediaVideoDecoderSliceDecode
NvMediaStatus NvMediaVideoDecoderSliceDecode(const NvMediaVideoDecoder *decoder, const NvMediaVideoSurface *target, const NvMediaSliceDecodeData *sliceDecData)
This function is intended for use in low-latency decode mode.
NvMediaVideoDecodeFrameStatus::decoding_status
uint32_t decoding_status
32 bits fields, each bit indicate the decoding progress
Definition: nvmedia_viddec.h:60
nvmedia_video.h
NVIDIA Media Interface: Video Surface Processing
NVMEDIA_UNKNOWN_TYPE
@ NVMEDIA_UNKNOWN_TYPE
invalid option
Definition: nvmedia_viddec.h:92
NvMediaMotionVectorFrameMetaData::bMVDumpPresent
NvMediaBool bMVDumpPresent
flag to indicate whether motion vector dump is present or not.
Definition: nvmedia_viddec.h:144
NvMediaMotionVectorMB_Metadata::mb_type
NvMedia_MB_Type_enum mb_type
mb type
Definition: nvmedia_viddec.h:130
NvMediaMotionVectorMB_Metadata::mbNum
uint16_t mbNum
macroblock number
Definition: nvmedia_viddec.h:116
NvMediaVideoDecodeStats
Frame stats structure to get get ring entry idx and motion vector dump.
Definition: nvmedia_viddec.h:158
NVMEDIA_MBTYPE_I
@ NVMEDIA_MBTYPE_I
macroblock type I
Definition: nvmedia_viddec.h:76
NvMediaSliceDecodeData
slice level data used with slice level decoding
Definition: nvmedia_common_decode.h:386
NVMEDIA_B
@ NVMEDIA_B
MB type B.
Definition: nvmedia_viddec.h:88
NvMedia_MB_Part_enum
NvMedia_MB_Part_enum
MB part.
Definition: nvmedia_viddec.h:98
NVMEDIA_P
@ NVMEDIA_P
MB type P.
Definition: nvmedia_viddec.h:86
NvMediaMotionVectorFrameMetaData::frameNumDecodeOrder
uint32_t frameNumDecodeOrder
FrameNumber in decoder order.
Definition: nvmedia_viddec.h:140
NvMediaMotionVectorMB_Metadata
Per Macroblock header information.
Definition: nvmedia_viddec.h:114
NvMedia_MB_Type_enum
NvMedia_MB_Type_enum
MB types.
Definition: nvmedia_viddec.h:82
NvMediaVideoDecodeFrameStatus::hwClockValue
uint32_t hwClockValue
pass hw decode clock value to calculate decode time
Definition: nvmedia_viddec.h:52
NvMediaVideoDecodeFrameStatus::decoded_mbs
uint32_t decoded_mbs
number of macroblocks decoded
Definition: nvmedia_viddec.h:56
NvMediaVideoDecoderRenderEx
NvMediaStatus NvMediaVideoDecoderRenderEx(const NvMediaVideoDecoder *decoder, const NvMediaVideoSurface *target, const NvMediaPictureInfo *pictureInfo, const void *encryptParams, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, NvMediaVideoDecodeStats *FrameStatsDump, NvMediaDecoderInstanceId instanceId)
Decodes a compressed field/frame and render the result into a NvMediaVideoSurface.
NvMediaMotionVectorMB_Metadata::mb_part
NvMedia_MB_Part_enum mb_part
mb part
Definition: nvmedia_viddec.h:132
NvMediaVideoDecoder::instanceId
NvMediaDecoderInstanceId instanceId
Instance ID of the decoder.
Definition: nvmedia_viddec.h:180
NvMediaDevice
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:348
NvMediaVideoDecodeStats::uRingEntryIdx
uint32_t uRingEntryIdx
this index is used to get the required decoded stats of current frame
Definition: nvmedia_viddec.h:160
NvMediaVideoCodec
NvMediaVideoCodec
Video codec type.
Definition: nvmedia_common_encode_decode.h:38
NvMediaVersion
Holds NvMedia version information.
Definition: nvmedia_core.h:237
NvMediaMotionVectorMB_Metadata::MBType
NvMediaMacroBlockType MBType
macroblock type
Definition: nvmedia_viddec.h:118
NvMediaMotionVectorMB_Metadata::mv_for_y
int16_t mv_for_y
forward motion vector in y direction
Definition: nvmedia_viddec.h:122
NvMediaVideoDecoderDestroy
void NvMediaVideoDecoderDestroy(const NvMediaVideoDecoder *decoder)
Destroys a video decoder object.
NVMEDIA_PART_8x8
@ NVMEDIA_PART_8x8
MB part 8x8.
Definition: nvmedia_viddec.h:106
NVMEDIA_SKIP
@ NVMEDIA_SKIP
MB type SKIP.
Definition: nvmedia_viddec.h:84
NvMediaMotionVectorMB_Metadata::qp
uint8_t qp
qp value
Definition: nvmedia_viddec.h:128
NvMediaVideoDecoder::decoderPriv
struct NvMediaVideoDecoderPriv_ * decoderPriv
An Opaque pointer for internal use.
Definition: nvmedia_viddec.h:182
NVMEDIA_PART_16x8
@ NVMEDIA_PART_16x8
MB part 16x8.
Definition: nvmedia_viddec.h:102
NvMediaVideoDecodeFrameStatus
To Get the decoding status from HW decoder.
Definition: nvmedia_viddec.h:50
NvMediaMotionVectorFrameMetaData::mv
NvMediaMotionVectorMB_Metadata * mv
pointer to motion vector array
Definition: nvmedia_viddec.h:146
NvMediaVideoDecoder
A handle representing a video decoder object.
Definition: nvmedia_viddec.h:170
NvMediaVideoDecoderGetVersion
NvMediaStatus NvMediaVideoDecoderGetVersion(NvMediaVersion *version)
Gets the version information for the NvMedia Video Decoder library.
NvMediaVideoSurface
A handle representing a video surface object.
Definition: nvmedia_video.h:58
NvMediaVideoDecodeStats::mvfData
NvMediaMotionVectorFrameMetaData mvfData
motion vector dump for current frame
Definition: nvmedia_viddec.h:164
NVMEDIA_PART_8x16
@ NVMEDIA_PART_8x16
MB part 8x16.
Definition: nvmedia_viddec.h:104
nvmedia_core.h
NVIDIA Media Interface: Core
NvMediaMotionVectorFrameMetaData::mbCount
uint32_t mbCount
total number of macroblocks in current frame
Definition: nvmedia_viddec.h:142
NvMediaVideoDecoderCreateEx
NvMediaVideoDecoder * NvMediaVideoDecoderCreateEx(const NvMediaDevice *device, NvMediaVideoCodec codec, uint16_t width, uint16_t height, uint16_t maxReferences, uint64_t maxBitstreamSize, uint8_t inputBuffering, uint32_t flags, NvMediaDecoderInstanceId instanceId)
Creates a video decoder object.
NvMediaMotionVectorMB_Metadata::mv_bac_y
int16_t mv_bac_y
forward motion vector in y direction
Definition: nvmedia_viddec.h:126
NVMEDIA_I
@ NVMEDIA_I
MB type I.
Definition: nvmedia_viddec.h:90
NvMediaMotionVectorFrameMetaData
Motion vector array to get the required current frame stats.
Definition: nvmedia_viddec.h:138
NvMediaStatus
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:180
NvMediaBitstreamBuffer
Holds an application data buffer containing compressed video data.
Definition: nvmedia_common_encode_decode.h:73
NvMediaVideoDecoderGetBackwardUpdates
NvMediaStatus NvMediaVideoDecoderGetBackwardUpdates(const NvMediaVideoDecoder *decoder, void *backupdates)
NvMediaVideoDecoder get backward updates counters for VP9 adaptive entropy contexts.
NvMediaMotionVectorMB_Metadata::mv_for_x
int16_t mv_for_x
forward motion vector in x direction
Definition: nvmedia_viddec.h:120
NvMediaVideoDecoderUnRegisterPinnedSurfaces
void NvMediaVideoDecoderUnRegisterPinnedSurfaces(const NvMediaVideoDecoder *decoder)
Unpin all the Pinned decode Surfaces used by decoder.
NvMediaMacroBlockType
NvMediaMacroBlockType
Macroblock types.
Definition: nvmedia_viddec.h:68
NVMEDIA_UNKNOWN_PART
@ NVMEDIA_UNKNOWN_PART
invalid option
Definition: nvmedia_viddec.h:108
NVMEDIA_MBTYPE_B
@ NVMEDIA_MBTYPE_B
macroblock type B
Definition: nvmedia_viddec.h:70
NVMEDIA_MBTYPE_P_BACKWARD
@ NVMEDIA_MBTYPE_P_BACKWARD
macroblock type P backward
Definition: nvmedia_viddec.h:74
NvMediaPictureInfo
void NvMediaPictureInfo
A generic "picture information" pointer type.
Definition: nvmedia_common_decode.h:94
NVMEDIA_PART_16x16
@ NVMEDIA_PART_16x16
MB part 16x16.
Definition: nvmedia_viddec.h:100
NvMediaVideoDecoder::height
uint16_t height
Decoder height.
Definition: nvmedia_viddec.h:176
NvMediaVideoDecodeFrameStatus::decode_error
uint16_t decode_error
non-zero value indicates error occured during decoding (codec-specific)
Definition: nvmedia_viddec.h:54
nvmedia_common_decode.h
NVIDIA Media Interface: Common Types for Video/Image Decode
NvMediaVideoDecoder::codec
NvMediaVideoCodec codec
Codec type.
Definition: nvmedia_viddec.h:172
NvMediaBool
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:80
NvMediaDecoderInstanceId
NvMediaDecoderInstanceId
Specifies the decoder instance ID.
Definition: nvmedia_common_decode.h:60
NvMediaVideoDecodeFrameStatus::hwDecodeTime
uint32_t hwDecodeTime
HW decoding time.
Definition: nvmedia_viddec.h:62
NvMediaMotionVectorMB_Metadata::mv_bac_x
int16_t mv_bac_x
backward motion vector in x direction
Definition: nvmedia_viddec.h:124
NvMediaVideoDecoderGetFrameDecodeStatus
NvMediaStatus NvMediaVideoDecoderGetFrameDecodeStatus(const NvMediaVideoDecoder *decoder, uint32_t ringEntryIdx, NvMediaVideoDecodeFrameStatus *FrameStatus)
Retrieves the HW decode status available.
NvMediaVideoDecodeFrameStatus::concealed_mbs
uint32_t concealed_mbs
number of macroblocks error-concealed
Definition: nvmedia_viddec.h:58
NvMediaVideoDecodeStats::uErrorRefPOC
uint32_t uErrorRefPOC
Will be used in case of H264/HEVC to convey the nearest POC out of RPS/DPB.
Definition: nvmedia_viddec.h:162
NvMediaVideoDecoder::width
uint16_t width
Decoder width.
Definition: nvmedia_viddec.h:174
NVMEDIA_MBTYPE_P_FORWARD
@ NVMEDIA_MBTYPE_P_FORWARD
macroblock type P forward
Definition: nvmedia_viddec.h:72