having new variable 'inter' in-between "reorder/antialias" and "hybrid" in order...
[IRC.git] / Robust / src / Tests / ssJava / mp3decoder / LayerIIIDecoder.java
index 8d9bb67d876d6b8a3e15d65064ff4dd036f3104d..8714428bb07d9728353fddea7c47c1e4c08cc26b 100644 (file)
@@ -4,7 +4,7 @@
  * 18/06/01  Michael Scheerer,  Fixed bugs which causes
  *           negative indexes in method huffmann_decode and in method 
  *           dequanisize_sample.
- *\r
+ *
  * 16/07/01  Michael Scheerer, Catched a bug in method
  *           huffmann_decode, which causes an outOfIndexException.
  *           Cause : Indexnumber of 24 at SfBandIndex,
  *----------------------------------------------------------------------
  */
 
-
 /**
  * Class Implementing Layer 3 Decoder.
  * 
  * @since 0.0
  */
-@LATTICE("FS<BR,BR<SF,LR<IR,IR<IP,IP<SF,LR<K,K<F,LR<VAR,LR<RO,RO<F,VAR<F,VAR<RAW,CSH<F,SAM<O,O<F,NS<SI,SI<CH,SFREQ<H,MAX<H,H<CH,FLCH<CH,FLCH<WC,SF<SFT,SFT<NS,NS<C,TS<RAW,O<TS,LY<F,NZ<VAR,C*,FS*,IP*,IR*,LR*,K*,O*,TS*,TS<BT,BT<GR,GR<SI,LR<S,S<ME,ME<CH,K<SH,K<LSF,LSF<H,LSF<CH,IP<SH,SH<J,J<S,S<ME,SH<SFREQ,SH<RO,IP<TMP2,LSF<H,TMP2<F,J*,SH*,O<RO2,RO2<RO3,RO3<RO4,RO4<RO5,O<RO1,RO1<RO5,RO5<RO6,RO6<RO7,RO7<RO8,RO8<RO9,RO9<SFREQ,RO9<F,RO1*,RO4*,RO5*,RO6*,RO9*,VAR<HD3,HD3<HD2,HD2<HD1,HD1<SI,HD1<SFREQ,HD1<RAW,HD2*,HD3*,SFB<GLSFD5,GLSFD5<NS,GLSFD5<GLSFD4,NS<GLSFD3,GLSFD4<GLSFD3,GLSFD3<GLSFD2,GLSFD2<GLSFD1,GLSFD1<SI,GLSFD5*,SF<GLSFF4,GLSFF4<GLSFF3,GLSFF3<GLSFF2,GLSFF2<GLSFF1,GLSFF1<SI,GLSFF4*,GLSFF3*,GLSFF2*,SF<GSF5,GSF5<GSF4,GSF4<GSF3,GSF3<GSF2,GSF2<GSF1,GSF1<SI,GSF5*,GSF4*,O<D3,D3<D2,D2<D1,D1<FLCH,D1*,D2*")
-//4th line added for hybrid.
-//5th added for stereo
-//6th added for reorder method
-//7th added for huffman_decode method
-//8th added for get_LSF_scale_data
-//9th added for get_LSF_scale_factors
-//10th added for get_scale_factors
-//llth added for decode
-@METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
+// @LATTICE("FS<BR,BR<SF,LR<IR,IR<IP,IP<SF,LR<K,K<F,LR<VAR,LR<RO,RO<F,VAR<F,VAR<RAW,CSH<F,SAM<O,O<F,NS<SI,SI<CH,SFREQ<H,MAX<H,H<CH,FLCH<CH,FLCH<WC,SF<SFT,SFT<NS,NS<C,TS<RAW,O<TS,LY<F,NZ<VAR,C*,FS*,IP*,IR*,LR*,K*,O*,TS*,TS<BT,BT<GR,GR<SI,LR<S,S<ME,ME<CH,K<SH,K<LSF,LSF<H,LSF<CH,IP<SH,SH<J,J<S,S<ME,SH<SFREQ,SH<RO,IP<TMP2,LSF<H,TMP2<F,J*,SH*,O<RO2,RO2<RO3,RO3<RO4,RO4<RO5,O<RO1,RO1<RO5,RO5<RO6,RO6<RO7,RO7<RO8,RO8<RO9,RO9<SFREQ,RO9<F,RO1*,RO4*,RO5*,RO6*,RO9*,VAR<HD3,HD3<HD2,HD2<HD1,HD1<SI,HD1<SFREQ,HD1<RAW,HD2*,HD3*,SFB<GLSFD5,GLSFD5<NS,GLSFD5<GLSFD4,NS<GLSFD3,GLSFD4<GLSFD3,GLSFD3<GLSFD2,GLSFD2<GLSFD1,GLSFD1<SI,GLSFD5*,SF<GLSFF4,GLSFF4<GLSFF3,GLSFF3<GLSFF2,GLSFF2<GLSFF1,GLSFF1<SI,GLSFF4*,GLSFF3*,GLSFF2*,SF<GSF5,GSF5<GSF4,GSF4<GSF3,GSF3<GSF2,GSF2<GSF1,GSF1<SI,GSF5*,GSF4*,O<D3,D3<D2,D2<D1,D1<FLCH,D1*,D2*")
+// 4th line added for hybrid.
+// 5th added for stereo
+// 6th added for reorder method
+// 7th added for huffman_decode method
+// 8th added for get_LSF_scale_data
+// 9th added for get_LSF_scale_factors
+// 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("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 {
-  @LOC("F") final double d43 = (4.0 / 3.0);
-  @LOC("SFT") public int[] scalefac_buffer;
+  static final double d43 = (4.0 / 3.0);
+  @LOC("SFB")
+  public int[] scalefac_buffer;
 
   // MDM: removed, as this wasn't being used.
   // private float CheckSumOut1d = 0.0f;
-  @LOC("CSH") private int CheckSumHuff = 0;
-  @LOC("VAR") private int[] is_1d;
-  @LOC("VAR") private float[][][] ro;
-  @LOC("LR") private float[][][] lr;
-  @LOC("O") private float[] out_1d; // 576 samples
-  @LOC("VAR") private float[][] prevblck;
-  @LOC("K") private float[][] k;
-  @LOC("NZ") private int[] nonzero;
-  @LOC("F") private Bitstream stream;
-  @LOC("H") private Header header;
-  @LOC("F") private SynthesisFilter filter1;
-  @LOC("F") private SynthesisFilter filter2;
-  @LOC("F") private Obuffer buffer; // output buffer
-  @LOC("WC") private int which_channels;
-  @LOC("BR") private BitReserve br;
-  @LOC("SI") private III_side_info_t si;
-
-//  @LOC("SBT") private temporaire2[] III_scalefac_t;
-  @LOC("SF") private temporaire2[] scalefac;
+  @LOC("SI1")
+  private int CheckSumHuff = 0;
+  @LOC("IS1D")
+  private int[] is_1d;
+  @LOC("RO")
+  private float[][][] ro;
+  @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;
+  @LOC("LR")
+  private float[][] k;
+  @LOC("NZ")
+  private int[] nonzero;
+  @LOC("FT")
+  private SynthesisFilter filter1;
+  @LOC("FT")
+  private SynthesisFilter filter2;
+  // @LOC("SP")
+  // private Obuffer buffer; // output buffer
+  @LOC("CH0")
+  private int which_channels;
+  @LOC("BR")
+  private BitReserve br;
+  @LOC("SI")
+  private III_side_info_t si;
+
+  // @LOC("SBT") private temporaire2[] III_scalefac_t;
+  @LOC("SF2")
+  private final temporaire2[] scalefac;
   // private III_scalefac_t scalefac;
 
-  @LOC("MAX") private int max_gr;
-  @LOC("FS") private int frame_start;
-  @LOC("F") private int part2_start;
-  @LOC("CH") private int channels;
-  @LOC("FLCH") private int first_channel;
-  @LOC("FLCH") private int last_channel;
-  @LOC("SFREQ") private int sfreq;
+  @LOC("CH0")
+  private int max_gr;
+  @LOC("CH0")
+  private int frame_start;
+  // @LOC("SI1") private int part2_start;
+  @LOC("CH0")
+  private final int channels;
+  @LOC("CH0")
+  private int first_channel;
+  @LOC("CH0")
+  private int last_channel;
+  @LOC("SBI")
+  private int sfreq;
+
+  @LOC("BR1")
+  private int part2_start;
+
+  @LOC("INIT")
+  private boolean initialized = false;
+
+  // constructor for the linear type system
+  public LayerIIIDecoder(@DELEGATE @LOC("VAR") SynthesisFilter filtera,
+      @DELEGATE @LOC("VAR") SynthesisFilter filterb, @LOC("VAR") int which_ch0) {
+
+    filter1 = filtera;
+    filter2 = filterb;
 
-  /**
-   * Constructor.
-   */
-  // REVIEW: these constructor arguments should be moved to the
-  // decodeFrame() method, where possible, so that one
-  @LATTICE("THIS<VAR,THIS<I,THIS<J,J<CH,I*,J*,CH*,THISLOC=THIS,GLOBALLOC=THIS") 
-  public LayerIIIDecoder(@LOC("VAR") Bitstream stream0, @LOC("VAR") Header header0, @LOC("VAR") SynthesisFilter filtera,
-      @LOC("VAR") SynthesisFilter filterb, @LOC("VAR") Obuffer buffer0, @LOC("VAR") int which_ch0) {
-    
     huffcodetab.inithuff();
     is_1d = new int[SBLIMIT * SSLIMIT + 4];
     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];
 
-    //removes unnecessary aliases
+    // removes unnecessary aliases
     // III_scalefact_t
-//    III_scalefac_t = new temporaire2[2];
-//    III_scalefac_t[0] = new temporaire2();
-//    III_scalefac_t[1] = new temporaire2();
-//    scalefac = III_scalefac_t;
-    
-    scalefac=new temporaire2[2];
+    // III_scalefac_t = new temporaire2[2];
+    // III_scalefac_t[0] = new temporaire2();
+    // III_scalefac_t[1] = new temporaire2();
+    // scalefac = III_scalefac_t;
+
+    scalefac = new temporaire2[2];
     scalefac[0] = new temporaire2();
     scalefac[1] = new temporaire2();
-    
+
     // L3TABLE INIT
 
     sfBandIndex = new SBI[9]; // SZD: MPEG2.5 +3 indices
@@ -173,22 +201,14 @@ final class LayerIIIDecoder implements FrameDecoder {
         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
 
-    stream = stream0;
-    header = header0;
-    filter1 = filtera;
-    filter2 = filterb;
-    buffer = buffer0;
-    which_channels = which_ch0;
+  }
+
+  @LATTICE("THIS<C,THIS<IN,C*,THISLOC=THIS")
+  private void init(@LOC("THIS,LayerIIIDecoder.HD1") Header header) {
 
     frame_start = 0;
     channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
@@ -220,20 +240,188 @@ final class LayerIIIDecoder implements FrameDecoder {
       first_channel = last_channel = 0;
     }
 
-    for (@LOC("CH") int ch = 0; ch < 2; ch++)
-      for (@LOC("J") 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;
 
-    br = new BitReserve();
     si = new III_side_info_t();
+
+    initialized = true;
+
   }
 
+  /**
+   * Constructor.
+   */
+  // REVIEW: these constructor arguments should be moved to the
+  // decodeFrame() method, where possible, so that one
+  // @LATTICE("THIS<VAR,THIS<I,THIS<J,J<CH,I*,J*,CH*,THISLOC=THIS,GLOBALLOC=THIS")
+  // public LayerIIIDecoder(@LOC("VAR") Header header0, @LOC("VAR")
+  // SynthesisFilter filtera,
+  // @LOC("VAR") SynthesisFilter filterb, @LOC("VAR") int which_ch0) {
+  //
+  // huffcodetab.inithuff();
+  // is_1d = new int[SBLIMIT * SSLIMIT + 4];
+  // ro = new float[2][SBLIMIT][SSLIMIT];
+  // lr = new float[2][SBLIMIT][SSLIMIT];
+  // out_1d = new float[SBLIMIT * SSLIMIT];
+  // prevblck = new float[2][SBLIMIT * SSLIMIT];
+  // k = new float[2][SBLIMIT * SSLIMIT];
+  // nonzero = new int[2];
+  //
+  // // removes unnecessary aliases
+  // // III_scalefact_t
+  // // III_scalefac_t = new temporaire2[2];
+  // // III_scalefac_t[0] = new temporaire2();
+  // // III_scalefac_t[1] = new temporaire2();
+  // // scalefac = III_scalefac_t;
+  //
+  // scalefac = new temporaire2[2];
+  // scalefac[0] = new temporaire2();
+  // scalefac[1] = new temporaire2();
+  //
+  // // L3TABLE INIT
+  //
+  // sfBandIndex = new SBI[9]; // SZD: MPEG2.5 +3 indices
+  // @LOC("VAR") int[] l0 =
+  // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+  // 284, 336, 396,
+  // 464, 522, 576 };
+  // @LOC("VAR") int[] s0 = { 0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132,
+  // 174, 192 };
+  // @LOC("VAR") int[] l1 =
+  // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 114, 136, 162, 194, 232,
+  // 278, 330, 394,
+  // 464, 540, 576 };
+  // @LOC("VAR") int[] s1 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136,
+  // 180, 192 };
+  // @LOC("VAR") int[] l2 =
+  // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+  // 284, 336, 396,
+  // 464, 522, 576 };
+  // @LOC("VAR") int[] s2 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134,
+  // 174, 192 };
+  //
+  // @LOC("VAR") int[] l3 =
+  // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196,
+  // 238, 288, 342,
+  // 418, 576 };
+  // @LOC("VAR") int[] s3 = { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136,
+  // 192 };
+  // @LOC("VAR") int[] l4 =
+  // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190,
+  // 230, 276, 330,
+  // 384, 576 };
+  // @LOC("VAR") int[] s4 = { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126,
+  // 192 };
+  // @LOC("VAR") int[] l5 =
+  // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240,
+  // 296, 364, 448,
+  // 550, 576 };
+  // @LOC("VAR") int[] s5 = { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138,
+  // 180, 192 };
+  // // SZD: MPEG2.5
+  // @LOC("VAR") int[] l6 =
+  // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+  // 284, 336, 396,
+  // 464, 522, 576 };
+  // @LOC("VAR") int[] s6 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134,
+  // 174, 192 };
+  // @LOC("VAR") int[] l7 =
+  // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238,
+  // 284, 336, 396,
+  // 464, 522, 576 };
+  // @LOC("VAR") int[] s7 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134,
+  // 174, 192 };
+  // @LOC("VAR") int[] l8 =
+  // { 0, 12, 24, 36, 48, 60, 72, 88, 108, 132, 160, 192, 232, 280, 336, 400,
+  // 476, 566, 568,
+  // 570, 572, 574, 576 };
+  // @LOC("VAR") int[] s8 = { 0, 8, 16, 24, 36, 52, 72, 96, 124, 160, 162, 164,
+  // 166, 192 };
+  //
+  // sfBandIndex[0] = new SBI(l0, s0);
+  // sfBandIndex[1] = new SBI(l1, s1);
+  // sfBandIndex[2] = new SBI(l2, s2);
+  //
+  // sfBandIndex[3] = new SBI(l3, s3);
+  // sfBandIndex[4] = new SBI(l4, s4);
+  // sfBandIndex[5] = new SBI(l5, s5);
+  // // SZD: MPEG2.5
+  // sfBandIndex[6] = new SBI(l6, s6);
+  // sfBandIndex[7] = new SBI(l7, s7);
+  // sfBandIndex[8] = new SBI(l8, s8);
+  // // END OF L3TABLE INIT
+  //
+  // if (reorder_table == null) { // SZD: generate LUT
+  // reorder_table = new int[9][];
+  // for (@LOC("I") int i = 0; i < 9; i++)
+  // 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
+  //
+  // // header = header0;
+  // filter1 = filtera;
+  // filter2 = filterb;
+  // // buffer = buffer0;
+  // which_channels = which_ch0;
+  //
+  // frame_start = 0;
+  // channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
+  // max_gr = (header.version() == Header.MPEG1) ? 2 : 1;
+  //
+  // sfreq =
+  // header.sample_frequency()
+  // + ((header.version() == Header.MPEG1) ? 3 : (header.version() ==
+  // Header.MPEG25_LSF) ? 6
+  // : 0); // SZD
+  //
+  // if (channels == 2) {
+  // switch (which_channels) {
+  // case OutputChannels.LEFT_CHANNEL:
+  // case OutputChannels.DOWNMIX_CHANNELS:
+  // first_channel = last_channel = 0;
+  // break;
+  //
+  // case OutputChannels.RIGHT_CHANNEL:
+  // first_channel = last_channel = 1;
+  // break;
+  //
+  // case OutputChannels.BOTH_CHANNELS:
+  // default:
+  // first_channel = 0;
+  // last_channel = 1;
+  // break;
+  // }
+  // } else {
+  // first_channel = last_channel = 0;
+  // }
+  //
+  // for (@LOC("CH") int ch = 0; ch < 2; ch++)
+  // for (@LOC("J") int j = 0; j < 576; j++)
+  // prevblck[ch][j] = 0.0f;
+  //
+  // nonzero[0] = nonzero[1] = 576;
+  //
+  // br = new BitReserve();
+  // si = new III_side_info_t();
+  // }
+
   /**
    * Notify decoder that a seek is being made.
    */
-  @LATTICE("THIS<J,J<CH,J*,CH*,THISLOC=THIS,GLOBALLOC=THIS") 
+  @LATTICE("THIS<J,J<CH,J*,CH*,THISLOC=THIS,GLOBALLOC=THIS")
   public void seek_notify() {
     frame_start = 0;
     for (@LOC("CH") int ch = 0; ch < 2; ch++)
@@ -242,8 +430,8 @@ final class LayerIIIDecoder implements FrameDecoder {
     br = new BitReserve();
   }
 
-  public void decodeFrame() {
-    decode();
+  public void decodeFrame(@LOC("IN") Header header) {
+    decode(header);
   }
 
   /**
@@ -252,121 +440,128 @@ final class LayerIIIDecoder implements FrameDecoder {
 
   // subband samples are buffered and passed to the
   // SynthesisFilter in one go.
-  @LOC("SAM") private float[] samples1 = new float[32];
-  @LOC("SAM") private float[] samples2 = new float[32];
-
-  /* location hierarchy of decode()
-{header} {stream} {si}
-{br, flush_main, main_data_end,frame_start,nSlots,bytes_to_discard}* 
-{gr,max_gr} // granule
-{ch,channels,first_channel, last_channel, which_channels} // channel
-{part2_start} 
-{sb18, ss}
-{out_1d}*
-{sb}*
-{samples1,sample2} {filter1,filter2}
+  @LOC("SP")
+  private float[] samples1 = new float[32];
+  @LOC("SP")
+  private float[] samples2 = new float[32];
+
+  /*
+   * location hierarchy of decode() {header} {stream} {si} {br, flush_main,
+   * main_data_end,frame_start,nSlots,bytes_to_discard}* {gr,max_gr} // granule
+   * {ch,channels,first_channel, last_channel, which_channels} // channel
+   * {part2_start} {sb18, ss} {out_1d}* {sb}* {samples1,sample2}
+   * {filter1,filter2}
    */
-  @LATTICE("BYTE<THIS,THIS<MAIN,MAIN<VAR,THIS<GR,GR<VAR,BYTE*,GR*,THISLOC=THIS,GLOBALLOC=VAR")
-  public void decode() {
-    @LOC("VAR") int nSlots = header.slots();
-    @LOC("VAR") int flush_main;
-    @LOC("GR") int gr;
-    @LOC("THIS,LayerIIIDecoder.D1") int ch;
-    @LOC("THIS,LayerIIIDecoder.D2") int ss;
-    @LOC("THIS,LayerIIIDecoder.D3") int sb;
-    @LOC("THIS,LayerIIIDecoder.D2") int sb18;
-    @LOC("MAIN") int main_data_end;
-    @LOC("BYTE") int bytes_to_discard;
-    @LOC("VAR") int i;
-
-    get_side_info();
-
-    for (i = 0; i < nSlots; i++)
-      br.hputbuf(stream.get_bits(8)); // br < stream
-
-    // br < main_data_end
-    main_data_end = br.hsstell() >>> 3; // of previous frame  
-     
-
-    if ((flush_main = (br.hsstell() & 7)) != 0) { // flush_main < br
-      br.hgetbits(8 - flush_main); // br < flush_main
-      main_data_end++;  // main_data_end*
+  // @LATTICE("BYTE<THIS,THIS<MAIN,MAIN<VAR,THIS<GR,GR<VAR,BYTE*,GR*,THISLOC=THIS,GLOBALLOC=VAR")
+  @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);
     }
 
-    // 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;
+    // 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();
+    //
 
-    // frame_start should be *
-    frame_start += nSlots;
+    @LOC("THIS,LayerIIIDecoder.HD1") int nSlots = header.slots();
 
-    if (bytes_to_discard < 0)
-      return;
+    @LOC("THIS,LayerIIIDecoder.CH0") int gr;
+    @LOC("THIS,LayerIIIDecoder.CH0") int ch;
 
-    if (main_data_end > 4096) { // main_data_end should be > than 'frame_start' and 'br'
-      frame_start -= 4096;
-      br.rewindNbytes(4096);
-    }
+    @LOC("THIS,LayerIIIDecoder.CH0") int ss;
+    @LOC("THIS,LayerIIIDecoder.CH0") int sb;
+    @LOC("THIS,LayerIIIDecoder.CH0") int sb18;
+
+    @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);
+    br = header.getBitReserve();
+
+    @LOC("THIS,LayerIIIDecoder.HD1") int version = header.version();
 
-    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++) {
+        // part2_start = br.hsstell();
+        @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_start_local = br.hsstell();
 
-        // 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
+        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
           // MPEG-2 LSF, SZD: MPEG-2.5 LSF
-          get_LSF_scale_factors(ch, gr); // no need to care from this side
+          get_LSF_scale_factors(header, 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_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
+        dequantize_sample(/* ro[ch], */ch, gr); // no need to care from this
+                                                // side
       }
 
-      stereo(gr); // no need to care from this side
+      stereo(header, 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];
+
+        // float CheckSumOut1d=0;
+        // for (int hb = 0;hb<576;hb++) {
+        // CheckSumOut1d = CheckSumOut1d + out_1d[hb];
+        // }
         // System.out.println("CheckSumOut1d = "+CheckSumOut1d);
 
+        for (@LOC("THIS,LayerIIIDecoder.SI1") int index = 0; index < 576; index++) {
+          out_1d[index] = inter[index];
+        }
+
         hybrid(ch, gr);
 
-        // for (int hb = 0;hb<576;hb++) CheckSumOut1d = CheckSumOut1d +
-        // out_1d[hb];
+        // float CheckSumOut1d=0;
+        // for (int hb = 0;hb<576;hb++) {
+        // CheckSumOut1d = CheckSumOut1d + 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;
@@ -376,7 +571,7 @@ final class LayerIIIDecoder implements FrameDecoder {
               sb++; // sb should be loc*
             }
             filter1.input_samples(samples1);
-            filter1.calculate_pcm_samples(buffer);
+            filter1.calculate_pcm_samples();
           }
         } else {
           for (ss = 0; ss < SSLIMIT; ss++) { // Polyphase synthesis
@@ -387,7 +582,7 @@ final class LayerIIIDecoder implements FrameDecoder {
               sb++;
             }
             filter2.input_samples(samples2);
-            filter2.calculate_pcm_samples(buffer);
+            filter2.calculate_pcm_samples();
           }
 
         }
@@ -398,7 +593,7 @@ final class LayerIIIDecoder implements FrameDecoder {
     // if (counter < 609)
     // {
     counter++; // count should be loc*
-    buffer.write_buffer(1); // buffer!!!
+    // buffer.write_buffer(1); // buffer!!!
     // }
     // else if (counter == 609)
     // {
@@ -415,44 +610,58 @@ 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;
-    if (header.version() == Header.MPEG1) {
+  @LATTICE("OUT<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  private boolean get_side_info(@LOC("THIS,LayerIIIDecoder.HD1") Header header) {
+
+    @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.TEMP") SideInfoBuffer sib =
+        header.getSideInfoBuffer();
+    @LOC("THIS,LayerIIIDecoder.SF1") int version = header.version();
+
+    @LOC("THIS,LayerIIIDecoder.SI0") int ch;
+    @LOC("THIS,LayerIIIDecoder.SI0") int gr;
+    // System.out.println("#get_side_info");
+    if (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);
-          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].table_select[0] = stream.get_bits(5);
-            si.ch[ch].gr[gr].table_select[1] = stream.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);
-
-            // Set region_count parameters since they are implicit in this case.
+          // 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);
+          @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].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] = 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.
 
             if (si.ch[ch].gr[gr].block_type == 0) {
               // Side info bad: block_type == 0 in split block
@@ -464,47 +673,54 @@ 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].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);
         }
       }
 
     } 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);
 
-        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 = 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
@@ -517,16 +733,19 @@ 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[gr].window_switching_flag = cond;
+        //
 
-        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<channels; ch++)
     } // if (header.version() == MPEG1)
     return true;
@@ -536,24 +755,27 @@ final class LayerIIIDecoder implements FrameDecoder {
         *
         */
   @LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
-  private void get_scale_factors(@LOC("IN") int ch, @LOC("IN") int gr) {
-    @LOC("THIS,LayerIIIDecoder.GSF4") int sfb;
-    @LOC("THIS,LayerIIIDecoder.GSF5") int window;
-    @LOC("THIS,LayerIIIDecoder.GSF1") gr_info_s gr_info = (si.ch[ch].gr[gr]);
-    @LOC("THIS,LayerIIIDecoder.GSF2") int scale_comp = gr_info.scalefac_compress;
-    @LOC("THIS,LayerIIIDecoder.GSF3") int length0 = slen[0][scale_comp];
-    @LOC("THIS,LayerIIIDecoder.GSF3") int length1 = slen[1][scale_comp];
-
-    if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)) {
-      if ((gr_info.mixed_block_flag) != 0) { // MIXED
+  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
+
+    @LOC("THIS,LayerIIIDecoder.NS") int sfb;
+    @LOC("THIS,LayerIIIDecoder.NS") int window;
+    @LOC("THIS,LayerIIIDecoder.NS") int scale_comp = si.ch[ch].gr[gr].scalefac_compress;
+    @LOC("THIS,LayerIIIDecoder.NS") int length0 = slen[0][scale_comp];
+    @LOC("THIS,LayerIIIDecoder.NS") int length1 = slen[1][scale_comp];
+
+    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) { // MIXED
         for (sfb = 0; sfb < 8; sfb++)
-          scalefac[ch].l[sfb] = br.hgetbits(slen[0][gr_info.scalefac_compress]);
+          scalefac[ch].l[sfb] = br.hgetbits(slen[0][si.ch[ch].gr[gr].scalefac_compress]);
         for (sfb = 3; sfb < 6; sfb++)
           for (window = 0; window < 3; window++)
-            scalefac[ch].s[window][sfb] = br.hgetbits(slen[0][gr_info.scalefac_compress]);
+            scalefac[ch].s[window][sfb] = br.hgetbits(slen[0][si.ch[ch].gr[gr].scalefac_compress]);
         for (sfb = 6; sfb < 12; sfb++)
           for (window = 0; window < 3; window++)
-            scalefac[ch].s[window][sfb] = br.hgetbits(slen[1][gr_info.scalefac_compress]);
+            scalefac[ch].s[window][sfb] = br.hgetbits(slen[1][si.ch[ch].gr[gr].scalefac_compress]);
         for (sfb = 12, window = 0; window < 3; window++)
           scalefac[ch].s[window][sfb] = 0;
 
@@ -642,29 +864,35 @@ final class LayerIIIDecoder implements FrameDecoder {
         */
   // MDM: new_slen is fully initialized before use, no need
   // to reallocate array.
-  @LOC("NS") private final int[] new_slen = new int[4];
-  
-  @LATTICE("THIS<IN,THIS<I,THIS<X,THIS<M,I*,X*,M*,THISLOC=THIS,GLOBALLOC=THIS")
-  private void get_LSF_scale_data(@LOC("IN") int ch, @LOC("IN") int gr) {
+  @LOC("NS")
+  private final int[] new_slen = new int[4];
 
-    @LOC("THIS,LayerIIIDecoder.GLSFD2") int scalefac_comp;
-    @LOC("THIS,LayerIIIDecoder.GLSFD3") int int_scalefac_comp;
-    @LOC("IN") int mode_ext = header.mode_extension();
-    @LOC("M") int m;
-    @LOC("THIS,LayerIIIDecoder.GLSFD4") int blocktypenumber;
-    @LOC("THIS,LayerIIIDecoder.GLSFD4") int blocknumber = 0;
+  // ssjava
+  @LATTICE("M<THIS,THIS<IN,THIS<C,C*,M*,THISLOC=THIS,GLOBALLOC=THIS")
+  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.GLSFD1") gr_info_s gr_info = (si.ch[ch].gr[gr]);
+    @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
 
-    scalefac_comp = gr_info.scalefac_compress;
+    @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.NS") int blocktypenumber;
 
-    if (gr_info.block_type == 2) {
-      if (gr_info.mixed_block_flag == 0)
+    @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 blocknumber =
+        0;
+
+    if (si.ch[ch].gr[gr].block_type == 2) {
+      if (si.ch[ch].gr[gr].mixed_block_flag == 0) {
         blocktypenumber = 1;
-      else if (gr_info.mixed_block_flag == 1)
+      } else if (si.ch[ch].gr[gr].mixed_block_flag == 1) {
         blocktypenumber = 2;
-      else
+      } else {
         blocktypenumber = 0;
+      }
     } else {
       blocktypenumber = 0;
     }
@@ -727,13 +955,14 @@ final class LayerIIIDecoder implements FrameDecoder {
       }
     }
 
-    for (@LOC("X") 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;
-    for (@LOC("I") int i = 0; i < 4; i++) {
-      for (@LOC("THIS,LayerIIIDecoder.GLSFD5") 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++;
 
@@ -745,16 +974,18 @@ final class LayerIIIDecoder implements FrameDecoder {
         *
         */
   @LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
-  private void get_LSF_scale_factors(@LOC("IN") int ch, @LOC("IN") int gr) {
-    @LOC("THIS,LayerIIIDecoder.GLSFF4") int m = 0;
-    @LOC("THIS,LayerIIIDecoder.GLSFF2") int sfb;
-    @LOC("THIS,LayerIIIDecoder.GLSFF3") int window;
-    @LOC("THIS,LayerIIIDecoder.GLSFF1") gr_info_s gr_info = (si.ch[ch].gr[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 window;
+    // gr_info_s gr_info = (si.ch[ch].gr[gr]); // remove alias
 
-    get_LSF_scale_data(ch, gr);
+    get_LSF_scale_data(header, ch, gr);
 
-    if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)) {
-      if (gr_info.mixed_block_flag != 0) { // MIXED
+    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) { // MIXED
         for (sfb = 0; sfb < 8; sfb++) {
           scalefac[ch].l[sfb] = scalefac_buffer[m];
           m++;
@@ -794,28 +1025,41 @@ final class LayerIIIDecoder implements FrameDecoder {
   /**
         *
         */
-  @LOC("LY") int[] x = { 0 };
-  @LOC("F") int[] y = { 0 };
-  @LOC("LY") int[] v = { 0 };
-  @LOC("LY") int[] w = { 0 };
-
-  @LATTICE("H<I,I<R,R<B1,B1<B,B<THIS,THIS<IN,I*,THISLOC=THIS,GLOBALLOC=IN")
-  private void huffman_decode(@LOC("IN") int ch, @LOC("IN") int gr) {
-    x[0] = 0;
-    y[0] = 0;
-    v[0] = 0;
-    w[0] = 0;
-
-    @LOC("THIS,LayerIIIDecoder.HD1") int part2_3_end = part2_start + si.ch[ch].gr[gr].part2_3_length;
-    @LOC("THIS,LayerIIIDecoder.HD2") int num_bits;
-    @LOC("R") int region1Start;
-    @LOC("R") int region2Start;
-    @LOC("THIS,LayerIIIDecoder.HD3") int index;
-
-    @LOC("B") int buf;
-    @LOC("B1") int buf1;
-
-    @LOC("H") huffcodetab h;
+  // @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 };
+
+  @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 =
+        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 index;
+
+    @LOC("THIS,LayerIIIDecoder.SI1") int buf;
+    @LOC("THIS,LayerIIIDecoder.SI1") int buf1;
 
     // Find region boundary for short block case
 
@@ -823,8 +1067,8 @@ final class LayerIIIDecoder implements FrameDecoder {
 
       // Region2.
       // MS: Extrahandling for 8KHZ
-      region1Start = (sfreq == 8) ? 72 : 36; // sfb[9/3]*3=36 or in case 8KHZ =
-                                             // 72
+      region1Start = (sfreq == 8) ? 72 : 36; // sfb[9/3]*3=36 or in case
+                                             // 8KHZ = 72
       region2Start = 576; // No Region2 for short block case
 
     } else { // Find region boundary for long block case
@@ -841,15 +1085,22 @@ final class LayerIIIDecoder implements FrameDecoder {
 
     index = 0;
     // 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]];
+    TERMINATE: for (@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i +=
+        2) {
+
+      @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]];
+      } else if (i < region2Start) {
+        htIdx = si.ch[ch].gr[gr].table_select[1];
+        // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[1]];
+      } else {
+        htIdx = si.ch[ch].gr[gr].table_select[2];
+        // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[2]];
+      }
 
-      huffcodetab.huffman_decoder(h, x, y, v, w, br);
+      huffcodetab.huffman_decoder(htIdx, 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);
 
@@ -857,16 +1108,18 @@ final class LayerIIIDecoder implements FrameDecoder {
       is_1d[index++] = y[0];
 
       CheckSumHuff = CheckSumHuff + x[0] + y[0];
-      // System.out.println("x = "+x[0]+" y = "+y[0]);
+      // System.out.println("x = " + x[0] + " y = " + y[0]);
     }
 
     // Read count1 area
-    h = huffcodetab.ht[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();
 
-    while ((num_bits < part2_3_end) && (index < 576)) {
+    TERMINATE: while ((num_bits < part2_3_end) && (index < 576)) {
 
-      huffcodetab.huffman_decoder(h, x, y, v, w, br);
+      huffcodetab.huffman_decoder(htIdx, x, y, v, w, br);
 
       is_1d[index++] = v[0];
       is_1d[index++] = w[0];
@@ -904,10 +1157,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;
@@ -923,23 +1183,32 @@ final class LayerIIIDecoder implements FrameDecoder {
   /**
         *
         */
-  @LATTICE("OUT<QUO,QUO<REST,REST<IDX,IDX<VAR,VAR<CB,CB<J,CB<GR,GR<IN,J<IN,QUO*,REST*,IDX*,CB*,J*,THISLOC=IN,GLOBALLOC=IN")
-  private void dequantize_sample(@LOC("OUT") float xr[][], @LOC("IN") int ch, @LOC("IN") int gr) {
-    @LOC("GR") gr_info_s gr_info = (si.ch[ch].gr[gr]);
-    @LOC("CB") int cb = 0;
-    @LOC("CB") int next_cb_boundary;
-    @LOC("CB") int cb_begin = 0;
-    @LOC("CB") int cb_width = 0;
-    @LOC("IN") int index = 0;
-    @LOC("VAR") int t_index;
-    @LOC("J") int j;
-    @LOC("VAR") float g_gain;
-    //float[][] xr_1d = xr;//substituted xr for instances of xr_1d to decrease number of areas
+  // @LATTICE("OUT<QUO,QUO<REST,REST<IDX,IDX<VAR,VAR<CB,CB<J,CB<GR,GR<IN,J<IN,QUO*,REST*,IDX*,CB*,J*,THISLOC=IN,GLOBALLOC=IN")
+  @LATTICE("THIS,THISLOC=THIS,GLOBALLOC=THIS")
+  // ssjava
+  private void dequantize_sample(
+  /* @LOC("OUT") float xr[][], */@LOC("THIS,LayerIIIDecoder.SI") int ch,
+      @LOC("THIS,LayerIIIDecoder.SI") int gr) {
+
+    // @LOC("GR") gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias!
+    @LOC("THIS,LayerIIIDecoder.SI1") int cb = 0;
+
+    @LOC("THIS,LayerIIIDecoder.SI1") int next_cb_boundary;
+    @LOC("THIS,LayerIIIDecoder.SI1") int cb_begin = 0;
+    @LOC("THIS,LayerIIIDecoder.SI1") int cb_width = 0;
+    @LOC("THIS,LayerIIIDecoder.SI1") float g_gain;
+
+    @LOC("THIS,LayerIIIDecoder.SI1") int index = 0;
+    @LOC("THIS,LayerIIIDecoder.SI1") int t_index;
+    @LOC("THIS,LayerIIIDecoder.NZ") int j;
+
+    // float[][] xr_1d = xr;//substituted xr for instances of xr_1d to decrease
+    // number of areas
 
     // choose correct scalefactor band per block type, initalize 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)
         next_cb_boundary = sfBandIndex[sfreq].l[1]; // LONG blocks: 0,1,3
       else {
         cb_width = sfBandIndex[sfreq].s[1];
@@ -952,31 +1221,31 @@ final class LayerIIIDecoder implements FrameDecoder {
 
     // Compute overall (global) scaling.
 
-    g_gain = (float) Math.pow(2.0, (0.25 * (gr_info.global_gain - 210.0)));
+    g_gain = (float) Math.pow(2.0, (0.25 * (si.ch[ch].gr[gr].global_gain - 210.0)));
 
     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);
-      if (is_1d[j] == 0)
-        xr[quotien][reste] = 0.0f;
-      else {
-       @LOC("VAR") int abv = is_1d[j];
+      @LOC("THIS,LayerIIIDecoder.NZ") int reste = j % SSLIMIT;
+      @LOC("THIS,LayerIIIDecoder.NZ") int quotien = (int) ((j - reste) / SSLIMIT);
+      if (is_1d[j] == 0) {
+        ro[ch][quotien][reste] = 0.0f;
+      else {
+        @LOC("THIS,LayerIIIDecoder.IS1D") int abv = is_1d[j];
         // Pow Array fix (11/17/04)
         if (abv < t_43.length) {
           if (is_1d[j] > 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);
         }
       }
     }
@@ -984,12 +1253,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];
@@ -1033,45 +1302,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;
@@ -1080,37 +1350,46 @@ final class LayerIIIDecoder implements FrameDecoder {
   /**
         *
         */
-  @LATTICE("THIS<I,I<GR,GR<IN,I*,THISLOC=THIS,GLOBALLOC=IN")
-  private void reorder(@LOC("IN") float xr[][], @LOC("IN") int ch, @LOC("IN") int gr) {
-    // the purpose of reordering: move 'short samples' back to their original position
+  // ssjava
+  // @LATTICE("THIS<I,I<GR,GR<IN,I*,THISLOC=THIS,GLOBALLOC=IN")
+  @LATTICE("THIS,THISLOC=THIS,GLOBALLOC=THIS")
+  private void reorder(/* @LOC("IN") float xr[][], */@LOC("THIS,LayerIIIDecoder.CH0") int ch,
+      @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+    // the purpose of reordering: move 'short samples' back to their original
+    // position
     // after reorder, the samples are no long ordered by frequency
-    
-    // the format of input data to reorder: 
-    // three small chunks of 192 samples each are combined to 576 samples ordered by frequency 
-    
-    @LOC("GR") gr_info_s gr_info = (si.ch[ch].gr[gr]);
-    @LOC("THIS,LayerIIIDecoder.RO6") int freq;
-    @LOC("THIS,LayerIIIDecoder.RO5") int freq3;
-    @LOC("I") int index;
-    @LOC("THIS,LayerIIIDecoder.RO9") int sfb;
-    @LOC("THIS,LayerIIIDecoder.RO8") int sfb_start;
-    @LOC("THIS,LayerIIIDecoder.RO7") int sfb_lines;
-    @LOC("THIS,LayerIIIDecoder.RO4") int src_line;
-    @LOC("THIS,LayerIIIDecoder.RO1") int des_line;
-    //float[][] xr_1d = xr;  subbed in xr for xr_1d so as not to create extra areas
-
-    if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)) {
-
-      for (index = 0; index < 576; index++)
-        out_1d[index] = 0.0f;
-
-      if (gr_info.mixed_block_flag != 0) {
+
+    // the format of input data to reorder:
+    // three small chunks of 192 samples each are combined to 576 samples
+    // ordered by frequency
+
+    // gr_info_s gr_info = (si.ch[ch].gr[gr]); //remove alias
+
+    @LOC("THIS,LayerIIIDecoder.SI1") int index;
+
+    @LOC("THIS,LayerIIIDecoder.SI1") int freq;
+    @LOC("THIS,LayerIIIDecoder.SI1") int freq3;
+    @LOC("THIS,LayerIIIDecoder.SI1") int sfb;
+    @LOC("THIS,LayerIIIDecoder.SI1") int sfb_start;
+    @LOC("THIS,LayerIIIDecoder.SI1") int sfb_lines;
+    @LOC("THIS,LayerIIIDecoder.SI1") int src_line;
+    @LOC("THIS,LayerIIIDecoder.SI1") int des_line;
+    // float[][] xr_1d = xr; subbed in xr for xr_1d so as not to create extra
+    // areas
+
+    if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) {
+
+      for (index = 0; index < 576; index++) {
+        inter[index] = 0.0f;
+      }
+
+      if (si.ch[ch].gr[gr].mixed_block_flag != 0) {
         // NO REORDER FOR LOW 2 SUBBANDS
         for (index = 0; index < 36; index++) {
           // Modif E.B 02/22/99
-         @LOC("THIS,LayerIIIDecoder.RO3") int reste = index % SSLIMIT;
-          @LOC("THIS,LayerIIIDecoder.RO2") int quotien = (int) ((index - reste) / SSLIMIT);
-          out_1d[index] = xr[quotien][reste];
+          @LOC("THIS,LayerIIIDecoder.SI1") int reste = index % SSLIMIT;
+          @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((index - reste) / SSLIMIT);
+          inter[index] = lr[ch][quotien][reste];
         }
         // REORDERING FOR REST SWITCHED SHORT
         /*
@@ -1124,48 +1403,48 @@ final class LayerIIIDecoder implements FrameDecoder {
           sfb_start = sfBandIndex[sfreq].s[sfb];
           sfb_lines = sfBandIndex[sfreq].s[sfb + 1] - sfb_start;
 
-          @LOC("THIS,LayerIIIDecoder.RO7") int sfb_start3 = (sfb_start << 2) - sfb_start;
+          @LOC("THIS,LayerIIIDecoder.SI1") int sfb_start3 = (sfb_start << 2) - sfb_start;
 
           for (freq = 0, freq3 = 0; freq < sfb_lines; freq++, freq3 += 3) {
 
             src_line = sfb_start3 + freq;
             des_line = sfb_start3 + freq3;
             // Modif E.B 02/22/99
-            @LOC("THIS,LayerIIIDecoder.RO3") int reste = src_line % SSLIMIT;
-            @LOC("THIS,LayerIIIDecoder.RO2") 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] = xr[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);
 
-            out_1d[des_line] = xr[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);
 
-            out_1d[des_line] = xr[quotien][reste];
+            inter[des_line] = lr[ch][quotien][reste];
           }
         }
 
       } else { // pure short
         for (index = 0; index < 576; index++) {
-         @LOC("THIS,LayerIIIDecoder.RO8") int j = reorder_table[sfreq][index];
-          @LOC("THIS,LayerIIIDecoder.RO3") int reste = j % SSLIMIT;
-          @LOC("THIS,LayerIIIDecoder.RO2") int quotien = (int) ((j - reste) / SSLIMIT);
-          out_1d[index] = xr[quotien][reste];
+          @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);
+          inter[index] = lr[ch][quotien][reste];
         }
       }
     } else { // long blocks
       for (index = 0; index < 576; index++) {
         // Modif E.B 02/22/99
-       @LOC("THIS,LayerIIIDecoder.RO3") int reste = index % SSLIMIT;
-        @LOC("THIS,LayerIIIDecoder.RO2") int quotien = (int) ((index - reste) / SSLIMIT);
-        out_1d[index] = xr[quotien][reste];
+        @LOC("THIS,LayerIIIDecoder.SI1") int reste = index % SSLIMIT;
+        @LOC("THIS,LayerIIIDecoder.SI1") int quotien = (int) ((index - reste) / SSLIMIT);
+        inter[index] = lr[ch][quotien][reste];
       }
     }
   }
@@ -1174,13 +1453,17 @@ final class LayerIIIDecoder implements FrameDecoder {
         *
         */
 
-  @LOC("IP") int[] is_pos = new int[576];
-  @LOC("IR") float[] is_ratio = new float[576];
+  @LOC("ISP")
+  int[] is_pos = new int[576];
+  @LOC("ISR")
+  float[] is_ratio = new float[576];
 
-  @LATTICE("IO<THIS,THIS<IN,THISLOC=THIS,GLOBALLOC=IN") 
-  private void stereo(@LOC("IN") int gr) {
-    @LOC("THIS,LayerIIIDecoder.SH") int sb;
-    @LOC("THIS,LayerIIIDecoder.SH") int ss;
+  // ssjava
+  @LATTICE("IO<THIS,THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
+  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;
 
     if (channels == 1) { // mono , bypass xr[0][][] to lr[0][][]
 
@@ -1193,20 +1476,23 @@ final class LayerIIIDecoder implements FrameDecoder {
 
     } else {
 
-      @LOC("THIS,LayerIIIDecoder.ME") gr_info_s gr_info = (si.ch[0].gr[gr]);
-      @LOC("THIS,LayerIIIDecoder.ME") int mode_ext = header.mode_extension();
-      @LOC("THIS,LayerIIIDecoder.SH") int sfb;
-      @LOC("THIS,LayerIIIDecoder.SH") int i;
-      @LOC("THIS,LayerIIIDecoder.SH") int lines;
-      @LOC("THIS,LayerIIIDecoder.SH") int temp;
-      @LOC("THIS,LayerIIIDecoder.TMP2") int temp2;
-
-      @LOC("THIS,LayerIIIDecoder.S") boolean ms_stereo = ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x2) != 0));
-      @LOC("THIS,LayerIIIDecoder.S") boolean i_stereo = ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x1) != 0));
-      @LOC("THIS,LayerIIIDecoder.LSF") boolean lsf =
+      // gr_info_s gr_info = (si.ch[0].gr[gr]); remove alias
+      @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 lines;
+      @LOC("THIS,LayerIIIDecoder.RO1") int temp;
+      @LOC("THIS,LayerIIIDecoder.RO1") int temp2;
+
+      @LOC("THIS,LayerIIIDecoder.SF15") boolean ms_stereo =
+          ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x2) != 0));
+      @LOC("THIS,LayerIIIDecoder.SF15") boolean i_stereo =
+          ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x1) != 0));
+      @LOC("THIS,LayerIIIDecoder.SF15") boolean lsf =
           ((header.version() == Header.MPEG2_LSF || header.version() == Header.MPEG25_LSF)); // SZD
 
-      @LOC("IO") int io_type = (gr_info.scalefac_compress & 1);
+      @LOC("THIS,LayerIIIDecoder.LR") int io_type = (si.ch[0].gr[gr].scalefac_compress & 1);
 
       // initialization
 
@@ -1217,20 +1503,19 @@ final class LayerIIIDecoder implements FrameDecoder {
       }
 
       if (i_stereo) {
-        if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)) {
-          if (gr_info.mixed_block_flag != 0) {
+        if ((si.ch[0].gr[gr].window_switching_flag != 0) && (si.ch[0].gr[gr].block_type == 2)) {
+          if (si.ch[0].gr[gr].mixed_block_flag != 0) {
 
-           @LOC("THIS,LayerIIIDecoder.SH") int max_sfb = 0;
+            @LOC("THIS,LayerIIIDecoder.RO1") int max_sfb = 0;
 
-            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 = 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;
-
-                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.
@@ -1256,7 +1541,7 @@ final class LayerIIIDecoder implements FrameDecoder {
                 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)
@@ -1274,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;
-
-              for (; sb > 0; sb--) {
+              TERMINATE: for (; sb > 0; sb--) {
                 is_pos[i] = is_pos[sfb];
 
                 if (lsf) {
@@ -1291,7 +1575,7 @@ final class LayerIIIDecoder implements FrameDecoder {
               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;
@@ -1310,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];
-                for (; sb > 0; sb--) {
+                TERMINATE: for (; sb > 0; sb--) {
                   is_pos[i] = scalefac[1].l[sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
@@ -1322,15 +1606,14 @@ 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--) {
+              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;
-
-                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.
@@ -1349,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;
-                for (; sb > 0; sb--) {
+                TERMINATE: for (; sb > 0; sb--) {
                   is_pos[i] = scalefac[1].s[j][sfb];
                   if (is_pos[i] != 7)
                     if (lsf)
@@ -1367,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;
-
-              for (; sb > 0; sb--) {
+              TERMINATE: for (; sb > 0; sb--) {
                 is_pos[i] = is_pos[sfb];
 
                 if (lsf) {
@@ -1385,7 +1667,7 @@ final class LayerIIIDecoder implements FrameDecoder {
           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;
@@ -1405,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];
-            for (; sb > 0; sb--) {
+            TERMINATE: for (; sb > 0; sb--) {
               is_pos[i] = scalefac[1].l[sfb];
               if (is_pos[i] != 7)
                 if (lsf)
@@ -1416,7 +1698,7 @@ final class LayerIIIDecoder implements FrameDecoder {
             }
           }
           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) {
@@ -1464,21 +1746,27 @@ final class LayerIIIDecoder implements FrameDecoder {
   /**
         *
         */
-  @LATTICE("THIS<SRC,SRC<SS,SS<SB18,SB18<SB18LIM,SB18LIM<GR,GR<IN,SB18*,SS*,THISLOC=THIS")
-  private void antialias(@LOC("IN") int ch, @LOC("IN") int gr) {
-    @LOC("SB18") int sb18;
-    @LOC("SS") int ss;
-    @LOC("SB18LIM") int sb18lim;
-    @LOC("GR") gr_info_s gr_info = (si.ch[ch].gr[gr]);
+  // @LATTICE("THIS<SRC,SRC<SS,SS<SB18,SB18<SB18LIM,SB18LIM<GR,GR<IN,SB18*,SS*,THISLOC=THIS")
+  @LATTICE("VAR<THIS,THIS<C,C<IN,THISLOC=THIS,C*")
+  private void antialias(@LOC("THIS,LayerIIIDecoder.SI") int ch,
+      @LOC("THIS,LayerIIIDecoder.SI") int gr) {
+
+    @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR2") int sb18;
+    @LOC("THIS,LayerIIIDecoder.SI1") int ss;
+    @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR2") int sb18lim;
+
+    // @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR1")
+    // gr_info_s gr_info =
+    // (si.ch[ch].gr[gr]);
     // 31 alias-reduction operations between each pair of sub-bands
     // with 8 butterflies between each pair
 
-    if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)
-        && !(gr_info.mixed_block_flag != 0))
+    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))
       return;
 
-    if ((gr_info.window_switching_flag != 0) && (gr_info.mixed_block_flag != 0)
-        && (gr_info.block_type == 2)) {
+    if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0)
+        && (si.ch[ch].gr[gr].block_type == 2)) {
       sb18lim = 18;
     } else {
       sb18lim = 558;
@@ -1486,12 +1774,12 @@ final class LayerIIIDecoder implements FrameDecoder {
 
     for (sb18 = 0; sb18 < sb18lim; sb18 += 18) {
       for (ss = 0; ss < 8; ss++) {
-       @LOC("SRC") int src_idx1 = sb18 + 17 - ss;
-        @LOC("SRC") int src_idx2 = sb18 + 18 + ss;
-        @LOC("THIS,LayerIIIDecoder.O") float bu = out_1d[src_idx1];
-        @LOC("THIS,LayerIIIDecoder.O") 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.SI1") int src_idx1 = sb18 + 17 - ss;
+        @LOC("THIS,LayerIIIDecoder.SI1") int src_idx2 = sb18 + 18 + 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]);
       }
     }
   }
@@ -1502,83 +1790,86 @@ final class LayerIIIDecoder implements FrameDecoder {
 
   // MDM: tsOutCopy and rawout do not need initializing, so the arrays
   // can be reused.
-  @LOC("TS") float[] tsOutCopy = new float[18];
-  @LOC("RAW") float[] rawout = new float[36];
-  
-  @LATTICE("THIS<SB,THIS<SH,SH<IN,IN<GLOBAL,SB*,SH*,THISLOC=THIS,GLOBALLOC=GLOBAL")
-  private void hybrid(@LOC("IN") int ch, @LOC("IN") int gr) {
-  @LOC("THIS,LayerIIIDecoder.BT") int bt;
-  @LOC("SB") int sb18;
-  @LOC("THIS,LayerIIIDecoder.GR") gr_info_s gr_info = (si.ch[ch].gr[gr]);
-  @LOC("THIS,LayerIIIDecoder.TS") float[] tsOut;
-
-  //float[][] prvblk;
-
-  for (sb18 = 0; sb18 < 576; sb18 += 18) {
-    bt =
-        ((gr_info.window_switching_flag != 0) && (gr_info.mixed_block_flag != 0) && (sb18 < 36))
-            ? 0 : gr_info.block_type;
-
-    tsOut = out_1d;
-    // Modif E.B 02/22/99
-    for (@LOC("SH") int cc = 0; cc < 18; cc++)
-      tsOutCopy[cc] = tsOut[cc + sb18];
-
-    inv_mdct(tsOutCopy, rawout, bt);
-
-    for (@LOC("SH") int cc = 0; cc < 18; cc++)
-      tsOut[cc + sb18] = tsOutCopy[cc];
-    // Fin Modif
-
-    // overlap addition
-    //prvblk = prevblck; //eliminated unnecessary areas
-
-    tsOut[0 + sb18] = rawout[0] + prevblck[ch][sb18 + 0];
-    prevblck[ch][sb18 + 0] = rawout[18];
-    tsOut[1 + sb18] = rawout[1] + prevblck[ch][sb18 + 1];
-    prevblck[ch][sb18 + 1] = rawout[19];
-    tsOut[2 + sb18] = rawout[2] + prevblck[ch][sb18 + 2];
-    prevblck[ch][sb18 + 2] = rawout[20];
-    tsOut[3 + sb18] = rawout[3] + prevblck[ch][sb18 + 3];
-    prevblck[ch][sb18 + 3] = rawout[21];
-    tsOut[4 + sb18] = rawout[4] + prevblck[ch][sb18 + 4];
-    prevblck[ch][sb18 + 4] = rawout[22];
-    tsOut[5 + sb18] = rawout[5] + prevblck[ch][sb18 + 5];
-    prevblck[ch][sb18 + 5] = rawout[23];
-    tsOut[6 + sb18] = rawout[6] + prevblck[ch][sb18 + 6];
-    prevblck[ch][sb18 + 6] = rawout[24];
-    tsOut[7 + sb18] = rawout[7] + prevblck[ch][sb18 + 7];
-    prevblck[ch][sb18 + 7] = rawout[25];
-    tsOut[8 + sb18] = rawout[8] + prevblck[ch][sb18 + 8];
-    prevblck[ch][sb18 + 8] = rawout[26];
-    tsOut[9 + sb18] = rawout[9] + prevblck[ch][sb18 + 9];
-    prevblck[ch][sb18 + 9] = rawout[27];
-    tsOut[10 + sb18] = rawout[10] + prevblck[ch][sb18 + 10];
-    prevblck[ch][sb18 + 10] = rawout[28];
-    tsOut[11 + sb18] = rawout[11] + prevblck[ch][sb18 + 11];
-    prevblck[ch][sb18 + 11] = rawout[29];
-    tsOut[12 + sb18] = rawout[12] + prevblck[ch][sb18 + 12];
-    prevblck[ch][sb18 + 12] = rawout[30];
-    tsOut[13 + sb18] = rawout[13] + prevblck[ch][sb18 + 13];
-    prevblck[ch][sb18 + 13] = rawout[31];
-    tsOut[14 + sb18] = rawout[14] + prevblck[ch][sb18 + 14];
-    prevblck[ch][sb18 + 14] = rawout[32];
-    tsOut[15 + sb18] = rawout[15] + prevblck[ch][sb18 + 15];
-    prevblck[ch][sb18 + 15] = rawout[33];
-    tsOut[16 + sb18] = rawout[16] + prevblck[ch][sb18 + 16];
-    prevblck[ch][sb18 + 16] = rawout[34];
-    tsOut[17 + sb18] = rawout[17] + prevblck[ch][sb18 + 17];
-    prevblck[ch][sb18 + 17] = rawout[35];
+  @LOC("OUT")
+  float[] tsOutCopy = new float[18];
+  @LOC("OUT")
+  float[] rawout = new float[36];
+
+  @LATTICE("THIS<SB,SB*,THISLOC=THIS")
+  private void hybrid(@LOC("THIS,LayerIIIDecoder.SI") int ch, @LOC("THIS,LayerIIIDecoder.SI") int gr) {
+
+    @LOC("THIS,LayerIIIDecoder.SI1") int bt;
+    @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) {
+      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
+      for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
+        tsOutCopy[cc] = out_1d[cc + sb18];
+
+      inv_mdct(bt);
+
+      for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
+        out_1d[cc + sb18] = tsOutCopy[cc];
+      // Fin Modif
+
+      // overlap addition
+      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];
+      prevblck[ch][sb18 + 1] = rawout[19];
+      out_1d[2 + sb18] = rawout[2] + prevblck[ch][sb18 + 2];
+      prevblck[ch][sb18 + 2] = rawout[20];
+      out_1d[3 + sb18] = rawout[3] + prevblck[ch][sb18 + 3];
+      prevblck[ch][sb18 + 3] = rawout[21];
+      out_1d[4 + sb18] = rawout[4] + prevblck[ch][sb18 + 4];
+      prevblck[ch][sb18 + 4] = rawout[22];
+      out_1d[5 + sb18] = rawout[5] + prevblck[ch][sb18 + 5];
+      prevblck[ch][sb18 + 5] = rawout[23];
+      out_1d[6 + sb18] = rawout[6] + prevblck[ch][sb18 + 6];
+      prevblck[ch][sb18 + 6] = rawout[24];
+      out_1d[7 + sb18] = rawout[7] + prevblck[ch][sb18 + 7];
+      prevblck[ch][sb18 + 7] = rawout[25];
+      out_1d[8 + sb18] = rawout[8] + prevblck[ch][sb18 + 8];
+      prevblck[ch][sb18 + 8] = rawout[26];
+      out_1d[9 + sb18] = rawout[9] + prevblck[ch][sb18 + 9];
+      prevblck[ch][sb18 + 9] = rawout[27];
+      out_1d[10 + sb18] = rawout[10] + prevblck[ch][sb18 + 10];
+      prevblck[ch][sb18 + 10] = rawout[28];
+      out_1d[11 + sb18] = rawout[11] + prevblck[ch][sb18 + 11];
+      prevblck[ch][sb18 + 11] = rawout[29];
+      out_1d[12 + sb18] = rawout[12] + prevblck[ch][sb18 + 12];
+      prevblck[ch][sb18 + 12] = rawout[30];
+      out_1d[13 + sb18] = rawout[13] + prevblck[ch][sb18 + 13];
+      prevblck[ch][sb18 + 13] = rawout[31];
+      out_1d[14 + sb18] = rawout[14] + prevblck[ch][sb18 + 14];
+      prevblck[ch][sb18 + 14] = rawout[32];
+      out_1d[15 + sb18] = rawout[15] + prevblck[ch][sb18 + 15];
+      prevblck[ch][sb18 + 15] = rawout[33];
+      out_1d[16 + sb18] = rawout[16] + prevblck[ch][sb18 + 16];
+      prevblck[ch][sb18 + 16] = rawout[34];
+      out_1d[17 + sb18] = rawout[17] + prevblck[ch][sb18 + 17];
+      prevblck[ch][sb18 + 17] = rawout[35];
     }
   }
 
   /**
         *
         */
-  @LATTICE("THIS<SB,THIS<SS,SB<GLOBAL,SS<GLOBAL,SS*,SB*,THISLOC=THIS,GLOBALLOC=GLOBAL")
   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;
@@ -1589,29 +1880,33 @@ final class LayerIIIDecoder implements FrameDecoder {
   /**
    * Fast INV_MDCT.
    */
-@LATTICE("OUT<6I,OUT<TMPF,TMPF<EO,EO<TMP,TMP<SUM,TMP<IIP,IIP<I00,I00<SH,SUM<PP,PP<SH,SH<I,I<IN,TMPF*,SH*,I*,6I*,GLOBALLOC=IN")
-public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN") int block_type) {
-    //float[] win_bt;
-    @LOC("I") int i;
-
-    @LOC("TMPF") float tmpf_0;
-    @LOC("TMPF") float tmpf_1;
-    @LOC("TMPF") float tmpf_2;
-    @LOC("TMPF") float tmpf_3;
-    @LOC("TMPF") float tmpf_4;
-    @LOC("TMPF") float tmpf_5;
-    @LOC("TMPF") float tmpf_6;
-    @LOC("TMPF") float tmpf_7;
-    @LOC("TMPF") float tmpf_8;
-    @LOC("TMPF") float tmpf_9;
-    @LOC("TMPF") float tmpf_10;
-    @LOC("TMPF") float tmpf_11;
-    @LOC("TMPF") float tmpf_12;
-    @LOC("TMPF") float tmpf_13;
-    @LOC("TMPF") float tmpf_14;
-    @LOC("TMPF") float tmpf_15;
-    @LOC("TMPF") float tmpf_16;
-    @LOC("TMPF") float tmpf_17;
+  // @LATTICE("OUT<6I,OUT<TMPF,TMPF<EO,EO<TMP,TMP<SUM,TMP<IIP,IIP<I00,I00<SH,SUM<PP,PP<SH,SH<I,I<IN,TMPF*,SH*,I*,6I*,GLOBALLOC=IN,THISLOC=IN")
+  // public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out,
+  // @LOC("IN") int block_type) {//remove alias
+  // ssjava
+  @LATTICE("THIS,THISLOC=THIS")
+  public void inv_mdct(@LOC("THIS,LayerIIIDecoder.OUT") int block_type) {
+    // float[] win_bt;
+    @LOC("THIS,LayerIIIDecoder.OUT") int i;
+
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_0;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_1;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_2;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_3;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_4;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_5;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_6;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_7;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_8;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_9;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_10;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_11;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_12;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_13;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_14;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_15;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_16;
+    @LOC("THIS,LayerIIIDecoder.OUT") float tmpf_17;
 
     tmpf_0 =
         tmpf_1 =
@@ -1639,76 +1934,76 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
        * out[p+1] = out[p+2] = out[p+3] = out[p+4] = out[p+5] = out[p+6] =
        * out[p+7] = out[p+8] = 0.0f; }
        */
-      out[0] = 0.0f;
-      out[1] = 0.0f;
-      out[2] = 0.0f;
-      out[3] = 0.0f;
-      out[4] = 0.0f;
-      out[5] = 0.0f;
-      out[6] = 0.0f;
-      out[7] = 0.0f;
-      out[8] = 0.0f;
-      out[9] = 0.0f;
-      out[10] = 0.0f;
-      out[11] = 0.0f;
-      out[12] = 0.0f;
-      out[13] = 0.0f;
-      out[14] = 0.0f;
-      out[15] = 0.0f;
-      out[16] = 0.0f;
-      out[17] = 0.0f;
-      out[18] = 0.0f;
-      out[19] = 0.0f;
-      out[20] = 0.0f;
-      out[21] = 0.0f;
-      out[22] = 0.0f;
-      out[23] = 0.0f;
-      out[24] = 0.0f;
-      out[25] = 0.0f;
-      out[26] = 0.0f;
-      out[27] = 0.0f;
-      out[28] = 0.0f;
-      out[29] = 0.0f;
-      out[30] = 0.0f;
-      out[31] = 0.0f;
-      out[32] = 0.0f;
-      out[33] = 0.0f;
-      out[34] = 0.0f;
-      out[35] = 0.0f;
-
-      @LOC("6I") int six_i = 0;
+      rawout[0] = 0.0f;
+      rawout[1] = 0.0f;
+      rawout[2] = 0.0f;
+      rawout[3] = 0.0f;
+      rawout[4] = 0.0f;
+      rawout[5] = 0.0f;
+      rawout[6] = 0.0f;
+      rawout[7] = 0.0f;
+      rawout[8] = 0.0f;
+      rawout[9] = 0.0f;
+      rawout[10] = 0.0f;
+      rawout[11] = 0.0f;
+      rawout[12] = 0.0f;
+      rawout[13] = 0.0f;
+      rawout[14] = 0.0f;
+      rawout[15] = 0.0f;
+      rawout[16] = 0.0f;
+      rawout[17] = 0.0f;
+      rawout[18] = 0.0f;
+      rawout[19] = 0.0f;
+      rawout[20] = 0.0f;
+      rawout[21] = 0.0f;
+      rawout[22] = 0.0f;
+      rawout[23] = 0.0f;
+      rawout[24] = 0.0f;
+      rawout[25] = 0.0f;
+      rawout[26] = 0.0f;
+      rawout[27] = 0.0f;
+      rawout[28] = 0.0f;
+      rawout[29] = 0.0f;
+      rawout[30] = 0.0f;
+      rawout[31] = 0.0f;
+      rawout[32] = 0.0f;
+      rawout[33] = 0.0f;
+      rawout[34] = 0.0f;
+      rawout[35] = 0.0f;
+
+      @LOC("THIS,LayerIIIDecoder.OUT") int six_i = 0;
 
       for (i = 0; i < 3; i++) {
         // 12 point IMDCT
         // Begin 12 point IDCT
         // Input aliasing for 12 pt IDCT
-        in[15 + i] += in[12 + i];
-        in[12 + i] += in[9 + i];
-        in[9 + i] += in[6 + i];
-        in[6 + i] += in[3 + i];
-        in[3 + i] += in[0 + i];
+        tsOutCopy[15 + i] += tsOutCopy[12 + i];
+        tsOutCopy[12 + i] += tsOutCopy[9 + i];
+        tsOutCopy[9 + i] += tsOutCopy[6 + i];
+        tsOutCopy[6 + i] += tsOutCopy[3 + i];
+        tsOutCopy[3 + i] += tsOutCopy[0 + i];
 
         // Input aliasing on odd indices (for 6 point IDCT)
-        in[15 + i] += in[9 + i];
-        in[9 + i] += in[3 + i];
+        tsOutCopy[15 + i] += tsOutCopy[9 + i];
+        tsOutCopy[9 + i] += tsOutCopy[3 + i];
 
         // 3 point IDCT on even indices
-        @LOC("PP") float pp1;
-       @LOC("PP") float pp2;
-        @LOC("SUM") float sum;
-        pp2 = in[12 + i] * 0.500000000f;
-        pp1 = in[6 + i] * 0.866025403f;
-        sum = in[0 + i] + pp2;
-        tmpf_1 = in[0 + i] - in[12 + i];
+        @LOC("THIS,LayerIIIDecoder.OUT") float pp1;
+        @LOC("THIS,LayerIIIDecoder.OUT") float pp2;
+        @LOC("THIS,LayerIIIDecoder.OUT") float sum;
+        pp2 = tsOutCopy[12 + i] * 0.500000000f;
+        pp1 = tsOutCopy[6 + i] * 0.866025403f;
+        sum = tsOutCopy[0 + i] + pp2;
+        tmpf_1 = tsOutCopy[0 + i] - tsOutCopy[12 + i];
         tmpf_0 = sum + pp1;
         tmpf_2 = sum - pp1;
 
         // End 3 point IDCT on even indices
         // 3 point IDCT on odd indices (for 6 point IDCT)
-        pp2 = in[15 + i] * 0.500000000f;
-        pp1 = in[9 + i] * 0.866025403f;
-        sum = in[3 + i] + pp2;
-        tmpf_4 = in[3 + i] - in[15 + i];
+        pp2 = tsOutCopy[15 + i] * 0.500000000f;
+        pp1 = tsOutCopy[9 + i] * 0.866025403f;
+        sum = tsOutCopy[3 + i] + pp2;
+        tmpf_4 = tsOutCopy[3 + i] - tsOutCopy[15 + i];
         tmpf_5 = sum + pp1;
         tmpf_3 = sum - pp1;
         // End 3 point IDCT on odd indices
@@ -1719,7 +2014,7 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
         tmpf_5 *= 0.517638090f;
 
         // Output butterflies on 2 3 point IDCT's (for 6 point IDCT)
-        @LOC("SH") float save = tmpf_0;
+        @LOC("THIS,LayerIIIDecoder.OUT") float save = tmpf_0;
         tmpf_0 += tmpf_5;
         tmpf_5 = save - tmpf_5;
         save = tmpf_1;
@@ -1759,71 +2054,71 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
 
         tmpf_0 *= 0.130526192f;
 
-        out[six_i + 6] += tmpf_0;
-        out[six_i + 7] += tmpf_1;
-        out[six_i + 8] += tmpf_2;
-        out[six_i + 9] += tmpf_3;
-        out[six_i + 10] += tmpf_4;
-        out[six_i + 11] += tmpf_5;
-        out[six_i + 12] += tmpf_6;
-        out[six_i + 13] += tmpf_7;
-        out[six_i + 14] += tmpf_8;
-        out[six_i + 15] += tmpf_9;
-        out[six_i + 16] += tmpf_10;
-        out[six_i + 17] += tmpf_11;
+        rawout[six_i + 6] += tmpf_0;
+        rawout[six_i + 7] += tmpf_1;
+        rawout[six_i + 8] += tmpf_2;
+        rawout[six_i + 9] += tmpf_3;
+        rawout[six_i + 10] += tmpf_4;
+        rawout[six_i + 11] += tmpf_5;
+        rawout[six_i + 12] += tmpf_6;
+        rawout[six_i + 13] += tmpf_7;
+        rawout[six_i + 14] += tmpf_8;
+        rawout[six_i + 15] += tmpf_9;
+        rawout[six_i + 16] += tmpf_10;
+        rawout[six_i + 17] += tmpf_11;
 
         six_i += 6;
       }
     } else {
       // 36 point IDCT
       // input aliasing for 36 point IDCT
-      in[17] += in[16];
-      in[16] += in[15];
-      in[15] += in[14];
-      in[14] += in[13];
-      in[13] += in[12];
-      in[12] += in[11];
-      in[11] += in[10];
-      in[10] += in[9];
-      in[9] += in[8];
-      in[8] += in[7];
-      in[7] += in[6];
-      in[6] += in[5];
-      in[5] += in[4];
-      in[4] += in[3];
-      in[3] += in[2];
-      in[2] += in[1];
-      in[1] += in[0];
+      tsOutCopy[17] += tsOutCopy[16];
+      tsOutCopy[16] += tsOutCopy[15];
+      tsOutCopy[15] += tsOutCopy[14];
+      tsOutCopy[14] += tsOutCopy[13];
+      tsOutCopy[13] += tsOutCopy[12];
+      tsOutCopy[12] += tsOutCopy[11];
+      tsOutCopy[11] += tsOutCopy[10];
+      tsOutCopy[10] += tsOutCopy[9];
+      tsOutCopy[9] += tsOutCopy[8];
+      tsOutCopy[8] += tsOutCopy[7];
+      tsOutCopy[7] += tsOutCopy[6];
+      tsOutCopy[6] += tsOutCopy[5];
+      tsOutCopy[5] += tsOutCopy[4];
+      tsOutCopy[4] += tsOutCopy[3];
+      tsOutCopy[3] += tsOutCopy[2];
+      tsOutCopy[2] += tsOutCopy[1];
+      tsOutCopy[1] += tsOutCopy[0];
 
       // 18 point IDCT for odd indices
       // input aliasing for 18 point IDCT
-      in[17] += in[15];
-      in[15] += in[13];
-      in[13] += in[11];
-      in[11] += in[9];
-      in[9] += in[7];
-      in[7] += in[5];
-      in[5] += in[3];
-      in[3] += in[1];
-
-      @LOC("TMP") float tmp0;
-      @LOC("TMP") float tmp1;
-      @LOC("TMP") float tmp2;
-      @LOC("TMP") float tmp3;
-      @LOC("TMP") float tmp4;
-      @LOC("TMP") float tmp0_;
-      @LOC("TMP") float tmp1_;
-      @LOC("TMP") float tmp2_;
-      @LOC("TMP") float tmp3_;
-      @LOC("TMP") float tmp0o;
-      @LOC("TMP") float tmp1o;
-      @LOC("TMP") float tmp2o;
-      @LOC("TMP") float tmp3o;
-      @LOC("TMP") float tmp4o;
-      @LOC("TMP") float tmp0_o;
-      @LOC("TMP") float tmp1_o;
-      @LOC("TMP") float tmp2_o;
-      @LOC("TMP") float tmp3_o;
+      tsOutCopy[17] += tsOutCopy[15];
+      tsOutCopy[15] += tsOutCopy[13];
+      tsOutCopy[13] += tsOutCopy[11];
+      tsOutCopy[11] += tsOutCopy[9];
+      tsOutCopy[9] += tsOutCopy[7];
+      tsOutCopy[7] += tsOutCopy[5];
+      tsOutCopy[5] += tsOutCopy[3];
+      tsOutCopy[3] += tsOutCopy[1];
+
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp0;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp1;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp2;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp3;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp4;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp0_;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp1_;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp2_;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp3_;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp0o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp1o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp2o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp3o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp4o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp0_o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp1_o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp2_o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float tmp3_o;
 
       // Fast 9 Point Inverse Discrete Cosine Transform
       //
@@ -1840,59 +2135,68 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
       // 9 point IDCT on even indices
 
       // 5 points on odd indices (not realy an IDCT)
-      @LOC("I00") float i00 = in[0] + in[0];
-      @LOC("IIP") float iip12 = i00 + in[12];
+      @LOC("THIS,LayerIIIDecoder.OUT") float i00 = tsOutCopy[0] + tsOutCopy[0];
+      @LOC("THIS,LayerIIIDecoder.OUT") float iip12 = i00 + tsOutCopy[12];
 
       tmp0 =
-          iip12 + in[4] * 1.8793852415718f + in[8] * 1.532088886238f + in[16] * 0.34729635533386f;
-      tmp1 = i00 + in[4] - in[8] - in[12] - in[12] - in[16];
+          iip12 + tsOutCopy[4] * 1.8793852415718f + tsOutCopy[8] * 1.532088886238f + tsOutCopy[16]
+              * 0.34729635533386f;
+      tmp1 = i00 + tsOutCopy[4] - tsOutCopy[8] - tsOutCopy[12] - tsOutCopy[12] - tsOutCopy[16];
       tmp2 =
-          iip12 - in[4] * 0.34729635533386f - in[8] * 1.8793852415718f + in[16] * 1.532088886238f;
+          iip12 - tsOutCopy[4] * 0.34729635533386f - tsOutCopy[8] * 1.8793852415718f
+              + tsOutCopy[16] * 1.532088886238f;
       tmp3 =
-          iip12 - in[4] * 1.532088886238f + in[8] * 0.34729635533386f - in[16] * 1.8793852415718f;
-      tmp4 = in[0] - in[4] + in[8] - in[12] + in[16];
+          iip12 - tsOutCopy[4] * 1.532088886238f + tsOutCopy[8] * 0.34729635533386f - tsOutCopy[16]
+              * 1.8793852415718f;
+      tmp4 = tsOutCopy[0] - tsOutCopy[4] + tsOutCopy[8] - tsOutCopy[12] + tsOutCopy[16];
 
       // 4 points on even indices
-      @LOC("I00") float i66_ = in[6] * 1.732050808f; // Sqrt[3]
+      @LOC("THIS,LayerIIIDecoder.OUT") float i66_ = tsOutCopy[6] * 1.732050808f; // Sqrt[3]
 
       tmp0_ =
-          in[2] * 1.9696155060244f + i66_ + in[10] * 1.2855752193731f + in[14] * 0.68404028665134f;
-      tmp1_ = (in[2] - in[10] - in[14]) * 1.732050808f;
+          tsOutCopy[2] * 1.9696155060244f + i66_ + tsOutCopy[10] * 1.2855752193731f + tsOutCopy[14]
+              * 0.68404028665134f;
+      tmp1_ = (tsOutCopy[2] - tsOutCopy[10] - tsOutCopy[14]) * 1.732050808f;
       tmp2_ =
-          in[2] * 1.2855752193731f - i66_ - in[10] * 0.68404028665134f + in[14] * 1.9696155060244f;
+          tsOutCopy[2] * 1.2855752193731f - i66_ - tsOutCopy[10] * 0.68404028665134f
+              + tsOutCopy[14] * 1.9696155060244f;
       tmp3_ =
-          in[2] * 0.68404028665134f - i66_ + in[10] * 1.9696155060244f - in[14] * 1.2855752193731f;
+          tsOutCopy[2] * 0.68404028665134f - i66_ + tsOutCopy[10] * 1.9696155060244f
+              - tsOutCopy[14] * 1.2855752193731f;
 
       // 9 point IDCT on odd indices
       // 5 points on odd indices (not realy an IDCT)
-      @LOC("I00") float i0 = in[0 + 1] + in[0 + 1];
-      @LOC("IIP") float i0p12 = i0 + in[12 + 1];
+      @LOC("THIS,LayerIIIDecoder.OUT") float i0 = tsOutCopy[0 + 1] + tsOutCopy[0 + 1];
+      @LOC("THIS,LayerIIIDecoder.OUT") float i0p12 = i0 + tsOutCopy[12 + 1];
 
       tmp0o =
-          i0p12 + in[4 + 1] * 1.8793852415718f + in[8 + 1] * 1.532088886238f + in[16 + 1]
-              * 0.34729635533386f;
-      tmp1o = i0 + in[4 + 1] - in[8 + 1] - in[12 + 1] - in[12 + 1] - in[16 + 1];
+          i0p12 + tsOutCopy[4 + 1] * 1.8793852415718f + tsOutCopy[8 + 1] * 1.532088886238f
+              + tsOutCopy[16 + 1] * 0.34729635533386f;
+      tmp1o =
+          i0 + tsOutCopy[4 + 1] - tsOutCopy[8 + 1] - tsOutCopy[12 + 1] - tsOutCopy[12 + 1]
+              - tsOutCopy[16 + 1];
       tmp2o =
-          i0p12 - in[4 + 1] * 0.34729635533386f - in[8 + 1] * 1.8793852415718f + in[16 + 1]
-              * 1.532088886238f;
+          i0p12 - tsOutCopy[4 + 1] * 0.34729635533386f - tsOutCopy[8 + 1] * 1.8793852415718f
+              + tsOutCopy[16 + 1] * 1.532088886238f;
       tmp3o =
-          i0p12 - in[4 + 1] * 1.532088886238f + in[8 + 1] * 0.34729635533386f - in[16 + 1]
-              * 1.8793852415718f;
-      tmp4o = (in[0 + 1] - in[4 + 1] + in[8 + 1] - in[12 + 1] + in[16 + 1]) * 0.707106781f; // Twiddled
+          i0p12 - tsOutCopy[4 + 1] * 1.532088886238f + tsOutCopy[8 + 1] * 0.34729635533386f
+              - tsOutCopy[16 + 1] * 1.8793852415718f;
+      tmp4o =
+          (tsOutCopy[0 + 1] - tsOutCopy[4 + 1] + tsOutCopy[8 + 1] - tsOutCopy[12 + 1] + tsOutCopy[16 + 1]) * 0.707106781f; // Twiddled
 
       // 4 points on even indices
-      @LOC("I00") float i6_ = in[6 + 1] * 1.732050808f; // Sqrt[3]
+      @LOC("THIS,LayerIIIDecoder.OUT") float i6_ = tsOutCopy[6 + 1] * 1.732050808f; // Sqrt[3]
 
       tmp0_o =
-          in[2 + 1] * 1.9696155060244f + i6_ + in[10 + 1] * 1.2855752193731f + in[14 + 1]
-              * 0.68404028665134f;
-      tmp1_o = (in[2 + 1] - in[10 + 1] - in[14 + 1]) * 1.732050808f;
+          tsOutCopy[2 + 1] * 1.9696155060244f + i6_ + tsOutCopy[10 + 1] * 1.2855752193731f
+              + tsOutCopy[14 + 1] * 0.68404028665134f;
+      tmp1_o = (tsOutCopy[2 + 1] - tsOutCopy[10 + 1] - tsOutCopy[14 + 1]) * 1.732050808f;
       tmp2_o =
-          in[2 + 1] * 1.2855752193731f - i6_ - in[10 + 1] * 0.68404028665134f + in[14 + 1]
-              * 1.9696155060244f;
+          tsOutCopy[2 + 1] * 1.2855752193731f - i6_ - tsOutCopy[10 + 1] * 0.68404028665134f
+              + tsOutCopy[14 + 1] * 1.9696155060244f;
       tmp3_o =
-          in[2 + 1] * 0.68404028665134f - i6_ + in[10 + 1] * 1.9696155060244f - in[14 + 1]
-              * 1.2855752193731f;
+          tsOutCopy[2 + 1] * 0.68404028665134f - i6_ + tsOutCopy[10 + 1] * 1.9696155060244f
+              - tsOutCopy[14 + 1] * 1.2855752193731f;
 
       // Twiddle factors on odd indices
       // and
@@ -1900,8 +2204,8 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
       // and
       // twiddle factors for 36 point IDCT
 
-      @LOC("EO") float e;
-      @LOC("EO") float o;
+      @LOC("THIS,LayerIIIDecoder.OUT") float e;
+      @LOC("THIS,LayerIIIDecoder.OUT") float o;
       e = tmp0 + tmp0_;
       o = (tmp0o + tmp0_o) * 0.501909918f;
       tmpf_0 = e + o;
@@ -1939,50 +2243,53 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
 
       // end 36 point IDCT */
       // shift to modified IDCT
-      //win_bt = win[block_type]; //substituted this so that a new area does not become created
-
-      out[0] = -tmpf_9 * win[block_type][0];
-      out[1] = -tmpf_10 * win[block_type][1];
-      out[2] = -tmpf_11 * win[block_type][2];
-      out[3] = -tmpf_12 * win[block_type][3];
-      out[4] = -tmpf_13 * win[block_type][4];
-      out[5] = -tmpf_14 * win[block_type][5];
-      out[6] = -tmpf_15 * win[block_type][6];
-      out[7] = -tmpf_16 * win[block_type][7];
-      out[8] = -tmpf_17 * win[block_type][8];
-      out[9] = tmpf_17 * win[block_type][9];
-      out[10] = tmpf_16 * win[block_type][10];
-      out[11] = tmpf_15 * win[block_type][11];
-      out[12] = tmpf_14 * win[block_type][12];
-      out[13] = tmpf_13 * win[block_type][13];
-      out[14] = tmpf_12 * win[block_type][14];
-      out[15] = tmpf_11 * win[block_type][15];
-      out[16] = tmpf_10 * win[block_type][16];
-      out[17] = tmpf_9 * win[block_type][17];
-      out[18] = tmpf_8 * win[block_type][18];
-      out[19] = tmpf_7 * win[block_type][19];
-      out[20] = tmpf_6 * win[block_type][20];
-      out[21] = tmpf_5 * win[block_type][21];
-      out[22] = tmpf_4 * win[block_type][22];
-      out[23] = tmpf_3 * win[block_type][23];
-      out[24] = tmpf_2 * win[block_type][24];
-      out[25] = tmpf_1 * win[block_type][25];
-      out[26] = tmpf_0 * win[block_type][26];
-      out[27] = tmpf_0 * win[block_type][27];
-      out[28] = tmpf_1 * win[block_type][28];
-      out[29] = tmpf_2 * win[block_type][29];
-      out[30] = tmpf_3 * win[block_type][30];
-      out[31] = tmpf_4 * win[block_type][31];
-      out[32] = tmpf_5 * win[block_type][32];
-      out[33] = tmpf_6 * win[block_type][33];
-      out[34] = tmpf_7 * win[block_type][34];
-      out[35] = tmpf_8 * win[block_type][35];
+      // win_bt = win[block_type]; //substituted this so that a new area does
+      // not become created
+
+      rawout[0] = -tmpf_9 * win[block_type][0];
+      rawout[1] = -tmpf_10 * win[block_type][1];
+      rawout[2] = -tmpf_11 * win[block_type][2];
+      rawout[3] = -tmpf_12 * win[block_type][3];
+      rawout[4] = -tmpf_13 * win[block_type][4];
+      rawout[5] = -tmpf_14 * win[block_type][5];
+      rawout[6] = -tmpf_15 * win[block_type][6];
+      rawout[7] = -tmpf_16 * win[block_type][7];
+      rawout[8] = -tmpf_17 * win[block_type][8];
+      rawout[9] = tmpf_17 * win[block_type][9];
+      rawout[10] = tmpf_16 * win[block_type][10];
+      rawout[11] = tmpf_15 * win[block_type][11];
+      rawout[12] = tmpf_14 * win[block_type][12];
+      rawout[13] = tmpf_13 * win[block_type][13];
+      rawout[14] = tmpf_12 * win[block_type][14];
+      rawout[15] = tmpf_11 * win[block_type][15];
+      rawout[16] = tmpf_10 * win[block_type][16];
+      rawout[17] = tmpf_9 * win[block_type][17];
+      rawout[18] = tmpf_8 * win[block_type][18];
+      rawout[19] = tmpf_7 * win[block_type][19];
+      rawout[20] = tmpf_6 * win[block_type][20];
+      rawout[21] = tmpf_5 * win[block_type][21];
+      rawout[22] = tmpf_4 * win[block_type][22];
+      rawout[23] = tmpf_3 * win[block_type][23];
+      rawout[24] = tmpf_2 * win[block_type][24];
+      rawout[25] = tmpf_1 * win[block_type][25];
+      rawout[26] = tmpf_0 * win[block_type][26];
+      rawout[27] = tmpf_0 * win[block_type][27];
+      rawout[28] = tmpf_1 * win[block_type][28];
+      rawout[29] = tmpf_2 * win[block_type][29];
+      rawout[30] = tmpf_3 * win[block_type][30];
+      rawout[31] = tmpf_4 * win[block_type][31];
+      rawout[32] = tmpf_5 * win[block_type][32];
+      rawout[33] = tmpf_6 * win[block_type][33];
+      rawout[34] = tmpf_7 * win[block_type][34];
+      rawout[35] = tmpf_8 * win[block_type][35];
     }
+
   }
 
-  @LOC("C") private int counter = 0;
-  @LOC("F") private static final int SSLIMIT = 18;
-  @LOC("F") private static final int SBLIMIT = 32;
+  @LOC("C")
+  private int counter = 0;
+  private static final int SSLIMIT = 18;
+  private static final int SBLIMIT = 32;
 
   // Size of the table of whole numbers raised to 4/3 power.
   // This may be adjusted for performance without any problems.
@@ -1994,35 +2301,53 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
 
   @LATTICE("N<VAR")
   static class SBI {
-    @LOC("VAR") public int[] l;
-    @LOC("VAR") public int[] s;
+    @LOC("VAR")
+    public int[] l;
+    @LOC("VAR")
+    public int[] s;
 
     public SBI() {
       l = new int[23];
       s = new int[14];
     }
+
     @LATTICE("THIS<IN,THISLOC=THIS")
-    public SBI(@LOC("IN") int[] thel, @LOC("IN") int[] thes) {
+    public SBI(@DELEGATE @LOC("IN") int[] thel, @DELEGATE @LOC("IN") int[] thes) {
       l = thel;
       s = thes;
     }
   }
-  @LATTICE("N<VAR") 
+
+  @LATTICE("V,V*")
   static class gr_info_s {
-    @LOC("VAR") public int part2_3_length = 0;
-    @LOC("VAR") public int big_values = 0;
-    @LOC("VAR") public int global_gain = 0;
-    @LOC("VAR") public int scalefac_compress = 0;
-    @LOC("VAR") public int window_switching_flag = 0;
-    @LOC("VAR") public int block_type = 0;
-    @LOC("VAR") public int mixed_block_flag = 0;
-    @LOC("VAR") public int[] table_select;
-    @LOC("VAR") public int[] subblock_gain;
-    @LOC("VAR") public int region0_count = 0;
-    @LOC("VAR") public int region1_count = 0;
-    @LOC("VAR") public int preflag = 0;
-    @LOC("VAR") public int scalefac_scale = 0;
-    @LOC("VAR") public int count1table_select = 0;
+    @LOC("V")
+    public int part2_3_length = 0;
+    @LOC("V")
+    public int big_values = 0;
+    @LOC("V")
+    public int global_gain = 0;
+    @LOC("V")
+    public int scalefac_compress = 0;
+    @LOC("V")
+    public int window_switching_flag = 0;
+    @LOC("V")
+    public int block_type = 0;
+    @LOC("V")
+    public int mixed_block_flag = 0;
+    @LOC("V")
+    public int[] table_select;
+    @LOC("V")
+    public int[] subblock_gain;
+    @LOC("V")
+    public int region0_count = 0;
+    @LOC("V")
+    public int region1_count = 0;
+    @LOC("V")
+    public int preflag = 0;
+    @LOC("V")
+    public int scalefac_scale = 0;
+    @LOC("V")
+    public int count1table_select = 0;
 
     /**
      * Dummy Constructor
@@ -2032,11 +2357,13 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
       subblock_gain = new int[3];
     }
   }
-  @LATTICE("N<VAR")
+
+  @LATTICE("GR2<GR1,GR1<GR,GR2*")
   static class temporaire {
-    @LOC("VAR") public int[] scfsi;
-    @LOC("VAR") public gr_info_s[] gr;
+    @LOC("GR")
+    public int[] scfsi;
+    @LOC("GR")
+    public gr_info_s[] gr;
 
     /**
      * Dummy Constructor
@@ -2049,12 +2376,15 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
     }
   }
 
-  @LATTICE("N<VAR")
+  @LATTICE("CH<TEMP,TEMP*")
   static class III_side_info_t {
 
-    @LOC("VAR") public int main_data_begin = 0;
-    @LOC("VAR") public int private_bits = 0;
-    @LOC("VAR") public temporaire[] ch;
+    @LOC("CH")
+    public int main_data_begin = 0;
+    @LOC("CH")
+    public int private_bits = 0;
+    @LOC("CH")
+    public temporaire[] ch;
 
     /**
      * Dummy Constructor
@@ -2068,8 +2398,10 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
 
   @LATTICE("N<VAR")
   static class temporaire2 {
-    @LOC("VAR") public int[] l; /* [cb] */
-    @LOC("VAR") public int[][] s; /* [window][cb] */
+    @LOC("VAR")
+    public int[] l; /* [cb] */
+    @LOC("VAR")
+    public int[][] s; /* [window][cb] */
 
     /**
      * Dummy Constructor
@@ -2092,15 +2424,16 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
   // }
   // }
 
-  @LOC("F") private static final int slen[][] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
+  private static final int slen[][] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
       { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 } };
 
-  @LOC("F") public static final int pretab[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3,
+  public static final int pretab[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3,
       2, 0 };
 
-  @LOC("F") private SBI[] sfBandIndex; // Init in the constructor.
+  @LOC("SBI")
+  private SBI[] sfBandIndex; // Init in the constructor.
 
-  @LOC("F") public static final float two_to_negative_half_pow[] = { 1.0000000000E+00f, 7.0710678119E-01f,
+  public static final float two_to_negative_half_pow[] = { 1.0000000000E+00f, 7.0710678119E-01f,
       5.0000000000E-01f, 3.5355339059E-01f, 2.5000000000E-01f, 1.7677669530E-01f,
       1.2500000000E-01f, 8.8388347648E-02f, 6.2500000000E-02f, 4.4194173824E-02f,
       3.1250000000E-02f, 2.2097086912E-02f, 1.5625000000E-02f, 1.1048543456E-02f,
@@ -2118,11 +2451,11 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
       1.8626451492E-09f, 1.3170890160E-09f, 9.3132257462E-10f, 6.5854450798E-10f,
       4.6566128731E-10f, 3.2927225399E-10f };
 
-  @LOC("F") public static final float t_43[] = create_t_43();
+  public static final float t_43[] = create_t_43();
 
   @RETURNLOC("OUT")
   static private float[] create_t_43() {
-      @LOC("OUT") float[] t43 = new float[8192];
+    @LOC("OUT") float[] t43 = new float[8192];
     final double d43 = (4.0 / 3.0);
 
     for (@LOC("SH") int i = 0; i < 8192; i++) {
@@ -2131,7 +2464,7 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
     return t43;
   }
 
-  @LOC("F") public static final float io[][] = {
+  public static final float io[][] = {
       { 1.0000000000E+00f, 8.4089641526E-01f, 7.0710678119E-01f, 5.9460355751E-01f,
           5.0000000001E-01f, 4.2044820763E-01f, 3.5355339060E-01f, 2.9730177876E-01f,
           2.5000000001E-01f, 2.1022410382E-01f, 1.7677669530E-01f, 1.4865088938E-01f,
@@ -2149,7 +2482,7 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
           2.4414062501E-04f, 1.7263349151E-04f, 1.2207031251E-04f, 8.6316745755E-05f,
           6.1035156254E-05f, 4.3158372878E-05f, 3.0517578127E-05f, 2.1579186439E-05f } };
 
-   @LOC("F") public static final float TAN12[] = { 0.0f, 0.26794919f, 0.57735027f, 1.0f, 1.73205081f,
+  public static final float TAN12[] = { 0.0f, 0.26794919f, 0.57735027f, 1.0f, 1.73205081f,
       3.73205081f, 9.9999999e10f, -3.73205081f, -1.73205081f, -1.0f, -0.57735027f, -0.26794919f,
       0.0f, 0.26794919f, 0.57735027f, 1.0f };
 
@@ -2216,12 +2549,14 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
    * 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
    * 12, 13, 14, 15, 16, 17 };
    */
-  @LOC("F") private static/* final */int reorder_table[][]/* = loadReorderTable() */; // SZD:
-                                                                            // will
-                                                                            // be
-                                                                            // generated
-                                                                            // on
-                                                                            // demand
+  @LOC("RT")
+  private static/* final */int reorder_table[][]/* = loadReorderTable() */; // SZD:
+
+  // will
+  // be
+  // generated
+  // on
+  // demand
 
   /**
    * Loads the data for the reorder
@@ -2234,7 +2569,8 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
    * ExceptionInInitializerError(ex); } }
    */
   @LATTICE("OUT<J,J<I,I<SE,I<WIN,SE<SF,SE<SFB,WIN<SFB,J*,I*,WIN*,SFB*")
-  static int[] reorder(@LOC("SF") int scalefac_band[]) { // SZD: converted from LAME
+  static int[] reorder(@LOC("SF") int scalefac_band[]) { // SZD: converted from
+                                                         // LAME
     @LOC("J") int j = 0;
     @LOC("OUT") int ix[] = new int[576];
     for (int sfb = 0; sfb < 13; sfb++) {
@@ -2461,10 +2797,10 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
    * 570,547,559,571,548,560,572,549,561,573,550,562,574,551,563,575} };
    */
 
-  @LOC("F") private static final float cs[] = { 0.857492925712f, 0.881741997318f, 0.949628649103f,
+  private static final float cs[] = { 0.857492925712f, 0.881741997318f, 0.949628649103f,
       0.983314592492f, 0.995517816065f, 0.999160558175f, 0.999899195243f, 0.999993155067f };
 
-  @LOC("F") private static final float ca[] = { -0.5144957554270f, -0.4717319685650f, -0.3133774542040f,
+  private static final float ca[] = { -0.5144957554270f, -0.4717319685650f, -0.3133774542040f,
       -0.1819131996110f, -0.0945741925262f, -0.0409655828852f, -0.0141985685725f,
       -0.00369997467375f };
 
@@ -2483,7 +2819,7 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
   /***************************************************************/
   /* INV_MDCT */
   /***************************************************************/
-  @LOC("F") public static final float win[][] = {
+  public static final float win[][] = {
       { -1.6141214951E-02f, -5.3603178919E-02f, -1.0070713296E-01f, -1.6280817573E-01f,
           -4.9999999679E-01f, -3.8388735032E-01f, -6.2061144372E-01f, -1.1659756083E+00f,
           -3.8720752656E+00f, -4.2256286556E+00f, -1.5195289984E+00f, -9.7416483388E-01f,
@@ -2527,25 +2863,8 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
   /***************************************************************/
   /* 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(@LOC("IN") int[] thel, @LOC("IN") int[] thes) {
-      l = thel;
-      s = thes;
-    }
-  }
-
-  @LOC("F") public Sftable sftable;
-
-  @LOC("NS") public static final int nr_of_sfb_block[][][] = {
+  public static final int nr_of_sfb_block[][][] = {
       { { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } },
       { { 6, 5, 7, 3 }, { 9, 9, 12, 6 }, { 6, 9, 12, 6 } },
       { { 11, 10, 0, 0 }, { 18, 18, 0, 0 }, { 15, 18, 0, 0 } },
@@ -2554,4 +2873,3 @@ public void inv_mdct(@LOC("SH") float[] in, @LOC("OUT") float[] out, @LOC("IN")
       { { 8, 8, 5, 0 }, { 15, 12, 9, 0 }, { 6, 18, 9, 0 } } };
 
 }
-