[Webkit-unassigned] [Bug 45863] Add HRTFKernel files
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 16 13:40:29 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=45863
--- Comment #3 from James Robinson <jamesr at chromium.org> 2010-09-16 13:40:29 PST ---
(From update of attachment 67758)
View in context: https://bugs.webkit.org/attachment.cgi?id=67758&action=prettypatch
> WebCore/platform/audio/HRTFKernel.cpp:73
> + size_t truncatedResponseLength = std::min(responseLength, fftSize / 2); // truncate if necessary to max impulse response length allowed by FFT
WebKit style is to add a 'using namespace std;' declaration and then call undecorated min().
> WebCore/platform/audio/HRTFKernel.cpp:76
> + float numberOfFadeOutFrames = sampleRate / 4410; // 10 sample-frames @44.1KHz sample-rate
This is truncating from double->float, do you mean to? If so please use a static_cast<> to make it explicit for readers and the compiler.
> WebCore/platform/audio/HRTFKernel.h:50
> + static PassRefPtr<HRTFKernel> create(float* impulseResponse, size_t responseLength, size_t fftSize, double sampleRate, bool bassBoost)
Can you use something other than a float*/size_t pair? It looks like we might be able to use an AudioChannel here. Passing raw pointer/length pairs around is error prone.
> WebCore/platform/audio/HRTFKernel.h:63
> + const FFTFrame* fftFrame() const { return m_fftFrame.get(); }
> +
> + size_t fftSize() const { return fftFrame()->fftSize(); }
WebKit code typically implements functions like fftSize() as just return m_fftFrame->fftSize() instead of providing a const FFTFrame* const getter.
> WebCore/platform/audio/HRTFKernel.h:71
> + // Converts back into impulse-response form.
> + // Response must point to storage of size fftSize().
> + void generateImpulseResponse(float* response);
This seems fragile as well. What will the callers of this look like? Is there any way way to do the logic associated with this in a way that doesn't require passing raw ptrs around?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list