Path: blob/master/3rdparty/openvx/hal/openvx_hal.hpp
16337 views
#ifndef OPENCV_OPENVX_HAL_HPP_INCLUDED1#define OPENCV_OPENVX_HAL_HPP_INCLUDED23#include "opencv2/core/hal/interface.h"45#include "VX/vx.h"67template <typename T>8int ovx_hal_add(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);9template <typename T>10int ovx_hal_sub(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);1112template <typename T>13int ovx_hal_absdiff(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);1415template <typename T>16int ovx_hal_and(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);17template <typename T>18int ovx_hal_or(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);19template <typename T>20int ovx_hal_xor(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h);21int ovx_hal_not(const uchar *a, size_t astep, uchar *c, size_t cstep, int w, int h);2223template <typename T>24int ovx_hal_mul(const T *a, size_t astep, const T *b, size_t bstep, T *c, size_t cstep, int w, int h, double scale);2526int ovx_hal_merge8u(const uchar **src_data, uchar *dst_data, int len, int cn);27int ovx_hal_resize(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, double inv_scale_x, double inv_scale_y, int interpolation);28int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[6], int interpolation, int borderType, const double borderValue[4]);29int ovx_hal_warpPerspective(int atype, const uchar *a, size_t astep, int aw, int ah, uchar *b, size_t bstep, int bw, int bh, const double M[9], int interpolation, int borderType, const double borderValue[4]);3031struct cvhalFilter2D;32int ovx_hal_filterInit(cvhalFilter2D **filter_context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height,33int, int, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace);34int ovx_hal_filterFree(cvhalFilter2D *filter_context);35int ovx_hal_filter(cvhalFilter2D *filter_context, uchar *a, size_t astep, uchar *b, size_t bstep, int w, int h, int, int, int, int);36int ovx_hal_sepFilterInit(cvhalFilter2D **filter_context, int src_type, int dst_type,37int kernel_type, uchar *kernelx_data, int kernelx_length, uchar *kernely_data, int kernely_length,38int anchor_x, int anchor_y, double delta, int borderType);3940#if VX_VERSION > VX_VERSION_1_041int ovx_hal_morphInit(cvhalFilter2D **filter_context, int operation, int src_type, int dst_type, int , int ,42int kernel_type, uchar *kernel_data, size_t kernel_step, int kernel_width, int kernel_height, int anchor_x, int anchor_y,43int borderType, const double borderValue[4], int iterations, bool allowSubmatrix, bool allowInplace);44int ovx_hal_morphFree(cvhalFilter2D *filter_context);45int ovx_hal_morph(cvhalFilter2D *filter_context, uchar *a, size_t astep, uchar *b, size_t bstep, int w, int h, int , int , int , int , int , int , int , int );46#endif // 1.0 guard4748int ovx_hal_cvtBGRtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int depth, int acn, int bcn, bool swapBlue);49int ovx_hal_cvtGraytoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int depth, int bcn);50int ovx_hal_cvtTwoPlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int bcn, bool swapBlue, int uIdx);51int ovx_hal_cvtThreePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int bcn, bool swapBlue, int uIdx);52int ovx_hal_cvtBGRtoThreePlaneYUV(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int acn, bool swapBlue, int uIdx);53int ovx_hal_cvtOnePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b, size_t bstep, int w, int h, int bcn, bool swapBlue, int uIdx, int ycn);54int ovx_hal_integral(int depth, int sdepth, int, const uchar * a, size_t astep, uchar * b, size_t bstep, uchar * c, size_t, uchar * d, size_t, int w, int h, int cn);5556//==================================================================================================57// functions redefinition58// ...5960#undef cv_hal_add8u61#define cv_hal_add8u ovx_hal_add<uchar>62#undef cv_hal_add16s63#define cv_hal_add16s ovx_hal_add<short>64#undef cv_hal_sub8u65#define cv_hal_sub8u ovx_hal_sub<uchar>66#undef cv_hal_sub16s67#define cv_hal_sub16s ovx_hal_sub<short>6869#undef cv_hal_absdiff8u70#define cv_hal_absdiff8u ovx_hal_absdiff<uchar>71#undef cv_hal_absdiff16s72#define cv_hal_absdiff16s ovx_hal_absdiff<short>7374#undef cv_hal_and8u75#define cv_hal_and8u ovx_hal_and<uchar>76#undef cv_hal_or8u77#define cv_hal_or8u ovx_hal_or<uchar>78#undef cv_hal_xor8u79#define cv_hal_xor8u ovx_hal_xor<uchar>80#undef cv_hal_not8u81#define cv_hal_not8u ovx_hal_not8283#undef cv_hal_mul8u84#define cv_hal_mul8u ovx_hal_mul<uchar>85#undef cv_hal_mul16s86#define cv_hal_mul16s ovx_hal_mul<short>8788#undef cv_hal_merge8u89#define cv_hal_merge8u ovx_hal_merge8u9091//#undef cv_hal_resize92//#define cv_hal_resize ovx_hal_resize9394//OpenVX warps use round to zero policy at least in sample implementation95//while OpenCV require round to nearest96//#undef cv_hal_warpAffine97//#define cv_hal_warpAffine ovx_hal_warpAffine98//#undef cv_hal_warpPerspective99//#define cv_hal_warpPerspective ovx_hal_warpPerspective100101#undef cv_hal_filterInit102#define cv_hal_filterInit ovx_hal_filterInit103#undef cv_hal_filter104#define cv_hal_filter ovx_hal_filter105#undef cv_hal_filterFree106#define cv_hal_filterFree ovx_hal_filterFree107108//#undef cv_hal_sepFilterInit109//#define cv_hal_sepFilterInit ovx_hal_sepFilterInit110//#undef cv_hal_sepFilter111//#define cv_hal_sepFilter ovx_hal_filter112//#undef cv_hal_sepFilterFree113//#define cv_hal_sepFilterFree ovx_hal_filterFree114115#if VX_VERSION > VX_VERSION_1_0116117#undef cv_hal_morphInit118#define cv_hal_morphInit ovx_hal_morphInit119#undef cv_hal_morph120#define cv_hal_morph ovx_hal_morph121#undef cv_hal_morphFree122#define cv_hal_morphFree ovx_hal_morphFree123124#endif // 1.0 guard125126#undef cv_hal_cvtBGRtoBGR127#define cv_hal_cvtBGRtoBGR ovx_hal_cvtBGRtoBGR128#undef cv_hal_cvtGraytoBGR129#define cv_hal_cvtGraytoBGR ovx_hal_cvtGraytoBGR130#undef cv_hal_cvtTwoPlaneYUVtoBGR131#define cv_hal_cvtTwoPlaneYUVtoBGR ovx_hal_cvtTwoPlaneYUVtoBGR132#undef cv_hal_cvtThreePlaneYUVtoBGR133#define cv_hal_cvtThreePlaneYUVtoBGR ovx_hal_cvtThreePlaneYUVtoBGR134#undef cv_hal_cvtBGRtoThreePlaneYUV135#define cv_hal_cvtBGRtoThreePlaneYUV ovx_hal_cvtBGRtoThreePlaneYUV136#undef cv_hal_cvtOnePlaneYUVtoBGR137#define cv_hal_cvtOnePlaneYUVtoBGR ovx_hal_cvtOnePlaneYUVtoBGR138#undef cv_hal_integral139#define cv_hal_integral ovx_hal_integral140141#endif142143144