Conversation
modules/core/src/arithm.cpp
Outdated
| int res; | ||
| res = cv_hal_mul8u16u(/* src1_data */ &ua, /* src1_step */ 1, /* src2_data */ &ub, /* src2_step */ 1, | ||
| /* dst_data */ &uc, /* dst_step */ 1, /* width */ 1, /* height */ 1, /* scale */ 1); | ||
| if (res == CV_HAL_ERROR_NOT_IMPLEMENTED) |
There was a problem hiding this comment.
The HAL function may return not implemented status, if size is to small or data is not aligned. Static pre-check does not work.
modules/core/src/arithm.cpp
Outdated
| void* usrdata) | ||
| { | ||
| double scale = *((double*)usrdata); | ||
| cv_hal_mul8s16s((schar*)src1, step1, (schar*)src2, step2, (short*)dst, step, width, height, scale); |
There was a problem hiding this comment.
cv_hal_mul8s16s and cv_hal_mul8u16u return value is not checked. They may return error or not implemented status.
There was a problem hiding this comment.
Have an ugly solution for this, please take a look
modules/core/src/arithm.cpp
Outdated
|
|
||
| arithm_op(src1, src2, dst, noArray(), dtype, getMulTab(), | ||
| true, &scale, std::abs(scale - 1.0) < DBL_EPSILON ? OCL_OP_MUL : OCL_OP_MUL_SCALE); | ||
| static bool halMul8to16available = (cv_hal_mul8u16u != hal_ni_mul8u16u) && (cv_hal_mul8s16s != hal_ni_mul8s16s); |
There was a problem hiding this comment.
What if HAL implements only one of them?
|
Can we replace |
modules/core/src/arithm.cpp
Outdated
| Mat src1 = psrc1->getMat(), src2 = psrc2->getMat(), dst = _dst.getMat(); | ||
| Size sz = getContinuousSize2D(src1, src2, dst, src1.channels()); | ||
| tab[depth1](src1.ptr(), src1.step, src2.ptr(), src2.step, dst.ptr(), dst.step, sz.width, sz.height, usrdata); | ||
| if (extendedFunc(src1.ptr(), src1.step, src2.ptr(), src2.step, |
There was a problem hiding this comment.
if (!extendedFunc || extendedFunc() != 0)
modules/core/src/arithm.cpp
Outdated
| { | ||
| double scale = *((double*)usrdata); | ||
| int res = cv_hal_mul8u16u(src1, step1, src2, step2, (ushort *)dst, step, width, height, scale); | ||
| if (res == 0 || res == CV_HAL_ERROR_NOT_IMPLEMENTED) |
There was a problem hiding this comment.
Use constant instead of 0.
HAL mul8x8to16 added opencv#25506 Fixes opencv#25034 See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
HAL mul8x8to16 added opencv#25506 Fixes opencv#25034 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
HAL mul8x8to16 added opencv#25506 Fixes opencv#25034 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
fixes #25034
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.