对技术执着
分类:
2015-03-14 17:09:24
:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://kware.blogbus.com/logs/30705123.html
1. 比特率 14 种,采样率 6-9 种
Mpeg Layer 1 2 3 4 5 6 7 8 9 10 11 12 13 14
------- --- -- -- -- --- --- --- --- --- --- --- --- --- --- ---
mpeg1.0 3 32 40 48 56 64 80 96 112 128 160 192 224 256 320
采样率表 sampling_freq, sfreq ?
sfreq 0 1 2 3 4 5 6 7 8
Mpeg 0 1 2 Mpeg 0 1 2 Mpeg 0 1 2
------- ----- ----- ----- ------- ----- ----- ----- ------- ----- ----- -----
mpeg2.0 22050 24000 16000 mpeg1.0 44100 48000 32000 mpeg2.5 11025 12000 8000
2. block_type 表
问题:
块是否就是窗?是同一状态的窗的集合吗?是否就是短窗、长窗、窗跳转状态?
窗切换标记 window_switching_flag 意味着什么?
混合块标记 mixed_block_flag 又意味着什么?
块类型 block_type:
2 短块,
0,1,3 长块
3. LUT 表
LUT 表就是重新排序表 reorder_table? 其尺寸为 9 x 576 每种采样率一张 576 长的子表。
reorder_table = new int[9][]; // 尺寸:9 x 576
for (int i=0; i<9; i++) reorder_table[i] = reorder(sfBandIndex[i].s);
sfBandIndex[0] = {
int[] l0 = {0, 6, 12, 18, 24, 30, 36, 44, // 子带系数 l0:长度为 cb=23 ?
54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576 };
int[] s0 = {0, 4, 8, 12, 18, 24, 32, 42, // 子带系数 s0:长度为 14
56, 74, 100, 132, 174, 192 };
}
static int[] reorder(int scalefac_band[]) { // 从 LAME 版本转化而来
int j = 0;
int ix[] = new int[576];
for (int sfb=0; sfb<13; sfb++) {
int start = scalefac_band[sfb], end = scalefac_band[sfb + 1];
for (int window=0; window<3; window++) for (int i=start; i
}
return ix;
}
4. sfreq 和 region_count、cb_width 的关系
sfreq 采样频率编号,0~8
region_count 区计数 ?
cb_width 关键子带带宽 ?
buf = si.ch[ch].gr[gr].region0_count + 1;
buf1 = buf + si.ch[ch].gr[gr].region1_count + 1;
region1Start = sfBandIndex[sfreq].l[buf]; // SBI.l(si.ch.gr.region0_count)
region2Start = sfBandIndex[sfreq].l[buf1]; // MI
cb_width = sfBandIndex[sfreq].s[1];
next_cb_boundary = sfBandIndex[sfreq].l[1]; // 长块: 0,1,3
next_cb_boundary = sfBandIndex[sfreq].s[4];
cb_begin = sfBandIndex[sfreq].s[3];
sfb_start = sfBandIndex[sfreq].s[sfb],
sfb_lines=sfBandIndex[sfreq].s[4] - sfb_start;
sfb = sfBandIndex[sfreq].s[10];
sb = sfBandIndex[sfreq].s[11] - sfb;
int[] l0 = {0, 6, 12, 18, 24, 30, 36, 44, // 子带系数 l0:长度为 cb=23 ?
54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576 };
int[] s0 = {0, 4, 8, 12, 18, 24, 32, 42, // 子带系数 s0:长度为 14
56, 74, 100, 132, 174, 192 };
5. 常数表及其意义分析
- private static final int slen[2][16]
= {{0, ..., 3, 4, 4}, {0, 1, 2, 3, 0, ...3}};
- private final int[] new_slen // 变量 new_slen 使用前已完全初始化,
= new int[4]; // 没必要重新分配数组
- public static final int pretab[22] // 用于解量化
= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, ...};
if (gr_info.preflag != 0) idx += pretab[cb];
- private SBI[9] sfBandIndex // 在解码器构造时,进行初始化
= {SBI(l0={0,6,12,18,24,30,36,44, // 子带系数 l0:长度为 cb=23 ?
54,66,80,96,116,140,168,200, 238,284,336,396,464,522,576},
s0={0,4,8,12,18,24,32,42, // 子带系数 s0:长度为 14
56,74,100,132,174,192}
),...}
- public static final float two_to_negative_half_pow[64] // 用于解量化
= {1.0000000000E+00f, ...};
xr_1d[quotien][reste] *= two_to_negative_half_pow[idx]; // 放缩操作
- public static final float t_43[8192] // 用于解量化
= create() { t_43[i] = (float)Math.pow(i, 4/3.0);};
xr_1d[quotien][reste] = g_gain * t_43[abv]; // dequantize_sample(xr, ch, gr)
- public static final float io[2][32] // 用于立体声处理
= {{1.0000000000E+00f, ...}, {..., 2.1579186439E-05f}};
k[0][i] = io[io_type][(is_pos + 1) >>> 1]; // i_stereo_k_values(is_pos, io_type, i)
- int[] is_pos = new int[576]; // 用于立体声处理
float[] is_ratio = new float[576];
- public static final float TAN12[16] // 用于立体声处理
= {0.0f, 0.26794919f, ..., 0.57735027f, 1.0f};
is_pos[i] = scalefac[1].s[j][sfb];
if (lsf) i_stereo_k_values(is_pos[i], io_type, i); // if (is_pos[i] != 7)
else is_ratio[i] = TAN12[is_pos[i]];
- private static final float cs[8] // 8 个蝶形操作用的 sin/cos ?
= {0.857492925712f, ..., 0.999993155067f};
private static final float ca[8]
= {-0.5144957554270f, ..., -0.00369997467375f};
out_1d[src_idx1] = (bu * cs[ss]) - (bd * ca[ss]); // antialias(ch, gr) 中用到
out_1d[src_idx2] = (bd * cs[ss]) + (bu * ca[ss]);
- public static final float win[4][36] // 四种 Block,36 个 ?
= {{-1.6141214951E-02f,...},...,{...,-1.4790705759E-02f}};
win_bt = win[block_type]; // 用在 IMDCT 里
- public static final int nr_of_sfb_block[6][3][4] // 仅用于 get_LSF_scale_data()
= {{{6, 5, 5, 5}...},...{...{6,18, 9, 0}}};
- public Sftable sftable[5,3] // LayerIIIDecoder 类里没用到
= Sftable(ll0 = {0, 6, 11, 16, 21}, ss0 = {0, 6, 12});
- private static int reorder_table[9][576]; // 将根据要求生成