[FFmpeg-cvslog] lavc/audiodsp: drop opposite sign optimisation

Rémi Denis-Courmont git at videolan.org
Thu Aug 1 22:54:32 EEST 2024


ffmpeg | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 25 22:50:35 2024 +0300| [c48213b2dc0b6329359a84e0d332e4697d84ea90] | committer: Rémi Denis-Courmont

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c48213b2dc0b6329359a84e0d332e4697d84ea90
---

 libavcodec/audiodsp.c | 35 -----------------------------------
 1 file changed, 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];
 



More information about the ffmpeg-cvslog mailing list