changes: LayerIDecoder and LayerIIDecoder pass the flow-down rule checking
authoryeom <yeom>
Tue, 26 Jul 2011 00:24:56 +0000 (00:24 +0000)
committeryeom <yeom>
Tue, 26 Jul 2011 00:24:56 +0000 (00:24 +0000)
Robust/src/Analysis/SSJava/FlowDownCheck.java
Robust/src/Tests/ssJava/mp3decoder/LayerIDecoder.java
Robust/src/Tests/ssJava/mp3decoder/LayerIIDecoder.java
Robust/src/Tests/ssJava/mp3decoder/Subband.java

index f113341..89afe62 100644 (file)
@@ -1309,9 +1309,10 @@ public class FlowDownCheck {
     return deltaLoc;
   }
 
-  private Location parseFieldLocDeclaraton(String decl, String msg) {
+  private Location parseFieldLocDeclaraton(String decl, String msg) throws Exception {
 
     int idx = decl.indexOf(".");
+
     String className = decl.substring(0, idx);
     String fieldName = decl.substring(idx + 1);
 
@@ -1321,6 +1322,7 @@ public class FlowDownCheck {
     Descriptor d = state.getClassSymbolTable().get(className);
 
     if (d == null) {
+      System.out.println("state.getClassSymbolTable()=" + state.getClassSymbolTable());
       throw new Error("The class in the location declaration '" + decl + "' does not exist at "
           + msg);
     }
@@ -1356,28 +1358,23 @@ public class FlowDownCheck {
     SSJavaLattice<String> localLattice = CompositeLattice.getLatticeByDescriptor(md);
     Location localLoc = new Location(md, localLocId);
     if (localLattice == null || (!localLattice.containsKey(localLocId))) {
+      System.out.println("locDec="+locDec);
       throw new Error("Location " + localLocId
           + " is not defined in the local variable lattice at "
-          + md.getClassDesc().getSourceFileName() + "::" + (n != null ? n.getNumLine() : "") + ".");
+          + md.getClassDesc().getSourceFileName() + "::" + (n != null ? n.getNumLine() : md) + ".");
     }
     compLoc.addLocation(localLoc);
 
     for (int i = 1; i < locIdList.size(); i++) {
       String locName = locIdList.get(i);
-
-      Location fieldLoc =
-          parseFieldLocDeclaraton(locName, generateErrorMessage(md.getClassDesc(), n));
-      // ClassDescriptor cd = fieldLocName2cd.get(locName);
-      // SSJavaLattice<String> fieldLattice =
-      // CompositeLattice.getLatticeByDescriptor(cd);
-      //
-      // if (fieldLattice == null || (!fieldLattice.containsKey(locName))) {
-      // throw new Error("Location " + locName +
-      // " is not defined in the field lattice at "
-      // + cd.getSourceFileName() + ".");
-      // }
-      // Location fieldLoc = new Location(cd, locName);
-      compLoc.addLocation(fieldLoc);
+      try {
+        Location fieldLoc =
+            parseFieldLocDeclaraton(locName, generateErrorMessage(md.getClassDesc(), n));
+        compLoc.addLocation(fieldLoc);
+      } catch (Exception e) {
+        throw new Error("The location declaration '" + locName + "' is wrong  at "
+            + generateErrorMessage(md.getClassDesc(), n));
+      }
     }
 
     return compLoc;
@@ -1463,7 +1460,7 @@ public class FlowDownCheck {
 
     public static boolean isGreaterThan(CompositeLocation loc1, CompositeLocation loc2, String msg) {
 
-      System.out.println("isGreaterThan=" + loc1 + " " + loc2 + " msg=" + msg);
+      System.out.println("\nisGreaterThan=" + loc1 + " " + loc2 + " msg=" + msg);
       int baseCompareResult = compareBaseLocationSet(loc1, loc2, true, msg);
       if (baseCompareResult == ComparisonResult.EQUAL) {
         if (compareDelta(loc1, loc2) == ComparisonResult.GREATER) {
@@ -1525,7 +1522,7 @@ public class FlowDownCheck {
         Location loc1 = compLoc1.get(i);
         if (i >= compLoc2.getSize()) {
           throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
-              + " because they are not comparable.");
+              + " because they are not comparable at " + msg);
         }
         Location loc2 = compLoc2.get(i);
 
index 89913a8..ea70899 100644 (file)
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *----------------------------------------------------------------------
  */
 
 /**
- * Implements decoding of MPEG Audio Layer I frames. 
+ * Implements decoding of MPEG Audio Layer I frames.
  */
-@LATTICE("L<SH,SH<H,SH*")
-@METHODDEFAULT("OUT<V,V<SH,SH<IN,SH*,THISLOC=V,GLOBALLOC=IN")
-    class LayerIDecoder implements FrameDecoder
-{
-    @LOC("H") protected Bitstream                              stream;
-    @LOC("H") protected Header                                         header;
-    @LOC("H") protected SynthesisFilter                        filter1;
-    @LOC("H") protected SynthesisFilter                         filter2;
-    @LOC("H") protected Obuffer                                buffer;
-    @LOC("H") protected int                                    which_channels;
-    @LOC("SH") protected int                                   mode;
-       
-    @LOC("SH") protected int                                   num_subbands;
-    @LOC("L") protected Subband[]                              subbands;
-    @LOC("H") protected Crc16                                  crc     = null; // new Crc16[1] to enable CRC checking.
-       
-       public LayerIDecoder()
-       {
-               crc = new Crc16();
-       }
-       
-    public void create(@LOC("IN") Bitstream stream0, @LOC("IN") Header header0,
-               @LOC("IN") SynthesisFilter filtera, @LOC("IN") SynthesisFilter filterb,
-               @LOC("IN") Obuffer buffer0, @LOC("IN") int which_ch0)
-       {               
-               stream         = stream0;
-               header         = header0;
-               filter1        = filtera;
-               filter2        = filterb;
-               buffer         = buffer0;
-               which_channels = which_ch0;
-                 
-       }
-       
-       public void decodeFrame() throws DecoderException
-       {
-               
-               num_subbands = header.number_of_subbands();
-               subbands = new Subband[32];
-               mode = header.mode();
-               
-               createSubbands();
-               
-               readAllocation();
-               readScaleFactorSelection();
-               
-           if ((crc != null) || header.checksum_ok())
-               {
-                       readScaleFactors();
-                       
-                       readSampleData();                       
-               }
-
-       }
-
-       protected void createSubbands()
-       {               
-               @LOC("V,LayerIDecoder.SH") int i;
-               if (mode == Header.SINGLE_CHANNEL)
-                 for (i = 0; i < num_subbands; ++i)
-                   subbands[i] = new SubbandLayer1(i);
-               else if (mode == Header.JOINT_STEREO)
-               {
-                 for (i = 0; i < header.intensity_stereo_bound(); ++i)
-                   subbands[i] = new SubbandLayer1Stereo(i);
-                 for (; i < num_subbands; ++i)
-                   subbands[i] = new SubbandLayer1IntensityStereo(i);
-               }
-               else
-               {
-                 for (i = 0; i < num_subbands; ++i)
-                   subbands[i] = new SubbandLayer1Stereo(i);
-           }           
-       }
-       
-       protected void readAllocation() throws DecoderException
-       {
-               // start to read audio data:
-           for (@LOC("V,LayerIDecoder.SH") int i = 0; i < num_subbands; ++i)
-             subbands[i].read_allocation(stream, header, crc);
-               
-       }
-
-       protected void readScaleFactorSelection()
-       {
-               // scale factor selection not present for layer I. 
-       }
-       
-       protected void readScaleFactors()
-       {
-             for (@LOC("SH") int i = 0; i < num_subbands; ++i)
-                 subbands[i].read_scalefactor(stream, header);                 
-       }
-       
-       protected void readSampleData()
-       {
-       @LOC("SH") boolean read_ready = false;
-         @LOC("SH") boolean write_ready = false;
-         @LOC("OUT") int mode = header.mode();
-         @LOC("SH") int i;
-         do
-         {
-           for (i = 0; i < num_subbands; ++i)
-             read_ready = subbands[i].read_sampledata(stream); // DELTA[Loc[readSampleData.V],Loc[LayerIDecoder.L]]
-           do
-           {
-             for (i = 0; i < num_subbands; ++i)
-               write_ready = subbands[i].put_next_sample(which_channels,filter1, filter2);
-
-             filter1.calculate_pcm_samples(buffer);
-             if ((which_channels == OutputChannels.BOTH_CHANNELS) && (mode != Header.SINGLE_CHANNEL))
-               filter2.calculate_pcm_samples(buffer);
-           } while (!write_ready);
-         } while (!read_ready);
-
-       }
-
-//     /**
-//      * Abstract base class for subband classes of layer I and II
-//      */
-//        @LATTICE("L<H")
-//     static abstract class Subband
-//     {
-//      /*
-//       *  Changes from version 1.1 to 1.2:
-//       *    - array size increased by one, although a scalefactor with index 63
-//       *      is illegal (to prevent segmentation faults)
-//       */
-//       // Scalefactors for layer I and II, Annex 3-B.1 in ISO/IEC DIS 11172:
-//       @LOC("H") public static final float scalefactors[] =
-//       {
-//       2.00000000000000f, 1.58740105196820f, 1.25992104989487f, 1.00000000000000f,
-//       0.79370052598410f, 0.62996052494744f, 0.50000000000000f, 0.39685026299205f,
-//       0.31498026247372f, 0.25000000000000f, 0.19842513149602f, 0.15749013123686f,
-//       0.12500000000000f, 0.09921256574801f, 0.07874506561843f, 0.06250000000000f,
-//       0.04960628287401f, 0.03937253280921f, 0.03125000000000f, 0.02480314143700f,
-//       0.01968626640461f, 0.01562500000000f, 0.01240157071850f, 0.00984313320230f,
-//       0.00781250000000f, 0.00620078535925f, 0.00492156660115f, 0.00390625000000f,
-//       0.00310039267963f, 0.00246078330058f, 0.00195312500000f, 0.00155019633981f,
-//       0.00123039165029f, 0.00097656250000f, 0.00077509816991f, 0.00061519582514f,
-//       0.00048828125000f, 0.00038754908495f, 0.00030759791257f, 0.00024414062500f,
-//       0.00019377454248f, 0.00015379895629f, 0.00012207031250f, 0.00009688727124f,
-//       0.00007689947814f, 0.00006103515625f, 0.00004844363562f, 0.00003844973907f,
-//       0.00003051757813f, 0.00002422181781f, 0.00001922486954f, 0.00001525878906f,
-//       0.00001211090890f, 0.00000961243477f, 0.00000762939453f, 0.00000605545445f,
-//       0.00000480621738f, 0.00000381469727f, 0.00000302772723f, 0.00000240310869f,
-//       0.00000190734863f, 0.00000151386361f, 0.00000120155435f, 0.00000000000000f /* illegal scalefactor */
-//       };
-//
-//       public abstract void read_allocation (Bitstream stream, Header header, Crc16 crc) throws DecoderException;
-//       public abstract void read_scalefactor (Bitstream stream, Header header);
-//       public abstract boolean read_sampledata (Bitstream stream);
-//       public abstract boolean put_next_sample (int channels, SynthesisFilter filter1, SynthesisFilter filter2);
-//     };
-       
-       /**
-        * Class for layer I subbands in single channel mode.
-        * Used for single channel mode
-        * and in derived class for intensity stereo mode
-        */
-     @LATTICE("S<L,L<H,H<SH,SH*,S*")
-     @METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-       static class SubbandLayer1 extends Subband
-       {
-
-         // Factors and offsets for sample requantization
-         @LOC("H") public static final float table_factor[] = {
-          0.0f, (1.0f/2.0f) * (4.0f/3.0f), (1.0f/4.0f) * (8.0f/7.0f), (1.0f/8.0f) * (16.0f/15.0f),
-         (1.0f/16.0f) * (32.0f/31.0f), (1.0f/32.0f) * (64.0f/63.0f), (1.0f/64.0f) * (128.0f/127.0f),
-         (1.0f/128.0f) * (256.0f/255.0f), (1.0f/256.0f) * (512.0f/511.0f),
-         (1.0f/512.0f) * (1024.0f/1023.0f), (1.0f/1024.0f) * (2048.0f/2047.0f),
-         (1.0f/2048.0f) * (4096.0f/4095.0f), (1.0f/4096.0f) * (8192.0f/8191.0f),
-         (1.0f/8192.0f) * (16384.0f/16383.0f), (1.0f/16384.0f) * (32768.0f/32767.0f)
-         };
-
-         @LOC("H") public static final float table_offset[] = {
-          0.0f, ((1.0f/2.0f)-1.0f) * (4.0f/3.0f), ((1.0f/4.0f)-1.0f) * (8.0f/7.0f), ((1.0f/8.0f)-1.0f) * (16.0f/15.0f),
-         ((1.0f/16.0f)-1.0f) * (32.0f/31.0f), ((1.0f/32.0f)-1.0f) * (64.0f/63.0f), ((1.0f/64.0f)-1.0f) * (128.0f/127.0f),
-         ((1.0f/128.0f)-1.0f) * (256.0f/255.0f), ((1.0f/256.0f)-1.0f) * (512.0f/511.0f),
-         ((1.0f/512.0f)-1.0f) * (1024.0f/1023.0f), ((1.0f/1024.0f)-1.0f) * (2048.0f/2047.0f),
-         ((1.0f/2048.0f)-1.0f) * (4096.0f/4095.0f), ((1.0f/4096.0f)-1.0f) * (8192.0f/8191.0f),
-         ((1.0f/8192.0f)-1.0f) * (16384.0f/16383.0f), ((1.0f/16384.0f)-1.0f) * (32768.0f/32767.0f)
-         };
-
-         @LOC("H") protected int                subbandnumber;
-         @LOC("SH") protected int               samplenumber;
-         @LOC("H") protected int                allocation;
-         @LOC("L") protected float              scalefactor;
-         @LOC("L") protected int                samplelength;
-         @LOC("S")protected float               sample;
-         @LOC("L") protected float              factor;
-         @LOC("L") protected float              offset;
-
-         /**
-          * Construtor.
-          */
-         public SubbandLayer1(@LOC("IN")int subbandnumber)
-         {
-           this.subbandnumber = subbandnumber;
-           samplenumber = 0;  
-         }
-         
-         /**
-          *
-          */
-           public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header, 
-                                        @LOC("IN") Crc16 crc) throws DecoderException
-         {
-           if ((allocation = stream.get_bits(4)) == 15) 
-           {
-               // CGJ: catch this condition and throw appropriate exception
-               throw new DecoderException(DecoderErrors.ILLEGAL_SUBBAND_ALLOCATION, null);     
-               //       cerr << "WARNING: stream contains an illegal allocation!\n";
-                       // MPEG-stream is corrupted!
-           }
-
-               if (crc != null) crc.add_bits(allocation, 4);
-               if (allocation != 0)
-           {
-                samplelength = allocation + 1;
-                factor = table_factor[allocation];
-                offset = table_offset[allocation];
-           }
-         }
-
-         /**
-          *
-          */
-           public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header)
-         {
-           if (allocation != 0) scalefactor = scalefactors[stream.get_bits(6)];
-         }
+@LATTICE("SB<H,H<SH,SH*,SB*")
+@METHODDEFAULT("MODE<THIS,THIS<C,C<IN,THISLOC=THIS,C*")
+class LayerIDecoder implements FrameDecoder {
 
-         /**
-          *
-          */
-         @RETURNLOC("OUT") 
-         public boolean read_sampledata(@LOC("IN") Bitstream stream)
-         {
-           if (allocation != 0)
-           {
-                  sample = (float) (stream.get_bits(samplelength));
-           }
-           if (++samplenumber == 12)
-           {
-                  samplenumber = 0;
-                  return true;
-           }
-           return false;  
-         }
-
-         /**
-          *
-          */
-         @RETURNLOC("OUT")
-         public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1, 
-                                         @LOC("IN") SynthesisFilter filter2)
-         {
-           if ((allocation !=0) && (channels != OutputChannels.RIGHT_CHANNEL))
-           {
-                  @LOC("OUT") float scaled_sample = (sample * factor + offset) * scalefactor;
-                  filter1.input_sample (scaled_sample, subbandnumber);
-           }
-           return true;
-         }
-       };
-       
-       /**
-        * Class for layer I subbands in joint stereo mode.
-        */
-     @LATTICE("S<L,L<H,H<SH,SH*")
-     @METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-       static class SubbandLayer1IntensityStereo extends SubbandLayer1
-       {
-         @LOC("L") protected float             channel2_scalefactor;
-
-         /**
-          * Constructor
-          */
-         public SubbandLayer1IntensityStereo(@LOC("IN") int subbandnumber)
-         {
-               super(subbandnumber);  
-         }
+  @LOC("H")
+  protected Bitstream stream;
+  @LOC("SH")
+  protected Header header;
+  @LOC("H")
+  protected SynthesisFilter filter1;
+  @LOC("H")
+  protected SynthesisFilter filter2;
+  @LOC("H")
+  protected Obuffer buffer;
+  @LOC("H")
+  protected int which_channels;
+  @LOC("SH")
+  protected int mode;
+
+  @LOC("SB")
+  protected int num_subbands;
+  @LOC("SB")
+  protected Subband[] subbands;
+
+  @LOC("H")
+  protected Crc16 crc = null; // new Crc16[1] to enable CRC checking.
+
+  public LayerIDecoder() {
+    crc = new Crc16();
+  }
+
+  public void create(@LOC("IN") Bitstream stream0, @LOC("IN") Header header0,
+      @LOC("IN") SynthesisFilter filtera, @LOC("IN") SynthesisFilter filterb,
+      @LOC("IN") Obuffer buffer0, @LOC("IN") int which_ch0) {
+    stream = stream0;
+    header = header0;
+    filter1 = filtera;
+    filter2 = filterb;
+    buffer = buffer0;
+    which_channels = which_ch0;
+
+  }
+
+  public void decodeFrame() throws DecoderException {
+
+    num_subbands = header.number_of_subbands();
+    subbands = new Subband[32];
+    mode = header.mode();
+
+    createSubbands();
+
+    readAllocation();
+    readScaleFactorSelection();
+
+    if ((crc != null) || header.checksum_ok()) {
+      readScaleFactors();
+
+      readSampleData();
+    }
+
+  }
+
+  protected void createSubbands() {
+    @LOC("THIS,LayerIDecoder.SB") int i;
+    if (mode == Header.SINGLE_CHANNEL) {
+      for (i = 0; i < num_subbands; ++i) {
+        subbands[i] = new SubbandLayer1(i);
+      }
+    } else if (mode == Header.JOINT_STEREO) {
+      for (i = 0; i < header.intensity_stereo_bound(); ++i) {
+        subbands[i] = new SubbandLayer1Stereo(i);
+      }
+      for (; i < num_subbands; ++i) {
+        subbands[i] = new SubbandLayer1IntensityStereo(i);
+      }
+    } else {
+      for (i = 0; i < num_subbands; ++i) {
+        subbands[i] = new SubbandLayer1Stereo(i);
+      }
+    }
+  }
+
+  protected void readAllocation() throws DecoderException {
+    // start to read audio data:
+    for (@LOC("THIS,LayerIDecoder.SB") int i = 0; i < num_subbands; ++i)
+      subbands[i].read_allocation(stream, header, crc);
+
+  }
+
+  protected void readScaleFactorSelection() {
+    // scale factor selection not present for layer I.
+  }
+
+  protected void readScaleFactors() {
+    for (@LOC("THIS,LayerIDecoder.SB") int i = 0; i < num_subbands; ++i)
+      subbands[i].read_scalefactor(stream, header);
+  }
+
+  @LATTICE("MODE<THIS,THIS<C,THISLOC=THIS,C*")
+  protected void readSampleData() {
+
+    @LOC("THIS,LayerIDecoder.SB") boolean read_ready = false;
+    @LOC("THIS,LayerIDecoder.SB") boolean write_ready = false;
+
+    @LOC("MODE") int mode = header.mode(); // header.mode() will return
+                                           // DELTA(THIS)
 
-         /**
+    @LOC("THIS,LayerIDecoder.SB") int i;
+    do {
+
+      for (i = 0; i < num_subbands; ++i) {
+        read_ready = subbands[i].read_sampledata(stream); // DELTA[Loc[readSampleData.V],Loc[LayerIDecoder.L]]
+      }
+
+      do {
+        for (i = 0; i < num_subbands; ++i) {
+          write_ready = subbands[i].put_next_sample(which_channels, filter1, filter2);
+        }
+
+        filter1.calculate_pcm_samples(buffer);
+        if ((which_channels == OutputChannels.BOTH_CHANNELS) && (mode != Header.SINGLE_CHANNEL)) {
+          filter2.calculate_pcm_samples(buffer);
+        }
+
+      } while (!write_ready);
+
+    } while (!read_ready);
+
+  }
+
+  /**
+   * Class for layer I subbands in single channel mode. Used for single channel
+   * mode and in derived class for intensity stereo mode
+   */
+  @LATTICE("S<L,L<H,H<SH,SH*,S*")
+  @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  static class SubbandLayer1 extends Subband {
+
+    // Factors and offsets for sample requantization
+    @LOC("H")
+    public static final float table_factor[] = { 0.0f, (1.0f / 2.0f) * (4.0f / 3.0f),
+        (1.0f / 4.0f) * (8.0f / 7.0f), (1.0f / 8.0f) * (16.0f / 15.0f),
+        (1.0f / 16.0f) * (32.0f / 31.0f), (1.0f / 32.0f) * (64.0f / 63.0f),
+        (1.0f / 64.0f) * (128.0f / 127.0f), (1.0f / 128.0f) * (256.0f / 255.0f),
+        (1.0f / 256.0f) * (512.0f / 511.0f), (1.0f / 512.0f) * (1024.0f / 1023.0f),
+        (1.0f / 1024.0f) * (2048.0f / 2047.0f), (1.0f / 2048.0f) * (4096.0f / 4095.0f),
+        (1.0f / 4096.0f) * (8192.0f / 8191.0f), (1.0f / 8192.0f) * (16384.0f / 16383.0f),
+        (1.0f / 16384.0f) * (32768.0f / 32767.0f) };
+
+    @LOC("H")
+    public static final float table_offset[] = { 0.0f, ((1.0f / 2.0f) - 1.0f) * (4.0f / 3.0f),
+        ((1.0f / 4.0f) - 1.0f) * (8.0f / 7.0f), ((1.0f / 8.0f) - 1.0f) * (16.0f / 15.0f),
+        ((1.0f / 16.0f) - 1.0f) * (32.0f / 31.0f), ((1.0f / 32.0f) - 1.0f) * (64.0f / 63.0f),
+        ((1.0f / 64.0f) - 1.0f) * (128.0f / 127.0f), ((1.0f / 128.0f) - 1.0f) * (256.0f / 255.0f),
+        ((1.0f / 256.0f) - 1.0f) * (512.0f / 511.0f),
+        ((1.0f / 512.0f) - 1.0f) * (1024.0f / 1023.0f),
+        ((1.0f / 1024.0f) - 1.0f) * (2048.0f / 2047.0f),
+        ((1.0f / 2048.0f) - 1.0f) * (4096.0f / 4095.0f),
+        ((1.0f / 4096.0f) - 1.0f) * (8192.0f / 8191.0f),
+        ((1.0f / 8192.0f) - 1.0f) * (16384.0f / 16383.0f),
+        ((1.0f / 16384.0f) - 1.0f) * (32768.0f / 32767.0f) };
+
+    @LOC("H")
+    protected int subbandnumber;
+    @LOC("SH")
+    protected int samplenumber;
+    @LOC("H")
+    protected int allocation;
+    @LOC("L")
+    protected float scalefactor;
+    @LOC("L")
+    protected int samplelength;
+    @LOC("S")
+    protected float sample;
+    @LOC("L")
+    protected float factor;
+    @LOC("L")
+    protected float offset;
+
+    /**
+     * Construtor.
+     */
+    public SubbandLayer1(@LOC("IN") int subbandnumber) {
+      this.subbandnumber = subbandnumber;
+      samplenumber = 0;
+    }
+
+    /**
           *
           */
-         public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header, 
-                                      @LOC("IN") Crc16 crc) throws DecoderException
-         {
-           super.read_allocation (stream, header, crc);
-         }
-         
-         /**
+    public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header,
+        @LOC("IN") Crc16 crc) throws DecoderException {
+      if ((allocation = stream.get_bits(4)) == 15) {
+        // CGJ: catch this condition and throw appropriate exception
+        throw new DecoderException(DecoderErrors.ILLEGAL_SUBBAND_ALLOCATION, null);
+        // cerr << "WARNING: stream contains an illegal allocation!\n";
+        // MPEG-stream is corrupted!
+      }
+
+      if (crc != null)
+        crc.add_bits(allocation, 4);
+      if (allocation != 0) {
+        samplelength = allocation + 1;
+        factor = table_factor[allocation];
+        offset = table_offset[allocation];
+      }
+    }
+
+    /**
           *
           */
-         public void read_scalefactor (@LOC("IN") Bitstream stream, @LOC("IN") Header header)
-         {
-           if (allocation != 0)
-           {
-                 scalefactor = scalefactors[stream.get_bits(6)];
-                 channel2_scalefactor = scalefactors[stream.get_bits(6)];
-           }
-         }
-
-         /**
+    public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
+      if (allocation != 0)
+        scalefactor = scalefactors[stream.get_bits(6)];
+    }
+
+    public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+      if (allocation != 0) {
+        sample = (float) (stream.get_bits(samplelength));
+      }
+      if (++samplenumber == 12) {
+        samplenumber = 0;
+        return true;
+      }
+      return false;
+    }
+
+    public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
+        @LOC("IN") SynthesisFilter filter2) {
+      if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) {
+        @LOC("OUT") float scaled_sample = (sample * factor + offset) * scalefactor;
+        filter1.input_sample(scaled_sample, subbandnumber);
+      }
+      return true;
+    }
+  };
+
+  /**
+   * Class for layer I subbands in joint stereo mode.
+   */
+  @LATTICE("S<L,L<H,H<SH,SH*")
+  @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  static class SubbandLayer1IntensityStereo extends SubbandLayer1 {
+    @LOC("L")
+    protected float channel2_scalefactor;
+
+    /**
+     * Constructor
+     */
+    public SubbandLayer1IntensityStereo(@LOC("IN") int subbandnumber) {
+      super(subbandnumber);
+    }
+
+    /**
           *
           */
-         @RETURNLOC("OUT")
-         public boolean read_sampledata(@LOC("IN") Bitstream stream)
-         {
-                return super.read_sampledata (stream);
-         }
-         
-         /**
+    public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header,
+        @LOC("IN") Crc16 crc) throws DecoderException {
+      super.read_allocation(stream, header, crc);
+    }
+
+    /**
           *
           */
-         @RETURNLOC("OUT")
-         public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1, 
-                                         @LOC("IN") SynthesisFilter filter2)
-         {
-           if (allocation !=0 )
-           {
-             sample = sample * factor + offset;                // requantization
-                 if (channels == OutputChannels.BOTH_CHANNELS)
-             {
-                    @LOC("OUT") float sample1 = sample * scalefactor;
-                       @LOC("OUT") float sample2 = sample * channel2_scalefactor;
-                       filter1.input_sample(sample1, subbandnumber);
-                       filter2.input_sample(sample2, subbandnumber);
-                 }
-                 else if (channels == OutputChannels.LEFT_CHANNEL)
-                 {
-                       @LOC("OUT") float sample1 = sample * scalefactor;
-                       filter1.input_sample(sample1, subbandnumber);
-                 }
-                 else
-                 {
-                       @LOC("OUT") float sample2 = sample * channel2_scalefactor;
-                       filter1.input_sample(sample2, subbandnumber);
-                 }
-           }
-           return true;
-         }
-       };
-       
-       /**
-        * Class for layer I subbands in stereo mode.
-        */     
-     @LATTICE("S<L,L<H,H<SH,SH*,S*")
-     @METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-       static class SubbandLayer1Stereo extends SubbandLayer1
-       {
-         @LOC("H") protected int               channel2_allocation;
-         @LOC("L") protected float             channel2_scalefactor;
-         @LOC("L") protected int               channel2_samplelength;
-         @LOC("S") protected float             channel2_sample;
-         @LOC("L") protected float             channel2_factor;
-         @LOC("L") protected float             channel2_offset;
-
-
-         /**
-          * Constructor
-          */
-         public SubbandLayer1Stereo(@LOC("IN") int subbandnumber)
-         {
-           super(subbandnumber);
-         }
-         
-         /**
+    public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
+      if (allocation != 0) {
+        scalefactor = scalefactors[stream.get_bits(6)];
+        channel2_scalefactor = scalefactors[stream.get_bits(6)];
+      }
+    }
+
+    public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+      return super.read_sampledata(stream);
+    }
+
+    public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
+        @LOC("IN") SynthesisFilter filter2) {
+      if (allocation != 0) {
+        sample = sample * factor + offset; // requantization
+        if (channels == OutputChannels.BOTH_CHANNELS) {
+          @LOC("OUT") float sample1 = sample * scalefactor;
+          @LOC("OUT") float sample2 = sample * channel2_scalefactor;
+          filter1.input_sample(sample1, subbandnumber);
+          filter2.input_sample(sample2, subbandnumber);
+        } else if (channels == OutputChannels.LEFT_CHANNEL) {
+          @LOC("OUT") float sample1 = sample * scalefactor;
+          filter1.input_sample(sample1, subbandnumber);
+        } else {
+          @LOC("OUT") float sample2 = sample * channel2_scalefactor;
+          filter1.input_sample(sample2, subbandnumber);
+        }
+      }
+      return true;
+    }
+  };
+
+  /**
+   * Class for layer I subbands in stereo mode.
+   */
+  @LATTICE("S<L,L<H,H<SH,SH*,S*")
+  @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  static class SubbandLayer1Stereo extends SubbandLayer1 {
+    @LOC("H")
+    protected int channel2_allocation;
+    @LOC("L")
+    protected float channel2_scalefactor;
+    @LOC("L")
+    protected int channel2_samplelength;
+    @LOC("S")
+    protected float channel2_sample;
+    @LOC("L")
+    protected float channel2_factor;
+    @LOC("L")
+    protected float channel2_offset;
+
+    /**
+     * Constructor
+     */
+    public SubbandLayer1Stereo(@LOC("IN") int subbandnumber) {
+      super(subbandnumber);
+    }
+
+    /**
           *
           */
-         public void read_allocation (@LOC("IN") Bitstream stream, @LOC("IN") Header header, 
-          @LOC("IN") Crc16 crc) throws DecoderException
-         {
-            allocation = stream.get_bits(4);
-            channel2_allocation = stream.get_bits(4);
-            if (crc != null)
-            {
-               crc.add_bits (allocation, 4);
-               crc.add_bits (channel2_allocation, 4);
-            }
-            if (allocation != 0)
-            {
-               samplelength = allocation + 1;
-               factor = table_factor[allocation];
-               offset = table_offset[allocation];
-            }
-            if (channel2_allocation != 0)
-            {
-               channel2_samplelength = channel2_allocation + 1;
-               channel2_factor = table_factor[channel2_allocation];
-               channel2_offset = table_offset[channel2_allocation];
-            }
-         }
-         
-         /**
+    public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header,
+        @LOC("IN") Crc16 crc) throws DecoderException {
+      allocation = stream.get_bits(4);
+      channel2_allocation = stream.get_bits(4);
+      if (crc != null) {
+        crc.add_bits(allocation, 4);
+        crc.add_bits(channel2_allocation, 4);
+      }
+      if (allocation != 0) {
+        samplelength = allocation + 1;
+        factor = table_factor[allocation];
+        offset = table_offset[allocation];
+      }
+      if (channel2_allocation != 0) {
+        channel2_samplelength = channel2_allocation + 1;
+        channel2_factor = table_factor[channel2_allocation];
+        channel2_offset = table_offset[channel2_allocation];
+      }
+    }
+
+    /**
           *
           */
-         public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header)
-         {
-           if (allocation != 0) scalefactor = scalefactors[stream.get_bits(6)];
-           if (channel2_allocation != 0) channel2_scalefactor = scalefactors[stream.get_bits(6)];
-         }
+    public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
+      if (allocation != 0)
+        scalefactor = scalefactors[stream.get_bits(6)];
+      if (channel2_allocation != 0)
+        channel2_scalefactor = scalefactors[stream.get_bits(6)];
+    }
 
-         /**
+    /**
           *
           */
-         @RETURNLOC("OUT")
-         public boolean read_sampledata (@LOC("IN")Bitstream stream)
-         {
-            @LOC("OUT") boolean returnvalue = super.read_sampledata(stream);
-            if (channel2_allocation != 0)
-            {
-                   channel2_sample = (float) (stream.get_bits(channel2_samplelength));
-             }
-           return returnvalue;
-         }
-         
-         /**
+    @RETURNLOC("OUT")
+    public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+      @LOC("OUT") boolean returnvalue = super.read_sampledata(stream);
+      if (channel2_allocation != 0) {
+        channel2_sample = (float) (stream.get_bits(channel2_samplelength));
+      }
+      return returnvalue;
+    }
+
+    /**
           *
           */
-         @RETURNLOC("OUT")
-         public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1, 
-                                         @LOC("IN") SynthesisFilter filter2)
-         {
-            super.put_next_sample (channels, filter1, filter2);
-            if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL))
-            {
-                   @LOC("OUT") float sample2 = (channel2_sample * channel2_factor + channel2_offset) *
-                                         channel2_scalefactor;
-                   if (channels == OutputChannels.BOTH_CHANNELS)
-                          filter2.input_sample (sample2, subbandnumber);
-                   else
-                          filter1.input_sample (sample2, subbandnumber);
-            }
-            return true;
-         }
-       };
-       
+    @RETURNLOC("OUT")
+    public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
+        @LOC("IN") SynthesisFilter filter2) {
+      super.put_next_sample(channels, filter1, filter2);
+      if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) {
+        @LOC("OUT") float sample2 =
+            (channel2_sample * channel2_factor + channel2_offset) * channel2_scalefactor;
+        if (channels == OutputChannels.BOTH_CHANNELS)
+          filter2.input_sample(sample2, subbandnumber);
+        else
+          filter1.input_sample(sample2, subbandnumber);
+      }
+      return true;
+    }
+    
+  };
+
 }
