|
|
|
@ -4102,13 +4102,13 @@ static inline uint32_t clipf_c_one(uint32_t a, uint32_t mini, |
|
|
|
|
else return a; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void vector_clipf_c_opposite_sign(float *dst, float *src, float *min, float *max, int len){ |
|
|
|
|
static void vector_clipf_c_opposite_sign(float *dst, const float *src, float *min, float *max, int len){ |
|
|
|
|
int i; |
|
|
|
|
uint32_t mini = *(uint32_t*)min; |
|
|
|
|
uint32_t maxi = *(uint32_t*)max; |
|
|
|
|
uint32_t maxisign = maxi ^ (1<<31); |
|
|
|
|
uint32_t *dsti = (uint32_t*)dst; |
|
|
|
|
uint32_t *srci = (uint32_t*)src; |
|
|
|
|
const uint32_t *srci = (const uint32_t*)src; |
|
|
|
|
for(i=0; i<len; i+=8) { |
|
|
|
|
dsti[i + 0] = clipf_c_one(srci[i + 0], mini, maxi, maxisign); |
|
|
|
|
dsti[i + 1] = clipf_c_one(srci[i + 1], mini, maxi, maxisign); |
|
|
|
@ -4120,7 +4120,7 @@ static void vector_clipf_c_opposite_sign(float *dst, float *src, float *min, flo |
|
|
|
|
dsti[i + 7] = clipf_c_one(srci[i + 7], mini, maxi, maxisign); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
static void vector_clipf_c(float *dst, float *src, float min, float max, int len){ |
|
|
|
|
static void vector_clipf_c(float *dst, const float *src, float min, float max, int len){ |
|
|
|
|
int i; |
|
|
|
|
if(min < 0 && max > 0) { |
|
|
|
|
vector_clipf_c_opposite_sign(dst, src, &min, &max, len); |
|
|
|
|