mp3文件解码- 哈夫曼码区1

哈夫曼码区边界

以下是MPEG官方文档Table 3-B.8a的表,哈夫曼编码时,576条频线分布情况
long blocks:

scale factor band(32k采样)width of bandindex of startindex of end
0403
1447
24811
341215
441619
542023
662429
763035
883643
9104453
10125465
11166681
122082101
1324102125
1430126155
1538156193
1646194239
1756240295
1868296363
1984364447
20102448549
scale factor band(44.1k采样)width of bandindex of startindex of end
0403
1447
24811
341215
441619
542023
662429
763035
883643
984451
10105261
11126273
12167489
132090109
1424110133
1528134161
1634162195
1742196237
1850238287
1954288341
2076342417
scale factor band(48k采样)width of bandindex of startindex of end
0403
1447
24811
341215
441619
542023
662429
763035
863641
984249
10105059
11126071
12167287
131888105
1422106127
1528128155
1634156189
1740190229
1846230275
1954276329
2054330383

short blocks:

scale factor band(32k采样)width of bandindex of startindex of end
0403
1447
24811
341215
461621
582229
6123041
7164257
8205877
92678103
1034104137
1142138179
scale factor band(44.1k采样)width of bandindex of startindex of end
0403
1447
24811
341215
461621
582229
6103039
7124051
8145265
9186683
102284105
1130106135
scale factor band(48k采样)width of bandindex of startindex of end
0403
1447
24811
341215
461621
562227
6102837
7123849
8145063
9166479
10208099
1126100125
struct {
	int l[23];
	int s[14];
} sfBandIndex[3]= {
	{{0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576},
		{0,4,8,12,16,22,30,40,52,66,84,106,136,192}},
	{{0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576},
		{0,4,8,12,16,22,28,38,50,64,80,100,126,192}},
	{{0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576},
		{0,4,8,12,16,22,30,42,58,78,104,138,180,192}}
};
   /* Find region boundary for short block case. */

   if ( ((*si).ch[ch].gr[gr].window_switching_flag) &&
        ((*si).ch[ch].gr[gr].block_type == 2) ) {

      /* Region2. */

      region1Start = 36;  /* sfb[9/3]*3=36 */
      region2Start = 576; /* No Region2 for short block case. */
   }


   else {          /* Find region boundary for long block case. */

      region1Start = sfBandIndex[fr_ps->header->sampling_frequency]
                           .l[(*si).ch[ch].gr[gr].region0_count + 1]; /* MI */
      region2Start = sfBandIndex[fr_ps->header->sampling_frequency]
                              .l[(*si).ch[ch].gr[gr].region0_count +
                              (*si).ch[ch].gr[gr].region1_count + 2]; /* MI */
      }

这不确定是不是官方的,没有标记版权,ycb1698大佬的版本则包含了MPEG2 ,MPEG2.5的,在确定sync_word是11位还是12位的时候,找过不少资料,其中官方的文档主要是ISO_11172和ISO.IEC-13818-1,前一个文档的同步字是12bits,后一个文档并未提及2.5版本,后来有资料说这是个民间版本,卒。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值