nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgproc/src/color_yuv.dispatch.cpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420
**Review Line:** 409

**Code Changes:**
```diff
@@ -124,8 +124,9 @@ void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
 
     CALL_HAL(cvtTwoPlaneYUVtoBGR, cv_hal_cvtTwoPlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx);
 
-    CV_CPU_DISPATCH(cvtTwoPlaneYUVtoBGR, (src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx),
-        CV_CPU_DISPATCH_MODES_ALL);
+    cvtTwoPlaneYUVtoBGR(
+            src_data, src_step, src_data + src_step * dst_height, src_step, dst_data, dst_step,
+            dst_width, dst_height, dcn, swapBlue, uIdx);
 }
 
 void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src_step,
@@ -135,7 +136,20 @@ void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src
 {
     CV_INSTRUMENT_REGION();
```

Review comment:
This PR updates implementations of HAL wrappers for available platforms (AFAIK these are only Carotene and OpenVX). Migration in this sense is not necessary.
**File:** modules/imgproc/src/color_yuv.dispatch.cpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420
**Review Line:** 409

**Code Changes:**
```diff
@@ -124,8 +124,9 @@ void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
 
     CALL_HAL(cvtTwoPlaneYUVtoBGR, cv_hal_cvtTwoPlaneYUVtoBGR, src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx);
 
-    CV_CPU_DISPATCH(cvtTwoPlaneYUVtoBGR, (src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx),
-        CV_CPU_DISPATCH_MODES_ALL);
+    cvtTwoPlaneYUVtoBGR(
+            src_data, src_step, src_data + src_step * dst_height, src_step, dst_data, dst_step,
+            dst_width, dst_height, dcn, swapBlue, uIdx);
 }
 
 void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src_step,
@@ -135,7 +136,20 @@ void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src
 {
     CV_INSTRUMENT_REGION();
```

Review comment:
... stored with OpenCV source code. For any other **external** HAL implementation (if any) this patch introduces regression.
**File:** modules/imgproc/src/color_yuv.simd.hpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420
**Review Line:** 1827

**Code Changes:**
```diff
                        int /* dst_height */,
-                       size_t /* _stride */,
                        const uchar* /* _y1 */,
-                       const uchar* /* _uv */);
+                       size_t /* _y1_step */,
+                       const uchar* /* _uv */,
+                       size_t /* _uv_step */);
 
-void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src_step,
+void cvtTwoPlaneYUVtoBGR(const uchar * y_data, size_t y_step, const uchar * uv_data, size_t uv_step,
                          uchar * dst_data, size_t dst_step,
```

Review comment:
Is the pointer arithmetics being done under dispatched branch of code by purpose?
**File:** modules/imgproc/test/test_color.cpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420

**Code Changes:**
```diff
@@ -3072,20 +3072,34 @@ TEST(ImgProc_RGB2YUV, regression_13668)
     EXPECT_EQ(res, ref);
 }
 
-TEST(ImgProc_cvtColorTwoPlane, missing_check_17036)  // test can be removed if required feature is implemented
+TEST(ImgProc_cvtColorTwoPlane, y_plane_padding_differs_from_uv_plane_padding_17036)
 {
-    std::vector<uchar> y_data(700 * 480);
-    std::vector<uchar> uv_data(640 * 240);
+    RNG &rng = theRNG();
```

Review comment:
<del>When using copyTo we face the following error: `unknown file: Failure C++ exception with description "OpenCV(3.4.13-dev) /build/precommit_linux64/3.4/opencv/modules/core/src/matrix.cpp:751: error: (-215:Assertion failed) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function 'Mat' " thrown in the test body.`</del> Fixed. Previously a typo led to the wrong conclusion.
**File:** modules/imgproc/test/test_color.cpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420

**Code Changes:**
```diff
@@ -3072,20 +3072,34 @@ TEST(ImgProc_RGB2YUV, regression_13668)
     EXPECT_EQ(res, ref);
 }
 
-TEST(ImgProc_cvtColorTwoPlane, missing_check_17036)  // test can be removed if required feature is implemented
+TEST(ImgProc_cvtColorTwoPlane, y_plane_padding_differs_from_uv_plane_padding_17036)
 {
-    std::vector<uchar> y_data(700 * 480);
-    std::vector<uchar> uv_data(640 * 240);
+    RNG &rng = theRNG();
```

