toanalyzeList.addAll(classtable.getValueSet());
Collections.sort(toanalyzeList, new Comparator<ClassDescriptor>() {
public int compare(ClassDescriptor o1, ClassDescriptor o2) {
- return o1.getClassName().compareTo(o2.getClassName());
+ return o1.getClassName().compareToIgnoreCase(o2.getClassName());
}
});
} else {
toanalyzeMethodList.addAll(methodtable.getValueSet());
Collections.sort(toanalyzeMethodList, new Comparator<MethodDescriptor>() {
public int compare(MethodDescriptor o1, MethodDescriptor o2) {
- return o1.getSymbol().compareTo(o2.getSymbol());
+ return o1.getSymbol().compareToIgnoreCase(o2.getSymbol());
}
});
} else {
// if developer does not define method lattice
// search return location in the method default lattice
String rtrStr = ssjava.getMethodLattice(md).getReturnLoc();
- if(rtrStr!=null){
+ if (rtrStr != null) {
returnLocComp = new CompositeLocation(new Location(md, rtrStr));
- }
+ }
}
if (returnLocComp == null) {
&& !CompositeLattice.isGreaterThan(condLoc, falseLoc,
generateErrorMessage(cd, tn.getCond()))) {
throw new Error(
- "The location of the condition expression is lower than the true expression at "
+ "The location of the condition expression is lower than the false expression at "
+ cd.getSourceFileName() + ":" + tn.getCond().getNumLine());
}
glbInputSet.add(trueLoc);
glbInputSet.add(falseLoc);
- return CompositeLattice.calculateGLB(glbInputSet, generateErrorMessage(cd, tn));
+ if (glbInputSet.size() == 1) {
+ return trueLoc;
+ } else {
+ return CompositeLattice.calculateGLB(glbInputSet, generateErrorMessage(cd, tn));
+ }
+
}
private CompositeLocation checkLocationFromMethodInvokeNode(MethodDescriptor md,
ClassDescriptor cd = md.getClassDesc();
MethodDescriptor calleeMD = min.getMethod();
- if (!ssjava.isTrustMethod(calleeMD)) {
+ NameDescriptor baseName = min.getBaseName();
+ boolean isSystemout = false;
+ if (baseName != null) {
+ isSystemout = baseName.getSymbol().equals("System.out");
+ }
+
+ if (!ssjava.isTrustMethod(calleeMD) && !calleeMD.getModifiers().isNative() && !isSystemout) {
+
CompositeLocation baseLocation = null;
if (min.getExpression() != null) {
baseLocation =
checkLocationFromExpressionNode(md, nametable, min.getExpression(),
new CompositeLocation(), constraint, false);
} else {
-
if (min.getMethod().isStatic()) {
String globalLocId = ssjava.getMethodLattice(md).getGlobalLoc();
if (globalLocId == null) {
}
System.out.println("\n#checkLocationFromMethodInvokeNode=" + min.printNode(0)
- + " baseLocation=" + baseLocation);
+ + " baseLocation=" + baseLocation + " constraint=" + constraint);
- int compareResult =
- CompositeLattice.compare(constraint, baseLocation, true, generateErrorMessage(cd, min));
-
- if (compareResult == ComparisonResult.LESS) {
- throw new Error("Method invocation does not respect the current branch constraint at "
- + generateErrorMessage(cd, min));
- } else if (compareResult != ComparisonResult.GREATER) {
- // if the current constraint is higher than method's THIS location
- // no need to check constraints!
- CompositeLocation calleeConstraint =
- translateCallerLocToCalleeLoc(calleeMD, baseLocation, constraint);
- checkMethodBody(calleeMD.getClassDesc(), calleeMD, calleeConstraint);
+ if (constraint != null) {
+ int compareResult =
+ CompositeLattice.compare(constraint, baseLocation, true, generateErrorMessage(cd, min));
+
+ if (compareResult == ComparisonResult.LESS) {
+ throw new Error("Method invocation does not respect the current branch constraint at "
+ + generateErrorMessage(cd, min));
+ } else if (compareResult != ComparisonResult.GREATER) {
+ // if the current constraint is higher than method's THIS location
+ // no need to check constraints!
+ CompositeLocation calleeConstraint =
+ translateCallerLocToCalleeLoc(calleeMD, baseLocation, constraint);
+ System.out.println("check method body for constraint:" + calleeMD + " calleeConstraint="
+ + calleeConstraint);
+ checkMethodBody(calleeMD.getClassDesc(), calleeMD, calleeConstraint);
+ }
}
checkCalleeConstraints(md, nametable, min, baseLocation, constraint);
}
}
- return new CompositeLocation();
+ return new CompositeLocation(Location.createTopLocation(md));
}
String errorMsg = generateErrorMessage(md.getClassDesc(), min);
System.out.println("checkCallerArgumentLocationConstraints=" + min.printNode(0));
- System.out.println("base location=" + callerBaseLoc);
+ System.out.println("base location=" + callerBaseLoc + " constraint=" + constraint);
for (int i = 0; i < calleeParamList.size(); i++) {
CompositeLocation calleeParamLoc = calleeParamList.get(i);
return loc;
}
}
-
+
+ if(left instanceof ArrayAccessNode){
+ System.out.println("HEREE!!");
+ ArrayAccessNode aan=(ArrayAccessNode)left;
+ left=aan.getExpression();
+ }
+
loc = checkLocationFromExpressionNode(md, nametable, left, loc, constraint, false);
System.out.println("### checkLocationFromFieldAccessNode=" + fan.printNode(0));
System.out.println("### left=" + left.printNode(0));
Location fieldLoc = getFieldLocation(fd);
loc.addLocation(fieldLoc);
}
-
+ System.out.println("### field loc="+loc);
return loc;
}
// currently enforce every variable to have corresponding location
if (annotationVec.size() == 0) {
- throw new Error("Location is not assigned to variable '" + vd.getSymbol() + "' in the method '"
- + md + "' of the class " + cd.getSymbol() + " at " + generateErrorMessage(cd, n));
+ throw new Error("Location is not assigned to variable '" + vd.getSymbol()
+ + "' in the method '" + md + "' of the class " + cd.getSymbol() + " at "
+ + generateErrorMessage(cd, n));
}
if (annotationVec.size() > 1) { // variable can have at most one location
// compute GLB of arguments subset that are same or higher than return
// location
- CompositeLocation glb = CompositeLattice.calculateGLB(inputGLB, "");
- return glb;
+ if (inputGLB.isEmpty()) {
+ CompositeLocation rtr =
+ new CompositeLocation(Location.createTopLocation(args.get(0).get(0).getDescriptor()));
+ return rtr;
+ } else {
+ CompositeLocation glb = CompositeLattice.calculateGLB(inputGLB, "");
+ return glb;
+ }
}
}
for (Iterator iterator2 = possibleCalleeSet.iterator(); iterator2.hasNext();) {
MethodDescriptor possibleCallee = (MethodDescriptor) iterator2.next();
- if (!possibleCallee.isAbstract()) {
+ if (!possibleCallee.isAbstract() && !possibleCallee.getModifiers().isNative()) {
ssjava.addAnnotationRequire(possibleCallee);
tovisit.add(possibleCallee);
}
value = c.value;
}
- @LATTICE("OUT<THIS,RETURNLOC=OUT,THISLOC=THIS")
+ @LATTICE("OUT<THIS,RETURNLOC=OUT,THISLOC=THIS,GLOBALLOC=OUT")
public String toString() {
return ""+value;
}
@LATTICE("V<C, V<O")
-@METHODDEFAULT("O<V,V<C,C<IN,THISLOC=IN,C*")
+@METHODDEFAULT("O<V,V<C,C<IN,THISLOC=IN,C*,GLOBALLOC=V")
public class Integer {
@LOC("V") private int value;
* @status updated to 1.5
*/
@LATTICE("V<C, V<O")
-@METHODDEFAULT("O<V,V<C,C<IN,C*,THISLOC=IN,RETURNLOC=O")
+@METHODDEFAULT("O<V,V<C,C<IN,THISLOC=IN,C*,GLOBALLOC=V,RETURNLOC=V")
public final class Long //extends Number implements Comparable<Long>
{
/**
import String;
@LATTICE("")
-@METHODDEFAULT("TH<IN,THISLOC=IN")
+@METHODDEFAULT("TH<IN,THISLOC=IN,GLOBALLOC=TH")
public class Object {
@RETURNLOC("TH")
import Vector;
-@LATTICE("V<C, V<O")
+@LATTICE("V<C, V<O,V*")
@METHODDEFAULT("O<V,V<C,C<IN,C*,THISLOC=O,RETURNLOC=O")
public class String {
return this;
}
- public static String valueOf(@LOC("IN") Object o) {
+ @LATTICE("OUT<THIS,THIS<IN,THISLOC=THIS,RETURNLOC=OUT")
+ public static String valueOf(@LOC("THIS") Object o) {
if (o == null)
return "null";
else
return new String(ar);
}
- public static String valueOf(@LOC("IN") int x) {
+ public static String valueOf(@LOC("C") int x) {
@LOC("C") int length = 0;
@LOC("C") int tmp;
if (x < 0)
public static native int convertdoubletochar(double val, char[] chararray);
- public static String valueOf(@LOC("IN") long x) {
+ public static String valueOf(@LOC("C") long x) {
@LOC("C") int length = 0;
@LOC("C") long tmp;
if (x < 0)
return count - s.count;
}
+ @LATTICE("OUT<THIS,THIS<C,C*,THISLOC=THIS")
+ @RETURNLOC("OUT")
public int hashCode() {
if (cachedHashcode != 0)
return cachedHashcode;
- @LOC("C") int hashcode = 0;
- for (@LOC("C") int i = 0; i < count; i++)
+ @LOC("THIS,String.V") int hashcode = 0;
+ for (@LOC("THIS,String.V") int i = 0; i < count; i++)
hashcode = hashcode * 31 + value[i + offset];
cachedHashcode = hashcode;
return hashcode;
-@LATTICE("V<C, V<O")
-@METHODDEFAULT("O<V,V<C,C<IN,C*,THISLOC=O,RETURNLOC=O")
+@LATTICE("V<C, V<O,V*")
+@METHODDEFAULT("G<O,O<V,V<C,C<IN,C*,THISLOC=O,RETURNLOC=O,GLOBALLOC=G")
public class StringBuffer {
@LOC("V")
char value[];
- @LOC("C")
+ @LOC("V")
int count;
// private static final int DEFAULTSIZE=16;
return value[x];
}
+ @LATTICE("OUT<THIS,THIS<VAR,VAR<G,G<IN,THISLOC=THIS,GLOBALLOC=G,RETURNLOC=OUT")
public StringBuffer append(@LOC("IN") char c) {
- return append(String.valueOf(c));
+ @LOC("VAR") String str = String.valueOf(c);
+ return append(str);
}
public StringBuffer append(@LOC("IN") String s) {
if ((s.count + count) > value.length) {
// Need to allocate
- @LOC("C") char newvalue[] = new char[s.count + count + 16]; // 16 is
- // DEFAULTSIZE
- for (@LOC("C") int i = 0; i < count; i++)
+ @LOC("O,StringBuffer.V") char newvalue[] = new char[s.count + count + 16]; // 16
+ // is
+ // DEFAULTSIZE
+ for (@LOC("O,StringBuffer.V") int i = 0; i < count; i++)
newvalue[i] = value[i];
- for (@LOC("C") int i = 0; i < s.count; i++)
+ for (@LOC("O,StringBuffer.V") int i = 0; i < s.count; i++)
newvalue[i + count] = s.value[i + s.offset];
value = newvalue;
count += s.count;
} else {
- for (@LOC("C") int i = 0; i < s.count; i++) {
+ for (@LOC("O,StringBuffer.V") int i = 0; i < s.count; i++) {
value[i + count] = s.value[i + s.offset];
}
count += s.count;
System.printString(s + "\n");
}
- public static void println(int o) {
+ public static void println(@LOC("IN") int o) {
System.printString("" + o + "\n");
}
- public static void println(double o) {
+ public static void println(@LOC("IN") double o) {
System.printString("" + o + "\n");
}
- public static void println(long o) {
+ public static void println(@LOC("IN") long o) {
System.printString("" + o + "\n");
}
System.printString("\n");
}
- public static void print(String s) {
+ public static void print(@LOC("IN") String s) {
System.printString(s);
}
* @version 0.0.7 12/12/99\r
* @since 0.0.5\r
*/\r
-@LATTICE("OUT<DE,DE<FILTER,FILTER<FACTORS,FACTORS<EQ,EQ<PARAM,PARAM<INIT")\r
+@LATTICE("OUT<DE,DE<FILTER,FILTER<FACTORS,FACTORS<EQ,EQ<PARAM,PARAM<H,H<INIT,PARAM*,INIT*")\r
@METHODDEFAULT("THIS,THISLOC=THIS,RETURNLOC=THIS")\r
public class Decoder implements DecoderErrors {\r
\r
* @return A SampleBuffer containing the decoded samples.\r
*/\r
@LATTICE("THIS<VAR,THISLOC=THIS,VAR*")\r
- public void decodeFrame(@LOC("VAR") Header header) throws DecoderException {\r
+ public void decodeFrame(@LOC("THIS,Decoder.H") Header header) throws DecoderException {\r
\r
if (!initialized) {\r
@LOC("VAR") float scalefactor = 32700.0f;\r
\r
- @LOC("VAR") int mode = header.mode();\r
- @LOC("VAR") int layer = header.layer();\r
- @LOC("VAR") int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2;\r
+ @LOC("THIS,Decoder.PARAM") int mode = header.mode();\r
+ @LOC("THIS,Decoder.PARAM") int layer = header.layer();\r
+ @LOC("THIS,Decoder.PARAM") int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2;\r
\r
// set up output buffer if not set up by client.\r
// if (output == null)\r
initialized = true;\r
}\r
\r
- SampleBufferWrapper.getOutput().clear_buffer();\r
- l3decoder.decodeFrame(header);\r
- SampleBufferWrapper.getOutput().write_buffer(1);\r
+ SampleBufferWrapper.clear_buffer();\r
+ l3decoder.decode(header);\r
+ // SampleBufferWrapper.getOutput().write_buffer(1);\r
\r
}\r
\r
*----------------------------------------------------------------------\r
*/\r
\r
-\r
-\r
/**\r
- * The <code>Equalizer</code> class can be used to specify\r
- * equalization settings for the MPEG audio decoder. \r
+ * The <code>Equalizer</code> class can be used to specify equalization settings\r
+ * for the MPEG audio decoder.\r
* <p>\r
- * The equalizer consists of 32 band-pass filters. \r
- * Each band of the equalizer can take on a fractional value between \r
- * -1.0 and +1.0.\r
- * At -1.0, the input signal is attenuated by 6dB, at +1.0 the signal is\r
- * amplified by 6dB. \r
+ * The equalizer consists of 32 band-pass filters. Each band of the equalizer\r
+ * can take on a fractional value between -1.0 and +1.0. At -1.0, the input\r
+ * signal is attenuated by 6dB, at +1.0 the signal is amplified by 6dB.\r
* \r
* @see Decoder\r
* \r
* @author MDM\r
*/\r
-@LATTICE("B<T")\r
+@LATTICE("B<IDX,IDX<T,IDX*")\r
@METHODDEFAULT("OUT<V,V<SH,SH<C,C<IN,SH*,THISLOC=IN,GLOBALLOC=IN")\r
-public final class Equalizer\r
-{ \r
- /**\r
- * Equalizer setting to denote that a given band will not be\r
- * present in the output signal.\r
- */\r
- @LOC("T") static public final float BAND_NOT_PRESENT = Float.NEGATIVE_INFINITY;\r
- \r
- @LOC("T") static public final Equalizer PASS_THRU_EQ = new Equalizer();\r
- \r
- @LOC("T") private static final int BANDS = 32;\r
- \r
- @LOC("B") private final float[] settings = new float[BANDS];\r
- \r
- /**\r
- * Creates a new <code>Equalizer</code> instance. \r
- */\r
- public Equalizer()\r
- { \r
- }\r
- \r
-// private Equalizer(float b1, float b2, float b3, float b4, float b5,\r
-// float b6, float b7, float b8, float b9, float b10, float b11,\r
-// float b12, float b13, float b14, float b15, float b16,\r
-// float b17, float b18, float b19, float b20);\r
-\r
- public Equalizer(float[] settings)\r
- {\r
- setFrom(settings);\r
- }\r
- \r
- public Equalizer(EQFunction eq)\r
- {\r
- setFrom(eq);\r
- }\r
- \r
- public void setFrom(float[] eq)\r
- {\r
- reset();\r
- int max = (eq.length > BANDS) ? BANDS : eq.length;\r
- \r
- for (int i=0; i<max; i++)\r
- {\r
- settings[i] = limit(eq[i]);\r
- }\r
- }\r
-\r
- public void setFrom(EQFunction eq)\r
- {\r
- reset();\r
- int max = BANDS;\r
- \r
- for (int i=0; i<max; i++)\r
- {\r
- settings[i] = limit(eq.getBand(i));\r
- } \r
- }\r
- \r
- /**\r
- * Sets the bands of this equalizer to the value the bands of\r
- * another equalizer. Bands that are not present in both equalizers are ignored. \r
- */\r
- public void setFrom(Equalizer eq)\r
- {\r
- if (eq!=this)\r
- {\r
- setFrom(eq.settings);\r
- }\r
- }\r
- \r
- \r
- \r
- \r
- /**\r
- * Sets all bands to 0.0\r
- */\r
- public void reset()\r
- {\r
- for (int i=0; i<BANDS; i++)\r
- {\r
- settings[i] = 0.0f;\r
- }\r
- }\r
-\r
- \r
- /**\r
- * Retrieves the number of bands present in this equalizer.\r
- */\r
- public int getBandCount()\r
- {\r
- return settings.length; \r
- }\r
- \r
- public float setBand(int band, float neweq)\r
- {\r
- float eq = 0.0f;\r
- \r
- if ((band>=0) && (band<BANDS))\r
- {\r
- eq = settings[band];\r
- settings[band] = limit(neweq);\r
- }\r
- \r
- return eq; \r
- }\r
- \r
- \r
- \r
- /**\r
- * Retrieves the eq setting for a given band.\r
- */\r
- public float getBand(int band)\r
- {\r
- float eq = 0.0f;\r
- \r
- if ((band>=0) && (band<BANDS))\r
- {\r
- eq = settings[band];\r
- }\r
- \r
- return eq;\r
- }\r
- \r
- private float limit(float eq)\r
- {\r
- if (eq==BAND_NOT_PRESENT)\r
- return eq;\r
- if (eq > 1.0f)\r
- return 1.0f;\r
- if (eq < -1.0f)\r
- return -1.0f;\r
- \r
- return eq;\r
- }\r
- \r
- /**\r
- * Retrieves an array of floats whose values represent a\r
- * scaling factor that can be applied to linear samples\r
- * in each band to provide the equalization represented by\r
- * this instance. \r
- * \r
- * @return an array of factors that can be applied to the\r
- * subbands.\r
- */\r
- @RETURNLOC("OUT") \r
- float[] getBandFactors()\r
- {\r
- @LOC("OUT") float[] factors = new float[BANDS];\r
- @LOC("C") int maxCount = BANDS;\r
- for (@LOC("SH") int i=0; i<maxCount; i++)\r
- {\r
- factors[i] = getBandFactor(settings[i]);\r
- }\r
- \r
- return factors;\r
- }\r
- \r
- /**\r
- * Converts an equalizer band setting to a sample factor.\r
- * The factor is determined by the function f = 2^n where\r
- * n is the equalizer band setting in the range [-1.0,1.0].\r
- * \r
- */\r
- @RETURNLOC("C")\r
- float getBandFactor(@LOC("IN") float eq)\r
- {\r
- if (eq==BAND_NOT_PRESENT)\r
- return 0.0f;\r
- \r
- @LOC("C") float f = (float)Math.pow(2.0, eq);\r
- return f;\r
- }\r
- \r
- \r
- static abstract public class EQFunction\r
- {\r
- /**\r
- * Returns the setting of a band in the equalizer. \r
- * \r
- * @param band The index of the band to retrieve the setting\r
- * for. \r
- * \r
- * @return the setting of the specified band. This is a value between\r
- * -1 and +1.\r
- */\r
- public float getBand(int band)\r
- {\r
- return 0.0f; \r
- }\r
- \r
- }\r
- \r
+public final class Equalizer {\r
+ /**\r
+ * Equalizer setting to denote that a given band will not be present in the\r
+ * output signal.\r
+ */\r
+ @LOC("T")\r
+ static public final float BAND_NOT_PRESENT = Float.NEGATIVE_INFINITY;\r
+\r
+ @LOC("T")\r
+ static public final Equalizer PASS_THRU_EQ = new Equalizer();\r
+\r
+ @LOC("T")\r
+ private static final int BANDS = 32;\r
+\r
+ @LOC("B")\r
+ private final float[] settings = new float[BANDS];\r
+\r
+ /**\r
+ * Creates a new <code>Equalizer</code> instance.\r
+ */\r
+ public Equalizer() {\r
+ }\r
+\r
+ // private Equalizer(float b1, float b2, float b3, float b4, float b5,\r
+ // float b6, float b7, float b8, float b9, float b10, float b11,\r
+ // float b12, float b13, float b14, float b15, float b16,\r
+ // float b17, float b18, float b19, float b20);\r
+\r
+ public Equalizer(float[] settings) {\r
+ setFrom(settings);\r
+ }\r
+\r
+ public Equalizer(EQFunction eq) {\r
+ setFrom(eq);\r
+ }\r
+\r
+ public void setFrom(float[] eq) {\r
+ reset();\r
+ int max = (eq.length > BANDS) ? BANDS : eq.length;\r
+\r
+ for (int i = 0; i < max; i++) {\r
+ settings[i] = limit(eq[i]);\r
+ }\r
+ }\r
+\r
+ public void setFrom(EQFunction eq) {\r
+ reset();\r
+ int max = BANDS;\r
+\r
+ for (int i = 0; i < max; i++) {\r
+ settings[i] = limit(eq.getBand(i));\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the bands of this equalizer to the value the bands of another\r
+ * equalizer. Bands that are not present in both equalizers are ignored.\r
+ */\r
+ public void setFrom(Equalizer eq) {\r
+ if (eq != this) {\r
+ setFrom(eq.settings);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets all bands to 0.0\r
+ */\r
+ public void reset() {\r
+ for (int i = 0; i < BANDS; i++) {\r
+ settings[i] = 0.0f;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Retrieves the number of bands present in this equalizer.\r
+ */\r
+ public int getBandCount() {\r
+ return settings.length;\r
+ }\r
+\r
+ public float setBand(int band, float neweq) {\r
+ float eq = 0.0f;\r
+\r
+ if ((band >= 0) && (band < BANDS)) {\r
+ eq = settings[band];\r
+ settings[band] = limit(neweq);\r
+ }\r
+\r
+ return eq;\r
+ }\r
+\r
+ /**\r
+ * Retrieves the eq setting for a given band.\r
+ */\r
+ public float getBand(int band) {\r
+ float eq = 0.0f;\r
+\r
+ if ((band >= 0) && (band < BANDS)) {\r
+ eq = settings[band];\r
+ }\r
+\r
+ return eq;\r
+ }\r
+\r
+ private float limit(float eq) {\r
+ if (eq == BAND_NOT_PRESENT)\r
+ return eq;\r
+ if (eq > 1.0f)\r
+ return 1.0f;\r
+ if (eq < -1.0f)\r
+ return -1.0f;\r
+\r
+ return eq;\r
+ }\r
+\r
+ /**\r
+ * Retrieves an array of floats whose values represent a scaling factor that\r
+ * can be applied to linear samples in each band to provide the equalization\r
+ * represented by this instance.\r
+ * \r
+ * @return an array of factors that can be applied to the subbands.\r
+ */\r
+ @LATTICE("OUT<THIS,THISLOC=THIS")\r
+ @RETURNLOC("OUT")\r
+ float[] getBandFactors() {\r
+ @LOC("OUT") float[] factors = new float[BANDS];\r
+ @LOC("THIS,Equalizer.IDX") int maxCount = BANDS;\r
+ for (@LOC("THIS,Equalizer.IDX") int i = 0; i < maxCount; i++) {\r
+ factors[i] = getBandFactor(settings[i]);\r
+ }\r
+\r
+ return factors;\r
+ }\r
+\r
+ /**\r
+ * Converts an equalizer band setting to a sample factor. The factor is\r
+ * determined by the function f = 2^n where n is the equalizer band setting in\r
+ * the range [-1.0,1.0].\r
+ * \r
+ */\r
+ @RETURNLOC("C")\r
+ float getBandFactor(@LOC("IN") float eq) {\r
+ if (eq == BAND_NOT_PRESENT)\r
+ return 0.0f;\r
+\r
+ @LOC("C") float f = (float) Math.pow(2.0, eq);\r
+ return f;\r
+ }\r
+\r
+ static abstract public class EQFunction {\r
+ /**\r
+ * Returns the setting of a band in the equalizer.\r
+ * \r
+ * @param band\r
+ * The index of the band to retrieve the setting for.\r
+ * \r
+ * @return the setting of the specified band. This is a value between -1 and\r
+ * +1.\r
+ */\r
+ public float getBand(int band) {\r
+ return 0.0f;\r
+ }\r
+\r
+ }\r
+\r
}\r
/**
* Class for extracting information from a frame header.
*/
-@LATTICE("HI<HNS,HNS<H,C<H,NS<FS,FS<H,FS<HV,H<SYNC,HV<SYNC,HV<T,SYNC*,HV*,FS*,HI*")
-// @METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-@METHODDEFAULT("THIS,THISLOC=THIS,RETURNLOC=THIS")
+@LATTICE("HI<HNS,HNS<H,C<H,NS<FS,FS<H,FS<HV,H<SYNC,HV<SYNC,H<T,HV<T,SYNC*,HV*,FS*,HI*")
+@METHODDEFAULT("THIS<IN,THISLOC=THIS,GLOBALLOC=THIS,RETURNLOC=THIS")
public final class Header {
public static final int[][] frequencies = { { 22050, 24000, 16000, 1 },
/**
* Returns version.
*/
+ @RETURNLOC("THIS,Header.HV")
public int version() {
return h_version;
}
/**
* Returns Layer ID.
*/
+ @RETURNLOC("THIS,Header.H")
public int layer() {
return h_layer;
}
/**
* Returns Sample Frequency.
*/
+ @RETURNLOC("THIS,Header.H")
public int sample_frequency() {
return h_sample_frequency;
}
/**
* Returns Frequency.
*/
+ @RETURNLOC("THIS,Header.FS")
public int frequency() {
return frequencies[h_version][h_sample_frequency];
}
/**
* Returns Mode.
*/
+ @RETURNLOC("THIS,Header.H")
public int mode() {
return h_mode;
}
/**
* Returns Protection bit.
*/
+ @RETURNLOC("THIS,Header.H")
public boolean checksums() {
if (h_protection_bit == 0)
return true;
/**
* Returns Slots.
*/
+ @RETURNLOC("THIS,Header.NS")
public int slots() {
return nSlots;
}
/**
* Returns Mode Extension.
*/
+ @RETURNLOC("THIS,Header.H")
public int mode_extension() {
return h_mode_extension;
}
/**
* Return Layer version.
*/
+ @RETURNLOC("THIS,Header.H")
public String layer_string() {
switch (h_layer) {
case 1:
*
* @return bitrate in bps
*/
+ @RETURNLOC("THIS,Header.FS")
public String bitrate_string() {
+ @LOC("THIS,Header.T") String kbs = " kb/s";
if (h_vbr == true) {
- return Integer.toString(bitrate() / 1000) + " kb/s";
- } else
+ return Integer.toString(bitrate() / 1000) + kbs;
+ } else {
return bitrate_str[h_version][h_layer - 1][h_bitrate_index];
+ }
}
/**
*
* @return bitrate in bps and average bitrate for VBR header
*/
+ @RETURNLOC("THIS,Header.FS")
public int bitrate() {
if (h_vbr == true) {
return ((int) ((h_vbr_bytes * 8) / (ms_per_frame() * h_vbr_frames))) * 1000;
- } else
+ } else {
return bitrates[h_version][h_layer - 1][h_bitrate_index];
+ }
}
/**
*
* @return frequency string in kHz
*/
+ @RETURNLOC("THIS,Header.FS")
public String sample_frequency_string() {
switch (h_sample_frequency) {
case THIRTYTWO:
/**
* Returns Mode.
*/
+ @RETURNLOC("THIS,Header.H")
public String mode_string() {
switch (h_mode) {
case STEREO:
*
* @return MPEG-1 or MPEG-2 LSF or MPEG-2.5 LSF
*/
+ @RETURNLOC("THIS,Header.HV")
public String version_string() {
switch (h_version) {
case MPEG1:
this.br = br;
}
+ @RETURNLOC("THIS,Header.T")
public SideInfoBuffer getSideInfoBuffer() {
return sib;
}
+ @RETURNLOC("THIS,Header.T")
public BitReserve getBitReserve() {
return br;
}
// 10th added for get_scale_factors
// llth added for decode
// @LATTICE("IS1D*,RO<IS1D,IS1D<SI2,SI2<SI1,SI<P2S,SF1<CH0,SF0*,SFB_SH<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SI1<SF2,SF2<SFB,SF1<BR,LR*,OUT<LR,LR<RO,NZ*,SI<SF1,SI1<NZ,NZ<SI,SI1<SBI,SBI<SI,BUF<FT,SF1<SF0,SF0<HD1,BR<ST,ST,FT<SP,SP<OUT,OUT<SI1,SI1<SI,P2S<CH0,CH0<MAX0,MAX0<BR1,FS<BR1,BR1<BR,BR<HD1,HD1<HD,OUT*,BR1*,SI1*,MAX0*,CH0*,RAW,TS,F,C,K,LY,VAR,IR,IP,CSH,GLSFD3,GLSFD4,GLSFD5,GLSFF4,GLSFF2,GLSFF3,GLSFF1,GSF4,GSF5,GSF1,GSF2,GSF3,HD2,HD3,BT,GR,RO6,RO5,RO9,RO8,RO7,RO4,RO1,RO3,RO2,SH,ME,TMP2,S,LSF,J")
-@LATTICE("ISR*,ISP*,LR<ISR,ISR<ISP,SI1<SF2,NS*,HD<ST,IS1D*,RO1<RO,RO1*,RO<IS1D,IS1D<SI2,SI2<SI1,BR<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SF2<SFB,LR*,OUT<LR,ISP<RO1,NZ*,SI<SF1,BR1<NZ,NZ<BR,SI1<RT,RT<SBI,SBI<SI,BUF<FT,SF1<CH0,CH0<HD1,FT<SP,SP<OUT,OUT<SI1,SI1<SI,SFB_SH<BR1,BR1<BR,HD1<HD,OUT*,BR1*,SI1*,CH0*,RAW,TS,F,C,K,LY,VAR,IR,IP,CSH,GLSFD3,GLSFD4,GLSFD5,GLSFF4,GLSFF2,GLSFF3,GLSFF1,GSF4,GSF5,GSF1,GSF2,GSF3,HD2,HD3,BT,GR,RO6,RO5,RO9,RO8,RO7,RO4,RO1,RO3,RO2,SH,ME,TMP2,S,LSF,J")
+@LATTICE("SI0*,INIT*,ISR*,ISP*,HD<CH0,LR<ISR,ISR<ISP,SI1<SF2,NS*,CH0<ST,ST<INIT,IS1D*,RO1<RO,RO1*,RO<IS1D,IS1D<SI2,SI2<SI1,BR<NS,NS<SI,SFB_SH*,SFB<SFB_SH,C,C*,SF2<SFB,LR*,OUT<LR,ISP<RO1,NZ*,SI<SI0,SI0<SF15,SF15<SF1,BR1<NZ,NZ<BR,SI1<RT,RT<SBI,SBI<SI,BUF<FT,SF1<HD1,SF1<HD1,FT<SP,SP<OUT,OUT<SI1,SI1<SI,SFB_SH<BR1,BR1<BR,HD1<HD,OUT*,BR1*,SI1*,CH0*,RAW,TS,F,C,K,LY,VAR,IR,IP,CSH,GLSFD3,GLSFD4,GLSFD5,GLSFF4,GLSFF2,GLSFF3,GLSFF1,GSF4,GSF5,GSF1,GSF2,GSF3,HD2,HD3,BT,GR,RO6,RO5,RO9,RO8,RO7,RO4,RO1,RO3,RO2,SH,ME,TMP2,S,LSF,J")
@METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN,RETURNLOC=OUT")
final class LayerIIIDecoder implements FrameDecoder {
static final double d43 = (4.0 / 3.0);
private float[][] k;
@LOC("NZ")
private int[] nonzero;
- // @LOC("HD")
- // private Header header;
@LOC("FT")
private SynthesisFilter filter1;
@LOC("FT")
@LOC("SBI")
private int sfreq;
- @LOC("ST")
+ @LOC("BR1")
private int part2_start;
- @LOC("ST")
+ @LOC("INIT")
private boolean initialized = false;
// constructor for the linear type system
}
@LATTICE("THIS<C,THIS<IN,C*,THISLOC=THIS")
- private void init(@LOC("IN") Header header) {
+ private void init(@LOC("THIS,LayerIIIDecoder.HD1") Header header) {
frame_start = 0;
channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
first_channel = last_channel = 0;
}
- for (@LOC("C") int ch = 0; ch < 2; ch++)
- for (@LOC("C") int j = 0; j < 576; j++)
+ for (@LOC("THIS,LayerIIIDecoder.CH0") int ch = 0; ch < 2; ch++)
+ for (@LOC("THIS,LayerIIIDecoder.CH0") int j = 0; j < 576; j++)
prevblck[ch][j] = 0.0f;
nonzero[0] = nonzero[1] = 576;
* {filter1,filter2}
*/
// @LATTICE("BYTE<THIS,THIS<MAIN,MAIN<VAR,THIS<GR,GR<VAR,BYTE*,GR*,THISLOC=THIS,GLOBALLOC=VAR")
- @LATTICE("VAR<THIS,C<THIS,THIS<IN,THISLOC=THIS,C*,VAR*")
- public void decode(@LOC("IN") Header header) {
+ @LATTICE("HEADER<VAR,VAR<THIS,C<THIS,THIS<IN,THISLOC=THIS,C*,VAR*")
+ public void decode(@LOC("THIS,LayerIIIDecoder.HD") Header header) {
if (!initialized) {
init(header);
get_side_info(header);
br = header.getBitReserve();
+ @LOC("THIS,LayerIIIDecoder.HD1") int version = header.version();
+
// here 'gr' and 'max_gr' should be higher than 'ch','channels', and more
for (gr = 0; gr < max_gr; gr++) { // two granules per channel
// in the loop body, access set={part2_start}
// 'ch', 'channels' should be higher than all locs in the below body
for (ch = 0; ch < channels; ch++) {
- part2_start = br.hsstell();
+ // part2_start = br.hsstell();
+ @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_start_local = br.hsstell();
// grab scale factors from the main data.
// following the scale factors is the actual compressed data
- if (header.version() == Header.MPEG1)
+ if (version == Header.MPEG1)
get_scale_factors(header, ch, gr); // no need to care from this side
// here move scale factor data from 'br' buffer to 'scalefac' field
else
// side
// here, decoding the compressed audio data
- huffman_decode(ch, gr); // no need to care from this side
+ huffman_decode(part2_start_local, ch, gr); // no need to care from this
+ // side
// System.out.println("CheckSum HuffMan = " + CheckSumHuff);
dequantize_sample(/* ro[ch], */ch, gr); // no need to care from this
// side
* Reads the side info from the stream, assuming the entire. frame has been
* read already. Mono : 136 bits (= 17 bytes) Stereo : 256 bits (= 32 bytes)
*/
- @LATTICE("THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=THIS")
- private boolean get_side_info(@LOC("IN") Header header) {
+ @LATTICE("OUT<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+ private boolean get_side_info(@LOC("THIS,LayerIIIDecoder.HD1") Header header) {
- @LOC("IN") SideInfoBuffer sib = header.getSideInfoBuffer();
+ @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.TEMP") SideInfoBuffer sib =
+ header.getSideInfoBuffer();
+ @LOC("THIS,LayerIIIDecoder.SF1") int version = header.version();
- @LOC("C") int ch;
- @LOC("C") int gr;
+ @LOC("THIS,LayerIIIDecoder.SI0") int ch;
+ @LOC("THIS,LayerIIIDecoder.SI0") int gr;
// System.out.println("#get_side_info");
- if (header.version() == Header.MPEG1) {
+ if (version == Header.MPEG1) {
si.main_data_begin = sib.get_bits(9);
if (channels == 1)
si.ch[ch].gr[gr].big_values = sib.get_bits(9);
si.ch[ch].gr[gr].global_gain = sib.get_bits(8);
si.ch[ch].gr[gr].scalefac_compress = sib.get_bits(4);
- si.ch[ch].gr[gr].window_switching_flag = sib.get_bits(1);
- if ((si.ch[ch].gr[gr].window_switching_flag) != 0) {
+ @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.TEMP") int cond =
+ sib.get_bits(1);
+ // si.ch[ch].gr[gr].window_switching_flag = sib.get_bits(1);
+ // if ((si.ch[ch].gr[gr].window_switching_flag) != 0) {
+ if (cond != 0) {
si.ch[ch].gr[gr].block_type = sib.get_bits(2);
si.ch[ch].gr[gr].mixed_block_flag = sib.get_bits(1);
si.ch[ch].gr[gr].region1_count = sib.get_bits(3);
si.ch[ch].gr[gr].block_type = 0;
}
+ //
+ si.ch[ch].gr[gr].window_switching_flag = cond;
+ //
si.ch[ch].gr[gr].preflag = sib.get_bits(1);
si.ch[ch].gr[gr].scalefac_scale = sib.get_bits(1);
si.ch[ch].gr[gr].count1table_select = sib.get_bits(1);
si.ch[ch].gr[0].big_values = sib.get_bits(9);
si.ch[ch].gr[0].global_gain = sib.get_bits(8);
si.ch[ch].gr[0].scalefac_compress = sib.get_bits(9);
- si.ch[ch].gr[0].window_switching_flag = sib.get_bits(1);
- if ((si.ch[ch].gr[0].window_switching_flag) != 0) {
+ @LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.TEMP") int cond =
+ sib.get_bits(1);
+ // si.ch[ch].gr[0].window_switching_flag = sib.get_bits(1);
+ // if ((si.ch[ch].gr[0].window_switching_flag) != 0) {
+ if (cond != 0) {
si.ch[ch].gr[0].block_type = sib.get_bits(2);
si.ch[ch].gr[0].mixed_block_flag = sib.get_bits(1);
si.ch[ch].gr[0].region1_count = sib.get_bits(3);
si.ch[ch].gr[0].block_type = 0;
}
+ //
+ si.ch[ch].gr[gr].window_switching_flag = cond;
+ //
si.ch[ch].gr[0].scalefac_scale = sib.get_bits(1);
si.ch[ch].gr[0].count1table_select = sib.get_bits(1);
*
*/
@LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
- private void get_scale_factors(@LOC("IN") Header header, @LOC("THIS,LayerIIIDecoder.CH0") int ch,
- @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+ private void get_scale_factors(@LOC("THIS,LayerIIIDecoder.SF1") Header header,
+ @LOC("THIS,LayerIIIDecoder.SF1") int ch, @LOC("THIS,LayerIIIDecoder.SF1") int gr) {
// gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias
// ssjava
@LATTICE("M<THIS,THIS<IN,THIS<C,C*,M*,THISLOC=THIS,GLOBALLOC=THIS")
- private void get_LSF_scale_data(@LOC("IN") Header header,
- @LOC("THIS,LayerIIIDecoder.CH0") int ch, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+ private void get_LSF_scale_data(@LOC("THIS,LayerIIIDecoder.SF15") Header header,
+ @LOC("THIS,LayerIIIDecoder.SF15") int ch, @LOC("THIS,LayerIIIDecoder.SF15") int gr) {
- @LOC("THIS,LayerIIIDecoder.HD1") int mode_ext = header.mode_extension();
+ @LOC("THIS,LayerIIIDecoder.SI0") int mode_ext = header.mode_extension();
// @LOC("THIS,LayerIIIDecoder.GLSFD1") gr_info_s gr_info =
// (si.ch[ch].gr[gr]); // remove alias
@LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR,LayerIIIDecoder$gr_info_s.V") int scalefac_comp =
si.ch[ch].gr[gr].scalefac_compress;
- @LOC("THIS,LayerIIIDecoder.SI") int blocktypenumber;
+ @LOC("THIS,LayerIIIDecoder.NS") int blocktypenumber;
@LOC("THIS,LayerIIIDecoder.SI,LayerIIIDecoder$III_side_info_t.CH,LayerIIIDecoder$temporaire.GR,LayerIIIDecoder$gr_info_s.V") int int_scalefac_comp;
@LOC("THIS,LayerIIIDecoder.SFB_SH") int m;
}
}
- for (@LOC("C") int x = 0; x < 45; x++)
+ for (@LOC("THIS,LayerIIIDecoder.NS") int x = 0; x < 45; x++)
// why 45, not 54?
scalefac_buffer[x] = 0;
m = 0;
- for (@LOC("C") int i = 0; i < 4; i++) {
+ for (@LOC("THIS,LayerIIIDecoder.NS") int i = 0; i < 4; i++) {
for (@LOC("THIS,LayerIIIDecoder.NS") int j = 0; j < nr_of_sfb_block[blocknumber][blocktypenumber][i]; j++) {
scalefac_buffer[m] = (new_slen[i] == 0) ? 0 : br.hgetbits(new_slen[i]);
m++;
*
*/
@LATTICE("THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
- private void get_LSF_scale_factors(@LOC("IN") Header header,
- @LOC("THIS,LayerIIIDecoder.CH0") int ch, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+ private void get_LSF_scale_factors(@LOC("THIS,LayerIIIDecoder.SF1") Header header,
+ @LOC("THIS,LayerIIIDecoder.SF1") int ch, @LOC("THIS,LayerIIIDecoder.SF1") int gr) {
@LOC("THIS,LayerIIIDecoder.SFB_SH") int sfb;
@LOC("THIS,LayerIIIDecoder.SFB_SH") int m = 0;
@LOC("SI1")
int w[] = { 0 };
- private void huffman_decode(@LOC("THIS,LayerIIIDecoder.CH0") int ch,
- @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+ @LATTICE("OUT<GLOBAL,GLOBAL<THIS,THISLOC=THIS,GLOBALLOC=GLOBAL,RETURNLOC=OUT")
+ private void huffman_decode(@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_start_local,
+ @LOC("THIS,LayerIIIDecoder.CH0") int ch, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
x[0] = 0;
y[0] = 0;
v[0] = 0;
w[0] = 0;
@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int part2_3_end =
- part2_start + si.ch[ch].gr[gr].part2_3_length;
+ part2_start_local + si.ch[ch].gr[gr].part2_3_length;
@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int num_bits;
@LOC("THIS,LayerIIIDecoder.SI1") int region1Start;
@LOC("THIS,LayerIIIDecoder.SI1") int region2Start;
for (@LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i +=
2) {
- @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int htIdx;
+ @LOC("THIS,LayerIIIDecoder.SI2") int htIdx;
if (i < region1Start) {
htIdx = si.ch[ch].gr[gr].table_select[0];
// h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[0]];
// Read count1 area
- @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int htIdx = si.ch[ch].gr[gr].count1table_select + 32;
+ @LOC("THIS,LayerIIIDecoder.SI2") int htIdx = si.ch[ch].gr[gr].count1table_select + 32;
// h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32];
num_bits = br.hsstell();
// ssjava
@LATTICE("IO<THIS,THIS<IN,THISLOC=THIS,GLOBALLOC=IN")
- private void stereo(@LOC("IN") Header header, @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
+ private void stereo(@LOC("THIS,LayerIIIDecoder.HD1") Header header,
+ @LOC("THIS,LayerIIIDecoder.CH0") int gr) {
@LOC("THIS,LayerIIIDecoder.RO1") int sb;
@LOC("THIS,LayerIIIDecoder.RO1") int ss;
} else {
// gr_info_s gr_info = (si.ch[0].gr[gr]); remove alias
- @LOC("THIS,LayerIIIDecoder.HD1") int mode_ext = header.mode_extension();
+ @LOC("THIS,LayerIIIDecoder.SF1") int mode_ext = header.mode_extension();
@LOC("THIS,LayerIIIDecoder.RO1") int sfb;
@LOC("THIS,LayerIIIDecoder.RO1") int i;
@LOC("THIS,LayerIIIDecoder.RO1") int temp;
@LOC("THIS,LayerIIIDecoder.RO1") int temp2;
- @LOC("THIS,LayerIIIDecoder.CH0") boolean ms_stereo =
+ @LOC("THIS,LayerIIIDecoder.SF15") boolean ms_stereo =
((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x2) != 0));
- @LOC("THIS,LayerIIIDecoder.CH0") boolean i_stereo =
+ @LOC("THIS,LayerIIIDecoder.SF15") boolean i_stereo =
((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x1) != 0));
- @LOC("THIS,LayerIIIDecoder.CH0") boolean lsf =
+ @LOC("THIS,LayerIIIDecoder.SF15") boolean lsf =
((header.version() == Header.MPEG2_LSF || header.version() == Header.MPEG25_LSF)); // SZD
@LOC("THIS,LayerIIIDecoder.LR") int io_type = (si.ch[0].gr[gr].scalefac_compress & 1);
private void hybrid(@LOC("THIS,LayerIIIDecoder.SI") int ch, @LOC("THIS,LayerIIIDecoder.SI") int gr) {
@LOC("THIS,LayerIIIDecoder.SI1") int bt;
- @LOC("SB") int sb18;
+ @LOC("THIS,LayerIIIDecoder.SI1") int sb18;
// gr_info_s gr_info = (si.ch[ch].gr[gr]); //remove alias
// @LOC("THIS,LayerIIIDecoder.TS") float[] tsOut; //remove alias
// float[][] prvblk;
for (sb18 = 0; sb18 < 576; sb18 += 18) {
- bt =
- ((si.ch[ch].gr[gr].window_switching_flag != 0)
- && (si.ch[ch].gr[gr].mixed_block_flag != 0) && (sb18 < 36)) ? 0
- : si.ch[ch].gr[gr].block_type;
+ if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0)
+ && (sb18 < 36)) {
+ bt = 0;
+ } else {
+ bt = si.ch[ch].gr[gr].block_type;
+ }
// tsOut = out_1d;
// Modif E.B 02/22/99
- for (@LOC("SB") int cc = 0; cc < 18; cc++)
+ for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
tsOutCopy[cc] = out_1d[cc + sb18];
inv_mdct(bt);
- for (@LOC("SB") int cc = 0; cc < 18; cc++)
+ for (@LOC("THIS,LayerIIIDecoder.SI1") int cc = 0; cc < 18; cc++)
out_1d[cc + sb18] = tsOutCopy[cc];
// Fin Modif
/**
*
*/
- @LATTICE("THIS<SB,THIS<SS,SB<GLOBAL,SS<GLOBAL,SS*,SB*,THISLOC=THIS,GLOBALLOC=GLOBAL")
private void do_downmix() {
- for (@LOC("SB") int sb = 0; sb < SSLIMIT; sb++) {
- for (@LOC("SS") int ss = 0; ss < SSLIMIT; ss += 3) {
+ for (@LOC("THIS,LayerIIIDecoder.ISR") int sb = 0; sb < SSLIMIT; sb++) {
+ for (@LOC("THIS,LayerIIIDecoder.ISR") int ss = 0; ss < SSLIMIT; ss += 3) {
lr[0][sb][ss] = (lr[0][sb][ss] + lr[1][sb][ss]) * 0.5f;
lr[0][sb][ss + 1] = (lr[0][sb][ss + 1] + lr[1][sb][ss + 1]) * 0.5f;
lr[0][sb][ss + 2] = (lr[0][sb][ss + 2] + lr[1][sb][ss + 2]) * 0.5f;
}
}
- @LATTICE("CH")
+ @LATTICE("CH<TEMP,TEMP*")
static class III_side_info_t {
@LOC("CH")
* @return true if the last frame was played, or false if there are more\r
* frames.\r
*/\r
- @LATTICE("IN<T,IN*,THISLOC=T")\r
- @RETURNLOC("IN")\r
+ @LATTICE("T<IN,T*,IN*,THISLOC=T")\r
+ @RETURNLOC("T")\r
public boolean play(@LOC("IN") int frames) throws JavaLayerException {\r
- @LOC("IN") boolean ret = true;\r
+ @LOC("T") boolean ret = true;\r
\r
SSJAVA: while (frames-- > 0 && ret) {\r
ret = decodeFrame();\r
* \r
* @return true if there are no more frames to decode, false otherwise.\r
*/\r
- @LATTICE("C,O<THIS,THIS<IN,C*,THISLOC=THIS,RETURNLOC=O")\r
+ @LATTICE("C<THIS,O<THIS,THIS<IN,C*,THISLOC=THIS,RETURNLOC=O,GLOBALLOC=THIS")\r
protected boolean decodeFrame() throws JavaLayerException {\r
try {\r
// AudioDevice out = audio;\r
// return false;\r
\r
// Header h = bitstream.readFrame();\r
- @LOC("IN") Header h = BitstreamWrapper.readFrame();\r
+ @LOC("THIS,Player.ST") Header h = BitstreamWrapper.readFrame();\r
\r
if (h == null)\r
return false;\r
static void init(int freq, int channels) {
output = new SampleBuffer(freq, channels);
}
+
+ @TRUST
+ static void clear_buffer(){
+ output.clear_buffer();
+ }
@TRUST
static SampleBuffer getOutput() {
0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, 0x00001FFF, 0x00003FFF,
0x00007FFF, 0x0000FFFF, 0x0001FFFF };
- @LATTICE("OUT<THIS,THIS<IN,THISLOC=THIS,RETURNLOC=OUT")
+ @LATTICE("OUT<THIS,THIS<IN,OUT*,THISLOC=THIS,RETURNLOC=OUT")
public int get_bits(@LOC("IN") int number_of_bits) {
@LOC("OUT") int returnvalue = 0;
@LOC("THIS,SideInfoBuffer.IDX") int sum = bitindex + number_of_bits;
// ((short[])&returnvalue)[0] = ((short[])wordpointer + 1)[0];
// wordpointer++; // Added by me!
// ((short[])&returnvalue + 1)[0] = ((short[])wordpointer)[0];
- @LOC("THIS,SideInfoBuffer.IDX") int Right = (framebuffer[wordpointer] & 0x0000FFFF);
+ @LOC("OUT") int Right = (framebuffer[wordpointer] & 0x0000FFFF);
wordpointer++;
- @LOC("THIS,SideInfoBuffer.IDX") int Left = (framebuffer[wordpointer] & 0xFFFF0000);
+ @LOC("OUT") int Left = (framebuffer[wordpointer] & 0xFFFF0000);
returnvalue = ((Right << 16) & 0xFFFF0000) | ((Left >>> 16) & 0x0000FFFF);
returnvalue >>>= 48 - sum; // returnvalue >>= 16 - (number_of_bits - (32
* from 32, 44.1 or 48 kHz to 8 kHz, if ULAW is defined. Frequencies above 4 kHz\r
* are removed by ignoring higher subbands.\r
*/\r
-@LATTICE("OUT<V,V<SAMPLE,SAMPLE<EQ,EQ<IDX")\r
+@LATTICE("OUT<V1,V1<V,V<NEWV,NEWV<SAMPLE,SAMPLE<EQ,EQ<IDX,NEWV*,IDX*")\r
+@METHODDEFAULT("OUT<THIS,THIS<C,C<IN,C*,THISLOC=THIS,GLOBALLOC=THIS")\r
final class SynthesisFilter {\r
\r
@LOC("IDX")\r
* public int getQuality() { return quality; }\r
*/\r
\r
- /**\r
- * Reset the synthesis filter.\r
- */\r
- public void reset() {\r
- // float[] floatp;\r
- // float[] floatp2;\r
-\r
- // initialize v1[] and v2[]:\r
- // for (floatp = v1 + 512, floatp2 = v2 + 512; floatp > v1; )\r
- // *--floatp = *--floatp2 = 0.0;\r
- for (int p = 0; p < 512; p++)\r
- v1[p] = v2[p] = 0.0f;\r
-\r
- // initialize samples[]:\r
- // for (floatp = samples + 32; floatp > samples; )\r
- // *--floatp = 0.0;\r
- for (int p2 = 0; p2 < 32; p2++)\r
- samples[p2] = 0.0f;\r
-\r
- // actual_v = v1;\r
- actual_write_pos = 15;\r
- }\r
-\r
/**\r
* Inject Sample.\r
*/\r
- public void input_sample(float sample, int subbandnumber) {\r
+ public void input_sample(@LOC("IN") float sample, @LOC("IN") int subbandnumber) {\r
samples[subbandnumber] = eq[subbandnumber] * sample;\r
}\r
\r
- public void input_samples(float[] s) {\r
- for (int i = 31; i >= 0; i--) {\r
+ public void input_samples(@LOC("IN") float[] s) {\r
+ for (@LOC("C") int i = 31; i >= 0; i--) {\r
samples[i] = s[i] * eq[i];\r
}\r
}\r
\r
private void compute_new_v2_v1() {\r
\r
- float new_v0, new_v1, new_v2, new_v3, new_v4, new_v5, new_v6, new_v7, new_v8, new_v9;\r
- float new_v10, new_v11, new_v12, new_v13, new_v14, new_v15, new_v16, new_v17, new_v18, new_v19;\r
- float new_v20, new_v21, new_v22, new_v23, new_v24, new_v25, new_v26, new_v27, new_v28, new_v29;\r
- float new_v30, new_v31;\r
-\r
- new_v0 =\r
- new_v1 =\r
- new_v2 =\r
- new_v3 =\r
- new_v4 =\r
- new_v5 =\r
- new_v6 =\r
- new_v7 =\r
- new_v8 =\r
- new_v9 =\r
- new_v10 =\r
- new_v11 =\r
- new_v12 =\r
- new_v13 =\r
- new_v14 =\r
- new_v15 =\r
- new_v16 =\r
- new_v17 =\r
- new_v18 =\r
- new_v19 =\r
- new_v20 =\r
- new_v21 =\r
- new_v22 =\r
- new_v23 =\r
- new_v24 =\r
- new_v25 =\r
- new_v26 =\r
- new_v27 =\r
- new_v28 =\r
- new_v29 =\r
- new_v30 =\r
- new_v31 =\r
- 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v0 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v1 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v2 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v3 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v4 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v5 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v6 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v7 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v8 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v9 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v10 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v11 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v12 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v13 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v14 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v15 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v16 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v17 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v18 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v19 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v20 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v21 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v22 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v23 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v24 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v25 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v26 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v27 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v28 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v29 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v30 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v31 = 0.0f;\r
\r
// float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure\r
// 3-A.2 in ISO DIS 11172-3\r
\r
// float[] s = samples;\r
\r
- float s0 = samples[0];\r
- float s1 = samples[1];\r
- float s2 = samples[2];\r
- float s3 = samples[3];\r
- float s4 = samples[4];\r
- float s5 = samples[5];\r
- float s6 = samples[6];\r
- float s7 = samples[7];\r
- float s8 = samples[8];\r
- float s9 = samples[9];\r
- float s10 = samples[10];\r
- float s11 = samples[11];\r
- float s12 = samples[12];\r
- float s13 = samples[13];\r
- float s14 = samples[14];\r
- float s15 = samples[15];\r
- float s16 = samples[16];\r
- float s17 = samples[17];\r
- float s18 = samples[18];\r
- float s19 = samples[19];\r
- float s20 = samples[20];\r
- float s21 = samples[21];\r
- float s22 = samples[22];\r
- float s23 = samples[23];\r
- float s24 = samples[24];\r
- float s25 = samples[25];\r
- float s26 = samples[26];\r
- float s27 = samples[27];\r
- float s28 = samples[28];\r
- float s29 = samples[29];\r
- float s30 = samples[30];\r
- float s31 = samples[31];\r
-\r
- float p0 = s0 + s31;\r
- float p1 = s1 + s30;\r
- float p2 = s2 + s29;\r
- float p3 = s3 + s28;\r
- float p4 = s4 + s27;\r
- float p5 = s5 + s26;\r
- float p6 = s6 + s25;\r
- float p7 = s7 + s24;\r
- float p8 = s8 + s23;\r
- float p9 = s9 + s22;\r
- float p10 = s10 + s21;\r
- float p11 = s11 + s20;\r
- float p12 = s12 + s19;\r
- float p13 = s13 + s18;\r
- float p14 = s14 + s17;\r
- float p15 = s15 + s16;\r
-\r
- float pp0 = p0 + p15;\r
- float pp1 = p1 + p14;\r
- float pp2 = p2 + p13;\r
- float pp3 = p3 + p12;\r
- float pp4 = p4 + p11;\r
- float pp5 = p5 + p10;\r
- float pp6 = p6 + p9;\r
- float pp7 = p7 + p8;\r
- float pp8 = (p0 - p15) * cos1_32;\r
- float pp9 = (p1 - p14) * cos3_32;\r
- float pp10 = (p2 - p13) * cos5_32;\r
- float pp11 = (p3 - p12) * cos7_32;\r
- float pp12 = (p4 - p11) * cos9_32;\r
- float pp13 = (p5 - p10) * cos11_32;\r
- float pp14 = (p6 - p9) * cos13_32;\r
- float pp15 = (p7 - p8) * cos15_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s0 = samples[0];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s1 = samples[1];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s2 = samples[2];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s3 = samples[3];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s4 = samples[4];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s5 = samples[5];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s6 = samples[6];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s7 = samples[7];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s8 = samples[8];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s9 = samples[9];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s10 = samples[10];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s11 = samples[11];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s12 = samples[12];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s13 = samples[13];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s14 = samples[14];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s15 = samples[15];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s16 = samples[16];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s17 = samples[17];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s18 = samples[18];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s19 = samples[19];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s20 = samples[20];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s21 = samples[21];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s22 = samples[22];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s23 = samples[23];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s24 = samples[24];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s25 = samples[25];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s26 = samples[26];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s27 = samples[27];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s28 = samples[28];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s29 = samples[29];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s30 = samples[30];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s31 = samples[31];\r
+\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p0 = s0 + s31;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p1 = s1 + s30;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p2 = s2 + s29;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p3 = s3 + s28;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p4 = s4 + s27;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p5 = s5 + s26;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p6 = s6 + s25;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p7 = s7 + s24;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p8 = s8 + s23;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p9 = s9 + s22;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p10 = s10 + s21;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p11 = s11 + s20;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p12 = s12 + s19;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p13 = s13 + s18;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p14 = s14 + s17;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p15 = s15 + s16;\r
+\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp0 = p0 + p15;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp1 = p1 + p14;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp2 = p2 + p13;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp3 = p3 + p12;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp4 = p4 + p11;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp5 = p5 + p10;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp6 = p6 + p9;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp7 = p7 + p8;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp8 = (p0 - p15) * cos1_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp9 = (p1 - p14) * cos3_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp10 = (p2 - p13) * cos5_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp11 = (p3 - p12) * cos7_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp12 = (p4 - p11) * cos9_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp13 = (p5 - p10) * cos11_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp14 = (p6 - p9) * cos13_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp15 = (p7 - p8) * cos15_32;\r
\r
p0 = pp0 + pp7;\r
p1 = pp1 + pp6;\r
p15 = (pp14 - pp15) * cos1_4;\r
\r
// this is pretty insane coding\r
- float tmp1;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float tmp1;\r
new_v19/* 36-17 */= -(new_v4 = (new_v12 = p7) + p5) - p6;\r
new_v27/* 44-17 */= -p6 - p7 - p4;\r
new_v6 = (new_v10 = (new_v14 = p15) + p11) + p13;\r
\r
// manually doing something that a compiler should handle sucks\r
// coding like this is hard to read\r
- float tmp2;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float tmp2;\r
new_v5 = (new_v11 = (new_v13 = (new_v15 = p15) + p7) + p11) + p5 + p13;\r
new_v7 = (new_v9 = p15 + p11 + p3) + p13;\r
new_v16/* 33-17 */= -(new_v1 = (tmp1 = p13 + p15 + p9) + p1) - p14;\r
// float[] x2 = actual_v + actual_write_pos;\r
// float dest[] = actual_v; v2\r
\r
- int pos = actual_write_pos;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int pos = actual_write_pos;\r
\r
v2[0 + pos] = new_v0;\r
v2[16 + pos] = new_v1;\r
\r
private void compute_new_v1_v2() {\r
\r
- float new_v0, new_v1, new_v2, new_v3, new_v4, new_v5, new_v6, new_v7, new_v8, new_v9;\r
- float new_v10, new_v11, new_v12, new_v13, new_v14, new_v15, new_v16, new_v17, new_v18, new_v19;\r
- float new_v20, new_v21, new_v22, new_v23, new_v24, new_v25, new_v26, new_v27, new_v28, new_v29;\r
- float new_v30, new_v31;\r
-\r
- new_v0 =\r
- new_v1 =\r
- new_v2 =\r
- new_v3 =\r
- new_v4 =\r
- new_v5 =\r
- new_v6 =\r
- new_v7 =\r
- new_v8 =\r
- new_v9 =\r
- new_v10 =\r
- new_v11 =\r
- new_v12 =\r
- new_v13 =\r
- new_v14 =\r
- new_v15 =\r
- new_v16 =\r
- new_v17 =\r
- new_v18 =\r
- new_v19 =\r
- new_v20 =\r
- new_v21 =\r
- new_v22 =\r
- new_v23 =\r
- new_v24 =\r
- new_v25 =\r
- new_v26 =\r
- new_v27 =\r
- new_v28 =\r
- new_v29 =\r
- new_v30 =\r
- new_v31 =\r
- 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v0 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v1 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v2 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v3 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v4 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v5 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v6 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v7 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v8 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v9 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v10 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v11 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v12 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v13 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v14 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v15 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v16 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v17 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v18 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v19 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v20 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v21 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v22 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v23 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v24 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v25 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v26 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v27 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v28 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v29 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v30 = 0.0f;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float new_v31 = 0.0f;\r
\r
// float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure\r
// 3-A.2 in ISO DIS 11172-3\r
\r
// float[] s = samples;\r
\r
- float s0 = samples[0];\r
- float s1 = samples[1];\r
- float s2 = samples[2];\r
- float s3 = samples[3];\r
- float s4 = samples[4];\r
- float s5 = samples[5];\r
- float s6 = samples[6];\r
- float s7 = samples[7];\r
- float s8 = samples[8];\r
- float s9 = samples[9];\r
- float s10 = samples[10];\r
- float s11 = samples[11];\r
- float s12 = samples[12];\r
- float s13 = samples[13];\r
- float s14 = samples[14];\r
- float s15 = samples[15];\r
- float s16 = samples[16];\r
- float s17 = samples[17];\r
- float s18 = samples[18];\r
- float s19 = samples[19];\r
- float s20 = samples[20];\r
- float s21 = samples[21];\r
- float s22 = samples[22];\r
- float s23 = samples[23];\r
- float s24 = samples[24];\r
- float s25 = samples[25];\r
- float s26 = samples[26];\r
- float s27 = samples[27];\r
- float s28 = samples[28];\r
- float s29 = samples[29];\r
- float s30 = samples[30];\r
- float s31 = samples[31];\r
-\r
- float p0 = s0 + s31;\r
- float p1 = s1 + s30;\r
- float p2 = s2 + s29;\r
- float p3 = s3 + s28;\r
- float p4 = s4 + s27;\r
- float p5 = s5 + s26;\r
- float p6 = s6 + s25;\r
- float p7 = s7 + s24;\r
- float p8 = s8 + s23;\r
- float p9 = s9 + s22;\r
- float p10 = s10 + s21;\r
- float p11 = s11 + s20;\r
- float p12 = s12 + s19;\r
- float p13 = s13 + s18;\r
- float p14 = s14 + s17;\r
- float p15 = s15 + s16;\r
-\r
- float pp0 = p0 + p15;\r
- float pp1 = p1 + p14;\r
- float pp2 = p2 + p13;\r
- float pp3 = p3 + p12;\r
- float pp4 = p4 + p11;\r
- float pp5 = p5 + p10;\r
- float pp6 = p6 + p9;\r
- float pp7 = p7 + p8;\r
- float pp8 = (p0 - p15) * cos1_32;\r
- float pp9 = (p1 - p14) * cos3_32;\r
- float pp10 = (p2 - p13) * cos5_32;\r
- float pp11 = (p3 - p12) * cos7_32;\r
- float pp12 = (p4 - p11) * cos9_32;\r
- float pp13 = (p5 - p10) * cos11_32;\r
- float pp14 = (p6 - p9) * cos13_32;\r
- float pp15 = (p7 - p8) * cos15_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s0 = samples[0];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s1 = samples[1];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s2 = samples[2];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s3 = samples[3];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s4 = samples[4];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s5 = samples[5];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s6 = samples[6];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s7 = samples[7];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s8 = samples[8];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s9 = samples[9];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s10 = samples[10];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s11 = samples[11];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s12 = samples[12];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s13 = samples[13];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s14 = samples[14];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s15 = samples[15];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s16 = samples[16];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s17 = samples[17];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s18 = samples[18];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s19 = samples[19];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s20 = samples[20];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s21 = samples[21];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s22 = samples[22];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s23 = samples[23];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s24 = samples[24];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s25 = samples[25];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s26 = samples[26];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s27 = samples[27];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s28 = samples[28];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s29 = samples[29];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s30 = samples[30];\r
+ @LOC("THIS,SynthesisFilter.NEWV") float s31 = samples[31];\r
+\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p0 = s0 + s31;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p1 = s1 + s30;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p2 = s2 + s29;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p3 = s3 + s28;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p4 = s4 + s27;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p5 = s5 + s26;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p6 = s6 + s25;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p7 = s7 + s24;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p8 = s8 + s23;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p9 = s9 + s22;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p10 = s10 + s21;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p11 = s11 + s20;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p12 = s12 + s19;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p13 = s13 + s18;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p14 = s14 + s17;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float p15 = s15 + s16;\r
+\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp0 = p0 + p15;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp1 = p1 + p14;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp2 = p2 + p13;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp3 = p3 + p12;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp4 = p4 + p11;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp5 = p5 + p10;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp6 = p6 + p9;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp7 = p7 + p8;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp8 = (p0 - p15) * cos1_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp9 = (p1 - p14) * cos3_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp10 = (p2 - p13) * cos5_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp11 = (p3 - p12) * cos7_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp12 = (p4 - p11) * cos9_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp13 = (p5 - p10) * cos11_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp14 = (p6 - p9) * cos13_32;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float pp15 = (p7 - p8) * cos15_32;\r
\r
p0 = pp0 + pp7;\r
p1 = pp1 + pp6;\r
p15 = (pp14 - pp15) * cos1_4;\r
\r
// this is pretty insane coding\r
- float tmp1;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float tmp1;\r
new_v19/* 36-17 */= -(new_v4 = (new_v12 = p7) + p5) - p6;\r
new_v27/* 44-17 */= -p6 - p7 - p4;\r
new_v6 = (new_v10 = (new_v14 = p15) + p11) + p13;\r
\r
// manually doing something that a compiler should handle sucks\r
// coding like this is hard to read\r
- float tmp2;\r
+ @LOC("THIS,SynthesisFilter.NEWV") float tmp2;\r
new_v5 = (new_v11 = (new_v13 = (new_v15 = p15) + p7) + p11) + p5 + p13;\r
new_v7 = (new_v9 = p15 + p11 + p3) + p13;\r
new_v16/* 33-17 */= -(new_v1 = (tmp1 = p13 + p15 + p9) + p1) - p14;\r
// float[] x2 = actual_v + actual_write_pos;\r
// float dest[] = actual_v; actual_v=v1;\r
\r
- int pos = actual_write_pos;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int pos = actual_write_pos;\r
\r
v1[0 + pos] = new_v0;\r
v1[16 + pos] = new_v1;\r
* Compute PCM Samples.\r
*/\r
\r
- @LOC("OUT") private float[] _tmpOut = new float[32];\r
+ @LOC("OUT")\r
+ private float[] _tmpOut = new float[32];\r
\r
private void compute_pcm_samples0() {\r
\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- float pcm_sample;\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
// final float[] dp = d16[i];\r
pcm_sample =\r
(float) (((v1[0 + dvp] * d16[i][0]) + (v1[15 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- float pcm_sample;\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
// final float[] dp = d16[i];\r
pcm_sample =\r
(float) (((v2[0 + dvp] * d16[i][0]) + (v2[15 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[1 + dvp] * d16[i][0]) + (v1[0 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[1 + dvp] * d16[i][0]) + (v2[0 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[2 + dvp] * d16[i][0]) + (v1[1 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[2 + dvp] * d16[i][0]) + (v2[1 + dvp] * d16[i][1])\r
if (vidx == 1) {\r
// final float[] vp = actual_v;\r
\r
- int idx = 0;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[3 + dvp] * d16[i][0]) + (v1[2 + dvp] * d16[i][1])\r
} else {\r
// final float[] vp = actual_v;\r
\r
- int idx = 0;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[3 + dvp] * d16[i][0]) + (v2[2 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[4 + dvp] * d16[i][0]) + (v1[3 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[4 + dvp] * d16[i][0]) + (v2[3 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[5 + dvp] * d16[i][0]) + (v1[4 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[5 + dvp] * d16[i][0]) + (v2[4 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[6 + dvp] * d16[i][0]) + (v1[5 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[6 + dvp] * d16[i][0]) + (v2[5 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[7 + dvp] * d16[i][0]) + (v1[6 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[7 + dvp] * d16[i][0]) + (v2[6 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[8 + dvp] * d16[i][0]) + (v1[7 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[8 + dvp] * d16[i][0]) + (v2[7 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[9 + dvp] * d16[i][0]) + (v1[8 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[9 + dvp] * d16[i][0]) + (v2[8 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[10 + dvp] * d16[i][0]) + (v1[9 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[10 + dvp] * d16[i][0]) + (v2[9 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[11 + dvp] * d16[i][0]) + (v1[10 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[11 + dvp] * d16[i][0]) + (v2[10 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[12 + dvp] * d16[i][0]) + (v1[11 + dvp] * d16[i][1])\r
// final float[] vp = actual_v;\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[12 + dvp] * d16[i][0]) + (v2[11 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[13 + dvp] * d16[i][0]) + (v1[12 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[13 + dvp] * d16[i][0]) + (v2[12 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v1[14 + dvp] * d16[i][0]) + (v1[13 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
// final float[] dp = d16[i];\r
- float pcm_sample;\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
\r
pcm_sample =\r
(float) (((v2[14 + dvp] * d16[i][0]) + (v2[13 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- float pcm_sample;\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
// final float d16[i][] = d16[i];\r
pcm_sample =\r
(float) (((v1[15 + dvp] * d16[i][0]) + (v1[14 + dvp] * d16[i][1])\r
\r
// int inc = v_inc;\r
// final float[] tmpOut = _tmpOut;\r
- int dvp = 0;\r
+ @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0;\r
\r
// fat chance of having this loop unroll\r
- for (int i = 0; i < 32; i++) {\r
- float pcm_sample;\r
+ for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) {\r
+ @LOC("THIS,SynthesisFilter.V1") float pcm_sample;\r
// final float d16[i][] = d16[i];\r
pcm_sample =\r
(float) (((v2[15 + dvp] * d16[i][0]) + (v2[14 + dvp] * d16[i][1])\r
\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 (int p = 0; p < 32; p++)\r
+ for (@LOC("C") int p = 0; p < 32; p++)\r
samples[p] = 0.0f;\r
}\r
\r
/**\r
* Class to implements Huffman decoder.\r
*/\r
-@LATTICE("FIELD<FINAL")\r
+@LATTICE("FIELD<FINAL,FIELD*")\r
@METHODDEFAULT("OUT<V,V<SH,SH<IN,SH*,THISLOC=IN,GLOBALLOC=IN")\r
final class huffcodetab {\r
private static final int MXOFF = 250;\r
* Big Constructor : Computes all Huffman Tables.\r
*/\r
private huffcodetab(@LOC("V") String S, @LOC("V") int XLEN, @LOC("V") int YLEN,\r
- @LOC("V") int LINBITS, @LOC("V") int LINMAX, @LOC("V") int REF, @DELEGATE @LOC("V") int[] TABLE,\r
- @DELEGATE @LOC("V") int[] HLEN,@DELEGATE @LOC("V") int[][] VAL, @LOC("V") int TREELEN) {\r
+ @LOC("V") int LINBITS, @LOC("V") int LINMAX, @LOC("V") int REF,\r
+ @DELEGATE @LOC("V") int[] TABLE, @DELEGATE @LOC("V") int[] HLEN,\r
+ @DELEGATE @LOC("V") int[][] VAL, @LOC("V") int TREELEN) {\r
tablename0 = S.charAt(0);\r
tablename1 = S.charAt(1);\r
tablename2 = S.charAt(2);\r
VAL = null;\r
treelen = TREELEN;\r
}\r
- \r
+\r
/**\r
- * Do the huffman-decoding.\r
- * note! for counta,countb -the 4 bit value is returned in y,\r
- * discard x.\r
+ * Do the huffman-decoding. note! for counta,countb -the 4 bit value is\r
+ * returned in y, discard x.\r
*/\r
- public static int huffman_decoder(int htIdx, int[] x, int[] y, int[] v, int[] w, BitReserve br)\r
- {\r
- // array of all huffcodtable headers\r
- // 0..31 Huffman code table 0..31\r
- // 32,33 count1-tables\r
- \r
-\r
- int dmask = 1 << ((4 * 8) - 1);\r
- int hs = 4 * 8;\r
- int level;\r
- int point = 0;\r
- int error = 1;\r
- level = dmask;\r
-\r
- if (ht[htIdx].val == null) return 2;\r
-\r
- /* table 0 needs no bits */\r
- if ( ht[htIdx].treelen == 0)\r
- { \r
- x[0] = y[0] = 0;\r
- return 0;\r
- }\r
-\r
- /* Lookup in Huffman table. */\r
-\r
- /*int bitsAvailable = 0; \r
- int bitIndex = 0;\r
- \r
- int bits[] = bitbuf;*/\r
- do \r
- {\r
- if (ht[htIdx].val[point][0]==0)\r
- { /*end of tree*/\r
- x[0] = ht[htIdx].val[point][1] >>> 4;\r
- y[0] = ht[htIdx].val[point][1] & 0xf;\r
- error = 0;\r
- break;\r
- }\r
- \r
- // hget1bit() is called thousands of times, and so needs to be\r
- // ultra fast. \r
- /*\r
- if (bitIndex==bitsAvailable)\r
- {\r
- bitsAvailable = br.readBits(bits, 32); \r
- bitIndex = 0;\r
- }\r
- */\r
- //if (bits[bitIndex++]!=0)\r
- if (br.hget1bit()!=0)\r
- {\r
- while (ht[htIdx].val[point][1] >= MXOFF) point += ht[htIdx].val[point][1];\r
- point += ht[htIdx].val[point][1];\r
- }\r
- else\r
- {\r
- while (ht[htIdx].val[point][0] >= MXOFF) point += ht[htIdx].val[point][0];\r
- point += ht[htIdx].val[point][0];\r
- }\r
- level >>>= 1;\r
- // MDM: ht[0] is always 0;\r
- } while ((level !=0 ) || (point < 0 /*ht[0].treelen*/) );\r
- \r
- // put back any bits not consumed\r
- /* \r
- int unread = (bitsAvailable-bitIndex);\r
- if (unread>0)\r
- br.rewindNbits(unread);\r
- */\r
- /* Process sign encodings for quadruples tables. */\r
- // System.out.println(ht[htIdx].tablename);\r
- if (ht[htIdx].tablename0 == '3' && (ht[htIdx].tablename1 == '2' || ht[htIdx].tablename1 == '3'))\r
- {\r
- v[0] = (y[0]>>3) & 1;\r
- w[0] = (y[0]>>2) & 1;\r
- x[0] = (y[0]>>1) & 1;\r
- y[0] = y[0] & 1;\r
-\r
- /* v, w, x and y are reversed in the bitstream.\r
- switch them around to make test bistream work. */\r
-\r
- if (v[0]!=0)\r
- if (br.hget1bit() != 0) v[0] = -v[0];\r
- if (w[0]!=0)\r
- if (br.hget1bit() != 0) w[0] = -w[0];\r
- if (x[0]!=0)\r
- if (br.hget1bit() != 0) x[0] = -x[0];\r
- if (y[0]!=0)\r
- if (br.hget1bit() != 0) y[0] = -y[0];\r
- }\r
- else\r
- {\r
- // Process sign and escape encodings for dual tables.\r
- // x and y are reversed in the test bitstream.\r
- // Reverse x and y here to make test bitstream work.\r
-\r
- if (ht[htIdx].linbits != 0)\r
- if ((ht[htIdx].xlen-1) == x[0])\r
- x[0] += br.hgetbits(ht[htIdx].linbits);\r
- if (x[0] != 0)\r
- if (br.hget1bit() != 0) x[0] = -x[0];\r
- if (ht[htIdx].linbits != 0)\r
- if ((ht[htIdx].ylen-1) == y[0])\r
- y[0] += br.hgetbits(ht[htIdx].linbits);\r
- if (y[0] != 0)\r
- if (br.hget1bit() != 0) y[0] = -y[0];\r
- }\r
- return error;\r
+ @LATTICE("OUT<THIS,THIS<V,V<IN,IN<C,C*,THISLOC=THIS,RETURNLOC=OUT,GLOBALLOC=IN")\r
+ public static int huffman_decoder(@LOC("THIS,LayerIIIDecoder.SI2") int htIdx,\r
+ @LOC("THIS,LayerIIIDecoder.SI1") int[] x, @LOC("THIS,LayerIIIDecoder.SI1") int[] y,\r
+ @LOC("THIS,LayerIIIDecoder.SI1") int[] v, @LOC("THIS,LayerIIIDecoder.SI1") int[] w,\r
+ @LOC("THIS,LayerIIIDecoder.BR") BitReserve br) {\r
+ // array of all huffcodtable headers\r
+ // 0..31 Huffman code table 0..31\r
+ // 32,33 count1-tables\r
+\r
+ @LOC("C") int dmask = 1 << ((4 * 8) - 1);\r
+ @LOC("THIS,LayerIIIDecoder.SI1") int hs = 4 * 8;\r
+ @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int level;\r
+ @LOC("THIS,LayerIIIDecoder.BR,BitReserve.BIT") int point = 0;\r
+ @LOC("OUT") int error = 1;\r
+ level = dmask;\r
+\r
+ if (ht[htIdx].val == null)\r
+ return 2;\r
+\r
+ /* table 0 needs no bits */\r
+ if (ht[htIdx].treelen == 0) {\r
+ x[0] = 0;\r
+ y[0] = 0;\r
+ return 0;\r
+ }\r
+\r
+ /* Lookup in Huffman table. */\r
+\r
+ /*\r
+ * int bitsAvailable = 0; int bitIndex = 0;\r
+ * \r
+ * int bits[] = bitbuf;\r
+ */\r
+ do {\r
+ if (ht[htIdx].val[point][0] == 0) { /* end of tree */\r
+ x[0] = ht[htIdx].val[point][1] >>> 4;\r
+ y[0] = ht[htIdx].val[point][1] & 0xf;\r
+ error = 0;\r
+ break;\r
+ }\r
+\r
+ // hget1bit() is called thousands of times, and so needs to be\r
+ // ultra fast.\r
+ /*\r
+ * if (bitIndex==bitsAvailable) { bitsAvailable = br.readBits(bits, 32);\r
+ * bitIndex = 0; }\r
+ */\r
+ // if (bits[bitIndex++]!=0)\r
+ if (br.hget1bit() != 0) {\r
+ while (ht[htIdx].val[point][1] >= MXOFF)\r
+ point += ht[htIdx].val[point][1];\r
+ point += ht[htIdx].val[point][1];\r
+ } else {\r
+ while (ht[htIdx].val[point][0] >= MXOFF)\r
+ point += ht[htIdx].val[point][0];\r
+ point += ht[htIdx].val[point][0];\r
+ }\r
+ level >>>= 1;\r
+ // MDM: ht[0] is always 0;\r
+ } while ((level != 0) || (point < 0 /* ht[0].treelen */));\r
+\r
+ // put back any bits not consumed\r
+ /*\r
+ * int unread = (bitsAvailable-bitIndex); if (unread>0)\r
+ * br.rewindNbits(unread);\r
+ */\r
+ /* Process sign encodings for quadruples tables. */\r
+ // System.out.println(ht[htIdx].tablename);\r
+ if (ht[htIdx].tablename0 == '3' && (ht[htIdx].tablename1 == '2' || ht[htIdx].tablename1 == '3')) {\r
+ v[0] = (y[0] >> 3) & 1;\r
+ w[0] = (y[0] >> 2) & 1;\r
+ x[0] = (y[0] >> 1) & 1;\r
+ y[0] = y[0] & 1;\r
+\r
+ /*\r
+ * v, w, x and y are reversed in the bitstream. switch them around to make\r
+ * test bistream work.\r
+ */\r
+\r
+ if (v[0] != 0)\r
+ if (br.hget1bit() != 0)\r
+ v[0] = -v[0];\r
+ if (w[0] != 0)\r
+ if (br.hget1bit() != 0)\r
+ w[0] = -w[0];\r
+ if (x[0] != 0)\r
+ if (br.hget1bit() != 0)\r
+ x[0] = -x[0];\r
+ if (y[0] != 0)\r
+ if (br.hget1bit() != 0)\r
+ y[0] = -y[0];\r
+ } else {\r
+ // Process sign and escape encodings for dual tables.\r
+ // x and y are reversed in the test bitstream.\r
+ // Reverse x and y here to make test bitstream work.\r
+\r
+ if (ht[htIdx].linbits != 0)\r
+ if ((ht[htIdx].xlen - 1) == x[0])\r
+ x[0] += br.hgetbits(ht[htIdx].linbits);\r
+ if (x[0] != 0)\r
+ if (br.hget1bit() != 0)\r
+ x[0] = -x[0];\r
+ if (ht[htIdx].linbits != 0)\r
+ if ((ht[htIdx].ylen - 1) == y[0])\r
+ y[0] += br.hgetbits(ht[htIdx].linbits);\r
+ if (y[0] != 0)\r
+ if (br.hget1bit() != 0)\r
+ y[0] = -y[0];\r
+ }\r
+ return error;\r
}\r
- \r
\r
/**\r
* Do the huffman-decoding. note! for counta,countb -the 4 bit value is\r
@LOC("OUT") int error = 1;\r
level = dmask;\r
\r
- if (ht[idx].val == null){\r
-// return 2;\r
+ if (ht[idx].val == null) {\r
+ // return 2;\r
return data;\r
}\r
\r
if (ht[idx].treelen == 0) {\r
data.y = 0;\r
data.x = 0;\r
-// return 0;\r
+ // return 0;\r
return data;\r
}\r
\r
if (data.br.hget1bit() != 0)\r
data.y = -data.y;\r
}\r
- \r
+\r
return data;\r
-// return error;\r
+ // return error;\r
}\r
- \r
+\r
public static void inithuff() {\r
\r
if (ht != null)\r