{\r
for(size_t n = r.begin(); n < r.end(); ++n)\r
{\r
- const float alpha0 = (n*2) * delta;\r
- const float volume0 = prev_volume * (1.0f - alpha0) + next_volume * alpha0;\r
- const float volume1 = prev_volume * (1.0f - alpha0 + delta) + next_volume * (alpha0 + delta);\r
+ const float alpha0 = (n*2+0) * delta;\r
+ const float alpha1 = (n*2+1) * delta;\r
+ const float volume0 = (prev_volume * (1.0f - alpha0)) + (next_volume * alpha0);\r
+ const float volume1 = (prev_volume * (1.0f - alpha1)) + (next_volume * alpha1);\r
\r
- auto sample_epi32 = _mm_load_si128(reinterpret_cast<__m128i*>(&item.audio_data[n*4]));\r
- auto res_sample_ps = _mm_load_ps(&intermediate[n*4]);\r
-\r
- auto sample_ps = _mm_cvtepi32_ps(sample_epi32); \r
+ auto sample_ps = _mm_cvtepi32_ps(_mm_load_si128(reinterpret_cast<__m128i*>(&item.audio_data[n*4])));\r
+ auto res_sample_ps = _mm_load_ps(&intermediate[n*4]); \r
sample_ps = _mm_mul_ps(sample_ps, _mm_setr_ps(volume1, volume1, volume0, volume0)); \r
res_sample_ps = _mm_add_ps(sample_ps, res_sample_ps); \r
\r