Provide a separate window source buffer to simplify single/multi window logic
This commit is contained in:
@@ -132,7 +132,7 @@ protected:
|
||||
FixedVector<process_t> accumulator;
|
||||
int accumulatorFill;
|
||||
|
||||
ChannelScaleData(int _fftSize, int _timeDomainLength) :
|
||||
ChannelScaleData(int _fftSize, int _longestFftSize) :
|
||||
fftSize(_fftSize),
|
||||
bufSize(fftSize/2 + 1),
|
||||
timeDomain(fftSize, 0.f),
|
||||
@@ -143,7 +143,7 @@ protected:
|
||||
advancedPhase(bufSize, 0.f),
|
||||
prevMag(bufSize, 0.f),
|
||||
pendingKick(bufSize, 0.f),
|
||||
accumulator(_timeDomainLength, 0.f),
|
||||
accumulator(_longestFftSize, 0.f),
|
||||
accumulatorFill(0)
|
||||
{ }
|
||||
|
||||
@@ -202,7 +202,7 @@ protected:
|
||||
std::unique_ptr<FormantData> formant;
|
||||
ChannelData(BinSegmenter::Parameters segmenterParameters,
|
||||
BinClassifier::Parameters classifierParameters,
|
||||
int timeDomainLength,
|
||||
int longestFftSize,
|
||||
int inRingBufferSize,
|
||||
int outRingBufferSize) :
|
||||
scales(),
|
||||
@@ -215,7 +215,7 @@ protected:
|
||||
BinClassifier::Classification::Residual),
|
||||
segmenter(new BinSegmenter(segmenterParameters)),
|
||||
segmentation(), prevSegmentation(), nextSegmentation(),
|
||||
mixdown(timeDomainLength, 0.f),
|
||||
mixdown(longestFftSize, 0.f),
|
||||
resampled(outRingBufferSize, 0.f),
|
||||
inbuf(new RingBuffer<float>(inRingBufferSize)),
|
||||
outbuf(new RingBuffer<float>(outRingBufferSize)),
|
||||
@@ -297,7 +297,7 @@ protected:
|
||||
std::map<int, std::shared_ptr<ScaleData>> m_scaleData;
|
||||
Guide m_guide;
|
||||
Guide::Configuration m_guideConfiguration;
|
||||
int m_timeDomainFrameLength;
|
||||
FixedVector<process_t> m_windowSourceBuffer;
|
||||
ChannelAssembly m_channelAssembly;
|
||||
std::unique_ptr<StretchCalculator> m_calculator;
|
||||
std::unique_ptr<Resampler> m_resampler;
|
||||
@@ -376,6 +376,15 @@ protected:
|
||||
return m_parameters.options &
|
||||
RubberBandStretcher::OptionWindowShort;
|
||||
}
|
||||
|
||||
int getWindowSourceBufferLength() const {
|
||||
if (m_guideConfiguration.longestFftSize >
|
||||
m_guideConfiguration.classificationFftSize) {
|
||||
return m_guideConfiguration.longestFftSize;
|
||||
} else {
|
||||
return (m_guideConfiguration.classificationFftSize * 3) / 2;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user