Title: [135220] trunk/Source/WebCore
Revision
135220
Author
[email protected]
Date
2012-11-19 17:53:54 -0800 (Mon, 19 Nov 2012)

Log Message

Remove empirical bass-boost for HRTF spatialization
https://bugs.webkit.org/show_bug.cgi?id=102745

Reviewed by Kenneth Russell.

Some empirically-based post-processing is being removed so that we'll
now process with the exact HRTF impulse response measurements.
Listening tests have determined that this post-processing is not necessary.

* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
* platform/audio/HRTFKernel.cpp:
(WebCore::HRTFKernel::HRTFKernel):
* platform/audio/HRTFKernel.h:
(WebCore::HRTFKernel::create):
(HRTFKernel):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135219 => 135220)


--- trunk/Source/WebCore/ChangeLog	2012-11-20 01:52:01 UTC (rev 135219)
+++ trunk/Source/WebCore/ChangeLog	2012-11-20 01:53:54 UTC (rev 135220)
@@ -1,3 +1,22 @@
+2012-11-19  Chris Rogers  <[email protected]>
+
+        Remove empirical bass-boost for HRTF spatialization
+        https://bugs.webkit.org/show_bug.cgi?id=102745
+
+        Reviewed by Kenneth Russell.
+
+        Some empirically-based post-processing is being removed so that we'll
+        now process with the exact HRTF impulse response measurements.
+        Listening tests have determined that this post-processing is not necessary.
+
+        * platform/audio/HRTFElevation.cpp:
+        (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
+        * platform/audio/HRTFKernel.cpp:
+        (WebCore::HRTFKernel::HRTFKernel):
+        * platform/audio/HRTFKernel.h:
+        (WebCore::HRTFKernel::create):
+        (HRTFKernel):
+
 2012-11-19  Adam Barth  <[email protected]>
 
         DISALLOW_COPY_AND_ASSIGN is not a WebKit macro

Modified: trunk/Source/WebCore/platform/audio/HRTFElevation.cpp (135219 => 135220)


--- trunk/Source/WebCore/platform/audio/HRTFElevation.cpp	2012-11-20 01:52:01 UTC (rev 135219)
+++ trunk/Source/WebCore/platform/audio/HRTFElevation.cpp	2012-11-20 01:53:54 UTC (rev 135220)
@@ -198,8 +198,8 @@
 
     // Note that depending on the fftSize returned by the panner, we may be truncating the impulse response we just loaded in.
     const size_t fftSize = HRTFPanner::fftSizeForSampleRate(sampleRate);
-    kernelL = HRTFKernel::create(leftEarImpulseResponse, fftSize, sampleRate, true);
-    kernelR = HRTFKernel::create(rightEarImpulseResponse, fftSize, sampleRate, true);
+    kernelL = HRTFKernel::create(leftEarImpulseResponse, fftSize, sampleRate);
+    kernelR = HRTFKernel::create(rightEarImpulseResponse, fftSize, sampleRate);
     
     return true;
 }

Modified: trunk/Source/WebCore/platform/audio/HRTFKernel.cpp (135219 => 135220)


--- trunk/Source/WebCore/platform/audio/HRTFKernel.cpp	2012-11-20 01:52:01 UTC (rev 135219)
+++ trunk/Source/WebCore/platform/audio/HRTFKernel.cpp	2012-11-20 01:53:54 UTC (rev 135220)
@@ -70,7 +70,7 @@
     return frameDelay;
 }
 
-HRTFKernel::HRTFKernel(AudioChannel* channel, size_t fftSize, float sampleRate, bool bassBoost)
+HRTFKernel::HRTFKernel(AudioChannel* channel, size_t fftSize, float sampleRate)
     : m_frameDelay(0)
     , m_sampleRate(sampleRate)
 {
@@ -82,15 +82,6 @@
     float* impulseResponse = channel->mutableData();
     size_t responseLength = channel->length();
 
-    if (bassBoost) {
-        // Run through some post-processing to boost the bass a little -- the HRTF's seem to be a little bass-deficient.
-        // FIXME: this post-processing should have already been applied to the HRTF file resources.  Once the files are put into this form,
-        // then this code path can be removed along with the bassBoost parameter.
-        Biquad filter;
-        filter.setLowShelfParams(700.0 / nyquist(), 6.0); // boost 6dB at 700Hz
-        filter.process(impulseResponse, impulseResponse, responseLength);
-    }
-
     // We need to truncate to fit into 1/2 the FFT size (with zero padding) in order to do proper convolution.
     size_t truncatedResponseLength = min(responseLength, fftSize / 2); // truncate if necessary to max impulse response length allowed by FFT
 

Modified: trunk/Source/WebCore/platform/audio/HRTFKernel.h (135219 => 135220)


--- trunk/Source/WebCore/platform/audio/HRTFKernel.h	2012-11-20 01:52:01 UTC (rev 135219)
+++ trunk/Source/WebCore/platform/audio/HRTFKernel.h	2012-11-20 01:53:54 UTC (rev 135220)
@@ -51,9 +51,9 @@
 public:
     // Note: this is destructive on the passed in AudioChannel.
     // The length of channel must be a power of two.
-    static PassRefPtr<HRTFKernel> create(AudioChannel* channel, size_t fftSize, float sampleRate, bool bassBoost)
+    static PassRefPtr<HRTFKernel> create(AudioChannel* channel, size_t fftSize, float sampleRate)
     {
-        return adoptRef(new HRTFKernel(channel, fftSize, sampleRate, bassBoost));
+        return adoptRef(new HRTFKernel(channel, fftSize, sampleRate));
     }
 
     static PassRefPtr<HRTFKernel> create(PassOwnPtr<FFTFrame> fftFrame, float frameDelay, float sampleRate)
@@ -79,7 +79,7 @@
 
 private:
     // Note: this is destructive on the passed in AudioChannel.
-    HRTFKernel(AudioChannel*, size_t fftSize, float sampleRate, bool bassBoost);
+    HRTFKernel(AudioChannel*, size_t fftSize, float sampleRate);
     
     HRTFKernel(PassOwnPtr<FFTFrame> fftFrame, float frameDelay, float sampleRate)
         : m_fftFrame(fftFrame)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to