mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Move audio resampler drivers (Sinc/nearest) to libretro-common; maister gave permission to relicense to MIT
This commit is contained in:
parent
7af2e2e6b8
commit
08a60c94d0
@ -210,11 +210,11 @@ OBJ += frontend/frontend.o \
|
|||||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
|
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
|
||||||
gfx/font_driver.o \
|
gfx/font_driver.o \
|
||||||
gfx/video_filter.o \
|
gfx/video_filter.o \
|
||||||
audio/audio_resampler_driver.o \
|
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.o \
|
||||||
audio/audio_dsp_filter.o \
|
audio/audio_dsp_filter.o \
|
||||||
audio/drivers_resampler/sinc_resampler.o \
|
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.o \
|
||||||
audio/drivers_resampler/nearest_resampler.o \
|
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.o \
|
||||||
audio/drivers_resampler/null_resampler.o \
|
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/null_resampler.o \
|
||||||
location/drivers/nulllocation.o \
|
location/drivers/nulllocation.o \
|
||||||
camera/drivers/nullcamera.o \
|
camera/drivers/nullcamera.o \
|
||||||
wifi/drivers/nullwifi.o \
|
wifi/drivers/nullwifi.o \
|
||||||
@ -431,12 +431,12 @@ ifeq ($(HAVE_NEON),1)
|
|||||||
DEFINES += -DSINC_LOWER_QUALITY
|
DEFINES += -DSINC_LOWER_QUALITY
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJ += $(LIBRETRO_COMM_DIR)/conversion/s16_to_float.o \
|
OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.o \
|
||||||
$(LIBRETRO_COMM_DIR)/conversion/float_to_s16.o
|
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o
|
||||||
|
|
||||||
ifeq ($(HAVE_NEON),1)
|
ifeq ($(HAVE_NEON),1)
|
||||||
OBJ += $(LIBRETRO_COMM_DIR)/conversion/s16_to_float_neon.o \
|
OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float_neon.o \
|
||||||
$(LIBRETRO_COMM_DIR)/conversion/float_to_s16_neon.o
|
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16_neon.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring Win32,$(OS)),)
|
ifneq ($(findstring Win32,$(OS)),)
|
||||||
|
@ -219,18 +219,19 @@ else ifeq ($(platform), vita)
|
|||||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||||
-lSceMotion_stub -lSceAppMgr_stub -lpng -lm -lc
|
-lSceMotion_stub -lSceAppMgr_stub -lpng -lm -lc
|
||||||
|
|
||||||
PLATEXTRA := deps/libvita2d/shader/compiled/clear_v_gxp.o \
|
PLATEXTRA := deps/libvita2d/shader/compiled/clear_v_gxp.o \
|
||||||
deps/libvita2d/shader/compiled/clear_f_gxp.o \
|
deps/libvita2d/shader/compiled/clear_f_gxp.o \
|
||||||
deps/libvita2d/shader/compiled/color_v_gxp.o \
|
deps/libvita2d/shader/compiled/color_v_gxp.o \
|
||||||
deps/libvita2d/shader/compiled/color_f_gxp.o \
|
deps/libvita2d/shader/compiled/color_f_gxp.o \
|
||||||
deps/libvita2d/shader/compiled/texture_v_gxp.o \
|
deps/libvita2d/shader/compiled/texture_v_gxp.o \
|
||||||
deps/libvita2d/shader/compiled/texture_f_gxp.o \
|
deps/libvita2d/shader/compiled/texture_f_gxp.o \
|
||||||
deps/libvita2d/shader/compiled/texture_tint_f_gxp.o
|
deps/libvita2d/shader/compiled/texture_tint_f_gxp.o
|
||||||
PLATOBJS += libretro-common/conversion/s16_to_float_neon.o \
|
PLATOBJS += \
|
||||||
libretro-common/conversion/float_to_s16_neon.o \
|
libretro-common/conversion/s16_to_float_neon.o \
|
||||||
memory/neon/memcpy-neon.o \
|
libretro-common/conversion/float_to_s16_neon.o \
|
||||||
audio/drivers_resampler/sinc_resampler_neon.o \
|
memory/neon/memcpy-neon.o \
|
||||||
audio/drivers_resampler/cc_resampler_neon.o
|
libretro-common/audio/resampler/drivers/sinc_resampler_neon.o \
|
||||||
|
audio/drivers_resampler/cc_resampler_neon.o
|
||||||
|
|
||||||
LIBDIRS += -L.
|
LIBDIRS += -L.
|
||||||
LDFLAGS += -Wl,-q
|
LDFLAGS += -Wl,-q
|
||||||
|
@ -19,8 +19,9 @@
|
|||||||
#include <retro_assert.h>
|
#include <retro_assert.h>
|
||||||
|
|
||||||
#include <lists/string_list.h>
|
#include <lists/string_list.h>
|
||||||
#include <conversion/float_to_s16.h>
|
#include <audio/conversion/float_to_s16.h>
|
||||||
#include <conversion/s16_to_float.h>
|
#include <audio/conversion/s16_to_float.h>
|
||||||
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
@ -28,9 +29,8 @@
|
|||||||
|
|
||||||
#include "audio_driver.h"
|
#include "audio_driver.h"
|
||||||
#include "audio_dsp_filter.h"
|
#include "audio_dsp_filter.h"
|
||||||
#include "audio_resampler_driver.h"
|
|
||||||
#include "../record/record_driver.h"
|
|
||||||
#include "audio_thread_wrapper.h"
|
#include "audio_thread_wrapper.h"
|
||||||
|
#include "../record/record_driver.h"
|
||||||
|
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
#include "../network/netplay/netplay.h"
|
#include "../network/netplay/netplay.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <memalign.h>
|
#include <memalign.h>
|
||||||
#include <math/float_minmax.h>
|
#include <math/float_minmax.h>
|
||||||
|
|
||||||
#include "../audio_resampler_driver.h"
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
/* Since SSE and NEON don't provide support for trigonometric functions
|
/* Since SSE and NEON don't provide support for trigonometric functions
|
||||||
* we approximate those with polynoms
|
* we approximate those with polynoms
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2014-2016 - Ali Bouhlel ( aliaspider@gmail.com )
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* RetroArch 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "../audio_resampler_driver.h"
|
|
||||||
typedef struct rarch_null_resampler
|
|
||||||
{
|
|
||||||
void *empty;
|
|
||||||
} rarch_null_resampler_t;
|
|
||||||
|
|
||||||
static void resampler_null_process(
|
|
||||||
void *re_, struct resampler_data *data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void resampler_null_free(void *re_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *resampler_null_init(const struct resampler_config *config,
|
|
||||||
double bandwidth_mod, resampler_simd_mask_t mask)
|
|
||||||
{
|
|
||||||
return (void*)0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rarch_resampler_t null_resampler = {
|
|
||||||
resampler_null_init,
|
|
||||||
resampler_null_process,
|
|
||||||
resampler_null_free,
|
|
||||||
RESAMPLER_API_VERSION,
|
|
||||||
"null",
|
|
||||||
"null"
|
|
||||||
};
|
|
@ -1,66 +0,0 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* RetroArch 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#if defined(__ARM_NEON__)
|
|
||||||
|
|
||||||
#ifndef __MACH__
|
|
||||||
.arm
|
|
||||||
#endif
|
|
||||||
.align 4
|
|
||||||
.globl process_sinc_neon_asm
|
|
||||||
#ifndef __MACH__
|
|
||||||
.type process_sinc_neon_asm, %function
|
|
||||||
#endif
|
|
||||||
.globl _process_sinc_neon_asm
|
|
||||||
#ifndef __MACH__
|
|
||||||
.type _process_sinc_neon_asm, %function
|
|
||||||
#endif
|
|
||||||
# void process_sinc_neon(float *out, const float *left, const float *right, const float *coeff, unsigned taps)
|
|
||||||
# Assumes taps is >= 8, and a multiple of 8.
|
|
||||||
process_sinc_neon_asm:
|
|
||||||
_process_sinc_neon_asm:
|
|
||||||
|
|
||||||
push {r4, lr}
|
|
||||||
vmov.f32 q0, #0.0
|
|
||||||
vmov.f32 q8, #0.0
|
|
||||||
|
|
||||||
# Taps argument (r4) goes on stack in armeabi.
|
|
||||||
ldr r4, [sp, #8]
|
|
||||||
|
|
||||||
1:
|
|
||||||
# Left
|
|
||||||
vld1.f32 {q2-q3}, [r1]!
|
|
||||||
# Right
|
|
||||||
vld1.f32 {q10-q11}, [r2]!
|
|
||||||
# Coeff
|
|
||||||
vld1.f32 {q12-q13}, [r3, :128]!
|
|
||||||
|
|
||||||
# Left / Right
|
|
||||||
vmla.f32 q0, q2, q12
|
|
||||||
vmla.f32 q8, q10, q12
|
|
||||||
vmla.f32 q0, q3, q13
|
|
||||||
vmla.f32 q8, q11, q13
|
|
||||||
|
|
||||||
subs r4, r4, #8
|
|
||||||
bne 1b
|
|
||||||
|
|
||||||
# Add everything together
|
|
||||||
vadd.f32 d0, d0, d1
|
|
||||||
vadd.f32 d16, d16, d17
|
|
||||||
vpadd.f32 d0, d0, d16
|
|
||||||
vst1.f32 d0, [r0]
|
|
||||||
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
#endif
|
|
3
driver.c
3
driver.c
@ -18,6 +18,8 @@
|
|||||||
#include <compat/posix_string.h>
|
#include <compat/posix_string.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
|
|
||||||
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
@ -30,7 +32,6 @@
|
|||||||
#include "msg_hash.h"
|
#include "msg_hash.h"
|
||||||
|
|
||||||
#include "audio/audio_driver.h"
|
#include "audio/audio_driver.h"
|
||||||
#include "audio/audio_resampler_driver.h"
|
|
||||||
#include "camera/camera_driver.h"
|
#include "camera/camera_driver.h"
|
||||||
#include "record/record_driver.h"
|
#include "record/record_driver.h"
|
||||||
#include "location/location_driver.h"
|
#include "location/location_driver.h"
|
||||||
|
@ -556,10 +556,10 @@ FIFO BUFFER
|
|||||||
/*============================================================
|
/*============================================================
|
||||||
AUDIO RESAMPLER
|
AUDIO RESAMPLER
|
||||||
============================================================ */
|
============================================================ */
|
||||||
#include "../audio/audio_resampler_driver.c"
|
#include "../libretro-common/audio/resampler/audio_resampler.c"
|
||||||
#include "../audio/drivers_resampler/sinc_resampler.c"
|
#include "../libretro-common/audio/resampler/drivers/sinc_resampler.c"
|
||||||
#include "../audio/drivers_resampler/nearest_resampler.c"
|
#include "../libretro-common/audio/resampler/drivers/nearest_resampler.c"
|
||||||
#include "../audio/drivers_resampler/null_resampler.c"
|
#include "../libretro-common/audio/resampler/drivers/null_resampler.c"
|
||||||
#ifdef HAVE_CC_RESAMPLER
|
#ifdef HAVE_CC_RESAMPLER
|
||||||
#include "../audio/drivers_resampler/cc_resampler.c"
|
#include "../audio/drivers_resampler/cc_resampler.c"
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <features/features_cpu.h>
|
#include <features/features_cpu.h>
|
||||||
#include <conversion/float_to_s16.h>
|
#include <audio/conversion/float_to_s16.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convert_float_to_s16_C:
|
* convert_float_to_s16_C:
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
#include <features/features_cpu.h>
|
#include <features/features_cpu.h>
|
||||||
#include <conversion/s16_to_float.h>
|
#include <audio/conversion/s16_to_float.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convert_s16_to_float_C:
|
* convert_s16_to_float_C:
|
@ -1,17 +1,23 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* Copyright (C) 2010-2016 The RetroArch team
|
||||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* RetroArch 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
|
* The following license statement only applies to this file (audio_resampler.c).
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* ---------------------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* Permission is hereby granted, free of charge,
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -20,7 +26,7 @@
|
|||||||
#include <features/features_cpu.h>
|
#include <features/features_cpu.h>
|
||||||
#include <file/config_file_userdata.h>
|
#include <file/config_file_userdata.h>
|
||||||
|
|
||||||
#include "audio_resampler_driver.h"
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
static const rarch_resampler_t *resampler_drivers[] = {
|
static const rarch_resampler_t *resampler_drivers[] = {
|
||||||
&sinc_resampler,
|
&sinc_resampler,
|
@ -1,23 +1,31 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* Copyright (C) 2010-2016 The RetroArch team
|
||||||
* Copyright (C) 2014-2016 - Ali Bouhlel ( aliaspider@gmail.com )
|
|
||||||
*
|
*
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
* ---------------------------------------------------------------------------------------
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
* The following license statement only applies to this file (nearest_resampler.c).
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
* ---------------------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* Permission is hereby granted, free of charge,
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* to deal in the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "../audio_resampler_driver.h"
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
typedef struct rarch_nearest_resampler
|
typedef struct rarch_nearest_resampler
|
||||||
{
|
{
|
||||||
float fraction;
|
float fraction;
|
56
libretro-common/audio/resampler/drivers/null_resampler.c
Normal file
56
libretro-common/audio/resampler/drivers/null_resampler.c
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/* Copyright (C) 2010-2016 The RetroArch team
|
||||||
|
*
|
||||||
|
* ---------------------------------------------------------------------------------------
|
||||||
|
* The following license statement only applies to this file (null_resampler.c).
|
||||||
|
* ---------------------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge,
|
||||||
|
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
|
typedef struct rarch_null_resampler
|
||||||
|
{
|
||||||
|
void *empty;
|
||||||
|
} rarch_null_resampler_t;
|
||||||
|
|
||||||
|
static void resampler_null_process(
|
||||||
|
void *re_, struct resampler_data *data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void resampler_null_free(void *re_)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *resampler_null_init(const struct resampler_config *config,
|
||||||
|
double bandwidth_mod, resampler_simd_mask_t mask)
|
||||||
|
{
|
||||||
|
return (void*)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
rarch_resampler_t null_resampler = {
|
||||||
|
resampler_null_init,
|
||||||
|
resampler_null_process,
|
||||||
|
resampler_null_free,
|
||||||
|
RESAMPLER_API_VERSION,
|
||||||
|
"null",
|
||||||
|
"null"
|
||||||
|
};
|
@ -1,16 +1,23 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* Copyright (C) 2010-2016 The RetroArch team
|
||||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* RetroArch 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
|
* The following license statement only applies to this file (sinc_resampler.c).
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* ---------------------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* Permission is hereby granted, free of charge,
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Bog-standard windowed SINC implementation. */
|
/* Bog-standard windowed SINC implementation. */
|
||||||
@ -28,7 +35,7 @@
|
|||||||
#include <filters.h>
|
#include <filters.h>
|
||||||
#include <memalign.h>
|
#include <memalign.h>
|
||||||
|
|
||||||
#include "../audio_resampler_driver.h"
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
/* Rough SNR values for upsampling:
|
/* Rough SNR values for upsampling:
|
||||||
* LOWEST: 40 dB
|
* LOWEST: 40 dB
|
@ -0,0 +1,74 @@
|
|||||||
|
/* Copyright (C) 2010-2016 The RetroArch team
|
||||||
|
*
|
||||||
|
* ---------------------------------------------------------------------------------------
|
||||||
|
* The following license statement only applies to this file (sinc_resampler_neon.S).
|
||||||
|
* ---------------------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge,
|
||||||
|
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(__ARM_NEON__)
|
||||||
|
|
||||||
|
#ifndef __MACH__
|
||||||
|
.arm
|
||||||
|
#endif
|
||||||
|
.align 4
|
||||||
|
.globl process_sinc_neon_asm
|
||||||
|
#ifndef __MACH__
|
||||||
|
.type process_sinc_neon_asm, %function
|
||||||
|
#endif
|
||||||
|
.globl _process_sinc_neon_asm
|
||||||
|
#ifndef __MACH__
|
||||||
|
.type _process_sinc_neon_asm, %function
|
||||||
|
#endif
|
||||||
|
# void process_sinc_neon(float *out, const float *left, const float *right, const float *coeff, unsigned taps)
|
||||||
|
# Assumes taps is >= 8, and a multiple of 8.
|
||||||
|
process_sinc_neon_asm:
|
||||||
|
_process_sinc_neon_asm:
|
||||||
|
|
||||||
|
push {r4, lr}
|
||||||
|
vmov.f32 q0, #0.0
|
||||||
|
vmov.f32 q8, #0.0
|
||||||
|
|
||||||
|
# Taps argument (r4) goes on stack in armeabi.
|
||||||
|
ldr r4, [sp, #8]
|
||||||
|
|
||||||
|
1:
|
||||||
|
# Left
|
||||||
|
vld1.f32 {q2-q3}, [r1]!
|
||||||
|
# Right
|
||||||
|
vld1.f32 {q10-q11}, [r2]!
|
||||||
|
# Coeff
|
||||||
|
vld1.f32 {q12-q13}, [r3, :128]!
|
||||||
|
|
||||||
|
# Left / Right
|
||||||
|
vmla.f32 q0, q2, q12
|
||||||
|
vmla.f32 q8, q10, q12
|
||||||
|
vmla.f32 q0, q3, q13
|
||||||
|
vmla.f32 q8, q11, q13
|
||||||
|
|
||||||
|
subs r4, r4, #8
|
||||||
|
bne 1b
|
||||||
|
|
||||||
|
# Add everything together
|
||||||
|
vadd.f32 d0, d0, d1
|
||||||
|
vadd.f32 d16, d16, d17
|
||||||
|
vpadd.f32 d0, d0, d16
|
||||||
|
vst1.f32 d0, [r0]
|
||||||
|
|
||||||
|
pop {r4, pc}
|
||||||
|
|
||||||
|
#endif
|
@ -1,22 +1,27 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
/* Copyright (C) 2010-2016 The RetroArch team
|
||||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* RetroArch 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
|
* The following license statement only applies to this file (audio_resampler.h).
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
* ---------------------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
* Permission is hereby granted, free of charge,
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __LIBRETRO_SDK_AUDIO_RESAMPLER_DRIVER_H
|
||||||
#ifndef __AUDIO_RESAMPLER_DRIVER_H
|
#define __LIBRETRO_SDK_AUDIO_RESAMPLER_DRIVER_H
|
||||||
#define __AUDIO_RESAMPLER_DRIVER_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
@ -21,6 +21,8 @@
|
|||||||
#include <lists/string_list.h>
|
#include <lists/string_list.h>
|
||||||
#include <compat/strl.h>
|
#include <compat/strl.h>
|
||||||
|
|
||||||
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
@ -49,7 +51,6 @@
|
|||||||
#include "input/input_hid_driver.h"
|
#include "input/input_hid_driver.h"
|
||||||
#include "input/input_joypad_driver.h"
|
#include "input/input_joypad_driver.h"
|
||||||
#include "audio/audio_driver.h"
|
#include "audio/audio_driver.h"
|
||||||
#include "audio/audio_resampler_driver.h"
|
|
||||||
#include "record/record_driver.h"
|
#include "record/record_driver.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include <compat/strl.h>
|
#include <compat/strl.h>
|
||||||
|
|
||||||
|
#include <audio/audio_resampler.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#endif
|
#endif
|
||||||
@ -69,7 +71,6 @@
|
|||||||
#include "../location/location_driver.h"
|
#include "../location/location_driver.h"
|
||||||
#include "../record/record_driver.h"
|
#include "../record/record_driver.h"
|
||||||
#include "../audio/audio_driver.h"
|
#include "../audio/audio_driver.h"
|
||||||
#include "../audio/audio_resampler_driver.h"
|
|
||||||
#include "../input/input_config.h"
|
#include "../input/input_config.h"
|
||||||
#include "../tasks/tasks_internal.h"
|
#include "../tasks/tasks_internal.h"
|
||||||
#include "../config.def.h"
|
#include "../config.def.h"
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
0FDA2A911BE1AFA800F2B5DA /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
0FDA2A911BE1AFA800F2B5DA /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
0FDA2A921BE1AFA800F2B5DA /* RetroArch_iOS9-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "RetroArch_iOS9-Info.plist"; path = "/Users/buildbot/buildbot/ios/retroarch/pkg/apple/RetroArch_iOS9-Info.plist"; sourceTree = "<absolute>"; };
|
0FDA2A921BE1AFA800F2B5DA /* RetroArch_iOS9-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "RetroArch_iOS9-Info.plist"; path = "/Users/buildbot/buildbot/ios/retroarch/pkg/apple/RetroArch_iOS9-Info.plist"; sourceTree = "<absolute>"; };
|
||||||
501232C9192E5FC40063A359 /* griffin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = griffin.c; path = ../../griffin/griffin.c; sourceTree = SOURCE_ROOT; };
|
501232C9192E5FC40063A359 /* griffin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = griffin.c; path = ../../griffin/griffin.c; sourceTree = SOURCE_ROOT; };
|
||||||
501232CB192E5FDC0063A359 /* sinc_resampler_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = sinc_resampler_neon.S; path = ../../audio/drivers_resampler/sinc_resampler_neon.S; sourceTree = SOURCE_ROOT; };
|
501232CB192E5FDC0063A359 /* sinc_resampler_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = sinc_resampler_neon.S; path = ../../libretro-common/audio/resampler/drivers/sinc_resampler_neon.S; sourceTree = SOURCE_ROOT; };
|
||||||
501232CD192E5FE30063A359 /* s16_to_float_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = s16_to_float_neon.S; path = "../../libretro-common/conversion/s16_to_float_neon.S"; sourceTree = SOURCE_ROOT; };
|
501232CD192E5FE30063A359 /* s16_to_float_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = s16_to_float_neon.S; path = "../../libretro-common/conversion/s16_to_float_neon.S"; sourceTree = SOURCE_ROOT; };
|
||||||
501881EB184BAD6D006F665D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
501881EB184BAD6D006F665D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||||
501881ED184BB54C006F665D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
|
501881ED184BB54C006F665D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
0FDA2A911BE1AFA800F2B5DA /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
0FDA2A911BE1AFA800F2B5DA /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
0FDA2A921BE1AFA800F2B5DA /* RetroArch_iOS9-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "RetroArch_iOS9-Info.plist"; path = "/Users/buildbot/buildbot/ios/retroarch/pkg/apple/RetroArch_iOS9-Info.plist"; sourceTree = "<absolute>"; };
|
0FDA2A921BE1AFA800F2B5DA /* RetroArch_iOS9-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "RetroArch_iOS9-Info.plist"; path = "/Users/buildbot/buildbot/ios/retroarch/pkg/apple/RetroArch_iOS9-Info.plist"; sourceTree = "<absolute>"; };
|
||||||
501232C9192E5FC40063A359 /* griffin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = griffin.c; path = ../../griffin/griffin.c; sourceTree = SOURCE_ROOT; };
|
501232C9192E5FC40063A359 /* griffin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = griffin.c; path = ../../griffin/griffin.c; sourceTree = SOURCE_ROOT; };
|
||||||
501232CB192E5FDC0063A359 /* sinc_resampler_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = sinc_resampler_neon.S; path = ../../audio/drivers_resampler/sinc_resampler_neon.S; sourceTree = SOURCE_ROOT; };
|
501232CB192E5FDC0063A359 /* sinc_resampler_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = sinc_resampler_neon.S; path = ../../libretro-common/audio/resampler/drivers/sinc_resampler_neon.S; sourceTree = SOURCE_ROOT; };
|
||||||
501232CD192E5FE30063A359 /* s16_to_float_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = s16_to_float_neon.S; path = "../../libretro-common/conversion/s16_to_float_neon.S"; sourceTree = SOURCE_ROOT; };
|
501232CD192E5FE30063A359 /* s16_to_float_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = s16_to_float_neon.S; path = "../../libretro-common/conversion/s16_to_float_neon.S"; sourceTree = SOURCE_ROOT; };
|
||||||
501881EB184BAD6D006F665D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
501881EB184BAD6D006F665D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||||
501881ED184BB54C006F665D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
|
501881ED184BB54C006F665D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
|
||||||
|
@ -30,8 +30,9 @@
|
|||||||
#include <gfx/scaler/scaler.h>
|
#include <gfx/scaler/scaler.h>
|
||||||
#include <gfx/video_frame.h>
|
#include <gfx/video_frame.h>
|
||||||
#include <file/config_file.h>
|
#include <file/config_file.h>
|
||||||
#include <conversion/float_to_s16.h>
|
#include <audio/audio_resampler.h>
|
||||||
#include <conversion/s16_to_float.h>
|
#include <audio/conversion/float_to_s16.h>
|
||||||
|
#include <audio/conversion/s16_to_float.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
@ -68,7 +69,6 @@ extern "C" {
|
|||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../gfx/video_driver.h"
|
#include "../../gfx/video_driver.h"
|
||||||
#include "../../audio/audio_resampler_driver.h"
|
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user