Backed out changeset b1275ea1b6c8

This makes very little perceptible difference, possibly for the worse, and it is more complicated
This commit is contained in:
Chris Cannam
2022-06-09 15:26:16 +01:00
parent 41e726b510
commit 4a9574b7ee
3 changed files with 5 additions and 37 deletions

View File

@@ -140,7 +140,6 @@ public:
void updateGuidance(double ratio, void updateGuidance(double ratio,
const double *const magnitudes, const double *const magnitudes,
const double *const prevMagnitudes, const double *const prevMagnitudes,
const double *const channelMixedMagnitudes,
const BinSegmenter::Segmentation &segmentation, const BinSegmenter::Segmentation &segmentation,
const BinSegmenter::Segmentation &prevSegmentation, const BinSegmenter::Segmentation &prevSegmentation,
const BinSegmenter::Segmentation &nextSegmentation, const BinSegmenter::Segmentation &nextSegmentation,
@@ -222,13 +221,13 @@ public:
if (lower > m_maxLower) lower = m_maxLower; if (lower > m_maxLower) lower = m_maxLower;
*/ */
double prevLower = guidance.fftBands[0].f1; double prevLower = guidance.fftBands[0].f1;
double lower = descendToValley(prevLower, channelMixedMagnitudes); double lower = descendToValley(prevLower, magnitudes);
if (lower > m_maxLower || lower < m_minLower) { if (lower > m_maxLower || lower < m_minLower) {
lower = m_defaultLower; lower = m_defaultLower;
} }
double prevHigher = guidance.fftBands[1].f1; double prevHigher = guidance.fftBands[1].f1;
double higher = descendToValley(prevHigher, channelMixedMagnitudes); double higher = descendToValley(prevHigher, magnitudes);
if (higher > m_maxHigher || higher < m_minHigher) { if (higher > m_maxHigher || higher < m_minHigher) {
higher = m_defaultHigher; higher = m_defaultHigher;
} }

View File

@@ -38,7 +38,6 @@ R3StretcherImpl::R3StretcherImpl(Parameters parameters,
m_guide(Guide::Parameters(m_parameters.sampleRate, parameters.logger)), m_guide(Guide::Parameters(m_parameters.sampleRate, parameters.logger)),
m_guideConfiguration(m_guide.getConfiguration()), m_guideConfiguration(m_guide.getConfiguration()),
m_channelAssembly(m_parameters.channels), m_channelAssembly(m_parameters.channels),
m_mixedClassifyMags(m_guideConfiguration.classificationFftSize / 2 + 1, 0.0),
m_inhop(1), m_inhop(1),
m_prevOuthop(1), m_prevOuthop(1),
m_draining(false) m_draining(false)
@@ -390,24 +389,7 @@ R3StretcherImpl::consume()
// Analysis // Analysis
for (int c = 0; c < channels; ++c) { for (int c = 0; c < channels; ++c) {
analyseChannel(c, inhop, m_prevInhop); analyseChannel(c, inhop, m_prevInhop, m_prevOuthop);
}
for (int c = 0; c < channels; ++c) {
auto &classifyScale =
m_channelData.at(c)->
scales.at(m_guideConfiguration.classificationFftSize);
if (c == 0) {
v_copy(m_mixedClassifyMags.data(), classifyScale->mag.data(),
classifyScale->mag.size());
} else {
v_add(m_mixedClassifyMags.data(), classifyScale->mag.data(),
classifyScale->mag.size());
}
}
for (int c = 0; c < channels; ++c) {
guideChannel(c, m_prevInhop, m_prevOuthop);
} }
// Phase update. This is synchronised across all channels // Phase update. This is synchronised across all channels
@@ -483,7 +465,7 @@ R3StretcherImpl::consume()
} }
void void
R3StretcherImpl::analyseChannel(int c, int inhop, int prevInhop) R3StretcherImpl::analyseChannel(int c, int inhop, int prevInhop, int prevOuthop)
{ {
int longest = m_guideConfiguration.longestFftSize; int longest = m_guideConfiguration.longestFftSize;
int classify = m_guideConfiguration.classificationFftSize; int classify = m_guideConfiguration.classificationFftSize;
@@ -669,17 +651,7 @@ R3StretcherImpl::analyseChannel(int c, int inhop, int prevInhop)
cd->prevSegmentation = cd->segmentation; cd->prevSegmentation = cd->segmentation;
cd->segmentation = cd->nextSegmentation; cd->segmentation = cd->nextSegmentation;
cd->nextSegmentation = cd->segmenter->segment(cd->nextClassification.data()); cd->nextSegmentation = cd->segmenter->segment(cd->nextClassification.data());
}
void
R3StretcherImpl::guideChannel(int c, int prevInhop, int prevOuthop)
{
auto &cd = m_channelData.at(c);
int classify = m_guideConfiguration.classificationFftSize;
auto &classifyScale = cd->scales.at(classify);
/* /*
if (c == 0) { if (c == 0) {
double pb = cd->nextSegmentation.percussiveBelow; double pb = cd->nextSegmentation.percussiveBelow;
@@ -710,7 +682,6 @@ R3StretcherImpl::guideChannel(int c, int prevInhop, int prevOuthop)
m_guide.updateGuidance(instantaneousRatio, m_guide.updateGuidance(instantaneousRatio,
classifyScale->mag.data(), classifyScale->mag.data(),
classifyScale->prevMag.data(), classifyScale->prevMag.data(),
m_mixedClassifyMags.data(),
cd->segmentation, cd->segmentation,
cd->prevSegmentation, cd->prevSegmentation,
cd->nextSegmentation, cd->nextSegmentation,

View File

@@ -259,7 +259,6 @@ protected:
Guide m_guide; Guide m_guide;
Guide::Configuration m_guideConfiguration; Guide::Configuration m_guideConfiguration;
ChannelAssembly m_channelAssembly; ChannelAssembly m_channelAssembly;
FixedVector<double> m_mixedClassifyMags;
std::unique_ptr<StretchCalculator> m_calculator; std::unique_ptr<StretchCalculator> m_calculator;
std::unique_ptr<Resampler> m_resampler; std::unique_ptr<Resampler> m_resampler;
std::atomic<int> m_inhop; std::atomic<int> m_inhop;
@@ -269,8 +268,7 @@ protected:
void consume(); void consume();
void calculateHop(); void calculateHop();
void analyseChannel(int channel, int inhop, int prevInhop); void analyseChannel(int channel, int inhop, int prevInhop, int prevOuthop);
void guideChannel(int channel, int prevInhop, int prevOuthop);
void analyseFormant(int channel); void analyseFormant(int channel);
void adjustFormant(int channel); void adjustFormant(int channel);
void synthesiseChannel(int channel, int outhop); void synthesiseChannel(int channel, int outhop);