index 320a831..3505ef6 100644 (file)
  *----------------------------------------------------------------------
  */
 
-
 /**
- * Implements decoding of MPEG Audio Layer II frames. 
+ * Implements decoding of MPEG Audio Layer II frames.
  */
-@LATTICE("L<SH,SH<H,SH*")
-@METHODDEFAULT("OUT<V,V<SH,SH<IN,SH*,THISLOC=V,GLOBALLOC=IN")
-class LayerIIDecoder extends LayerIDecoder implements FrameDecoder  
-{
-
-       public LayerIIDecoder()
-       {
-       }
-
-       
-       protected void createSubbands()
-       {               
-               @LOC("V,LayerIIDecoder.SH") int i;
-               if (mode == Header.SINGLE_CHANNEL)
-                 for (i = 0; i < num_subbands; ++i)
-                   subbands[i] = new SubbandLayer2(i);
-               else if (mode == Header.JOINT_STEREO)
-               {
-                 for (i = 0; i < header.intensity_stereo_bound(); ++i)
-                     subbands[i] = new SubbandLayer2Stereo(i);
-                 for (; i < num_subbands; ++i)
-                     subbands[i] = new SubbandLayer2IntensityStereo(i);
-               }
-               else
-               {
-                 for (i = 0; i < num_subbands; ++i)
-                     subbands[i] = new SubbandLayer2Stereo(i);
-        }
-               
-       }
-       
-       protected void readScaleFactorSelection()
-       {
-         // eom note: num_subbands is defined in LayerIDecoder so it has (THIS, LayerIDecoder) Loc
-             for (@LOC("V,LayerIIDecoder.SH") int i = 0; i < num_subbands; ++i){
-               ((SubbandLayer2)subbands[i]).read_scalefactor_selection(stream, crc);
-             }
-       }
-       
-       
-
-        /**
-         * Class for layer II subbands in single channel mode.
-         */
-     @LATTICE("S<L,L<H,L<ARR,ARR<F,SN<F,GN<F,F<H,H<SH,SN*,GN*")
-       @METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-       static class SubbandLayer2 extends Subband
-       {
-         // this table contains 3 requantized samples for each legal codeword
-         // when grouped in 5 bits, i.e. 3 quantizationsteps per sample
-       @LOC("H") public static final float grouping_5bits[] = new float[]
-       {
-         -2.0f/3.0f, -2.0f/3.0f, -2.0f/3.0f,
-                        0.0f, -2.0f/3.0f, -2.0f/3.0f,
-               2.0f/3.0f, -2.0f/3.0f, -2.0f/3.0f,
-         -2.0f/3.0f,      0.0f, -2.0f/3.0f,
-                        0.0f,      0.0f, -2.0f/3.0f,
-               2.0f/3.0f,      0.0f, -2.0f/3.0f,
-         -2.0f/3.0f,  2.0f/3.0f, -2.0f/3.0f,
-                        0.0f,  2.0f/3.0f, -2.0f/3.0f,
-               2.0f/3.0f,  2.0f/3.0f, -2.0f/3.0f,
-         -2.0f/3.0f, -2.0f/3.0f,      0.0f,
-                        0.0f, -2.0f/3.0f,      0.0f,
-               2.0f/3.0f, -2.0f/3.0f,      0.0f,
-         -2.0f/3.0f,      0.0f,      0.0f,
-                        0.0f,      0.0f,      0.0f,
-               2.0f/3.0f,      0.0f,      0.0f,
-         -2.0f/3.0f,  2.0f/3.0f,      0.0f,
-                        0.0f,  2.0f/3.0f,      0.0f,
-               2.0f/3.0f,  2.0f/3.0f,      0.0f,
-         -2.0f/3.0f, -2.0f/3.0f,  2.0f/3.0f,
-              0.0f, -2.0f/3.0f,  2.0f/3.0f,
-               2.0f/3.0f, -2.0f/3.0f,  2.0f/3.0f,
-         -2.0f/3.0f,      0.0f,  2.0f/3.0f,
-              0.0f,      0.0f,  2.0f/3.0f,
-          2.0f/3.0f,      0.0f,  2.0f/3.0f,
-         -2.0f/3.0f,  2.0f/3.0f,  2.0f/3.0f,
-                        0.0f,  2.0f/3.0f,  2.0f/3.0f,
-          2.0f/3.0f,  2.0f/3.0f,  2.0f/3.0f
-       };
-
-       // this table contains 3 requantized samples for each legal codeword
-       // when grouped in 7 bits, i.e. 5 quantizationsteps per sample
-       @LOC("H") public static final float grouping_7bits[] = new float[]
-       {
-         -0.8f, -0.8f, -0.8f,   -0.4f, -0.8f, -0.8f,    0.0f, -0.8f, -0.8f,    0.4f, -0.8f, -0.8f,    0.8f, -0.8f, -0.8f,
-         -0.8f, -0.4f, -0.8f,   -0.4f, -0.4f, -0.8f,    0.0f, -0.4f, -0.8f,    0.4f, -0.4f, -0.8f,    0.8f, -0.4f, -0.8f,
-         -0.8f,  0.0f, -0.8f,   -0.4f,  0.0f, -0.8f,    0.0f,  0.0f, -0.8f,    0.4f,  0.0f, -0.8f,    0.8f,  0.0f, -0.8f,
-         -0.8f,  0.4f, -0.8f,   -0.4f,  0.4f, -0.8f,    0.0f,  0.4f, -0.8f,    0.4f,  0.4f, -0.8f,    0.8f,  0.4f, -0.8f,
-         -0.8f,  0.8f, -0.8f,   -0.4f,  0.8f, -0.8f,    0.0f,  0.8f, -0.8f,    0.4f,  0.8f, -0.8f,    0.8f,  0.8f, -0.8f,
-         -0.8f, -0.8f, -0.4f,   -0.4f, -0.8f, -0.4f,    0.0f, -0.8f, -0.4f,    0.4f, -0.8f, -0.4f,    0.8f, -0.8f, -0.4f,
-         -0.8f, -0.4f, -0.4f,   -0.4f, -0.4f, -0.4f,    0.0f, -0.4f, -0.4f,    0.4f, -0.4f, -0.4f,    0.8f, -0.4f, -0.4f,
-         -0.8f,  0.0f, -0.4f,   -0.4f,  0.0f, -0.4f,    0.0f,  0.0f, -0.4f,    0.4f,  0.0f, -0.4f,    0.8f,  0.0f, -0.4f,
-         -0.8f,  0.4f, -0.4f,   -0.4f,  0.4f, -0.4f,    0.0f,  0.4f, -0.4f,    0.4f,  0.4f, -0.4f,    0.8f,  0.4f, -0.4f,
-         -0.8f,  0.8f, -0.4f,   -0.4f,  0.8f, -0.4f,    0.0f,  0.8f, -0.4f,    0.4f,  0.8f, -0.4f,    0.8f,  0.8f, -0.4f,
-         -0.8f, -0.8f,  0.0f,   -0.4f, -0.8f,  0.0f,    0.0f, -0.8f,  0.0f,    0.4f, -0.8f,  0.0f,    0.8f, -0.8f,  0.0f,
-         -0.8f, -0.4f,  0.0f,   -0.4f, -0.4f,  0.0f,    0.0f, -0.4f,  0.0f,    0.4f, -0.4f,  0.0f,    0.8f, -0.4f,  0.0f,
-         -0.8f,  0.0f,  0.0f,   -0.4f,  0.0f,  0.0f,    0.0f,  0.0f,  0.0f,    0.4f,  0.0f,  0.0f,    0.8f,  0.0f,  0.0f,
-         -0.8f,  0.4f,  0.0f,   -0.4f,  0.4f,  0.0f,    0.0f,  0.4f,  0.0f,    0.4f,  0.4f,  0.0f,    0.8f,  0.4f,  0.0f,
-         -0.8f,  0.8f,  0.0f,   -0.4f,  0.8f,  0.0f,    0.0f,  0.8f,  0.0f,    0.4f,  0.8f,  0.0f,    0.8f,  0.8f,  0.0f,
-         -0.8f, -0.8f,  0.4f,   -0.4f, -0.8f,  0.4f,    0.0f, -0.8f,  0.4f,    0.4f, -0.8f,  0.4f,    0.8f, -0.8f,  0.4f,
-         -0.8f, -0.4f,  0.4f,   -0.4f, -0.4f,  0.4f,    0.0f, -0.4f,  0.4f,    0.4f, -0.4f,  0.4f,    0.8f, -0.4f,  0.4f,
-         -0.8f,  0.0f,  0.4f,   -0.4f,  0.0f,  0.4f,    0.0f,  0.0f,  0.4f,    0.4f,  0.0f,  0.4f,    0.8f,  0.0f,  0.4f,
-         -0.8f,  0.4f,  0.4f,   -0.4f,  0.4f,  0.4f,    0.0f,  0.4f,  0.4f,    0.4f,  0.4f,  0.4f,    0.8f,  0.4f,  0.4f,
-         -0.8f,  0.8f,  0.4f,   -0.4f,  0.8f,  0.4f,    0.0f,  0.8f,  0.4f,    0.4f,  0.8f,  0.4f,    0.8f,  0.8f,  0.4f,
-         -0.8f, -0.8f,  0.8f,   -0.4f, -0.8f,  0.8f,    0.0f, -0.8f,  0.8f,    0.4f, -0.8f,  0.8f,    0.8f, -0.8f,  0.8f,
-         -0.8f, -0.4f,  0.8f,   -0.4f, -0.4f,  0.8f,    0.0f, -0.4f,  0.8f,    0.4f, -0.4f,  0.8f,    0.8f, -0.4f,  0.8f,
-         -0.8f,  0.0f,  0.8f,   -0.4f,  0.0f,  0.8f,    0.0f,  0.0f,  0.8f,    0.4f,  0.0f,  0.8f,    0.8f,  0.0f,  0.8f,
-         -0.8f,  0.4f,  0.8f,   -0.4f,  0.4f,  0.8f,    0.0f,  0.4f,  0.8f,    0.4f,  0.4f,  0.8f,    0.8f,  0.4f,  0.8f,
-         -0.8f,  0.8f,  0.8f,   -0.4f,  0.8f,  0.8f,    0.0f,  0.8f,  0.8f,    0.4f,  0.8f,  0.8f,    0.8f,  0.8f,  0.8f
-       };
-
-       // this table contains 3 requantized samples for each legal codeword
-       // when grouped in 10 bits, i.e. 9 quantizationsteps per sample
-       @LOC("H") public static final float grouping_10bits[] =
-       {
-         -8.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,        0.0f, -8.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,        0.0f, -6.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,        0.0f, -4.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,        0.0f, -2.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f,      0.0f, -8.0f/9.0f,   -6.0f/9.0f,      0.0f, -8.0f/9.0f,   -4.0f/9.0f,      0.0f, -8.0f/9.0f,
-         -2.0f/9.0f,      0.0f, -8.0f/9.0f,        0.0f,      0.0f, -8.0f/9.0f,    2.0f/9.0f,      0.0f, -8.0f/9.0f,
-               4.0f/9.0f,      0.0f, -8.0f/9.0f,    6.0f/9.0f,      0.0f, -8.0f/9.0f,    8.0f/9.0f,      0.0f, -8.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,        0.0f,  2.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,        0.0f,  4.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,        0.0f,  6.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,        0.0f,  8.0f/9.0f, -8.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,
-               4.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f, -8.0f/9.0f,
-         -8.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,        0.0f, -8.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,        0.0f, -6.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,        0.0f, -4.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,        0.0f, -2.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f,      0.0f, -6.0f/9.0f,   -6.0f/9.0f,      0.0f, -6.0f/9.0f,   -4.0f/9.0f,      0.0f, -6.0f/9.0f,
-         -2.0f/9.0f,      0.0f, -6.0f/9.0f,        0.0f,      0.0f, -6.0f/9.0f,    2.0f/9.0f,      0.0f, -6.0f/9.0f,
-               4.0f/9.0f,      0.0f, -6.0f/9.0f,    6.0f/9.0f,      0.0f, -6.0f/9.0f,    8.0f/9.0f,      0.0f, -6.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,        0.0f,  2.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,        0.0f,  4.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,        0.0f,  6.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,        0.0f,  8.0f/9.0f, -6.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,
-               4.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f, -6.0f/9.0f,
-         -8.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,        0.0f, -8.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,        0.0f, -6.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,        0.0f, -4.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,        0.0f, -2.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f,      0.0f, -4.0f/9.0f,   -6.0f/9.0f,      0.0f, -4.0f/9.0f,   -4.0f/9.0f,      0.0f, -4.0f/9.0f,
-         -2.0f/9.0f,      0.0f, -4.0f/9.0f,        0.0f,      0.0f, -4.0f/9.0f,    2.0f/9.0f,      0.0f, -4.0f/9.0f,
-               4.0f/9.0f,      0.0f, -4.0f/9.0f,    6.0f/9.0f,      0.0f, -4.0f/9.0f,    8.0f/9.0f,      0.0f, -4.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,        0.0f,  2.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,        0.0f,  4.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,        0.0f,  6.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,        0.0f,  8.0f/9.0f, -4.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,
-               4.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f, -4.0f/9.0f,
-         -8.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,        0.0f, -8.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,        0.0f, -6.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,        0.0f, -4.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,        0.0f, -2.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f,      0.0f, -2.0f/9.0f,   -6.0f/9.0f,      0.0f, -2.0f/9.0f,   -4.0f/9.0f,      0.0f, -2.0f/9.0f,
-         -2.0f/9.0f,      0.0f, -2.0f/9.0f,        0.0f,      0.0f, -2.0f/9.0f,    2.0f/9.0f,      0.0f, -2.0f/9.0f,
-               4.0f/9.0f,      0.0f, -2.0f/9.0f,    6.0f/9.0f,      0.0f, -2.0f/9.0f,    8.0f/9.0f,      0.0f, -2.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,        0.0f,  2.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,        0.0f,  4.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,        0.0f,  6.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,        0.0f,  8.0f/9.0f, -2.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,
-               4.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f, -2.0f/9.0f,
-         -8.0f/9.0f, -8.0f/9.0f,      0.0f,   -6.0f/9.0f, -8.0f/9.0f,      0.0f,   -4.0f/9.0f, -8.0f/9.0f,      0.0f,
-         -2.0f/9.0f, -8.0f/9.0f,      0.0f,        0.0f, -8.0f/9.0f,      0.0f,    2.0f/9.0f, -8.0f/9.0f,      0.0f,
-               4.0f/9.0f, -8.0f/9.0f,      0.0f,    6.0f/9.0f, -8.0f/9.0f,      0.0f,    8.0f/9.0f, -8.0f/9.0f,      0.0f,
-         -8.0f/9.0f, -6.0f/9.0f,      0.0f,   -6.0f/9.0f, -6.0f/9.0f,      0.0f,   -4.0f/9.0f, -6.0f/9.0f,      0.0f,
-         -2.0f/9.0f, -6.0f/9.0f,      0.0f,        0.0f, -6.0f/9.0f,      0.0f,    2.0f/9.0f, -6.0f/9.0f,      0.0f,
-               4.0f/9.0f, -6.0f/9.0f,      0.0f,    6.0f/9.0f, -6.0f/9.0f,      0.0f,    8.0f/9.0f, -6.0f/9.0f,      0.0f,
-         -8.0f/9.0f, -4.0f/9.0f,      0.0f,   -6.0f/9.0f, -4.0f/9.0f,      0.0f,   -4.0f/9.0f, -4.0f/9.0f,      0.0f,
-         -2.0f/9.0f, -4.0f/9.0f,      0.0f,        0.0f, -4.0f/9.0f,      0.0f,    2.0f/9.0f, -4.0f/9.0f,      0.0f,
-               4.0f/9.0f, -4.0f/9.0f,      0.0f,    6.0f/9.0f, -4.0f/9.0f,      0.0f,    8.0f/9.0f, -4.0f/9.0f,      0.0f,
-         -8.0f/9.0f, -2.0f/9.0f,      0.0f,   -6.0f/9.0f, -2.0f/9.0f,      0.0f,   -4.0f/9.0f, -2.0f/9.0f,      0.0f,
-         -2.0f/9.0f, -2.0f/9.0f,      0.0f,        0.0f, -2.0f/9.0f,      0.0f,    2.0f/9.0f, -2.0f/9.0f,      0.0f,
-               4.0f/9.0f, -2.0f/9.0f,      0.0f,    6.0f/9.0f, -2.0f/9.0f,      0.0f,    8.0f/9.0f, -2.0f/9.0f,      0.0f,
-         -8.0f/9.0f,      0.0f,      0.0f,   -6.0f/9.0f,      0.0f,      0.0f,   -4.0f/9.0f,      0.0f,      0.0f,
-         -2.0f/9.0f,      0.0f,      0.0f,        0.0f,      0.0f,      0.0f,    2.0f/9.0f,      0.0f,      0.0f,
-               4.0f/9.0f,      0.0f,      0.0f,    6.0f/9.0f,      0.0f,      0.0f,    8.0f/9.0f,      0.0f,      0.0f,
-         -8.0f/9.0f,  2.0f/9.0f,      0.0f,   -6.0f/9.0f,  2.0f/9.0f,      0.0f,   -4.0f/9.0f,  2.0f/9.0f,      0.0f,
-         -2.0f/9.0f,  2.0f/9.0f,      0.0f,        0.0f,  2.0f/9.0f,      0.0f,    2.0f/9.0f,  2.0f/9.0f,      0.0f,
-               4.0f/9.0f,  2.0f/9.0f,      0.0f,    6.0f/9.0f,  2.0f/9.0f,      0.0f,    8.0f/9.0f,  2.0f/9.0f,      0.0f,
-         -8.0f/9.0f,  4.0f/9.0f,      0.0f,   -6.0f/9.0f,  4.0f/9.0f,      0.0f,   -4.0f/9.0f,  4.0f/9.0f,      0.0f,
-         -2.0f/9.0f,  4.0f/9.0f,      0.0f,        0.0f,  4.0f/9.0f,      0.0f,    2.0f/9.0f,  4.0f/9.0f,      0.0f,
-               4.0f/9.0f,  4.0f/9.0f,      0.0f,    6.0f/9.0f,  4.0f/9.0f,      0.0f,    8.0f/9.0f,  4.0f/9.0f,      0.0f,
-         -8.0f/9.0f,  6.0f/9.0f,      0.0f,   -6.0f/9.0f,  6.0f/9.0f,      0.0f,   -4.0f/9.0f,  6.0f/9.0f,      0.0f,
-         -2.0f/9.0f,  6.0f/9.0f,      0.0f,        0.0f,  6.0f/9.0f,      0.0f,    2.0f/9.0f,  6.0f/9.0f,      0.0f,
-               4.0f/9.0f,  6.0f/9.0f,      0.0f,    6.0f/9.0f,  6.0f/9.0f,      0.0f,    8.0f/9.0f,  6.0f/9.0f,      0.0f,
-         -8.0f/9.0f,  8.0f/9.0f,      0.0f,   -6.0f/9.0f,  8.0f/9.0f,      0.0f,   -4.0f/9.0f,  8.0f/9.0f,      0.0f,
-         -2.0f/9.0f,  8.0f/9.0f,      0.0f,        0.0f,  8.0f/9.0f,      0.0f,    2.0f/9.0f,  8.0f/9.0f,      0.0f,
-          4.0f/9.0f,  8.0f/9.0f,      0.0f,    6.0f/9.0f,  8.0f/9.0f,      0.0f,    8.0f/9.0f,  8.0f/9.0f,      0.0f,
-         -8.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,        0.0f, -8.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,
-               4.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,        0.0f, -6.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,
-               4.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,        0.0f, -4.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,
-          4.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,        0.0f, -2.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,
-          4.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f,      0.0f,  2.0f/9.0f,   -6.0f/9.0f,      0.0f,  2.0f/9.0f,   -4.0f/9.0f,      0.0f,  2.0f/9.0f,
-         -2.0f/9.0f,      0.0f,  2.0f/9.0f,        0.0f,      0.0f,  2.0f/9.0f,    2.0f/9.0f,      0.0f,  2.0f/9.0f,
-          4.0f/9.0f,      0.0f,  2.0f/9.0f,    6.0f/9.0f,      0.0f,  2.0f/9.0f,    8.0f/9.0f,      0.0f,  2.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,        0.0f,  2.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,
-          4.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,        0.0f,  4.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,
-               4.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,        0.0f,  6.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,
-          4.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,        0.0f,  8.0f/9.0f,  2.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,
-          4.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f,  2.0f/9.0f,
-         -8.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,        0.0f, -8.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,
-               4.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,        0.0f, -6.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,
-          4.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,        0.0f, -4.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,
-          4.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,        0.0f, -2.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,
-               4.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f,      0.0f,  4.0f/9.0f,   -6.0f/9.0f,      0.0f,  4.0f/9.0f,   -4.0f/9.0f,      0.0f,  4.0f/9.0f,
-         -2.0f/9.0f,      0.0f,  4.0f/9.0f,        0.0f,      0.0f,  4.0f/9.0f,    2.0f/9.0f,      0.0f,  4.0f/9.0f,
-          4.0f/9.0f,      0.0f,  4.0f/9.0f,    6.0f/9.0f,      0.0f,  4.0f/9.0f,    8.0f/9.0f,      0.0f,  4.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,        0.0f,  2.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,
-          4.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,        0.0f,  4.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,
-          4.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,        0.0f,  6.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,
-               4.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,        0.0f,  8.0f/9.0f,  4.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,
-               4.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f,  4.0f/9.0f,
-         -8.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,        0.0f, -8.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,
-          4.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,        0.0f, -6.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,
-          4.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,        0.0f, -4.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,
-               4.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,        0.0f, -2.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,
-          4.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f,      0.0f,  6.0f/9.0f,   -6.0f/9.0f,      0.0f,  6.0f/9.0f,   -4.0f/9.0f,      0.0f,  6.0f/9.0f,
-         -2.0f/9.0f,      0.0f,  6.0f/9.0f,        0.0f,      0.0f,  6.0f/9.0f,    2.0f/9.0f,      0.0f,  6.0f/9.0f,
-               4.0f/9.0f,      0.0f,  6.0f/9.0f,    6.0f/9.0f,      0.0f,  6.0f/9.0f,    8.0f/9.0f,      0.0f,  6.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,        0.0f,  2.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,
-               4.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,        0.0f,  4.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,
-               4.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,        0.0f,  6.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,
-               4.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,        0.0f,  8.0f/9.0f,  6.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,
-               4.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f,  6.0f/9.0f,
-         -8.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,        0.0f, -8.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,
-          4.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f, -8.0f/9.0f,  8.0f/9.0f,
-         -8.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,        0.0f, -6.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,
-               4.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f, -6.0f/9.0f,  8.0f/9.0f,
-         -8.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,        0.0f, -4.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,
-          4.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f, -4.0f/9.0f,  8.0f/9.0f,
-         -8.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,        0.0f, -2.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,
-          4.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f, -2.0f/9.0f,  8.0f/9.0f,
-         -8.0f/9.0f,      0.0f,  8.0f/9.0f,   -6.0f/9.0f,      0.0f,  8.0f/9.0f,   -4.0f/9.0f,      0.0f,  8.0f/9.0f,
-         -2.0f/9.0f,      0.0f,  8.0f/9.0f,        0.0f,      0.0f,  8.0f/9.0f,    2.0f/9.0f,      0.0f,  8.0f/9.0f,
-          4.0f/9.0f,      0.0f,  8.0f/9.0f,    6.0f/9.0f,      0.0f,  8.0f/9.0f,    8.0f/9.0f,      0.0f,  8.0f/9.0f,
-         -8.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,        0.0f,  2.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,
-               4.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f,  2.0f/9.0f,  8.0f/9.0f,
-         -8.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,        0.0f,  4.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,
-               4.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f,  4.0f/9.0f,  8.0f/9.0f,
-         -8.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,        0.0f,  6.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,
-          4.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f,  6.0f/9.0f,  8.0f/9.0f,
-         -8.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f,   -6.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f,   -4.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f,
-         -2.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f,        0.0f,  8.0f/9.0f,  8.0f/9.0f,    2.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f,
-          4.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f,    6.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f,    8.0f/9.0f,  8.0f/9.0f,  8.0f/9.0f
-       };
-
-       // data taken from ISO/IEC DIS 11172, Annexes 3-B.2[abcd] and 3-B.4:
-
-       // subbands 0-2 in tables 3-B.2a and 2b: (index is allocation)
-       @LOC("F") public static final int table_ab1_codelength[] =
-         // bits per codeword
-       { 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
-
-       @LOC("F") public static final float table_ab1_groupingtables[][] =
-         // pointer to sample grouping table, or NULL-pointer if ungrouped
-       { null, grouping_5bits, null, null, null, null, null, null, null, null, null, null, null, null, null, null };
-
-       @LOC("F") public static final float table_ab1_factor[] =
-         // factor for requantization: (real)sample * factor - 1.0 gives requantized sample
-       { 0.0f, 1.0f/2.0f, 1.0f/4.0f, 1.0f/8.0f, 1.0f/16.0f, 1.0f/32.0f, 1.0f/64.0f,
-         1.0f/128.0f, 1.0f/256.0f, 1.0f/512.0f, 1.0f/1024.0f, 1.0f/2048.0f,
-         1.0f/4096.0f, 1.0f/8192.0f, 1.0f/16384.0f, 1.0f/32768.0f };
-
-       @LOC("F") public static final float table_ab1_c[] =
-         // factor c for requantization from table 3-B.4
-       { 0.0f,           1.33333333333f, 1.14285714286f, 1.06666666666f, 1.03225806452f,
-         1.01587301587f, 1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f,
-         1.00048851979f, 1.00024420024f, 1.00012208522f, 1.00006103888f, 1.00003051851f,
-         1.00001525902f };
-
-       @LOC("F") public static final float table_ab1_d[] =
-         // addend d for requantization from table 3-B.4
-       { 0.0f,           0.50000000000f, 0.25000000000f, 0.12500000000f, 0.06250000000f,
-         0.03125000000f, 0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f,
-         0.00097656250f, 0.00048828125f, 0.00024414063f, 0.00012207031f, 0.00006103516f,
-         0.00003051758f };
-
-       // subbands 3-... tables 3-B.2a and 2b:
-       @LOC("F") public static final float[] table_ab234_groupingtables[] =
-       { null, grouping_5bits, grouping_7bits, null, grouping_10bits, null, null, null, null, null, null, null, null, null, null, null };
-
-       // subbands 3-10 in tables 3-B.2a and 2b:
-       @LOC("F") public static final int table_ab2_codelength[] =
-       { 0, 5, 7, 3, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 };
-       @LOC("F") public static final float table_ab2_factor[] =
-       { 0.0f, 1.0f/2.0f, 1.0f/4.0f, 1.0f/4.0f, 1.0f/8.0f, 1.0f/8.0f, 1.0f/16.0f,
-         1.0f/32.0f, 1.0f/64.0f, 1.0f/128.0f, 1.0f/256.0f, 1.0f/512.0f,
-         1.0f/1024.0f, 1.0f/2048.0f, 1.0f/4096.0f, 1.0f/32768.0f };
-       @LOC("F") public static final float table_ab2_c[] =
-       { 0.0f,           1.33333333333f, 1.60000000000f, 1.14285714286f, 1.77777777777f,
-         1.06666666666f, 1.03225806452f, 1.01587301587f, 1.00787401575f, 1.00392156863f,
-         1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f, 1.00012208522f,
-         1.00001525902f };
-       @LOC("F") public static final float table_ab2_d[] =
-       { 0.0f,           0.50000000000f, 0.50000000000f, 0.25000000000f, 0.50000000000f,
-         0.12500000000f, 0.06250000000f, 0.03125000000f, 0.01562500000f, 0.00781250000f,
-         0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f, 0.00024414063f,
-         0.00003051758f };
-
-       // subbands 11-22 in tables 3-B.2a and 2b:
-       @LOC("F") public static final int table_ab3_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 16 };
-       @LOC("F") public static final float table_ab3_factor[] =
-       { 0.0f, 1.0f/2.0f, 1.0f/4.0f, 1.0f/4.0f, 1.0f/8.0f, 1.0f/8.0f, 1.0f/16.0f, 1.0f/32768.0f };
-       @LOC("F") public static final float table_ab3_c[] =
-       { 0.0f,           1.33333333333f, 1.60000000000f, 1.14285714286f, 1.77777777777f,
-         1.06666666666f, 1.03225806452f, 1.00001525902f };
-       @LOC("F") public static final float table_ab3_d[] =
-       { 0.0f,           0.50000000000f, 0.50000000000f, 0.25000000000f, 0.50000000000f,
-         0.12500000000f, 0.06250000000f, 0.00003051758f };
-
-       // subbands 23-... in tables 3-B.2a and 2b:
-       @LOC("F") public static final int table_ab4_codelength[] = { 0, 5, 7, 16 };
-        @LOC("F") public static final float table_ab4_factor[] = { 0.0f, 1.0f/2.0f, 1.0f/4.0f, 1.0f/32768.0f };
-       @LOC("F") public static final float table_ab4_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, 1.00001525902f };
-       @LOC("F") public static final float table_ab4_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, 0.00003051758f };
-
-       // subbands in tables 3-B.2c and 2d:
-       @LOC("F") public static final int table_cd_codelength[] =
-       { 0, 5, 7, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
-       @LOC("F") public static final float table_cd_groupingtables[][] =
-       { null, grouping_5bits, grouping_7bits, grouping_10bits, null, null, null, null, null, null, null, null, null, null, null, null };
-       @LOC("F") public static final float table_cd_factor[] =
-       { 0.0f, 1.0f/2.0f, 1.0f/4.0f, 1.0f/8.0f, 1.0f/8.0f, 1.0f/16.0f, 1.0f/32.0f, 1.0f/64.0f,
-         1.0f/128.0f, 1.0f/256.0f, 1.0f/512.0f, 1.0f/1024.0f, 1.0f/2048.0f, 1.0f/4096.0f,
-         1.0f/8192.0f, 1.0f/16384.0f };
-       @LOC("F") public static final float table_cd_c[] =
-       { 0.0f,           1.33333333333f, 1.60000000000f, 1.77777777777f, 1.06666666666f,
-         1.03225806452f, 1.01587301587f, 1.00787401575f, 1.00392156863f, 1.00195694716f,
-         1.00097751711f, 1.00048851979f, 1.00024420024f, 1.00012208522f, 1.00006103888f,
-         1.00003051851f };
-       @LOC("F") public static final float table_cd_d[] =
-       { 0.0f,           0.50000000000f, 0.50000000000f, 0.50000000000f, 0.12500000000f,
-         0.06250000000f, 0.03125000000f, 0.01562500000f, 0.00781250000f, 0.00390625000f,
-         0.00195312500f, 0.00097656250f, 0.00048828125f, 0.00024414063f, 0.00012207031f,
-         0.00006103516f };
-
-
-
-         @LOC("F") protected int                       subbandnumber;
-         @LOC("F") protected int                               allocation;
-         @LOC("ARR") protected int                             scfsi;
-         @LOC("L") protected float                     scalefactor1;
-         @LOC("L") protected float                     scalefactor2;
-         @LOC("L") protected float                     scalefactor3;
-         @LOC("ARR") protected int[]                   codelength = {0}; 
-         @LOC("ARR") protected float                       groupingtable[][] = new float[2][]; 
-         //protected float[][]                 groupingtable = {{0},{0}} ;
-         @LOC("ARR") protected float[]                 factor = {0.0f};
-         @LOC("GN") protected int                              groupnumber;
-         @LOC("SN") protected int                      samplenumber;
-         @LOC("L") protected float[]                   samples = new float[3];
-         @LOC("ARR") protected float[]                 c = {0.0f};
-         @LOC("ARR") protected float[]                 d = {0.0f};
-         /**
-          * Constructor
-          */
-         public SubbandLayer2(@LOC("IN") int subbandnumber)
-         {     
-               this.subbandnumber = subbandnumber;
-           groupnumber = samplenumber = 0;  
-         }
-         
-         
-         /**
-          *
-          */
-         @RETURNLOC("OUT") 
-         protected int get_allocationlength (@LOC("IN") Header header)
-         {
-               if (header.version() == Header.MPEG1)
-               {
-                 @LOC("SH") int channel_bitrate = header.bitrate_index();
-
-                 // calculate bitrate per channel:
-                 if (header.mode() != Header.SINGLE_CHANNEL)
-                        if (channel_bitrate == 4)
-                               channel_bitrate = 1;
-                        else
-                               channel_bitrate -= 4;
-
-                 if (channel_bitrate == 1 || channel_bitrate == 2)
-                        // table 3-B.2c or 3-B.2d
-                        if (subbandnumber <= 1)
-                               return 4;
-                        else
-                               return 3;
-                 else
-                        // tables 3-B.2a or 3-B.2b
-                        if (subbandnumber <= 10)
-                               return 4;
-                        else if (subbandnumber <= 22)
-                               return 3;
-                        else
-                               return 2;
-           }
-               else
-               { // MPEG-2 LSF -- Jeff
-
-                // table B.1 of ISO/IEC 13818-3
-            if (subbandnumber <= 3)
-                       return 4;
-            else if (subbandnumber <= 10)
-                       return 3;
-            else
-                       return 2;
-           }
-         }
-         
-         /**
-          *
-          */
-           protected void prepare_sample_reading(@LOC("IN") Header header, @LOC("IN") int allocation,
-                                                 //float[][] groupingtable,
-                                                 @LOC("IN") int channel,
-                                                 @LOC("V") float[] factor, @LOC("V") int[] codelength,
-                                                 @LOC("V") float[] c, @LOC("V") float[] d)
-          {
-                       @LOC("SH")int channel_bitrate = header.bitrate_index();
-                       // calculate bitrate per channel:
-                       if (header.mode() != Header.SINGLE_CHANNEL)
-                               if (channel_bitrate == 4)
-                                       channel_bitrate = 1;
-                               else
-                                       channel_bitrate -= 4;
-                       
-                        if (channel_bitrate == 1 || channel_bitrate == 2)
-                        {
-                                // table 3-B.2c or 3-B.2d
-                                groupingtable[channel] = table_cd_groupingtables[allocation];
-                                factor[0] = table_cd_factor[allocation];
-                                codelength[0] = table_cd_codelength[allocation];
-                                c[0] = table_cd_c[allocation];
-                                d[0] = table_cd_d[allocation];
-                        }
-                        else
-                        {
-                                // tables 3-B.2a or 3-B.2b
-                                if (subbandnumber <= 2)
-                                {
-                                       groupingtable[channel] = table_ab1_groupingtables[allocation];
-                                       factor[0] = table_ab1_factor[allocation];
-                                       codelength[0] = table_ab1_codelength[allocation];
-                               c[0] = table_ab1_c[allocation];
-                               d[0] = table_ab1_d[allocation];
-                            }
-                                else
-                                {
-                               groupingtable[channel] = table_ab234_groupingtables[allocation];
-                                       if (subbandnumber <= 10)
-                                       {
-                                               factor[0] = table_ab2_factor[allocation];
-                                               codelength[0] = table_ab2_codelength[allocation];
-                                               c[0] = table_ab2_c[allocation];
-                                               d[0] = table_ab2_d[allocation];
-                               }
-                               else if (subbandnumber <= 22)
-                               {
-                                               factor[0] = table_ab3_factor[allocation];
-                                               codelength[0] = table_ab3_codelength[allocation];
-                                               c[0] = table_ab3_c[allocation];
-                                               d[0] = table_ab3_d[allocation];
-                               }
-                                       else
-                               {
-                                               factor[0] = table_ab4_factor[allocation];
-                                               codelength[0] = table_ab4_codelength[allocation];
-                                               c[0] = table_ab4_c[allocation];
-                                               d[0] = table_ab4_d[allocation];
-                               }
-                                }
-                        }   
-          }
-                                        
-         
-         /**
+@LATTICE("SB<H,H<SH,SH*,,SB*")
+@METHODDEFAULT("MODE<THIS,THIS<C,C<IN,THISLOC=THIS,C*")
+class LayerIIDecoder extends LayerIDecoder implements FrameDecoder {
+
+  public LayerIIDecoder() {
+  }
+
+  protected void createSubbands() {
+    @LOC("THIS,LayerIIDecoder.SB") int i;
+    if (mode == Header.SINGLE_CHANNEL)
+      for (i = 0; i < num_subbands; ++i)
+        subbands[i] = new SubbandLayer2(i);
+    else if (mode == Header.JOINT_STEREO) {
+      for (i = 0; i < header.intensity_stereo_bound(); ++i)
+        subbands[i] = new SubbandLayer2Stereo(i);
+      for (; i < num_subbands; ++i)
+        subbands[i] = new SubbandLayer2IntensityStereo(i);
+    } else {
+      for (i = 0; i < num_subbands; ++i)
+        subbands[i] = new SubbandLayer2Stereo(i);
+    }
+
+  }
+
+  protected void readScaleFactorSelection() {
+    // eom note: num_subbands is defined in LayerIDecoder so it has (THIS,
+    // LayerIDecoder) Loc
+    for (@LOC("THIS,LayerIIDecoder.SB") int i = 0; i < num_subbands; ++i) {
+      ((SubbandLayer2) subbands[i]).read_scalefactor_selection(stream, crc);
+    }
+  }
+
+  /**
+   * Class for layer II subbands in single channel mode.
+   */
+  @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,F,ARR,GN,SN,SH*,SM*")
+  @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  static class SubbandLayer2 extends Subband {
+    // this table contains 3 requantized samples for each legal codeword
+    // when grouped in 5 bits, i.e. 3 quantizationsteps per sample
+    public static final float grouping_5bits[] = new float[] { -2.0f / 3.0f, -2.0f / 3.0f,
+        -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f,
+        -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f,
+        -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f,
+        2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 0.0f,
+        -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        0.0f, 2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 0.0f,
+        2.0f / 3.0f, 2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f,
+        -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f,
+        2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f,
+        2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f,
+        2.0f / 3.0f };
+
+    // this table contains 3 requantized samples for each legal codeword
+    // when grouped in 7 bits, i.e. 5 quantizationsteps per sample
+    public static final float grouping_7bits[] = new float[] { -0.8f, -0.8f, -0.8f, -0.4f, -0.8f,
+        -0.8f, 0.0f, -0.8f, -0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.8f,
+        -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.8f, -0.8f,
+        0.0f, -0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f, -0.8f,
+        -0.8f, 0.4f, -0.8f, -0.4f, 0.4f, -0.8f, 0.0f, 0.4f, -0.8f, 0.4f, 0.4f, -0.8f, 0.8f, 0.4f,
+        -0.8f, -0.8f, 0.8f, -0.8f, -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.8f, 0.8f,
+        0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.4f, -0.8f, -0.4f, 0.0f, -0.8f, -0.4f, 0.4f, -0.8f,
+        -0.4f, 0.8f, -0.8f, -0.4f, -0.8f, -0.4f, -0.4f, -0.4f, -0.4f, -0.4f, 0.0f, -0.4f, -0.4f,
+        0.4f, -0.4f, -0.4f, 0.8f, -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.4f, 0.0f, -0.4f, 0.0f, 0.0f,
+        -0.4f, 0.4f, 0.0f, -0.4f, 0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.4f, 0.4f, -0.4f, 0.0f,
+        0.4f, -0.4f, 0.4f, 0.4f, -0.4f, 0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.4f, 0.8f, -0.4f,
+        0.0f, 0.8f, -0.4f, 0.4f, 0.8f, -0.4f, 0.8f, 0.8f, -0.4f, -0.8f, -0.8f, 0.0f, -0.4f, -0.8f,
+        0.0f, 0.0f, -0.8f, 0.0f, 0.4f, -0.8f, 0.0f, 0.8f, -0.8f, 0.0f, -0.8f, -0.4f, 0.0f, -0.4f,
+        -0.4f, 0.0f, 0.0f, -0.4f, 0.0f, 0.4f, -0.4f, 0.0f, 0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f,
+        -0.4f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f, 0.0f, 0.0f, 0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f,
+        -0.4f, 0.4f, 0.0f, 0.0f, 0.4f, 0.0f, 0.4f, 0.4f, 0.0f, 0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f,
+        -0.4f, 0.8f, 0.0f, 0.0f, 0.8f, 0.0f, 0.4f, 0.8f, 0.0f, 0.8f, 0.8f, 0.0f, -0.8f, -0.8f,
+        0.4f, -0.4f, -0.8f, 0.4f, 0.0f, -0.8f, 0.4f, 0.4f, -0.8f, 0.4f, 0.8f, -0.8f, 0.4f, -0.8f,
+        -0.4f, 0.4f, -0.4f, -0.4f, 0.4f, 0.0f, -0.4f, 0.4f, 0.4f, -0.4f, 0.4f, 0.8f, -0.4f, 0.4f,
+        -0.8f, 0.0f, 0.4f, -0.4f, 0.0f, 0.4f, 0.0f, 0.0f, 0.4f, 0.4f, 0.0f, 0.4f, 0.8f, 0.0f, 0.4f,
+        -0.8f, 0.4f, 0.4f, -0.4f, 0.4f, 0.4f, 0.0f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.8f, 0.4f, 0.4f,
+        -0.8f, 0.8f, 0.4f, -0.4f, 0.8f, 0.4f, 0.0f, 0.8f, 0.4f, 0.4f, 0.8f, 0.4f, 0.8f, 0.8f, 0.4f,
+        -0.8f, -0.8f, 0.8f, -0.4f, -0.8f, 0.8f, 0.0f, -0.8f, 0.8f, 0.4f, -0.8f, 0.8f, 0.8f, -0.8f,
+        0.8f, -0.8f, -0.4f, 0.8f, -0.4f, -0.4f, 0.8f, 0.0f, -0.4f, 0.8f, 0.4f, -0.4f, 0.8f, 0.8f,
+        -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.4f, 0.0f, 0.8f, 0.0f, 0.0f, 0.8f, 0.4f, 0.0f, 0.8f,
+        0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.4f, 0.4f, 0.8f, 0.0f, 0.4f, 0.8f, 0.4f, 0.4f, 0.8f,
+        0.8f, 0.4f, 0.8f, -0.8f, 0.8f, 0.8f, -0.4f, 0.8f, 0.8f, 0.0f, 0.8f, 0.8f, 0.4f, 0.8f, 0.8f,
+        0.8f, 0.8f, 0.8f };
+
+    // this table contains 3 requantized samples for each legal codeword
+    // when grouped in 10 bits, i.e. 9 quantizationsteps per sample
+    public static final float grouping_10bits[] = { -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
+        -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
+        -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
+        -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -6.0f / 9.0f,
+        -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
+        -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
+        -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
+        -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
+        4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
+        8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f,
+        -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f,
+        -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
+        -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f,
+        -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
+        -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f,
+        8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
+        -8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f,
+        2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
+        -8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
+        -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
+        8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        8.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
+        -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f,
+        0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f,
+        8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
+        -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f,
+        -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
+        -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f,
+        6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
+        6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
+        6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
+        8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
+        8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
+        -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f,
+        2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
+        -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
+        -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 2.0f / 9.0f,
+        0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f,
+        8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
+        -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        -4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f,
+        2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
+        -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
+        -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f,
+        6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
+        8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        8.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
+        -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
+        -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
+        -4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
+        -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f,
+        0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f,
+        8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
+        -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f,
+        -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
+        -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
+        8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f,
+        8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
+        -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 0.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f,
+        -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 0.0f,
+        2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f,
+        -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f,
+        -4.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f,
+        -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f,
+        -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f,
+        -6.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        0.0f, 2.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f,
+        8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f,
+        -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 0.0f,
+        2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f,
+        4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 0.0f,
+        4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f,
+        0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f,
+        6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f,
+        6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f,
+        -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f,
+        8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f,
+        8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f,
+        8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
+        -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
+        -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
+        2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f,
+        2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f,
+        2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
+        -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f,
+        -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f,
+        -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
+        -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
+        -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f,
+        -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
+        -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
+        2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f,
+        -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f,
+        2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f,
+        2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f,
+        2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f,
+        2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
+        4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f,
+        2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
+        6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f,
+        2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
+        8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, 8.0f / 9.0f,
+        2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f,
+        -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
+        -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f,
+        4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
+        4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f,
+        4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f,
+        4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f,
+        4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
+        4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f,
+        8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f,
+        -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
+        -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
+        -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f,
+        -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f,
+        -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f,
+        4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f,
+        4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
+        4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f,
+        -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f,
+        2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 0.0f,
+        4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
+        -2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
+        2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f,
+        -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
+        4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
+        4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
+        -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
+        4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
+        -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f,
+        8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f,
+        2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
+        -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
+        6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f,
+        4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f,
+        4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f,
+        4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
+        6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f,
+        8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
+        -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
+        -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
+        6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f,
+        -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f,
+        8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f,
+        8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f,
+        8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, 8.0f / 9.0f,
+        2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
+        6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f,
+        -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f,
+        -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
+        -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
+        -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f,
+        8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f,
+        8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f,
+        8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f,
+        8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f,
+        2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
+        6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f,
+        -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f,
+        8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f,
+        8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f,
+        0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f,
+        8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f,
+        8.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f,
+        4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
+        2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f,
+        4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f,
+        4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f,
+        8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f,
+        8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
+        6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f,
+        8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
+        -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f,
+        -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f,
+        8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f,
+        8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f };
+
+    // data taken from ISO/IEC DIS 11172, Annexes 3-B.2[abcd] and 3-B.4:
+
+    // subbands 0-2 in tables 3-B.2a and 2b: (index is allocation)
+    public static final int table_ab1_codelength[] =
+    // bits per codeword
+        { 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
+
+    public static final float table_ab1_groupingtables[][] =
+    // pointer to sample grouping table, or NULL-pointer if ungrouped
+        { null, grouping_5bits, null, null, null, null, null, null, null, null, null, null, null,
+            null, null, null };
+
+    public static final float table_ab1_factor[] =
+    // factor for requantization: (real)sample * factor - 1.0 gives requantized
+    // sample
+        { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f,
+            1.0f / 128.0f, 1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f,
+            1.0f / 4096.0f, 1.0f / 8192.0f, 1.0f / 16384.0f, 1.0f / 32768.0f };
+
+    public static final float table_ab1_c[] =
+    // factor c for requantization from table 3-B.4
+        { 0.0f, 1.33333333333f, 1.14285714286f, 1.06666666666f, 1.03225806452f, 1.01587301587f,
+            1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f,
+            1.00024420024f, 1.00012208522f, 1.00006103888f, 1.00003051851f, 1.00001525902f };
+
+    public static final float table_ab1_d[] =
+    // addend d for requantization from table 3-B.4
+        { 0.0f, 0.50000000000f, 0.25000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f,
+            0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f,
+            0.00048828125f, 0.00024414063f, 0.00012207031f, 0.00006103516f, 0.00003051758f };
+
+    // subbands 3-... tables 3-B.2a and 2b:
+    public static final float[] table_ab234_groupingtables[] = { null, grouping_5bits,
+        grouping_7bits, null, grouping_10bits, null, null, null, null, null, null, null, null,
+        null, null, null };
+
+    // subbands 3-10 in tables 3-B.2a and 2b:
+    public static final int table_ab2_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 6, 7, 8, 9, 10, 11,
+        12, 13, 16 };
+    public static final float table_ab2_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f,
+        1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f,
+        1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f,
+        1.0f / 32768.0f };
+    public static final float table_ab2_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
+        1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f,
+        1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f,
+        1.00024420024f, 1.00012208522f, 1.00001525902f };
+    public static final float table_ab2_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
+        0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f,
+        0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f,
+        0.00048828125f, 0.00024414063f, 0.00003051758f };
+
+    // subbands 11-22 in tables 3-B.2a and 2b:
+    public static final int table_ab3_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 16 };
+    public static final float table_ab3_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f,
+        1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32768.0f };
+    public static final float table_ab3_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
+        1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.00001525902f };
+    public static final float table_ab3_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
+        0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.00003051758f };
+
+    // subbands 23-... in tables 3-B.2a and 2b:
+    public static final int table_ab4_codelength[] = { 0, 5, 7, 16 };
+    public static final float table_ab4_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f,
+        1.0f / 32768.0f };
+    public static final float table_ab4_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
+        1.00001525902f };
+    public static final float table_ab4_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
+        0.00003051758f };
+
+    // subbands in tables 3-B.2c and 2d:
+    public static final int table_cd_codelength[] = { 0, 5, 7, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12,
+        13, 14, 15 };
+    public static final float table_cd_groupingtables[][] = { null, grouping_5bits, grouping_7bits,
+        grouping_10bits, null, null, null, null, null, null, null, null, null, null, null, null };
+    public static final float table_cd_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f,
+        1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f,
+        1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f, 1.0f / 8192.0f,
+        1.0f / 16384.0f };
+    public static final float table_cd_c[] = { 0.0f, 1.33333333333f, 1.60000000000f,
+        1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f, 1.00787401575f,
+        1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f,
+        1.00012208522f, 1.00006103888f, 1.00003051851f };
+    public static final float table_cd_d[] = { 0.0f, 0.50000000000f, 0.50000000000f,
+        0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, 0.01562500000f,
+        0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f,
+        0.00024414063f, 0.00012207031f, 0.00006103516f };
+
+    @LOC("SH")
+    protected int subbandnumber;
+    @LOC("SH")
+    protected int allocation;
+    @LOC("SH")
+    protected int scfsi;
+    @LOC("SH")
+    protected float scalefactor1;
+    @LOC("SH")
+    protected float scalefactor2;
+    @LOC("SH")
+    protected float scalefactor3;
+    @LOC("H")
+    protected int[] codelength = { 0 };
+    @LOC("SH")
+    protected float groupingtable[][] = new float[2][];
+    // protected float[][] groupingtable = {{0},{0}} ;
+    @LOC("SM")
+    protected float[] factor = { 0.0f };
+    @LOC("SH")
+    protected int groupnumber;
+    @LOC("SM")
+    protected int samplenumber;
+    @LOC("SM")
+    protected float[] samples = new float[3];
+    @LOC("SM")
+    protected float[] c = { 0.0f };
+    @LOC("SM")
+    protected float[] d = { 0.0f };
+
+    /**
+     * Constructor
+     */
+    public SubbandLayer2(@LOC("IN") int subbandnumber) {
+      this.subbandnumber = subbandnumber;
+      groupnumber = samplenumber = 0;
+    }
+
+    /**
           *
           */
