Bug 1266112 - Remove unnecessary alignment checks from AudioNodeEngine.cpp; r?padenot
Assuming that
Bug 1266405 fixed the underlying cause for the unaligned
buffers we were seeing, the checks in AudioBufferAddWithScale and
AudioBlockCopyWithScale shoudl no longer be necessary.
MozReview-Commit-ID: 4OQ4qQVjEP3
--- a/dom/media/webaudio/AudioNodeEngine.cpp
+++ b/dom/media/webaudio/AudioNodeEngine.cpp
@@ -73,20 +73,17 @@ void AudioBufferAddWithScale(const float
#ifdef BUILD_ARM_NEON
if (mozilla::supports_neon()) {
AudioBufferAddWithScale_NEON(aInput, aScale, aOutput, aSize);
return;
}
#endif
#ifdef USE_SSE2
- // TODO: See Bug 1266112, we should either fix the source of the unaligned
- // buffers or do as much as possible with vector instructions and
- // fallback to scalar instructions where necessary.
- if (mozilla::supports_sse2() && IS_ALIGNED16(aInput) && IS_ALIGNED16(aOutput)) {
+ if (mozilla::supports_sse2()) {
AudioBufferAddWithScale_SSE(aInput, aScale, aOutput, aSize);
return;
}
#endif
if (aScale == 1.0f) {
for (uint32_t i = 0; i < aSize; ++i) {
aOutput[i] += aInput[i];
@@ -117,20 +114,17 @@ AudioBlockCopyChannelWithScale(const flo
#ifdef BUILD_ARM_NEON
if (mozilla::supports_neon()) {
AudioBlockCopyChannelWithScale_NEON(aInput, aScale, aOutput);
return;
}
#endif
#ifdef USE_SSE2
- // TODO: See Bug 1266112, we should either fix the source of the unaligned
- // buffers or do as much as possible with vector instructions and
- // fallback to scalar instructions where necessary.
- if (mozilla::supports_sse2() && IS_ALIGNED16(aInput) && IS_ALIGNED16(aOutput)) {
+ if (mozilla::supports_sse2()) {
AudioBlockCopyChannelWithScale_SSE(aInput, aScale, aOutput);
return;
}
#endif
for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; ++i) {
aOutput[i] = aInput[i]*aScale;
}