mirror of
https://github.com/libretro/RetroArch
synced 2025-02-02 14:54:10 +00:00
Add resampler tests for CC resampler.
This commit is contained in:
parent
1d32b3080d
commit
24906b8869
@ -15,7 +15,7 @@ INCDIR = $(PSPPATH)/include
|
||||
CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES = -DPSP -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DWANT_RPNG -DSINC_LOWEST_QUALITY
|
||||
RARCH_DEFINES = -DPSP -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DWANT_RPNG -DSINC_LOWEST_QUALITY -DHAVE_CC_RESAMPLER
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
|
@ -23,10 +23,10 @@
|
||||
#include "../general.h"
|
||||
|
||||
static const rarch_resampler_t *backends[] = {
|
||||
&sinc_resampler,
|
||||
#if defined(PSP)
|
||||
#ifdef HAVE_CC_RESAMPLER
|
||||
&CC_resampler,
|
||||
#endif
|
||||
&sinc_resampler,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@ -42,6 +42,9 @@ static int find_resampler_driver_index(const char *driver)
|
||||
// Resampler is used by multiple modules so avoid clobbering g_extern.audio_data.resampler here.
|
||||
static const rarch_resampler_t *find_resampler_driver(const char *ident)
|
||||
{
|
||||
if (!ident)
|
||||
return backends[0];
|
||||
|
||||
int i = find_resampler_driver_index(ident);
|
||||
if (i >= 0)
|
||||
return backends[i];
|
||||
@ -56,6 +59,7 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef RESAMPLER_TEST
|
||||
void find_prev_resampler_driver(void)
|
||||
{
|
||||
int i = find_resampler_driver_index(g_settings.audio.resampler);
|
||||
@ -73,6 +77,7 @@ void find_next_resampler_driver(void)
|
||||
else
|
||||
RARCH_WARN("Couldn't find any next resampler driver (current one: \"%s\").\n", g_extern.audio_data.resampler->ident);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend, const char *ident, double bw_ratio)
|
||||
{
|
||||
|
@ -51,9 +51,7 @@ typedef struct rarch_resampler
|
||||
} rarch_resampler_t;
|
||||
|
||||
extern const rarch_resampler_t sinc_resampler;
|
||||
#if defined(PSP)
|
||||
extern const rarch_resampler_t CC_resampler;
|
||||
#endif
|
||||
|
||||
// Reallocs resampler. Will free previous handle before allocating a new one.
|
||||
// If ident is NULL, first resampler will be used.
|
||||
|
@ -7,9 +7,11 @@ TESTS := test-sinc-lowest \
|
||||
test-sinc-higher \
|
||||
test-snr-sinc-higher \
|
||||
test-sinc-highest \
|
||||
test-snr-sinc-highest
|
||||
test-snr-sinc-highest \
|
||||
test-cc \
|
||||
test-snr-cc
|
||||
|
||||
CFLAGS += -O3 -ffast-math -g -Wall -pedantic -march=native -std=gnu99 -DRESAMPLER_TEST
|
||||
CFLAGS += -O3 -ffast-math -g -Wall -pedantic -march=native -std=gnu99 -DRESAMPLER_TEST -DRARCH_DUMMY_LOG
|
||||
LDFLAGS += -lm
|
||||
|
||||
all: $(TESTS)
|
||||
@ -17,6 +19,12 @@ all: $(TESTS)
|
||||
resampler-sinc.o: ../resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
resampler-cc.o: ../resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) -DHAVE_CC_RESAMPLER
|
||||
|
||||
cc-resampler.o: ../cc_resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
sinc-lowest.o: ../sinc.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) -DSINC_LOWEST_QUALITY
|
||||
|
||||
@ -62,6 +70,12 @@ test-sinc-highest: sinc-highest.o ../utils.o main.o resampler-sinc.o
|
||||
test-snr-sinc-highest: sinc-highest.o ../utils.o snr.o resampler-sinc.o
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-cc: cc-resampler.o ../utils.o main.o resampler-cc.o sinc.o
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-snr-cc: cc-resampler.o ../utils.o snr.o resampler-cc.o sinc.o
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
|
@ -358,7 +358,7 @@ AUDIO RESAMPLER
|
||||
============================================================ */
|
||||
#include "../audio/resampler.c"
|
||||
#include "../audio/sinc.c"
|
||||
#ifdef PSP
|
||||
#ifdef HAVE_CC_RESAMPLER
|
||||
#include "../audio/cc_resampler.c"
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user