having new variable 'inter' in-between "reorder/antialias" and "hybrid" in order...
[IRC.git] / Robust / src / Tests / ssJava / mp3decoder / LayerIIIDecoder.java
index 4ec6a8980fa2dd3af0c34436b1cdaf9875faeaa2..8714428bb07d9728353fddea7c47c1e4c08cc26b 100644 (file)
@@ -47,7 +47,7 @@
 // 10th added for get_scale_factors
 // llth added for decode
 // @LATTICE("IS1D*,RO<IS1D,IS1D<SI2,SI2<SI1,SI<P2S,SF1<CH0,SF0*,SFB_SH<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SI1<SF2,SF2<SFB,SF1<BR,LR*,OUT<LR,LR<RO,NZ*,SI<SF1,SI1<NZ,NZ<SI,SI1<SBI,SBI<SI,BUF<FT,SF1<SF0,SF0<HD1,BR<ST,ST,FT<SP,SP<OUT,OUT<SI1,SI1<SI,P2S<CH0,CH0<MAX0,MAX0<BR1,FS<BR1,BR1<BR,BR<HD1,HD1<HD,OUT*,BR1*,SI1*,MAX0*,CH0*,RAW,TS,F,C,K,LY,VAR,IR,IP,CSH,GLSFD3,GLSFD4,GLSFD5,GLSFF4,GLSFF2,GLSFF3,GLSFF1,GSF4,GSF5,GSF1,GSF2,GSF3,HD2,HD3,BT,GR,RO6,RO5,RO9,RO8,RO7,RO4,RO1,RO3,RO2,SH,ME,TMP2,S,LSF,J")
 // 10th added for get_scale_factors
 // llth added for decode
 // @LATTICE("IS1D*,RO<IS1D,IS1D<SI2,SI2<SI1,SI<P2S,SF1<CH0,SF0*,SFB_SH<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SI1<SF2,SF2<SFB,SF1<BR,LR*,OUT<LR,LR<RO,NZ*,SI<SF1,SI1<NZ,NZ<SI,SI1<SBI,SBI<SI,BUF<FT,SF1<SF0,SF0<HD1,BR<ST,ST,FT<SP,SP<OUT,OUT<SI1,SI1<SI,P2S<CH0,CH0<MAX0,MAX0<BR1,FS<BR1,BR1<BR,BR<HD1,HD1<HD,OUT*,BR1*,SI1*,MAX0*,CH0*,RAW,TS,F,C,K,LY,VAR,IR,IP,CSH,GLSFD3,GLSFD4,GLSFD5,GLSFF4,GLSFF2,GLSFF3,GLSFF1,GSF4,GSF5,GSF1,GSF2,GSF3,HD2,HD3,BT,GR,RO6,RO5,RO9,RO8,RO7,RO4,RO1,RO3,RO2,SH,ME,TMP2,S,LSF,J")
