Commit 6953d5fb authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Boxes: Fix abs in Unix transform to int

(just put >= instead of > for comparison
parent 2c6257a9
......@@ -49,17 +49,17 @@ bool CBoxAlgorithmArtefactAmplitude::process()
for (uint32_t i = 0; i < boxContext.getInputChunkCount(0); ++i)
{
bool artefact = false;
m_iSignalCodec.decode(i); // Decode le morceau
m_iSignalCodec.decode(i); // Decode chunk
OV_ERROR_UNLESS_KRF(m_iMatrix->getDimensionCount() == 2, "Invalid Input Signal", ErrorType::BadInput);
if (m_iSignalCodec.isHeaderReceived()) {} // Entete recu
else if (m_iSignalCodec.isBufferReceived()) // Buffer recu
//if (m_iSignalCodec.isHeaderReceived()) {} // Header
if (m_iSignalCodec.isBufferReceived()) // Buffer
{
const size_t size = m_iMatrix->getDimensionSize(0) * m_iMatrix->getDimensionSize(1); // Recuperation de l'echantillonnage
const double* iBuffer = m_iMatrix->getBuffer(); // Buffer d'entree
const size_t size = m_iMatrix->getDimensionSize(0) * m_iMatrix->getDimensionSize(1); // get buffer size
const double* iBuffer = m_iMatrix->getBuffer(); // input buffer
for (size_t idx = 0; idx < size; ++idx)
{
if (abs(iBuffer[idx]) > m_max) // Detection d'artefact
if (abs(iBuffer[idx]) >= m_max) // Amplitude comparison
{
this->getLogManager() << LogLevel_Trace << "Artefact detected in channel (" << floor(idx / m_iMatrix->getDimensionSize(1)) << ")\n";
artefact = true;
......@@ -67,8 +67,8 @@ bool CBoxAlgorithmArtefactAmplitude::process()
}
}
}
else if (m_iSignalCodec.isEndReceived()) {} // Fin recu
//if (m_iSignalCodec.isEndReceived()) {} // End
// We don't need output codec we copy just the inpu to the output if there is no amplitude artefact
if (!artefact)
{
uint64_t tStart = 0, tEnd = 0, chunkSize = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment