(drivers_resampler) Style indent cleanups

This commit is contained in:
twinaphex 2016-09-08 11:46:59 +02:00
parent 60cdd730b1
commit ea4f85d860
2 changed files with 22 additions and 23 deletions

View File

@ -59,10 +59,10 @@ typedef struct rarch_CC_resampler
static void resampler_CC_process(void *re_, struct resampler_data *data)
{
float ratio, fraction;
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 *outp = (audio_frame_float_t*)data->data_out;
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
(void)re_;
@ -196,15 +196,15 @@ static void resampler_CC_downsample(void *re_, struct resampler_data *data)
__m128 vec_in;
__m128 vec_ratio =
_mm_mul_ps(_mm_set_ps1(ratio), _mm_set_ps(3.0, 2.0, 1.0, 0.0));
__m128 vec_w = _mm_sub_ps(_mm_set_ps1(re->distance), vec_ratio);
__m128 vec_w = _mm_sub_ps(_mm_set_ps1(re->distance), vec_ratio);
__m128 vec_w1 = _mm_add_ps(vec_w , _mm_set_ps1(0.5));
__m128 vec_w2 = _mm_sub_ps(vec_w , _mm_set_ps1(0.5));
__m128 vec_w1 = _mm_add_ps(vec_w , _mm_set_ps1(0.5));
__m128 vec_w2 = _mm_sub_ps(vec_w , _mm_set_ps1(0.5));
__m128 vec_b = _mm_set_ps1(b);
__m128 vec_b = _mm_set_ps1(b);
vec_w1 = _mm_mul_ps(vec_w1, vec_b);
vec_w2 = _mm_mul_ps(vec_w2, vec_b);
vec_w1 = _mm_mul_ps(vec_w1, vec_b);
vec_w2 = _mm_mul_ps(vec_w2, vec_b);
(void)vec_ww1;
(void)vec_ww2;

View File

@ -141,10 +141,9 @@ static void init_sinc_table(rarch_sinc_resampler_t *resamp, double cutoff,
float val;
int n = j * phases + i;
double window_phase = (double)n / (phases * taps); /* [0, 1). */
window_phase = 2.0 * window_phase - 1.0; /* [-1, 1) */
sinc_phase = sidelobes * window_phase;
val = cutoff * sinc(M_PI * sinc_phase * cutoff) *
window_phase = 2.0 * window_phase - 1.0; /* [-1, 1) */
sinc_phase = sidelobes * window_phase;
val = cutoff * sinc(M_PI * sinc_phase * cutoff) *
window_function(window_phase) / window_mod;
phase_table[i * stride * taps + j] = val;
}
@ -170,12 +169,12 @@ static void init_sinc_table(rarch_sinc_resampler_t *resamp, double cutoff,
{
float val, delta;
double sinc_phase;
int n = j * phases + (phase + 1);
int n = j * phases + (phase + 1);
double window_phase = (double)n / (phases * taps); /* (0, 1]. */
window_phase = 2.0 * window_phase - 1.0; /* (-1, 1] */
sinc_phase = sidelobes * window_phase;
window_phase = 2.0 * window_phase - 1.0; /* (-1, 1] */
sinc_phase = sidelobes * window_phase;
val = cutoff * sinc(M_PI * sinc_phase * cutoff) *
val = cutoff * sinc(M_PI * sinc_phase * cutoff) *
window_function(window_phase) / window_mod;
delta = (val - phase_table[phase * stride * taps + j]);
phase_table[(phase * stride + 1) * taps + j] = delta;
@ -416,8 +415,8 @@ static void resampler_sinc_free(void *re)
static void *resampler_sinc_new(const struct resampler_config *config,
double bandwidth_mod, resampler_simd_mask_t mask)
{
size_t phase_elems, elems;
double cutoff;
size_t phase_elems, elems;
rarch_sinc_resampler_t *re = (rarch_sinc_resampler_t*)
calloc(1, sizeof(*re));
@ -439,24 +438,24 @@ static void *resampler_sinc_new(const struct resampler_config *config,
/* Be SIMD-friendly. */
#if (defined(__AVX__) && ENABLE_AVX) || (defined(__ARM_NEON__)&& !defined(VITA))
re->taps = (re->taps + 7) & ~7;
re->taps = (re->taps + 7) & ~7;
#else
re->taps = (re->taps + 3) & ~3;
re->taps = (re->taps + 3) & ~3;
#endif
phase_elems = (1 << PHASE_BITS) * re->taps;
phase_elems = (1 << PHASE_BITS) * re->taps;
#if SINC_COEFF_LERP
phase_elems *= 2;
#endif
elems = phase_elems + 4 * re->taps;
elems = phase_elems + 4 * re->taps;
re->main_buffer = (float*)memalign_alloc(128, sizeof(float) * elems);
if (!re->main_buffer)
goto error;
re->phase_table = re->main_buffer;
re->buffer_l = re->main_buffer + phase_elems;
re->buffer_r = re->buffer_l + 2 * re->taps;
re->buffer_l = re->main_buffer + phase_elems;
re->buffer_r = re->buffer_l + 2 * re->taps;
init_sinc_table(re, cutoff, re->phase_table,
1 << PHASE_BITS, re->taps, SINC_COEFF_LERP);