зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1706772 use size_t for RevebAccumulationBuffer read index r=padenot
The accumulate() return value and updateReadIndex() were unused. Depends on D113624 Differential Revision: https://phabricator.services.mozilla.com/D113625
This commit is contained in:
Родитель
a773a03d90
Коммит
f6cc0e39ab
|
@ -74,15 +74,10 @@ void ReverbAccumulationBuffer::readAndClear(float* destination,
|
|||
m_readTimeFrame += numberOfFrames;
|
||||
}
|
||||
|
||||
void ReverbAccumulationBuffer::updateReadIndex(int* readIndex,
|
||||
size_t numberOfFrames) const {
|
||||
// Update caller's readIndex
|
||||
*readIndex = (*readIndex + numberOfFrames) % m_buffer.Length();
|
||||
}
|
||||
|
||||
int ReverbAccumulationBuffer::accumulate(const float* source,
|
||||
size_t numberOfFrames, int* readIndex,
|
||||
size_t delayFrames) {
|
||||
void ReverbAccumulationBuffer::accumulate(const float* source,
|
||||
size_t numberOfFrames,
|
||||
size_t* readIndex,
|
||||
size_t delayFrames) {
|
||||
size_t bufferLength = m_buffer.Length();
|
||||
|
||||
size_t writeIndex = (*readIndex + delayFrames) % bufferLength;
|
||||
|
@ -100,7 +95,7 @@ int ReverbAccumulationBuffer::accumulate(const float* source,
|
|||
numberOfFrames1 + writeIndex <= bufferLength &&
|
||||
numberOfFrames2 <= bufferLength;
|
||||
MOZ_ASSERT(isSafe);
|
||||
if (!isSafe) return 0;
|
||||
if (!isSafe) return;
|
||||
|
||||
AudioBufferAddWithScale(source, 1.0f, destination + writeIndex,
|
||||
numberOfFrames1);
|
||||
|
@ -108,8 +103,6 @@ int ReverbAccumulationBuffer::accumulate(const float* source,
|
|||
AudioBufferAddWithScale(source + numberOfFrames1, 1.0f, destination,
|
||||
numberOfFrames2);
|
||||
}
|
||||
|
||||
return writeIndex;
|
||||
}
|
||||
|
||||
void ReverbAccumulationBuffer::reset() {
|
||||
|
|
|
@ -52,12 +52,10 @@ class ReverbAccumulationBuffer {
|
|||
// delay from the read position. We need to pass in and update readIndex here,
|
||||
// since each ReverbConvolverStage may be running in a different thread than
|
||||
// the realtime thread calling ReadAndClear() and maintaining m_readIndex
|
||||
// Returns the writeIndex where the accumulation took place
|
||||
int accumulate(const float* source, size_t numberOfFrames, int* readIndex,
|
||||
size_t delayFrames);
|
||||
void accumulate(const float* source, size_t numberOfFrames, size_t* readIndex,
|
||||
size_t delayFrames);
|
||||
|
||||
size_t readIndex() const { return m_readIndex; }
|
||||
void updateReadIndex(int* readIndex, size_t numberOfFrames) const;
|
||||
|
||||
size_t readTimeFrame() const { return m_readTimeFrame; }
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ class ReverbConvolverStage {
|
|||
mozilla::UniquePtr<FFTConvolver> m_fftConvolver;
|
||||
|
||||
ReverbAccumulationBuffer* m_accumulationBuffer;
|
||||
int m_accumulationReadIndex;
|
||||
size_t m_accumulationReadIndex;
|
||||
int m_inputReadIndex;
|
||||
|
||||
size_t m_postDelayLength;
|
||||
|
|
Загрузка…
Ссылка в новой задаче