This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Question about the aac decoder in DVRRDK3.05



Hi,

I use the aac decoder provided in DVRRDK3.05 to test the DSP codec. I use the davinci.aac as the input file and find that the minInputBufSize which the decode acquired is 3840 bytes. But the input data each time the decode consumed is just more or less 340 bytes. And in Audio_decodeAac() function which do the decode task, if the input buf size is less than the minInputBufSize, the function will return zero. So, the aac decoder could not decode the data at the end of the input file. I could not understand why the aac decoder needs 3840 bytes as it's minInput buf size but actully consumes just 1/10 of the input data. Could someone give the detail information of the aac decoder?

Thanks in advance!

 

  • Hi Bing,

    AAC decoder expects atleast one full frame in input buffer. As per ISO/ICE AAC standard, maximum frame size is 768 bytes/channel.

    For stereo it will be 1536 bytes. But we have seen some stereo streams violating the standard with framesize > 3000 bytes. Such streams are decoded properly with other players. To support this, TI's decoder continues decoding even if it violates the standard.

    3840 corresponds to maximum framesize for 5 channel stream. Though the decoder is stereo, we have set 3840 as minimum input buffer requirement.

    Ram

  • Hi Ram,

    Thanks for your reply! Do you mean that for stereo I can set the min input buffer size to 1536? For the rest of the input data whose length is less than 1536, could I add  zeros in the end to form a full frame and give it to the decoder?

  • Hi Bing,

    Application can not set minimum buffer size. It is the requirement expected by decoder. You still have to go with 3840 buffer size.

    You don't need to pad zero also for input data whose length is < 1536. If the buffer has full frame data , decoder should decode the frame.

    How many bytes are in input buffer are not getting decoded?

    Ram

  • Hi Ram,

    In the file rpe_audio.c, there are the following codes in Audio_decodeAac() function:

    if (pPrm->inBuf.dataBufSize >= ctx->decMinInputBufSize)
    {
           pPrm->inBuf.dataBufSize = ctx->decMinInputBufSize;
    }
    else
    {
         pPrm->numSamples = 0;
         pPrm->outBuf.dataBufSize = 0;
         pPrm->inBuf.dataBufSize = 0;
         return 0;
    }

    Could I replace "if (pPrm->inBuf.dataBufSize >= ctx->decMinInputBufSize)" to "if (pPrm->inBuf.dataBufSize >= 1536)"?

    When I use davinci.aac as the input file, there will be 3836 bytes left. As 3836 is less than 3840, the decoder will not do decode task for these bytes.

  • Hi Bing,

    This condition is not allowing to decode last 3.5k bytes of data.

    Comment else part completely , this should be able to decode remaining bytes.

    Ram

  • Hi Ram,

    Thanks for your reply! As the aac decode must have one full frame as it input. For the input file whose length is not integer multiples of the frame length(1536 for stereo), the decoder could not decode all the data for sure. I check the davinci.aac and find it's length is not multiples of 1536. I will test if the decode will decode all the data. Another question, the decoder output data length shall be a const number or depend on the input data? I mean different input data with same length. I want to do audio mix after decode, so if the decode output data length is the same for all channels, the mix job will be easier. 

  • Hi Ram,

    I do the test and the decoder now could decode all the input data. I open the pcm file in cooledite and the length is the same as the aac file.

    For the decoder output data length, I test with different input aac files which were converted from mp3 using the same convertor and get the same result.