From 08a60c94d0b85e35e46e0334aa781bbb061412c9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 12 Dec 2016 13:02:29 +0100 Subject: [PATCH] Move audio resampler drivers (Sinc/nearest) to libretro-common; maister gave permission to relicense to MIT --- Makefile.common | 16 ++-- Makefile.griffin | 25 ++++--- audio/audio_driver.c | 8 +- audio/drivers_resampler/cc_resampler.c | 2 +- audio/drivers_resampler/null_resampler.c | 48 ------------ audio/drivers_resampler/sinc_resampler_neon.S | 66 ----------------- driver.c | 3 +- griffin/griffin.c | 8 +- .../{ => audio}/conversion/float_to_s16.c | 2 +- .../conversion/float_to_s16_neon.S | 0 .../conversion/float_to_s16_neon.c | 0 .../{ => audio}/conversion/s16_to_float.c | 2 +- .../conversion/s16_to_float_neon.S | 0 .../conversion/s16_to_float_neon.c | 0 .../audio/resampler/audio_resampler.c | 32 ++++---- .../resampler/drivers}/nearest_resampler.c | 30 +++++--- .../audio/resampler/drivers/null_resampler.c | 56 ++++++++++++++ .../audio/resampler/drivers}/sinc_resampler.c | 31 +++++--- .../resampler/drivers/sinc_resampler_neon.S | 74 +++++++++++++++++++ .../include/audio/audio_resampler.h | 35 +++++---- .../{ => audio}/conversion/float_to_s16.h | 0 .../{ => audio}/conversion/s16_to_float.h | 0 list_special.c | 3 +- menu/menu_setting.c | 3 +- .../RetroArch_iOS.xcodeproj/project.pbxproj | 2 +- .../RetroArch_iOS10.xcodeproj/project.pbxproj | 2 +- record/drivers/record_ffmpeg.c | 6 +- 27 files changed, 250 insertions(+), 204 deletions(-) delete mode 100644 audio/drivers_resampler/null_resampler.c delete mode 100644 audio/drivers_resampler/sinc_resampler_neon.S rename libretro-common/{ => audio}/conversion/float_to_s16.c (99%) rename libretro-common/{ => audio}/conversion/float_to_s16_neon.S (100%) rename libretro-common/{ => audio}/conversion/float_to_s16_neon.c (100%) rename libretro-common/{ => audio}/conversion/s16_to_float.c (99%) rename libretro-common/{ => audio}/conversion/s16_to_float_neon.S (100%) rename libretro-common/{ => audio}/conversion/s16_to_float_neon.c (100%) rename audio/audio_resampler_driver.c => libretro-common/audio/resampler/audio_resampler.c (72%) rename {audio/drivers_resampler => libretro-common/audio/resampler/drivers}/nearest_resampler.c (52%) create mode 100644 libretro-common/audio/resampler/drivers/null_resampler.c rename {audio/drivers_resampler => libretro-common/audio/resampler/drivers}/sinc_resampler.c (90%) create mode 100644 libretro-common/audio/resampler/drivers/sinc_resampler_neon.S rename audio/audio_resampler_driver.h => libretro-common/include/audio/audio_resampler.h (76%) rename libretro-common/include/{ => audio}/conversion/float_to_s16.h (100%) rename libretro-common/include/{ => audio}/conversion/s16_to_float.h (100%) diff --git a/Makefile.common b/Makefile.common index 792725bb5b..9b9fe49306 100644 --- a/Makefile.common +++ b/Makefile.common @@ -210,11 +210,11 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \ gfx/font_driver.o \ gfx/video_filter.o \ - audio/audio_resampler_driver.o \ + $(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.o \ audio/audio_dsp_filter.o \ - audio/drivers_resampler/sinc_resampler.o \ - audio/drivers_resampler/nearest_resampler.o \ - audio/drivers_resampler/null_resampler.o \ + $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.o \ + $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.o \ + $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/null_resampler.o \ location/drivers/nulllocation.o \ camera/drivers/nullcamera.o \ wifi/drivers/nullwifi.o \ @@ -431,12 +431,12 @@ ifeq ($(HAVE_NEON),1) DEFINES += -DSINC_LOWER_QUALITY endif -OBJ += $(LIBRETRO_COMM_DIR)/conversion/s16_to_float.o \ - $(LIBRETRO_COMM_DIR)/conversion/float_to_s16.o +OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.o \ + $(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o ifeq ($(HAVE_NEON),1) - OBJ += $(LIBRETRO_COMM_DIR)/conversion/s16_to_float_neon.o \ - $(LIBRETRO_COMM_DIR)/conversion/float_to_s16_neon.o + OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float_neon.o \ + $(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16_neon.o endif ifneq ($(findstring Win32,$(OS)),) diff --git a/Makefile.griffin b/Makefile.griffin index 24505188e2..a36557e888 100644 --- a/Makefile.griffin +++ b/Makefile.griffin @@ -219,18 +219,19 @@ else ifeq ($(platform), vita) -lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \ -lSceMotion_stub -lSceAppMgr_stub -lpng -lm -lc - PLATEXTRA := deps/libvita2d/shader/compiled/clear_v_gxp.o \ - deps/libvita2d/shader/compiled/clear_f_gxp.o \ - deps/libvita2d/shader/compiled/color_v_gxp.o \ - deps/libvita2d/shader/compiled/color_f_gxp.o \ - deps/libvita2d/shader/compiled/texture_v_gxp.o \ - deps/libvita2d/shader/compiled/texture_f_gxp.o \ - deps/libvita2d/shader/compiled/texture_tint_f_gxp.o - PLATOBJS += libretro-common/conversion/s16_to_float_neon.o \ - libretro-common/conversion/float_to_s16_neon.o \ - memory/neon/memcpy-neon.o \ - audio/drivers_resampler/sinc_resampler_neon.o \ - audio/drivers_resampler/cc_resampler_neon.o + PLATEXTRA := deps/libvita2d/shader/compiled/clear_v_gxp.o \ + deps/libvita2d/shader/compiled/clear_f_gxp.o \ + deps/libvita2d/shader/compiled/color_v_gxp.o \ + deps/libvita2d/shader/compiled/color_f_gxp.o \ + deps/libvita2d/shader/compiled/texture_v_gxp.o \ + deps/libvita2d/shader/compiled/texture_f_gxp.o \ + deps/libvita2d/shader/compiled/texture_tint_f_gxp.o + PLATOBJS += \ + libretro-common/conversion/s16_to_float_neon.o \ + libretro-common/conversion/float_to_s16_neon.o \ + memory/neon/memcpy-neon.o \ + libretro-common/audio/resampler/drivers/sinc_resampler_neon.o \ + audio/drivers_resampler/cc_resampler_neon.o LIBDIRS += -L. LDFLAGS += -Wl,-q diff --git a/audio/audio_driver.c b/audio/audio_driver.c index b951515f80..68e60ec4c5 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -19,8 +19,9 @@ #include #include -#include -#include +#include