From: yeom Date: Thu, 18 Aug 2011 12:17:32 +0000 (+0000) Subject: more changes to pass the flow-down rule X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cbf149e6d6d5d28b8d0f7774958bef0b2e6eac5c;p=IRC.git more changes to pass the flow-down rule --- diff --git a/Robust/src/Analysis/SSJava/FlowDownCheck.java b/Robust/src/Analysis/SSJava/FlowDownCheck.java index 5b458dc6..89ba8091 100644 --- a/Robust/src/Analysis/SSJava/FlowDownCheck.java +++ b/Robust/src/Analysis/SSJava/FlowDownCheck.java @@ -136,7 +136,7 @@ public class FlowDownCheck { toanalyzeList.addAll(classtable.getValueSet()); Collections.sort(toanalyzeList, new Comparator() { public int compare(ClassDescriptor o1, ClassDescriptor o2) { - return o1.getClassName().compareTo(o2.getClassName()); + return o1.getClassName().compareToIgnoreCase(o2.getClassName()); } }); } else { @@ -153,7 +153,7 @@ public class FlowDownCheck { toanalyzeMethodList.addAll(methodtable.getValueSet()); Collections.sort(toanalyzeMethodList, new Comparator() { public int compare(MethodDescriptor o1, MethodDescriptor o2) { - return o1.getSymbol().compareTo(o2.getSymbol()); + return o1.getSymbol().compareToIgnoreCase(o2.getSymbol()); } }); } else { @@ -325,9 +325,9 @@ public class FlowDownCheck { // 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) { @@ -822,7 +822,7 @@ public class FlowDownCheck { && !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()); } @@ -831,7 +831,12 @@ public class FlowDownCheck { 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, @@ -841,14 +846,20 @@ public class FlowDownCheck { 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) { @@ -864,20 +875,24 @@ public class FlowDownCheck { } 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); @@ -893,7 +908,7 @@ public class FlowDownCheck { } } - return new CompositeLocation(); + return new CompositeLocation(Location.createTopLocation(md)); } @@ -949,7 +964,7 @@ public class FlowDownCheck { 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); @@ -1344,7 +1359,13 @@ public class FlowDownCheck { 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)); @@ -1352,7 +1373,7 @@ public class FlowDownCheck { Location fieldLoc = getFieldLocation(fd); loc.addLocation(fieldLoc); } - + System.out.println("### field loc="+loc); return loc; } @@ -1474,8 +1495,9 @@ public class FlowDownCheck { // 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 @@ -2124,8 +2146,14 @@ class ReturnLocGenerator { // 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; + } } } diff --git a/Robust/src/Analysis/SSJava/MethodAnnotationCheck.java b/Robust/src/Analysis/SSJava/MethodAnnotationCheck.java index df5d779d..bd585c07 100644 --- a/Robust/src/Analysis/SSJava/MethodAnnotationCheck.java +++ b/Robust/src/Analysis/SSJava/MethodAnnotationCheck.java @@ -106,7 +106,7 @@ public class MethodAnnotationCheck { 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); } diff --git a/Robust/src/ClassLibrary/SSJava/Character.java b/Robust/src/ClassLibrary/SSJava/Character.java index edff16e4..df60b97c 100644 --- a/Robust/src/ClassLibrary/SSJava/Character.java +++ b/Robust/src/ClassLibrary/SSJava/Character.java @@ -35,7 +35,7 @@ public class Character { value = c.value; } - @LATTICE("OUT { /** diff --git a/Robust/src/ClassLibrary/SSJava/Object.java b/Robust/src/ClassLibrary/SSJava/Object.java index 4bc8ac35..8e128c52 100644 --- a/Robust/src/ClassLibrary/SSJava/Object.java +++ b/Robust/src/ClassLibrary/SSJava/Object.java @@ -1,7 +1,7 @@ import String; @LATTICE("") -@METHODDEFAULT("TH 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; diff --git a/Robust/src/ClassLibrary/SSJava/System.java b/Robust/src/ClassLibrary/SSJava/System.java index 3d18547e..e5765604 100644 --- a/Robust/src/ClassLibrary/SSJava/System.java +++ b/Robust/src/ClassLibrary/SSJava/System.java @@ -20,15 +20,15 @@ public class System { 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"); } @@ -36,7 +36,7 @@ public class System { System.printString("\n"); } - public static void print(String s) { + public static void print(@LOC("IN") String s) { System.printString(s); } diff --git a/Robust/src/Tests/ssJava/mp3decoder/Decoder.java b/Robust/src/Tests/ssJava/mp3decoder/Decoder.java index febbd7c8..94486847 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/Decoder.java +++ b/Robust/src/Tests/ssJava/mp3decoder/Decoder.java @@ -26,7 +26,7 @@ * @version 0.0.7 12/12/99 * @since 0.0.5 */ -@LATTICE("OUTEqualizer class can be used to specify - * equalization settings for the MPEG audio decoder. + * The Equalizer class can be used to specify equalization settings + * for the MPEG audio decoder. *

- * The equalizer consists of 32 band-pass filters. - * Each band of the equalizer can take on a fractional value between - * -1.0 and +1.0. - * At -1.0, the input signal is attenuated by 6dB, at +1.0 the signal is - * amplified by 6dB. + * The equalizer consists of 32 band-pass filters. Each band of the equalizer + * can take on a fractional value between -1.0 and +1.0. At -1.0, the input + * signal is attenuated by 6dB, at +1.0 the signal is amplified by 6dB. * * @see Decoder * * @author MDM */ -@LATTICE("BEqualizer instance. - */ - public Equalizer() - { - } - -// private Equalizer(float b1, float b2, float b3, float b4, float b5, -// float b6, float b7, float b8, float b9, float b10, float b11, -// float b12, float b13, float b14, float b15, float b16, -// float b17, float b18, float b19, float b20); - - public Equalizer(float[] settings) - { - setFrom(settings); - } - - public Equalizer(EQFunction eq) - { - setFrom(eq); - } - - public void setFrom(float[] eq) - { - reset(); - int max = (eq.length > BANDS) ? BANDS : eq.length; - - for (int i=0; i=0) && (band=0) && (band 1.0f) - return 1.0f; - if (eq < -1.0f) - return -1.0f; - - return eq; - } - - /** - * Retrieves an array of floats whose values represent a - * scaling factor that can be applied to linear samples - * in each band to provide the equalization represented by - * this instance. - * - * @return an array of factors that can be applied to the - * subbands. - */ - @RETURNLOC("OUT") - float[] getBandFactors() - { - @LOC("OUT") float[] factors = new float[BANDS]; - @LOC("C") int maxCount = BANDS; - for (@LOC("SH") int i=0; iEqualizer instance. + */ + public Equalizer() { + } + + // private Equalizer(float b1, float b2, float b3, float b4, float b5, + // float b6, float b7, float b8, float b9, float b10, float b11, + // float b12, float b13, float b14, float b15, float b16, + // float b17, float b18, float b19, float b20); + + public Equalizer(float[] settings) { + setFrom(settings); + } + + public Equalizer(EQFunction eq) { + setFrom(eq); + } + + public void setFrom(float[] eq) { + reset(); + int max = (eq.length > BANDS) ? BANDS : eq.length; + + for (int i = 0; i < max; i++) { + settings[i] = limit(eq[i]); + } + } + + public void setFrom(EQFunction eq) { + reset(); + int max = BANDS; + + for (int i = 0; i < max; i++) { + settings[i] = limit(eq.getBand(i)); + } + } + + /** + * Sets the bands of this equalizer to the value the bands of another + * equalizer. Bands that are not present in both equalizers are ignored. + */ + public void setFrom(Equalizer eq) { + if (eq != this) { + setFrom(eq.settings); + } + } + + /** + * Sets all bands to 0.0 + */ + public void reset() { + for (int i = 0; i < BANDS; i++) { + settings[i] = 0.0f; + } + } + + /** + * Retrieves the number of bands present in this equalizer. + */ + public int getBandCount() { + return settings.length; + } + + public float setBand(int band, float neweq) { + float eq = 0.0f; + + if ((band >= 0) && (band < BANDS)) { + eq = settings[band]; + settings[band] = limit(neweq); + } + + return eq; + } + + /** + * Retrieves the eq setting for a given band. + */ + public float getBand(int band) { + float eq = 0.0f; + + if ((band >= 0) && (band < BANDS)) { + eq = settings[band]; + } + + return eq; + } + + private float limit(float eq) { + if (eq == BAND_NOT_PRESENT) + return eq; + if (eq > 1.0f) + return 1.0f; + if (eq < -1.0f) + return -1.0f; + + return eq; + } + + /** + * Retrieves an array of floats whose values represent a scaling factor that + * can be applied to linear samples in each band to provide the equalization + * represented by this instance. + * + * @return an array of factors that can be applied to the subbands. + */ + @LATTICE("OUT 0 && ret) { ret = decodeFrame(); @@ -170,7 +170,7 @@ public class Player { * * @return true if there are no more frames to decode, false otherwise. */ - @LATTICE("C,O>> 16) & 0x0000FFFF); returnvalue >>>= 48 - sum; // returnvalue >>= 16 - (number_of_bits - (32 diff --git a/Robust/src/Tests/ssJava/mp3decoder/SynthesisFilter.java b/Robust/src/Tests/ssJava/mp3decoder/SynthesisFilter.java index 0f276849..bc86eb80 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/SynthesisFilter.java +++ b/Robust/src/Tests/ssJava/mp3decoder/SynthesisFilter.java @@ -34,7 +34,8 @@ * from 32, 44.1 or 48 kHz to 8 kHz, if ULAW is defined. Frequencies above 4 kHz * are removed by ignoring higher subbands. */ -@LATTICE("OUT v1; ) - // *--floatp = *--floatp2 = 0.0; - for (int p = 0; p < 512; p++) - v1[p] = v2[p] = 0.0f; - - // initialize samples[]: - // for (floatp = samples + 32; floatp > samples; ) - // *--floatp = 0.0; - for (int p2 = 0; p2 < 32; p2++) - samples[p2] = 0.0f; - - // actual_v = v1; - actual_write_pos = 15; - } - /** * Inject Sample. */ - public void input_sample(float sample, int subbandnumber) { + public void input_sample(@LOC("IN") float sample, @LOC("IN") int subbandnumber) { samples[subbandnumber] = eq[subbandnumber] * sample; } - public void input_samples(float[] s) { - for (int i = 31; i >= 0; i--) { + public void input_samples(@LOC("IN") float[] s) { + for (@LOC("C") int i = 31; i >= 0; i--) { samples[i] = s[i] * eq[i]; } } private void compute_new_v2_v1() { - float new_v0, new_v1, new_v2, new_v3, new_v4, new_v5, new_v6, new_v7, new_v8, new_v9; - float new_v10, new_v11, new_v12, new_v13, new_v14, new_v15, new_v16, new_v17, new_v18, new_v19; - float new_v20, new_v21, new_v22, new_v23, new_v24, new_v25, new_v26, new_v27, new_v28, new_v29; - float new_v30, new_v31; - - new_v0 = - new_v1 = - new_v2 = - new_v3 = - new_v4 = - new_v5 = - new_v6 = - new_v7 = - new_v8 = - new_v9 = - new_v10 = - new_v11 = - new_v12 = - new_v13 = - new_v14 = - new_v15 = - new_v16 = - new_v17 = - new_v18 = - new_v19 = - new_v20 = - new_v21 = - new_v22 = - new_v23 = - new_v24 = - new_v25 = - new_v26 = - new_v27 = - new_v28 = - new_v29 = - new_v30 = - new_v31 = - 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v0 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v1 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v2 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v3 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v4 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v5 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v6 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v7 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v8 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v9 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v10 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v11 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v12 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v13 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v14 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v15 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v16 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v17 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v18 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v19 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v20 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v21 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v22 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v23 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v24 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v25 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v26 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v27 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v28 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v29 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v30 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v31 = 0.0f; // float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure // 3-A.2 in ISO DIS 11172-3 @@ -200,72 +172,72 @@ final class SynthesisFilter { // float[] s = samples; - float s0 = samples[0]; - float s1 = samples[1]; - float s2 = samples[2]; - float s3 = samples[3]; - float s4 = samples[4]; - float s5 = samples[5]; - float s6 = samples[6]; - float s7 = samples[7]; - float s8 = samples[8]; - float s9 = samples[9]; - float s10 = samples[10]; - float s11 = samples[11]; - float s12 = samples[12]; - float s13 = samples[13]; - float s14 = samples[14]; - float s15 = samples[15]; - float s16 = samples[16]; - float s17 = samples[17]; - float s18 = samples[18]; - float s19 = samples[19]; - float s20 = samples[20]; - float s21 = samples[21]; - float s22 = samples[22]; - float s23 = samples[23]; - float s24 = samples[24]; - float s25 = samples[25]; - float s26 = samples[26]; - float s27 = samples[27]; - float s28 = samples[28]; - float s29 = samples[29]; - float s30 = samples[30]; - float s31 = samples[31]; - - float p0 = s0 + s31; - float p1 = s1 + s30; - float p2 = s2 + s29; - float p3 = s3 + s28; - float p4 = s4 + s27; - float p5 = s5 + s26; - float p6 = s6 + s25; - float p7 = s7 + s24; - float p8 = s8 + s23; - float p9 = s9 + s22; - float p10 = s10 + s21; - float p11 = s11 + s20; - float p12 = s12 + s19; - float p13 = s13 + s18; - float p14 = s14 + s17; - float p15 = s15 + s16; - - float pp0 = p0 + p15; - float pp1 = p1 + p14; - float pp2 = p2 + p13; - float pp3 = p3 + p12; - float pp4 = p4 + p11; - float pp5 = p5 + p10; - float pp6 = p6 + p9; - float pp7 = p7 + p8; - float pp8 = (p0 - p15) * cos1_32; - float pp9 = (p1 - p14) * cos3_32; - float pp10 = (p2 - p13) * cos5_32; - float pp11 = (p3 - p12) * cos7_32; - float pp12 = (p4 - p11) * cos9_32; - float pp13 = (p5 - p10) * cos11_32; - float pp14 = (p6 - p9) * cos13_32; - float pp15 = (p7 - p8) * cos15_32; + @LOC("THIS,SynthesisFilter.NEWV") float s0 = samples[0]; + @LOC("THIS,SynthesisFilter.NEWV") float s1 = samples[1]; + @LOC("THIS,SynthesisFilter.NEWV") float s2 = samples[2]; + @LOC("THIS,SynthesisFilter.NEWV") float s3 = samples[3]; + @LOC("THIS,SynthesisFilter.NEWV") float s4 = samples[4]; + @LOC("THIS,SynthesisFilter.NEWV") float s5 = samples[5]; + @LOC("THIS,SynthesisFilter.NEWV") float s6 = samples[6]; + @LOC("THIS,SynthesisFilter.NEWV") float s7 = samples[7]; + @LOC("THIS,SynthesisFilter.NEWV") float s8 = samples[8]; + @LOC("THIS,SynthesisFilter.NEWV") float s9 = samples[9]; + @LOC("THIS,SynthesisFilter.NEWV") float s10 = samples[10]; + @LOC("THIS,SynthesisFilter.NEWV") float s11 = samples[11]; + @LOC("THIS,SynthesisFilter.NEWV") float s12 = samples[12]; + @LOC("THIS,SynthesisFilter.NEWV") float s13 = samples[13]; + @LOC("THIS,SynthesisFilter.NEWV") float s14 = samples[14]; + @LOC("THIS,SynthesisFilter.NEWV") float s15 = samples[15]; + @LOC("THIS,SynthesisFilter.NEWV") float s16 = samples[16]; + @LOC("THIS,SynthesisFilter.NEWV") float s17 = samples[17]; + @LOC("THIS,SynthesisFilter.NEWV") float s18 = samples[18]; + @LOC("THIS,SynthesisFilter.NEWV") float s19 = samples[19]; + @LOC("THIS,SynthesisFilter.NEWV") float s20 = samples[20]; + @LOC("THIS,SynthesisFilter.NEWV") float s21 = samples[21]; + @LOC("THIS,SynthesisFilter.NEWV") float s22 = samples[22]; + @LOC("THIS,SynthesisFilter.NEWV") float s23 = samples[23]; + @LOC("THIS,SynthesisFilter.NEWV") float s24 = samples[24]; + @LOC("THIS,SynthesisFilter.NEWV") float s25 = samples[25]; + @LOC("THIS,SynthesisFilter.NEWV") float s26 = samples[26]; + @LOC("THIS,SynthesisFilter.NEWV") float s27 = samples[27]; + @LOC("THIS,SynthesisFilter.NEWV") float s28 = samples[28]; + @LOC("THIS,SynthesisFilter.NEWV") float s29 = samples[29]; + @LOC("THIS,SynthesisFilter.NEWV") float s30 = samples[30]; + @LOC("THIS,SynthesisFilter.NEWV") float s31 = samples[31]; + + @LOC("THIS,SynthesisFilter.NEWV") float p0 = s0 + s31; + @LOC("THIS,SynthesisFilter.NEWV") float p1 = s1 + s30; + @LOC("THIS,SynthesisFilter.NEWV") float p2 = s2 + s29; + @LOC("THIS,SynthesisFilter.NEWV") float p3 = s3 + s28; + @LOC("THIS,SynthesisFilter.NEWV") float p4 = s4 + s27; + @LOC("THIS,SynthesisFilter.NEWV") float p5 = s5 + s26; + @LOC("THIS,SynthesisFilter.NEWV") float p6 = s6 + s25; + @LOC("THIS,SynthesisFilter.NEWV") float p7 = s7 + s24; + @LOC("THIS,SynthesisFilter.NEWV") float p8 = s8 + s23; + @LOC("THIS,SynthesisFilter.NEWV") float p9 = s9 + s22; + @LOC("THIS,SynthesisFilter.NEWV") float p10 = s10 + s21; + @LOC("THIS,SynthesisFilter.NEWV") float p11 = s11 + s20; + @LOC("THIS,SynthesisFilter.NEWV") float p12 = s12 + s19; + @LOC("THIS,SynthesisFilter.NEWV") float p13 = s13 + s18; + @LOC("THIS,SynthesisFilter.NEWV") float p14 = s14 + s17; + @LOC("THIS,SynthesisFilter.NEWV") float p15 = s15 + s16; + + @LOC("THIS,SynthesisFilter.NEWV") float pp0 = p0 + p15; + @LOC("THIS,SynthesisFilter.NEWV") float pp1 = p1 + p14; + @LOC("THIS,SynthesisFilter.NEWV") float pp2 = p2 + p13; + @LOC("THIS,SynthesisFilter.NEWV") float pp3 = p3 + p12; + @LOC("THIS,SynthesisFilter.NEWV") float pp4 = p4 + p11; + @LOC("THIS,SynthesisFilter.NEWV") float pp5 = p5 + p10; + @LOC("THIS,SynthesisFilter.NEWV") float pp6 = p6 + p9; + @LOC("THIS,SynthesisFilter.NEWV") float pp7 = p7 + p8; + @LOC("THIS,SynthesisFilter.NEWV") float pp8 = (p0 - p15) * cos1_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp9 = (p1 - p14) * cos3_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp10 = (p2 - p13) * cos5_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp11 = (p3 - p12) * cos7_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp12 = (p4 - p11) * cos9_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp13 = (p5 - p10) * cos11_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp14 = (p6 - p9) * cos13_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp15 = (p7 - p8) * cos15_32; p0 = pp0 + pp7; p1 = pp1 + pp6; @@ -319,7 +291,7 @@ final class SynthesisFilter { p15 = (pp14 - pp15) * cos1_4; // this is pretty insane coding - float tmp1; + @LOC("THIS,SynthesisFilter.NEWV") float tmp1; new_v19/* 36-17 */= -(new_v4 = (new_v12 = p7) + p5) - p6; new_v27/* 44-17 */= -p6 - p7 - p4; new_v6 = (new_v10 = (new_v14 = p15) + p11) + p13; @@ -418,7 +390,7 @@ final class SynthesisFilter { // manually doing something that a compiler should handle sucks // coding like this is hard to read - float tmp2; + @LOC("THIS,SynthesisFilter.NEWV") float tmp2; new_v5 = (new_v11 = (new_v13 = (new_v15 = p15) + p7) + p11) + p5 + p13; new_v7 = (new_v9 = p15 + p11 + p3) + p13; new_v16/* 33-17 */= -(new_v1 = (tmp1 = p13 + p15 + p9) + p1) - p14; @@ -435,7 +407,7 @@ final class SynthesisFilter { // float[] x2 = actual_v + actual_write_pos; // float dest[] = actual_v; v2 - int pos = actual_write_pos; + @LOC("THIS,SynthesisFilter.NEWV") int pos = actual_write_pos; v2[0 + pos] = new_v0; v2[16 + pos] = new_v1; @@ -516,44 +488,38 @@ final class SynthesisFilter { private void compute_new_v1_v2() { - float new_v0, new_v1, new_v2, new_v3, new_v4, new_v5, new_v6, new_v7, new_v8, new_v9; - float new_v10, new_v11, new_v12, new_v13, new_v14, new_v15, new_v16, new_v17, new_v18, new_v19; - float new_v20, new_v21, new_v22, new_v23, new_v24, new_v25, new_v26, new_v27, new_v28, new_v29; - float new_v30, new_v31; - - new_v0 = - new_v1 = - new_v2 = - new_v3 = - new_v4 = - new_v5 = - new_v6 = - new_v7 = - new_v8 = - new_v9 = - new_v10 = - new_v11 = - new_v12 = - new_v13 = - new_v14 = - new_v15 = - new_v16 = - new_v17 = - new_v18 = - new_v19 = - new_v20 = - new_v21 = - new_v22 = - new_v23 = - new_v24 = - new_v25 = - new_v26 = - new_v27 = - new_v28 = - new_v29 = - new_v30 = - new_v31 = - 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v0 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v1 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v2 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v3 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v4 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v5 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v6 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v7 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v8 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v9 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v10 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v11 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v12 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v13 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v14 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v15 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v16 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v17 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v18 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v19 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v20 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v21 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v22 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v23 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v24 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v25 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v26 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v27 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v28 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v29 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v30 = 0.0f; + @LOC("THIS,SynthesisFilter.NEWV") float new_v31 = 0.0f; // float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure // 3-A.2 in ISO DIS 11172-3 @@ -562,72 +528,72 @@ final class SynthesisFilter { // float[] s = samples; - float s0 = samples[0]; - float s1 = samples[1]; - float s2 = samples[2]; - float s3 = samples[3]; - float s4 = samples[4]; - float s5 = samples[5]; - float s6 = samples[6]; - float s7 = samples[7]; - float s8 = samples[8]; - float s9 = samples[9]; - float s10 = samples[10]; - float s11 = samples[11]; - float s12 = samples[12]; - float s13 = samples[13]; - float s14 = samples[14]; - float s15 = samples[15]; - float s16 = samples[16]; - float s17 = samples[17]; - float s18 = samples[18]; - float s19 = samples[19]; - float s20 = samples[20]; - float s21 = samples[21]; - float s22 = samples[22]; - float s23 = samples[23]; - float s24 = samples[24]; - float s25 = samples[25]; - float s26 = samples[26]; - float s27 = samples[27]; - float s28 = samples[28]; - float s29 = samples[29]; - float s30 = samples[30]; - float s31 = samples[31]; - - float p0 = s0 + s31; - float p1 = s1 + s30; - float p2 = s2 + s29; - float p3 = s3 + s28; - float p4 = s4 + s27; - float p5 = s5 + s26; - float p6 = s6 + s25; - float p7 = s7 + s24; - float p8 = s8 + s23; - float p9 = s9 + s22; - float p10 = s10 + s21; - float p11 = s11 + s20; - float p12 = s12 + s19; - float p13 = s13 + s18; - float p14 = s14 + s17; - float p15 = s15 + s16; - - float pp0 = p0 + p15; - float pp1 = p1 + p14; - float pp2 = p2 + p13; - float pp3 = p3 + p12; - float pp4 = p4 + p11; - float pp5 = p5 + p10; - float pp6 = p6 + p9; - float pp7 = p7 + p8; - float pp8 = (p0 - p15) * cos1_32; - float pp9 = (p1 - p14) * cos3_32; - float pp10 = (p2 - p13) * cos5_32; - float pp11 = (p3 - p12) * cos7_32; - float pp12 = (p4 - p11) * cos9_32; - float pp13 = (p5 - p10) * cos11_32; - float pp14 = (p6 - p9) * cos13_32; - float pp15 = (p7 - p8) * cos15_32; + @LOC("THIS,SynthesisFilter.NEWV") float s0 = samples[0]; + @LOC("THIS,SynthesisFilter.NEWV") float s1 = samples[1]; + @LOC("THIS,SynthesisFilter.NEWV") float s2 = samples[2]; + @LOC("THIS,SynthesisFilter.NEWV") float s3 = samples[3]; + @LOC("THIS,SynthesisFilter.NEWV") float s4 = samples[4]; + @LOC("THIS,SynthesisFilter.NEWV") float s5 = samples[5]; + @LOC("THIS,SynthesisFilter.NEWV") float s6 = samples[6]; + @LOC("THIS,SynthesisFilter.NEWV") float s7 = samples[7]; + @LOC("THIS,SynthesisFilter.NEWV") float s8 = samples[8]; + @LOC("THIS,SynthesisFilter.NEWV") float s9 = samples[9]; + @LOC("THIS,SynthesisFilter.NEWV") float s10 = samples[10]; + @LOC("THIS,SynthesisFilter.NEWV") float s11 = samples[11]; + @LOC("THIS,SynthesisFilter.NEWV") float s12 = samples[12]; + @LOC("THIS,SynthesisFilter.NEWV") float s13 = samples[13]; + @LOC("THIS,SynthesisFilter.NEWV") float s14 = samples[14]; + @LOC("THIS,SynthesisFilter.NEWV") float s15 = samples[15]; + @LOC("THIS,SynthesisFilter.NEWV") float s16 = samples[16]; + @LOC("THIS,SynthesisFilter.NEWV") float s17 = samples[17]; + @LOC("THIS,SynthesisFilter.NEWV") float s18 = samples[18]; + @LOC("THIS,SynthesisFilter.NEWV") float s19 = samples[19]; + @LOC("THIS,SynthesisFilter.NEWV") float s20 = samples[20]; + @LOC("THIS,SynthesisFilter.NEWV") float s21 = samples[21]; + @LOC("THIS,SynthesisFilter.NEWV") float s22 = samples[22]; + @LOC("THIS,SynthesisFilter.NEWV") float s23 = samples[23]; + @LOC("THIS,SynthesisFilter.NEWV") float s24 = samples[24]; + @LOC("THIS,SynthesisFilter.NEWV") float s25 = samples[25]; + @LOC("THIS,SynthesisFilter.NEWV") float s26 = samples[26]; + @LOC("THIS,SynthesisFilter.NEWV") float s27 = samples[27]; + @LOC("THIS,SynthesisFilter.NEWV") float s28 = samples[28]; + @LOC("THIS,SynthesisFilter.NEWV") float s29 = samples[29]; + @LOC("THIS,SynthesisFilter.NEWV") float s30 = samples[30]; + @LOC("THIS,SynthesisFilter.NEWV") float s31 = samples[31]; + + @LOC("THIS,SynthesisFilter.NEWV") float p0 = s0 + s31; + @LOC("THIS,SynthesisFilter.NEWV") float p1 = s1 + s30; + @LOC("THIS,SynthesisFilter.NEWV") float p2 = s2 + s29; + @LOC("THIS,SynthesisFilter.NEWV") float p3 = s3 + s28; + @LOC("THIS,SynthesisFilter.NEWV") float p4 = s4 + s27; + @LOC("THIS,SynthesisFilter.NEWV") float p5 = s5 + s26; + @LOC("THIS,SynthesisFilter.NEWV") float p6 = s6 + s25; + @LOC("THIS,SynthesisFilter.NEWV") float p7 = s7 + s24; + @LOC("THIS,SynthesisFilter.NEWV") float p8 = s8 + s23; + @LOC("THIS,SynthesisFilter.NEWV") float p9 = s9 + s22; + @LOC("THIS,SynthesisFilter.NEWV") float p10 = s10 + s21; + @LOC("THIS,SynthesisFilter.NEWV") float p11 = s11 + s20; + @LOC("THIS,SynthesisFilter.NEWV") float p12 = s12 + s19; + @LOC("THIS,SynthesisFilter.NEWV") float p13 = s13 + s18; + @LOC("THIS,SynthesisFilter.NEWV") float p14 = s14 + s17; + @LOC("THIS,SynthesisFilter.NEWV") float p15 = s15 + s16; + + @LOC("THIS,SynthesisFilter.NEWV") float pp0 = p0 + p15; + @LOC("THIS,SynthesisFilter.NEWV") float pp1 = p1 + p14; + @LOC("THIS,SynthesisFilter.NEWV") float pp2 = p2 + p13; + @LOC("THIS,SynthesisFilter.NEWV") float pp3 = p3 + p12; + @LOC("THIS,SynthesisFilter.NEWV") float pp4 = p4 + p11; + @LOC("THIS,SynthesisFilter.NEWV") float pp5 = p5 + p10; + @LOC("THIS,SynthesisFilter.NEWV") float pp6 = p6 + p9; + @LOC("THIS,SynthesisFilter.NEWV") float pp7 = p7 + p8; + @LOC("THIS,SynthesisFilter.NEWV") float pp8 = (p0 - p15) * cos1_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp9 = (p1 - p14) * cos3_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp10 = (p2 - p13) * cos5_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp11 = (p3 - p12) * cos7_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp12 = (p4 - p11) * cos9_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp13 = (p5 - p10) * cos11_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp14 = (p6 - p9) * cos13_32; + @LOC("THIS,SynthesisFilter.NEWV") float pp15 = (p7 - p8) * cos15_32; p0 = pp0 + pp7; p1 = pp1 + pp6; @@ -681,7 +647,7 @@ final class SynthesisFilter { p15 = (pp14 - pp15) * cos1_4; // this is pretty insane coding - float tmp1; + @LOC("THIS,SynthesisFilter.NEWV") float tmp1; new_v19/* 36-17 */= -(new_v4 = (new_v12 = p7) + p5) - p6; new_v27/* 44-17 */= -p6 - p7 - p4; new_v6 = (new_v10 = (new_v14 = p15) + p11) + p13; @@ -780,7 +746,7 @@ final class SynthesisFilter { // manually doing something that a compiler should handle sucks // coding like this is hard to read - float tmp2; + @LOC("THIS,SynthesisFilter.NEWV") float tmp2; new_v5 = (new_v11 = (new_v13 = (new_v15 = p15) + p7) + p11) + p5 + p13; new_v7 = (new_v9 = p15 + p11 + p3) + p13; new_v16/* 33-17 */= -(new_v1 = (tmp1 = p13 + p15 + p9) + p1) - p14; @@ -797,7 +763,7 @@ final class SynthesisFilter { // float[] x2 = actual_v + actual_write_pos; // float dest[] = actual_v; actual_v=v1; - int pos = actual_write_pos; + @LOC("THIS,SynthesisFilter.NEWV") int pos = actual_write_pos; v1[0 + pos] = new_v0; v1[16 + pos] = new_v1; @@ -880,7 +846,8 @@ final class SynthesisFilter { * Compute PCM Samples. */ - @LOC("OUT") private float[] _tmpOut = new float[32]; + @LOC("OUT") + private float[] _tmpOut = new float[32]; private void compute_pcm_samples0() { @@ -888,11 +855,11 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { - float pcm_sample; + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; // final float[] dp = d16[i]; pcm_sample = (float) (((v1[0 + dvp] * d16[i][0]) + (v1[15 + dvp] * d16[i][1]) @@ -912,11 +879,11 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { - float pcm_sample; + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; // final float[] dp = d16[i]; pcm_sample = (float) (((v2[0 + dvp] * d16[i][0]) + (v2[15 + dvp] * d16[i][1]) @@ -942,12 +909,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[1 + dvp] * d16[i][0]) + (v1[0 + dvp] * d16[i][1]) @@ -967,12 +934,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[1 + dvp] * d16[i][0]) + (v2[0 + dvp] * d16[i][1]) @@ -998,12 +965,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[2 + dvp] * d16[i][0]) + (v1[1 + dvp] * d16[i][1]) @@ -1023,12 +990,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[2 + dvp] * d16[i][0]) + (v2[1 + dvp] * d16[i][1]) @@ -1053,15 +1020,14 @@ final class SynthesisFilter { if (vidx == 1) { // final float[] vp = actual_v; - int idx = 0; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[3 + dvp] * d16[i][0]) + (v1[2 + dvp] * d16[i][1]) @@ -1080,15 +1046,14 @@ final class SynthesisFilter { } else { // final float[] vp = actual_v; - int idx = 0; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[3 + dvp] * d16[i][0]) + (v2[2 + dvp] * d16[i][1]) @@ -1115,12 +1080,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[4 + dvp] * d16[i][0]) + (v1[3 + dvp] * d16[i][1]) @@ -1140,12 +1105,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[4 + dvp] * d16[i][0]) + (v2[3 + dvp] * d16[i][1]) @@ -1171,12 +1136,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[5 + dvp] * d16[i][0]) + (v1[4 + dvp] * d16[i][1]) @@ -1196,12 +1161,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[5 + dvp] * d16[i][0]) + (v2[4 + dvp] * d16[i][1]) @@ -1227,12 +1192,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[6 + dvp] * d16[i][0]) + (v1[5 + dvp] * d16[i][1]) @@ -1252,12 +1217,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[6 + dvp] * d16[i][0]) + (v2[5 + dvp] * d16[i][1]) @@ -1283,12 +1248,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[7 + dvp] * d16[i][0]) + (v1[6 + dvp] * d16[i][1]) @@ -1308,12 +1273,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[7 + dvp] * d16[i][0]) + (v2[6 + dvp] * d16[i][1]) @@ -1340,12 +1305,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[8 + dvp] * d16[i][0]) + (v1[7 + dvp] * d16[i][1]) @@ -1366,12 +1331,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[8 + dvp] * d16[i][0]) + (v2[7 + dvp] * d16[i][1]) @@ -1397,12 +1362,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[9 + dvp] * d16[i][0]) + (v1[8 + dvp] * d16[i][1]) @@ -1422,12 +1387,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[9 + dvp] * d16[i][0]) + (v2[8 + dvp] * d16[i][1]) @@ -1451,12 +1416,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[10 + dvp] * d16[i][0]) + (v1[9 + dvp] * d16[i][1]) @@ -1475,12 +1440,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[10 + dvp] * d16[i][0]) + (v2[9 + dvp] * d16[i][1]) @@ -1506,12 +1471,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[11 + dvp] * d16[i][0]) + (v1[10 + dvp] * d16[i][1]) @@ -1531,12 +1496,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[11 + dvp] * d16[i][0]) + (v2[10 + dvp] * d16[i][1]) @@ -1561,12 +1526,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[12 + dvp] * d16[i][0]) + (v1[11 + dvp] * d16[i][1]) @@ -1585,12 +1550,12 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[12 + dvp] * d16[i][0]) + (v2[11 + dvp] * d16[i][1]) @@ -1616,12 +1581,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[13 + dvp] * d16[i][0]) + (v1[12 + dvp] * d16[i][1]) @@ -1641,12 +1606,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[13 + dvp] * d16[i][0]) + (v2[12 + dvp] * d16[i][1]) @@ -1672,12 +1637,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v1[14 + dvp] * d16[i][0]) + (v1[13 + dvp] * d16[i][1]) @@ -1697,12 +1662,12 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; pcm_sample = (float) (((v2[14 + dvp] * d16[i][0]) + (v2[13 + dvp] * d16[i][1]) @@ -1727,11 +1692,11 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { - float pcm_sample; + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; // final float d16[i][] = d16[i]; pcm_sample = (float) (((v1[15 + dvp] * d16[i][0]) + (v1[14 + dvp] * d16[i][1]) @@ -1750,11 +1715,11 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + @LOC("THIS,SynthesisFilter.NEWV") int dvp = 0; // fat chance of having this loop unroll - for (int i = 0; i < 32; i++) { - float pcm_sample; + for (@LOC("THIS,SynthesisFilter.NEWV") int i = 0; i < 32; i++) { + @LOC("THIS,SynthesisFilter.V1") float pcm_sample; // final float d16[i][] = d16[i]; pcm_sample = (float) (((v2[15 + dvp] * d16[i][0]) + (v2[14 + dvp] * d16[i][1]) @@ -1878,7 +1843,7 @@ final class SynthesisFilter { // MDM: this may not be necessary. The Layer III decoder always // outputs 32 subband samples, but I haven't checked layer I & II. - for (int p = 0; p < 32; p++) + for (@LOC("C") int p = 0; p < 32; p++) samples[p] = 0.0f; } diff --git a/Robust/src/Tests/ssJava/mp3decoder/huffcodetab.java b/Robust/src/Tests/ssJava/mp3decoder/huffcodetab.java index 054bc4d0..77be768e 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/huffcodetab.java +++ b/Robust/src/Tests/ssJava/mp3decoder/huffcodetab.java @@ -40,7 +40,7 @@ /** * Class to implements Huffman decoder. */ -@LATTICE("FIELD>> 4; - y[0] = ht[htIdx].val[point][1] & 0xf; - error = 0; - break; - } - - // hget1bit() is called thousands of times, and so needs to be - // ultra fast. - /* - if (bitIndex==bitsAvailable) - { - bitsAvailable = br.readBits(bits, 32); - bitIndex = 0; - } - */ - //if (bits[bitIndex++]!=0) - if (br.hget1bit()!=0) - { - while (ht[htIdx].val[point][1] >= MXOFF) point += ht[htIdx].val[point][1]; - point += ht[htIdx].val[point][1]; - } - else - { - while (ht[htIdx].val[point][0] >= MXOFF) point += ht[htIdx].val[point][0]; - point += ht[htIdx].val[point][0]; - } - level >>>= 1; - // MDM: ht[0] is always 0; - } while ((level !=0 ) || (point < 0 /*ht[0].treelen*/) ); - - // put back any bits not consumed - /* - int unread = (bitsAvailable-bitIndex); - if (unread>0) - br.rewindNbits(unread); - */ - /* Process sign encodings for quadruples tables. */ - // System.out.println(ht[htIdx].tablename); - if (ht[htIdx].tablename0 == '3' && (ht[htIdx].tablename1 == '2' || ht[htIdx].tablename1 == '3')) - { - v[0] = (y[0]>>3) & 1; - w[0] = (y[0]>>2) & 1; - x[0] = (y[0]>>1) & 1; - y[0] = y[0] & 1; - - /* v, w, x and y are reversed in the bitstream. - switch them around to make test bistream work. */ - - if (v[0]!=0) - if (br.hget1bit() != 0) v[0] = -v[0]; - if (w[0]!=0) - if (br.hget1bit() != 0) w[0] = -w[0]; - if (x[0]!=0) - if (br.hget1bit() != 0) x[0] = -x[0]; - if (y[0]!=0) - if (br.hget1bit() != 0) y[0] = -y[0]; - } - else - { - // Process sign and escape encodings for dual tables. - // x and y are reversed in the test bitstream. - // Reverse x and y here to make test bitstream work. - - if (ht[htIdx].linbits != 0) - if ((ht[htIdx].xlen-1) == x[0]) - x[0] += br.hgetbits(ht[htIdx].linbits); - if (x[0] != 0) - if (br.hget1bit() != 0) x[0] = -x[0]; - if (ht[htIdx].linbits != 0) - if ((ht[htIdx].ylen-1) == y[0]) - y[0] += br.hgetbits(ht[htIdx].linbits); - if (y[0] != 0) - if (br.hget1bit() != 0) y[0] = -y[0]; - } - return error; + @LATTICE("OUT>> 4; + y[0] = ht[htIdx].val[point][1] & 0xf; + error = 0; + break; + } + + // hget1bit() is called thousands of times, and so needs to be + // ultra fast. + /* + * if (bitIndex==bitsAvailable) { bitsAvailable = br.readBits(bits, 32); + * bitIndex = 0; } + */ + // if (bits[bitIndex++]!=0) + if (br.hget1bit() != 0) { + while (ht[htIdx].val[point][1] >= MXOFF) + point += ht[htIdx].val[point][1]; + point += ht[htIdx].val[point][1]; + } else { + while (ht[htIdx].val[point][0] >= MXOFF) + point += ht[htIdx].val[point][0]; + point += ht[htIdx].val[point][0]; + } + level >>>= 1; + // MDM: ht[0] is always 0; + } while ((level != 0) || (point < 0 /* ht[0].treelen */)); + + // put back any bits not consumed + /* + * int unread = (bitsAvailable-bitIndex); if (unread>0) + * br.rewindNbits(unread); + */ + /* Process sign encodings for quadruples tables. */ + // System.out.println(ht[htIdx].tablename); + if (ht[htIdx].tablename0 == '3' && (ht[htIdx].tablename1 == '2' || ht[htIdx].tablename1 == '3')) { + v[0] = (y[0] >> 3) & 1; + w[0] = (y[0] >> 2) & 1; + x[0] = (y[0] >> 1) & 1; + y[0] = y[0] & 1; + + /* + * v, w, x and y are reversed in the bitstream. switch them around to make + * test bistream work. + */ + + if (v[0] != 0) + if (br.hget1bit() != 0) + v[0] = -v[0]; + if (w[0] != 0) + if (br.hget1bit() != 0) + w[0] = -w[0]; + if (x[0] != 0) + if (br.hget1bit() != 0) + x[0] = -x[0]; + if (y[0] != 0) + if (br.hget1bit() != 0) + y[0] = -y[0]; + } else { + // Process sign and escape encodings for dual tables. + // x and y are reversed in the test bitstream. + // Reverse x and y here to make test bitstream work. + + if (ht[htIdx].linbits != 0) + if ((ht[htIdx].xlen - 1) == x[0]) + x[0] += br.hgetbits(ht[htIdx].linbits); + if (x[0] != 0) + if (br.hget1bit() != 0) + x[0] = -x[0]; + if (ht[htIdx].linbits != 0) + if ((ht[htIdx].ylen - 1) == y[0]) + y[0] += br.hgetbits(ht[htIdx].linbits); + if (y[0] != 0) + if (br.hget1bit() != 0) + y[0] = -y[0]; + } + return error; } - /** * Do the huffman-decoding. note! for counta,countb -the 4 bit value is @@ -639,8 +640,8 @@ final class huffcodetab { @LOC("OUT") int error = 1; level = dmask; - if (ht[idx].val == null){ -// return 2; + if (ht[idx].val == null) { + // return 2; return data; } @@ -648,7 +649,7 @@ final class huffcodetab { if (ht[idx].treelen == 0) { data.y = 0; data.x = 0; -// return 0; + // return 0; return data; } @@ -735,11 +736,11 @@ final class huffcodetab { if (data.br.hget1bit() != 0) data.y = -data.y; } - + return data; -// return error; + // return error; } - + public static void inithuff() { if (ht != null)