mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
audiocommon: remove 1:1 interpolation
The usual one is 32->48 khz interpolation. So there is no need in a special 1:1 interpolation only for performance.
This commit is contained in:
parent
4a5ef06f71
commit
2956ffa5be
@ -56,33 +56,6 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
|
|||||||
if (m_AIplaying) {
|
if (m_AIplaying) {
|
||||||
numLeft = (numLeft > numSamples) ? numSamples : numLeft;
|
numLeft = (numLeft > numSamples) ? numSamples : numLeft;
|
||||||
|
|
||||||
if (AudioInterface::GetAIDSampleRate() == m_sampleRate) // (1:1)
|
|
||||||
{
|
|
||||||
#if _M_SSE >= 0x301
|
|
||||||
if (cpu_info.bSSSE3 && !((numLeft * 2) % 8))
|
|
||||||
{
|
|
||||||
static const __m128i sr_mask =
|
|
||||||
_mm_set_epi32(0x0C0D0E0FL, 0x08090A0BL,
|
|
||||||
0x04050607L, 0x00010203L);
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < numLeft * 2; i += 8)
|
|
||||||
{
|
|
||||||
_mm_storeu_si128((__m128i *)&samples[i], _mm_shuffle_epi8(_mm_loadu_si128((__m128i *)&m_buffer[(indexR + i) & INDEX_MASK]), sr_mask));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
for (unsigned int i = 0; i < numLeft * 2; i+=2)
|
|
||||||
{
|
|
||||||
samples[i] = Common::swap16(m_buffer[(indexR + i + 1) & INDEX_MASK]);
|
|
||||||
samples[i+1] = Common::swap16(m_buffer[(indexR + i) & INDEX_MASK]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
indexR += numLeft * 2;
|
|
||||||
}
|
|
||||||
else //linear interpolation
|
|
||||||
{
|
|
||||||
//render numleft sample pairs to samples[]
|
//render numleft sample pairs to samples[]
|
||||||
//advance indexR with sample position
|
//advance indexR with sample position
|
||||||
//remember fractional offset
|
//remember fractional offset
|
||||||
@ -109,7 +82,6 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
|
|||||||
indexR += 2 * (u16)(frac >> 16);
|
indexR += 2 * (u16)(frac >> 16);
|
||||||
frac &= 0xffff;
|
frac &= 0xffff;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
numLeft = 0;
|
numLeft = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user