mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-08 17:28:49 -10:00
(Resampler) One place builds an int16 backend, and the mixer uses it
The integer counterpart of a float backend was selected by an if-chain on short_ident, written out three times in audio_driver.c - the front pair, the extra-channel pairs and the microphone - and a fourth site did not select at all: audio_mixer.c called sinc_resampler_int16_init() outright, for both the one-shot WAV conversion and the streaming s16 voice. So with CC or nearest chosen, the game stream went through the selected backend while menu sounds and BGM went through sinc, and those voices honoured Resampler Quality while the stream did not. retro_resampler_int16_new() is that selection, once, in libretro-common. It resolves the name through the same lookup retro_resampler_realloc() uses, so NULL or an unknown name lands on the fallback, and it hands back the instance with its process, reset and free - zeroed when the backend has no integer implementation, which is the caller's signal to keep the float path. The quality mapping onto sinc's own enum, which audio_driver.c and audio_mixer.c each carried a copy of, lives there too. It goes in its own unit rather than audio_resampler.c: a target that never asks for an integer backend links none of the three int16 drivers, which putting it beside the driver table would have forced on every consumer of audio_resampler.o. audio_mixer_play_s16() takes the resampler_ident its float twin has always taken, and the s16 voice carries the whole handle rather than a bare pointer with sinc's functions assumed around it. The HQ policy now reads RESAMPLER_CAP_HQ_OVERSAMPLE rather than comparing the backend against &sinc_resampler, so extra_capacity's stand-in for "another backend" clears that bit instead of relying on its address.
This commit is contained in:
1 parent
4820970267
commit
4d5f87fdbe
39 files changed
+278
-165
No files matched your search
@@ -401,6 +401,7 @@ DEFINES += -DHAVE_WINDOW_OFFSET
|
||||
endif
|
||||
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.o
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.o
|
||||
|
||||
ifeq ($(HAVE_DSP_FILTER), 1)
|
||||
DEFINES += -DHAVE_DSP_FILTER
|
||||
|
||||
+23
-87
@@ -597,23 +597,6 @@ static bool audio_driver_resampler_realloc(audio_driver_state_t *audio_st,
|
||||
return initialized;
|
||||
}
|
||||
|
||||
/* Map the shared resampler quality enum onto the integer sinc driver's own
|
||||
* quality enum (they use different orderings). */
|
||||
static enum sinc_int16_quality audio_sinc_int16_quality_map(
|
||||
enum resampler_quality q)
|
||||
{
|
||||
switch (q)
|
||||
{
|
||||
case RESAMPLER_QUALITY_LOWEST: return SINC_INT16_QUALITY_LOWEST;
|
||||
case RESAMPLER_QUALITY_LOWER: return SINC_INT16_QUALITY_LOWER;
|
||||
case RESAMPLER_QUALITY_HIGHER: return SINC_INT16_QUALITY_HIGHER;
|
||||
case RESAMPLER_QUALITY_HIGHEST: return SINC_INT16_QUALITY_HIGHEST;
|
||||
case RESAMPLER_QUALITY_NORMAL:
|
||||
case RESAMPLER_QUALITY_DONTCARE:
|
||||
default: return SINC_INT16_QUALITY_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
size_t audio_driver_get_underruns(void)
|
||||
{
|
||||
audio_driver_state_t *audio_st = &audio_driver_st;
|
||||
@@ -655,21 +638,13 @@ static void audio_driver_extra_free(audio_driver_state_t *audio_st)
|
||||
/* An int16 resampler instance of the kind the front pair uses. */
|
||||
static void *audio_driver_int16_resampler_new(audio_driver_state_t *audio_st)
|
||||
{
|
||||
const char *rs_ident = (audio_st->resampler && audio_st->resampler->short_ident)
|
||||
? audio_st->resampler->short_ident : "";
|
||||
if (string_is_equal(rs_ident, "sinc"))
|
||||
return sinc_resampler_int16_init_hq(audio_st->src_ratio_orig,
|
||||
audio_sinc_int16_quality_map(audio_st->resampler_quality),
|
||||
audio_st->resampler_hq);
|
||||
#ifdef HAVE_NEAREST_RESAMPLER
|
||||
if (string_is_equal(rs_ident, "nearest"))
|
||||
return nearest_resampler_int16_init();
|
||||
#endif
|
||||
#ifdef HAVE_CC_RESAMPLER
|
||||
if (string_is_equal(rs_ident, "cc"))
|
||||
return cc_resampler_int16_init(audio_st->src_ratio_orig);
|
||||
#endif
|
||||
return NULL;
|
||||
retro_resampler_int16_t rs;
|
||||
retro_resampler_int16_new(&rs,
|
||||
(audio_st->resampler && audio_st->resampler->short_ident)
|
||||
? audio_st->resampler->short_ident : NULL,
|
||||
audio_st->resampler_quality, audio_st->src_ratio_orig,
|
||||
audio_st->resampler_hq);
|
||||
return rs.data;
|
||||
}
|
||||
|
||||
/* Room for a batch of extras: the buffers, and resampler instances of
|
||||
@@ -4473,35 +4448,14 @@ bool audio_driver_init_internal(void *settings_data, bool audio_cb_inited)
|
||||
&& audio_driver_st.resampler->short_ident)
|
||||
{
|
||||
const char *rs_ident = audio_driver_st.resampler->short_ident;
|
||||
if (string_is_equal(rs_ident, "sinc"))
|
||||
{
|
||||
audio_driver_st.resampler_data_int16 = sinc_resampler_int16_init_hq(
|
||||
audio_driver_st.src_ratio_orig,
|
||||
audio_sinc_int16_quality_map(audio_driver_st.resampler_quality),
|
||||
audio_driver_st.resampler_hq);
|
||||
audio_driver_st.resampler_int16_process = sinc_resampler_int16_process;
|
||||
audio_driver_st.resampler_int16_free = sinc_resampler_int16_free;
|
||||
audio_driver_st.resampler_int16_reset = sinc_resampler_int16_reset;
|
||||
}
|
||||
#ifdef HAVE_NEAREST_RESAMPLER
|
||||
else if (string_is_equal(rs_ident, "nearest"))
|
||||
{
|
||||
audio_driver_st.resampler_data_int16 = nearest_resampler_int16_init();
|
||||
audio_driver_st.resampler_int16_process = nearest_resampler_int16_process;
|
||||
audio_driver_st.resampler_int16_free = nearest_resampler_int16_free;
|
||||
audio_driver_st.resampler_int16_reset = nearest_resampler_int16_reset;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_CC_RESAMPLER
|
||||
else if (string_is_equal(rs_ident, "cc"))
|
||||
{
|
||||
audio_driver_st.resampler_data_int16 = cc_resampler_int16_init(
|
||||
audio_driver_st.src_ratio_orig);
|
||||
audio_driver_st.resampler_int16_process = cc_resampler_int16_process;
|
||||
audio_driver_st.resampler_int16_free = cc_resampler_int16_free;
|
||||
audio_driver_st.resampler_int16_reset = cc_resampler_int16_reset;
|
||||
}
|
||||
#endif
|
||||
retro_resampler_int16_t rs;
|
||||
retro_resampler_int16_new(&rs, rs_ident,
|
||||
audio_driver_st.resampler_quality,
|
||||
audio_driver_st.src_ratio_orig, audio_driver_st.resampler_hq);
|
||||
audio_driver_st.resampler_data_int16 = rs.data;
|
||||
audio_driver_st.resampler_int16_process = rs.process;
|
||||
audio_driver_st.resampler_int16_free = rs.free;
|
||||
audio_driver_st.resampler_int16_reset = rs.reset;
|
||||
if (audio_driver_st.resampler_int16_process)
|
||||
RARCH_LOG("[Audio] %s resampler: integer s16 path %s.\n",
|
||||
rs_ident,
|
||||
@@ -7774,6 +7728,7 @@ bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params)
|
||||
if (audio_driver_mixer_use_s16(audio_driver_st.stat_core_is_float))
|
||||
voice = audio_mixer_play_s16(handle, looped,
|
||||
GAIN_TO_Q16(params->volume),
|
||||
audio_driver_st.resampler_ident,
|
||||
audio_driver_st.resampler_quality, stop_cb);
|
||||
else
|
||||
voice = audio_mixer_play(handle, looped, params->volume,
|
||||
@@ -7864,6 +7819,7 @@ static void audio_driver_mixer_play_stream_internal(
|
||||
audio_mixer_play_s16(audio_driver_st.mixer_streams[i].handle,
|
||||
(type == AUDIO_STREAM_STATE_PLAYING_LOOPED) ? true : false,
|
||||
AUDIO_MIXER_GAIN_UNITY,
|
||||
audio_driver_st.resampler_ident,
|
||||
audio_driver_st.resampler_quality,
|
||||
audio_driver_st.mixer_streams[i].stop_cb);
|
||||
else
|
||||
@@ -9430,32 +9386,12 @@ static bool mic_driver_open_mic_internal(retro_microphone_t* microphone)
|
||||
&& microphone->resampler
|
||||
&& microphone->resampler->short_ident)
|
||||
{
|
||||
const char *rs_ident = microphone->resampler->short_ident;
|
||||
if (string_is_equal(rs_ident, "sinc"))
|
||||
{
|
||||
microphone->resampler_data_int16 = sinc_resampler_int16_init(
|
||||
microphone->orig_ratio,
|
||||
audio_sinc_int16_quality_map(mic_st->resampler_quality));
|
||||
microphone->resampler_int16_process = sinc_resampler_int16_process;
|
||||
microphone->resampler_int16_free = sinc_resampler_int16_free;
|
||||
}
|
||||
#ifdef HAVE_NEAREST_RESAMPLER
|
||||
else if (string_is_equal(rs_ident, "nearest"))
|
||||
{
|
||||
microphone->resampler_data_int16 = nearest_resampler_int16_init();
|
||||
microphone->resampler_int16_process = nearest_resampler_int16_process;
|
||||
microphone->resampler_int16_free = nearest_resampler_int16_free;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_CC_RESAMPLER
|
||||
else if (string_is_equal(rs_ident, "cc"))
|
||||
{
|
||||
microphone->resampler_data_int16 = cc_resampler_int16_init(
|
||||
microphone->orig_ratio);
|
||||
microphone->resampler_int16_process = cc_resampler_int16_process;
|
||||
microphone->resampler_int16_free = cc_resampler_int16_free;
|
||||
}
|
||||
#endif
|
||||
retro_resampler_int16_t rs;
|
||||
retro_resampler_int16_new(&rs, microphone->resampler->short_ident,
|
||||
mic_st->resampler_quality, microphone->orig_ratio, false);
|
||||
microphone->resampler_data_int16 = rs.data;
|
||||
microphone->resampler_int16_process = rs.process;
|
||||
microphone->resampler_int16_free = rs.free;
|
||||
if (!microphone->resampler_data_int16)
|
||||
{
|
||||
microphone->resampler_int16_process = NULL;
|
||||
|
||||
@@ -942,6 +942,7 @@ FIFO BUFFER
|
||||
AUDIO RESAMPLER
|
||||
============================================================ */
|
||||
#include "../libretro-common/audio/resampler/audio_resampler.c"
|
||||
#include "../libretro-common/audio/resampler/audio_resampler_int16.c"
|
||||
#include "../libretro-common/audio/resampler/drivers/sinc_resampler.c"
|
||||
#include "../libretro-common/audio/resampler/drivers/sinc_resampler_int16.c"
|
||||
#ifdef HAVE_NEAREST_RESAMPLER
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* Two voice pipelines, kept apart on purpose. audio_mixer_play makes
|
||||
* a float voice mixed by audio_mixer_mix; audio_mixer_play_s16 makes a
|
||||
* fixed-point voice, resampled by the integer sinc resampler (quality
|
||||
* mapped in audio_mixer_i16_quality) and mixed with integer gain and
|
||||
* mapped by the resampler layer) and mixed with integer gain and
|
||||
* saturation by audio_mixer_mix_s16. Nothing is decoded in one
|
||||
* pipeline and converted into the other - a WAV sound keeps its source
|
||||
* bytes so either pipeline builds from the original, and frame counts
|
||||
@@ -64,7 +64,6 @@
|
||||
|
||||
#include <audio/audio_mixer.h>
|
||||
#include <audio/audio_resampler.h>
|
||||
#include <audio/sinc_resampler_int16.h>
|
||||
|
||||
#ifdef HAVE_RWAV
|
||||
#include <formats/rwav.h>
|
||||
@@ -218,7 +217,7 @@ struct audio_mixer_voice
|
||||
* and past the stack-probe threshold on Windows, so every call
|
||||
* paid a chkstk page walk before doing any work. */
|
||||
int16_t *decode_buf_s16;
|
||||
void *resampler_int16;
|
||||
retro_resampler_int16_t resampler_int16;
|
||||
} stream;
|
||||
#endif
|
||||
|
||||
@@ -794,19 +793,6 @@ static int32_t audio_mixer_gain_s16(int16_t s, int32_t gain_q16)
|
||||
#ifdef AUDIO_MIXER_HAS_STREAM
|
||||
/* Only the WAV and streaming s16 resample paths consult this; a MOD-only or
|
||||
* no-codec build would otherwise flag it as unused. */
|
||||
static enum sinc_int16_quality audio_mixer_i16_quality(enum resampler_quality q)
|
||||
{
|
||||
switch (q)
|
||||
{
|
||||
case RESAMPLER_QUALITY_LOWEST: return SINC_INT16_QUALITY_LOWEST;
|
||||
case RESAMPLER_QUALITY_LOWER: return SINC_INT16_QUALITY_LOWER;
|
||||
case RESAMPLER_QUALITY_HIGHER: return SINC_INT16_QUALITY_HIGHER;
|
||||
case RESAMPLER_QUALITY_HIGHEST: return SINC_INT16_QUALITY_HIGHEST;
|
||||
case RESAMPLER_QUALITY_NORMAL:
|
||||
case RESAMPLER_QUALITY_DONTCARE:
|
||||
default: return SINC_INT16_QUALITY_NORMAL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RWAV
|
||||
@@ -1013,10 +999,12 @@ static bool wav_to_s16(const rwav_t* wav, const uint8_t* src,
|
||||
}
|
||||
|
||||
static bool one_shot_resample_s16(const int16_t* in, size_t samples_in,
|
||||
unsigned rate, enum resampler_quality quality,
|
||||
unsigned rate, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
int16_t** out, size_t* samples_out)
|
||||
{
|
||||
struct resampler_data_int16 info;
|
||||
retro_resampler_int16_t rs;
|
||||
size_t alloc_samples;
|
||||
size_t pad;
|
||||
void *re = NULL;
|
||||
@@ -1027,11 +1015,10 @@ static bool one_shot_resample_s16(const int16_t* in, size_t samples_in,
|
||||
return false;
|
||||
ratio = (double)s_rate / (double)rate;
|
||||
|
||||
re = sinc_resampler_int16_init((ratio < 1.0) ? ratio : 1.0,
|
||||
audio_mixer_i16_quality(quality));
|
||||
|
||||
if (!re)
|
||||
if (!retro_resampler_int16_new(&rs, resampler_ident, quality,
|
||||
(ratio < 1.0) ? ratio : 1.0, false))
|
||||
return false;
|
||||
re = rs.data;
|
||||
|
||||
/* Size by the predicted output count plus a ratio-scaled safeguard,
|
||||
* exactly like one_shot_resample, so the s16 buffer carries the same
|
||||
@@ -1048,7 +1035,7 @@ static bool one_shot_resample_s16(const int16_t* in, size_t samples_in,
|
||||
|
||||
if (*out == NULL)
|
||||
{
|
||||
sinc_resampler_int16_free(re);
|
||||
rs.free(re);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1060,8 +1047,8 @@ static bool one_shot_resample_s16(const int16_t* in, size_t samples_in,
|
||||
info.output_frames = 0;
|
||||
info.ratio = ratio;
|
||||
|
||||
sinc_resampler_int16_process(re, &info);
|
||||
sinc_resampler_int16_free(re);
|
||||
rs.process(re, &info);
|
||||
rs.free(re);
|
||||
|
||||
/* As in one_shot_resample: report what came out, not what was
|
||||
* predicted, so the tail is not dropped. */
|
||||
@@ -1078,7 +1065,7 @@ static bool one_shot_resample_s16(const int16_t* in, size_t samples_in,
|
||||
static bool wav_build_float(audio_mixer_sound_t* sound,
|
||||
const char *resampler_ident, enum resampler_quality quality);
|
||||
static bool wav_build_s16(audio_mixer_sound_t* sound,
|
||||
enum resampler_quality quality);
|
||||
const char *resampler_ident, enum resampler_quality quality);
|
||||
|
||||
audio_mixer_sound_t* audio_mixer_load_wav(void *buffer, size_t size,
|
||||
const char *resampler_ident, enum resampler_quality quality,
|
||||
@@ -1138,7 +1125,7 @@ audio_mixer_sound_t* audio_mixer_load_wav(void *buffer, size_t size,
|
||||
/* Build the pipeline the caller asked for now, so that triggering
|
||||
* the sound later allocates nothing. The other one is built only
|
||||
* if a mode flip actually asks for it. */
|
||||
if (want_s16 ? wav_build_s16(sound, quality)
|
||||
if (want_s16 ? wav_build_s16(sound, resampler_ident, quality)
|
||||
: wav_build_float(sound, resampler_ident, quality))
|
||||
return sound;
|
||||
|
||||
@@ -1684,7 +1671,7 @@ static bool wav_build_float(audio_mixer_sound_t* sound,
|
||||
}
|
||||
|
||||
static bool wav_build_s16(audio_mixer_sound_t* sound,
|
||||
enum resampler_quality quality)
|
||||
const char *resampler_ident, enum resampler_quality quality)
|
||||
{
|
||||
int16_t *pcm = NULL;
|
||||
size_t samples;
|
||||
@@ -1705,7 +1692,7 @@ static bool wav_build_s16(audio_mixer_sound_t* sound,
|
||||
int16_t *resampled = NULL;
|
||||
|
||||
if (!one_shot_resample_s16(pcm, samples,
|
||||
sound->types.wav.hdr.samplerate, quality,
|
||||
sound->types.wav.hdr.samplerate, resampler_ident, quality,
|
||||
&resampled, &samples))
|
||||
{
|
||||
memalign_free((void*)pcm);
|
||||
@@ -1734,7 +1721,7 @@ static bool wav_build_float(audio_mixer_sound_t* sound,
|
||||
}
|
||||
|
||||
static bool wav_build_s16(audio_mixer_sound_t* sound,
|
||||
enum resampler_quality quality)
|
||||
const char *resampler_ident, enum resampler_quality quality)
|
||||
{
|
||||
(void)sound;
|
||||
(void)quality;
|
||||
@@ -1905,14 +1892,16 @@ static void audio_mixer_release_stream(audio_mixer_voice_t* voice,
|
||||
if (voice->types.stream.decode_buf_s16)
|
||||
memalign_free(voice->types.stream.decode_buf_s16);
|
||||
voice->types.stream.buffer_s16 = NULL;
|
||||
if (voice->types.stream.resampler_int16)
|
||||
sinc_resampler_int16_free(voice->types.stream.resampler_int16);
|
||||
if (voice->types.stream.resampler_int16.data)
|
||||
voice->types.stream.resampler_int16.free(
|
||||
voice->types.stream.resampler_int16.data);
|
||||
}
|
||||
|
||||
static bool audio_mixer_play_stream_s16(
|
||||
audio_mixer_sound_t* sound,
|
||||
audio_mixer_voice_t* voice,
|
||||
bool repeat, int32_t gain,
|
||||
const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb,
|
||||
enum audio_type_enum type)
|
||||
@@ -1922,8 +1911,11 @@ static bool audio_mixer_play_stream_s16(
|
||||
unsigned channels = 0;
|
||||
unsigned rate = 0;
|
||||
void *sbuf = NULL;
|
||||
void *resamp_i16 = NULL;
|
||||
retro_resampler_int16_t rs;
|
||||
void *xfer = audio_transfer_new(type);
|
||||
|
||||
/* No resampling leaves it zeroed, which the fill reads as "none". */
|
||||
memset(&rs, 0, sizeof(rs));
|
||||
(void)repeat;
|
||||
(void)gain;
|
||||
(void)stop_cb;
|
||||
@@ -1987,10 +1979,8 @@ static bool audio_mixer_play_stream_s16(
|
||||
if (!s_rate || !rate)
|
||||
goto error;
|
||||
ratio = (double)s_rate / (double)rate;
|
||||
resamp_i16 = sinc_resampler_int16_init(
|
||||
(ratio < 1.0) ? ratio : 1.0,
|
||||
audio_mixer_i16_quality(quality));
|
||||
if (!resamp_i16)
|
||||
if (!retro_resampler_int16_new(&rs, resampler_ident, quality,
|
||||
(ratio < 1.0) ? ratio : 1.0, false))
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -2001,8 +1991,8 @@ static bool audio_mixer_play_stream_s16(
|
||||
|
||||
if (!voice->types.stream.decode_buf_s16)
|
||||
{
|
||||
if (resamp_i16)
|
||||
sinc_resampler_int16_free(resamp_i16);
|
||||
if (rs.data)
|
||||
rs.free(rs.data);
|
||||
goto error;
|
||||
}
|
||||
/* The resampled buffer is a view into the decode block; release
|
||||
@@ -2013,7 +2003,7 @@ static bool audio_mixer_play_stream_s16(
|
||||
voice->types.stream.resampler = NULL;
|
||||
voice->types.stream.resampler_data = NULL;
|
||||
voice->types.stream.buffer = NULL;
|
||||
voice->types.stream.resampler_int16 = resamp_i16;
|
||||
voice->types.stream.resampler_int16 = rs;
|
||||
voice->types.stream.buffer_s16 = (int16_t*)sbuf;
|
||||
voice->types.stream.buf_samples = samples;
|
||||
voice->types.stream.ratio = ratio;
|
||||
@@ -2157,6 +2147,7 @@ audio_mixer_voice_t* audio_mixer_play(audio_mixer_sound_t* sound,
|
||||
|
||||
audio_mixer_voice_t* audio_mixer_play_s16(audio_mixer_sound_t* sound,
|
||||
bool repeat, int32_t gain,
|
||||
const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
@@ -2193,62 +2184,62 @@ audio_mixer_voice_t* audio_mixer_play_s16(audio_mixer_sound_t* sound,
|
||||
case AUDIO_MIXER_TYPE_FLAC:
|
||||
#ifdef HAVE_RFLAC
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_FLAC);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_FLAC);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_WAV_STREAM:
|
||||
#ifdef HAVE_RWAV
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_WAV);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_WAV);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_OGG:
|
||||
#ifdef HAVE_RVORBIS
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_VORBIS);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_VORBIS);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_MP3:
|
||||
#ifdef HAVE_RMP3
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_MP3);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_MP3);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_M4A:
|
||||
#ifdef HAVE_RAAC
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_AAC);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_AAC);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_AC3:
|
||||
#ifdef HAVE_RAC3
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_AC3);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_AC3);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_LPCM:
|
||||
#ifdef HAVE_RLPCM
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_LPCM);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_LPCM);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_OPUS:
|
||||
#ifdef HAVE_ROPUS
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_OPUS);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_OPUS);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_MOD:
|
||||
#ifdef HAVE_RMODTRACKER
|
||||
res = audio_mixer_play_stream_s16(sound, voice, repeat, gain,
|
||||
quality, stop_cb, AUDIO_TYPE_MOD);
|
||||
resampler_ident, quality, stop_cb, AUDIO_TYPE_MOD);
|
||||
#endif
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_WAV:
|
||||
/* s16 voice: build the s16 pipeline from the source if it
|
||||
* is not there yet (the sound was loaded for float before
|
||||
* a mode flip) */
|
||||
res = wav_build_s16(sound, quality)
|
||||
res = wav_build_s16(sound, resampler_ident, quality)
|
||||
&& audio_mixer_play_wav(sound, voice, repeat, stop_cb);
|
||||
break;
|
||||
case AUDIO_MIXER_TYPE_WEBA: /* resolved at load; never stored */
|
||||
@@ -2697,10 +2688,10 @@ again:
|
||||
info.output_frames = 0;
|
||||
info.ratio = voice->types.stream.ratio;
|
||||
|
||||
if (voice->types.stream.resampler_int16)
|
||||
if (voice->types.stream.resampler_int16.data)
|
||||
{
|
||||
sinc_resampler_int16_process(
|
||||
voice->types.stream.resampler_int16, &info);
|
||||
voice->types.stream.resampler_int16.process(
|
||||
voice->types.stream.resampler_int16.data, &info);
|
||||
voice->types.stream.samples = (unsigned)(info.output_frames * 2);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -130,6 +130,11 @@ static bool resampler_append_plugs(void **re,
|
||||
}
|
||||
|
||||
|
||||
const retro_resampler_t *audio_resampler_driver_find(const char *ident)
|
||||
{
|
||||
return find_resampler_driver(ident);
|
||||
}
|
||||
|
||||
unsigned audio_resampler_driver_caps(const char *ident)
|
||||
{
|
||||
const retro_resampler_t *drv = find_resampler_driver(ident);
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/* Copyright (C) 2010-2026 The RetroArch team
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
* The following license statement only applies to this file (audio_resampler_int16.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.
|
||||
*/
|
||||
|
||||
/* The integer counterparts, in their own unit: a target that never
|
||||
* asks for one links none of the int16 drivers. */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include <audio/audio_resampler.h>
|
||||
#include <audio/sinc_resampler_int16.h>
|
||||
#ifdef HAVE_NEAREST_RESAMPLER
|
||||
#include <audio/nearest_resampler_int16.h>
|
||||
#endif
|
||||
#ifdef HAVE_CC_RESAMPLER
|
||||
#include <audio/cc_resampler_int16.h>
|
||||
#endif
|
||||
|
||||
/* The shared quality enum onto the integer sinc driver's own, which
|
||||
* orders its tiers differently. */
|
||||
static enum sinc_int16_quality resampler_sinc_int16_quality(
|
||||
enum resampler_quality q)
|
||||
{
|
||||
switch (q)
|
||||
{
|
||||
case RESAMPLER_QUALITY_LOWEST: return SINC_INT16_QUALITY_LOWEST;
|
||||
case RESAMPLER_QUALITY_LOWER: return SINC_INT16_QUALITY_LOWER;
|
||||
case RESAMPLER_QUALITY_HIGHER: return SINC_INT16_QUALITY_HIGHER;
|
||||
case RESAMPLER_QUALITY_HIGHEST: return SINC_INT16_QUALITY_HIGHEST;
|
||||
case RESAMPLER_QUALITY_NORMAL:
|
||||
case RESAMPLER_QUALITY_DONTCARE:
|
||||
default: return SINC_INT16_QUALITY_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
bool retro_resampler_int16_new(retro_resampler_int16_t *out,
|
||||
const char *short_ident, enum resampler_quality quality,
|
||||
double bw_ratio, bool hq_oversampling)
|
||||
{
|
||||
const retro_resampler_t *drv;
|
||||
if (!out)
|
||||
return false;
|
||||
memset(out, 0, sizeof(*out));
|
||||
/* The same lookup retro_resampler_realloc() uses, so a NULL or
|
||||
* unknown name lands on the fallback here too. */
|
||||
if (!(drv = audio_resampler_driver_find(short_ident)) || !drv->short_ident)
|
||||
return false;
|
||||
short_ident = drv->short_ident;
|
||||
|
||||
if (string_is_equal(short_ident, "sinc"))
|
||||
{
|
||||
out->data = sinc_resampler_int16_init_hq(bw_ratio,
|
||||
resampler_sinc_int16_quality(quality), hq_oversampling);
|
||||
out->process = sinc_resampler_int16_process;
|
||||
out->reset = sinc_resampler_int16_reset;
|
||||
out->free = sinc_resampler_int16_free;
|
||||
}
|
||||
#ifdef HAVE_NEAREST_RESAMPLER
|
||||
else if (string_is_equal(short_ident, "nearest"))
|
||||
{
|
||||
out->data = nearest_resampler_int16_init();
|
||||
out->process = nearest_resampler_int16_process;
|
||||
out->reset = nearest_resampler_int16_reset;
|
||||
out->free = nearest_resampler_int16_free;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_CC_RESAMPLER
|
||||
else if (string_is_equal(short_ident, "cc"))
|
||||
{
|
||||
out->data = cc_resampler_int16_init(bw_ratio);
|
||||
out->process = cc_resampler_int16_process;
|
||||
out->reset = cc_resampler_int16_reset;
|
||||
out->free = cc_resampler_int16_free;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
return false;
|
||||
|
||||
if (out->data)
|
||||
return true;
|
||||
memset(out, 0, sizeof(*out));
|
||||
return false;
|
||||
}
|
||||
@@ -178,7 +178,9 @@ bool audio_mixer_has_float_voices(void);
|
||||
bool audio_mixer_has_s16_voices(void);
|
||||
|
||||
audio_mixer_voice_t* audio_mixer_play_s16(audio_mixer_sound_t* sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain,
|
||||
const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include <audio/sinc_resampler_int16.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define RESAMPLER_SIMD_SSE (1 << 0)
|
||||
@@ -205,6 +207,31 @@ extern retro_resampler_t CC_resampler;
|
||||
#endif
|
||||
extern retro_resampler_t nearest_resampler;
|
||||
|
||||
/* The deterministic integer counterpart of a float backend. Zeroed
|
||||
* where the named backend has no int16 implementation, which is the
|
||||
* caller's signal to keep the float path. */
|
||||
typedef struct retro_resampler_int16
|
||||
{
|
||||
void *data;
|
||||
void (*process)(void *, struct resampler_data_int16 *);
|
||||
void (*reset)(void *);
|
||||
void (*free)(void *);
|
||||
} retro_resampler_int16_t;
|
||||
|
||||
/* Builds the int16 counterpart of @short_ident - the short_ident of a
|
||||
* backend, not a user-facing name. @hq_oversampling is a request; a
|
||||
* backend that does not read it ignores it, as it ignores @quality.
|
||||
* Returns whether an instance was made; the struct is zeroed if not,
|
||||
* and its free() is the one that must release data. */
|
||||
bool retro_resampler_int16_new(retro_resampler_int16_t *out,
|
||||
const char *short_ident, enum resampler_quality quality,
|
||||
double bw_ratio, bool hq_oversampling);
|
||||
|
||||
/* The backend the named one resolves to, by the lookup
|
||||
* retro_resampler_realloc() uses: NULL or an unknown name gives the
|
||||
* fallback. */
|
||||
const retro_resampler_t *audio_resampler_driver_find(const char *ident);
|
||||
|
||||
/* The RESAMPLER_CAP_* of the named backend, by the same lookup
|
||||
* retro_resampler_realloc() uses, so an unknown name reports the
|
||||
* fallback's. Zero where the name is NULL or nothing is registered. */
|
||||
|
||||
@@ -16,6 +16,7 @@ COMMON_SOURCES := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.c \
|
||||
|
||||
@@ -366,7 +366,7 @@ static int mix_repeating(audio_mixer_sound_t *sound, int s16,
|
||||
voice_ended = 0;
|
||||
|
||||
voice = s16
|
||||
? audio_mixer_play_s16(sound, true, 0x10000,
|
||||
? audio_mixer_play_s16(sound, true, 0x10000, NULL,
|
||||
RESAMPLER_QUALITY_DONTCARE, voice_stopped)
|
||||
: audio_mixer_play(sound, true, 1.0f, NULL,
|
||||
RESAMPLER_QUALITY_DONTCARE, voice_stopped);
|
||||
|
||||
@@ -13,6 +13,7 @@ COMMON_SOURCES := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.c \
|
||||
|
||||
@@ -34,6 +34,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -144,10 +144,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -144,10 +144,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ LDFLAGS += -fsanitize=$(SANITIZER)
|
||||
endif
|
||||
SOURCES = $(COMMON)/audio/resampler/drivers/sinc_resampler.c \
|
||||
$(COMMON)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(COMMON)/audio/resampler/audio_resampler.c \
|
||||
$(COMMON)/audio/resampler/audio_resampler_int16.c \
|
||||
$(COMMON)/audio/conversion/s16_to_float.c $(COMMON)/audio/conversion/float_to_s16.c \
|
||||
$(COMMON)/memmap/memalign.c $(ROOT)/audio/audio_upmix.c
|
||||
all: extra_capacity_test hq_settings_test
|
||||
|
||||
@@ -82,7 +82,10 @@ bool retro_resampler_realloc_hq(void **re, const retro_resampler_t **backend,
|
||||
*backend = &sinc_resampler;
|
||||
if (ident && strcmp(ident, "other") == 0)
|
||||
{
|
||||
/* A backend that does not offer HQ oversampling, which is what
|
||||
* the policy reads now rather than the identity of sinc. */
|
||||
alternate = sinc_resampler;
|
||||
alternate.caps &= ~RESAMPLER_CAP_HQ_OVERSAMPLE;
|
||||
*backend = &alternate;
|
||||
hq = false;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -141,10 +141,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/stereo_to_mono_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -143,10 +143,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -141,10 +141,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -141,10 +141,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -141,10 +141,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -141,10 +141,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -149,10 +149,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -141,10 +141,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -143,10 +143,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
|
||||
|
||||
@@ -141,10 +141,12 @@ audio_mixer_voice_t *audio_mixer_play(audio_mixer_sound_t *sound,
|
||||
}
|
||||
|
||||
audio_mixer_voice_t *audio_mixer_play_s16(audio_mixer_sound_t *sound,
|
||||
bool repeat, int32_t gain, enum resampler_quality quality,
|
||||
bool repeat, int32_t gain, const char *resampler_ident,
|
||||
enum resampler_quality quality,
|
||||
audio_mixer_stop_cb_t stop_cb)
|
||||
{
|
||||
(void)sound; (void)repeat; (void)gain; (void)quality; (void)stop_cb;
|
||||
(void)sound; (void)repeat; (void)gain; (void)resampler_ident;
|
||||
(void)quality; (void)stop_cb;
|
||||
return new_voice();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ SOURCES := gfx_thumbnail_preview_test.c \
|
||||
stubs_retroarch.c \
|
||||
$(REPO_ROOT)/libretro-common/audio/audio_mixer.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
|
||||
@@ -104,6 +105,7 @@ OBJS := $(SOURCES:.c=.o)
|
||||
DECODE_SOURCES := preview_audio_decode_test.c \
|
||||
$(REPO_ROOT)/libretro-common/audio/audio_mixer.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
|
||||
|
||||
@@ -33,6 +33,7 @@ SOURCES_C := \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.c \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_int16.c \
|
||||
$(LIBRETRO_COMM_DIR)/file/config_file_io.c \
|
||||
|
||||
Reference in new issue
Block a user