-          @LATTICE("OUT<V,V<SH,SH<IN,SH*,THISLOC=OUT,GLOBALLOC=IN")
-         public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header, @LOC("IN") Crc16 crc)
-         {
-                @LOC("V") int length = get_allocationlength(header);
-                allocation = stream.get_bits(length);
-                if (crc != null) 
-                        crc.add_bits(allocation, length);  
-         }
-         
-         /**
+    protected int get_allocationlength(@LOC("IN") Header header) {
+
+      if (header.version() == Header.MPEG1) {
+
+        @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") int channel_bitrate = header.bitrate_index();
+
+        // calculate bitrate per channel:
+        if (header.mode() != Header.SINGLE_CHANNEL)
+          if (channel_bitrate == 4)
+            channel_bitrate = 1;
+          else
+            channel_bitrate -= 4;
+
+        if (channel_bitrate == 1 || channel_bitrate == 2)
+          // table 3-B.2c or 3-B.2d
+          if (subbandnumber <= 1)
+            return 4;
+          else
+            return 3;
+        else
+        // tables 3-B.2a or 3-B.2b
+        if (subbandnumber <= 10)
+          return 4;
+        else if (subbandnumber <= 22)
+          return 3;
+        else
+          return 2;
+      } else { // MPEG-2 LSF -- Jeff
+
+        // table B.1 of ISO/IEC 13818-3
+        if (subbandnumber <= 3)
+          return 4;
+        else if (subbandnumber <= 10)
+          return 3;
+        else
+          return 2;
+      }
+    }
+
+    /**
           *
           */
-         public void read_scalefactor_selection (@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc)
-         {
-               if (allocation != 0)
-               {
-               scfsi = stream.get_bits(2);
-               if (crc != null) crc.add_bits(scfsi, 2);
-           }
-         }
-
-         /**
+    @LATTICE("OUT<THIS,THIS<IN,THISLOC=THIS")
+    protected void prepare_sample_reading(@LOC("IN") Header header, @LOC("IN") int allocation,
+        // float[][] groupingtable,
+        @LOC("IN") int channel, @LOC("OUT") float[] factor, @LOC("OUT") int[] codelength,
+        @LOC("OUT") float[] c, @LOC("OUT") float[] d) {
+
+      // header.bitrate_index() will generate at most DELTA(THIS,SH*)
+      @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") int channel_bitrate = header.bitrate_index();
+
+      // calculate bitrate per channel:
+      if (header.mode() != Header.SINGLE_CHANNEL) {
+        if (channel_bitrate == 4) {
+          channel_bitrate = 1;
+        } else {
+          channel_bitrate -= 4;
+        }
+      }
+
+      if (channel_bitrate == 1 || channel_bitrate == 2) {
+        // table 3-B.2c or 3-B.2d
+        groupingtable[channel] = table_cd_groupingtables[allocation];
+        factor[0] = table_cd_factor[allocation];
+        codelength[0] = table_cd_codelength[allocation];
+        c[0] = table_cd_c[allocation];
+        d[0] = table_cd_d[allocation];
+      } else {
+        // tables 3-B.2a or 3-B.2b
+        if (subbandnumber <= 2) {
+          groupingtable[channel] = table_ab1_groupingtables[allocation];
+          factor[0] = table_ab1_factor[allocation];
+          codelength[0] = table_ab1_codelength[allocation];
+          c[0] = table_ab1_c[allocation];
+          d[0] = table_ab1_d[allocation];
+        } else {
+          groupingtable[channel] = table_ab234_groupingtables[allocation];
+          if (subbandnumber <= 10) {
+            factor[0] = table_ab2_factor[allocation];
+            codelength[0] = table_ab2_codelength[allocation];
+            c[0] = table_ab2_c[allocation];
+            d[0] = table_ab2_d[allocation];
+          } else if (subbandnumber <= 22) {
+            factor[0] = table_ab3_factor[allocation];
+            codelength[0] = table_ab3_codelength[allocation];
+            c[0] = table_ab3_c[allocation];
+            d[0] = table_ab3_d[allocation];
+          } else {
+            factor[0] = table_ab4_factor[allocation];
+            codelength[0] = table_ab4_codelength[allocation];
+            c[0] = table_ab4_c[allocation];
+            d[0] = table_ab4_d[allocation];
+          }
+        }
+      }
+    }
+
+    /**
           *
           */
-         public void read_scalefactor (@LOC("IN") Bitstream stream, @LOC("IN") Header header)
-         {
-               if (allocation != 0)
-               {
-                  switch (scfsi)
-                  {
-                  case 0:
-                        scalefactor1 = scalefactors[stream.get_bits(6)];
-                        scalefactor2 = scalefactors[stream.get_bits(6)];
-                        scalefactor3 = scalefactors[stream.get_bits(6)];
-                        break;
-                       case 1:
-                        scalefactor1 = scalefactor2 = scalefactors[stream.get_bits(6)];
-                        scalefactor3 = scalefactors[stream.get_bits(6)];
-                        break;
-                  case 2:
-                        scalefactor1 = scalefactor2 = scalefactor3 = scalefactors[stream.get_bits(6)];
-                        break;
-                  case 3:
-                        scalefactor1 = scalefactors[stream.get_bits(6)];
-                        scalefactor2 = scalefactor3 = scalefactors[stream.get_bits(6)];
-                        break;
-               }
-               prepare_sample_reading(header, allocation, 0,
-                                   factor, codelength, c, d);
-         }
-         }
-         
-         /**
+    @LATTICE("V<THIS,THIS<IN,THISLOC=THIS")
+    // ssjava
+    public void read_allocation(@LOC("IN") Bitstream stream,
+        @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") Header header, @LOC("IN") Crc16 crc) {
+
+      @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") int length = get_allocationlength(header); // return
+                                                                                              // DELTA(THIS)
+      allocation = stream.get_bits(length);
+      if (crc != null) {
+        crc.add_bits(allocation, length);
+      }
+    }
+
+    /**
           *
           */
