Quantized Subband Samples (Transient Encoding)

This contains exactly 12 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
-16 Reserved -
-15 Reserved -
-14 Intensity stereo using 6 vector bit, all further bands also uses this encoding 0.00 bit -
-13 Intensity stereo using 5 vector bit, all further bands also uses this encoding 0.00 bit -
-12 Intensity stereo using 4 vector bit, all further bands also uses this encoding 0.00 bit -
-11 Intensity stereo using 3 vector bit, all further bands also uses this encoding 0.00 bit -
-10 Intensity stereo using 2 vector bit, all further bands also uses this encoding 0.00 bit -
-9 Intensity stereo using 1 vector bit, all further bands also uses this encoding 0.00 bit -
-8 Intensity stereo using 6 vector bit 0.00 bit -
-7 Intensity stereo using 5 vector bit 0.00 bit -
-6 Intensity stereo using 4 vector bit 0.00 bit -
-5 Intensity stereo using 3 vector bit 0.00 bit -
-4 Intensity stereo using 2 vector bit 0.00 bit -
-3 Intensity stereo using 1 vector bit 0.00 bit -
-2 -0.5 or +0.5 generated by a random number generator 0.00 bit -
-1 0. All following subbands also have alloc = -1,
i.e. subband samples are 0.
0.00 bit -
0 0. 0.00 bit -
1 [-1,+1], 6 samples are grouped
At most 2 samples per group can be nonzero.
0.58 bit 73 (table_03)
2 [-1,+1], 4 samples are grouped 1.11 bit 81 (table_04)
3 [-2,+2], 3 samples are grouped 1.56 bit 125 (table_06)
4 [-3,+3], 2 samples are grouped 2.25 bit 49 (table_08)
5 [-4,+4], 2 samples are grouped 2.72 bit 81 (table_09)
6 [-5,+5], 2 samples are grouped 3.22 bit 121 (table_10)
7 coded using 0 linear bits and heavy shaped table
encoded range [-16,+15]
3.74 bit 32 (table_01)
8 coded using 1 linear bits and heavy shaped table
encoded range [-32,+31]
4.74 bit 32 (table_01)
9 coded using 2 linear bits and heavy shaped table
encoded range [-64,+63]
5.74 bit 32 (table_01)
10 coded using 3 linear bits and heavy shaped table
encoded range [-128,+127]
6.74 bit 32 (table_01)
11 coded using 4 linear bits and heavy shaped table
encoded range [-256,+255]
7.74 bit 32 (table_01)
12 coded using 5 linear bits and heavy shaped table
encoded range [-512,+511]
8.74 bit 32 (table_01)
13 coded using 6 linear bits and heavy shaped table
encoded range [-1024,+1023]
9.74 bit 32 (table_01)
14 coded using 8 linear bits and heavy shaped table
encoded range [-4096,+4095]
11.74 bit 32 (table_01)
15 coded using 11 linear bits and heavy shaped table
encoded range [-32768,+32767]
14.74 bit 32 (table_01)


Allocation = -1, 0

All subband samples are 0.

    int  i;

    for ( i = 0; i < 36; i++ ) {
        sample [i] = 0;
    }

Allocation = 1

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 = 2

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 = 3

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 = 4

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 = 5

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 = 6

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 = 7, . . ., 15

Subband samples are heavily shaped.

Allocation linear bits
7 none
8 1
9 2
10 3
11 4
12 5
13 6
14 8
15 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 = -2

All subband samples are generated by a random generator.

    int  i;

    for ( i = 0; i < 36; i++ ) {
        sample [i] = rand () & 0x4000 ? +0.5 : -0.5;
    }

[eMail]      [Addr]