|
|
|
@ -657,6 +657,28 @@ typedef struct GUIDTuple { |
|
|
|
|
static void nvenc_map_preset(NvencContext *ctx) |
|
|
|
|
{ |
|
|
|
|
GUIDTuple presets[] = { |
|
|
|
|
#ifdef NVENC_HAVE_NEW_PRESETS |
|
|
|
|
PRESET(P1), |
|
|
|
|
PRESET(P2), |
|
|
|
|
PRESET(P3), |
|
|
|
|
PRESET(P4), |
|
|
|
|
PRESET(P5), |
|
|
|
|
PRESET(P6), |
|
|
|
|
PRESET(P7), |
|
|
|
|
PRESET_ALIAS(SLOW, P7, NVENC_TWO_PASSES), |
|
|
|
|
PRESET_ALIAS(MEDIUM, P4, NVENC_ONE_PASS), |
|
|
|
|
PRESET_ALIAS(FAST, P1, NVENC_ONE_PASS), |
|
|
|
|
// Compat aliases
|
|
|
|
|
PRESET_ALIAS(DEFAULT, P4, NVENC_DEPRECATED_PRESET), |
|
|
|
|
PRESET_ALIAS(HP, P1, NVENC_DEPRECATED_PRESET), |
|
|
|
|
PRESET_ALIAS(HQ, P7, NVENC_DEPRECATED_PRESET), |
|
|
|
|
PRESET_ALIAS(BD, P5, NVENC_DEPRECATED_PRESET), |
|
|
|
|
PRESET_ALIAS(LOW_LATENCY_DEFAULT, P4, NVENC_DEPRECATED_PRESET | NVENC_LOWLATENCY), |
|
|
|
|
PRESET_ALIAS(LOW_LATENCY_HP, P1, NVENC_DEPRECATED_PRESET | NVENC_LOWLATENCY), |
|
|
|
|
PRESET_ALIAS(LOW_LATENCY_HQ, P7, NVENC_DEPRECATED_PRESET | NVENC_LOWLATENCY), |
|
|
|
|
PRESET_ALIAS(LOSSLESS_DEFAULT, P4, NVENC_DEPRECATED_PRESET | NVENC_LOSSLESS), |
|
|
|
|
PRESET_ALIAS(LOSSLESS_HP, P1, NVENC_DEPRECATED_PRESET | NVENC_LOSSLESS), |
|
|
|
|
#else |
|
|
|
|
PRESET(DEFAULT), |
|
|
|
|
PRESET(HP), |
|
|
|
|
PRESET(HQ), |
|
|
|
@ -669,14 +691,6 @@ static void nvenc_map_preset(NvencContext *ctx) |
|
|
|
|
PRESET(LOW_LATENCY_HQ, NVENC_LOWLATENCY), |
|
|
|
|
PRESET(LOSSLESS_DEFAULT, NVENC_LOSSLESS), |
|
|
|
|
PRESET(LOSSLESS_HP, NVENC_LOSSLESS), |
|
|
|
|
#ifdef NVENC_HAVE_NEW_PRESETS |
|
|
|
|
PRESET(P1), |
|
|
|
|
PRESET(P2), |
|
|
|
|
PRESET(P3), |
|
|
|
|
PRESET(P4), |
|
|
|
|
PRESET(P5), |
|
|
|
|
PRESET(P6), |
|
|
|
|
PRESET(P7), |
|
|
|
|
#endif |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -1238,6 +1252,9 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx) |
|
|
|
|
|
|
|
|
|
nvenc_map_preset(ctx); |
|
|
|
|
|
|
|
|
|
if (ctx->flags & NVENC_DEPRECATED_PRESET) |
|
|
|
|
av_log(avctx, AV_LOG_WARNING, "The selected preset is deprecated. Use p1 to p7 + -tune or fast/medium/slow.\n"); |
|
|
|
|
|
|
|
|
|
preset_config.version = NV_ENC_PRESET_CONFIG_VER; |
|
|
|
|
preset_config.presetCfg.version = NV_ENC_CONFIG_VER; |
|
|
|
|
|
|
|
|
|