Skip to content

different paddings in cvtColorTwoPlane() for biplane YUV420#19554

Merged
alalek merged 3 commits intoopencv:3.4from
amirtu:OCV-215_cvtColorTwoPlane_wrong_output_when_Y_Plane_Mat_has_step
Sep 22, 2021
Merged

different paddings in cvtColorTwoPlane() for biplane YUV420#19554
alalek merged 3 commits intoopencv:3.4from
amirtu:OCV-215_cvtColorTwoPlane_wrong_output_when_Y_Plane_Mat_has_step

Conversation

@amirtu
Copy link
Copy Markdown
Member

@amirtu amirtu commented Feb 18, 2021

fixes #17036

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@amirtu amirtu requested a review from asmorkalov February 18, 2021 10:24
@asmorkalov
Copy link
Copy Markdown
Contributor

@amirtu There is failed test in CI log: missing_check_17036. The test checks that function throws exception, if strides are different. You need to implement the test properly and rename the test according to its logic.

@asmorkalov asmorkalov added category: imgproc optimization pr: needs test New functionality requires minimal tests set labels Feb 18, 2021
@amirtu amirtu changed the title wip: separate steps for image data planes in cvtColorTwoPlane() wip: separate steps for biplane YUV420 in cvtColorTwoPlane() Feb 18, 2021
@amirtu amirtu changed the title wip: separate steps for biplane YUV420 in cvtColorTwoPlane() separate steps for biplane YUV420 in cvtColorTwoPlane() Feb 19, 2021
@amirtu amirtu changed the title separate steps for biplane YUV420 in cvtColorTwoPlane() different paddings in cvtColorTwoPlane() for biplane YUV420 Feb 20, 2021
{
CV_INSTRUMENT_REGION();

const uchar* uv = src_data + src_step * static_cast<size_t>(dst_height);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the pointer arithmetics being done under dispatched branch of code by purpose?

@asmorkalov asmorkalov removed the pr: needs test New functionality requires minimal tests set label Feb 24, 2021
@asmorkalov asmorkalov force-pushed the OCV-215_cvtColorTwoPlane_wrong_output_when_Y_Plane_Mat_has_step branch from 0c861d8 to e6f2066 Compare March 19, 2021 09:01
@asenyaev
Copy link
Copy Markdown
Contributor

asenyaev commented Apr 8, 2021

jenkins cn please retry a build

@asmorkalov asmorkalov force-pushed the OCV-215_cvtColorTwoPlane_wrong_output_when_Y_Plane_Mat_has_step branch from e6f2066 to e84fb22 Compare September 22, 2021 06:06
@asmorkalov
Copy link
Copy Markdown
Contributor

@alalek I fixed build issue for dispatch case and rebased the branch to current 3.4. Please take a look and merge the PR.

Comment on lines +149 to +152
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),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

@alalek alalek merged commit 86a5101 into opencv:3.4 Sep 22, 2021
@alalek alalek mentioned this pull request Sep 25, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants