nareshmlx/opencv-pr huggingface dataset:
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -694,8 +694,8 @@ class CV_EXPORTS_W QRCodeDetector
     CV_WRAP bool detect(InputArray img, OutputArray points) const;
 
     /** @brief Decodes QR code in image once it's found by the detect() method.
-     Returns UTF8-encoded output string or empty string if the code cannot be decoded.
 
+     Returns UTF8-encoded output string or empty string if the code cannot be decoded.
      @param img grayscale or color (BGR) image containing QR code.
      @param points Quadrangle vertices found by detect() method (or some other algorithm).
      @param straight_qrcode The optional output image containing rectified and binarized QR code
```

Review comment:
Do we really need two different epsilons? I mean according to QR codes standard, both horizontal and vertical directions should be equal, aren't they?
**File:** modules/objdetect/misc/java/test/QRCodeDetectorTest.java
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684
**Review Line:** 42

**Code Changes:**
```diff
+        assertNotNull(detector);
+        List < String > output = new ArrayList< String >();
+        boolean result = detector.detectAndDecodeMulti(img, output);
+        assertTrue(result);
+        assertEquals(output.size(), 6);
+        assertEquals(output.get(0), "SKIP");
+        assertEquals(output.get(1), "EXTRA");
+        assertEquals(output.get(2), "TWO STEPS FORWARD");
+        assertEquals(output.get(3), "STEP BACK");
+        assertEquals(output.get(4), "QUESTION");
+        assertEquals(output.get(5), "STEP FORWARD");
```

Review comment:
Result must be checked first. Don't try to access for elements without checking container size. ``` boolean result = detector.detectAndDecodeMulti(...); assertTrue(result); assertEquals(output.size(), 6); ... ```
**File:** modules/objdetect/misc/java/test/QRCodeDetectorTest.java
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684
**Review Line:** 34

**Code Changes:**
```diff
         String output = detector.detectAndDecode(img);
         assertEquals(output, "https://opencv.org/");
     }
 
+    public void testDetectAndDecodeMulti() {
+        Mat img = Imgcodecs.imread(testDataPath + "/cv/qrcode/multiple/6_qrcodes.png");
+        assertFalse(img.empty());
+        QRCodeDetector detector = new QRCodeDetector();
+        assertNotNull(detector);
+        List < String > output = new ArrayList< String >();
+        boolean result = detector.detectAndDecodeMulti(img, output);
```

Review comment:
> imread Result should be checked. Tests reports must be relevant as much as possible (image load failure instead of detector malfunction).
**File:** modules/objdetect/perf/perf_qrcode_pipeline.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -53,6 +53,56 @@ PERF_TEST_P_(Perf_Objdetect_QRCode, decode)
 }
 #endif
 
+typedef ::perf::TestBaseWithParam< std::string > Perf_Objdetect_QRCode_Multi;
+
+PERF_TEST_P_(Perf_Objdetect_QRCode_Multi, detectMulti)
+{
+    const std::string name_current_image = GetParam();
+    const std::string root = "cv/qrcode/multiple/";
```

Review comment:
> straight_barcode Not used.
**File:** modules/objdetect/perf/perf_qrcode_pipeline.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -53,6 +53,56 @@ PERF_TEST_P_(Perf_Objdetect_QRCode, decode)
 }
 #endif
 
+typedef ::perf::TestBaseWithParam< std::string > Perf_Objdetect_QRCode_Multi;
+
+PERF_TEST_P_(Perf_Objdetect_QRCode_Multi, detectMulti)
+{
+    const std::string name_current_image = GetParam();
+    const std::string root = "cv/qrcode/multiple/";
```

Review comment:
swap two last lines or move "straight_barcode" down (before `TEST_CYCLE`).
**File:** modules/objdetect/perf/perf_qrcode_pipeline.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -53,6 +53,56 @@ PERF_TEST_P_(Perf_Objdetect_QRCode, decode)
 }
 #endif
 
+typedef ::perf::TestBaseWithParam< std::string > Perf_Objdetect_QRCode_Multi;
+
+PERF_TEST_P_(Perf_Objdetect_QRCode_Multi, detectMulti)
+{
+    const std::string name_current_image = GetParam();
+    const std::string root = "cv/qrcode/multiple/";
```

Review comment:
Please keep code readable. - Construct variables in order of their usage. - Reduce variables scope as much as possible (make them local). ``` qrcode.detectMulti(src, corners) ^1^ ^2^ /*3*/ std::vector< cv::String > decoded_info; /*4*/ std::vector<Mat> straight_barcode; ```
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -22,6 +22,48 @@ namespace cv
 {
 using std::vector;
 
+static bool checkQRInputImage(InputArray img, Mat& gray)
+{
+    CV_Assert(!img.empty());
+    CV_CheckDepthEQ(img.depth(), CV_8U, "");
+
+    if (img.cols() <= 20 || img.rows() <= 20)
```

