Skip to content

Commit 3d242a6

Browse files
authored
Merge pull request #3513 from cudawarped:fix_cudacodec_cudart_defines
`cudacodec::VideoReader` - fix CUDART_VERSION tests
2 parents 9c10a6d + cc5c276 commit 3d242a6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/cudacodec/src/video_decoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ void cv::cudacodec::detail::VideoDecoder::create(const FormatInfo& videoFormat)
9797
cudaVideoCodec_UYVY == _codec;
9898

9999
#if defined (HAVE_CUDA)
100-
#if (CUDART_VERSION >= 6500)
100+
#if (CUDART_VERSION >= 6050)
101101
codecSupported |= cudaVideoCodec_HEVC == _codec;
102102
#endif
103-
#if ((CUDART_VERSION == 7500) || (CUDART_VERSION >= 9000))
103+
#if ((CUDART_VERSION == 7050) || (CUDART_VERSION >= 9000))
104104
codecSupported |= cudaVideoCodec_VP8 == _codec ||
105105
cudaVideoCodec_VP9 == _codec ||
106106
cudaVideoCodec_AV1 == _codec ||

modules/cudacodec/src/video_reader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ void cvtFromNv12(const GpuMat& decodedFrame, GpuMat& outFrame, int width, int he
6767
outFrame.create(height, width, CV_8UC3);
6868
Npp8u* pSrc[2] = { decodedFrame.data, &decodedFrame.data[decodedFrame.step * height] };
6969
NppiSize oSizeROI = { width,height };
70-
#if (CUDART_VERSION < 10100)
70+
#if (CUDART_VERSION < 10010)
7171
cv::cuda::NppStreamHandler h(stream);
7272
if (videoFullRangeFlag)
7373
nppSafeCall(nppiNV12ToBGR_709HDTV_8u_P2C3R(pSrc, decodedFrame.step, outFrame.data, outFrame.step, oSizeROI));
7474
else {
7575
nppSafeCall(nppiNV12ToBGR_8u_P2C3R(pSrc, decodedFrame.step, outFrame.data, outFrame.step, oSizeROI));
7676
}
77-
#elif (CUDART_VERSION >= 10100)
77+
#elif (CUDART_VERSION >= 10010)
7878
NppStreamContext nppStreamCtx;
7979
nppSafeCall(nppGetStreamContext(&nppStreamCtx));
8080
nppStreamCtx.hStream = StreamAccessor::getStream(stream);
@@ -316,7 +316,7 @@ namespace
316316
bool VideoReaderImpl::set(const ColorFormat colorFormat_) {
317317
if (!ValidColorFormat(colorFormat_)) return false;
318318
if (colorFormat_ == ColorFormat::BGR) {
319-
#if (CUDART_VERSION < 9200)
319+
#if (CUDART_VERSION < 9020)
320320
CV_LOG_DEBUG(NULL, "ColorFormat::BGR is not supported until CUDA 9.2, use default ColorFormat::BGRA.");
321321
return false;
322322
#elif (CUDART_VERSION < 11000)

0 commit comments

Comments
 (0)