nareshmlx/opencv-pr huggingface dataset:
**File:** modules/nonfree/src/sift.cpp
**Change Type:** modified
**Context:** PR #1495: Bugfix 3282 - Fix mentioned in bug #3282: clip radius of sift descriptor to diagonal of image to overcome a autobuffer error.

**Code Changes:**
```diff
@@ -543,6 +543,8 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc
     float exp_scale = -1.f/(d * d * 0.5f);
     float hist_width = SIFT_DESCR_SCL_FCTR * scl;
     int radius = cvRound(hist_width * 1.4142135623730951f * (d + 1) * 0.5f);
+    // Clip the radius to the diagonal of the image to avoid autobuffer too large exception
+    radius = std::min(radius, (int) sqrt((double) img.cols*img.cols + img.rows*img.rows));
     cos_t /= hist_width;
     sin_t /= hist_width;
 
```

Review comment:
Use this to fix build errors: ``` radius = std::min(radius, (int) sqrt((double) img.cols*img.cols + img.rows*img.rows)); ```
**File:** modules/nonfree/src/sift.cpp
**Change Type:** modified
**Context:** PR #1495: Bugfix 3282 - Fix mentioned in bug #3282: clip radius of sift descriptor to diagonal of image to overcome a autobuffer error.

**Code Changes:**
```diff
@@ -543,6 +543,8 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc
     float exp_scale = -1.f/(d * d * 0.5f);
     float hist_width = SIFT_DESCR_SCL_FCTR * scl;
     int radius = cvRound(hist_width * 1.4142135623730951f * (d + 1) * 0.5f);
+    // Clip the radius to the diagonal of the image to avoid autobuffer too large exception
+    radius = std::min(radius, (int) sqrt((double) img.cols*img.cols + img.rows*img.rows));
     cos_t /= hist_width;
     sin_t /= hist_width;
 
```

Review comment:
I will fix this week. Have been on holiday last week...
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
please, change the signature to "CV_WRAP virtual Point calculateShift(InputArray img0, InputArray img1) = 0;"
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
use InputOutputArray or whatever instead of Mat
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
it's preferable to use OutputArrayOfArrays instead of vector<Mat>
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
use InputArray instead of vector<float>
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
should it be ExposureCalibrator? or CalibrateExposure? In the derived classes you use Calibrate... pattern, probably, you should just rename the base class to CalibrateExposure
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
The same thing about ExposureMerge - base class name is not consistent with derivatives
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
use InputArray; BTW, timestamps is a clearer name than times
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
use InputArray
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
How do I get float vector from InputArray?
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
Those are exposure time values. So I don't think it can be called timestamp.
**File:** modules/photo/include/opencv2/photo.hpp
**Change Type:** modified
**Context:** PR #1474: HDR imaging

**Code Changes:**
```diff
@@ -80,6 +80,214 @@ CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs,
                                                     float h = 3, float hColor = 3,
                                                     int templateWindowSize = 7, int searchWindowSize = 21);
 
+enum { LDR_SIZE = 256 };
+
+class CV_EXPORTS_W Tonemap : public Algorithm
+{
+public:
+    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;
```

Review comment:
Unfortunetely it didn't work the same as vector reference.
**File:** modules/core/include/opencv2/core/core.hpp
**Change Type:** modified
**Context:** PR #1468: OCL: alignSize -> roundUp - alignSize() works only with n = power of 2, but some kernels are called with local group size != 2^n
**Review Line:** 342

**Code Changes:**
```diff
@@ -339,6 +339,7 @@ template<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_
 */
 static inline size_t alignSize(size_t sz, int n)
 {
+    assert((n & (n - 1)) == 0); // n is a power of 2
     return (sz + n-1) & -n;
 }
 
```

