diff options
author | Diego de Souza <[email protected]> | 2025-01-08 13:18:54 +0100 |
---|---|---|
committer | Timo Rothenpieler <[email protected]> | 2025-02-02 20:02:08 +0100 |
commit | ed80e555860126ececb77181f0bf00fa8e699259 (patch) | |
tree | 4b5ddd8ed40bd17f9124f5b2e67fdba4f239287a | |
parent | 2cfef29f978080d6064d15f17c3b7948f025fef1 (diff) |
avcodec/nvenc: add UHQ to AV1 for NVENC
This commit adds support for Ultra High Quality mode for AV1 on
NVIDIA GPUs.
Signed-off-by: Diego de Souza <[email protected]>
Signed-off-by: Timo Rothenpieler <[email protected]>
-rw-r--r-- | libavcodec/nvenc.h | 1 | ||||
-rw-r--r-- | libavcodec/nvenc_av1.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h index 34774b6a72..2d8e8bef44 100644 --- a/libavcodec/nvenc.h +++ b/libavcodec/nvenc.h @@ -97,6 +97,7 @@ typedef void ID3D11Device; #if NVENCAPI_CHECK_VERSION(13, 0) #define NVENC_HAVE_H264_10BIT_SUPPORT #define NVENC_HAVE_422_SUPPORT +#define NVENC_HAVE_AV1_UHQ_TUNING #endif typedef struct NvencSurface diff --git a/libavcodec/nvenc_av1.c b/libavcodec/nvenc_av1.c index 79253cff66..bccc63dd5b 100644 --- a/libavcodec/nvenc_av1.c +++ b/libavcodec/nvenc_av1.c @@ -38,8 +38,11 @@ static const AVOption options[] = { { "p5", "slow (good quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P5 }, 0, 0, VE, .unit = "preset" }, { "p6", "slower (better quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P6 }, 0, 0, VE, .unit = "preset" }, { "p7", "slowest (best quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P7 }, 0, 0, VE, .unit = "preset" }, - { "tune", "Set the encoding tuning info", OFFSET(tuning_info), AV_OPT_TYPE_INT, { .i64 = NV_ENC_TUNING_INFO_HIGH_QUALITY }, NV_ENC_TUNING_INFO_HIGH_QUALITY, NV_ENC_TUNING_INFO_LOSSLESS, VE, .unit = "tune" }, + { "tune", "Set the encoding tuning info", OFFSET(tuning_info), AV_OPT_TYPE_INT, { .i64 = NV_ENC_TUNING_INFO_HIGH_QUALITY }, NV_ENC_TUNING_INFO_HIGH_QUALITY, NV_ENC_TUNING_INFO_COUNT - 1, VE, .unit = "tune" }, { "hq", "High quality", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_HIGH_QUALITY }, 0, 0, VE, .unit = "tune" }, +#ifdef NVENC_HAVE_AV1_UHQ_TUNING + { "uhq", "Ultra high quality", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_HIGH_QUALITY }, 0, 0, VE, .unit = "tune" }, +#endif { "ll", "Low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOW_LATENCY }, 0, 0, VE, .unit = "tune" }, { "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, .unit = "tune" }, { "lossless", "Lossless", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS }, 0, 0, VE, .unit = "tune" }, |