Merge pull request #13379 from savuor:color_5x5

RGB to/from Gray rewritten to wide intrinsics (#13379)

* 5x5 to RGB added

* RGB25x5 added

* Gray2RGB added

* Gray2RGB5x5 added

* vx_set moved out of loops

* RGB5x52Gray added

* RGB2Gray written

* warnings fixed (int -> (u)short conversion)

* warning fixed

* warning fixed

* "i < n-vsize+1" to "i <= n-vsize"

* RGBA2mRGBA vectorized

* try to fix ARM builds

* fixed ARM build for RGB2RGB5x5

* mRGBA2RGBA: saturation, vectorization

* fixed CL implementation of mRGBA2RGBA (saturation added)
pull/13443/head
Rostislav Vasilikhin 6 years ago committed by Alexander Alekhin
parent 82a02d8585
commit d99a4af229
  1. 1291
      modules/imgproc/src/color_rgb.cpp
  2. 7
      modules/imgproc/src/opencl/color_rgb.cl

File diff suppressed because it is too large Load Diff

@ -439,9 +439,10 @@ __kernel void mRGBA2RGBA(__global const uchar* src, int src_step, int src_offset
*(__global uchar4 *)(dst + dst_index) = (uchar4)(0, 0, 0, 0);
else
*(__global uchar4 *)(dst + dst_index) =
(uchar4)(mad24(src_pix.x, MAX_NUM, v3_half) / v3,
mad24(src_pix.y, MAX_NUM, v3_half) / v3,
mad24(src_pix.z, MAX_NUM, v3_half) / v3, v3);
(uchar4)(SAT_CAST(mad24(src_pix.x, MAX_NUM, v3_half) / v3),
SAT_CAST(mad24(src_pix.y, MAX_NUM, v3_half) / v3),
SAT_CAST(mad24(src_pix.z, MAX_NUM, v3_half) / v3),
SAT_CAST(v3));
++y;
dst_index += dst_step;

Loading…
Cancel
Save