Review comment:
Fixed by switching to the latter option.
**File:** 3rdparty/carotene/hal/tegra_hal.hpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420

**Code Changes:**
```diff
@@ -1778,60 +1778,63 @@ TegraCvtColor_Invoker(bgrx2hsvf, bgrx2hsv, src_data + static_cast<size_t>(range.
     : CV_HAL_ERROR_NOT_IMPLEMENTED \
 )
 
-#define TEGRA_CVT2PYUVTOBGR(src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx) \
+#define TEGRA_CVT2PYUVTOBGR_EX(y_data, y_step, uv_data, uv_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx) \
 ( \
     CAROTENE_NS::isSupportedConfiguration() ? \
         dcn == 3 ? \
             uIdx == 0 ? \
```

Review comment:
Should now be fixed. Have added the new function under another name. Probably another option was to use variadic macro, as the number of parameters differs between the two functions, but assessment of feasibility of this would require understanding of initial reasoning.
**File:** modules/imgproc/src/color_yuv.dispatch.cpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420
**Review Line:** 152

**Code Changes:**
```diff
+    CV_INSTRUMENT_REGION();
+
+    CALL_HAL(cvtTwoPlaneYUVtoBGREx, cv_hal_cvtTwoPlaneYUVtoBGREx,
+             y_data, y_step, uv_data, uv_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx);
+
+    CV_CPU_DISPATCH(cvtTwoPlaneYUVtoBGR, (y_data, y_step, uv_data, uv_step, dst_data, dst_step, dst_width, dst_height, dcn, swapBlue, uIdx),
         CV_CPU_DISPATCH_MODES_ALL);
 }
 
@@ -172,7 +186,8 @@ void cvtBGRtoTwoPlaneYUV(const uchar * src_data, size_t src_step,
 {
```

Review comment:
We should have fallback on HAL code specialized for `y_step == uv_step` case. Otherwise this patch introduces performance regressions (to see that, drop changes from the HAL implementations). ``` if (y_step == uv_step) CALL_HAL(cvtTwoPlaneYUVtoBGR, cv_hal_cvtTwoPlaneYUVtoBGR, ...) ``` See discussion near removed `CV_CheckEQ()` for details (which is not resolved).
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -189,7 +189,9 @@ enum VideoCaptureProperties {
 enum VideoWriterProperties {
   VIDEOWRITER_PROP_QUALITY = 1,    //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
   VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
-  VIDEOWRITER_PROP_NSTRIPES = 3    //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_IS_COLOR = 4    //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
+                                   //!< will work with grayscale frames.
 };
 
```

Review comment:
> the flag is currently supported on Windows only Is it an accurate statement?
**File:** modules/videoio/src/backend.hpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -18,7 +18,8 @@ class IBackend
     virtual ~IBackend() {}
     virtual Ptr<IVideoCapture> createCapture(int camera) const = 0;
     virtual Ptr<IVideoCapture> createCapture(const std::string &filename) const = 0;
-    virtual Ptr<IVideoWriter>  createWriter(const std::string &filename, int fourcc, double fps, const cv::Size &sz, bool isColor) const = 0;
+    virtual Ptr<IVideoWriter> createWriter(const std::string& filename, int fourcc, double fps, const cv::Size& sz,
+                                           const VideoWriterParameters& params) const = 0;
 };
 
 class IBackendFactory
```

Review comment:
Please do not touch empty lines. Such changes are not related to purpose of the patch.
**File:** modules/videoio/src/backend_plugin.cpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -240,7 +240,8 @@ class PluginBackend: public IBackend
 
     Ptr<IVideoCapture> createCapture(int camera) const CV_OVERRIDE;
     Ptr<IVideoCapture> createCapture(const std::string &filename) const CV_OVERRIDE;
-    Ptr<IVideoWriter>  createWriter(const std::string &filename, int fourcc, double fps, const cv::Size &sz, bool isColor) const CV_OVERRIDE;
+    Ptr<IVideoWriter> createWriter(const std::string& filename, int fourcc, double fps,
+                                   const cv::Size& sz, const VideoWriterParameters& params) const CV_OVERRIDE;
 };
 
 class PluginBackendFactory : public IBackendFactory