-//          @LATTICE("OUT<V,V<SH,SH<TEMP,TEMP<TMP,TMP<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
-         @LATTICE("OUT<V,V<TEMP,TEMP<TMP,TMP<SH,SH<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
-         @RETURNLOC("V")
-         public boolean read_sampledata (@LOC("IN") Bitstream stream)
-         {
-               if (allocation != 0)
-                if (groupingtable[0] != null)
-                {
-                       @LOC("SH") int samplecode = stream.get_bits(codelength[0]);
-                       // create requantized samples:
-                       samplecode += samplecode << 1;
-                       //float[] target = samples;  //subbed in variable to reduce areas
-                       //float[] source = groupingtable[0];  //subbed in variable to reduce areas
-                 /*
-                 int tmp = 0;
-                       int temp = 0;
-                       target[tmp++] = source[samplecode + temp];
-                       temp++;
-                       target[tmp++] = source[samplecode + temp];
-                       temp++;
-                       target[tmp] = source[samplecode + temp];
-                       */
-                       //Bugfix:
-                       @LOC("TMP") int tmp = 0;
-                       @LOC("TEMP") int temp = samplecode;
-                       
-//                     if(temp > source.length - 3) temp = source.length - 3;
-                       if(temp > groupingtable[0].length - 3) temp = groupingtable[0].length - 3;
-                       
-                       samples[tmp] = groupingtable[0][temp];
-                       temp++;tmp++;
-                       samples[tmp] = groupingtable[0][temp];
-                       temp++;tmp++;
-                       samples[tmp] = groupingtable[0][temp];
-                       
-                       // memcpy (samples, groupingtable + samplecode, 3 * sizeof (real));
-                }
-                else
-                {
-                       samples[0] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
-                       samples[1] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
-                       samples[2] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
-                }
-
-               samplenumber = 0;
-                 if (++groupnumber == 12)
-                        return true;
-                 else
-                        return false;
-         }
-
-         /**
+    public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc) {
+      if (allocation != 0) {
+        scfsi = stream.get_bits(2);
+        if (crc != null)
+          crc.add_bits(scfsi, 2);
+      }
+    }
+
+    /**
           *
           */
-       @RETURNLOC("THIS")
-         public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1, @LOC("IN") SynthesisFilter filter2)
-         {
-           if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL))
-           {
-                @LOC("SH") float sample = samples[samplenumber];
-         
-                if (groupingtable[0] == null)
-                       sample = (sample + d[0]) * c[0];
-                if (groupnumber <= 4)
-                       sample *= scalefactor1;
-                else if (groupnumber <= 8)
-                       sample *= scalefactor2;
-                else
-                       sample *= scalefactor3;
-                filter1.input_sample(sample, subbandnumber);
-           }
-         
-           if (++samplenumber == 3)
-                return true;
-           else
-                return false;
-         }
-       };
-       
-        /**
-         * Class for layer II subbands in joint stereo mode.
-         */
-     @LATTICE("S<L,L<H,L<ARR,ARR<F,SN<F,GN<F,F<H,H<SH,SN*,GN*,L*")
-       @METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-       static class SubbandLayer2IntensityStereo extends SubbandLayer2
-       {
-         @LOC("ARR") protected int              channel2_scfsi;
-         @LOC("L") protected float      channel2_scalefactor1; 
-         @LOC("L") protected float        channel2_scalefactor2;
-         @LOC("L") protected float        channel2_scalefactor3;
-
-         /**
-          * Constructor
-          */
-         public SubbandLayer2IntensityStereo (@LOC("IN") int subbandnumber)
-         {
-               super(subbandnumber);
-         }
+    public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
+      if (allocation != 0) {
+        switch (scfsi) {
+        case 0:
+          scalefactor1 = scalefactors[stream.get_bits(6)];
+          scalefactor2 = scalefactors[stream.get_bits(6)];
+          scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+        case 1:
+          scalefactor1 = scalefactor2 = scalefactors[stream.get_bits(6)];
+          scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+        case 2:
+          scalefactor1 = scalefactor2 = scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+        case 3:
+          scalefactor1 = scalefactors[stream.get_bits(6)];
+          scalefactor2 = scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+        }
+        prepare_sample_reading(header, allocation, 0, factor, codelength, c, d);
+      }
+    }
 
-         /**
+    /**
           *
           */
-         public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header, @LOC("IN") Crc16 crc)
-         {
-           super.read_allocation (stream, header, crc);
-         }
-         
-         /**
+    // @LATTICE("OUT<V,V<SH,SH<TEMP,TEMP<TMP,TMP<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
+    // @LATTICE("OUT<V,V<TEMP,TEMP<TMP,TMP<SH,SH<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
+    // @RETURNLOC("V")
+    // ssjava
+    public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+      if (allocation != 0) {
+        if (groupingtable[0] != null) {
+
+          @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") int samplecode =
+              stream.get_bits(codelength[0]);
+          // create requantized samples:
+          samplecode += samplecode << 1;
+          // float[] target = samples; //subbed in variable to reduce areas
+          // float[] source = groupingtable[0]; //subbed in variable to reduce
+          // areas
+          /*
+           * int tmp = 0; int temp = 0; target[tmp++] = source[samplecode +
+           * temp]; temp++; target[tmp++] = source[samplecode + temp]; temp++;
+           * target[tmp] = source[samplecode + temp];
+           */
+          // Bugfix:
+          @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") int tmp = 0;
+          @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") int temp = samplecode;
+
+          // if(temp > source.length - 3) temp = source.length - 3;
+          if (temp > groupingtable[0].length - 3) {
+            temp = groupingtable[0].length - 3;
+          }
+
+          samples[tmp] = groupingtable[0][temp];
+          temp++;
+          tmp++;
+          samples[tmp] = groupingtable[0][temp];
+          temp++;
+          tmp++;
+          samples[tmp] = groupingtable[0][temp];
+
+          // memcpy (samples, groupingtable + samplecode, 3 * sizeof (real));
+        } else {
+          samples[0] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
+          samples[1] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
+          samples[2] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
+        }
+      }
+      samplenumber = 0;
+      if (++groupnumber == 12)
+        return true;
+      else
+        return false;
+    }
+
+    // ssjava
+    public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
+        @LOC("IN") SynthesisFilter filter2) {
+
+      if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) {
+
+        @LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") float sample = samples[samplenumber];
+
+        if (groupingtable[0] == null) {
+          sample = (sample + d[0]) * c[0];
+        }
+        if (groupnumber <= 4) {
+          sample *= scalefactor1;
+        } else if (groupnumber <= 8) {
+          sample *= scalefactor2;
+        } else {
+          sample *= scalefactor3;
+        }
+        filter1.input_sample(sample, subbandnumber);
+      }
+
+      if (++samplenumber == 3)
+        return true;
+      else
+        return false;
+    }
+  };
+
+  /**
+   * Class for layer II subbands in joint stereo mode.
+   */
+  @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,F,ARR,GN,SN,SH*,SM*")
+  @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  static class SubbandLayer2IntensityStereo extends SubbandLayer2 {
+    @LOC("SH")
+    protected int channel2_scfsi;
+    @LOC("SH")
+    protected float channel2_scalefactor1;
+    @LOC("SH")
+    protected float channel2_scalefactor2;
+    @LOC("SH")
+    protected float channel2_scalefactor3;
+
+    /**
+     * Constructor
+     */
+    public SubbandLayer2IntensityStereo(@LOC("IN") int subbandnumber) {
+      super(subbandnumber);
+    }
+
+    /**
           *
           */
-         public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc)
-         {
-           if (allocation != 0)
-           {
-                scfsi = stream.get_bits(2);
-                channel2_scfsi = stream.get_bits(2);
-                if (crc != null)
-                {
-                       crc.add_bits(scfsi, 2);
-                       crc.add_bits(channel2_scfsi, 2);
-                }
-           }  
-         }
-         
-         /**
+    public void read_allocation(@LOC("IN") Bitstream stream, @LOC("THIS") Header header,
+        @LOC("IN") Crc16 crc) {
+      super.read_allocation(stream, header, crc);
+    }
+
+    /**
           *
           */
-           public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header)
-         {
-           if (allocation != 0)
-           {
-                super.read_scalefactor(stream, header);
-                switch (channel2_scfsi)
-                {
-                case 0:
-                  channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
-                  channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
-                  channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
-                  break;
-
-                case 1:
-                  channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
-                  channel2_scalefactor2 = channel2_scalefactor1;
-                  channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
-                  break;
-
-                case 2:
-                  channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
-                  channel2_scalefactor2 = channel2_scalefactor1;
-                  channel2_scalefactor3 = channel2_scalefactor2;
-                  break;
-
-                case 3:
-                  channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
-                  channel2_scalefactor2 = scalefactors[stream.get_bits (6)];
-                  channel2_scalefactor3 = channel2_scalefactor2;
-                  break;
-                }
-           }
-         
-         }
-         
-         /**
+    public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc) {
+      if (allocation != 0) {
+        scfsi = stream.get_bits(2);
+        channel2_scfsi = stream.get_bits(2);
+        if (crc != null) {
+          crc.add_bits(scfsi, 2);
+          crc.add_bits(channel2_scfsi, 2);
+        }
+      }
+    }
+
+    /**
           *
           */
-         @RETURNLOC("V")
-         public boolean read_sampledata(@LOC("IN") Bitstream stream)
-         {
-                return super.read_sampledata (stream);
-         }
-         
-         /**
+    public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
+      if (allocation != 0) {
+        super.read_scalefactor(stream, header);
+        switch (channel2_scfsi) {
+        case 0:
+          channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+
+        case 1:
+          channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor2 = channel2_scalefactor1;
+          channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+
+        case 2:
+          channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor2 = channel2_scalefactor1;
+          channel2_scalefactor3 = channel2_scalefactor2;
+          break;
+
+        case 3:
+          channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor3 = channel2_scalefactor2;
+          break;
+        }
+      }
+
+    }
+
+    /**
           *
           */
