reformat benchmark source codes to meet the requirements of the annotation generation.
[IRC.git] / Robust / src / Benchmarks / SSJava / MP3DecoderInfer / Decoder.java
index d7754bbb80aab487906f9a33ebc3f9eae165e87e..b453a6c74bf5d838a83cbf665c3585c29d807fb3 100644 (file)
@@ -27,7 +27,6 @@
  * @since 0.0.5\r
  */\r
 \r
-\r
 public class Decoder implements DecoderErrors {\r
 \r
   static private final Params DEFAULT_PARAMS = new Params();\r
@@ -35,49 +34,45 @@ public class Decoder implements DecoderErrors {
   /**\r
    * The Bistream from which the MPEG audio frames are read.\r
    */\r
-  // \r
+  //\r
   // private Bitstream stream;\r
 \r
   /**\r
    * The Obuffer instance that will receive the decoded PCM samples.\r
    */\r
-  // \r
+  //\r
   // private Obuffer output;\r
 \r
   /**\r
    * Synthesis filter for the left channel.\r
    */\r
-  // \r
+  //\r
   // private SynthesisFilter filter1;\r
 \r
   /**\r
    * Sythesis filter for the right channel.\r
    */\r
-  // \r
+  //\r
   // private SynthesisFilter filter2;\r
 \r
   /**\r
    * The decoder used to decode layer III frames.\r
    */\r
-  \r
+\r
   private LayerIIIDecoder l3decoder;\r
-  // \r
+  //\r
   // private LayerIIDecoder l2decoder;\r
-  // \r
+  //\r
   // private LayerIDecoder l1decoder;\r
 \r
-  \r
   private int outputFrequency;\r
-  \r
+\r
   private int outputChannels;\r
 \r
-  \r
   private Equalizer equalizer = new Equalizer();\r
 \r
-  \r
   private Params params;\r
 \r
-  \r
   private boolean initialized;\r
 \r
   /**\r
@@ -127,25 +122,24 @@ public class Decoder implements DecoderErrors {
   // if (filter2 != null)\r
   // filter2.setEQ(factors);\r
   // }\r
-  \r
-  public void init(  Header header) {\r
-     float scalefactor = 32700.0f;\r
 \r
-     int mode = header.mode();\r
-     int layer = header.layer();\r
-     int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2;\r
+  public void init(Header header) {\r
+    float scalefactor = 32700.0f;\r
+\r
+    int mode = header.mode();\r
+    int layer = header.layer();\r
+    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
     // output = new SampleBuffer(header.frequency(), channels);\r
     SampleBufferWrapper.init(header.frequency(), channels);\r
 \r
-     float[] factors = equalizer.getBandFactors();\r
-     SynthesisFilter filter1 =\r
-        new SynthesisFilter(0, scalefactor, factors);\r
+    float[] factors = equalizer.getBandFactors();\r
+    SynthesisFilter filter1 = new SynthesisFilter(0, scalefactor, factors);\r
 \r
     // REVIEW: allow mono output for stereo\r
-     SynthesisFilter filter2 = null;\r
+    SynthesisFilter filter2 = null;\r
     if (channels == 2) {\r
       filter2 = new SynthesisFilter(1, scalefactor, factors);\r
     }\r
@@ -153,7 +147,7 @@ public class Decoder implements DecoderErrors {
     outputChannels = channels;\r
     outputFrequency = header.frequency();\r
 \r
-    l3decoder = new LayerIIIDecoder(header,filter1, filter2, OutputChannels.BOTH_CHANNELS);\r
+    l3decoder = new LayerIIIDecoder(header, filter1, filter2, OutputChannels.BOTH_CHANNELS);\r
 \r
   }\r
 \r
@@ -167,8 +161,8 @@ public class Decoder implements DecoderErrors {
    * \r
    * @return A SampleBuffer containing the decoded samples.\r
    */\r
-  \r
-  public void decodeFrame( Header header) throws DecoderException {\r
+\r
+  public void decodeFrame(Header header) throws DecoderException {\r
 \r
     SampleBufferWrapper.clear_buffer();\r
     l3decoder.decode(header);\r
@@ -234,67 +228,63 @@ public class Decoder implements DecoderErrors {
   }\r
 }\r
 \r
+/**\r
+ * The <code>Params</code> class presents the customizable aspects of the\r
+ * decoder.\r
+ * <p>\r
+ * Instances of this class are not thread safe.\r
+ */\r
+public class Params implements Cloneable {\r
 \r
+  // private OutputChannels outputChannels = OutputChannels.BOTH;\r
+  private OutputChannels outputChannels = new OutputChannels(0);\r
 \r
+  private Equalizer equalizer = new Equalizer();\r
 \r
+  public Params() {\r
+  }\r
 \r
-  /**\r
-   * The <code>Params</code> class presents the customizable aspects of the\r
-   * decoder.\r
-   * <p>\r
-   * Instances of this class are not thread safe.\r
-   */\r
-  public class Params implements Cloneable {\r
-\r
-    // private OutputChannels outputChannels = OutputChannels.BOTH;\r
-    private OutputChannels outputChannels = new OutputChannels(0);\r
-\r
-    private Equalizer equalizer = new Equalizer();\r
-\r
-    public Params() {\r
-    }\r
-\r
-    public Object clone() {\r
-      // TODO: need to have better clone method\r
-      Params clone = new Params();\r
-      clone.outputChannels = new OutputChannels(outputChannels.getChannelsOutputCode());\r
-      clone.equalizer = new Equalizer();\r
-      return clone;\r
-      // try\r
-      // {\r
-      // return super.clone();\r
-      // }\r
-      // catch (CloneNotSupportedException ex)\r
-      // {\r
-      // throw new InternalError(this+": "+ex);\r
-      // }\r
-    }\r
+  public Object clone() {\r
+    // TODO: need to have better clone method\r
+    Params clone = new Params();\r
+    clone.outputChannels = new OutputChannels(outputChannels.getChannelsOutputCode());\r
+    clone.equalizer = new Equalizer();\r
+    return clone;\r
+    // try\r
+    // {\r
+    // return super.clone();\r
+    // }\r
+    // catch (CloneNotSupportedException ex)\r
+    // {\r
+    // throw new InternalError(this+": "+ex);\r
+    // }\r
+  }\r
 \r
-    public void setOutputChannels(OutputChannels out) {\r
-      if (out == null)\r
-        throw new NullPointerException("out");\r
+  public void setOutputChannels(OutputChannels out) {\r
+    if (out == null)\r
+      throw new NullPointerException("out");\r
 \r
-      outputChannels = out;\r
-    }\r
+    outputChannels = out;\r
+  }\r
 \r
-    public OutputChannels getOutputChannels() {\r
-      return outputChannels;\r
-    }\r
+  public OutputChannels getOutputChannels() {\r
+    return outputChannels;\r
+  }\r
 \r
-    /**\r
-     * Retrieves the equalizer settings that the decoder's equalizer will be\r
-     * initialized from.\r
-     * <p>\r
-     * The <code>Equalizer</code> instance returned cannot be changed in real\r
-     * time to affect the decoder output as it is used only to initialize the\r
-     * decoders EQ settings. To affect the decoder's output in realtime, use the\r
-     * Equalizer returned from the getEqualizer() method on the decoder.\r
-     \r
-     * @return The <code>Equalizer</code> used to initialize the EQ settings of\r
-     *         the decoder.\r
-     */\r
-    public Equalizer getInitialEqualizerSettings() {\r
-      return equalizer;\r
-    }\r
+  /**\r
+   * Retrieves the equalizer settings that the decoder's equalizer will be\r
+   * initialized from.\r
+   * <p>\r
+   * The <code>Equalizer</code> instance returned cannot be changed in real time\r
+   * to affect the decoder output as it is used only to initialize the decoders\r
+   * EQ settings. To affect the decoder's output in realtime, use the Equalizer\r
+   * returned from the getEqualizer() method on the decoder.\r
+   * \r
+   * @return The <code>Equalizer</code> used to initialize the EQ settings of\r
+   *         the decoder.\r
+   */\r
+  public Equalizer getInitialEqualizerSettings() {\r
+    return equalizer;\r
+  }\r
 \r
-  }
\ No newline at end of file
+}
\ No newline at end of file