This updates the original SSE2 implementations to match the current
AudioNodeEngine API and adds them to the build.
MozReview-Commit-ID: KULBD7KTr3n
--HG--
extra : rebase_source : 05adf8a26cb33a4b9d9c9d200d3ed8b1831f6995
To be able to use SSE2 routines, we need to audio buffers to be allocated
on 16 byte boundaries.
MozReview-Commit-ID: 2mjxMWqysFd
--HG--
extra : rebase_source : 8bd7d48b767b7bcfa5874061586b9b41c26a18ae
We currently rebuild the BandLimitedTables whenever we encounter a lower
fundamental frequency but it is only necessary to rebuild the tables if we
can fit more partials below the Nyquist frequency. Rebuilding the tables
unnecessarily can cause performance problems, particularly in the case where
the frequency is continually lowered.
--HG--
extra : rebase_source : e53c773d53f723d5b34270d6214a5812ec1eb7f0
This builds the band limited tables for each range index individually as
required.
--HG--
extra : rebase_source : 022665e3b83b82bcdcec3cabf3ddda9c2dce2ebf
If we build the band limited tables after the fundamental frequency is known,
we can exclude partials that are above the nyquist frequency for the sampling
frequency being used.
We rebuild the band limited tables each time we see a request for data for a
lower fundamental frequency so we have the required partials.
--HG--
extra : rebase_source : 067075c7c8a90580650bf850c50ca7d8fc1eb6ff
We need to store the components used to create the PeriodicWave for later use
if we want to be able to build the band limited tables lazily.
--HG--
extra : rebase_source : d760433e6fe5490a60da761be7e2148a6504d20d
This increases the maximum PeriodicWave size to 8192 and adds an optimization
to use 8192 elements only in the case where we receive more than 4096
components. In accordance with the spec, a maximum number of components is no
longer enforced.
--HG--
extra : rebase_source : ecb9a401fabdb14f23f690c44944ece434599055
Efficiency is proportional to stage size, so start with the largest size
possible.
--HG--
extra : rebase_source : 34915efce1eb94e18f53adf35dc939301242467a
Now, the most FFT work that happens during one realtime processing block is
when one 2048-size stage and the 256-size stage are performed at the same
phase-offset. Before FFT timing was controlled by initial input buffer offset
(bug 1221831), two 1024-size stages as well as the 512- and 256-size stages
performed FFTs at one offset. Thus, the maximum work in one block is reduced
by a ratio of about 11 to 9.
Measurements also indicate a similar reduction in total rendering thread
CPU usage.
Previously the alignment of the eleven 1024-size realtime stages was such
that, in three consecutive blocks, two 1024-size stages would peform their
FFTs. Now, the 2048-size stages is aligned so that none of these perform
their FFTs in consecutive blocks.
--HG--
extra : rebase_source : 7265374c1642661db1d4f4d630ddc8294be689c7
as with the main thread.
The comment was incomplete as ReverbConvolverStage also supports multiples of
the FFT halfsize, but only values up to WEBAUDIO_BLOCK_SIZE.
--HG--
extra : rebase_source : 34f11834dd425075e8948f47dcc5283dcb50fc42
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
This commit was generated using the following script, executed at the
top level of a typical source code checkout.
# Don't modify select files in mfbt/ because it's not worth trying to
# tease out the dependencies currently.
#
# Don't modify anything in media/gmp-clearkey/0.1/ because those files
# use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
grep -v 'mfbt/RefPtr.h' | \
grep -v 'mfbt/nsRefPtr.h' | \
grep -v 'mfbt/RefCounted.h' | \
grep -v 'media/gmp-clearkey/0.1/' | \
xargs perl -p -i -e '
s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#; # handle strange #includes
'
# |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'
# RefPtr.h used |byRef| for dealing with COM-style outparams.
# nsRefPtr.h uses |getter_AddRefs|.
# Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
They were both "truncation from 'double' to 'float'" warnings.
This also allows the COMPILER_ALLOW_WARNINGS=True flag to be removed.
--HG--
extra : rebase_source : 4b57cba0d994671d5218be94d8f838582496ac1c
In a subsequent patch, AllocateAudioBlock will become part of an AudioBlock
class derived from AudioChunk and used for AudioNodeStream members.
--HG--
extra : rebase_source : a3bfde8345995865c6f8e46abed24f008c112702
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
It is now no longer necessary to clear zero bins because these are zeroed
in the FFTBlock constructor.
nsTArray bounds assertions now apply.
--HG--
extra : rebase_source : 18c07ecb51f9cb3c199536fe59110093db2295d4
realP[halfSize] was always set to zero because numberOfPartials < halfSize + 1
was always true.
--HG--
extra : rebase_source : 819b04a56032d810231a16fa0dd139cf82ef8ddf
The built-in waveforms are all odd and so realP[halfSize] was zero, and it
would have been ignored in createBandLimitedTables even if it was non-zero.
imagP[halfSize] was ignored as it was not involved in the inverse FFT.
This returns the code to that prior to
https://hg.mozilla.org/mozilla-central/diff/5377bce3b478/content/media/webaudio/blink/PeriodicWave.cpp#l1.276
--HG--
extra : rebase_source : 1bfa9eefc7dd269a64a98cdfdd4cbf76fa207dc4
There are no behavior changes here, just the change in meaning of the variable.
--HG--
extra : rebase_source : 9bae9f29a27430e9074dc0337773313140af9ba2
This makes it clearer that, unlike how SizeOf*() functions usually work, this
doesn't measure any children hanging off the array.
And do likewise for nsTObserverArray.
--HG--
extra : rebase_source : 6a8c8d8ffb53ad51b5773afea77126cdd767f149
tableInterpolationFactor = 0 now means use lowerWaveData, which is
rangeIndex2.
--HG--
extra : rebase_source : a8e1b64c534cf2e9aea92dd8a06a4eeee8403d73
The bulk of this commit was generated by running:
run-clang-tidy.py \
-checks='-*,llvm-namespace-comment' \
-header-filter=^/.../mozilla-central/.* \
-fix
This conversion was done with the script:
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl' | \
egrep -v 'cairo-win32-refptr.h|RefPtr.h|TestRefPtr.cpp' | \
xargs sed -i -e 's/mozilla::TemporaryRef</already_AddRefed</g' \
-e 's/TemporaryRef</already_AddRefed</g'
Manual fixups were performed in the following instances:
- We handled mfbt/RefPtr.h manually so as to not convert TemporaryRef itself
into already_AddRefed.
- The following files had explicit Move() calls added to make up for the lack
of a copy constructor on already_AddRefed:
dom/base/ImageEncoder.cpp
dom/media/MediaTaskQueue.{h,cpp}
dom/media/webaudio/PannerNode.cpp
- A redundant overload for MediaTaskQueue::Dispatch was deleted.
- A few manual fixups were required in mfbt/tests/TestRefPtr.cpp.
- Comments, using declarations, and forward declarations relating to
TemporaryRef in dom/canvas/ and gfx/layers/ were changed to refer to
already_AddRefed.