Commit Graph

59 Commits

Author SHA1 Message Date
Birunthan Mohanathas
d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda
d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Dan Minor
31ec45b291 Bug 1240054 - Only rebuild BandLimitedTables if more partials are required r=padenot
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
2016-01-18 08:51:29 -05:00
Julian Seward
7f3e3b8977 Bug 1232326 - Uninitialised value use in AudioBufferInPlaceScale. r=dminor.
--HG--
extra : rebase_source : 608cb061bb6da051dd781ff6fdbbdb5ec8e1cc6d
2015-12-16 17:36:21 +01:00
Chris Peterson
46bb7c80dd Bug 1228947 - Replace mfbt/Constants.h with math.h. r=roc
--HG--
extra : rebase_source : 4ab2c4a917ea90055e48bd6adcb53904f2266ee0
2015-11-27 20:49:55 -08:00
Nathan Froyd
ffeb7c7fe3 Bug 1229963 - use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in dom/media/; r=cpearce 2015-12-02 18:07:59 -05:00
Dan Minor
57ace7e27d Bug 1222405 - (part 3) Build band limited tables lazily r=padenot
This builds the band limited tables for each range index individually as
required.

--HG--
extra : rebase_source : 022665e3b83b82bcdcec3cabf3ddda9c2dce2ebf
2015-11-27 15:01:28 -05:00
Dan Minor
5c9b087388 Bug 1222405 - (part 2) Build band limited tables after fundamental frequency is known r=padenot
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
2015-11-13 11:17:39 -05:00
Dan Minor
eec8d40aad Bug 1222405 - (part 1) Store PeriodicWave components for later use r=padenot
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
2015-11-12 10:40:45 -05:00
Karl Tomlinson
f9ed76a4de bug 1224102 reduce the size of the final FFT convolution stage if possible r=padenot
--HG--
extra : rebase_source : 18d699f2710d9094811e0d734bcb1cf085c147c6
extra : histedit_source : 0393d5f2d3251aae45f07473e103c026921054bc
2015-11-12 17:34:13 +13:00
Dan Minor
229f2b76cc Bug 1171436 - support at least 8192 elements for PeriodicWave r=padenot
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
2015-10-27 22:05:47 -04:00
Karl Tomlinson
de1e2244a1 bug 1221836 return output pointer from FFTConvolver::process() to save a buffer copy r=padenot
--HG--
extra : rebase_source : 99568b7c3095f44a061f783cefd5d6cbeebfa496
2015-11-04 21:23:18 +13:00
Karl Tomlinson
754b0bf4f3 bug 1221833 remove now-unused direct convolver r=padenot
--HG--
extra : rebase_source : 648461a4d49b58d72eb18826b4cd43f62230852b
2015-11-04 09:21:45 +13:00
Karl Tomlinson
9211c999d3 bug 1221833 remove first two half-block-size convolver stages r=padenot
Efficiency is proportional to stage size, so start with the largest size
possible.

--HG--
extra : rebase_source : 34915efce1eb94e18f53adf35dc939301242467a
2015-11-04 09:02:57 +13:00
Karl Tomlinson
3bc589b269 bug 1221833 replace initial direct convolution stage with fft r=padenot
--HG--
extra : rebase_source : 2cc20db26a95b56683d24853622fbe3cac016b45
2015-11-04 08:40:12 +13:00
Karl Tomlinson
02e971d1d8 bug 1221833 reduce FFTConvolver latency by one block r=padenot
--HG--
extra : rebase_source : 1bf6b117a8d50717c04bb6f149bd16e2fc86976a
2015-11-04 06:32:49 +13:00
Karl Tomlinson
3a15f3bba0 bug 1221830 double maximum realtime convolver stage size to 2048 r=padenot
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
2015-11-04 11:46:21 +13:00
Karl Tomlinson
fe5dd59db9 bug 1221830 use WEBAUDIO_BLOCK_SIZE constant in FFTConvolver r=padenot
--HG--
extra : rebase_source : 08b570d5f6f2f3d121706867935253c9d898dd55
2015-11-04 07:39:41 +13:00
Karl Tomlinson
8f7fd34a0b bug 1221830 use WEBAUDIO_BLOCK_SIZE slice size for background convolver thread r=padenot
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
2015-11-03 16:36:53 +13:00
Karl Tomlinson
0c21da20ee bug 1221830 use WEBAUDIO_BLOCK_SIZE constant in Reverb methods r=padenot
--HG--
extra : rebase_source : b7e18f2aa4abf271f45428efac16ee1e703a6652
2015-11-03 16:35:32 +13:00
Karl Tomlinson
0336bb8152 bug 1221831 remove now-unnecessary m_preDelayBuffer r=padenot
--HG--
extra : rebase_source : 77283553705714838d3a3275c57a9cad32d27e7c
2015-11-03 14:14:40 +13:00
Karl Tomlinson
5d90fce0de bug 1221831 use initial input buffer offset to control when convolver stages perform their FFT r=padenot
--HG--
extra : rebase_source : 76c468519435033b4f9a726c6d5ca2e6b44dade9
2015-11-03 12:28:14 +13:00
Karl Tomlinson
90f122ced0 bug 1221831 remove unused Reverb::latencyFrames() r=padenot
--HG--
extra : rebase_source : c5acf681fe724a9258a2fc106d2f8c0b9056c6d3
2015-11-03 13:56:35 +13:00
Karl Tomlinson
eb5e6e879d bug 1221831 remove unused Reverb::reset() r=padenot
--HG--
extra : rebase_source : 2a1f6ef489ca1f00d4f7a7ccdd7fa132c67543d0
2015-11-03 13:53:27 +13:00
Nathan Froyd
01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
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
2015-10-18 01:24:48 -04:00
Nathan Froyd
583afa0965 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
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'
2015-10-18 00:40:10 -04:00
Nicholas Nethercote
5db37503fb Bug 1204195 - Fix two warnings in dom/media/webaudio/blink/. r=rillian.
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
2015-09-14 18:09:14 -07:00
Karl Tomlinson
e74d20e2da bug 1197028 use AudioBlock for web audio processing to reuse buffers shared downstream r=padenot
--HG--
extra : rebase_source : d2e403ae64a314177cba4d596ea235eb351ad3bc
2015-09-03 19:01:50 +12:00
Karl Tomlinson
cdffecdf9b bug 1197028 use AudioChunk::GetDuration() r=padenot
--HG--
extra : rebase_source : 48c1a44fd8509fc3a20f96861790be7b09715214
2015-09-03 18:04:41 +12:00
Karl Tomlinson
e32bdd4030 bug 1197028 use AudioChunk::ChannelCount() r=padenot
--HG--
extra : rebase_source : 033220c221f33fb4230f1384427d24e9b0b01213
2015-09-03 17:30:16 +12:00
Karl Tomlinson
68df460f8c bug 1197028 move AllocateAudioBlock to AudioBlock.h r=padenot
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
2015-09-03 19:05:02 +12:00
Nicholas Nethercote
f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
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
2015-08-27 20:44:53 -07:00
Karl Tomlinson
a4757ceda3 bug 1188704 use existing FFTBlock arrays instead of allocating and copying and scaling r=rillian
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
2015-08-03 09:28:32 +12:00
Karl Tomlinson
6ca6918802 bug 1188704 combine scaling with copying r=rillian
--HG--
extra : rebase_source : f30aed44b66cca842a752a207ab9536e3cb395b2
2015-07-28 15:58:06 +12:00
Karl Tomlinson
893dc9cca8 bug 1188704 simplify culling of partials r=rillian
avoiding copying and scaling components that will be zeroed.

