mp3decoder finally passes the flow-down rule checking.
[IRC.git] / Robust / src / Tests / ssJava / mp3decoder / huffcodetab.java
index 77be768e95ecdb0ae90fc8462820bd720bab644d..2f52c134f871a9516b45f9681414937b9ad758ca 100644 (file)
@@ -506,20 +506,21 @@ final class huffcodetab {
    * Do the huffman-decoding. note! for counta,countb -the 4 bit value is\r
    * returned in y, discard x.\r
    */\r
    * Do the huffman-decoding. note! for counta,countb -the 4 bit value is\r
    * returned in y, discard x.\r
    */\r
-  @LATTICE("OUT<THIS,THIS<V,V<IN,IN<C,C*,THISLOC=THIS,RETURNLOC=OUT,GLOBALLOC=IN")\r
+  @LATTICE("OUT<V1,THIS<V1,V1<V,V<IN,IN<C,C*,V*,THISLOC=THIS,GLOBALLOC=IN")\r
+  @RETURNLOC("OUT,BitReserve.BIT")\r
   public static int huffman_decoder(@LOC("THIS,LayerIIIDecoder.SI2") int htIdx,\r
   public static int huffman_decoder(@LOC("THIS,LayerIIIDecoder.SI2") int htIdx,\r
-      @LOC("THIS,LayerIIIDecoder.SI1") int[] x, @LOC("THIS,LayerIIIDecoder.SI1") int[] y,\r
-      @LOC("THIS,LayerIIIDecoder.SI1") int[] v, @LOC("THIS,LayerIIIDecoder.SI1") int[] w,\r
-      @LOC("THIS,LayerIIIDecoder.BR") BitReserve br) {\r
+      @LOC("OUT,BitReserve.BIT") int[] x, @LOC("OUT,BitReserve.BIT") int[] y,\r
+      @LOC("OUT,BitReserve.BIT") int[] v, @LOC("OUT,BitReserve.BIT") int[] w,\r
+      @LOC("OUT") BitReserve br) {\r
     // array of all huffcodtable headers\r
     // 0..31 Huffman code table 0..31\r
     // 32,33 count1-tables\r
 \r
     @LOC("C") int dmask = 1 << ((4 * 8) - 1);\r
     @LOC("THIS,LayerIIIDecoder.SI1") int hs = 4 * 8;\r
     // array of all huffcodtable headers\r
     // 0..31 Huffman code table 0..31\r
     // 32,33 count1-tables\r
 \r
     @LOC("C") int dmask = 1 << ((4 * 8) - 1);\r
     @LOC("THIS,LayerIIIDecoder.SI1") int hs = 4 * 8;\r
-    @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int level;\r
-    @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int point = 0;\r
-    @LOC("OUT") int error = 1;\r
+    @LOC("OUT,BitReserve.BIT") int level;\r
+    @LOC("OUT,BitReserve.BIT") int point = 0;\r
+    @LOC("OUT,BitReserve.BIT") int error = 1;\r
     level = dmask;\r
 \r
     if (ht[htIdx].val == null)\r
     level = dmask;\r
 \r
     if (ht[htIdx].val == null)\r
@@ -618,129 +619,6 @@ final class huffcodetab {
     return error;\r
   }\r
 \r
     return error;\r
   }\r
 \r
-  /**\r
-   * Do the huffman-decoding. note! for counta,countb -the 4 bit value is\r
-   * returned in y, discard x.\r
-   */\r
-  @LATTICE("X<Y,V<Y,W<Y,Y<VAR,VAR<IN,OUT<IN,VAR*,Y*,X*,V*,W*,THISLOC=IN,GLOBALLOC=IN")\r
-  @RETURNLOC("IN")\r
-  // public static int huffman_decoder(/* @LOC("IN") huffcodetab h, */@LOC("IN")\r
-  // int idx,\r
-  // @LOC("X") int[] x, @LOC("Y") int[] y, @LOC("V") int[] v, @LOC("W") int[] w,\r
-  // @LOC("IN") BitReserve br) {\r
-  public static HuffData huffman_decoder(@LOC("IN") int idx, @LOC("IN") HuffData data) {\r
-    // array of all huffcodtable headers\r
-    // 0..31 Huffman code table 0..31\r
-    // 32,33 count1-tables\r
-\r
-    @LOC("IN") int dmask = 1 << ((4 * 8) - 1);\r
-    @LOC("IN") int hs = 4 * 8;\r
-    @LOC("VAR") int level;\r
-    @LOC("VAR") int point = 0;\r
-    @LOC("OUT") int error = 1;\r
-    level = dmask;\r
-\r
-    if (ht[idx].val == null) {\r
-      // return 2;\r
-      return data;\r
-    }\r
-\r
-    /* table 0 needs no bits */\r
-    if (ht[idx].treelen == 0) {\r
-      data.y = 0;\r
-      data.x = 0;\r
-      // return 0;\r
-      return data;\r
-    }\r
-\r
-    /* Lookup in Huffman table. */\r
-\r
-    /*\r
-     * int bitsAvailable = 0; int bitIndex = 0;\r
-     * \r
-     * int bits[] = bitbuf;\r
-     */\r
-    do {\r
-      if (ht[idx].val[point][0] == 0) { /* end of tree */\r
-        data.x = ht[idx].val[point][1] >>> 4;\r
-        data.y = ht[idx].val[point][1] & 0xf;\r
-        error = 0;\r
-        break;\r
-      }\r
-\r
-      // hget1bit() is called thousands of times, and so needs to be\r
-      // ultra fast.\r
-      /*\r
-       * if (bitIndex==bitsAvailable) { bitsAvailable = br.readBits(bits, 32);\r
-       * bitIndex = 0; }\r
-       */\r
-      // if (bits[bitIndex++]!=0)\r
-      if (data.br.hget1bit() != 0) {\r
-        while (ht[idx].val[point][1] >= MXOFF)\r
-          point += ht[idx].val[point][1];\r
-        point += ht[idx].val[point][1];\r
-      } else {\r
-        while (ht[idx].val[point][0] >= MXOFF)\r
-          point += ht[idx].val[point][0];\r
-        point += ht[idx].val[point][0];\r
-      }\r
-      level >>>= 1;\r
-      // MDM: ht[0] is always 0;\r
-    } while ((level != 0) || (point < 0 /* ht[0].treelen */));\r
-\r
-    // put back any bits not consumed\r
-    /*\r
-     * int unread = (bitsAvailable-bitIndex); if (unread>0)\r
-     * br.rewindNbits(unread);\r
-     */\r
-    /* Process sign encodings for quadruples tables. */\r
-    // System.out.println(h.tablename);\r
-    if (ht[idx].tablename0 == '3' && (ht[idx].tablename1 == '2' || ht[idx].tablename1 == '3')) {\r
-      data.v = (data.y >> 3) & 1;\r
-      data.w = (data.y >> 2) & 1;\r
-      data.x = (data.y >> 1) & 1;\r
-      data.y = data.y & 1;\r
-\r
-      /*\r
-       * v, w, x and y are reversed in the bitstream. switch them around to make\r
-       * test bistream work.\r
-       */\r
-\r
-      if (data.v != 0)\r
-        if (data.br.hget1bit() != 0)\r
-          data.v = -data.v;\r
-      if (data.w != 0)\r
-        if (data.br.hget1bit() != 0)\r
-          data.w = -data.w;\r
-      if (data.x != 0)\r
-        if (data.br.hget1bit() != 0)\r
-          data.x = -data.x;\r
-      if (data.y != 0)\r
-        if (data.br.hget1bit() != 0)\r
-          data.y = -data.y;\r
-    } else {\r
-      // Process sign and escape encodings for dual tables.\r
-      // x and y are reversed in the test bitstream.\r
-      // Reverse x and y here to make test bitstream work.\r
-\r
-      if (ht[idx].linbits != 0)\r
-        if ((ht[idx].xlen - 1) == data.x)\r
-          data.x += data.br.hgetbits(ht[idx].linbits);\r
-      if (data.x != 0)\r
-        if (data.br.hget1bit() != 0)\r
-          data.x = -data.x;\r
-      if (ht[idx].linbits != 0)\r
-        if ((ht[idx].ylen - 1) == data.y)\r
-          data.y += data.br.hgetbits(ht[idx].linbits);\r
-      if (data.y != 0)\r
-        if (data.br.hget1bit() != 0)\r
-          data.y = -data.y;\r
-    }\r
-\r
-    return data;\r
-    // return error;\r
-  }\r
-\r
   public static void inithuff() {\r
 \r
     if (ht != null)\r
   public static void inithuff() {\r
 \r
     if (ht != null)\r