nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/src/layers/cpu_kernels/conv_winograd_f63.cpp
**Change Type:** modified
**Context:** PR #23763: DNN: fix bug for X86 winograd
**Review Line:** 417

**Code Changes:**
```diff
@@ -398,7 +414,7 @@ void winofunc_accum_f32(const float* inwptr, const float* wptr, float* outbuf, i
 void winofunc_BtXB_8x8_f32(const float* inptr, int inpstep,
                           float* outptr, int Cg, const int winoIblock, const int winoAtomF32)
 {
-    CV_Assert(CONV_WINO_IBLOCK == 3 && CONV_WINO_KBLOCK == 4 && CONV_WINO_ATOM_F32 == 4);
+    CV_Assert(winoIblock == 3 && winoAtomF32 == 4);
     v_float32x4 x00 = v_load(inptr), x01 = v_load(inptr + 4);
     v_float32x4 x10 = v_load(inptr + inpstep), x11 = v_load(inptr + inpstep + 4);
     v_float32x4 x20 = v_load(inptr + inpstep*2), x21 = v_load(inptr + inpstep*2 + 4);
@@ -573,7 +589,6 @@ void winofunc_AtXA_8x8_f32(const float* inptr, int inpstep,
                           float* bpptr, int bpstep, float* outptr, int outstep,
```

Review comment:
What I want to do is to align the API. ``` #if CV_TRY_AVX2 if (conv->useAVX2) opt_AVX2::winofunc_accum_f32(inwptr, wptr, out_wbuf, Cg, block_id1 - block_id0, CONV_WINO_IBLOCK, CONV_WINO_KBLOCK, CONV_WINO_ATOM_F32, CONV_WINO_NATOMS_F32); else #endif #if CV_TRY_AVX if (conv->useAVX) opt_AVX::winofunc_accum_f32(inwptr, wptr, out_wbuf, Cg, block_id1 - block_id0, CONV_WINO_IBLOCK, CONV_WINO_KBLOCK, CONV_WINO_ATOM_F32, CONV_WINO_NATOMS_F32); else #endif #if CV_NEON && CV_NEON_AARCH64 if (conv->useNEON) opt_NEON::winofunc_accum_f32(inwptr, wptr, out_wbuf, Cg, block_id1 - block_id0, CONV_WINO_IBLOCK, CONV_WINO_KBLOCK, CONV_WINO_ATOM_F32, CONV_WINO_NATOMS_F32); else #endif winofunc_accum_f32(inwptr, wptr, out_wbuf, Cg, block_id1 - block_id0, CONV_WINO_IBLOCK, CONV_WINO_KBLOCK, CONV_WINO_ATOM_F32, CONV_WINO_NATOMS_F32); ``` For SIMD implementation, the parameters is the same, but for other dispatch, it may be different.
**File:** modules/imgproc/src/intelligent_scissors.cpp
**Change Type:** modified
**Context:** PR #21959: imgproc: optimise local cost computation in IntelligentScissorsMB::buildMap
**Review Line:** 650

**Code Changes:**
```diff
 #endif
 
-                float cost = cost_q + local_cost(q, r);  // TODO(opt): compute partially until cost < cost_r
-                if (cost < cost_r)
+                float cost = cost_q;
+                if (add_local_cost(q, r, cost, cost_r))
                 {
 #if 0  // avoid compiler warning
                     if (cost_r != FLT_MAX)
```

Review comment:
What is observed performance result? on which configuration?
**File:** modules/imgproc/src/intelligent_scissors.cpp
**Change Type:** modified
**Context:** PR #21959: imgproc: optimise local cost computation in IntelligentScissorsMB::buildMap
**Review Line:** 650

**Code Changes:**
```diff
 #endif
 
-                float cost = cost_q + local_cost(q, r);  // TODO(opt): compute partially until cost < cost_r
-                if (cost < cost_r)
+                float cost = cost_q;
+                if (add_local_cost(q, r, cost, cost_r))
                 {
 #if 0  // avoid compiler warning
                     if (cost_r != FLT_MAX)
```

Review comment:
Updated the PR description with snippets from the `opencv_perf_imgproc` test run. Not sure w.r.t. configuration(s), this was on Mac with `cmake -DCMAKE_BUILD_TYPE=Release` build.
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
Why do you need loop, if all k are handled in swtch?
**File:** modules/core/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22947: added cv::hasNonZero()
**Review Line:** 9

**Code Changes:**
```diff
@@ -6,6 +6,7 @@ ocv_add_dispatched_file(arithm SSE2 SSE4_1 AVX2 VSX3)
 ocv_add_dispatched_file(convert SSE2 AVX2 VSX3)
 ocv_add_dispatched_file(convert_scale SSE2 AVX2)
 ocv_add_dispatched_file(count_non_zero SSE2 AVX2)
+ocv_add_dispatched_file(has_non_zero SSE2 AVX2)
 ocv_add_dispatched_file(matmul SSE2 SSE4_1 AVX2 AVX512_SKX NEON_DOTPROD)
 ocv_add_dispatched_file(mean SSE2 AVX2)
 ocv_add_dispatched_file(merge SSE2 AVX2)
```

Review comment:
What about other platforms, e.g. ARM NEON?
**File:** modules/core/src/has_non_zero.simd.hpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,327 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+
+namespace cv {
+
+typedef bool (*HasNonZeroFunc)(const uchar*, size_t);
```

Review comment:
the code does not handle -0 properly
**File:** modules/core/src/has_non_zero.simd.hpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,327 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+
+namespace cv {
+
+typedef bool (*HasNonZeroFunc)(const uchar*, size_t);
```

Review comment:
-0 is not handled properly
**File:** modules/core/CMakeLists.txt
**Change Type:** modified
**Context:** PR #22947: added cv::hasNonZero()
**Review Line:** 9

**Code Changes:**
```diff
@@ -6,6 +6,7 @@ ocv_add_dispatched_file(arithm SSE2 SSE4_1 AVX2 VSX3)
 ocv_add_dispatched_file(convert SSE2 AVX2 VSX3)
 ocv_add_dispatched_file(convert_scale SSE2 AVX2)
 ocv_add_dispatched_file(count_non_zero SSE2 AVX2)
+ocv_add_dispatched_file(has_non_zero SSE2 AVX2)
 ocv_add_dispatched_file(matmul SSE2 SSE4_1 AVX2 AVX512_SKX NEON_DOTPROD)
 ocv_add_dispatched_file(mean SSE2 AVX2)
 ocv_add_dispatched_file(merge SSE2 AVX2)
```

Review comment:
Please ignore. NEON and other options will be enabled without dispatching.
**File:** modules/core/src/has_non_zero.simd.hpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,327 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+
+namespace cv {
+
+typedef bool (*HasNonZeroFunc)(const uchar*, size_t);
```

Review comment:
AFAIK, my last commit does support -0 correctly. The buildbot just reports failure because of perf_test not runnable (no reference data).
**File:** modules/core/src/has_non_zero.simd.hpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,327 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include "precomp.hpp"
+
+namespace cv {
+
+typedef bool (*HasNonZeroFunc)(const uchar*, size_t);
```

Review comment:
I just double-checked that `v_check_any(((v0 | v8) != v_zero));` will be correct on a x64 target : ```#if CV_SIMD_64F typedef v_float64 v_type; const v_type v_zero = vx_setzero_f64(); const v_type v_poszero = vx_setall_f64(0); const v_type v_negzero = vx_setall_f64(-0); const v_type v_one = vx_setall_f64(1); bool b1 = v_check_any((v_poszero != v_zero));//reports FALSE, as expected bool b2 = v_check_any((v_negzero != v_zero));//reports FALSE, as expected, because the _mm256_cmp_pd seems to handle -0 correctly bool b3 = v_check_any((v_one != v_zero));//reports TRUE, as expected ``` But I don't know if it behaves the same on NEON
**File:** modules/core/src/has_non_zero.simd.hpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()
**Review Line:** 56

**Code Changes:**
```diff
+                res |= ((gathered<<1) != 0);//remove what would be the sign bit
+            }
+            #endif
+        }
+        for( ; !res && (i < len); i++ )
+            res |= (src[i] != 0);
+    }
+    return res;
+}
+
+template<>
```

Review comment:
<<1 is missing here
**File:** modules/core/src/has_non_zero.simd.hpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()
**Review Line:** 81

**Code Changes:**
```diff
+                res |= ((gathered<<1) != 0);//remove what would be the sign bit
+            }
+            #endif
+        }
+        for( ; !res && (i < len); i++ )
+            res |= (src[i] != 0);
+    }
+    return res;
+}
+
+static bool hasNonZero8u( const uchar* src, size_t len )
```

Review comment:
<<1 is missing here
**File:** modules/core/src/has_non_zero.simd.hpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()
**Review Line:** 81

**Code Changes:**
```diff
+                res |= ((gathered<<1) != 0);//remove what would be the sign bit
+            }
+            #endif
+        }
+        for( ; !res && (i < len); i++ )
+            res |= (src[i] != 0);
+    }
+    return res;
+}
+
+static bool hasNonZero8u( const uchar* src, size_t len )
```

Review comment:
I don't think so. Native comparison between a float (or double) and zero already handles the sign bit.
**File:** modules/core/src/has_non_zero.dispatch.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,107 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+
+#include "precomp.hpp"
+#include "opencl_kernels_core.hpp"
+#include "stat.hpp"
+
```

Review comment:
the non-continuous case does not handle multi-dimensional arrays. It should not be difficult to add for this function, use NAryMatIterator
**File:** modules/core/src/has_non_zero.dispatch.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,107 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+
+#include "precomp.hpp"
+#include "opencl_kernels_core.hpp"
+#include "stat.hpp"
+
```

Review comment:
Ok, It will just take me the time to figure out how NAryMatIterator is supposed to be used (I am not familiar with it yet)
**File:** modules/core/src/has_non_zero.dispatch.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,107 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+
+#include "precomp.hpp"
+#include "opencl_kernels_core.hpp"
+#include "stat.hpp"
+
```

Review comment:
at least add the check for src.dims <= 2, otherwise in the case of non-contiguous 3D, 4D etc. arrays the function will always return 'false', since rows=cols=-1 in this case.
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
- I propose to reduce switch and extract common part. No need to repeat the same several times. - No need to handle results and print status manually. Use it parameter and call the function with particular k in dedicated test instance. Result will be obvious from GTest output.
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
I just took the code from test_countnonzero, this is the exact same scheme. What is the best option : make that scheme evolve for cv_hasNonZero(), or keep homogeneity between those two unit tests ?
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
test_countnonzero was written in pre-GTest epoch. No need to do the same. Feel free to use Gtest in more efficient way.
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
Ok, I will refactor the whole hasNonZero tests to modern code (within a few days )
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
Done (and it exposed a bug that I could fix)
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
std::vector or other container is better here. No memory leaks in case of exception.
**File:** modules/core/test/test_hasnonzero.cpp
**Change Type:** added
**Context:** PR #22947: added cv::hasNonZero()

**Code Changes:**
```diff
@@ -0,0 +1,201 @@
+/*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:
I do not think we need so many random sizes. IMHO "normal" case like 320x240 or VGA and couple of odd like 127x113 and 1x113 is enough. It's fast and covers "tails" in vectorized code. It's more important to randomize matrix content, especially for float values and add nans, infs, -0, 0 to be sure that function does not trigger on such cases.
**File:** modules/imgproc/perf/perf_intelligent_scissors.cpp
**Change Type:** added
**Context:** PR #23698: imgproc: add basic IntelligentScissorsMB performance test

**Code Changes:**
```diff
@@ -0,0 +1,34 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+#include "perf_precomp.hpp"
+
+namespace opencv_test { namespace {
+
+
+typedef perf::TestBaseWithParam<int> TestIntelligentScissorsMB;
```

Review comment:
``` Mat image = imread(findDataFile("cv/shared/lena.png"), IMREAD_COLOR); ASSERT_TRUE(!image.empty()); ``` Is enough. No need to add dedicated function.
**File:** modules/imgproc/test/test_intelligent_scissors.cpp
**Change Type:** modified
**Context:** PR #23688: imgproc: add contour values check to IntelligentScissorsMB tests

**Code Changes:**
```diff
@@ -147,27 +147,91 @@ void show(const Mat& img, const std::vector<Point> pts)
     }
 }
 
+Size estimateContourSize(const std::vector<Point>& pts)
+{
+    Size s(0,0);
+    for (size_t i = 0; i < pts.size(); i++)
+    {
+        if (s.width < pts[i].x)
```

Review comment:
I recommend to guard regression data recording with macro like `GENERATE_TEST_DATA` to prevent test data corruption during debug. See test_io.cpp:639 for example.
**File:** modules/imgproc/test/test_intelligent_scissors.cpp
**Change Type:** modified
**Context:** PR #23688: imgproc: add contour values check to IntelligentScissorsMB tests

**Code Changes:**
```diff
@@ -147,27 +147,91 @@ void show(const Mat& img, const std::vector<Point> pts)
     }
 }
 
+Size estimateContourSize(const std::vector<Point>& pts)
+{
+    Size s(0,0);
+    for (size_t i = 0; i < pts.size(); i++)
+    {
+        if (s.width < pts[i].x)
```

Review comment:
Else branch looks strange. It checks nothing, if size is different. In case if +-1 result is expected, then you can use cv::norm(..., NORM_INF) could be used. In case if amount of contour pixels is unstable, please do not call `getContours`, but do all steps in test body.
**File:** modules/imgproc/test/test_intelligent_scissors.cpp
**Change Type:** modified
**Context:** PR #23688: imgproc: add contour values check to IntelligentScissorsMB tests

**Code Changes:**
```diff
@@ -147,27 +147,91 @@ void show(const Mat& img, const std::vector<Point> pts)
     }
 }
 
+Size estimateContourSize(const std::vector<Point>& pts)
+{
+    Size s(0,0);
+    for (size_t i = 0; i < pts.size(); i++)
+    {
+        if (s.width < pts[i].x)
```

Review comment:
I propose to rename to `strongCheck` or something then stress it.
**File:** modules/imgproc/test/test_intelligent_scissors.cpp
**Change Type:** modified
**Context:** PR #23688: imgproc: add contour values check to IntelligentScissorsMB tests

**Code Changes:**
```diff
@@ -147,27 +147,91 @@ void show(const Mat& img, const std::vector<Point> pts)
     }
 }
 
+Size estimateContourSize(const std::vector<Point>& pts)
+{
+    Size s(0,0);
+    for (size_t i = 0; i < pts.size(); i++)
+    {
+        if (s.width < pts[i].x)
```

Review comment:
> ... I'm not sure if I understood the _"... but do all steps in test body."_ suggestion correctly ... Never mind, I see now e.g. from the https://pullrequest.opencv.org/buildbot/builders/precommit_windows64/builds/101746/steps/test_imgproc/logs/tests%20summary CI failure that the `cv::norm` call should only be made if the vector sizes match and therefore the call is better placed in the test body alongside the PTS_SIZE_EPS check.
**File:** modules/imgproc/test/test_intelligent_scissors.cpp
**Change Type:** modified
**Context:** PR #23688: imgproc: add contour values check to IntelligentScissorsMB tests

**Code Changes:**
```diff
@@ -147,27 +147,91 @@ void show(const Mat& img, const std::vector<Point> pts)
     }
 }
 
+Size estimateContourSize(const std::vector<Point>& pts)
+{
+    Size s(0,0);
+    for (size_t i = 0; i < pts.size(); i++)
+    {
+        if (s.width < pts[i].x)
```

Review comment:
`getAndCheckContour` checks contour size too. The following size checks are not required here and bellow.
**File:** modules/imgproc/src/filter.simd.hpp
**Change Type:** modified
**Context:** PR #23567: Reformulated some pointer arithmetic to avoid (unsigned) overflow - Although unsigned overflow is well-defined by the C++ standard, it is o...

**Code Changes:**
```diff
@@ -44,6 +44,8 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include "filter.hpp"
 
+#include <cstddef>
+
 #if defined(CV_CPU_BASELINE_MODE)
 #if IPP_VERSION_X100 >= 710
 #define USE_IPP_SEP_FILTERS 1
@@ -304,7 +306,7 @@ void FilterEngine__apply(FilterEngine& this_, const Mat& src, Mat& dst, const Si
```

Review comment:
We should avoid unnecessary `if` branching. does `src.ptr() + y * (ssize_t)src.step` work with UBSan? (to avoid unsigned value) If no then please put this code under UBSan macro guard.
**File:** modules/imgproc/src/filter.simd.hpp
**Change Type:** modified
**Context:** PR #23567: Reformulated some pointer arithmetic to avoid (unsigned) overflow - Although unsigned overflow is well-defined by the C++ standard, it is o...

**Code Changes:**
```diff
@@ -44,6 +44,8 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include "filter.hpp"
 
+#include <cstddef>
+
 #if defined(CV_CPU_BASELINE_MODE)
 #if IPP_VERSION_X100 >= 710
 #define USE_IPP_SEP_FILTERS 1
@@ -304,7 +306,7 @@ void FilterEngine__apply(FilterEngine& this_, const Mat& src, Mat& dst, const Si
```

Review comment:
>does src.ptr() + y * (ssize_t)src.step work with UBSan? (to avoid unsigned value) That would be worse actually. *signed* overflow is undefined. *unsigned* overflow (what we have now) is actually well-defined (see my commit message). >If no then please put this code under UBSan macro guard. I will pursue such a solution then...
**File:** modules/imgproc/src/filter.simd.hpp
**Change Type:** modified
**Context:** PR #23567: Reformulated some pointer arithmetic to avoid (unsigned) overflow - Although unsigned overflow is well-defined by the C++ standard, it is o...

**Code Changes:**
```diff
@@ -44,6 +44,8 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include "filter.hpp"
 
+#include <cstddef>
+
 #if defined(CV_CPU_BASELINE_MODE)
 #if IPP_VERSION_X100 >= 710
 #define USE_IPP_SEP_FILTERS 1
@@ -304,7 +306,7 @@ void FilterEngine__apply(FilterEngine& this_, const Mat& src, Mat& dst, const Si
```

Review comment:
> signed overflow is undefined We should not have *signed* overflow in address arithmetic.
**File:** modules/imgproc/src/filter.simd.hpp
**Change Type:** modified
**Context:** PR #23567: Reformulated some pointer arithmetic to avoid (unsigned) overflow - Although unsigned overflow is well-defined by the C++ standard, it is o...

**Code Changes:**
```diff
@@ -44,6 +44,8 @@
 #include "opencv2/core/hal/intrin.hpp"
 #include "filter.hpp"
 
+#include <cstddef>
+
 #if defined(CV_CPU_BASELINE_MODE)
 #if IPP_VERSION_X100 >= 710
 #define USE_IPP_SEP_FILTERS 1
@@ -304,7 +306,7 @@ void FilterEngine__apply(FilterEngine& this_, const Mat& src, Mat& dst, const Si
```

Review comment:
It is better to avoid disabling of whole function. Adjust single expression only through `#if` check.