Merge pull request #14106 from savuor:lab_wide

Lab, Luv and XYZ conversions rewritten to wide intrinsics (#14106)

* rgb2xyz<float> re-vectorized

* rgb2xyz_i vectorized for ushort and uchar

* xyz2rgb<float> vectorized

* xyz2rgb_i vectorized for both uchar and ushort

* intermediate conversions (int->float) rewritten

* packed rgb2luv rewritten

* (some) float conversions rewritten

* burnt volatile int _3 and similar

* RGB2Lab_b rewritten

* tests: logging made better

* RGB2Lab_f (LRGB path) rewritten

* Lab2RGBfloat rewritten

* Lab2RGBinteger and Lab2RGB_b rewritten to wide universal intrinsics

* Luv2RGBinteger wide vectorized

* RGB2Lab_b fixed: v_sub_wrap instead of saturated sub

* warnings fixed

* trying to fix compilation on older compilers

* using 16x8 registers for 8-element dot product

* cleanup added

* splineInterpolate: loop unrolled, perf fix for f32x4

* Lab2RGBfloat: grab 2x more data to process on f32x4

* nrepeats for Luv2RGBfloat, +20% perf

* minor

* nrepeats to RGB2Lab_f

* Lab2RGBinteger: no tab for linear BGR

* nrepeats for RGB2Luvfloat

* Luv2RGBinteger: no tab for linear RGB

* +10% more to perf of Luv2RGBfloat

* nrepeats for 256-simd for Lab2RGBfloat

* less warnings

* BOM removed

* CV_SIMD_WIDTH used for lanes number checking

* trilinearPackedInterpolate: 128-bit specialization added

* fix build; no vx_cleanup(), instrumentation instead
pull/14591/head
Rostislav Vasilikhin 6 years ago committed by Alexander Alekhin
parent bc4b2d521c
commit e90e0ef9aa
  1. 3660
      modules/imgproc/src/color_lab.cpp
  2. 12
      modules/imgproc/test/test_color.cpp

File diff suppressed because it is too large Load Diff

@ -2687,9 +2687,9 @@ TEST(Imgproc_ColorLab_Full, bitExactness)
<< "Iteration: " << iter << endl
<< "Hash vs Correct hash: " << h << ", " << goodHash << endl
<< "Error in: (" << x << ", " << y << ")" << endl
<< "Reference value: " << gx[0] << " " << gx[1] << " " << gx[2] << endl
<< "Actual value: " << rx[0] << " " << rx[1] << " " << rx[2] << endl
<< "Src value: " << px[0] << " " << px[1] << " " << px[2] << endl
<< "Reference value: " << int(gx[0]) << " " << int(gx[1]) << " " << int(gx[2]) << endl
<< "Actual value: " << int(rx[0]) << " " << int(rx[1]) << " " << int(rx[2]) << endl
<< "Src value: " << int(px[0]) << " " << int(px[1]) << " " << int(px[2]) << endl
<< "Size: (" << probe.rows << ", " << probe.cols << ")" << endl;
break;
@ -2780,9 +2780,9 @@ TEST(Imgproc_ColorLuv_Full, bitExactness)
<< "Iteration: " << iter << endl
<< "Hash vs Correct hash: " << h << ", " << goodHash << endl
<< "Error in: (" << x << ", " << y << ")" << endl
<< "Reference value: " << gx[0] << " " << gx[1] << " " << gx[2] << endl
<< "Actual value: " << rx[0] << " " << rx[1] << " " << rx[2] << endl
<< "Src value: " << px[0] << " " << px[1] << " " << px[2] << endl
<< "Reference value: " << int(gx[0]) << " " << int(gx[1]) << " " << int(gx[2]) << endl
<< "Actual value: " << int(rx[0]) << " " << int(rx[1]) << " " << int(rx[2]) << endl
<< "Src value: " << int(px[0]) << " " << int(px[1]) << " " << int(px[2]) << endl
<< "Size: (" << probe.rows << ", " << probe.cols << ")" << endl;
break;

Loading…
Cancel
Save