@@ -1011,10 +1011,6 @@ struct H264ToH265 : SetDevice
1011
1011
{
1012
1012
};
1013
1013
1014
- #if defined(WIN32) // remove when FFmpeg wrapper includes PR25874
1015
- #define WIN32_WAIT_FOR_FFMPEG_WRAPPER_UPDATE
1016
- #endif
1017
-
1018
1014
CUDA_TEST_P (H264ToH265, Transcode)
1019
1015
{
1020
1016
const std::string inputFile = std::string (cvtest::TS::ptr ()->get_data_path ()) + " ../highgui/video/big_buck_bunny.h264" ;
@@ -1054,10 +1050,8 @@ CUDA_TEST_P(H264ToH265, Transcode)
1054
1050
for (int i = 0 ; i < nFrames; ++i) {
1055
1051
cap >> frame;
1056
1052
ASSERT_FALSE (frame.empty ());
1057
- #if !defined(WIN32_WAIT_FOR_FFMPEG_WRAPPER_UPDATE)
1058
1053
const int pts = static_cast <int >(cap.get (CAP_PROP_PTS));
1059
1054
ASSERT_EQ (i, pts > 0 ? pts : 0 ); // FFmpeg back end returns dts if pts is zero.
1060
- #endif
1061
1055
}
1062
1056
}
1063
1057
ASSERT_EQ (0 , remove (outputFile.c_str ()));
@@ -1066,7 +1060,7 @@ CUDA_TEST_P(H264ToH265, Transcode)
1066
1060
INSTANTIATE_TEST_CASE_P (CUDA_Codec, H264ToH265, ALL_DEVICES);
1067
1061
1068
1062
CV_ENUM (YuvColorFormats, cudacodec::ColorFormat::NV_YUV444, cudacodec::ColorFormat::NV_YUV420_10BIT, cudacodec::ColorFormat::NV_YUV444_10BIT)
1069
- PARAM_TEST_CASE(YUVFormats, cv::cuda::DeviceInfo, YuvColorFormats)
1063
+ PARAM_TEST_CASE(YUVFormats, cv::cuda::DeviceInfo, YuvColorFormats, bool )
1070
1064
{
1071
1065
};
1072
1066
@@ -1075,6 +1069,7 @@ CUDA_TEST_P(YUVFormats, Transcode)
1075
1069
cv::cuda::setDevice (GET_PARAM (0 ).deviceID ());
1076
1070
const std::string inputFile = std::string (cvtest::TS::ptr ()->get_data_path ()) + " ../highgui/video/big_buck_bunny.h265" ;
1077
1071
const cv::cudacodec::ColorFormat writerColorFormat = static_cast <cudacodec::ColorFormat>(static_cast <int >(GET_PARAM (1 )));
1072
+ const bool fullRange = GET_PARAM (2 );
1078
1073
constexpr double fps = 25 ;
1079
1074
const cudacodec::Codec codec = cudacodec::Codec::HEVC;
1080
1075
const std::string ext = " .mp4" ;
@@ -1088,6 +1083,7 @@ CUDA_TEST_P(YUVFormats, Transcode)
1088
1083
cv::cudacodec::EncoderParams params;
1089
1084
params.tuningInfo = cv::cudacodec::EncodeTuningInfo::ENC_TUNING_INFO_LOSSLESS;
1090
1085
params.rateControlMode = cv::cudacodec::EncodeParamsRcMode::ENC_PARAMS_RC_CONSTQP;
1086
+ params.videoFullRangeFlag = fullRange;
1091
1087
for (int i = 0 ; i < nFrames; ++i) {
1092
1088
ASSERT_TRUE (cap.read (frame));
1093
1089
ASSERT_FALSE (frame.empty ());
@@ -1101,7 +1097,7 @@ CUDA_TEST_P(YUVFormats, Transcode)
1101
1097
yuvFormat = cudacodec::SurfaceFormat::SF_P016;
1102
1098
bitDepth = cudacodec::BitDepth::SIXTEEN;
1103
1099
}
1104
- generateTestImages (frame, yuv, bgr, yuvFormat, cudacodec::ColorFormat::BGR, bitDepth, false );
1100
+ generateTestImages (frame, yuv, bgr, yuvFormat, cudacodec::ColorFormat::BGR, bitDepth, false , fullRange );
1105
1101
bgrGs.push_back (bgr.clone ());
1106
1102
if (writer.empty ())
1107
1103
writer = cv::cudacodec::createVideoWriter (outputFile, frame.size (), codec, fps, writerColorFormat, params);
@@ -1125,7 +1121,7 @@ CUDA_TEST_P(YUVFormats, Transcode)
1125
1121
ASSERT_EQ (0 , remove (outputFile.c_str ()));
1126
1122
}
1127
1123
1128
- INSTANTIATE_TEST_CASE_P (CUDA_Codec, YUVFormats, testing::Combine(ALL_DEVICES, YuvColorFormats::all()));
1124
+ INSTANTIATE_TEST_CASE_P (CUDA_Codec, YUVFormats, testing::Combine(ALL_DEVICES, YuvColorFormats::all(), testing::Bool() ));
1129
1125
#endif
1130
1126
1131
1127
#if defined(HAVE_NVCUVENC)
@@ -1201,10 +1197,8 @@ CUDA_TEST_P(Write, Writer)
1201
1197
for (int i = 0 ; i < nFrames; ++i) {
1202
1198
cap >> frame;
1203
1199
ASSERT_FALSE (frame.empty ());
1204
- #if !defined(WIN32_WAIT_FOR_FFMPEG_WRAPPER_UPDATE)
1205
1200
const int pts = static_cast <int >(cap.get (CAP_PROP_PTS));
1206
1201
ASSERT_EQ (i, pts > 0 ? pts : 0 ); // FFmpeg back end returns dts if pts is zero.
1207
- #endif
1208
1202
}
1209
1203
}
1210
1204
ASSERT_EQ (0 , remove (outputFile.c_str ()));
@@ -1299,10 +1293,8 @@ CUDA_TEST_P(EncoderParams, Writer)
1299
1293
const bool keyFrameActual = capRaw.get (CAP_PROP_LRF_HAS_KEY_FRAME) == 1.0 ;
1300
1294
const bool keyFrameReference = i % idrPeriod == 0 ;
1301
1295
ASSERT_EQ (keyFrameActual, keyFrameReference);
1302
- #if !defined(WIN32_WAIT_FOR_FFMPEG_WRAPPER_UPDATE)
1303
1296
const int pts = static_cast <int >(cap.get (CAP_PROP_PTS));
1304
1297
ASSERT_EQ (i, pts > 0 ? pts : 0 ); // FFmpeg back end returns dts if pts is zero.
1305
- #endif
1306
1298
}
1307
1299
}
1308
1300
}
0 commit comments