From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 906434AF3E for ; Thu, 25 Jul 2024 20:25:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A836A68D7AC; Thu, 25 Jul 2024 23:25:31 +0300 (EEST) Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DC85268D762 for ; Thu, 25 Jul 2024 23:25:23 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 4AE4EC01F0 for ; Thu, 25 Jul 2024 23:25:23 +0300 (EEST) From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jul 2024 23:25:17 +0300 Message-ID: <20240725202522.276182-3-remi@remlab.net> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240725202522.276182-1-remi@remlab.net> References: <20240725202522.276182-1-remi@remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] lavc/audiodsp: drop opposite sign optimisation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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".