gpucodec module for video decoding/encoding
This commit is contained in:
		| @@ -1005,103 +1005,3 @@ PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG, | ||||
| } | ||||
|  | ||||
| #endif | ||||
|  | ||||
| ////////////////////////////////////////////////////// | ||||
| // VideoReader | ||||
|  | ||||
| #if defined(HAVE_NVCUVID) && BUILD_WITH_VIDEO_INPUT_SUPPORT | ||||
|  | ||||
| PERF_TEST_P(Video, DISABLED_Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi")) | ||||
| { | ||||
|     declare.time(20); | ||||
|  | ||||
|     const string inputFile = perf::TestBase::getDataPath(GetParam()); | ||||
|  | ||||
|     if (PERF_RUN_GPU()) | ||||
|     { | ||||
|         cv::gpu::VideoReader_GPU d_reader(inputFile); | ||||
|         ASSERT_TRUE( d_reader.isOpened() ); | ||||
|  | ||||
|         cv::gpu::GpuMat frame; | ||||
|  | ||||
|         TEST_CYCLE_N(10) d_reader.read(frame); | ||||
|  | ||||
|         GPU_SANITY_CHECK(frame); | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         cv::VideoCapture reader(inputFile); | ||||
|         ASSERT_TRUE( reader.isOpened() ); | ||||
|  | ||||
|         cv::Mat frame; | ||||
|  | ||||
|         TEST_CYCLE_N(10) reader >> frame; | ||||
|  | ||||
|         CPU_SANITY_CHECK(frame); | ||||
|     } | ||||
| } | ||||
|  | ||||
| #endif | ||||
|  | ||||
| ////////////////////////////////////////////////////// | ||||
| // VideoWriter | ||||
|  | ||||
| #if defined(HAVE_NVCUVID) && defined(WIN32) | ||||
|  | ||||
| PERF_TEST_P(Video, DISABLED_Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi")) | ||||
| { | ||||
|     declare.time(30); | ||||
|  | ||||
|     const string inputFile = perf::TestBase::getDataPath(GetParam()); | ||||
|     const string outputFile = cv::tempfile(".avi"); | ||||
|  | ||||
|     const double FPS = 25.0; | ||||
|  | ||||
|     cv::VideoCapture reader(inputFile); | ||||
|     ASSERT_TRUE( reader.isOpened() ); | ||||
|  | ||||
|     cv::Mat frame; | ||||
|  | ||||
|     if (PERF_RUN_GPU()) | ||||
|     { | ||||
|         cv::gpu::VideoWriter_GPU d_writer; | ||||
|  | ||||
|         cv::gpu::GpuMat d_frame; | ||||
|  | ||||
|         for (int i = 0; i < 10; ++i) | ||||
|         { | ||||
|             reader >> frame; | ||||
|             ASSERT_FALSE(frame.empty()); | ||||
|  | ||||
|             d_frame.upload(frame); | ||||
|  | ||||
|             if (!d_writer.isOpened()) | ||||
|                 d_writer.open(outputFile, frame.size(), FPS); | ||||
|  | ||||
|             startTimer(); next(); | ||||
|             d_writer.write(d_frame); | ||||
|             stopTimer(); | ||||
|         } | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         cv::VideoWriter writer; | ||||
|  | ||||
|         for (int i = 0; i < 10; ++i) | ||||
|         { | ||||
|             reader >> frame; | ||||
|             ASSERT_FALSE(frame.empty()); | ||||
|  | ||||
|             if (!writer.isOpened()) | ||||
|                 writer.open(outputFile, CV_FOURCC('X', 'V', 'I', 'D'), FPS, frame.size()); | ||||
|  | ||||
|             startTimer(); next(); | ||||
|             writer.write(frame); | ||||
|             stopTimer(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     SANITY_CHECK(frame); | ||||
| } | ||||
|  | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Vladislav Vinogradov
					Vladislav Vinogradov