Closed
Bug 875277
Opened 10 years ago
Closed 10 years ago
Implement WaveShaperNode.oversample
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: ehsan.akhgari, Assigned: jwwang)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(2 files, 6 obsolete files)
6.86 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
6.26 KB,
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•10 years ago
|
||
Mass moving Web Audio bugs to the Web Audio component. Filter on duckityduck.
Component: Video/Audio → Web Audio
Assignee | ||
Comment 2•10 years ago
|
||
The idea is to use libspeex for up/down sampling per chunk. However, speex_resampler_process_float() gives weird outputs in Resampler::UpSample/DownSample. Is there anything missing to use libspeex correctly?
Updated•10 years ago
|
Flags: needinfo?(jmvalin)
Comment 3•10 years ago
|
||
Pass 1 for channel count to _init and 0 for channel number in _process_float because the channels are already individual streams.
Assignee | ||
Comment 5•10 years ago
|
||
Attachment #782479 -
Flags: review?(ehsan)
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #782480 -
Flags: review?(ehsan)
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #782481 -
Flags: review?(ehsan)
Reporter | ||
Updated•10 years ago
|
Attachment #782479 -
Flags: review?(ehsan) → review+
Reporter | ||
Comment 8•10 years ago
|
||
Comment on attachment 782480 [details] [diff] [review] Part2 - add up/down samplers from Blink Review of attachment 782480 [details] [diff] [review]: ----------------------------------------------------------------- Why should we not use libspeex here? I don't think this is the right thing to do.
Attachment #782480 -
Flags: review?(ehsan) → review-
Reporter | ||
Updated•10 years ago
|
Attachment #782481 -
Flags: review?(ehsan)
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #780297 -
Attachment is obsolete: true
Attachment #782480 -
Attachment is obsolete: true
Attachment #782481 -
Attachment is obsolete: true
Attachment #782972 -
Flags: review?(ehsan)
Assignee | ||
Updated•10 years ago
|
Attachment #782972 -
Attachment description: implement based on libspeex → Part2 - implement based on libspeex
Reporter | ||
Comment 10•10 years ago
|
||
Comment on attachment 782972 [details] [diff] [review] Part2 - implement based on libspeex Review of attachment 782972 [details] [diff] [review]: ----------------------------------------------------------------- Looks great, thanks! ::: content/media/webaudio/WaveShaperNode.cpp @@ +67,5 @@ > + void Reset(uint32_t aChannels, uint32_t aSampleRate, OverSampleType aType) > + { > + if (aChannels == mChannels > + && aSampleRate == mSampleRate > + && aType == mType) Nit: please put the ands at the end of lines. Also, please wrap if's in curly brackets. @@ +90,5 @@ > + mDownSampler = speex_resampler_init(aChannels, > + aSampleRate * ValueOf(aType), > + aSampleRate, > + SPEEX_RESAMPLER_QUALITY_DEFAULT, > + nullptr); Hmm, I think it would be slightly better to lazily allocate the resamplers, since I believe in most cases we will only end up using one of them. @@ +104,5 @@ > + MOZ_ASSERT(mBuffer.Length() == outSamples); > + > + speex_resampler_process_float(mUpSampler, aChannel, > + aInputData, &inSamples, > + outputData, &outSamples); After this line, please MOZ_ASSERT(inSamples == WEBAUDIO_BLOCK_SIZE && outSamples == WEBAUDIO_BLOCK_SIZE * aBlocks);. Same in DownSample() below. @@ +139,5 @@ > + OverSampleType mType; > + SpeexResamplerState* mUpSampler; > + SpeexResamplerState* mDownSampler; > + uint32_t mChannels; > + uint32_t mSampleRate; Nit: please use TrackRate as the type of the sample rate here and in the above functions. (TrackRate is int32_t.)
Attachment #782972 -
Flags: review?(ehsan) → review+
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → jwwang
Assignee | ||
Comment 11•10 years ago
|
||
Comment on attachment 782972 [details] [diff] [review] Part2 - implement based on libspeex Review of attachment 782972 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/webaudio/WaveShaperNode.cpp @@ +90,5 @@ > + mDownSampler = speex_resampler_init(aChannels, > + aSampleRate * ValueOf(aType), > + aSampleRate, > + SPEEX_RESAMPLER_QUALITY_DEFAULT, > + nullptr); I don't get it. Do you mean we will only use either upsampler or downsampler in most cases? I think we will need both of them to complete the process (upsample -> apply curve -> downsample).
Reporter | ||
Comment 12•10 years ago
|
||
(In reply to jwwang from comment #11) > Comment on attachment 782972 [details] [diff] [review] > Part2 - implement based on libspeex > > Review of attachment 782972 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: content/media/webaudio/WaveShaperNode.cpp > @@ +90,5 @@ > > + mDownSampler = speex_resampler_init(aChannels, > > + aSampleRate * ValueOf(aType), > > + aSampleRate, > > + SPEEX_RESAMPLER_QUALITY_DEFAULT, > > + nullptr); > > I don't get it. Do you mean we will only use either upsampler or downsampler > in most cases? I think we will need both of them to complete the process > (upsample -> apply curve -> downsample). No, sorry, this comment was a mistake of mine, and I meant to remove it before submitting the review! Please ignore it.
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #782972 -
Attachment is obsolete: true
Attachment #785583 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Updated•10 years ago
|
Keywords: dev-doc-needed
Comment 14•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a633e4d67d31 https://hg.mozilla.org/integration/mozilla-inbound/rev/aee6b1a6c400
Keywords: checkin-needed
Comment 15•10 years ago
|
||
Backed out for bustage. https://hg.mozilla.org/integration/mozilla-inbound/rev/a0dd80f800e2 https://tbpl.mozilla.org/php/getParsedLog.php?id=26184561&tree=Mozilla-Inbound
Assignee | ||
Comment 16•10 years ago
|
||
"OverSampleType mType;" is missing from WaveShaperNode.h after merge and results in build fail. Does the merge fail?
Comment 17•10 years ago
|
||
Maybe. Please make sure your patches apply against m-c tip and rebase as necessary.
Assignee | ||
Comment 18•10 years ago
|
||
Attachment #782479 -
Attachment is obsolete: true
Attachment #786152 -
Flags: review+
Assignee | ||
Comment 19•10 years ago
|
||
Attachment #785583 -
Attachment is obsolete: true
Attachment #786153 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 20•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/802ef003bb08 https://hg.mozilla.org/integration/mozilla-inbound/rev/1406e31167e2
Keywords: checkin-needed
Comment 21•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/802ef003bb08 https://hg.mozilla.org/mozilla-central/rev/1406e31167e2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Reporter | ||
Comment 22•10 years ago
|
||
Comment on attachment 786152 [details] [diff] [review] Part1 - add webidl enums This is needed for Web Audio in Firefox 25.
Attachment #786152 -
Flags: approval-mozilla-aurora?
Reporter | ||
Updated•10 years ago
|
Attachment #786152 -
Flags: approval-mozilla-aurora?
Comment 24•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/109bf9967b3d https://hg.mozilla.org/releases/mozilla-aurora/rev/32aab56d0aa5
Comment 25•10 years ago
|
||
Backed out in https://hg.mozilla.org/releases/mozilla-aurora/rev/4d652113720b because something in https://tbpl.mozilla.org/?tree=Mozilla-Aurora&rev=2d110609f4d3 caused test_mediaStreamAudioSourceNodeResampling.html to time out (once https://tbpl.mozilla.org/?tree=Mozilla-Aurora&rev=918a847c0018 let things get that far).
Updated•9 years ago
|
Flags: in-testsuite?
Comment 27•9 years ago
|
||
Doc is up-to-date: https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode.oversample https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode
Keywords: dev-doc-needed → dev-doc-complete
Comment 28•9 years ago
|
||
Ooops, last link should have been: https://developer.mozilla.org/en-US/Firefox/Releases/26
You need to log in
before you can comment on or make changes to this bug.
Description
•