Closed
Bug 1263910
Opened 8 years ago
Closed 8 years ago
Optimize ReverbAccumulationBuffer code to use SSE2 calls when possible
Categories
(Core :: Web Audio, defect, P2)
Core
Web Audio
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: dminor, Assigned: dminor)
Details
Attachments
(1 file)
The ReverbAccumulationBuffer has to deal with wrap around which makes it unlikely that the read and write pointers will be properly aligned and the number of values to write will be a multiple of 16. We should attempt to do enough scalar operations to get things properly aligned and then switch to vector operations rather than doing everything with scalar operations.
Comment 1•8 years ago
|
||
AFAIR ReverbAccumulationBuffer is now only used with blocks of WEBAUDIO_BLOCK_SIZE, so providing necessary alignment may just require making the length of ReverbAccumulationBuffer::m_buffer a multiple of 4.
Assignee | ||
Updated•8 years ago
|
Priority: -- → P1
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → dminor
Status: NEW → ASSIGNED
Rank: 25
Priority: P1 → P2
Assignee | ||
Comment 2•8 years ago
|
||
ReverbAccumulationBuffer often produces unaligned buffers due to the way it wraps around results. This modifies AudioBufferAddWithScale on SSE2 platforms to handle unaligned buffers by performing scalar operations until both the input and output buffers are aligned to 16 bytes. It then does as many vector operations as possible and switches back to scalar operations for anything that is left over. This could also be done within the ReverbAccumulationBuffer code but doing it directly within the AudioNodeEngine code makes it available to other callers in the future, at the cost of a few extra branches in the case where everything was aligned anyway. Review commit: https://reviewboard.mozilla.org/r/51959/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/51959/
Attachment #8751335 -
Flags: review?(padenot)
Comment 3•8 years ago
|
||
Comment on attachment 8751335 [details] MozReview Request: Bug 1263910 - Make AudioBufferAddWithScale handle unaligned buffers; r=padenot https://reviewboard.mozilla.org/r/51959/#review49085 ::: dom/media/webaudio/AudioNodeEngine.cpp:85 (Diff revision 1) > #ifdef USE_SSE2 > if (mozilla::supports_sse2()) { > - AudioBufferAddWithScale_SSE(aInput, aScale, aOutput, aSize); > - return; > + if (aScale == 1.0f) { > + while (aSize && (!IS_ALIGNED16(aInput) || !IS_ALIGNED16(aOutput))) { > + *aOutput += *aInput; > + ++aOutput; ++aInput; --aSize; Each on its line, please, and below.
Attachment #8751335 -
Flags: review?(padenot) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Comment on attachment 8751335 [details] MozReview Request: Bug 1263910 - Make AudioBufferAddWithScale handle unaligned buffers; r=padenot Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51959/diff/1-2/
Attachment #8751335 -
Attachment description: MozReview Request: Bug 1263910 - Make AudioBufferAddWithScale handle unaligned buffers; r?padenot → MozReview Request: Bug 1263910 - Make AudioBufferAddWithScale handle unaligned buffers; r=padenot
Comment 6•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/24e883121fcd
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•