Merge pull request #13174 from elatkin:el/gapi_perf_rgb2yuv

GAPI (fluid): RGB to YUV optimization (#13174)

* GAPI (fluid): RGB to YUV: activate performance tests

* GAPI (fluid): speedup 4-8x RGB-to-YUV, 2.5x YUV to RGB with int16 arithmetic

* GAPI (fluid): RGB <--> YUV: fixed compiler warning

* GAPI (fluid): RGB <--> YUV: additional speedup 2-3x times (10-15x over original) via manual CV_SIMD

* GAPI (fluid): RGB <--> YUV: dynamic CV_SIMD dispatching
This commit is contained in:
Evgeny Latkin
2018-11-19 17:30:14 +03:00
committed by Alexander Alekhin
parent 59e2ca16d9
commit 6757c2c5a6
6 changed files with 219 additions and 30 deletions
@@ -678,7 +678,7 @@ PERF_TEST_P_(RGB2YUVPerfTest, TestPerformance)
TEST_CYCLE()
{
c.apply(in_mat1, out_mat_gapi, std::move(compile_args));
c.apply(in_mat1, out_mat_gapi);
}
// Comparison //////////////////////////////////////////////////////////////
@@ -716,7 +716,7 @@ PERF_TEST_P_(YUV2RGBPerfTest, TestPerformance)
TEST_CYCLE()
{
c.apply(in_mat1, out_mat_gapi, std::move(compile_args));
c.apply(in_mat1, out_mat_gapi);
}
// Comparison //////////////////////////////////////////////////////////////
@@ -864,7 +864,7 @@ PERF_TEST_P_(BGR2YUVPerfTest, TestPerformance)
TEST_CYCLE()
{
c.apply(in_mat1, out_mat_gapi, std::move(compile_args));
c.apply(in_mat1, out_mat_gapi);
}
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
@@ -894,7 +894,7 @@ PERF_TEST_P_(YUV2BGRPerfTest, TestPerformance)
TEST_CYCLE()
{
c.apply(in_mat1, out_mat_gapi, std::move(compile_args));
c.apply(in_mat1, out_mat_gapi);
}
EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
@@ -43,4 +43,24 @@ namespace opencv_test
Values(szVGA, sz720p, sz1080p),
Values(cv::compile_args(IMGPROC_FLUID))));
INSTANTIATE_TEST_CASE_P(RGB2YUVPerfTestFluid, RGB2YUVPerfTest,
Combine(Values(ToleranceColor(1e-3).to_compare_f()),
Values(szVGA, sz720p, sz1080p),
Values(cv::compile_args(IMGPROC_FLUID))));
INSTANTIATE_TEST_CASE_P(YUV2RGBPerfTestFluid, YUV2RGBPerfTest,
Combine(Values(ToleranceColor(1e-3).to_compare_f()),
Values(szVGA, sz720p, sz1080p),
Values(cv::compile_args(IMGPROC_FLUID))));
INSTANTIATE_TEST_CASE_P(BGR2YUVPerfTestFluid, BGR2YUVPerfTest,
Combine(Values(ToleranceColor(1e-3).to_compare_f()),
Values(szVGA, sz720p, sz1080p),
Values(cv::compile_args(IMGPROC_FLUID))));
INSTANTIATE_TEST_CASE_P(YUV2BGRPerfTestFluid, YUV2BGRPerfTest,
Combine(Values(ToleranceColor(1e-3).to_compare_f()),
Values(szVGA, sz720p, sz1080p),
Values(cv::compile_args(IMGPROC_FLUID))));
}