* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
*----------------------------------------------------------------------\r
*/\r
-\r
-package javazoom.jl.decoder;\r
\r
/**\r
* Implementation of Bit Reservoir for Layer III.\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
-\r
import java.io.BufferedInputStream;\r
import java.io.ByteArrayInputStream;\r
import java.io.IOException;\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
-\r
/**\r
* This interface describes all error codes that can be thrown \r
* in <code>BistreamException</code>s.\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
-\r
/**\r
* Instances of <code>BitstreamException</code> are thrown \r
* when operations on a <code>Bitstream</code> fail. \r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
-\r
/**\r
* Work in progress.\r
*/\r
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
*----------------------------------------------------------------------\r
*/\r
-package javazoom.jl.decoder;\r
\r
/**\r
* 16-Bit CRC checksum\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* The <code>Decoder</code> class encapsulates the details of\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* This interface provides constants describing the error\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* The <code>DecoderException</code> represents the class of\r
*/\r
\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* The <code>Equalizer</code> class can be used to specify\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* Implementations of FrameDecoder are responsible for decoding\r
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
*----------------------------------------------------------------------\r
*/\r
-package javazoom.jl.decoder;\r
\r
/**\r
* Class for extracting information from a frame header.\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
-\r
import java.io.IOException;\r
import java.io.InputStream;\r
\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
-\r
/**\r
* Work in progress.\r
* \r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* Exception erorr codes for components of the JavaLayer API.\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
import java.io.PrintStream;\r
\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
import java.io.InputStream;\r
\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
import java.io.IOException;\r
import java.io.InputStream;\r
--- /dev/null
+public @interface LATTICE{
+ String value();
+}
--- /dev/null
+public @interface LOC{
+ String value();
+}
\ No newline at end of file
*----------------------------------------------------------------------
*/
-package javazoom.jl.decoder;
/**
* Implements decoding of MPEG Audio Layer I frames.
*----------------------------------------------------------------------
*/
-package javazoom.jl.decoder;
/**
* Implements decoding of MPEG Audio Layer II frames.
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* Class Implementing Layer 3 Decoder.\r
private int[] is_1d;\r
private float[][][] ro;\r
private float[][][] lr;\r
- private float[] out_1d;\r
+ private float[] out_1d; // 576 samples\r
private float[][] prevblck;\r
private float[][] k;\r
private int[] nonzero;\r
private Bitstream stream;\r
- @HEADER private Header header;\r
+ private Header header;\r
private SynthesisFilter filter1, filter2;\r
- private Obuffer buffer;\r
+ private Obuffer buffer; // output buffer\r
private int which_channels;\r
private BitReserve br;\r
private III_side_info_t si;\r
for (; bytes_to_discard > 0; bytes_to_discard--) // bytes_to_discard > br\r
br.hgetbits(8);\r
\r
+ // doing something from here\r
+ \r
// here 'gr' and 'max_gr' should be higher than 'ch','channels', and more\r
- for (gr = 0; gr < max_gr; gr++) { \r
+ for (gr = 0; gr < max_gr; gr++) { // two granules per channel \r
// in the loop body, access set={part2_start} \r
\r
// 'ch', 'channels' should be higher than all locs in the below body\r
for (ch = 0; ch < channels; ch++) { \r
part2_start = br.hsstell(); // part2_start < br\r
\r
+ // grab scale factors from the main data. \r
+ // following the scale factors is the actual compressed data\r
if (header.version() == Header.MPEG1)\r
get_scale_factors(ch, gr); // no need to care from this side\r
+ // here move scale factor data from 'br' buffer to 'scalefac' field\r
else\r
// MPEG-2 LSF, SZD: MPEG-2.5 LSF\r
get_LSF_scale_factors(ch, gr); // no need to care from this side\r
\r
+ // here, decoding the compressed audio data \r
huffman_decode(ch, gr); // no need to care from this side\r
// System.out.println("CheckSum HuffMan = " + CheckSumHuff);\r
dequantize_sample(ro[ch], ch, gr); // no need to care from this side\r
*\r
*/\r
private void reorder(float xr[][], int ch, int gr) {\r
+ // the purpose of reordering: move 'short samples' back to their original position\r
+ // after reorder, the samples are no long ordered by frequency\r
+ \r
+ // the format of input data to reorder: \r
+ // three small chunks of 192 samples each are combined to 576 samples ordered by frequency \r
+ \r
gr_info_s gr_info = (si.ch[ch].gr[gr]);\r
int freq, freq3;\r
int index;\r
{ { 8, 8, 5, 0 }, { 15, 12, 9, 0 }, { 6, 18, 9, 0 } } };\r
\r
}\r
+\r
--- /dev/null
+public @interface METHODDEFAULT{
+ String value();
+}
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* Work in progress.\r
-/* \r
- * 11/19/04 1.0 moved to LGPL.\r
- * 12/12/99 Added appendSamples() method for efficiency. MDM.\r
- * 15/02/99 ,Java Conversion by E.B ,ebsp@iname.com, JavaLayer\r
- *\r
- * Declarations for output buffer, includes operating system\r
- * implementation of the virtual Obuffer. Optional routines\r
- * enabling seeks and stops added by Jeff Tsay. \r
- *\r
- * @(#) obuffer.h 1.8, last edit: 6/15/94 16:51:56\r
- * @(#) Copyright (C) 1993, 1994 Tobias Bading (bading@cs.tu-berlin.de)\r
- * @(#) Berlin University of Technology\r
- *\r
- * Idea and first implementation for u-law output with fast downsampling by\r
- * Jim Boucher (jboucher@flash.bu.edu)\r
- *\r
- * LinuxObuffer class written by\r
- * Louis P. Kruger (lpkruger@phoenix.princeton.edu)\r
- *-----------------------------------------------------------------------\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU Library General Public License as published\r
- * by the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU Library General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Library General Public\r
- * License along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
- *----------------------------------------------------------------------\r
- */\r
-package javazoom.jl.decoder;\r
-\r
-/**\r
- * Base Class for audio output.\r
- */\r
-public abstract class Obuffer\r
-{\r
- public static final int OBUFFERSIZE = 2 * 1152; // max. 2 * 1152 samples per frame\r
- public static final int MAXCHANNELS = 2; // max. number of channels\r
-\r
- /**\r
- * Takes a 16 Bit PCM sample.\r
- */\r
- public abstract void append(int channel, short value);\r
-\r
- /**\r
- * Accepts 32 new PCM samples. \r
- */\r
- public void appendSamples(int channel, float[] f)\r
- {\r
- short s;\r
- for (int i=0; i<32;)\r
- {\r
- s = clip(f[i++]);\r
- append(channel, s); \r
- }\r
- }\r
-\r
- /**\r
- * Clip Sample to 16 Bits\r
- */\r
- private final short clip(float sample)\r
- {\r
- return ((sample > 32767.0f) ? 32767 :\r
- ((sample < -32768.0f) ? -32768 :\r
- (short) sample));\r
- }\r
- \r
- /**\r
- * Write the samples to the file or directly to the audio hardware.\r
- */\r
- public abstract void write_buffer(int val);\r
- public abstract void close();\r
-\r
- /**\r
- * Clears all data in the buffer (for seeking).\r
- */\r
- public abstract void clear_buffer();\r
-\r
- /**\r
- * Notify the buffer that the user has stopped the stream.\r
- */\r
- public abstract void set_stop_flag();\r
-}\r
+/*
+ * 11/19/04 1.0 moved to LGPL.
+ * 12/12/99 Added appendSamples() method for efficiency. MDM.
+ * 15/02/99 ,Java Conversion by E.B ,ebsp@iname.com, JavaLayer
+ *
+ * Declarations for output buffer, includes operating system
+ * implementation of the virtual Obuffer. Optional routines
+ * enabling seeks and stops added by Jeff Tsay.
+ *
+ * @(#) obuffer.h 1.8, last edit: 6/15/94 16:51:56
+ * @(#) Copyright (C) 1993, 1994 Tobias Bading (bading@cs.tu-berlin.de)
+ * @(#) Berlin University of Technology
+ *
+ * Idea and first implementation for u-law output with fast downsampling by
+ * Jim Boucher (jboucher@flash.bu.edu)
+ *
+ * LinuxObuffer class written by
+ * Louis P. Kruger (lpkruger@phoenix.princeton.edu)
+ *-----------------------------------------------------------------------
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *----------------------------------------------------------------------
+ */
+
+/**
+ * Base Class for audio output.
+ */
+@METHODDEFAULT("D<IN,D<C")
+public abstract class Obuffer
+{
+ public static final int OBUFFERSIZE = 2 * 1152; // max. 2 * 1152 samples per frame
+ public static final int MAXCHANNELS = 2; // max. number of channels
+
+ /**
+ * Takes a 16 Bit PCM sample.
+ */
+ public abstract void append(int channel, short value);
+
+ /**
+ * Accepts 32 new PCM samples.
+ */
+ public void appendSamples(@LOC("IN") int channel, @LOC("IN") float[] f)
+ {
+ @LOC("D") short s;
+ for (@LOC("C") int i=0; i<32;)
+ {
+ s = clip(f[i++]); // flow from "IN" to "D"
+ append(channel, s);
+ }
+ }
+
+ /**
+ * Clip Sample to 16 Bits
+ */
+ private final short clip(@LOC("IN") float sample)
+ {
+ return ((sample > 32767.0f) ? 32767 :
+ ((sample < -32768.0f) ? -32768 :
+ (short) sample));
+ }
+
+ /**
+ * Write the samples to the file or directly to the audio hardware.
+ */
+ public abstract void write_buffer(int val);
+ public abstract void close();
+
+ /**
+ * Clears all data in the buffer (for seeking).
+ */
+ public abstract void clear_buffer();
+
+ /**
+ * Notify the buffer that the user has stopped the stream.
+ */
+ public abstract void set_stop_flag();
+}
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
\r
/**\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.player;\r
\r
import java.io.InputStream;\r
\r
-import javazoom.jl.decoder.Bitstream;\r
-import javazoom.jl.decoder.BitstreamException;\r
-import javazoom.jl.decoder.Decoder;\r
-import javazoom.jl.decoder.Header;\r
-import javazoom.jl.decoder.JavaLayerException;\r
-import javazoom.jl.decoder.SampleBuffer;\r
\r
/**\r
* The <code>Player</code> class implements a simple player for playback\r
/**\r
* The AudioDevice the audio samples are written to. \r
*/\r
- private AudioDevice audio;\r
+ //private AudioDevice audio; \r
\r
/**\r
* Has the player been closed?\r
*/\r
public Player(InputStream stream) throws JavaLayerException\r
{\r
- this(stream, null); \r
+ //this(stream, null); \r
}\r
- \r
+\r
+ /* temporarily disabled by eom\r
public Player(InputStream stream, AudioDevice device) throws JavaLayerException\r
{\r
bitstream = new Bitstream(stream); \r
}\r
audio.open(decoder);\r
}\r
+ */\r
\r
public void play() throws JavaLayerException\r
{\r
public boolean play(int frames) throws JavaLayerException\r
{\r
boolean ret = true;\r
- \r
+ \r
+ \r
while (frames-- > 0 && ret)\r
{\r
ret = decodeFrame(); \r
}\r
- \r
+ /*\r
if (!ret)\r
{\r
// last frame, ensure all data flushed to the audio device. \r
} \r
}\r
}\r
+ */\r
return ret;\r
}\r
\r
* Cloases this player. Any audio currently playing is stopped\r
* immediately. \r
*/\r
+ \r
public synchronized void close()\r
{ \r
+/*\r
AudioDevice out = audio;\r
if (out!=null)\r
{ \r
{\r
}\r
}\r
+*/\r
}\r
\r
+ \r
/**\r
* Returns the completed status of this player.\r
* \r
*/\r
public int getPosition()\r
{\r
- int position = lastPosition;\r
+ //int position = lastPosition;\r
\r
- AudioDevice out = audio; \r
- if (out!=null)\r
- {\r
- position = out.getPosition(); \r
- }\r
- return position;\r
+ //AudioDevice out = audio; \r
+ //if (out!=null)\r
+ //{\r
+ // position = out.getPosition(); \r
+ //}\r
+ //return position;\r
+ return 0;\r
} \r
\r
/**\r
{ \r
try\r
{\r
- AudioDevice out = audio;\r
- if (out==null)\r
- return false;\r
+ //AudioDevice out = audio;\r
+ //if (out==null)\r
+ // return false;\r
\r
Header h = bitstream.readFrame(); \r
\r
// sample buffer set when decoder constructed\r
SampleBuffer output = (SampleBuffer)decoder.decodeFrame(h, bitstream);\r
\r
- synchronized (this)\r
- {\r
- out = audio;\r
- if (out!=null)\r
- { \r
- out.write(output.getBuffer(), 0, output.getBufferLength());\r
- } \r
- }\r
+ //synchronized (this)\r
+ //{\r
+ // out = audio;\r
+ // if (out!=null)\r
+ // { \r
+ // out.write(output.getBuffer(), 0, output.getBufferLength());\r
+ // } \r
+ //}\r
\r
bitstream.closeFrame();\r
} \r
-/* \r
- * 11/19/04 1.0 moved to LGPL.\r
- * \r
- * 12/12/99 Initial Version based on FileObuffer. mdm@techie.com.\r
- * \r
- * FileObuffer:\r
- * 15/02/99 Java Conversion by E.B ,javalayer@javazoom.net\r
- *\r
- *-----------------------------------------------------------------------\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU Library General Public License as published\r
- * by the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU Library General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Library General Public\r
- * License along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
- *----------------------------------------------------------------------\r
- */\r
-\r
-package javazoom.jl.decoder;\r
-\r
-/**\r
- * The <code>SampleBuffer</code> class implements an output buffer\r
- * that provides storage for a fixed size block of samples. \r
- */\r
-public class SampleBuffer extends Obuffer\r
-{\r
- private short[] buffer;\r
- private int[] bufferp;\r
- private int channels;\r
- private int frequency;\r
- \r
- /**\r
- * Constructor\r
- */\r
- public SampleBuffer(int sample_frequency, int number_of_channels)\r
- {\r
- buffer = new short[OBUFFERSIZE];\r
- bufferp = new int[MAXCHANNELS];\r
- channels = number_of_channels;\r
- frequency = sample_frequency;\r
- \r
- for (int i = 0; i < number_of_channels; ++i) \r
- bufferp[i] = (short)i;\r
- \r
- }\r
-\r
- public int getChannelCount()\r
- {\r
- return this.channels; \r
- }\r
- \r
- public int getSampleFrequency()\r
- {\r
- return this.frequency;\r
- }\r
- \r
- public short[] getBuffer()\r
- {\r
- return this.buffer; \r
- }\r
- \r
- public int getBufferLength()\r
- {\r
- return bufferp[0];\r
- }\r
- \r
- /**\r
- * Takes a 16 Bit PCM sample.\r
- */\r
- public void append(int channel, short value)\r
- {\r
- buffer[bufferp[channel]] = value;\r
- bufferp[channel] += channels; \r
- }\r
- \r
- public void appendSamples(int channel, float[] f)\r
- {\r
- int pos = bufferp[channel];\r
- \r
- short s;\r
- float fs;\r
- for (int i=0; i<32;)\r
- {\r
- fs = f[i++];\r
- fs = (fs>32767.0f ? 32767.0f \r
- : (fs < -32767.0f ? -32767.0f : fs));\r
- \r
- s = (short)fs;\r
- buffer[pos] = s;\r
- pos += channels;\r
- }\r
- \r
- bufferp[channel] = pos;\r
- }\r
- \r
- \r
- /**\r
- * Write the samples to the file (Random Acces).\r
- */\r
- public void write_buffer(int val)\r
- {\r
- \r
- //for (int i = 0; i < channels; ++i) \r
- // bufferp[i] = (short)i;\r
-\r
- }\r
-\r
- public void close()\r
- {}\r
- \r
- /**\r
- *\r
- */\r
- public void clear_buffer()\r
- {\r
- for (int i = 0; i < channels; ++i) \r
- bufferp[i] = (short)i;\r
- }\r
-\r
- /**\r
- *\r
- */\r
- public void set_stop_flag()\r
- {}\r
-}\r
+/*
+ * 11/19/04 1.0 moved to LGPL.
+ *
+ * 12/12/99 Initial Version based on FileObuffer. mdm@techie.com.
+ *
+ * FileObuffer:
+ * 15/02/99 Java Conversion by E.B ,javalayer@javazoom.net
+ *
+ *-----------------------------------------------------------------------
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *----------------------------------------------------------------------
+ */
+
+/**
+ * The <code>SampleBuffer</code> class implements an output buffer
+ * that provides storage for a fixed size block of samples.
+ */
+@LATTICE("BUF<BUFP,BUFP<CONT,BUFP*")
+@METHODDEFAULT("D<IN,D<C,C*,THISLOC=D")
+public class SampleBuffer extends Obuffer
+{
+ @LOC("BUF") private short[] buffer;
+ @LOC("BUFP") private int[] bufferp;
+ @LOC("CONT") private int channels;
+ @LOC("CONT") private int frequency;
+
+ /**
+ * Constructor
+ */
+ public SampleBuffer(@LOC("IN") int sample_frequency, @LOC("IN") int number_of_channels)
+ {
+ buffer = new short[OBUFFERSIZE];
+ bufferp = new int[MAXCHANNELS];
+ channels = number_of_channels; // [IN] -> [D]
+ frequency = sample_frequency; // [IN] -> [D]
+
+ for (@LOC("C") int i = 0; i < number_of_channels; ++i) {
+ bufferp[i] = (short)i; // LOC(bufferp[i]) has indirect flows from the location C, IN
+ // also, it has a direct flow from C
+ // anyway, LOC(bufferp[i])=[D,SampleBuffer.BUFP] is lower than all locations that have in-flows
+ }
+
+ }
+
+ public int getChannelCount()
+ {
+ return this.channels;
+ }
+
+ public int getSampleFrequency()
+ {
+ return this.frequency;
+ }
+
+ public short[] getBuffer()
+ {
+ return this.buffer;
+ }
+
+ public int getBufferLength()
+ {
+ return bufferp[0];
+ }
+
+ /**
+ * Takes a 16 Bit PCM sample.
+ */
+ public void append(@LOC("IN") int channel, @LOC("IN") short value)
+ {
+ buffer[bufferp[channel]] = value;
+ // LOC(bufferp[channel])= [local.D,SampleBuffer.BUF]
+ // so, for LHS, LOC(buffer) < LOC(bufferp[channle])
+ // also, bet' LHS and RHS, LOC(LHS) < LOC(RHS) since LOC(value)=[IN]
+
+ bufferp[channel] += channels;
+ // for lhs, LOC(bufferp[channel]) = [local.D, SampleBuffer.BUFP]
+ // for rhs, LOC(channels) = [local.D, SampleBuffer.CON]
+
+ }
+
+ @LATTICE("D<IN,D<C,THISLOC=D")
+ public void appendSamples(@LOC("IN") int channel, @LOC("IN") float[] f)
+ {
+ @LOC("D, SampleBuffer.BUFP") int pos = bufferp[channel];
+ // LOC(bufferp[channel])=[D,SampleBuffer.BUF]
+ // LOC(pos)=[D,SampleBuffer.BUFP]
+
+ @LOC("D,SampleBuffer.BUFP") short s;
+ @LOC("D,SampleBuffer.BUFP") float fs;
+
+ for (@LOC("C") int i=0; i<32;)
+ {
+ fs = f[i++]; // [IN] -> [D,BUFP]
+
+
+ if(fs>32767.0f){
+ fs=32767.0f;
+ // it has an indirect flow from LOC(fs)
+ // since LOC(fs) is a shared location, it's okay
+ }else{
+ if(fs<-32767f){
+ fs=-327.67f;
+ }
+ }
+
+ /*
+ fs = (fs>32767.0f ? 32767.0f
+ : (fs < -32767.0f ? -32767.0f : fs));
+ */
+
+ s = (short)fs; // it's okay since BUFP of [D,BUFP] is a shared location
+ buffer[pos] = s;
+ // for LHS, LOC(buffer[pos])= GLB( [D,BUF] , [D,BUFP] ) = [D,BUF]
+ // for RHS, LOC(s) = [D,BUFP]
+ // so it's okay: [D,BUFP] -> [D,BUF]
+
+ pos += channels; // [D,BUFP] -> [D,BUFP]
+ }
+
+ bufferp[channel] = pos;
+ // for lhs, LOC(bufferp[channel])=[D,BUFP]
+ // for rhs, LOC(pos)=[D,BUFP]
+ // since BUFP is a shared location, the assignment is okay
+ }
+
+
+ /**
+ * Write the samples to the file (Random Acces).
+ */
+ public void write_buffer(int val)
+ {
+
+ //for (int i = 0; i < channels; ++i)
+ // bufferp[i] = (short)i;
+
+ }
+
+ public void close()
+ {}
+
+ /**
+ *
+ */
+ public void clear_buffer()
+ {
+ for (int i = 0; i < channels; ++i)
+ bufferp[i] = (short)i;
+ }
+
+ /**
+ *
+ */
+ public void set_stop_flag()
+ {}
+}
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
import java.io.IOException;\r
\r
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
*----------------------------------------------------------------------\r
*/\r
-package javazoom.jl.decoder;\r
\r
import java.io.IOException;\r
\r
p7 = (pp6 - pp7) * cos1_4;\r
p8 = pp8 + pp9;\r
p9 = (pp8 - pp9) * cos1_4;\r
+\r
p10 = pp10 + pp11;\r
p11 = (pp10 - pp11) * cos1_4;\r
p12 = pp12 + pp13;\r
*----------------------------------------------------------------------\r
*/\r
\r
-package javazoom.jl.decoder;\r
\r
/**\r
* Class to implements Huffman decoder.\r
--- /dev/null
+BUILDSCRIPT=../../../buildscript
+
+PROGRAM=Player
+SOURCE_FILES=Player.java
+
+BSFLAGS= -32bit -ssjava -printlinenum -mainclass $(PROGRAM) -heapsize-mb 1000 -garbagestats -joptimize -noloop -optimize -debug
+
+default: $(PROGRAM)s.bin
+
+$(PROGRAM)s.bin: $(SOURCE_FILES) makefile
+ $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM)s -builddir sing $(SOURCE_FILES)
+
+clean:
+ rm -f $(PROGRAM).bin
+ rm -fr sing
+ rm -f *~
+ rm -f *.dot
+ rm -f *.png
+ rm -f *.txt
+ rm -f aliases.txt
+ rm -f results*txt
+ rm -f *log
+