Skip to content

Remove the redundant codes of cv::convertMaps and mRGBA2RGBA<uchar>#26071

Merged
asmorkalov merged 2 commits intoopencv:4.xfrom
tingboliao:4.x
Sep 3, 2024
Merged

Remove the redundant codes of cv::convertMaps and mRGBA2RGBA<uchar>#26071
asmorkalov merged 2 commits intoopencv:4.xfrom
tingboliao:4.x

Conversation

@tingboliao
Copy link
Copy Markdown
Contributor

@tingboliao tingboliao commented Aug 27, 2024

(1) cv::convertMaps: the branch [else if( m1type == CV_32FC2 && dstm1type == CV_16SC2 ) if( nninterpolate )] is unreachable,
as the condition is satisfied in lines 1959 to 1961, calculated in advance and return directly.
(2) mRGBA2RGBA: dst[0], dst[1], dst[2] and dst[3] is calculated repeatedly. Introduced in #13440

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 another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the 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

cv::convertMaps: the branch [else if( m1type == CV_32FC2 && dstm1type == CV_16SC2 ) if( nninterpolate )] is unreachable,
as the condition is satisfied in lines 1959 to 1961, calculated in advance and return directly.
mRGBA2RGBA<uchar>: dst[0], dst[1], dst[2] and dst[3] is calculated repeatedly.
@asmorkalov asmorkalov added category: imgproc cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) labels Aug 27, 2024
@asmorkalov asmorkalov self-requested a review August 28, 2024 13:24
@asmorkalov asmorkalov added this to the 4.11.0 milestone Sep 2, 2024
@asmorkalov
Copy link
Copy Markdown
Contributor

@fengyuentau could you take a look too. The patch looks relevant for me.

@asmorkalov asmorkalov self-assigned this Sep 3, 2024
@asmorkalov asmorkalov merged commit 88f99ed into opencv:4.x Sep 3, 2024
@asmorkalov asmorkalov mentioned this pull request Sep 10, 2024
thewoz pushed a commit to CobbsLab/OPENCV that referenced this pull request Feb 13, 2025
Remove the redundant codes of cv::convertMaps and mRGBA2RGBA<uchar> opencv#26071

(1) cv::convertMaps: the branch [else if( m1type == CV_32FC2 && dstm1type == CV_16SC2 ) if( nninterpolate )] is unreachable,
    as the condition is satisfied in lines 1959 to 1961, calculated in advance and return directly.
(2) mRGBA2RGBA<uchar>: dst[0], dst[1], dst[2] and dst[3] is calculated repeatedly. Introduced in opencv#13440

### 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 another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: imgproc cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants