Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Recent HAL changes ported to 4.9#26395

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
savuor wants to merge15 commits intoopencv:4.xfromsavuor:rv/fastcv_hal_4.9
Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
15 commits
Select commitHold shift + click to select a range
67fe2ba
Merge pull request #25789 from asmorkalov:as/HAL_meanStdDev_tails
asmorkalovJun 27, 2024
e8cc13c
Merge pull request #25789 from asmorkalov:as/HAL_meanStdDev_tails
asmorkalovJun 27, 2024
b25db18
Relax equalizeHist test for some HAL implementations.
asmorkalovJun 27, 2024
e5f2be8
Use Carotene implementation of TEGRA_GaussianBlurBinomial 3x3 and 5x5…
asmorkalovJun 20, 2024
153a50a
Merge pull request #25792 from asmorkalov:as/HAL_fast_GaussianBlur
asmorkalovJul 12, 2024
e376ee7
Merge pull request #25936 from savuor:rv/hal_dot
savuorJul 23, 2024
ff8afe8
Report used HAL to test log and xml
asmorkalovJul 23, 2024
2f6c235
Merge pull request #25970 from savuor:rv/hal_pyrdown
savuorAug 6, 2024
a242431
Got rid of CAROTENE_NEON_ARCH and use standard __ARM_ARCH check.
asmorkalovAug 30, 2024
14e4be0
Merge pull request #26080 from asmorkalov:as/HAL_minMaxIdx_ND_offset
asmorkalovAug 30, 2024
a8f2b2b
Excluded nullptr leak to arithmetic HAL got from empty Mat.
asmorkalovSep 6, 2024
5a2e561
Merge pull request #26143 from asmorkalov:as/HAL_opticalFlowLK
asmorkalovSep 16, 2024
ba340ee
Merge pull request #26163 from asmorkalov:as/HAL_schaar_deriv
asmorkalovSep 23, 2024
5ee4f59
OpenCV Acceleration with FastCV HAL changes
sssanjee-quicOct 16, 2024
6f907fb
Fastcv HAL changes for Opencv Acceleration
sssanjee-quicOct 25, 2024
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
PrevPrevious commit
NextNext commit
Merge pull request#25936 from savuor:rv/hal_dot
HAL for dot product added#25936See details athttps://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- [ ] 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
  • Loading branch information
@savuor
savuor authored andRostislav Vasilikhin committedNov 1, 2024
commite376ee7efd4377023d16302ffcb79c5cf5b6b543
157 changes: 157 additions & 0 deletionsmodules/core/src/hal_replacement.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,6 +95,9 @@ inline int hal_ni_sub16s(const short *src1_data, size_t src1_step, const short *
inline int hal_ni_sub32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_sub32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_sub64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }

inline int hal_ni_sub8u32f(const uchar *src1_data, size_t src1_step, const uchar *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_sub8s32f(const schar *src1_data, size_t src1_step, const schar *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @}

/**
Expand DownExpand Up@@ -187,6 +190,8 @@ inline int hal_ni_not8u(const uchar *src_data, size_t src_step, uchar *dst_data,
#define cv_hal_sub32s hal_ni_sub32s
#define cv_hal_sub32f hal_ni_sub32f
#define cv_hal_sub64f hal_ni_sub64f
#define cv_hal_sub8u32f hal_ni_sub8u32f
#define cv_hal_sub8s32f hal_ni_sub8s32f
#define cv_hal_max8u hal_ni_max8u
#define cv_hal_max8s hal_ni_max8s
#define cv_hal_max16u hal_ni_max16u
Expand DownExpand Up@@ -214,6 +219,62 @@ inline int hal_ni_not8u(const uchar *src_data, size_t src_step, uchar *dst_data,
#define cv_hal_not8u hal_ni_not8u
//! @endcond

/**
Lookup table replacement
Table consists of 256 elements of a size from 1 to 8 bytes having 1 channel or src_channels
For 8s input type 128 is added to LUT index
Destination should have the same element type and number of channels as lookup table elements
@param src_data Source image data
@param src_step Source image step
@param src_type Sorce image type
@param lut_data Pointer to lookup table
@param lut_channel_size Size of each channel in bytes
@param lut_channels Number of channels in lookup table
@param dst_data Destination data
@param dst_step Destination step
@param width Width of images
@param height Height of images
@sa LUT
*/
//! @addtogroup core_hal_interface_lut Lookup table
//! @{
inline int hal_ni_lut(const uchar *src_data, size_t src_step, size_t src_type, const uchar* lut_data, size_t lut_channel_size, size_t lut_channels, uchar *dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @}

//! @cond IGNORED
#define cv_hal_lut hal_ni_lut
//! @endcond

/**
Hamming norm of a vector
@param a pointer to vector data
@param n length of a vector
@param cellSize how many bits of the vector will be added and treated as a single bit, can be 1 (standard Hamming distance), 2 or 4
@param result pointer to result output
*/
//! @addtogroup core_hal_interface_hamming Hamming distance
//! @{
inline int hal_ni_normHamming8u(const uchar* a, int n, int cellSize, int* result) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @}