-@LATTICE("ISR*,ISP*,LR<ISR,ISR<ISP,SI1<SF2,NS*,HD<ST,IS1D*,RO1<RO,RO1*,RO<IS1D,IS1D<SI2,SI2<SI1,BR<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SF2<SFB,LR*,OUT<LR,ISP<RO1,NZ*,SI<SF1,BR1<NZ,NZ<BR,SI1<RT,RT<SBI,SBI<SI,BUF<FT,SF1<CH0,CH0<HD1,FT<SP,SP<OUT,OUT<SI1,SI1<SI,SFB_SH<BR1,BR1<BR,HD1<HD,OUT*,BR1*,SI1*,CH0*,RAW,TS,F,C,K,LY,VAR,IR,IP,CSH,GLSFD3,GLSFD4,GLSFD5,GLSFF4,GLSFF2,GLSFF3,GLSFF1,GSF4,GSF5,GSF1,GSF2,GSF3,HD2,HD3,BT,GR,RO6,RO5,RO9,RO8,RO7,RO4,RO1,RO3,RO2,SH,ME,TMP2,S,LSF,J")
+@LATTICE("SI0*,INIT*,ISR*,ISP*,HD<CH0,LR<ISR,ISR<ISP,SI1<SF2,NS*,CH0<ST,ST<INIT,IS1D*,RO1<RO,RO1*,RO<IS1D,IS1D<SI2,SI2<SI1,BR<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SF2<SFB,LR*,OUT<LR,ISP<RO1,NZ*,SI<SI0,SI0<SF15,SF15<SF1,BR1<NZ,NZ<BR,SI1<RT,RT<SBI,SBI<SI,BUF<FT,SF1<HD1,SF1<HD1,FT<SP,SP<OUT,OUT<SI1,SI1<SI,SFB_SH<BR1,BR1<BR,HD1<HD,OUT*,BR1*,SI1*,CH0*")
 @METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN,RETURNLOC=OUT")
 final class LayerIIIDecoder implements FrameDecoder {
   static final double d43 = (4.0 / 3.0);
 @METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN,RETURNLOC=OUT")
 final class LayerIIIDecoder implements FrameDecoder {
   static final double d43 = (4.0 / 3.0);
@@ -65,6 +65,8 @@ final class LayerIIIDecoder implements FrameDecoder {
   @LOC("LR")
   private float[][][] lr;
   @LOC("OUT")
   @LOC("LR")
   private float[][][] lr;
   @LOC("OUT")
+  private float[] inter; // 576 samples
+  @LOC("OUT")
   private float[] out_1d; // 576 samples
   @LOC("OUT")
   private float[][] prevblck;
   private float[] out_1d; // 576 samples
   @LOC("OUT")
   private float[][] prevblck;
@@ -72,8 +74,6 @@ final class LayerIIIDecoder implements FrameDecoder {
   private float[][] k;
   @LOC("NZ")
   private int[] nonzero;
   private float[][] k;
   @LOC("NZ")
   private int[] nonzero;
-  // @LOC("HD")
-  // private Header header;
   @LOC("FT")
   private SynthesisFilter filter1;
   @LOC("FT")
   @LOC("FT")
   private SynthesisFilter filter1;
   @LOC("FT")
@@ -89,7 +89,7 @@ final class LayerIIIDecoder implements FrameDecoder {
 
   // @LOC("SBT") private temporaire2[] III_scalefac_t;
   @LOC("SF2")
 
   // @LOC("SBT") private temporaire2[] III_scalefac_t;
   @LOC("SF2")
-  private temporaire2[] scalefac;
+  private final temporaire2[] scalefac;
   // private III_scalefac_t scalefac;
 
   @LOC("CH0")
   // private III_scalefac_t scalefac;
 
   @LOC("CH0")
@@ -98,7 +98,7 @@ final class LayerIIIDecoder implements FrameDecoder {
   private int frame_start;
   // @LOC("SI1") private int part2_start;
   @LOC("CH0")
   private int frame_start;
   // @LOC("SI1") private int part2_start;
   @LOC("CH0")
-  private int channels;
+  private final int channels;
   @LOC("CH0")
   private int first_channel;
   @LOC("CH0")
   @LOC("CH0")
   private int first_channel;
   @LOC("CH0")
@@ -106,10 +106,10 @@ final class LayerIIIDecoder implements FrameDecoder {
   @LOC("SBI")
   private int sfreq;
 
   @LOC("SBI")
   private int sfreq;
 
-  @LOC("ST")
+  @LOC("BR1")
   private int part2_start;
 
   private int part2_start;
 
-  @LOC("ST")
+  @LOC("INIT")
   private boolean initialized = false;
 
   // constructor for the linear type system
   private boolean initialized = false;
 
   // constructor for the linear type system
@@ -124,6 +124,7 @@ final class LayerIIIDecoder implements FrameDecoder {
     ro = new float[2][SBLIMIT][SSLIMIT];
     lr = new float[2][SBLIMIT][SSLIMIT];
     out_1d = new float[SBLIMIT * SSLIMIT];
     ro = new float[2][SBLIMIT][SSLIMIT];
     lr = new float[2][SBLIMIT][SSLIMIT];
     out_1d = new float[SBLIMIT * SSLIMIT];
+    inter = new float[SBLIMIT * SSLIMIT];
     prevblck = new float[2][SBLIMIT * SSLIMIT];
     k = new float[2][SBLIMIT * SSLIMIT];
     nonzero = new int[2];
     prevblck = new float[2][SBLIMIT * SSLIMIT];
     k = new float[2][SBLIMIT * SSLIMIT];
     nonzero = new int[2];
@@ -200,12 +201,6 @@ final class LayerIIIDecoder implements FrameDecoder {
         reorder_table[i] = reorder(sfBandIndex[i].s);
     }
 
         reorder_table[i] = reorder(sfBandIndex[i].s);
     }
 
-    // Sftable
-    @LOC("VAR") int[] ll0 = { 0, 6, 11, 16, 21 };
-    @LOC("VAR") int[] ss0 = { 0, 6, 12 };
-    sftable = new Sftable(ll0, ss0);
-    // END OF Sftable
-
     // scalefac_buffer
     scalefac_buffer = new int[54];
     // END OF scalefac_buffer
     // scalefac_buffer
     scalefac_buffer = new int[54];
     // END OF scalefac_buffer
@@ -213,7 +208,7 @@ final class LayerIIIDecoder implements FrameDecoder {
   }
 
   @LATTICE("THIS<C,THIS<IN,C*,THISLOC=THIS")
   }
 
   @LATTICE("THIS<C,THIS<IN,C*,THISLOC=THIS")
-  private void init(@LOC("IN") Header header) {
+  private void init(@LOC("THIS,LayerIIIDecoder.HD1") Header header) {
 
     frame_start = 0;
     channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
 
     frame_start = 0;
     channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
@@ -245,13 +240,12 @@ final class LayerIIIDecoder implements FrameDecoder {
       first_channel = last_channel = 0;
     }
 
       first_channel = last_channel = 0;
     }
 
-    for (@LOC("C") int ch = 0; ch < 2; ch++)
-      for (@LOC("C") int j = 0; j < 576; j++)
+    for (@LOC("THIS,LayerIIIDecoder.CH0") int ch = 0; ch < 2; ch++)
+      for (@LOC("THIS,LayerIIIDecoder.CH0") int j = 0; j < 576; j++)
         prevblck[ch][j] = 0.0f;
 
     nonzero[0] = nonzero[1] = 576;
 
         prevblck[ch][j] = 0.0f;
 
     nonzero[0] = nonzero[1] = 576;
 
-    br = new BitReserve();
     si = new III_side_info_t();
 
     initialized = true;
     si = new III_side_info_t();
 
     initialized = true;
@@ -459,13 +453,20 @@ final class LayerIIIDecoder implements FrameDecoder {
    * {filter1,filter2}
    */
   // @LATTICE("BYTE<THIS,THIS<MAIN,MAIN<VAR,THIS<GR,GR<VAR,BYTE*,GR*,THISLOC=THIS,GLOBALLOC=VAR")
    * {filter1,filter2}
    */
   // @LATTICE("BYTE<THIS,THIS<MAIN,MAIN<VAR,THIS<GR,GR<VAR,BYTE*,GR*,THISLOC=THIS,GLOBALLOC=VAR")
-  @LATTICE("VAR<THIS,C<THIS,THIS<IN,THISLOC=THIS,C*,VAR*")
-  public void decode(@LOC("IN") Header header) {
+  @LATTICE("HEADER<VAR,VAR<THIS,C<THIS,THIS<IN,THISLOC=THIS,C*,VAR*")
+  public void decode(@LOC("THIS,LayerIIIDecoder.HD") Header header) {
 
     if (!initialized) {
       init(header);
     }
 
 
     if (!initialized) {
       init(header);
     }
 
+    // overwrites once per a loop
+    samples1 = new float[32];
+    samples2 = new float[32];
+    // prevblck = new float[2][SBLIMIT * SSLIMIT];
+    si = new III_side_info_t();
+    //
+
     @LOC("THIS,LayerIIIDecoder.HD1") int nSlots = header.slots();
 
     @LOC("THIS,LayerIIIDecoder.CH0") int gr;
     @LOC("THIS,LayerIIIDecoder.HD1") int nSlots = header.slots();
 
     @LOC("THIS,LayerIIIDecoder.CH0") int gr;
@@ -485,17 +486,20 @@ final class LayerIIIDecoder implements FrameDecoder {
     get_side_info(header);
     br = header.getBitReserve();
 
     get_side_info(header);
     br = header.getBitReserve();
 
+    @LOC("THIS,LayerIIIDecoder.HD1") int version = header.version();
+
     // 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}
 
       // 'ch', 'channels' should be higher than all locs in the below body
       for (ch = 0; ch < channels; ch++) {
     // 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}
 
       // '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.hsstell();
+        @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_start_local = br.hsstell();
 
         // grab scale factors from the main data.
         // following the scale factors is the actual compressed data
 
         // grab scale factors from the main data.
         // following the scale factors is the actual compressed data
-        if (header.version() == Header.MPEG1)
+        if (version == Header.MPEG1)
           get_scale_factors(header, ch, gr); // no need to care from this side
         // here move scale factor data from 'br' buffer to 'scalefac' field
         else
           get_scale_factors(header, ch, gr); // no need to care from this side
         // here move scale factor data from 'br' buffer to 'scalefac' field
         else
@@ -504,7 +508,8 @@ final class LayerIIIDecoder implements FrameDecoder {
                                                  // side
 
         // here, decoding the compressed audio data
                                                  // side
 
         // here, decoding the compressed audio data
-        huffman_decode(ch, gr); // no need to care from this side
+        huffman_decode(part2_start_local, 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
         // System.out.println("CheckSum HuffMan = " + CheckSumHuff);
         dequantize_sample(/* ro[ch], */ch, gr); // no need to care from this
                                                 // side
@@ -533,6 +538,10 @@ final class LayerIIIDecoder implements FrameDecoder {
         // }
         // System.out.println("CheckSumOut1d = "+CheckSumOut1d);
 
         // }
         // System.out.println("CheckSumOut1d = "+CheckSumOut1d);
 
+        for (@LOC("THIS,LayerIIIDecoder.SI1") int index = 0; index < 576; index++) {
+          out_1d[index] = inter[index];
+        }
+
         hybrid(ch, gr);
 
         // float CheckSumOut1d=0;
         hybrid(ch, gr);
 
         // float CheckSumOut1d=0;
@@ -601,15 +610,17 @@ 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)
    */
    * 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)
    */
-  @LATTICE("THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=THIS")
-  private boolean get_side_info(@LOC("IN") Header header) {
+  @LATTICE("OUT<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  private boolean get_side_info(@LOC("THIS,LayerIIIDecoder.HD1") Header header) {
 
 
-    @LOC("IN") SideInfoBuffer sib = header.getSideInfoBuffer();
+    @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.TEMP") SideInfoBuffer sib =
+        header.getSideInfoBuffer();
+    @LOC("THIS,LayerIIIDecoder.SF1") int version = header.version();
 
 
-    @LOC("C") int ch;
-    @LOC("C") int gr;
+    @LOC("THIS,LayerIIIDecoder.SI0") int ch;
+    @LOC("THIS,LayerIIIDecoder.SI0") int gr;
     // System.out.println("#get_side_info");
     // System.out.println("#get_side_info");
-    if (header.version() == Header.MPEG1) {
+    if (version == Header.MPEG1) {
 
       si.main_data_begin = sib.get_bits(9);
       if (channels == 1)
 
       si.main_data_begin = sib.get_bits(9);
       if (channels == 1)
@@ -634,8 +645,11 @@ final class LayerIIIDecoder implements FrameDecoder {
           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].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) {
+          @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.TEMP") int cond =
+              sib.get_bits(1);
+          // si.ch[ch].gr[gr].window_switching_flag = sib.get_bits(1);
+          // if ((si.ch[ch].gr[gr].window_switching_flag) != 0) {
+          if (cond != 0) {
             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].block_type = sib.get_bits(2);
             si.ch[ch].gr[gr].mixed_block_flag = sib.get_bits(1);
 
@@ -666,6 +680,9 @@ final class LayerIIIDecoder implements FrameDecoder {
             si.ch[ch].gr[gr].region1_count = sib.get_bits(3);
             si.ch[ch].gr[gr].block_type = 0;
           }
             si.ch[ch].gr[gr].region1_count = sib.get_bits(3);
             si.ch[ch].gr[gr].block_type = 0;
           }
+          //
+          si.ch[ch].gr[gr].window_switching_flag = cond;
+          //
           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);
           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);
@@ -686,9 +703,12 @@ final class LayerIIIDecoder implements FrameDecoder {
         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].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) {
+        @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.TEMP") int cond =
+            sib.get_bits(1);
+        // si.ch[ch].gr[0].window_switching_flag = sib.get_bits(1);
+        // if ((si.ch[ch].gr[0].window_switching_flag) != 0) {
+        if (cond != 0) {
 
           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].block_type = sib.get_bits(2);
           si.ch[ch].gr[0].mixed_block_flag = sib.get_bits(1);
@@ -720,6 +740,9 @@ final class LayerIIIDecoder implements FrameDecoder {
           si.ch[ch].gr[0].region1_count = sib.get_bits(3);
           si.ch[ch].gr[0].block_type = 0;
         }
           si.ch[ch].gr[0].region1_count = sib.get_bits(3);
           si.ch[ch].gr[0].block_type = 0;
         }
+        //
+        si.ch[ch].gr[gr].window_switching_flag = cond;
+        //
 
         si.ch[ch].gr[0].scalefac_scale = sib.get_bits(1);
         si.ch[ch].gr[0].count1table_select = sib.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);
@@ -732,8 +755,8 @@ final class LayerIIIDecoder implements FrameDecoder {
         *
         */
   @LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
         *
         */
   @LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
-  private void get_scale_factors(@LOC("IN") Header header, @LOC("THIS,LayerIIIDecoder.CH0") int ch,
-      @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+  private void get_scale_factors(@LOC("THIS,LayerIIIDecoder.SF1") Header header,
+      @LOC("THIS,LayerIIIDecoder.SF1") int ch, @LOC("THIS,LayerIIIDecoder.SF1") int gr) {
 
     // gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias
 
 
     // gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias
 
@@ -846,16 +869,16 @@ final class LayerIIIDecoder implements FrameDecoder {
 
   // ssjava
   @LATTICE("M<THIS,THIS<IN,THIS<C,C*,M*,THISLOC=THIS,GLOBALLOC=THIS")
 
   // ssjava
   @LATTICE("M<THIS,THIS<IN,THIS<C,C*,M*,THISLOC=THIS,GLOBALLOC=THIS")
-  private void get_LSF_scale_data(@LOC("IN") Header header,
-      @LOC("THIS,LayerIIIDecoder.CH0") int ch, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+  private void get_LSF_scale_data(@LOC("THIS,LayerIIIDecoder.SF15") Header header,
+      @LOC("THIS,LayerIIIDecoder.SF15") int ch, @LOC("THIS,LayerIIIDecoder.SF15") int gr) {
 
 
-    @LOC("THIS,LayerIIIDecoder.HD1") int mode_ext = header.mode_extension();
+    @LOC("THIS,LayerIIIDecoder.SI0") int mode_ext = header.mode_extension();
     // @LOC("THIS,LayerIIIDecoder.GLSFD1") gr_info_s gr_info =
     // (si.ch[ch].gr[gr]); // remove alias
 
     @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR,LayerIIIDecoder$gr_info_s.V") int scalefac_comp =
         si.ch[ch].gr[gr].scalefac_compress;
     // @LOC("THIS,LayerIIIDecoder.GLSFD1") gr_info_s gr_info =
     // (si.ch[ch].gr[gr]); // remove alias
 
     @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR,LayerIIIDecoder$gr_info_s.V") int scalefac_comp =
         si.ch[ch].gr[gr].scalefac_compress;
-    @LOC("THIS,LayerIIIDecoder.SI") int blocktypenumber;
+    @LOC("THIS,LayerIIIDecoder.NS") int blocktypenumber;
 
     @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR,LayerIIIDecoder$gr_info_s.V") int int_scalefac_comp;
     @LOC("THIS,LayerIIIDecoder.SFB_SH") int m;
 
     @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR,LayerIIIDecoder$gr_info_s.V") int int_scalefac_comp;
     @LOC("THIS,LayerIIIDecoder.SFB_SH") int m;
@@ -932,13 +955,14 @@ final class LayerIIIDecoder implements FrameDecoder {
       }
     }
 
       }
     }
 
-    for (@LOC("C") int x = 0; x < 45; x++)
+    for (@LOC("THIS,LayerIIIDecoder.NS") int x = 0; x < 45; x++)
       // why 45, not 54?
       scalefac_buffer[x] = 0;
 
     m = 0;
       // why 45, not 54?
       scalefac_buffer[x] = 0;
 
     m = 0;
-    for (@LOC("C") int i = 0; i < 4; i++) {
-      for (@LOC("THIS,LayerIIIDecoder.NS") int j = 0; j < nr_of_sfb_block[blocknumber][blocktypenumber][i]; j++) {
+    for (@LOC("THIS,LayerIIIDecoder.NS") int i = 0; i < 4; i++) {
+      @LOC("THIS,LayerIIIDecoder.NS") int jmax = nr_of_sfb_block[blocknumber][blocktypenumber][i];
+      for (@LOC("THIS,LayerIIIDecoder.NS") int j = 0; j < jmax; j++) {
         scalefac_buffer[m] = (new_slen[i] == 0) ? 0 : br.hgetbits(new_slen[i]);
         m++;
 
         scalefac_buffer[m] = (new_slen[i] == 0) ? 0 : br.hgetbits(new_slen[i]);
         m++;
 
@@ -950,8 +974,8 @@ final class LayerIIIDecoder implements FrameDecoder {
         *
         */
   @LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
         *
         */
   @LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
-  private void get_LSF_scale_factors(@LOC("IN") Header header,
-      @LOC("THIS,LayerIIIDecoder.CH0") int ch, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+  private void get_LSF_scale_factors(@LOC("THIS,LayerIIIDecoder.SF1") Header header,
+      @LOC("THIS,LayerIIIDecoder.SF1") int ch, @LOC("THIS,LayerIIIDecoder.SF1") int gr) {
 
     @LOC("THIS,LayerIIIDecoder.SFB_SH") int sfb;
     @LOC("THIS,LayerIIIDecoder.SFB_SH") int m = 0;
 
     @LOC("THIS,LayerIIIDecoder.SFB_SH") int sfb;
     @LOC("THIS,LayerIIIDecoder.SFB_SH") int m = 0;
@@ -1009,24 +1033,26 @@ final class LayerIIIDecoder implements FrameDecoder {
   // int[] v = { 0 };
   // @LOC("SI1")
   // int[] w = { 0 };
   // int[] v = { 0 };
   // @LOC("SI1")
   // int[] w = { 0 };
-  @LOC("SI1")
-  int x[] = { 0 };
-  @LOC("SI1")
-  int y[] = { 0 };
-  @LOC("SI1")
-  int v[] = { 0 };
-  @LOC("SI1")
-  int w[] = { 0 };
+  // @LOC("SI1")
+  // int x[] = { 0 };
+  // @LOC("SI1")
+  // int y[] = { 0 };
+  // @LOC("SI1")
+  // int v[] = { 0 };
+  // @LOC("SI1")
+  // int w[] = { 0 };
 
 
-  private void huffman_decode(@LOC("THIS,LayerIIIDecoder.CH0") int ch,
-      @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
-    x[0] = 0;
-    y[0] = 0;
-    v[0] = 0;
-    w[0] = 0;
+  @LATTICE("VAR<OUT,OUT<THIS,THIS<RE,THISLOC=THIS,GLOBALLOC=OUT,RETURNLOC=OUT")
+  private void huffman_decode(@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_start_local,
+      @LOC("THIS,LayerIIIDecoder.CH0") int ch, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+
+    @LOC("RE") int x[] = new int[1];
+    @LOC("RE") int y[] = new int[1];
+    @LOC("RE") int v[] = new int[1];
+    @LOC("RE") int w[] = new int[1];
 
     @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_3_end =
 
     @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_3_end =
-        part2_start + si.ch[ch].gr[gr].part2_3_length;
+        part2_start_local + si.ch[ch].gr[gr].part2_3_length;
     @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int num_bits;
     @LOC("THIS,LayerIIIDecoder.SI1") int region1Start;
     @LOC("THIS,LayerIIIDecoder.SI1") int region2Start;
     @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int num_bits;
     @LOC("THIS,LayerIIIDecoder.SI1") int region1Start;
     @LOC("THIS,LayerIIIDecoder.SI1") int region2Start;
@@ -1059,10 +1085,10 @@ final class LayerIIIDecoder implements FrameDecoder {
 
     index = 0;
     // Read bigvalues area
 
     index = 0;
     // Read bigvalues area
-    for (@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i +=
+    TERMINATE: for (@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i +=
         2) {
 
         2) {
 
-      @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT")  int htIdx;
+      @LOC("THIS,LayerIIIDecoder.SI2") int htIdx;
       if (i < region1Start) {
         htIdx = si.ch[ch].gr[gr].table_select[0];
         // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[0]];
       if (i < region1Start) {
         htIdx = si.ch[ch].gr[gr].table_select[0];
         // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[0]];
@@ -1087,11 +1113,11 @@ final class LayerIIIDecoder implements FrameDecoder {
 
     // Read count1 area
 
 
     // Read count1 area
 
-    @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT")     int htIdx = si.ch[ch].gr[gr].count1table_select + 32;
+    @LOC("THIS,LayerIIIDecoder.SI2") int htIdx = si.ch[ch].gr[gr].count1table_select + 32;
     // h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32];
     num_bits = br.hsstell();
 
     // h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32];
     num_bits = br.hsstell();
 
-    while ((num_bits < part2_3_end) && (index < 576)) {
+    TERMINATE: while ((num_bits < part2_3_end) && (index < 576)) {
 
       huffcodetab.huffman_decoder(htIdx, x, y, v, w, br);
 
 
       huffcodetab.huffman_decoder(htIdx, x, y, v, w, br);
 
@@ -1354,7 +1380,7 @@ final class LayerIIIDecoder implements FrameDecoder {
     if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) {
 
       for (index = 0; index < 576; index++) {
     if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) {
 
       for (index = 0; index < 576; index++) {
-        out_1d[index] = 0.0f;
+        inter[index] = 0.0f;
       }
 
       if (si.ch[ch].gr[gr].mixed_block_flag != 0) {
       }
 
       if (si.ch[ch].gr[gr].mixed_block_flag != 0) {
@@ -1363,7 +1389,7 @@ final class LayerIIIDecoder implements FrameDecoder {
           // Modif E.B 02/22/99
           @LOC("THIS,LayerIIIDecoder.SI1") int reste = index % SSLIMIT;
           @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((index - reste) / SSLIMIT);
           // Modif E.B 02/22/99
           @LOC("THIS,LayerIIIDecoder.SI1") int reste = index % SSLIMIT;
           @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((index - reste) / SSLIMIT);
-          out_1d[index] = lr[ch][quotien][reste];
+          inter[index] = lr[ch][quotien][reste];
         }
         // REORDERING FOR REST SWITCHED SHORT
         /*
         }
         // REORDERING FOR REST SWITCHED SHORT
         /*
@@ -1387,21 +1413,21 @@ final class LayerIIIDecoder implements FrameDecoder {
             @LOC("THIS,LayerIIIDecoder.SI1") int reste = src_line % SSLIMIT;
             @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((src_line - reste) / SSLIMIT);
 
             @LOC("THIS,LayerIIIDecoder.SI1") int reste = src_line % SSLIMIT;
             @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((src_line - reste) / SSLIMIT);
 
-            out_1d[des_line] = lr[ch][quotien][reste];
+            inter[des_line] = lr[ch][quotien][reste];
             src_line += sfb_lines;
             des_line++;
 
             reste = src_line % SSLIMIT;
             quotien = (int) ((src_line - reste) / SSLIMIT);
 
             src_line += sfb_lines;
             des_line++;
 
             reste = src_line % SSLIMIT;
             quotien = (int) ((src_line - reste) / SSLIMIT);
 
-            out_1d[des_line] = lr[ch][quotien][reste];
+            inter[des_line] = lr[ch][quotien][reste];
             src_line += sfb_lines;
             des_line++;
 
             reste = src_line % SSLIMIT;
             quotien = (int) ((src_line - reste) / SSLIMIT);
 
             src_line += sfb_lines;
             des_line++;
 
             reste = src_line % SSLIMIT;
             quotien = (int) ((src_line - reste) / SSLIMIT);
 
-            out_1d[des_line] = lr[ch][quotien][reste];
+            inter[des_line] = lr[ch][quotien][reste];
           }
         }
 
           }
         }
 
@@ -1410,7 +1436,7 @@ final class LayerIIIDecoder implements FrameDecoder {
           @LOC("THIS,LayerIIIDecoder.SI1") int j = reorder_table[sfreq][index];
           @LOC("THIS,LayerIIIDecoder.SI1") int reste = j % SSLIMIT;
           @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((j - reste) / SSLIMIT);
           @LOC("THIS,LayerIIIDecoder.SI1") int j = reorder_table[sfreq][index];
           @LOC("THIS,LayerIIIDecoder.SI1") int reste = j % SSLIMIT;
           @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((j - reste) / SSLIMIT);
-          out_1d[index] = lr[ch][quotien][reste];
+          inter[index] = lr[ch][quotien][reste];
         }
       }
     } else { // long blocks
         }
       }
     } else { // long blocks
@@ -1418,7 +1444,7 @@ final class LayerIIIDecoder implements FrameDecoder {
         // Modif E.B 02/22/99
         @LOC("THIS,LayerIIIDecoder.SI1") int reste = index % SSLIMIT;
         @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((index - reste) / SSLIMIT);
         // Modif E.B 02/22/99
         @LOC("THIS,LayerIIIDecoder.SI1") int reste = index % SSLIMIT;
         @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((index - reste) / SSLIMIT);
-        out_1d[index] = lr[ch][quotien][reste];
+        inter[index] = lr[ch][quotien][reste];
       }
     }
   }
       }
     }
   }
@@ -1434,7 +1460,8 @@ final class LayerIIIDecoder implements FrameDecoder {
 
   // ssjava
   @LATTICE("IO<THIS,THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
 
   // ssjava
   @LATTICE("IO<THIS,THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
-  private void stereo(@LOC("IN") Header header, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+  private void stereo(@LOC("THIS,LayerIIIDecoder.HD1") Header header,
+      @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
     @LOC("THIS,LayerIIIDecoder.RO1") int sb;
     @LOC("THIS,LayerIIIDecoder.RO1") int ss;
 
     @LOC("THIS,LayerIIIDecoder.RO1") int sb;
     @LOC("THIS,LayerIIIDecoder.RO1") int ss;
 
@@ -1450,7 +1477,7 @@ final class LayerIIIDecoder implements FrameDecoder {
     } else {
 
       // gr_info_s gr_info = (si.ch[0].gr[gr]); remove alias
     } else {
 
       // gr_info_s gr_info = (si.ch[0].gr[gr]); remove alias
-      @LOC("THIS,LayerIIIDecoder.HD1") int mode_ext = header.mode_extension();
+      @LOC("THIS,LayerIIIDecoder.SF1") int mode_ext = header.mode_extension();
 
       @LOC("THIS,LayerIIIDecoder.RO1") int sfb;
       @LOC("THIS,LayerIIIDecoder.RO1") int i;
 
       @LOC("THIS,LayerIIIDecoder.RO1") int sfb;
       @LOC("THIS,LayerIIIDecoder.RO1") int i;
@@ -1458,11 +1485,11 @@ final class LayerIIIDecoder implements FrameDecoder {
       @LOC("THIS,LayerIIIDecoder.RO1") int temp;
       @LOC("THIS,LayerIIIDecoder.RO1") int temp2;
 
       @LOC("THIS,LayerIIIDecoder.RO1") int temp;
       @LOC("THIS,LayerIIIDecoder.RO1") int temp2;
 
-      @LOC("THIS,LayerIIIDecoder.CH0") boolean ms_stereo =
+      @LOC("THIS,LayerIIIDecoder.SF15") boolean ms_stereo =
           ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x2) != 0));
           ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x2) != 0));
-      @LOC("THIS,LayerIIIDecoder.CH0") boolean i_stereo =
+      @LOC("THIS,LayerIIIDecoder.SF15") boolean i_stereo =
           ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x1) != 0));
           ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x1) != 0));
-      @LOC("THIS,LayerIIIDecoder.CH0") boolean lsf =
+      @LOC("THIS,LayerIIIDecoder.SF15") boolean lsf =
           ((header.version() == Header.MPEG2_LSF || header.version() == Header.MPEG25_LSF)); // SZD
 
       @LOC("THIS,LayerIIIDecoder.LR") int io_type = (si.ch[0].gr[gr].scalefac_compress & 1);
           ((header.version() == Header.MPEG2_LSF || header.version() == Header.MPEG25_LSF)); // SZD
 
       @LOC("THIS,LayerIIIDecoder.LR") int io_type = (si.ch[0].gr[gr].scalefac_compress & 1);
@@ -1484,12 +1511,11 @@ final class LayerIIIDecoder implements FrameDecoder {
             for (@LOC("THIS,LayerIIIDecoder.RO1") int j = 0; j < 3; j++) {
               @LOC("THIS,LayerIIIDecoder.RO1") int sfbcnt;
               sfbcnt = 2;
             for (@LOC("THIS,LayerIIIDecoder.RO1") int j = 0; j < 3; j++) {
               @LOC("THIS,LayerIIIDecoder.RO1") int sfbcnt;
               sfbcnt = 2;
-              for (sfb = 12; sfb >= 3; sfb--) {
+              TERMINATE: for (sfb = 12; sfb >= 3; sfb--) {
                 i = sfBandIndex[sfreq].s[sfb];
                 lines = sfBandIndex[sfreq].s[sfb + 1] - i;
                 i = (i << 2) - i + (j + 1) * lines - 1;
                 i = sfBandIndex[sfreq].s[sfb];
                 lines = sfBandIndex[sfreq].s[sfb + 1] - i;
                 i = (i << 2) - i + (j + 1) * lines - 1;
-
-                while (lines > 0) {
+                TERMINATE: while (lines > 0) {
                   if (ro[1][i / 18][i % 18] != 0.0f) {
                     // MDM: in java, array access is very slow.
                     // Is quicker to compute div and mod values.
                   if (ro[1][i / 18][i % 18] != 0.0f) {
                     // MDM: in java, array access is very slow.
                     // Is quicker to compute div and mod values.
@@ -1515,7 +1541,7 @@ final class LayerIIIDecoder implements FrameDecoder {
                 sb = sfBandIndex[sfreq].s[sfb + 1] - temp;
                 i = (temp << 2) - temp + j * sb;
 
                 sb = sfBandIndex[sfreq].s[sfb + 1] - temp;
                 i = (temp << 2) - temp + j * sb;
 
-                for (; sb > 0; sb--) {
+                TERMINATE: for (; sb > 0; sb--) {
                   is_pos[i] = scalefac[1].s[j][sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
                   is_pos[i] = scalefac[1].s[j][sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
@@ -1533,8 +1559,7 @@ final class LayerIIIDecoder implements FrameDecoder {
               temp = sfBandIndex[sfreq].s[11];
               sb = sfBandIndex[sfreq].s[12] - temp;
               i = (temp << 2) - temp + j * sb;
               temp = sfBandIndex[sfreq].s[11];
               sb = sfBandIndex[sfreq].s[12] - temp;
               i = (temp << 2) - temp + j * sb;
-
-              for (; sb > 0; sb--) {
+              TERMINATE: for (; sb > 0; sb--) {
                 is_pos[i] = is_pos[sfb];
 
                 if (lsf) {
                 is_pos[i] = is_pos[sfb];
 
                 if (lsf) {
@@ -1550,7 +1575,7 @@ final class LayerIIIDecoder implements FrameDecoder {
               i = 2;
               ss = 17;
               sb = -1;
               i = 2;
               ss = 17;
               sb = -1;
-              while (i >= 0) {
+              TERMINATE: while (i >= 0) {
                 if (ro[1][i][ss] != 0.0f) {
                   sb = (i << 4) + (i << 1) + ss;
                   i = -1;
                 if (ro[1][i][ss] != 0.0f) {
                   sb = (i << 4) + (i << 1) + ss;
                   i = -1;
@@ -1569,7 +1594,7 @@ final class LayerIIIDecoder implements FrameDecoder {
               i = sfBandIndex[sfreq].l[i];
               for (; sfb < 8; sfb++) {
                 sb = sfBandIndex[sfreq].l[sfb + 1] - sfBandIndex[sfreq].l[sfb];
               i = sfBandIndex[sfreq].l[i];
               for (; sfb < 8; sfb++) {
                 sb = sfBandIndex[sfreq].l[sfb + 1] - sfBandIndex[sfreq].l[sfb];
-                for (; sb > 0; sb--) {
+                TERMINATE: for (; sb > 0; sb--) {
                   is_pos[i] = scalefac[1].l[sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
                   is_pos[i] = scalefac[1].l[sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
@@ -1584,12 +1609,11 @@ final class LayerIIIDecoder implements FrameDecoder {
             for (@LOC("THIS,LayerIIIDecoder.RO1") int j = 0; j < 3; j++) {
               @LOC("THIS,LayerIIIDecoder.RO1") int sfbcnt;
               sfbcnt = -1;
             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--) {
+              TERMINATE: for (sfb = 12; sfb >= 0; sfb--) {
                 temp = sfBandIndex[sfreq].s[sfb];
                 lines = sfBandIndex[sfreq].s[sfb + 1] - temp;
                 i = (temp << 2) - temp + (j + 1) * lines - 1;
                 temp = sfBandIndex[sfreq].s[sfb];
                 lines = sfBandIndex[sfreq].s[sfb + 1] - temp;
                 i = (temp << 2) - temp + (j + 1) * lines - 1;
-
-                while (lines > 0) {
+                TERMINATE: while (lines > 0) {
                   if (ro[1][i / 18][i % 18] != 0.0f) {
                     // MDM: in java, array access is very slow.
                     // Is quicker to compute div and mod values.
                   if (ro[1][i / 18][i % 18] != 0.0f) {
                     // MDM: in java, array access is very slow.
                     // Is quicker to compute div and mod values.
@@ -1608,7 +1632,7 @@ final class LayerIIIDecoder implements FrameDecoder {
                 temp = sfBandIndex[sfreq].s[sfb];
                 sb = sfBandIndex[sfreq].s[sfb + 1] - temp;
                 i = (temp << 2) - temp + j * sb;
                 temp = sfBandIndex[sfreq].s[sfb];
                 sb = sfBandIndex[sfreq].s[sfb + 1] - temp;
                 i = (temp << 2) - temp + j * sb;
-                for (; sb > 0; sb--) {
+                TERMINATE: for (; sb > 0; sb--) {
                   is_pos[i] = scalefac[1].s[j][sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
                   is_pos[i] = scalefac[1].s[j][sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
@@ -1626,8 +1650,7 @@ final class LayerIIIDecoder implements FrameDecoder {
               sfb = (temp << 2) - temp + j * sb;
               sb = sfBandIndex[sfreq].s[12] - temp2;
               i = (temp2 << 2) - temp2 + j * sb;
               sfb = (temp << 2) - temp + j * sb;
               sb = sfBandIndex[sfreq].s[12] - temp2;
               i = (temp2 << 2) - temp2 + j * sb;
-
-              for (; sb > 0; sb--) {
+              TERMINATE: for (; sb > 0; sb--) {
                 is_pos[i] = is_pos[sfb];
 
                 if (lsf) {
                 is_pos[i] = is_pos[sfb];
 
                 if (lsf) {
@@ -1644,7 +1667,7 @@ final class LayerIIIDecoder implements FrameDecoder {
           i = 31;
           ss = 17;
           sb = 0;
           i = 31;
           ss = 17;
           sb = 0;
-          while (i >= 0) {
+          TERMINATE: while (i >= 0) {
             if (ro[1][i][ss] != 0.0f) {
               sb = (i << 4) + (i << 1) + ss;
               i = -1;
             if (ro[1][i][ss] != 0.0f) {
               sb = (i << 4) + (i << 1) + ss;
               i = -1;
@@ -1664,7 +1687,7 @@ final class LayerIIIDecoder implements FrameDecoder {
           i = sfBandIndex[sfreq].l[i];
           for (; sfb < 21; sfb++) {
             sb = sfBandIndex[sfreq].l[sfb + 1] - sfBandIndex[sfreq].l[sfb];
           i = sfBandIndex[sfreq].l[i];
           for (; sfb < 21; sfb++) {
             sb = sfBandIndex[sfreq].l[sfb + 1] - sfBandIndex[sfreq].l[sfb];
-            for (; sb > 0; sb--) {
+            TERMINATE: for (; sb > 0; sb--) {
               is_pos[i] = scalefac[1].l[sfb];
               if (is_pos[i] != 7)
                 if (lsf)
               is_pos[i] = scalefac[1].l[sfb];
               if (is_pos[i] != 7)
                 if (lsf)
@@ -1675,7 +1698,7 @@ final class LayerIIIDecoder implements FrameDecoder {
             }
           }
           sfb = sfBandIndex[sfreq].l[20];
             }
           }
           sfb = sfBandIndex[sfreq].l[20];
-          for (sb = 576 - sfBandIndex[sfreq].l[21]; (sb > 0) && (i < 576); sb--) {
+          TERMINATE: for (sb = 576 - sfBandIndex[sfreq].l[21]; (sb > 0) && (i < 576); sb--) {
             is_pos[i] = is_pos[sfb]; // error here : i >=576
 
             if (lsf) {
             is_pos[i] = is_pos[sfb]; // error here : i >=576
 
             if (lsf) {
@@ -1753,10 +1776,10 @@ final class LayerIIIDecoder implements FrameDecoder {
       for (ss = 0; ss < 8; ss++) {
         @LOC("THIS,LayerIIIDecoder.SI1") int src_idx1 = sb18 + 17 - ss;
         @LOC("THIS,LayerIIIDecoder.SI1") int src_idx2 = sb18 + 18 + ss;
       for (ss = 0; ss < 8; ss++) {
         @LOC("THIS,LayerIIIDecoder.SI1") int src_idx1 = sb18 + 17 - ss;
         @LOC("THIS,LayerIIIDecoder.SI1") int src_idx2 = sb18 + 18 + ss;
-        @LOC("THIS,LayerIIIDecoder.OUT") float bu = out_1d[src_idx1];
-        @LOC("THIS,LayerIIIDecoder.OUT") float bd = out_1d[src_idx2];
-        out_1d[src_idx1] = (bu * cs[ss]) - (bd * ca[ss]);
-        out_1d[src_idx2] = (bd * cs[ss]) + (bu * ca[ss]);
+        @LOC("THIS,LayerIIIDecoder.OUT") float bu = inter[src_idx1];
+        @LOC("THIS,LayerIIIDecoder.OUT") float bd = inter[src_idx2];
+        inter[src_idx1] = (bu * cs[ss]) - (bd * ca[ss]);
+        inter[src_idx2] = (bd * cs[ss]) + (bu * ca[ss]);
       }
     }
   }
       }
     }
   }
@@ -1776,32 +1799,32 @@ final class LayerIIIDecoder implements FrameDecoder {
   private void hybrid(@LOC("THIS,LayerIIIDecoder.SI") int ch, @LOC("THIS,LayerIIIDecoder.SI") int gr) {
 
     @LOC("THIS,LayerIIIDecoder.SI1") int bt;
   private void hybrid(@LOC("THIS,LayerIIIDecoder.SI") int ch, @LOC("THIS,LayerIIIDecoder.SI") int gr) {
 
     @LOC("THIS,LayerIIIDecoder.SI1") int bt;
-    @LOC("SB") int sb18;
+    @LOC("THIS,LayerIIIDecoder.SI1") int sb18;
     // gr_info_s gr_info = (si.ch[ch].gr[gr]); //remove alias
     // @LOC("THIS,LayerIIIDecoder.TS") float[] tsOut; //remove alias
 
     // float[][] prvblk;
 
     for (sb18 = 0; sb18 < 576; sb18 += 18) {
     // gr_info_s gr_info = (si.ch[ch].gr[gr]); //remove alias
     // @LOC("THIS,LayerIIIDecoder.TS") float[] tsOut; //remove alias
 
     // float[][] prvblk;
 
     for (sb18 = 0; sb18 < 576; sb18 += 18) {
-      bt =
-          ((si.ch[ch].gr[gr].window_switching_flag != 0)
-              && (si.ch[ch].gr[gr].mixed_block_flag != 0) && (sb18 < 36)) ? 0
-              : si.ch[ch].gr[gr].block_type;
+      if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0)
+          && (sb18 < 36)) {
+        bt = 0;
+      } else {
+        bt = si.ch[ch].gr[gr].block_type;
+      }
 
       // tsOut = out_1d;
       // Modif E.B 02/22/99
 
       // tsOut = out_1d;
       // Modif E.B 02/22/99
-      for (@LOC("SB") int cc = 0; cc < 18; cc++)
+      for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
         tsOutCopy[cc] = out_1d[cc + sb18];
 
       inv_mdct(bt);
 
         tsOutCopy[cc] = out_1d[cc + sb18];
 
       inv_mdct(bt);
 
-      for (@LOC("SB") int cc = 0; cc < 18; cc++)
+      for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
         out_1d[cc + sb18] = tsOutCopy[cc];
       // Fin Modif
 
       // overlap addition
         out_1d[cc + sb18] = tsOutCopy[cc];
       // Fin Modif
 
       // overlap addition
-      // prvblk = prevblck; //eliminated unnecessary areas
-
       out_1d[0 + sb18] = rawout[0] + prevblck[ch][sb18 + 0];
       prevblck[ch][sb18 + 0] = rawout[18];
       out_1d[1 + sb18] = rawout[1] + prevblck[ch][sb18 + 1];
       out_1d[0 + sb18] = rawout[0] + prevblck[ch][sb18 + 0];
       prevblck[ch][sb18 + 0] = rawout[18];
       out_1d[1 + sb18] = rawout[1] + prevblck[ch][sb18 + 1];
@@ -1844,10 +1867,9 @@ final class LayerIIIDecoder implements FrameDecoder {
   /**
         *
         */
   /**
         *
         */
-  @LATTICE("THIS<SB,THIS<SS,SB<GLOBAL,SS<GLOBAL,SS*,SB*,THISLOC=THIS,GLOBALLOC=GLOBAL")
   private void do_downmix() {
   private void do_downmix() {
-    for (@LOC("SB") int sb = 0; sb < SSLIMIT; sb++) {
-      for (@LOC("SS") int ss = 0; ss < SSLIMIT; ss += 3) {
+    for (@LOC("THIS,LayerIIIDecoder.ISR") int sb = 0; sb < SSLIMIT; sb++) {
+      for (@LOC("THIS,LayerIIIDecoder.ISR") int ss = 0; ss < SSLIMIT; ss += 3) {
         lr[0][sb][ss] = (lr[0][sb][ss] + lr[1][sb][ss]) * 0.5f;
         lr[0][sb][ss + 1] = (lr[0][sb][ss + 1] + lr[1][sb][ss + 1]) * 0.5f;
         lr[0][sb][ss + 2] = (lr[0][sb][ss + 2] + lr[1][sb][ss + 2]) * 0.5f;
         lr[0][sb][ss] = (lr[0][sb][ss] + lr[1][sb][ss]) * 0.5f;
         lr[0][sb][ss + 1] = (lr[0][sb][ss + 1] + lr[1][sb][ss + 1]) * 0.5f;
         lr[0][sb][ss + 2] = (lr[0][sb][ss + 2] + lr[1][sb][ss + 2]) * 0.5f;
@@ -2354,7 +2376,7 @@ final class LayerIIIDecoder implements FrameDecoder {
     }
   }
 
     }
   }
 
-  @LATTICE("CH")
+  @LATTICE("CH<TEMP,TEMP*")
   static class III_side_info_t {
 
     @LOC("CH")
   static class III_side_info_t {
 
     @LOC("CH")
@@ -2841,27 +2863,6 @@ final class LayerIIIDecoder implements FrameDecoder {
   /***************************************************************/
   /* END OF INV_MDCT */
   /***************************************************************/
   /***************************************************************/
   /* END OF INV_MDCT */
   /***************************************************************/
-  @LATTICE("N<VAR")
-  class Sftable {
-    @LOC("VAR")
-    public int[] l;
-    @LOC("VAR")
-    public int[] s;
-
-    public Sftable() {
-      l = new int[5];
-      s = new int[3];
-    }
-
-    @LATTICE("THIS<IN,THISLOC=THIS")
-    public Sftable(@DELEGATE @LOC("IN") int[] thel, @DELEGATE @LOC("IN") int[] thes) {
-      l = thel;
-      s = thes;
-    }
-  }
-
-  @LOC("F")
-  public Sftable sftable;
 
   public static final int nr_of_sfb_block[][][] = {
       { { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } },
 
   public static final int nr_of_sfb_block[][][] = {
       { { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } },