From f231df560862556fd2dda9b7bece361c7e6906f4 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 12 Dec 2017 21:06:11 +0100 Subject: [PATCH] remove redundant fluid_real_t casts in rvoice_dsp --- src/rvoice/fluid_rvoice_dsp.c | 98 +++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/rvoice/fluid_rvoice_dsp.c b/src/rvoice/fluid_rvoice_dsp.c index b7746637..db399c20 100644 --- a/src/rvoice/fluid_rvoice_dsp.c +++ b/src/rvoice/fluid_rvoice_dsp.c @@ -520,13 +520,13 @@ fluid_rvoice_dsp_interpolate_7th_order (fluid_rvoice_dsp_t *voice) coeffs = sinc_table7[fluid_phase_fract_to_tablerow (dsp_phase)]; dsp_buf[dsp_i] = dsp_amp - * (coeffs[0] * (fluid_real_t)start_points[2] - + coeffs[1] * (fluid_real_t)start_points[1] - + coeffs[2] * (fluid_real_t)start_points[0] - + coeffs[3] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) - + coeffs[4] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) - + coeffs[5] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) - + coeffs[6] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); + * (coeffs[0] * start_points[2] + + coeffs[1] * start_points[1] + + coeffs[2] * start_points[0] + + coeffs[3] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) + + coeffs[4] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) + + coeffs[5] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) + + coeffs[6] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); /* increment phase and amplitude */ fluid_phase_incr (dsp_phase, dsp_phase_incr); @@ -542,13 +542,13 @@ fluid_rvoice_dsp_interpolate_7th_order (fluid_rvoice_dsp_t *voice) coeffs = sinc_table7[fluid_phase_fract_to_tablerow (dsp_phase)]; dsp_buf[dsp_i] = dsp_amp - * (coeffs[0] * (fluid_real_t)start_points[1] - + coeffs[1] * (fluid_real_t)start_points[0] - + coeffs[2] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) - + coeffs[3] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) - + coeffs[4] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) - + coeffs[5] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) - + coeffs[6] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); + * (coeffs[0] * start_points[1] + + coeffs[1] * start_points[0] + + coeffs[2] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) + + coeffs[3] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) + + coeffs[4] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) + + coeffs[5] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) + + coeffs[6] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); /* increment phase and amplitude */ fluid_phase_incr (dsp_phase, dsp_phase_incr); @@ -564,13 +564,13 @@ fluid_rvoice_dsp_interpolate_7th_order (fluid_rvoice_dsp_t *voice) coeffs = sinc_table7[fluid_phase_fract_to_tablerow (dsp_phase)]; dsp_buf[dsp_i] = dsp_amp - * (coeffs[0] * (fluid_real_t)start_points[0] - + coeffs[1] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) - + coeffs[2] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) - + coeffs[3] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) - + coeffs[4] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) - + coeffs[5] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) - + coeffs[6] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); + * (coeffs[0] * start_points[0] + + coeffs[1] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) + + coeffs[2] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) + + coeffs[3] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) + + coeffs[4] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) + + coeffs[5] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) + + coeffs[6] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); /* increment phase and amplitude */ fluid_phase_incr (dsp_phase, dsp_phase_incr); @@ -587,13 +587,13 @@ fluid_rvoice_dsp_interpolate_7th_order (fluid_rvoice_dsp_t *voice) coeffs = sinc_table7[fluid_phase_fract_to_tablerow (dsp_phase)]; dsp_buf[dsp_i] = dsp_amp - * (coeffs[0] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) - + coeffs[1] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) - + coeffs[2] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) - + coeffs[3] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) - + coeffs[4] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) - + coeffs[5] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) - + coeffs[6] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); + * (coeffs[0] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) + + coeffs[1] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) + + coeffs[2] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) + + coeffs[3] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) + + coeffs[4] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) + + coeffs[5] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) + + coeffs[6] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+3)); /* increment phase and amplitude */ fluid_phase_incr (dsp_phase, dsp_phase_incr); @@ -612,13 +612,13 @@ fluid_rvoice_dsp_interpolate_7th_order (fluid_rvoice_dsp_t *voice) coeffs = sinc_table7[fluid_phase_fract_to_tablerow (dsp_phase)]; dsp_buf[dsp_i] = dsp_amp - * (coeffs[0] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) - + coeffs[1] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) - + coeffs[2] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) - + coeffs[3] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) - + coeffs[4] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) - + coeffs[5] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) - + coeffs[6] * (fluid_real_t)end_points[0]); + * (coeffs[0] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) + + coeffs[1] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) + + coeffs[2] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) + + coeffs[3] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) + + coeffs[4] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) + + coeffs[5] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+2) + + coeffs[6] * end_points[0]); /* increment phase and amplitude */ fluid_phase_incr (dsp_phase, dsp_phase_incr); @@ -634,13 +634,13 @@ fluid_rvoice_dsp_interpolate_7th_order (fluid_rvoice_dsp_t *voice) coeffs = sinc_table7[fluid_phase_fract_to_tablerow (dsp_phase)]; dsp_buf[dsp_i] = dsp_amp - * (coeffs[0] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) - + coeffs[1] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) - + coeffs[2] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) - + coeffs[3] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) - + coeffs[4] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) - + coeffs[5] * (fluid_real_t)end_points[0] - + coeffs[6] * (fluid_real_t)end_points[1]); + * (coeffs[0] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) + + coeffs[1] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) + + coeffs[2] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) + + coeffs[3] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) + + coeffs[4] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index+1) + + coeffs[5] * end_points[0] + + coeffs[6] * end_points[1]); /* increment phase and amplitude */ fluid_phase_incr (dsp_phase, dsp_phase_incr); @@ -656,13 +656,13 @@ fluid_rvoice_dsp_interpolate_7th_order (fluid_rvoice_dsp_t *voice) coeffs = sinc_table7[fluid_phase_fract_to_tablerow (dsp_phase)]; dsp_buf[dsp_i] = dsp_amp - * (coeffs[0] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) - + coeffs[1] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) - + coeffs[2] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) - + coeffs[3] * (fluid_real_t)fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) - + coeffs[4] * (fluid_real_t)end_points[0] - + coeffs[5] * (fluid_real_t)end_points[1] - + coeffs[6] * (fluid_real_t)end_points[2]); + * (coeffs[0] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-3) + + coeffs[1] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-2) + + coeffs[2] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index-1) + + coeffs[3] * fluid_rvoice_get_sample(dsp_data, dsp_data24, dsp_phase_index) + + coeffs[4] * end_points[0] + + coeffs[5] * end_points[1] + + coeffs[6] * end_points[2]); /* increment phase and amplitude */ fluid_phase_incr (dsp_phase, dsp_phase_incr);