nareshmlx/opencv-pr huggingface dataset:
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -188,6 +188,7 @@ enum VideoCaptureProperties {
        CAP_PROP_HW_ACCELERATION_USE_OPENCL=52, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.
        CAP_PROP_OPEN_TIMEOUT_MSEC=53, //!< (**open-only**) timeout in milliseconds for opening a video capture (applicable for FFmpeg back-end only)
        CAP_PROP_READ_TIMEOUT_MSEC=54, //!< (**open-only**) timeout in milliseconds for reading from a video capture (applicable for FFmpeg back-end only)
+       CAP_PROP_STREAM_OPEN_TIME_USEC =55, //<! (read-only) time in microseconds since Jan 1 1970 when stream was opened. Applicable for FFmpeg backend only. Useful for RTSP and other live streams
 #ifndef CV_DOXYGEN
        CV__CAP_PROP_LATEST
 #endif
```

Review comment:
> in seconds Lets use nanoseconds to keep this value accurate and avoid division (FFmpeg uses microseconds internally)
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -188,6 +188,7 @@ enum VideoCaptureProperties {
        CAP_PROP_HW_ACCELERATION_USE_OPENCL=52, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.
        CAP_PROP_OPEN_TIMEOUT_MSEC=53, //!< (**open-only**) timeout in milliseconds for opening a video capture (applicable for FFmpeg back-end only)
        CAP_PROP_READ_TIMEOUT_MSEC=54, //!< (**open-only**) timeout in milliseconds for reading from a video capture (applicable for FFmpeg back-end only)
+       CAP_PROP_STREAM_OPEN_TIME_USEC =55, //<! (read-only) time in microseconds since Jan 1 1970 when stream was opened. Applicable for FFmpeg backend only. Useful for RTSP and other live streams
 #ifndef CV_DOXYGEN
        CV__CAP_PROP_LATEST
 #endif
```

Review comment:
Ok. I changed the name of the cap prop (added _NSEC to the end) to reflect the units
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -188,6 +188,7 @@ enum VideoCaptureProperties {
        CAP_PROP_HW_ACCELERATION_USE_OPENCL=52, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.
        CAP_PROP_OPEN_TIMEOUT_MSEC=53, //!< (**open-only**) timeout in milliseconds for opening a video capture (applicable for FFmpeg back-end only)
        CAP_PROP_READ_TIMEOUT_MSEC=54, //!< (**open-only**) timeout in milliseconds for reading from a video capture (applicable for FFmpeg back-end only)
+       CAP_PROP_STREAM_OPEN_TIME_USEC =55, //<! (read-only) time in microseconds since Jan 1 1970 when stream was opened. Applicable for FFmpeg backend only. Useful for RTSP and other live streams
 #ifndef CV_DOXYGEN
        CV__CAP_PROP_LATEST
 #endif
```

Review comment:
I looked on that once more. `int64_t` is good for nanoseconds, but `double` which is used to return property values - doesn't. Double's 53 mantissa bits are reached in 104 days (it is not good for timestamps since 1970). Details about similar problem: https://groups.google.com/g/python-ideas/c/RLRBS15Gofc Seconds / milliseconds is not enough accurate for sensors (without fractional part). Perhaps, microseconds (`_USEC`) should work.
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -188,6 +188,7 @@ enum VideoCaptureProperties {
        CAP_PROP_HW_ACCELERATION_USE_OPENCL=52, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.
        CAP_PROP_OPEN_TIMEOUT_MSEC=53, //!< (**open-only**) timeout in milliseconds for opening a video capture (applicable for FFmpeg back-end only)
        CAP_PROP_READ_TIMEOUT_MSEC=54, //!< (**open-only**) timeout in milliseconds for reading from a video capture (applicable for FFmpeg back-end only)
+       CAP_PROP_STREAM_OPEN_TIME_USEC =55, //<! (read-only) time in microseconds since Jan 1 1970 when stream was opened. Applicable for FFmpeg backend only. Useful for RTSP and other live streams
 #ifndef CV_DOXYGEN
        CV__CAP_PROP_LATEST
 #endif
```

Review comment:
Using seconds/milliseconds with the fractional part would necessitate a division (is there a compiler macro #ifdef-type thing to allow that?), so I don't think we'd want to go with that. Microseconds fits in a double until ~2170 (log2 [86400*1e6 * 365 * 200] is less than 53). I'm going to change to microseconds
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -1591,6 +1591,9 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
     case CAP_PROP_HW_ACCELERATION_USE_OPENCL:
         return static_cast<double>(use_opencl);
 #endif  // USE_AV_HW_CODECS
+    case CAP_PROP_STREAM_OPEN_TIME_USEC:
+        //ic->start_time_realtime is in microseconds
+        return ((double)ic->start_time_realtime);
     default:
         break;
     }
```

Review comment:
Please fix whitespace issue (to make builds green): http://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/31979
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -1591,6 +1591,9 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
     case CAP_PROP_HW_ACCELERATION_USE_OPENCL:
         return static_cast<double>(use_opencl);
 #endif  // USE_AV_HW_CODECS
+    case CAP_PROP_STREAM_OPEN_TIME_USEC:
+        //ic->start_time_realtime is in microseconds
+        return ((double)ic->start_time_realtime);
     default:
         break;
     }
```

Review comment:
`git diff --check` did not catch this - is that a bug? I'm assuming that the extra space at the end of line 1595 was the offending whitespace.
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -1591,6 +1591,9 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
     case CAP_PROP_HW_ACCELERATION_USE_OPENCL:
         return static_cast<double>(use_opencl);
 #endif  // USE_AV_HW_CODECS
+    case CAP_PROP_STREAM_OPEN_TIME_USEC:
+        //ic->start_time_realtime is in microseconds
+        return ((double)ic->start_time_realtime);
     default:
         break;
     }
```

Review comment:
It works (need to specify the "base" commit): ``` $ git checkout 567ffd8134d67d76277181930dd4f4eb618fe26f Note: switching to '567ffd8134d67d76277181930dd4f4eb618fe26f'. HEAD is now at 567ffd8134 use microseconds for CAP_PROP_STREAM_OPEN_TIME (nanoseconds rolls over too soon, and milliseconds/seconds requires a division) $ git diff --check 6fbfc58602e719b9d58099a3c43e5c764718c4ba modules/videoio/src/cap_ffmpeg_impl.hpp:1596: trailing whitespace. + return ((double)ic->start_time_realtime); ```
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #20591: Add CAP_PROP_STREAM_OPEN_TIME - I added CAP_PROP_STREAM_OPEN_TIME to the capture properties enumeration and support for it in the `getPrope...

**Code Changes:**
```diff
@@ -1591,6 +1591,9 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
     case CAP_PROP_HW_ACCELERATION_USE_OPENCL:
         return static_cast<double>(use_opencl);
 #endif  // USE_AV_HW_CODECS
+    case CAP_PROP_STREAM_OPEN_TIME_USEC:
+        //ic->start_time_realtime is in microseconds
+        return ((double)ic->start_time_realtime);
     default:
         break;
     }
```

Review comment:
> It works (need to specify the "base" commit): > > ``` > $ git checkout 567ffd8134d67d76277181930dd4f4eb618fe26f > Note: switching to '567ffd8134d67d76277181930dd4f4eb618fe26f'. > > HEAD is now at 567ffd8134 use microseconds for CAP_PROP_STREAM_OPEN_TIME (nanoseconds rolls over too soon, and milliseconds/seconds requires a division) > $ git diff --check 6fbfc58602e719b9d58099a3c43e5c764718c4ba > modules/videoio/src/cap_ffmpeg_impl.hpp:1596: trailing whitespace. > + return ((double)ic->start_time_realtime); > ``` Sorry - do I need to do something on this PR, or are you saying that, in order to get the whitespace check to work, I need to use `git diff --check [base_commit]` ?
**File:** modules/imgproc/src/color_yuv.simd.hpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420
**Review Line:** 1403

**Code Changes:**
```diff
+                            const uchar* _y1, size_t _y1_step, const uchar* _uv, size_t _uv_step)
 {
-    YUV420sp2RGB8Invoker<bIdx, uIdx, dcn> converter(dst_data, dst_step, dst_width, _stride, _y1,  _uv);
+    YUV420sp2RGB8Invoker<bIdx, uIdx, dcn> converter(dst_data, dst_step, dst_width, _y1, _y1_step, _uv, _uv_step);
     if (dst_width * dst_height >= MIN_SIZE_FOR_PARALLEL_YUV420_CONVERSION)
         parallel_for_(Range(0, dst_height/2), converter);
     else
@@ -1817,26 +1818,16 @@ void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
         CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, YCrCb2RGB_f<float>(dcn, blueIdx, isCbCr));
 }
 
```

Review comment:
Is it safe for images with odd heights?
**File:** modules/imgproc/src/color_yuv.simd.hpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420
**Review Line:** 1403

**Code Changes:**
```diff
+                            const uchar* _y1, size_t _y1_step, const uchar* _uv, size_t _uv_step)
 {
-    YUV420sp2RGB8Invoker<bIdx, uIdx, dcn> converter(dst_data, dst_step, dst_width, _stride, _y1,  _uv);
+    YUV420sp2RGB8Invoker<bIdx, uIdx, dcn> converter(dst_data, dst_step, dst_width, _y1, _y1_step, _uv, _uv_step);
     if (dst_width * dst_height >= MIN_SIZE_FOR_PARALLEL_YUV420_CONVERSION)
         parallel_for_(Range(0, dst_height/2), converter);
     else
@@ -1817,26 +1818,16 @@ void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
         CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, YCrCb2RGB_f<float>(dcn, blueIdx, isCbCr));
 }
 
```

Review comment:
`Y` plane must have even width and height values (see 420 format).
**File:** modules/imgproc/src/color_yuv.simd.hpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420
**Review Line:** 1403

**Code Changes:**
```diff
+                            const uchar* _y1, size_t _y1_step, const uchar* _uv, size_t _uv_step)
 {
-    YUV420sp2RGB8Invoker<bIdx, uIdx, dcn> converter(dst_data, dst_step, dst_width, _stride, _y1,  _uv);
+    YUV420sp2RGB8Invoker<bIdx, uIdx, dcn> converter(dst_data, dst_step, dst_width, _y1, _y1_step, _uv, _uv_step);
     if (dst_width * dst_height >= MIN_SIZE_FOR_PARALLEL_YUV420_CONVERSION)
         parallel_for_(Range(0, dst_height/2), converter);
     else
@@ -1817,26 +1818,16 @@ void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
         CvtColorLoop(src_data, src_step, dst_data, dst_step, width, height, YCrCb2RGB_f<float>(dcn, blueIdx, isCbCr));
 }
 
```

Review comment:
Seems this is required by the format definition.
**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:
It's better to use test system controlled random generator: ``` RNG& rng = ts->get_rng(); ```
**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:
`RNG::fill` can fill Matrix directly. No need to create extra container. https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html#ad26f2b09d9868cf108e84c9814aa682d
**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:
The same here too.
**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:
`cv::Mat::at<>` takes stride in account. No need to create vector, you can just copy Mat elements. As alternative you can try `cv::Mat::copyTo`, but I'm not sure if it supports output with step.
**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:
Looks like ::testing::Test parent class has no pointer to the system.
**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:
`cv::theRNG()` should be used (controlled by OpenCV test system).
**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:
`rgb_reference_mat - rgb_y_padded_mat` Subtraction is not needed. Pass 2 mats instead.
**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:
It makes sense to convert this into condition which selects corresponding HAL interface (with the same step value, or with different values)
**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:
`y_reference_mat.copyTo(y_padded_mat(Rect(0, 0, y_reference_mat.cols, y_reference_mat.rows)));`
**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, but I would prefer this variant, as to keep it uniform with the other tests.
**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:
I think there is no point to support special cases, when we can fall fast to the general case.
**File:** modules/imgproc/src/color_yuv.simd.hpp
**Change Type:** modified
**Context:** PR #19554: different paddings in cvtColorTwoPlane() for biplane YUV420

**Code Changes:**
```diff
@@ -17,11 +17,7 @@ void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
                  uchar * dst_data, size_t dst_step,
                  int width, int height,
                  int depth, int dcn, bool swapBlue, bool isCbCr);
-void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
-                         uchar * dst_data, size_t dst_step,
-                         int dst_width, int dst_height,
-                         int dcn, bool swapBlue, int uIdx);
-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,
```

Review comment:
This redundancy is removed in the 2a6e4fd commit.
**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:
Point here is providing smooth migration and keep support for "old" HALs which don't have support for new API yet.
**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:
Let's rename it according to the test logic.