## Topic: Size of subblock gain mp3 (Read 3277 times)previous topic - next topic

0 Members and 1 Guest are viewing this topic.
• Mussé
Size of subblock gain mp3
##### 29 June, 2013, 04:37:27 PM
What I got so far: subblock_gain is only used when window_switching_flag = 1 and block_type = 2 --- the latter meaning that 3 short windows are used per subblock.
The confusing part is that Rassol's paper (The Theory Behind Mp3,2002) states that the subblock_gain flag is 9 bits (mono) or 18 bits (dual).
Meanwhile, Sripada's thesis (MP3 DECODER in Theory and Practice) states that the subblock_gain flag is 10 bits (mono) or 18 (dual).

I'm conserned with the mono part. 10 bits works out --- then the size of the sideinfo is 17 bytes as the standard specifies it to be --- , but is 9 bits, as Rassol claimes, simply incorrect or is there something I'm missing here?

• Garf
• Developer (Donating)
Size of subblock gain mp3
##### Reply #1 – 30 June, 2013, 05:38:03 AM
It's always a multiple of 3 bits (e.g. 3*3bits = 9 bits). Seriously just get the ISO standard.

• Mussé
Size of subblock gain mp3
##### Reply #2 – 30 June, 2013, 06:59:05 AM
It's always a multiple of 3 bits (e.g. 3*3bits = 9 bits). Seriously just get the ISO standard.

That sounds plausible. Namely, there are 3 windows to specify the subgain -- i.e. offset from global gain --- for and each offset is specified with 3 bits. Hence 3 * 3 = 9 bits.
There was a miscalculation in Sripada's thesis(MP3 DECODER in Theory and Practice, p.26). He states that the subbgain is specified (for the case block_type = 2 and mono mode) by 5 + 5 = 10 bits.
But, for the dual case (with block_type = 2 --- i. e. 3 short windows are used) he states the correct amount 2*3*3 = 18 bits.
Moreover, it is stated that, when block_type = 2, the region0_count- and region1_count fields aren't used (that's what I needed to know), which helps account for the right size of the overall sideinfo --- 17 (mono) or 32 bytes(dual).

Conclusion, a miscalculation in Sripada's thesis confused me for a moment, but now it's resolved.
However, my new question is: why aren't the region0_count- and region1_count fields used  when block_type = 2?

Hereby a corrected calculation which shows that 3*3 = 9 bits is indeed consistent, for the case of mono mode with window_select_flag = 1 and block_type = 2:
General (shared between granules) fields:
• main_data_begin (9bits)
• private_bits (5bits)
• scalefactor_selection_information (4bits)
• total = 18 bits

Granule fields:
• part2_3_length (12bits)
• big_values (9bits)
• global_gain (8bits)
• scalefac_compress (4bits)
• window_switchingflag (1bit)
• table_select(2*5 = 10 bits)
• block_type (2bits)
• mixed_block_flag (1bit)
• subblock_gain (3*3 = 9 bits)
• preflag (1bit)
• scalefac_scale (1bit)
• count1table_select (1bit)
• total = 59 bits

Since there are 2 granules per frame we have for the total size of sideinfo 18 + 2 * 59 = 136 bits = 17 bytes.

Finally, where can I find a full copy of the ISO standard of mp3? I've tried searching for it but only could find small snippets of it. However I'm aware that one can buy it for like \$250 or so from some sites.