```

Review comment:
Some message should be emitted about non supported / not consumed parameters.
**File:** modules/videoio/src/cap.cpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -458,6 +458,18 @@ VideoWriter::VideoWriter(const String& filename, int apiPreference, int _fourcc,
     open(filename, apiPreference, _fourcc, fps, frameSize, isColor);
 }
 
+VideoWriter::VideoWriter(const cv::String& filename, int fourcc, double fps,
+                         const cv::Size& frameSize, const std::vector<int>& params)
+{
+    open(filename, fourcc, fps, frameSize, params);
+}
+
```

Review comment:
Not sure that this is correct approach. Backends may have own specific parameters. So one function is not enough. Also it is not enough one such function per backend - for example, file container / codec tuning parameters. So it is better to replace this by stuff by similar to Python `.get(key, default_value)` method: ``` int get(std::map<int, int>& map, int key, const int defaultValue); // or more generic (not needed for now) template<...> getKeyOrDefault(std::map<TKey, TValue>& map, const TKey& key, const TValue defaultValue) ```
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -189,7 +189,9 @@ enum VideoCaptureProperties {
 enum VideoWriterProperties {
   VIDEOWRITER_PROP_QUALITY = 1,    //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
   VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
-  VIDEOWRITER_PROP_NSTRIPES = 3    //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_IS_COLOR = 4    //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
+                                   //!< will work with grayscale frames.
 };
 
```

Review comment:
This statement comes from the `isColor` parameter description
**File:** modules/videoio/src/cap.cpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -458,6 +458,18 @@ VideoWriter::VideoWriter(const String& filename, int apiPreference, int _fourcc,
     open(filename, apiPreference, _fourcc, fps, frameSize, isColor);
 }
 
+VideoWriter::VideoWriter(const cv::String& filename, int fourcc, double fps,
+                         const cv::Size& frameSize, const std::vector<int>& params)
+{
+    open(filename, fourcc, fps, frameSize, params);
+}
+
```

Review comment:
The goal of this function is to be a configuration point for required *common* parameters, e.g. `isColor`, to share 1 default value for various backends. I like your way of getting codec/backend specific parameters and will use it in further. Maybe better name (e.g. `fillCommonRequiredWriterParameters`) should remove such confusion or it's better to remove it anyway?
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -189,7 +189,9 @@ enum VideoCaptureProperties {
 enum VideoWriterProperties {
   VIDEOWRITER_PROP_QUALITY = 1,    //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
   VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
-  VIDEOWRITER_PROP_NSTRIPES = 3    //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_IS_COLOR = 4    //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
+                                   //!< will work with grayscale frames.
 };
 
```

Review comment:
I rechecked `isColor` parameter usage. It is completely ignored on MSMF and Intel MFX backends, so I updated the description.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -189,7 +189,9 @@ enum VideoCaptureProperties {
 enum VideoWriterProperties {
   VIDEOWRITER_PROP_QUALITY = 1,    //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
   VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
-  VIDEOWRITER_PROP_NSTRIPES = 3    //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_IS_COLOR = 4    //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
+                                   //!< will work with grayscale frames.
 };
 
```

Review comment:
> the flag is ignored It is better to keep here common information only. Backend-specific information should be moved on dedicated pages (there is huge amount of implementation details)
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -189,7 +189,9 @@ enum VideoCaptureProperties {
 enum VideoWriterProperties {
   VIDEOWRITER_PROP_QUALITY = 1,    //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
   VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
-  VIDEOWRITER_PROP_NSTRIPES = 3    //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_IS_COLOR = 4    //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
+                                   //!< will work with grayscale frames.
 };
 
```

Review comment:
Does `(the flag may be ignored by some backends. For more information refer to backend implementation)` sound better?
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #16766: feature: Extend VideoWriter to accept vector of parameters

**Code Changes:**
```diff
@@ -189,7 +189,9 @@ enum VideoCaptureProperties {
 enum VideoWriterProperties {
   VIDEOWRITER_PROP_QUALITY = 1,    //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
   VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
-  VIDEOWRITER_PROP_NSTRIPES = 3    //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.
+  VIDEOWRITER_PROP_IS_COLOR = 4    //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
+                                   //!< will work with grayscale frames.
 };
 
```

Review comment:
I would prefer to keep this info in a single place (to avoid manual maintenance in different places). See here: https://github.com/opencv/opencv/blame/4.3.0/modules/videoio/doc/videoio_overview.markdown#L27 I believe the header of properties enumeration should be enough.
**File:** modules/dnn/CMakeLists.txt
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -21,6 +21,8 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses -Wmaybe-uninit
 )
 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4701 /wd4100)
 
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ocl4dnn/include ${OPENCL_INCLUDE_DIRS})
+
 if(MSVC)
   add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 )
   ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146
```

Review comment:
In OpenCV there is T-API that loads OpenCL runtime dynamically. You should not link OpenCL explicitly. Everything, including vendor extensions, is loaded dynamically.
**File:** modules/dnn/src/dnn.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -875,7 +875,7 @@ struct Net::Impl
 
         if (preferableBackend == DNN_BACKEND_DEFAULT)
         {
-            CV_Assert(preferableTarget == DNN_TARGET_CPU);
+            CV_Assert(preferableTarget == DNN_TARGET_CPU || preferableTarget == DNN_TARGET_OPENCL);
             return;
         }
 
@@ -1000,6 +1000,7 @@ struct Net::Impl
```

Review comment:
Until it's not tested well on different hardware, I suggest not to make OpenCL the preferable target. Let's have user to set it explicitly.
**File:** modules/dnn/src/dnn.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -875,7 +875,7 @@ struct Net::Impl
 
         if (preferableBackend == DNN_BACKEND_DEFAULT)
         {
-            CV_Assert(preferableTarget == DNN_TARGET_CPU);
+            CV_Assert(preferableTarget == DNN_TARGET_CPU || preferableTarget == DNN_TARGET_OPENCL);
             return;
         }
 
@@ -1000,6 +1000,7 @@ struct Net::Impl
```

Review comment:
this change will seriously affect performance of CPU branch. By "seriously" I mean 50-100%. If you want to disable fusion in the case of OpenCL target, please, do so.
**File:** modules/dnn/src/layers/convolution_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -47,6 +47,10 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include <iostream>
 
+#ifdef HAVE_OPENCL
+using namespace cv::dnn::ocl4dnn;
+#endif
+
 namespace cv
 {
```

Review comment:
There should be a space between >>, otherwise some compiler may produce error
**File:** modules/dnn/src/layers/convolution_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -47,6 +47,10 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include <iostream>
 
+#ifdef HAVE_OPENCL
+using namespace cv::dnn::ocl4dnn;
+#endif
+
 namespace cv
 {
```

Review comment:
This code is under `#ifdef HAVE_OPENCL`. We currently have no "OpenCL with C++ 98" precommit builder. Precommit Linux OpenCL builder forces C++11 (for Halide), similar case for Windows OpenCL. Nightly builder would detect this problem only (after merge).
**File:** modules/dnn/src/opencl/math.cl
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,55 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
What is about [sign()](https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/sign.html) ?
**File:** modules/dnn/src/layers/convolution_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -47,6 +47,10 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include <iostream>
 
+#ifdef HAVE_OPENCL
+using namespace cv::dnn::ocl4dnn;
+#endif
+
 namespace cv
 {
```

Review comment:
Probably constant values can be pre-allocated and filled into `cv::UMat` during "preparation" stage.
**File:** modules/dnn/src/layers/convolution_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -47,6 +47,10 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include <iostream>
 
+#ifdef HAVE_OPENCL
+using namespace cv::dnn::ocl4dnn;
+#endif
+
 namespace cv
 {
```

Review comment:
Please replace passing of cv_mem via `float*` type to `const cv::UMat&`.
**File:** modules/dnn/CMakeLists.txt
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -21,6 +21,8 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses -Wmaybe-uninit
 )
 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4701 /wd4100)
 
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ocl4dnn/include ${OPENCL_INCLUDE_DIRS})
+
 if(MSVC)
   add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 )
   ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146
```

Review comment:
Forcing C++11 for main OpenCV modules is forbidden.