Closed Bug 1389638 Opened 7 years ago Closed 7 years ago

correct math for unaligned AudioBufferSumOfSquares input on SSE2 platforms

Categories

(Core :: Web Audio, defect, P3)

48 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox-esr52 --- wontfix
firefox55 --- wontfix
firefox56 --- wontfix
firefox57 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

Details

(Keywords: regression)

Attachments

(3 files)

The SSE implementation of AudioBufferSumOfSquares handles leading and trailing unaligned input incorrectly. There is probably currently no leading unaligned input in practice due to bug 1024182 making the buffer at least 128 samples long, if the allocator aligns larger allocations on 64 bytes. The issue with trailing unaligned data is a regression from bug 881587. Given this means only a few incorrect samples from what is usually a considerably longer buffer, the regression is probably not too bad. P3 because this is not too bad a regression, though it is really higher priority because this blocks 1024182, which makes the normalization scale completely wrong.
Bug 1024182 makes this difficult to test, and so I'll add a test case there.
Flags: in-testsuite-
Comment on attachment 8896482 [details] bug 1389638 declare length of array for AudioBufferSumOfSquares_SSE as an integral type https://reviewboard.mozilla.org/r/167722/#review173424
Attachment #8896482 - Flags: review?(dminor) → review+
Comment on attachment 8896483 [details] bug 1389638 include leading unaligned AudioBufferSumOfSquares input in length count and check for end of buffer https://reviewboard.mozilla.org/r/167724/#review173432 ::: commit-message-39625:4 (Diff revision 1) > +bug 1389638 include leading unaligned AudioBufferSumOfSquares input in length count and check for end of buffer r?dminor > + > +The length of the array for AudioBufferSumOfSquares_SSE() is calculated from > +available aligned input, instead of total input. Please make the change you have made clearer, e.g. "This fixes the calculation for the length of the array for AudioBufferSumOfSquares_SSE to use the available aligned input rather than the total input"
Attachment #8896483 - Flags: review?(dminor) → review+
Comment on attachment 8896484 [details] bug 1389638 use correct input elements for summing squares of trailing unaligned input https://reviewboard.mozilla.org/r/167726/#review173440
Attachment #8896484 - Flags: review?(dminor) → review+
Comment on attachment 8896483 [details] bug 1389638 include leading unaligned AudioBufferSumOfSquares input in length count and check for end of buffer https://reviewboard.mozilla.org/r/167724/#review173432 > Please make the change you have made clearer, e.g. "This fixes the calculation for the length of the array for AudioBufferSumOfSquares_SSE to use the available aligned input rather than the total input" The patch does more than that, and so I've added comments to clarify.
(In reply to Karl Tomlinson (:karlt) from comment #11) > The patch does more than that, and so I've added comments to clarify. That seems very terse, sorry. I actually replaced that reviewboard comment before publishing with a long description of what I changed in the comment and why. Reviewboard has decided to revert to an earlier version on publishing. As it is going to be turned off soon, I won't bother filing another reviewboard bug about it losing comment changes. Thank you for the review. I hope I've made the changes clearer. The comments are at least more detailed.
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c307e5ea3488 declare length of array for AudioBufferSumOfSquares_SSE as an integral type r=dminor https://hg.mozilla.org/integration/autoland/rev/46a45f39fc9d include leading unaligned AudioBufferSumOfSquares input in length count and check for end of buffer r=dminor https://hg.mozilla.org/integration/autoland/rev/b95c2146d637 use correct input elements for summing squares of trailing unaligned input r=dminor
FWIW closing the reviewboard page now presents "This page is asking you to confirm that you want to leave - data you have entered may not be saved.", but selecting "Stay on Page" is showing the previous version of the comment. I can't find the more recent version anywhere.
Doesn't sound like this is worth backporting. Feel free to set status back to affected and request approval if you feel otherwise, however.
Version: Trunk → 48 Branch
Flags: in-testsuite- → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: