commit ffnvcodec for openSUSE:Factory
Hello community, here is the log from the commit of package ffnvcodec for openSUSE:Factory checked in at 2019-11-30 10:36:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ffnvcodec (Old) and /work/SRC/openSUSE:Factory/.ffnvcodec.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ffnvcodec" Sat Nov 30 10:36:02 2019 rev:8 rq:750896 version:9.1.23.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ffnvcodec/ffnvcodec.changes 2019-06-27 15:52:42.651871980 +0200 +++ /work/SRC/openSUSE:Factory/.ffnvcodec.new.26869/ffnvcodec.changes 2019-11-30 10:36:54.596175587 +0100 @@ -1,0 +2,8 @@ +Tue Nov 26 03:51:19 UTC 2019 - Martin Herkt <9+suse@cirno.systems> + +- Update to version 9.1.23.0 + * Add cuCtxGetDevice + * Use pointer-to-struct typedefs for pointer-to-struct types + * Update headers from Video SDK 9.1 release + +------------------------------------------------------------------- Old: ---- nv-codec-headers-9.0.18.1.tar.xz New: ---- nv-codec-headers-9.1.23.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ffnvcodec.spec ++++++ --- /var/tmp/diff_new_pack.GjpT33/_old 2019-11-30 10:36:56.100175407 +0100 +++ /var/tmp/diff_new_pack.GjpT33/_new 2019-11-30 10:36:56.104175406 +0100 @@ -1,7 +1,7 @@ # # spec file for package ffnvcodec # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: ffnvcodec -Version: 9.0.18.1 +Version: 9.1.23.0 Release: 0 Summary: FFmpeg version of NVIDIA codec API headers License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.GjpT33/_old 2019-11-30 10:36:56.128175403 +0100 +++ /var/tmp/diff_new_pack.GjpT33/_new 2019-11-30 10:36:56.128175403 +0100 @@ -4,7 +4,7 @@ <param name="scm">git</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">n([0-9\.]*)</param> - <param name="revision">n9.0.18.1</param> + <param name="revision">n9.1.23.0</param> </service> <service mode="disabled" name="recompress"> <param name="file">*.tar</param> ++++++ nv-codec-headers-9.0.18.1.tar.xz -> nv-codec-headers-9.1.23.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nv-codec-headers-9.0.18.1/README new/nv-codec-headers-9.1.23.0/README --- old/nv-codec-headers-9.0.18.1/README 2019-03-11 11:19:36.000000000 +0100 +++ new/nv-codec-headers-9.1.23.0/README 2019-09-23 16:03:27.000000000 +0200 @@ -1,7 +1,7 @@ FFmpeg version of headers required to interface with Nvidias codec APIs. -Corresponds to Video Codec SDK version 9.0.18. +Corresponds to Video Codec SDK version 9.1.23. Minimum required driver versions: -Linux: 418.30 or newer -Windows: 418.81 or newer +Linux: 435.21 or newer +Windows: 436.15 or newer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nv-codec-headers-9.0.18.1/ffnvcodec.pc.in new/nv-codec-headers-9.1.23.0/ffnvcodec.pc.in --- old/nv-codec-headers-9.0.18.1/ffnvcodec.pc.in 2019-03-11 11:19:36.000000000 +0100 +++ new/nv-codec-headers-9.1.23.0/ffnvcodec.pc.in 2019-09-23 16:03:27.000000000 +0200 @@ -3,5 +3,5 @@ Name: ffnvcodec Description: FFmpeg version of Nvidia Codec SDK headers -Version: 9.0.18.1 +Version: 9.1.23.0 Cflags: -I${includedir} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_cuda.h new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_cuda.h --- old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_cuda.h 2019-03-11 11:19:36.000000000 +0100 +++ new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_cuda.h 2019-09-23 16:03:27.000000000 +0200 @@ -41,22 +41,23 @@ #define CU_CTX_SCHED_BLOCKING_SYNC 4 typedef int CUdevice; -typedef void* CUarray; -typedef void* CUcontext; -typedef void* CUstream; -typedef void* CUevent; -typedef void* CUfunction; -typedef void* CUmodule; -typedef void* CUtexObject; -typedef void* CUmipmappedArray; -typedef void* CUgraphicsResource; -typedef void* CUexternalMemory; -typedef void* CUexternalSemaphore; #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined(__LP64__) typedef unsigned long long CUdeviceptr; #else typedef unsigned int CUdeviceptr; #endif +typedef unsigned long long CUtexObject; + +typedef struct CUarray_st *CUarray; +typedef struct CUctx_st *CUcontext; +typedef struct CUstream_st *CUstream; +typedef struct CUevent_st *CUevent; +typedef struct CUfunc_st *CUfunction; +typedef struct CUmod_st *CUmodule; +typedef struct CUmipmappedArray_st *CUmipmappedArray; +typedef struct CUgraphicsResource_st *CUgraphicsResource; +typedef struct CUextMemory_st *CUexternalMemory; +typedef struct CUextSemaphore_st *CUexternalSemaphore; typedef enum cudaError_enum { CUDA_SUCCESS = 0, @@ -329,6 +330,7 @@ typedef CUresult CUDAAPI tcuMemcpy2DAsync_v2(const CUDA_MEMCPY2D *pcopy, CUstream hStream); typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pstr); typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pstr); +typedef CUresult CUDAAPI tcuCtxGetDevice(CUdevice *device); typedef CUresult CUDAAPI tcuStreamCreate(CUstream *phStream, unsigned int flags); typedef CUresult CUDAAPI tcuStreamQuery(CUstream hStream); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_cuviddec.h new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_cuviddec.h --- old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_cuviddec.h 2019-03-11 11:19:36.000000000 +0100 +++ new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_cuviddec.h 2019-09-23 16:03:27.000000000 +0200 @@ -42,7 +42,7 @@ #endif #define NVDECAPI_MAJOR_VERSION 9 -#define NVDECAPI_MINOR_VERSION 0 +#define NVDECAPI_MINOR_VERSION 1 #define NVDECAPI_VERSION (NVDECAPI_MAJOR_VERSION | (NVDECAPI_MINOR_VERSION << 24)) @@ -158,20 +158,21 @@ /**************************************************************************************************************/ typedef struct _CUVIDDECODECAPS { - cudaVideoCodec eCodecType; /**< IN: cudaVideoCodec_XXX */ - cudaVideoChromaFormat eChromaFormat; /**< IN: cudaVideoChromaFormat_XXX */ - unsigned int nBitDepthMinus8; /**< IN: The Value "BitDepth minus 8" */ - unsigned int reserved1[3]; /**< Reserved for future use - set to zero */ - - unsigned char bIsSupported; /**< OUT: 1 if codec supported, 0 if not supported */ - unsigned char reserved2[3]; /**< Reserved for future use - set to zero */ - unsigned int nMaxWidth; /**< OUT: Max supported coded width in pixels */ - unsigned int nMaxHeight; /**< OUT: Max supported coded height in pixels */ + cudaVideoCodec eCodecType; /**< IN: cudaVideoCodec_XXX */ + cudaVideoChromaFormat eChromaFormat; /**< IN: cudaVideoChromaFormat_XXX */ + unsigned int nBitDepthMinus8; /**< IN: The Value "BitDepth minus 8" */ + unsigned int reserved1[3]; /**< Reserved for future use - set to zero */ + + unsigned char bIsSupported; /**< OUT: 1 if codec supported, 0 if not supported */ + unsigned char reserved2; /**< Reserved for future use - set to zero */ + unsigned short nOutputFormatMask; /**< OUT: each bit represents corresponding cudaVideoSurfaceFormat enum */ + unsigned int nMaxWidth; /**< OUT: Max supported coded width in pixels */ + unsigned int nMaxHeight; /**< OUT: Max supported coded height in pixels */ unsigned int nMaxMBCount; /**< OUT: Max supported macroblock count - CodedWidth*CodedHeight/256 must be <= nMaxMBCount */ - unsigned short nMinWidth; /**< OUT: Min supported coded width in pixels */ - unsigned short nMinHeight; /**< OUT: Min supported coded height in pixels */ - unsigned int reserved3[11]; /**< Reserved for future use - set to zero */ + CodedWidth*CodedHeight/256 must be <= nMaxMBCount */ + unsigned short nMinWidth; /**< OUT: Min supported coded width in pixels */ + unsigned short nMinHeight; /**< OUT: Min supported coded height in pixels */ + unsigned int reserved3[11]; /**< Reserved for future use - set to zero */ } CUVIDDECODECAPS; /**************************************************************************************************************/ @@ -189,7 +190,7 @@ tcu_ulong bitDepthMinus8; /**< IN: The value "BitDepth minus 8" */ tcu_ulong ulIntraDecodeOnly; /**< IN: Set 1 only if video has all intra frames (default value is 0). This will optimize video memory for Intra frames only decoding. The support is limited - to specific codecs(H264 rightnow), the flag will be ignored for codecs which + to specific codecs - H264, HEVC, VP9, the flag will be ignored for codecs which are not supported. However decoding might fail if the flag is enabled in case of supported codecs for regular bit streams having P and/or B frames. */ tcu_ulong ulMaxWidth; /**< IN: Coded sequence max width in pixels used with reconfigure Decoder */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_loader.h new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_loader.h --- old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_loader.h 2019-03-11 11:19:36.000000000 +0100 +++ new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_loader.h 2019-09-23 16:03:27.000000000 +0200 @@ -156,6 +156,7 @@ tcuMemcpy2DAsync_v2 *cuMemcpy2DAsync; tcuGetErrorName *cuGetErrorName; tcuGetErrorString *cuGetErrorString; + tcuCtxGetDevice *cuCtxGetDevice; tcuStreamCreate *cuStreamCreate; tcuStreamQuery *cuStreamQuery; @@ -280,6 +281,7 @@ LOAD_SYMBOL(cuMemcpy2DAsync, tcuMemcpy2DAsync_v2, "cuMemcpy2DAsync_v2"); LOAD_SYMBOL(cuGetErrorName, tcuGetErrorName, "cuGetErrorName"); LOAD_SYMBOL(cuGetErrorString, tcuGetErrorString, "cuGetErrorString"); + LOAD_SYMBOL(cuCtxGetDevice, tcuCtxGetDevice, "cuCtxGetDevice"); LOAD_SYMBOL(cuStreamCreate, tcuStreamCreate, "cuStreamCreate"); LOAD_SYMBOL(cuStreamQuery, tcuStreamQuery, "cuStreamQuery"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_nvcuvid.h new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_nvcuvid.h --- old/nv-codec-headers-9.0.18.1/include/ffnvcodec/dynlink_nvcuvid.h 2019-03-11 11:19:36.000000000 +0100 +++ new/nv-codec-headers-9.1.23.0/include/ffnvcodec/dynlink_nvcuvid.h 2019-09-23 16:03:27.000000000 +0200 @@ -100,10 +100,16 @@ unsigned char bit_depth_luma_minus8; /**< OUT: high bit depth luma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */ unsigned char bit_depth_chroma_minus8; /**< OUT: high bit depth chroma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */ unsigned char min_num_decode_surfaces; /**< OUT: Minimum number of decode surfaces to be allocated for correct - decoding. The client can send this value in - ulNumDecodeSurfaces (in CUVIDDECODECREATEINFO strcuture). - If this value is used for ulNumDecodeSurfaces then it has to - also be returned to parser during sequence callback. */ + decoding. The client can send this value in ulNumDecodeSurfaces + (in CUVIDDECODECREATEINFO structure). + This guarantees correct functionality and optimal video memory + usage but not necessarily the best performance, which depends on + the design of the overall application. The optimal number of + decode surfaces (in terms of performance and memory utilization) + should be decided by experimentation for each application, but it + cannot go below min_num_decode_surfaces. + If this value is used for ulNumDecodeSurfaces then it must be + returned to parser during sequence callback. */ unsigned int coded_width; /**< OUT: coded frame width in pixels */ unsigned int coded_height; /**< OUT: coded frame height in pixels */ /** @@ -313,13 +319,14 @@ /***********************************************************************************************************************/ //! Parser callbacks -//! The parser will call these synchronously from within cuvidParseVideoData(), whenever there is seqeuence change or a picture +//! The parser will call these synchronously from within cuvidParseVideoData(), whenever there is sequence change or a picture //! is ready to be decoded and/or displayed. First argument in functions is "void *pUserData" member of structure CUVIDSOURCEPARAMS -//! Return values from these callbacks are interpreted as: -//! PFNVIDSEQUENCECALLBACK : 0: fail, 1: suceeded, > 1: override dpb size of parser (set by CUVIDPARSERPARAMS::ulMaxNumDecodeSurfaces +//! Return values from these callbacks are interpreted as below. If the callbacks return failure, it will be propagated by +//! cuvidParseVideoData() to the application. +//! PFNVIDSEQUENCECALLBACK : 0: fail, 1: succeeded, > 1: override dpb size of parser (set by CUVIDPARSERPARAMS::ulMaxNumDecodeSurfaces //! while creating parser) -//! PFNVIDDECODECALLBACK : 0: fail, >=1: suceeded -//! PFNVIDDISPLAYCALLBACK : 0: fail, >=1: suceeded +//! PFNVIDDECODECALLBACK : 0: fail, >=1: succeeded +//! PFNVIDDISPLAYCALLBACK : 0: fail, >=1: succeeded /***********************************************************************************************************************/ typedef int (CUDAAPI *PFNVIDSEQUENCECALLBACK)(void *, CUVIDEOFORMAT *); typedef int (CUDAAPI *PFNVIDDECODECALLBACK)(void *, CUVIDPICPARAMS *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nv-codec-headers-9.0.18.1/include/ffnvcodec/nvEncodeAPI.h new/nv-codec-headers-9.1.23.0/include/ffnvcodec/nvEncodeAPI.h --- old/nv-codec-headers-9.0.18.1/include/ffnvcodec/nvEncodeAPI.h 2019-03-11 11:19:36.000000000 +0100 +++ new/nv-codec-headers-9.1.23.0/include/ffnvcodec/nvEncodeAPI.h 2019-09-23 16:03:27.000000000 +0200 @@ -30,7 +30,7 @@ * NVIDIA GPUs - beginning with the Kepler generation - contain a hardware-based encoder * (referred to as NVENC) which provides fully-accelerated hardware-based video encoding. * NvEncodeAPI provides the interface for NVIDIA video encoder (NVENC). - * \date 2011-2018 + * \date 2011-2019 * This file contains the interface constants, structure definitions and function prototypes. */ @@ -112,9 +112,10 @@ typedef void* NV_ENC_INPUT_PTR; /**< NVENCODE API input buffer */ typedef void* NV_ENC_OUTPUT_PTR; /**< NVENCODE API output buffer*/ typedef void* NV_ENC_REGISTERED_PTR; /**< A Resource that has been registered with NVENCODE API*/ +typedef void* NV_ENC_CUSTREAM_PTR; /**< Pointer to CUstream*/ #define NVENCAPI_MAJOR_VERSION 9 -#define NVENCAPI_MINOR_VERSION 0 +#define NVENCAPI_MINOR_VERSION 1 #define NVENCAPI_VERSION (NVENCAPI_MAJOR_VERSION | (NVENCAPI_MINOR_VERSION << 24)) @@ -715,6 +716,21 @@ } NV_ENC_DEVICE_TYPE; /** + * Number of reference frames + */ +typedef enum _NV_ENC_NUM_REF_FRAMES +{ + NV_ENC_NUM_REF_FRAMES_AUTOSELECT = 0x0, /**< Number of reference frames is auto selected by the encoder driver */ + NV_ENC_NUM_REF_FRAMES_1 = 0x1, /**< Number of reference frames equal to 1 */ + NV_ENC_NUM_REF_FRAMES_2 = 0x2, /**< Number of reference frames equal to 2 */ + NV_ENC_NUM_REF_FRAMES_3 = 0x3, /**< Number of reference frames equal to 3 */ + NV_ENC_NUM_REF_FRAMES_4 = 0x4, /**< Number of reference frames equal to 4 */ + NV_ENC_NUM_REF_FRAMES_5 = 0x5, /**< Number of reference frames equal to 5 */ + NV_ENC_NUM_REF_FRAMES_6 = 0x6, /**< Number of reference frames equal to 6 */ + NV_ENC_NUM_REF_FRAMES_7 = 0x7 /**< Number of reference frames equal to 7 */ +} NV_ENC_NUM_REF_FRAMES; + +/** * Encoder capabilities enumeration. */ typedef enum _NV_ENC_CAPS @@ -781,9 +797,11 @@ NV_ENC_CAPS_SUPPORT_ADAPTIVE_TRANSFORM, /** - * Reserved enum field. + * Indicates HW support for Multi View Coding. + * \n 0 : Multi View Coding not supported. + * \n 1 : Multi View Coding supported. */ - NV_ENC_CAPS_SUPPORT_RESERVED, + NV_ENC_CAPS_SUPPORT_STEREO_MVC, /** * Indicates HW support for encoding Temporal layers. @@ -1033,6 +1051,21 @@ */ NV_ENC_CAPS_SUPPORT_EMPHASIS_LEVEL_MAP, + /** + * Minimum input width supported. + */ + NV_ENC_CAPS_WIDTH_MIN, + + /** + * Minimum input height supported. + */ + NV_ENC_CAPS_HEIGHT_MIN, + + /** + * Indicates HW support for multiple reference frames. + */ + NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES, + /** * Reserved - Not to be used by clients. */ @@ -1170,9 +1203,9 @@ */ typedef struct _NV_ENC_QP { - uint32_t qpInterP; - uint32_t qpInterB; - uint32_t qpIntra; + uint32_t qpInterP; /**< [in]: Specifies QP value for P-frame. Even though this field is uint32_t for legacy reasons, the client should treat this as a signed parameter(int32_t) for cases in which negative QP values are to be specified. */ + uint32_t qpInterB; /**< [in]: Specifies QP value for B-frame. Even though this field is uint32_t for legacy reasons, the client should treat this as a signed parameter(int32_t) for cases in which negative QP values are to be specified. */ + uint32_t qpIntra; /**< [in]: Specifies QP value for Intra Frame. Even though this field is uint32_t for legacy reasons, the client should treat this as a signed parameter(int32_t) for cases in which negative QP values are to be specified. */ } NV_ENC_QP; /** @@ -1195,7 +1228,7 @@ uint32_t enableLookahead :1; /**< [in]: Set this to 1 to enable lookahead with depth <lookaheadDepth> (if lookahead is enabled, input frames must remain available to the encoder until encode completion) */ uint32_t disableIadapt :1; /**< [in]: Set this to 1 to disable adaptive I-frame insertion at scene cuts (only has an effect when lookahead is enabled) */ uint32_t disableBadapt :1; /**< [in]: Set this to 1 to disable adaptive B-frame decision (only has an effect when lookahead is enabled) */ - uint32_t enableTemporalAQ :1; /**< [in]: Set this to 1 to enable temporal AQ for H.264 */ + uint32_t enableTemporalAQ :1; /**< [in]: Set this to 1 to enable temporal AQ */ uint32_t zeroReorderDelay :1; /**< [in]: Set this to 1 to indicate zero latency operation (no reordering delay, num_reorder_frames=0) */ uint32_t enableNonRefP :1; /**< [in]: Set this to 1 to enable automatic insertion of non-reference P-frames (no effect if enablePTD=0) */ uint32_t strictGOPTarget :1; /**< [in]: Set this to 1 to minimize GOP-to-GOP rate fluctuations */ @@ -1210,19 +1243,19 @@ uint8_t targetQualityLSB; /**< [in]: Fractional part of target quality (as 8.8 fixed point format) */ uint16_t lookaheadDepth; /**< [in]: Maximum depth of lookahead with range 0-32 (only used if enableLookahead=1) */ uint32_t reserved1; - NV_ENC_QP_MAP_MODE qpMapMode; /**< [in]: This flag is used to interpret values in array pecified by NV_ENC_PIC_PARAMS::qpDeltaMap. - Set this to NV_ENC_QP_MAP_EMPHASIS to treat values specified by NV_ENC_PIC_PARAMS::qpDeltaMap as Emphasis level Map. + NV_ENC_QP_MAP_MODE qpMapMode; /**< [in]: This flag is used to interpret values in array specified by NV_ENC_PIC_PARAMS::qpDeltaMap. + Set this to NV_ENC_QP_MAP_EMPHASIS to treat values specified by NV_ENC_PIC_PARAMS::qpDeltaMap as Emphasis Level Map. Emphasis Level can be assigned any value specified in enum NV_ENC_EMPHASIS_MAP_LEVEL. Emphasis Level Map is used to specify regions to be encoded at varying levels of quality. The hardware encoder adjusts the quantization within the image as per the provided emphasis map, by adjusting the quantization parameter (QP) assigned to each macroblock. This adjustment is commonly called “Delta QP”. The adjustment depends on the absolute QP decided by the rate control algorithm, and is applied after the rate control has decided each macroblock’s QP. - Since the Delta QP overrides rate control, enabling emphasis level map may violate bitrate and VBV buffersize constraints. - Emphasis level map is useful in situations when client has a priori knowledge of the image complexity (e.g. via use of NVFBC's Classification feature) and encoding those high-complexity areas at higher quality (lower QP) is important, even at the possible cost of violating bitrate/VBV buffersize constraints + Since the Delta QP overrides rate control, enabling Emphasis Level Map may violate bitrate and VBV buffer size constraints. + Emphasis Level Map is useful in situations where client has a priori knowledge of the image complexity (e.g. via use of NVFBC's Classification feature) and encoding those high-complexity areas at higher quality (lower QP) is important, even at the possible cost of violating bitrate/VBV buffer size constraints This feature is not supported when AQ( Spatial/Temporal) is enabled. This feature is only supported for H264 codec currently. - Set this to NV_ENC_QP_MAP_DELTA to treat values specified by NV_ENC_PIC_PARAMS::qpDeltaMap as QPDelta. This specify QP modifier to be applied on top of the QP chosen by rate control + Set this to NV_ENC_QP_MAP_DELTA to treat values specified by NV_ENC_PIC_PARAMS::qpDeltaMap as QPDelta. This specifies QP modifier to be applied on top of the QP chosen by rate control Set this to NV_ENC_QP_MAP_DISABLED to ignore NV_ENC_PIC_PARAMS::qpDeltaMap values. In this case, qpDeltaMap should be set to NULL. @@ -1297,7 +1330,7 @@ */ typedef struct _NV_ENC_CONFIG_H264 { - uint32_t enableTemporalSVC :1; /**< [in]: Set to 1 to enable SVC temporal*/ + uint32_t reserved :1; /**< [in]: Reserved and must be set to 0 */ uint32_t enableStereoMVC :1; /**< [in]: Set to 1 to enable stereo MVC*/ uint32_t hierarchicalPFrames :1; /**< [in]: Set to 1 to enable hierarchical PFrames */ uint32_t hierarchicalBFrames :1; /**< [in]: Set to 1 to enable hierarchical BFrames */ @@ -1323,7 +1356,17 @@ uint32_t qpPrimeYZeroTransformBypassFlag :1; /**< [in]: To enable lossless encode set this to 1, set QP to 0 and RC_mode to NV_ENC_PARAMS_RC_CONSTQP and profile to HIGH_444_PREDICTIVE_PROFILE. Check support for lossless encoding using ::NV_ENC_CAPS_SUPPORT_LOSSLESS_ENCODE caps. */ uint32_t useConstrainedIntraPred :1; /**< [in]: Set 1 to enable constrained intra prediction. */ - uint32_t reservedBitFields :15; /**< [in]: Reserved bitfields and must be set to 0 */ + uint32_t enableFillerDataInsertion :1; /**< [in]: Set to 1 to enable insertion of filler data in the bitstream. + This flag will take effect only when one of the CBR rate + control modes (NV_ENC_PARAMS_RC_CBR, NV_ENC_PARAMS_RC_CBR_HQ, + NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ) is in use and both + NV_ENC_INITIALIZE_PARAMS::frameRateNum and + NV_ENC_INITIALIZE_PARAMS::frameRateDen are set to non-zero + values. Setting this field when + NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is also set + is currently not supported and will make ::NvEncInitializeEncoder() + return an error. */ + uint32_t reservedBitFields :14; /**< [in]: Reserved bitfields and must be set to 0 */ uint32_t level; /**< [in]: Specifies the encoding level. Client is recommended to set this to NV_ENC_LEVEL_AUTOSELECT in order to enable the NvEncodeAPI interface to select the correct level. */ uint32_t idrPeriod; /**< [in]: Specifies the IDR interval. If not set, this is made equal to gopLength in NV_ENC_CONFIG.Low latency application client can set IDR interval to NVENC_INFINITE_GOPLENGTH so that IDR frames are not inserted automatically. */ uint32_t separateColourPlaneFlag; /**< [in]: Set to 1 to enable 4:4:4 separate colour planes */ @@ -1364,7 +1407,11 @@ Check support for YUV444 encoding using ::NV_ENC_CAPS_SUPPORT_YUV444_ENCODE caps.*/ uint32_t maxTemporalLayers; /**< [in]: Specifies the max temporal layer used for hierarchical coding. */ NV_ENC_BFRAME_REF_MODE useBFramesAsRef; /**< [in]: Specifies the B-Frame as reference mode. Check support for useBFramesAsRef mode using ::NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE caps.*/ - uint32_t reserved1[269]; /**< [in]: Reserved and must be set to 0 */ + NV_ENC_NUM_REF_FRAMES numRefL0; /**< [in]: Specifies max number of reference frames in reference picture list L0, that can be used by hardware for prediction of a frame. + Check support for numRefL0 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ + NV_ENC_NUM_REF_FRAMES numRefL1; /**< [in]: Specifies max number of reference frames in reference picture list L1, that can be used by hardware for prediction of a frame. + Check support for numRefL1 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ + uint32_t reserved1[267]; /**< [in]: Reserved and must be set to 0 */ void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ } NV_ENC_CONFIG_H264; @@ -1395,7 +1442,17 @@ uint32_t enableIntraRefresh :1; /**< [in]: Set 1 to enable gradual decoder refresh or intra refresh. If the GOP structure uses B frames this will be ignored */ uint32_t chromaFormatIDC :2; /**< [in]: Specifies the chroma format. Should be set to 1 for yuv420 input, 3 for yuv444 input.*/ uint32_t pixelBitDepthMinus8 :3; /**< [in]: Specifies pixel bit depth minus 8. Should be set to 0 for 8 bit input, 2 for 10 bit input.*/ - uint32_t reserved :18; /**< [in]: Reserved bitfields.*/ + uint32_t enableFillerDataInsertion :1; /**< [in]: Set to 1 to enable insertion of filler data in the bitstream. + This flag will take effect only when one of the CBR rate + control modes (NV_ENC_PARAMS_RC_CBR, NV_ENC_PARAMS_RC_CBR_HQ, + NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ) is in use and both + NV_ENC_INITIALIZE_PARAMS::frameRateNum and + NV_ENC_INITIALIZE_PARAMS::frameRateDen are set to non-zero + values. Setting this field when + NV_ENC_INITIALIZE_PARAMS::enableOutputInVidmem is also set + is currently not supported and will make ::NvEncInitializeEncoder() + return an error. */ + uint32_t reserved :17; /**< [in]: Reserved bitfields.*/ uint32_t idrPeriod; /**< [in]: Specifies the IDR interval. If not set, this is made equal to gopLength in NV_ENC_CONFIG.Low latency application client can set IDR interval to NVENC_INFINITE_GOPLENGTH so that IDR frames are not inserted automatically. */ uint32_t intraRefreshPeriod; /**< [in]: Specifies the interval between successive intra refresh if enableIntrarefresh is set. Requires enableIntraRefresh to be set. Will be disabled if NV_ENC_CONFIG::gopLength is not set to NVENC_INFINITE_GOPLENGTH. */ @@ -1422,8 +1479,12 @@ be deprecated in future releases. Set to 0 when using "LTR Per Picture" mode of LTR operation. */ NV_ENC_BFRAME_REF_MODE useBFramesAsRef; /**< [in]: Specifies the B-Frame as reference mode. Check support for useBFramesAsRef mode using ::NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE caps.*/ - uint32_t reserved1[216]; /**< [in]: Reserved and must be set to 0.*/ - void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ + NV_ENC_NUM_REF_FRAMES numRefL0; /**< [in]: Specifies max number of reference frames in reference picture list L0, that can be used by hardware for prediction of a frame. + Check support for numRefL0 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ + NV_ENC_NUM_REF_FRAMES numRefL1; /**< [in]: Specifies max number of reference frames in reference picture list L1, that can be used by hardware for prediction of a frame. + Check support for numRefL1 using ::NV_ENC_CAPS_SUPPORT_MULTIPLE_REF_FRAMES caps. */ + uint32_t reserved1[214]; /**< [in]: Reserved and must be set to 0.*/ + void* reserved2[64]; /**< [in]: Reserved and must be set to NULL */ } NV_ENC_CONFIG_HEVC; /** @@ -1590,6 +1651,34 @@ /** + * \struct _NV_ENC_PIC_PARAMS_MVC + * MVC-specific parameters to be sent on a per-frame basis. + */ +typedef struct _NV_ENC_PIC_PARAMS_MVC +{ + uint32_t version; /**< [in]: Struct version. Must be set to ::NV_ENC_PIC_PARAMS_MVC_VER. */ + uint32_t viewID; /**< [in]: Specifies the view ID associated with the current input view. */ + uint32_t temporalID; /**< [in]: Specifies the temporal ID associated with the current input view. */ + uint32_t priorityID; /**< [in]: Specifies the priority ID associated with the current input view. Reserved and ignored by the NvEncodeAPI interface. */ + uint32_t reserved1[12]; /**< [in]: Reserved and must be set to 0. */ + void* reserved2[8]; /**< [in]: Reserved and must be set to NULL. */ +}NV_ENC_PIC_PARAMS_MVC; + +/** macro for constructing the version field of ::_NV_ENC_PIC_PARAMS_MVC */ +#define NV_ENC_PIC_PARAMS_MVC_VER NVENCAPI_STRUCT_VERSION(1) + + +/** + * \union _NV_ENC_PIC_PARAMS_H264_EXT + * H264 extension picture parameters + */ +typedef union _NV_ENC_PIC_PARAMS_H264_EXT +{ + NV_ENC_PIC_PARAMS_MVC mvcPicParams; /**< [in]: Specifies the MVC picture parameters. */ + uint32_t reserved1[32]; /**< [in]: Reserved and must be set to 0. */ +}NV_ENC_PIC_PARAMS_H264_EXT; + +/** * \struct _NV_ENC_SEI_PAYLOAD * User SEI message */ @@ -1642,7 +1731,8 @@ This option along with forceIntraSliceIdx[] array needs to be used with sliceMode = 3 only */ uint32_t *forceIntraSliceIdx; /**< [in]: Slice indices to be forced to intra in the current picture. Each slice index should be <= num_slices_in_picture -1. Index starts from 0 for first slice. The number of entries in this array should be equal to forceIntraSliceCount */ - uint32_t reserved [242]; /**< [in]: Reserved and must be set to 0. */ + NV_ENC_PIC_PARAMS_H264_EXT h264ExtPicParams; /**< [in]: Specifies the H264 extension config parameters using this config. */ + uint32_t reserved [210]; /**< [in]: Reserved and must be set to 0. */ void* reserved2[61]; /**< [in]: Reserved and must be set to NULL. */ } NV_ENC_PIC_PARAMS_H264; @@ -1734,11 +1824,11 @@ + 4*meHintCountsPerBlock[Lx].numCandsPerBlk8x8. For frames using bidirectional ME , the total number of candidates for single macroblock is sum of total number of candidates per MB for each direction (L0 and L1) */ uint32_t reserved1[6]; /**< [in]: Reserved and must be set to 0 */ void* reserved2[2]; /**< [in]: Reserved and must be set to NULL */ - int8_t *qpDeltaMap; /**< [in]: Specifies the pointer to signed byte array containing value per MB in raster scan order for the current picture, which will be Interperated depending on NV_ENC_RC_PARAMS::qpMapMode. - If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_DELTA , This specify QP modifier to be applied on top of the QP chosen by rate control. - If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_EMPHASIS, it specifies emphasis level map per MB. This level value along with QP chosen by rate control is used to compute the QP modifier, - which in turn is applied on top of QP chosen by rate control. - If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_DISABLED value in qpDeltaMap will be ignored.*/ + int8_t *qpDeltaMap; /**< [in]: Specifies the pointer to signed byte array containing value per MB in raster scan order for the current picture, which will be interpreted depending on NV_ENC_RC_PARAMS::qpMapMode. + If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_DELTA, qpDeltaMap specifies QP modifier per MB. This QP modifier will be applied on top of the QP chosen by rate control. + If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_EMPHASIS, qpDeltaMap specifies Emphasis Level Map per MB. This level value along with QP chosen by rate control is used to + compute the QP modifier, which in turn is applied on top of QP chosen by rate control. + If NV_ENC_RC_PARAMS::qpMapMode is NV_ENC_QP_MAP_DISABLED, value in qpDeltaMap will be ignored.*/ uint32_t qpDeltaMapSize; /**< [in]: Specifies the size in bytes of qpDeltaMap surface allocated by client and pointed to by NV_ENC_PIC_PARAMS::qpDeltaMap. Surface (array) should be picWidthInMbs * picHeightInMbs */ uint32_t reservedBitFields; /**< [in]: Reserved bitfields and must be set to 0 */ uint16_t meHintRefPicDist[2]; /**< [in]: Specifies temporal distance for reference picture (NVENC_EXTERNAL_ME_HINT::refidx = 0) used during external ME with NV_ENC_INITALIZE_PARAMS::enablePTD = 1 . meHintRefPicDist[0] is for L0 hints and meHintRefPicDist[1] is for L1 hints. @@ -2491,6 +2581,41 @@ */ NVENCSTATUS NVENCAPI NvEncDestroyInputBuffer (void* encoder, NV_ENC_INPUT_PTR inputBuffer); +// NvEncSetIOCudaStreams +/** + * \brief Set input and output CUDA stream for specified encoder attribute. + * + * Encoding may involve CUDA pre-processing on the input and post-processing on encoded output. + * This function is used to set input and output CUDA streams to pipeline the CUDA pre-processing + * and post-processing tasks. Clients should call this function before the call to + * NvEncUnlockInputBuffer(). If this function is not called, the default CUDA stream is used for + * input and output processing. After a successful call to this function, the streams specified + * in that call will replace the previously-used streams. + * This API is supported for NVCUVID interface only. + * + * \param [in] encoder + * Pointer to the NvEncodeAPI interface. + * \param [in] inputStream + * Pointer to CUstream which is used to process ::NV_ENC_PIC_PARAMS::inputFrame for encode. + * In case of ME-only mode, inputStream is used to process ::NV_ENC_MEONLY_PARAMS::inputBuffer and + * ::NV_ENC_MEONLY_PARAMS::referenceFrame + * \param [in] outputStream + * Pointer to CUstream which is used to process ::NV_ENC_PIC_PARAMS::outputBuffer for encode. + * In case of ME-only mode, outputStream is used to process ::NV_ENC_MEONLY_PARAMS::mvBuffer + * + * \return + * ::NV_ENC_SUCCESS \n + * ::NV_ENC_ERR_INVALID_PTR \n + * ::NV_ENC_ERR_INVALID_ENCODERDEVICE \n + * ::NV_ENC_ERR_DEVICE_NOT_EXIST \n + * ::NV_ENC_ERR_UNSUPPORTED_PARAM \n + * ::NV_ENC_ERR_OUT_OF_MEMORY \n + * ::NV_ENC_ERR_INVALID_PARAM \n + * ::NV_ENC_ERR_INVALID_VERSION \n + * ::NV_ENC_ERR_GENERIC \n + */ +NVENCSTATUS NVENCAPI NvEncSetIOCudaStreams (void* encoder, NV_ENC_CUSTREAM_PTR inputStream, NV_ENC_CUSTREAM_PTR outputStream); + // NvEncCreateBitstreamBuffer /** @@ -2570,6 +2695,11 @@ * - NV_ENC_PIC_PARAMS_H264::frameNumSyntax(H264 only) * - NV_ENC_PIC_PARAMS_H264::refPicFlag(H264 only) * + *\par MVC Encoding: + * For MVC encoding the client must call encode picture api for each view separately + * and must pass valid view id in NV_ENC_PIC_PARAMS_MVC::viewID field. Currently + * NvEncodeAPI only support stereo MVC so client must send viewID as 0 for base + * view and view ID as 1 for dependent view. * *\par Asynchronous Encoding * If the client has enabled asynchronous mode of encoding by setting @@ -3363,6 +3493,22 @@ NVENCSTATUS NVENCAPI NvEncodeAPIGetMaxSupportedVersion (uint32_t* version); +// NvEncodeAPIGetLastErrorString +/** + * \brief Get the description of the last error reported by the API. + * + * This function returns a null-terminated string that can be used by clients to better understand the reason + * for failure of a previous API call. + * + * \param [in] encoder + * Pointer to the NvEncodeAPI interface. + * + * \return + * Pointer to buffer containing the details of the last error encountered by the API. + */ +const char * NVENCAPI NvEncGetLastErrorString (void* encoder); + + /// \cond API PFN /* * Defines API function pointers @@ -3404,6 +3550,8 @@ typedef NVENCSTATUS (NVENCAPI* PNVENCCREATEMVBUFFER) (void* encoder, NV_ENC_CREATE_MV_BUFFER* createMVBufferParams); typedef NVENCSTATUS (NVENCAPI* PNVENCDESTROYMVBUFFER) (void* encoder, NV_ENC_OUTPUT_PTR mvBuffer); typedef NVENCSTATUS (NVENCAPI* PNVENCRUNMOTIONESTIMATIONONLY) (void* encoder, NV_ENC_MEONLY_PARAMS* meOnlyParams); +typedef const char * (NVENCAPI* PNVENCGETLASTERROR) (void* encoder); +typedef NVENCSTATUS (NVENCAPI* PNVENCSETIOCUDASTREAMS) (void* encoder, NV_ENC_CUSTREAM_PTR inputStream, NV_ENC_CUSTREAM_PTR outputStream); /// \endcond @@ -3456,7 +3604,9 @@ PNVENCCREATEMVBUFFER nvEncCreateMVBuffer; /**< [out]: Client should access ::NvEncCreateMVBuffer API through this pointer. */ PNVENCDESTROYMVBUFFER nvEncDestroyMVBuffer; /**< [out]: Client should access ::NvEncDestroyMVBuffer API through this pointer. */ PNVENCRUNMOTIONESTIMATIONONLY nvEncRunMotionEstimationOnly; /**< [out]: Client should access ::NvEncRunMotionEstimationOnly API through this pointer. */ - void* reserved2[281]; /**< [in]: Reserved and must be set to NULL */ + PNVENCGETLASTERROR nvEncGetLastErrorString; /**< [out]: Client should access ::nvEncGetLastErrorString API through this pointer. */ + PNVENCSETIOCUDASTREAMS nvEncSetIOCudaStreams; /**< [out]: Client should access ::nvEncSetIOCudaStreams API through this pointer. */ + void* reserved2[279]; /**< [in]: Reserved and must be set to NULL */ } NV_ENCODE_API_FUNCTION_LIST; /** Macro for constructing the version field of ::_NV_ENCODEAPI_FUNCTION_LIST. */
participants (1)
-
root