Content-Length: 353410 | pFad | http://github.com/opencv/opencv/pull/26752/files

2C imgproc: fix performance regressions of c3 kernels of warp functions by fengyuentau · Pull Request #26752 · opencv/opencv · GitHub
Skip to content

imgproc: fix performance regressions of c3 kernels of warp functions #26752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,42 @@ template <> inline void v_store<8>(ushort* ptr, const v_uint16& a)
ptr[4] = buf[4]; ptr[5] = buf[5]; ptr[6] = buf[6]; ptr[7] = buf[7];
}

template <int N = VTraits<v_uint32>::max_nlanes>
inline void v_store(unsigned* ptr, const v_uint32& a)
{
unsigned buf[VTraits<v_uint32>::max_nlanes];
v_store(buf, a);
for (int i = 0; i < N; i++) {
ptr[i] = buf[i];
}
}

template <> inline void v_store<4>(unsigned* ptr, const v_uint32& a)
{
unsigned buf[VTraits<v_uint32>::max_nlanes];
v_store(buf, a);
ptr[0] = buf[0]; ptr[1] = buf[1];
ptr[2] = buf[2]; ptr[3] = buf[3];
}

template <int N = VTraits<v_int32>::max_nlanes>
inline void v_store(int* ptr, const v_int32& a)
{
int buf[VTraits<v_int32>::max_nlanes];
v_store(buf, a);
for (int i = 0; i < N; i++) {
ptr[i] = buf[i];
}
}

template <> inline void v_store<4>(int* ptr, const v_int32& a)
{
int buf[VTraits<v_int32>::max_nlanes];
v_store(buf, a);
ptr[0] = buf[0]; ptr[1] = buf[1];
ptr[2] = buf[2]; ptr[3] = buf[3];
}

template <int N = VTraits<v_float32>::max_nlanes>
inline void v_store(float* ptr, const v_float32& a)
{
Expand Down Expand Up @@ -1674,6 +1710,42 @@ OPENCV_HAL_IMPL_RVV_EXPAND(short, v_int32, vint32m4_t, v_int16, 16, i32, i16, __
OPENCV_HAL_IMPL_RVV_EXPAND(uint, v_uint64, vuint64m4_t, v_uint32, 32, u64, u32, __riscv_vwcvtu_x)
OPENCV_HAL_IMPL_RVV_EXPAND(int, v_int64, vint64m4_t, v_int32, 32, i64, i32, __riscv_vwcvt_x)

template <int N = VTraits<v_uint32>::max_nlanes>
inline v_uint32 v_load(const unsigned* ptr)
{
unsigned buf[VTraits<v_uint32>::max_nlanes];
v_store(buf, v_setzero_u32());
for (int i = 0; i < N; i++) {
buf[i] = ptr[i];
}
return v_load(buf);
}
template <> inline v_uint32 v_load<4>(const unsigned* ptr)
{
unsigned buf[VTraits<v_uint32>::max_nlanes];
v_store(buf, v_setzero_u32());
buf[0] = ptr[0]; buf[1] = ptr[1]; buf[2] = ptr[2]; buf[3] = ptr[3];
return v_load(buf);
}

template <int N = VTraits<v_int32>::max_nlanes>
inline v_int32 v_load(const int* ptr)
{
int buf[VTraits<v_int32>::max_nlanes];
v_store(buf, v_setzero_s32());
for (int i = 0; i < N; i++) {
buf[i] = ptr[i];
}
return v_load(buf);
}
template <> inline v_int32 v_load<4>(const int* ptr)
{
int buf[VTraits<v_int32>::max_nlanes];
v_store(buf, v_setzero_s32());
buf[0] = ptr[0]; buf[1] = ptr[1]; buf[2] = ptr[2]; buf[3] = ptr[3];
return v_load(buf);
}

template <int N = VTraits<v_float32>::max_nlanes>
inline v_float32 v_load(const float* ptr)
{
Expand Down
Loading
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/opencv/opencv/pull/26752/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy