Skip to content

Commit afbcc07

Browse files
committed
Merge remote-tracking branch 'origin/drawing_performance' into drawing_performance
# Conflicts: # modules/imgproc/src/drawing.cpp
2 parents 91a0270 + 16a9407 commit afbcc07

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

modules/imgproc/src/drawing.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ EllipseEx( Mat& img, Point2l center, Size2l axes,
10751075
#if (defined(i386) || defined(__i386__) || defined(_M_IX86) || \
10761076
defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
10771077
defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
1078-
defined(__arm__) || defined(_LITTLE_ENDIAN) || defined(LITTLE_ENDIAN))
1078+
defined(__arm__) || defined(__aarch64__) || defined(_LITTLE_ENDIAN) || defined(LITTLE_ENDIAN))
10791079
# define OPENCV_BYTEORDER 1234
10801080
# define OPENCV_BIGENDIAN 0
10811081
# define OPENCV_LITTLEENDIAN 1
@@ -1086,6 +1086,7 @@ EllipseEx( Mat& img, Point2l center, Size2l axes,
10861086
#endif
10871087

10881088
#if !defined(OPENCV_BYTEORDER)
1089+
# define OPENCV_BYTEORDER 0
10891090
static const int opencvOne = 1;
10901091
# define OPENCV_BIGENDIAN (*((const char *)(&opencvOne))==0)
10911092
# define OPENCV_LITTLEENDIAN (*((const char *)(&opencvOne))==1)
@@ -1102,12 +1103,13 @@ static const int opencvOne = 1;
11021103
# endif
11031104
# endif
11041105

1106+
/*
11051107
static inline uint32_t opencvBigToHost32(const uchar* p){
11061108
#if OPENCV_BYTEORDER==4321
11071109
uint32_t x;
11081110
memcpy(&x,p,4);
11091111
return x;
1110-
#elif OPENCV_BYTEORDER==1234 && defined(__GNUC__) && GCC_VERSION>=4003000
1112+
#elif OPENCV_BYTEORDER==1234 && defined(__GNUC__)
11111113
uint32_t x;
11121114
memcpy(&x,p,4);
11131115
return __builtin_bswap32(x);
@@ -1127,27 +1129,30 @@ static inline uint32_t opencvBigToHost32(uint32_t x){
11271129
return opencvBigToHost32((uchar*)&x);
11281130
#endif
11291131
}
1132+
*/
11301133

11311134
static inline uint32_t opencvLittleToHost32(const uchar* p){
11321135
#if OPENCV_BYTEORDER==1234
11331136
uint32_t x;
11341137
memcpy(&x,p,4);
11351138
return x;
1136-
#elif OPENCV_BYTEORDER==4321 && defined(__GNUC__) && GCC_VERSION>=4003000
1139+
#elif OPENCV_BYTEORDER==4321 && defined(__GNUC__)
11371140
uint32_t x;
11381141
memcpy(&x,p,4);
11391142
return __builtin_bswap32(x);
11401143
#elif OPENCV_BYTEORDER==4321 && defined(_MSC_VER) && _MSC_VER>=1300
11411144
uint32_t x;
11421145
memcpy(&x,p,4);
11431146
return _byteswap_ulong(x);
1147+
#elif OPENCV_LITTLEENDIAN
1148+
return x;
11441149
#else
11451150
return ((unsigned)p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
11461151
#endif
11471152
}
11481153

11491154
static inline uint32_t opencvLittleToHost32(uint32_t x){
1150-
#if OPENCV_BYTEORDER==1234
1155+
#if OPENCV_LITTLEENDIAN
11511156
return x;
11521157
#else
11531158
return opencvLittleToHost32((uchar*)&x);

0 commit comments

Comments
 (0)