X-Git-Url: http://plrg.eecs.uci.edu/git/?p=IRC.git;a=blobdiff_plain;f=Robust%2Fsrc%2FTests%2FssJava%2Fmp3decoder%2FLayerIIIDecoder.java;h=055484bbb5577a2fffcfe1292399633b8172191d;hp=ff6d4a165f9e63e67bda5e8880ab8b474f029513;hb=88cc6f37e1158f55870e1b55100e91a09b8d1556;hpb=a807864e4251c1b35cf6b27f739f45b1c6696d74
diff --git a/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java b/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java
index ff6d4a16..055484bb 100644
--- a/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java
+++ b/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java
@@ -4,7 +4,7 @@
* 18/06/01 Michael Scheerer, Fixed bugs which causes
* negative indexes in method huffmann_decode and in method
* dequanisize_sample.
- *
+ *
* 16/07/01 Michael Scheerer, Catched a bug in method
* huffmann_decode, which causes an outOfIndexException.
* Cause : Indexnumber of 24 at SfBandIndex,
@@ -32,66 +32,89 @@
*----------------------------------------------------------------------
*/
-
/**
* Class Implementing Layer 3 Decoder.
*
* @since 0.0
*/
-@LATTICE("FS
>> 3;
-
- if ((flush_main = (br.hsstell() & 7)) != 0) { // flush_main < br
- br.hgetbits(8 - flush_main); // br < flush_main
- main_data_end++; // main_data_end*
- }
- // bytes_to_discard < GLB(frame_start,main_data_end,si)
- // TODO does bytes_to_discard need to go back to si???
- bytes_to_discard = frame_start - main_data_end - si.main_data_begin;
+ @LOC("THIS,LayerIIIDecoder.HD1") int nSlots = header.slots();
- // frame_start should be *
- frame_start += nSlots;
+ @LOC("THIS,LayerIIIDecoder.CH0") int gr;
+ @LOC("THIS,LayerIIIDecoder.CH0") int ch;
- if (bytes_to_discard < 0)
- return;
+ @LOC("THIS,LayerIIIDecoder.CH0") int ss;
+ @LOC("THIS,LayerIIIDecoder.CH0") int sb;
+ @LOC("THIS,LayerIIIDecoder.CH0") int sb18;
- if (main_data_end > 4096) { // main_data_end should be > than 'frame_start' and 'br'
- frame_start -= 4096;
- br.rewindNbytes(4096);
- }
+ @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int main_data_end;
+ @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int flush_main;
+
+ @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int bytes_to_discard;
+ @LOC("C") int i;
+
+ // modifications for linear type
+ get_side_info(header.getSideInfoBuffer());
+ br = header.getBitReserve();
- for (; bytes_to_discard > 0; bytes_to_discard--) // bytes_to_discard > br
- br.hgetbits(8);
-
- // doing something from here
-
// here 'gr' and 'max_gr' should be higher than 'ch','channels', and more
- for (gr = 0; gr < max_gr; gr++) { // two granules per channel
- // in the loop body, access set={part2_start}
-
+ for (gr = 0; gr < max_gr; gr++) { // two granules per channel
+ // in the loop body, access set={part2_start}
+
// 'ch', 'channels' should be higher than all locs in the below body
- for (ch = 0; ch < channels; ch++) {
- part2_start = br.hsstell(); // part2_start < br
+ for (ch = 0; ch < channels; ch++) {
+ @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_start = br.hsstell(); // part2_start
+ // <
+ // br
- // grab scale factors from the main data.
+ // grab scale factors from the main data.
// following the scale factors is the actual compressed data
if (header.version() == Header.MPEG1)
get_scale_factors(ch, gr); // no need to care from this side
- // here move scale factor data from 'br' buffer to 'scalefac' field
+ // here move scale factor data from 'br' buffer to 'scalefac' field
else
// MPEG-2 LSF, SZD: MPEG-2.5 LSF
get_LSF_scale_factors(ch, gr); // no need to care from this side
- // here, decoding the compressed audio data
- huffman_decode(ch, gr); // no need to care from this side
+ // here, decoding the compressed audio data
+ huffman_decode(part2_start, ch, gr); // no need to care from this side
// System.out.println("CheckSum HuffMan = " + CheckSumHuff);
- dequantize_sample(ro[ch], ch, gr); // no need to care from this side
+ dequantize_sample(/* ro[ch], */ch, gr); // no need to care from this
+ // side
}
stereo(gr); // no need to care from this side
- if ((which_channels == OutputChannels.DOWNMIX_CHANNELS) && (channels > 1))
+ if ((which_channels == OutputChannels.DOWNMIX_CHANNELS) && (channels > 1)) {
do_downmix();
+ }
- for (ch = first_channel; ch <= last_channel; ch++) { // 'ch' and 'first_channel' > the body
+ for (ch = first_channel; ch <= last_channel; ch++) { // 'ch' and
+ // 'first_channel' >
+ // the body
// in the body
// read set= lr,ch,gr,out_1d, sb18, ss, SSLIMIT, out_1d
// write set= out_1d
-
- reorder(lr[ch], ch, gr);
+
+ reorder(/* lr[ch], */ch, gr);
antialias(ch, gr);
// for (int hb = 0;hb<576;hb++) CheckSumOut1d = CheckSumOut1d +
// out_1d[hb];
@@ -357,14 +361,18 @@ final class LayerIIIDecoder implements FrameDecoder {
// out_1d[hb];
// System.out.println("CheckSumOut1d = "+CheckSumOut1d);
- for (sb18 = 18; sb18 < 576; sb18 += 36) // sb18 > ss, SSLIMIT, out1d
+ for (sb18 = 18; sb18 < 576; sb18 += 36) {
+ // sb18 > ss, SSLIMIT, out1d
// Frequency inversion
- for (ss = 1; ss < SSLIMIT; ss += 2) // 'ss','SSLIMIT' > out_1d
+ for (ss = 1; ss < SSLIMIT; ss += 2) {
+ // 'ss','SSLIMIT' > out_1d
out_1d[sb18 + ss] = -out_1d[sb18 + ss]; // out1d*
+ }
+ }
// 'ch', 'which_channels' should be higher than if/else body!
- // location set written by if/else body
- // = {samples1, samples2, filter1, filter2}
+ // location set written by if/else body
+ // = {samples1, samples2, filter1, filter2}
if ((ch == 0) || (which_channels == OutputChannels.RIGHT_CHANNEL)) {
for (ss = 0; ss < SSLIMIT; ss++) { // Polyphase synthesis
sb = 0;
@@ -413,44 +421,48 @@ final class LayerIIIDecoder implements FrameDecoder {
* Reads the side info from the stream, assuming the entire. frame has been
* read already. Mono : 136 bits (= 17 bytes) Stereo : 256 bits (= 32 bytes)
*/
- @RETURNLOC("OUT")
- private boolean get_side_info() {
- @LOC("IN") int ch;
- @LOC("IN") int gr;
+ private boolean get_side_info(SideInfoBuffer sib) {
+ int ch, gr;
+ // System.out.println("#get_side_info");
if (header.version() == Header.MPEG1) {
- si.main_data_begin = stream.get_bits(9);
+ si.main_data_begin = sib.get_bits(9);
if (channels == 1)
- si.private_bits = stream.get_bits(5);
+ si.private_bits = sib.get_bits(5);
else
- si.private_bits = stream.get_bits(3);
+ si.private_bits = sib.get_bits(3);
for (ch = 0; ch < channels; ch++) {
- si.ch[ch].scfsi[0] = stream.get_bits(1);
- si.ch[ch].scfsi[1] = stream.get_bits(1);
- si.ch[ch].scfsi[2] = stream.get_bits(1);
- si.ch[ch].scfsi[3] = stream.get_bits(1);
+ si.ch[ch].scfsi[0] = sib.get_bits(1);
+ si.ch[ch].scfsi[1] = sib.get_bits(1);
+ si.ch[ch].scfsi[2] = sib.get_bits(1);
+ si.ch[ch].scfsi[3] = sib.get_bits(1);
}
+ // System.out.println("BEFORE GR,CH");
+
for (gr = 0; gr < 2; gr++) {
+ // System.out.println("GR=" + gr);
for (ch = 0; ch < channels; ch++) {
- si.ch[ch].gr[gr].part2_3_length = stream.get_bits(12);
- si.ch[ch].gr[gr].big_values = stream.get_bits(9);
- si.ch[ch].gr[gr].global_gain = stream.get_bits(8);
- si.ch[ch].gr[gr].scalefac_compress = stream.get_bits(4);
- si.ch[ch].gr[gr].window_switching_flag = stream.get_bits(1);
+ // System.out.println("CH");
+ si.ch[ch].gr[gr].part2_3_length = sib.get_bits(12);
+ si.ch[ch].gr[gr].big_values = sib.get_bits(9);
+ si.ch[ch].gr[gr].global_gain = sib.get_bits(8);
+ si.ch[ch].gr[gr].scalefac_compress = sib.get_bits(4);
+ si.ch[ch].gr[gr].window_switching_flag = sib.get_bits(1);
if ((si.ch[ch].gr[gr].window_switching_flag) != 0) {
- si.ch[ch].gr[gr].block_type = stream.get_bits(2);
- si.ch[ch].gr[gr].mixed_block_flag = stream.get_bits(1);
+ si.ch[ch].gr[gr].block_type = sib.get_bits(2);
+ si.ch[ch].gr[gr].mixed_block_flag = sib.get_bits(1);
- si.ch[ch].gr[gr].table_select[0] = stream.get_bits(5);
- si.ch[ch].gr[gr].table_select[1] = stream.get_bits(5);
+ si.ch[ch].gr[gr].table_select[0] = sib.get_bits(5);
+ si.ch[ch].gr[gr].table_select[1] = sib.get_bits(5);
- si.ch[ch].gr[gr].subblock_gain[0] = stream.get_bits(3);
- si.ch[ch].gr[gr].subblock_gain[1] = stream.get_bits(3);
- si.ch[ch].gr[gr].subblock_gain[2] = stream.get_bits(3);
+ si.ch[ch].gr[gr].subblock_gain[0] = sib.get_bits(3);
+ si.ch[ch].gr[gr].subblock_gain[1] = sib.get_bits(3);
+ si.ch[ch].gr[gr].subblock_gain[2] = sib.get_bits(3);
- // Set region_count parameters since they are implicit in this case.
+ // Set region_count parameters since they are implicit
+ // in this case.
if (si.ch[ch].gr[gr].block_type == 0) {
// Side info bad: block_type == 0 in split block
@@ -462,47 +474,48 @@ final class LayerIIIDecoder implements FrameDecoder {
}
si.ch[ch].gr[gr].region1_count = 20 - si.ch[ch].gr[gr].region0_count;
} else {
- si.ch[ch].gr[gr].table_select[0] = stream.get_bits(5);
- si.ch[ch].gr[gr].table_select[1] = stream.get_bits(5);
- si.ch[ch].gr[gr].table_select[2] = stream.get_bits(5);
- si.ch[ch].gr[gr].region0_count = stream.get_bits(4);
- si.ch[ch].gr[gr].region1_count = stream.get_bits(3);
+ si.ch[ch].gr[gr].table_select[0] = sib.get_bits(5);
+ si.ch[ch].gr[gr].table_select[1] = sib.get_bits(5);
+ si.ch[ch].gr[gr].table_select[2] = sib.get_bits(5);
+ si.ch[ch].gr[gr].region0_count = sib.get_bits(4);
+ si.ch[ch].gr[gr].region1_count = sib.get_bits(3);
si.ch[ch].gr[gr].block_type = 0;
}
- si.ch[ch].gr[gr].preflag = stream.get_bits(1);
- si.ch[ch].gr[gr].scalefac_scale = stream.get_bits(1);
- si.ch[ch].gr[gr].count1table_select = stream.get_bits(1);
+ si.ch[ch].gr[gr].preflag = sib.get_bits(1);
+ si.ch[ch].gr[gr].scalefac_scale = sib.get_bits(1);
+ si.ch[ch].gr[gr].count1table_select = sib.get_bits(1);
}
}
} else { // MPEG-2 LSF, SZD: MPEG-2.5 LSF
- si.main_data_begin = stream.get_bits(8);
+ si.main_data_begin = sib.get_bits(8);
if (channels == 1)
- si.private_bits = stream.get_bits(1);
+ si.private_bits = sib.get_bits(1);
else
- si.private_bits = stream.get_bits(2);
+ si.private_bits = sib.get_bits(2);
for (ch = 0; ch < channels; ch++) {
- si.ch[ch].gr[0].part2_3_length = stream.get_bits(12);
- si.ch[ch].gr[0].big_values = stream.get_bits(9);
- si.ch[ch].gr[0].global_gain = stream.get_bits(8);
- si.ch[ch].gr[0].scalefac_compress = stream.get_bits(9);
- si.ch[ch].gr[0].window_switching_flag = stream.get_bits(1);
+ si.ch[ch].gr[0].part2_3_length = sib.get_bits(12);
+ si.ch[ch].gr[0].big_values = sib.get_bits(9);
+ si.ch[ch].gr[0].global_gain = sib.get_bits(8);
+ si.ch[ch].gr[0].scalefac_compress = sib.get_bits(9);
+ si.ch[ch].gr[0].window_switching_flag = sib.get_bits(1);
if ((si.ch[ch].gr[0].window_switching_flag) != 0) {
- si.ch[ch].gr[0].block_type = stream.get_bits(2);
- si.ch[ch].gr[0].mixed_block_flag = stream.get_bits(1);
- si.ch[ch].gr[0].table_select[0] = stream.get_bits(5);
- si.ch[ch].gr[0].table_select[1] = stream.get_bits(5);
+ si.ch[ch].gr[0].block_type = sib.get_bits(2);
+ si.ch[ch].gr[0].mixed_block_flag = sib.get_bits(1);
+ si.ch[ch].gr[0].table_select[0] = sib.get_bits(5);
+ si.ch[ch].gr[0].table_select[1] = sib.get_bits(5);
- si.ch[ch].gr[0].subblock_gain[0] = stream.get_bits(3);
- si.ch[ch].gr[0].subblock_gain[1] = stream.get_bits(3);
- si.ch[ch].gr[0].subblock_gain[2] = stream.get_bits(3);
+ si.ch[ch].gr[0].subblock_gain[0] = sib.get_bits(3);
+ si.ch[ch].gr[0].subblock_gain[1] = sib.get_bits(3);
+ si.ch[ch].gr[0].subblock_gain[2] = sib.get_bits(3);
- // Set region_count parameters since they are implicit in this case.
+ // Set region_count parameters since they are implicit in
+ // this case.
if (si.ch[ch].gr[0].block_type == 0) {
// Side info bad: block_type == 0 in split block
@@ -515,16 +528,16 @@ final class LayerIIIDecoder implements FrameDecoder {
}
} else {
- si.ch[ch].gr[0].table_select[0] = stream.get_bits(5);
- si.ch[ch].gr[0].table_select[1] = stream.get_bits(5);
- si.ch[ch].gr[0].table_select[2] = stream.get_bits(5);
- si.ch[ch].gr[0].region0_count = stream.get_bits(4);
- si.ch[ch].gr[0].region1_count = stream.get_bits(3);
+ si.ch[ch].gr[0].table_select[0] = sib.get_bits(5);
+ si.ch[ch].gr[0].table_select[1] = sib.get_bits(5);
+ si.ch[ch].gr[0].table_select[2] = sib.get_bits(5);
+ si.ch[ch].gr[0].region0_count = sib.get_bits(4);
+ si.ch[ch].gr[0].region1_count = sib.get_bits(3);
si.ch[ch].gr[0].block_type = 0;
}
- si.ch[ch].gr[0].scalefac_scale = stream.get_bits(1);
- si.ch[ch].gr[0].count1table_select = stream.get_bits(1);
+ si.ch[ch].gr[0].scalefac_scale = sib.get_bits(1);
+ si.ch[ch].gr[0].count1table_select = sib.get_bits(1);
} // for(ch=0; ch sfBandIndex[sfreq].l.length - 1)
+ if (buf1 > sfBandIndex[sfreq].l.length - 1) {
buf1 = sfBandIndex[sfreq].l.length - 1;
+ }
region1Start = sfBandIndex[sfreq].l[buf];
region2Start = sfBandIndex[sfreq].l[buf1]; /* MI */
}
index = 0;
+ @LOC("THIS,LayerIIIDecoder.SI1") int h;
// Read bigvalues area
- for (@LOC("I") int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i += 2) {
- if (i < region1Start)
- h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[0]];
- else if (i < region2Start)
- h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[1]];
- else
- h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[2]];
+ for (@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i +=
+ 2) {
+ if (i < region1Start) {
+ // huffcodetab.huffman_decoder(h, x, y, v, w, br);
+ h = si.ch[ch].gr[gr].table_select[0];
+ } else if (i < region2Start) {
+ h = si.ch[ch].gr[gr].table_select[1];
+ // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[1]];
+ } else {
+ h = si.ch[ch].gr[gr].table_select[2];
+ // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[2]];
+ }
+
+ // @LOC("THIS,LayerIIIDecoder.SI2") HuffData huffData =
+ // huffcodetab.huffman_decoder(h, new HuffData(x, y, v, w, br));
+ // x = huffData.x;
+ // y = huffData.y;
+ // v = huffData.v;
+ // w = huffData.w;
+ // br = huffData.br;
+ huffcodetab_huffman_decoder(h);
- huffcodetab.huffman_decoder(h, x, y, v, w, br);
// if (index >= is_1d.length)
// System.out.println("i0="+i+"/"+(si.ch[ch].gr[gr].big_values<<1)+" Index="+index+" is_1d="+is_1d.length);
- is_1d[index++] = x[0];
- is_1d[index++] = y[0];
+ is_1d[index++] = x;
+ is_1d[index++] = y;
- CheckSumHuff = CheckSumHuff + x[0] + y[0];
+ CheckSumHuff = CheckSumHuff + x + y;
// System.out.println("x = "+x[0]+" y = "+y[0]);
}
// Read count1 area
- h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32];
+ // h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32];
num_bits = br.hsstell();
while ((num_bits < part2_3_end) && (index < 576)) {
- huffcodetab.huffman_decoder(h, x, y, v, w, br);
-
- is_1d[index++] = v[0];
- is_1d[index++] = w[0];
- is_1d[index++] = x[0];
- is_1d[index++] = y[0];
- CheckSumHuff = CheckSumHuff + v[0] + w[0] + x[0] + y[0];
+ // huffcodetab.huffman_decoder(h, x, y, v, w, br);
+ // @LOC("I") HuffData huffData2 =
+ // huffcodetab.huffman_decoder(si.ch[ch].gr[gr].count1table_select + 32,
+ // new HuffData(x, y,
+ // v, w, br));
+ // x = huffData2.x;
+ // y = huffData2.y;
+ // v = huffData2.v;
+ // w = huffData2.w;
+ // br = huffData2.br;
+ huffcodetab_huffman_decoder(h);
+
+ is_1d[index++] = v;
+ is_1d[index++] = w;
+ is_1d[index++] = x;
+ is_1d[index++] = y;
+ CheckSumHuff = CheckSumHuff + v + w + x + y;
// System.out.println("v = "+v[0]+" w = "+w[0]);
// System.out.println("x = "+x[0]+" y = "+y[0]);
num_bits = br.hsstell();
@@ -902,10 +971,17 @@ final class LayerIIIDecoder implements FrameDecoder {
is_1d[index] = 0;
}
+ @LATTICE("THIS,IN,THISLOC=THIS,RETURNLOC=THIS")
+ private int huffcodetab_huffman_decoder(@LOC("IN") int h) {
+ // TODO need to move huffmancodetab implementation here
+ return 0;
+ }
+
/**
*
*/
- private void i_stereo_k_values(@LOC("IN") int is_pos, @LOC("IN") int io_type, @LOC("IN") int i) {
+ private void i_stereo_k_values(@LOC("THIS,LayerIIIDecoder.LR") int is_pos,
+ @LOC("THIS,LayerIIIDecoder.LR") int io_type, @LOC("THIS,LayerIIIDecoder.LR") int i) {
if (is_pos == 0) {
k[0][i] = 1.0f;
k[1][i] = 1.0f;
@@ -921,23 +997,32 @@ final class LayerIIIDecoder implements FrameDecoder {
/**
*
*/
- @LATTICE("OUT 0)
- xr[quotien][reste] = g_gain * t_43[abv];
+ ro[ch][quotien][reste] = g_gain * t_43[abv];
else {
if (-abv < t_43.length)
- xr[quotien][reste] = -g_gain * t_43[-abv];
+ ro[ch][quotien][reste] = -g_gain * t_43[-abv];
else
- xr[quotien][reste] = -g_gain * (float) Math.pow(-abv, d43);
+ ro[ch][quotien][reste] = -g_gain * (float) Math.pow(-abv, d43);
}
} else {
if (is_1d[j] > 0)
- xr[quotien][reste] = g_gain * (float) Math.pow(abv, d43);
+ ro[ch][quotien][reste] = g_gain * (float) Math.pow(abv, d43);
else
- xr[quotien][reste] = -g_gain * (float) Math.pow(-abv, d43);
+ ro[ch][quotien][reste] = -g_gain * (float) Math.pow(-abv, d43);
}
}
}
@@ -982,12 +1067,12 @@ final class LayerIIIDecoder implements FrameDecoder {
// apply formula per block type
for (j = 0; j < nonzero[ch]; j++) {
// Modif E.B 02/22/99
- @LOC("REST") int reste = j % SSLIMIT;
- @LOC("QUO") int quotien = (int) ((j - reste) / SSLIMIT);
+ @LOC("THIS,LayerIIIDecoder.NZ") int reste = j % SSLIMIT;
+ @LOC("THIS,LayerIIIDecoder.NZ") int quotien = (int) ((j - reste) / SSLIMIT);
if (index == next_cb_boundary) { /* Adjust critical band boundary */
- if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)) {
- if (gr_info.mixed_block_flag != 0) {
+ if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) {
+ if (si.ch[ch].gr[gr].mixed_block_flag != 0) {
if (index == sfBandIndex[sfreq].l[8]) {
next_cb_boundary = sfBandIndex[sfreq].s[4];
@@ -1031,45 +1116,46 @@ final class LayerIIIDecoder implements FrameDecoder {
// Do long/short dependent scaling operations
- if ((gr_info.window_switching_flag != 0)
- && (((gr_info.block_type == 2) && (gr_info.mixed_block_flag == 0)) || ((gr_info.block_type == 2)
- && (gr_info.mixed_block_flag != 0) && (j >= 36)))) {
+ if ((si.ch[ch].gr[gr].window_switching_flag != 0)
+ && (((si.ch[ch].gr[gr].block_type == 2) && (si.ch[ch].gr[gr].mixed_block_flag == 0)) || ((si.ch[ch].gr[gr].block_type == 2)
+ && (si.ch[ch].gr[gr].mixed_block_flag != 0) && (j >= 36)))) {
t_index = (index - cb_begin) / cb_width;
/*
* xr[sb][ss] *= pow(2.0, ((-2.0 * gr_info.subblock_gain[t_index]) -(0.5
* * (1.0 + gr_info.scalefac_scale) scalefac[ch].s[t_index][cb])));
*/
- @LOC("IDX") int idx = scalefac[ch].s[t_index][cb] << gr_info.scalefac_scale;
- idx += (gr_info.subblock_gain[t_index] << 2);
+ @LOC("THIS,LayerIIIDecoder.SI1") int idx =
+ scalefac[ch].s[t_index][cb] << si.ch[ch].gr[gr].scalefac_scale;
+ idx += (si.ch[ch].gr[gr].subblock_gain[t_index] << 2);
- xr[quotien][reste] *= two_to_negative_half_pow[idx];
+ ro[ch][quotien][reste] *= two_to_negative_half_pow[idx];
} else { // LONG block types 0,1,3 & 1st 2 subbands of switched blocks
/*
* xr[sb][ss] *= pow(2.0, -0.5 * (1.0+gr_info.scalefac_scale)
* (scalefac[ch].l[cb] + gr_info.preflag * pretab[cb]));
*/
- @LOC("IDX") int idx = scalefac[ch].l[cb];
+ @LOC("THIS,LayerIIIDecoder.SI1") int idx = scalefac[ch].l[cb];
- if (gr_info.preflag != 0)
+ if (si.ch[ch].gr[gr].preflag != 0)
idx += pretab[cb];
- idx = idx << gr_info.scalefac_scale;
- xr[quotien][reste] *= two_to_negative_half_pow[idx];
+ idx = idx << si.ch[ch].gr[gr].scalefac_scale;
+ ro[ch][quotien][reste] *= two_to_negative_half_pow[idx];
}
index++;
}
for (j = nonzero[ch]; j < 576; j++) {
// Modif E.B 02/22/99
- @LOC("REST") int reste = j % SSLIMIT;
- @LOC("QUO") int quotien = (int) ((j - reste) / SSLIMIT);
+ @LOC("THIS,LayerIIIDecoder.NZ") int reste = j % SSLIMIT;
+ @LOC("THIS,LayerIIIDecoder.NZ") int quotien = (int) ((j - reste) / SSLIMIT);
if (reste < 0)
reste = 0;
if (quotien < 0)
quotien = 0;
- xr[quotien][reste] = 0.0f;
+ ro[ch][quotien][reste] = 0.0f;
}
return;
@@ -1078,37 +1164,46 @@ final class LayerIIIDecoder implements FrameDecoder {
/**
*
*/
- @LATTICE("THIS= 3; sfb--) {
i = sfBandIndex[sfreq].s[sfb];
@@ -1320,8 +1421,8 @@ final class LayerIIIDecoder implements FrameDecoder {
} // for (; sfb<8 ...
} // for (j=0 ...
} else { // if (gr_info.mixed_block_flag)
- for (@LOC("THIS,LayerIIIDecoder.J") int j = 0; j < 3; j++) {
- @LOC("THIS,LayerIIIDecoder.SH") int sfbcnt;
+ for (@LOC("THIS,LayerIIIDecoder.RO1") int j = 0; j < 3; j++) {
+ @LOC("THIS,LayerIIIDecoder.RO1") int sfbcnt;
sfbcnt = -1;
for (sfb = 12; sfb >= 0; sfb--) {
temp = sfBandIndex[sfreq].s[sfb];
@@ -1462,12 +1563,17 @@ final class LayerIIIDecoder implements FrameDecoder {
/**
*
*/
- @LATTICE("THIS