diff options
author | Rémi Denis-Courmont <remi@remlab.net> | 2024-07-25 22:50:35 +0300 |
---|---|---|
committer | Rémi Denis-Courmont <remi@remlab.net> | 2024-08-01 19:29:40 +0300 |
commit | c48213b2dc0b6329359a84e0d332e4697d84ea90 (patch) | |
tree | ed979bbb0b849b29473f9334a7ed0558da2365a7 /libavcodec | |
parent | d86b6767ce98fda133e2b8f7f954a497eab2e528 (diff) | |
download | ffmpeg-c48213b2dc0b6329359a84e0d332e4697d84ea90.tar.gz |
lavc/audiodsp: drop opposite sign optimisation
This was added along side the original SSE(one) DSP function in
0a68cd876e14f76a00df7bb8edbfeb350f8ef617 without rationale. This was
presumably faster on x87, which is no longer relevant since we pretty
much assume SSE2 or later on x86.
Meanwhile this function is ~2.5x slower than the normal floating point
one on SiFive-U74.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/audiodsp.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/libavcodec/audiodsp.c b/libavcodec/audiodsp.c index 9e83f06aaa..fd6a00345f 100644 --- a/libavcodec/audiodsp.c +++ b/libavcodec/audiodsp.c @@ -22,44 +22,9 @@ #include "libavutil/common.h" #include "audiodsp.h" -static inline float clipf_c_one(float a, uint32_t mini, - uint32_t maxi, uint32_t maxisign) -{ - uint32_t ai = av_float2int(a); - - if (ai > mini) - return av_int2float(mini); - else if ((ai ^ (1U << 31)) > maxisign) - return av_int2float(maxi); - else - return a; -} - -static void vector_clipf_c_opposite_sign(float *dst, const float *src, - float min, float max, int len) -{ - uint32_t mini = av_float2int(min); - uint32_t maxi = av_float2int(max); - uint32_t maxisign = maxi ^ (1U << 31); - - for (int i = 0; i < len; i += 8) { - float tmp[8]; - - for (int j = 0; j < 8; j++) - tmp[j]= clipf_c_one(src[i + j], mini, maxi, maxisign); - for (int j = 0; j < 8; j++) - dst[i + j] = tmp[j]; - } -} - static void vector_clipf_c(float *dst, const float *src, int len, float min, float max) { - if (min < 0 && max > 0) { - vector_clipf_c_opposite_sign(dst, src, min, max, len); - return; - } - for (int i = 0; i < len; i += 8) { float tmp[8]; |