Review comment:
please, replace it by CV_Assert
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
I recommend you replace hardcoded integer values with constants and if->if->if by switch construction. It makes code more readable. Also, why do not use the same status for error cases (1)?
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
Ok will do that! Can you just point me out which are the predefined constants? Because I have no idea what they are or where to find them.
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
And by using the same status for error cases, you are suggesting replacing the minus 1 by a positive 1?
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
I think, that there is no ready constants here. Function status was used as Boolean value before your changes. I recommend you to create new local constants. Also you can replace several error statuses pf read_frame_v4l2 function with the single one (1). In this case you do not need additional constants at all. Everything would work in the same Boolean style.
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
Hmm it seems that this is a bridge to far, since I am actually not understanding your remarks completely. Have a busy week so not sure if I will figure it out. Any help is always apreciated!
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
I think, that constants is needed here too. Also, Make it global, and uppercase.
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
Also, I recommend you make constants global and use it calling place.
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
CAM_UNPLUGGED must be here instead of hardcoded "2".
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
Correct :) Forgot to change that one :)
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...

**Code Changes:**
```diff
@@ -248,6 +248,10 @@ make & enjoy!
 #define CHANNEL_NUMBER 1
 #define MAX_CAMERAS 8
 
+// Extra global values declared for error capture
+#define CAPV4L2_CAMERA_UNPLUGGED 2
+#define CAPV4L2_OK 1
+#define CAPV4L2_FAIL 0
 
 // default and maximum number of V4L buffers, not including last, 'special' buffer
```

Review comment:
This constants are dead code now.
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...
**Review Line:** 1281

**Code Changes:**
```diff
             }
 
-            if (read_frame_v4l2 (capture))
-                break;
+            switch(int readresult = read_frame_v4l2(capture) )
+                case CAM_UNPLUGGED:
+                  return CAPV4L2_FAIL;
+                default:
+                  return CAPV4L2_OK;
         }
     }
```

Review comment:
Where is `CAM_UNPLUGGED` defined?
**File:** modules/highgui/src/cap_v4l.cpp
**Change Type:** modified
**Context:** PR #1464: Bugfix 3186 second - As mentioned in bugfix 3186 (http://code.opencv.org/issues/3186) Tried to incorporate remarks made in last pull request...
**Review Line:** 1281

**Code Changes:**
```diff
             }
 
-            if (read_frame_v4l2 (capture))
-                break;
+            switch(int readresult = read_frame_v4l2(capture) )
+                case CAM_UNPLUGGED:
+                  return CAPV4L2_FAIL;
+                default:
+                  return CAPV4L2_OK;
         }
     }
```

Review comment:
Woops, this is actually a wrong change indeed... Will prepare a fix later this week for it!
**File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #1450: Refactor vectorized arithmetical operations - This patch makes implementation of vectorized routines for another platform simpler. This is a...

**Code Changes:**
```diff
@@ -65,11 +65,22 @@ IPPArithmInitializer ippArithmInitializer;
 
 struct NOP {};
 
-template<typename T, class Op, class Op8>
-void vBinOp8(const T* src1, size_t step1, const T* src2, size_t step2, T* dst, size_t step, Size sz)
+#if CV_SSE2
+
+#define FUNCTOR_TEMPLATE(name)          \
+    template<typename T> struct name {}
```

Review comment:
It's a minor nit but... here you changed `r0` and `r1` to `r1` and `r2`, but below you've kept `v0` and `v1` as-is. Either change both or none.
**File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #1450: Refactor vectorized arithmetical operations - This patch makes implementation of vectorized routines for another platform simpler. This is a...

**Code Changes:**
```diff
@@ -65,11 +65,22 @@ IPPArithmInitializer ippArithmInitializer;
 
 struct NOP {};
 
-template<typename T, class Op, class Op8>
-void vBinOp8(const T* src1, size_t step1, const T* src2, size_t step2, T* dst, size_t step, Size sz)
+#if CV_SSE2
+
+#define FUNCTOR_TEMPLATE(name)          \
+    template<typename T> struct name {}
```

Review comment:
You shouldn't really change this... This function is still only for floating-point.
**File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #1450: Refactor vectorized arithmetical operations - This patch makes implementation of vectorized routines for another platform simpler. This is a...

