knik0 / faad2

Freeware Advanced Audio (AAC) Decoder faad2 mirror
https://sourceforge.net/projects/faac/
Other
175 stars 77 forks source link

TNS_MAX_ORDER is object type and short/long window dependent #195

Open atimmernans opened 11 months ago

atimmernans commented 11 months ago

I was looking at some AAC specs and they mention that TNS_MAX_ORDER is a constant that is dependent of the object type and can takes values 12 or 20 for long windows and 7 for short windows. FAAD2 seems to only use value 20.

Since they are some draft specs found on the net and not official ones can you check this point?

eustas commented 11 months ago

For short window it is capped with 7 indeed (search for order_bits = 3 and tns_order = min(tns->order[w][f], TNS_MAX_ORDER). For long window it is capped with 20, but again it could be 0..20.

eustas commented 11 months ago

@atimmernans it would be nice if you provide some quotes, to be sure we have coded it right. Currently I do not have access to spec to check it myself.

atimmernans commented 11 months ago

From that ISO/IEC 14496-3:2009 document:

4.6.9.4 Maximum TNS order and bandwidth The value for the constant MAX_TNS_ODER depends on audio object type and windowing, and. Table 4.156 defines MAX_TNS_ORDER depending on these parameters. Table 4.156 – Definition of TNS_MAX_ORDER depending on AOT and windowing windowing short windows long windows AOT 1 (AAC Main) 7 20 other AOT using TNS 7 12