Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8207549

Browse filesBrowse files
authored
Merge pull request opencv#26991 from fengyuentau:4x/core/norm2hal_rvv
core: improve norm of hal rvv opencv#26991 Merge with opencv/opencv_extra#1241 ### 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 - [ ] 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. - [ ] The feature is well documented and sample code can be built with the project CMake
1 parent 0142231 commit 8207549
Copy full SHA for 8207549

File tree

Expand file treeCollapse file tree

5 files changed

+1046
-672
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+1046
-672
lines changed
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This file is part of OpenCV project.
2+
// It is subject to the license terms in the LICENSE file found in the top-level directory
3+
// of this distribution and at http://opencv.org/license.html.
4+
5+
#ifndef OPENCV_HAL_RVV_COMMON_HPP_INCLUDED
6+
#define OPENCV_HAL_RVV_COMMON_HPP_INCLUDED
7+
8+
#include <riscv_vector.h>
9+
10+
namespace cv { namespace cv_hal_rvv { namespace custom_intrin {
11+
12+
#define CV_HAL_RVV_COMMON_CUSTOM_INTRIN_ABS(_Tpvs, _Tpvd, shift, suffix) \
13+
inline _Tpvd __riscv_vabs(const _Tpvs& v, const int vl) { \
14+
_Tpvs mask = __riscv_vsra(v, shift, vl); \
15+
_Tpvs v_xor = __riscv_vxor(v, mask, vl); \
16+
return __riscv_vreinterpret_##suffix( \
17+
__riscv_vsub(v_xor, mask, vl) \
18+
); \
19+
}
20+
21+
CV_HAL_RVV_COMMON_CUSTOM_INTRIN_ABS(vint8m2_t, vuint8m2_t, 7, u8m2)
22+
CV_HAL_RVV_COMMON_CUSTOM_INTRIN_ABS(vint8m8_t, vuint8m8_t, 7, u8m8)
23+
CV_HAL_RVV_COMMON_CUSTOM_INTRIN_ABS(vint16m4_t, vuint16m4_t, 15, u16m4)
24+
CV_HAL_RVV_COMMON_CUSTOM_INTRIN_ABS(vint16m8_t, vuint16m8_t, 15, u16m8)
25+
CV_HAL_RVV_COMMON_CUSTOM_INTRIN_ABS(vint32m4_t, vuint32m4_t, 31, u32m4)
26+
CV_HAL_RVV_COMMON_CUSTOM_INTRIN_ABS(vint32m8_t, vuint32m8_t, 31, u32m8)
27+
28+
}}} // cv::cv_hal_rvv::custom_intrin
29+
30+
#endif

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.