CompositeLocation thisLoc = new CompositeLocation(new Location(md, thisLocId));
paramList.add(0, thisLoc);
- System.out.println("### ReturnLocGenerator="+md);
- System.out.println("### md2ReturnLoc.get(md)="+md2ReturnLoc.get(md));
+ System.out.println("### ReturnLocGenerator=" + md);
+ System.out.println("### md2ReturnLoc.get(md)=" + md2ReturnLoc.get(md));
md2ReturnLocGen.put(md, new ReturnLocGenerator(md2ReturnLoc.get(md), paramList, md + " of "
+ cd.getSourceFileName()));
}
CompositeLocation declaredReturnLoc = md2ReturnLoc.get(md);
int compareResult =
- CompositeLattice.compare(returnValueLoc, declaredReturnLoc,
+ CompositeLattice.compare(returnValueLoc, declaredReturnLoc, false,
generateErrorMessage(md.getClassDesc(), rn));
if (compareResult == ComparisonResult.LESS || compareResult == ComparisonResult.INCOMPARABLE) {
// here, check if ordering relations among caller's args respect
// ordering relations in-between callee's args
- for (int i = 0; i < calleeParamList.size(); i++) {
+ CHECK: for (int i = 0; i < calleeParamList.size(); i++) {
CompositeLocation calleeLoc1 = calleeParamList.get(i);
CompositeLocation callerLoc1 = callerArgList.get(i);
CompositeLocation calleeLoc2 = calleeParamList.get(j);
CompositeLocation callerLoc2 = callerArgList.get(j);
+ if (callerLoc1.get(callerLoc1.getSize() - 1).isTop()
+ || callerLoc2.get(callerLoc2.getSize() - 1).isTop()) {
+ continue CHECK;
+ }
+
int callerResult =
- CompositeLattice.compare(callerLoc1, callerLoc2,
+ CompositeLattice.compare(callerLoc1, callerLoc2, true,
generateErrorMessage(md.getClassDesc(), min));
int calleeResult =
- CompositeLattice.compare(calleeLoc1, calleeLoc2,
+ CompositeLattice.compare(calleeLoc1, calleeLoc2, true,
generateErrorMessage(md.getClassDesc(), min));
if (calleeResult == ComparisonResult.GREATER
public static boolean isGreaterThan(CompositeLocation loc1, CompositeLocation loc2, String msg) {
System.out.println("\nisGreaterThan=" + loc1 + " " + loc2 + " msg=" + msg);
- int baseCompareResult = compareBaseLocationSet(loc1, loc2, true, msg);
+ int baseCompareResult = compareBaseLocationSet(loc1, loc2, true, false, msg);
if (baseCompareResult == ComparisonResult.EQUAL) {
if (compareDelta(loc1, loc2) == ComparisonResult.GREATER) {
return true;
}
- public static int compare(CompositeLocation loc1, CompositeLocation loc2, String msg) {
+ public static int compare(CompositeLocation loc1, CompositeLocation loc2, boolean ignore,
+ String msg) {
System.out.println("compare=" + loc1 + " " + loc2);
- int baseCompareResult = compareBaseLocationSet(loc1, loc2, false, msg);
+ int baseCompareResult = compareBaseLocationSet(loc1, loc2, false, ignore, msg);
if (baseCompareResult == ComparisonResult.EQUAL) {
return compareDelta(loc1, loc2);
}
private static int compareBaseLocationSet(CompositeLocation compLoc1,
- CompositeLocation compLoc2, boolean awareSharedLoc, String msg) {
+ CompositeLocation compLoc2, boolean awareSharedLoc, boolean ignore, String msg) {
// if compLoc1 is greater than compLoc2, return true
// else return false;
for (int i = 0; i < compLoc1.getSize(); i++) {
Location loc1 = compLoc1.get(i);
if (i >= compLoc2.getSize()) {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
- }
- Location loc2 = compLoc2.get(i);
-
- Descriptor d1 = loc1.getDescriptor();
- Descriptor d2 = loc2.getDescriptor();
-
- Descriptor descriptor;
-
- if (d1 instanceof ClassDescriptor && d2 instanceof ClassDescriptor) {
-
- if (d1.equals(d2)) {
- descriptor = d1;
- } else {
- // identifying which one is parent class
- Set<Descriptor> d1SubClassesSet = ssjava.tu.getSubClasses((ClassDescriptor) d1);
- Set<Descriptor> d2SubClassesSet = ssjava.tu.getSubClasses((ClassDescriptor) d2);
-
- if (d1 == null && d2 == null) {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
- } else if (d1SubClassesSet != null && d1SubClassesSet.contains(d2)) {
- descriptor = d1;
- } else if (d2SubClassesSet != null && d2SubClassesSet.contains(d1)) {
- descriptor = d2;
- } else {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
- }
- }
-
- } else if (d1 instanceof MethodDescriptor && d2 instanceof MethodDescriptor) {
-
- if (d1.equals(d2)) {
- descriptor = d1;
+ if (ignore) {
+ return ComparisonResult.INCOMPARABLE;
} else {
-
- // identifying which one is parent class
- MethodDescriptor md1 = (MethodDescriptor) d1;
- MethodDescriptor md2 = (MethodDescriptor) d2;
-
- if (!md1.matches(md2)) {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
- }
-
- Set<Descriptor> d1SubClassesSet =
- ssjava.tu.getSubClasses(((MethodDescriptor) d1).getClassDesc());
- Set<Descriptor> d2SubClassesSet =
- ssjava.tu.getSubClasses(((MethodDescriptor) d2).getClassDesc());
-
- if (d1 == null && d2 == null) {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
- } else if (d1 != null && d1SubClassesSet.contains(d2)) {
- descriptor = d1;
- } else if (d2 != null && d2SubClassesSet.contains(d1)) {
- descriptor = d2;
- } else {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
- }
+ throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
+ + " because they are not comparable at " + msg);
}
-
- } else {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
}
+ Location loc2 = compLoc2.get(i);
- // SSJavaLattice<String> lattice1 = getLatticeByDescriptor(d1);
- // SSJavaLattice<String> lattice2 = getLatticeByDescriptor(d2);
-
+ Descriptor descriptor = getCommonParentDescriptor(loc1, loc2, msg);
SSJavaLattice<String> lattice = getLatticeByDescriptor(descriptor);
- // check if the spin location is appeared only at the end of the
+ // check if the shared location is appeared only at the end of the
// composite location
if (lattice.getSpinLocSet().contains(loc1.getLocIdentifier())) {
if (i != (compLoc1.getSize() - 1)) {
if (lattice.getSpinLocSet().contains(loc2.getLocIdentifier())) {
if (i != (compLoc2.getSize() - 1)) {
- throw new Error("The spin location " + loc2.getLocIdentifier()
+ throw new Error("The shared location " + loc2.getLocIdentifier()
+ " cannot be appeared in the middle of composite location at " + msg);
}
}
if (numOfTie == compLoc1.getSize()) {
if (numOfTie != compLoc2.getSize()) {
- throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
- + " because they are not comparable at " + msg);
+
+ if (ignore) {
+ return ComparisonResult.INCOMPARABLE;
+ } else {
+ throw new Error("Failed to compare two locations of " + compLoc1 + " and " + compLoc2
+ + " because they are not comparable at " + msg);
+ }
+
}
return ComparisonResult.EQUAL;
paramIdx2paramType = new Hashtable<Integer, Integer>();
for (int i = 0; i < params.size(); i++) {
CompositeLocation param = params.get(i);
- int compareResult = CompositeLattice.compare(param, returnLoc, msg);
+ int compareResult = CompositeLattice.compare(param, returnLoc, true, msg);
int type;
if (compareResult == ComparisonResult.GREATER) {
/**\r
* Feed a bitstring to the crc calculation (0 < length <= 32).\r
*/\r
+ //ssjava\r
@LATTICE("OUT<V,V<SH,SH<IN,SH*,THISLOC=V,GLOBALLOC=V")\r
public void add_bits (@LOC("IN") int bitstring, @LOC("IN") int length)\r
{\r
@METHODDEFAULT("MODE<THIS,THIS<C,C<IN,THISLOC=THIS,C*")
class LayerIDecoder implements FrameDecoder {
- @LOC("H")
+ @LOC("SH")
protected Bitstream stream;
@LOC("SH")
protected Header header;
* Class for layer I subbands in single channel mode. Used for single channel
* mode and in derived class for intensity stereo mode
*/
- @LATTICE("S<L,L<H,H<SH,SH*,S*")
+ @LATTICE("S<L,L<H,H<SH,SH<SH0,SH*,S*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
static class SubbandLayer1 extends Subband {
}
// ssjava
- @LATTICE("THIS<IN,THISLOC=THIS,RETURNLOC=THIS")
- // THIS,LayerIDecoder$SubbandLayer1.S
+ @LATTICE("THIS<IN,THISLOC=THIS")
+ @RETURNLOC("THIS,LayerIDecoder$SubbandLayer1.S")
public boolean read_sampledata(@LOC("THIS,LayerIDecoder$SubbandLayer1.S") Bitstream stream) {
if (allocation != 0) {
sample = (float) (stream.get_bits(samplelength));
/**
* Class for layer I subbands in joint stereo mode.
*/
- @LATTICE("S<L,L<H,H<SH,SH*")
+ @LATTICE("S<L,L<H,H<SH,SH<SH0,SH*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
static class SubbandLayer1IntensityStereo extends SubbandLayer1 {
@LOC("L")
/**
*
*/
- public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header,
- @LOC("IN") Crc16 crc) throws DecoderException {
+ @LATTICE("THIS<IN2,IN2<IN1,IN1<IN0,THISLOC=THIS")
+ public void read_allocation(@LOC("IN1") Bitstream stream, @LOC("IN0") Header header,
+ @LOC("IN2") Crc16 crc) throws DecoderException {
super.read_allocation(stream, header, crc);
}
/**
* Class for layer I subbands in stereo mode.
*/
- @LATTICE("S<L,L<H,H<SH,SH*,S*")
+ @LATTICE("S<L,L<H,H<SH,SH<SH0,SH*,S*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
static class SubbandLayer1Stereo extends SubbandLayer1 {
@LOC("H")
/**
*
*/
- public void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header,
- @LOC("IN") Crc16 crc) throws DecoderException {
+ // ssjava
+ public void read_allocation(@LOC("THIS,LayerIDecoder$SubbandLayer1Stereo.SH") Bitstream stream,
+ @LOC("IN") Header header, @LOC("THIS,LayerIDecoder$SubbandLayer1Stereo.L") Crc16 crc)
+ throws DecoderException {
allocation = stream.get_bits(4);
channel2_allocation = stream.get_bits(4);
if (crc != null) {
/**
*
*/
- @RETURNLOC("OUT")
- public boolean read_sampledata(@LOC("IN") Bitstream stream) {
- @LOC("OUT") boolean returnvalue = super.read_sampledata(stream);
+ @RETURNLOC("THIS,LayerIDecoder$SubbandLayer1Stereo.S")
+ public boolean read_sampledata(@LOC("THIS,LayerIDecoder$SubbandLayer1Stereo.S") Bitstream stream) {
+ @LOC("THIS,LayerIDecoder$SubbandLayer1Stereo.S") boolean returnvalue = super.read_sampledata(stream);
if (channel2_allocation != 0) {
channel2_sample = (float) (stream.get_bits(channel2_samplelength));
}
/**
* Class for layer II subbands in single channel mode.
*/
- @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,F,ARR,GN,SN,SH*,SM*")
+ @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,SH<SH0,SH*,SM*,SH0*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
static class SubbandLayer2 extends Subband {
// this table contains 3 requantized samples for each legal codeword
/**
*
*/
- protected int get_allocationlength(@LOC("IN") Header header) {
+ protected int get_allocationlength(@LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") Header header) {
if (header.version() == Header.MPEG1) {
*
*/
@LATTICE("OUT<THIS,THIS<IN,THISLOC=THIS")
- protected void prepare_sample_reading(@LOC("IN") Header header, @LOC("IN") int allocation,
+ protected void prepare_sample_reading(@LOC("IN") Header header,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH0") int allocation,
// float[][] groupingtable,
@LOC("IN") int channel, @LOC("OUT") float[] factor, @LOC("OUT") int[] codelength,
@LOC("OUT") float[] c, @LOC("OUT") float[] d) {
*/
@LATTICE("V<THIS,THIS<IN,THISLOC=THIS")
// ssjava
- public void read_allocation(@LOC("IN") Bitstream stream,
- @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") Header header, @LOC("IN") Crc16 crc) {
+ public void read_allocation(@LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") Bitstream stream,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH0") Header header,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2.H") Crc16 crc) {
+
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH0") int length = get_allocationlength(header);
- @LOC("THIS,LayerIIDecoder$SubbandLayer2.SH") int length = get_allocationlength(header); // return
- // DELTA(THIS)
allocation = stream.get_bits(length);
if (crc != null) {
crc.add_bits(allocation, length);
/**
*
*/
- public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc) {
+ public void read_scalefactor_selection(@LOC("IN") Bitstream stream,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2.H") Crc16 crc) {
if (allocation != 0) {
scfsi = stream.get_bits(2);
if (crc != null)
/**
*
*/
- // @LATTICE("OUT<V,V<SH,SH<TEMP,TEMP<TMP,TMP<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
- // @LATTICE("OUT<V,V<TEMP,TEMP<TMP,TMP<SH,SH<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
- // @RETURNLOC("V")
// ssjava
- public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+ public boolean read_sampledata(@LOC("THIS,LayerIIDecoder$SubbandLayer2.SM") Bitstream stream) {
if (allocation != 0) {
if (groupingtable[0] != null) {
/**
* Class for layer II subbands in joint stereo mode.
*/
- @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,F,ARR,GN,SN,SH*,SM*")
+ @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,SH<SH0,SH*,SM*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
static class SubbandLayer2IntensityStereo extends SubbandLayer2 {
@LOC("SH")
/**
*
*/
- public void read_allocation(@LOC("IN") Bitstream stream, @LOC("THIS") Header header,
- @LOC("IN") Crc16 crc) {
+ @LATTICE("THIS<IN2,IN2<IN1,IN1<IN0,THISLOC=THIS")
+ public void read_allocation(@LOC("IN1") Bitstream stream, @LOC("IN0") Header header,
+ @LOC("IN2") Crc16 crc) {
super.read_allocation(stream, header, crc);
}
/**
*
*/
- public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc) {
+ public void read_scalefactor_selection(@LOC("IN") Bitstream stream,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2IntensityStereo.H") Crc16 crc) {
if (allocation != 0) {
scfsi = stream.get_bits(2);
channel2_scfsi = stream.get_bits(2);
/**
* Class for layer II subbands in stereo mode.
*/
- @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,F,ARR,GN,SN,SH*,SM*")
+ @LATTICE("S<L,L<H,L<SM,SM<H,H<SH,SH<SH0,SH*,SM*,SH0*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
static class SubbandLayer2Stereo extends SubbandLayer2 {
@LOC("SH")
/**
*
*/
- @LATTICE("OUT<SH,SH<THIS,THIS<V,V<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
- public void read_allocation(@LOC("IN") Bitstream stream,
- @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH") Header header, @LOC("IN") Crc16 crc) {
- @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH") int length = get_allocationlength(header);
+ @LATTICE("V<THIS,THIS<IN,THISLOC=THIS")
+ // ssjava
+ public void read_allocation(
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH") Bitstream stream,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH0") Header header,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.H") Crc16 crc) {
+
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SH0") int length = get_allocationlength(header);
allocation = stream.get_bits(length);
channel2_allocation = stream.get_bits(length);
if (crc != null) {
crc.add_bits(allocation, length);
crc.add_bits(channel2_allocation, length);
}
+
}
/**
*
*/
- public void read_scalefactor_selection(@LOC("IN") Bitstream stream, @LOC("IN") Crc16 crc) {
+ public void read_scalefactor_selection(@LOC("IN") Bitstream stream,
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.H") Crc16 crc) {
if (allocation != 0) {
scfsi = stream.get_bits(2);
if (crc != null)
*
*/
// ssjava
- public boolean read_sampledata(@LOC("IN") Bitstream stream) {
+ public boolean read_sampledata(
+ @LOC("THIS,LayerIIDecoder$SubbandLayer2Stereo.SM") Bitstream stream) {
@LOC("V") boolean returnvalue = super.read_sampledata(stream);
if (channel2_allocation != 0)
// 9th added for get_LSF_scale_factors
// 10th added for get_scale_factors
// llth added for decode
-@LATTICE("ST,SP<OUT,OUT<SI1,SI1<SI,OUT<CH0,P2S<CH0,CH0<MAX0,MAX0<BR1,FS<BR1,BR1<BR,BR<HD1,HD1<HD,OUT*,BR1*,SI1*,MAX0*,CH0*,FS<BR,BR<SF,LR<IR,IR<IP,IP<SF,LR<K,K<F,LR<VAR,LR<RO,RO<F,VAR<F,VAR<RAW,CSH<F,SAM<O,O<F,NS<SI,SI<CH,SFREQ<H,MAX<H,H<CH,FLCH<CH,FLCH<WC,SF<SFT,SFT<NS,NS<C,TS<RAW,O<TS,LY<F,NZ<VAR,C*,FS*,IP*,IR*,LR*,K*,O*,TS*,TS<BT,BT<GR,GR<SI,LR<S,S<ME,ME<CH,K<SH,K<LSF,LSF<H,LSF<CH,IP<SH,SH<J,J<S,S<ME,SH<SFREQ,SH<RO,IP<TMP2,LSF<H,TMP2<F,J*,SH*,O<RO2,RO2<RO3,RO3<RO4,RO4<RO5,O<RO1,RO1<RO5,RO5<RO6,RO6<RO7,RO7<RO8,RO8<RO9,RO9<SFREQ,RO9<F,RO1*,RO4*,RO5*,RO6*,RO9*,VAR<HD3,HD3<HD2,HD2<HD1,HD1<SI,HD1<SFREQ,HD1<RAW,HD2*,HD3*,SFB<GLSFD5,GLSFD5<NS,GLSFD5<GLSFD4,NS<GLSFD3,GLSFD4<GLSFD3,GLSFD3<GLSFD2,GLSFD2<GLSFD1,GLSFD1<SI,GLSFD5*,SF<GLSFF4,GLSFF4<GLSFF3,GLSFF3<GLSFF2,GLSFF2<GLSFF1,GLSFF1<SI,GLSFF4*,GLSFF3*,GLSFF2*,SF<GSF5,GSF5<GSF4,GSF4<GSF3,GSF3<GSF2,GSF2<GSF1,GSF1<SI,GSF5*,GSF4*,O<D3,D3<D2,D2<D1,D1<FLCH,D1*,D2*")
+@LATTICE("BR<ST,ST,SP<OUT,OUT<SI1,SI1<SI,OUT<CH0,P2S<CH0,CH0<MAX0,MAX0<BR1,FS<BR1,BR1<BR,BR<HD1,HD1<HD,OUT*,BR1*,SI1*,MAX0*,CH0*,FS<BR,BR<SF,LR<IR,IR<IP,IP<SF,LR<K,K<F,LR<VAR,LR<RO,RO<F,VAR<F,VAR<RAW,CSH<F,SAM<O,O<F,NS<SI,SI<CH,SFREQ<H,MAX<H,H<CH,FLCH<CH,FLCH<WC,SF<SFT,SFT<NS,NS<C,TS<RAW,O<TS,LY<F,NZ<VAR,C*,FS*,IP*,IR*,LR*,K*,O*,TS*,TS<BT,BT<GR,GR<SI,LR<S,S<ME,ME<CH,K<SH,K<LSF,LSF<H,LSF<CH,IP<SH,SH<J,J<S,S<ME,SH<SFREQ,SH<RO,IP<TMP2,LSF<H,TMP2<F,J*,SH*,O<RO2,RO2<RO3,RO3<RO4,RO4<RO5,O<RO1,RO1<RO5,RO5<RO6,RO6<RO7,RO7<RO8,RO8<RO9,RO9<SFREQ,RO9<F,RO1*,RO4*,RO5*,RO6*,RO9*,VAR<HD3,HD3<HD2,HD2<HD1,HD1<SI,HD1<SFREQ,HD1<RAW,HD2*,HD3*,SFB<GLSFD5,GLSFD5<NS,GLSFD5<GLSFD4,NS<GLSFD3,GLSFD4<GLSFD3,GLSFD3<GLSFD2,GLSFD2<GLSFD1,GLSFD1<SI,GLSFD5*,SF<GLSFF4,GLSFF4<GLSFF3,GLSFF3<GLSFF2,GLSFF2<GLSFF1,GLSFF1<SI,GLSFF4*,GLSFF3*,GLSFF2*,SF<GSF5,GSF5<GSF4,GSF4<GSF3,GSF3<GSF2,GSF2<GSF1,GSF1<SI,GSF5*,GSF4*,O<D3,D3<D2,D2<D1,D1<FLCH,D1*,D2*")
@METHODDEFAULT("OUT<V,V<THIS,THIS<SH,SH<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
final class LayerIIIDecoder implements FrameDecoder {
@LOC("F")
get_side_info();
for (i = 0; i < nSlots; i++) {
- br.hputbuf(stream.get_bits(8));
+ br.hputbuf(stream.get_bits(8));
+ // LOC(stream.get_bits)=DELTA[Loc[decode.THIS],Loc[LayerIIIDecoder.ST]]
+ // param should be higher than br
}
main_data_end = br.hsstell() >>> 3;
/**
* Abstract base class for subband classes of layer I and II
*/
-@LATTICE("S<L,L<H,H<SH")
- @METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
-//@METHODDEFAULT("OUT<V,V<SH,SH<THIS,THIS<IN,SH*,THISLOC=THIS,GLOBALLOC=IN")
-static abstract class Subband
-{
- /*
- * Changes from version 1.1 to 1.2:
- * - array size increased by one, although a scalefactor with index 63
- * is illegal (to prevent segmentation faults)
- */
+@LATTICE("S<L,L<H,H<SH,SH<SH0")
+@METHODDEFAULT("OUT<V,V<THIS,THIS<C,C<IN,C*,THISLOC=THIS,RETURNLOC=OUT")
+static abstract class Subband {
+ /*
+ * Changes from version 1.1 to 1.2: - array size increased by one, although a
+ * scalefactor with index 63 is illegal (to prevent segmentation faults)
+ */
// Scalefactors for layer I and II, Annex 3-B.1 in ISO/IEC DIS 11172:
- public static final float scalefactors[] =
- {
- 2.00000000000000f, 1.58740105196820f, 1.25992104989487f, 1.00000000000000f,
- 0.79370052598410f, 0.62996052494744f, 0.50000000000000f, 0.39685026299205f,
- 0.31498026247372f, 0.25000000000000f, 0.19842513149602f, 0.15749013123686f,
- 0.12500000000000f, 0.09921256574801f, 0.07874506561843f, 0.06250000000000f,
- 0.04960628287401f, 0.03937253280921f, 0.03125000000000f, 0.02480314143700f,
- 0.01968626640461f, 0.01562500000000f, 0.01240157071850f, 0.00984313320230f,
- 0.00781250000000f, 0.00620078535925f, 0.00492156660115f, 0.00390625000000f,
- 0.00310039267963f, 0.00246078330058f, 0.00195312500000f, 0.00155019633981f,
- 0.00123039165029f, 0.00097656250000f, 0.00077509816991f, 0.00061519582514f,
- 0.00048828125000f, 0.00038754908495f, 0.00030759791257f, 0.00024414062500f,
- 0.00019377454248f, 0.00015379895629f, 0.00012207031250f, 0.00009688727124f,
- 0.00007689947814f, 0.00006103515625f, 0.00004844363562f, 0.00003844973907f,
- 0.00003051757813f, 0.00002422181781f, 0.00001922486954f, 0.00001525878906f,
- 0.00001211090890f, 0.00000961243477f, 0.00000762939453f, 0.00000605545445f,
- 0.00000480621738f, 0.00000381469727f, 0.00000302772723f, 0.00000240310869f,
- 0.00000190734863f, 0.00000151386361f, 0.00000120155435f, 0.00000000000000f /* illegal scalefactor */
+ public static final float scalefactors[] = { 2.00000000000000f, 1.58740105196820f,
+ 1.25992104989487f, 1.00000000000000f, 0.79370052598410f, 0.62996052494744f,
+ 0.50000000000000f, 0.39685026299205f, 0.31498026247372f, 0.25000000000000f,
+ 0.19842513149602f, 0.15749013123686f, 0.12500000000000f, 0.09921256574801f,
+ 0.07874506561843f, 0.06250000000000f, 0.04960628287401f, 0.03937253280921f,
+ 0.03125000000000f, 0.02480314143700f, 0.01968626640461f, 0.01562500000000f,
+ 0.01240157071850f, 0.00984313320230f, 0.00781250000000f, 0.00620078535925f,
+ 0.00492156660115f, 0.00390625000000f, 0.00310039267963f, 0.00246078330058f,
+ 0.00195312500000f, 0.00155019633981f, 0.00123039165029f, 0.00097656250000f,
+ 0.00077509816991f, 0.00061519582514f, 0.00048828125000f, 0.00038754908495f,
+ 0.00030759791257f, 0.00024414062500f, 0.00019377454248f, 0.00015379895629f,
+ 0.00012207031250f, 0.00009688727124f, 0.00007689947814f, 0.00006103515625f,
+ 0.00004844363562f, 0.00003844973907f, 0.00003051757813f, 0.00002422181781f,
+ 0.00001922486954f, 0.00001525878906f, 0.00001211090890f, 0.00000961243477f,
+ 0.00000762939453f, 0.00000605545445f, 0.00000480621738f, 0.00000381469727f,
+ 0.00000302772723f, 0.00000240310869f, 0.00000190734863f, 0.00000151386361f,
+ 0.00000120155435f, 0.00000000000000f /* illegal scalefactor */
};
- public abstract void read_allocation (@LOC("IN") Bitstream stream, @LOC("IN") Header header, @LOC("IN") Crc16 crc) throws DecoderException;
- public abstract void read_scalefactor (@LOC("IN") Bitstream stream, @LOC("IN") Header header);
-
+ public abstract void read_allocation(@LOC("IN") Bitstream stream, @LOC("IN") Header header,
+ @LOC("IN") Crc16 crc) throws DecoderException;
+
+ public abstract void read_scalefactor(@LOC("IN") Bitstream stream, @LOC("IN") Header header);
+
@RETURNLOC("OUT")
- public abstract boolean read_sampledata (@LOC("IN") Bitstream stream);
-
+ public abstract boolean read_sampledata(@LOC("IN") Bitstream stream);
+
@RETURNLOC("OUT")
- public abstract boolean put_next_sample (@LOC("IN") int channels,@LOC("IN") SynthesisFilter filter1,@LOC("IN") SynthesisFilter filter2);
+ public abstract boolean put_next_sample(@LOC("IN") int channels,
+ @LOC("IN") SynthesisFilter filter1, @LOC("IN") SynthesisFilter filter2);
};