#ifndef AVCODEC_NVENC_H
#define AVCODEC_NVENC_H
-#include <cuda.h>
#include <nvEncodeAPI.h>
#include "config.h"
#include "avcodec.h"
+#if CONFIG_CUDA
+#include <cuda.h>
+#else
+
+#if defined(_WIN32)
+#define CUDAAPI __stdcall
+#else
+#define CUDAAPI
+#endif
+
+typedef enum cudaError_enum {
+ CUDA_SUCCESS = 0
+} CUresult;
+typedef int CUdevice;
+typedef void* CUcontext;
+typedef void* CUdeviceptr;
+#endif
+
#define MAX_REGISTERED_FRAMES 64
typedef struct NVENCFrame {
enum {
PRESET_DEFAULT,
+ PRESET_SLOW,
+ PRESET_MEDIUM,
+ PRESET_FAST,
PRESET_HP,
PRESET_HQ,
PRESET_BD ,
NV_ENC_H264_PROFILE_CONSTRAINED_HIGH,
};
+enum {
+ NV_ENC_HEVC_PROFILE_MAIN,
+ NV_ENC_HEVC_PROFILE_MAIN_10,
+ NV_ENC_HEVC_PROFILE_REXT,
+};
+
enum {
NVENC_LOWLATENCY = 1,
- NVENC_LOSSLESS,
+ NVENC_LOSSLESS = 2,
+ NVENC_ONE_PASS = 4,
+ NVENC_TWO_PASSES = 8,
};
enum {
int rc;
int device;
int flags;
+ int async_depth;
+ int rc_lookahead;
+ int aq;
+ int no_scenecut;
+ int b_adapt;
+ int temporal_aq;
+ int zerolatency;
+ int nonref_p;
+ int strict_gop;
+ int aq_strength;
+ int quality;
} NVENCContext;
int ff_nvenc_encode_init(AVCodecContext *avctx);