-          @LATTICE("S2<S1,S1<THIS,THIS<GLOBAL,GLOBAL<IN,S1*,THISLOC=THIS,GLOBALLOC=GLOBAL")
-         @RETURNLOC("S2")
-         public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1, @LOC("IN") SynthesisFilter filter2)
-         {
-                 if (allocation != 0)
-                 {
-                       @LOC("S1") float sample = samples[samplenumber];
-               
-                        if (groupingtable[0] == null)
-                               sample = (sample + d[0]) * c[0];
-                      if (channels == OutputChannels.BOTH_CHANNELS)
-                          {
-                             @LOC("S2") float sample2 = sample;
-                             if (groupnumber <= 4)
-                             {
-                                       sample *= scalefactor1;
-                                       sample2 *= channel2_scalefactor1;
-                                 }
-                                 else if (groupnumber <= 8)
-                                 {
-                                       sample *= scalefactor2;
-                                       sample2 *= channel2_scalefactor2;
-                                 }
-                                 else
-                                 {
-                                       sample *= scalefactor3;
-                                       sample2 *= channel2_scalefactor3;
-                                 }
-                                 filter1.input_sample(sample, subbandnumber);
-                             filter2.input_sample(sample2, subbandnumber);
-                           }
-                               else if (channels == OutputChannels.LEFT_CHANNEL)
-                               {
-                                       if (groupnumber <= 4)
-                                               sample *= scalefactor1;
-                               else if (groupnumber <= 8)
-                                               sample *= scalefactor2;
-                                       else
-                                               sample *= scalefactor3;
-                                       filter1.input_sample(sample, subbandnumber);
-                                }
-                                else
-                                {
-                                       if (groupnumber <= 4)
-                                       sample *= channel2_scalefactor1;
-                                       else if (groupnumber <= 8)
-                                               sample *= channel2_scalefactor2;
-                                       else
-                                               sample *= channel2_scalefactor3;
-                                       filter1.input_sample(sample, subbandnumber);
-                               }
-                       }
-               
-                 if (++samplenumber == 3)
-                        return true;
-                 else
-                return false;
-         }
-       };
-
-        /**
-         * Class for layer II subbands in stereo mode.
-         */
-     @LATTICE("S<L,L<H,L<ARR,ARR<F,SN<F,GN<F,F<H,H<SH,SN*,GN*")
-       @METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-       static class SubbandLayer2Stereo extends SubbandLayer2
-       {
-         @LOC("F")protected int                        channel2_allocation;
-         @LOC("ARR") protected int             channel2_scfsi;
-         @LOC("L") protected float             channel2_scalefactor1;
-         @LOC("L") protected float channel2_scalefactor2;
-         @LOC("L") protected float channel2_scalefactor3;
-         //protected boolean           channel2_grouping;  ???? Never used!
-         @LOC("ARR") protected int[]           channel2_codelength = {0};
-         //protected float[][]         channel2_groupingtable = {{0},{0}};
-         @LOC("ARR") protected float[]         channel2_factor = {0.0f};
-         @LOC("L") protected float[]   channel2_samples;
-         @LOC("ARR") protected float[]         channel2_c = {0.0f};
-         @LOC("ARR") protected float[]         channel2_d = {0.0f};
-         
-         /**
-          * Constructor
-          */
-         public SubbandLayer2Stereo(@LOC("IN") int subbandnumber)
-         {
-               super(subbandnumber);
-               channel2_samples = new float[3];
-         }
-         
-         /**
+    public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+      return super.read_sampledata(stream);
+    }
+
+    /**
           *
           */
-          @LATTICE("OUT<SH,SH<THIS,THIS<V,V<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-         public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header, @LOC("IN") Crc16 crc)
-         {
-           @LOC("V") int length = get_allocationlength(header);
-           allocation = stream.get_bits(length);
-           channel2_allocation = stream.get_bits(length);
-           if (crc != null)
-           {
-                crc.add_bits(allocation, length);
-                crc.add_bits(channel2_allocation, length);
-           }
-         }
-
-         /**
+    @LATTICE("S2<S1,S1<THIS,THIS<GLOBAL,GLOBAL<IN,S1*,THISLOC=THIS,GLOBALLOC=GLOBAL")
+    @RETURNLOC("S2")
+    public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
+        @LOC("IN") SynthesisFilter filter2) {
+      if (allocation != 0) {
+        @LOC("S1") float sample = samples[samplenumber];
+
+        if (groupingtable[0] == null)
+          sample = (sample + d[0]) * c[0];
+        if (channels == OutputChannels.BOTH_CHANNELS) {
+          @LOC("S2") float sample2 = sample;
+          if (groupnumber <= 4) {
+            sample *= scalefactor1;
+            sample2 *= channel2_scalefactor1;
+          } else if (groupnumber <= 8) {
+            sample *= scalefactor2;
+            sample2 *= channel2_scalefactor2;
+          } else {
+            sample *= scalefactor3;
+            sample2 *= channel2_scalefactor3;
+          }
+          filter1.input_sample(sample, subbandnumber);
+          filter2.input_sample(sample2, subbandnumber);
+        } else if (channels == OutputChannels.LEFT_CHANNEL) {
+          if (groupnumber <= 4)
+            sample *= scalefactor1;
+          else if (groupnumber <= 8)
+            sample *= scalefactor2;
+          else
+            sample *= scalefactor3;
+          filter1.input_sample(sample, subbandnumber);
+        } else {
+          if (groupnumber <= 4)
+            sample *= channel2_scalefactor1;
+          else if (groupnumber <= 8)
+            sample *= channel2_scalefactor2;
+          else
+            sample *= channel2_scalefactor3;
+          filter1.input_sample(sample, subbandnumber);
+        }
+      }
+
+      if (++samplenumber == 3)
+        return true;
+      else
+        return false;
+    }
+  };
+
+  /**
+   * Class for layer II subbands in stereo mode.
+   */
+  @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,F,ARR,GN,SN,SH*,SM*")
+  @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+  static class SubbandLayer2Stereo extends SubbandLayer2 {
+    @LOC("SH")
+    protected int channel2_allocation;
+    @LOC("SH")
+    protected int channel2_scfsi;
+    @LOC("SH")
+    protected float channel2_scalefactor1;
+    @LOC("SH")
+    protected float channel2_scalefactor2;
+    @LOC("SH")
+    protected float channel2_scalefactor3;
+    // protected boolean channel2_grouping; ???? Never used!
+    @LOC("H")
+    protected int[] channel2_codelength = { 0 };
+    // protected float[][] channel2_groupingtable = {{0},{0}};
+    @LOC("H")
+    protected float[] channel2_factor = { 0.0f };
+    @LOC("SM")
+    protected float[] channel2_samples;
+    @LOC("SM")
+    protected float[] channel2_c = { 0.0f };
+    @LOC("SM")
+    protected float[] channel2_d = { 0.0f };
+
+    /**
+     * Constructor
+     */
+    public SubbandLayer2Stereo(@LOC("IN") int subbandnumber) {
+      super(subbandnumber);
+      channel2_samples = new float[3];
+    }
+
+    /**
           *
           */
-         public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc)
-         {
-                 if (allocation != 0)
-                 {
-                        scfsi = stream.get_bits(2);
-                        if (crc != null)
-                               crc.add_bits(scfsi, 2);
-                 }
-                 if (channel2_allocation != 0)
-                 {
-                        channel2_scfsi = stream.get_bits(2);
-                        if (crc != null)
-                               crc.add_bits(channel2_scfsi, 2);
-                 }
-         }
-
-         /**
+    @LATTICE("OUT<SH,SH<THIS,THIS<V,V<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
+    public void read_allocation(@LOC("IN") Bitstream stream,
+        @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH") Header header, @LOC("IN") Crc16 crc) {
+      @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH") int length = get_allocationlength(header);
+      allocation = stream.get_bits(length);
+      channel2_allocation = stream.get_bits(length);
+      if (crc != null) {
+        crc.add_bits(allocation, length);
+        crc.add_bits(channel2_allocation, length);
+      }
+    }
+
+    /**
           *
           */
-           public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header)
-         {
-           super.read_scalefactor(stream, header);
-           if (channel2_allocation != 0)
-           {
-                switch (channel2_scfsi)
-                {
-                       case 0:
-                  channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
-                          channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
-                      channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
-                      break;
-         
-                       case 1:
-                          channel2_scalefactor1 = channel2_scalefactor2 =
-                                                                     scalefactors[stream.get_bits(6)];
-                      channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
-                      break;
-         
-                       case 2:
-                          channel2_scalefactor1 = channel2_scalefactor2 =
-                      channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
-                      break;
-         
-                       case 3:
-                          channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
-                      channel2_scalefactor2 = channel2_scalefactor3 =
-                                                                          scalefactors[stream.get_bits(6)];
-                  break;
-                }
-                prepare_sample_reading(header, channel2_allocation, 1,
-                                    channel2_factor, channel2_codelength, channel2_c,
-                                    channel2_d);
-          }
-         }
-
-         /**
+    public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc) {
+      if (allocation != 0) {
+        scfsi = stream.get_bits(2);
+        if (crc != null)
+          crc.add_bits(scfsi, 2);
+      }
+      if (channel2_allocation != 0) {
+        channel2_scfsi = stream.get_bits(2);
+        if (crc != null)
+          crc.add_bits(channel2_scfsi, 2);
+      }
+    }
+
+    /**
           *
           */
-          @LATTICE("OUT<V,V<TEMP,TEMP<SH,TEMP<TMP,TMP<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
-         @RETURNLOC("V")
-         public boolean read_sampledata (@LOC("IN") Bitstream stream)
-         {
-           @LOC("V")boolean returnvalue = super.read_sampledata(stream);
-         
-           if (channel2_allocation != 0)
-                if (groupingtable[1] != null)
-                {
-                       @LOC("SH") int samplecode = stream.get_bits(channel2_codelength[0]);
-                       // create requantized samples:
-                       samplecode += samplecode << 1;
-               /*
-                       float[] target = channel2_samples;
-                       float[] source = channel2_groupingtable[0];
-                       int tmp = 0;
-                       int temp = 0;
-                       target[tmp++] = source[samplecode + temp];
-                       temp++;
-                       target[tmp++] = source[samplecode + temp];
-                       temp++;
-                       target[tmp] = source[samplecode + temp];
-                       // memcpy (channel2_samples, channel2_groupingtable + samplecode, 3 * sizeof (real));
-               */
-                       @LOC("V") float[] target = channel2_samples;
-                       @LOC("V") float[] source = groupingtable[1];
-                       @LOC("TMP") int tmp = 0;
-                       @LOC("TEMP") int temp = samplecode;
-               target[tmp] = source[temp];
-                       temp++;tmp++;
-               target[tmp] = source[temp];
-                       temp++;tmp++;
-               target[tmp] = source[temp];
-               
-             } 
-                 else 
-                 {
-                       channel2_samples[0] = (float) ((stream.get_bits(channel2_codelength[0])) *
-                                                                        channel2_factor[0] - 1.0);
-                       channel2_samples[1] = (float) ((stream.get_bits(channel2_codelength[0])) *
-                                                                        channel2_factor[0] - 1.0);
-                       channel2_samples[2] = (float) ((stream.get_bits(channel2_codelength[0])) *
-                                     channel2_factor[0] - 1.0);
-                }
-            return returnvalue;
-         }
-
-         /**
+    public void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header) {
+      super.read_scalefactor(stream, header);
+      if (channel2_allocation != 0) {
+        switch (channel2_scfsi) {
+        case 0:
+          channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+
+        case 1:
+          channel2_scalefactor1 = channel2_scalefactor2 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+
+        case 2:
+          channel2_scalefactor1 =
+              channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+
+        case 3:
+          channel2_scalefactor1 = scalefactors[stream.get_bits(6)];
+          channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream.get_bits(6)];
+          break;
+        }
+        prepare_sample_reading(header, channel2_allocation, 1, channel2_factor,
+            channel2_codelength, channel2_c, channel2_d);
+      }
+    }
+
+    /**
           *
           */
-         @RETURNLOC("V")
-         public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1, @LOC("IN") SynthesisFilter filter2)
-         {
-           @LOC("V") boolean returnvalue = super.put_next_sample(channels, filter1, filter2);
-           if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL))
-           {
-               @LOC("SH") float sample = channel2_samples[samplenumber - 1];
-         
-                if (groupingtable[1] == null)
-                       sample = (sample + channel2_d[0]) * channel2_c[0];
-         
-                if (groupnumber <= 4)
-                       sample *= channel2_scalefactor1;
-                else if (groupnumber <= 8)
-                       sample *= channel2_scalefactor2;
-                else
-                       sample *= channel2_scalefactor3;
-                if (channels == OutputChannels.BOTH_CHANNELS)
-                       filter2.input_sample(sample, subbandnumber);
-                else
-                       filter1.input_sample(sample, subbandnumber);
-           }
-               return returnvalue;
-         }
-       }
+    // ssjava
+    public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+      @LOC("V") boolean returnvalue = super.read_sampledata(stream);
+
+      if (channel2_allocation != 0)
+        if (groupingtable[1] != null) {
+          @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") int samplecode =
+              stream.get_bits(channel2_codelength[0]);
+          // create requantized samples:
+          samplecode += samplecode << 1;
+
+          @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") int tmp = 0;
+          @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") int temp = samplecode;
+
+          channel2_samples[tmp] = groupingtable[1][temp];
+          temp++;
+          tmp++;
+          channel2_samples[tmp] = groupingtable[1][temp];
+          temp++;
+          tmp++;
+          channel2_samples[tmp] = groupingtable[1][temp];
+
+        } else {
+          channel2_samples[0] =
+              (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0);
+          channel2_samples[1] =
+              (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0);
+          channel2_samples[2] =
+              (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0);
+        }
+      return returnvalue;
+    }
+
+    // ssjava
+    public boolean put_next_sample(@LOC("IN") int channels, @LOC("IN") SynthesisFilter filter1,
+        @LOC("IN") SynthesisFilter filter2) {
+
+      @LOC("OUT") boolean returnvalue = super.put_next_sample(channels, filter1, filter2);
+
+      if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) {
+
+        @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") float sample =
+            channel2_samples[samplenumber - 1];
+
+        if (groupingtable[1] == null) {
+          sample = (sample + channel2_d[0]) * channel2_c[0];
+        }
+
+        if (groupnumber <= 4) {
+          sample *= channel2_scalefactor1;
+        } else if (groupnumber <= 8) {
+          sample *= channel2_scalefactor2;
+        } else {
+          sample *= channel2_scalefactor3;
+        }
+
+        if (channels == OutputChannels.BOTH_CHANNELS) {
+          filter2.input_sample(sample, subbandnumber);
+        } else {
+          filter1.input_sample(sample, subbandnumber);
+        }
+      }
+
+      return returnvalue;
+
+    }
+  }
 }
index bf0319a..2dd0805 100644 (file)
@@ -4,7 +4,8 @@
  * Abstract base class for subband classes of layer I and II
  */
 @LATTICE("S<L,L<H,H<SH")
-@METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
+  @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+//@METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
 static abstract class Subband
 {
  /*
@@ -13,7 +14,7 @@ static abstract class Subband
   *      is illegal (to prevent segmentation faults)
   */
   // Scalefactors for layer I and II, Annex 3-B.1 in ISO/IEC DIS 11172:
-  @LOC("H") public static final float scalefactors[] =
+  public static final float scalefactors[] =
   {
   2.00000000000000f, 1.58740105196820f, 1.25992104989487f, 1.00000000000000f,
   0.79370052598410f, 0.62996052494744f, 0.50000000000000f, 0.39685026299205f,