NVIDIA DRIVE OS Linux API Reference

5.1.6.1 Release
For Test and Development only

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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.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 10
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 
197 #define NVMEDIA_VIDEO_DECODER_10BIT_DECODE (1U<<0)
198 
204 #define NVMEDIA_VIDEO_DECODER_PIXEL_REC_2020 (1U<<1)
205 
211 #define NVMEDIA_VIDEO_DECODER_OUTPUT_16BIT_SURFACES (1U<<2)
212 
218 #define NVMEDIA_VIDEO_DECODER_ENABLE_AES (1U<<3)
219 
225 #define NVMEDIA_VIDEO_DECODER_NV24_OUTPUT (1U<<4)
226 
232 #define NVMEDIA_VIDEO_DECODER_PROFILING (1U<<5)
233 
239 #define NVMEDIA_VIDEO_DECODER_DUMP_MV (1U<<6)
240 
254  NvMediaVersion *version
255 );
256 
304  const NvMediaDevice *device,
305  NvMediaVideoCodec codec,
306  uint16_t width,
307  uint16_t height,
308  uint16_t maxReferences,
309  uint64_t maxBitstreamSize,
310  uint8_t inputBuffering,
311  uint32_t flags,
312  NvMediaDecoderInstanceId instanceId
313 );
314 
318 void
320  const NvMediaVideoDecoder *decoder
321 );
322 
355  const NvMediaVideoDecoder *decoder,
356  const NvMediaVideoSurface *target,
357  const NvMediaPictureInfo *pictureInfo,
358  const void *encryptParams,
359  uint32_t numBitstreamBuffers,
360  const NvMediaBitstreamBuffer *bitstreams,
361  NvMediaVideoDecodeStats *FrameStatsDump,
362  NvMediaDecoderInstanceId instanceId
363 );
364 
392  const NvMediaVideoDecoder *decoder,
393  const NvMediaVideoSurface *target,
394  const NvMediaSliceDecodeData *sliceDecData
395 );
396 
397 
448  const NvMediaVideoDecoder *decoder,
449  uint32_t ringEntryIdx,
450  NvMediaVideoDecodeFrameStatus *FrameStatus
451 );
452 
463  const NvMediaVideoDecoder *decoder,
464  void *backupdates
465 );
466 
467 /*
468  * \defgroup history_nvmedia_viddec History
469  * Provides change history for the NvMedia Video Decode API.
470  *
471  * \section history_nvmedia_viddec Version History
472  *
473  * <b> Version 1.0 </b> March 21, 2017
474  * - Initial release
475  *
476  * <b> Version 1.1 </b> April 07, 2017
477  * - Added hwClockValue in \ref NvMediaVideoDecodeFrameStatus
478  * - Rename NvMediaVideoBackwardUpdates to \ref NvMediaVideoDecoderGetBackwardUpdates
479  *
480  * <b> Version 1.2 </b> April 18, 2017
481  * - Deprecated NvMediaVideoDecoderCreate() and NvMediaVideoDecoderRender()
482  * - Added \ref NvMediaVideoDecoderGetVersion()
483  * - Added device and instance ID parameters to \ref NvMediaVideoDecoderCreateEx()
484  * - Added instanceId parameter to \ref NvMediaVideoDecoderRenderEx()
485  * - Added instanceId to \ref NvMediaVideoDecoder object
486  * - Changed to use standard data types
487  *
488  * <b> Version 1.3 </b> May 17, 2017
489  * - Added deprecated warning message for \ref NvMediaVideoDecoderSetAttributes
490  *
491  * <b> Version 1.4 </b> June 05, 2017
492  * - Removed \ref -NvMediaVideoDecoderCopySliceData interface
493  * - Added \ref NvMediaVideoDecoderSliceDecode interface
494  * - Added \ref NvMediaSliceDecodeData structure required for
495  * \ref NvMediaVideoDecoderSliceDecode argument.
496  *
497  * <b> Version 1.5 </b> June 15, 2017
498  * - Deprecated \ref NvMediaVideoDecoderSetAttributes()
499  *
500  * <b> Version 1.6 </b> July 04, 2017
501  * - Added \ref NvMedia_MB_Type_enum enumerator
502  * - Added \ref NvMedia_MB_Part_enum enumerator
503  * - Added qp, mb_type and mb_part to \ref NvMediaMotionVectorMB_Metadata structure
504  *
505  * <b> Version 1.7 </b> Dec 14, 2018
506  * - Defined Macro constants as unsigned to fix MISRA issues
507  * - Fix MISRA violations 21.1 and 21.2
508  *
509  * <b> Version 1.8 </b> January 15, 2019
510  * - Fix MISRA violations 8.13
511  *
512  * <b> Version 1.9 </b> Feb 11, 2019
513  * - Added opaque handle for decoder
514  * internal usage into video decoder object
515  * - Fix MISRA violations 11.3
516  * - Fix MISRA violations 8.13
517  *
518  * <b> Version 1.10 </b> Feb 28, 2019
519  * - Added required header include nvmedia_core.h
520  */
521 
524 #ifdef __cplusplus
525 }; /* extern "C" */
526 #endif
527 
528 #endif /* NVMEDIA_VIDDEC_H */
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.
MB part 16x8.
uint16_t maxReferences
Maximum number of reference pictures.
Holds an application data buffer containing compressed video data.
uint16_t decode_error
non-zero value indicates error occured during decoding (codec-specific)
int uint32_t width
uint32_t hwDecodeTime
HW decoding time.
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:80
NvMediaDecoderInstanceId
Specifies the decoder instance ID.
macroblock type P backward
int16_t mv_bac_x
backward motion vector in x direction
NvMedia_MB_Part_enum mb_part
mb part
uint16_t mbNum
macroblock number
uint16_t height
Decoder height.
MB part 16x16.
macroblock type I
invalid option
NvMediaVideoCodec codec
Codec type.
Holds NvMedia version information.
Definition: nvmedia_core.h:226
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:337
Frame stats structure to get get ring entry idx and motion vector dump.
invalid option
NvMedia_MB_Type_enum mb_type
mb type
MB type SKIP.
NVIDIA Media Interface: Common Types for Video/Image Encode/Decode
NvMediaDecoderInstanceId instanceId
Instance ID of the decoder.
struct NvMediaVideoDecoderPriv_ * decoderPriv
An Opaque pointer for internal use.
NVIDIA Media Interface: Core
macroblock type B
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:169
NvMedia_MB_Type_enum
MB types.
uint32_t hwClockValue
pass hw decode clock value to calculate decode time
MB part 8x8.
int16_t mv_bac_y
forward motion vector in y direction
MB type P.
uint32_t concealed_mbs
number of macroblocks error-concealed
int uint32_t uint32_t uint32_t const uint32_t const uint32_t const uint32_t const uint64_t uint32_t uint32_t flags
int uint32_t uint32_t height
int16_t mv_for_x
forward motion vector in x direction
To Get the decoding status from HW decoder.
slice level data used with slice level decoding
uint32_t uErrorRefPOC
Will be used in case of H264/HEVC to convey the nearest POC out of RPS/DPB.
NVIDIA Media Interface: Video Surface Processing
uint32_t uRingEntryIdx
this index is used to get the required decoded stats of current frame
NvMediaMotionVectorMB_Metadata * mv
pointer to motion vector array
MB part 8x16.
void NvMediaPictureInfo
A generic "picture information" pointer type.
uint32_t decoding_status
32 bits fields, each bit indicate the decoding progress
NvMediaStatus NvMediaVideoDecoderGetFrameDecodeStatus(const NvMediaVideoDecoder *decoder, uint32_t ringEntryIdx, NvMediaVideoDecodeFrameStatus *FrameStatus)
Retrieves the HW decode status available.
uint16_t width
Decoder width.
Motion vector array to get the required current frame stats.
NvMediaMotionVectorFrameMetaData mvfData
motion vector dump for current frame
NvMediaBool bMVDumpPresent
flag to indicate whether motion vector dump is present or not.
NvMediaVideoCodec
Video codec type.
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.
NvMediaStatus NvMediaVideoDecoderSliceDecode(const NvMediaVideoDecoder *decoder, const NvMediaVideoSurface *target, const NvMediaSliceDecodeData *sliceDecData)
This function is intended for use in low-latency decode mode.
Per Macroblock header information.
int16_t mv_for_y
forward motion vector in y direction
MB type B.
uint32_t decoded_mbs
number of macroblocks decoded
NvMediaStatus NvMediaVideoDecoderGetBackwardUpdates(const NvMediaVideoDecoder *decoder, void *backupdates)
NvMediaVideoDecoder get backward updates counters for VP9 adaptive entropy contexts.
NvMedia_MB_Part_enum
MB part.
uint32_t frameNumDecodeOrder
FrameNumber in decoder order.
MB type I.
A handle representing a video decoder object.
NvMediaMacroBlockType MBType
macroblock type
NvMediaStatus NvMediaVideoDecoderGetVersion(NvMediaVersion *version)
Gets the version information for the NvMedia Video Decoder library.
void NvMediaVideoDecoderDestroy(const NvMediaVideoDecoder *decoder)
Destroys a video decoder object.
NvMediaMacroBlockType
Macroblock types.
A handle representing a video surface object.
Definition: nvmedia_video.h:58
uint32_t mbCount
total number of macroblocks in current frame
macroblock type P forward