From 6a025f165e3c14b3aea060139288f90eeed0f0a5 Mon Sep 17 00:00:00 2001 From: yeom Date: Thu, 14 Jul 2011 17:59:22 +0000 Subject: [PATCH] adding more annotations for mp3decoder --- .../Tests/ssJava/mp3decoder/BitReserve.java | 2 +- .../src/Tests/ssJava/mp3decoder/Decoder.java | 39 +++++++++++-------- .../src/Tests/ssJava/mp3decoder/Header.java | 1 + Robust/src/Tests/ssJava/mp3decoder/LOC.java | 8 +++- .../ssJava/mp3decoder/LayerIDecoder.java | 4 +- .../ssJava/mp3decoder/LayerIIIDecoder.java | 16 +++++--- .../src/Tests/ssJava/mp3decoder/Obuffer.java | 8 ++-- .../src/Tests/ssJava/mp3decoder/Player.java | 29 ++++++++------ .../Tests/ssJava/mp3decoder/SampleBuffer.java | 2 +- .../src/Tests/ssJava/mp3decoder/Subband.java | 2 +- .../ssJava/mp3decoder/SynthesisFilter.java | 2 +- 11 files changed, 67 insertions(+), 46 deletions(-) diff --git a/Robust/src/Tests/ssJava/mp3decoder/BitReserve.java b/Robust/src/Tests/ssJava/mp3decoder/BitReserve.java index bd57b6ea..3c907a79 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/BitReserve.java +++ b/Robust/src/Tests/ssJava/mp3decoder/BitReserve.java @@ -209,7 +209,7 @@ final class BitReserve /** * Rewind N bits in Stream. */ - public void rewindNbits(int N) + public void rewindNbits(@LOC("IN") int N) { totbit -= N; buf_byte_idx -= N; diff --git a/Robust/src/Tests/ssJava/mp3decoder/Decoder.java b/Robust/src/Tests/ssJava/mp3decoder/Decoder.java index bcf918ba..46c87ba2 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/Decoder.java +++ b/Robust/src/Tests/ssJava/mp3decoder/Decoder.java @@ -27,6 +27,7 @@ * @version 0.0.7 12/12/99 * @since 0.0.5 */ +@LATTICE("ST,OUT,FIL,DE,O,EQ,PA,INIT") public class Decoder implements DecoderErrors { static private final Params DEFAULT_PARAMS = new Params(); @@ -34,39 +35,39 @@ public class Decoder implements DecoderErrors /** * The Bistream from which the MPEG audio frames are read. */ - private Bitstream stream; + @LOC("ST") private Bitstream stream; /** * The Obuffer instance that will receive the decoded * PCM samples. */ - private Obuffer output; + @LOC("OUT") private Obuffer output; /** * Synthesis filter for the left channel. */ - private SynthesisFilter filter1; + @LOC("FIL") private SynthesisFilter filter1; /** * Sythesis filter for the right channel. */ - private SynthesisFilter filter2; + @LOC("FIL") private SynthesisFilter filter2; /** * The decoder used to decode layer III frames. */ - private LayerIIIDecoder l3decoder; - private LayerIIDecoder l2decoder; - private LayerIDecoder l1decoder; + @LOC("DE") private LayerIIIDecoder l3decoder; + @LOC("DE") private LayerIIDecoder l2decoder; + @LOC("DE") private LayerIDecoder l1decoder; - private int outputFrequency; - private int outputChannels; + @LOC("O") private int outputFrequency; + @LOC("O") private int outputChannels; - private Equalizer equalizer = new Equalizer(); + @LOC("EQ") private Equalizer equalizer = new Equalizer(); - private Params params; + @LOC("PA") private Params params; - private boolean initialized; + @LOC("INIT") private boolean initialized; /** @@ -129,7 +130,9 @@ public class Decoder implements DecoderErrors * * @return A SampleBuffer containing the decoded samples. */ - public Obuffer decodeFrame(Header header, Bitstream stream) + @LATTICE("OPlayer instance. @@ -114,14 +115,16 @@ public class Player * @return true if the last frame was played, or false if there are * more frames. */ - public boolean play(int frames) throws JavaLayerException + @LATTICE("IN 0 && ret) { - ret = decodeFrame(); + ret = decodeFrame(); } /* if (!ret) @@ -206,6 +209,8 @@ public class Player * * @return true if there are no more frames to decode, false otherwise. */ + @LATTICE("O,THISLOC=O") + @RETURNLOC("O") protected boolean decodeFrame() throws JavaLayerException { try @@ -220,7 +225,7 @@ public class Player // return false; // sample buffer set when decoder constructed - SampleBuffer output = (SampleBuffer)decoder.decodeFrame(header, bitstream); + @LOC("O") SampleBuffer output = (SampleBuffer)decoder.decodeFrame(header, bitstream); //synchronized (this) //{ diff --git a/Robust/src/Tests/ssJava/mp3decoder/SampleBuffer.java b/Robust/src/Tests/ssJava/mp3decoder/SampleBuffer.java index 913b8b02..211a328c 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/SampleBuffer.java +++ b/Robust/src/Tests/ssJava/mp3decoder/SampleBuffer.java @@ -140,7 +140,7 @@ public class SampleBuffer extends Obuffer /** * Write the samples to the file (Random Acces). */ - public void write_buffer(int val) + public void write_buffer(@LOC("IN") int val) { //for (int i = 0; i < channels; ++i) diff --git a/Robust/src/Tests/ssJava/mp3decoder/Subband.java b/Robust/src/Tests/ssJava/mp3decoder/Subband.java index dbfcd873..eff274d9 100644 --- a/Robust/src/Tests/ssJava/mp3decoder/Subband.java +++ b/Robust/src/Tests/ssJava/mp3decoder/Subband.java @@ -3,7 +3,7 @@ /** * Abstract base class for subband classes of layer I and II */ - @LATTICE("L=0; i--) { -- 2.34.1