Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Quantization & Huffman in AAC (Read 3458 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Quantization & Huffman in AAC

I have several difficulties to understand the quantization and Huffman coding procedure in AAC.
The whole process is quite unclear to me. 

In the quantization formula for the MDCT coeffcients includes the scalefactor (chosen from a table)
and a "common scalefactor". It seems that the "common scalefactor" assures that the quantized
integers (for the frame) are between plus and minus 8191. (Yes?)


Ok, subsequently the integers are Huffman coded, with given Huffman code books.
Now, I would assume that between -8191 and +8191 every integer is possible. (Yes?)
But this would imply  that the Huffman Code book also needs to have 16384 entries. (Yes?)
Which is apparently not the case. The largest table seems to have 288 entries.

This is all very confusing. Any help to understand whats going on is appreciated. 


Quantization & Huffman in AAC

Reply #1
The common scalefactor is just the starting value in a differential coding process of the actual used scalefactors. The scalefactors are coded differentially so they require less bits.

The huffman tables don't really code any high values (don't know the exact maximum, but I think it's 15). Higher values are coded using escape sequences. Also the quantized values are huffman coded in sets of 2 or 4, not each one separately.

 

Quantization & Huffman in AAC

Reply #2
Thank you very much. I see much clearer now!