Forums - FAQ: Conversion in Elite framework from 16-bit to 24-bit in the decoder side before sending to POPP topology

1 post / 0 new
FAQ: Conversion in Elite framework from 16-bit to 24-bit in the decoder side before sending to POPP topology
brianp
Join Date: 5 Dec 12
Posts: 41
Posted: Thu, 2013-10-10 18:19

If a 24-bit audio playback session is created and the decoder generates the output in 16-bit then after completing the decoding process Elite framework converts the 16-bit data into 24-bit in AudioDecSvc dynamic service.

Please see, AudioDecSvc_Process() in AudioDecSvc.cpp (Piece of code given below)

 

//get the decoder output bits per sample
int dec_bits_per_sample;
pMe->pDecoderLib->GetParam(eIcapiBitsPerSample,
&dec_bits_per_sample);
//if input is 16 bits and output is 24 bits need to shift
if((16 == dec_bits_per_sample) && (24 == pMe->output_bits_per_sample))
{
/* 16 -> 24 bit conversion if required */

uint32_t num_samples_per_chan = (pMe->PcmData.pBuf[0].nActualDataLen) / (channel_cfg_after->nChannels * BYTES_PER_SAMPLE_TWO);

int8_t * final_dst_ptr = (int8_t *)pMe->PcmData.pBuf[0].Data;
uint32_t num_channels = channel_cfg_after->nChannels;
memcpy(pMe->scratch_out_buf, final_dst_ptr, pMe->PcmData.pBuf[0].nActualDataLen);
/* Q15->Q28 conversion */
byte_up_down_convertor_deintlv((int8_t *)pMe->scratch_out_buf,
final_dst_ptr,
num_samples_per_chan,
num_channels,
num_samples_per_chan,
num_samples_per_chan,
BYTE_UP_CONV);
/* Double the out size in bytes */
pMe->PcmData.pBuf[0].nActualDataLen <<= 1;
}
  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.