changes.
authoryeom <yeom>
Tue, 13 Dec 2011 01:43:14 +0000 (01:43 +0000)
committeryeom <yeom>
Tue, 13 Dec 2011 01:43:14 +0000 (01:43 +0000)
Robust/src/Analysis/SSJava/DefinitelyWrittenCheck.java
Robust/src/Benchmarks/SSJava/MP3Decoder/LayerIIIDecoder.java
Robust/src/Benchmarks/SSJava/MP3Decoder/SynthesisFilter.java

index 2e1598d22d52563344f880ba733749dce6b2840c..fd02c24d4f91e3f113318a31cafe22c908b37ac3 100644 (file)
@@ -8,6 +8,7 @@ import java.util.LinkedList;
 import java.util.Set;
 import java.util.Stack;
 
+import Analysis.Liveness;
 import Analysis.CallGraph.CallGraph;
 import Analysis.Loops.LoopFinder;
 import IR.Descriptor;
@@ -37,6 +38,8 @@ public class DefinitelyWrittenCheck {
   State state;
   CallGraph callGraph;
 
+  Liveness liveness;
+
   int debugcount = 0;
 
   // maps a descriptor to its known dependents: namely
@@ -127,6 +130,8 @@ public class DefinitelyWrittenCheck {
   private SharedLocMap calleeUnionBoundDeleteSet;
   private SharedLocMap calleeIntersectBoundSharedSet;
 
+  Set<TempDescriptor> liveInTempSetToEventLoop;
+
   private Hashtable<Descriptor, Location> mapDescToLocation;
 
   private TempDescriptor LOCAL;
@@ -168,6 +173,8 @@ public class DefinitelyWrittenCheck {
     this.mapMethodToSharedLocCoverSet =
         new Hashtable<MethodDescriptor, MultiSourceMap<NTuple<Location>, NTuple<Descriptor>>>();
     this.mapFlatNodeToDeleteSet = new Hashtable<FlatNode, SharedLocMap>();
+    this.liveness = new Liveness();
+    this.liveInTempSetToEventLoop = new HashSet<TempDescriptor>();
   }
 
   public void definitelyWrittenCheck() {
@@ -344,31 +351,35 @@ public class DefinitelyWrittenCheck {
           if (!lhs.getSymbol().startsWith("neverused") && !lhs.getSymbol().startsWith("leftop")
               && !lhs.getSymbol().startsWith("rightop") && rhs.getType().isImmutable()) {
 
-            Location dstLoc = getLocation(lhs);
-            if (dstLoc != null && ssjava.isSharedLocation(dstLoc)) {
-              NTuple<Descriptor> lhsHeapPath = computePath(lhs);
-              NTuple<Location> lhsLocTuple = mapDescriptorToLocationPath.get(lhs);
+            if (mapHeapPath.containsKey(rhs)) {
+              Location dstLoc = getLocation(lhs);
+              if (dstLoc != null && ssjava.isSharedLocation(dstLoc)) {
+                NTuple<Descriptor> lhsHeapPath = computePath(lhs);
+                NTuple<Location> lhsLocTuple = mapDescriptorToLocationPath.get(lhs);
 
-              Location srcLoc = getLocation(lhs);
+                Location srcLoc = getLocation(lhs);
 
-              // computing gen/kill set
-              computeKILLSetForWrite(curr, killSet, lhsLocTuple, lhsHeapPath);
-              if (!dstLoc.equals(srcLoc)) {
-                computeGENSetForHigherWrite(curr, killSet, lhsLocTuple, lhsHeapPath);
-                updateDeleteSetForHigherWrite(currDeleteSet, lhsLocTuple, lhsHeapPath);
-              } else {
-                computeGENSetForSameHeightWrite(curr, killSet, lhsLocTuple, lhsHeapPath);
-                updateDeleteSetForSameHeightWrite(currDeleteSet, lhsLocTuple, lhsHeapPath);
-              }
+                // computing gen/kill set
+                computeKILLSetForWrite(curr, killSet, lhsLocTuple, lhsHeapPath);
+                if (!dstLoc.equals(srcLoc)) {
+                  computeGENSetForHigherWrite(curr, killSet, lhsLocTuple, lhsHeapPath);
+                  updateDeleteSetForHigherWrite(currDeleteSet, lhsLocTuple, lhsHeapPath);
+                } else {
+                  computeGENSetForSameHeightWrite(curr, killSet, lhsLocTuple, lhsHeapPath);
+                  updateDeleteSetForSameHeightWrite(currDeleteSet, lhsLocTuple, lhsHeapPath);
+                }
 
-              // System.out.println("VAR WRITE:" + fn);
-              // System.out.println("lhsLocTuple=" + lhsLocTuple +
-              // " lhsHeapPath=" + lhsHeapPath);
-              // System.out.println("dstLoc=" + dstLoc + " srcLoc=" + srcLoc);
-              // System.out.println("KILLSET=" + killSet);
-              // System.out.println("GENSet=" + genSet);
-              // System.out.println("DELETESET=" + currDeleteSet);
+                // System.out.println("VAR WRITE:" + fn);
+                // System.out.println("lhsLocTuple=" + lhsLocTuple +
+                // " lhsHeapPath=" + lhsHeapPath);
+                // System.out.println("dstLoc=" + dstLoc + " srcLoc=" + srcLoc);
+                // System.out.println("KILLSET=" + killSet);
+                // System.out.println("GENSet=" + genSet);
+                // System.out.println("DELETESET=" + currDeleteSet);
 
+              }
+            } else {
+              break;
             }
 
           }
@@ -705,54 +716,59 @@ public class DefinitelyWrittenCheck {
         if (!lhs.getSymbol().startsWith("neverused") && !lhs.getSymbol().startsWith("leftop")
             && !lhs.getSymbol().startsWith("rightop")) {
 
-          NTuple<Location> rhsLocTuple = new NTuple<Location>();
-          NTuple<Location> lhsLocTuple = new NTuple<Location>();
-          if (mapDescriptorToLocationPath.containsKey(rhs)) {
-            mapDescriptorToLocationPath.put(lhs, deriveLocationTuple(md, rhs));
-            lhsLocTuple = mapDescriptorToLocationPath.get(lhs);
-          } else {
-            // rhs side
-            if (rhs.getType().getExtension() != null
-                && rhs.getType().getExtension() instanceof SSJavaType) {
+          if (mapHeapPath.containsKey(rhs)) {
+            NTuple<Location> rhsLocTuple = new NTuple<Location>();
+            NTuple<Location> lhsLocTuple = new NTuple<Location>();
+            if (mapDescriptorToLocationPath.containsKey(rhs)) {
+              mapDescriptorToLocationPath.put(lhs, deriveLocationTuple(md, rhs));
+              lhsLocTuple = mapDescriptorToLocationPath.get(lhs);
+            } else {
+              // rhs side
+              if (rhs.getType().getExtension() != null
+                  && rhs.getType().getExtension() instanceof SSJavaType) {
 
-              if (((SSJavaType) rhs.getType().getExtension()).getCompLoc() != null) {
-                rhsLocTuple.addAll(((SSJavaType) rhs.getType().getExtension()).getCompLoc()
-                    .getTuple());
+                if (((SSJavaType) rhs.getType().getExtension()).getCompLoc() != null) {
+                  rhsLocTuple.addAll(((SSJavaType) rhs.getType().getExtension()).getCompLoc()
+                      .getTuple());
+                }
+
+              } else {
+                NTuple<Location> locTuple = deriveLocationTuple(md, rhs);
+                if (locTuple != null) {
+                  rhsLocTuple.addAll(locTuple);
+                }
+              }
+              if (rhsLocTuple.size() > 0) {
+                mapDescriptorToLocationPath.put(rhs, rhsLocTuple);
               }
 
-            } else {
-              NTuple<Location> locTuple = deriveLocationTuple(md, rhs);
-              if (locTuple != null) {
-                rhsLocTuple.addAll(locTuple);
+              // lhs side
+              if (lhs.getType().getExtension() != null
+                  && lhs.getType().getExtension() instanceof SSJavaType) {
+                lhsLocTuple.addAll(((SSJavaType) lhs.getType().getExtension()).getCompLoc()
+                    .getTuple());
+                mapDescriptorToLocationPath.put(lhs, lhsLocTuple);
+              } else if (mapDescriptorToLocationPath.get(rhs) != null) {
+                // propagate rhs's location to lhs
+                lhsLocTuple.addAll(mapDescriptorToLocationPath.get(rhs));
+                mapDescriptorToLocationPath.put(lhs, lhsLocTuple);
               }
             }
-            if (rhsLocTuple.size() > 0) {
-              mapDescriptorToLocationPath.put(rhs, rhsLocTuple);
-            }
 
-            // lhs side
-            if (lhs.getType().getExtension() != null
-                && lhs.getType().getExtension() instanceof SSJavaType) {
-              lhsLocTuple.addAll(((SSJavaType) lhs.getType().getExtension()).getCompLoc()
-                  .getTuple());
-              mapDescriptorToLocationPath.put(lhs, lhsLocTuple);
-            } else if (mapDescriptorToLocationPath.get(rhs) != null) {
-              // propagate rhs's location to lhs
-              lhsLocTuple.addAll(mapDescriptorToLocationPath.get(rhs));
-              mapDescriptorToLocationPath.put(lhs, lhsLocTuple);
-            }
-          }
+            if (isEventLoopBody && lhs.getType().isPrimitive()
+                && !lhs.getSymbol().startsWith("srctmp")) {
 
-          if (isEventLoopBody && lhs.getType().isPrimitive()
-              && !lhs.getSymbol().startsWith("srctmp")) {
+              NTuple<Descriptor> lhsHeapPath = computePath(lhs);
 
-            NTuple<Descriptor> lhsHeapPath = computePath(lhs);
+              if (lhsLocTuple != null) {
+                addMayWrittenSet(md, lhsLocTuple, lhsHeapPath);
+              }
 
-            if (lhsLocTuple != null) {
-              addMayWrittenSet(md, lhsLocTuple, lhsHeapPath);
             }
-
+          } else {
+            break;
           }
+
         }
 
       }
@@ -1288,11 +1304,10 @@ public class DefinitelyWrittenCheck {
               hasWriteEffect = true;
             }
 
-            if (hasWriteEffect) {
+            if (hasWriteEffect && mapHeapPath.containsKey(lhs)) {
               // write(lhs)
-              NTuple<Descriptor> rhsHeapPath = computePath(rhs);
               NTuple<Descriptor> lhsHeapPath = new NTuple<Descriptor>();
-              lhsHeapPath.addAll(rhsHeapPath);
+              lhsHeapPath.addAll(mapHeapPath.get(lhs));
 
               Location lhsLoc = getLocation(lhs);
               if (ssjava.isSharedLocation(lhsLoc)) {
@@ -1381,47 +1396,51 @@ public class DefinitelyWrittenCheck {
           fld = getArrayField(td);
         }
 
-        // write(field)
-        NTuple<Descriptor> lhsHeapPath = computePath(lhs);
-        NTuple<Descriptor> fldHeapPath = new NTuple<Descriptor>(lhsHeapPath.getList());
-        if (fn.kind() == FKind.FlatSetFieldNode) {
-          fldHeapPath.add(fld);
-        }
-
-        // shared loc extension
-        Location fieldLoc;
-        if (fn.kind() == FKind.FlatSetFieldNode) {
-          fieldLoc = (Location) fld.getType().getExtension();
-        } else {
-          NTuple<Location> locTuple = mapDescriptorToLocationPath.get(lhs);
-          fieldLoc = locTuple.get(locTuple.size() - 1);
-        }
-
-        if (ssjava.isSharedLocation(fieldLoc)) {
+        // set up heap path
+        NTuple<Descriptor> lhsHeapPath = mapHeapPath.get(lhs);
+        if (lhsHeapPath != null) {
+          // write(field)
+          NTuple<Descriptor> fldHeapPath = new NTuple<Descriptor>(lhsHeapPath.getList());
+          if (fn.kind() == FKind.FlatSetFieldNode) {
+            fldHeapPath.add(fld);
+          }
 
-          NTuple<Location> fieldLocTuple = new NTuple<Location>();
-          fieldLocTuple.addAll(mapDescriptorToLocationPath.get(lhs));
+          // shared loc extension
+          Location fieldLoc;
           if (fn.kind() == FKind.FlatSetFieldNode) {
-            fieldLocTuple.add(fieldLoc);
+            fieldLoc = (Location) fld.getType().getExtension();
+          } else {
+            NTuple<Location> locTuple = mapDescriptorToLocationPath.get(lhs);
+            fieldLoc = locTuple.get(locTuple.size() - 1);
           }
 
-          Set<NTuple<Descriptor>> writtenSet =
-              mapFlatNodeToSharedLocMapping.get(fn).get(fieldLocTuple);
+          if (ssjava.isSharedLocation(fieldLoc)) {
+
+            NTuple<Location> fieldLocTuple = new NTuple<Location>();
+            fieldLocTuple.addAll(mapDescriptorToLocationPath.get(lhs));
+            if (fn.kind() == FKind.FlatSetFieldNode) {
+              fieldLocTuple.add(fieldLoc);
+            }
+
+            Set<NTuple<Descriptor>> writtenSet =
+                mapFlatNodeToSharedLocMapping.get(fn).get(fieldLocTuple);
+
+            if (isCovered(fieldLocTuple, writtenSet)) {
+              computeKILLSetForSharedWrite(curr, writtenSet, readWriteKillSet);
+              computeGENSetForSharedAllCoverWrite(curr, writtenSet, readWriteGenSet);
+            } else {
+              computeGENSetForSharedNonCoverWrite(curr, fldHeapPath, readWriteGenSet);
+            }
 
-          if (isCovered(fieldLocTuple, writtenSet)) {
-            computeKILLSetForSharedWrite(curr, writtenSet, readWriteKillSet);
-            computeGENSetForSharedAllCoverWrite(curr, writtenSet, readWriteGenSet);
           } else {
-            computeGENSetForSharedNonCoverWrite(curr, fldHeapPath, readWriteGenSet);
+            computeKILLSetForWrite(curr, fldHeapPath, readWriteKillSet);
+            computeGENSetForWrite(fldHeapPath, readWriteGenSet);
           }
 
-        } else {
-          computeKILLSetForWrite(curr, fldHeapPath, readWriteKillSet);
-          computeGENSetForWrite(fldHeapPath, readWriteGenSet);
-        }
+          // System.out.println("KILLSET=" + readWriteKillSet);
+          // System.out.println("GENSet=" + readWriteGenSet);
 
-        // System.out.println("KILLSET=" + readWriteKillSet);
-        // System.out.println("GENSet=" + readWriteGenSet);
+        }
 
       }
         break;
@@ -1437,13 +1456,16 @@ public class DefinitelyWrittenCheck {
         // System.out.println("KILLSET=" + readWriteKillSet);
         // System.out.println("GENSet=" + readWriteGenSet);
 
-        checkManyRead(fc, curr);
       }
         break;
 
       }
 
       computeNewMapping(curr, readWriteKillSet, readWriteGenSet);
+      if (fn instanceof FlatCall) {
+        checkManyRead((FlatCall) fn, curr);
+      }
+
       // System.out.println("#######" + curr);
 
     }
@@ -1501,6 +1523,9 @@ public class DefinitelyWrittenCheck {
     Set<NTuple<Descriptor>> coverSet =
         mapMethodToSharedLocCoverSet.get(methodContainingSSJavaLoop).get(locTuple);
 
+    // System.out.println("locTuple=" + locTuple + " coverSet=" + coverSet +
+    // "  currSet=" + inSet);
+
     return inSet.containsAll(coverSet);
   }
 
@@ -1611,7 +1636,7 @@ public class DefinitelyWrittenCheck {
       Hashtable<NTuple<Descriptor>, Set<WriteAge>> KILLSet) {
 
     Set<NTuple<Descriptor>> boundMustWriteSet = mapFlatNodeToBoundMustWriteSet.get(fc);
-    System.out.println("boundMustWriteSet=" + boundMustWriteSet);
+    System.out.println("#boundMustWriteSet=" + boundMustWriteSet);
 
     for (Iterator iterator = boundMustWriteSet.iterator(); iterator.hasNext();) {
       NTuple<Descriptor> heapPath = (NTuple<Descriptor>) iterator.next();
@@ -1619,7 +1644,7 @@ public class DefinitelyWrittenCheck {
       if (isSharedLocation(heapPath)) {
         NTuple<Location> locTuple = getLocationTuple(heapPath);
 
-        if (isCovered(locTuple, sharedLocMap.get(locTuple))) {
+        if (isCovered(locTuple, sharedLocMap.get(locTuple)) && curr.containsKey(heapPath)) {
           // if it is shared loc and corresponding shared loc has been covered
           KILLSet.put(heapPath, curr.get(heapPath));
         }
@@ -2056,6 +2081,10 @@ public class DefinitelyWrittenCheck {
     Set<MethodDescriptor> methodDescriptorsToAnalyze = new HashSet<MethodDescriptor>();
     methodDescriptorsToAnalyze.addAll(ssjava.getAnnotationRequireSet());
     sortedDescriptors = topologicalSort(methodDescriptorsToAnalyze);
+
+    liveInTempSetToEventLoop =
+        liveness.getLiveInTemps(state.getMethodFlat(methodContainingSSJavaLoop),
+            ssjava.getSSJavaLoopEntrance());
   }
 
   private void methodReadWriteSetAnalysis() {
@@ -2150,6 +2179,13 @@ public class DefinitelyWrittenCheck {
     mapFlatMethodToMustWriteSet.put(flatMethodContainingSSJavaLoop, mustWriteSet);
     mapFlatMethodToMayWriteSet.put(flatMethodContainingSSJavaLoop, mayWriteSet);
 
+    for (Iterator iterator = liveInTempSetToEventLoop.iterator(); iterator.hasNext();) {
+      TempDescriptor liveIn = (TempDescriptor) iterator.next();
+      NTuple<Descriptor> heapPath = new NTuple<Descriptor>();
+      heapPath.add(liveIn);
+      mapHeapPath.put(liveIn, heapPath);
+    }
+
     methodReadWriteSet_analyzeBody(ssjava.getSSJavaLoopEntrance(), readSet, mustWriteSet,
         mayWriteSet, true);
 
@@ -2237,16 +2273,17 @@ public class DefinitelyWrittenCheck {
         // mapHeapPath.put(lhs, lhsHeapPath);
         // } else
 
-        if (rhsHeapPath != null) {
+        if (rhsHeapPath != null && (!lhs.getType().isPrimitive())) {
           mapHeapPath.put(lhs, mapHeapPath.get(rhs));
         } else {
-          if (isEventLoopBody) {
-            NTuple<Descriptor> heapPath = new NTuple<Descriptor>();
-            heapPath.add(rhs);
-            mapHeapPath.put(lhs, heapPath);
-          } else {
-            break;
-          }
+          break;
+          // if (isEventLoopBody) {
+          // NTuple<Descriptor> lhsHeapPath = new NTuple<Descriptor>();
+          // lhsHeapPath.add(rhs);
+          // mapHeapPath.put(lhs, lhsHeapPath);
+          // } else {
+          // break;
+          // }
         }
 
         // shared loc extension
index 3936ca16d5e2505fbc0c68942929e331ca864739..8739d5c4267bac4164bca6ff36a983da1caa9b81 100644 (file)
@@ -32,8 +32,6 @@
  *----------------------------------------------------------------------
  */
 
-
-
 /**
  * Class Implementing Layer 3 Decoder.
  * 
@@ -646,7 +644,7 @@ final class LayerIIIDecoder implements FrameDecoder {
     // System.out.println("Counter = ................................."+counter);
     // if (counter < 609)
     // {
-    counter++; // count should be loc*
+    // counter++; // count should be loc*
     // buffer.write_buffer(1); // buffer!!!
     // }
     // else if (counter == 609)
@@ -699,8 +697,7 @@ final class LayerIIIDecoder implements FrameDecoder {
           si.ch[ch].gr[gr].big_values = sib.get_bits(9);
           si.ch[ch].gr[gr].global_gain = sib.get_bits(8);
           si.ch[ch].gr[gr].scalefac_compress = sib.get_bits(4);
-          @LOC("THIS,LayerIIIDecoder.SI,III_side_info_t.TEMP") int cond =
-              sib.get_bits(1);
+          @LOC("THIS,LayerIIIDecoder.SI,III_side_info_t.TEMP") int cond = sib.get_bits(1);
           // si.ch[ch].gr[gr].window_switching_flag = sib.get_bits(1);
           // if ((si.ch[ch].gr[gr].window_switching_flag) != 0) {
           if (cond != 0) {
@@ -758,8 +755,7 @@ final class LayerIIIDecoder implements FrameDecoder {
         si.ch[ch].gr[0].global_gain = sib.get_bits(8);
         si.ch[ch].gr[0].scalefac_compress = sib.get_bits(9);
 
-        @LOC("THIS,LayerIIIDecoder.SI,III_side_info_t.TEMP") int cond =
-            sib.get_bits(1);
+        @LOC("THIS,LayerIIIDecoder.SI,III_side_info_t.TEMP") int cond = sib.get_bits(1);
         // si.ch[ch].gr[0].window_switching_flag = sib.get_bits(1);
         // if ((si.ch[ch].gr[0].window_switching_flag) != 0) {
         if (cond != 0) {
@@ -1817,7 +1813,6 @@ final class LayerIIIDecoder implements FrameDecoder {
         && !(si.ch[ch].gr[gr].mixed_block_flag != 0))
       return;
 
-     
     if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0)
         && (si.ch[ch].gr[gr].block_type == 2)) {
       sb18lim = 18;
@@ -2391,7 +2386,6 @@ final class LayerIIIDecoder implements FrameDecoder {
   // This may be adjusted for performance without any problems.
   // public static final int POW_TABLE_LIMIT=512;
 
-
   private static final int slen[][] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
       { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 } };
 
@@ -2842,134 +2836,131 @@ final class LayerIIIDecoder implements FrameDecoder {
 
 }
 
+/************************************************************/
+/* L3TABLE */
+/************************************************************/
 
+@LATTICE("N<VAR")
+class SBI {
+  @LOC("VAR")
+  public int[] l;
+  @LOC("VAR")
+  public int[] s;
 
+  public SBI() {
+    l = new int[23];
+    s = new int[14];
+  }
 
-  /************************************************************/
-  /* L3TABLE */
-  /************************************************************/
+  @LATTICE("THIS<IN,THISLOC=THIS")
+  public SBI(@DELEGATE @LOC("IN") int[] thel, @DELEGATE @LOC("IN") int[] thes) {
+    l = thel;
+    s = thes;
+  }
+}
 
-  @LATTICE("N<VAR")
-   class SBI {
-    @LOC("VAR")
-    public int[] l;
-    @LOC("VAR")
-    public int[] s;
+@LATTICE("V,V*")
+class gr_info_s {
+  @LOC("V")
+  public int part2_3_length = 0;
+  @LOC("V")
+  public int big_values = 0;
+  @LOC("V")
+  public int global_gain = 0;
+  @LOC("V")
+  public int scalefac_compress = 0;
+  @LOC("V")
+  public int window_switching_flag = 0;
+  @LOC("V")
+  public int block_type = 0;
+  @LOC("V")
+  public int mixed_block_flag = 0;
+  @LOC("V")
+  public int[] table_select;
+  @LOC("V")
+  public int[] subblock_gain;
+  @LOC("V")
+  public int region0_count = 0;
+  @LOC("V")
+  public int region1_count = 0;
+  @LOC("V")
+  public int preflag = 0;
+  @LOC("V")
+  public int scalefac_scale = 0;
+  @LOC("V")
+  public int count1table_select = 0;
 
-    public SBI() {
-      l = new int[23];
-      s = new int[14];
-    }
-
-    @LATTICE("THIS<IN,THISLOC=THIS")
-    public SBI(@DELEGATE @LOC("IN") int[] thel, @DELEGATE @LOC("IN") int[] thes) {
-      l = thel;
-      s = thes;
-    }
+  /**
+   * Dummy Constructor
+   */
+  public gr_info_s() {
+    table_select = new int[3];
+    subblock_gain = new int[3];
   }
+}
 
-  @LATTICE("V,V*")
-   class gr_info_s {
-    @LOC("V")
-    public int part2_3_length = 0;
-    @LOC("V")
-    public int big_values = 0;
-    @LOC("V")
-    public int global_gain = 0;
-    @LOC("V")
-    public int scalefac_compress = 0;
-    @LOC("V")
-    public int window_switching_flag = 0;
-    @LOC("V")
-    public int block_type = 0;
-    @LOC("V")
-    public int mixed_block_flag = 0;
-    @LOC("V")
-    public int[] table_select;
-    @LOC("V")
-    public int[] subblock_gain;
-    @LOC("V")
-    public int region0_count = 0;
-    @LOC("V")
-    public int region1_count = 0;
-    @LOC("V")
-    public int preflag = 0;
-    @LOC("V")
-    public int scalefac_scale = 0;
-    @LOC("V")
-    public int count1table_select = 0;
-
-    /**
-     * Dummy Constructor
-     */
-    public gr_info_s() {
-      table_select = new int[3];
-      subblock_gain = new int[3];
-    }
-  }
+@LATTICE("GR2<GR1,GR1<GR,GR2*")
+class temporaire {
+  @LOC("GR")
+  public int[] scfsi;
+  @LOC("GR")
+  public gr_info_s[] gr;
 
-  @LATTICE("GR2<GR1,GR1<GR,GR2*")
-   class temporaire {
-    @LOC("GR")
-    public int[] scfsi;
-    @LOC("GR")
-    public gr_info_s[] gr;
-
-    /**
-     * Dummy Constructor
-     */
-    public temporaire() {
-      scfsi = new int[4];
-      gr = new gr_info_s[2];
-      gr[0] = new gr_info_s();
-      gr[1] = new gr_info_s();
-    }
+  /**
+   * Dummy Constructor
+   */
+  public temporaire() {
+    scfsi = new int[4];
+    gr = new gr_info_s[2];
+    gr[0] = new gr_info_s();
+    gr[1] = new gr_info_s();
   }
+}
 
-  @LATTICE("CH<TEMP,TEMP*")
-   class III_side_info_t {
-
-    @LOC("CH")
-    public int main_data_begin = 0;
-    @LOC("CH")
-    public int private_bits = 0;
-    @LOC("CH")
-    public temporaire[] ch;
-
-    /**
-     * Dummy Constructor
-     */
-    public III_side_info_t() {
-      ch = new temporaire[2];
-      ch[0] = new temporaire();
-      ch[1] = new temporaire();
-    }
+@LATTICE("CH<TEMP,TEMP*")
+class III_side_info_t {
+
+  @LOC("CH")
+  public int main_data_begin = 0;
+  @LOC("CH")
+  public int private_bits = 0;
+  @LOC("CH")
+  public temporaire[] ch;
+
+  /**
+   * Dummy Constructor
+   */
+  public III_side_info_t() {
+    ch = new temporaire[2];
+    ch[0] = new temporaire();
+    ch[1] = new temporaire();
   }
+}
 
-  @LATTICE("N<VAR")
-   class temporaire2 {
-    @LOC("VAR")
-    public int[] l; /* [cb] */
-    @LOC("VAR")
-    public int[][] s; /* [window][cb] */
-
-    /**
-     * Dummy Constructor
-     */
-    public temporaire2() {
-      l = new int[23];
-      s = new int[3][13];
-    }
+@LATTICE("N<VAR")
+class temporaire2 {
+  @LOC("VAR")
+  public int[] l; /* [cb] */
+  @LOC("VAR")
+  public int[][] s; /* [window][cb] */
+
+  /**
+   * Dummy Constructor
+   */
+  public temporaire2() {
+    l = new int[23];
+    s = new int[3][13];
   }
+}
 
-  // class III_scalefac_t
-  // {
-  // public temporaire2[] tab;
-  // /**
-  // * Dummy Constructor
-  // */
-  // public III_scalefac_t()
-  // {
-  // tab = new temporaire2[2];
-  // }
-  // }
+// class III_scalefac_t
+// {
+// public temporaire2[] tab;
+// /**
+// * Dummy Constructor
+// */
+// public III_scalefac_t()
+// {
+// tab = new temporaire2[2];
+// }
+// }
index 7ad2ee4a7b698efdc5109531fe41cf0fada893af..18d681d0efd918f8e8adcde9d8ee2e7593e4ca21 100644 (file)
@@ -2030,8 +2030,10 @@ final class SynthesisFilter {
 \r
     // MDM: this may not be necessary. The Layer III decoder always\r
     // outputs 32 subband samples, but I haven't checked layer I & II.\r
-    for (@LOC("C") int p = 0; p < 32; p++)\r
-      samples[p] = 0.0f;\r
+    // for (@LOC("C") int p = 0; p < 32; p++){\r
+    // samples[p] = 0.0f;\r
+    // }\r
+    SSJAVA.arrayinit(samples, 0);\r
   }\r
 \r
   private static final double MY_PI = 3.14159265358979323846;\r