(cc_resampler.c) Remove some unneeded header includes / make it more
backwards compatible
This commit is contained in:
parent
069491f488
commit
7d3b436c2a
|
@ -17,8 +17,6 @@
|
||||||
// Convoluted Cosine Resampler
|
// Convoluted Cosine Resampler
|
||||||
|
|
||||||
#include "resampler.h"
|
#include "resampler.h"
|
||||||
#include "../libretro.h"
|
|
||||||
#include "../performance.h"
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -186,15 +184,15 @@ static inline void add_to(const audio_frame_float_t *source, audio_frame_float_t
|
||||||
|
|
||||||
static void resampler_CC_downsample(void *re_, struct resampler_data *data)
|
static void resampler_CC_downsample(void *re_, struct resampler_data *data)
|
||||||
{
|
{
|
||||||
|
float ratio, b;
|
||||||
rarch_CC_resampler_t *re = (rarch_CC_resampler_t*)re_;
|
rarch_CC_resampler_t *re = (rarch_CC_resampler_t*)re_;
|
||||||
|
|
||||||
audio_frame_float_t *inp = (audio_frame_float_t*)data->data_in;
|
audio_frame_float_t *inp = (audio_frame_float_t*)data->data_in;
|
||||||
audio_frame_float_t *inp_max = (audio_frame_float_t*)(inp + data->input_frames);
|
audio_frame_float_t *inp_max = (audio_frame_float_t*)(inp + data->input_frames);
|
||||||
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
|
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
|
||||||
|
|
||||||
float ratio = 1.0 / data->ratio;
|
ratio = 1.0 / data->ratio;
|
||||||
|
b = data->ratio; // cutoff frequency
|
||||||
float b = data->ratio; // cutoff frequency
|
|
||||||
|
|
||||||
while (inp != inp_max)
|
while (inp != inp_max)
|
||||||
{
|
{
|
||||||
|
@ -229,14 +227,15 @@ static void resampler_CC_downsample(void *re_, struct resampler_data *data)
|
||||||
|
|
||||||
static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||||
{
|
{
|
||||||
|
float b, ratio;
|
||||||
rarch_CC_resampler_t *re = (rarch_CC_resampler_t*)re_;
|
rarch_CC_resampler_t *re = (rarch_CC_resampler_t*)re_;
|
||||||
|
|
||||||
audio_frame_float_t *inp = (audio_frame_float_t*)data->data_in;
|
audio_frame_float_t *inp = (audio_frame_float_t*)data->data_in;
|
||||||
audio_frame_float_t *inp_max = inp + data->input_frames;
|
audio_frame_float_t *inp_max = inp + data->input_frames;
|
||||||
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
|
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
|
||||||
|
|
||||||
float b = min(data->ratio, 1.00); // cutoff frequency
|
b = min(data->ratio, 1.00); // cutoff frequency
|
||||||
float ratio = 1.0 / data->ratio;
|
ratio = 1.0 / data->ratio;
|
||||||
|
|
||||||
while (inp != inp_max)
|
while (inp != inp_max)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue