Closed
Bug 875277
Opened 12 years ago
Closed 11 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)
(deleted),
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•11 years ago
|
||
Mass moving Web Audio bugs to the Web Audio component. Filter on duckityduck.
Component: Video/Audio → Web Audio
Assignee | ||
Comment 2•11 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•11 years ago
|
Flags: needinfo?(jmvalin)
Comment 3•11 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•11 years ago
|
||
Attachment #782479 -
Flags: review?(ehsan)
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #782480 -
Flags: review?(ehsan)
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #782481 -
Flags: review?(ehsan)
Reporter | ||
Updated•11 years ago
|
Attachment #782479 -
Flags: review?(ehsan) → review+
Reporter | ||
Comment 8•11 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•11 years ago
|
Attachment #782481 -
Flags: review?(ehsan)
Assignee | ||
Comment 9•11 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•11 years ago
|
Attachment #782972 -
Attachment description: implement based on libspeex → Part2 - implement based on libspeex
Reporter | ||
Comment 10•11 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•11 years ago
|
Assignee: nobody → jwwang
Assignee | ||
Comment 11•11 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•11 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•11 years ago
|
||
Attachment #782972 -
Attachment is obsolete: true
Attachment #785583 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Updated•11 years ago
|
Keywords: dev-doc-needed
Comment 14•11 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•11 years ago
|
||
Assignee | ||
Comment 16•11 years ago
|
||
"OverSampleType mType;" is missing from WaveShaperNode.h after merge and results in build fail. Does the merge fail?
Comment 17•11 years ago
|
||
Maybe. Please make sure your patches apply against m-c tip and rebase as necessary.
Assignee | ||
Comment 18•11 years ago
|
||
Attachment #782479 -
Attachment is obsolete: true
Attachment #786152 -
Flags: review+
Assignee | ||
Comment 19•11 years ago
|
||
Attachment #785583 -
Attachment is obsolete: true
Attachment #786153 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 20•11 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•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/802ef003bb08
https://hg.mozilla.org/mozilla-central/rev/1406e31167e2
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Reporter | ||
Comment 22•11 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•11 years ago
|
Attachment #786152 -
Flags: approval-mozilla-aurora?
Comment 24•11 years ago
|
||
Comment 25•11 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•11 years ago
|
Flags: in-testsuite?
Comment 27•10 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•10 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
•