diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2018-04-13 10:36:49 +0300 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2018-04-13 12:19:43 +0300 |
commit | 9f3902f107343f2690dce7ac7fef7c66887692b1 (patch) | |
tree | bdca818f2528af84e0cb75911c2b811ae192544a /libavcodec/nvenc.h | |
parent | 987026adda79be4bbc541e12c5c6796b43f84bc1 (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.h | 5 |
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 |