From b6b869ddeec2c61ea733dd9bc07632a96e9f7a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 1 May 2024 11:58:53 +0200 Subject: [PATCH] Remove float_dsp.cpp, inline the functions --- Common/Common.vcxproj | 1 - Common/Common.vcxproj.filters | 3 -- UWP/CommonUWP/CommonUWP.vcxproj | 2 - UWP/CommonUWP/CommonUWP.vcxproj.filters | 6 --- android/jni/Android.mk | 1 - ext/at3_standalone/CMakeLists.txt | 1 - ext/at3_standalone/float_dsp.cpp | 43 --------------------- ext/at3_standalone/float_dsp.h | 51 ++++++++++++++++--------- libretro/Makefile.common | 1 - 9 files changed, 32 insertions(+), 77 deletions(-) delete mode 100644 ext/at3_standalone/float_dsp.cpp diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index 8745044801..73c7f834ab 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -604,7 +604,6 @@ - diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index 50f2086669..2fa42ddc7c 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -1029,9 +1029,6 @@ ext\at3_standalone - - ext\at3_standalone - ext\at3_standalone diff --git a/UWP/CommonUWP/CommonUWP.vcxproj b/UWP/CommonUWP/CommonUWP.vcxproj index 4939854018..5d6e99ea6a 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj +++ b/UWP/CommonUWP/CommonUWP.vcxproj @@ -248,7 +248,6 @@ - @@ -401,7 +400,6 @@ - diff --git a/UWP/CommonUWP/CommonUWP.vcxproj.filters b/UWP/CommonUWP/CommonUWP.vcxproj.filters index bea74ab0cc..1795ce8645 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj.filters +++ b/UWP/CommonUWP/CommonUWP.vcxproj.filters @@ -486,9 +486,6 @@ ext\at3_standalone - - ext\at3_standalone - ext\at3_standalone @@ -937,9 +934,6 @@ ext\at3_standalone - - ext\at3_standalone - ext\at3_standalone diff --git a/android/jni/Android.mk b/android/jni/Android.mk index f6ddf4100e..838a037439 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -121,7 +121,6 @@ AT3_STANDALONE_FILES := \ ${SRC}/ext/at3_standalone/get_bits.cpp \ ${SRC}/ext/at3_standalone/compat.cpp \ ${SRC}/ext/at3_standalone/fft.cpp \ - ${SRC}/ext/at3_standalone/float_dsp.cpp \ ${SRC}/ext/at3_standalone/mem.cpp \ ${SRC}/ext/at3_standalone/sinewin.cpp diff --git a/ext/at3_standalone/CMakeLists.txt b/ext/at3_standalone/CMakeLists.txt index e9c5452b13..e3b282c5ce 100644 --- a/ext/at3_standalone/CMakeLists.txt +++ b/ext/at3_standalone/CMakeLists.txt @@ -14,7 +14,6 @@ set(ALL_SOURCE_FILES ${SRC_DIR}/get_bits.cpp ${SRC_DIR}/compat.cpp ${SRC_DIR}/fft.cpp - ${SRC_DIR}/float_dsp.cpp ${SRC_DIR}/mem.cpp ${SRC_DIR}/sinewin.cpp ) diff --git a/ext/at3_standalone/float_dsp.cpp b/ext/at3_standalone/float_dsp.cpp deleted file mode 100644 index 75dbdb6918..0000000000 --- a/ext/at3_standalone/float_dsp.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2005 Balatoni Denes - * Copyright 2006 Loren Merritt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "compat.h" -#include "float_dsp.h" -#include "mem.h" - -void vector_fmul(float *dst, const float *src0, const float *src1, int len) { - int i; - for (i = 0; i < len; i++) - dst[i] = src0[i] * src1[i]; -} - -void vector_fmul_scalar(float *dst, const float *src, float mul, int len) { - int i; - for (i = 0; i < len; i++) - dst[i] = src[i] * mul; -} - -void vector_fmul_reverse(float *dst, const float *src0, const float *src1, int len) { - int i; - src1 += len - 1; - for (i = 0; i < len; i++) - dst[i] = src0[i] * src1[-i]; -} diff --git a/ext/at3_standalone/float_dsp.h b/ext/at3_standalone/float_dsp.h index c379dd17ba..f02764382f 100644 --- a/ext/at3_standalone/float_dsp.h +++ b/ext/at3_standalone/float_dsp.h @@ -18,26 +18,39 @@ #pragma once -void vector_fmul(float *dst, const float *src0, const float *src1, int len); +inline void vector_fmul(float *dst, const float *src0, const float *src1, int len) { + int i; + for (i = 0; i < len; i++) + dst[i] = src0[i] * src1[i]; +} /** - * Multiply a vector of floats by a scalar float. Source and - * destination vectors must overlap exactly or not at all. - */ -void vector_fmul_scalar(float *dst, const float *src, float mul, int len); +* Multiply a vector of floats by a scalar float. Source and +* destination vectors must overlap exactly or not at all. +*/ +inline void vector_fmul_scalar(float *dst, const float *src, float mul, int len) { + int i; + for (i = 0; i < len; i++) + dst[i] = src[i] * mul; +} /** - * Calculate the entry wise product of two vectors of floats, and store the result - * in a vector of floats. The second vector of floats is iterated over - * in reverse order. - * - * @param dst output vector - * constraints: 32-byte aligned - * @param src0 first input vector - * constraints: 32-byte aligned - * @param src1 second input vector - * constraints: 32-byte aligned - * @param len number of elements in the input - * constraints: multiple of 16 - */ -void vector_fmul_reverse(float *dst, const float *src0, const float *src1, int len); +* Calculate the entry wise product of two vectors of floats, and store the result +* in a vector of floats. The second vector of floats is iterated over +* in reverse order. +* +* @param dst output vector +* constraints: 32-byte aligned +* @param src0 first input vector +* constraints: 32-byte aligned +* @param src1 second input vector +* constraints: 32-byte aligned +* @param len number of elements in the input +* constraints: multiple of 16 +*/ +inline void vector_fmul_reverse(float *dst, const float *src0, const float *src1, int len) { + int i; + src1 += len - 1; + for (i = 0; i < len; i++) + dst[i] = src0[i] * src1[-i]; +} diff --git a/libretro/Makefile.common b/libretro/Makefile.common index 7e6a998116..75b51cdef5 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -271,7 +271,6 @@ SOURCES_CXX += \ ${EXTDIR}/at3_standalone/get_bits.cpp \ ${EXTDIR}/at3_standalone/compat.cpp \ ${EXTDIR}/at3_standalone/fft.cpp \ - ${EXTDIR}/at3_standalone/float_dsp.cpp \ ${EXTDIR}/at3_standalone/mem.cpp \ ${EXTDIR}/at3_standalone/sinewin.cpp