Bug 46527 - Add BiquadProcessor files
Summary: Add BiquadProcessor files
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-24 15:24 PDT by Chris Rogers
Modified: 2010-10-05 00:59 PDT (History)
8 users (show)

See Also:


Attachments
Patch (9.92 KB, patch)
2010-09-24 15:25 PDT, Chris Rogers
no flags Details | Formatted Diff | Diff
Patch (9.44 KB, patch)
2010-10-04 15:56 PDT, Chris Rogers
no flags Details | Formatted Diff | Diff
Patch (9.30 KB, patch)
2010-10-04 16:47 PDT, Chris Rogers
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rogers 2010-09-24 15:24:01 PDT
Add BiquadProcessor files
Comment 1 Chris Rogers 2010-09-24 15:25:42 PDT
Created attachment 68769 [details]
Patch
Comment 2 Chris Rogers 2010-10-01 14:51:37 PDT
BiquadProcessor is used by the various filter AudioNode objects such as LowPass2FilterNode
Comment 3 Kenneth Russell 2010-10-04 14:40:52 PDT
Comment on attachment 68769 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=68769&action=review

Several issues. Also please update the license text per offline discussion.

> WebCore/webaudio/BiquadProcessor.cpp:58
> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);

These are the same parameters as LowPass2. Something looks wrong.

> WebCore/webaudio/BiquadProcessor.cpp:68
> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);

These parameters look the same as those for Peaking aside from m_parameter3 being "unused" instead of "gain". I don't know what the right values should be but please double-check both.

> WebCore/webaudio/BiquadProcessor.cpp:73
> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);

Two assignments to m_parameter3 and none to m_parameter2.

> WebCore/webaudio/BiquadProcessor.cpp:78
> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);

Two assignments to m_parameter3 and none to m_parameter2.

> WebCore/webaudio/BiquadProcessor.h:65
> +    AudioParam& parameter3() { return *m_parameter3; }

Especially since subclasses take the addresses of these references, I think you should return pointers here. You can indicate in the documentation that the BiquadProcessor owns the storage for the parameters.

> WebCore/webaudio/BiquadProcessor.h:70
> +    FilterType m_type; // lowpass, highpass, etc.

As many of these protected fields should be made private as possible. Also, this comment is unnecessary because the FilterType enum is self-documenting.
Comment 4 Chris Rogers 2010-10-04 15:56:47 PDT
Created attachment 69707 [details]
Patch
Comment 5 Chris Rogers 2010-10-04 16:01:03 PDT
Comment on attachment 68769 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=68769&action=review

Also updated LICENSE

>> WebCore/webaudio/BiquadProcessor.cpp:58
>> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);
> 
> These are the same parameters as LowPass2. Something looks wrong.

This should be OK.  They do have the same parameters.

>> WebCore/webaudio/BiquadProcessor.cpp:68
>> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);
> 
> These parameters look the same as those for Peaking aside from m_parameter3 being "unused" instead of "gain". I don't know what the right values should be but please double-check both.

Yes, these ones were not quite right.  I've fixed peaking to use the standard three parameters: frequency, gain, Q
and for Allpass: frequency, Q

>> WebCore/webaudio/BiquadProcessor.cpp:73
>> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);
> 
> Two assignments to m_parameter3 and none to m_parameter2.

FIXED

>> WebCore/webaudio/BiquadProcessor.cpp:78
>> +        m_parameter3 = AudioParam::create("unused", 0.0, 0.0, 1.0);
> 
> Two assignments to m_parameter3 and none to m_parameter2.

FIXED

>> WebCore/webaudio/BiquadProcessor.h:65
>> +    AudioParam& parameter3() { return *m_parameter3; }
> 
> Especially since subclasses take the addresses of these references, I think you should return pointers here. You can indicate in the documentation that the BiquadProcessor owns the storage for the parameters.

FIXED

>> WebCore/webaudio/BiquadProcessor.h:70
>> +    FilterType m_type; // lowpass, highpass, etc.
> 
> As many of these protected fields should be made private as possible. Also, this comment is unnecessary because the FilterType enum is self-documenting.

All made private.
Comment 6 Kenneth Russell 2010-10-04 16:10:44 PDT
Comment on attachment 69707 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=69707&action=review

Thanks for addressing the earlier review feedback. One more issue.

> WebCore/webaudio/BiquadProcessor.cpp:51
> +    case HighPass2:

Since it sounds like these share the same coefficients and how the biquad processor is set up (for a low-pass vs. high-pass filter) is handled at a lower level, please fold these two switch arms together and consider adding a comment that they share the same parameter values, only differing in type.
Comment 7 Chris Rogers 2010-10-04 16:47:57 PDT
Created attachment 69720 [details]
Patch
Comment 8 Chris Rogers 2010-10-04 16:48:47 PDT
FIXED last nit
Comment 9 Kenneth Russell 2010-10-04 16:49:40 PDT
Comment on attachment 69720 [details]
Patch

Looks good.
Comment 10 WebKit Commit Bot 2010-10-05 00:59:27 PDT
Comment on attachment 69720 [details]
Patch

Clearing flags on attachment: 69720

Committed r69091: <http://trac.webkit.org/changeset/69091>
Comment 11 WebKit Commit Bot 2010-10-05 00:59:33 PDT
All reviewed patches have been landed.  Closing bug.