summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.h
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2021-04-18 11:17:54 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2021-04-18 11:39:45 +0200
commit988f2e9eb063db7c1a678729f58aab6eba59a55b (patch)
treeef537b2c8ef60a5389adfdfe52063e12604a32cd /libavcodec/nvenc.h
parentd43b26b30dabc6004142b86a87c1d6730735b11c (diff)
downloadffmpeg-988f2e9eb063db7c1a678729f58aab6eba59a55b.tar.gz
avcodec/nvenc: fix lossless tuning logic
Relying on the order of the enum is bad. It clashes with the new presets having to sit at the end of the list, so that they can be properly filtered out by the options parser on builds with older SDKs. So this refactors nvenc.c to instead rely on the internal NVENC_LOSSLESS flag. For this, the preset mapping has to happen much earlier, so it's moved from nvenc_setup_encoder to nvenc_setup_device and thus runs before the device capability check.
Diffstat (limited to 'libavcodec/nvenc.h')
-rw-r--r--libavcodec/nvenc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index fefc5f7f0b..314c270e74 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -103,7 +103,7 @@ enum {
PRESET_LOW_LATENCY_DEFAULT ,
PRESET_LOW_LATENCY_HQ ,
PRESET_LOW_LATENCY_HP,
- PRESET_LOSSLESS_DEFAULT, // lossless presets must be the last ones
+ PRESET_LOSSLESS_DEFAULT,
PRESET_LOSSLESS_HP,
#ifdef NVENC_HAVE_NEW_PRESETS
PRESET_P1,