Quantized Subband Samples
This contains exactly 36 quantized subband samples for a channel and a subband.
After requantization and channel dematrixing this gives the input for the subband synthesizer.
Member of Audio Frame
Coding of the subband samples depends and only depends on the Allocation.
Samples are huffman coded by fixed huffman tables.
The following allocations are currently defined (allocations below 0 are not possible for subband 0):
alloc | sample value are . . . | typical entropy per sample | No. of Codes |
-32 | Reserved | | - |
. . . | . . . | | - |
-18 | Reserved | | - |
-17 | Intensity stereo using 8 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-16 | Intensity stereo using 7 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-15 | Intensity stereo using 6 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-14 | Intensity stereo using 5 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-13 | Intensity stereo using 4 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-12 | Intensity stereo using 3 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-11 | Intensity stereo using 2 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-10 | Intensity stereo using 1 vector bit, all further bands also uses this encoding | 0.00 bit | - |
-9 | Intensity stereo using 8 vector bit | 0.00 bit | - |
-8 | Intensity stereo using 7 vector bit | 0.00 bit | - |
-7 | Intensity stereo using 6 vector bit | 0.00 bit | - |
-6 | Intensity stereo using 5 vector bit | 0.00 bit | - |
-5 | Intensity stereo using 4 vector bit | 0.00 bit | - |
-4 | Intensity stereo using 3 vector bit | 0.00 bit | - |
-3 | Intensity stereo using 2 vector bit | 0.00 bit | - |
-2 | Intensity stereo using 1 vector bit | 0.00 bit | - |
-1 | -0.5 or +0.5 generated by a random number generator | 0.00 bit | - |
0 | 0. all further bands also uses this encoding | 0.00 bit | - |
1 | 0. | 0.00 bit | - |
2 | [-1,+1], 6 samples are grouped At most 2 samples per group can be nonzero. | 0.58 bit | 73 (table_03) |
3 | [-1,+1], 4 samples are grouped | 1.11 bit | 81 (table_04) |
4 | [-1,+1], 3 samples are grouped | 1.37 bit | 27 (table_05) |
5 | [-2,+2], 3 samples are grouped | 1.56 bit | 125 (table_06) |
6 | [-2,+2], 2 samples are grouped | 1.73 bit | 25 (table_07) |
7 | [-3,+3], 2 samples are grouped | 2.25 bit | 49 (table_08) |
8 | [-4,+4], 2 samples are grouped | 2.72 bit | 81 (table_09) |
9 | [-5,+5], 2 samples are grouped | 3.22 bit | 121 (table_10) |
10 | coded using 0 linear bits and heavy shaped table encoded range [-16,+15] | 3.74 bit | 32 (table_01) |
11 | coded using 0 linear bits and light shaped table encoded range [-16,+15] | 4.26 bit | 32 (table_02) |
12 | coded using 1 linear bits and heavy shaped table encoded range [-32,+31] | 4.74 bit | 32 (table_01) |
13 | coded using 1 linear bits and light shaped table encoded range [-32,+31] | 5.26 bit | 32 (table_02) |
14 | coded using 2 linear bits and heavy shaped table encoded range [-64,+63] | 5.74 bit | 32 (table_01) |
15 | coded using 2 linear bits and light shaped table encoded range [-64,+63] | 6.26 bit | 32 (table_02) |
16 | coded using 3 linear bits and heavy shaped table encoded range [-128,+127] | 6.74 bit | 32 (table_01) |
17 | coded using 3 linear bits and light shaped table encoded range [-128,+127] | 7.26 bit | 32 (table_02) |
18 | coded using 4 linear bits and heavy shaped table encoded range [-256,+255] | 7.74 bit | 32 (table_01) |
19 | coded using 4 linear bits and light shaped table encoded range [-256,+255] | 8.26 bit | 32 (table_02) |
20 | coded using 5 linear bits and heavy shaped table encoded range [-512,+511] | 8.74 bit | 32 (table_01) |
21 | coded using 5 linear bits and light shaped table encoded range [-512,+511] | 9.26 bit | 32 (table_02) |
22 | coded using 6 linear bits and heavy shaped table encoded range [-1024,+1023] | 9.74 bit | 32 (table_01) |
23 | coded using 6 linear bits and light shaped table encoded range [-1024,+1023] | 10.26 bit | 32 (table_02) |
24 | coded using 7 linear bits and heavy shaped table encoded range [-2048,+2047] | 10.74 bit | 32 (table_01) |
25 | coded using 8 linear bits and heavy shaped table encoded range [-4096,+4095] | 11.74 bit | 32 (table_01) |
26 | coded using 9 linear bits and heavy shaped table encoded range [-8192,+8191] | 12.74 bit | 32 (table_01) |
27 | coded using 10 linear bits and heavy shaped table encoded range [-16384,+16383] | 13.74 bit | 32 (table_01) |
28 | coded using 11 linear bits and heavy shaped table encoded range [-32768,+32767] | 14.74 bit | 32 (table_01) |
29 | Reserved | | - |
30 | Reserved | | - |
31 | Use a subframe based allocation theme | | - |
Allocation = 0, 1
All subband samples are 0.
int i;
for ( i = 0; i < 36; i++ ) {
sample [i] = 0;
}
Allocation = 2
Subband samples has the range [-1,+1], 6 samples are grouped.
At most 2 samples per group can be nonzero.
static unsigned char tab [] = { 0x01,0x02,0x03,0x04,0x05,
0x12,0x13,0x14,0x15,
0x23,0x24,0x25,
0x34,0x35,
0x45
};
int code;
int tmp;
int i;
for ( i = 0; i < 36; i += 6 ) {
code = Decode_Huffman_Table (table_03) - 1;
sample [i + 0] = sample [i + 1] = sample [i + 2] =
sample [i + 3] = sample [i + 4] = sample [i + 5] = 0;
if ( code >= 0 )
if ( code < 12 ) {
sample [i + (code >> 1)] = code & 1 ? +1 : -1;
}
else {
tmp = tab [(code - 12) >> 2];
sample [i + (tmp >> 4)] = code & 1 ? +1 : -1;
sample [i + (tmp & 15)] = code & 2 ? +1 : -1;
}
}
Allocation = 3
Subband samples has the range [-1,+1], 4 samples are grouped.
int code;
int i;
for ( i = 0; i < 36; i += 4 ) {
code = Decode_Huffman_Table (table_04);
sample [i + 0] = code % 3 - 1;
sample [i + 1] = code / 3 % 3 - 1;
sample [i + 2] = code / 9 % 3 - 1;
sample [i + 3] = code / 27 - 1;
}
Allocation = 4
Subband samples has the range [-1,+1], 3 samples are grouped.
int code;
int i;
for ( i = 0; i < 36; i += 3 ) {
code = Decode_Huffman_Table (table_05);
sample [i + 0] = code % 3 - 1;
sample [i + 1] = code / 3 % 3 - 1;
sample [i + 2] = code / 9 - 1;
}
Allocation = 5
Subband samples has the range [-2,+2], 3 samples are grouped.
int code;
int i;
for ( i = 0; i < 36; i += 3 ) {
code = Decode_Huffman_Table (table_06);
sample [i + 0] = code % 5 - 2;
sample [i + 1] = code / 5 % 5 - 2;
sample [i + 2] = code / 25 - 2;
}
Allocation = 6
Subband samples has the range [-2,+2], 2 samples are grouped.
int code;
int i;
for ( i = 0; i < 36; i += 2 ) {
code = Decode_Huffman_Table (table_07);
sample [i + 0] = code % 5 - 2;
sample [i + 1] = code / 5 - 2;
}
Allocation = 7
Subband samples has the range [-3,+3], 2 samples are grouped.
int code;
int i;
for ( i = 0; i < 36; i += 2 ) {
code = Decode_Huffman_Table (table_08);
sample [i + 0] = code % 7 - 3;
sample [i + 1] = code / 7 - 3;
}
Allocation = 8
Subband samples has the range [-4,+4], 2 samples are grouped.
int code;
int i;
for ( i = 0; i < 36; i += 2 ) {
code = Decode_Huffman_Table (table_09);
sample [i + 0] = code % 9 - 4;
sample [i + 1] = code / 9 - 4;
}
Allocation = 9
Subband samples has the range [-5,+5], 2 samples are grouped.
int code;
int i;
for ( i = 0; i < 36; i += 2 ) {
code = Decode_Huffman_Table (table_10);
sample [i + 0] = code % 11 - 5;
sample [i + 1] = code / 11 - 5;
}
Allocation = 10, 12, 14, 16, 18, 20, 22, 24 . . . 28
Subband samples are heavily shaped.
Allocation | linear bits |
10 | none |
12 | 1 |
14 | 2 |
16 | 3 |
18 | 4 |
20 | 5 |
22 | 6 |
24 | 7 |
25 | 8 |
26 | 9 |
27 | 10 |
28 | 11 |
int linear = ...;
int code;
int i;
for ( i = 0; i < 36; i++ ) {
code = Decode_Huffman_Table (table_01);
sample [i] = (code << linear) + Read_Bits (linear);
}
Allocation = 11, 13, 15, 17, 19, 21
Subband samples are lightly shaped.
Allocation | linear bits |
11 | none |
13 | 1 |
15 | 2 |
17 | 3 |
19 | 4 |
21 | 5 |
int linear = ...;
int code;
int i;
for ( i = 0; i < 36; i++ ) {
code = Decode_Huffman_Table (table_02);
sample [i] = (code << linear) + Read_Bits (linear);
}
Allocation = -1
All subband samples are generated by a random generator.
int i;
for ( i = 0; i < 36; i++ ) {
sample [i] = gaussian_distribution (0.0, 0.5); // 1st momentum 0, 2nd momentum 0.5
}
Allocation = -17 . . . -10, 0
If this resolution occures, all following subbands are also encoded with this resolution.
For Allocation 0 this means all following bands are zero.
For allocation -17...-10 this means all following subbands are using Intensity stereo with 8...1 vector bits
as long as the corresponding base channel contains signal.