**Code Changes:**
```diff
@@ -65,11 +65,22 @@ IPPArithmInitializer ippArithmInitializer;
 
 struct NOP {};
 
-template<typename T, class Op, class Op8>
-void vBinOp8(const T* src1, size_t step1, const T* src2, size_t step2, T* dst, size_t step, Size sz)
+#if CV_SSE2
+
+#define FUNCTOR_TEMPLATE(name)          \
+    template<typename T> struct name {}
```

Review comment:
Please move these to where the old functors were (to keep them closer to the non-vectorised versions).
**File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #1450: Refactor vectorized arithmetical operations - This patch makes implementation of vectorized routines for another platform simpler. This is a...
**Review Line:** 68

**Code Changes:**
```diff
 
 struct NOP {};
 
-template<typename T, class Op, class Op8>
-void vBinOp8(const T* src1, size_t step1, const T* src2, size_t step2, T* dst, size_t step, Size sz)
+#if CV_SSE2
+
+#define FUNCTOR_TEMPLATE(name)          \
+    template<typename T> struct name {}
+
+FUNCTOR_TEMPLATE(VLoadStore128);
```

Review comment:
I had to keep the VLoadStore templates here so gcc won't complain I'm using undeclared templates.
**File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #1450: Refactor vectorized arithmetical operations - This patch makes implementation of vectorized routines for another platform simpler. This is a...
**Review Line:** 199

**Code Changes:**
```diff
 
 
-template<class Op, class Op32>
-void vBinOp32f(const float* src1, size_t step1, const float* src2, size_t step2,
-               float* dst, size_t step, Size sz)
+template<typename T, class Op, class Op64>
+void vBinOp64(const T* src1, size_t step1, const T* src2, size_t step2,
+               T* dst, size_t step, Size sz)
 {
 #if CV_SSE2
-    Op32 op32;
```

Review comment:
I had to add `typename T` because otherwise gcc complains that it can't find `VLoadStore128Aligned<double>::` fields but `VLoadStore128Aligned<T>::` fields are ok.
**File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #1450: Refactor vectorized arithmetical operations - This patch makes implementation of vectorized routines for another platform simpler. This is a...
**Review Line:** 68

**Code Changes:**
```diff
 
 struct NOP {};
 
-template<typename T, class Op, class Op8>
-void vBinOp8(const T* src1, size_t step1, const T* src2, size_t step2, T* dst, size_t step, Size sz)
+#if CV_SSE2
+
+#define FUNCTOR_TEMPLATE(name)          \
+    template<typename T> struct name {}
+
+FUNCTOR_TEMPLATE(VLoadStore128);
```

Review comment:
I see. I guess this arrangement will do. Redefining `FUNCTOR_TEMPLATE` doesn't look to good, though. I think you should just define it once on top and not undefine it, ever (it's local to the file, so it's no problem).
**File:** modules/core/src/arithm.cpp
**Change Type:** modified
**Context:** PR #1450: Refactor vectorized arithmetical operations - This patch makes implementation of vectorized routines for another platform simpler. This is a...
**Review Line:** 199

**Code Changes:**
```diff
 
 
-template<class Op, class Op32>
-void vBinOp32f(const float* src1, size_t step1, const float* src2, size_t step2,
-               float* dst, size_t step, Size sz)
+template<typename T, class Op, class Op64>
+void vBinOp64(const T* src1, size_t step1, const T* src2, size_t step2,
+               T* dst, size_t step, Size sz)
 {
 #if CV_SSE2
-    Op32 op32;
```

Review comment:
OK, but then change the `double`s below to `T`, as well. I guess you can now change the name to `vBinOp64`, too.
**File:** modules/ocl/src/opencl/pyr_down.cl
**Change Type:** modified
**Context:** PR #1428: Ocl pyr - added CV_16UC(1, 3, 4), CV_16SC(1, 3, 4) data types support in ocl::pyrUp and ocl::pyrDown functions

**Code Changes:**
```diff
@@ -43,37 +43,6 @@
 //
 //M*/
 
-//#pragma OPENCL EXTENSION cl_amd_printf : enable
-
-
-uchar round_uchar_int(int v)
-{
-    return (uchar)((uint)v <= 255 ? v : v > 0 ? 255 : 0);
```

Review comment:
I suggest you use `convert_ushort_sat()` instead.