--HG--
extra : rebase_source : a649e78254296945d89f5e03dc75e6af753e56b4
2015-07-28 08:37:21 +12:00
Karl Tomlinson
a4daa97373 bug 1188704 limit number of Fourier coefficients used to halfSize earlier r=rillian
realP[halfSize] was always set to zero because numberOfPartials < halfSize + 1
was always true.

--HG--
extra : rebase_source : 819b04a56032d810231a16fa0dd139cf82ef8ddf
2015-07-30 10:08:15 +12:00
Karl Tomlinson
0ffb72d8eb bug 1188704 trim unnecessary extra basic waveform coeffient r=rillian
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
2015-07-27 23:55:06 +12:00
Karl Tomlinson
0ebb28aa85 bug 1188704 redefine halfSize as fftSize / 2 r=rillian
There are no behavior changes here, just the change in meaning of the variable.

--HG--
extra : rebase_source : 9bae9f29a27430e9074dc0337773313140af9ba2
2015-07-27 22:41:31 +12:00
Nicholas Nethercote
87b80f8c66 Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.
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
2015-07-28 23:24:24 -07:00
Karl Tomlinson
a905a14a19 bug 1187785 reverse tableInterpolationFactor to make it consistent with documentation r=rillian
tableInterpolationFactor = 0 now means use lowerWaveData, which is
rangeIndex2.

--HG--
extra : rebase_source : a8e1b64c534cf2e9aea92dd8a06a4eeee8403d73
2015-07-27 16:59:17 +12:00
Ehsan Akhgari
89d446ad7d Bug 1184419 - Part 2: Get rid of HRTFDatabaseLoader::shutdownEnumFunc; r=padenot 2015-07-16 14:47:59 -04:00
Birunthan Mohanathas
a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Paul Adenot
b1cd8acc4d Bug 1173016 - Properly refcount the inner PeriodicWave object. r=karlt 2015-07-06 13:58:33 +02:00
Paul Adenot
5484d0c363 Bug 1173016 - Cache the basic waveform PeriodicWaves. r=karlt 2015-06-15 18:16:16 +02:00
Nathan Froyd
974d8120f2 Bug 1161627 - part 2 - machine-convert TemporaryRef<T> to already_AddRefed<T>; r=ehsan
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.
2015-06-17 10:00:52 -04:00
Baptiste Emmanuel
92defa0014 Bug 1140450 - Lower speex_resampler quality for Web Audio API. r=padenot 2015-05-21 10:12:23 +02:00
Nathan Froyd
db188ea282 Bug 1160485 - remove implicit conversion from RefPtr<T> to TemporaryRef<T>; r=ehsan
Having this implicit conversion means that we can silently do extra
refcounting when it's completely unnecessary.  It's also an obstacle to
making RefPtr more nsRefPtr-like, so let's get rid of it.
2015-05-01 09:14:16 -04:00
JW Wang
235cf09a22 Bug 926838 - [Part 4] Implement AlignedTArray for 32-byte alignment is required by openmax dl. Also modify callers. r=ehsan 2013-11-13 11:07:31 +08:00
Carsten "Tomcat" Book
1084384de1 Backed out changeset 2a08b161b02e (bug 926838) 2015-05-05 15:51:27 +02:00