diff --git a/modules/core/src/opencl/arithm.cl b/modules/core/src/opencl/arithm.cl index c8fd99eef..5b7373553 100644 --- a/modules/core/src/opencl/arithm.cl +++ b/modules/core/src/opencl/arithm.cl @@ -196,12 +196,12 @@ #elif defined OP_PHASE_RADIANS #define PROCESS_ELEM \ workT tmp = atan2(srcelem2, srcelem1); \ - if(tmp < 0) tmp += 6.283185307179586232; \ + if(tmp < 0) tmp += 6.283185307179586232f; \ dstelem = tmp #elif defined OP_PHASE_DEGREES #define PROCESS_ELEM \ - workT tmp = atan2(srcelem2, srcelem1)*57.29577951308232286465; \ + workT tmp = atan2(srcelem2, srcelem1)*57.29577951308232286465f; \ if(tmp < 0) tmp += 360; \ dstelem = tmp @@ -223,7 +223,6 @@ dstelem = v > (dstT)(0) ? log(v) : log(-v) #define dstT uchar #define srcT2 srcT1 #define convertToWT1 -#define convertToWT2 #define PROCESS_ELEM dstelem = convert_uchar(srcelem1 CMP_OPERATOR srcelem2 ? 255 : 0) #elif defined OP_CONVERT_SCALE_ABS @@ -313,7 +312,9 @@ __kernel void KF(__global const uchar* srcptr1, int srcstep1, int srcoffset1, if (x < cols && y < rows) { int src1_index = mad24(y, srcstep1, x*(int)sizeof(srcT1) + srcoffset1); +#if !(defined(OP_RECIP_SCALE) || defined(OP_NOT)) int src2_index = mad24(y, srcstep2, x*(int)sizeof(srcT2) + srcoffset2); +#endif int dst_index = mad24(y, dststep, x*(int)sizeof(dstT) + dstoffset); EXTRA_INDEX; diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index 70ad0827c..53859dd07 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -2996,7 +2996,7 @@ static bool ocl_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) } else k.create(kernelName.c_str(), ocl::imgproc::cvtcolor_oclsrc, - format("-D depth=%d -D hscale=%f -D bidx=%d -D scn=%d -D dcn=3", depth, hrange*(1.f/360.f), bidx, scn)); + format("-D depth=%d -D hscale=%ff -D bidx=%d -D scn=%d -D dcn=3", depth, hrange*(1.f/360.f), bidx, scn)); break; } case COLOR_HSV2BGR: case COLOR_HSV2RGB: case COLOR_HSV2BGR_FULL: case COLOR_HSV2RGB_FULL: @@ -3014,7 +3014,7 @@ static bool ocl_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) String kernelName = String(is_hsv ? "HSV" : "HLS") + "2RGB"; k.create(kernelName.c_str(), ocl::imgproc::cvtcolor_oclsrc, - format("-D depth=%d -D dcn=%d -D scn=3 -D bidx=%d -D hrange=%d -D hscale=%f", + format("-D depth=%d -D dcn=%d -D scn=3 -D bidx=%d -D hrange=%d -D hscale=%ff", depth, dcn, bidx, hrange, 6.f/hrange)); break; } diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index a69ba8a2a..e9fd60d5d 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -2004,7 +2004,7 @@ static bool ocl_resize( InputArray _src, OutputArray _dst, Size dsize, { int wdepth2 = std::max(CV_32F, depth), wtype2 = CV_MAKE_TYPE(wdepth2, cn); buildOption = buildOption + format(" -D convertToT=%s -D WT2V=%s -D convertToWT2V=%s -D INTER_AREA_FAST" - " -D XSCALE=%d -D YSCALE=%d -D SCALE=%f", + " -D XSCALE=%d -D YSCALE=%d -D SCALE=%ff", ocl::convertTypeStr(wdepth2, depth, cn, cvt[0]), ocl::typeToStr(wtype2), ocl::convertTypeStr(wdepth, wdepth2, cn, cvt[1]), iscale_x, iscale_y, 1.0f / (iscale_x * iscale_y)); diff --git a/modules/imgproc/src/opencl/cvtcolor.cl b/modules/imgproc/src/opencl/cvtcolor.cl index ad7562f3d..1779c4fa7 100644 --- a/modules/imgproc/src/opencl/cvtcolor.cl +++ b/modules/imgproc/src/opencl/cvtcolor.cl @@ -472,7 +472,7 @@ __kernel void RGB(__global const uchar* srcptr, int src_step, int src_offset, dst[0] = src[2]; dst[1] = src[1]; dst[2] = src[0]; -#elif defined ORDER +#else dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; @@ -728,7 +728,7 @@ __kernel void RGB2HSV(__global const uchar* srcptr, int src_step, int src_offset diff = v - vmin; s = diff/(float)(fabs(v) + FLT_EPSILON); - diff = (float)(60./(diff + FLT_EPSILON)); + diff = (float)(60.f/(diff + FLT_EPSILON)); if( v == r ) h = (g - b)*diff; else if( v == g ) diff --git a/modules/imgproc/src/opencl/filterSepCol.cl b/modules/imgproc/src/opencl/filterSepCol.cl index c990a6ca1..e99fa6ee0 100644 --- a/modules/imgproc/src/opencl/filterSepCol.cl +++ b/modules/imgproc/src/opencl/filterSepCol.cl @@ -71,7 +71,7 @@ __kernel __attribute__((reqd_work_group_size(LSIZE0,LSIZE1,1))) void col_filter const int dst_step_in_pixel, const int dst_cols, const int dst_rows, - __constant float * mat_kernel __attribute__((max_constant_size(4*(2*RADIUSY+1))))) + __constant float * mat_kernel) { int x = get_global_id(0); int y = get_global_id(1); diff --git a/modules/imgproc/src/opencl/filterSepRow.cl b/modules/imgproc/src/opencl/filterSepRow.cl index f276d0840..dfbf30099 100644 --- a/modules/imgproc/src/opencl/filterSepRow.cl +++ b/modules/imgproc/src/opencl/filterSepRow.cl @@ -154,7 +154,7 @@ __kernel __attribute__((reqd_work_group_size(LSIZE0,LSIZE1,1))) void row_filter_ int dst_step_in_pixel, int dst_cols, int dst_rows, int radiusy, - __constant float * mat_kernel __attribute__((max_constant_size(4*(2*RADIUSX+1))))) + __constant float * mat_kernel) { int x = get_global_id(0)<<2; int y = get_global_id(1); @@ -298,7 +298,7 @@ __kernel __attribute__((reqd_work_group_size(LSIZE0,LSIZE1,1))) void row_filter_ int dst_step_in_pixel, int dst_cols, int dst_rows, int radiusy, - __constant float * mat_kernel __attribute__((max_constant_size(4*(2*RADIUSX+1))))) + __constant float * mat_kernel) { int x = get_global_id(0); int y = get_global_id(1); @@ -392,7 +392,7 @@ __kernel __attribute__((reqd_work_group_size(LSIZE0,LSIZE1,1))) void row_filter_ int dst_step_in_pixel, int dst_cols, int dst_rows, int radiusy, - __constant float * mat_kernel __attribute__((max_constant_size(4*(2*RADIUSX+1))))) + __constant float * mat_kernel) { int x = get_global_id(0); int y = get_global_id(1); @@ -485,7 +485,7 @@ __kernel __attribute__((reqd_work_group_size(LSIZE0,LSIZE1,1))) void row_filter_ int dst_step_in_pixel, int dst_cols, int dst_rows, int radiusy, - __constant float * mat_kernel __attribute__((max_constant_size(4*(2*RADIUSX+1))))) + __constant float * mat_kernel) { int x = get_global_id(0); int y = get_global_id(1); diff --git a/modules/imgproc/src/opencl/resize.cl b/modules/imgproc/src/opencl/resize.cl index ecab2faa5..d4f238358 100644 --- a/modules/imgproc/src/opencl/resize.cl +++ b/modules/imgproc/src/opencl/resize.cl @@ -78,7 +78,6 @@ __kernel void resizeLN(__global const uchar* srcptr, int srcstep, int srcoffset, int y_ = INC(y,srcrows); int x_ = INC(x,srccols); - __global const PIXTYPE* src = (__global const PIXTYPE*)(srcptr + mad24(y, srcstep, srcoffset + x*PIXSIZE)); #if depth <= 4