mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #21049 from sivanov-work:vpl_dx11_merge
G-API: oneVPL merge DX11 acceleration * Merge DX11 initial * Fold conditions row in MACRO in utils * Inject DeviceSelector * Turn on DeviceSelector in DX11 * Change sharedLock logic & Move FMT checking in FrameAdapter c-tor * Move out NumSuggestFrame to configure params * Drain file source fix * Fix compilation * Force zero initializetion of SharedLock * Fix some compiler warnings * Fix integer comparison warnings * Fix integers in sample * Integrate Demux * Fix compilation * Add predefined names for some CfgParam * Trigger CI * Fix MultithreadCtx bug, Add Dx11 GetBlobParam(), Get rif of ATL CComPtr * Fix UT: remove unit test with deprecated video from opencv_extra * Add creators for most usable CfgParam * Eliminate some warnings * Fix warning in GAPI_Assert * Apply comments * Add VPL wrapped header with MSVC pragma to get rid of global warning masking
This commit is contained in:
@@ -18,16 +18,19 @@ using namespace perf;
|
||||
const std::string files[] = {
|
||||
"highgui/video/big_buck_bunny.h265",
|
||||
"highgui/video/big_buck_bunny.h264",
|
||||
"highgui/video/sample_322x242_15frames.yuv420p.libx265.mp4",
|
||||
};
|
||||
|
||||
const std::string codec[] = {
|
||||
"MFX_CODEC_HEVC",
|
||||
"MFX_CODEC_AVC"
|
||||
"MFX_CODEC_AVC",
|
||||
"",
|
||||
};
|
||||
|
||||
using source_t = std::string;
|
||||
using codec_t = std::string;
|
||||
using source_description_t = std::tuple<source_t, codec_t>;
|
||||
using accel_mode_t = std::string;
|
||||
using source_description_t = std::tuple<source_t, codec_t, accel_mode_t>;
|
||||
|
||||
class OneVPLSourcePerfTest : public TestPerfParams<source_description_t> {};
|
||||
class VideoCapSourcePerfTest : public TestPerfParams<source_t> {};
|
||||
@@ -39,12 +42,20 @@ PERF_TEST_P_(OneVPLSourcePerfTest, TestPerformance)
|
||||
const auto params = GetParam();
|
||||
source_t src = findDataFile(get<0>(params));
|
||||
codec_t type = get<1>(params);
|
||||
accel_mode_t mode = get<2>(params);
|
||||
|
||||
std::vector<CfgParam> cfg_params {
|
||||
CfgParam::create<std::string>("mfxImplDescription.Impl", "MFX_IMPL_TYPE_HARDWARE"),
|
||||
CfgParam::create("mfxImplDescription.mfxDecoderDescription.decoder.CodecID", type),
|
||||
CfgParam::create_implementation("MFX_IMPL_TYPE_HARDWARE"),
|
||||
};
|
||||
|
||||
if (!type.empty()) {
|
||||
cfg_params.push_back(CfgParam::create_decoder_id(type.c_str()));
|
||||
}
|
||||
|
||||
if (!mode.empty()) {
|
||||
cfg_params.push_back(CfgParam::create_acceleration_mode(mode.c_str()));
|
||||
}
|
||||
|
||||
auto source_ptr = cv::gapi::wip::make_onevpl_src(src, cfg_params);
|
||||
|
||||
cv::gapi::wip::Data out;
|
||||
@@ -72,12 +83,17 @@ PERF_TEST_P_(VideoCapSourcePerfTest, TestPerformance)
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Streaming, OneVPLSourcePerfTest,
|
||||
Values(source_description_t(files[0], codec[0]),
|
||||
source_description_t(files[1], codec[1])));
|
||||
Values(source_description_t(files[0], codec[0], ""),
|
||||
source_description_t(files[0], codec[0], "MFX_ACCEL_MODE_VIA_D3D11"),
|
||||
source_description_t(files[1], codec[1], ""),
|
||||
source_description_t(files[1], codec[1], "MFX_ACCEL_MODE_VIA_D3D11"),
|
||||
source_description_t(files[2], codec[2], ""),
|
||||
source_description_t(files[2], codec[2], "MFX_ACCEL_MODE_VIA_D3D11")));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Streaming, VideoCapSourcePerfTest,
|
||||
Values(files[0],
|
||||
files[1]));
|
||||
files[1],
|
||||
files[2]));
|
||||
} // namespace opencv_test
|
||||
|
||||
#endif // HAVE_ONEVPL
|
||||
|
||||
Reference in New Issue
Block a user