avcodec/nvenc: use alias to provide deprecated profiles
This commit is contained in:
@ -657,6 +657,28 @@ typedef struct GUIDTuple {
|
|||||||
static void nvenc_map_preset(NvencContext *ctx)
|
static void nvenc_map_preset(NvencContext *ctx)
|
||||||
{
|
{
|
||||||
GUIDTuple presets[] = {
|
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(DEFAULT),
|
||||||
PRESET(HP),
|
PRESET(HP),
|
||||||
PRESET(HQ),
|
PRESET(HQ),
|
||||||
@ -669,14 +691,6 @@ static void nvenc_map_preset(NvencContext *ctx)
|
|||||||
PRESET(LOW_LATENCY_HQ, NVENC_LOWLATENCY),
|
PRESET(LOW_LATENCY_HQ, NVENC_LOWLATENCY),
|
||||||
PRESET(LOSSLESS_DEFAULT, NVENC_LOSSLESS),
|
PRESET(LOSSLESS_DEFAULT, NVENC_LOSSLESS),
|
||||||
PRESET(LOSSLESS_HP, 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
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1238,6 +1252,9 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
|
|||||||
|
|
||||||
nvenc_map_preset(ctx);
|
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.version = NV_ENC_PRESET_CONFIG_VER;
|
||||||
preset_config.presetCfg.version = NV_ENC_CONFIG_VER;
|
preset_config.presetCfg.version = NV_ENC_CONFIG_VER;
|
||||||
|
|
||||||
|
@ -135,6 +135,8 @@ enum {
|
|||||||
NVENC_LOSSLESS = 2,
|
NVENC_LOSSLESS = 2,
|
||||||
NVENC_ONE_PASS = 4,
|
NVENC_ONE_PASS = 4,
|
||||||
NVENC_TWO_PASSES = 8,
|
NVENC_TWO_PASSES = 8,
|
||||||
|
|
||||||
|
NVENC_DEPRECATED_PRESET = 0x8000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
Reference in New Issue
Block a user