13
0

Increase accuracy of analyzed true-peak positions

This commit is contained in:
Robin Gareus 2020-03-06 04:13:09 +01:00
parent b92de5a2fe
commit 4674dd8534
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -593,12 +593,18 @@ VampTruePeak::process(const float *const *inputBuffers,
return FeatureSet(); return FeatureSet();
} }
_meter.process (inputBuffers[0], m_blockSize); size_t remain = m_blockSize;
size_t processed = 0;
while (remain > 0) {
size_t to_proc = std::min ((size_t)48, remain);
_meter.process (&inputBuffers[0][processed], to_proc);
processed += to_proc;
remain -= to_proc;
// TODO optional (not rt safe)
if (_meter.read () >= .89125 /* -1dBTP */) { if (_meter.read () >= .89125 /* -1dBTP */) {
long f = Vamp::RealTime::realTime2Frame (timestamp, m_rate); long f = Vamp::RealTime::realTime2Frame (timestamp, m_rate);
_above_m1.values.push_back ((float) f); _above_m1.values.push_back ((float) (f + processed));
}
} }
return FeatureSet(); return FeatureSet();