summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.h
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2018-04-13 09:36:49 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2018-04-13 11:19:43 +0200
commit9f3902f107343f2690dce7ac7fef7c66887692b1 (patch)
treebdca818f2528af84e0cb75911c2b811ae192544a /libavcodec/nvenc.h
parent987026adda79be4bbc541e12c5c6796b43f84bc1 (diff)
avcodec/nv{enc,dec}: use sane version checking macro
For some odd reason, the Nvidia version macros puts the minor version in the msb, so comparing against it is impossible.
Diffstat (limited to 'libavcodec/nvenc.h')
-rw-r--r--libavcodec/nvenc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 2d6e781739..c7506d6a15 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -40,8 +40,11 @@ typedef void ID3D11Device;
#define RC_MODE_DEPRECATED 0x800000
#define RCD(rc_mode) ((rc_mode) | RC_MODE_DEPRECATED)
+#define NVENCAPI_CHECK_VERSION(major, minor) \
+ ((major) < NVENCAPI_MAJOR_VERSION || ((major) == NVENCAPI_MAJOR_VERSION && (minor) <= NVENCAPI_MINOR_VERSION))
+
// SDK 8.1 compile time feature checks
-#if NVENCAPI_VERSION >= 0x01000008
+#if NVENCAPI_CHECK_VERSION(8, 1)
#define NVENC_HAVE_BFRAME_REF_MODE
#define NVENC_HAVE_QP_MAP_MODE
#endif