Fix sample unpacking

This commit is contained in:
Geoffrey Merck 2020-05-24 08:01:59 +02:00
parent 0bd79fa440
commit 47649171fc
1 changed files with 3 additions and 3 deletions

View File

@ -52,9 +52,9 @@ void CFMUpSampler::addData(const uint8_t* data, uint16_t length)
uint32_t pack = 0U; uint32_t pack = 0U;
uint8_t* packPtr = (uint8_t*)&pack; uint8_t* packPtr = (uint8_t*)&pack;
packPtr[1] = m_pack.byte0; packPtr[0U] = m_pack.byte0;
packPtr[2] = m_pack.byte1; packPtr[1U] = m_pack.byte1;
packPtr[3] = m_pack.byte2; packPtr[2U] = m_pack.byte2;
q15_t sample2 = q15_t(uint16_t(pack & FM_UPSAMPLE_MASK) - 2048); q15_t sample2 = q15_t(uint16_t(pack & FM_UPSAMPLE_MASK) - 2048);
q15_t sample1 = q15_t(uint16_t(pack >> 12) - 2048); q15_t sample1 = q15_t(uint16_t(pack >> 12) - 2048);