[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

crogers at google.com crogers at google.com
Wed Dec 22 15:07:04 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 212b4ef2b06bea34a57d07c08fe0d7e904467a3e
Author: crogers at google.com <crogers at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 28 03:21:56 2010 +0000

    2010-10-27  Chris Rogers  <crogers at google.com>
    
            Reviewed by Kenneth Russell.
    
            Fixup files affected by VectorMath and related API changes
            https://bugs.webkit.org/show_bug.cgi?id=48481
    
            No new tests since audio API is not yet implemented.
    
            * platform/audio/AudioBus.cpp:
            * platform/audio/AudioChannel.cpp:
            * platform/audio/Biquad.cpp:
            * platform/audio/FFTConvolver.cpp:
            * platform/audio/FFTConvolver.h:
            * platform/audio/Panner.cpp:
            (WebCore::Panner::create):
            * platform/audio/Reverb.cpp:
            (WebCore::calculateNormalizationScale):
            (WebCore::Reverb::initialize):
            (WebCore::Reverb::process):
            * platform/audio/ReverbAccumulationBuffer.cpp:
            * platform/audio/ReverbAccumulationBuffer.h:
            * platform/audio/ReverbConvolver.cpp:
            (WebCore::ReverbConvolver::ReverbConvolver):
            (WebCore::ReverbConvolver::process):
            * platform/audio/ReverbConvolver.h:
            * platform/audio/ReverbConvolverStage.cpp:
            (WebCore::ReverbConvolverStage::ReverbConvolverStage):
            * platform/audio/ReverbConvolverStage.h:
            * platform/audio/ReverbInputBuffer.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70742 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f6621fb..b698e01 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-10-27  Chris Rogers  <crogers at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Fixup files affected by VectorMath and related API changes
+        https://bugs.webkit.org/show_bug.cgi?id=48481
+
+        No new tests since audio API is not yet implemented.
+
+        * platform/audio/AudioBus.cpp:
+        * platform/audio/AudioChannel.cpp:
+        * platform/audio/Biquad.cpp:
+        * platform/audio/FFTConvolver.cpp:
+        * platform/audio/FFTConvolver.h:
+        * platform/audio/Panner.cpp:
+        (WebCore::Panner::create):
+        * platform/audio/Reverb.cpp:
+        (WebCore::calculateNormalizationScale):
+        (WebCore::Reverb::initialize):
+        (WebCore::Reverb::process):
+        * platform/audio/ReverbAccumulationBuffer.cpp:
+        * platform/audio/ReverbAccumulationBuffer.h:
+        * platform/audio/ReverbConvolver.cpp:
+        (WebCore::ReverbConvolver::ReverbConvolver):
+        (WebCore::ReverbConvolver::process):
+        * platform/audio/ReverbConvolver.h:
+        * platform/audio/ReverbConvolverStage.cpp:
+        (WebCore::ReverbConvolverStage::ReverbConvolverStage):
+        * platform/audio/ReverbConvolverStage.h:
+        * platform/audio/ReverbInputBuffer.h:
+
 2010-10-27  Kinuko Yasuda  <kinuko at chromium.org>
 
         Reviewed by Dumitru Daniliuc.
diff --git a/WebCore/platform/audio/AudioBus.cpp b/WebCore/platform/audio/AudioBus.cpp
index 6b7ec3f..dd4746d 100644
--- a/WebCore/platform/audio/AudioBus.cpp
+++ b/WebCore/platform/audio/AudioBus.cpp
@@ -32,7 +32,7 @@
 
 #include "AudioBus.h"
 
-#include "Accelerate.h"
+#include "VectorMath.h"
 #include <algorithm>
 #include <assert.h>
 #include <math.h>
@@ -41,6 +41,8 @@
 
 namespace WebCore {
 
+using namespace VectorMath;
+    
 AudioBus::AudioBus(unsigned numberOfChannels, size_t length, bool allocate)
     : m_length(length)
     , m_busGain(1.0)
diff --git a/WebCore/platform/audio/AudioChannel.cpp b/WebCore/platform/audio/AudioChannel.cpp
index ad38219..a962deb 100644
--- a/WebCore/platform/audio/AudioChannel.cpp
+++ b/WebCore/platform/audio/AudioChannel.cpp
@@ -32,13 +32,15 @@
 
 #include "AudioChannel.h"
 
-#include "Accelerate.h"
+#include "VectorMath.h"
 #include <algorithm>
 #include <math.h>
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
+using namespace VectorMath;
+
 void AudioChannel::scale(double scale)
 {
     float s = static_cast<float>(scale);
diff --git a/WebCore/platform/audio/Biquad.cpp b/WebCore/platform/audio/Biquad.cpp
index 6918dd6..49f010b 100644
--- a/WebCore/platform/audio/Biquad.cpp
+++ b/WebCore/platform/audio/Biquad.cpp
@@ -32,12 +32,15 @@
 
 #include "Biquad.h"
 
-#include "Accelerate.h"
 #include <algorithm>
 #include <float.h>
 #include <math.h>
 #include <stdio.h>
 
+#if OS(DARWIN)
+#include <Accelerate/Accelerate.h>
+#endif
+
 namespace WebCore {
 
 const int kBufferSize = 1024;
diff --git a/WebCore/platform/audio/FFTConvolver.cpp b/WebCore/platform/audio/FFTConvolver.cpp
index b0211fd..9093433 100644
--- a/WebCore/platform/audio/FFTConvolver.cpp
+++ b/WebCore/platform/audio/FFTConvolver.cpp
@@ -32,10 +32,12 @@
 
 #include "FFTConvolver.h"
 
-#include "Accelerate.h"
+#include "VectorMath.h"
 
 namespace WebCore {
 
+using namespace VectorMath;
+    
 FFTConvolver::FFTConvolver(size_t fftSize)
     : m_frame(fftSize)
     , m_readWriteIndex(0)
diff --git a/WebCore/platform/audio/FFTConvolver.h b/WebCore/platform/audio/FFTConvolver.h
index 0eec7c1..c1b5002 100644
--- a/WebCore/platform/audio/FFTConvolver.h
+++ b/WebCore/platform/audio/FFTConvolver.h
@@ -29,7 +29,7 @@
 #ifndef FFTConvolver_h
 #define FFTConvolver_h
 
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
 #include "FFTFrame.h"
 
 namespace WebCore {
diff --git a/WebCore/platform/audio/Panner.cpp b/WebCore/platform/audio/Panner.cpp
index 29a1fbe..a300786 100644
--- a/WebCore/platform/audio/Panner.cpp
+++ b/WebCore/platform/audio/Panner.cpp
@@ -45,7 +45,7 @@ PassOwnPtr<Panner> Panner::create(PanningModel model, double sampleRate)
 
     switch (model) {
     case PanningModelEqualPower:
-        panner = adoptPtr(new EqualPowerPanner());
+        panner = adoptPtr(new EqualPowerPanner(sampleRate));
         break;
 
     case PanningModelHRTF:
diff --git a/WebCore/platform/audio/Reverb.cpp b/WebCore/platform/audio/Reverb.cpp
index 886a553..e59ff46 100644
--- a/WebCore/platform/audio/Reverb.cpp
+++ b/WebCore/platform/audio/Reverb.cpp
@@ -56,12 +56,12 @@ static double calculateNormalizationScale(AudioBus* response)
 {
     // Normalize by RMS power
     size_t numberOfChannels = response->numberOfChannels();
-    size_t frameSize = response->frameSize();
+    size_t length = response->length();
 
     double power = 0.0;
 
     for (size_t i = 0; i < numberOfChannels; ++i) {
-        int n = frameSize;
+        int n = length;
         float* p = response->channel(i)->data();
 
         while (n--) {
@@ -70,7 +70,7 @@ static double calculateNormalizationScale(AudioBus* response)
         }
     }
 
-    power = sqrt(power / (numberOfChannels * frameSize));
+    power = sqrt(power / (numberOfChannels * length));
 
     // Protect against accidental overload
     if (isinf(power) || isnan(power) || power < MinPower)
@@ -102,7 +102,7 @@ Reverb::Reverb(AudioBus* impulseResponse, size_t renderSliceSize, size_t maxFFTS
 
 void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads)
 {
-    m_impulseResponseLength = impulseResponseBuffer->frameSize();
+    m_impulseResponseLength = impulseResponseBuffer->length();
 
     // The reverb can handle a mono impulse response and still do stereo processing
     size_t numResponseChannels = impulseResponseBuffer->numberOfChannels();
@@ -112,8 +112,8 @@ void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize,
     for (size_t i = 0; i < numResponseChannels; ++i) {
         AudioChannel* channel = impulseResponseBuffer->channel(i);
 
-        ReverbConvolver* convolver = new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads);
-        m_convolvers.append(convolver);
+        OwnPtr<ReverbConvolver> convolver = adoptPtr(new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads));
+        m_convolvers.append(convolver.release());
 
         convolverRenderPhase += renderSliceSize;
     }
@@ -129,7 +129,7 @@ void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t frame
     // Do a fairly comprehensive sanity check.
     // If these conditions are satisfied, all of the source and destination pointers will be valid for the various matrixing cases.
     bool isSafeToProcess = sourceBus && destinationBus && sourceBus->numberOfChannels() > 0 && destinationBus->numberOfChannels() > 0
-        && framesToProcess <= MaxFrameSize && framesToProcess <= sourceBus->frameSize() && framesToProcess <= destinationBus->frameSize(); 
+        && framesToProcess <= MaxFrameSize && framesToProcess <= sourceBus->length() && framesToProcess <= destinationBus->length(); 
     
     ASSERT(isSafeToProcess);
     if (!isSafeToProcess)
@@ -167,7 +167,7 @@ void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t frame
 
         // simply copy L -> R
         AudioChannel* destinationChannelR = destinationBus->channel(1);
-        bool isCopySafe = destinationChannelL->data() && destinationChannelR->data() && destinationChannelL->frameSize() >= framesToProcess && destinationChannelR->frameSize() >= framesToProcess;
+        bool isCopySafe = destinationChannelL->data() && destinationChannelR->data() && destinationChannelL->length() >= framesToProcess && destinationChannelR->length() >= framesToProcess;
         ASSERT(isCopySafe);
         if (!isCopySafe)
             return;
diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.cpp b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
index 7b1c63b..3d694d1 100644
--- a/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
+++ b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
@@ -32,10 +32,12 @@
 
 #include "ReverbAccumulationBuffer.h"
 
-#include "Accelerate.h"
+#include "VectorMath.h"
 
 namespace WebCore {
 
+using namespace VectorMath;
+
 ReverbAccumulationBuffer::ReverbAccumulationBuffer(size_t length)
     : m_buffer(length)
     , m_readIndex(0)
diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.h b/WebCore/platform/audio/ReverbAccumulationBuffer.h
index 44a0773..f5ead2a 100644
--- a/WebCore/platform/audio/ReverbAccumulationBuffer.h
+++ b/WebCore/platform/audio/ReverbAccumulationBuffer.h
@@ -29,7 +29,7 @@
 #ifndef ReverbAccumulationBuffer_h
 #define ReverbAccumulationBuffer_h
 
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
 
 namespace WebCore {
 
diff --git a/WebCore/platform/audio/ReverbConvolver.cpp b/WebCore/platform/audio/ReverbConvolver.cpp
index 719e586..120c9f2 100644
--- a/WebCore/platform/audio/ReverbConvolver.cpp
+++ b/WebCore/platform/audio/ReverbConvolver.cpp
@@ -32,11 +32,13 @@
 
 #include "ReverbConvolver.h"
 
-#include "Accelerate.h"
+#include "VectorMath.h"
 #include "AudioBus.h"
 
 namespace WebCore {
 
+using namespace VectorMath;
+
 const int InputBufferSize = 8 * 16384;
 
 // We only process the leading portion of the impulse response in the real-time thread.  We don't exceed this length.
@@ -59,8 +61,8 @@ static void* backgroundThreadEntry(void* threadData)
 }
 
 ReverbConvolver::ReverbConvolver(AudioChannel* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t convolverRenderPhase, bool useBackgroundThreads)
-    : m_impulseResponseLength(impulseResponse->frameSize())
-    , m_accumulationBuffer(impulseResponse->frameSize() + renderSliceSize)
+    : m_impulseResponseLength(impulseResponse->length())
+    , m_accumulationBuffer(impulseResponse->length() + renderSliceSize)
     , m_inputBuffer(InputBufferSize)
     , m_renderSliceSize(renderSliceSize)
     , m_minFFTSize(MinFFTSize) // First stage will have this size - successive stages will double in size each time
@@ -81,7 +83,7 @@ ReverbConvolver::ReverbConvolver(AudioChannel* impulseResponse, size_t renderSli
     bool hasRealtimeConstraint = useBackgroundThreads;
 
     float* response = impulseResponse->data();
-    size_t totalResponseLength = impulseResponse->frameSize();
+    size_t totalResponseLength = impulseResponse->length();
 
     // Because we're not using direct-convolution in the leading portion, the reverb has an overall latency of half the first-stage FFT size
     size_t reverbTotalLatency = m_minFFTSize / 2;
@@ -175,7 +177,7 @@ void ReverbConvolver::backgroundThreadEntry()
 
 void ReverbConvolver::process(AudioChannel* sourceChannel, AudioChannel* destinationChannel, size_t framesToProcess)
 {
-    bool isSafe = sourceChannel && destinationChannel && sourceChannel->frameSize() >= framesToProcess && destinationChannel->frameSize() >= framesToProcess;
+    bool isSafe = sourceChannel && destinationChannel && sourceChannel->length() >= framesToProcess && destinationChannel->length() >= framesToProcess;
     ASSERT(isSafe);
     if (!isSafe)
         return;
diff --git a/WebCore/platform/audio/ReverbConvolver.h b/WebCore/platform/audio/ReverbConvolver.h
index 34f77d3..013b684 100644
--- a/WebCore/platform/audio/ReverbConvolver.h
+++ b/WebCore/platform/audio/ReverbConvolver.h
@@ -29,7 +29,7 @@
 #ifndef ReverbConvolver_h
 #define ReverbConvolver_h
 
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
 #include "FFTConvolver.h"
 #include "ReverbAccumulationBuffer.h"
 #include "ReverbConvolverStage.h"
diff --git a/WebCore/platform/audio/ReverbConvolverStage.cpp b/WebCore/platform/audio/ReverbConvolverStage.cpp
index 8606502..e722813 100644
--- a/WebCore/platform/audio/ReverbConvolverStage.cpp
+++ b/WebCore/platform/audio/ReverbConvolverStage.cpp
@@ -32,7 +32,7 @@
 
 #include "ReverbConvolverStage.h"
 
-#include "Accelerate.h"
+#include "VectorMath.h"
 #include "ReverbAccumulationBuffer.h"
 #include "ReverbConvolver.h"
 #include "ReverbInputBuffer.h"
@@ -41,6 +41,8 @@
 
 namespace WebCore {
 
+using namespace VectorMath;
+
 ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t responseLength, size_t reverbTotalLatency, size_t stageOffset, size_t stageLength,
                                            size_t fftSize, size_t renderPhase, size_t renderSliceSize, ReverbAccumulationBuffer* accumulationBuffer)
     : m_fftKernel(fftSize)
@@ -53,8 +55,8 @@ ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t respon
     ASSERT(accumulationBuffer);
     
     m_fftKernel.doPaddedFFT(impulseResponse + stageOffset, stageLength);
-    m_convolver = new FFTConvolver(fftSize);
-    m_temporaryBuffer.allocate(renderSliceSize);
+    m_convolver = adoptPtr(new FFTConvolver(fftSize));
+    m_temporaryBuffer.resize(renderSliceSize);
 
     // The convolution stage at offset stageOffset needs to have a corresponding delay to cancel out the offset.
     size_t totalDelay = stageOffset + reverbTotalLatency;
@@ -76,7 +78,7 @@ ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t respon
     m_preReadWriteIndex = 0;
     m_framesProcessed = 0; // total frames processed so far
 
-    m_preDelayBuffer.allocate(m_preDelayLength < fftSize ? fftSize : m_preDelayLength);
+    m_preDelayBuffer.resize(m_preDelayLength < fftSize ? fftSize : m_preDelayLength);
 }
 
 void ReverbConvolverStage::processInBackground(ReverbConvolver* convolver, size_t framesToProcess)
diff --git a/WebCore/platform/audio/ReverbConvolverStage.h b/WebCore/platform/audio/ReverbConvolverStage.h
index 88351af..fc05a0e 100644
--- a/WebCore/platform/audio/ReverbConvolverStage.h
+++ b/WebCore/platform/audio/ReverbConvolverStage.h
@@ -29,7 +29,7 @@
 #ifndef ReverbConvolverStage_h
 #define ReverbConvolverStage_h
 
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
 #include "FFTFrame.h"
 #include <wtf/OwnPtr.h>
 
diff --git a/WebCore/platform/audio/ReverbInputBuffer.h b/WebCore/platform/audio/ReverbInputBuffer.h
index aa9cf41..15a2818 100644
--- a/WebCore/platform/audio/ReverbInputBuffer.h
+++ b/WebCore/platform/audio/ReverbInputBuffer.h
@@ -29,7 +29,7 @@
 #ifndef ReverbInputBuffer_h
 #define ReverbInputBuffer_h
 
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
 
 namespace WebCore {
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list