From b1691dd3c0567c74ea99a7d4d2dcdb94c9ba85ba Mon Sep 17 00:00:00 2001 From: yeom Date: Thu, 28 Jul 2011 01:03:44 +0000 Subject: [PATCH] changes. --- Robust/src/Analysis/SSJava/FlowDownCheck.java | 14 ++- .../src/Analysis/SSJava/SSJavaAnalysis.java | 2 +- .../ssJava/mp3decoder/LayerIIIDecoder.java | 115 ++++++++++-------- 3 files changed, 70 insertions(+), 61 deletions(-) diff --git a/Robust/src/Analysis/SSJava/FlowDownCheck.java b/Robust/src/Analysis/SSJava/FlowDownCheck.java index 11f3f2e3..4d949f4d 100644 --- a/Robust/src/Analysis/SSJava/FlowDownCheck.java +++ b/Robust/src/Analysis/SSJava/FlowDownCheck.java @@ -1264,12 +1264,14 @@ public class FlowDownCheck { System.out.println("rhsLocation=" + rhsLocation); System.out.println("constraint=" + constraint); - if (constraint != null) { - inputGLBSet.add(rhsLocation); - inputGLBSet.add(constraint); - srcLocation = CompositeLattice.calculateGLB(inputGLBSet, generateErrorMessage(cd, an)); - } else { - srcLocation = rhsLocation; + srcLocation = rhsLocation; + + if (!rhsLocation.get(rhsLocation.getSize() - 1).isTop()) { + if (constraint != null) { + inputGLBSet.add(rhsLocation); + inputGLBSet.add(constraint); + srcLocation = CompositeLattice.calculateGLB(inputGLBSet, generateErrorMessage(cd, an)); + } } if (!CompositeLattice.isGreaterThan(srcLocation, destLocation, generateErrorMessage(cd, an))) { diff --git a/Robust/src/Analysis/SSJava/SSJavaAnalysis.java b/Robust/src/Analysis/SSJava/SSJavaAnalysis.java index dd4a5b29..4e62c259 100644 --- a/Robust/src/Analysis/SSJava/SSJavaAnalysis.java +++ b/Robust/src/Analysis/SSJava/SSJavaAnalysis.java @@ -241,7 +241,7 @@ public class SSJavaAnalysis { } else if (orderElement.startsWith(RETURNLOC + "=")) { String returnLoc = orderElement.substring(10); locOrder.setReturnLoc(returnLoc); - } else if (orderElement.contains("*")) { + } else if (orderElement.endsWith("*")) { // spin loc definition locOrder.addSharedLoc(orderElement.substring(0, orderElement.length() - 1)); } else { diff --git a/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java b/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java index 6bdfddfc..48b0d1b2 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java +++ b/Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java @@ -46,11 +46,11 @@ // 9th added for get_LSF_scale_factors // 10th added for get_scale_factors // llth added for decode -@LATTICE("BUF 0) @@ -1040,12 +1049,12 @@ final class LayerIIIDecoder implements FrameDecoder { // apply formula per block type for (j = 0; j < nonzero[ch]; j++) { // Modif E.B 02/22/99 - @LOC("REST") int reste = j % SSLIMIT; - @LOC("QUO") int quotien = (int) ((j - reste) / SSLIMIT); + @LOC("THIS,LayerIIIDecoder.NZ") int reste = j % SSLIMIT; + @LOC("THIS,LayerIIIDecoder.NZ") int quotien = (int) ((j - reste) / SSLIMIT); if (index == next_cb_boundary) { /* Adjust critical band boundary */ - if ((gr_info.window_switching_flag != 0) && (gr_info.block_type == 2)) { - if (gr_info.mixed_block_flag != 0) { + if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) { + if (si.ch[ch].gr[gr].mixed_block_flag != 0) { if (index == sfBandIndex[sfreq].l[8]) { next_cb_boundary = sfBandIndex[sfreq].s[4]; @@ -1089,17 +1098,18 @@ final class LayerIIIDecoder implements FrameDecoder { // Do long/short dependent scaling operations - if ((gr_info.window_switching_flag != 0) - && (((gr_info.block_type == 2) && (gr_info.mixed_block_flag == 0)) || ((gr_info.block_type == 2) - && (gr_info.mixed_block_flag != 0) && (j >= 36)))) { + if ((si.ch[ch].gr[gr].window_switching_flag != 0) + && (((si.ch[ch].gr[gr].block_type == 2) && (si.ch[ch].gr[gr].mixed_block_flag == 0)) || ((si.ch[ch].gr[gr].block_type == 2) + && (si.ch[ch].gr[gr].mixed_block_flag != 0) && (j >= 36)))) { t_index = (index - cb_begin) / cb_width; /* * xr[sb][ss] *= pow(2.0, ((-2.0 * gr_info.subblock_gain[t_index]) -(0.5 * * (1.0 + gr_info.scalefac_scale) scalefac[ch].s[t_index][cb]))); */ - @LOC("IDX") int idx = scalefac[ch].s[t_index][cb] << gr_info.scalefac_scale; - idx += (gr_info.subblock_gain[t_index] << 2); + @LOC("THIS,LayerIIIDecoder.SI1") int idx = + scalefac[ch].s[t_index][cb] << si.ch[ch].gr[gr].scalefac_scale; + idx += (si.ch[ch].gr[gr].subblock_gain[t_index] << 2); ro[ch][quotien][reste] *= two_to_negative_half_pow[idx]; @@ -1108,12 +1118,12 @@ final class LayerIIIDecoder implements FrameDecoder { * xr[sb][ss] *= pow(2.0, -0.5 * (1.0+gr_info.scalefac_scale) * (scalefac[ch].l[cb] + gr_info.preflag * pretab[cb])); */ - @LOC("IDX") int idx = scalefac[ch].l[cb]; + @LOC("THIS,LayerIIIDecoder.SI1") int idx = scalefac[ch].l[cb]; - if (gr_info.preflag != 0) + if (si.ch[ch].gr[gr].preflag != 0) idx += pretab[cb]; - idx = idx << gr_info.scalefac_scale; + idx = idx << si.ch[ch].gr[gr].scalefac_scale; ro[ch][quotien][reste] *= two_to_negative_half_pow[idx]; } index++; @@ -1121,8 +1131,8 @@ final class LayerIIIDecoder implements FrameDecoder { for (j = nonzero[ch]; j < 576; j++) { // Modif E.B 02/22/99 - @LOC("REST") int reste = j % SSLIMIT; - @LOC("QUO") int quotien = (int) ((j - reste) / SSLIMIT); + @LOC("THIS,LayerIIIDecoder.NZ") int reste = j % SSLIMIT; + @LOC("THIS,LayerIIIDecoder.NZ") int quotien = (int) ((j - reste) / SSLIMIT); if (reste < 0) reste = 0; if (quotien < 0) @@ -2054,9 +2064,7 @@ final class LayerIIIDecoder implements FrameDecoder { @LOC("C") private int counter = 0; - @LOC("F") private static final int SSLIMIT = 18; - @LOC("F") private static final int SBLIMIT = 32; // Size of the table of whole numbers raised to 4/3 power. @@ -2200,7 +2208,7 @@ final class LayerIIIDecoder implements FrameDecoder { public static final int pretab[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 }; - @LOC("F") + @LOC("SBI") private SBI[] sfBandIndex; // Init in the constructor. @LOC("F") @@ -2222,7 +2230,6 @@ final class LayerIIIDecoder implements FrameDecoder { 1.8626451492E-09f, 1.3170890160E-09f, 9.3132257462E-10f, 6.5854450798E-10f, 4.6566128731E-10f, 3.2927225399E-10f }; - @LOC("F") public static final float t_43[] = create_t_43(); @RETURNLOC("OUT") -- 2.34.1