From: "Rémi Denis-Courmont" <remi@remlab.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 3/6] lavc/audiodsp: drop opposite sign optimisation
Date: Thu, 25 Jul 2024 23:25:17 +0300
Message-ID: <20240725202522.276182-3-remi@remlab.net> (raw)
In-Reply-To: <20240725202522.276182-1-remi@remlab.net>
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.
---
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];
--
2.45.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-07-25 20:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 20:25 [FFmpeg-devel] [PATCH 1/6] lavu/riscv: implement floating point clips Rémi Denis-Courmont
2024-07-25 20:25 ` [FFmpeg-devel] [PATCH 2/6] lavc/audiodsp: properly unroll vector_clipf Rémi Denis-Courmont
2024-07-25 20:25 ` Rémi Denis-Courmont [this message]
2024-07-25 20:25 ` [FFmpeg-devel] [PATCH 4/6] lavc/audiodsp: drop R-V F vector_clipf Rémi Denis-Courmont
2024-07-25 20:25 ` [FFmpeg-devel] [PATCH 5/6] lavc/riscv: drop probing for F & D extensions Rémi Denis-Courmont
2024-07-25 20:25 ` [FFmpeg-devel] [PATCH 6/6] lavu/cpu: deprecate AV_CPU_FLAG_RV{F, D} Rémi Denis-Courmont
2024-07-26 9:16 ` Andreas Rheinhardt
2024-07-27 12:22 ` Rémi Denis-Courmont
2024-07-27 12:27 ` Rémi Denis-Courmont
2024-07-26 6:23 ` [FFmpeg-devel] [PATCH 1/6] lavu/riscv: implement floating point clips Rémi Denis-Courmont
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240725202522.276182-3-remi@remlab.net \
--to=remi@remlab.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git