/**
Hamming distance between two vectors
@param a pointer to first vector data
@param b pointer to second vector data
@param n length of vectors
@param cellSize how many bits of the vectors will be added and treated as a single bit, can be 1 (standard Hamming distance), 2 or 4
@param result pointer to result output
*/
//! @addtogroup core_hal_interface_hamming Hamming distance
//! @{
inline int hal_ni_normHammingDiff8u(const uchar* a, const uchar* b, int n, int cellSize, int* result) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @}

//! @cond IGNORED
#define cv_hal_normHamming8u hal_ni_normHamming8u
#define cv_hal_normHammingDiff8u hal_ni_normHammingDiff8u
//! @endcond

/**
Compare: _dst[i] = src1[i] op src2[i]_
@param src1_data first source image data
Expand DownExpand Up@@ -268,6 +329,8 @@ inline int hal_ni_mul16s(const short *src1_data, size_t src1_step, const short *
inline int hal_ni_mul32s(const int *src1_data, size_t src1_step, const int *src2_data, size_t src2_step, int *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_mul32f(const float *src1_data, size_t src1_step, const float *src2_data, size_t src2_step, float *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_mul64f(const double *src1_data, size_t src1_step, const double *src2_data, size_t src2_step, double *dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_mul8u16u(const uchar* src1_data, size_t src1_step, const uchar* src2_data, size_t src2_step, ushort* dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_mul8s16s(const schar* src1_data, size_t src1_step, const schar* src2_data, size_t src2_step, short* dst_data, size_t dst_step, int width, int height, double scale) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @}

/**
Expand DownExpand Up@@ -322,6 +385,8 @@ inline int hal_ni_recip64f(const double *src_data, size_t src_step, double *dst_
#define cv_hal_mul32s hal_ni_mul32s
#define cv_hal_mul32f hal_ni_mul32f
#define cv_hal_mul64f hal_ni_mul64f
#define cv_hal_mul8u16u hal_ni_mul8u16u
#define cv_hal_mul8s16s hal_ni_mul8s16s
#define cv_hal_div8u hal_ni_div8u
#define cv_hal_div8s hal_ni_div8s
#define cv_hal_div16u hal_ni_div16u
Expand DownExpand Up@@ -413,6 +478,24 @@ inline int hal_ni_merge64s(const int64 **src_data, int64 *dst_data, int len, int
#define cv_hal_merge64s hal_ni_merge64s
//! @endcond

/**
@param x source X arrays
@param y source Y arrays
@param mag destination magnitude array
@param angle destination angle array
@param len length of arrays
@param angleInDegrees if set to true return angles in degrees, otherwise in radians
*/
//! @addtogroup core_hal_interface_fastAtan Atan calculation
//! @{
inline int hal_ni_cartToPolar32f(const float* x, const float* y, float* mag, float* angle, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_cartToPolar64f(const double* x, const double* y, double* mag, double* angle, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @}

//! @cond IGNORED
#define cv_hal_cartToPolar32f hal_ni_cartToPolar32f
#define cv_hal_cartToPolar64f hal_ni_cartToPolar64f
//! @endcond

/**
@param y source Y arrays
Expand DownExpand Up@@ -450,6 +533,24 @@ inline int hal_ni_magnitude64f(const double *x, const double *y, double *dst, i
#define cv_hal_magnitude64f hal_ni_magnitude64f
//! @endcond

/**
@param mag source magnitude arrays
@param mag source angle arrays
@param x destination X array
@param y destination Y array
@param len length of arrays
@param angleInDegrees if set to true interpret angles from degrees, otherwise from radians
*/
//! @addtogroup core_hal_interface_fastAtan Atan calculation
//! @{
inline int hal_ni_polarToCart32f(const float* mag, const float* angle, float* x, float* y, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_polarToCart64f(const double* mag, const double* angle, double* x, double* y, int len, bool angleInDegrees) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @}

//! @cond IGNORED
#define cv_hal_polarToCart32f hal_ni_polarToCart32f
#define cv_hal_polarToCart64f hal_ni_polarToCart64f
//! @endcond

/**
@param src source array
Expand DownExpand Up@@ -777,6 +878,48 @@ inline int hal_ni_minMaxIdx(const uchar* src_data, size_t src_step, int width, i
#define cv_hal_minMaxIdx hal_ni_minMaxIdx
//! @endcond

/**
@brief calculates the mean and the standard deviation of array elements independently for each channel
@param src_data Source image
@param src_step Source image
@param width Source image dimensions
@param height Source image dimensions
@param src_type Type of source image
@param mean_val Array of per-channel mean values. May be nullptr, if mean value is not required.
@param stddev_val Array of per-channel standard deviation values. May be nullptr, if stddev value is not required.
@param mask Specified array region.
@param mask_step Mask array step.
@sa meanStdDev
*/
inline int hal_ni_meanStdDev(const uchar* src_data, size_t src_step, int width, int height,
int src_type, double* mean_val, double* stddev_val, uchar* mask, size_t mask_step)
{ return CV_HAL_ERROR_NOT_IMPLEMENTED; }

//! @cond IGNORED
#define cv_hal_meanStdDev hal_ni_meanStdDev
//! @endcond

/**
* @brief calculates dot product of two vectors (represented as 2d images)
*
* @param a_data Pointer to 1st 2nd image data
* @param a_step Stride of 1st 2nd image
* @param b_data Pointer to 1st 2nd image data
* @param b_step Stride of 1st 2nd image
* @param width Width of both images
* @param height Height of both images
* @param type Data type of both images, for example CV_8U or CV_32F
* @param dot_val Pointer to resulting dot product value
* @return int
*/
inline int hal_ni_dotProduct(const uchar* a_data, size_t a_step, const uchar* b_data, size_t b_step, int width, int height,
int type, double *dot_val)
{ return CV_HAL_ERROR_NOT_IMPLEMENTED; }

//! @cond IGNORED
#define cv_hal_dotProduct hal_ni_dotProduct
//! @endcond

/**
@brief hal_flip
@param src_type source and destination image type
Expand DownExpand Up@@ -818,6 +961,20 @@ inline int hal_ni_rotate90(int src_type, const uchar* src_data, size_t src_step,
#define cv_hal_rotate90 hal_ni_rotate90
//! @endcond

/**
@brief Transpose2d
@param src_data,src_step Source image
@param dst_data,dst_step Destination image
@param src_width,src_height Source image dimensions
@param element_size Size of an element in bytes
*/
inline int hal_ni_transpose2d(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int src_width,
int src_height, int element_size) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }

//! @cond IGNORED
#define cv_hal_transpose2d hal_ni_transpose2d
//! @endcond

//! @}


Expand Down
11 changes: 10 additions & 1 deletionmodules/core/src/matmul.dispatch.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -995,9 +995,18 @@ double Mat::dot(InputArray _mat) const
CV_INSTRUMENT_REGION();

Mat mat = _mat.getMat();
CV_Assert_N( mat.type() == type(), mat.size == size);

int cn = channels();
if (this->dims <= 2)
{
double product = 0;
CALL_HAL_RET(dotProduct, cv_hal_dotProduct, product, this->data, this->step, mat.data, mat.step,
this->cols * cn, this->rows, this->depth());
}

DotProdFunc func = getDotProdFunc(depth());
CV_Assert_N( mat.type() == type(), mat.size == size,func != 0 );
CV_Assert(func != 0 );

if( isContinuous() && mat.isContinuous() )
{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp