NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 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, 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_video.h"
24 
42 #define NVMEDIA_VIDEODEC_VERSION_MAJOR 1
43 
44 #define NVMEDIA_VIDEODEC_VERSION_MINOR 6
45 
49 typedef struct{
51  uint32_t hwClockValue;
53  uint16_t decode_error;
55  uint32_t decoded_mbs;
57  uint32_t concealed_mbs; // number of macroblocks concealed
59  uint32_t decoding_status;
61  uint32_t hwDecodeTime;
63 
67 typedef enum {
77 
81 typedef enum {
93 
97 typedef enum {
109 
113 typedef struct {
115  uint16_t mbNum;
119  int16_t mv_for_x;
121  int16_t mv_for_y;
123  int16_t mv_bac_x;
125  int16_t mv_bac_y;
127  uint8_t qp;
133 
137 typedef struct{
141  uint32_t mbCount;
147 
157 typedef struct{
159  uint32_t uRingEntryIdx;
161  uint32_t uErrorRefPOC;
165 
169 typedef struct {
173  uint16_t width;
175  uint16_t height;
177  uint16_t maxReferences;
181 
182 
194 #define NVMEDIA_VIDEO_DECODER_10BIT_DECODE (1<<0)
195 
201 #define NVMEDIA_VIDEO_DECODER_PIXEL_REC_2020 (1<<1)
202 
208 #define NVMEDIA_VIDEO_DECODER_OUTPUT_16BIT_SURFACES (1<<2)
209 
215 #define NVMEDIA_VIDEO_DECODER_ENABLE_AES (1<<3)
216 
222 #define NVMEDIA_VIDEO_DECODER_NV24_OUTPUT (1<<4)
223 
229 #define NVMEDIA_VIDEO_DECODER_PROFILING (1<<5)
230 
236 #define NVMEDIA_VIDEO_DECODER_DUMP_MV (1<<6)
237 
251  NvMediaVersion *version
252 );
253 
301  NvMediaDevice *device,
302  NvMediaVideoCodec codec,
303  uint16_t width,
304  uint16_t height,
305  uint16_t maxReferences,
306  uint64_t maxBitstreamSize,
307  uint8_t inputBuffering,
308  uint32_t flags,
309  NvMediaDecoderInstanceId instanceId
310 );
311 
315 void
317  NvMediaVideoDecoder *decoder
318 );
319 
352  NvMediaVideoDecoder *decoder,
353  NvMediaVideoSurface *target,
354  NvMediaPictureInfo *pictureInfo,
355  void *encryptParams,
356  uint32_t numBitstreamBuffers,
357  const NvMediaBitstreamBuffer *bitstreams,
358  NvMediaVideoDecodeStats *FrameStatsDump,
359  NvMediaDecoderInstanceId instanceId
360 );
361 
389  NvMediaVideoDecoder *decoder,
390  NvMediaVideoSurface *target,
391  NvMediaSliceDecodeData *sliceDecData
392 );
393 
394 
445  NvMediaVideoDecoder *decoder,
446  uint32_t ringEntryIdx,
447  NvMediaVideoDecodeFrameStatus *FrameStatus
448 );
449 
460  NvMediaVideoDecoder *decoder,
461  void *backupdates
462 );
463 
464 /*
465  * \defgroup history_nvmedia_viddec History
466  * Provides change history for the NvMedia Video Decode API.
467  *
468  * \section history_nvmedia_viddec Version History
469  *
470  * <b> Version 1.0 </b> March 21, 2017
471  * - Initial release
472  *
473  * <b> Version 1.1 </b> April 07, 2017
474  * - Added hwClockValue in \ref NvMediaVideoDecodeFrameStatus
475  * - Rename NvMediaVideoBackwardUpdates to \ref NvMediaVideoDecoderGetBackwardUpdates
476  *
477  * <b> Version 1.2 </b> April 18, 2017
478  * - Deprecated NvMediaVideoDecoderCreate() and NvMediaVideoDecoderRender()
479  * - Added \ref NvMediaVideoDecoderGetVersion()
480  * - Added device and instance ID parameters to \ref NvMediaVideoDecoderCreateEx()
481  * - Added instanceId parameter to \ref NvMediaVideoDecoderRenderEx()
482  * - Added instanceId to \ref NvMediaVideoDecoder object
483  * - Changed to use standard data types
484  *
485  * <b> Version 1.3 </b> May 17, 2017
486  * - Added deprecated warning message for \ref NvMediaVideoDecoderSetAttributes
487  *
488  * <b> Version 1.4 </b> June 05, 2017
489  * - Removed \ref -NvMediaVideoDecoderCopySliceData interface
490  * - Added \ref NvMediaVideoDecoderSliceDecode interface
491  * - Added \ref NvMediaSliceDecodeData structure required for
492  * \ref NvMediaVideoDecoderSliceDecode argument.
493  *
494  * <b> Version 1.5 </b> June 15, 2017
495  * - Deprecated \ref NvMediaVideoDecoderSetAttributes()
496  *
497  * <b> Version 1.6 </b> July 04, 2017
498  * - Added \ref NvMedia_MB_Type_enum enumerator
499  * - Added \ref NvMedia_MB_Part_enum enumerator
500  * - Added qp, mb_type and mb_part to \ref NvMediaMotionVectorMB_Metadata structure
501  */
502 
505 #ifdef __cplusplus
506 }; /* extern "C" */
507 #endif
508 
509 #endif /* _NVMEDIA_VIDDEC_H */
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:79
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
NvMediaStatus NvMediaVideoDecoderGetBackwardUpdates(NvMediaVideoDecoder *decoder, void *backupdates)
NvMediaVideoDecoder get backward updates counters for VP9 adaptive entropy contexts.
uint16_t height
Decoder height.
MB part 16x16.
macroblock type I
NvMediaVideoDecoder * NvMediaVideoDecoderCreateEx(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.
invalid option
NvMediaVideoCodec codec
Codec type.
Holds NvMedia Version information.
Definition: nvmedia_core.h:252
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.
NvMediaStatus NvMediaVideoDecoderSliceDecode(NvMediaVideoDecoder *decoder, NvMediaVideoSurface *target, NvMediaSliceDecodeData *sliceDecData)
This function is intended for use in low-latency decode mode.
void NvMediaVideoDecoderDestroy(NvMediaVideoDecoder *decoder)
Destroys a video decoder object.
macroblock type B
NvMediaStatus
The set of all possible error codes.
Definition: nvmedia_core.h:199
NvMediaStatus NvMediaVideoDecoderGetFrameDecodeStatus(NvMediaVideoDecoder *decoder, uint32_t ringEntryIdx, NvMediaVideoDecodeFrameStatus *FrameStatus)
Retrieves the HW decode status available.
NvMediaStatus NvMediaVideoDecoderRenderEx(NvMediaVideoDecoder *decoder, NvMediaVideoSurface *target, NvMediaPictureInfo *pictureInfo, void *encryptParams, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, NvMediaVideoDecodeStats *FrameStatsDump, NvMediaDecoderInstanceId instanceId)
Decodes a compressed field/frame and render the result into a NvMediaVideoSurface.
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 NvMediaDevice
An opaque handle representing a NvMediaDevice object.
Definition: nvmedia_core.h:305
void NvMediaPictureInfo
A generic "picture information" pointer type.
uint32_t decoding_status
32 bits fields, each bit indicate the decoding progress
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.
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
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.
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