Help - Search - Members - Calendar
Full Version: Please help, how to determine AAC packet size?
Hydrogenaudio Forums > Lossy Audio Compression > AAC > AAC - Tech
lift
Hello,

I am trying to parse an AAC stream and extract at frame (or packet, sorry if I don't have the right terminology) boundaries. When parsing an MP3 stream, I can take the frame length from the header and expect to see a sync word at header offset + frame length. In every AAC stream I've looked at taking the frame length as a byte count (according to an old version of ISO 14496-3 that I have) and adding that to the frame header offset always seems to put me at an arbitrary offset (i.e. non-syncword) in the stream.

Can anyone tell me how to determine from the ADTS header (if possible) the total length of the compressed packet? I'd really like to be able to fill a buffer with a "whole" frame and expect to see the syncword as the next byte in the stream.

I'm asking for two reasons:

1) because I need to send a complete packet to the decoder, and
2) because I'd like to do an integrity check on the stream, i.e. if a syncword shows up at the a calculated offset then I can probably assume the frame was transmitted correctly.

Is it possible the spec I have is out of data and the AAC frame length field is the number of bits for a single channel, where the total frame bytes would then be (frame length * channel count / 8)?

Thank you!
lift
Update: I found the problem...

I was looking at the ADTS fixed header description in ISO 14496-3 (1998) section 1.1.2.1 Table 1-6. In this table there are two additional bits at the end of the structure for a field called 'emphasis'. This field is not present in ISO 13818-7 (2004) section 6.2.1. Lol, guess this has been screwing me up for a while.

Can anyone tell me when/why this field was removed?

Thanks!
cmurillo
Hi!

I am working on a decoder for aac format. I'm new in this, maybe you could help me out a little bit. I need to know the beginning of a frame, which I assume I can find by reading the headers. Is there a specific pattern that I should look for???

Thanks,
Cristina
cmurillo
Hi!

I am working on a decoder for aac format. I'm new in this, maybe you could help me out a little bit. I need to know the beginning of a frame, which I assume I can find by reading the headers. Is there a specific pattern that I should look for???

Thanks,
Cristina
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.