aac stream decoding

aac stream decoding

Hi!

I would like to decode a One Way(What does this means?)AAC LC stream coming froma camera. It is transported by RTP to a programand thatgives the audio data to my program. I tried to feed the data with theAAC decoder, but it didn't recognize the type. What is the difference between AACDecoder and AACDecoderInt? How can I feed the audio data with the decoder to decode it?

Thanks in advance:

Bendeguy

9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello, UMC AAC decoder should be able to work with AAC audio stream, could you check it for correctness? As I understand it was extracted from RTP and de-packetized..

The difference between AACDecoder and AACDecoderInt is only in used internal arithmetic. The first one is built on floating-point calculations whereas the second one is built on fixed-point arithmetic (to be used on FPU-less platforms, like XScale).

Vladimir

Hello,

It seems to me, it hasn't got any header. I think it is raw aac without header and the information about the aac packets is sent by SDP. I have the following audiospecific MIME informations:

m=audio 0 RTP/AVP 97
a=control:trackID=2
a=rtpmap:97 mpeg4-generic/16000/1
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1408; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=mpeg4-esid:101

It seems to me the config=1408 is the information which can be decoded with the

dec_audio_specific_config

function. It means subtype = LC, sample frequency = 16000kHz channels = 1 andframesize= 1024. Is this information enough to decode aac audio without any header?

Thanks in advance,

Bendeguy

Problem solved. The solution:

I set the streamtype to UMC::AAC_MPEG4_STREAM. After then I made an AudioData object and filled it with the MIME config parameter(two byte: 14h 08h). Then comes a GetFrame which decode this two frame and do nothing else. After this the AAC Frames can beput to an AudioData object. And that can be decoded with the GetFrame. I hope somebody can use this information.

Bye,

Bendeguy

Hello Bendeguy,

thank you for sharing your findings with others!

Regards,
Vladimir

Hello Vladimir,

You're welcome. One more notice:

In the AACDecoder::GetFrame function:

if (AAC_MPEG4_STREAM == m_info.m_init_stream_type) {
in->MoveDataPointer(in->GetDataSize());
} else {
in->MoveDataPointer(nDecodedBytes);
}

This part of the code caused problem to me because I have a lot of AAC Frame in one packet. So, when I decode the first frame it sets the data pointer to the end of the data and I can't decode the others. I think there is no needfor this distinction:

  • if I have stream packet with only one frame, then the decoder decodes and the
    in->MoveDataPointer(nDecodedBytes) can move the cursor to the end of the data(similar tothe in->MoveDataPointer(in->GetDataSize()) )
  • if I have stream packet with more then one frame, then I would like to decode all of them

Correct me if I'm wrong

Greetings,

Bendeguy

Hello,

could you please attach your stream here?

Regards,
Vladimir

Hello,

I attachedthe example file.

Greetings,

Bendeguy

Attachments: 

AttachmentSize
Downloadapplication/zip aac.zip5 KB

Hello,

there is comment from our expert

The function GetFrame decoded only one frame of encoded data. After frame decoding the data pointer is shifted on value nDecodedBytes. Then, to decode next frame, one should call GetFrame function once again. But there is one exception. It is well known that MPEG4 chunks contain only one AAC frame, but sometimes these chunks contains also additional data (garbage data) after AAC frames. To decode AAC streams encapsulated into MPEG4 container we use MPEG4 splitter which returns us MediaData containing exactly one chunk. To skip garbage data our AAC decoder sets the data pointer to the end of MediaData. It allows us to use the same algorithm of data handling outside the decoder for all types of AAC container (ADIF, ADTS, MPEG4) (I mean shift remaining data and append the new one)

Regards,
Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today