Skip to content

Fix YUV indexes + YUV Planner detection condition#20529

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
saikatnanda:master
Aug 12, 2021
Merged

Fix YUV indexes + YUV Planner detection condition#20529
opencv-pushbot merged 1 commit intoopencv:masterfrom
saikatnanda:master

Conversation

@saikatnanda
Copy link
Copy Markdown

@saikatnanda saikatnanda commented Aug 10, 2021

continues #20509

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

The code was crashing on buffer.insert() line#330 on Android 11 Emulator with Camera2 NDK. This is tested with a C++ Test Application.

It looks like the U & V indexes are reversed and the YUVPlaner check condition is having an assignment operator than ==.
This fix satisfies the YUV buffer memory layout expectation as in https://en.wikipedia.org/wiki/YUV#/media/File:Yuv420.svg

@saikatnanda
Copy link
Copy Markdown
Author

@komakai I have created this fresh PR to address the crash issue. The changes are rolled up into one commit after rebasing with latest master. Hopefully this helps to address the build failure.

@saikatnanda
Copy link
Copy Markdown
Author

@komakai are we in good shape for this PR to move on?

@komakai
Copy link
Copy Markdown
Contributor

komakai commented Aug 11, 2021

@komakai are we in good shape for this PR to move on?

@saikatnanda from my point of view looks good. But you'll need one of the maintainers to review/merge (@alalek ?)

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.

@saikatnanda Thank you for contribution 👍

@komakai Thank you for the review!

@opencv-pushbot opencv-pushbot merged commit 0f8efb0 into opencv:master Aug 12, 2021
@saikatnanda
Copy link
Copy Markdown
Author

Thanks @alalek and @komakai

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.

5 participants