Review comment:
Avoid merging of `if` condition and `if` body into one line. It is bad practice which blocks code coverage tools.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -22,6 +22,48 @@ namespace cv
 {
 using std::vector;
 
+static bool checkQRInputImage(InputArray img, Mat& gray)
+{
+    CV_Assert(!img.empty());
+    CV_CheckDepthEQ(img.depth(), CV_8U, "");
+
+    if (img.cols() <= 20 || img.rows() <= 20)
```

Review comment:
> points_distance >= 0 Always true except `NaN` values.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -22,6 +22,48 @@ namespace cv
 {
 using std::vector;
 
+static bool checkQRInputImage(InputArray img, Mat& gray)
+{
+    CV_Assert(!img.empty());
+    CV_CheckDepthEQ(img.depth(), CV_8U, "");
+
+    if (img.cols() <= 20 || img.rows() <= 20)
```

Review comment:
You might use dot product instead of law of cosines in case of input vectors: - https://en.wikipedia.org/wiki/Dot_product
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -22,6 +22,48 @@ namespace cv
 {
 using std::vector;
 
+static bool checkQRInputImage(InputArray img, Mat& gray)
+{
+    CV_Assert(!img.empty());
+    CV_CheckDepthEQ(img.depth(), CV_8U, "");
+
+    if (img.cols() <= 20 || img.rows() <= 20)
```

Review comment:
Consider adding high-level non-obvious comments into your code. What and why are these loops doing here? What are main stages of this algorithm? This method is ~400 lines. It definitely should be divided into well named (and well tested) parts/stages.
**File:** modules/objdetect/include/opencv2/objdetect.hpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -694,8 +694,8 @@ class CV_EXPORTS_W QRCodeDetector
     CV_WRAP bool detect(InputArray img, OutputArray points) const;
 
     /** @brief Decodes QR code in image once it's found by the detect() method.
-     Returns UTF8-encoded output string or empty string if the code cannot be decoded.
 
+     Returns UTF8-encoded output string or empty string if the code cannot be decoded.
      @param img grayscale or color (BGR) image containing QR code.
      @param points Quadrangle vertices found by detect() method (or some other algorithm).
      @param straight_qrcode The optional output image containing rectified and binarized QR code
```

Review comment:
> OutputArrayOfArrays > InputArrayOfArrays > std::vector< std::vector< Point > > corners; Please avoid using of `*OfArrays` types and/or nested `std::vector`. This is unnecessary for fixed size elements (4 points per QR code). Lets store `points` as one "array" (without nesting): - `std::vector< Point >` where each 4 points define QR code instance (`<0, 1, 2, 3>, <4, 5, 6 ,7> ...`). - `Mat` - CV_32FC2 with one or multiple rows. and pass them as `OutputArray`. This is continued discussion from this comment: https://github.com/opencv/opencv/pull/15338#discussion_r339004770
**File:** samples/cpp/qrcode.cpp
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -2,23 +2,45 @@
 #include "opencv2/imgproc.hpp"
 #include "opencv2/highgui.hpp"
 #include "opencv2/videoio.hpp"
+#include "opencv2/imgcodecs.hpp"
 #include <string>
 #include <iostream>
 
 using namespace std;
 using namespace cv;
```

Review comment:
Saving each frame slowdowns demo significantly. Image I/O is not optimized (because it is for debug purposes here). Original and processed frames should be saved by pressing key only (it was space ' '). Both at once.
**File:** modules/objdetect/misc/python/test/test_qrcode_detect.py
**Change Type:** modified
**Context:** PR #15338: QR-Code detector : multiple detection - **Merge with extra**: https://github.com/opencv/opencv_extra/pull/684

**Code Changes:**
```diff
@@ -11,8 +11,42 @@
 from tests_common import NewOpenCVTests
 
 class qrcode_detector_test(NewOpenCVTests):
+
+    def test_detect(self):
+        img = cv.imread(os.path.join(self.extraTestDataPath, 'cv/qrcode/link_ocv.jpg'))
+        self.assertFalse(img is None)
+        detector = cv.QRCodeDetector()
+        retval, points = detector.detect(img)
```

Review comment:
> == None In Python world checks should look like: - `a is None` - `a is not None`
**File:** modules/videoio/test/test_ffmpeg.cpp
**Change Type:** modified
**Context:** PR #16190: Videocapture skip frames - ### This pullrequest changes **Add the possibility to skip frames** in VideoCapture by using the existing `OPENC...

**Code Changes:**
```diff
@@ -303,6 +303,54 @@ const videoio_container_params_t videoio_container_params[] =
 
 INSTANTIATE_TEST_CASE_P(/**/, videoio_container, testing::ValuesIn(videoio_container_params));
 
+typedef tuple<string, string, int> videoio_skip_params_t;
+typedef testing::TestWithParam< videoio_skip_params_t > videoio_skip;
+
+TEST_P(videoio_skip, DISABLED_read)  // optional test, may fail in some configurations
+{
+#if CV_VERSION_MAJOR >= 4
```

Review comment:
The test is FFMPEG specific, so no need to push backend type as parameter. Also file name and extension are always used together, no need to pass them as separate parameters and then concatenate in test body.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #16190: Videocapture skip frames - ### This pullrequest changes **Add the possibility to skip frames** in VideoCapture by using the existing `OPENC...
**Review Line:** 988

**Code Changes:**
```diff
+                enc->skip_frame = AVDISCARD_NONINTRA;
+#endif
+            else if (strcmp(avdiscard_entry->value, "nonkey") == 0)
+                enc->skip_frame = AVDISCARD_NONKEY;
+            else if (strcmp(avdiscard_entry->value, "nonref") == 0)
+                enc->skip_frame = AVDISCARD_NONREF;
+        }
+#endif
+
 #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 2, 0)
 #define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
```

Review comment:
What FFmpeg / libav versions support that? (at least compilation) Need to properly guard code through "#if"s. BTW, access to `OPENCV_FFMPEG_CAPTURE_OPTIONS` is guarded by ``` #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0) ```
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
There is similar `CV_ALWAYS_INLINE` macro in `cvdef.h`
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
Is it possible to reduce size of this macro? Or even omit it?
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
It looks like `minInit` and `maxInit` are always set to type boundaries, while `minVal` and `maxVal` are corresponding type variables. I suppose this condition never could be satisfied.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
I suggest defining `VT operator ==(VT v, ST s){return v_setall_##suffix(s) == v}`. That's the only part that changes for different MACRO instantiations.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
`valMin` vector is initialized with `minVal` so if there is non negative value in `idxMin` there should be at least one value that is less than minVal and therefore it looks like `vmin < minVal` should always be true.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
The loop is redundant here since we search for the first minimal value.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
Actually minVal/maxVal are commonly set to INT_MIN/INT_MAX and are 'int' types. This means they are out of range for 'char' and 'short' types until they initialized. The same is true for float/double - they are commonly initialized to +/- infinity. So this condition is needed.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
It's possible to have a condition where vmin == minVal and its 'position' index value is less than minIdx. That is the logic here.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
It is possible for the values in the vector to continually be less than or equal to the current value. So this needs to be a loop and not a single check.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
There is also 'RT' type. How does this help? I still need a macro for the suffix and RT types.
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
I don't see how to omit it. Suggestions?
**File:** modules/core/src/minmax.cpp
**Change Type:** modified
**Context:** PR #15488: Vectorize minMaxIdx functions - Vectorize minMaxIdx functions. minMaxIdx_8u & minMaxIdx_8s - 11.1x improvement on VSX and 8.6x speedup on x...

**Code Changes:**
```diff
@@ -71,33 +71,759 @@ minMaxIdx_( const T* src, const uchar* mask, WT* _minVal, WT* _maxVal,
     *_maxVal = maxVal;
 }
 
+#if CV_SIMD128
+template<typename T, typename WT> CV_ALWAYS_INLINE void
+minMaxIdx_init( const T* src, const uchar* mask, WT* minval, WT* maxval,
+                size_t* minidx, size_t* maxidx, WT &minVal, WT &maxVal,
+                size_t &minIdx, size_t &maxIdx, const WT minInit, const WT maxInit,
+                const int nlanes, int len, size_t startidx, int &j, int &len0 )
```

Review comment:
Got the idea. May be it make sense to use `v_reduce_min(v_select(v_setall_##suffix(vmin) == valMin, idxMin, v_setall_##suffix(std::numeric_limits<IR>::max)));` to ensure constant time evaluation?