summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
authorYogender Gupta <ygupta@nvidia.com>2016-09-24 17:54:58 +0200
committerLuca Barbato <lu_zero@gentoo.org>2016-09-24 18:08:54 +0200
commite02e2515b24bfc37ede6ca1744696230be55e50b (patch)
tree0fd5a51c6e88f213466b5c63eef7bf908f2fb997 /libavcodec/nvenc.c
parent352741b5ead1543d775ccf6040f33023e4491186 (diff)
nvenc: Add some easier to understand presets that match x264 terminology
Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Signed-off-by: Diego Biurrun <diego@biurrun.de> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 6db5b0d896..7f8737e0bf 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -459,8 +459,10 @@ typedef struct GUIDTuple {
int flags;
} GUIDTuple;
-#define PRESET(name, ...) \
- [PRESET_ ## name] = { NV_ENC_PRESET_ ## name ## _GUID, __VA_ARGS__ }
+#define PRESET_ALIAS(alias, name, ...) \
+ [PRESET_ ## alias] = { NV_ENC_PRESET_ ## name ## _GUID, __VA_ARGS__ }
+
+#define PRESET(name, ...) PRESET_ALIAS(name, name, __VA_ARGS__)
static int nvec_map_preset(NVENCContext *ctx)
{
@@ -474,6 +476,9 @@ static int nvec_map_preset(NVENCContext *ctx)
PRESET(LOW_LATENCY_HQ, NVENC_LOWLATENCY),
PRESET(LOSSLESS_DEFAULT, NVENC_LOSSLESS),
PRESET(LOSSLESS_HP, NVENC_LOSSLESS),
+ PRESET_ALIAS(SLOW, HQ, NVENC_TWO_PASSES),
+ PRESET_ALIAS(MEDIUM, HQ, NVENC_ONE_PASS),
+ PRESET_ALIAS(FAST, HP, NVENC_ONE_PASS),
{ { 0 } }
};
@@ -486,6 +491,7 @@ static int nvec_map_preset(NVENCContext *ctx)
}
#undef PRESET
+#undef PRESET_ALIAS
static void set_constqp(AVCodecContext *avctx, NV_ENC_RC_PARAMS *rc)
{