Don't call hermite twice per sample for clamping. Adjust so compiler

auto-SIMDs.
This commit is contained in:
Brandon Wright 2012-01-30 13:29:01 -06:00
parent dc773bb6be
commit f6c9ea8de3
1 changed files with 5 additions and 2 deletions

View File

@ -76,11 +76,14 @@ class HermiteResampler : public Resampler
{
int s_left = internal_buffer[i_position];
int s_right = internal_buffer[i_position + 1];
float hermite_val[2];
while (r_frac <= 1.0 && o_position < num_samples)
{
data[o_position] = SHORT_CLAMP (hermite (r_frac, r_left [0], r_left [1], r_left [2], r_left [3]));
data[o_position + 1] = SHORT_CLAMP (hermite (r_frac, r_right[0], r_right[1], r_right[2], r_right[3]));
hermite_val[0] = hermite (r_frac, r_left [0], r_left [1], r_left [2], r_left [3]);
hermite_val[1] = hermite (r_frac, r_right[0], r_right[1], r_right[2], r_right[3]);
data[o_position] = SHORT_CLAMP (hermite_val[0]);
data[o_position + 1] = SHORT_CLAMP (hermite_val[1]);
o_position += 2;