From 70aff04c5bb5a7b5f5693a72a29a1abf97004e8d Mon Sep 17 00:00:00 2001 From: yeom Date: Mon, 13 Aug 2012 02:07:08 +0000 Subject: [PATCH] reformat benchmark source codes to meet the requirements of the annotation generation. --- .../SSJava/MP3DecoderInfer/BitReserve.java | 31 +- .../SSJava/MP3DecoderInfer/Bitstream.java | 109 +- .../MP3DecoderInfer/BitstreamErrors.java | 75 +- .../MP3DecoderInfer/BitstreamException.java | 80 +- .../SSJava/MP3DecoderInfer/Crc16.java | 42 +- .../SSJava/MP3DecoderInfer/DataParse.java | 48 - .../SSJava/MP3DecoderInfer/Decoder.java | 152 ++- .../SSJava/MP3DecoderInfer/DecoderErrors.java | 32 +- .../MP3DecoderInfer/DecoderException.java | 62 +- .../SSJava/MP3DecoderInfer/Equalizer.java | 21 +- .../SSJava/MP3DecoderInfer/FrameDecoder.java | 24 +- .../SSJava/MP3DecoderInfer/Header.java | 211 ++-- .../SSJava/MP3DecoderInfer/HuffData.java | 10 +- .../MP3DecoderInfer/InputStreamSource.java | 83 +- .../MP3DecoderInfer/JavaLayerError.java | 7 +- .../MP3DecoderInfer/JavaLayerErrors.java | 24 +- .../MP3DecoderInfer/JavaLayerException.java | 92 +- .../SSJava/MP3DecoderInfer/JavaLayerHook.java | 18 +- .../MP3DecoderInfer/JavaLayerUtils.java | 370 +++--- .../SSJava/MP3DecoderInfer/LATTICE.java | 4 +- .../SSJava/MP3DecoderInfer/LayerIDecoder.java | 175 ++- .../MP3DecoderInfer/LayerIIDecoder.java | 640 ++-------- .../MP3DecoderInfer/LayerIIIDecoder.java | 910 ++++++--------- .../SSJava/MP3DecoderInfer/METHODDEFAULT.java | 4 +- .../SSJava/MP3DecoderInfer/Manager.java | 34 +- .../SSJava/MP3DecoderInfer/Obuffer.java | 19 +- .../MP3DecoderInfer/OutputChannels.java | 4 +- .../SSJava/MP3DecoderInfer/Player.java | 40 +- .../SSJava/MP3DecoderInfer/SampleBuffer.java | 30 +- .../MP3DecoderInfer/SampleBufferWrapper.java | 4 +- .../MP3DecoderInfer/SideInfoBuffer.java | 29 +- .../SSJava/MP3DecoderInfer/Source.java | 40 +- .../SSJava/MP3DecoderInfer/Subband.java | 35 +- .../MP3DecoderInfer/SynthesisFilter.java | 1029 ++++++----------- .../SSJava/MP3DecoderInfer/huffcodetab.java | 475 +------- .../SSJava/MP3DecoderInfer/infer/makefile | 50 + .../SSJavaInfer/BufferedInputStream.java | 376 ++++++ .../SSJavaInfer/ByteArrayInputStream.java | 243 ++++ .../ClassLibrary/SSJavaInfer/Character.java | 66 ++ .../ClassLibrary/SSJavaInfer/Cloneable.java | 77 ++ .../src/ClassLibrary/SSJavaInfer/Double.java | 571 +++++++++ .../ClassLibrary/SSJavaInfer/Enumeration.java | 13 + .../ClassLibrary/SSJavaInfer/Exception.java | 102 ++ Robust/src/ClassLibrary/SSJavaInfer/File.java | 21 + .../SSJavaInfer/FileDescriptor.java | 135 +++ .../SSJavaInfer/FileInputStream.java | 95 ++ .../SSJavaInfer/FileOutputStream.java | 67 ++ .../SSJavaInfer/FilterInputStream.java | 210 ++++ .../SSJavaInfer/FilterOutputStream.java | 157 +++ .../src/ClassLibrary/SSJavaInfer/Float.java | 605 ++++++++++ .../ClassLibrary/SSJavaInfer/IOException.java | 71 ++ .../ClassLibrary/SSJavaInfer/InputStream.java | 270 +++++ .../src/ClassLibrary/SSJavaInfer/Integer.java | 119 ++ Robust/src/ClassLibrary/SSJavaInfer/Long.java | 834 +++++++++++++ Robust/src/ClassLibrary/SSJavaInfer/Math.java | 136 +++ .../src/ClassLibrary/SSJavaInfer/Number.java | 163 +++ .../src/ClassLibrary/SSJavaInfer/Object.java | 22 + .../SSJavaInfer/OutputStream.java | 23 + .../ClassLibrary/SSJavaInfer/PrintStream.java | 629 ++++++++++ .../SSJavaInfer/PushbackInputStream.java | 338 ++++++ .../src/ClassLibrary/SSJavaInfer/Random.java | 405 +++++++ .../src/ClassLibrary/SSJavaInfer/SSJAVA.java | 69 ++ .../src/ClassLibrary/SSJavaInfer/String.java | 521 +++++++++ .../SSJavaInfer/StringBuffer.java | 149 +++ .../src/ClassLibrary/SSJavaInfer/System.java | 91 ++ .../ClassLibrary/SSJavaInfer/Throwable.java | 509 ++++++++ .../src/ClassLibrary/SSJavaInfer/Vector.java | 149 +++ 67 files changed, 8965 insertions(+), 3284 deletions(-) delete mode 100644 Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DataParse.java create mode 100644 Robust/src/Benchmarks/SSJava/MP3DecoderInfer/infer/makefile create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/BufferedInputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/ByteArrayInputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Character.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Cloneable.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Double.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Enumeration.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Exception.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/File.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/FileDescriptor.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/FileInputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/FileOutputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/FilterInputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/FilterOutputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Float.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/IOException.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/InputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Integer.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Long.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Math.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Number.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Object.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/OutputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/PrintStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/PushbackInputStream.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Random.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/SSJAVA.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/String.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/StringBuffer.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/System.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Throwable.java create mode 100644 Robust/src/ClassLibrary/SSJavaInfer/Vector.java diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitReserve.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitReserve.java index eb54d964..49d62afd 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitReserve.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitReserve.java @@ -38,7 +38,6 @@ // REVIEW: there is no range checking, so buffer underflow or overflow // can silently occur. - final class BitReserve { /** * Size of the internal buffer to store the reserved bits. Must be a power of @@ -52,16 +51,12 @@ final class BitReserve { */ private static final int BUFSIZE_MASK = BUFSIZE - 1; - private int offset; - public int totbit; - public int buf_byte_idx; - private final int[] buf; BitReserve() { @@ -74,7 +69,7 @@ final class BitReserve { /** * Return totbit Field. */ - + public int hsstell() { return (totbit); } @@ -85,13 +80,13 @@ final class BitReserve { * @param N * the number of */ - public int hgetbits( int N) { + public int hgetbits(int N) { totbit += N; - int val = 0; + int val = 0; - int pos = buf_byte_idx; + int pos = buf_byte_idx; if (pos + N < BUFSIZE) { TERMINATE: while (N-- > 0) { val <<= 1; @@ -116,10 +111,10 @@ final class BitReserve { * * @returns 0 if next bit is reset, or 1 if next bit is set. */ - + public int hget1bit() { totbit++; - int val = buf[buf_byte_idx]; + int val = buf[buf_byte_idx]; buf_byte_idx = (buf_byte_idx + 1) & BUFSIZE_MASK; return val; } @@ -127,9 +122,9 @@ final class BitReserve { /** * Write 8 bits into the bit stream. */ - - public void hputbuf( int val) { - int ofs = offset; + + public void hputbuf(int val) { + int ofs = offset; buf[ofs++] = val & 0x80; buf[ofs++] = val & 0x40; buf[ofs++] = val & 0x20; @@ -149,7 +144,7 @@ final class BitReserve { /** * Rewind N bits in Stream. */ - public void rewindNbits( int N) { + public void rewindNbits(int N) { totbit -= N; buf_byte_idx -= N; if (buf_byte_idx < 0) @@ -159,9 +154,9 @@ final class BitReserve { /** * Rewind N bytes in Stream. */ - - public void rewindNbytes( int N) { - int bits = (N << 3); + + public void rewindNbytes(int N) { + int bits = (N << 3); totbit -= bits; buf_byte_idx -= bits; if (buf_byte_idx < 0) diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Bitstream.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Bitstream.java index 5bb23eba..ce88b158 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Bitstream.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Bitstream.java @@ -41,102 +41,90 @@ * This should be moved into this class and associated inner classes. */ - public final class Bitstream implements BitstreamErrors { /** * Synchronization control constant for the initial synchronization to the * start of a frame. */ - + static byte INITIAL_SYNC = 0; /** * Synchronization control constant for non-initial frame synchronizations. */ - static byte STRICT_SYNC = 1; // max. 1730 bytes per frame: 144 * 384kbit/s / 32000 Hz + 2 Bytes CRC /** * Maximum size of the frame buffer. */ - + private static final int BUFFER_INT_SIZE = 433; /** * The frame buffer that holds the data for the current frame. */ - + private final int[] framebuffer = new int[BUFFER_INT_SIZE]; /** * Number of valid bytes in the frame buffer. */ - + private int framesize; /** * The bytes read from the stream. */ - + private byte[] frame_bytes = new byte[BUFFER_INT_SIZE * 4]; /** * Index into framebuffer where the next bits are retrieved. */ - + private int wordpointer; /** * Number (0-31, from MSB to LSB) of next bit for get_bits() */ - + private int bitindex; /** * The current specified syncword */ - + private int syncword; /** * Audio header position in stream. */ - + private int header_pos = 0; /** * */ - + private boolean single_ch_mode; // private int current_frame_number; // private int last_frame_number; - - private final int bitmask[] = { - 0, // dummy - 0x00000001, 0x00000003, 0x00000007, 0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F, - 0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, 0x00001FFF, 0x00003FFF, - 0x00007FFF, 0x0000FFFF, 0x0001FFFF }; + private final int bitmask[] = { 0, // dummy + 0x00000001, 0x00000003, 0x00000007, 0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF, 0x0001FFFF }; - private final PushbackInputStream source; - private final Header header = new Header(); - private final byte syncbuf[] = new byte[4]; - private Crc16[] crc = new Crc16[1]; - private byte[] rawid3v2 = null; - private boolean firstframe = true; private BitReserve br; @@ -226,8 +214,7 @@ public final class Bitstream implements BitstreamErrors { int majorVersion = id3header[0]; int revision = id3header[1]; in.read(id3header, 0, 4); - size = - (int) (id3header[0] << 21) + (id3header[1] << 14) + (id3header[2] << 7) + (id3header[3]); + size = (int) (id3header[0] << 21) + (id3header[1] << 14) + (id3header[2] << 7) + (id3header[3]); } return (size + 10); } @@ -364,9 +351,7 @@ public final class Bitstream implements BitstreamErrors { */ public boolean isSyncCurrentPosition(int syncmode) throws BitstreamException { int read = readBytes(syncbuf, 0, 4); - int headerstring = - ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) - | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF); + int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF); try { source.unread(syncbuf, 0, read); @@ -462,9 +447,7 @@ public final class Bitstream implements BitstreamErrors { if (bytesRead != 3) throw newBitstreamException(STREAM_EOF, null); - headerstring = - ((syncbuf[0] << 16) & 0x00FF0000) | ((syncbuf[1] << 8) & 0x0000FF00) - | ((syncbuf[2] << 0) & 0x000000FF); + headerstring = ((syncbuf[0] << 16) & 0x00FF0000) | ((syncbuf[1] << 8) & 0x0000FF00) | ((syncbuf[2] << 0) & 0x000000FF); do { headerstring <<= 8; @@ -494,9 +477,7 @@ public final class Bitstream implements BitstreamErrors { // sync = ((headerstring & 0xFFF00000) == 0xFFF00000); sync = ((headerstring & 0xFFE00000) == 0xFFE00000); // SZD: MPEG 2.5 } else { - sync = - ((headerstring & 0xFFF80C00) == word) - && (((headerstring & 0x000000C0) == 0x000000C0) == single_ch_mode); + sync = ((headerstring & 0xFFF80C00) == word) && (((headerstring & 0x000000C0) == 0x000000C0) == single_ch_mode); } // filter out invalid sample rate @@ -528,12 +509,12 @@ public final class Bitstream implements BitstreamErrors { /** * Parses the data previously read with read_frame_data(). */ - + void parse_frame() throws BitstreamException { // Convert Bytes read to int - int b = 0; - byte[] byteread = frame_bytes; - int bytesize = framesize; + int b = 0; + byte[] byteread = frame_bytes; + int bytesize = framesize; // Check ID3v1 TAG (True only if last frame). // for (int t=0;t<(byteread.length)-2;t++) @@ -545,12 +526,12 @@ public final class Bitstream implements BitstreamErrors { // } // } - for ( int k = 0; k < bytesize; k = k + 4) { - int convert = 0; - byte b0 = 0; - byte b1 = 0; - byte b2 = 0; - byte b3 = 0; + for (int k = 0; k < bytesize; k = k + 4) { + int convert = 0; + byte b0 = 0; + byte b1 = 0; + byte b2 = 0; + byte b3 = 0; b0 = byteread[k]; if (k + 1 < bytesize) b1 = byteread[k + 1]; @@ -558,9 +539,7 @@ public final class Bitstream implements BitstreamErrors { b2 = byteread[k + 2]; if (k + 3 < bytesize) b3 = byteread[k + 3]; - framebuffer[b++] = - ((b0 << 24) & 0xFF000000) | ((b1 << 16) & 0x00FF0000) | ((b2 << 8) & 0x0000FF00) - | (b3 & 0x000000FF); + framebuffer[b++] = ((b0 << 24) & 0xFF000000) | ((b1 << 16) & 0x00FF0000) | ((b2 << 8) & 0x0000FF00) | (b3 & 0x000000FF); } wordpointer = 0; bitindex = 0; @@ -570,11 +549,11 @@ public final class Bitstream implements BitstreamErrors { * Read bits from buffer into the lower bits of an unsigned int. The LSB * contains the latest read bit of the stream. (1 <= number_of_bits <= 16) */ - - public int get_bits( int number_of_bits) { - int returnvalue = 0; - int sum = bitindex + number_of_bits; + public int get_bits(int number_of_bits) { + + int returnvalue = 0; + int sum = bitindex + number_of_bits; // E.B // There is a problem here, wordpointer could be -1 ?! @@ -597,9 +576,9 @@ public final class Bitstream implements BitstreamErrors { // ((short[])&returnvalue)[0] = ((short[])wordpointer + 1)[0]; // wordpointer++; // Added by me! // ((short[])&returnvalue + 1)[0] = ((short[])wordpointer)[0]; - int Right = (framebuffer[wordpointer] & 0x0000FFFF); + int Right = (framebuffer[wordpointer] & 0x0000FFFF); wordpointer++; - int Left = (framebuffer[wordpointer] & 0xFFFF0000); + int Left = (framebuffer[wordpointer] & 0xFFFF0000); returnvalue = ((Right << 16) & 0xFFFF0000) | ((Left >>> 16) & 0x0000FFFF); returnvalue >>>= 48 - sum; // returnvalue >>= 16 - (number_of_bits - (32 - @@ -612,7 +591,7 @@ public final class Bitstream implements BitstreamErrors { /** * Set the word we want to sync the header to. In Big-Endian byte order */ - void set_syncword( int syncword0) { + void set_syncword(int syncword0) { syncword = syncword0 & 0xFFFFFF3F; single_ch_mode = ((syncword0 & 0x000000C0) == 0x000000C0); } @@ -632,14 +611,12 @@ public final class Bitstream implements BitstreamErrors { * is thrown if the specified number of bytes could not be read * from the stream. */ - - - private int readFully( byte[] b, int offs, int len) - throws BitstreamException { - int nRead = 0; + + private int readFully(byte[] b, int offs, int len) throws BitstreamException { + int nRead = 0; try { while (len > 0) { - int bytesread = source.read(b, offs, len); + int bytesread = source.read(b, offs, len); if (bytesread == -1) { while (len-- > 0) { b[offs++] = 0; @@ -660,14 +637,12 @@ public final class Bitstream implements BitstreamErrors { /** * Simlar to readFully, but doesn't throw exception when EOF is reached. */ - - - private int readBytes( byte[] b, int offs, int len) - throws BitstreamException { - int totalBytesRead = 0; + + private int readBytes(byte[] b, int offs, int len) throws BitstreamException { + int totalBytesRead = 0; try { while (len > 0) { - int bytesread = source.read(b, offs, len); + int bytesread = source.read(b, offs, len); if (bytesread == -1) { break; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamErrors.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamErrors.java index 07114dbf..452711a1 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamErrors.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamErrors.java @@ -20,51 +20,50 @@ */ /** - * This interface describes all error codes that can be thrown - * in BistreamExceptions. + * This interface describes all error codes that can be thrown in + * BistreamExceptions. * * @see BitstreamException * - * @author MDM 12/12/99 - * @since 0.0.6 + * @author MDM 12/12/99 + * @since 0.0.6 */ -public interface BitstreamErrors extends JavaLayerErrors -{ - - /** - * An undeterminable error occurred. - */ - static public final int UNKNOWN_ERROR = BITSTREAM_ERROR + 0; - - /** - * The header describes an unknown sample rate. - */ - static public final int UNKNOWN_SAMPLE_RATE = BITSTREAM_ERROR + 1; +public interface BitstreamErrors extends JavaLayerErrors { - /** - * A problem occurred reading from the stream. - */ - static public final int STREAM_ERROR = BITSTREAM_ERROR + 2; - - /** - * The end of the stream was reached prematurely. - */ - static public final int UNEXPECTED_EOF = BITSTREAM_ERROR + 3; - - /** - * The end of the stream was reached. - */ - static public final int STREAM_EOF = BITSTREAM_ERROR + 4; - - /** - * Frame data are missing. - */ - static public final int INVALIDFRAME = BITSTREAM_ERROR + 5; + /** + * An undeterminable error occurred. + */ + static public final int UNKNOWN_ERROR = BITSTREAM_ERROR + 0; - /** + /** + * The header describes an unknown sample rate. + */ + static public final int UNKNOWN_SAMPLE_RATE = BITSTREAM_ERROR + 1; + + /** + * A problem occurred reading from the stream. + */ + static public final int STREAM_ERROR = BITSTREAM_ERROR + 2; + + /** + * The end of the stream was reached prematurely. + */ + static public final int UNEXPECTED_EOF = BITSTREAM_ERROR + 3; + + /** + * The end of the stream was reached. + */ + static public final int STREAM_EOF = BITSTREAM_ERROR + 4; + + /** + * Frame data are missing. + */ + static public final int INVALIDFRAME = BITSTREAM_ERROR + 5; + + /** * */ - static public final int BITSTREAM_LAST = 0x1ff; - + static public final int BITSTREAM_LAST = 0x1ff; + } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamException.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamException.java index 1889add6..9d88622f 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamException.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/BitstreamException.java @@ -19,52 +19,46 @@ */ /** - * Instances of BitstreamException are thrown - * when operations on a Bitstream fail. + * Instances of BitstreamException are thrown when operations on a + * Bitstream fail. *

- * The exception provides details of the exception condition - * in two ways: - *

  1. - * as an error-code describing the nature of the error - *


  2. - * as the Throwable instance, if any, that was thrown - * indicating that an exceptional condition has occurred. - *

+ * The exception provides details of the exception condition in two ways: + *
    + *
  1. + * as an error-code describing the nature of the error

  2. + *
    + *
  3. + * as the Throwable instance, if any, that was thrown indicating + * that an exceptional condition has occurred.
  4. + *
+ *

* * @since 0.0.6 - * @author MDM 12/12/99 + * @author MDM 12/12/99 */ -public class BitstreamException extends JavaLayerException - implements BitstreamErrors -{ - private int errorcode = UNKNOWN_ERROR; - - public BitstreamException(String msg, Throwable t) - { - super(msg, t); - } - - public BitstreamException(int errorcode, Throwable t) - { - this(getErrorString(errorcode), t); - this.errorcode = errorcode; - } - - public int getErrorCode() - { - return errorcode; - } - - - static public String getErrorString(int errorcode) - { - // REVIEW: use resource bundle to map error codes - // to locale-sensitive strings. - -// return "Bitstream errorcode "+Integer.toHexString(errorcode); - return "Bitstream errorcode "+errorcode; - } - - +public class BitstreamException extends JavaLayerException implements BitstreamErrors { + private int errorcode = UNKNOWN_ERROR; + + public BitstreamException(String msg, Throwable t) { + super(msg, t); + } + + public BitstreamException(int errorcode, Throwable t) { + this(getErrorString(errorcode), t); + this.errorcode = errorcode; + } + + public int getErrorCode() { + return errorcode; + } + + static public String getErrorString(int errorcode) { + // REVIEW: use resource bundle to map error codes + // to locale-sensitive strings. + + // return "Bitstream errorcode "+Integer.toHexString(errorcode); + return "Bitstream errorcode " + errorcode; + } + } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Crc16.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Crc16.java index 90351d15..f822adf6 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Crc16.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Crc16.java @@ -27,48 +27,40 @@ * 16-Bit CRC checksum */ - -public final class Crc16 -{ - private static short polynomial=(short)0x8005; - private short crc; +public final class Crc16 { + private static short polynomial = (short) 0x8005; + private short crc; /** * Dummy Constructor */ - public Crc16() - { - crc = (short) 0xFFFF; + public Crc16() { + crc = (short) 0xFFFF; } /** * Feed a bitstring to the crc calculation (0 < length <= 32). */ - //ssjava - - public void add_bits ( int bitstring, int length) - { - int bitmask = 1 << (length - 1); - do{ - if (((crc & 0x8000) == 0) ^ ((bitstring & bitmask) == 0 )) - { + // ssjava + + public void add_bits(int bitstring, int length) { + int bitmask = 1 << (length - 1); + do { + if (((crc & 0x8000) == 0) ^ ((bitstring & bitmask) == 0)) { crc <<= 1; crc ^= polynomial; - } - else{ + } else { crc <<= 1; } - }while ((bitmask >>>= 1) != 0); + } while ((bitmask >>>= 1) != 0); } /** - * Return the calculated checksum. - * Erase it for next calls to add_bits(). + * Return the calculated checksum. Erase it for next calls to add_bits(). */ - - public short checksum() - { - short sum = crc; + + public short checksum() { + short sum = crc; crc = (short) 0xFFFF; return sum; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DataParse.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DataParse.java deleted file mode 100644 index a6b30b09..00000000 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DataParse.java +++ /dev/null @@ -1,48 +0,0 @@ -import java.io.*; -import java.util.*; - -public class DataParse { - - public static void main(String args[]) { - - try { - - FileWriter fout = new FileWriter("out.csv"); - BufferedWriter out = new BufferedWriter(fout); - - FileInputStream fin = new FileInputStream("errinj-history-5001.txt"); - DataInputStream in = new DataInputStream(fin); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); - String inLine; - String value; - while ((inLine = br.readLine()) != null) { - // System.out.println(inLine); - if (inLine.startsWith("idx")) { - value = inLine.substring(4, inLine.length()); - out.write("\n" + value); - } else if (inLine.startsWith("inj")) { - if (inLine.length() > 3) { - value = inLine.substring(4, inLine.length()); - if (value.length() > 0) { - StringTokenizer st = new StringTokenizer(value, " "); - if (st.hasMoreTokens()) { - out.write("," + st.nextToken()); - } - } - } - } else if (inLine.startsWith("NO DIFF")) { - // do nothing - } else { - out.write("," + inLine); - } - } - in.close(); - out.close(); - - } catch (Exception e) { - System.out.println(e); - } - - } - -} \ No newline at end of file diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Decoder.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Decoder.java index d7754bbb..b453a6c7 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Decoder.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Decoder.java @@ -27,7 +27,6 @@ * @since 0.0.5 */ - public class Decoder implements DecoderErrors { static private final Params DEFAULT_PARAMS = new Params(); @@ -35,49 +34,45 @@ public class Decoder implements DecoderErrors { /** * The Bistream from which the MPEG audio frames are read. */ - // + // // private Bitstream stream; /** * The Obuffer instance that will receive the decoded PCM samples. */ - // + // // private Obuffer output; /** * Synthesis filter for the left channel. */ - // + // // private SynthesisFilter filter1; /** * Sythesis filter for the right channel. */ - // + // // private SynthesisFilter filter2; /** * The decoder used to decode layer III frames. */ - + private LayerIIIDecoder l3decoder; - // + // // private LayerIIDecoder l2decoder; - // + // // private LayerIDecoder l1decoder; - private int outputFrequency; - + private int outputChannels; - private Equalizer equalizer = new Equalizer(); - private Params params; - private boolean initialized; /** @@ -127,25 +122,24 @@ public class Decoder implements DecoderErrors { // if (filter2 != null) // filter2.setEQ(factors); // } - - public void init( Header header) { - float scalefactor = 32700.0f; - int mode = header.mode(); - int layer = header.layer(); - int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2; + public void init(Header header) { + float scalefactor = 32700.0f; + + int mode = header.mode(); + int layer = header.layer(); + int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2; // set up output buffer if not set up by client. // if (output == null) // output = new SampleBuffer(header.frequency(), channels); SampleBufferWrapper.init(header.frequency(), channels); - float[] factors = equalizer.getBandFactors(); - SynthesisFilter filter1 = - new SynthesisFilter(0, scalefactor, factors); + float[] factors = equalizer.getBandFactors(); + SynthesisFilter filter1 = new SynthesisFilter(0, scalefactor, factors); // REVIEW: allow mono output for stereo - SynthesisFilter filter2 = null; + SynthesisFilter filter2 = null; if (channels == 2) { filter2 = new SynthesisFilter(1, scalefactor, factors); } @@ -153,7 +147,7 @@ public class Decoder implements DecoderErrors { outputChannels = channels; outputFrequency = header.frequency(); - l3decoder = new LayerIIIDecoder(header,filter1, filter2, OutputChannels.BOTH_CHANNELS); + l3decoder = new LayerIIIDecoder(header, filter1, filter2, OutputChannels.BOTH_CHANNELS); } @@ -167,8 +161,8 @@ public class Decoder implements DecoderErrors { * * @return A SampleBuffer containing the decoded samples. */ - - public void decodeFrame( Header header) throws DecoderException { + + public void decodeFrame(Header header) throws DecoderException { SampleBufferWrapper.clear_buffer(); l3decoder.decode(header); @@ -234,67 +228,63 @@ public class Decoder implements DecoderErrors { } } +/** + * The Params class presents the customizable aspects of the + * decoder. + *

+ * Instances of this class are not thread safe. + */ +public class Params implements Cloneable { + // private OutputChannels outputChannels = OutputChannels.BOTH; + private OutputChannels outputChannels = new OutputChannels(0); + private Equalizer equalizer = new Equalizer(); + public Params() { + } - /** - * The Params class presents the customizable aspects of the - * decoder. - *

- * Instances of this class are not thread safe. - */ - public class Params implements Cloneable { - - // private OutputChannels outputChannels = OutputChannels.BOTH; - private OutputChannels outputChannels = new OutputChannels(0); - - private Equalizer equalizer = new Equalizer(); - - public Params() { - } - - public Object clone() { - // TODO: need to have better clone method - Params clone = new Params(); - clone.outputChannels = new OutputChannels(outputChannels.getChannelsOutputCode()); - clone.equalizer = new Equalizer(); - return clone; - // try - // { - // return super.clone(); - // } - // catch (CloneNotSupportedException ex) - // { - // throw new InternalError(this+": "+ex); - // } - } + public Object clone() { + // TODO: need to have better clone method + Params clone = new Params(); + clone.outputChannels = new OutputChannels(outputChannels.getChannelsOutputCode()); + clone.equalizer = new Equalizer(); + return clone; + // try + // { + // return super.clone(); + // } + // catch (CloneNotSupportedException ex) + // { + // throw new InternalError(this+": "+ex); + // } + } - public void setOutputChannels(OutputChannels out) { - if (out == null) - throw new NullPointerException("out"); + public void setOutputChannels(OutputChannels out) { + if (out == null) + throw new NullPointerException("out"); - outputChannels = out; - } + outputChannels = out; + } - public OutputChannels getOutputChannels() { - return outputChannels; - } + public OutputChannels getOutputChannels() { + return outputChannels; + } - /** - * Retrieves the equalizer settings that the decoder's equalizer will be - * initialized from. - *

- * The Equalizer instance returned cannot be changed in real - * time to affect the decoder output as it is used only to initialize the - * decoders EQ settings. To affect the decoder's output in realtime, use the - * Equalizer returned from the getEqualizer() method on the decoder. - * - * @return The Equalizer used to initialize the EQ settings of - * the decoder. - */ - public Equalizer getInitialEqualizerSettings() { - return equalizer; - } + /** + * Retrieves the equalizer settings that the decoder's equalizer will be + * initialized from. + *

+ * The Equalizer instance returned cannot be changed in real time + * to affect the decoder output as it is used only to initialize the decoders + * EQ settings. To affect the decoder's output in realtime, use the Equalizer + * returned from the getEqualizer() method on the decoder. + * + * @return The Equalizer used to initialize the EQ settings of + * the decoder. + */ + public Equalizer getInitialEqualizerSettings() { + return equalizer; + } - } \ No newline at end of file +} \ No newline at end of file diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderErrors.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderErrors.java index ef3552ad..f329fe46 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderErrors.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderErrors.java @@ -19,26 +19,24 @@ *---------------------------------------------------------------------- */ - /** - * This interface provides constants describing the error - * codes used by the Decoder to indicate errors. + * This interface provides constants describing the error codes used by the + * Decoder to indicate errors. * - * @author MDM + * @author MDM */ -public interface DecoderErrors extends JavaLayerErrors -{ - - static public final int UNKNOWN_ERROR = DECODER_ERROR + 0; - - /** - * Layer not supported by the decoder. - */ - static public final int UNSUPPORTED_LAYER = DECODER_ERROR + 1; +public interface DecoderErrors extends JavaLayerErrors { + + static public final int UNKNOWN_ERROR = DECODER_ERROR + 0; + + /** + * Layer not supported by the decoder. + */ + static public final int UNSUPPORTED_LAYER = DECODER_ERROR + 1; - /** - * Illegal allocation in subband layer. Indicates a corrupt stream. - */ - static public final int ILLEGAL_SUBBAND_ALLOCATION = DECODER_ERROR + 2; + /** + * Illegal allocation in subband layer. Indicates a corrupt stream. + */ + static public final int ILLEGAL_SUBBAND_ALLOCATION = DECODER_ERROR + 2; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderException.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderException.java index d33b0f09..aaeec8e7 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderException.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/DecoderException.java @@ -18,44 +18,34 @@ *---------------------------------------------------------------------- */ - /** - * The DecoderException represents the class of - * errors that can occur when decoding MPEG audio. + * The DecoderException represents the class of errors that can + * occur when decoding MPEG audio. * * @author MDM */ -public class DecoderException extends JavaLayerException - implements DecoderErrors -{ - private int errorcode = UNKNOWN_ERROR; - - public DecoderException(String msg, Throwable t) - { - super(msg, t); - } - - public DecoderException(int errorcode, Throwable t) - { - this(getErrorString(errorcode), t); - this.errorcode = errorcode; - } - - public int getErrorCode() - { - return errorcode; - } - - - static public String getErrorString(int errorcode) - { - // REVIEW: use resource file to map error codes - // to locale-sensitive strings. - -// return "Decoder errorcode "+Integer.toHexString(errorcode); - return "Decoder errorcode "+errorcode; - } - - -} +public class DecoderException extends JavaLayerException implements DecoderErrors { + private int errorcode = UNKNOWN_ERROR; + + public DecoderException(String msg, Throwable t) { + super(msg, t); + } + + public DecoderException(int errorcode, Throwable t) { + this(getErrorString(errorcode), t); + this.errorcode = errorcode; + } + public int getErrorCode() { + return errorcode; + } + + static public String getErrorString(int errorcode) { + // REVIEW: use resource file to map error codes + // to locale-sensitive strings. + + // return "Decoder errorcode "+Integer.toHexString(errorcode); + return "Decoder errorcode " + errorcode; + } + +} diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Equalizer.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Equalizer.java index 1fe7fb9e..b8d4ad45 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Equalizer.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Equalizer.java @@ -31,22 +31,18 @@ * @author MDM */ - public final class Equalizer { /** * Equalizer setting to denote that a given band will not be present in the * output signal. */ - + static public final float BAND_NOT_PRESENT = Float.NEGATIVE_INFINITY; - static public final Equalizer PASS_THRU_EQ = new Equalizer(); - private static final int BANDS = 32; - private final float[] settings = new float[BANDS]; /** @@ -154,12 +150,11 @@ public final class Equalizer { * * @return an array of factors that can be applied to the subbands. */ - - + float[] getBandFactors() { - float[] factors = new float[BANDS]; - int maxCount = BANDS; - for ( int i = 0; i < maxCount; i++) { + float[] factors = new float[BANDS]; + int maxCount = BANDS; + for (int i = 0; i < maxCount; i++) { factors[i] = getBandFactor(settings[i]); } @@ -172,12 +167,12 @@ public final class Equalizer { * the range [-1.0,1.0]. * */ - - float getBandFactor( float eq) { + + float getBandFactor(float eq) { if (eq == BAND_NOT_PRESENT) return 0.0f; - float f = (float) Math.pow(2.0, eq); + float f = (float) Math.pow(2.0, eq); return f; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/FrameDecoder.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/FrameDecoder.java index 9c7029dd..777a1d3c 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/FrameDecoder.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/FrameDecoder.java @@ -19,20 +19,18 @@ *---------------------------------------------------------------------- */ - /** - * Implementations of FrameDecoder are responsible for decoding - * an MPEG audio frame. - * + * Implementations of FrameDecoder are responsible for decoding an MPEG audio + * frame. + * */ -//REVIEW: the interface currently is too thin. There should be +// REVIEW: the interface currently is too thin. There should be // methods to specify the output buffer, the synthesis filters and -// possibly other objects used by the decoder. -public interface FrameDecoder -{ - /** - * Decodes one frame of MPEG audio. - */ - public void decodeFrame() throws DecoderException; - +// possibly other objects used by the decoder. +public interface FrameDecoder { + /** + * Decodes one frame of MPEG audio. + */ + public void decodeFrame() throws DecoderException; + } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Header.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Header.java index 55bf5ed8..b4ccc69a 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Header.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Header.java @@ -34,11 +34,10 @@ * Class for extracting information from a frame header. */ - public final class Header { - public static final int[][] frequencies = { { 22050, 24000, 16000, 1 }, - { 44100, 48000, 32000, 1 }, { 11025, 12000, 8000, 1 } }; // SZD: MPEG25 + public static final int[][] frequencies = { { 22050, 24000, 16000, 1 }, { 44100, 48000, 32000, 1 }, { 11025, 12000, 8000, 1 } }; // SZD: + // MPEG25 /** * Constant for MPEG-2 LSF version @@ -59,73 +58,66 @@ public final class Header { public static final int FOURTYEIGHT = 1; public static final int THIRTYTWO = 2; - private int h_layer; - + private int h_protection_bit; - + private int h_bitrate_index; - + private int h_padding_bit; - + private int h_mode_extension; - + private int h_version; - + private int h_mode; - + private int h_sample_frequency; - + private int h_number_of_subbands; - + private int h_intensity_stereo_bound; - + private boolean h_copyright; - + private boolean h_original; // VBR support added by E.B - + private double[] h_vbr_time_per_frame = { -1.0, 384.0, 1152.0, 1152.0 }; - + private boolean h_vbr; - + private int h_vbr_frames; - + private int h_vbr_scale; - + private int h_vbr_bytes; - + private byte[] h_vbr_toc; - private byte syncmode = Bitstream.INITIAL_SYNC; - + private Crc16 crc; - public short checksum; - + public int framesize; - + public int nSlots; - private int _headerstring = -1; // E.B - private SideInfoBuffer sib; - + private BitReserve br; - private int idx; Header() { } - public String toString() { - StringBuffer buffer = new StringBuffer(200); + StringBuffer buffer = new StringBuffer(200); buffer.append("Layer "); buffer.append(layer_string()); buffer.append(" frame "); @@ -141,7 +133,7 @@ public final class Header { buffer.append(' '); buffer.append(bitrate_string()); - String s = buffer.toString(); + String s = buffer.toString(); return s; } @@ -199,8 +191,7 @@ public final class Header { h_number_of_subbands = 12; else h_number_of_subbands = 8; - else if ((h_sample_frequency == FOURTYEIGHT) - || ((channel_bitrate >= 3) && (channel_bitrate <= 5))) + else if ((h_sample_frequency == FOURTYEIGHT) || ((channel_bitrate >= 3) && (channel_bitrate <= 5))) h_number_of_subbands = 27; else h_number_of_subbands = 30; @@ -290,17 +281,13 @@ public final class Header { // Read number of frames (if available). if ((flags[3] & (byte) (1 << 0)) != 0) { System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length); - h_vbr_frames = - (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) - & 0x0000FF00 | tmp[3] & 0x000000FF; + h_vbr_frames = (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) & 0x0000FF00 | tmp[3] & 0x000000FF; length += 4; } // Read size (if available). if ((flags[3] & (byte) (1 << 1)) != 0) { System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length); - h_vbr_bytes = - (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) - & 0x0000FF00 | tmp[3] & 0x000000FF; + h_vbr_bytes = (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) & 0x0000FF00 | tmp[3] & 0x000000FF; length += 4; } // Read TOC (if available). @@ -311,9 +298,7 @@ public final class Header { // Read scale (if available). if ((flags[3] & (byte) (1 << 3)) != 0) { System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length); - h_vbr_scale = - (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) - & 0x0000FF00 | tmp[3] & 0x000000FF; + h_vbr_scale = (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) & 0x0000FF00 | tmp[3] & 0x000000FF; length += 4; } // System.out.println("VBR:"+xing+" Frames:"+ h_vbr_frames @@ -339,15 +324,11 @@ public final class Header { // Bytes. int length = 4 + 6; System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length); - h_vbr_bytes = - (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) & 0x0000FF00 - | tmp[3] & 0x000000FF; + h_vbr_bytes = (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) & 0x0000FF00 | tmp[3] & 0x000000FF; length += 4; // Frames. System.arraycopy(firstframe, offset + length, tmp, 0, tmp.length); - h_vbr_frames = - (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) & 0x0000FF00 - | tmp[3] & 0x000000FF; + h_vbr_frames = (tmp[0] << 24) & 0xFF000000 | (tmp[1] << 16) & 0x00FF0000 | (tmp[2] << 8) & 0x0000FF00 | tmp[3] & 0x000000FF; length += 4; // System.out.println("VBR:"+vbri+" Frames:"+ h_vbr_frames // +" Size:"+h_vbr_bytes); @@ -363,7 +344,7 @@ public final class Header { /** * Returns version. */ - + public int version() { return h_version; } @@ -371,7 +352,7 @@ public final class Header { /** * Returns Layer ID. */ - + public int layer() { return h_layer; } @@ -386,7 +367,7 @@ public final class Header { /** * Returns Sample Frequency. */ - + public int sample_frequency() { return h_sample_frequency; } @@ -394,7 +375,7 @@ public final class Header { /** * Returns Frequency. */ - + public int frequency() { return frequencies[h_version][h_sample_frequency]; } @@ -402,7 +383,7 @@ public final class Header { /** * Returns Mode. */ - + public int mode() { return h_mode; } @@ -410,7 +391,7 @@ public final class Header { /** * Returns Protection bit. */ - + public boolean checksums() { if (h_protection_bit == 0) return true; @@ -462,7 +443,7 @@ public final class Header { /** * Returns Checksum flag. Compares computed checksum with stream checksum. */ - + public boolean checksum_ok() { return (checksum == crc.checksum()); } @@ -481,7 +462,7 @@ public final class Header { /** * Returns Slots. */ - + public int slots() { return nSlots; } @@ -489,36 +470,35 @@ public final class Header { /** * Returns Mode Extension. */ - + public int mode_extension() { return h_mode_extension; } // E.B -> private to public - public static final int bitrates[][][] = { - { - { 0 /* free format */, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, - 160000, 176000, 192000, 224000, 256000, 0 }, - { 0 /* free format */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, - 96000, 112000, 128000, 144000, 160000, 0 }, - { 0 /* free format */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, - 96000, 112000, 128000, 144000, 160000, 0 } }, - - { - { 0 /* free format */, 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, - 288000, 320000, 352000, 384000, 416000, 448000, 0 }, - { 0 /* free format */, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, - 192000, 224000, 256000, 320000, 384000, 0 }, - { 0 /* free format */, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, - 160000, 192000, 224000, 256000, 320000, 0 } }, + public static final int bitrates[][][] = { { { 0 /* free format */, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000, 0 }, { 0 /* + * free + * format + */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 0 }, { 0 /* + * free + * format + */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 0 } }, + + { { 0 /* free format */, 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000, 0 }, { 0 /* + * free + * format + */, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000, 0 }, { 0 /* + * free + * format + */, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 0 } }, // SZD: MPEG2.5 - { - { 0 /* free format */, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, - 160000, 176000, 192000, 224000, 256000, 0 }, - { 0 /* free format */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, - 96000, 112000, 128000, 144000, 160000, 0 }, - { 0 /* free format */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, - 96000, 112000, 128000, 144000, 160000, 0 } }, + { { 0 /* free format */, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000, 0 }, { 0 /* + * free + * format + */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 0 }, { 0 /* + * free + * format + */, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 0 } }, }; @@ -529,17 +509,13 @@ public final class Header { public int calculate_framesize() { if (h_layer == 1) { - framesize = - (12 * bitrates[h_version][0][h_bitrate_index]) - / frequencies[h_version][h_sample_frequency]; + framesize = (12 * bitrates[h_version][0][h_bitrate_index]) / frequencies[h_version][h_sample_frequency]; if (h_padding_bit != 0) framesize++; framesize <<= 2; // one slot is 4 bytes long nSlots = 0; } else { - framesize = - (144 * bitrates[h_version][h_layer - 1][h_bitrate_index]) - / frequencies[h_version][h_sample_frequency]; + framesize = (144 * bitrates[h_version][h_layer - 1][h_bitrate_index]) / frequencies[h_version][h_sample_frequency]; if (h_version == MPEG2_LSF || h_version == MPEG25_LSF) framesize >>= 1; // SZD if (h_padding_bit != 0) @@ -608,17 +584,16 @@ public final class Header { * * @return milliseconds per frame */ - + public float ms_per_frame() // E.B { if (h_vbr == true) { - double tpf = h_vbr_time_per_frame[layer()] / frequency(); + double tpf = h_vbr_time_per_frame[layer()] / frequency(); if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF)) tpf /= 2; return ((float) (tpf * 1000)); } else { - float ms_per_frame_array[][] = - { { 8.707483f, 8.0f, 12.0f }, { 26.12245f, 24.0f, 36.0f }, { 26.12245f, 24.0f, 36.0f } }; + float ms_per_frame_array[][] = { { 8.707483f, 8.0f, 12.0f }, { 26.12245f, 24.0f, 36.0f }, { 26.12245f, 24.0f, 36.0f } }; return (ms_per_frame_array[h_layer - 1][h_sample_frequency]); } } @@ -646,7 +621,7 @@ public final class Header { /** * Return Layer version. */ - + public String layer_string() { switch (h_layer) { case 1: @@ -660,39 +635,11 @@ public final class Header { } // E.B -> private to public - public static final String bitrate_str[][][] = { - { - { "free format", "32 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", - "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "176 kbit/s", - "192 kbit/s", "224 kbit/s", "256 kbit/s", "forbidden" }, - { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", - "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", - "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" }, - { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", - "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", - "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" } }, - - { - { "free format", "32 kbit/s", "64 kbit/s", "96 kbit/s", "128 kbit/s", "160 kbit/s", - "192 kbit/s", "224 kbit/s", "256 kbit/s", "288 kbit/s", "320 kbit/s", "352 kbit/s", - "384 kbit/s", "416 kbit/s", "448 kbit/s", "forbidden" }, - { "free format", "32 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", - "96 kbit/s", "112 kbit/s", "128 kbit/s", "160 kbit/s", "192 kbit/s", "224 kbit/s", - "256 kbit/s", "320 kbit/s", "384 kbit/s", "forbidden" }, - { "free format", "32 kbit/s", "40 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", - "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "160 kbit/s", "192 kbit/s", - "224 kbit/s", "256 kbit/s", "320 kbit/s", "forbidden" } }, + public static final String bitrate_str[][][] = { { { "free format", "32 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "176 kbit/s", "192 kbit/s", "224 kbit/s", "256 kbit/s", "forbidden" }, { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" }, { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" } }, + + { { "free format", "32 kbit/s", "64 kbit/s", "96 kbit/s", "128 kbit/s", "160 kbit/s", "192 kbit/s", "224 kbit/s", "256 kbit/s", "288 kbit/s", "320 kbit/s", "352 kbit/s", "384 kbit/s", "416 kbit/s", "448 kbit/s", "forbidden" }, { "free format", "32 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "160 kbit/s", "192 kbit/s", "224 kbit/s", "256 kbit/s", "320 kbit/s", "384 kbit/s", "forbidden" }, { "free format", "32 kbit/s", "40 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "160 kbit/s", "192 kbit/s", "224 kbit/s", "256 kbit/s", "320 kbit/s", "forbidden" } }, // SZD: MPEG2.5 - { - { "free format", "32 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", - "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "176 kbit/s", - "192 kbit/s", "224 kbit/s", "256 kbit/s", "forbidden" }, - { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", - "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", - "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" }, - { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", - "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", - "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" } }, }; + { { "free format", "32 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "176 kbit/s", "192 kbit/s", "224 kbit/s", "256 kbit/s", "forbidden" }, { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" }, { "free format", "8 kbit/s", "16 kbit/s", "24 kbit/s", "32 kbit/s", "40 kbit/s", "48 kbit/s", "56 kbit/s", "64 kbit/s", "80 kbit/s", "96 kbit/s", "112 kbit/s", "128 kbit/s", "144 kbit/s", "160 kbit/s", "forbidden" } }, }; /** * Return Bitrate. @@ -700,9 +647,8 @@ public final class Header { * @return bitrate in bps */ - public String bitrate_string() { - String kbs = " kb/s"; + String kbs = " kb/s"; if (h_vbr == true) { return Integer.toString(bitrate() / 1000) + kbs; } else { @@ -715,7 +661,7 @@ public final class Header { * * @return bitrate in bps and average bitrate for VBR header */ - + public int bitrate() { if (h_vbr == true) { return ((int) ((h_vbr_bytes * 8) / (ms_per_frame() * h_vbr_frames))) * 1000; @@ -738,7 +684,7 @@ public final class Header { * * @return frequency string in kHz */ - + public String sample_frequency_string() { switch (h_sample_frequency) { case THIRTYTWO: @@ -772,7 +718,7 @@ public final class Header { /** * Returns Mode. */ - + public String mode_string() { switch (h_mode) { case STEREO: @@ -792,7 +738,7 @@ public final class Header { * * @return MPEG-1 or MPEG-2 LSF or MPEG-2.5 LSF */ - + public String version_string() { switch (h_version) { case MPEG1: @@ -833,17 +779,14 @@ public final class Header { this.br = br; } - public SideInfoBuffer getSideInfoBuffer() { return sib; } - public BitReserve getBitReserve() { return br; } - public int getIdx() { return idx; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/HuffData.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/HuffData.java index fd77b646..d32ee1ae 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/HuffData.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/HuffData.java @@ -2,11 +2,11 @@ public class HuffData { - public int x; - public int y; - public int w; - public int v; - public BitReserve br; + public int x; + public int y; + public int w; + public int v; + public BitReserve br; public HuffData(int x, int y, int w, int v, BitReserve br) { this.x = x; diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/InputStreamSource.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/InputStreamSource.java index 3945c3d0..079a5c89 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/InputStreamSource.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/InputStreamSource.java @@ -26,53 +26,44 @@ import java.io.InputStream; * * An instance of InputStreamSource implements a * Source that provides data from an InputStream - * . Seeking functionality is not supported. + * . Seeking functionality is not supported. * * @author MDM */ -public class InputStreamSource implements Source -{ - private final InputStream in; - - public InputStreamSource(InputStream in) - { - if (in==null) - throw new NullPointerException("in"); - - this.in = in; - } - - public int read(byte[] b, int offs, int len) - throws IOException - { - int read = in.read(b, offs, len); - return read; - } - - public boolean willReadBlock() - { - return true; - //boolean block = (in.available()==0); - //return block; - } - - public boolean isSeekable() - { - return false; - } - - public long tell() - { - return -1; - } - - public long seek(long to) - { - return -1; - } - - public long length() - { - return -1; - } +public class InputStreamSource implements Source { + private final InputStream in; + + public InputStreamSource(InputStream in) { + if (in == null) + throw new NullPointerException("in"); + + this.in = in; + } + + public int read(byte[] b, int offs, int len) throws IOException { + int read = in.read(b, offs, len); + return read; + } + + public boolean willReadBlock() { + return true; + // boolean block = (in.available()==0); + // return block; + } + + public boolean isSeekable() { + return false; + } + + public long tell() { + return -1; + } + + public long seek(long to) { + return -1; + } + + public long length() { + return -1; + } } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerError.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerError.java index cc8dde73..502c0bdf 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerError.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerError.java @@ -21,9 +21,8 @@ /** * Work in progress. * - * API usage errors may be handled by throwing an instance of this - * class, as per JMF 2.0. + * API usage errors may be handled by throwing an instance of this class, as per + * JMF 2.0. */ -public class JavaLayerError extends Error -{ +public class JavaLayerError extends Error { } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerErrors.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerErrors.java index 4d11270c..e8f455a8 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerErrors.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerErrors.java @@ -18,22 +18,20 @@ *---------------------------------------------------------------------- */ - /** * Exception erorr codes for components of the JavaLayer API. */ -public interface JavaLayerErrors -{ - /** - * The first bitstream error code. See the {@link DecoderErrors DecoderErrors} - * interface for other bitstream error codes. - */ - static public final int BITSTREAM_ERROR = 0x100; +public interface JavaLayerErrors { + /** + * The first bitstream error code. See the {@link DecoderErrors DecoderErrors} + * interface for other bitstream error codes. + */ + static public final int BITSTREAM_ERROR = 0x100; - /** - * The first decoder error code. See the {@link DecoderErrors DecoderErrors} - * interface for other decoder error codes. - */ - static public final int DECODER_ERROR = 0x200; + /** + * The first decoder error code. See the {@link DecoderErrors DecoderErrors} + * interface for other decoder error codes. + */ + static public final int DECODER_ERROR = 0x200; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerException.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerException.java index 2759a9a8..b324415f 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerException.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerException.java @@ -18,62 +18,50 @@ *---------------------------------------------------------------------- */ - //import java.io.PrintStream; - /** - * The JavaLayerException is the base class for all API-level - * exceptions thrown by JavaLayer. To facilitate conversion and - * common handling of exceptions from other domains, the class - * can delegate some functionality to a contained Throwable instance. - *

+ * The JavaLayerException is the base class for all API-level exceptions thrown + * by JavaLayer. To facilitate conversion and common handling of exceptions from + * other domains, the class can delegate some functionality to a contained + * Throwable instance. + *

* * @author MDM */ -public class JavaLayerException extends Exception -{ - - private Throwable exception; - - - public JavaLayerException() - { - } - - public JavaLayerException(String msg) - { - super(msg); - } - - public JavaLayerException(String msg, Throwable t) - { - super(msg); - exception = t; - } - - public Throwable getException() - { - return exception; - } - - - public void printStackTrace() - { -// printStackTrace(System.err); - } - - public void printStackTrace(PrintStream ps) - { -// if (this.exception==null) -// { -// super.printStackTrace(ps); -// } -// else -// { -// exception.printStackTrace(); -// } - } - - +public class JavaLayerException extends Exception { + + private Throwable exception; + + public JavaLayerException() { + } + + public JavaLayerException(String msg) { + super(msg); + } + + public JavaLayerException(String msg, Throwable t) { + super(msg); + exception = t; + } + + public Throwable getException() { + return exception; + } + + public void printStackTrace() { + // printStackTrace(System.err); + } + + public void printStackTrace(PrintStream ps) { + // if (this.exception==null) + // { + // super.printStackTrace(ps); + // } + // else + // { + // exception.printStackTrace(); + // } + } + } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerHook.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerHook.java index eda09dec..fc719e6a 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerHook.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerHook.java @@ -17,19 +17,17 @@ *---------------------------------------------------------------------- */ - //import java.io.InputStream; /** - * The JavaLayerHooks class allows developers to change - * the way the JavaLayer library uses Resources. + * The JavaLayerHooks class allows developers to change the way the + * JavaLayer library uses Resources. */ -public interface JavaLayerHook -{ - /** - * Retrieves the named resource. This allows resources to be - * obtained without specifying how they are retrieved. - */ - public InputStream getResourceAsStream(String name); +public interface JavaLayerHook { + /** + * Retrieves the named resource. This allows resources to be obtained without + * specifying how they are retrieved. + */ + public InputStream getResourceAsStream(String name); } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerUtils.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerUtils.java index 13f2ac0b..54aae48f 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerUtils.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/JavaLayerUtils.java @@ -18,7 +18,6 @@ *---------------------------------------------------------------------- */ - //import java.io.IOException; //import java.io.InputStream; //import java.io.InvalidClassException; @@ -29,199 +28,186 @@ //import java.lang.reflect.Array; /** - * The JavaLayerUtils class is not strictly part of the JavaLayer API. - * It serves to provide useful methods and system-wide hooks. + * The JavaLayerUtils class is not strictly part of the JavaLayer API. It serves + * to provide useful methods and system-wide hooks. * * @author MDM */ -public class JavaLayerUtils -{ - static private JavaLayerHook hook = null; - - /** - * Deserializes the object contained in the given input stream. - * @param in The input stream to deserialize an object from. - * @param cls The expected class of the deserialized object. - */ -// static public Object deserialize(InputStream in, Class cls) - static public Object deserialize(InputStream in) - throws IOException - { -// if (cls==null) -// throw new NullPointerException("cls"); - -// Object obj = deserialize(in, cls); - Object obj = deserialize(in); -// if (!cls.isInstance(obj)) -// { -// throw new InvalidObjectException("type of deserialized instance not of required class."); -// } - - return obj; - } - - /** - * Deserializes an object from the given InputStream. - * The deserialization is delegated to an - * ObjectInputStream instance. - * - * @param in The InputStream to deserialize an object - * from. - * - * @return The object deserialized from the stream. - * @exception IOException is thrown if there was a problem reading - * the underlying stream, or an object could not be deserialized - * from the stream. - * - * @see java.io.ObjectInputStream - */ - static public Object deserialize(InputStream in) - throws IOException - { - if (in==null) - throw new NullPointerException("in"); - - //TODO : need to enable after having objectinputstream - /* - ObjectInputStream objIn = new ObjectInputStream(in); - - Object obj; - - try - { - obj = objIn.readObject(); - } - catch (ClassNotFoundException ex) - { - throw new InvalidClassException(ex.toString()); - } - - return obj; - */ - return null; - } - - /** - * Deserializes an array from a given InputStream. - * - * @param in The InputStream to - * deserialize an object from. - * - * @param elemType The class denoting the type of the array - * elements. - * @param length The expected length of the array, or -1 if - * any length is expected. - */ - static public Object deserializeArray(InputStream in, int length) - throws IOException - { - if (length<-1) - throw new IllegalArgumentException("length"); - - Object obj = deserialize(in); - - return obj; +public class JavaLayerUtils { + static private JavaLayerHook hook = null; + + /** + * Deserializes the object contained in the given input stream. + * + * @param in + * The input stream to deserialize an object from. + * @param cls + * The expected class of the deserialized object. + */ + // static public Object deserialize(InputStream in, Class cls) + static public Object deserialize(InputStream in) throws IOException { + // if (cls==null) + // throw new NullPointerException("cls"); + + // Object obj = deserialize(in, cls); + Object obj = deserialize(in); + // if (!cls.isInstance(obj)) + // { + // throw new + // InvalidObjectException("type of deserialized instance not of required class."); + // } + + return obj; + } + + /** + * Deserializes an object from the given InputStream. The + * deserialization is delegated to an + * ObjectInputStream instance. + * + * @param in + * The InputStream to deserialize an object from. + * + * @return The object deserialized from the stream. + * @exception IOException + * is thrown if there was a problem reading the underlying + * stream, or an object could not be deserialized from the + * stream. + * + * @see java.io.ObjectInputStream + */ + static public Object deserialize(InputStream in) throws IOException { + if (in == null) + throw new NullPointerException("in"); + + // TODO : need to enable after having objectinputstream + /* + * ObjectInputStream objIn = new ObjectInputStream(in); + * + * Object obj; + * + * try { obj = objIn.readObject(); } catch (ClassNotFoundException ex) { + * throw new InvalidClassException(ex.toString()); } + * + * return obj; + */ + return null; + } + + /** + * Deserializes an array from a given InputStream. + * + * @param in + * The InputStream to deserialize an object from. + * + * @param elemType + * The class denoting the type of the array elements. + * @param length + * The expected length of the array, or -1 if any length is expected. + */ + static public Object deserializeArray(InputStream in, int length) throws IOException { + if (length < -1) + throw new IllegalArgumentException("length"); + + Object obj = deserialize(in); + + return obj; + } + + // static public Object deserializeArray(InputStream in, Class elemType, int + // length) + // throws IOException + // { + // if (elemType==null) + // throw new NullPointerException("elemType"); + // + // if (length<-1) + // throw new IllegalArgumentException("length"); + // + // Object obj = deserialize(in); + // + // //SSJava will never throw exceptions as it is so this code is meaningless + // /* + // Class cls = obj.getClass(); + // + // if (!cls.isArray()) + // throw new InvalidObjectException("object is not an array"); + // + // Class arrayElemType = cls.getComponentType(); + // if (arrayElemType!=elemType) + // throw new InvalidObjectException("unexpected array component type"); + // + // if (length != -1) + // { + // int arrayLength = Array.getLength(obj); + // if (arrayLength!=length) + // throw new InvalidObjectException("array length mismatch"); + // } + // */ + // return obj; + // } + + // static public Object deserializeArrayResource(String name, Class elemType, + // int length) + static public Object deserializeArrayResource(String name, int length) throws IOException { + InputStream str = getResourceAsStream(name); + if (str == null) + throw new IOException("unable to load resource '" + name + "'"); + + // Object obj = deserializeArray(str, elemType, length); + Object obj = deserializeArray(str, length); + + return obj; + } + + static public void serialize(OutputStream out, Object obj) throws IOException { + // TODO : need to enable after having objectinputstream + // if (out==null) + // throw new NullPointerException("out"); + // + // if (obj==null) + // throw new NullPointerException("obj"); + // + // ObjectOutputStream objOut = new ObjectOutputStream(out); + // objOut.writeObject(obj); + + } + + /** + * Sets the system-wide JavaLayer hook. + */ + static synchronized public void setHook(JavaLayerHook hook0) { + hook = hook0; + } + + static synchronized public JavaLayerHook getHook() { + return hook; + } + + /** + * Retrieves an InputStream for a named resource. + * + * @param name + * The name of the resource. This must be a simple name, and not a + * qualified package name. + * + * @return The InputStream for the named resource, or null if the resource has + * not been found. If a hook has been provided, its + * getResourceAsStream() method is called to retrieve the resource. + */ + static synchronized public InputStream getResourceAsStream(String name) { + InputStream is = null; + + if (hook != null) { + is = hook.getResourceAsStream(name); } -// static public Object deserializeArray(InputStream in, Class elemType, int length) -// throws IOException -// { -// if (elemType==null) -// throw new NullPointerException("elemType"); -// -// if (length<-1) -// throw new IllegalArgumentException("length"); -// -// Object obj = deserialize(in); -// -// //SSJava will never throw exceptions as it is so this code is meaningless -// /* -// Class cls = obj.getClass(); -// -// if (!cls.isArray()) -// throw new InvalidObjectException("object is not an array"); -// -// Class arrayElemType = cls.getComponentType(); -// if (arrayElemType!=elemType) -// throw new InvalidObjectException("unexpected array component type"); -// -// if (length != -1) -// { -// int arrayLength = Array.getLength(obj); -// if (arrayLength!=length) -// throw new InvalidObjectException("array length mismatch"); -// } -// */ -// return obj; -// } - -// static public Object deserializeArrayResource(String name, Class elemType, int length) - static public Object deserializeArrayResource(String name, int length) - throws IOException - { - InputStream str = getResourceAsStream(name); - if (str==null) - throw new IOException("unable to load resource '"+name+"'"); - -// Object obj = deserializeArray(str, elemType, length); - Object obj = deserializeArray(str, length); - - return obj; - } - - static public void serialize(OutputStream out, Object obj) - throws IOException - { - //TODO : need to enable after having objectinputstream -// if (out==null) -// throw new NullPointerException("out"); -// -// if (obj==null) -// throw new NullPointerException("obj"); -// -// ObjectOutputStream objOut = new ObjectOutputStream(out); -// objOut.writeObject(obj); - - } - - /** - * Sets the system-wide JavaLayer hook. - */ - static synchronized public void setHook(JavaLayerHook hook0) - { - hook = hook0; - } - - static synchronized public JavaLayerHook getHook() - { - return hook; - } - - /** - * Retrieves an InputStream for a named resource. - * - * @param name The name of the resource. This must be a simple - * name, and not a qualified package name. - * - * @return The InputStream for the named resource, or null if - * the resource has not been found. If a hook has been - * provided, its getResourceAsStream() method is called - * to retrieve the resource. - */ - static synchronized public InputStream getResourceAsStream(String name) - { - InputStream is = null; - - if (hook!=null) - { - is = hook.getResourceAsStream(name); - } - //TODO java reflection -// else -// { -// Class cls = JavaLayerUtils.class; -// is = cls.getResourceAsStream(name); -// } - - return is; - } + // TODO java reflection + // else + // { + // Class cls = JavaLayerUtils.class; + // is = cls.getResourceAsStream(name); + // } + + return is; + } } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LATTICE.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LATTICE.java index 3dc53b81..3cb4b1da 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LATTICE.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LATTICE.java @@ -1,3 +1,3 @@ -public @interface LATTICE{ - String value(); +public @interface LATTICE { + String value(); } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIDecoder.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIDecoder.java index 2b28d2d8..6802e541 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIDecoder.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIDecoder.java @@ -28,39 +28,33 @@ * Implements decoding of MPEG Audio Layer I frames. */ - class LayerIDecoder implements FrameDecoder { - protected Bitstream stream; - + protected Header header; - + protected SynthesisFilter filter1; - + protected SynthesisFilter filter2; - + protected Obuffer buffer; - + protected int which_channels; - + protected int mode; - protected int num_subbands; - + protected Subband[] subbands; - protected Crc16 crc = null; // new Crc16[1] to enable CRC checking. public LayerIDecoder() { crc = new Crc16(); } - public void create( Bitstream stream0, Header header0, - SynthesisFilter filtera, SynthesisFilter filterb, - Obuffer buffer0, int which_ch0) { + public void create(Bitstream stream0, Header header0, SynthesisFilter filtera, SynthesisFilter filterb, Obuffer buffer0, int which_ch0) { stream = stream0; header = header0; filter1 = filtera; @@ -90,7 +84,7 @@ class LayerIDecoder implements FrameDecoder { } protected void createSubbands() { - int i; + int i; if (mode == Header.SINGLE_CHANNEL) { for (i = 0; i < num_subbands; ++i) { subbands[i] = new SubbandLayer1(i); @@ -111,7 +105,7 @@ class LayerIDecoder implements FrameDecoder { protected void readAllocation() throws DecoderException { // start to read audio data: - for ( int i = 0; i < num_subbands; ++i) + for (int i = 0; i < num_subbands; ++i) subbands[i].read_allocation(stream, header, crc); } @@ -121,20 +115,19 @@ class LayerIDecoder implements FrameDecoder { } protected void readScaleFactors() { - for ( int i = 0; i < num_subbands; ++i) + for (int i = 0; i < num_subbands; ++i) subbands[i].read_scalefactor(stream, header); } - protected void readSampleData() { - boolean read_ready = false; - boolean write_ready = false; + boolean read_ready = false; + boolean write_ready = false; - int mode = header.mode(); // header.mode() will return - // DELTA(THIS) + int mode = header.mode(); // header.mode() will return + // DELTA(THIS) - int i; + int i; do { for (i = 0; i < num_subbands; ++i) { @@ -161,53 +154,34 @@ class LayerIDecoder implements FrameDecoder { * Class for layer I subbands in single channel mode. Used for single channel * mode and in derived class for intensity stereo mode */ - - + static class SubbandLayer1 extends Subband { // Factors and offsets for sample requantization - public static final float table_factor[] = { 0.0f, (1.0f / 2.0f) * (4.0f / 3.0f), - (1.0f / 4.0f) * (8.0f / 7.0f), (1.0f / 8.0f) * (16.0f / 15.0f), - (1.0f / 16.0f) * (32.0f / 31.0f), (1.0f / 32.0f) * (64.0f / 63.0f), - (1.0f / 64.0f) * (128.0f / 127.0f), (1.0f / 128.0f) * (256.0f / 255.0f), - (1.0f / 256.0f) * (512.0f / 511.0f), (1.0f / 512.0f) * (1024.0f / 1023.0f), - (1.0f / 1024.0f) * (2048.0f / 2047.0f), (1.0f / 2048.0f) * (4096.0f / 4095.0f), - (1.0f / 4096.0f) * (8192.0f / 8191.0f), (1.0f / 8192.0f) * (16384.0f / 16383.0f), - (1.0f / 16384.0f) * (32768.0f / 32767.0f) }; - - public static final float table_offset[] = { 0.0f, ((1.0f / 2.0f) - 1.0f) * (4.0f / 3.0f), - ((1.0f / 4.0f) - 1.0f) * (8.0f / 7.0f), ((1.0f / 8.0f) - 1.0f) * (16.0f / 15.0f), - ((1.0f / 16.0f) - 1.0f) * (32.0f / 31.0f), ((1.0f / 32.0f) - 1.0f) * (64.0f / 63.0f), - ((1.0f / 64.0f) - 1.0f) * (128.0f / 127.0f), ((1.0f / 128.0f) - 1.0f) * (256.0f / 255.0f), - ((1.0f / 256.0f) - 1.0f) * (512.0f / 511.0f), - ((1.0f / 512.0f) - 1.0f) * (1024.0f / 1023.0f), - ((1.0f / 1024.0f) - 1.0f) * (2048.0f / 2047.0f), - ((1.0f / 2048.0f) - 1.0f) * (4096.0f / 4095.0f), - ((1.0f / 4096.0f) - 1.0f) * (8192.0f / 8191.0f), - ((1.0f / 8192.0f) - 1.0f) * (16384.0f / 16383.0f), - ((1.0f / 16384.0f) - 1.0f) * (32768.0f / 32767.0f) }; - - + public static final float table_factor[] = { 0.0f, (1.0f / 2.0f) * (4.0f / 3.0f), (1.0f / 4.0f) * (8.0f / 7.0f), (1.0f / 8.0f) * (16.0f / 15.0f), (1.0f / 16.0f) * (32.0f / 31.0f), (1.0f / 32.0f) * (64.0f / 63.0f), (1.0f / 64.0f) * (128.0f / 127.0f), (1.0f / 128.0f) * (256.0f / 255.0f), (1.0f / 256.0f) * (512.0f / 511.0f), (1.0f / 512.0f) * (1024.0f / 1023.0f), (1.0f / 1024.0f) * (2048.0f / 2047.0f), (1.0f / 2048.0f) * (4096.0f / 4095.0f), (1.0f / 4096.0f) * (8192.0f / 8191.0f), (1.0f / 8192.0f) * (16384.0f / 16383.0f), (1.0f / 16384.0f) * (32768.0f / 32767.0f) }; + + public static final float table_offset[] = { 0.0f, ((1.0f / 2.0f) - 1.0f) * (4.0f / 3.0f), ((1.0f / 4.0f) - 1.0f) * (8.0f / 7.0f), ((1.0f / 8.0f) - 1.0f) * (16.0f / 15.0f), ((1.0f / 16.0f) - 1.0f) * (32.0f / 31.0f), ((1.0f / 32.0f) - 1.0f) * (64.0f / 63.0f), ((1.0f / 64.0f) - 1.0f) * (128.0f / 127.0f), ((1.0f / 128.0f) - 1.0f) * (256.0f / 255.0f), ((1.0f / 256.0f) - 1.0f) * (512.0f / 511.0f), ((1.0f / 512.0f) - 1.0f) * (1024.0f / 1023.0f), ((1.0f / 1024.0f) - 1.0f) * (2048.0f / 2047.0f), ((1.0f / 2048.0f) - 1.0f) * (4096.0f / 4095.0f), ((1.0f / 4096.0f) - 1.0f) * (8192.0f / 8191.0f), ((1.0f / 8192.0f) - 1.0f) * (16384.0f / 16383.0f), ((1.0f / 16384.0f) - 1.0f) * (32768.0f / 32767.0f) }; + protected int subbandnumber; - + protected int samplenumber; - + protected int allocation; - + protected float scalefactor; - + protected int samplelength; - + protected float sample; - + protected float factor; - + protected float offset; /** * Construtor. */ - public SubbandLayer1( int subbandnumber) { + public SubbandLayer1(int subbandnumber) { this.subbandnumber = subbandnumber; samplenumber = 0; } @@ -215,11 +189,9 @@ class LayerIDecoder implements FrameDecoder { /** * */ - // - - public void read_allocation( Bitstream stream, - Header header, Crc16 crc) - throws DecoderException { + // + + public void read_allocation(Bitstream stream, Header header, Crc16 crc) throws DecoderException { if ((allocation = stream.get_bits(4)) == 15) { // CGJ: catch this condition and throw appropriate exception @@ -242,15 +214,14 @@ class LayerIDecoder implements FrameDecoder { /** * */ - public void read_scalefactor( Bitstream stream, Header header) { + public void read_scalefactor(Bitstream stream, Header header) { if (allocation != 0) scalefactor = scalefactors[stream.get_bits(6)]; } // ssjava - - - public boolean read_sampledata( Bitstream stream) { + + public boolean read_sampledata(Bitstream stream) { if (allocation != 0) { sample = (float) (stream.get_bits(samplelength)); } @@ -261,14 +232,11 @@ class LayerIDecoder implements FrameDecoder { return false; } - // - - public boolean put_next_sample( int channels, - SynthesisFilter filter1, - SynthesisFilter filter2) { + // + + public boolean put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) { - float scaled_sample = - (sample * factor + offset) * scalefactor; + float scaled_sample = (sample * factor + offset) * scalefactor; filter1.input_sample(scaled_sample, subbandnumber); } return true; @@ -278,56 +246,53 @@ class LayerIDecoder implements FrameDecoder { /** * Class for layer I subbands in joint stereo mode. */ - - + static class SubbandLayer1IntensityStereo extends SubbandLayer1 { - + protected float channel2_scalefactor; /** * Constructor */ - public SubbandLayer1IntensityStereo( int subbandnumber) { + public SubbandLayer1IntensityStereo(int subbandnumber) { super(subbandnumber); } /** * */ - - public void read_allocation( Bitstream stream, Header header, - Crc16 crc) throws DecoderException { + + public void read_allocation(Bitstream stream, Header header, Crc16 crc) throws DecoderException { super.read_allocation(stream, header, crc); } /** * */ - public void read_scalefactor( Bitstream stream, Header header) { + public void read_scalefactor(Bitstream stream, Header header) { if (allocation != 0) { scalefactor = scalefactors[stream.get_bits(6)]; channel2_scalefactor = scalefactors[stream.get_bits(6)]; } } - public boolean read_sampledata( Bitstream stream) { + public boolean read_sampledata(Bitstream stream) { return super.read_sampledata(stream); } - public boolean put_next_sample( int channels, SynthesisFilter filter1, - SynthesisFilter filter2) { + public boolean put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if (allocation != 0) { sample = sample * factor + offset; // requantization if (channels == OutputChannels.BOTH_CHANNELS) { - float sample1 = sample * scalefactor; - float sample2 = sample * channel2_scalefactor; + float sample1 = sample * scalefactor; + float sample2 = sample * channel2_scalefactor; filter1.input_sample(sample1, subbandnumber); filter2.input_sample(sample2, subbandnumber); } else if (channels == OutputChannels.LEFT_CHANNEL) { - float sample1 = sample * scalefactor; + float sample1 = sample * scalefactor; filter1.input_sample(sample1, subbandnumber); } else { - float sample2 = sample * channel2_scalefactor; + float sample2 = sample * channel2_scalefactor; filter1.input_sample(sample2, subbandnumber); } } @@ -338,26 +303,25 @@ class LayerIDecoder implements FrameDecoder { /** * Class for layer I subbands in stereo mode. */ - - + static class SubbandLayer1Stereo extends SubbandLayer1 { - + protected int channel2_allocation; - + protected float channel2_scalefactor; - + protected int channel2_samplelength; - + protected float channel2_sample; - + protected float channel2_factor; - + protected float channel2_offset; /** * Constructor */ - public SubbandLayer1Stereo( int subbandnumber) { + public SubbandLayer1Stereo(int subbandnumber) { super(subbandnumber); } @@ -365,9 +329,7 @@ class LayerIDecoder implements FrameDecoder { * */ // ssjava - public void read_allocation( Bitstream stream, - Header header, Crc16 crc) - throws DecoderException { + public void read_allocation(Bitstream stream, Header header, Crc16 crc) throws DecoderException { allocation = stream.get_bits(4); channel2_allocation = stream.get_bits(4); if (crc != null) { @@ -389,7 +351,7 @@ class LayerIDecoder implements FrameDecoder { /** * */ - public void read_scalefactor( Bitstream stream, Header header) { + public void read_scalefactor(Bitstream stream, Header header) { if (allocation != 0) scalefactor = scalefactors[stream.get_bits(6)]; if (channel2_allocation != 0) @@ -399,10 +361,9 @@ class LayerIDecoder implements FrameDecoder { /** * */ - - public boolean read_sampledata( Bitstream stream) { - boolean returnvalue = - super.read_sampledata(stream); + + public boolean read_sampledata(Bitstream stream) { + boolean returnvalue = super.read_sampledata(stream); if (channel2_allocation != 0) { channel2_sample = (float) (stream.get_bits(channel2_samplelength)); } @@ -412,13 +373,11 @@ class LayerIDecoder implements FrameDecoder { /** * */ - - public boolean put_next_sample( int channels, SynthesisFilter filter1, - SynthesisFilter filter2) { + + public boolean put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { super.put_next_sample(channels, filter1, filter2); if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) { - float sample2 = - (channel2_sample * channel2_factor + channel2_offset) * channel2_scalefactor; + float sample2 = (channel2_sample * channel2_factor + channel2_offset) * channel2_scalefactor; if (channels == OutputChannels.BOTH_CHANNELS) filter2.input_sample(sample2, subbandnumber); else diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIDecoder.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIDecoder.java index d9af8f4b..0ab4e20d 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIDecoder.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIDecoder.java @@ -31,14 +31,13 @@ * Implements decoding of MPEG Audio Layer II frames. */ - class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { public LayerIIDecoder() { } protected void createSubbands() { - int i; + int i; if (mode == Header.SINGLE_CHANNEL) for (i = 0; i < num_subbands; ++i) subbands[i] = new SubbandLayer2(i); @@ -57,7 +56,7 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { protected void readScaleFactorSelection() { // eom note: num_subbands is defined in LayerIDecoder so it has (THIS, // LayerIDecoder) Loc - for ( int i = 0; i < num_subbands; ++i) { + for (int i = 0; i < num_subbands; ++i) { ((SubbandLayer2) subbands[i]).read_scalefactor_selection(stream, crc); } } @@ -65,510 +64,105 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * Class for layer II subbands in single channel mode. */ - - + static class SubbandLayer2 extends Subband { // this table contains 3 requantized samples for each legal codeword // when grouped in 5 bits, i.e. 3 quantizationsteps per sample - public static final float grouping_5bits[] = new float[] { -2.0f / 3.0f, -2.0f / 3.0f, - -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, - -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, - -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, - 2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 0.0f, - -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 0.0f, - 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, - -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, - 2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, - 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, - 2.0f / 3.0f }; + public static final float grouping_5bits[] = new float[] { -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f / 3.0f, 0.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, -2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, 0.0f, -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, -2.0f / 3.0f, 0.0f, 2.0f / 3.0f, 0.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, -2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 0.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f, 2.0f / 3.0f }; // this table contains 3 requantized samples for each legal codeword // when grouped in 7 bits, i.e. 5 quantizationsteps per sample - public static final float grouping_7bits[] = new float[] { -0.8f, -0.8f, -0.8f, -0.4f, -0.8f, - -0.8f, 0.0f, -0.8f, -0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.8f, - -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.8f, -0.8f, - 0.0f, -0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f, -0.8f, - -0.8f, 0.4f, -0.8f, -0.4f, 0.4f, -0.8f, 0.0f, 0.4f, -0.8f, 0.4f, 0.4f, -0.8f, 0.8f, 0.4f, - -0.8f, -0.8f, 0.8f, -0.8f, -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.8f, 0.8f, - 0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.4f, -0.8f, -0.4f, 0.0f, -0.8f, -0.4f, 0.4f, -0.8f, - -0.4f, 0.8f, -0.8f, -0.4f, -0.8f, -0.4f, -0.4f, -0.4f, -0.4f, -0.4f, 0.0f, -0.4f, -0.4f, - 0.4f, -0.4f, -0.4f, 0.8f, -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.4f, 0.0f, -0.4f, 0.0f, 0.0f, - -0.4f, 0.4f, 0.0f, -0.4f, 0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.4f, 0.4f, -0.4f, 0.0f, - 0.4f, -0.4f, 0.4f, 0.4f, -0.4f, 0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.4f, 0.8f, -0.4f, - 0.0f, 0.8f, -0.4f, 0.4f, 0.8f, -0.4f, 0.8f, 0.8f, -0.4f, -0.8f, -0.8f, 0.0f, -0.4f, -0.8f, - 0.0f, 0.0f, -0.8f, 0.0f, 0.4f, -0.8f, 0.0f, 0.8f, -0.8f, 0.0f, -0.8f, -0.4f, 0.0f, -0.4f, - -0.4f, 0.0f, 0.0f, -0.4f, 0.0f, 0.4f, -0.4f, 0.0f, 0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f, - -0.4f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f, 0.0f, 0.0f, 0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f, - -0.4f, 0.4f, 0.0f, 0.0f, 0.4f, 0.0f, 0.4f, 0.4f, 0.0f, 0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f, - -0.4f, 0.8f, 0.0f, 0.0f, 0.8f, 0.0f, 0.4f, 0.8f, 0.0f, 0.8f, 0.8f, 0.0f, -0.8f, -0.8f, - 0.4f, -0.4f, -0.8f, 0.4f, 0.0f, -0.8f, 0.4f, 0.4f, -0.8f, 0.4f, 0.8f, -0.8f, 0.4f, -0.8f, - -0.4f, 0.4f, -0.4f, -0.4f, 0.4f, 0.0f, -0.4f, 0.4f, 0.4f, -0.4f, 0.4f, 0.8f, -0.4f, 0.4f, - -0.8f, 0.0f, 0.4f, -0.4f, 0.0f, 0.4f, 0.0f, 0.0f, 0.4f, 0.4f, 0.0f, 0.4f, 0.8f, 0.0f, 0.4f, - -0.8f, 0.4f, 0.4f, -0.4f, 0.4f, 0.4f, 0.0f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.8f, 0.4f, 0.4f, - -0.8f, 0.8f, 0.4f, -0.4f, 0.8f, 0.4f, 0.0f, 0.8f, 0.4f, 0.4f, 0.8f, 0.4f, 0.8f, 0.8f, 0.4f, - -0.8f, -0.8f, 0.8f, -0.4f, -0.8f, 0.8f, 0.0f, -0.8f, 0.8f, 0.4f, -0.8f, 0.8f, 0.8f, -0.8f, - 0.8f, -0.8f, -0.4f, 0.8f, -0.4f, -0.4f, 0.8f, 0.0f, -0.4f, 0.8f, 0.4f, -0.4f, 0.8f, 0.8f, - -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.4f, 0.0f, 0.8f, 0.0f, 0.0f, 0.8f, 0.4f, 0.0f, 0.8f, - 0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.4f, 0.4f, 0.8f, 0.0f, 0.4f, 0.8f, 0.4f, 0.4f, 0.8f, - 0.8f, 0.4f, 0.8f, -0.8f, 0.8f, 0.8f, -0.4f, 0.8f, 0.8f, 0.0f, 0.8f, 0.8f, 0.4f, 0.8f, 0.8f, - 0.8f, 0.8f, 0.8f }; + public static final float grouping_7bits[] = new float[] { -0.8f, -0.8f, -0.8f, -0.4f, -0.8f, -0.8f, 0.0f, -0.8f, -0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.8f, -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.8f, -0.8f, 0.0f, -0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f, -0.8f, -0.8f, 0.4f, -0.8f, -0.4f, 0.4f, -0.8f, 0.0f, 0.4f, -0.8f, 0.4f, 0.4f, -0.8f, 0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.8f, -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.8f, 0.8f, 0.8f, -0.8f, -0.8f, -0.8f, -0.4f, -0.4f, -0.8f, -0.4f, 0.0f, -0.8f, -0.4f, 0.4f, -0.8f, -0.4f, 0.8f, -0.8f, -0.4f, -0.8f, -0.4f, -0.4f, -0.4f, -0.4f, -0.4f, 0.0f, -0.4f, -0.4f, 0.4f, -0.4f, -0.4f, 0.8f, -0.4f, -0.4f, -0.8f, 0.0f, -0.4f, -0.4f, 0.0f, -0.4f, 0.0f, 0.0f, -0.4f, 0.4f, 0.0f, -0.4f, 0.8f, 0.0f, -0.4f, -0.8f, 0.4f, -0.4f, -0.4f, 0.4f, -0.4f, 0.0f, 0.4f, -0.4f, 0.4f, 0.4f, -0.4f, 0.8f, 0.4f, -0.4f, -0.8f, 0.8f, -0.4f, -0.4f, 0.8f, -0.4f, 0.0f, 0.8f, -0.4f, 0.4f, 0.8f, -0.4f, 0.8f, 0.8f, -0.4f, -0.8f, -0.8f, 0.0f, -0.4f, -0.8f, 0.0f, 0.0f, -0.8f, 0.0f, 0.4f, -0.8f, 0.0f, 0.8f, -0.8f, 0.0f, -0.8f, -0.4f, 0.0f, -0.4f, -0.4f, 0.0f, 0.0f, -0.4f, 0.0f, 0.4f, -0.4f, 0.0f, 0.8f, -0.4f, 0.0f, -0.8f, 0.0f, 0.0f, -0.4f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.4f, 0.0f, 0.0f, 0.8f, 0.0f, 0.0f, -0.8f, 0.4f, 0.0f, -0.4f, 0.4f, 0.0f, 0.0f, 0.4f, 0.0f, 0.4f, 0.4f, 0.0f, 0.8f, 0.4f, 0.0f, -0.8f, 0.8f, 0.0f, -0.4f, 0.8f, 0.0f, 0.0f, 0.8f, 0.0f, 0.4f, 0.8f, 0.0f, 0.8f, 0.8f, 0.0f, -0.8f, -0.8f, 0.4f, -0.4f, -0.8f, 0.4f, 0.0f, -0.8f, 0.4f, 0.4f, -0.8f, 0.4f, 0.8f, -0.8f, 0.4f, -0.8f, -0.4f, 0.4f, -0.4f, -0.4f, 0.4f, 0.0f, -0.4f, 0.4f, 0.4f, -0.4f, 0.4f, 0.8f, -0.4f, 0.4f, -0.8f, 0.0f, 0.4f, -0.4f, 0.0f, 0.4f, 0.0f, 0.0f, 0.4f, 0.4f, 0.0f, 0.4f, 0.8f, 0.0f, 0.4f, -0.8f, 0.4f, 0.4f, -0.4f, 0.4f, 0.4f, 0.0f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.8f, 0.4f, 0.4f, -0.8f, 0.8f, 0.4f, -0.4f, 0.8f, 0.4f, 0.0f, 0.8f, 0.4f, 0.4f, 0.8f, 0.4f, 0.8f, 0.8f, 0.4f, -0.8f, -0.8f, 0.8f, -0.4f, -0.8f, 0.8f, 0.0f, -0.8f, 0.8f, 0.4f, -0.8f, 0.8f, 0.8f, -0.8f, 0.8f, -0.8f, -0.4f, 0.8f, -0.4f, -0.4f, 0.8f, 0.0f, -0.4f, 0.8f, 0.4f, -0.4f, 0.8f, 0.8f, -0.4f, 0.8f, -0.8f, 0.0f, 0.8f, -0.4f, 0.0f, 0.8f, 0.0f, 0.0f, 0.8f, 0.4f, 0.0f, 0.8f, 0.8f, 0.0f, 0.8f, -0.8f, 0.4f, 0.8f, -0.4f, 0.4f, 0.8f, 0.0f, 0.4f, 0.8f, 0.4f, 0.4f, 0.8f, 0.8f, 0.4f, 0.8f, -0.8f, 0.8f, 0.8f, -0.4f, 0.8f, 0.8f, 0.0f, 0.8f, 0.8f, 0.4f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f }; // this table contains 3 requantized samples for each legal codeword // when grouped in 10 bits, i.e. 9 quantizationsteps per sample - public static final float grouping_10bits[] = { -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, - -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, - -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, - -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, - -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, - -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, - -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, - -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, - -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, - 4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, - 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, - -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, - -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, - -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, - -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, - -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, - -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, - -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f, - 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, - -8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, - -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, - 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, - -8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, - -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, - 6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, - 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, - 6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, - 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - 8.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, - -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, - -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, - 6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, - -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, - -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, - -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, - -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, - 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f, - 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, - -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, - -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, - -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, - 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, - 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, - 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, - 8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, - 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, - -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, - 2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, - 6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, - -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, - -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, - -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, - -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, - -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, - -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 2.0f / 9.0f, - 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, - 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, - -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - -4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f, - 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, - -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, - -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, - 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, - 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, - 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - 8.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, - -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, - -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - -8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, - -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, - -4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, - -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, - -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, - -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, - 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, - 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, - -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, - -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, - -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f, - 6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, - 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, - 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, - -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, - -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, - -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, - -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 0.0f, - -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, - -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 0.0f, - 2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f, - -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, - -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, - -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, - -4.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f, - -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, - -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f, - 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, - -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f, - -6.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 2.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f, - 8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, - -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 0.0f, - 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f, - 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, - 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 0.0f, - 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, - 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, - 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, - 6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, - 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, - -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, - 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, - 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, - 8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, - -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, - -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, - 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, - 2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, - 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, - -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, - -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, - -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, - -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, - -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, - -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, - -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, - 2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, - -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, - 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, - 2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, - 2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f, - 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, - 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, - 2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, - 6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - 6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f, - 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, - 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - 8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, 8.0f / 9.0f, - 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, - -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, - -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, - 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, - 4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, - 4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, - 4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, - 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, - 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, - 8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, - -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, - -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, - -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, - -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, - -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, - 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, - 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, - 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, - -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, - 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 0.0f, - 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, - -2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, - 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, - -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, - 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, - 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, - -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, - 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, - -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, - 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, - 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, - 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, - -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, - -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, - -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, - 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, - -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, - 6.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, - 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, - 0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, - 4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, - 4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, - 4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, - 6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, - 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, - -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, - -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, - 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, - -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, - 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - 6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, - 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, - 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, 8.0f / 9.0f, - 2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, - 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, - -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, - -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, - -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, - -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, - -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, - 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, - 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, - 8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, - 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f, - 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, - 6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, - -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f, - 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, - 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, - 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, - 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, - 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, - 4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, - 2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, - 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, - 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, - 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, - 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, - 6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, - 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, - -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, - -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, - 8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, - 8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f }; + public static final float grouping_10bits[] = { -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -6.0f / 9.0f, -8.0f / 9.0f, 0.0f, -4.0f / 9.0f, -8.0f / 9.0f, 0.0f, -2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -6.0f / 9.0f, -6.0f / 9.0f, 0.0f, -4.0f / 9.0f, -6.0f / 9.0f, 0.0f, -2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, -8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -6.0f / 9.0f, -4.0f / 9.0f, 0.0f, -4.0f / 9.0f, -4.0f / 9.0f, 0.0f, -2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f, -8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -6.0f / 9.0f, -2.0f / 9.0f, 0.0f, -4.0f / 9.0f, -2.0f / 9.0f, 0.0f, -2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 0.0f, 0.0f, -6.0f / 9.0f, 0.0f, 0.0f, -4.0f / 9.0f, 0.0f, 0.0f, -2.0f / 9.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 0.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 0.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 0.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 0.0f, -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 0.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -6.0f / 9.0f, 0.0f, 2.0f / 9.0f, -4.0f / 9.0f, 0.0f, 2.0f / 9.0f, -2.0f / 9.0f, 0.0f, 2.0f / 9.0f, 0.0f, 0.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 0.0f, 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 0.0f, -8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 0.0f, -6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 0.0f, -4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 0.0f, -2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -6.0f / 9.0f, 0.0f, 4.0f / 9.0f, -4.0f / 9.0f, 0.0f, 4.0f / 9.0f, -2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 0.0f, 0.0f, 4.0f / 9.0f, 2.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 0.0f, 2.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 0.0f, 4.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 0.0f, -8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 0.0f, -6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 0.0f, -4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 0.0f, -2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -6.0f / 9.0f, 0.0f, 6.0f / 9.0f, -4.0f / 9.0f, 0.0f, 6.0f / 9.0f, -2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 0.0f, 0.0f, 6.0f / 9.0f, 2.0f / 9.0f, 0.0f, 6.0f / 9.0f, 4.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 0.0f, 2.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 0.0f, 4.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 0.0f, 6.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 0.0f, -8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 0.0f, -6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 0.0f, -4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 0.0f, -2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -6.0f / 9.0f, 0.0f, 8.0f / 9.0f, -4.0f / 9.0f, 0.0f, 8.0f / 9.0f, -2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 0.0f, 0.0f, 8.0f / 9.0f, 2.0f / 9.0f, 0.0f, 8.0f / 9.0f, 4.0f / 9.0f, 0.0f, 8.0f / 9.0f, 6.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 0.0f, 8.0f / 9.0f, -8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 0.0f, 2.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 0.0f, 4.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 0.0f, 6.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, -8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, -2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 0.0f, 8.0f / 9.0f, 8.0f / 9.0f, 2.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 4.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 6.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f, 8.0f / 9.0f }; // data taken from ISO/IEC DIS 11172, Annexes 3-B.2[abcd] and 3-B.4: // subbands 0-2 in tables 3-B.2a and 2b: (index is allocation) public static final int table_ab1_codelength[] = // bits per codeword - { 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; + { 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; public static final float table_ab1_groupingtables[][] = // pointer to sample grouping table, or NULL-pointer if ungrouped - { null, grouping_5bits, null, null, null, null, null, null, null, null, null, null, null, - null, null, null }; + { null, grouping_5bits, null, null, null, null, null, null, null, null, null, null, null, null, null, null }; public static final float table_ab1_factor[] = // factor for requantization: (real)sample * factor - 1.0 gives requantized // sample - { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, - 1.0f / 128.0f, 1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, - 1.0f / 4096.0f, 1.0f / 8192.0f, 1.0f / 16384.0f, 1.0f / 32768.0f }; + { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f, 1.0f / 8192.0f, 1.0f / 16384.0f, 1.0f / 32768.0f }; public static final float table_ab1_c[] = // factor c for requantization from table 3-B.4 - { 0.0f, 1.33333333333f, 1.14285714286f, 1.06666666666f, 1.03225806452f, 1.01587301587f, - 1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, - 1.00024420024f, 1.00012208522f, 1.00006103888f, 1.00003051851f, 1.00001525902f }; + { 0.0f, 1.33333333333f, 1.14285714286f, 1.06666666666f, 1.03225806452f, 1.01587301587f, 1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f, 1.00012208522f, 1.00006103888f, 1.00003051851f, 1.00001525902f }; public static final float table_ab1_d[] = // addend d for requantization from table 3-B.4 - { 0.0f, 0.50000000000f, 0.25000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, - 0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, - 0.00048828125f, 0.00024414063f, 0.00012207031f, 0.00006103516f, 0.00003051758f }; + { 0.0f, 0.50000000000f, 0.25000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, 0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f, 0.00024414063f, 0.00012207031f, 0.00006103516f, 0.00003051758f }; // subbands 3-... tables 3-B.2a and 2b: - public static final float[] table_ab234_groupingtables[] = { null, grouping_5bits, - grouping_7bits, null, grouping_10bits, null, null, null, null, null, null, null, null, - null, null, null }; + public static final float[] table_ab234_groupingtables[] = { null, grouping_5bits, grouping_7bits, null, grouping_10bits, null, null, null, null, null, null, null, null, null, null, null }; // subbands 3-10 in tables 3-B.2a and 2b: - public static final int table_ab2_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 16 }; - public static final float table_ab2_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f, - 1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, - 1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f, - 1.0f / 32768.0f }; - public static final float table_ab2_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, - 1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f, - 1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, - 1.00024420024f, 1.00012208522f, 1.00001525902f }; - public static final float table_ab2_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, - 0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, - 0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, - 0.00048828125f, 0.00024414063f, 0.00003051758f }; + public static final int table_ab2_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 }; + public static final float table_ab2_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f, 1.0f / 32768.0f }; + public static final float table_ab2_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, 1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f, 1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f, 1.00012208522f, 1.00001525902f }; + public static final float table_ab2_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, 0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, 0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f, 0.00024414063f, 0.00003051758f }; // subbands 11-22 in tables 3-B.2a and 2b: public static final int table_ab3_codelength[] = { 0, 5, 7, 3, 10, 4, 5, 16 }; - public static final float table_ab3_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f, - 1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32768.0f }; - public static final float table_ab3_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, - 1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.00001525902f }; - public static final float table_ab3_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, - 0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.00003051758f }; + public static final float table_ab3_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32768.0f }; + public static final float table_ab3_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, 1.14285714286f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.00001525902f }; + public static final float table_ab3_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, 0.25000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.00003051758f }; // subbands 23-... in tables 3-B.2a and 2b: public static final int table_ab4_codelength[] = { 0, 5, 7, 16 }; - public static final float table_ab4_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, - 1.0f / 32768.0f }; - public static final float table_ab4_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, - 1.00001525902f }; - public static final float table_ab4_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, - 0.00003051758f }; + public static final float table_ab4_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 32768.0f }; + public static final float table_ab4_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, 1.00001525902f }; + public static final float table_ab4_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, 0.00003051758f }; // subbands in tables 3-B.2c and 2d: - public static final int table_cd_codelength[] = { 0, 5, 7, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15 }; - public static final float table_cd_groupingtables[][] = { null, grouping_5bits, grouping_7bits, - grouping_10bits, null, null, null, null, null, null, null, null, null, null, null, null }; - public static final float table_cd_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, - 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f, - 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f, 1.0f / 8192.0f, - 1.0f / 16384.0f }; - public static final float table_cd_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, - 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f, 1.00787401575f, - 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f, - 1.00012208522f, 1.00006103888f, 1.00003051851f }; - public static final float table_cd_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, - 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, 0.01562500000f, - 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f, - 0.00024414063f, 0.00012207031f, 0.00006103516f }; - - + public static final int table_cd_codelength[] = { 0, 5, 7, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; + public static final float table_cd_groupingtables[][] = { null, grouping_5bits, grouping_7bits, grouping_10bits, null, null, null, null, null, null, null, null, null, null, null, null }; + public static final float table_cd_factor[] = { 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f, 1.0f / 512.0f, 1.0f / 1024.0f, 1.0f / 2048.0f, 1.0f / 4096.0f, 1.0f / 8192.0f, 1.0f / 16384.0f }; + public static final float table_cd_c[] = { 0.0f, 1.33333333333f, 1.60000000000f, 1.77777777777f, 1.06666666666f, 1.03225806452f, 1.01587301587f, 1.00787401575f, 1.00392156863f, 1.00195694716f, 1.00097751711f, 1.00048851979f, 1.00024420024f, 1.00012208522f, 1.00006103888f, 1.00003051851f }; + public static final float table_cd_d[] = { 0.0f, 0.50000000000f, 0.50000000000f, 0.50000000000f, 0.12500000000f, 0.06250000000f, 0.03125000000f, 0.01562500000f, 0.00781250000f, 0.00390625000f, 0.00195312500f, 0.00097656250f, 0.00048828125f, 0.00024414063f, 0.00012207031f, 0.00006103516f }; + protected int subbandnumber; - + protected int allocation; - + protected int scfsi; - + protected float scalefactor1; - + protected float scalefactor2; - + protected float scalefactor3; - + protected int[] codelength = { 0 }; - + protected float groupingtable[][] = new float[2][]; // protected float[][] groupingtable = {{0},{0}} ; - + protected float[] factor = { 0.0f }; - + protected int groupnumber; - + protected int samplenumber; - + protected float[] samples = new float[3]; - + protected float[] c = { 0.0f }; - + protected float[] d = { 0.0f }; /** * Constructor */ - public SubbandLayer2( int subbandnumber) { + public SubbandLayer2(int subbandnumber) { this.subbandnumber = subbandnumber; groupnumber = samplenumber = 0; } @@ -576,11 +170,11 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - protected int get_allocationlength( Header header) { + protected int get_allocationlength(Header header) { if (header.version() == Header.MPEG1) { - int channel_bitrate = header.bitrate_index(); + int channel_bitrate = header.bitrate_index(); // calculate bitrate per channel: if (header.mode() != Header.SINGLE_CHANNEL) @@ -618,15 +212,13 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - - protected void prepare_sample_reading( Header header, - int allocation, - // float[][] groupingtable, - int channel, float[] factor, int[] codelength, - float[] c, float[] d) { + + protected void prepare_sample_reading(Header header, int allocation, + // float[][] groupingtable, + int channel, float[] factor, int[] codelength, float[] c, float[] d) { // header.bitrate_index() will generate at most DELTA(THIS,SH*) - int channel_bitrate = header.bitrate_index(); + int channel_bitrate = header.bitrate_index(); // calculate bitrate per channel: if (header.mode() != Header.SINGLE_CHANNEL) { @@ -677,13 +269,11 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - + // ssjava - public void read_allocation( Bitstream stream, - Header header, - Crc16 crc) { + public void read_allocation(Bitstream stream, Header header, Crc16 crc) { - int length = get_allocationlength(header); + int length = get_allocationlength(header); allocation = stream.get_bits(length); if (crc != null) { @@ -694,8 +284,7 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - public void read_scalefactor_selection( Bitstream stream, - Crc16 crc) { + public void read_scalefactor_selection(Bitstream stream, Crc16 crc) { if (allocation != 0) { scfsi = stream.get_bits(2); if (crc != null) @@ -706,7 +295,7 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - public void read_scalefactor( Bitstream stream, Header header) { + public void read_scalefactor(Bitstream stream, Header header) { if (allocation != 0) { switch (scfsi) { case 0: @@ -734,12 +323,11 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { * */ // ssjava - public boolean read_sampledata( Bitstream stream) { + public boolean read_sampledata(Bitstream stream) { if (allocation != 0) { if (groupingtable[0] != null) { - int samplecode = - stream.get_bits(codelength[0]); + int samplecode = stream.get_bits(codelength[0]); // create requantized samples: samplecode += samplecode << 1; // float[] target = samples; //subbed in variable to reduce areas @@ -751,8 +339,8 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { * target[tmp] = source[samplecode + temp]; */ // Bugfix: - int tmp = 0; - int temp = samplecode; + int tmp = 0; + int temp = samplecode; // if(temp > source.length - 3) temp = source.length - 3; if (temp > groupingtable[0].length - 3) { @@ -782,12 +370,11 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { } // ssjava - public boolean put_next_sample( int channels, SynthesisFilter filter1, - SynthesisFilter filter2) { + public boolean put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if ((allocation != 0) && (channels != OutputChannels.RIGHT_CHANNEL)) { - float sample = samples[samplenumber]; + float sample = samples[samplenumber]; if (groupingtable[0] == null) { sample = (sample + d[0]) * c[0]; @@ -812,39 +399,36 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * Class for layer II subbands in joint stereo mode. */ - - + static class SubbandLayer2IntensityStereo extends SubbandLayer2 { - + protected int channel2_scfsi; - + protected float channel2_scalefactor1; - + protected float channel2_scalefactor2; - + protected float channel2_scalefactor3; /** * Constructor */ - public SubbandLayer2IntensityStereo( int subbandnumber) { + public SubbandLayer2IntensityStereo(int subbandnumber) { super(subbandnumber); } /** * */ - - public void read_allocation( Bitstream stream, Header header, - Crc16 crc) { + + public void read_allocation(Bitstream stream, Header header, Crc16 crc) { super.read_allocation(stream, header, crc); } /** * */ - public void read_scalefactor_selection( Bitstream stream, - Crc16 crc) { + public void read_scalefactor_selection(Bitstream stream, Crc16 crc) { if (allocation != 0) { scfsi = stream.get_bits(2); channel2_scfsi = stream.get_bits(2); @@ -858,7 +442,7 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - public void read_scalefactor( Bitstream stream, Header header) { + public void read_scalefactor(Bitstream stream, Header header) { if (allocation != 0) { super.read_scalefactor(stream, header); switch (channel2_scfsi) { @@ -893,24 +477,22 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - public boolean read_sampledata( Bitstream stream) { + public boolean read_sampledata(Bitstream stream) { return super.read_sampledata(stream); } /** * */ - - - public boolean put_next_sample( int channels, SynthesisFilter filter1, - SynthesisFilter filter2) { + + public boolean put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { if (allocation != 0) { - float sample = samples[samplenumber]; + float sample = samples[samplenumber]; if (groupingtable[0] == null) sample = (sample + d[0]) * c[0]; if (channels == OutputChannels.BOTH_CHANNELS) { - float sample2 = sample; + float sample2 = sample; if (groupnumber <= 4) { sample *= scalefactor1; sample2 *= channel2_scalefactor1; @@ -952,36 +534,35 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * Class for layer II subbands in stereo mode. */ - - + static class SubbandLayer2Stereo extends SubbandLayer2 { - + protected int channel2_allocation; - + protected int channel2_scfsi; - + protected float channel2_scalefactor1; - + protected float channel2_scalefactor2; - + protected float channel2_scalefactor3; // protected boolean channel2_grouping; ???? Never used! - + protected int[] channel2_codelength = { 0 }; // protected float[][] channel2_groupingtable = {{0},{0}}; - + protected float[] channel2_factor = { 0.0f }; - + protected float[] channel2_samples; - + protected float[] channel2_c = { 0.0f }; - + protected float[] channel2_d = { 0.0f }; /** * Constructor */ - public SubbandLayer2Stereo( int subbandnumber) { + public SubbandLayer2Stereo(int subbandnumber) { super(subbandnumber); channel2_samples = new float[3]; } @@ -989,14 +570,11 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - + // ssjava - public void read_allocation( - Bitstream stream, - Header header, - Crc16 crc) { + public void read_allocation(Bitstream stream, Header header, Crc16 crc) { - int length = get_allocationlength(header); + int length = get_allocationlength(header); allocation = stream.get_bits(length); channel2_allocation = stream.get_bits(length); if (crc != null) { @@ -1009,8 +587,7 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - public void read_scalefactor_selection( Bitstream stream, - Crc16 crc) { + public void read_scalefactor_selection(Bitstream stream, Crc16 crc) { if (allocation != 0) { scfsi = stream.get_bits(2); if (crc != null) @@ -1026,7 +603,7 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { /** * */ - public void read_scalefactor( Bitstream stream, Header header) { + public void read_scalefactor(Bitstream stream, Header header) { super.read_scalefactor(stream, header); if (channel2_allocation != 0) { switch (channel2_scfsi) { @@ -1042,8 +619,8 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { break; case 2: - channel2_scalefactor1 = - channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream.get_bits(6)]; + channel2_scalefactor1 = channel2_scalefactor2 = channel2_scalefactor3 = scalefactors[stream + .get_bits(6)]; break; case 3: @@ -1060,19 +637,17 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { * */ // ssjava - public boolean read_sampledata( - Bitstream stream) { - boolean returnvalue = super.read_sampledata(stream); + public boolean read_sampledata(Bitstream stream) { + boolean returnvalue = super.read_sampledata(stream); if (channel2_allocation != 0) if (groupingtable[1] != null) { - int samplecode = - stream.get_bits(channel2_codelength[0]); + int samplecode = stream.get_bits(channel2_codelength[0]); // create requantized samples: samplecode += samplecode << 1; - int tmp = 0; - int temp = samplecode; + int tmp = 0; + int temp = samplecode; channel2_samples[tmp] = groupingtable[1][temp]; temp++; @@ -1083,26 +658,21 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder { channel2_samples[tmp] = groupingtable[1][temp]; } else { - channel2_samples[0] = - (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0); - channel2_samples[1] = - (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0); - channel2_samples[2] = - (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0); + channel2_samples[0] = (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0); + channel2_samples[1] = (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0); + channel2_samples[2] = (float) ((stream.get_bits(channel2_codelength[0])) * channel2_factor[0] - 1.0); } return returnvalue; } // ssjava - public boolean put_next_sample( int channels, SynthesisFilter filter1, - SynthesisFilter filter2) { + public boolean put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2) { - boolean returnvalue = super.put_next_sample(channels, filter1, filter2); + boolean returnvalue = super.put_next_sample(channels, filter1, filter2); if ((channel2_allocation != 0) && (channels != OutputChannels.LEFT_CHANNEL)) { - float sample = - channel2_samples[samplenumber - 1]; + float sample = channel2_samples[samplenumber - 1]; if (groupingtable[1] == null) { sample = (sample + channel2_d[0]) * channel2_c[0]; diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIIDecoder.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIIDecoder.java index ebbf8ec7..d0f217dc 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIIDecoder.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/LayerIIIDecoder.java @@ -37,7 +37,7 @@ * * @since 0.0 */ -// +// // 4th line added for hybrid. // 5th added for stereo // 6th added for reorder method @@ -46,79 +46,73 @@ // 9th added for get_LSF_scale_factors // 10th added for get_scale_factors // llth added for decode -// - +// final class LayerIIIDecoder implements FrameDecoder { static final double d43 = (4.0 / 3.0); - + public int[] scalefac_buffer; // MDM: removed, as this wasn't being used. // private float CheckSumOut1d = 0.0f; - + private int CheckSumHuff = 0; - + private int[] is_1d; - + private float[][][] ro; - + private float[][][] lr; - + private float[] inter; // 576 samples - + private float[] out_1d; // 576 samples - + private float[][] prevblck; - private float[][] k; - + private int[] nonzero; - + private SynthesisFilter filter1; - + private SynthesisFilter filter2; - // + // // private Obuffer buffer; // output buffer - + private int which_channels; - + private BitReserve br; - + private III_side_info_t si; - // private temporaire2[] III_scalefac_t; - + // private temporaire2[] III_scalefac_t; + private final temporaire2[] scalefac; // private III_scalefac_t scalefac; - private int max_gr; - + private int frame_start; - // private int part2_start; - + // private int part2_start; + private final int channels; - + private int first_channel; - + private int last_channel; - + private int sfreq; - private int part2_start; - private boolean initialized = false; - float[][] raw_full; // 18 left shfited since it will be copied into prevblck! // constructor for the linear type system - public LayerIIIDecoder(Header h, @DELEGATE SynthesisFilter filtera, - @DELEGATE SynthesisFilter filterb, int which_ch0) { + public LayerIIIDecoder(Header h, @DELEGATE SynthesisFilter filtera, + @DELEGATE SynthesisFilter filterb, int which_ch0) { filter_pos = 11; raw_full = new float[2][SBLIMIT * SSLIMIT]; @@ -150,44 +144,26 @@ final class LayerIIIDecoder implements FrameDecoder { // L3TABLE INIT sfBandIndex = new SBI[9]; // SZD: MPEG2.5 +3 indices - int[] l0 = - { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, - 464, 522, 576 }; - int[] s0 = { 0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132, 174, 192 }; - int[] l1 = - { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 114, 136, 162, 194, 232, 278, 330, 394, - 464, 540, 576 }; - int[] s1 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136, 180, 192 }; - int[] l2 = - { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, - 464, 522, 576 }; - int[] s2 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192 }; - - int[] l3 = - { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196, 238, 288, 342, - 418, 576 }; - int[] s3 = { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192 }; - int[] l4 = - { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190, 230, 276, 330, - 384, 576 }; - int[] s4 = { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192 }; - int[] l5 = - { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240, 296, 364, 448, - 550, 576 }; - int[] s5 = { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192 }; + int[] l0 = { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576 }; + int[] s0 = { 0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132, 174, 192 }; + int[] l1 = { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 114, 136, 162, 194, 232, 278, 330, 394, 464, 540, 576 }; + int[] s1 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136, 180, 192 }; + int[] l2 = { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576 }; + int[] s2 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192 }; + + int[] l3 = { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196, 238, 288, 342, 418, 576 }; + int[] s3 = { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192 }; + int[] l4 = { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190, 230, 276, 330, 384, 576 }; + int[] s4 = { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192 }; + int[] l5 = { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240, 296, 364, 448, 550, 576 }; + int[] s5 = { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192 }; // SZD: MPEG2.5 - int[] l6 = - { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, - 464, 522, 576 }; - int[] s6 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192 }; - int[] l7 = - { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, - 464, 522, 576 }; - int[] s7 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192 }; - int[] l8 = - { 0, 12, 24, 36, 48, 60, 72, 88, 108, 132, 160, 192, 232, 280, 336, 400, 476, 566, 568, - 570, 572, 574, 576 }; - int[] s8 = { 0, 8, 16, 24, 36, 52, 72, 96, 124, 160, 162, 164, 166, 192 }; + int[] l6 = { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576 }; + int[] s6 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192 }; + int[] l7 = { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576 }; + int[] s7 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192 }; + int[] l8 = { 0, 12, 24, 36, 48, 60, 72, 88, 108, 132, 160, 192, 232, 280, 336, 400, 476, 566, 568, 570, 572, 574, 576 }; + int[] s8 = { 0, 8, 16, 24, 36, 52, 72, 96, 124, 160, 162, 164, 166, 192 }; sfBandIndex[0] = new SBI(l0, s0); sfBandIndex[1] = new SBI(l1, s1); @@ -204,7 +180,7 @@ final class LayerIIIDecoder implements FrameDecoder { if (reorder_table == null) { // SZD: generate LUT reorder_table = new int[9][]; - for ( int i = 0; i < 9; i++) + for (int i = 0; i < 9; i++) reorder_table[i] = reorder(sfBandIndex[i].s); } @@ -215,17 +191,14 @@ final class LayerIIIDecoder implements FrameDecoder { init(h); } - - private void init( Header header) { + private void init(Header header) { frame_start = 0; channels = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2; max_gr = (header.version() == Header.MPEG1) ? 2 : 1; - sfreq = - header.sample_frequency() - + ((header.version() == Header.MPEG1) ? 3 : (header.version() == Header.MPEG25_LSF) ? 6 - : 0); // SZD + sfreq = header.sample_frequency() + ((header.version() == Header.MPEG1) ? 3 + : (header.version() == Header.MPEG25_LSF) ? 6 : 0); // SZD if (channels == 2) { switch (which_channels) { @@ -248,8 +221,8 @@ final class LayerIIIDecoder implements FrameDecoder { first_channel = last_channel = 0; } - for ( int ch = 0; ch < 2; ch++) - for ( int j = 0; j < 576; j++) + for (int ch = 0; ch < 2; ch++) + for (int j = 0; j < 576; j++) prevblck[ch][j] = 0.0f; nonzero[0] = nonzero[1] = 576; @@ -265,10 +238,10 @@ final class LayerIIIDecoder implements FrameDecoder { */ // REVIEW: these constructor arguments should be moved to the // decodeFrame() method, where possible, so that one - // - // public LayerIIIDecoder( Header header0, + // + // public LayerIIIDecoder( Header header0, // SynthesisFilter filtera, - // SynthesisFilter filterb, int which_ch0) { + // SynthesisFilter filterb, int which_ch0) { // // huffcodetab.inithuff(); // is_1d = new int[SBLIMIT * SSLIMIT + 4]; @@ -293,61 +266,61 @@ final class LayerIIIDecoder implements FrameDecoder { // // L3TABLE INIT // // sfBandIndex = new SBI[9]; // SZD: MPEG2.5 +3 indices - // int[] l0 = + // int[] l0 = // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, // 284, 336, 396, // 464, 522, 576 }; - // int[] s0 = { 0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132, + // int[] s0 = { 0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132, // 174, 192 }; - // int[] l1 = + // int[] l1 = // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 114, 136, 162, 194, 232, // 278, 330, 394, // 464, 540, 576 }; - // int[] s1 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136, + // int[] s1 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136, // 180, 192 }; - // int[] l2 = + // int[] l2 = // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, // 284, 336, 396, // 464, 522, 576 }; - // int[] s2 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, + // int[] s2 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, // 174, 192 }; // - // int[] l3 = + // int[] l3 = // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196, // 238, 288, 342, // 418, 576 }; - // int[] s3 = { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, + // int[] s3 = { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, // 192 }; - // int[] l4 = + // int[] l4 = // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190, // 230, 276, 330, // 384, 576 }; - // int[] s4 = { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, + // int[] s4 = { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, // 192 }; - // int[] l5 = + // int[] l5 = // { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240, // 296, 364, 448, // 550, 576 }; - // int[] s5 = { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, + // int[] s5 = { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, // 180, 192 }; // // SZD: MPEG2.5 - // int[] l6 = + // int[] l6 = // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, // 284, 336, 396, // 464, 522, 576 }; - // int[] s6 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, + // int[] s6 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, // 174, 192 }; - // int[] l7 = + // int[] l7 = // { 0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, // 284, 336, 396, // 464, 522, 576 }; - // int[] s7 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, + // int[] s7 = { 0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, // 174, 192 }; - // int[] l8 = + // int[] l8 = // { 0, 12, 24, 36, 48, 60, 72, 88, 108, 132, 160, 192, 232, 280, 336, 400, // 476, 566, 568, // 570, 572, 574, 576 }; - // int[] s8 = { 0, 8, 16, 24, 36, 52, 72, 96, 124, 160, 162, 164, + // int[] s8 = { 0, 8, 16, 24, 36, 52, 72, 96, 124, 160, 162, 164, // 166, 192 }; // // sfBandIndex[0] = new SBI(l0, s0); @@ -370,8 +343,8 @@ final class LayerIIIDecoder implements FrameDecoder { // } // // // Sftable - // int[] ll0 = { 0, 6, 11, 16, 21 }; - // int[] ss0 = { 0, 6, 12 }; + // int[] ll0 = { 0, 6, 11, 16, 21 }; + // int[] ss0 = { 0, 6, 12 }; // sftable = new Sftable(ll0, ss0); // // END OF Sftable // @@ -429,16 +402,16 @@ final class LayerIIIDecoder implements FrameDecoder { /** * Notify decoder that a seek is being made. */ - + public void seek_notify() { frame_start = 0; - for ( int ch = 0; ch < 2; ch++) - for ( int j = 0; j < 576; j++) + for (int ch = 0; ch < 2; ch++) + for (int j = 0; j < 576; j++) prevblck[ch][j] = 0.0f; br = new BitReserve(); } - public void decodeFrame( Header header) { + public void decodeFrame(Header header) { decode(header); } @@ -448,11 +421,11 @@ final class LayerIIIDecoder implements FrameDecoder { // subband samples are buffered and passed to the // SynthesisFilter in one go. - + private float[] samples1 = new float[32]; - + private float[] samples2 = new float[32]; - + private int filter_pos; /* @@ -462,9 +435,9 @@ final class LayerIIIDecoder implements FrameDecoder { * {part2_start} {sb18, ss} {out_1d}* {sb}* {samples1,sample2} * {filter1,filter2} */ - // - - public void decode( Header header) { + // + + public void decode(Header header) { // if (!initialized) { // init(header); @@ -493,26 +466,26 @@ final class LayerIIIDecoder implements FrameDecoder { si = new III_side_info_t(); // - int nSlots = header.slots(); + int nSlots = header.slots(); - int gr; - int ch; + int gr; + int ch; - int ss; - int sb; - int sb18; + int ss; + int sb; + int sb18; - int main_data_end; - int flush_main; + int main_data_end; + int flush_main; - int bytes_to_discard; - int i; + int bytes_to_discard; + int i; // modifications for linear type get_side_info(header); br = header.getBitReserve(); - int version = header.version(); + int version = header.version(); // additional codes for the definitely written property filter_pos = (header.getIdx() * 4) & 0xf; @@ -528,7 +501,7 @@ final class LayerIIIDecoder implements FrameDecoder { // 'ch', 'channels' should be higher than all locs in the below body for (ch = 0; ch < channels; ch++) { // part2_start = br.hsstell(); - int part2_start_local = br.hsstell(); + int part2_start_local = br.hsstell(); // grab scale factors from the main data. // following the scale factors is the actual compressed data @@ -567,7 +540,7 @@ final class LayerIIIDecoder implements FrameDecoder { // } // System.out.println("CheckSumOut1d = "+CheckSumOut1d); - for ( int index = 0; index < 576; index++) { + for (int index = 0; index < 576; index++) { out_1d[index] = inter[index]; } @@ -669,15 +642,14 @@ final class LayerIIIDecoder implements FrameDecoder { * Reads the side info from the stream, assuming the entire. frame has been * read already. Mono : 136 bits (= 17 bytes) Stereo : 256 bits (= 32 bytes) */ - - private boolean get_side_info( Header header) { - SideInfoBuffer sib = - header.getSideInfoBuffer(); - int version = header.version(); + private boolean get_side_info(Header header) { - int ch; - int gr; + SideInfoBuffer sib = header.getSideInfoBuffer(); + int version = header.version(); + + int ch; + int gr; // System.out.println("#get_side_info"); if (version == Header.MPEG1) { @@ -704,7 +676,7 @@ final class LayerIIIDecoder implements FrameDecoder { si.ch[ch].gr[gr].big_values = sib.get_bits(9); si.ch[ch].gr[gr].global_gain = sib.get_bits(8); si.ch[ch].gr[gr].scalefac_compress = sib.get_bits(4); - int cond = sib.get_bits(1); + int cond = sib.get_bits(1); // si.ch[ch].gr[gr].window_switching_flag = sib.get_bits(1); // if ((si.ch[ch].gr[gr].window_switching_flag) != 0) { if (cond != 0) { @@ -762,7 +734,7 @@ final class LayerIIIDecoder implements FrameDecoder { si.ch[ch].gr[0].global_gain = sib.get_bits(8); si.ch[ch].gr[0].scalefac_compress = sib.get_bits(9); - int cond = sib.get_bits(1); + int cond = sib.get_bits(1); // si.ch[ch].gr[0].window_switching_flag = sib.get_bits(1); // if ((si.ch[ch].gr[0].window_switching_flag) != 0) { if (cond != 0) { @@ -811,17 +783,16 @@ final class LayerIIIDecoder implements FrameDecoder { /** * */ - - private void get_scale_factors( Header header, - int ch, int gr) { + + private void get_scale_factors(Header header, int ch, int gr) { // gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias - int sfb; - int window; - int scale_comp = si.ch[ch].gr[gr].scalefac_compress; - int length0 = slen[0][scale_comp]; - int length1 = slen[1][scale_comp]; + int sfb; + int window; + int scale_comp = si.ch[ch].gr[gr].scalefac_compress; + int length0 = slen[0][scale_comp]; + int length1 = slen[1][scale_comp]; 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) { // MIXED @@ -921,26 +892,23 @@ final class LayerIIIDecoder implements FrameDecoder { */ // MDM: new_slen is fully initialized before use, no need // to reallocate array. - + private int[] new_slen = new int[4]; // ssjava - - private void get_LSF_scale_data( Header header, - int ch, int gr) { - int mode_ext = header.mode_extension(); - // gr_info_s gr_info = + private void get_LSF_scale_data(Header header, int ch, int gr) { + + int mode_ext = header.mode_extension(); + // gr_info_s gr_info = // (si.ch[ch].gr[gr]); // remove alias - int scalefac_comp = - si.ch[ch].gr[gr].scalefac_compress; - int blocktypenumber; + int scalefac_comp = si.ch[ch].gr[gr].scalefac_compress; + int blocktypenumber; - int int_scalefac_comp; - int m; - int blocknumber = - 0; + int int_scalefac_comp; + int m; + int blocknumber = 0; if (si.ch[ch].gr[gr].block_type == 2) { if (si.ch[ch].gr[gr].mixed_block_flag == 0) { @@ -1017,9 +985,9 @@ final class LayerIIIDecoder implements FrameDecoder { // scalefac_buffer[x] = 0; m = 0; - for ( int i = 0; i < 4; i++) { - int jmax = nr_of_sfb_block[blocknumber][blocktypenumber][i]; - for ( int j = 0; j < jmax; j++) { + for (int i = 0; i < 4; i++) { + int jmax = nr_of_sfb_block[blocknumber][blocktypenumber][i]; + for (int j = 0; j < jmax; j++) { scalefac_buffer[m] = (new_slen[i] == 0) ? 0 : br.hgetbits(new_slen[i]); m++; @@ -1030,13 +998,12 @@ final class LayerIIIDecoder implements FrameDecoder { /** * */ - - private void get_LSF_scale_factors( Header header, - int ch, int gr) { - int sfb; - int m = 0; - int window; + private void get_LSF_scale_factors(Header header, int ch, int gr) { + + int sfb; + int m = 0; + int window; // gr_info_s gr_info = (si.ch[ch].gr[gr]); // remove alias get_LSF_scale_data(header, ch, gr); @@ -1082,41 +1049,38 @@ final class LayerIIIDecoder implements FrameDecoder { /** * */ - // + // // int[] x = { 0 }; - // + // // int[] y = { 0 }; - // + // // int[] v = { 0 }; - // + // // int[] w = { 0 }; - // + // // int x[] = { 0 }; - // + // // int y[] = { 0 }; - // + // // int v[] = { 0 }; - // + // // int w[] = { 0 }; - - private void huffman_decode( int part2_start_local, - int ch, int gr) { + private void huffman_decode(int part2_start_local, int ch, int gr) { - int x[] = new int[1]; - int y[] = new int[1]; - int v[] = new int[1]; - int w[] = new int[1]; + int x[] = new int[1]; + int y[] = new int[1]; + int v[] = new int[1]; + int w[] = new int[1]; - int part2_3_end = - part2_start_local + si.ch[ch].gr[gr].part2_3_length; - int num_bits; - int region1Start; - int region2Start; - int index; + int part2_3_end = part2_start_local + si.ch[ch].gr[gr].part2_3_length; + int num_bits; + int region1Start; + int region2Start; + int index; - int buf; - int buf1; + int buf; + int buf1; // Find region boundary for short block case @@ -1142,10 +1106,9 @@ final class LayerIIIDecoder implements FrameDecoder { index = 0; // Read bigvalues area - TERMINATE: for ( int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i += - 2) { + TERMINATE: for (int i = 0; i < (si.ch[ch].gr[gr].big_values << 1); i += 2) { - int htIdx; + int htIdx; if (i < region1Start) { htIdx = si.ch[ch].gr[gr].table_select[0]; // h = huffcodetab.ht[si.ch[ch].gr[gr].table_select[0]]; @@ -1170,7 +1133,7 @@ final class LayerIIIDecoder implements FrameDecoder { // Read count1 area - int htIdx = si.ch[ch].gr[gr].count1table_select + 32; + int htIdx = si.ch[ch].gr[gr].count1table_select + 32; // h = huffcodetab.ht[si.ch[ch].gr[gr].count1table_select + 32]; num_bits = br.hsstell(); @@ -1214,8 +1177,7 @@ final class LayerIIIDecoder implements FrameDecoder { is_1d[index] = 0; } - - private int huffcodetab_huffman_decoder( int h) { + private int huffcodetab_huffman_decoder(int h) { // TODO need to move huffmancodetab implementation here return 0; } @@ -1223,8 +1185,7 @@ final class LayerIIIDecoder implements FrameDecoder { /** * */ - private void i_stereo_k_values( int is_pos, - int io_type, int i) { + private void i_stereo_k_values(int is_pos, int io_type, int i) { if (is_pos == 0) { k[0][i] = 1.0f; k[1][i] = 1.0f; @@ -1240,24 +1201,23 @@ final class LayerIIIDecoder implements FrameDecoder { /** * */ - // - + // + // ssjava private void dequantize_sample( - /* float xr[][], */ int ch, - int gr) { + /* float xr[][], */int ch, int gr) { - // gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias! - int cb = 0; + // gr_info_s gr_info = (si.ch[ch].gr[gr]); remove alias! + int cb = 0; - int next_cb_boundary; - int cb_begin = 0; - int cb_width = 0; - float g_gain; + int next_cb_boundary; + int cb_begin = 0; + int cb_width = 0; + float g_gain; - int index = 0; - int t_index; - int j; + int index = 0; + int t_index; + int j; // float[][] xr_1d = xr;//substituted xr for instances of xr_1d to decrease // number of areas @@ -1282,12 +1242,12 @@ final class LayerIIIDecoder implements FrameDecoder { for (j = 0; j < nonzero[ch]; j++) { // Modif E.B 02/22/99 - int reste = j % SSLIMIT; - int quotien = (int) ((j - reste) / SSLIMIT); + int reste = j % SSLIMIT; + int quotien = (int) ((j - reste) / SSLIMIT); if (is_1d[j] == 0) { ro[ch][quotien][reste] = 0.0f; } else { - int abv = is_1d[j]; + int abv = is_1d[j]; // Pow Array fix (11/17/04) if (abv < t_43.length) { if (is_1d[j] > 0) @@ -1310,8 +1270,8 @@ final class LayerIIIDecoder implements FrameDecoder { // apply formula per block type for (j = 0; j < nonzero[ch]; j++) { // Modif E.B 02/22/99 - int reste = j % SSLIMIT; - int quotien = (int) ((j - reste) / SSLIMIT); + int reste = j % SSLIMIT; + int quotien = (int) ((j - reste) / SSLIMIT); if (index == next_cb_boundary) { /* Adjust critical band boundary */ if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) { @@ -1359,17 +1319,14 @@ final class LayerIIIDecoder implements FrameDecoder { // Do long/short dependent scaling operations - 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)))) { + 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]))); */ - int idx = - scalefac[ch].s[t_index][cb] << si.ch[ch].gr[gr].scalefac_scale; + 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]; @@ -1379,7 +1336,7 @@ 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])); */ - int idx = scalefac[ch].l[cb]; + int idx = scalefac[ch].l[cb]; if (si.ch[ch].gr[gr].preflag != 0) idx += pretab[cb]; @@ -1392,8 +1349,8 @@ final class LayerIIIDecoder implements FrameDecoder { for (j = nonzero[ch]; j < 576; j++) { // Modif E.B 02/22/99 - int reste = j % SSLIMIT; - int quotien = (int) ((j - reste) / SSLIMIT); + int reste = j % SSLIMIT; + int quotien = (int) ((j - reste) / SSLIMIT); if (reste < 0) reste = 0; if (quotien < 0) @@ -1408,10 +1365,9 @@ final class LayerIIIDecoder implements FrameDecoder { * */ // ssjava - // - - private void reorder(/* float xr[][], */ int ch, - int gr) { + // + + private void reorder(/* float xr[][], */int ch, int gr) { // the purpose of reordering: move 'short samples' back to their original // position // after reorder, the samples are no long ordered by frequency @@ -1422,15 +1378,15 @@ final class LayerIIIDecoder implements FrameDecoder { // gr_info_s gr_info = (si.ch[ch].gr[gr]); //remove alias - int index; + int index; - int freq; - int freq3; - int sfb; - int sfb_start; - int sfb_lines; - int src_line; - int des_line; + int freq; + int freq3; + int sfb; + int sfb_start; + int sfb_lines; + int src_line; + int des_line; // float[][] xr_1d = xr; subbed in xr for xr_1d so as not to create extra // areas @@ -1444,8 +1400,8 @@ final class LayerIIIDecoder implements FrameDecoder { // NO REORDER FOR LOW 2 SUBBANDS for (index = 0; index < 36; index++) { // Modif E.B 02/22/99 - int reste = index % SSLIMIT; - int quotien = (int) ((index - reste) / SSLIMIT); + int reste = index % SSLIMIT; + int quotien = (int) ((index - reste) / SSLIMIT); inter[index] = lr[ch][quotien][reste]; } // REORDERING FOR REST SWITCHED SHORT @@ -1460,15 +1416,15 @@ final class LayerIIIDecoder implements FrameDecoder { sfb_start = sfBandIndex[sfreq].s[sfb]; sfb_lines = sfBandIndex[sfreq].s[sfb + 1] - sfb_start; - int sfb_start3 = (sfb_start << 2) - sfb_start; + int sfb_start3 = (sfb_start << 2) - sfb_start; for (freq = 0, freq3 = 0; freq < sfb_lines; freq++, freq3 += 3) { src_line = sfb_start3 + freq; des_line = sfb_start3 + freq3; // Modif E.B 02/22/99 - int reste = src_line % SSLIMIT; - int quotien = (int) ((src_line - reste) / SSLIMIT); + int reste = src_line % SSLIMIT; + int quotien = (int) ((src_line - reste) / SSLIMIT); inter[des_line] = lr[ch][quotien][reste]; src_line += sfb_lines; @@ -1490,17 +1446,17 @@ final class LayerIIIDecoder implements FrameDecoder { } else { // pure short for (index = 0; index < 576; index++) { - int j = reorder_table[sfreq][index]; - int reste = j % SSLIMIT; - int quotien = (int) ((j - reste) / SSLIMIT); + int j = reorder_table[sfreq][index]; + int reste = j % SSLIMIT; + int quotien = (int) ((j - reste) / SSLIMIT); inter[index] = lr[ch][quotien][reste]; } } } else { // long blocks for (index = 0; index < 576; index++) { // Modif E.B 02/22/99 - int reste = index % SSLIMIT; - int quotien = (int) ((index - reste) / SSLIMIT); + int reste = index % SSLIMIT; + int quotien = (int) ((index - reste) / SSLIMIT); inter[index] = lr[ch][quotien][reste]; } } @@ -1510,17 +1466,15 @@ final class LayerIIIDecoder implements FrameDecoder { * */ - int[] is_pos = new int[576]; - + float[] is_ratio = new float[576]; // ssjava - - private void stereo( Header header, - int gr) { - int sb; - int ss; + + private void stereo(Header header, int gr) { + int sb; + int ss; if (channels == 1) { // mono , bypass xr[0][][] to lr[0][][] @@ -1534,22 +1488,19 @@ final class LayerIIIDecoder implements FrameDecoder { } else { // gr_info_s gr_info = (si.ch[0].gr[gr]); remove alias - int mode_ext = header.mode_extension(); + int mode_ext = header.mode_extension(); - int sfb; - int i; - int lines; - int temp; - int temp2; + int sfb; + int i; + int lines; + int temp; + int temp2; - boolean ms_stereo = - ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x2) != 0)); - boolean i_stereo = - ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x1) != 0)); - boolean lsf = - ((header.version() == Header.MPEG2_LSF || header.version() == Header.MPEG25_LSF)); // SZD + boolean ms_stereo = ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x2) != 0)); + boolean i_stereo = ((header.mode() == Header.JOINT_STEREO) && ((mode_ext & 0x1) != 0)); + boolean lsf = ((header.version() == Header.MPEG2_LSF || header.version() == Header.MPEG25_LSF)); // SZD - int io_type = (si.ch[0].gr[gr].scalefac_compress & 1); + int io_type = (si.ch[0].gr[gr].scalefac_compress & 1); // initialization // for (i = 0; i < 576; i++) { @@ -1561,10 +1512,10 @@ final class LayerIIIDecoder implements FrameDecoder { if ((si.ch[0].gr[gr].window_switching_flag != 0) && (si.ch[0].gr[gr].block_type == 2)) { if (si.ch[0].gr[gr].mixed_block_flag != 0) { - int max_sfb = 0; + int max_sfb = 0; - for ( int j = 0; j < 3; j++) { - int sfbcnt; + for (int j = 0; j < 3; j++) { + int sfbcnt; sfbcnt = 2; TERMINATE: for (sfb = 12; sfb >= 3; sfb--) { i = sfBandIndex[sfreq].s[sfb]; @@ -1661,8 +1612,8 @@ final class LayerIIIDecoder implements FrameDecoder { } // for (; sfb<8 ... } // for (j=0 ... } else { // if (gr_info.mixed_block_flag) - for ( int j = 0; j < 3; j++) { - int sfbcnt; + for (int j = 0; j < 3; j++) { + int sfbcnt; sfbcnt = -1; TERMINATE: for (sfb = 12; sfb >= 0; sfb--) { temp = sfBandIndex[sfreq].s[sfb]; @@ -1801,27 +1752,24 @@ final class LayerIIIDecoder implements FrameDecoder { /** * */ - // - - private void antialias( int ch, - int gr) { + // + + private void antialias(int ch, int gr) { - int sb18; - int ss; - int sb18lim; + int sb18; + int ss; + int sb18lim; - // + // // gr_info_s gr_info = // (si.ch[ch].gr[gr]); // 31 alias-reduction operations between each pair of sub-bands // with 8 butterflies between each pair - 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)) + 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)) return; - if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0) - && (si.ch[ch].gr[gr].block_type == 2)) { + if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0) && (si.ch[ch].gr[gr].block_type == 2)) { sb18lim = 18; } else { sb18lim = 558; @@ -1829,10 +1777,10 @@ final class LayerIIIDecoder implements FrameDecoder { for (sb18 = 0; sb18 < sb18lim; sb18 += 18) { for (ss = 0; ss < 8; ss++) { - int src_idx1 = sb18 + 17 - ss; - int src_idx2 = sb18 + 18 + ss; - float bu = inter[src_idx1]; - float bd = inter[src_idx2]; + int src_idx1 = sb18 + 17 - ss; + int src_idx2 = sb18 + 18 + ss; + float bu = inter[src_idx1]; + float bd = inter[src_idx2]; inter[src_idx1] = (bu * cs[ss]) - (bd * ca[ss]); inter[src_idx2] = (bd * cs[ss]) + (bu * ca[ss]); } @@ -1845,24 +1793,22 @@ final class LayerIIIDecoder implements FrameDecoder { // MDM: tsOutCopy and rawout do not need initializing, so the arrays // can be reused. - + float[] tsOutCopy = new float[18]; - + float[] rawout = new float[36]; - - private void hybrid( int ch, int gr) { + private void hybrid(int ch, int gr) { - int bt; - int sb18; + int bt; + int sb18; // gr_info_s gr_info = (si.ch[ch].gr[gr]); //remove alias - // float[] tsOut; //remove alias + // float[] tsOut; //remove alias // float[][] prvblk; for (sb18 = 0; sb18 < 576; sb18 += 18) { - if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0) - && (sb18 < 36)) { + if ((si.ch[ch].gr[gr].window_switching_flag != 0) && (si.ch[ch].gr[gr].mixed_block_flag != 0) && (sb18 < 36)) { bt = 0; } else { bt = si.ch[ch].gr[gr].block_type; @@ -1870,14 +1816,14 @@ final class LayerIIIDecoder implements FrameDecoder { // tsOut = out_1d; // Modif E.B 02/22/99 - for ( int cc = 0; cc < 18; cc++) { + for (int cc = 0; cc < 18; cc++) { // tsOutCopy[cc] = out_1d[cc + sb18]; tsOutCopy[cc] = inter[cc + sb18]; } inv_mdct(bt); - for ( int cc = 0; cc < 18; cc++) { + for (int cc = 0; cc < 18; cc++) { out_1d[cc + sb18] = tsOutCopy[cc]; } @@ -1966,8 +1912,8 @@ final class LayerIIIDecoder implements FrameDecoder { * */ private void do_downmix() { - for ( int sb = 0; sb < SSLIMIT; sb++) { - for ( int ss = 0; ss < SSLIMIT; ss += 3) { + for (int sb = 0; sb < SSLIMIT; sb++) { + for (int ss = 0; ss < SSLIMIT; ss += 3) { lr[0][sb][ss] = (lr[0][sb][ss] + lr[1][sb][ss]) * 0.5f; lr[0][sb][ss + 1] = (lr[0][sb][ss + 1] + lr[1][sb][ss + 1]) * 0.5f; lr[0][sb][ss + 2] = (lr[0][sb][ss + 2] + lr[1][sb][ss + 2]) * 0.5f; @@ -1978,50 +1924,35 @@ final class LayerIIIDecoder implements FrameDecoder { /** * Fast INV_MDCT. */ - // - // public void inv_mdct( float[] in, float[] out, - // int block_type) {//remove alias + // + // public void inv_mdct( float[] in, float[] out, + // int block_type) {//remove alias // ssjava - - public void inv_mdct( int block_type) { + + public void inv_mdct(int block_type) { // float[] win_bt; - int i; - - float tmpf_0; - float tmpf_1; - float tmpf_2; - float tmpf_3; - float tmpf_4; - float tmpf_5; - float tmpf_6; - float tmpf_7; - float tmpf_8; - float tmpf_9; - float tmpf_10; - float tmpf_11; - float tmpf_12; - float tmpf_13; - float tmpf_14; - float tmpf_15; - float tmpf_16; - float tmpf_17; - - tmpf_0 = - tmpf_1 = - tmpf_2 = - tmpf_3 = - tmpf_4 = - tmpf_5 = - tmpf_6 = - tmpf_7 = - tmpf_8 = - tmpf_9 = - tmpf_10 = - tmpf_11 = - tmpf_12 = - tmpf_13 = - tmpf_14 = - tmpf_15 = tmpf_16 = tmpf_17 = 0.0f; + int i; + + float tmpf_0; + float tmpf_1; + float tmpf_2; + float tmpf_3; + float tmpf_4; + float tmpf_5; + float tmpf_6; + float tmpf_7; + float tmpf_8; + float tmpf_9; + float tmpf_10; + float tmpf_11; + float tmpf_12; + float tmpf_13; + float tmpf_14; + float tmpf_15; + float tmpf_16; + float tmpf_17; + + tmpf_0 = tmpf_1 = tmpf_2 = tmpf_3 = tmpf_4 = tmpf_5 = tmpf_6 = tmpf_7 = tmpf_8 = tmpf_9 = tmpf_10 = tmpf_11 = tmpf_12 = tmpf_13 = tmpf_14 = tmpf_15 = tmpf_16 = tmpf_17 = 0.0f; if (block_type == 2) { @@ -2069,7 +2000,7 @@ final class LayerIIIDecoder implements FrameDecoder { rawout[34] = 0.0f; rawout[35] = 0.0f; - int six_i = 0; + int six_i = 0; for (i = 0; i < 3; i++) { // 12 point IMDCT @@ -2086,9 +2017,9 @@ final class LayerIIIDecoder implements FrameDecoder { tsOutCopy[9 + i] += tsOutCopy[3 + i]; // 3 point IDCT on even indices - float pp1; - float pp2; - float sum; + float pp1; + float pp2; + float sum; pp2 = tsOutCopy[12 + i] * 0.500000000f; pp1 = tsOutCopy[6 + i] * 0.866025403f; sum = tsOutCopy[0 + i] + pp2; @@ -2112,7 +2043,7 @@ final class LayerIIIDecoder implements FrameDecoder { tmpf_5 *= 0.517638090f; // Output butterflies on 2 3 point IDCT's (for 6 point IDCT) - float save = tmpf_0; + float save = tmpf_0; tmpf_0 += tmpf_5; tmpf_5 = save - tmpf_5; save = tmpf_1; @@ -2199,24 +2130,24 @@ final class LayerIIIDecoder implements FrameDecoder { tsOutCopy[5] += tsOutCopy[3]; tsOutCopy[3] += tsOutCopy[1]; - float tmp0; - float tmp1; - float tmp2; - float tmp3; - float tmp4; - float tmp0_; - float tmp1_; - float tmp2_; - float tmp3_; - float tmp0o; - float tmp1o; - float tmp2o; - float tmp3o; - float tmp4o; - float tmp0_o; - float tmp1_o; - float tmp2_o; - float tmp3_o; + float tmp0; + float tmp1; + float tmp2; + float tmp3; + float tmp4; + float tmp0_; + float tmp1_; + float tmp2_; + float tmp3_; + float tmp0o; + float tmp1o; + float tmp2o; + float tmp3o; + float tmp4o; + float tmp0_o; + float tmp1_o; + float tmp2_o; + float tmp3_o; // Fast 9 Point Inverse Discrete Cosine Transform // @@ -2233,68 +2164,41 @@ final class LayerIIIDecoder implements FrameDecoder { // 9 point IDCT on even indices // 5 points on odd indices (not realy an IDCT) - float i00 = tsOutCopy[0] + tsOutCopy[0]; - float iip12 = i00 + tsOutCopy[12]; + float i00 = tsOutCopy[0] + tsOutCopy[0]; + float iip12 = i00 + tsOutCopy[12]; - tmp0 = - iip12 + tsOutCopy[4] * 1.8793852415718f + tsOutCopy[8] * 1.532088886238f + tsOutCopy[16] - * 0.34729635533386f; + tmp0 = iip12 + tsOutCopy[4] * 1.8793852415718f + tsOutCopy[8] * 1.532088886238f + tsOutCopy[16] * 0.34729635533386f; tmp1 = i00 + tsOutCopy[4] - tsOutCopy[8] - tsOutCopy[12] - tsOutCopy[12] - tsOutCopy[16]; - tmp2 = - iip12 - tsOutCopy[4] * 0.34729635533386f - tsOutCopy[8] * 1.8793852415718f - + tsOutCopy[16] * 1.532088886238f; - tmp3 = - iip12 - tsOutCopy[4] * 1.532088886238f + tsOutCopy[8] * 0.34729635533386f - tsOutCopy[16] - * 1.8793852415718f; + tmp2 = iip12 - tsOutCopy[4] * 0.34729635533386f - tsOutCopy[8] * 1.8793852415718f + tsOutCopy[16] * 1.532088886238f; + tmp3 = iip12 - tsOutCopy[4] * 1.532088886238f + tsOutCopy[8] * 0.34729635533386f - tsOutCopy[16] * 1.8793852415718f; tmp4 = tsOutCopy[0] - tsOutCopy[4] + tsOutCopy[8] - tsOutCopy[12] + tsOutCopy[16]; // 4 points on even indices - float i66_ = tsOutCopy[6] * 1.732050808f; // Sqrt[3] + float i66_ = tsOutCopy[6] * 1.732050808f; // Sqrt[3] - tmp0_ = - tsOutCopy[2] * 1.9696155060244f + i66_ + tsOutCopy[10] * 1.2855752193731f + tsOutCopy[14] - * 0.68404028665134f; + tmp0_ = tsOutCopy[2] * 1.9696155060244f + i66_ + tsOutCopy[10] * 1.2855752193731f + tsOutCopy[14] * 0.68404028665134f; tmp1_ = (tsOutCopy[2] - tsOutCopy[10] - tsOutCopy[14]) * 1.732050808f; - tmp2_ = - tsOutCopy[2] * 1.2855752193731f - i66_ - tsOutCopy[10] * 0.68404028665134f - + tsOutCopy[14] * 1.9696155060244f; - tmp3_ = - tsOutCopy[2] * 0.68404028665134f - i66_ + tsOutCopy[10] * 1.9696155060244f - - tsOutCopy[14] * 1.2855752193731f; + tmp2_ = tsOutCopy[2] * 1.2855752193731f - i66_ - tsOutCopy[10] * 0.68404028665134f + tsOutCopy[14] * 1.9696155060244f; + tmp3_ = tsOutCopy[2] * 0.68404028665134f - i66_ + tsOutCopy[10] * 1.9696155060244f - tsOutCopy[14] * 1.2855752193731f; // 9 point IDCT on odd indices // 5 points on odd indices (not realy an IDCT) - float i0 = tsOutCopy[0 + 1] + tsOutCopy[0 + 1]; - float i0p12 = i0 + tsOutCopy[12 + 1]; - - tmp0o = - i0p12 + tsOutCopy[4 + 1] * 1.8793852415718f + tsOutCopy[8 + 1] * 1.532088886238f - + tsOutCopy[16 + 1] * 0.34729635533386f; - tmp1o = - i0 + tsOutCopy[4 + 1] - tsOutCopy[8 + 1] - tsOutCopy[12 + 1] - tsOutCopy[12 + 1] - - tsOutCopy[16 + 1]; - tmp2o = - i0p12 - tsOutCopy[4 + 1] * 0.34729635533386f - tsOutCopy[8 + 1] * 1.8793852415718f - + tsOutCopy[16 + 1] * 1.532088886238f; - tmp3o = - i0p12 - tsOutCopy[4 + 1] * 1.532088886238f + tsOutCopy[8 + 1] * 0.34729635533386f - - tsOutCopy[16 + 1] * 1.8793852415718f; - tmp4o = - (tsOutCopy[0 + 1] - tsOutCopy[4 + 1] + tsOutCopy[8 + 1] - tsOutCopy[12 + 1] + tsOutCopy[16 + 1]) * 0.707106781f; // Twiddled + float i0 = tsOutCopy[0 + 1] + tsOutCopy[0 + 1]; + float i0p12 = i0 + tsOutCopy[12 + 1]; + + tmp0o = i0p12 + tsOutCopy[4 + 1] * 1.8793852415718f + tsOutCopy[8 + 1] * 1.532088886238f + tsOutCopy[16 + 1] * 0.34729635533386f; + tmp1o = i0 + tsOutCopy[4 + 1] - tsOutCopy[8 + 1] - tsOutCopy[12 + 1] - tsOutCopy[12 + 1] - tsOutCopy[16 + 1]; + tmp2o = i0p12 - tsOutCopy[4 + 1] * 0.34729635533386f - tsOutCopy[8 + 1] * 1.8793852415718f + tsOutCopy[16 + 1] * 1.532088886238f; + tmp3o = i0p12 - tsOutCopy[4 + 1] * 1.532088886238f + tsOutCopy[8 + 1] * 0.34729635533386f - tsOutCopy[16 + 1] * 1.8793852415718f; + tmp4o = (tsOutCopy[0 + 1] - tsOutCopy[4 + 1] + tsOutCopy[8 + 1] - tsOutCopy[12 + 1] + tsOutCopy[16 + 1]) * 0.707106781f; // Twiddled // 4 points on even indices - float i6_ = tsOutCopy[6 + 1] * 1.732050808f; // Sqrt[3] + float i6_ = tsOutCopy[6 + 1] * 1.732050808f; // Sqrt[3] - tmp0_o = - tsOutCopy[2 + 1] * 1.9696155060244f + i6_ + tsOutCopy[10 + 1] * 1.2855752193731f - + tsOutCopy[14 + 1] * 0.68404028665134f; + tmp0_o = tsOutCopy[2 + 1] * 1.9696155060244f + i6_ + tsOutCopy[10 + 1] * 1.2855752193731f + tsOutCopy[14 + 1] * 0.68404028665134f; tmp1_o = (tsOutCopy[2 + 1] - tsOutCopy[10 + 1] - tsOutCopy[14 + 1]) * 1.732050808f; - tmp2_o = - tsOutCopy[2 + 1] * 1.2855752193731f - i6_ - tsOutCopy[10 + 1] * 0.68404028665134f - + tsOutCopy[14 + 1] * 1.9696155060244f; - tmp3_o = - tsOutCopy[2 + 1] * 0.68404028665134f - i6_ + tsOutCopy[10 + 1] * 1.9696155060244f - - tsOutCopy[14 + 1] * 1.2855752193731f; + tmp2_o = tsOutCopy[2 + 1] * 1.2855752193731f - i6_ - tsOutCopy[10 + 1] * 0.68404028665134f + tsOutCopy[14 + 1] * 1.9696155060244f; + tmp3_o = tsOutCopy[2 + 1] * 0.68404028665134f - i6_ + tsOutCopy[10 + 1] * 1.9696155060244f - tsOutCopy[14 + 1] * 1.2855752193731f; // Twiddle factors on odd indices // and @@ -2302,8 +2206,8 @@ final class LayerIIIDecoder implements FrameDecoder { // and // twiddle factors for 36 point IDCT - float e; - float o; + float e; + float o; e = tmp0 + tmp0_; o = (tmp0o + tmp0_o) * 0.501909918f; tmpf_0 = e + o; @@ -2384,7 +2288,6 @@ final class LayerIIIDecoder implements FrameDecoder { } - private int counter = 0; private static final int SSLIMIT = 18; private static final int SBLIMIT = 32; @@ -2393,67 +2296,29 @@ final class LayerIIIDecoder implements FrameDecoder { // This may be adjusted for performance without any problems. // public static final int POW_TABLE_LIMIT=512; - private static final int slen[][] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, - { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 } }; + private static final int slen[][] = { { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 } }; - 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 }; + 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 }; - private SBI[] sfBandIndex; // Init in the constructor. - public static final float two_to_negative_half_pow[] = { 1.0000000000E+00f, 7.0710678119E-01f, - 5.0000000000E-01f, 3.5355339059E-01f, 2.5000000000E-01f, 1.7677669530E-01f, - 1.2500000000E-01f, 8.8388347648E-02f, 6.2500000000E-02f, 4.4194173824E-02f, - 3.1250000000E-02f, 2.2097086912E-02f, 1.5625000000E-02f, 1.1048543456E-02f, - 7.8125000000E-03f, 5.5242717280E-03f, 3.9062500000E-03f, 2.7621358640E-03f, - 1.9531250000E-03f, 1.3810679320E-03f, 9.7656250000E-04f, 6.9053396600E-04f, - 4.8828125000E-04f, 3.4526698300E-04f, 2.4414062500E-04f, 1.7263349150E-04f, - 1.2207031250E-04f, 8.6316745750E-05f, 6.1035156250E-05f, 4.3158372875E-05f, - 3.0517578125E-05f, 2.1579186438E-05f, 1.5258789062E-05f, 1.0789593219E-05f, - 7.6293945312E-06f, 5.3947966094E-06f, 3.8146972656E-06f, 2.6973983047E-06f, - 1.9073486328E-06f, 1.3486991523E-06f, 9.5367431641E-07f, 6.7434957617E-07f, - 4.7683715820E-07f, 3.3717478809E-07f, 2.3841857910E-07f, 1.6858739404E-07f, - 1.1920928955E-07f, 8.4293697022E-08f, 5.9604644775E-08f, 4.2146848511E-08f, - 2.9802322388E-08f, 2.1073424255E-08f, 1.4901161194E-08f, 1.0536712128E-08f, - 7.4505805969E-09f, 5.2683560639E-09f, 3.7252902985E-09f, 2.6341780319E-09f, - 1.8626451492E-09f, 1.3170890160E-09f, 9.3132257462E-10f, 6.5854450798E-10f, - 4.6566128731E-10f, 3.2927225399E-10f }; + public static final float two_to_negative_half_pow[] = { 1.0000000000E+00f, 7.0710678119E-01f, 5.0000000000E-01f, 3.5355339059E-01f, 2.5000000000E-01f, 1.7677669530E-01f, 1.2500000000E-01f, 8.8388347648E-02f, 6.2500000000E-02f, 4.4194173824E-02f, 3.1250000000E-02f, 2.2097086912E-02f, 1.5625000000E-02f, 1.1048543456E-02f, 7.8125000000E-03f, 5.5242717280E-03f, 3.9062500000E-03f, 2.7621358640E-03f, 1.9531250000E-03f, 1.3810679320E-03f, 9.7656250000E-04f, 6.9053396600E-04f, 4.8828125000E-04f, 3.4526698300E-04f, 2.4414062500E-04f, 1.7263349150E-04f, 1.2207031250E-04f, 8.6316745750E-05f, 6.1035156250E-05f, 4.3158372875E-05f, 3.0517578125E-05f, 2.1579186438E-05f, 1.5258789062E-05f, 1.0789593219E-05f, 7.6293945312E-06f, 5.3947966094E-06f, 3.8146972656E-06f, 2.6973983047E-06f, 1.9073486328E-06f, 1.3486991523E-06f, 9.5367431641E-07f, 6.7434957617E-07f, 4.7683715820E-07f, 3.3717478809E-07f, 2.3841857910E-07f, 1.6858739404E-07f, 1.1920928955E-07f, 8.4293697022E-08f, 5.9604644775E-08f, 4.2146848511E-08f, 2.9802322388E-08f, 2.1073424255E-08f, 1.4901161194E-08f, 1.0536712128E-08f, 7.4505805969E-09f, 5.2683560639E-09f, 3.7252902985E-09f, 2.6341780319E-09f, 1.8626451492E-09f, 1.3170890160E-09f, 9.3132257462E-10f, 6.5854450798E-10f, 4.6566128731E-10f, 3.2927225399E-10f }; public static final float t_43[] = create_t_43(); - static private float[] create_t_43() { - float[] t43 = new float[8192]; + float[] t43 = new float[8192]; final double d43 = (4.0 / 3.0); - for ( int i = 0; i < 8192; i++) { + for (int i = 0; i < 8192; i++) { t43[i] = (float) Math.pow(i, d43); } return t43; } - public static final float io[][] = { - { 1.0000000000E+00f, 8.4089641526E-01f, 7.0710678119E-01f, 5.9460355751E-01f, - 5.0000000001E-01f, 4.2044820763E-01f, 3.5355339060E-01f, 2.9730177876E-01f, - 2.5000000001E-01f, 2.1022410382E-01f, 1.7677669530E-01f, 1.4865088938E-01f, - 1.2500000000E-01f, 1.0511205191E-01f, 8.8388347652E-02f, 7.4325444691E-02f, - 6.2500000003E-02f, 5.2556025956E-02f, 4.4194173826E-02f, 3.7162722346E-02f, - 3.1250000002E-02f, 2.6278012978E-02f, 2.2097086913E-02f, 1.8581361173E-02f, - 1.5625000001E-02f, 1.3139006489E-02f, 1.1048543457E-02f, 9.2906805866E-03f, - 7.8125000006E-03f, 6.5695032447E-03f, 5.5242717285E-03f, 4.6453402934E-03f }, - { 1.0000000000E+00f, 7.0710678119E-01f, 5.0000000000E-01f, 3.5355339060E-01f, - 2.5000000000E-01f, 1.7677669530E-01f, 1.2500000000E-01f, 8.8388347650E-02f, - 6.2500000001E-02f, 4.4194173825E-02f, 3.1250000001E-02f, 2.2097086913E-02f, - 1.5625000000E-02f, 1.1048543456E-02f, 7.8125000002E-03f, 5.5242717282E-03f, - 3.9062500001E-03f, 2.7621358641E-03f, 1.9531250001E-03f, 1.3810679321E-03f, - 9.7656250004E-04f, 6.9053396603E-04f, 4.8828125002E-04f, 3.4526698302E-04f, - 2.4414062501E-04f, 1.7263349151E-04f, 1.2207031251E-04f, 8.6316745755E-05f, - 6.1035156254E-05f, 4.3158372878E-05f, 3.0517578127E-05f, 2.1579186439E-05f } }; - - public static final float TAN12[] = { 0.0f, 0.26794919f, 0.57735027f, 1.0f, 1.73205081f, - 3.73205081f, 9.9999999e10f, -3.73205081f, -1.73205081f, -1.0f, -0.57735027f, -0.26794919f, - 0.0f, 0.26794919f, 0.57735027f, 1.0f }; + public static final float io[][] = { { 1.0000000000E+00f, 8.4089641526E-01f, 7.0710678119E-01f, 5.9460355751E-01f, 5.0000000001E-01f, 4.2044820763E-01f, 3.5355339060E-01f, 2.9730177876E-01f, 2.5000000001E-01f, 2.1022410382E-01f, 1.7677669530E-01f, 1.4865088938E-01f, 1.2500000000E-01f, 1.0511205191E-01f, 8.8388347652E-02f, 7.4325444691E-02f, 6.2500000003E-02f, 5.2556025956E-02f, 4.4194173826E-02f, 3.7162722346E-02f, 3.1250000002E-02f, 2.6278012978E-02f, 2.2097086913E-02f, 1.8581361173E-02f, 1.5625000001E-02f, 1.3139006489E-02f, 1.1048543457E-02f, 9.2906805866E-03f, 7.8125000006E-03f, 6.5695032447E-03f, 5.5242717285E-03f, 4.6453402934E-03f }, { 1.0000000000E+00f, 7.0710678119E-01f, 5.0000000000E-01f, 3.5355339060E-01f, 2.5000000000E-01f, 1.7677669530E-01f, 1.2500000000E-01f, 8.8388347650E-02f, 6.2500000001E-02f, 4.4194173825E-02f, 3.1250000001E-02f, 2.2097086913E-02f, 1.5625000000E-02f, 1.1048543456E-02f, 7.8125000002E-03f, 5.5242717282E-03f, 3.9062500001E-03f, 2.7621358641E-03f, 1.9531250001E-03f, 1.3810679321E-03f, 9.7656250004E-04f, 6.9053396603E-04f, 4.8828125002E-04f, 3.4526698302E-04f, 2.4414062501E-04f, 1.7263349151E-04f, 1.2207031251E-04f, 8.6316745755E-05f, 6.1035156254E-05f, 4.3158372878E-05f, 3.0517578127E-05f, 2.1579186439E-05f } }; + + public static final float TAN12[] = { 0.0f, 0.26794919f, 0.57735027f, 1.0f, 1.73205081f, 3.73205081f, 9.9999999e10f, -3.73205081f, -1.73205081f, -1.0f, -0.57735027f, -0.26794919f, 0.0f, 0.26794919f, 0.57735027f, 1.0f }; // REVIEW: in java, the array lookup may well be slower than // the actual calculation @@ -2518,7 +2383,7 @@ final class LayerIIIDecoder implements FrameDecoder { * 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, * 12, 13, 14, 15, 16, 17 }; */ - + private static/* final */int reorder_table[][]/* = loadReorderTable() */; // SZD: // will @@ -2537,11 +2402,11 @@ final class LayerIIIDecoder implements FrameDecoder { * return (int[][])o; } catch (IOException ex) { throw new * ExceptionInInitializerError(ex); } } */ - - static int[] reorder( int scalefac_band[]) { // SZD: converted from - // LAME - int j = 0; - int ix[] = new int[576]; + + static int[] reorder(int scalefac_band[]) { // SZD: converted from + // LAME + int j = 0; + int ix[] = new int[576]; for (int sfb = 0; sfb < 13; sfb++) { int start = scalefac_band[sfb]; int end = scalefac_band[sfb + 1]; @@ -2766,12 +2631,9 @@ final class LayerIIIDecoder implements FrameDecoder { * 570,547,559,571,548,560,572,549,561,573,550,562,574,551,563,575} }; */ - private static final float cs[] = { 0.857492925712f, 0.881741997318f, 0.949628649103f, - 0.983314592492f, 0.995517816065f, 0.999160558175f, 0.999899195243f, 0.999993155067f }; + private static final float cs[] = { 0.857492925712f, 0.881741997318f, 0.949628649103f, 0.983314592492f, 0.995517816065f, 0.999160558175f, 0.999899195243f, 0.999993155067f }; - private static final float ca[] = { -0.5144957554270f, -0.4717319685650f, -0.3133774542040f, - -0.1819131996110f, -0.0945741925262f, -0.0409655828852f, -0.0141985685725f, - -0.00369997467375f }; + private static final float ca[] = { -0.5144957554270f, -0.4717319685650f, -0.3133774542040f, -0.1819131996110f, -0.0945741925262f, -0.0409655828852f, -0.0141985685725f, -0.00369997467375f }; /************************************************************/ /* END OF L3TABLE */ @@ -2788,58 +2650,19 @@ final class LayerIIIDecoder implements FrameDecoder { /***************************************************************/ /* INV_MDCT */ /***************************************************************/ - public static final float win[][] = { - { -1.6141214951E-02f, -5.3603178919E-02f, -1.0070713296E-01f, -1.6280817573E-01f, - -4.9999999679E-01f, -3.8388735032E-01f, -6.2061144372E-01f, -1.1659756083E+00f, - -3.8720752656E+00f, -4.2256286556E+00f, -1.5195289984E+00f, -9.7416483388E-01f, - -7.3744074053E-01f, -1.2071067773E+00f, -5.1636156596E-01f, -4.5426052317E-01f, - -4.0715656898E-01f, -3.6969460527E-01f, -3.3876269197E-01f, -3.1242222492E-01f, - -2.8939587111E-01f, -2.6880081906E-01f, -5.0000000266E-01f, -2.3251417468E-01f, - -2.1596714708E-01f, -2.0004979098E-01f, -1.8449493497E-01f, -1.6905846094E-01f, - -1.5350360518E-01f, -1.3758624925E-01f, -1.2103922149E-01f, -2.0710679058E-01f, - -8.4752577594E-02f, -6.4157525656E-02f, -4.1131172614E-02f, -1.4790705759E-02f }, - - { -1.6141214951E-02f, -5.3603178919E-02f, -1.0070713296E-01f, -1.6280817573E-01f, - -4.9999999679E-01f, -3.8388735032E-01f, -6.2061144372E-01f, -1.1659756083E+00f, - -3.8720752656E+00f, -4.2256286556E+00f, -1.5195289984E+00f, -9.7416483388E-01f, - -7.3744074053E-01f, -1.2071067773E+00f, -5.1636156596E-01f, -4.5426052317E-01f, - -4.0715656898E-01f, -3.6969460527E-01f, -3.3908542600E-01f, -3.1511810350E-01f, - -2.9642226150E-01f, -2.8184548650E-01f, -5.4119610000E-01f, -2.6213228100E-01f, - -2.5387916537E-01f, -2.3296291359E-01f, -1.9852728987E-01f, -1.5233534808E-01f, - -9.6496400054E-02f, -3.3423828516E-02f, 0.0000000000E+00f, 0.0000000000E+00f, - 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f }, - - { -4.8300800645E-02f, -1.5715656932E-01f, -2.8325045177E-01f, -4.2953747763E-01f, - -1.2071067795E+00f, -8.2426483178E-01f, -1.1451749106E+00f, -1.7695290101E+00f, - -4.5470225061E+00f, -3.4890531002E+00f, -7.3296292804E-01f, -1.5076514758E-01f, - 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, - 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, - 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, - 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, - 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, - 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f }, - - { 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, - 0.0000000000E+00f, 0.0000000000E+00f, -1.5076513660E-01f, -7.3296291107E-01f, - -3.4890530566E+00f, -4.5470224727E+00f, -1.7695290031E+00f, -1.1451749092E+00f, - -8.3137738100E-01f, -1.3065629650E+00f, -5.4142014250E-01f, -4.6528974900E-01f, - -4.1066990750E-01f, -3.7004680800E-01f, -3.3876269197E-01f, -3.1242222492E-01f, - -2.8939587111E-01f, -2.6880081906E-01f, -5.0000000266E-01f, -2.3251417468E-01f, - -2.1596714708E-01f, -2.0004979098E-01f, -1.8449493497E-01f, -1.6905846094E-01f, - -1.5350360518E-01f, -1.3758624925E-01f, -1.2103922149E-01f, -2.0710679058E-01f, - -8.4752577594E-02f, -6.4157525656E-02f, -4.1131172614E-02f, -1.4790705759E-02f } }; + public static final float win[][] = { { -1.6141214951E-02f, -5.3603178919E-02f, -1.0070713296E-01f, -1.6280817573E-01f, -4.9999999679E-01f, -3.8388735032E-01f, -6.2061144372E-01f, -1.1659756083E+00f, -3.8720752656E+00f, -4.2256286556E+00f, -1.5195289984E+00f, -9.7416483388E-01f, -7.3744074053E-01f, -1.2071067773E+00f, -5.1636156596E-01f, -4.5426052317E-01f, -4.0715656898E-01f, -3.6969460527E-01f, -3.3876269197E-01f, -3.1242222492E-01f, -2.8939587111E-01f, -2.6880081906E-01f, -5.0000000266E-01f, -2.3251417468E-01f, -2.1596714708E-01f, -2.0004979098E-01f, -1.8449493497E-01f, -1.6905846094E-01f, -1.5350360518E-01f, -1.3758624925E-01f, -1.2103922149E-01f, -2.0710679058E-01f, -8.4752577594E-02f, -6.4157525656E-02f, -4.1131172614E-02f, -1.4790705759E-02f }, + + { -1.6141214951E-02f, -5.3603178919E-02f, -1.0070713296E-01f, -1.6280817573E-01f, -4.9999999679E-01f, -3.8388735032E-01f, -6.2061144372E-01f, -1.1659756083E+00f, -3.8720752656E+00f, -4.2256286556E+00f, -1.5195289984E+00f, -9.7416483388E-01f, -7.3744074053E-01f, -1.2071067773E+00f, -5.1636156596E-01f, -4.5426052317E-01f, -4.0715656898E-01f, -3.6969460527E-01f, -3.3908542600E-01f, -3.1511810350E-01f, -2.9642226150E-01f, -2.8184548650E-01f, -5.4119610000E-01f, -2.6213228100E-01f, -2.5387916537E-01f, -2.3296291359E-01f, -1.9852728987E-01f, -1.5233534808E-01f, -9.6496400054E-02f, -3.3423828516E-02f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f }, + + { -4.8300800645E-02f, -1.5715656932E-01f, -2.8325045177E-01f, -4.2953747763E-01f, -1.2071067795E+00f, -8.2426483178E-01f, -1.1451749106E+00f, -1.7695290101E+00f, -4.5470225061E+00f, -3.4890531002E+00f, -7.3296292804E-01f, -1.5076514758E-01f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f }, + + { 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, 0.0000000000E+00f, -1.5076513660E-01f, -7.3296291107E-01f, -3.4890530566E+00f, -4.5470224727E+00f, -1.7695290031E+00f, -1.1451749092E+00f, -8.3137738100E-01f, -1.3065629650E+00f, -5.4142014250E-01f, -4.6528974900E-01f, -4.1066990750E-01f, -3.7004680800E-01f, -3.3876269197E-01f, -3.1242222492E-01f, -2.8939587111E-01f, -2.6880081906E-01f, -5.0000000266E-01f, -2.3251417468E-01f, -2.1596714708E-01f, -2.0004979098E-01f, -1.8449493497E-01f, -1.6905846094E-01f, -1.5350360518E-01f, -1.3758624925E-01f, -1.2103922149E-01f, -2.0710679058E-01f, -8.4752577594E-02f, -6.4157525656E-02f, -4.1131172614E-02f, -1.4790705759E-02f } }; /***************************************************************/ /* END OF INV_MDCT */ /***************************************************************/ - public static final int nr_of_sfb_block[][][] = { - { { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } }, - { { 6, 5, 7, 3 }, { 9, 9, 12, 6 }, { 6, 9, 12, 6 } }, - { { 11, 10, 0, 0 }, { 18, 18, 0, 0 }, { 15, 18, 0, 0 } }, - { { 7, 7, 7, 0 }, { 12, 12, 12, 0 }, { 6, 15, 12, 0 } }, - { { 6, 6, 6, 3 }, { 12, 9, 9, 6 }, { 6, 12, 9, 6 } }, - { { 8, 8, 5, 0 }, { 15, 12, 9, 0 }, { 6, 18, 9, 0 } } }; + public static final int nr_of_sfb_block[][][] = { { { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } }, { { 6, 5, 7, 3 }, { 9, 9, 12, 6 }, { 6, 9, 12, 6 } }, { { 11, 10, 0, 0 }, { 18, 18, 0, 0 }, { 15, 18, 0, 0 } }, { { 7, 7, 7, 0 }, { 12, 12, 12, 0 }, { 6, 15, 12, 0 } }, { { 6, 6, 6, 3 }, { 12, 9, 9, 6 }, { 6, 12, 9, 6 } }, { { 8, 8, 5, 0 }, { 15, 12, 9, 0 }, { 6, 18, 9, 0 } } }; } @@ -2847,11 +2670,10 @@ final class LayerIIIDecoder implements FrameDecoder { /* L3TABLE */ /************************************************************/ - class SBI { - + public int[] l; - + public int[] s; public SBI() { @@ -2859,42 +2681,40 @@ class SBI { s = new int[14]; } - - public SBI(@DELEGATE int[] thel, @DELEGATE int[] thes) { + public SBI(@DELEGATE int[] thel, @DELEGATE int[] thes) { l = thel; s = thes; } } - class gr_info_s { - + public int part2_3_length = 0; - + public int big_values = 0; - + public int global_gain = 0; - + public int scalefac_compress = 0; - + public int window_switching_flag = 0; - + public int block_type = 0; - + public int mixed_block_flag = 0; - + public int[] table_select; - + public int[] subblock_gain; - + public int region0_count = 0; - + public int region1_count = 0; - + public int preflag = 0; - + public int scalefac_scale = 0; - + public int count1table_select = 0; /** @@ -2906,11 +2726,10 @@ class gr_info_s { } } - class temporaire { - + public int[] scfsi; - + public gr_info_s[] gr; /** @@ -2924,14 +2743,12 @@ class temporaire { } } - class III_side_info_t { - public int main_data_begin = 0; - + public int private_bits = 0; - + public temporaire[] ch; /** @@ -2944,11 +2761,10 @@ class III_side_info_t { } } - class temporaire2 { - + public int[] l; /* [cb] */ - + public int[][] s; /* [window][cb] */ /** diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/METHODDEFAULT.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/METHODDEFAULT.java index 8cc6ce76..b9b49e24 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/METHODDEFAULT.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/METHODDEFAULT.java @@ -1,3 +1,3 @@ -public @interface METHODDEFAULT{ - String value(); +public @interface METHODDEFAULT { + String value(); } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Manager.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Manager.java index fe855401..651713ca 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Manager.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Manager.java @@ -17,29 +17,25 @@ *---------------------------------------------------------------------- */ - /** * Work in progress. * * Manages a number of controls. */ -public class Manager //implements Control +public class Manager // implements Control { - public void addControl(Control c) - { - - } - - public void removeControl(Control c) - { - - } - - public void removeAll() - { - - } - - // control interface delegates to a managed control - + public void addControl(Control c) { + + } + + public void removeControl(Control c) { + + } + + public void removeAll() { + + } + + // control interface delegates to a managed control + } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Obuffer.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Obuffer.java index 8a6d8c09..ca7eaf0c 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Obuffer.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Obuffer.java @@ -37,7 +37,6 @@ * Base Class for audio output. */ - public abstract class Obuffer { public static final int OBUFFERSIZE = 2 * 1152; // max. 2 * 1152 samples per // frame @@ -46,15 +45,15 @@ public abstract class Obuffer { /** * Takes a 16 Bit PCM sample. */ - public abstract void append( int channel, short value); + public abstract void append(int channel, short value); /** * Accepts 32 new PCM samples. */ - - public void appendSamples( int channel, float[] f) { - short s; - for ( int i = 0; i < 32;) { + + public void appendSamples(int channel, float[] f) { + short s; + for (int i = 0; i < 32;) { s = clip(f[i++]); append(channel, s); } @@ -63,10 +62,10 @@ public abstract class Obuffer { /** * Clip Sample to 16 Bits */ - - private final short clip( float sample) { - short s = (short) sample; + private final short clip(float sample) { + + short s = (short) sample; if (sample > 32767.0f) { s = (short) 32767; @@ -81,7 +80,7 @@ public abstract class Obuffer { /** * Write the samples to the file or directly to the audio hardware. */ - public abstract void write_buffer( int val); + public abstract void write_buffer(int val); public abstract void close(); diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/OutputChannels.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/OutputChannels.java index 811a4e65..056011b0 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/OutputChannels.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/OutputChannels.java @@ -27,7 +27,6 @@ * @since 0.0.7 */ - public class OutputChannels { /** * Flag to indicate output should include both channels. @@ -54,7 +53,6 @@ public class OutputChannels { public static final OutputChannels BOTH = new OutputChannels(BOTH_CHANNELS); public static final OutputChannels DOWNMIX = new OutputChannels(DOWNMIX_CHANNELS); - private/* final */int outputChannels; /** @@ -82,7 +80,7 @@ public class OutputChannels { } } - public OutputChannels( int channels) { + public OutputChannels(int channels) { outputChannels = channels; if (channels < 0 || channels > 3) diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java index f9593476..c7ef1c0f 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Player.java @@ -37,7 +37,7 @@ public class Player { /** * The current frame number. */ - + private int frame = 0; /** @@ -59,19 +59,17 @@ public class Player { /** * Has the player been closed? */ - + private boolean closed = false; /** * Has the player played back all frames from the stream? */ - + private boolean complete = false; - private int lastPosition = 0; - private long sampleNumber; /** @@ -110,20 +108,19 @@ 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 { - boolean ret = true; + + public boolean play(int frames) throws JavaLayerException { + boolean ret = true; // initialization before ssjava loop - boolean init = true; - Header h = BitstreamWrapper.readFrame(); + boolean init = true; + Header h = BitstreamWrapper.readFrame(); decoder.init(h); sampleNumber = 1; System.out.println("Gobble sentinel: +++"); - // int count = 0; + // int count = 0; SSJAVA: while (true) { if (h == null) { break; @@ -189,9 +186,8 @@ public class Player { * * @return true if there are no more frames to decode, false otherwise. */ - - protected boolean decodeFrame( boolean init, Header h) - throws JavaLayerException { + + protected boolean decodeFrame(boolean init, Header h) throws JavaLayerException { try { // AudioDevice out = audio; // if (out==null) @@ -202,12 +198,12 @@ public class Player { // if (h == null){ // return false; // } - - // SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h); + + // SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h); decoder.decodeFrame(h); -// DEBUG_OUTPUT_CHECKSUM(); -// DEBUG_OUTPUT(); + // DEBUG_OUTPUT_CHECKSUM(); + // DEBUG_OUTPUT(); // synchronized (this) // { // out = audio; @@ -247,10 +243,10 @@ public class Player { @TRUST public void DEBUG_OUTPUT_CHECKSUM() { // eom debug - int sum = 0; - short[] outbuf = SampleBufferWrapper.getBuffer(); + int sum = 0; + short[] outbuf = SampleBufferWrapper.getBuffer(); // short[] outbuf = output.getBuffer(); - TERMINATE: for ( int i = 0; i < SampleBufferWrapper.getBufferLength(); i++) { + TERMINATE: for (int i = 0; i < SampleBufferWrapper.getBufferLength(); i++) { // System.out.println(outbuf[i]); sum += outbuf[i]; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBuffer.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBuffer.java index 5e710561..0d401159 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBuffer.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBuffer.java @@ -28,17 +28,16 @@ * storage for a fixed size block of samples. */ - public class SampleBuffer extends Obuffer { - + private short[] buffer; - + private int[] bufferp; - + private int channels; - + private int frequency; - + private int idx; static public long sampleNumber = 0; @@ -46,13 +45,13 @@ public class SampleBuffer extends Obuffer { /** * Constructor */ - public SampleBuffer( int sample_frequency, int number_of_channels) { + public SampleBuffer(int sample_frequency, int number_of_channels) { buffer = new short[OBUFFERSIZE]; bufferp = new int[MAXCHANNELS]; channels = number_of_channels; // [IN] -> [D] frequency = sample_frequency; // [IN] -> [D] - for ( int i = 0; i < number_of_channels; ++i) { + for (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 @@ -81,7 +80,7 @@ public class SampleBuffer extends Obuffer { /** * Takes a 16 Bit PCM sample. */ - public void append( int channel, short value) { + public void append(int channel, short value) { buffer[bufferp[channel]] = value; // LOC(bufferp[channel])= [local.D,SampleBuffer.BUF] // so, for LHS, LOC(buffer) < LOC(bufferp[channle]) @@ -93,16 +92,15 @@ public class SampleBuffer extends Obuffer { } - - public void appendSamples( int channel, float[] f) { - int pos = bufferp[channel]; + public void appendSamples(int channel, float[] f) { + int pos = bufferp[channel]; // LOC(bufferp[channel])=[D,SampleBuffer.BUFP] // LOC(pos)=[D,SampleBuffer.BUFP] - short s; - float fs; + short s; + float fs; - for ( int i = 0; i < 32;) { + for (int i = 0; i < 32;) { fs = f[i++]; // [IN] -> [D,BUFP] if (fs > 32767.0f) { @@ -140,7 +138,7 @@ public class SampleBuffer extends Obuffer { /** * Write the samples to the file (Random Acces). */ - public void write_buffer( int val) { + public void write_buffer(int val) { // for (int i = 0; i < channels; ++i) // bufferp[i] = (short)i; diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBufferWrapper.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBufferWrapper.java index 5c691eb2..ac0232c5 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBufferWrapper.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SampleBufferWrapper.java @@ -6,9 +6,9 @@ public class SampleBufferWrapper { static void init(int freq, int channels) { output = new SampleBuffer(freq, channels); } - + @TRUST - static void clear_buffer(){ + static void clear_buffer() { output.clear_buffer(); } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SideInfoBuffer.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SideInfoBuffer.java index d62c4885..644d14ac 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SideInfoBuffer.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SideInfoBuffer.java @@ -1,11 +1,9 @@ - - public class SideInfoBuffer { /** * The frame buffer that holds the data for the current frame. */ - + private final int[] framebuffer = new int[BUFFER_INT_SIZE]; /** @@ -16,36 +14,31 @@ public class SideInfoBuffer { /** * Index into framebuffer where the next bits are retrieved. */ - + private int wordpointer; /** * Number (0-31, from MSB to LSB) of next bit for get_bits() */ - + private int bitindex; - private int main_data_begin; public int getMain_data_begin() { return main_data_begin; } - public void setMain_data_begin( int main_data_begin) { + public void setMain_data_begin(int main_data_begin) { this.main_data_begin = main_data_begin; } - private static final int bitmask[] = { - 0, // dummy - 0x00000001, 0x00000003, 0x00000007, 0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F, - 0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, 0x00001FFF, 0x00003FFF, - 0x00007FFF, 0x0000FFFF, 0x0001FFFF }; + private static final int bitmask[] = { 0, // dummy + 0x00000001, 0x00000003, 0x00000007, 0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF, 0x0001FFFF }; - - public int get_bits( int number_of_bits) { - int returnvalue = 0; - int sum = bitindex + number_of_bits; + public int get_bits(int number_of_bits) { + int returnvalue = 0; + int sum = bitindex + number_of_bits; // System.out.println("bitindex=" + bitindex + " wordpointer=" // + wordpointer); // E.B @@ -70,9 +63,9 @@ public class SideInfoBuffer { // ((short[])&returnvalue)[0] = ((short[])wordpointer + 1)[0]; // wordpointer++; // Added by me! // ((short[])&returnvalue + 1)[0] = ((short[])wordpointer)[0]; - int Right = (framebuffer[wordpointer] & 0x0000FFFF); + int Right = (framebuffer[wordpointer] & 0x0000FFFF); wordpointer++; - int Left = (framebuffer[wordpointer] & 0xFFFF0000); + int Left = (framebuffer[wordpointer] & 0xFFFF0000); returnvalue = ((Right << 16) & 0xFFFF0000) | ((Left >>> 16) & 0x0000FFFF); returnvalue >>>= 48 - sum; // returnvalue >>= 16 - (number_of_bits - (32 diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Source.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Source.java index ad2f0c91..ce8874b2 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Source.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Source.java @@ -17,32 +17,28 @@ *---------------------------------------------------------------------- */ - import java.io.IOException; /** * Work in progress. * - * Class to describe a seekable data source. - * + * Class to describe a seekable data source. + * */ -public interface Source -{ - - public static final long LENGTH_UNKNOWN = -1; - - public int read(byte[] b, int offs, int len) - throws IOException; - - - public boolean willReadBlock(); - - public boolean isSeekable(); - - public long length(); - - public long tell(); - - public long seek(long pos); - +public interface Source { + + public static final long LENGTH_UNKNOWN = -1; + + public int read(byte[] b, int offs, int len) throws IOException; + + public boolean willReadBlock(); + + public boolean isSeekable(); + + public long length(); + + public long tell(); + + public long seek(long pos); + } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Subband.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Subband.java index cadd0af3..56f68fde 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Subband.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/Subband.java @@ -4,41 +4,24 @@ * Abstract base class for subband classes of layer I and II */ - 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( Bitstream stream, Header header, - Crc16 crc) throws DecoderException; + public abstract void read_allocation(Bitstream stream, Header header, Crc16 crc) + throws DecoderException; - public abstract void read_scalefactor( Bitstream stream, Header header); + public abstract void read_scalefactor(Bitstream stream, Header header); - - public abstract boolean read_sampledata( Bitstream stream); + public abstract boolean read_sampledata(Bitstream stream); - - public abstract boolean put_next_sample( int channels, - SynthesisFilter filter1, SynthesisFilter filter2); + public abstract boolean put_next_sample(int channels, SynthesisFilter filter1, SynthesisFilter filter2); }; diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SynthesisFilter.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SynthesisFilter.java index 6641d730..aa5c6ae1 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SynthesisFilter.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/SynthesisFilter.java @@ -35,31 +35,28 @@ * are removed by ignoring higher subbands. */ - final class SynthesisFilter { - public int vidx; - + public float[] v1; - + public float[] v2; - public float[] prev1; - + public float[] prev2; // private float[] actual_v; // v1 or v2 - + public int actual_write_pos; // 0-15 - + private float[] samples; // 32 new subband samples - + public final int channel; - + public final float scalefactor; - + private float[] eq; /** @@ -129,50 +126,50 @@ final class SynthesisFilter { /** * Inject Sample. */ - public void input_sample( float sample, int subbandnumber) { + public void input_sample(float sample, int subbandnumber) { samples[subbandnumber] = eq[subbandnumber] * sample; } - public void input_samples( float[] s) { - TERMINATE: for ( int i = 31; i >= 0; i--) { + public void input_samples(float[] s) { + TERMINATE: for (int i = 31; i >= 0; i--) { samples[i] = s[i] * eq[i]; } } private void compute_new_v2_v1() { - float new_v0 = 0.0f; - float new_v1 = 0.0f; - float new_v2 = 0.0f; - float new_v3 = 0.0f; - float new_v4 = 0.0f; - float new_v5 = 0.0f; - float new_v6 = 0.0f; - float new_v7 = 0.0f; - float new_v8 = 0.0f; - float new_v9 = 0.0f; - float new_v10 = 0.0f; - float new_v11 = 0.0f; - float new_v12 = 0.0f; - float new_v13 = 0.0f; - float new_v14 = 0.0f; - float new_v15 = 0.0f; - float new_v16 = 0.0f; - float new_v17 = 0.0f; - float new_v18 = 0.0f; - float new_v19 = 0.0f; - float new_v20 = 0.0f; - float new_v21 = 0.0f; - float new_v22 = 0.0f; - float new_v23 = 0.0f; - float new_v24 = 0.0f; - float new_v25 = 0.0f; - float new_v26 = 0.0f; - float new_v27 = 0.0f; - float new_v28 = 0.0f; - float new_v29 = 0.0f; - float new_v30 = 0.0f; - float new_v31 = 0.0f; + float new_v0 = 0.0f; + float new_v1 = 0.0f; + float new_v2 = 0.0f; + float new_v3 = 0.0f; + float new_v4 = 0.0f; + float new_v5 = 0.0f; + float new_v6 = 0.0f; + float new_v7 = 0.0f; + float new_v8 = 0.0f; + float new_v9 = 0.0f; + float new_v10 = 0.0f; + float new_v11 = 0.0f; + float new_v12 = 0.0f; + float new_v13 = 0.0f; + float new_v14 = 0.0f; + float new_v15 = 0.0f; + float new_v16 = 0.0f; + float new_v17 = 0.0f; + float new_v18 = 0.0f; + float new_v19 = 0.0f; + float new_v20 = 0.0f; + float new_v21 = 0.0f; + float new_v22 = 0.0f; + float new_v23 = 0.0f; + float new_v24 = 0.0f; + float new_v25 = 0.0f; + float new_v26 = 0.0f; + float new_v27 = 0.0f; + float new_v28 = 0.0f; + float new_v29 = 0.0f; + float new_v30 = 0.0f; + float new_v31 = 0.0f; // float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure // 3-A.2 in ISO DIS 11172-3 @@ -181,72 +178,72 @@ final class SynthesisFilter { // float[] s = samples; - float s0 = samples[0]; - float s1 = samples[1]; - float s2 = samples[2]; - float s3 = samples[3]; - float s4 = samples[4]; - float s5 = samples[5]; - float s6 = samples[6]; - float s7 = samples[7]; - float s8 = samples[8]; - float s9 = samples[9]; - float s10 = samples[10]; - float s11 = samples[11]; - float s12 = samples[12]; - float s13 = samples[13]; - float s14 = samples[14]; - float s15 = samples[15]; - float s16 = samples[16]; - float s17 = samples[17]; - float s18 = samples[18]; - float s19 = samples[19]; - float s20 = samples[20]; - float s21 = samples[21]; - float s22 = samples[22]; - float s23 = samples[23]; - float s24 = samples[24]; - float s25 = samples[25]; - float s26 = samples[26]; - float s27 = samples[27]; - float s28 = samples[28]; - float s29 = samples[29]; - float s30 = samples[30]; - float s31 = samples[31]; - - float p0 = s0 + s31; - float p1 = s1 + s30; - float p2 = s2 + s29; - float p3 = s3 + s28; - float p4 = s4 + s27; - float p5 = s5 + s26; - float p6 = s6 + s25; - float p7 = s7 + s24; - float p8 = s8 + s23; - float p9 = s9 + s22; - float p10 = s10 + s21; - float p11 = s11 + s20; - float p12 = s12 + s19; - float p13 = s13 + s18; - float p14 = s14 + s17; - float p15 = s15 + s16; - - float pp0 = p0 + p15; - float pp1 = p1 + p14; - float pp2 = p2 + p13; - float pp3 = p3 + p12; - float pp4 = p4 + p11; - float pp5 = p5 + p10; - float pp6 = p6 + p9; - float pp7 = p7 + p8; - float pp8 = (p0 - p15) * cos1_32; - float pp9 = (p1 - p14) * cos3_32; - float pp10 = (p2 - p13) * cos5_32; - float pp11 = (p3 - p12) * cos7_32; - float pp12 = (p4 - p11) * cos9_32; - float pp13 = (p5 - p10) * cos11_32; - float pp14 = (p6 - p9) * cos13_32; - float pp15 = (p7 - p8) * cos15_32; + float s0 = samples[0]; + float s1 = samples[1]; + float s2 = samples[2]; + float s3 = samples[3]; + float s4 = samples[4]; + float s5 = samples[5]; + float s6 = samples[6]; + float s7 = samples[7]; + float s8 = samples[8]; + float s9 = samples[9]; + float s10 = samples[10]; + float s11 = samples[11]; + float s12 = samples[12]; + float s13 = samples[13]; + float s14 = samples[14]; + float s15 = samples[15]; + float s16 = samples[16]; + float s17 = samples[17]; + float s18 = samples[18]; + float s19 = samples[19]; + float s20 = samples[20]; + float s21 = samples[21]; + float s22 = samples[22]; + float s23 = samples[23]; + float s24 = samples[24]; + float s25 = samples[25]; + float s26 = samples[26]; + float s27 = samples[27]; + float s28 = samples[28]; + float s29 = samples[29]; + float s30 = samples[30]; + float s31 = samples[31]; + + float p0 = s0 + s31; + float p1 = s1 + s30; + float p2 = s2 + s29; + float p3 = s3 + s28; + float p4 = s4 + s27; + float p5 = s5 + s26; + float p6 = s6 + s25; + float p7 = s7 + s24; + float p8 = s8 + s23; + float p9 = s9 + s22; + float p10 = s10 + s21; + float p11 = s11 + s20; + float p12 = s12 + s19; + float p13 = s13 + s18; + float p14 = s14 + s17; + float p15 = s15 + s16; + + float pp0 = p0 + p15; + float pp1 = p1 + p14; + float pp2 = p2 + p13; + float pp3 = p3 + p12; + float pp4 = p4 + p11; + float pp5 = p5 + p10; + float pp6 = p6 + p9; + float pp7 = p7 + p8; + float pp8 = (p0 - p15) * cos1_32; + float pp9 = (p1 - p14) * cos3_32; + float pp10 = (p2 - p13) * cos5_32; + float pp11 = (p3 - p12) * cos7_32; + float pp12 = (p4 - p11) * cos9_32; + float pp13 = (p5 - p10) * cos11_32; + float pp14 = (p6 - p9) * cos13_32; + float pp15 = (p7 - p8) * cos15_32; p0 = pp0 + pp7; p1 = pp1 + pp6; @@ -300,7 +297,7 @@ final class SynthesisFilter { p15 = (pp14 - pp15) * cos1_4; // this is pretty insane coding - float tmp1; + float tmp1; new_v19/* 36-17 */= -(new_v4 = (new_v12 = p7) + p5) - p6; new_v27/* 44-17 */= -p6 - p7 - p4; new_v6 = (new_v10 = (new_v14 = p15) + p11) + p13; @@ -399,7 +396,7 @@ final class SynthesisFilter { // manually doing something that a compiler should handle sucks // coding like this is hard to read - float tmp2; + float tmp2; new_v5 = (new_v11 = (new_v13 = (new_v15 = p15) + p7) + p11) + p5 + p13; new_v7 = (new_v9 = p15 + p11 + p3) + p13; new_v16/* 33-17 */= -(new_v1 = (tmp1 = p13 + p15 + p9) + p1) - p14; @@ -416,7 +413,7 @@ final class SynthesisFilter { // float[] x2 = actual_v + actual_write_pos; // float dest[] = actual_v; v2 - int pos = actual_write_pos; + int pos = actual_write_pos; v2[0 + pos] = new_v0; v2[16 + pos] = new_v1; @@ -577,38 +574,38 @@ final class SynthesisFilter { private void compute_new_v1_v2() { - float new_v0 = 0.0f; - float new_v1 = 0.0f; - float new_v2 = 0.0f; - float new_v3 = 0.0f; - float new_v4 = 0.0f; - float new_v5 = 0.0f; - float new_v6 = 0.0f; - float new_v7 = 0.0f; - float new_v8 = 0.0f; - float new_v9 = 0.0f; - float new_v10 = 0.0f; - float new_v11 = 0.0f; - float new_v12 = 0.0f; - float new_v13 = 0.0f; - float new_v14 = 0.0f; - float new_v15 = 0.0f; - float new_v16 = 0.0f; - float new_v17 = 0.0f; - float new_v18 = 0.0f; - float new_v19 = 0.0f; - float new_v20 = 0.0f; - float new_v21 = 0.0f; - float new_v22 = 0.0f; - float new_v23 = 0.0f; - float new_v24 = 0.0f; - float new_v25 = 0.0f; - float new_v26 = 0.0f; - float new_v27 = 0.0f; - float new_v28 = 0.0f; - float new_v29 = 0.0f; - float new_v30 = 0.0f; - float new_v31 = 0.0f; + float new_v0 = 0.0f; + float new_v1 = 0.0f; + float new_v2 = 0.0f; + float new_v3 = 0.0f; + float new_v4 = 0.0f; + float new_v5 = 0.0f; + float new_v6 = 0.0f; + float new_v7 = 0.0f; + float new_v8 = 0.0f; + float new_v9 = 0.0f; + float new_v10 = 0.0f; + float new_v11 = 0.0f; + float new_v12 = 0.0f; + float new_v13 = 0.0f; + float new_v14 = 0.0f; + float new_v15 = 0.0f; + float new_v16 = 0.0f; + float new_v17 = 0.0f; + float new_v18 = 0.0f; + float new_v19 = 0.0f; + float new_v20 = 0.0f; + float new_v21 = 0.0f; + float new_v22 = 0.0f; + float new_v23 = 0.0f; + float new_v24 = 0.0f; + float new_v25 = 0.0f; + float new_v26 = 0.0f; + float new_v27 = 0.0f; + float new_v28 = 0.0f; + float new_v29 = 0.0f; + float new_v30 = 0.0f; + float new_v31 = 0.0f; // float[] new_v = new float[32]; // new V[0-15] and V[33-48] of Figure // 3-A.2 in ISO DIS 11172-3 @@ -617,72 +614,72 @@ final class SynthesisFilter { // float[] s = samples; - float s0 = samples[0]; - float s1 = samples[1]; - float s2 = samples[2]; - float s3 = samples[3]; - float s4 = samples[4]; - float s5 = samples[5]; - float s6 = samples[6]; - float s7 = samples[7]; - float s8 = samples[8]; - float s9 = samples[9]; - float s10 = samples[10]; - float s11 = samples[11]; - float s12 = samples[12]; - float s13 = samples[13]; - float s14 = samples[14]; - float s15 = samples[15]; - float s16 = samples[16]; - float s17 = samples[17]; - float s18 = samples[18]; - float s19 = samples[19]; - float s20 = samples[20]; - float s21 = samples[21]; - float s22 = samples[22]; - float s23 = samples[23]; - float s24 = samples[24]; - float s25 = samples[25]; - float s26 = samples[26]; - float s27 = samples[27]; - float s28 = samples[28]; - float s29 = samples[29]; - float s30 = samples[30]; - float s31 = samples[31]; - - float p0 = s0 + s31; - float p1 = s1 + s30; - float p2 = s2 + s29; - float p3 = s3 + s28; - float p4 = s4 + s27; - float p5 = s5 + s26; - float p6 = s6 + s25; - float p7 = s7 + s24; - float p8 = s8 + s23; - float p9 = s9 + s22; - float p10 = s10 + s21; - float p11 = s11 + s20; - float p12 = s12 + s19; - float p13 = s13 + s18; - float p14 = s14 + s17; - float p15 = s15 + s16; - - float pp0 = p0 + p15; - float pp1 = p1 + p14; - float pp2 = p2 + p13; - float pp3 = p3 + p12; - float pp4 = p4 + p11; - float pp5 = p5 + p10; - float pp6 = p6 + p9; - float pp7 = p7 + p8; - float pp8 = (p0 - p15) * cos1_32; - float pp9 = (p1 - p14) * cos3_32; - float pp10 = (p2 - p13) * cos5_32; - float pp11 = (p3 - p12) * cos7_32; - float pp12 = (p4 - p11) * cos9_32; - float pp13 = (p5 - p10) * cos11_32; - float pp14 = (p6 - p9) * cos13_32; - float pp15 = (p7 - p8) * cos15_32; + float s0 = samples[0]; + float s1 = samples[1]; + float s2 = samples[2]; + float s3 = samples[3]; + float s4 = samples[4]; + float s5 = samples[5]; + float s6 = samples[6]; + float s7 = samples[7]; + float s8 = samples[8]; + float s9 = samples[9]; + float s10 = samples[10]; + float s11 = samples[11]; + float s12 = samples[12]; + float s13 = samples[13]; + float s14 = samples[14]; + float s15 = samples[15]; + float s16 = samples[16]; + float s17 = samples[17]; + float s18 = samples[18]; + float s19 = samples[19]; + float s20 = samples[20]; + float s21 = samples[21]; + float s22 = samples[22]; + float s23 = samples[23]; + float s24 = samples[24]; + float s25 = samples[25]; + float s26 = samples[26]; + float s27 = samples[27]; + float s28 = samples[28]; + float s29 = samples[29]; + float s30 = samples[30]; + float s31 = samples[31]; + + float p0 = s0 + s31; + float p1 = s1 + s30; + float p2 = s2 + s29; + float p3 = s3 + s28; + float p4 = s4 + s27; + float p5 = s5 + s26; + float p6 = s6 + s25; + float p7 = s7 + s24; + float p8 = s8 + s23; + float p9 = s9 + s22; + float p10 = s10 + s21; + float p11 = s11 + s20; + float p12 = s12 + s19; + float p13 = s13 + s18; + float p14 = s14 + s17; + float p15 = s15 + s16; + + float pp0 = p0 + p15; + float pp1 = p1 + p14; + float pp2 = p2 + p13; + float pp3 = p3 + p12; + float pp4 = p4 + p11; + float pp5 = p5 + p10; + float pp6 = p6 + p9; + float pp7 = p7 + p8; + float pp8 = (p0 - p15) * cos1_32; + float pp9 = (p1 - p14) * cos3_32; + float pp10 = (p2 - p13) * cos5_32; + float pp11 = (p3 - p12) * cos7_32; + float pp12 = (p4 - p11) * cos9_32; + float pp13 = (p5 - p10) * cos11_32; + float pp14 = (p6 - p9) * cos13_32; + float pp15 = (p7 - p8) * cos15_32; p0 = pp0 + pp7; p1 = pp1 + pp6; @@ -736,7 +733,7 @@ final class SynthesisFilter { p15 = (pp14 - pp15) * cos1_4; // this is pretty insane coding - float tmp1; + float tmp1; new_v19/* 36-17 */= -(new_v4 = (new_v12 = p7) + p5) - p6; new_v27/* 44-17 */= -p6 - p7 - p4; new_v6 = (new_v10 = (new_v14 = p15) + p11) + p13; @@ -835,7 +832,7 @@ final class SynthesisFilter { // manually doing something that a compiler should handle sucks // coding like this is hard to read - float tmp2; + float tmp2; new_v5 = (new_v11 = (new_v13 = (new_v15 = p15) + p7) + p11) + p5 + p13; new_v7 = (new_v9 = p15 + p11 + p3) + p13; new_v16/* 33-17 */= -(new_v1 = (tmp1 = p13 + p15 + p9) + p1) - p14; @@ -852,7 +849,7 @@ final class SynthesisFilter { // float[] x2 = actual_v + actual_write_pos; // float dest[] = actual_v; actual_v=v1; - int pos = actual_write_pos; + int pos = actual_write_pos; v1[0 + pos] = new_v0; v1[16 + pos] = new_v1; @@ -1015,7 +1012,6 @@ final class SynthesisFilter { * Compute PCM Samples. */ - private float[] _tmpOut = new float[32]; private void compute_pcm_samples0() { @@ -1024,21 +1020,13 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { - float pcm_sample; + for (int i = 0; i < 32; i++) { + float pcm_sample; // final float[] dp = d16[i]; - pcm_sample = - (float) (((v1[0 + dvp] * d16[i][0]) + (v1[15 + dvp] * d16[i][1]) - + (v1[14 + dvp] * d16[i][2]) + (v1[13 + dvp] * d16[i][3]) - + (v1[12 + dvp] * d16[i][4]) + (v1[11 + dvp] * d16[i][5]) - + (v1[10 + dvp] * d16[i][6]) + (v1[9 + dvp] * d16[i][7]) - + (v1[8 + dvp] * d16[i][8]) + (v1[7 + dvp] * d16[i][9]) - + (v1[6 + dvp] * d16[i][10]) + (v1[5 + dvp] * d16[i][11]) - + (v1[4 + dvp] * d16[i][12]) + (v1[3 + dvp] * d16[i][13]) - + (v1[2 + dvp] * d16[i][14]) + (v1[1 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[0 + dvp] * d16[i][0]) + (v1[15 + dvp] * d16[i][1]) + (v1[14 + dvp] * d16[i][2]) + (v1[13 + dvp] * d16[i][3]) + (v1[12 + dvp] * d16[i][4]) + (v1[11 + dvp] * d16[i][5]) + (v1[10 + dvp] * d16[i][6]) + (v1[9 + dvp] * d16[i][7]) + (v1[8 + dvp] * d16[i][8]) + (v1[7 + dvp] * d16[i][9]) + (v1[6 + dvp] * d16[i][10]) + (v1[5 + dvp] * d16[i][11]) + (v1[4 + dvp] * d16[i][12]) + (v1[3 + dvp] * d16[i][13]) + (v1[2 + dvp] * d16[i][14]) + (v1[1 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1048,21 +1036,13 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { - float pcm_sample; + for (int i = 0; i < 32; i++) { + float pcm_sample; // final float[] dp = d16[i]; - pcm_sample = - (float) (((v2[0 + dvp] * d16[i][0]) + (v2[15 + dvp] * d16[i][1]) - + (v2[14 + dvp] * d16[i][2]) + (v2[13 + dvp] * d16[i][3]) - + (v2[12 + dvp] * d16[i][4]) + (v2[11 + dvp] * d16[i][5]) - + (v2[10 + dvp] * d16[i][6]) + (v2[9 + dvp] * d16[i][7]) - + (v2[8 + dvp] * d16[i][8]) + (v2[7 + dvp] * d16[i][9]) - + (v2[6 + dvp] * d16[i][10]) + (v2[5 + dvp] * d16[i][11]) - + (v2[4 + dvp] * d16[i][12]) + (v2[3 + dvp] * d16[i][13]) - + (v2[2 + dvp] * d16[i][14]) + (v2[1 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[0 + dvp] * d16[i][0]) + (v2[15 + dvp] * d16[i][1]) + (v2[14 + dvp] * d16[i][2]) + (v2[13 + dvp] * d16[i][3]) + (v2[12 + dvp] * d16[i][4]) + (v2[11 + dvp] * d16[i][5]) + (v2[10 + dvp] * d16[i][6]) + (v2[9 + dvp] * d16[i][7]) + (v2[8 + dvp] * d16[i][8]) + (v2[7 + dvp] * d16[i][9]) + (v2[6 + dvp] * d16[i][10]) + (v2[5 + dvp] * d16[i][11]) + (v2[4 + dvp] * d16[i][12]) + (v2[3 + dvp] * d16[i][13]) + (v2[2 + dvp] * d16[i][14]) + (v2[1 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1078,22 +1058,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; - - pcm_sample = - (float) (((v1[1 + dvp] * d16[i][0]) + (v1[0 + dvp] * d16[i][1]) - + (v1[15 + dvp] * d16[i][2]) + (v1[14 + dvp] * d16[i][3]) - + (v1[13 + dvp] * d16[i][4]) + (v1[12 + dvp] * d16[i][5]) - + (v1[11 + dvp] * d16[i][6]) + (v1[10 + dvp] * d16[i][7]) - + (v1[9 + dvp] * d16[i][8]) + (v1[8 + dvp] * d16[i][9]) - + (v1[7 + dvp] * d16[i][10]) + (v1[6 + dvp] * d16[i][11]) - + (v1[5 + dvp] * d16[i][12]) + (v1[4 + dvp] * d16[i][13]) - + (v1[3 + dvp] * d16[i][14]) + (v1[2 + dvp] * d16[i][15])) * scalefactor); + float pcm_sample; + + pcm_sample = (float) (((v1[1 + dvp] * d16[i][0]) + (v1[0 + dvp] * d16[i][1]) + (v1[15 + dvp] * d16[i][2]) + (v1[14 + dvp] * d16[i][3]) + (v1[13 + dvp] * d16[i][4]) + (v1[12 + dvp] * d16[i][5]) + (v1[11 + dvp] * d16[i][6]) + (v1[10 + dvp] * d16[i][7]) + (v1[9 + dvp] * d16[i][8]) + (v1[8 + dvp] * d16[i][9]) + (v1[7 + dvp] * d16[i][10]) + (v1[6 + dvp] * d16[i][11]) + (v1[5 + dvp] * d16[i][12]) + (v1[4 + dvp] * d16[i][13]) + (v1[3 + dvp] * d16[i][14]) + (v1[2 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1103,22 +1075,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; - - pcm_sample = - (float) (((v2[1 + dvp] * d16[i][0]) + (v2[0 + dvp] * d16[i][1]) - + (v2[15 + dvp] * d16[i][2]) + (v2[14 + dvp] * d16[i][3]) - + (v2[13 + dvp] * d16[i][4]) + (v2[12 + dvp] * d16[i][5]) - + (v2[11 + dvp] * d16[i][6]) + (v2[10 + dvp] * d16[i][7]) - + (v2[9 + dvp] * d16[i][8]) + (v2[8 + dvp] * d16[i][9]) - + (v2[7 + dvp] * d16[i][10]) + (v2[6 + dvp] * d16[i][11]) - + (v2[5 + dvp] * d16[i][12]) + (v2[4 + dvp] * d16[i][13]) - + (v2[3 + dvp] * d16[i][14]) + (v2[2 + dvp] * d16[i][15])) * scalefactor); + float pcm_sample; + + pcm_sample = (float) (((v2[1 + dvp] * d16[i][0]) + (v2[0 + dvp] * d16[i][1]) + (v2[15 + dvp] * d16[i][2]) + (v2[14 + dvp] * d16[i][3]) + (v2[13 + dvp] * d16[i][4]) + (v2[12 + dvp] * d16[i][5]) + (v2[11 + dvp] * d16[i][6]) + (v2[10 + dvp] * d16[i][7]) + (v2[9 + dvp] * d16[i][8]) + (v2[8 + dvp] * d16[i][9]) + (v2[7 + dvp] * d16[i][10]) + (v2[6 + dvp] * d16[i][11]) + (v2[5 + dvp] * d16[i][12]) + (v2[4 + dvp] * d16[i][13]) + (v2[3 + dvp] * d16[i][14]) + (v2[2 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1134,22 +1098,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; - - pcm_sample = - (float) (((v1[2 + dvp] * d16[i][0]) + (v1[1 + dvp] * d16[i][1]) - + (v1[0 + dvp] * d16[i][2]) + (v1[15 + dvp] * d16[i][3]) - + (v1[14 + dvp] * d16[i][4]) + (v1[13 + dvp] * d16[i][5]) - + (v1[12 + dvp] * d16[i][6]) + (v1[11 + dvp] * d16[i][7]) - + (v1[10 + dvp] * d16[i][8]) + (v1[9 + dvp] * d16[i][9]) - + (v1[8 + dvp] * d16[i][10]) + (v1[7 + dvp] * d16[i][11]) - + (v1[6 + dvp] * d16[i][12]) + (v1[5 + dvp] * d16[i][13]) - + (v1[4 + dvp] * d16[i][14]) + (v1[3 + dvp] * d16[i][15])) * scalefactor); + float pcm_sample; + + pcm_sample = (float) (((v1[2 + dvp] * d16[i][0]) + (v1[1 + dvp] * d16[i][1]) + (v1[0 + dvp] * d16[i][2]) + (v1[15 + dvp] * d16[i][3]) + (v1[14 + dvp] * d16[i][4]) + (v1[13 + dvp] * d16[i][5]) + (v1[12 + dvp] * d16[i][6]) + (v1[11 + dvp] * d16[i][7]) + (v1[10 + dvp] * d16[i][8]) + (v1[9 + dvp] * d16[i][9]) + (v1[8 + dvp] * d16[i][10]) + (v1[7 + dvp] * d16[i][11]) + (v1[6 + dvp] * d16[i][12]) + (v1[5 + dvp] * d16[i][13]) + (v1[4 + dvp] * d16[i][14]) + (v1[3 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1159,22 +1115,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; - - pcm_sample = - (float) (((v2[2 + dvp] * d16[i][0]) + (v2[1 + dvp] * d16[i][1]) - + (v2[0 + dvp] * d16[i][2]) + (v2[15 + dvp] * d16[i][3]) - + (v2[14 + dvp] * d16[i][4]) + (v2[13 + dvp] * d16[i][5]) - + (v2[12 + dvp] * d16[i][6]) + (v2[11 + dvp] * d16[i][7]) - + (v2[10 + dvp] * d16[i][8]) + (v2[9 + dvp] * d16[i][9]) - + (v2[8 + dvp] * d16[i][10]) + (v2[7 + dvp] * d16[i][11]) - + (v2[6 + dvp] * d16[i][12]) + (v2[5 + dvp] * d16[i][13]) - + (v2[4 + dvp] * d16[i][14]) + (v2[3 + dvp] * d16[i][15])) * scalefactor); + float pcm_sample; + + pcm_sample = (float) (((v2[2 + dvp] * d16[i][0]) + (v2[1 + dvp] * d16[i][1]) + (v2[0 + dvp] * d16[i][2]) + (v2[15 + dvp] * d16[i][3]) + (v2[14 + dvp] * d16[i][4]) + (v2[13 + dvp] * d16[i][5]) + (v2[12 + dvp] * d16[i][6]) + (v2[11 + dvp] * d16[i][7]) + (v2[10 + dvp] * d16[i][8]) + (v2[9 + dvp] * d16[i][9]) + (v2[8 + dvp] * d16[i][10]) + (v2[7 + dvp] * d16[i][11]) + (v2[6 + dvp] * d16[i][12]) + (v2[5 + dvp] * d16[i][13]) + (v2[4 + dvp] * d16[i][14]) + (v2[3 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1191,22 +1139,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; - - pcm_sample = - (float) (((v1[3 + dvp] * d16[i][0]) + (v1[2 + dvp] * d16[i][1]) - + (v1[1 + dvp] * d16[i][2]) + (v1[0 + dvp] * d16[i][3]) - + (v1[15 + dvp] * d16[i][4]) + (v1[14 + dvp] * d16[i][5]) - + (v1[13 + dvp] * d16[i][6]) + (v1[12 + dvp] * d16[i][7]) - + (v1[11 + dvp] * d16[i][8]) + (v1[10 + dvp] * d16[i][9]) - + (v1[9 + dvp] * d16[i][10]) + (v1[8 + dvp] * d16[i][11]) - + (v1[7 + dvp] * d16[i][12]) + (v1[6 + dvp] * d16[i][13]) - + (v1[5 + dvp] * d16[i][14]) + (v1[4 + dvp] * d16[i][15])) * scalefactor); + float pcm_sample; + + pcm_sample = (float) (((v1[3 + dvp] * d16[i][0]) + (v1[2 + dvp] * d16[i][1]) + (v1[1 + dvp] * d16[i][2]) + (v1[0 + dvp] * d16[i][3]) + (v1[15 + dvp] * d16[i][4]) + (v1[14 + dvp] * d16[i][5]) + (v1[13 + dvp] * d16[i][6]) + (v1[12 + dvp] * d16[i][7]) + (v1[11 + dvp] * d16[i][8]) + (v1[10 + dvp] * d16[i][9]) + (v1[9 + dvp] * d16[i][10]) + (v1[8 + dvp] * d16[i][11]) + (v1[7 + dvp] * d16[i][12]) + (v1[6 + dvp] * d16[i][13]) + (v1[5 + dvp] * d16[i][14]) + (v1[4 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1217,22 +1157,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; - - pcm_sample = - (float) (((v2[3 + dvp] * d16[i][0]) + (v2[2 + dvp] * d16[i][1]) - + (v2[1 + dvp] * d16[i][2]) + (v2[0 + dvp] * d16[i][3]) - + (v2[15 + dvp] * d16[i][4]) + (v2[14 + dvp] * d16[i][5]) - + (v2[13 + dvp] * d16[i][6]) + (v2[12 + dvp] * d16[i][7]) - + (v2[11 + dvp] * d16[i][8]) + (v2[10 + dvp] * d16[i][9]) - + (v2[9 + dvp] * d16[i][10]) + (v2[8 + dvp] * d16[i][11]) - + (v2[7 + dvp] * d16[i][12]) + (v2[6 + dvp] * d16[i][13]) - + (v2[5 + dvp] * d16[i][14]) + (v2[4 + dvp] * d16[i][15])) * scalefactor); + float pcm_sample; + + pcm_sample = (float) (((v2[3 + dvp] * d16[i][0]) + (v2[2 + dvp] * d16[i][1]) + (v2[1 + dvp] * d16[i][2]) + (v2[0 + dvp] * d16[i][3]) + (v2[15 + dvp] * d16[i][4]) + (v2[14 + dvp] * d16[i][5]) + (v2[13 + dvp] * d16[i][6]) + (v2[12 + dvp] * d16[i][7]) + (v2[11 + dvp] * d16[i][8]) + (v2[10 + dvp] * d16[i][9]) + (v2[9 + dvp] * d16[i][10]) + (v2[8 + dvp] * d16[i][11]) + (v2[7 + dvp] * d16[i][12]) + (v2[6 + dvp] * d16[i][13]) + (v2[5 + dvp] * d16[i][14]) + (v2[4 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1249,21 +1181,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[4 + dvp] * d16[i][0]) + (v1[3 + dvp] * d16[i][1]) - + (v1[2 + dvp] * d16[i][2]) + (v1[1 + dvp] * d16[i][3]) + (v1[0 + dvp] * d16[i][4]) - + (v1[15 + dvp] * d16[i][5]) + (v1[14 + dvp] * d16[i][6]) - + (v1[13 + dvp] * d16[i][7]) + (v1[12 + dvp] * d16[i][8]) - + (v1[11 + dvp] * d16[i][9]) + (v1[10 + dvp] * d16[i][10]) - + (v1[9 + dvp] * d16[i][11]) + (v1[8 + dvp] * d16[i][12]) - + (v1[7 + dvp] * d16[i][13]) + (v1[6 + dvp] * d16[i][14]) + (v1[5 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[4 + dvp] * d16[i][0]) + (v1[3 + dvp] * d16[i][1]) + (v1[2 + dvp] * d16[i][2]) + (v1[1 + dvp] * d16[i][3]) + (v1[0 + dvp] * d16[i][4]) + (v1[15 + dvp] * d16[i][5]) + (v1[14 + dvp] * d16[i][6]) + (v1[13 + dvp] * d16[i][7]) + (v1[12 + dvp] * d16[i][8]) + (v1[11 + dvp] * d16[i][9]) + (v1[10 + dvp] * d16[i][10]) + (v1[9 + dvp] * d16[i][11]) + (v1[8 + dvp] * d16[i][12]) + (v1[7 + dvp] * d16[i][13]) + (v1[6 + dvp] * d16[i][14]) + (v1[5 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1274,21 +1199,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[4 + dvp] * d16[i][0]) + (v2[3 + dvp] * d16[i][1]) - + (v2[2 + dvp] * d16[i][2]) + (v2[1 + dvp] * d16[i][3]) + (v2[0 + dvp] * d16[i][4]) - + (v2[15 + dvp] * d16[i][5]) + (v2[14 + dvp] * d16[i][6]) - + (v2[13 + dvp] * d16[i][7]) + (v2[12 + dvp] * d16[i][8]) - + (v2[11 + dvp] * d16[i][9]) + (v2[10 + dvp] * d16[i][10]) - + (v2[9 + dvp] * d16[i][11]) + (v2[8 + dvp] * d16[i][12]) - + (v2[7 + dvp] * d16[i][13]) + (v2[6 + dvp] * d16[i][14]) + (v2[5 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[4 + dvp] * d16[i][0]) + (v2[3 + dvp] * d16[i][1]) + (v2[2 + dvp] * d16[i][2]) + (v2[1 + dvp] * d16[i][3]) + (v2[0 + dvp] * d16[i][4]) + (v2[15 + dvp] * d16[i][5]) + (v2[14 + dvp] * d16[i][6]) + (v2[13 + dvp] * d16[i][7]) + (v2[12 + dvp] * d16[i][8]) + (v2[11 + dvp] * d16[i][9]) + (v2[10 + dvp] * d16[i][10]) + (v2[9 + dvp] * d16[i][11]) + (v2[8 + dvp] * d16[i][12]) + (v2[7 + dvp] * d16[i][13]) + (v2[6 + dvp] * d16[i][14]) + (v2[5 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1305,21 +1223,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[5 + dvp] * d16[i][0]) + (v1[4 + dvp] * d16[i][1]) - + (v1[3 + dvp] * d16[i][2]) + (v1[2 + dvp] * d16[i][3]) + (v1[1 + dvp] * d16[i][4]) - + (v1[0 + dvp] * d16[i][5]) + (v1[15 + dvp] * d16[i][6]) - + (v1[14 + dvp] * d16[i][7]) + (v1[13 + dvp] * d16[i][8]) - + (v1[12 + dvp] * d16[i][9]) + (v1[11 + dvp] * d16[i][10]) - + (v1[10 + dvp] * d16[i][11]) + (v1[9 + dvp] * d16[i][12]) - + (v1[8 + dvp] * d16[i][13]) + (v1[7 + dvp] * d16[i][14]) + (v1[6 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[5 + dvp] * d16[i][0]) + (v1[4 + dvp] * d16[i][1]) + (v1[3 + dvp] * d16[i][2]) + (v1[2 + dvp] * d16[i][3]) + (v1[1 + dvp] * d16[i][4]) + (v1[0 + dvp] * d16[i][5]) + (v1[15 + dvp] * d16[i][6]) + (v1[14 + dvp] * d16[i][7]) + (v1[13 + dvp] * d16[i][8]) + (v1[12 + dvp] * d16[i][9]) + (v1[11 + dvp] * d16[i][10]) + (v1[10 + dvp] * d16[i][11]) + (v1[9 + dvp] * d16[i][12]) + (v1[8 + dvp] * d16[i][13]) + (v1[7 + dvp] * d16[i][14]) + (v1[6 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1330,21 +1241,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[5 + dvp] * d16[i][0]) + (v2[4 + dvp] * d16[i][1]) - + (v2[3 + dvp] * d16[i][2]) + (v2[2 + dvp] * d16[i][3]) + (v2[1 + dvp] * d16[i][4]) - + (v2[0 + dvp] * d16[i][5]) + (v2[15 + dvp] * d16[i][6]) - + (v2[14 + dvp] * d16[i][7]) + (v2[13 + dvp] * d16[i][8]) - + (v2[12 + dvp] * d16[i][9]) + (v2[11 + dvp] * d16[i][10]) - + (v2[10 + dvp] * d16[i][11]) + (v2[9 + dvp] * d16[i][12]) - + (v2[8 + dvp] * d16[i][13]) + (v2[7 + dvp] * d16[i][14]) + (v2[6 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[5 + dvp] * d16[i][0]) + (v2[4 + dvp] * d16[i][1]) + (v2[3 + dvp] * d16[i][2]) + (v2[2 + dvp] * d16[i][3]) + (v2[1 + dvp] * d16[i][4]) + (v2[0 + dvp] * d16[i][5]) + (v2[15 + dvp] * d16[i][6]) + (v2[14 + dvp] * d16[i][7]) + (v2[13 + dvp] * d16[i][8]) + (v2[12 + dvp] * d16[i][9]) + (v2[11 + dvp] * d16[i][10]) + (v2[10 + dvp] * d16[i][11]) + (v2[9 + dvp] * d16[i][12]) + (v2[8 + dvp] * d16[i][13]) + (v2[7 + dvp] * d16[i][14]) + (v2[6 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1361,21 +1265,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[6 + dvp] * d16[i][0]) + (v1[5 + dvp] * d16[i][1]) - + (v1[4 + dvp] * d16[i][2]) + (v1[3 + dvp] * d16[i][3]) + (v1[2 + dvp] * d16[i][4]) - + (v1[1 + dvp] * d16[i][5]) + (v1[0 + dvp] * d16[i][6]) - + (v1[15 + dvp] * d16[i][7]) + (v1[14 + dvp] * d16[i][8]) - + (v1[13 + dvp] * d16[i][9]) + (v1[12 + dvp] * d16[i][10]) - + (v1[11 + dvp] * d16[i][11]) + (v1[10 + dvp] * d16[i][12]) - + (v1[9 + dvp] * d16[i][13]) + (v1[8 + dvp] * d16[i][14]) + (v1[7 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[6 + dvp] * d16[i][0]) + (v1[5 + dvp] * d16[i][1]) + (v1[4 + dvp] * d16[i][2]) + (v1[3 + dvp] * d16[i][3]) + (v1[2 + dvp] * d16[i][4]) + (v1[1 + dvp] * d16[i][5]) + (v1[0 + dvp] * d16[i][6]) + (v1[15 + dvp] * d16[i][7]) + (v1[14 + dvp] * d16[i][8]) + (v1[13 + dvp] * d16[i][9]) + (v1[12 + dvp] * d16[i][10]) + (v1[11 + dvp] * d16[i][11]) + (v1[10 + dvp] * d16[i][12]) + (v1[9 + dvp] * d16[i][13]) + (v1[8 + dvp] * d16[i][14]) + (v1[7 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1386,21 +1283,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[6 + dvp] * d16[i][0]) + (v2[5 + dvp] * d16[i][1]) - + (v2[4 + dvp] * d16[i][2]) + (v2[3 + dvp] * d16[i][3]) + (v2[2 + dvp] * d16[i][4]) - + (v2[1 + dvp] * d16[i][5]) + (v2[0 + dvp] * d16[i][6]) - + (v2[15 + dvp] * d16[i][7]) + (v2[14 + dvp] * d16[i][8]) - + (v2[13 + dvp] * d16[i][9]) + (v2[12 + dvp] * d16[i][10]) - + (v2[11 + dvp] * d16[i][11]) + (v2[10 + dvp] * d16[i][12]) - + (v2[9 + dvp] * d16[i][13]) + (v2[8 + dvp] * d16[i][14]) + (v2[7 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[6 + dvp] * d16[i][0]) + (v2[5 + dvp] * d16[i][1]) + (v2[4 + dvp] * d16[i][2]) + (v2[3 + dvp] * d16[i][3]) + (v2[2 + dvp] * d16[i][4]) + (v2[1 + dvp] * d16[i][5]) + (v2[0 + dvp] * d16[i][6]) + (v2[15 + dvp] * d16[i][7]) + (v2[14 + dvp] * d16[i][8]) + (v2[13 + dvp] * d16[i][9]) + (v2[12 + dvp] * d16[i][10]) + (v2[11 + dvp] * d16[i][11]) + (v2[10 + dvp] * d16[i][12]) + (v2[9 + dvp] * d16[i][13]) + (v2[8 + dvp] * d16[i][14]) + (v2[7 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1417,21 +1307,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[7 + dvp] * d16[i][0]) + (v1[6 + dvp] * d16[i][1]) - + (v1[5 + dvp] * d16[i][2]) + (v1[4 + dvp] * d16[i][3]) + (v1[3 + dvp] * d16[i][4]) - + (v1[2 + dvp] * d16[i][5]) + (v1[1 + dvp] * d16[i][6]) + (v1[0 + dvp] * d16[i][7]) - + (v1[15 + dvp] * d16[i][8]) + (v1[14 + dvp] * d16[i][9]) - + (v1[13 + dvp] * d16[i][10]) + (v1[12 + dvp] * d16[i][11]) - + (v1[11 + dvp] * d16[i][12]) + (v1[10 + dvp] * d16[i][13]) - + (v1[9 + dvp] * d16[i][14]) + (v1[8 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[7 + dvp] * d16[i][0]) + (v1[6 + dvp] * d16[i][1]) + (v1[5 + dvp] * d16[i][2]) + (v1[4 + dvp] * d16[i][3]) + (v1[3 + dvp] * d16[i][4]) + (v1[2 + dvp] * d16[i][5]) + (v1[1 + dvp] * d16[i][6]) + (v1[0 + dvp] * d16[i][7]) + (v1[15 + dvp] * d16[i][8]) + (v1[14 + dvp] * d16[i][9]) + (v1[13 + dvp] * d16[i][10]) + (v1[12 + dvp] * d16[i][11]) + (v1[11 + dvp] * d16[i][12]) + (v1[10 + dvp] * d16[i][13]) + (v1[9 + dvp] * d16[i][14]) + (v1[8 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1442,21 +1325,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[7 + dvp] * d16[i][0]) + (v2[6 + dvp] * d16[i][1]) - + (v2[5 + dvp] * d16[i][2]) + (v2[4 + dvp] * d16[i][3]) + (v2[3 + dvp] * d16[i][4]) - + (v2[2 + dvp] * d16[i][5]) + (v2[1 + dvp] * d16[i][6]) + (v2[0 + dvp] * d16[i][7]) - + (v2[15 + dvp] * d16[i][8]) + (v2[14 + dvp] * d16[i][9]) - + (v2[13 + dvp] * d16[i][10]) + (v2[12 + dvp] * d16[i][11]) - + (v2[11 + dvp] * d16[i][12]) + (v2[10 + dvp] * d16[i][13]) - + (v2[9 + dvp] * d16[i][14]) + (v2[8 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[7 + dvp] * d16[i][0]) + (v2[6 + dvp] * d16[i][1]) + (v2[5 + dvp] * d16[i][2]) + (v2[4 + dvp] * d16[i][3]) + (v2[3 + dvp] * d16[i][4]) + (v2[2 + dvp] * d16[i][5]) + (v2[1 + dvp] * d16[i][6]) + (v2[0 + dvp] * d16[i][7]) + (v2[15 + dvp] * d16[i][8]) + (v2[14 + dvp] * d16[i][9]) + (v2[13 + dvp] * d16[i][10]) + (v2[12 + dvp] * d16[i][11]) + (v2[11 + dvp] * d16[i][12]) + (v2[10 + dvp] * d16[i][13]) + (v2[9 + dvp] * d16[i][14]) + (v2[8 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1474,21 +1350,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[8 + dvp] * d16[i][0]) + (v1[7 + dvp] * d16[i][1]) - + (v1[6 + dvp] * d16[i][2]) + (v1[5 + dvp] * d16[i][3]) + (v1[4 + dvp] * d16[i][4]) - + (v1[3 + dvp] * d16[i][5]) + (v1[2 + dvp] * d16[i][6]) + (v1[1 + dvp] * d16[i][7]) - + (v1[0 + dvp] * d16[i][8]) + (v1[15 + dvp] * d16[i][9]) - + (v1[14 + dvp] * d16[i][10]) + (v1[13 + dvp] * d16[i][11]) - + (v1[12 + dvp] * d16[i][12]) + (v1[11 + dvp] * d16[i][13]) - + (v1[10 + dvp] * d16[i][14]) + (v1[9 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[8 + dvp] * d16[i][0]) + (v1[7 + dvp] * d16[i][1]) + (v1[6 + dvp] * d16[i][2]) + (v1[5 + dvp] * d16[i][3]) + (v1[4 + dvp] * d16[i][4]) + (v1[3 + dvp] * d16[i][5]) + (v1[2 + dvp] * d16[i][6]) + (v1[1 + dvp] * d16[i][7]) + (v1[0 + dvp] * d16[i][8]) + (v1[15 + dvp] * d16[i][9]) + (v1[14 + dvp] * d16[i][10]) + (v1[13 + dvp] * d16[i][11]) + (v1[12 + dvp] * d16[i][12]) + (v1[11 + dvp] * d16[i][13]) + (v1[10 + dvp] * d16[i][14]) + (v1[9 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1500,21 +1369,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[8 + dvp] * d16[i][0]) + (v2[7 + dvp] * d16[i][1]) - + (v2[6 + dvp] * d16[i][2]) + (v2[5 + dvp] * d16[i][3]) + (v2[4 + dvp] * d16[i][4]) - + (v2[3 + dvp] * d16[i][5]) + (v2[2 + dvp] * d16[i][6]) + (v2[1 + dvp] * d16[i][7]) - + (v2[0 + dvp] * d16[i][8]) + (v2[15 + dvp] * d16[i][9]) - + (v2[14 + dvp] * d16[i][10]) + (v2[13 + dvp] * d16[i][11]) - + (v2[12 + dvp] * d16[i][12]) + (v2[11 + dvp] * d16[i][13]) - + (v2[10 + dvp] * d16[i][14]) + (v2[9 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[8 + dvp] * d16[i][0]) + (v2[7 + dvp] * d16[i][1]) + (v2[6 + dvp] * d16[i][2]) + (v2[5 + dvp] * d16[i][3]) + (v2[4 + dvp] * d16[i][4]) + (v2[3 + dvp] * d16[i][5]) + (v2[2 + dvp] * d16[i][6]) + (v2[1 + dvp] * d16[i][7]) + (v2[0 + dvp] * d16[i][8]) + (v2[15 + dvp] * d16[i][9]) + (v2[14 + dvp] * d16[i][10]) + (v2[13 + dvp] * d16[i][11]) + (v2[12 + dvp] * d16[i][12]) + (v2[11 + dvp] * d16[i][13]) + (v2[10 + dvp] * d16[i][14]) + (v2[9 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1531,21 +1393,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[9 + dvp] * d16[i][0]) + (v1[8 + dvp] * d16[i][1]) - + (v1[7 + dvp] * d16[i][2]) + (v1[6 + dvp] * d16[i][3]) + (v1[5 + dvp] * d16[i][4]) - + (v1[4 + dvp] * d16[i][5]) + (v1[3 + dvp] * d16[i][6]) + (v1[2 + dvp] * d16[i][7]) - + (v1[1 + dvp] * d16[i][8]) + (v1[0 + dvp] * d16[i][9]) - + (v1[15 + dvp] * d16[i][10]) + (v1[14 + dvp] * d16[i][11]) - + (v1[13 + dvp] * d16[i][12]) + (v1[12 + dvp] * d16[i][13]) - + (v1[11 + dvp] * d16[i][14]) + (v1[10 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[9 + dvp] * d16[i][0]) + (v1[8 + dvp] * d16[i][1]) + (v1[7 + dvp] * d16[i][2]) + (v1[6 + dvp] * d16[i][3]) + (v1[5 + dvp] * d16[i][4]) + (v1[4 + dvp] * d16[i][5]) + (v1[3 + dvp] * d16[i][6]) + (v1[2 + dvp] * d16[i][7]) + (v1[1 + dvp] * d16[i][8]) + (v1[0 + dvp] * d16[i][9]) + (v1[15 + dvp] * d16[i][10]) + (v1[14 + dvp] * d16[i][11]) + (v1[13 + dvp] * d16[i][12]) + (v1[12 + dvp] * d16[i][13]) + (v1[11 + dvp] * d16[i][14]) + (v1[10 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1556,21 +1411,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[9 + dvp] * d16[i][0]) + (v2[8 + dvp] * d16[i][1]) - + (v2[7 + dvp] * d16[i][2]) + (v2[6 + dvp] * d16[i][3]) + (v2[5 + dvp] * d16[i][4]) - + (v2[4 + dvp] * d16[i][5]) + (v2[3 + dvp] * d16[i][6]) + (v2[2 + dvp] * d16[i][7]) - + (v2[1 + dvp] * d16[i][8]) + (v2[0 + dvp] * d16[i][9]) - + (v2[15 + dvp] * d16[i][10]) + (v2[14 + dvp] * d16[i][11]) - + (v2[13 + dvp] * d16[i][12]) + (v2[12 + dvp] * d16[i][13]) - + (v2[11 + dvp] * d16[i][14]) + (v2[10 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[9 + dvp] * d16[i][0]) + (v2[8 + dvp] * d16[i][1]) + (v2[7 + dvp] * d16[i][2]) + (v2[6 + dvp] * d16[i][3]) + (v2[5 + dvp] * d16[i][4]) + (v2[4 + dvp] * d16[i][5]) + (v2[3 + dvp] * d16[i][6]) + (v2[2 + dvp] * d16[i][7]) + (v2[1 + dvp] * d16[i][8]) + (v2[0 + dvp] * d16[i][9]) + (v2[15 + dvp] * d16[i][10]) + (v2[14 + dvp] * d16[i][11]) + (v2[13 + dvp] * d16[i][12]) + (v2[12 + dvp] * d16[i][13]) + (v2[11 + dvp] * d16[i][14]) + (v2[10 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1585,21 +1433,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[10 + dvp] * d16[i][0]) + (v1[9 + dvp] * d16[i][1]) - + (v1[8 + dvp] * d16[i][2]) + (v1[7 + dvp] * d16[i][3]) + (v1[6 + dvp] * d16[i][4]) - + (v1[5 + dvp] * d16[i][5]) + (v1[4 + dvp] * d16[i][6]) + (v1[3 + dvp] * d16[i][7]) - + (v1[2 + dvp] * d16[i][8]) + (v1[1 + dvp] * d16[i][9]) - + (v1[0 + dvp] * d16[i][10]) + (v1[15 + dvp] * d16[i][11]) - + (v1[14 + dvp] * d16[i][12]) + (v1[13 + dvp] * d16[i][13]) - + (v1[12 + dvp] * d16[i][14]) + (v1[11 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[10 + dvp] * d16[i][0]) + (v1[9 + dvp] * d16[i][1]) + (v1[8 + dvp] * d16[i][2]) + (v1[7 + dvp] * d16[i][3]) + (v1[6 + dvp] * d16[i][4]) + (v1[5 + dvp] * d16[i][5]) + (v1[4 + dvp] * d16[i][6]) + (v1[3 + dvp] * d16[i][7]) + (v1[2 + dvp] * d16[i][8]) + (v1[1 + dvp] * d16[i][9]) + (v1[0 + dvp] * d16[i][10]) + (v1[15 + dvp] * d16[i][11]) + (v1[14 + dvp] * d16[i][12]) + (v1[13 + dvp] * d16[i][13]) + (v1[12 + dvp] * d16[i][14]) + (v1[11 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1609,21 +1450,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[10 + dvp] * d16[i][0]) + (v2[9 + dvp] * d16[i][1]) - + (v2[8 + dvp] * d16[i][2]) + (v2[7 + dvp] * d16[i][3]) + (v2[6 + dvp] * d16[i][4]) - + (v2[5 + dvp] * d16[i][5]) + (v2[4 + dvp] * d16[i][6]) + (v2[3 + dvp] * d16[i][7]) - + (v2[2 + dvp] * d16[i][8]) + (v2[1 + dvp] * d16[i][9]) - + (v2[0 + dvp] * d16[i][10]) + (v2[15 + dvp] * d16[i][11]) - + (v2[14 + dvp] * d16[i][12]) + (v2[13 + dvp] * d16[i][13]) - + (v2[12 + dvp] * d16[i][14]) + (v2[11 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[10 + dvp] * d16[i][0]) + (v2[9 + dvp] * d16[i][1]) + (v2[8 + dvp] * d16[i][2]) + (v2[7 + dvp] * d16[i][3]) + (v2[6 + dvp] * d16[i][4]) + (v2[5 + dvp] * d16[i][5]) + (v2[4 + dvp] * d16[i][6]) + (v2[3 + dvp] * d16[i][7]) + (v2[2 + dvp] * d16[i][8]) + (v2[1 + dvp] * d16[i][9]) + (v2[0 + dvp] * d16[i][10]) + (v2[15 + dvp] * d16[i][11]) + (v2[14 + dvp] * d16[i][12]) + (v2[13 + dvp] * d16[i][13]) + (v2[12 + dvp] * d16[i][14]) + (v2[11 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1640,21 +1474,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[11 + dvp] * d16[i][0]) + (v1[10 + dvp] * d16[i][1]) - + (v1[9 + dvp] * d16[i][2]) + (v1[8 + dvp] * d16[i][3]) + (v1[7 + dvp] * d16[i][4]) - + (v1[6 + dvp] * d16[i][5]) + (v1[5 + dvp] * d16[i][6]) + (v1[4 + dvp] * d16[i][7]) - + (v1[3 + dvp] * d16[i][8]) + (v1[2 + dvp] * d16[i][9]) - + (v1[1 + dvp] * d16[i][10]) + (v1[0 + dvp] * d16[i][11]) - + (v1[15 + dvp] * d16[i][12]) + (v1[14 + dvp] * d16[i][13]) - + (v1[13 + dvp] * d16[i][14]) + (v1[12 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[11 + dvp] * d16[i][0]) + (v1[10 + dvp] * d16[i][1]) + (v1[9 + dvp] * d16[i][2]) + (v1[8 + dvp] * d16[i][3]) + (v1[7 + dvp] * d16[i][4]) + (v1[6 + dvp] * d16[i][5]) + (v1[5 + dvp] * d16[i][6]) + (v1[4 + dvp] * d16[i][7]) + (v1[3 + dvp] * d16[i][8]) + (v1[2 + dvp] * d16[i][9]) + (v1[1 + dvp] * d16[i][10]) + (v1[0 + dvp] * d16[i][11]) + (v1[15 + dvp] * d16[i][12]) + (v1[14 + dvp] * d16[i][13]) + (v1[13 + dvp] * d16[i][14]) + (v1[12 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1665,21 +1492,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[11 + dvp] * d16[i][0]) + (v2[10 + dvp] * d16[i][1]) - + (v2[9 + dvp] * d16[i][2]) + (v2[8 + dvp] * d16[i][3]) + (v2[7 + dvp] * d16[i][4]) - + (v2[6 + dvp] * d16[i][5]) + (v2[5 + dvp] * d16[i][6]) + (v2[4 + dvp] * d16[i][7]) - + (v2[3 + dvp] * d16[i][8]) + (v2[2 + dvp] * d16[i][9]) - + (v2[1 + dvp] * d16[i][10]) + (v2[0 + dvp] * d16[i][11]) - + (v2[15 + dvp] * d16[i][12]) + (v2[14 + dvp] * d16[i][13]) - + (v2[13 + dvp] * d16[i][14]) + (v2[12 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[11 + dvp] * d16[i][0]) + (v2[10 + dvp] * d16[i][1]) + (v2[9 + dvp] * d16[i][2]) + (v2[8 + dvp] * d16[i][3]) + (v2[7 + dvp] * d16[i][4]) + (v2[6 + dvp] * d16[i][5]) + (v2[5 + dvp] * d16[i][6]) + (v2[4 + dvp] * d16[i][7]) + (v2[3 + dvp] * d16[i][8]) + (v2[2 + dvp] * d16[i][9]) + (v2[1 + dvp] * d16[i][10]) + (v2[0 + dvp] * d16[i][11]) + (v2[15 + dvp] * d16[i][12]) + (v2[14 + dvp] * d16[i][13]) + (v2[13 + dvp] * d16[i][14]) + (v2[12 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1695,21 +1515,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[12 + dvp] * d16[i][0]) + (v1[11 + dvp] * d16[i][1]) - + (v1[10 + dvp] * d16[i][2]) + (v1[9 + dvp] * d16[i][3]) - + (v1[8 + dvp] * d16[i][4]) + (v1[7 + dvp] * d16[i][5]) + (v1[6 + dvp] * d16[i][6]) - + (v1[5 + dvp] * d16[i][7]) + (v1[4 + dvp] * d16[i][8]) + (v1[3 + dvp] * d16[i][9]) - + (v1[2 + dvp] * d16[i][10]) + (v1[1 + dvp] * d16[i][11]) - + (v1[0 + dvp] * d16[i][12]) + (v1[15 + dvp] * d16[i][13]) - + (v1[14 + dvp] * d16[i][14]) + (v1[13 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[12 + dvp] * d16[i][0]) + (v1[11 + dvp] * d16[i][1]) + (v1[10 + dvp] * d16[i][2]) + (v1[9 + dvp] * d16[i][3]) + (v1[8 + dvp] * d16[i][4]) + (v1[7 + dvp] * d16[i][5]) + (v1[6 + dvp] * d16[i][6]) + (v1[5 + dvp] * d16[i][7]) + (v1[4 + dvp] * d16[i][8]) + (v1[3 + dvp] * d16[i][9]) + (v1[2 + dvp] * d16[i][10]) + (v1[1 + dvp] * d16[i][11]) + (v1[0 + dvp] * d16[i][12]) + (v1[15 + dvp] * d16[i][13]) + (v1[14 + dvp] * d16[i][14]) + (v1[13 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1719,21 +1532,14 @@ final class SynthesisFilter { // final float[] vp = actual_v; // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[12 + dvp] * d16[i][0]) + (v2[11 + dvp] * d16[i][1]) - + (v2[10 + dvp] * d16[i][2]) + (v2[9 + dvp] * d16[i][3]) - + (v2[8 + dvp] * d16[i][4]) + (v2[7 + dvp] * d16[i][5]) + (v2[6 + dvp] * d16[i][6]) - + (v2[5 + dvp] * d16[i][7]) + (v2[4 + dvp] * d16[i][8]) + (v2[3 + dvp] * d16[i][9]) - + (v2[2 + dvp] * d16[i][10]) + (v2[1 + dvp] * d16[i][11]) - + (v2[0 + dvp] * d16[i][12]) + (v2[15 + dvp] * d16[i][13]) - + (v2[14 + dvp] * d16[i][14]) + (v2[13 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[12 + dvp] * d16[i][0]) + (v2[11 + dvp] * d16[i][1]) + (v2[10 + dvp] * d16[i][2]) + (v2[9 + dvp] * d16[i][3]) + (v2[8 + dvp] * d16[i][4]) + (v2[7 + dvp] * d16[i][5]) + (v2[6 + dvp] * d16[i][6]) + (v2[5 + dvp] * d16[i][7]) + (v2[4 + dvp] * d16[i][8]) + (v2[3 + dvp] * d16[i][9]) + (v2[2 + dvp] * d16[i][10]) + (v2[1 + dvp] * d16[i][11]) + (v2[0 + dvp] * d16[i][12]) + (v2[15 + dvp] * d16[i][13]) + (v2[14 + dvp] * d16[i][14]) + (v2[13 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1750,21 +1556,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[13 + dvp] * d16[i][0]) + (v1[12 + dvp] * d16[i][1]) - + (v1[11 + dvp] * d16[i][2]) + (v1[10 + dvp] * d16[i][3]) - + (v1[9 + dvp] * d16[i][4]) + (v1[8 + dvp] * d16[i][5]) + (v1[7 + dvp] * d16[i][6]) - + (v1[6 + dvp] * d16[i][7]) + (v1[5 + dvp] * d16[i][8]) + (v1[4 + dvp] * d16[i][9]) - + (v1[3 + dvp] * d16[i][10]) + (v1[2 + dvp] * d16[i][11]) - + (v1[1 + dvp] * d16[i][12]) + (v1[0 + dvp] * d16[i][13]) - + (v1[15 + dvp] * d16[i][14]) + (v1[14 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[13 + dvp] * d16[i][0]) + (v1[12 + dvp] * d16[i][1]) + (v1[11 + dvp] * d16[i][2]) + (v1[10 + dvp] * d16[i][3]) + (v1[9 + dvp] * d16[i][4]) + (v1[8 + dvp] * d16[i][5]) + (v1[7 + dvp] * d16[i][6]) + (v1[6 + dvp] * d16[i][7]) + (v1[5 + dvp] * d16[i][8]) + (v1[4 + dvp] * d16[i][9]) + (v1[3 + dvp] * d16[i][10]) + (v1[2 + dvp] * d16[i][11]) + (v1[1 + dvp] * d16[i][12]) + (v1[0 + dvp] * d16[i][13]) + (v1[15 + dvp] * d16[i][14]) + (v1[14 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1775,21 +1574,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[13 + dvp] * d16[i][0]) + (v2[12 + dvp] * d16[i][1]) - + (v2[11 + dvp] * d16[i][2]) + (v2[10 + dvp] * d16[i][3]) - + (v2[9 + dvp] * d16[i][4]) + (v2[8 + dvp] * d16[i][5]) + (v2[7 + dvp] * d16[i][6]) - + (v2[6 + dvp] * d16[i][7]) + (v2[5 + dvp] * d16[i][8]) + (v2[4 + dvp] * d16[i][9]) - + (v2[3 + dvp] * d16[i][10]) + (v2[2 + dvp] * d16[i][11]) - + (v2[1 + dvp] * d16[i][12]) + (v2[0 + dvp] * d16[i][13]) - + (v2[15 + dvp] * d16[i][14]) + (v2[14 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[13 + dvp] * d16[i][0]) + (v2[12 + dvp] * d16[i][1]) + (v2[11 + dvp] * d16[i][2]) + (v2[10 + dvp] * d16[i][3]) + (v2[9 + dvp] * d16[i][4]) + (v2[8 + dvp] * d16[i][5]) + (v2[7 + dvp] * d16[i][6]) + (v2[6 + dvp] * d16[i][7]) + (v2[5 + dvp] * d16[i][8]) + (v2[4 + dvp] * d16[i][9]) + (v2[3 + dvp] * d16[i][10]) + (v2[2 + dvp] * d16[i][11]) + (v2[1 + dvp] * d16[i][12]) + (v2[0 + dvp] * d16[i][13]) + (v2[15 + dvp] * d16[i][14]) + (v2[14 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1806,21 +1598,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v1[14 + dvp] * d16[i][0]) + (v1[13 + dvp] * d16[i][1]) - + (v1[12 + dvp] * d16[i][2]) + (v1[11 + dvp] * d16[i][3]) - + (v1[10 + dvp] * d16[i][4]) + (v1[9 + dvp] * d16[i][5]) - + (v1[8 + dvp] * d16[i][6]) + (v1[7 + dvp] * d16[i][7]) + (v1[6 + dvp] * d16[i][8]) - + (v1[5 + dvp] * d16[i][9]) + (v1[4 + dvp] * d16[i][10]) - + (v1[3 + dvp] * d16[i][11]) + (v1[2 + dvp] * d16[i][12]) - + (v1[1 + dvp] * d16[i][13]) + (v1[0 + dvp] * d16[i][14]) + (v1[15 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[14 + dvp] * d16[i][0]) + (v1[13 + dvp] * d16[i][1]) + (v1[12 + dvp] * d16[i][2]) + (v1[11 + dvp] * d16[i][3]) + (v1[10 + dvp] * d16[i][4]) + (v1[9 + dvp] * d16[i][5]) + (v1[8 + dvp] * d16[i][6]) + (v1[7 + dvp] * d16[i][7]) + (v1[6 + dvp] * d16[i][8]) + (v1[5 + dvp] * d16[i][9]) + (v1[4 + dvp] * d16[i][10]) + (v1[3 + dvp] * d16[i][11]) + (v1[2 + dvp] * d16[i][12]) + (v1[1 + dvp] * d16[i][13]) + (v1[0 + dvp] * d16[i][14]) + (v1[15 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1831,21 +1616,14 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) { // final float[] dp = d16[i]; - float pcm_sample; + float pcm_sample; - pcm_sample = - (float) (((v2[14 + dvp] * d16[i][0]) + (v2[13 + dvp] * d16[i][1]) - + (v2[12 + dvp] * d16[i][2]) + (v2[11 + dvp] * d16[i][3]) - + (v2[10 + dvp] * d16[i][4]) + (v2[9 + dvp] * d16[i][5]) - + (v2[8 + dvp] * d16[i][6]) + (v2[7 + dvp] * d16[i][7]) + (v2[6 + dvp] * d16[i][8]) - + (v2[5 + dvp] * d16[i][9]) + (v2[4 + dvp] * d16[i][10]) - + (v2[3 + dvp] * d16[i][11]) + (v2[2 + dvp] * d16[i][12]) - + (v2[1 + dvp] * d16[i][13]) + (v2[0 + dvp] * d16[i][14]) + (v2[15 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[14 + dvp] * d16[i][0]) + (v2[13 + dvp] * d16[i][1]) + (v2[12 + dvp] * d16[i][2]) + (v2[11 + dvp] * d16[i][3]) + (v2[10 + dvp] * d16[i][4]) + (v2[9 + dvp] * d16[i][5]) + (v2[8 + dvp] * d16[i][6]) + (v2[7 + dvp] * d16[i][7]) + (v2[6 + dvp] * d16[i][8]) + (v2[5 + dvp] * d16[i][9]) + (v2[4 + dvp] * d16[i][10]) + (v2[3 + dvp] * d16[i][11]) + (v2[2 + dvp] * d16[i][12]) + (v2[1 + dvp] * d16[i][13]) + (v2[0 + dvp] * d16[i][14]) + (v2[15 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; @@ -1861,20 +1639,13 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { - float pcm_sample; + for (int i = 0; i < 32; i++) { + float pcm_sample; // final float d16[i][] = d16[i]; - pcm_sample = - (float) (((v1[15 + dvp] * d16[i][0]) + (v1[14 + dvp] * d16[i][1]) - + (v1[13 + dvp] * d16[i][2]) + (v1[12 + dvp] * d16[i][3]) - + (v1[11 + dvp] * d16[i][4]) + (v1[10 + dvp] * d16[i][5]) - + (v1[9 + dvp] * d16[i][6]) + (v1[8 + dvp] * d16[i][7]) + (v1[7 + dvp] * d16[i][8]) - + (v1[6 + dvp] * d16[i][9]) + (v1[5 + dvp] * d16[i][10]) - + (v1[4 + dvp] * d16[i][11]) + (v1[3 + dvp] * d16[i][12]) - + (v1[2 + dvp] * d16[i][13]) + (v1[1 + dvp] * d16[i][14]) + (v1[0 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v1[15 + dvp] * d16[i][0]) + (v1[14 + dvp] * d16[i][1]) + (v1[13 + dvp] * d16[i][2]) + (v1[12 + dvp] * d16[i][3]) + (v1[11 + dvp] * d16[i][4]) + (v1[10 + dvp] * d16[i][5]) + (v1[9 + dvp] * d16[i][6]) + (v1[8 + dvp] * d16[i][7]) + (v1[7 + dvp] * d16[i][8]) + (v1[6 + dvp] * d16[i][9]) + (v1[5 + dvp] * d16[i][10]) + (v1[4 + dvp] * d16[i][11]) + (v1[3 + dvp] * d16[i][12]) + (v1[2 + dvp] * d16[i][13]) + (v1[1 + dvp] * d16[i][14]) + (v1[0 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; dvp += 16; @@ -1884,20 +1655,13 @@ final class SynthesisFilter { // int inc = v_inc; // final float[] tmpOut = _tmpOut; - int dvp = 0; + int dvp = 0; // fat chance of having this loop unroll - for ( int i = 0; i < 32; i++) { - float pcm_sample; + for (int i = 0; i < 32; i++) { + float pcm_sample; // final float d16[i][] = d16[i]; - pcm_sample = - (float) (((v2[15 + dvp] * d16[i][0]) + (v2[14 + dvp] * d16[i][1]) - + (v2[13 + dvp] * d16[i][2]) + (v2[12 + dvp] * d16[i][3]) - + (v2[11 + dvp] * d16[i][4]) + (v2[10 + dvp] * d16[i][5]) - + (v2[9 + dvp] * d16[i][6]) + (v2[8 + dvp] * d16[i][7]) + (v2[7 + dvp] * d16[i][8]) - + (v2[6 + dvp] * d16[i][9]) + (v2[5 + dvp] * d16[i][10]) - + (v2[4 + dvp] * d16[i][11]) + (v2[3 + dvp] * d16[i][12]) - + (v2[2 + dvp] * d16[i][13]) + (v2[1 + dvp] * d16[i][14]) + (v2[0 + dvp] * d16[i][15])) * scalefactor); + pcm_sample = (float) (((v2[15 + dvp] * d16[i][0]) + (v2[14 + dvp] * d16[i][1]) + (v2[13 + dvp] * d16[i][2]) + (v2[12 + dvp] * d16[i][3]) + (v2[11 + dvp] * d16[i][4]) + (v2[10 + dvp] * d16[i][5]) + (v2[9 + dvp] * d16[i][6]) + (v2[8 + dvp] * d16[i][7]) + (v2[7 + dvp] * d16[i][8]) + (v2[6 + dvp] * d16[i][9]) + (v2[5 + dvp] * d16[i][10]) + (v2[4 + dvp] * d16[i][11]) + (v2[3 + dvp] * d16[i][12]) + (v2[2 + dvp] * d16[i][13]) + (v2[1 + dvp] * d16[i][14]) + (v2[0 + dvp] * d16[i][15])) * scalefactor); _tmpOut[i] = pcm_sample; dvp += 16; @@ -1979,17 +1743,16 @@ final class SynthesisFilter { */ } - public void clear() { // clear out v1,v2 SSJAVA.arrayinit(v1, 0); SSJAVA.arrayinit(v2, 0); // copy previous v1,v2 - for ( int i = 0; i < prev1.length; i++) { + for (int i = 0; i < prev1.length; i++) { v1[i] = prev1[i]; } - for ( int i = 0; i < prev2.length; i++) { + for (int i = 0; i < prev2.length; i++) { v2[i] = prev2[i]; } // clear out previous buffer @@ -2005,7 +1768,8 @@ final class SynthesisFilter { public void calculate_pcm_samples() { -// System.out.println("#calculate_pcm_samples::actual_write_pos=" + actual_write_pos); + // System.out.println("#calculate_pcm_samples::actual_write_pos=" + + // actual_write_pos); if (vidx == 1) { compute_new_v1_v2(); @@ -2020,7 +1784,7 @@ final class SynthesisFilter { // System.out.println("3.actual_v=" + (actual_v == v1) + " vidx=" + vidx); actual_write_pos = (actual_write_pos + 1) & 0xf; -// System.out.println("actual_write_pos="+actual_write_pos); + // System.out.println("actual_write_pos="+actual_write_pos); // actual_v = (actual_v == v1) ? v2 : v1; if (vidx == 1) { @@ -2083,7 +1847,7 @@ final class SynthesisFilter { * by allowing a block of 16 to be addressed with constant offset. **/ // TODO CONST - + private final static float d16[][] = null; /** @@ -2141,91 +1905,6 @@ final class SynthesisFilter { // The original data for d[]. This data is loaded from a file // to reduce the overall package size and to improve performance. - static final float d[] = { 0.000000000f, -0.000442505f, 0.003250122f, -0.007003784f, - 0.031082153f, -0.078628540f, 0.100311279f, -0.572036743f, 1.144989014f, 0.572036743f, - 0.100311279f, 0.078628540f, 0.031082153f, 0.007003784f, 0.003250122f, 0.000442505f, - -0.000015259f, -0.000473022f, 0.003326416f, -0.007919312f, 0.030517578f, -0.084182739f, - 0.090927124f, -0.600219727f, 1.144287109f, 0.543823242f, 0.108856201f, 0.073059082f, - 0.031478882f, 0.006118774f, 0.003173828f, 0.000396729f, -0.000015259f, -0.000534058f, - 0.003387451f, -0.008865356f, 0.029785156f, -0.089706421f, 0.080688477f, -0.628295898f, - 1.142211914f, 0.515609741f, 0.116577148f, 0.067520142f, 0.031738281f, 0.005294800f, - 0.003082275f, 0.000366211f, -0.000015259f, -0.000579834f, 0.003433228f, -0.009841919f, - 0.028884888f, -0.095169067f, 0.069595337f, -0.656219482f, 1.138763428f, 0.487472534f, - 0.123474121f, 0.061996460f, 0.031845093f, 0.004486084f, 0.002990723f, 0.000320435f, - -0.000015259f, -0.000625610f, 0.003463745f, -0.010848999f, 0.027801514f, -0.100540161f, - 0.057617188f, -0.683914185f, 1.133926392f, 0.459472656f, 0.129577637f, 0.056533813f, - 0.031814575f, 0.003723145f, 0.002899170f, 0.000289917f, -0.000015259f, -0.000686646f, - 0.003479004f, -0.011886597f, 0.026535034f, -0.105819702f, 0.044784546f, -0.711318970f, - 1.127746582f, 0.431655884f, 0.134887695f, 0.051132202f, 0.031661987f, 0.003005981f, - 0.002792358f, 0.000259399f, -0.000015259f, -0.000747681f, 0.003479004f, -0.012939453f, - 0.025085449f, -0.110946655f, 0.031082153f, -0.738372803f, 1.120223999f, 0.404083252f, - 0.139450073f, 0.045837402f, 0.031387329f, 0.002334595f, 0.002685547f, 0.000244141f, - -0.000030518f, -0.000808716f, 0.003463745f, -0.014022827f, 0.023422241f, -0.115921021f, - 0.016510010f, -0.765029907f, 1.111373901f, 0.376800537f, 0.143264771f, 0.040634155f, - 0.031005859f, 0.001693726f, 0.002578735f, 0.000213623f, -0.000030518f, -0.000885010f, - 0.003417969f, -0.015121460f, 0.021575928f, -0.120697021f, 0.001068115f, -0.791213989f, - 1.101211548f, 0.349868774f, 0.146362305f, 0.035552979f, 0.030532837f, 0.001098633f, - 0.002456665f, 0.000198364f, -0.000030518f, -0.000961304f, 0.003372192f, -0.016235352f, - 0.019531250f, -0.125259399f, -0.015228271f, -0.816864014f, 1.089782715f, 0.323318481f, - 0.148773193f, 0.030609131f, 0.029937744f, 0.000549316f, 0.002349854f, 0.000167847f, - -0.000030518f, -0.001037598f, 0.003280640f, -0.017349243f, 0.017257690f, -0.129562378f, - -0.032379150f, -0.841949463f, 1.077117920f, 0.297210693f, 0.150497437f, 0.025817871f, - 0.029281616f, 0.000030518f, 0.002243042f, 0.000152588f, -0.000045776f, -0.001113892f, - 0.003173828f, -0.018463135f, 0.014801025f, -0.133590698f, -0.050354004f, -0.866363525f, - 1.063217163f, 0.271591187f, 0.151596069f, 0.021179199f, 0.028533936f, -0.000442505f, - 0.002120972f, 0.000137329f, -0.000045776f, -0.001205444f, 0.003051758f, -0.019577026f, - 0.012115479f, -0.137298584f, -0.069168091f, -0.890090942f, 1.048156738f, 0.246505737f, - 0.152069092f, 0.016708374f, 0.027725220f, -0.000869751f, 0.002014160f, 0.000122070f, - -0.000061035f, -0.001296997f, 0.002883911f, -0.020690918f, 0.009231567f, -0.140670776f, - -0.088775635f, -0.913055420f, 1.031936646f, 0.221984863f, 0.151962280f, 0.012420654f, - 0.026840210f, -0.001266479f, 0.001907349f, 0.000106812f, -0.000061035f, -0.001388550f, - 0.002700806f, -0.021789551f, 0.006134033f, -0.143676758f, -0.109161377f, -0.935195923f, - 1.014617920f, 0.198059082f, 0.151306152f, 0.008316040f, 0.025909424f, -0.001617432f, - 0.001785278f, 0.000106812f, -0.000076294f, -0.001480103f, 0.002487183f, -0.022857666f, - 0.002822876f, -0.146255493f, -0.130310059f, -0.956481934f, 0.996246338f, 0.174789429f, - 0.150115967f, 0.004394531f, 0.024932861f, -0.001937866f, 0.001693726f, 0.000091553f, - -0.000076294f, -0.001586914f, 0.002227783f, -0.023910522f, -0.000686646f, -0.148422241f, - -0.152206421f, -0.976852417f, 0.976852417f, 0.152206421f, 0.148422241f, 0.000686646f, - 0.023910522f, -0.002227783f, 0.001586914f, 0.000076294f, -0.000091553f, -0.001693726f, - 0.001937866f, -0.024932861f, -0.004394531f, -0.150115967f, -0.174789429f, -0.996246338f, - 0.956481934f, 0.130310059f, 0.146255493f, -0.002822876f, 0.022857666f, -0.002487183f, - 0.001480103f, 0.000076294f, -0.000106812f, -0.001785278f, 0.001617432f, -0.025909424f, - -0.008316040f, -0.151306152f, -0.198059082f, -1.014617920f, 0.935195923f, 0.109161377f, - 0.143676758f, -0.006134033f, 0.021789551f, -0.002700806f, 0.001388550f, 0.000061035f, - -0.000106812f, -0.001907349f, 0.001266479f, -0.026840210f, -0.012420654f, -0.151962280f, - -0.221984863f, -1.031936646f, 0.913055420f, 0.088775635f, 0.140670776f, -0.009231567f, - 0.020690918f, -0.002883911f, 0.001296997f, 0.000061035f, -0.000122070f, -0.002014160f, - 0.000869751f, -0.027725220f, -0.016708374f, -0.152069092f, -0.246505737f, -1.048156738f, - 0.890090942f, 0.069168091f, 0.137298584f, -0.012115479f, 0.019577026f, -0.003051758f, - 0.001205444f, 0.000045776f, -0.000137329f, -0.002120972f, 0.000442505f, -0.028533936f, - -0.021179199f, -0.151596069f, -0.271591187f, -1.063217163f, 0.866363525f, 0.050354004f, - 0.133590698f, -0.014801025f, 0.018463135f, -0.003173828f, 0.001113892f, 0.000045776f, - -0.000152588f, -0.002243042f, -0.000030518f, -0.029281616f, -0.025817871f, -0.150497437f, - -0.297210693f, -1.077117920f, 0.841949463f, 0.032379150f, 0.129562378f, -0.017257690f, - 0.017349243f, -0.003280640f, 0.001037598f, 0.000030518f, -0.000167847f, -0.002349854f, - -0.000549316f, -0.029937744f, -0.030609131f, -0.148773193f, -0.323318481f, -1.089782715f, - 0.816864014f, 0.015228271f, 0.125259399f, -0.019531250f, 0.016235352f, -0.003372192f, - 0.000961304f, 0.000030518f, -0.000198364f, -0.002456665f, -0.001098633f, -0.030532837f, - -0.035552979f, -0.146362305f, -0.349868774f, -1.101211548f, 0.791213989f, -0.001068115f, - 0.120697021f, -0.021575928f, 0.015121460f, -0.003417969f, 0.000885010f, 0.000030518f, - -0.000213623f, -0.002578735f, -0.001693726f, -0.031005859f, -0.040634155f, -0.143264771f, - -0.376800537f, -1.111373901f, 0.765029907f, -0.016510010f, 0.115921021f, -0.023422241f, - 0.014022827f, -0.003463745f, 0.000808716f, 0.000030518f, -0.000244141f, -0.002685547f, - -0.002334595f, -0.031387329f, -0.045837402f, -0.139450073f, -0.404083252f, -1.120223999f, - 0.738372803f, -0.031082153f, 0.110946655f, -0.025085449f, 0.012939453f, -0.003479004f, - 0.000747681f, 0.000015259f, -0.000259399f, -0.002792358f, -0.003005981f, -0.031661987f, - -0.051132202f, -0.134887695f, -0.431655884f, -1.127746582f, 0.711318970f, -0.044784546f, - 0.105819702f, -0.026535034f, 0.011886597f, -0.003479004f, 0.000686646f, 0.000015259f, - -0.000289917f, -0.002899170f, -0.003723145f, -0.031814575f, -0.056533813f, -0.129577637f, - -0.459472656f, -1.133926392f, 0.683914185f, -0.057617188f, 0.100540161f, -0.027801514f, - 0.010848999f, -0.003463745f, 0.000625610f, 0.000015259f, -0.000320435f, -0.002990723f, - -0.004486084f, -0.031845093f, -0.061996460f, -0.123474121f, -0.487472534f, -1.138763428f, - 0.656219482f, -0.069595337f, 0.095169067f, -0.028884888f, 0.009841919f, -0.003433228f, - 0.000579834f, 0.000015259f, -0.000366211f, -0.003082275f, -0.005294800f, -0.031738281f, - -0.067520142f, -0.116577148f, -0.515609741f, -1.142211914f, 0.628295898f, -0.080688477f, - 0.089706421f, -0.029785156f, 0.008865356f, -0.003387451f, 0.000534058f, 0.000015259f, - -0.000396729f, -0.003173828f, -0.006118774f, -0.031478882f, -0.073059082f, -0.108856201f, - -0.543823242f, -1.144287109f, 0.600219727f, -0.090927124f, 0.084182739f, -0.030517578f, - 0.007919312f, -0.003326416f, 0.000473022f, 0.000015259f }; + static final float d[] = { 0.000000000f, -0.000442505f, 0.003250122f, -0.007003784f, 0.031082153f, -0.078628540f, 0.100311279f, -0.572036743f, 1.144989014f, 0.572036743f, 0.100311279f, 0.078628540f, 0.031082153f, 0.007003784f, 0.003250122f, 0.000442505f, -0.000015259f, -0.000473022f, 0.003326416f, -0.007919312f, 0.030517578f, -0.084182739f, 0.090927124f, -0.600219727f, 1.144287109f, 0.543823242f, 0.108856201f, 0.073059082f, 0.031478882f, 0.006118774f, 0.003173828f, 0.000396729f, -0.000015259f, -0.000534058f, 0.003387451f, -0.008865356f, 0.029785156f, -0.089706421f, 0.080688477f, -0.628295898f, 1.142211914f, 0.515609741f, 0.116577148f, 0.067520142f, 0.031738281f, 0.005294800f, 0.003082275f, 0.000366211f, -0.000015259f, -0.000579834f, 0.003433228f, -0.009841919f, 0.028884888f, -0.095169067f, 0.069595337f, -0.656219482f, 1.138763428f, 0.487472534f, 0.123474121f, 0.061996460f, 0.031845093f, 0.004486084f, 0.002990723f, 0.000320435f, -0.000015259f, -0.000625610f, 0.003463745f, -0.010848999f, 0.027801514f, -0.100540161f, 0.057617188f, -0.683914185f, 1.133926392f, 0.459472656f, 0.129577637f, 0.056533813f, 0.031814575f, 0.003723145f, 0.002899170f, 0.000289917f, -0.000015259f, -0.000686646f, 0.003479004f, -0.011886597f, 0.026535034f, -0.105819702f, 0.044784546f, -0.711318970f, 1.127746582f, 0.431655884f, 0.134887695f, 0.051132202f, 0.031661987f, 0.003005981f, 0.002792358f, 0.000259399f, -0.000015259f, -0.000747681f, 0.003479004f, -0.012939453f, 0.025085449f, -0.110946655f, 0.031082153f, -0.738372803f, 1.120223999f, 0.404083252f, 0.139450073f, 0.045837402f, 0.031387329f, 0.002334595f, 0.002685547f, 0.000244141f, -0.000030518f, -0.000808716f, 0.003463745f, -0.014022827f, 0.023422241f, -0.115921021f, 0.016510010f, -0.765029907f, 1.111373901f, 0.376800537f, 0.143264771f, 0.040634155f, 0.031005859f, 0.001693726f, 0.002578735f, 0.000213623f, -0.000030518f, -0.000885010f, 0.003417969f, -0.015121460f, 0.021575928f, -0.120697021f, 0.001068115f, -0.791213989f, 1.101211548f, 0.349868774f, 0.146362305f, 0.035552979f, 0.030532837f, 0.001098633f, 0.002456665f, 0.000198364f, -0.000030518f, -0.000961304f, 0.003372192f, -0.016235352f, 0.019531250f, -0.125259399f, -0.015228271f, -0.816864014f, 1.089782715f, 0.323318481f, 0.148773193f, 0.030609131f, 0.029937744f, 0.000549316f, 0.002349854f, 0.000167847f, -0.000030518f, -0.001037598f, 0.003280640f, -0.017349243f, 0.017257690f, -0.129562378f, -0.032379150f, -0.841949463f, 1.077117920f, 0.297210693f, 0.150497437f, 0.025817871f, 0.029281616f, 0.000030518f, 0.002243042f, 0.000152588f, -0.000045776f, -0.001113892f, 0.003173828f, -0.018463135f, 0.014801025f, -0.133590698f, -0.050354004f, -0.866363525f, 1.063217163f, 0.271591187f, 0.151596069f, 0.021179199f, 0.028533936f, -0.000442505f, 0.002120972f, 0.000137329f, -0.000045776f, -0.001205444f, 0.003051758f, -0.019577026f, 0.012115479f, -0.137298584f, -0.069168091f, -0.890090942f, 1.048156738f, 0.246505737f, 0.152069092f, 0.016708374f, 0.027725220f, -0.000869751f, 0.002014160f, 0.000122070f, -0.000061035f, -0.001296997f, 0.002883911f, -0.020690918f, 0.009231567f, -0.140670776f, -0.088775635f, -0.913055420f, 1.031936646f, 0.221984863f, 0.151962280f, 0.012420654f, 0.026840210f, -0.001266479f, 0.001907349f, 0.000106812f, -0.000061035f, -0.001388550f, 0.002700806f, -0.021789551f, 0.006134033f, -0.143676758f, -0.109161377f, -0.935195923f, 1.014617920f, 0.198059082f, 0.151306152f, 0.008316040f, 0.025909424f, -0.001617432f, 0.001785278f, 0.000106812f, -0.000076294f, -0.001480103f, 0.002487183f, -0.022857666f, 0.002822876f, -0.146255493f, -0.130310059f, -0.956481934f, 0.996246338f, 0.174789429f, 0.150115967f, 0.004394531f, 0.024932861f, -0.001937866f, 0.001693726f, 0.000091553f, -0.000076294f, -0.001586914f, 0.002227783f, -0.023910522f, -0.000686646f, -0.148422241f, -0.152206421f, -0.976852417f, 0.976852417f, 0.152206421f, 0.148422241f, 0.000686646f, 0.023910522f, -0.002227783f, 0.001586914f, 0.000076294f, -0.000091553f, -0.001693726f, 0.001937866f, -0.024932861f, -0.004394531f, -0.150115967f, -0.174789429f, -0.996246338f, 0.956481934f, 0.130310059f, 0.146255493f, -0.002822876f, 0.022857666f, -0.002487183f, 0.001480103f, 0.000076294f, -0.000106812f, -0.001785278f, 0.001617432f, -0.025909424f, -0.008316040f, -0.151306152f, -0.198059082f, -1.014617920f, 0.935195923f, 0.109161377f, 0.143676758f, -0.006134033f, 0.021789551f, -0.002700806f, 0.001388550f, 0.000061035f, -0.000106812f, -0.001907349f, 0.001266479f, -0.026840210f, -0.012420654f, -0.151962280f, -0.221984863f, -1.031936646f, 0.913055420f, 0.088775635f, 0.140670776f, -0.009231567f, 0.020690918f, -0.002883911f, 0.001296997f, 0.000061035f, -0.000122070f, -0.002014160f, 0.000869751f, -0.027725220f, -0.016708374f, -0.152069092f, -0.246505737f, -1.048156738f, 0.890090942f, 0.069168091f, 0.137298584f, -0.012115479f, 0.019577026f, -0.003051758f, 0.001205444f, 0.000045776f, -0.000137329f, -0.002120972f, 0.000442505f, -0.028533936f, -0.021179199f, -0.151596069f, -0.271591187f, -1.063217163f, 0.866363525f, 0.050354004f, 0.133590698f, -0.014801025f, 0.018463135f, -0.003173828f, 0.001113892f, 0.000045776f, -0.000152588f, -0.002243042f, -0.000030518f, -0.029281616f, -0.025817871f, -0.150497437f, -0.297210693f, -1.077117920f, 0.841949463f, 0.032379150f, 0.129562378f, -0.017257690f, 0.017349243f, -0.003280640f, 0.001037598f, 0.000030518f, -0.000167847f, -0.002349854f, -0.000549316f, -0.029937744f, -0.030609131f, -0.148773193f, -0.323318481f, -1.089782715f, 0.816864014f, 0.015228271f, 0.125259399f, -0.019531250f, 0.016235352f, -0.003372192f, 0.000961304f, 0.000030518f, -0.000198364f, -0.002456665f, -0.001098633f, -0.030532837f, -0.035552979f, -0.146362305f, -0.349868774f, -1.101211548f, 0.791213989f, -0.001068115f, 0.120697021f, -0.021575928f, 0.015121460f, -0.003417969f, 0.000885010f, 0.000030518f, -0.000213623f, -0.002578735f, -0.001693726f, -0.031005859f, -0.040634155f, -0.143264771f, -0.376800537f, -1.111373901f, 0.765029907f, -0.016510010f, 0.115921021f, -0.023422241f, 0.014022827f, -0.003463745f, 0.000808716f, 0.000030518f, -0.000244141f, -0.002685547f, -0.002334595f, -0.031387329f, -0.045837402f, -0.139450073f, -0.404083252f, -1.120223999f, 0.738372803f, -0.031082153f, 0.110946655f, -0.025085449f, 0.012939453f, -0.003479004f, 0.000747681f, 0.000015259f, -0.000259399f, -0.002792358f, -0.003005981f, -0.031661987f, -0.051132202f, -0.134887695f, -0.431655884f, -1.127746582f, 0.711318970f, -0.044784546f, 0.105819702f, -0.026535034f, 0.011886597f, -0.003479004f, 0.000686646f, 0.000015259f, -0.000289917f, -0.002899170f, -0.003723145f, -0.031814575f, -0.056533813f, -0.129577637f, -0.459472656f, -1.133926392f, 0.683914185f, -0.057617188f, 0.100540161f, -0.027801514f, 0.010848999f, -0.003463745f, 0.000625610f, 0.000015259f, -0.000320435f, -0.002990723f, -0.004486084f, -0.031845093f, -0.061996460f, -0.123474121f, -0.487472534f, -1.138763428f, 0.656219482f, -0.069595337f, 0.095169067f, -0.028884888f, 0.009841919f, -0.003433228f, 0.000579834f, 0.000015259f, -0.000366211f, -0.003082275f, -0.005294800f, -0.031738281f, -0.067520142f, -0.116577148f, -0.515609741f, -1.142211914f, 0.628295898f, -0.080688477f, 0.089706421f, -0.029785156f, 0.008865356f, -0.003387451f, 0.000534058f, 0.000015259f, -0.000396729f, -0.003173828f, -0.006118774f, -0.031478882f, -0.073059082f, -0.108856201f, -0.543823242f, -1.144287109f, 0.600219727f, -0.090927124f, 0.084182739f, -0.030517578f, 0.007919312f, -0.003326416f, 0.000473022f, 0.000015259f }; } diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/huffcodetab.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/huffcodetab.java index d3c2f221..a1fdac5b 100644 --- a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/huffcodetab.java +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/huffcodetab.java @@ -41,450 +41,85 @@ * Class to implements Huffman decoder. */ - final class huffcodetab { private static final int MXOFF = 250; private static final int HTN = 34; - private char tablename0 = ' '; /* string, containing table_description */ - + private char tablename1 = ' '; /* string, containing table_description */ - + private char tablename2 = ' '; /* string, containing table_description */ - private int xlen; /* max. x-index+ */ - + private int ylen; /* max. y-index+ */ - + private int linbits; /* number of linbits */ - + private int linmax; /* max number to be stored in linbits */ - + private int ref; /* a positive value indicates a reference */ - + private int[] table = null; /* pointer to array[xlen][ylen] */ - + private int[] hlen = null; /* pointer to array[xlen][ylen] */ - + private int[][] val = null; /* decoder tree */ - + private int treelen; /* length of decoder tree */ - private static int ValTab0[][] = { { 0, 0 } // dummy - }; + }; - - private static int ValTab1[][] = { { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, { 2, 1 }, { 0, 1 }, - { 0, 17 }, }; + private static int ValTab1[][] = { { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, { 2, 1 }, { 0, 1 }, { 0, 17 }, }; - - private static int ValTab2[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, - { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, - { 0, 2 }, { 0, 34 }, }; + private static int ValTab2[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 2 }, { 0, 34 }, }; - - private static int ValTab3[][] = { { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 1 }, { 2, 1 }, { 0, 17 }, - { 2, 1 }, { 0, 16 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, - { 0, 2 }, { 0, 34 }, }; + private static int ValTab3[][] = { { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 1 }, { 2, 1 }, { 0, 17 }, { 2, 1 }, { 0, 16 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 2 }, { 0, 34 }, }; - private static int ValTab4[][] = { { 0, 0 } }; // dummy - - private static int ValTab5[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, - { 2, 1 }, { 0, 17 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, - { 0, 18 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 2, 1 }, { 0, 3 }, { 0, 19 }, - { 2, 1 }, { 0, 49 }, { 2, 1 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, { 0, 51 }, }; - - - private static int ValTab6[][] = { { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 16 }, { 0, 17 }, - { 6, 1 }, { 2, 1 }, { 0, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 6, 1 }, { 2, 1 }, { 0, 18 }, - { 2, 1 }, { 0, 2 }, { 0, 34 }, { 4, 1 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 4, 1 }, { 2, 1 }, - { 0, 48 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, { 2, 1 }, { 0, 3 }, { 0, 51 }, }; - - - private static int ValTab7[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, - { 8, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 0, 33 }, { 18, 1 }, - { 6, 1 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 4, 1 }, { 2, 1 }, { 0, 49 }, - { 0, 19 }, { 4, 1 }, { 2, 1 }, { 0, 3 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, { 0, 4 }, { 10, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 65 }, { 2, 1 }, { 0, 20 }, { 2, 1 }, { 0, 66 }, - { 0, 36 }, { 12, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 51 }, { 0, 67 }, { 0, 80 }, - { 4, 1 }, { 2, 1 }, { 0, 52 }, { 0, 5 }, { 0, 81 }, { 6, 1 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, - { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 53 }, { 4, 1 }, { 2, 1 }, - { 0, 83 }, { 0, 84 }, { 2, 1 }, { 0, 69 }, { 0, 85 }, }; - - - private static int ValTab8[][] = { { 6, 1 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, - { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 14, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 34 }, { 4, 1 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, { 2, 1 }, - { 0, 49 }, { 0, 19 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, - { 2, 1 }, { 0, 64 }, { 0, 4 }, { 2, 1 }, { 0, 65 }, { 2, 1 }, { 0, 20 }, { 0, 66 }, - { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 36 }, { 2, 1 }, { 0, 51 }, { 0, 80 }, { 4, 1 }, { 2, 1 }, - { 0, 67 }, { 0, 52 }, { 0, 81 }, { 6, 1 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, { 0, 5 }, - { 0, 82 }, { 6, 1 }, { 2, 1 }, { 0, 37 }, { 2, 1 }, { 0, 68 }, { 0, 53 }, { 2, 1 }, - { 0, 83 }, { 2, 1 }, { 0, 69 }, { 2, 1 }, { 0, 84 }, { 0, 85 }, }; - - - private static int ValTab9[][] = { { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 16 }, { 2, 1 }, - { 0, 1 }, { 0, 17 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 2, 1 }, - { 0, 18 }, { 2, 1 }, { 0, 2 }, { 0, 34 }, { 12, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 48 }, - { 0, 3 }, { 0, 49 }, { 2, 1 }, { 0, 19 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 12, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 65 }, { 0, 20 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 51 }, { 2, 1 }, - { 0, 66 }, { 0, 36 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 80 }, - { 0, 67 }, { 2, 1 }, { 0, 52 }, { 0, 81 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 21 }, - { 0, 82 }, { 2, 1 }, { 0, 37 }, { 0, 68 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 5 }, { 0, 84 }, - { 0, 83 }, { 2, 1 }, { 0, 53 }, { 2, 1 }, { 0, 69 }, { 0, 85 }, }; - - - private static int ValTab10[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, - { 10, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, - { 0, 18 }, { 28, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 2, 1 }, - { 0, 49 }, { 0, 19 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 3 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, - { 0, 64 }, { 4, 1 }, { 2, 1 }, { 0, 65 }, { 0, 20 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 51 }, - { 2, 1 }, { 0, 66 }, { 0, 36 }, { 28, 1 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 80 }, { 0, 5 }, { 0, 96 }, { 2, 1 }, { 0, 97 }, { 0, 22 }, { 12, 1 }, { 6, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 67 }, { 0, 52 }, { 0, 81 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, - { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, { 0, 38 }, { 0, 54 }, { 0, 113 }, { 20, 1 }, - { 8, 1 }, { 2, 1 }, { 0, 23 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 0, 6 }, { 6, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 53 }, { 0, 69 }, { 0, 98 }, { 2, 1 }, { 0, 112 }, { 2, 1 }, - { 0, 7 }, { 0, 100 }, { 14, 1 }, { 4, 1 }, { 2, 1 }, { 0, 114 }, { 0, 39 }, { 6, 1 }, - { 2, 1 }, { 0, 99 }, { 2, 1 }, { 0, 84 }, { 0, 85 }, { 2, 1 }, { 0, 70 }, { 0, 115 }, - { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 55 }, { 0, 101 }, { 2, 1 }, { 0, 86 }, { 0, 116 }, - { 6, 1 }, { 2, 1 }, { 0, 71 }, { 2, 1 }, { 0, 102 }, { 0, 117 }, { 4, 1 }, { 2, 1 }, - { 0, 87 }, { 0, 118 }, { 2, 1 }, { 0, 103 }, { 0, 119 }, }; - - - private static int ValTab11[][] = { { 6, 1 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, - { 8, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 0, 18 }, { 24, 1 }, - { 8, 1 }, { 2, 1 }, { 0, 33 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, { 4, 1 }, - { 2, 1 }, { 0, 49 }, { 0, 19 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 4, 1 }, { 2, 1 }, - { 0, 64 }, { 0, 4 }, { 2, 1 }, { 0, 65 }, { 0, 20 }, { 30, 1 }, { 16, 1 }, { 10, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 66 }, { 0, 36 }, { 4, 1 }, { 2, 1 }, { 0, 51 }, { 0, 67 }, - { 0, 80 }, { 4, 1 }, { 2, 1 }, { 0, 52 }, { 0, 81 }, { 0, 97 }, { 6, 1 }, { 2, 1 }, - { 0, 22 }, { 2, 1 }, { 0, 6 }, { 0, 38 }, { 2, 1 }, { 0, 98 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, - { 0, 5 }, { 0, 82 }, { 16, 1 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 37 }, - { 0, 68 }, { 0, 96 }, { 2, 1 }, { 0, 99 }, { 0, 54 }, { 4, 1 }, { 2, 1 }, { 0, 112 }, - { 0, 23 }, { 0, 113 }, { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 7 }, { 0, 100 }, - { 0, 114 }, { 2, 1 }, { 0, 39 }, { 4, 1 }, { 2, 1 }, { 0, 83 }, { 0, 53 }, { 2, 1 }, - { 0, 84 }, { 0, 69 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 70 }, { 0, 115 }, { 2, 1 }, - { 0, 55 }, { 2, 1 }, { 0, 101 }, { 0, 86 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 85 }, { 0, 87 }, { 0, 116 }, { 2, 1 }, { 0, 71 }, { 0, 102 }, { 4, 1 }, { 2, 1 }, - { 0, 117 }, { 0, 118 }, { 2, 1 }, { 0, 103 }, { 0, 119 }, }; - - - private static int ValTab12[][] = { { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 2, 1 }, - { 0, 17 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 16, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 33 }, { 0, 18 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 49 }, { 2, 1 }, { 0, 19 }, - { 2, 1 }, { 0, 48 }, { 2, 1 }, { 0, 3 }, { 0, 64 }, { 26, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 50 }, { 0, 35 }, { 2, 1 }, { 0, 65 }, { 0, 51 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 20 }, { 0, 66 }, { 2, 1 }, { 0, 36 }, { 2, 1 }, { 0, 4 }, { 0, 80 }, { 4, 1 }, { 2, 1 }, - { 0, 67 }, { 0, 52 }, { 2, 1 }, { 0, 81 }, { 0, 21 }, { 28, 1 }, { 14, 1 }, { 8, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 2, 1 }, { 0, 83 }, { 0, 53 }, { 4, 1 }, { 2, 1 }, - { 0, 96 }, { 0, 22 }, { 0, 97 }, { 4, 1 }, { 2, 1 }, { 0, 98 }, { 0, 38 }, { 6, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 5 }, { 0, 6 }, { 0, 68 }, { 2, 1 }, { 0, 84 }, { 0, 69 }, { 18, 1 }, - { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 99 }, { 0, 54 }, { 4, 1 }, { 2, 1 }, { 0, 112 }, - { 0, 7 }, { 0, 113 }, { 4, 1 }, { 2, 1 }, { 0, 23 }, { 0, 100 }, { 2, 1 }, { 0, 70 }, - { 0, 114 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 39 }, { 2, 1 }, { 0, 85 }, { 0, 115 }, - { 2, 1 }, { 0, 55 }, { 0, 86 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 101 }, { 0, 116 }, - { 2, 1 }, { 0, 71 }, { 0, 102 }, { 4, 1 }, { 2, 1 }, { 0, 117 }, { 0, 87 }, { 2, 1 }, - { 0, 118 }, { 2, 1 }, { 0, 103 }, { 0, 119 }, }; - - - private static int ValTab13[][] = { { 2, 1 }, { 0, 0 }, { 6, 1 }, { 2, 1 }, { 0, 16 }, { 2, 1 }, - { 0, 1 }, { 0, 17 }, { 28, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, - { 0, 33 }, { 0, 18 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 2, 1 }, { 0, 3 }, - { 0, 49 }, { 6, 1 }, { 2, 1 }, { 0, 19 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 4, 1 }, { 2, 1 }, - { 0, 64 }, { 0, 4 }, { 0, 65 }, { 70, 1 }, { 28, 1 }, { 14, 1 }, { 6, 1 }, { 2, 1 }, - { 0, 20 }, { 2, 1 }, { 0, 51 }, { 0, 66 }, { 4, 1 }, { 2, 1 }, { 0, 36 }, { 0, 80 }, - { 2, 1 }, { 0, 67 }, { 0, 52 }, { 4, 1 }, { 2, 1 }, { 0, 81 }, { 0, 21 }, { 4, 1 }, { 2, 1 }, - { 0, 5 }, { 0, 82 }, { 2, 1 }, { 0, 37 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 14, 1 }, - { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 96 }, { 0, 6 }, { 2, 1 }, { 0, 97 }, { 0, 22 }, { 4, 1 }, - { 2, 1 }, { 0, 128 }, { 0, 8 }, { 0, 129 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 53 }, { 0, 98 }, { 2, 1 }, { 0, 38 }, { 0, 84 }, { 4, 1 }, { 2, 1 }, { 0, 69 }, - { 0, 99 }, { 2, 1 }, { 0, 54 }, { 0, 112 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 7 }, - { 0, 85 }, { 0, 113 }, { 2, 1 }, { 0, 23 }, { 2, 1 }, { 0, 39 }, { 0, 55 }, { 72, 1 }, - { 24, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 24 }, { 0, 130 }, { 2, 1 }, { 0, 40 }, - { 4, 1 }, { 2, 1 }, { 0, 100 }, { 0, 70 }, { 0, 114 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 132 }, { 0, 72 }, { 2, 1 }, { 0, 144 }, { 0, 9 }, { 2, 1 }, { 0, 145 }, { 0, 25 }, - { 24, 1 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 115 }, { 0, 101 }, { 2, 1 }, - { 0, 86 }, { 0, 116 }, { 4, 1 }, { 2, 1 }, { 0, 71 }, { 0, 102 }, { 0, 131 }, { 6, 1 }, - { 2, 1 }, { 0, 56 }, { 2, 1 }, { 0, 117 }, { 0, 87 }, { 2, 1 }, { 0, 146 }, { 0, 41 }, - { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 103 }, { 0, 133 }, { 2, 1 }, { 0, 88 }, - { 0, 57 }, { 2, 1 }, { 0, 147 }, { 2, 1 }, { 0, 73 }, { 0, 134 }, { 6, 1 }, { 2, 1 }, - { 0, 160 }, { 2, 1 }, { 0, 104 }, { 0, 10 }, { 2, 1 }, { 0, 161 }, { 0, 26 }, { 68, 1 }, - { 24, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 162 }, { 0, 42 }, { 4, 1 }, { 2, 1 }, - { 0, 149 }, { 0, 89 }, { 2, 1 }, { 0, 163 }, { 0, 58 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 74 }, { 0, 150 }, { 2, 1 }, { 0, 176 }, { 0, 11 }, { 2, 1 }, { 0, 177 }, { 0, 27 }, - { 20, 1 }, { 8, 1 }, { 2, 1 }, { 0, 178 }, { 4, 1 }, { 2, 1 }, { 0, 118 }, { 0, 119 }, - { 0, 148 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 135 }, { 0, 120 }, { 0, 164 }, { 4, 1 }, - { 2, 1 }, { 0, 105 }, { 0, 165 }, { 0, 43 }, { 12, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 90 }, { 0, 136 }, { 0, 179 }, { 2, 1 }, { 0, 59 }, { 2, 1 }, { 0, 121 }, { 0, 166 }, - { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 106 }, { 0, 180 }, { 0, 192 }, { 4, 1 }, { 2, 1 }, - { 0, 12 }, { 0, 152 }, { 0, 193 }, { 60, 1 }, { 22, 1 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, - { 0, 28 }, { 2, 1 }, { 0, 137 }, { 0, 181 }, { 2, 1 }, { 0, 91 }, { 0, 194 }, { 4, 1 }, - { 2, 1 }, { 0, 44 }, { 0, 60 }, { 4, 1 }, { 2, 1 }, { 0, 182 }, { 0, 107 }, { 2, 1 }, - { 0, 196 }, { 0, 76 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 168 }, { 0, 138 }, - { 2, 1 }, { 0, 208 }, { 0, 13 }, { 2, 1 }, { 0, 209 }, { 2, 1 }, { 0, 75 }, { 2, 1 }, - { 0, 151 }, { 0, 167 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 195 }, { 2, 1 }, { 0, 122 }, - { 0, 153 }, { 4, 1 }, { 2, 1 }, { 0, 197 }, { 0, 92 }, { 0, 183 }, { 4, 1 }, { 2, 1 }, - { 0, 29 }, { 0, 210 }, { 2, 1 }, { 0, 45 }, { 2, 1 }, { 0, 123 }, { 0, 211 }, { 52, 1 }, - { 28, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 4, 1 }, { 2, 1 }, - { 0, 108 }, { 0, 169 }, { 2, 1 }, { 0, 154 }, { 0, 212 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 184 }, { 0, 139 }, { 2, 1 }, { 0, 77 }, { 0, 199 }, { 4, 1 }, { 2, 1 }, { 0, 124 }, - { 0, 213 }, { 2, 1 }, { 0, 93 }, { 0, 224 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 225 }, - { 0, 30 }, { 4, 1 }, { 2, 1 }, { 0, 14 }, { 0, 46 }, { 0, 226 }, { 8, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 227 }, { 0, 109 }, { 2, 1 }, { 0, 140 }, { 0, 228 }, { 4, 1 }, { 2, 1 }, - { 0, 229 }, { 0, 186 }, { 0, 240 }, { 38, 1 }, { 16, 1 }, { 4, 1 }, { 2, 1 }, { 0, 241 }, - { 0, 31 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 170 }, { 0, 155 }, { 0, 185 }, { 2, 1 }, - { 0, 62 }, { 2, 1 }, { 0, 214 }, { 0, 200 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 78 }, - { 2, 1 }, { 0, 215 }, { 0, 125 }, { 2, 1 }, { 0, 171 }, { 2, 1 }, { 0, 94 }, { 0, 201 }, - { 6, 1 }, { 2, 1 }, { 0, 15 }, { 2, 1 }, { 0, 156 }, { 0, 110 }, { 2, 1 }, { 0, 242 }, - { 0, 47 }, { 32, 1 }, { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 216 }, { 0, 141 }, - { 0, 63 }, { 6, 1 }, { 2, 1 }, { 0, 243 }, { 2, 1 }, { 0, 230 }, { 0, 202 }, { 2, 1 }, - { 0, 244 }, { 0, 79 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 187 }, { 0, 172 }, { 2, 1 }, - { 0, 231 }, { 0, 245 }, { 4, 1 }, { 2, 1 }, { 0, 217 }, { 0, 157 }, { 2, 1 }, { 0, 95 }, - { 0, 232 }, { 30, 1 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 111 }, { 2, 1 }, { 0, 246 }, - { 0, 203 }, { 4, 1 }, { 2, 1 }, { 0, 188 }, { 0, 173 }, { 0, 218 }, { 8, 1 }, { 2, 1 }, - { 0, 247 }, { 4, 1 }, { 2, 1 }, { 0, 126 }, { 0, 127 }, { 0, 142 }, { 6, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 158 }, { 0, 174 }, { 0, 204 }, { 2, 1 }, { 0, 248 }, { 0, 143 }, { 18, 1 }, - { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 219 }, { 0, 189 }, { 2, 1 }, { 0, 234 }, { 0, 249 }, - { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 235 }, { 2, 1 }, { 0, 190 }, { 2, 1 }, { 0, 205 }, - { 0, 250 }, { 14, 1 }, { 4, 1 }, { 2, 1 }, { 0, 221 }, { 0, 236 }, { 6, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 233 }, { 0, 175 }, { 0, 220 }, { 2, 1 }, { 0, 206 }, { 0, 251 }, { 8, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 191 }, { 0, 222 }, { 2, 1 }, { 0, 207 }, { 0, 238 }, { 4, 1 }, - { 2, 1 }, { 0, 223 }, { 0, 239 }, { 2, 1 }, { 0, 255 }, { 2, 1 }, { 0, 237 }, { 2, 1 }, - { 0, 253 }, { 2, 1 }, { 0, 252 }, { 0, 254 }, }; - - + private static int ValTab5[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 2, 1 }, { 0, 17 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 2, 1 }, { 0, 3 }, { 0, 19 }, { 2, 1 }, { 0, 49 }, { 2, 1 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, { 0, 51 }, }; + + private static int ValTab6[][] = { { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 16 }, { 0, 17 }, { 6, 1 }, { 2, 1 }, { 0, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 6, 1 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 2 }, { 0, 34 }, { 4, 1 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 4, 1 }, { 2, 1 }, { 0, 48 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, { 2, 1 }, { 0, 3 }, { 0, 51 }, }; + + private static int ValTab7[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 8, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 0, 33 }, { 18, 1 }, { 6, 1 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 4, 1 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 4, 1 }, { 2, 1 }, { 0, 3 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, { 0, 4 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 65 }, { 2, 1 }, { 0, 20 }, { 2, 1 }, { 0, 66 }, { 0, 36 }, { 12, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 51 }, { 0, 67 }, { 0, 80 }, { 4, 1 }, { 2, 1 }, { 0, 52 }, { 0, 5 }, { 0, 81 }, { 6, 1 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 53 }, { 4, 1 }, { 2, 1 }, { 0, 83 }, { 0, 84 }, { 2, 1 }, { 0, 69 }, { 0, 85 }, }; + + private static int ValTab8[][] = { { 6, 1 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 14, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 34 }, { 4, 1 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 2, 1 }, { 0, 64 }, { 0, 4 }, { 2, 1 }, { 0, 65 }, { 2, 1 }, { 0, 20 }, { 0, 66 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 36 }, { 2, 1 }, { 0, 51 }, { 0, 80 }, { 4, 1 }, { 2, 1 }, { 0, 67 }, { 0, 52 }, { 0, 81 }, { 6, 1 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, { 0, 5 }, { 0, 82 }, { 6, 1 }, { 2, 1 }, { 0, 37 }, { 2, 1 }, { 0, 68 }, { 0, 53 }, { 2, 1 }, { 0, 83 }, { 2, 1 }, { 0, 69 }, { 2, 1 }, { 0, 84 }, { 0, 85 }, }; + + private static int ValTab9[][] = { { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 16 }, { 2, 1 }, { 0, 1 }, { 0, 17 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 33 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 2 }, { 0, 34 }, { 12, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, { 0, 49 }, { 2, 1 }, { 0, 19 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 65 }, { 0, 20 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 51 }, { 2, 1 }, { 0, 66 }, { 0, 36 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 80 }, { 0, 67 }, { 2, 1 }, { 0, 52 }, { 0, 81 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 21 }, { 0, 82 }, { 2, 1 }, { 0, 37 }, { 0, 68 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 5 }, { 0, 84 }, { 0, 83 }, { 2, 1 }, { 0, 53 }, { 2, 1 }, { 0, 69 }, { 0, 85 }, }; + + private static int ValTab10[][] = { { 2, 1 }, { 0, 0 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 10, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 28, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 3 }, { 0, 50 }, { 2, 1 }, { 0, 35 }, { 0, 64 }, { 4, 1 }, { 2, 1 }, { 0, 65 }, { 0, 20 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 51 }, { 2, 1 }, { 0, 66 }, { 0, 36 }, { 28, 1 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 80 }, { 0, 5 }, { 0, 96 }, { 2, 1 }, { 0, 97 }, { 0, 22 }, { 12, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 67 }, { 0, 52 }, { 0, 81 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, { 0, 38 }, { 0, 54 }, { 0, 113 }, { 20, 1 }, { 8, 1 }, { 2, 1 }, { 0, 23 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 0, 6 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 53 }, { 0, 69 }, { 0, 98 }, { 2, 1 }, { 0, 112 }, { 2, 1 }, { 0, 7 }, { 0, 100 }, { 14, 1 }, { 4, 1 }, { 2, 1 }, { 0, 114 }, { 0, 39 }, { 6, 1 }, { 2, 1 }, { 0, 99 }, { 2, 1 }, { 0, 84 }, { 0, 85 }, { 2, 1 }, { 0, 70 }, { 0, 115 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 55 }, { 0, 101 }, { 2, 1 }, { 0, 86 }, { 0, 116 }, { 6, 1 }, { 2, 1 }, { 0, 71 }, { 2, 1 }, { 0, 102 }, { 0, 117 }, { 4, 1 }, { 2, 1 }, { 0, 87 }, { 0, 118 }, { 2, 1 }, { 0, 103 }, { 0, 119 }, }; + + private static int ValTab11[][] = { { 6, 1 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 8, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 0, 18 }, { 24, 1 }, { 8, 1 }, { 2, 1 }, { 0, 33 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, { 4, 1 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 4 }, { 2, 1 }, { 0, 65 }, { 0, 20 }, { 30, 1 }, { 16, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 66 }, { 0, 36 }, { 4, 1 }, { 2, 1 }, { 0, 51 }, { 0, 67 }, { 0, 80 }, { 4, 1 }, { 2, 1 }, { 0, 52 }, { 0, 81 }, { 0, 97 }, { 6, 1 }, { 2, 1 }, { 0, 22 }, { 2, 1 }, { 0, 6 }, { 0, 38 }, { 2, 1 }, { 0, 98 }, { 2, 1 }, { 0, 21 }, { 2, 1 }, { 0, 5 }, { 0, 82 }, { 16, 1 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 37 }, { 0, 68 }, { 0, 96 }, { 2, 1 }, { 0, 99 }, { 0, 54 }, { 4, 1 }, { 2, 1 }, { 0, 112 }, { 0, 23 }, { 0, 113 }, { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 7 }, { 0, 100 }, { 0, 114 }, { 2, 1 }, { 0, 39 }, { 4, 1 }, { 2, 1 }, { 0, 83 }, { 0, 53 }, { 2, 1 }, { 0, 84 }, { 0, 69 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 70 }, { 0, 115 }, { 2, 1 }, { 0, 55 }, { 2, 1 }, { 0, 101 }, { 0, 86 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 85 }, { 0, 87 }, { 0, 116 }, { 2, 1 }, { 0, 71 }, { 0, 102 }, { 4, 1 }, { 2, 1 }, { 0, 117 }, { 0, 118 }, { 2, 1 }, { 0, 103 }, { 0, 119 }, }; + + private static int ValTab12[][] = { { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 2, 1 }, { 0, 17 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 16, 1 }, { 4, 1 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 49 }, { 2, 1 }, { 0, 19 }, { 2, 1 }, { 0, 48 }, { 2, 1 }, { 0, 3 }, { 0, 64 }, { 26, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 2, 1 }, { 0, 65 }, { 0, 51 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 20 }, { 0, 66 }, { 2, 1 }, { 0, 36 }, { 2, 1 }, { 0, 4 }, { 0, 80 }, { 4, 1 }, { 2, 1 }, { 0, 67 }, { 0, 52 }, { 2, 1 }, { 0, 81 }, { 0, 21 }, { 28, 1 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 2, 1 }, { 0, 83 }, { 0, 53 }, { 4, 1 }, { 2, 1 }, { 0, 96 }, { 0, 22 }, { 0, 97 }, { 4, 1 }, { 2, 1 }, { 0, 98 }, { 0, 38 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 5 }, { 0, 6 }, { 0, 68 }, { 2, 1 }, { 0, 84 }, { 0, 69 }, { 18, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 99 }, { 0, 54 }, { 4, 1 }, { 2, 1 }, { 0, 112 }, { 0, 7 }, { 0, 113 }, { 4, 1 }, { 2, 1 }, { 0, 23 }, { 0, 100 }, { 2, 1 }, { 0, 70 }, { 0, 114 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 39 }, { 2, 1 }, { 0, 85 }, { 0, 115 }, { 2, 1 }, { 0, 55 }, { 0, 86 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 101 }, { 0, 116 }, { 2, 1 }, { 0, 71 }, { 0, 102 }, { 4, 1 }, { 2, 1 }, { 0, 117 }, { 0, 87 }, { 2, 1 }, { 0, 118 }, { 2, 1 }, { 0, 103 }, { 0, 119 }, }; + + private static int ValTab13[][] = { { 2, 1 }, { 0, 0 }, { 6, 1 }, { 2, 1 }, { 0, 16 }, { 2, 1 }, { 0, 1 }, { 0, 17 }, { 28, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 34 }, { 0, 48 }, { 2, 1 }, { 0, 3 }, { 0, 49 }, { 6, 1 }, { 2, 1 }, { 0, 19 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 4 }, { 0, 65 }, { 70, 1 }, { 28, 1 }, { 14, 1 }, { 6, 1 }, { 2, 1 }, { 0, 20 }, { 2, 1 }, { 0, 51 }, { 0, 66 }, { 4, 1 }, { 2, 1 }, { 0, 36 }, { 0, 80 }, { 2, 1 }, { 0, 67 }, { 0, 52 }, { 4, 1 }, { 2, 1 }, { 0, 81 }, { 0, 21 }, { 4, 1 }, { 2, 1 }, { 0, 5 }, { 0, 82 }, { 2, 1 }, { 0, 37 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 96 }, { 0, 6 }, { 2, 1 }, { 0, 97 }, { 0, 22 }, { 4, 1 }, { 2, 1 }, { 0, 128 }, { 0, 8 }, { 0, 129 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 53 }, { 0, 98 }, { 2, 1 }, { 0, 38 }, { 0, 84 }, { 4, 1 }, { 2, 1 }, { 0, 69 }, { 0, 99 }, { 2, 1 }, { 0, 54 }, { 0, 112 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 7 }, { 0, 85 }, { 0, 113 }, { 2, 1 }, { 0, 23 }, { 2, 1 }, { 0, 39 }, { 0, 55 }, { 72, 1 }, { 24, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 24 }, { 0, 130 }, { 2, 1 }, { 0, 40 }, { 4, 1 }, { 2, 1 }, { 0, 100 }, { 0, 70 }, { 0, 114 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 132 }, { 0, 72 }, { 2, 1 }, { 0, 144 }, { 0, 9 }, { 2, 1 }, { 0, 145 }, { 0, 25 }, { 24, 1 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 115 }, { 0, 101 }, { 2, 1 }, { 0, 86 }, { 0, 116 }, { 4, 1 }, { 2, 1 }, { 0, 71 }, { 0, 102 }, { 0, 131 }, { 6, 1 }, { 2, 1 }, { 0, 56 }, { 2, 1 }, { 0, 117 }, { 0, 87 }, { 2, 1 }, { 0, 146 }, { 0, 41 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 103 }, { 0, 133 }, { 2, 1 }, { 0, 88 }, { 0, 57 }, { 2, 1 }, { 0, 147 }, { 2, 1 }, { 0, 73 }, { 0, 134 }, { 6, 1 }, { 2, 1 }, { 0, 160 }, { 2, 1 }, { 0, 104 }, { 0, 10 }, { 2, 1 }, { 0, 161 }, { 0, 26 }, { 68, 1 }, { 24, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 162 }, { 0, 42 }, { 4, 1 }, { 2, 1 }, { 0, 149 }, { 0, 89 }, { 2, 1 }, { 0, 163 }, { 0, 58 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 74 }, { 0, 150 }, { 2, 1 }, { 0, 176 }, { 0, 11 }, { 2, 1 }, { 0, 177 }, { 0, 27 }, { 20, 1 }, { 8, 1 }, { 2, 1 }, { 0, 178 }, { 4, 1 }, { 2, 1 }, { 0, 118 }, { 0, 119 }, { 0, 148 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 135 }, { 0, 120 }, { 0, 164 }, { 4, 1 }, { 2, 1 }, { 0, 105 }, { 0, 165 }, { 0, 43 }, { 12, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 90 }, { 0, 136 }, { 0, 179 }, { 2, 1 }, { 0, 59 }, { 2, 1 }, { 0, 121 }, { 0, 166 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 106 }, { 0, 180 }, { 0, 192 }, { 4, 1 }, { 2, 1 }, { 0, 12 }, { 0, 152 }, { 0, 193 }, { 60, 1 }, { 22, 1 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 28 }, { 2, 1 }, { 0, 137 }, { 0, 181 }, { 2, 1 }, { 0, 91 }, { 0, 194 }, { 4, 1 }, { 2, 1 }, { 0, 44 }, { 0, 60 }, { 4, 1 }, { 2, 1 }, { 0, 182 }, { 0, 107 }, { 2, 1 }, { 0, 196 }, { 0, 76 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 168 }, { 0, 138 }, { 2, 1 }, { 0, 208 }, { 0, 13 }, { 2, 1 }, { 0, 209 }, { 2, 1 }, { 0, 75 }, { 2, 1 }, { 0, 151 }, { 0, 167 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 195 }, { 2, 1 }, { 0, 122 }, { 0, 153 }, { 4, 1 }, { 2, 1 }, { 0, 197 }, { 0, 92 }, { 0, 183 }, { 4, 1 }, { 2, 1 }, { 0, 29 }, { 0, 210 }, { 2, 1 }, { 0, 45 }, { 2, 1 }, { 0, 123 }, { 0, 211 }, { 52, 1 }, { 28, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 4, 1 }, { 2, 1 }, { 0, 108 }, { 0, 169 }, { 2, 1 }, { 0, 154 }, { 0, 212 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 184 }, { 0, 139 }, { 2, 1 }, { 0, 77 }, { 0, 199 }, { 4, 1 }, { 2, 1 }, { 0, 124 }, { 0, 213 }, { 2, 1 }, { 0, 93 }, { 0, 224 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 225 }, { 0, 30 }, { 4, 1 }, { 2, 1 }, { 0, 14 }, { 0, 46 }, { 0, 226 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 227 }, { 0, 109 }, { 2, 1 }, { 0, 140 }, { 0, 228 }, { 4, 1 }, { 2, 1 }, { 0, 229 }, { 0, 186 }, { 0, 240 }, { 38, 1 }, { 16, 1 }, { 4, 1 }, { 2, 1 }, { 0, 241 }, { 0, 31 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 170 }, { 0, 155 }, { 0, 185 }, { 2, 1 }, { 0, 62 }, { 2, 1 }, { 0, 214 }, { 0, 200 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 78 }, { 2, 1 }, { 0, 215 }, { 0, 125 }, { 2, 1 }, { 0, 171 }, { 2, 1 }, { 0, 94 }, { 0, 201 }, { 6, 1 }, { 2, 1 }, { 0, 15 }, { 2, 1 }, { 0, 156 }, { 0, 110 }, { 2, 1 }, { 0, 242 }, { 0, 47 }, { 32, 1 }, { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 216 }, { 0, 141 }, { 0, 63 }, { 6, 1 }, { 2, 1 }, { 0, 243 }, { 2, 1 }, { 0, 230 }, { 0, 202 }, { 2, 1 }, { 0, 244 }, { 0, 79 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 187 }, { 0, 172 }, { 2, 1 }, { 0, 231 }, { 0, 245 }, { 4, 1 }, { 2, 1 }, { 0, 217 }, { 0, 157 }, { 2, 1 }, { 0, 95 }, { 0, 232 }, { 30, 1 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 111 }, { 2, 1 }, { 0, 246 }, { 0, 203 }, { 4, 1 }, { 2, 1 }, { 0, 188 }, { 0, 173 }, { 0, 218 }, { 8, 1 }, { 2, 1 }, { 0, 247 }, { 4, 1 }, { 2, 1 }, { 0, 126 }, { 0, 127 }, { 0, 142 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 158 }, { 0, 174 }, { 0, 204 }, { 2, 1 }, { 0, 248 }, { 0, 143 }, { 18, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 219 }, { 0, 189 }, { 2, 1 }, { 0, 234 }, { 0, 249 }, { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 235 }, { 2, 1 }, { 0, 190 }, { 2, 1 }, { 0, 205 }, { 0, 250 }, { 14, 1 }, { 4, 1 }, { 2, 1 }, { 0, 221 }, { 0, 236 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 233 }, { 0, 175 }, { 0, 220 }, { 2, 1 }, { 0, 206 }, { 0, 251 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 191 }, { 0, 222 }, { 2, 1 }, { 0, 207 }, { 0, 238 }, { 4, 1 }, { 2, 1 }, { 0, 223 }, { 0, 239 }, { 2, 1 }, { 0, 255 }, { 2, 1 }, { 0, 237 }, { 2, 1 }, { 0, 253 }, { 2, 1 }, { 0, 252 }, { 0, 254 }, }; + private static int ValTab14[][] = { { 0, 0 } // dummy - }; - - - private static int ValTab15[][] = { { 16, 1 }, { 6, 1 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, - { 0, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, - { 0, 18 }, { 50, 1 }, { 16, 1 }, { 6, 1 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, - { 0, 49 }, { 6, 1 }, { 2, 1 }, { 0, 19 }, { 2, 1 }, { 0, 3 }, { 0, 64 }, { 2, 1 }, { 0, 50 }, - { 0, 35 }, { 14, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 20 }, { 0, 65 }, { 4, 1 }, - { 2, 1 }, { 0, 51 }, { 0, 66 }, { 2, 1 }, { 0, 36 }, { 0, 67 }, { 10, 1 }, { 6, 1 }, - { 2, 1 }, { 0, 52 }, { 2, 1 }, { 0, 80 }, { 0, 5 }, { 2, 1 }, { 0, 81 }, { 0, 21 }, { 4, 1 }, - { 2, 1 }, { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 0, 97 }, - { 90, 1 }, { 36, 1 }, { 18, 1 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 53 }, { 2, 1 }, - { 0, 96 }, { 0, 6 }, { 2, 1 }, { 0, 22 }, { 0, 98 }, { 4, 1 }, { 2, 1 }, { 0, 38 }, - { 0, 84 }, { 2, 1 }, { 0, 69 }, { 0, 99 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 54 }, - { 2, 1 }, { 0, 112 }, { 0, 7 }, { 2, 1 }, { 0, 113 }, { 0, 85 }, { 4, 1 }, { 2, 1 }, - { 0, 23 }, { 0, 100 }, { 2, 1 }, { 0, 114 }, { 0, 39 }, { 24, 1 }, { 16, 1 }, { 8, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 70 }, { 0, 115 }, { 2, 1 }, { 0, 55 }, { 0, 101 }, { 4, 1 }, - { 2, 1 }, { 0, 86 }, { 0, 128 }, { 2, 1 }, { 0, 8 }, { 0, 116 }, { 4, 1 }, { 2, 1 }, - { 0, 129 }, { 0, 24 }, { 2, 1 }, { 0, 130 }, { 0, 40 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 71 }, { 0, 102 }, { 2, 1 }, { 0, 131 }, { 0, 56 }, { 4, 1 }, { 2, 1 }, - { 0, 117 }, { 0, 87 }, { 2, 1 }, { 0, 132 }, { 0, 72 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 144 }, { 0, 25 }, { 0, 145 }, { 4, 1 }, { 2, 1 }, { 0, 146 }, { 0, 118 }, { 2, 1 }, - { 0, 103 }, { 0, 41 }, { 92, 1 }, { 36, 1 }, { 18, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 133 }, { 0, 88 }, { 4, 1 }, { 2, 1 }, { 0, 9 }, { 0, 119 }, { 0, 147 }, { 4, 1 }, - { 2, 1 }, { 0, 57 }, { 0, 148 }, { 2, 1 }, { 0, 73 }, { 0, 134 }, { 10, 1 }, { 6, 1 }, - { 2, 1 }, { 0, 104 }, { 2, 1 }, { 0, 160 }, { 0, 10 }, { 2, 1 }, { 0, 161 }, { 0, 26 }, - { 4, 1 }, { 2, 1 }, { 0, 162 }, { 0, 42 }, { 2, 1 }, { 0, 149 }, { 0, 89 }, { 26, 1 }, - { 14, 1 }, { 6, 1 }, { 2, 1 }, { 0, 163 }, { 2, 1 }, { 0, 58 }, { 0, 135 }, { 4, 1 }, - { 2, 1 }, { 0, 120 }, { 0, 164 }, { 2, 1 }, { 0, 74 }, { 0, 150 }, { 6, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 105 }, { 0, 176 }, { 0, 177 }, { 4, 1 }, { 2, 1 }, { 0, 27 }, { 0, 165 }, - { 0, 178 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 90 }, { 0, 43 }, { 2, 1 }, - { 0, 136 }, { 0, 151 }, { 2, 1 }, { 0, 179 }, { 2, 1 }, { 0, 121 }, { 0, 59 }, { 8, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 106 }, { 0, 180 }, { 2, 1 }, { 0, 75 }, { 0, 193 }, { 4, 1 }, - { 2, 1 }, { 0, 152 }, { 0, 137 }, { 2, 1 }, { 0, 28 }, { 0, 181 }, { 80, 1 }, { 34, 1 }, - { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 91 }, { 0, 44 }, { 0, 194 }, { 6, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 11 }, { 0, 192 }, { 0, 166 }, { 2, 1 }, { 0, 167 }, { 0, 122 }, - { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 195 }, { 0, 60 }, { 4, 1 }, { 2, 1 }, { 0, 12 }, - { 0, 153 }, { 0, 182 }, { 4, 1 }, { 2, 1 }, { 0, 107 }, { 0, 196 }, { 2, 1 }, { 0, 76 }, - { 0, 168 }, { 20, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 138 }, { 0, 197 }, { 4, 1 }, - { 2, 1 }, { 0, 208 }, { 0, 92 }, { 0, 209 }, { 4, 1 }, { 2, 1 }, { 0, 183 }, { 0, 123 }, - { 2, 1 }, { 0, 29 }, { 2, 1 }, { 0, 13 }, { 0, 45 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 210 }, { 0, 211 }, { 4, 1 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 2, 1 }, { 0, 108 }, - { 0, 169 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 154 }, { 0, 184 }, { 0, 212 }, { 4, 1 }, - { 2, 1 }, { 0, 139 }, { 0, 77 }, { 2, 1 }, { 0, 199 }, { 0, 124 }, { 68, 1 }, { 34, 1 }, - { 18, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 213 }, { 0, 93 }, { 4, 1 }, { 2, 1 }, - { 0, 224 }, { 0, 14 }, { 0, 225 }, { 4, 1 }, { 2, 1 }, { 0, 30 }, { 0, 226 }, { 2, 1 }, - { 0, 170 }, { 0, 46 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 185 }, { 0, 155 }, { 2, 1 }, - { 0, 227 }, { 0, 214 }, { 4, 1 }, { 2, 1 }, { 0, 109 }, { 0, 62 }, { 2, 1 }, { 0, 200 }, - { 0, 140 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 228 }, { 0, 78 }, { 2, 1 }, - { 0, 215 }, { 0, 125 }, { 4, 1 }, { 2, 1 }, { 0, 229 }, { 0, 186 }, { 2, 1 }, { 0, 171 }, - { 0, 94 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 201 }, { 0, 156 }, { 2, 1 }, { 0, 241 }, - { 0, 31 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 240 }, { 0, 110 }, { 0, 242 }, { 2, 1 }, - { 0, 47 }, { 0, 230 }, { 38, 1 }, { 18, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 216 }, - { 0, 243 }, { 2, 1 }, { 0, 63 }, { 0, 244 }, { 6, 1 }, { 2, 1 }, { 0, 79 }, { 2, 1 }, - { 0, 141 }, { 0, 217 }, { 2, 1 }, { 0, 187 }, { 0, 202 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 172 }, { 0, 231 }, { 2, 1 }, { 0, 126 }, { 0, 245 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 157 }, { 0, 95 }, { 2, 1 }, { 0, 232 }, { 0, 142 }, { 2, 1 }, { 0, 246 }, { 0, 203 }, - { 34, 1 }, { 18, 1 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 15 }, { 0, 174 }, - { 0, 111 }, { 2, 1 }, { 0, 188 }, { 0, 218 }, { 4, 1 }, { 2, 1 }, { 0, 173 }, { 0, 247 }, - { 2, 1 }, { 0, 127 }, { 0, 233 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 158 }, { 0, 204 }, - { 2, 1 }, { 0, 248 }, { 0, 143 }, { 4, 1 }, { 2, 1 }, { 0, 219 }, { 0, 189 }, { 2, 1 }, - { 0, 234 }, { 0, 249 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 220 }, - { 2, 1 }, { 0, 205 }, { 0, 235 }, { 4, 1 }, { 2, 1 }, { 0, 190 }, { 0, 250 }, { 2, 1 }, - { 0, 175 }, { 0, 221 }, { 14, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 236 }, { 0, 206 }, - { 0, 251 }, { 4, 1 }, { 2, 1 }, { 0, 191 }, { 0, 237 }, { 2, 1 }, { 0, 222 }, { 0, 252 }, - { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 207 }, { 0, 253 }, { 0, 238 }, { 4, 1 }, { 2, 1 }, - { 0, 223 }, { 0, 254 }, { 2, 1 }, { 0, 239 }, { 0, 255 }, }; - - - private static int ValTab16[][] = { { 2, 1 }, { 0, 0 }, { 6, 1 }, { 2, 1 }, { 0, 16 }, { 2, 1 }, - { 0, 1 }, { 0, 17 }, { 42, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, - { 0, 33 }, { 0, 18 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, - { 0, 3 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, - { 0, 35 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 4 }, { 0, 65 }, { 6, 1 }, { 2, 1 }, { 0, 20 }, - { 2, 1 }, { 0, 51 }, { 0, 66 }, { 4, 1 }, { 2, 1 }, { 0, 36 }, { 0, 80 }, { 2, 1 }, - { 0, 67 }, { 0, 52 }, { 138, 1 }, { 40, 1 }, { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 5 }, { 0, 21 }, { 0, 81 }, { 4, 1 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, - { 0, 68 }, { 0, 53 }, { 0, 83 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 96 }, - { 0, 6 }, { 0, 97 }, { 2, 1 }, { 0, 22 }, { 0, 98 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 38 }, - { 0, 84 }, { 2, 1 }, { 0, 69 }, { 0, 99 }, { 4, 1 }, { 2, 1 }, { 0, 54 }, { 0, 112 }, - { 0, 113 }, { 40, 1 }, { 18, 1 }, { 8, 1 }, { 2, 1 }, { 0, 23 }, { 2, 1 }, { 0, 7 }, - { 2, 1 }, { 0, 85 }, { 0, 100 }, { 4, 1 }, { 2, 1 }, { 0, 114 }, { 0, 39 }, { 4, 1 }, - { 2, 1 }, { 0, 70 }, { 0, 101 }, { 0, 115 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 55 }, - { 2, 1 }, { 0, 86 }, { 0, 8 }, { 2, 1 }, { 0, 128 }, { 0, 129 }, { 6, 1 }, { 2, 1 }, - { 0, 24 }, { 2, 1 }, { 0, 116 }, { 0, 71 }, { 2, 1 }, { 0, 130 }, { 2, 1 }, { 0, 40 }, - { 0, 102 }, { 24, 1 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 131 }, { 0, 56 }, - { 2, 1 }, { 0, 117 }, { 0, 132 }, { 4, 1 }, { 2, 1 }, { 0, 72 }, { 0, 144 }, { 0, 145 }, - { 6, 1 }, { 2, 1 }, { 0, 25 }, { 2, 1 }, { 0, 9 }, { 0, 118 }, { 2, 1 }, { 0, 146 }, - { 0, 41 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 133 }, { 0, 88 }, { 2, 1 }, - { 0, 147 }, { 0, 57 }, { 4, 1 }, { 2, 1 }, { 0, 160 }, { 0, 10 }, { 0, 26 }, { 8, 1 }, - { 2, 1 }, { 0, 162 }, { 2, 1 }, { 0, 103 }, { 2, 1 }, { 0, 87 }, { 0, 73 }, { 6, 1 }, - { 2, 1 }, { 0, 148 }, { 2, 1 }, { 0, 119 }, { 0, 134 }, { 2, 1 }, { 0, 161 }, { 2, 1 }, - { 0, 104 }, { 0, 149 }, { 220, 1 }, { 126, 1 }, { 50, 1 }, { 26, 1 }, { 12, 1 }, { 6, 1 }, - { 2, 1 }, { 0, 42 }, { 2, 1 }, { 0, 89 }, { 0, 58 }, { 2, 1 }, { 0, 163 }, { 2, 1 }, - { 0, 135 }, { 0, 120 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 164 }, { 0, 74 }, { 2, 1 }, - { 0, 150 }, { 0, 105 }, { 4, 1 }, { 2, 1 }, { 0, 176 }, { 0, 11 }, { 0, 177 }, { 10, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 27 }, { 0, 178 }, { 2, 1 }, { 0, 43 }, { 2, 1 }, { 0, 165 }, - { 0, 90 }, { 6, 1 }, { 2, 1 }, { 0, 179 }, { 2, 1 }, { 0, 166 }, { 0, 106 }, { 4, 1 }, - { 2, 1 }, { 0, 180 }, { 0, 75 }, { 2, 1 }, { 0, 12 }, { 0, 193 }, { 30, 1 }, { 14, 1 }, - { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 181 }, { 0, 194 }, { 0, 44 }, { 4, 1 }, { 2, 1 }, - { 0, 167 }, { 0, 195 }, { 2, 1 }, { 0, 107 }, { 0, 196 }, { 8, 1 }, { 2, 1 }, { 0, 29 }, - { 4, 1 }, { 2, 1 }, { 0, 136 }, { 0, 151 }, { 0, 59 }, { 4, 1 }, { 2, 1 }, { 0, 209 }, - { 0, 210 }, { 2, 1 }, { 0, 45 }, { 0, 211 }, { 18, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 30 }, { 0, 46 }, { 0, 226 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 121 }, { 0, 152 }, - { 0, 192 }, { 2, 1 }, { 0, 28 }, { 2, 1 }, { 0, 137 }, { 0, 91 }, { 14, 1 }, { 6, 1 }, - { 2, 1 }, { 0, 60 }, { 2, 1 }, { 0, 122 }, { 0, 182 }, { 4, 1 }, { 2, 1 }, { 0, 76 }, - { 0, 153 }, { 2, 1 }, { 0, 168 }, { 0, 138 }, { 6, 1 }, { 2, 1 }, { 0, 13 }, { 2, 1 }, - { 0, 197 }, { 0, 92 }, { 4, 1 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 2, 1 }, { 0, 108 }, - { 0, 154 }, { 88, 1 }, { 86, 1 }, { 36, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 139 }, { 0, 77 }, { 2, 1 }, { 0, 199 }, { 0, 124 }, { 4, 1 }, { 2, 1 }, { 0, 213 }, - { 0, 93 }, { 2, 1 }, { 0, 224 }, { 0, 14 }, { 8, 1 }, { 2, 1 }, { 0, 227 }, { 4, 1 }, - { 2, 1 }, { 0, 208 }, { 0, 183 }, { 0, 123 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 169 }, - { 0, 184 }, { 0, 212 }, { 2, 1 }, { 0, 225 }, { 2, 1 }, { 0, 170 }, { 0, 185 }, { 24, 1 }, - { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 155 }, { 0, 214 }, { 0, 109 }, { 2, 1 }, - { 0, 62 }, { 0, 200 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 140 }, { 0, 228 }, { 0, 78 }, - { 4, 1 }, { 2, 1 }, { 0, 215 }, { 0, 229 }, { 2, 1 }, { 0, 186 }, { 0, 171 }, { 12, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 156 }, { 0, 230 }, { 4, 1 }, { 2, 1 }, { 0, 110 }, { 0, 216 }, - { 2, 1 }, { 0, 141 }, { 0, 187 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 231 }, { 0, 157 }, - { 2, 1 }, { 0, 232 }, { 0, 142 }, { 4, 1 }, { 2, 1 }, { 0, 203 }, { 0, 188 }, { 0, 158 }, - { 0, 241 }, { 2, 1 }, { 0, 31 }, { 2, 1 }, { 0, 15 }, { 0, 47 }, { 66, 1 }, { 56, 1 }, - { 2, 1 }, { 0, 242 }, { 52, 1 }, { 50, 1 }, { 20, 1 }, { 8, 1 }, { 2, 1 }, { 0, 189 }, - { 2, 1 }, { 0, 94 }, { 2, 1 }, { 0, 125 }, { 0, 201 }, { 6, 1 }, { 2, 1 }, { 0, 202 }, - { 2, 1 }, { 0, 172 }, { 0, 126 }, { 4, 1 }, { 2, 1 }, { 0, 218 }, { 0, 173 }, { 0, 204 }, - { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 174 }, { 2, 1 }, { 0, 219 }, { 0, 220 }, { 2, 1 }, - { 0, 205 }, { 0, 190 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 235 }, { 0, 237 }, { 0, 238 }, - { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 217 }, { 0, 234 }, { 0, 233 }, { 2, 1 }, { 0, 222 }, - { 4, 1 }, { 2, 1 }, { 0, 221 }, { 0, 236 }, { 0, 206 }, { 0, 63 }, { 0, 240 }, { 4, 1 }, - { 2, 1 }, { 0, 243 }, { 0, 244 }, { 2, 1 }, { 0, 79 }, { 2, 1 }, { 0, 245 }, { 0, 95 }, - { 10, 1 }, { 2, 1 }, { 0, 255 }, { 4, 1 }, { 2, 1 }, { 0, 246 }, { 0, 111 }, { 2, 1 }, - { 0, 247 }, { 0, 127 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 143 }, { 2, 1 }, { 0, 248 }, - { 0, 249 }, { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 250 }, { 0, 175 }, { 8, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 251 }, { 0, 191 }, { 2, 1 }, { 0, 252 }, { 0, 207 }, { 4, 1 }, { 2, 1 }, - { 0, 253 }, { 0, 223 }, { 2, 1 }, { 0, 254 }, { 0, 239 }, }; - - - private static int ValTab24[][] = { { 60, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 16 }, - { 2, 1 }, { 0, 1 }, { 0, 17 }, { 14, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, - { 0, 33 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, - { 14, 1 }, { 4, 1 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, - { 0, 35 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 4 }, { 0, 65 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 20 }, { 0, 51 }, { 2, 1 }, { 0, 66 }, { 0, 36 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, - { 0, 67 }, { 0, 52 }, { 0, 81 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 80 }, { 0, 5 }, - { 0, 21 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 250, 1 }, { 98, 1 }, { 34, 1 }, { 18, 1 }, - { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 2, 1 }, { 0, 53 }, { 2, 1 }, - { 0, 96 }, { 0, 6 }, { 4, 1 }, { 2, 1 }, { 0, 97 }, { 0, 22 }, { 2, 1 }, { 0, 98 }, - { 0, 38 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 84 }, { 0, 69 }, { 2, 1 }, { 0, 99 }, - { 0, 54 }, { 4, 1 }, { 2, 1 }, { 0, 113 }, { 0, 85 }, { 2, 1 }, { 0, 100 }, { 0, 70 }, - { 32, 1 }, { 14, 1 }, { 6, 1 }, { 2, 1 }, { 0, 114 }, { 2, 1 }, { 0, 39 }, { 0, 55 }, - { 2, 1 }, { 0, 115 }, { 4, 1 }, { 2, 1 }, { 0, 112 }, { 0, 7 }, { 0, 23 }, { 10, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 101 }, { 0, 86 }, { 4, 1 }, { 2, 1 }, { 0, 128 }, { 0, 8 }, - { 0, 129 }, { 4, 1 }, { 2, 1 }, { 0, 116 }, { 0, 71 }, { 2, 1 }, { 0, 24 }, { 0, 130 }, - { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 40 }, { 0, 102 }, { 2, 1 }, { 0, 131 }, - { 0, 56 }, { 4, 1 }, { 2, 1 }, { 0, 117 }, { 0, 87 }, { 2, 1 }, { 0, 132 }, { 0, 72 }, - { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 145 }, { 0, 25 }, { 2, 1 }, { 0, 146 }, { 0, 118 }, - { 4, 1 }, { 2, 1 }, { 0, 103 }, { 0, 41 }, { 2, 1 }, { 0, 133 }, { 0, 88 }, { 92, 1 }, - { 34, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 147 }, { 0, 57 }, { 2, 1 }, - { 0, 148 }, { 0, 73 }, { 4, 1 }, { 2, 1 }, { 0, 119 }, { 0, 134 }, { 2, 1 }, { 0, 104 }, - { 0, 161 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 162 }, { 0, 42 }, { 2, 1 }, { 0, 149 }, - { 0, 89 }, { 4, 1 }, { 2, 1 }, { 0, 163 }, { 0, 58 }, { 2, 1 }, { 0, 135 }, { 2, 1 }, - { 0, 120 }, { 0, 74 }, { 22, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 164 }, { 0, 150 }, - { 4, 1 }, { 2, 1 }, { 0, 105 }, { 0, 177 }, { 2, 1 }, { 0, 27 }, { 0, 165 }, { 6, 1 }, - { 2, 1 }, { 0, 178 }, { 2, 1 }, { 0, 90 }, { 0, 43 }, { 2, 1 }, { 0, 136 }, { 0, 179 }, - { 16, 1 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 144 }, { 2, 1 }, { 0, 9 }, { 0, 160 }, - { 2, 1 }, { 0, 151 }, { 0, 121 }, { 4, 1 }, { 2, 1 }, { 0, 166 }, { 0, 106 }, { 0, 180 }, - { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 26 }, { 2, 1 }, { 0, 10 }, { 0, 176 }, { 2, 1 }, - { 0, 59 }, { 2, 1 }, { 0, 11 }, { 0, 192 }, { 4, 1 }, { 2, 1 }, { 0, 75 }, { 0, 193 }, - { 2, 1 }, { 0, 152 }, { 0, 137 }, { 67, 1 }, { 34, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 28 }, { 0, 181 }, { 2, 1 }, { 0, 91 }, { 0, 194 }, { 4, 1 }, { 2, 1 }, - { 0, 44 }, { 0, 167 }, { 2, 1 }, { 0, 122 }, { 0, 195 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, - { 0, 60 }, { 2, 1 }, { 0, 12 }, { 0, 208 }, { 2, 1 }, { 0, 182 }, { 0, 107 }, { 4, 1 }, - { 2, 1 }, { 0, 196 }, { 0, 76 }, { 2, 1 }, { 0, 153 }, { 0, 168 }, { 16, 1 }, { 8, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 138 }, { 0, 197 }, { 2, 1 }, { 0, 92 }, { 0, 209 }, { 4, 1 }, - { 2, 1 }, { 0, 183 }, { 0, 123 }, { 2, 1 }, { 0, 29 }, { 0, 210 }, { 9, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 45 }, { 0, 211 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 85, 250 }, { 4, 1 }, - { 2, 1 }, { 0, 108 }, { 0, 169 }, { 2, 1 }, { 0, 154 }, { 0, 212 }, { 32, 1 }, { 16, 1 }, - { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 184 }, { 0, 139 }, { 2, 1 }, { 0, 77 }, { 0, 199 }, - { 4, 1 }, { 2, 1 }, { 0, 124 }, { 0, 213 }, { 2, 1 }, { 0, 93 }, { 0, 225 }, { 8, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 30 }, { 0, 226 }, { 2, 1 }, { 0, 170 }, { 0, 185 }, { 4, 1 }, - { 2, 1 }, { 0, 155 }, { 0, 227 }, { 2, 1 }, { 0, 214 }, { 0, 109 }, { 20, 1 }, { 10, 1 }, - { 6, 1 }, { 2, 1 }, { 0, 62 }, { 2, 1 }, { 0, 46 }, { 0, 78 }, { 2, 1 }, { 0, 200 }, - { 0, 140 }, { 4, 1 }, { 2, 1 }, { 0, 228 }, { 0, 215 }, { 4, 1 }, { 2, 1 }, { 0, 125 }, - { 0, 171 }, { 0, 229 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 186 }, { 0, 94 }, { 2, 1 }, - { 0, 201 }, { 2, 1 }, { 0, 156 }, { 0, 110 }, { 8, 1 }, { 2, 1 }, { 0, 230 }, { 2, 1 }, - { 0, 13 }, { 2, 1 }, { 0, 224 }, { 0, 14 }, { 4, 1 }, { 2, 1 }, { 0, 216 }, { 0, 141 }, - { 2, 1 }, { 0, 187 }, { 0, 202 }, { 74, 1 }, { 2, 1 }, { 0, 255 }, { 64, 1 }, { 58, 1 }, - { 32, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 172 }, { 0, 231 }, { 2, 1 }, - { 0, 126 }, { 0, 217 }, { 4, 1 }, { 2, 1 }, { 0, 157 }, { 0, 232 }, { 2, 1 }, { 0, 142 }, - { 0, 203 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 188 }, { 0, 218 }, { 2, 1 }, { 0, 173 }, - { 0, 233 }, { 4, 1 }, { 2, 1 }, { 0, 158 }, { 0, 204 }, { 2, 1 }, { 0, 219 }, { 0, 189 }, - { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 234 }, { 0, 174 }, { 2, 1 }, { 0, 220 }, - { 0, 205 }, { 4, 1 }, { 2, 1 }, { 0, 235 }, { 0, 190 }, { 2, 1 }, { 0, 221 }, { 0, 236 }, - { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 206 }, { 0, 237 }, { 2, 1 }, { 0, 222 }, { 0, 238 }, - { 0, 15 }, { 4, 1 }, { 2, 1 }, { 0, 240 }, { 0, 31 }, { 0, 241 }, { 4, 1 }, { 2, 1 }, - { 0, 242 }, { 0, 47 }, { 2, 1 }, { 0, 243 }, { 0, 63 }, { 18, 1 }, { 8, 1 }, { 4, 1 }, - { 2, 1 }, { 0, 244 }, { 0, 79 }, { 2, 1 }, { 0, 245 }, { 0, 95 }, { 4, 1 }, { 2, 1 }, - { 0, 246 }, { 0, 111 }, { 2, 1 }, { 0, 247 }, { 2, 1 }, { 0, 127 }, { 0, 143 }, { 10, 1 }, - { 4, 1 }, { 2, 1 }, { 0, 248 }, { 0, 249 }, { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 175 }, - { 0, 250 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 251 }, { 0, 191 }, { 2, 1 }, { 0, 252 }, - { 0, 207 }, { 4, 1 }, { 2, 1 }, { 0, 253 }, { 0, 223 }, { 2, 1 }, { 0, 254 }, { 0, 239 }, }; - - - private static int ValTab32[][] = { { 2, 1 }, { 0, 0 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 8 }, - { 0, 4 }, { 2, 1 }, { 0, 1 }, { 0, 2 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 12 }, { 0, 10 }, - { 2, 1 }, { 0, 3 }, { 0, 6 }, { 6, 1 }, { 2, 1 }, { 0, 9 }, { 2, 1 }, { 0, 5 }, { 0, 7 }, - { 4, 1 }, { 2, 1 }, { 0, 14 }, { 0, 13 }, { 2, 1 }, { 0, 15 }, { 0, 11 }, }; - - - private static int ValTab33[][] = { { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 1 }, - { 2, 1 }, { 0, 2 }, { 0, 3 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 5 }, { 2, 1 }, { 0, 6 }, - { 0, 7 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 8 }, { 0, 9 }, { 2, 1 }, { 0, 10 }, { 0, 11 }, - { 4, 1 }, { 2, 1 }, { 0, 12 }, { 0, 13 }, { 2, 1 }, { 0, 14 }, { 0, 15 }, }; - - + }; + + private static int ValTab15[][] = { { 16, 1 }, { 6, 1 }, { 2, 1 }, { 0, 0 }, { 2, 1 }, { 0, 16 }, { 0, 1 }, { 2, 1 }, { 0, 17 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 50, 1 }, { 16, 1 }, { 6, 1 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, { 0, 49 }, { 6, 1 }, { 2, 1 }, { 0, 19 }, { 2, 1 }, { 0, 3 }, { 0, 64 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 14, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 20 }, { 0, 65 }, { 4, 1 }, { 2, 1 }, { 0, 51 }, { 0, 66 }, { 2, 1 }, { 0, 36 }, { 0, 67 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 52 }, { 2, 1 }, { 0, 80 }, { 0, 5 }, { 2, 1 }, { 0, 81 }, { 0, 21 }, { 4, 1 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 0, 97 }, { 90, 1 }, { 36, 1 }, { 18, 1 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 53 }, { 2, 1 }, { 0, 96 }, { 0, 6 }, { 2, 1 }, { 0, 22 }, { 0, 98 }, { 4, 1 }, { 2, 1 }, { 0, 38 }, { 0, 84 }, { 2, 1 }, { 0, 69 }, { 0, 99 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 54 }, { 2, 1 }, { 0, 112 }, { 0, 7 }, { 2, 1 }, { 0, 113 }, { 0, 85 }, { 4, 1 }, { 2, 1 }, { 0, 23 }, { 0, 100 }, { 2, 1 }, { 0, 114 }, { 0, 39 }, { 24, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 70 }, { 0, 115 }, { 2, 1 }, { 0, 55 }, { 0, 101 }, { 4, 1 }, { 2, 1 }, { 0, 86 }, { 0, 128 }, { 2, 1 }, { 0, 8 }, { 0, 116 }, { 4, 1 }, { 2, 1 }, { 0, 129 }, { 0, 24 }, { 2, 1 }, { 0, 130 }, { 0, 40 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 71 }, { 0, 102 }, { 2, 1 }, { 0, 131 }, { 0, 56 }, { 4, 1 }, { 2, 1 }, { 0, 117 }, { 0, 87 }, { 2, 1 }, { 0, 132 }, { 0, 72 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 144 }, { 0, 25 }, { 0, 145 }, { 4, 1 }, { 2, 1 }, { 0, 146 }, { 0, 118 }, { 2, 1 }, { 0, 103 }, { 0, 41 }, { 92, 1 }, { 36, 1 }, { 18, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 133 }, { 0, 88 }, { 4, 1 }, { 2, 1 }, { 0, 9 }, { 0, 119 }, { 0, 147 }, { 4, 1 }, { 2, 1 }, { 0, 57 }, { 0, 148 }, { 2, 1 }, { 0, 73 }, { 0, 134 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 104 }, { 2, 1 }, { 0, 160 }, { 0, 10 }, { 2, 1 }, { 0, 161 }, { 0, 26 }, { 4, 1 }, { 2, 1 }, { 0, 162 }, { 0, 42 }, { 2, 1 }, { 0, 149 }, { 0, 89 }, { 26, 1 }, { 14, 1 }, { 6, 1 }, { 2, 1 }, { 0, 163 }, { 2, 1 }, { 0, 58 }, { 0, 135 }, { 4, 1 }, { 2, 1 }, { 0, 120 }, { 0, 164 }, { 2, 1 }, { 0, 74 }, { 0, 150 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 105 }, { 0, 176 }, { 0, 177 }, { 4, 1 }, { 2, 1 }, { 0, 27 }, { 0, 165 }, { 0, 178 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 90 }, { 0, 43 }, { 2, 1 }, { 0, 136 }, { 0, 151 }, { 2, 1 }, { 0, 179 }, { 2, 1 }, { 0, 121 }, { 0, 59 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 106 }, { 0, 180 }, { 2, 1 }, { 0, 75 }, { 0, 193 }, { 4, 1 }, { 2, 1 }, { 0, 152 }, { 0, 137 }, { 2, 1 }, { 0, 28 }, { 0, 181 }, { 80, 1 }, { 34, 1 }, { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 91 }, { 0, 44 }, { 0, 194 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 11 }, { 0, 192 }, { 0, 166 }, { 2, 1 }, { 0, 167 }, { 0, 122 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 195 }, { 0, 60 }, { 4, 1 }, { 2, 1 }, { 0, 12 }, { 0, 153 }, { 0, 182 }, { 4, 1 }, { 2, 1 }, { 0, 107 }, { 0, 196 }, { 2, 1 }, { 0, 76 }, { 0, 168 }, { 20, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 138 }, { 0, 197 }, { 4, 1 }, { 2, 1 }, { 0, 208 }, { 0, 92 }, { 0, 209 }, { 4, 1 }, { 2, 1 }, { 0, 183 }, { 0, 123 }, { 2, 1 }, { 0, 29 }, { 2, 1 }, { 0, 13 }, { 0, 45 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 210 }, { 0, 211 }, { 4, 1 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 2, 1 }, { 0, 108 }, { 0, 169 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 154 }, { 0, 184 }, { 0, 212 }, { 4, 1 }, { 2, 1 }, { 0, 139 }, { 0, 77 }, { 2, 1 }, { 0, 199 }, { 0, 124 }, { 68, 1 }, { 34, 1 }, { 18, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 213 }, { 0, 93 }, { 4, 1 }, { 2, 1 }, { 0, 224 }, { 0, 14 }, { 0, 225 }, { 4, 1 }, { 2, 1 }, { 0, 30 }, { 0, 226 }, { 2, 1 }, { 0, 170 }, { 0, 46 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 185 }, { 0, 155 }, { 2, 1 }, { 0, 227 }, { 0, 214 }, { 4, 1 }, { 2, 1 }, { 0, 109 }, { 0, 62 }, { 2, 1 }, { 0, 200 }, { 0, 140 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 228 }, { 0, 78 }, { 2, 1 }, { 0, 215 }, { 0, 125 }, { 4, 1 }, { 2, 1 }, { 0, 229 }, { 0, 186 }, { 2, 1 }, { 0, 171 }, { 0, 94 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 201 }, { 0, 156 }, { 2, 1 }, { 0, 241 }, { 0, 31 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 240 }, { 0, 110 }, { 0, 242 }, { 2, 1 }, { 0, 47 }, { 0, 230 }, { 38, 1 }, { 18, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 216 }, { 0, 243 }, { 2, 1 }, { 0, 63 }, { 0, 244 }, { 6, 1 }, { 2, 1 }, { 0, 79 }, { 2, 1 }, { 0, 141 }, { 0, 217 }, { 2, 1 }, { 0, 187 }, { 0, 202 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 172 }, { 0, 231 }, { 2, 1 }, { 0, 126 }, { 0, 245 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 157 }, { 0, 95 }, { 2, 1 }, { 0, 232 }, { 0, 142 }, { 2, 1 }, { 0, 246 }, { 0, 203 }, { 34, 1 }, { 18, 1 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 15 }, { 0, 174 }, { 0, 111 }, { 2, 1 }, { 0, 188 }, { 0, 218 }, { 4, 1 }, { 2, 1 }, { 0, 173 }, { 0, 247 }, { 2, 1 }, { 0, 127 }, { 0, 233 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 158 }, { 0, 204 }, { 2, 1 }, { 0, 248 }, { 0, 143 }, { 4, 1 }, { 2, 1 }, { 0, 219 }, { 0, 189 }, { 2, 1 }, { 0, 234 }, { 0, 249 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 220 }, { 2, 1 }, { 0, 205 }, { 0, 235 }, { 4, 1 }, { 2, 1 }, { 0, 190 }, { 0, 250 }, { 2, 1 }, { 0, 175 }, { 0, 221 }, { 14, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 236 }, { 0, 206 }, { 0, 251 }, { 4, 1 }, { 2, 1 }, { 0, 191 }, { 0, 237 }, { 2, 1 }, { 0, 222 }, { 0, 252 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 207 }, { 0, 253 }, { 0, 238 }, { 4, 1 }, { 2, 1 }, { 0, 223 }, { 0, 254 }, { 2, 1 }, { 0, 239 }, { 0, 255 }, }; + + private static int ValTab16[][] = { { 2, 1 }, { 0, 0 }, { 6, 1 }, { 2, 1 }, { 0, 16 }, { 2, 1 }, { 0, 1 }, { 0, 17 }, { 42, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 2, 1 }, { 0, 33 }, { 0, 18 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 4 }, { 0, 65 }, { 6, 1 }, { 2, 1 }, { 0, 20 }, { 2, 1 }, { 0, 51 }, { 0, 66 }, { 4, 1 }, { 2, 1 }, { 0, 36 }, { 0, 80 }, { 2, 1 }, { 0, 67 }, { 0, 52 }, { 138, 1 }, { 40, 1 }, { 16, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 5 }, { 0, 21 }, { 0, 81 }, { 4, 1 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 53 }, { 0, 83 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 96 }, { 0, 6 }, { 0, 97 }, { 2, 1 }, { 0, 22 }, { 0, 98 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 38 }, { 0, 84 }, { 2, 1 }, { 0, 69 }, { 0, 99 }, { 4, 1 }, { 2, 1 }, { 0, 54 }, { 0, 112 }, { 0, 113 }, { 40, 1 }, { 18, 1 }, { 8, 1 }, { 2, 1 }, { 0, 23 }, { 2, 1 }, { 0, 7 }, { 2, 1 }, { 0, 85 }, { 0, 100 }, { 4, 1 }, { 2, 1 }, { 0, 114 }, { 0, 39 }, { 4, 1 }, { 2, 1 }, { 0, 70 }, { 0, 101 }, { 0, 115 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 55 }, { 2, 1 }, { 0, 86 }, { 0, 8 }, { 2, 1 }, { 0, 128 }, { 0, 129 }, { 6, 1 }, { 2, 1 }, { 0, 24 }, { 2, 1 }, { 0, 116 }, { 0, 71 }, { 2, 1 }, { 0, 130 }, { 2, 1 }, { 0, 40 }, { 0, 102 }, { 24, 1 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 131 }, { 0, 56 }, { 2, 1 }, { 0, 117 }, { 0, 132 }, { 4, 1 }, { 2, 1 }, { 0, 72 }, { 0, 144 }, { 0, 145 }, { 6, 1 }, { 2, 1 }, { 0, 25 }, { 2, 1 }, { 0, 9 }, { 0, 118 }, { 2, 1 }, { 0, 146 }, { 0, 41 }, { 14, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 133 }, { 0, 88 }, { 2, 1 }, { 0, 147 }, { 0, 57 }, { 4, 1 }, { 2, 1 }, { 0, 160 }, { 0, 10 }, { 0, 26 }, { 8, 1 }, { 2, 1 }, { 0, 162 }, { 2, 1 }, { 0, 103 }, { 2, 1 }, { 0, 87 }, { 0, 73 }, { 6, 1 }, { 2, 1 }, { 0, 148 }, { 2, 1 }, { 0, 119 }, { 0, 134 }, { 2, 1 }, { 0, 161 }, { 2, 1 }, { 0, 104 }, { 0, 149 }, { 220, 1 }, { 126, 1 }, { 50, 1 }, { 26, 1 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 42 }, { 2, 1 }, { 0, 89 }, { 0, 58 }, { 2, 1 }, { 0, 163 }, { 2, 1 }, { 0, 135 }, { 0, 120 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 164 }, { 0, 74 }, { 2, 1 }, { 0, 150 }, { 0, 105 }, { 4, 1 }, { 2, 1 }, { 0, 176 }, { 0, 11 }, { 0, 177 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 27 }, { 0, 178 }, { 2, 1 }, { 0, 43 }, { 2, 1 }, { 0, 165 }, { 0, 90 }, { 6, 1 }, { 2, 1 }, { 0, 179 }, { 2, 1 }, { 0, 166 }, { 0, 106 }, { 4, 1 }, { 2, 1 }, { 0, 180 }, { 0, 75 }, { 2, 1 }, { 0, 12 }, { 0, 193 }, { 30, 1 }, { 14, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 181 }, { 0, 194 }, { 0, 44 }, { 4, 1 }, { 2, 1 }, { 0, 167 }, { 0, 195 }, { 2, 1 }, { 0, 107 }, { 0, 196 }, { 8, 1 }, { 2, 1 }, { 0, 29 }, { 4, 1 }, { 2, 1 }, { 0, 136 }, { 0, 151 }, { 0, 59 }, { 4, 1 }, { 2, 1 }, { 0, 209 }, { 0, 210 }, { 2, 1 }, { 0, 45 }, { 0, 211 }, { 18, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 30 }, { 0, 46 }, { 0, 226 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 121 }, { 0, 152 }, { 0, 192 }, { 2, 1 }, { 0, 28 }, { 2, 1 }, { 0, 137 }, { 0, 91 }, { 14, 1 }, { 6, 1 }, { 2, 1 }, { 0, 60 }, { 2, 1 }, { 0, 122 }, { 0, 182 }, { 4, 1 }, { 2, 1 }, { 0, 76 }, { 0, 153 }, { 2, 1 }, { 0, 168 }, { 0, 138 }, { 6, 1 }, { 2, 1 }, { 0, 13 }, { 2, 1 }, { 0, 197 }, { 0, 92 }, { 4, 1 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 2, 1 }, { 0, 108 }, { 0, 154 }, { 88, 1 }, { 86, 1 }, { 36, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 139 }, { 0, 77 }, { 2, 1 }, { 0, 199 }, { 0, 124 }, { 4, 1 }, { 2, 1 }, { 0, 213 }, { 0, 93 }, { 2, 1 }, { 0, 224 }, { 0, 14 }, { 8, 1 }, { 2, 1 }, { 0, 227 }, { 4, 1 }, { 2, 1 }, { 0, 208 }, { 0, 183 }, { 0, 123 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 169 }, { 0, 184 }, { 0, 212 }, { 2, 1 }, { 0, 225 }, { 2, 1 }, { 0, 170 }, { 0, 185 }, { 24, 1 }, { 10, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 155 }, { 0, 214 }, { 0, 109 }, { 2, 1 }, { 0, 62 }, { 0, 200 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 140 }, { 0, 228 }, { 0, 78 }, { 4, 1 }, { 2, 1 }, { 0, 215 }, { 0, 229 }, { 2, 1 }, { 0, 186 }, { 0, 171 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 156 }, { 0, 230 }, { 4, 1 }, { 2, 1 }, { 0, 110 }, { 0, 216 }, { 2, 1 }, { 0, 141 }, { 0, 187 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 231 }, { 0, 157 }, { 2, 1 }, { 0, 232 }, { 0, 142 }, { 4, 1 }, { 2, 1 }, { 0, 203 }, { 0, 188 }, { 0, 158 }, { 0, 241 }, { 2, 1 }, { 0, 31 }, { 2, 1 }, { 0, 15 }, { 0, 47 }, { 66, 1 }, { 56, 1 }, { 2, 1 }, { 0, 242 }, { 52, 1 }, { 50, 1 }, { 20, 1 }, { 8, 1 }, { 2, 1 }, { 0, 189 }, { 2, 1 }, { 0, 94 }, { 2, 1 }, { 0, 125 }, { 0, 201 }, { 6, 1 }, { 2, 1 }, { 0, 202 }, { 2, 1 }, { 0, 172 }, { 0, 126 }, { 4, 1 }, { 2, 1 }, { 0, 218 }, { 0, 173 }, { 0, 204 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 174 }, { 2, 1 }, { 0, 219 }, { 0, 220 }, { 2, 1 }, { 0, 205 }, { 0, 190 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 235 }, { 0, 237 }, { 0, 238 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 217 }, { 0, 234 }, { 0, 233 }, { 2, 1 }, { 0, 222 }, { 4, 1 }, { 2, 1 }, { 0, 221 }, { 0, 236 }, { 0, 206 }, { 0, 63 }, { 0, 240 }, { 4, 1 }, { 2, 1 }, { 0, 243 }, { 0, 244 }, { 2, 1 }, { 0, 79 }, { 2, 1 }, { 0, 245 }, { 0, 95 }, { 10, 1 }, { 2, 1 }, { 0, 255 }, { 4, 1 }, { 2, 1 }, { 0, 246 }, { 0, 111 }, { 2, 1 }, { 0, 247 }, { 0, 127 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 143 }, { 2, 1 }, { 0, 248 }, { 0, 249 }, { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 250 }, { 0, 175 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 251 }, { 0, 191 }, { 2, 1 }, { 0, 252 }, { 0, 207 }, { 4, 1 }, { 2, 1 }, { 0, 253 }, { 0, 223 }, { 2, 1 }, { 0, 254 }, { 0, 239 }, }; + + private static int ValTab24[][] = { { 60, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 16 }, { 2, 1 }, { 0, 1 }, { 0, 17 }, { 14, 1 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 32 }, { 0, 2 }, { 0, 33 }, { 2, 1 }, { 0, 18 }, { 2, 1 }, { 0, 34 }, { 2, 1 }, { 0, 48 }, { 0, 3 }, { 14, 1 }, { 4, 1 }, { 2, 1 }, { 0, 49 }, { 0, 19 }, { 4, 1 }, { 2, 1 }, { 0, 50 }, { 0, 35 }, { 4, 1 }, { 2, 1 }, { 0, 64 }, { 0, 4 }, { 0, 65 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 20 }, { 0, 51 }, { 2, 1 }, { 0, 66 }, { 0, 36 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 67 }, { 0, 52 }, { 0, 81 }, { 6, 1 }, { 4, 1 }, { 2, 1 }, { 0, 80 }, { 0, 5 }, { 0, 21 }, { 2, 1 }, { 0, 82 }, { 0, 37 }, { 250, 1 }, { 98, 1 }, { 34, 1 }, { 18, 1 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 68 }, { 0, 83 }, { 2, 1 }, { 0, 53 }, { 2, 1 }, { 0, 96 }, { 0, 6 }, { 4, 1 }, { 2, 1 }, { 0, 97 }, { 0, 22 }, { 2, 1 }, { 0, 98 }, { 0, 38 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 84 }, { 0, 69 }, { 2, 1 }, { 0, 99 }, { 0, 54 }, { 4, 1 }, { 2, 1 }, { 0, 113 }, { 0, 85 }, { 2, 1 }, { 0, 100 }, { 0, 70 }, { 32, 1 }, { 14, 1 }, { 6, 1 }, { 2, 1 }, { 0, 114 }, { 2, 1 }, { 0, 39 }, { 0, 55 }, { 2, 1 }, { 0, 115 }, { 4, 1 }, { 2, 1 }, { 0, 112 }, { 0, 7 }, { 0, 23 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 101 }, { 0, 86 }, { 4, 1 }, { 2, 1 }, { 0, 128 }, { 0, 8 }, { 0, 129 }, { 4, 1 }, { 2, 1 }, { 0, 116 }, { 0, 71 }, { 2, 1 }, { 0, 24 }, { 0, 130 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 40 }, { 0, 102 }, { 2, 1 }, { 0, 131 }, { 0, 56 }, { 4, 1 }, { 2, 1 }, { 0, 117 }, { 0, 87 }, { 2, 1 }, { 0, 132 }, { 0, 72 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 145 }, { 0, 25 }, { 2, 1 }, { 0, 146 }, { 0, 118 }, { 4, 1 }, { 2, 1 }, { 0, 103 }, { 0, 41 }, { 2, 1 }, { 0, 133 }, { 0, 88 }, { 92, 1 }, { 34, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 147 }, { 0, 57 }, { 2, 1 }, { 0, 148 }, { 0, 73 }, { 4, 1 }, { 2, 1 }, { 0, 119 }, { 0, 134 }, { 2, 1 }, { 0, 104 }, { 0, 161 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 162 }, { 0, 42 }, { 2, 1 }, { 0, 149 }, { 0, 89 }, { 4, 1 }, { 2, 1 }, { 0, 163 }, { 0, 58 }, { 2, 1 }, { 0, 135 }, { 2, 1 }, { 0, 120 }, { 0, 74 }, { 22, 1 }, { 12, 1 }, { 4, 1 }, { 2, 1 }, { 0, 164 }, { 0, 150 }, { 4, 1 }, { 2, 1 }, { 0, 105 }, { 0, 177 }, { 2, 1 }, { 0, 27 }, { 0, 165 }, { 6, 1 }, { 2, 1 }, { 0, 178 }, { 2, 1 }, { 0, 90 }, { 0, 43 }, { 2, 1 }, { 0, 136 }, { 0, 179 }, { 16, 1 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 144 }, { 2, 1 }, { 0, 9 }, { 0, 160 }, { 2, 1 }, { 0, 151 }, { 0, 121 }, { 4, 1 }, { 2, 1 }, { 0, 166 }, { 0, 106 }, { 0, 180 }, { 12, 1 }, { 6, 1 }, { 2, 1 }, { 0, 26 }, { 2, 1 }, { 0, 10 }, { 0, 176 }, { 2, 1 }, { 0, 59 }, { 2, 1 }, { 0, 11 }, { 0, 192 }, { 4, 1 }, { 2, 1 }, { 0, 75 }, { 0, 193 }, { 2, 1 }, { 0, 152 }, { 0, 137 }, { 67, 1 }, { 34, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 28 }, { 0, 181 }, { 2, 1 }, { 0, 91 }, { 0, 194 }, { 4, 1 }, { 2, 1 }, { 0, 44 }, { 0, 167 }, { 2, 1 }, { 0, 122 }, { 0, 195 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 60 }, { 2, 1 }, { 0, 12 }, { 0, 208 }, { 2, 1 }, { 0, 182 }, { 0, 107 }, { 4, 1 }, { 2, 1 }, { 0, 196 }, { 0, 76 }, { 2, 1 }, { 0, 153 }, { 0, 168 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 138 }, { 0, 197 }, { 2, 1 }, { 0, 92 }, { 0, 209 }, { 4, 1 }, { 2, 1 }, { 0, 183 }, { 0, 123 }, { 2, 1 }, { 0, 29 }, { 0, 210 }, { 9, 1 }, { 4, 1 }, { 2, 1 }, { 0, 45 }, { 0, 211 }, { 2, 1 }, { 0, 61 }, { 0, 198 }, { 85, 250 }, { 4, 1 }, { 2, 1 }, { 0, 108 }, { 0, 169 }, { 2, 1 }, { 0, 154 }, { 0, 212 }, { 32, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 184 }, { 0, 139 }, { 2, 1 }, { 0, 77 }, { 0, 199 }, { 4, 1 }, { 2, 1 }, { 0, 124 }, { 0, 213 }, { 2, 1 }, { 0, 93 }, { 0, 225 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 30 }, { 0, 226 }, { 2, 1 }, { 0, 170 }, { 0, 185 }, { 4, 1 }, { 2, 1 }, { 0, 155 }, { 0, 227 }, { 2, 1 }, { 0, 214 }, { 0, 109 }, { 20, 1 }, { 10, 1 }, { 6, 1 }, { 2, 1 }, { 0, 62 }, { 2, 1 }, { 0, 46 }, { 0, 78 }, { 2, 1 }, { 0, 200 }, { 0, 140 }, { 4, 1 }, { 2, 1 }, { 0, 228 }, { 0, 215 }, { 4, 1 }, { 2, 1 }, { 0, 125 }, { 0, 171 }, { 0, 229 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 186 }, { 0, 94 }, { 2, 1 }, { 0, 201 }, { 2, 1 }, { 0, 156 }, { 0, 110 }, { 8, 1 }, { 2, 1 }, { 0, 230 }, { 2, 1 }, { 0, 13 }, { 2, 1 }, { 0, 224 }, { 0, 14 }, { 4, 1 }, { 2, 1 }, { 0, 216 }, { 0, 141 }, { 2, 1 }, { 0, 187 }, { 0, 202 }, { 74, 1 }, { 2, 1 }, { 0, 255 }, { 64, 1 }, { 58, 1 }, { 32, 1 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 172 }, { 0, 231 }, { 2, 1 }, { 0, 126 }, { 0, 217 }, { 4, 1 }, { 2, 1 }, { 0, 157 }, { 0, 232 }, { 2, 1 }, { 0, 142 }, { 0, 203 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 188 }, { 0, 218 }, { 2, 1 }, { 0, 173 }, { 0, 233 }, { 4, 1 }, { 2, 1 }, { 0, 158 }, { 0, 204 }, { 2, 1 }, { 0, 219 }, { 0, 189 }, { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 234 }, { 0, 174 }, { 2, 1 }, { 0, 220 }, { 0, 205 }, { 4, 1 }, { 2, 1 }, { 0, 235 }, { 0, 190 }, { 2, 1 }, { 0, 221 }, { 0, 236 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 206 }, { 0, 237 }, { 2, 1 }, { 0, 222 }, { 0, 238 }, { 0, 15 }, { 4, 1 }, { 2, 1 }, { 0, 240 }, { 0, 31 }, { 0, 241 }, { 4, 1 }, { 2, 1 }, { 0, 242 }, { 0, 47 }, { 2, 1 }, { 0, 243 }, { 0, 63 }, { 18, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 244 }, { 0, 79 }, { 2, 1 }, { 0, 245 }, { 0, 95 }, { 4, 1 }, { 2, 1 }, { 0, 246 }, { 0, 111 }, { 2, 1 }, { 0, 247 }, { 2, 1 }, { 0, 127 }, { 0, 143 }, { 10, 1 }, { 4, 1 }, { 2, 1 }, { 0, 248 }, { 0, 249 }, { 4, 1 }, { 2, 1 }, { 0, 159 }, { 0, 175 }, { 0, 250 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 251 }, { 0, 191 }, { 2, 1 }, { 0, 252 }, { 0, 207 }, { 4, 1 }, { 2, 1 }, { 0, 253 }, { 0, 223 }, { 2, 1 }, { 0, 254 }, { 0, 239 }, }; + + private static int ValTab32[][] = { { 2, 1 }, { 0, 0 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 8 }, { 0, 4 }, { 2, 1 }, { 0, 1 }, { 0, 2 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 12 }, { 0, 10 }, { 2, 1 }, { 0, 3 }, { 0, 6 }, { 6, 1 }, { 2, 1 }, { 0, 9 }, { 2, 1 }, { 0, 5 }, { 0, 7 }, { 4, 1 }, { 2, 1 }, { 0, 14 }, { 0, 13 }, { 2, 1 }, { 0, 15 }, { 0, 11 }, }; + + private static int ValTab33[][] = { { 16, 1 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 0 }, { 0, 1 }, { 2, 1 }, { 0, 2 }, { 0, 3 }, { 4, 1 }, { 2, 1 }, { 0, 4 }, { 0, 5 }, { 2, 1 }, { 0, 6 }, { 0, 7 }, { 8, 1 }, { 4, 1 }, { 2, 1 }, { 0, 8 }, { 0, 9 }, { 2, 1 }, { 0, 10 }, { 0, 11 }, { 4, 1 }, { 2, 1 }, { 0, 12 }, { 0, 13 }, { 2, 1 }, { 0, 14 }, { 0, 15 }, }; + public static huffcodetab[] ht = null; /* Simulate extern struct */ - private static int[] bitbuf = new int[32]; /** * Big Constructor : Computes all Huffman Tables. */ - private huffcodetab( String S, int XLEN, int YLEN, - int LINBITS, int LINMAX, int REF, - @DELEGATE int[] TABLE, @DELEGATE int[] HLEN, - @DELEGATE int[][] VAL, int TREELEN) { + private huffcodetab(String S, int XLEN, int YLEN, int LINBITS, int LINMAX, int REF, + @DELEGATE int[] TABLE, @DELEGATE int[] HLEN, @DELEGATE int[][] VAL, int TREELEN) { tablename0 = S.charAt(0); tablename1 = S.charAt(1); tablename2 = S.charAt(2); @@ -506,21 +141,17 @@ final class huffcodetab { * Do the huffman-decoding. note! for counta,countb -the 4 bit value is * returned in y, discard x. */ - - - public static int huffman_decoder( int htIdx, - int[] x, int[] y, - int[] v, int[] w, - BitReserve br) { + + public static int huffman_decoder(int htIdx, int[] x, int[] y, int[] v, int[] w, BitReserve br) { // array of all huffcodtable headers // 0..31 Huffman code table 0..31 // 32,33 count1-tables - int dmask = 1 << ((4 * 8) - 1); - int hs = 4 * 8; - int level; - int point = 0; - int error = 1; + int dmask = 1 << ((4 * 8) - 1); + int hs = 4 * 8; + int level; + int point = 0; + int error = 1; level = dmask; if (ht[htIdx].val == null) diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/infer/makefile b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/infer/makefile new file mode 100644 index 00000000..4a126244 --- /dev/null +++ b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/infer/makefile @@ -0,0 +1,50 @@ +BUILDSCRIPT=../../../buildscript + +PROGRAM=MP3Player +SOURCE_FILES=MP3Player.java Player.java + +ifndef INV_ERROR_PROB +INV_ERROR_PROB=1000 +endif + +ifndef RANDOMSEED +RANDOMSEED=12345 +endif + +SSJAVA= -ssjava -ssjavanoclasspath -ssjavadebug +BSFLAGS= -32bit -mainclass $(PROGRAM) -heapsize-mb 1350 -nooptimize -debug -garbagestats #-printlinenum #-joptimize +NORMAL= -ssjava-inject-error 0 0 +INJECT_ERROR= -ssjava-inject-error $(INV_ERROR_PROB) $(RANDOMSEED) + + +default: $(PROGRAM)s.bin + +normal: $(PROGRAM)n.bin + +error: $(PROGRAM)e.bin + + +$(PROGRAM)s.bin: $(SOURCE_FILES) makefile + $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES) + +$(PROGRAM)n.bin: $(SOURCE_FILES) makefile + $(BUILDSCRIPT) $(NORMAL) $(BSFLAGS) -o $(PROGRAM)n -builddir norm $(SOURCE_FILES) + +$(PROGRAM)e.bin: $(SOURCE_FILES) makefile + $(BUILDSCRIPT) $(SSJAVA) $(INJECT_ERROR) $(BSFLAGS) -o $(PROGRAM)e -builddir injerr $(SOURCE_FILES) + +cleanerror: + rm -f $(PROGRAM)e.bin + rm -rf injerr + +clean: + rm -f $(PROGRAM)s.bin $(PROGRAM)n.bin $(PROGRAM)e.bin + rm -fr ssj norm injerr + rm -f nve-diff.tmp nve-diff-ranges.tmp + rm -f *~ + rm -f *.dot + rm -f *.png + rm -f aliases.txt + rm -f results*txt + rm -f *log + diff --git a/Robust/src/ClassLibrary/SSJavaInfer/BufferedInputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/BufferedInputStream.java new file mode 100644 index 00000000..709bc601 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/BufferedInputStream.java @@ -0,0 +1,376 @@ +/* BufferedInputStream.java -- An input stream that implements buffering + Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 + * "The Java Language Specification", ISBN 0-201-63451-1 + * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. + * Status: Believed complete and correct. + */ + +/** + * This subclass of FilterInputStream buffers input from an + * underlying implementation to provide a possibly more efficient read + * mechanism. It maintains the buffer and buffer state in instance variables + * that are available to subclasses. The default buffer size of 2048 bytes can + * be overridden by the creator of the stream. + *

+ * This class also implements mark/reset functionality. It is capable of + * remembering any number of input bytes, to the limits of system memory or the + * size of Integer.MAX_VALUE + *

+ * Please note that this class does not properly handle character encodings. + * Consider using the BufferedReader class which does. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy (warrenl@cygnus.com) + * @author Jeroen Frijters (jeroen@frijters.net) + */ + +public class BufferedInputStream extends FilterInputStream { + + /** + * This is the default buffer size + */ + private static final int DEFAULT_BUFFER_SIZE = 2048; // by default, it is TOP + + /** + * The buffer used for storing data from the underlying stream. + */ + + protected byte[] buf; + + /** + * The number of valid bytes currently in the buffer. It is also the index of + * the buffer position one byte past the end of the valid data. + */ + + protected int count; + + /** + * The index of the next character that will by read from the buffer. When + * pos == count, the buffer is empty. + */ + + protected int pos; + + /** + * The value of pos when the mark() method was + * called. This is set to -1 if there is no mark set. + */ + + protected int markpos = -1; + + /** + * This is the maximum number of bytes than can be read after a call to + * mark() before the mark can be discarded. After this may bytes + * are read, the reset() method may not be called successfully. + */ + protected int marklimit; + + /** + * This is the initial buffer size. When the buffer is grown because of + * marking requirements, it will be grown by bufferSize increments. The + * underlying stream will be read in chunks of bufferSize. + */ + private final int bufferSize; + + /** + * This method initializes a new BufferedInputStream that will + * read from the specified subordinate stream with a default buffer size of + * 2048 bytes + * + * @param in + * The subordinate stream to read from + */ + public BufferedInputStream(InputStream in) { + this(in, DEFAULT_BUFFER_SIZE); + } + + /** + * This method initializes a new BufferedInputStream that will + * read from the specified subordinate stream with a buffer size that is + * specified by the caller. + * + * @param in + * The subordinate stream to read from + * @param size + * The buffer size to use + * + * @exception IllegalArgumentException + * when size is smaller then 1 + */ + public BufferedInputStream(InputStream in, int size) { + super(in); + if (size <= 0) + throw new IllegalArgumentException(); + buf = new byte[size]; + // initialize pos & count to bufferSize, to prevent refill from + // allocating a new buffer (if the caller starts out by calling mark()). + pos = count = bufferSize = size; + } + + /** + * This method returns the number of bytes that can be read from this stream + * before a read can block. A return of 0 indicates that blocking might (or + * might not) occur on the very next read attempt. + *

+ * The number of available bytes will be the number of read ahead bytes stored + * in the internal buffer plus the number of available bytes in the underlying + * stream. + * + * @return The number of bytes that can be read before blocking could occur + * + * @exception IOException + * If an error occurs + */ + public synchronized int available() throws IOException { + return count - pos + super.available(); + } + + /** + * This method closes the underlying input stream and frees any resources + * associated with it. Sets buf to null. + * + * @exception IOException + * If an error occurs. + */ + public void close() throws IOException { + // Free up the array memory. + buf = null; + pos = count = 0; + markpos = -1; + super.close(); + } + + /** + * This method marks a position in the input to which the stream can be + * "reset" by calling the reset() method. The parameter + * readlimit is the number of bytes that can be read from the + * stream after setting the mark before the mark becomes invalid. For example, + * if mark() is called with a read limit of 10, then when 11 + * bytes of data are read from the stream before the reset() + * method is called, then the mark is invalid and the stream object instance + * is not required to remember the mark. + *

+ * Note that the number of bytes that can be remembered by this method can be + * greater than the size of the internal read buffer. It is also not dependent + * on the subordinate stream supporting mark/reset functionality. + * + * @param readlimit + * The number of bytes that can be read before the mark becomes + * invalid + */ + public synchronized void mark(int readlimit) { + marklimit = readlimit; + markpos = pos; + } + + /** + * This method returns true to indicate that this class supports + * mark/reset functionality. + * + * @return true to indicate that mark/reset functionality is + * supported + * + */ + public boolean markSupported() { + return true; + } + + /** + * This method reads an unsigned byte from the input stream and returns it as + * an int in the range of 0-255. This method also will return -1 if the end of + * the stream has been reached. + *

+ * This method will block until the byte can be read. + * + * @return The byte read or -1 if end of stream + * + * @exception IOException + * If an error occurs + */ + public synchronized int read() throws IOException { + if (pos >= count && !refill()) + return -1; // EOF + + return buf[pos++] & 0xFF; + } + + /** + * This method reads bytes from a stream and stores them into a caller + * supplied buffer. It starts storing the data at index off into + * the buffer and attempts to read len bytes. This method can + * return before reading the number of bytes requested, but it will try to + * read the requested number of bytes by repeatedly calling the underlying + * stream as long as available() for this stream continues to return a + * non-zero value (or until the requested number of bytes have been read). The + * actual number of bytes read is returned as an int. A -1 is returned to + * indicate the end of the stream. + *

+ * This method will block until some data can be read. + * + * @param b + * The array into which the bytes read should be stored + * @param off + * The offset into the array to start storing bytes + * @param len + * The requested number of bytes to read + * + * @return The actual number of bytes read, or -1 if end of stream. + * + * @exception IOException + * If an error occurs. + * @exception IndexOutOfBoundsException + * when off or len are negative, or + * when off + len is larger then the size of + * b, + */ + public synchronized int read(byte[] b, int off, int len) throws IOException { + if (off < 0 || len < 0 || b.length - off < len) + // throw new IndexOutOfBoundsException(); + return -1; + + if (len == 0) + return 0; + + if (pos >= count && !refill()) + return -1; // No bytes were read before EOF. + + int totalBytesRead = Math.min(count - pos, len); + System.arraycopy(buf, pos, b, off, totalBytesRead); + pos += totalBytesRead; + off += totalBytesRead; + len -= totalBytesRead; + + while (len > 0 && super.available() > 0 && refill()) { + int remain = Math.min(count - pos, len); + System.arraycopy(buf, pos, b, off, remain); + pos += remain; + off += remain; + len -= remain; + totalBytesRead += remain; + } + + return totalBytesRead; + } + + /** + * This method resets a stream to the point where the mark() + * method was called. Any bytes that were read after the mark point was set + * will be re-read during subsequent reads. + *

+ * This method will throw an IOException if the number of bytes read from the + * stream since the call to mark() exceeds the mark limit passed + * when establishing the mark. + * + * @exception IOException + * If mark() was never called or more then + * marklimit bytes were read since the last call to + * mark() + */ + public synchronized void reset() throws IOException { + if (markpos == -1) + throw new IOException(buf == null ? "Stream closed." : "Invalid mark."); + + pos = markpos; + } + + /** + * This method skips the specified number of bytes in the stream. It returns + * the actual number of bytes skipped, which may be less than the requested + * amount. + * + * @param n + * The requested number of bytes to skip + * + * @return The actual number of bytes skipped. + * + * @exception IOException + * If an error occurs + */ + public synchronized long skip(long n) throws IOException { + if (buf == null) + throw new IOException("Stream closed."); + + final long origN = n; + + while (n > 0L) { + if (pos >= count && !refill()) + break; + + int numread = (int) Math.min((long) (count - pos), n); + pos += numread; + n -= numread; + } + + return origN - n; + } + + /** + * Called to refill the buffer (when count is equal to pos). + * + * @return true when at least one additional byte was read into + * buf, false otherwise (at EOF). + */ + private boolean refill() throws IOException { + if (buf == null) + throw new IOException("Stream closed."); + + if (markpos == -1 || count - markpos >= marklimit) { + markpos = -1; + pos = count = 0; + } else { + byte[] newbuf = buf; + if (markpos < bufferSize) { + newbuf = new byte[count - markpos + bufferSize]; + } + System.arraycopy(buf, markpos, newbuf, 0, count - markpos); + buf = newbuf; + count -= markpos; + pos -= markpos; + markpos = 0; + } + + int numread = super.read(buf, count, bufferSize); + + if (numread <= 0) // EOF + return false; + + count += numread; + return true; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/ByteArrayInputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/ByteArrayInputStream.java new file mode 100644 index 00000000..37e8126f --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/ByteArrayInputStream.java @@ -0,0 +1,243 @@ +/* ByteArrayInputStream.java -- Read an array as a stream + Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.io; + +/** + * This class permits an array of bytes to be read as an input stream. + * + * @author Warren Levy (warrenl@cygnus.com) + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + +public class ByteArrayInputStream extends InputStream { + /** + * The array that contains the data supplied during read operations + */ + protected byte[] buf; + + /** + * The array index of the next byte to be read from the buffer + * buf + */ + protected int pos; + + /** + * The currently marked position in the stream. This defaults to 0, so a reset + * operation on the stream resets it to read from array index 0 in the buffer + * - even if the stream was initially created with an offset greater than 0 + */ + protected int mark; + + /** + * This indicates the maximum number of bytes that can be read from this + * stream. It is the array index of the position after the last valid byte in + * the buffer buf + */ + protected int count; + + /** + * Create a new ByteArrayInputStream that will read bytes from the passed in + * byte array. This stream will read from the beginning to the end of the + * array. It is identical to calling an overloaded constructor as + * ByteArrayInputStream(buf, 0, buf.length). + *

+ * Note that this array is not copied. If its contents are changed while this + * stream is being read, those changes will be reflected in the bytes supplied + * to the reader. Please use caution in changing the contents of the buffer + * while this stream is open. + * + * @param buffer + * The byte array buffer this stream will read from. + */ + public ByteArrayInputStream(byte[] buffer) { + this(buffer, 0, buffer.length); + } + + /** + * Create a new ByteArrayInputStream that will read bytes from the passed in + * byte array. This stream will read from position offset in the + * array for a length of length bytes past offset. + * If the stream is reset to a position before offset then more + * than length bytes can be read from the stream. The + * length value should be viewed as the array index one greater + * than the last position in the buffer to read. + *

+ * Note that this array is not copied. If its contents are changed while this + * stream is being read, those changes will be reflected in the bytes supplied + * to the reader. Please use caution in changing the contents of the buffer + * while this stream is open. + * + * @param buffer + * The byte array buffer this stream will read from. + * @param offset + * The index into the buffer to start reading bytes from + * @param length + * The number of bytes to read from the buffer + */ + public ByteArrayInputStream(byte[] buffer, int offset, int length) { + if (offset < 0 || length < 0 || offset > buffer.length) + throw new IllegalArgumentException(); + + buf = buffer; + + count = offset + length; + if (count > buf.length) + count = buf.length; + + pos = offset; + mark = pos; + } + + /** + * This method returns the number of bytes available to be read from this + * stream. The value returned will be equal to count - pos. + * + * @return The number of bytes that can be read from this stream before + * blocking, which is all of them + */ + public synchronized int available() { + return count - pos; + } + + /** + * This method sets the mark position in this stream to the current position. + * Note that the readlimit parameter in this method does nothing + * as this stream is always capable of remembering all the bytes int it. + *

+ * Note that in this class the mark position is set by default to position 0 + * in the stream. This is in constrast to some other stream types where there + * is no default mark position. + * + * @param readLimit + * The number of bytes this stream must remember. This parameter is + * ignored. + */ + public synchronized void mark(int readLimit) { + // readLimit is ignored per Java Class Lib. book, p.220. + mark = pos; + } + + /** + * This method overrides the markSupported method in + * InputStream in order to return true - indicating + * that this stream class supports mark/reset functionality. + * + * @return true to indicate that this class supports mark/reset. + */ + public boolean markSupported() { + return true; + } + + /** + * This method reads one byte from the stream. The pos counter is + * advanced to the next byte to be read. The byte read is returned as an int + * in the range of 0-255. If the stream position is already at the end of the + * buffer, no byte is read and a -1 is returned in order to indicate the end + * of the stream. + * + * @return The byte read, or -1 if end of stream + */ + public synchronized int read() { + if (pos < count) + return ((int) buf[pos++]) & 0xFF; + return -1; + } + + /** + * This method reads bytes from the stream and stores them into a caller + * supplied buffer. It starts storing the data at index offset + * into the buffer and attempts to read len bytes. This method + * can return before reading the number of bytes requested if the end of the + * stream is encountered first. The actual number of bytes read is returned. + * If no bytes can be read because the stream is already at the end of stream + * position, a -1 is returned. + *

+ * This method does not block. + * + * @param buffer + * The array into which the bytes read should be stored. + * @param offset + * The offset into the array to start storing bytes + * @param length + * The requested number of bytes to read + * + * @return The actual number of bytes read, or -1 if end of stream. + */ + public synchronized int read(byte[] buffer, int offset, int length) { + if (pos >= count) + return -1; + + int numBytes = Math.min(count - pos, length); + System.arraycopy(buf, pos, buffer, offset, numBytes); + pos += numBytes; + return numBytes; + } + + /** + * This method sets the read position in the stream to the mark point by + * setting the pos variable equal to the mark + * variable. Since a mark can be set anywhere in the array, the mark/reset + * methods int this class can be used to provide random search capabilities + * for this type of stream. + */ + public synchronized void reset() { + pos = mark; + } + + /** + * This method attempts to skip the requested number of bytes in the input + * stream. It does this by advancing the pos value by the + * specified number of bytes. It this would exceed the length of the buffer, + * then only enough bytes are skipped to position the stream at the end of the + * buffer. The actual number of bytes skipped is returned. + * + * @param num + * The requested number of bytes to skip + * + * @return The actual number of bytes skipped. + */ + public synchronized long skip(long num) { + // Even though the var numBytes is a long, in reality it can never + // be larger than an int since the result of subtracting 2 positive + // ints will always fit in an int. Since we have to return a long + // anyway, numBytes might as well just be a long. + long numBytes = Math.min((long) (count - pos), num < 0 ? 0L : num); + pos += (int) numBytes; + return numBytes; + } +} \ No newline at end of file diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Character.java b/Robust/src/ClassLibrary/SSJavaInfer/Character.java new file mode 100644 index 00000000..609862e8 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Character.java @@ -0,0 +1,66 @@ +public class Character { + + public static int digit(char ch, int radix) { + if (ch >= '0' && ch <= '9') + return ch - '0'; + else if (ch >= 'a' && ch <= 'z') { + int val = (ch - 'a') + 10; + if (val < radix) + return val; + } else if (ch >= 'A' && ch <= 'Z') { + int val = (ch - 'A') + 10; + if (val < radix) + return val; + } + return -1; + } + + public static boolean isDigit(char ch) { + // TODO This is a temparory implementation, there are other groups of digits + // besides '0' ~ '9' + if (ch >= '0' && ch <= '9') + return true; + else + return false; + } + + char value; + + public Character(char c) { + value = c; + } + + public Character(Character c) { + value = c.value; + } + + public String toString() { + return "" + value; + } + + public static boolean isWhitespace(char character) { + boolean returnValue; + if ((character == '\t') || (character == '\n') || (character == ' ') || (character == '\u000C') || (character == '\u001C') || (character == '\u001D') || (character == '\u001E') || (character == '\u001F')) { + returnValue = true; + } else { + returnValue = false; + } + return returnValue; + } + + public static final int MIN_RADIX = 2; + public static final int MAX_RADIX = 36; + + public static char forDigit(int digit, int radix) { + if ((digit >= radix) || (digit < 0)) { + return '\0'; + } + if ((radix < Character.MIN_RADIX) || (radix > Character.MAX_RADIX)) { + return '\0'; + } + if (digit < 10) { + return (char) ('0' + digit); + } + return (char) ('a' - 10 + digit); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Cloneable.java b/Robust/src/ClassLibrary/SSJavaInfer/Cloneable.java new file mode 100644 index 00000000..85f4b1da --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Cloneable.java @@ -0,0 +1,77 @@ +/* Cloneable.java -- Interface for marking objects cloneable by Object.clone() + Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.lang; + +/** + * This interface should be implemented by classes wishing to support of + * override Object.clone(). The default behaviour of + * clone() performs a shallow copy, but subclasses often change + * this to perform a deep copy. Therefore, it is a good idea to document how + * deep your clone will go. If clone() is called on an object which + * does not implement this interface, a CloneNotSupportedException + * will be thrown. + * + *

+ * This interface is simply a tagging interface; it carries no requirements on + * methods to implement. However, it is typical for a Cloneable class to + * implement at least equals, hashCode, and + * clone, sometimes increasing the accessibility of clone to be + * public. The typical implementation of clone invokes + * super.clone() rather than a constructor, but this is not a + * requirement. + * + *

+ * If an object that implement Cloneable should not be cloned, simply override + * the clone method to throw a + * CloneNotSupportedException. + * + *

+ * All array types implement Cloneable, and have a public clone + * method that will never fail with a CloneNotSupportedException. + * + * @author Paul Fisher + * @author Eric Blake (ebb9@email.byu.edu) + * @author Warren Levy (warrenl@cygnus.com) + * @see Object#clone() + * @see CloneNotSupportedException + * @since 1.0 + * @status updated to 1.4 + */ +public interface Cloneable { + // Tagging interface only. +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Double.java b/Robust/src/ClassLibrary/SSJavaInfer/Double.java new file mode 100644 index 00000000..28eb19aa --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Double.java @@ -0,0 +1,571 @@ +/* Double.java -- object wrapper for double + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + +//package java.lang; + +/** + * Instances of class Double represent primitive + * double values. + * + * Additionally, this class provides various helper functions and variables + * related to doubles. + * + * @author Paul Fisher + * @author Andrew Haley (aph@cygnus.com) + * @author Eric Blake (ebb9@email.byu.edu) + * @author Tom Tromey (tromey@redhat.com) + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) + * @since 1.0 + * @status partly updated to 1.5 + */ + +public final class Double extends Number // implements Comparable +{ + /** + * Compatible with JDK 1.0+. + */ + /** + * The immutable value of this Double. + * + * @serial the wrapped double + */ + + private final double value; + + /** + * Create a Double from the primitive double + * specified. + * + * @param value + * the double argument + */ + public Double(double value) { + this.value = value; + } + + /** + * Create a Double from the specified String. This + * method calls Double.parseDouble(). + * + * @param s + * the String to convert + * @throws NumberFormatException + * if s cannot be parsed as a double + * @throws NullPointerException + * if s is null + * @see #parseDouble(String) + */ + public Double(String s) { + value = parseDouble(s); + } + + /** + * Convert the double to a String. Floating-point + * string representation is fairly complex: here is a rundown of the possible + * values. "[-]" indicates that a negative sign will be printed + * if the value (or exponent) is negative. "<number>" means + * a string of digits ('0' to '9'). "<digit>" means a + * single digit ('0' to '9').
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Value of DoubleString Representation
[+-] 0[-]0.0
Between [+-] 10-3 and 107, exclusive[-]number.number
Other numeric value[-]<digit>.<number> + * E[-]<number>
[+-] infinity[-]Infinity
NaNNaN
+ * + * Yes, negative zero is a possible value. Note that there is + * always a . and at least one digit printed after it: + * even if the number is 3, it will be printed as 3.0. After the + * ".", all digits will be printed except trailing zeros. The result is + * rounded to the shortest decimal number which will parse back to the same + * double. + * + *

+ * To create other output formats, use {@link java.text.NumberFormat}. + * + * @XXX specify where we are not in accord with the spec. + * + * @param d + * the double to convert + * @return the String representing the double + */ + public static String toString(double d) { + return String.valueOf(d); + } + + /** + * Convert a double value to a hexadecimal string. This converts as follows: + *

+ * + * @param d + * the double value + * @return the hexadecimal string representation + * @since 1.5 + */ + public static String toHexString(double d) { + /* + * if (isNaN(d)) return "NaN"; if (isInfinite(d)) return d < 0 ? "-Infinity" + * : "Infinity"; + * + * long bits = doubleToLongBits(d); StringBuilder result = new + * StringBuilder(); + * + * if (bits < 0) result.append('-'); result.append("0x"); + * + * final int mantissaBits = 52; final int exponentBits = 11; long mantMask = + * (1L << mantissaBits) - 1; long mantissa = bits & mantMask; long expMask = + * (1L << exponentBits) - 1; long exponent = (bits >>> mantissaBits) & + * expMask; + * + * result.append(exponent == 0 ? '0' : '1'); result.append('.'); + * result.append(Long.toHexString(mantissa)); if (exponent == 0 && mantissa + * != 0) { // Treat denormal specially by inserting '0's to make // the + * length come out right. The constants here are // to account for things + * like the '0x'. int offset = 4 + ((bits < 0) ? 1 : 0); // The silly +3 is + * here to keep the code the same between // the Float and Double cases. In + * Float the value is // not a multiple of 4. int desiredLength = offset + + * (mantissaBits + 3) / 4; while (result.length() < desiredLength) + * result.insert(offset, '0'); } result.append('p'); if (exponent == 0 && + * mantissa == 0) { // Zero, so do nothing special. } else { // Apply bias. + * boolean denormal = exponent == 0; exponent -= (1 << (exponentBits - 1)) - + * 1; // Handle denormal. if (denormal) ++exponent; } + * + * result.append(Long.toString(exponent)); return result.toString(); + */ + return "0x0"; + } + + /** + * Returns a Double object wrapping the value. In contrast to the + * Double constructor, this method may cache some values. It is + * used by boxing conversion. + * + * @param val + * the value to wrap + * @return the Double + * @since 1.5 + */ + public static Double valueOf(double val) { + // We don't actually cache, but we could. + return new Double(val); + } + + /** + * Create a new Double object using the String. + * + * @param s + * the String to convert + * @return the new Double + * @throws NumberFormatException + * if s cannot be parsed as a double + * @throws NullPointerException + * if s is null. + * @see #parseDouble(String) + */ + public static Double valueOf(String s) { + return new Double(parseDouble(s)); + } + + /** + * Parse the specified String as a double. The + * extended BNF grammar is as follows:
+ * + *
+   * DecodableString:
+   *      ( [ - | + ] NaN )
+   *    | ( [ - | + ] Infinity )
+   *    | ( [ - | + ] FloatingPoint
+   *              [ f | F | d
+   *                | D] )
+   * FloatingPoint:
+   *      ( { Digit }+ [ . { Digit } ]
+   *              [ Exponent ] )
+   *    | ( . { Digit }+ [ Exponent ] )
+   * Exponent:
+   *      ( ( e | E )
+   *              [ - | + ] { Digit }+ )
+   * Digit: '0' through '9'
+   * 
+ * + *

+ * NaN and infinity are special cases, to allow parsing of the output of + * toString. Otherwise, the result is determined by calculating + * n * 10exponent to infinite precision, then rounding to + * the nearest double. Remember that many numbers cannot be precisely + * represented in floating point. In case of overflow, infinity is used, and + * in case of underflow, signed zero is used. Unlike Integer.parseInt, this + * does not accept Unicode digits outside the ASCII range. + * + *

+ * If an unexpected character is found in the String, a + * NumberFormatException will be thrown. Leading and trailing + * 'whitespace' is ignored via String.trim(), but spaces internal + * to the actual number are not allowed. + * + *

+ * To parse numbers according to another format, consider using + * {@link java.text.NumberFormat}. + * + * @XXX specify where/how we are not in accord with the spec. + * + * @param str + * the String to convert + * @return the double value of s + * @throws NumberFormatException + * if s cannot be parsed as a double + * @throws NullPointerException + * if s is null + * @see #MIN_VALUE + * @see #MAX_VALUE + * @see #POSITIVE_INFINITY + * @see #NEGATIVE_INFINITY + * @since 1.2 + */ + public static double parseDouble(String str) { + return nativeparsedouble(str); + } + + public static native double nativeparsedouble(String str); + + public static native double nativeparsedouble(int start, int length, byte[] str); + + /** + * Return true if the double has the same value as + * NaN, otherwise return false. + * + * @param v + * the double to compare + * @return whether the argument is NaN. + */ + public static boolean isNaN(double v) { + // This works since NaN != NaN is the only reflexive inequality + // comparison which returns true. + return v != v; + } + + /** + * Return true if the double has a value equal to + * either NEGATIVE_INFINITY or POSITIVE_INFINITY, + * otherwise return false. + * + * @param v + * the double to compare + * @return whether the argument is (-/+) infinity. + */ + public static boolean isInfinite(double v) { + return false; + } + + /** + * Return true if the value of this Double is the + * same as NaN, otherwise return false. + * + * @return whether this Double is NaN + */ + public boolean isNaN() { + return isNaN(value); + } + + /** + * Return true if the value of this Double is the + * same as NEGATIVE_INFINITY or POSITIVE_INFINITY, + * otherwise return false. + * + * @return whether this Double is (-/+) infinity + */ + public boolean isInfinite() { + return isInfinite(value); + } + + /** + * Convert the double value of this Double to a + * String. This method calls Double.toString(double) + * to do its dirty work. + * + * @return the String representation + * @see #toString(double) + */ + public String toString() { + return toString(value); + } + + /** + * Return the value of this Double as a byte. + * + * @return the byte value + * @since 1.1 + */ + public byte byteValue() { + return (byte) value; + } + + /** + * Return the value of this Double as a short. + * + * @return the short value + * @since 1.1 + */ + public short shortValue() { + return (short) value; + } + + /** + * Return the value of this Double as an int. + * + * @return the int value + */ + public int intValue() { + return (int) value; + } + + /** + * Return the value of this Double as a long. + * + * @return the long value + */ + public long longValue() { + return (long) value; + } + + /** + * Return the value of this Double as a float. + * + * @return the float value + */ + public float floatValue() { + return (float) value; + } + + /** + * Return the value of this Double. + * + * @return the double value + */ + public double doubleValue() { + return value; + } + + /** + * Return a hashcode representing this Object. Double's hash code + * is calculated by:
+ * long v = Double.doubleToLongBits(doubleValue());
+ * int hash = (int)(v^(v>>32))
. + * + * @return this Object's hash code + * @see #doubleToLongBits(double) + */ + public int hashCode() { + long v = doubleToLongBits(value); + return (int) (v ^ (v >>> 32)); + } + + /** + * Returns true if obj is an instance of + * Double and represents the same double value. Unlike comparing + * two doubles with ==, this treats two instances of + * Double.NaN as equal, but treats 0.0 and + * -0.0 as unequal. + * + *

+ * Note that d1.equals(d2) is identical to + * doubleToLongBits(d1.doubleValue()) == + * doubleToLongBits(d2.doubleValue()). + * + * @param obj + * the object to compare + * @return whether the objects are semantically equal + */ + public boolean equals(Object obj) { + if (!(obj instanceof Double)) + return false; + + double d = ((Double) obj).value; + + // Avoid call to native method. However, some implementations, like gcj, + // are better off using floatToIntBits(value) == floatToIntBits(f). + // Check common case first, then check NaN and 0. + if (value == d) + return (value != 0) || (1 / value == 1 / d); + return isNaN(value) && isNaN(d); + } + + /** + * Convert the double to the IEEE 754 floating-point "double format" bit + * layout. Bit 63 (the most significant) is the sign bit, bits 62-52 (masked + * by 0x7ff0000000000000L) represent the exponent, and bits 51-0 (masked by + * 0x000fffffffffffffL) are the mantissa. This function collapses all versions + * of NaN to 0x7ff8000000000000L. The result of this function can be used as + * the argument to Double.longBitsToDouble(long) to obtain the + * original double value. + * + * @param value + * the double to convert + * @return the bits of the double + * @see #longBitsToDouble(long) + */ + public static long doubleToLongBits(double value) { + if (isNaN(value)) + return 0x7ff8000000000000L; + else + return /* VMDouble. */doubleToRawLongBits(value); + } + + /** + * Convert the double to the IEEE 754 floating-point "double format" bit + * layout. Bit 63 (the most significant) is the sign bit, bits 62-52 (masked + * by 0x7ff0000000000000L) represent the exponent, and bits 51-0 (masked by + * 0x000fffffffffffffL) are the mantissa. This function leaves NaN alone, + * rather than collapsing to a canonical value. The result of this function + * can be used as the argument to Double.longBitsToDouble(long) + * to obtain the original double value. + * + * @param value + * the double to convert + * @return the bits of the double + * @see #longBitsToDouble(long) + */ + /* + * public static long doubleToRawLongBits(double value) { return + * VMDouble.doubleToRawLongBits(value); } + */ + public static native long doubleToRawLongBits(double value); + + /** + * Convert the argument in IEEE 754 floating-point "double format" bit layout + * to the corresponding float. Bit 63 (the most significant) is the sign bit, + * bits 62-52 (masked by 0x7ff0000000000000L) represent the exponent, and bits + * 51-0 (masked by 0x000fffffffffffffL) are the mantissa. This function leaves + * NaN alone, so that you can recover the bit pattern with + * Double.doubleToRawLongBits(double). + * + * @param bits + * the bits to convert + * @return the double represented by the bits + * @see #doubleToLongBits(double) + * @see #doubleToRawLongBits(double) + */ + /* + * public static double longBitsToDouble(long bits) { return + * VMDouble.longBitsToDouble(bits); } + */ + public static native double longBitsToDouble(long bits); + + /** + * Compare two Doubles numerically by comparing their double + * values. The result is positive if the first is greater, negative if the + * second is greater, and 0 if the two are equal. However, this special cases + * NaN and signed zero as follows: NaN is considered greater than all other + * doubles, including POSITIVE_INFINITY, and positive zero is + * considered greater than negative zero. + * + * @param d + * the Double to compare + * @return the comparison + * @since 1.2 + */ + public int compareTo(Double d) { + return compare(value, d.value); + } + + /** + * Behaves like new Double(x).compareTo(new Double(y)); in other + * words this compares two doubles, special casing NaN and zero, without the + * overhead of objects. + * + * @param x + * the first double to compare + * @param y + * the second double to compare + * @return the comparison + * @since 1.4 + */ + public static int compare(double x, double y) { + // handle the easy cases: + if (x < y) + return -1; + if (x > y) + return 1; + + // handle equality respecting that 0.0 != -0.0 (hence not using x == y): + long lx = doubleToRawLongBits(x); + long ly = doubleToRawLongBits(y); + if (lx == ly) + return 0; + + // handle NaNs: + if (x != x) + return (y != y) ? 0 : 1; + else if (y != y) + return -1; + + // handle +/- 0.0 + return (lx < ly) ? -1 : 1; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Enumeration.java b/Robust/src/ClassLibrary/SSJavaInfer/Enumeration.java new file mode 100644 index 00000000..e8da9fec --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Enumeration.java @@ -0,0 +1,13 @@ +public class Enumeration { + + public Enumeration() { + } + + public boolean hasMoreElements() { + return false; + } + + public Object nextElement() { + return null; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Exception.java b/Robust/src/ClassLibrary/SSJavaInfer/Exception.java new file mode 100644 index 00000000..83385049 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Exception.java @@ -0,0 +1,102 @@ +/* Exception.java -- generic exception thrown to indicate an exceptional + condition has occurred. + Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.lang; + +/** + * The root class of all exceptions worth catching in a program. This includes + * the special category of RuntimeException, which does not need to + * be declared in a throws clause. Exceptions can be used to represent almost + * any exceptional behavior, such as programming errors, mouse movements, + * keyboard clicking, etc. + * + * @author Brian Jones + * @author Warren Levy (warrenl@cygnus.com) + * @author Eric Blake (ebb9@email.byu.edu) + * @status updated to 1.4 + */ +public class Exception extends Throwable { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -3387516993124229948L; + + /** + * Create an exception without a message. The cause remains uninitialized. + * + * @see #initCause(Throwable) + */ + public Exception() { + } + + /** + * Create an exception with a message. The cause remains uninitialized. + * + * @param s + * the message + * @see #initCause(Throwable) + */ + public Exception(String s) { + super(s); + } + + /** + * Create an exception with a message and a cause. + * + * @param s + * the message string + * @param cause + * the cause of this error + * @since 1.4 + */ + public Exception(String s, Throwable cause) { + super(s, cause); + } + + /** + * Create an exception with a given cause, and a message of + * cause == null ? null : cause.toString(). + * + * @param cause + * the cause of this exception + * @since 1.4 + */ + public Exception(Throwable cause) { + super(cause); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/File.java b/Robust/src/ClassLibrary/SSJavaInfer/File.java new file mode 100644 index 00000000..97b1b912 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/File.java @@ -0,0 +1,21 @@ +//import java.io.FileSystem; +//import java.io.FilenameFilter; +//import java.util.ArrayList; + +public class File { + String path; + + public File(String path) { + this.path = path; + } + + String getPath() { + return path; + } + + long length() { + return nativeLength(path.getBytes()); + } + + private static native long nativeLength(byte[] pathname); +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/FileDescriptor.java b/Robust/src/ClassLibrary/SSJavaInfer/FileDescriptor.java new file mode 100644 index 00000000..9e51e438 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/FileDescriptor.java @@ -0,0 +1,135 @@ +/* FileDescriptor.java -- Opaque file handle class + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + +//package java.io; + +/*import gnu.java.nio.FileChannelImpl; + + import java.nio.channels.ByteChannel; + import java.nio.channels.FileChannel; + */ +/** + * This class represents an opaque file handle as a Java class. It should be + * used only to pass to other methods that expect an object of this type. No + * system specific information can be obtained from this object. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey (tromey@cygnus.com) + * @date September 24, 1998 + */ +public final class FileDescriptor { + /** + * A FileDescriptor representing the system standard input + * stream. This will usually be accessed through the System.in + * variable. + */ + public static final FileDescriptor in = new FileDescriptor("System.in" /* + * FileChannelImpl + * .in + */); + + /** + * A FileDescriptor representing the system standard output + * stream. This will usually be accessed through the System.out + * variable. + */ + public static final FileDescriptor out = new FileDescriptor("System.out" /* + * FileChannelImpl + * . + * out + */); + + /** + * A FileDescriptor representing the system standard error + * stream. This will usually be accessed through the System.err + * variable. + */ + public static final FileDescriptor err = new FileDescriptor("System.err" /* + * FileChannelImpl + * . + * err + */); + + // final ByteChannel channel; + final String channel; + + /** + * This method is used to initialize an invalid FileDescriptor object. + */ + public FileDescriptor() { + channel = null; + } + + /** + * This method is used to initialize a FileDescriptor object. + */ + /* + * FileDescriptor(ByteChannel channel) { this.channel = channel; } + */ + + FileDescriptor(String channel) { + this.channel = channel; + } + + /** + * This method forces all data that has not yet been physically written to the + * underlying storage medium associated with this FileDescriptor + * to be written out. This method will not return until all data has been + * fully written to the underlying device. If the device does not support this + * functionality or if an error occurs, then an exception will be thrown. + */ + /* + * public void sync () throws SyncFailedException { if (channel instanceof + * FileChannel) { try { ((FileChannel) channel).force(true); } catch + * (IOException ex) { if (ex instanceof SyncFailedException) throw + * (SyncFailedException) ex; else throw new + * SyncFailedException(ex.toString()); } } } + */ + + /** + * This methods tests whether or not this object represents a valid open + * native file handle. + * + * @return true if this object represents a valid native file + * handle, false otherwise + */ + /* + * public boolean valid () { ByteChannel c = channel; return (c != null) && + * (c.isOpen()); } + */ +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/FileInputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/FileInputStream.java new file mode 100644 index 00000000..8dfd3fe8 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/FileInputStream.java @@ -0,0 +1,95 @@ +public class FileInputStream extends InputStream { + private int fd; + + public FileInputStream(String pathname) { + fd = nativeOpen(pathname.getBytes()); + } + + public FileInputStream(File path) { + fd = nativeOpen(path.getPath().getBytes()); + } + + public int getfd() { + return fd; + } + + private static native int nativeOpen(byte[] filename); + + private static native int nativeRead(int fd, byte[] array, int numBytes); + + private static native int nativePeek(int fd); + + private static native void nativeClose(int fd); + + private static native int nativeAvailable(int fd); + + public int read() { + byte b[] = new byte[1]; + int retval = read(b); + if (retval == -1 || retval == 0) + return -1; + + // if carriage return comes back, dump it + if (b[0] == 13) { + return read(); + } + + // otherwise return result + return b[0]; + } + + public int peek() { + return nativePeek(fd); + } + + public int read(byte[] b, int offset, int len) { + if (offset < 0 || len < 0 || offset + len > b.length) { + return -1; + } + byte readbuf[] = new byte[len]; + int rtr = nativeRead(fd, readbuf, len); + System.arraycopy(readbuf, 0, b, offset, len); + return rtr; + } + + public int read(byte[] b) { + return nativeRead(fd, b, b.length); + } + + public String readLine() { + String line = ""; + int c = read(); + + // if we're already at the end of the file + // or there is an error, don't even return + // the empty string + if (c <= 0) { + return null; + } + + // ASCII 13 is carriage return, check for that also + while (c != '\n' && c != 13 && c > 0) { + line += (char) c; + c = read(); + } + + // peek and consume characters that are carriage + // returns or line feeds so the whole line is read + // and returned, and none of the line-ending chars + c = peek(); + while (c == '\n' || c == 13) { + c = read(); + c = peek(); + } + + return line; + } + + public void close() { + nativeClose(fd); + } + + public int available() { + return nativeAvailable(fd); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/FileOutputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/FileOutputStream.java new file mode 100644 index 00000000..d7ffa875 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/FileOutputStream.java @@ -0,0 +1,67 @@ +//import java.io.FileDescriptor; + +public class FileOutputStream extends OutputStream { + private int fd; + + public FileOutputStream(String pathname) { + fd = nativeOpen(pathname.getBytes()); + } + + public FileOutputStream(String pathname, boolean append) { + if (append) + fd = nativeAppend(pathname.getBytes()); + else + fd = nativeOpen(pathname.getBytes()); + } + + public FileOutputStream(String pathname, int mode) { + if (mode == 0) + fd = nativeAppend(pathname.getBytes()); + if (mode == 1) + fd = nativeOpen(pathname.getBytes()); + } + + public FileOutputStream(File path) { + fd = nativeOpen(path.getPath().getBytes()); + } + + public FileOutputStreamOpen(String pathname) { + fd = nativeOpen(pathname.getBytes()); + } + + public FileOutputStream(FileDescriptor fdObj) { + fd = nativeOpen(fdObj.channel.getBytes()); + } + + private static native int nativeOpen(byte[] filename); + + private static native int nativeAppend(byte[] filename); + + private static native void nativeWrite(int fd, byte[] array, int off, int len); + + private static native void nativeClose(int fd); + + private static native void nativeFlush(int fd); + + public void write(int ch) { + byte b[] = new byte[1]; + b[0] = (byte) ch; + write(b); + } + + public void write(byte[] b) { + nativeWrite(fd, b, 0, b.length); + } + + public void write(byte[] b, int index, int len) { + nativeWrite(fd, b, index, len); + } + + public void flush() { + nativeFlush(fd); + } + + public void close() { + nativeClose(fd); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/FilterInputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/FilterInputStream.java new file mode 100644 index 00000000..b1353f51 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/FilterInputStream.java @@ -0,0 +1,210 @@ +/* FilterInputStream.java -- Base class for classes that filter input + Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.io; + +/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 + * "The Java Language Specification", ISBN 0-201-63451-1 + * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. + * Status: Believed complete and correct. + */ + +/** + * This is the common superclass of all standard classes that filter input. It + * acts as a layer on top of an underlying InputStream and simply + * redirects calls made to it to the subordinate InputStream instead. Subclasses + * of this class perform additional filtering functions in addition to simply + * redirecting the call. + *

+ * This class is not abstract. However, since it only redirects calls to a + * subordinate InputStream without adding any functionality on top + * of it, this class should not be used directly. Instead, various subclasses of + * this class should be used. This is enforced with a protected constructor. Do + * not try to hack around it. + *

+ * When creating a subclass of FilterInputStream, override the + * appropriate methods to implement the desired filtering. However, note that + * the read(byte[]) method does not need to be overridden as this + * class redirects calls to that method to read(byte[], int, int) + * instead of to the subordinate InputStream read(byte[]) method. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy (warrenl@cygnus.com) + */ + +public class FilterInputStream extends InputStream { + /** + * This is the subordinate InputStream to which method calls are + * redirected + */ + protected InputStream in; + + /** + * Create a FilterInputStream with the specified subordinate + * InputStream. + * + * @param in + * The subordinate InputStream + */ + protected FilterInputStream(InputStream in) { + this.in = in; + } + + /** + * Calls the in.mark(int) method. + * + * @param readlimit + * The parameter passed to in.mark(int) + */ + public void mark(int readlimit) { + in.mark(readlimit); + } + + /** + * Calls the in.markSupported() method. + * + * @return true if mark/reset is supported, false + * otherwise + */ + + public boolean markSupported() { + return in.markSupported(); + } + + /** + * Calls the in.reset() method. + * + * @exception IOException + * If an error occurs + */ + public void reset() throws IOException { + in.reset(); + } + + /** + * Calls the in.available() method. + * + * @return The value returned from in.available() + * + * @exception IOException + * If an error occurs + */ + public int available() throws IOException { + return in.available(); + } + + /** + * Calls the in.skip(long) method + * + * @param numBytes + * The requested number of bytes to skip. + * + * @return The value returned from in.skip(long) + * + * @exception IOException + * If an error occurs + */ + + public long skip(long numBytes) throws IOException { + return in.skip(numBytes); + } + + /** + * Calls the in.read() method + * + * @return The value returned from in.read() + * + * @exception IOException + * If an error occurs + */ + + public int read() throws IOException { + return in.read(); + } + + /** + * Calls the read(byte[], int, int) overloaded method. Note that + * this method does not redirect its call directly to a corresponding method + * in in. This allows subclasses to override only the three + * argument version of read. + * + * @param buf + * The buffer to read bytes into + * + * @return The value retured from in.read(byte[], int, int) + * + * @exception IOException + * If an error occurs + */ + + public int read(byte[] buf) throws IOException { + return read(buf, 0, buf.length); + } + + /** + * Calls the in.read(byte[], int, int) method. + * + * @param buf + * The buffer to read bytes into + * @param offset + * The index into the buffer to start storing bytes + * @param len + * The maximum number of bytes to read. + * + * @return The value retured from in.read(byte[], int, int) + * + * @exception IOException + * If an error occurs + */ + + public int read(byte[] buf, int offset, int len) throws IOException { + return in.read(buf, offset, len); + } + + /** + * This method closes the input stream by closing the input stream that this + * object is filtering. Future attempts to access this stream may throw an + * exception. + * + * @exception IOException + * If an error occurs + */ + + public void close() throws IOException { + in.close(); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/FilterOutputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/FilterOutputStream.java new file mode 100644 index 00000000..633c3469 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/FilterOutputStream.java @@ -0,0 +1,157 @@ +/* FilterOutputStream.java -- Parent class for output streams that filter + Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.io; + +/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 + * "The Java Language Specification", ISBN 0-201-63451-1 + * Status: Complete to version 1.1. + */ + +/** + * This class is the common superclass of output stream classes that filter the + * output they write. These classes typically transform the data in some way + * prior to writing it out to another underlying OutputStream. This + * class simply overrides all the methods in OutputStream to + * redirect them to the underlying stream. Subclasses provide actual filtering. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey (tromey@cygnus.com) + */ +public class FilterOutputStream extends OutputStream { + /** + * This is the subordinate OutputStream that this class redirects + * its method calls to. + */ + protected OutputStream out; + + /** + * This method initializes an instance of FilterOutputStream to + * write to the specified subordinate OutputStream. + * + * @param out + * The OutputStream to write to + */ + public FilterOutputStream(OutputStream out) { + this.out = out; + } + + /** + * This method closes the underlying OutputStream. Any further + * attempts to write to this stream may throw an exception. + * + * @exception IOException + * If an error occurs + */ + public void close() // throws IOException + { + flush(); + out.close(); + } + + /** + * This method attempt to flush all buffered output to be written to the + * underlying output sink. + * + * @exception IOException + * If an error occurs + */ + public void flush() // throws IOException + { + out.flush(); + } + + /** + * This method writes a single byte of output to the underlying + * OutputStream. + * + * @param b + * The byte to write, passed as an int. + * + * @exception IOException + * If an error occurs + */ + public void write(int b) // throws IOException + { + out.write(b); + } + + /** + * This method writes all the bytes in the specified array to the underlying + * OutputStream. It does this by calling the three parameter + * version of this method - write(byte[], int, int) in this class + * instead of writing to the underlying OutputStream directly. + * This allows most subclasses to avoid overriding this method. + * + * @param buf + * The byte array to write bytes from + * + * @exception IOException + * If an error occurs + */ + public void write(byte[] buf) // throws IOException + { + // Don't do checking here, per Java Lang Spec. + write(buf, 0, buf.length); + } + + /** + * This method calls the write(int) method len times + * for all bytes from the array buf starting at index + * offset. Subclasses should overwrite this method to get a more + * efficient implementation. + * + * @param buf + * The byte array to write bytes from + * @param offset + * The index into the array to start writing bytes from + * @param len + * The number of bytes to write + * + * @exception IOException + * If an error occurs + */ + public void write(byte[] buf, int offset, int len) // throws IOException + { + // Don't do checking here, per Java Lang Spec. + for (int i = 0; i < len; i++) + write(buf[offset + i]); + + } + +} // class FilterOutputStream + diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Float.java b/Robust/src/ClassLibrary/SSJavaInfer/Float.java new file mode 100644 index 00000000..59b08c89 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Float.java @@ -0,0 +1,605 @@ +/* Float.java -- object wrapper for float + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +/** + * Instances of class Float represent primitive float + * values. + * + * Additionally, this class provides various helper functions and variables + * related to floats. + * + * @author Paul Fisher + * @author Andrew Haley (aph@cygnus.com) + * @author Eric Blake (ebb9@email.byu.edu) + * @author Tom Tromey (tromey@redhat.com) + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) + * @since 1.0 + * @status partly updated to 1.5 + */ +public final class Float { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -2671257302660747028L; + + /** + * The maximum positive value a double may represent is + * 3.4028235e+38f. + */ + public static final float MAX_VALUE = 3.4028235e+38f; + + /** + * The minimum positive value a float may represent is 1.4e-45. + */ + public static final float MIN_VALUE = 1.4e-45f; + + /** + * The value of a float representation -1.0/0.0, negative infinity. + */ + public static final float NEGATIVE_INFINITY = -1.0f / 0.0f; + + /** + * The value of a float representation 1.0/0.0, positive infinity. + */ + public static final float POSITIVE_INFINITY = 1.0f / 0.0f; + + /** + * All IEEE 754 values of NaN have the same value in Java. + */ + public static final float NaN = 0.0f / 0.0f; + + /** + * The primitive type float is represented by this + * Class object. + * + * @since 1.1 + */ + // public static final Class TYPE = (Class) + // VMClassLoader.getPrimitiveClass('F'); + + /** + * The number of bits needed to represent a float. + * + * @since 1.5 + */ + public static final int SIZE = 32; + + /** + * Cache representation of 0 + */ + private static final Float ZERO = new Float(0.0f); + + /** + * Cache representation of 1 + */ + private static final Float ONE = new Float(1.0f); + + /** + * The immutable value of this Float. + * + * @serial the wrapped float + */ + private final float value; + + /** + * Create a Float from the primitive float + * specified. + * + * @param value + * the float argument + */ + public Float(float value) { + this.value = value; + } + + /** + * Create a Float from the primitive double + * specified. + * + * @param value + * the double argument + */ + public Float(double value) { + this.value = (float) value; + } + + /** + * Create a Float from the specified String. This + * method calls Float.parseFloat(). + * + * @param s + * the String to convert + * @throws NumberFormatException + * if s cannot be parsed as a float + * @throws NullPointerException + * if s is null + * @see #parseFloat(String) + */ + public Float(String s) { + value = parseFloat(s); + } + + /** + * Convert the float to a String. Floating-point + * string representation is fairly complex: here is a rundown of the possible + * values. "[-]" indicates that a negative sign will be printed + * if the value (or exponent) is negative. "<number>" means + * a string of digits ('0' to '9'). "<digit>" means a + * single digit ('0' to '9').
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Value of FloatString Representation
[+-] 0[-]0.0
Between [+-] 10-3 and 107, exclusive[-]number.number
Other numeric value[-]<digit>.<number> + * E[-]<number>
[+-] infinity[-]Infinity
NaNNaN
+ * + * Yes, negative zero is a possible value. Note that there is + * always a . and at least one digit printed after it: + * even if the number is 3, it will be printed as 3.0. After the + * ".", all digits will be printed except trailing zeros. The result is + * rounded to the shortest decimal number which will parse back to the same + * float. + * + *

+ * To create other output formats, use {@link java.text.NumberFormat}. + * + * @XXX specify where we are not in accord with the spec. + * + * @param f + * the float to convert + * @return the String representing the float + */ + /* + * public static String toString(float f) { return VMFloat.toString(f); } + */ + + /** + * Convert a float value to a hexadecimal string. This converts as follows: + *

+ * + * @param f + * the float value + * @return the hexadecimal string representation + * @since 1.5 + */ + /* + * public static String toHexString(float f) { if (isNaN(f)) return "NaN"; if + * (isInfinite(f)) return f < 0 ? "-Infinity" : "Infinity"; + * + * int bits = floatToIntBits(f); CPStringBuilder result = new + * CPStringBuilder(); + * + * if (bits < 0) result.append('-'); result.append("0x"); + * + * final int mantissaBits = 23; final int exponentBits = 8; int mantMask = (1 + * << mantissaBits) - 1; int mantissa = bits & mantMask; int expMask = (1 << + * exponentBits) - 1; int exponent = (bits >>> mantissaBits) & expMask; + * + * result.append(exponent == 0 ? '0' : '1'); result.append('.'); // For Float + * only, we have to adjust the mantissa. mantissa <<= 1; + * result.append(Integer.toHexString(mantissa)); if (exponent == 0 && mantissa + * != 0) { // Treat denormal specially by inserting '0's to make // the length + * come out right. The constants here are // to account for things like the + * '0x'. int offset = 4 + ((bits < 0) ? 1 : 0); // The silly +3 is here to + * keep the code the same between // the Float and Double cases. In Float the + * value is // not a multiple of 4. int desiredLength = offset + (mantissaBits + * + 3) / 4; while (result.length() < desiredLength) result.insert(offset, + * '0'); } result.append('p'); if (exponent == 0 && mantissa == 0) { // Zero, + * so do nothing special. } else { // Apply bias. boolean denormal = exponent + * == 0; exponent -= (1 << (exponentBits - 1)) - 1; // Handle denormal. if + * (denormal) ++exponent; } + * + * result.append(Integer.toString(exponent)); return result.toString(); } + */ + + /** + * Creates a new Float object using the String. + * + * @param s + * the String to convert + * @return the new Float + * @throws NumberFormatException + * if s cannot be parsed as a float + * @throws NullPointerException + * if s is null + * @see #parseFloat(String) + */ + public static Float valueOf(String s) { + return valueOf(parseFloat(s)); + } + + /** + * Returns a Float object wrapping the value. In contrast to the + * Float constructor, this method may cache some values. It is + * used by boxing conversion. + * + * @param val + * the value to wrap + * @return the Float + * @since 1.5 + */ + public static Float valueOf(float val) { + if ((val == 0.0)/* && (floatToRawIntBits(val) == 0) */) + return ZERO; + else if (val == 1.0) + return ONE; + else + return new Float(val); + } + + /** + * Parse the specified String as a float. The + * extended BNF grammar is as follows:
+ * + *
+   * DecodableString:
+   *      ( [ - | + ] NaN )
+   *    | ( [ - | + ] Infinity )
+   *    | ( [ - | + ] FloatingPoint
+   *              [ f | F | d
+   *                | D] )
+   * FloatingPoint:
+   *      ( { Digit }+ [ . { Digit } ]
+   *              [ Exponent ] )
+   *    | ( . { Digit }+ [ Exponent ] )
+   * Exponent:
+   *      ( ( e | E )
+   *              [ - | + ] { Digit }+ )
+   * Digit: '0' through '9'
+   * 
+ * + *

+ * NaN and infinity are special cases, to allow parsing of the output of + * toString. Otherwise, the result is determined by calculating + * n * 10exponent to infinite precision, then rounding to + * the nearest float. Remember that many numbers cannot be precisely + * represented in floating point. In case of overflow, infinity is used, and + * in case of underflow, signed zero is used. Unlike Integer.parseInt, this + * does not accept Unicode digits outside the ASCII range. + * + *

+ * If an unexpected character is found in the String, a + * NumberFormatException will be thrown. Leading and trailing + * 'whitespace' is ignored via String.trim(), but spaces internal + * to the actual number are not allowed. + * + *

+ * To parse numbers according to another format, consider using + * {@link java.text.NumberFormat}. + * + * @XXX specify where/how we are not in accord with the spec. + * + * @param str + * the String to convert + * @return the float value of s + * @throws NumberFormatException + * if str cannot be parsed as a float + * @throws NullPointerException + * if str is null + * @see #MIN_VALUE + * @see #MAX_VALUE + * @see #POSITIVE_INFINITY + * @see #NEGATIVE_INFINITY + * @since 1.2 + */ + public static float parseFloat(String str) { + // return VMFloat.parseFloat(str); + return (float) (Double.parseDouble(str)); + } + + /** + * Return true if the float has the same value as + * NaN, otherwise return false. + * + * @param v + * the float to compare + * @return whether the argument is NaN + */ + public static boolean isNaN(float v) { + // This works since NaN != NaN is the only reflexive inequality + // comparison which returns true. + return v != v; + } + + /** + * Return true if the float has a value equal to + * either NEGATIVE_INFINITY or POSITIVE_INFINITY, + * otherwise return false. + * + * @param v + * the float to compare + * @return whether the argument is (-/+) infinity + */ + public static boolean isInfinite(float v) { + return v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY; + } + + /** + * Return true if the value of this Float is the + * same as NaN, otherwise return false. + * + * @return whether this Float is NaN + */ + public boolean isNaN() { + return isNaN(value); + } + + /** + * Return true if the value of this Float is the + * same as NEGATIVE_INFINITY or POSITIVE_INFINITY, + * otherwise return false. + * + * @return whether this Float is (-/+) infinity + */ + public boolean isInfinite() { + return isInfinite(value); + } + + /** + * Convert the float value of this Float to a + * String. This method calls Float.toString(float) + * to do its dirty work. + * + * @return the String representation + * @see #toString(float) + */ + /* + * public String toString() { return toString(value); } + */ + + /** + * Return the value of this Float as a byte. + * + * @return the byte value + * @since 1.1 + */ + public byte byteValue() { + return (byte) value; + } + + /** + * Return the value of this Float as a short. + * + * @return the short value + * @since 1.1 + */ + public short shortValue() { + return (short) value; + } + + /** + * Return the value of this Integer as an int. + * + * @return the int value + */ + public int intValue() { + return (int) value; + } + + /** + * Return the value of this Integer as a long. + * + * @return the long value + */ + public long longValue() { + return (long) value; + } + + /** + * Return the value of this Float. + * + * @return the float value + */ + public float floatValue() { + return value; + } + + /** + * Return the value of this Float as a double + * + * @return the double value + */ + public double doubleValue() { + return value; + } + + /** + * Return a hashcode representing this Object. Float's hash code + * is calculated by calling floatToIntBits(floatValue()). + * + * @return this Object's hash code + * @see #floatToIntBits(float) + */ + /* + * public int hashCode() { return floatToIntBits(value); } + */ + + /** + * Returns true if obj is an instance of + * Float and represents the same float value. Unlike comparing + * two floats with ==, this treats two instances of + * Float.NaN as equal, but treats 0.0 and + * -0.0 as unequal. + * + *

+ * Note that f1.equals(f2) is identical to + * floatToIntBits(f1.floatValue()) == + * floatToIntBits(f2.floatValue()). + * + * @param obj + * the object to compare + * @return whether the objects are semantically equal + */ + /* + * public boolean equals(Object obj) { if (obj instanceof Float) { float f = + * ((Float) obj).value; return (floatToRawIntBits(value) == + * floatToRawIntBits(f)) || (isNaN(value) && isNaN(f)); } return false; } + */ + + /** + * Convert the float to the IEEE 754 floating-point "single format" bit + * layout. Bit 31 (the most significant) is the sign bit, bits 30-23 (masked + * by 0x7f800000) represent the exponent, and bits 22-0 (masked by 0x007fffff) + * are the mantissa. This function collapses all versions of NaN to + * 0x7fc00000. The result of this function can be used as the argument to + * Float.intBitsToFloat(int) to obtain the original + * float value. + * + * @param value + * the float to convert + * @return the bits of the float + * @see #intBitsToFloat(int) + */ + /* + * public static int floatToIntBits(float value) { if (isNaN(value)) return + * 0x7fc00000; else return VMFloat.floatToRawIntBits(value); } + */ + + /** + * Convert the float to the IEEE 754 floating-point "single format" bit + * layout. Bit 31 (the most significant) is the sign bit, bits 30-23 (masked + * by 0x7f800000) represent the exponent, and bits 22-0 (masked by 0x007fffff) + * are the mantissa. This function leaves NaN alone, rather than collapsing to + * a canonical value. The result of this function can be used as the argument + * to Float.intBitsToFloat(int) to obtain the original + * float value. + * + * @param value + * the float to convert + * @return the bits of the float + * @see #intBitsToFloat(int) + */ + /* + * public static int floatToRawIntBits(float value) { return + * VMFloat.floatToRawIntBits(value); } + */ + + /** + * Convert the argument in IEEE 754 floating-point "single format" bit layout + * to the corresponding float. Bit 31 (the most significant) is the sign bit, + * bits 30-23 (masked by 0x7f800000) represent the exponent, and bits 22-0 + * (masked by 0x007fffff) are the mantissa. This function leaves NaN alone, so + * that you can recover the bit pattern with + * Float.floatToRawIntBits(float). + * + * @param bits + * the bits to convert + * @return the float represented by the bits + * @see #floatToIntBits(float) + * @see #floatToRawIntBits(float) + */ + /* + * public static float intBitsToFloat(int bits) { return + * VMFloat.intBitsToFloat(bits); } + */ + + /** + * Compare two Floats numerically by comparing their float + * values. The result is positive if the first is greater, negative if the + * second is greater, and 0 if the two are equal. However, this special cases + * NaN and signed zero as follows: NaN is considered greater than all other + * floats, including POSITIVE_INFINITY, and positive zero is + * considered greater than negative zero. + * + * @param f + * the Float to compare + * @return the comparison + * @since 1.2 + */ + /* + * public int compareTo(Float f) { return compare(value, f.value); } + */ + + /** + * Behaves like new Float(x).compareTo(new Float(y)); in other + * words this compares two floats, special casing NaN and zero, without the + * overhead of objects. + * + * @param x + * the first float to compare + * @param y + * the second float to compare + * @return the comparison + * @since 1.4 + */ + /* + * public static int compare(float x, float y) { // handle the easy cases: if + * (x < y) return -1; if (x > y) return 1; + * + * // handle equality respecting that 0.0 != -0.0 (hence not using x == y): + * int ix = floatToRawIntBits(x); int iy = floatToRawIntBits(y); if (ix == iy) + * return 0; + * + * // handle NaNs: if (x != x) return (y != y) ? 0 : 1; else if (y != y) + * return -1; + * + * // handle +/- 0.0 return (ix < iy) ? -1 : 1; } + */ +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/IOException.java b/Robust/src/ClassLibrary/SSJavaInfer/IOException.java new file mode 100644 index 00000000..89ea1bb6 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/IOException.java @@ -0,0 +1,71 @@ +/* IOException.java -- Generic input/output exception + Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.io; + +/** + * This exception is thrown to indicate an I/O problem of some sort occurred. + * Since this is a fairly generic exception, often a subclass of IOException + * will actually be thrown in order to provide a more detailed indication of + * what happened. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey (tromey@cygnus.com) + * @status updated to 1.4 + */ +public class IOException extends Exception { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 7818375828146090155L; + + /** + * Create an exception without a descriptive error message. + */ + public IOException() { + } + + /** + * Create an exception with a descriptive error message. + * + * @param message + * the descriptive error message + */ + public IOException(String message) { + super(message); + } +} // class IOException \ No newline at end of file diff --git a/Robust/src/ClassLibrary/SSJavaInfer/InputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/InputStream.java new file mode 100644 index 00000000..ab5cfd40 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/InputStream.java @@ -0,0 +1,270 @@ +/* InputStream.java -- Base class for input + Copyright (C) 1998, 1999, 2001, 2004, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.io; //NO PACKAGES FOR CLASS FILES + +/** + * This abstract class forms the base of the hierarchy of classes that read + * input as a stream of bytes. It provides a common set of methods for reading + * bytes from streams. Subclasses implement and extend these methods to read + * bytes from a particular input source such as a file or network connection. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy (warrenl@cygnus.com) + */ + +public abstract class InputStream // implements Closeable //COMPILER CANNOT + // HANDLE IMPLEMENTS +{ + /** + * Default, no-arg, public constructor + */ + public InputStream() { + } + + /** + * This method returns the number of bytes that can be read from this stream + * before a read can block. A return of 0 indicates that blocking might (or + * might not) occur on the very next read attempt. + *

+ * This method always returns 0 in this class + * + * @return The number of bytes that can be read before blocking could occur + * + * @exception IOException + * If an error occurs + */ + + public int available() throws IOException { + return 0; + } + + /** + * This method closes the stream. Any futher attempts to read from the stream + * may generate an IOException + *

+ * This method does nothing in this class, but subclasses may override this + * method in order to provide additional functionality. + * + * @exception IOException + * If an error occurs, which can only happen in a subclass + */ + public void close() throws IOException { + // Do nothing + } + + /** + * This method marks a position in the input to which the stream can be + * "reset" by calling the reset() method. The parameter + * @code{readlimit} is the number of bytes that can be read from the stream + * after setting the mark before the mark becomes invalid. For example, if + * mark() is called with a read limit of 10, then when 11 bytes + * of data are read from the stream before the reset() method is + * called, then the mark is invalid and the stream object instance is not + * required to remember the mark. + *

+ * This method does nothing in this class, but subclasses may override it to + * provide mark/reset functionality. + * + * @param readLimit + * The number of bytes that can be read before the mark becomes + * invalid + */ + public void mark(int readLimit) { + // Do nothing + } + + /** + * This method returns a boolean that indicates whether the mark/reset methods + * are supported in this class. Those methods can be used to remember a + * specific point in the stream and reset the stream to that point. + *

+ * This method always returns false in this class, but subclasses + * can override this method to return true if they support + * mark/reset functionality. + * + * @return true if mark/reset functionality is supported, + * false otherwise + */ + + public boolean markSupported() { + return false; + } + + /** + * This method reads an unsigned byte from the input stream and returns it as + * an int in the range of 0-255. This method also will return -1 if the end of + * the stream has been reached. + *

+ * This method will block until the byte can be read. + * + * @return The byte read or -1 if end of stream + * + * @exception IOException + * If an error occurs + */ + public abstract int read() throws IOException; + + /** + * This method reads bytes from a stream and stores them into a caller + * supplied buffer. This method attempts to completely fill the buffer, but + * can return before doing so. The actual number of bytes read is returned as + * an int. A -1 is returned to indicate the end of the stream. + *

+ * This method will block until some data can be read. + *

+ * This method operates by calling an overloaded read method like so: + * read(b, 0, b.length) + * + * @param b + * The buffer into which the bytes read will be stored. + * + * @return The number of bytes read or -1 if end of stream. + * + * @exception IOException + * If an error occurs. + */ + + public int read(byte[] b) throws IOException { + return read(b, 0, b.length); + } + + /** + * This method read bytes from a stream and stores them into a caller supplied + * buffer. It starts storing the data at index off into the + * buffer and attempts to read len bytes. This method can return + * before reading the number of bytes requested. The actual number of bytes + * read is returned as an int. A -1 is returned to indicate the end of the + * stream. + *

+ * This method will block until some data can be read. + *

+ * This method operates by calling the single byte read() method + * in a loop until the desired number of bytes are read. The read loop stops + * short if the end of the stream is encountered or if an IOException is + * encountered on any read operation except the first. If the first attempt to + * read a bytes fails, the IOException is allowed to propagate upward. And + * subsequent IOException is caught and treated identically to an end of + * stream condition. Subclasses can (and should if possible) override this + * method to provide a more efficient implementation. + * + * @param b + * The array into which the bytes read should be stored + * @param off + * The offset into the array to start storing bytes + * @param len + * The requested number of bytes to read + * + * @return The actual number of bytes read, or -1 if end of stream. + * + * @exception IOException + * If an error occurs. + */ + + public int read(byte[] b, int off, int len) throws IOException { + if (off < 0 || len < 0 || b.length - off < len) + throw new IndexOutOfBoundsException(); + + int i; + int ch; + + for (i = 0; i < len; ++i) + try { + if ((ch = read()) < 0) + return i == 0 ? -1 : i; // EOF + b[off + i] = (byte) ch; + } catch (IOException ex) { + // Only reading the first byte should cause an IOException. + if (i == 0) + throw ex; + return i; + } + + return i; + } + + /** + * This method resets a stream to the point where the mark() + * method was called. Any bytes that were read after the mark point was set + * will be re-read during subsequent reads. + *

+ * This method always throws an IOException in this class, but subclasses can + * override this method if they provide mark/reset functionality. + * + * @exception IOException + * Always thrown for this class + */ + public void reset() throws IOException { + throw new IOException("mark/reset not supported"); + } + + /** + * This method skips the specified number of bytes in the stream. It returns + * the actual number of bytes skipped, which may be less than the requested + * amount. + *

+ * This method reads and discards bytes into a byte array until the specified + * number of bytes were skipped or until either the end of stream is reached + * or a read attempt returns a short count. Subclasses can override this + * method to provide a more efficient implementation where one exists. + * + * @param n + * The requested number of bytes to skip + * + * @return The actual number of bytes skipped. + * + * @exception IOException + * If an error occurs + */ + + public long skip(long n) throws IOException { + // Throw away n bytes by reading them into a temp byte[]. + // Limit the temp array to 2Kb so we don't grab too much memory. + final int buflen = n > 2048 ? 2048 : (int) n; + byte[] tmpbuf = new byte[buflen]; + final long origN = n; + + while (n > 0) { + int numread = read(tmpbuf, 0, n > buflen ? buflen : (int) n); + if (numread <= 0) + break; + n -= numread; + } + + return origN - n; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Integer.java b/Robust/src/ClassLibrary/SSJavaInfer/Integer.java new file mode 100644 index 00000000..b4907cc2 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Integer.java @@ -0,0 +1,119 @@ + +public class Integer { + + private int value; + + /** + * The maximum value an int can represent is 2147483647 (or + * 231 - 1). + */ + public static final int MAX_VALUE = 0x7fffffff; + + public Integer(int value) { + this.value = value; + } + + // public Integer(String str) { + // value=Integer.parseInt(str, 10); + // } + + public int intValue() { + return value; + } + + public double doubleValue() { + return (double) value; + } + + public float floatValue() { + return (float) value; + } + + public byte[] intToByteArray() { + byte[] b = new byte[4]; + for (int i = 0; i < 4; i++) { + int offset = (b.length - 1 - i) * 8; + b[i] = (byte) ((value >> offset) & 0xFF); + } + return b; + } + + public int byteArrayToInt(byte[] b) { + int value = 0; + for (int i = 0; i < 4; i++) { + int shift = (4 - 1 - i) * 8; + value += (b[i] & 0x000000FF) << shift; + } + return value; + } + + public static int parseInt(String str) { + return Integer.parseInt(str, 10); + } + + public static int parseInt(String str, int radix) { + int value = 0; + boolean isNeg = false; + int start = 0; + byte[] chars = str.getBytes(); + + while (chars[start] == ' ' || chars[start] == '\t') + start++; + + if (chars[start] == '-') { + isNeg = true; + start++; + } + boolean cont = true; + for (int i = start; cont && i < str.length(); i++) { + byte b = chars[i]; + int val; + if (b >= '0' && b <= '9') + val = b - '0'; + else if (b >= 'a' && b <= 'z') + val = 10 + b - 'a'; + else if (b >= 'A' && b <= 'Z') + val = 10 + b - 'A'; + else { + cont = false; + } + if (cont) { + if (val >= radix) + System.error(); + value = value * radix + val; + } + } + if (isNeg) + value = -value; + return value; + } + + public String toString() { + return String.valueOf(value); + } + + public static String toString(int i) { + Integer I = new Integer(i); + return I.toString(); + } + + public int hashCode() { + return value; + } + + public boolean equals(Object o) { + if (o.getType() != getType()) + return false; + Integer s = (Integer) o; + if (s.intValue() != this.value) + return false; + return true; + } + + public int compareTo(Integer i) { + if (value == i.value) + return 0; + // Returns just -1 or 1 on inequality; doing math might overflow. + return value > i.value ? 1 : -1; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Long.java b/Robust/src/ClassLibrary/SSJavaInfer/Long.java new file mode 100644 index 00000000..f084b87f --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Long.java @@ -0,0 +1,834 @@ +/* Long.java -- object wrapper for long + Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +//package java.lang; + +/** + * Instances of class Long represent primitive + * long values. + * + * Additionally, this class provides various helper functions and variables + * related to longs. + * + * @author Paul Fisher + * @author John Keiser + * @author Warren Levy + * @author Eric Blake (ebb9@email.byu.edu) + * @author Tom Tromey (tromey@redhat.com) + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) + * @author Ian Rogers + * @since 1.0 + * @status updated to 1.5 + */ + + +public final class Long //extends Number implements Comparable +{ + /** + * Compatible with JDK 1.0.2+. + */ + private static final long serialVersionUID = 4290774380558885855L; + + /** + * The minimum value a long can represent is + * -9223372036854775808L (or -263). + */ + public static final long MIN_VALUE = 0x8000000000000000L; + + /** + * The maximum value a long can represent is + * 9223372036854775807 (or 263 - 1). + */ + public static final long MAX_VALUE = 0x7fffffffffffffffL; + + /** + * The primitive type long is represented by this + * Class object. + * @since 1.1 + */ + //public static final Class TYPE = (Class) VMClassLoader.getPrimitiveClass ('J'); + + /** + * The number of bits needed to represent a long. + * @since 1.5 + */ + public static final int SIZE = 64; + + // This caches some Long values, and is used by boxing + // conversions via valueOf(). We cache at least -128..127; + // these constants control how much we actually cache. + private static final int MIN_CACHE = -128; + private static final int MAX_CACHE = 127; + private static final Long[] longCache = new Long[MAX_CACHE - MIN_CACHE + 1]; + static + { + for (int i=MIN_CACHE; i <= MAX_CACHE; i++) + longCache[i - MIN_CACHE] = new Long(i); + } + + /** + * The immutable value of this Long. + * + * @serial the wrapped long + */ + private final long value; + + /** + * Create a Long object representing the value of the + * long argument. + * + * @param value the value to use + */ + public Long(long value) + { + this.value = value; + } + + /** + * Create a Long object representing the value of the + * argument after conversion to a long. + * + * @param s the string to convert + * @throws NumberFormatException if the String does not contain a long + * @see #valueOf(String) + */ + public Long(String s) + { + value = parseLong(s, 10, false); + } + + /** + * Return the size of a string large enough to hold the given number + * + * @param num the number we want the string length for (must be positive) + * @param radix the radix (base) that will be used for the string + * @return a size sufficient for a string of num + */ + private static int stringSize(long num, int radix) { + int exp; + if (radix < 4) + { + exp = 1; + } + else if (radix < 8) + { + exp = 2; + } + else if (radix < 16) + { + exp = 3; + } + else if (radix < 32) + { + exp = 4; + } + else + { + exp = 5; + } + int size=0; + do + { + num >>>= exp; + size++; + } + while(num != 0); + return size; + } + + /** + * Converts the long to a String using + * the specified radix (base). If the radix exceeds + * Character.MIN_RADIX or Character.MAX_RADIX, 10 + * is used instead. If the result is negative, the leading character is + * '-' ('\\u002D'). The remaining characters come from + * Character.forDigit(digit, radix) ('0'-'9','a'-'z'). + * + * @param num the long to convert to String + * @param radix the radix (base) to use in the conversion + * @return the String representation of the argument + */ + /*public static String toString(long num, int radix) + { + if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) + radix = 10; + + // Is the value negative? + boolean isNeg = num < 0; + + // Is the string a single character? + if (!isNeg && num < radix) + return new String(digits, (int)num, 1, true); + + // Compute string size and allocate buffer + // account for a leading '-' if the value is negative + int size; + int i; + char[] buffer; + if (isNeg) + { + num = -num; + + // When the value is MIN_VALUE, it overflows when made positive + if (num < 0) + { + i = size = stringSize(MAX_VALUE, radix) + 2; + buffer = new char[size]; + buffer[--i] = digits[(int) (-(num + radix) % radix)]; + num = -(num / radix); + } + else + { + i = size = stringSize(num, radix) + 1; + buffer = new char[size]; + } + } + else + { + i = size = stringSize(num, radix); + buffer = new char[size]; + } + + do + { + buffer[--i] = digits[(int) (num % radix)]; + num /= radix; + } + while (num > 0); + + if (isNeg) + buffer[--i] = '-'; + + // Package constructor avoids an array copy. + return new String(buffer, i, size - i, true); + }*/ + + /** + * Converts the long to a String assuming it is + * unsigned in base 16. + * + * @param l the long to convert to String + * @return the String representation of the argument + */ + /*public static String toHexString(long l) + { + return toUnsignedString(l, 4); + }*/ + + /** + * Converts the long to a String assuming it is + * unsigned in base 8. + * + * @param l the long to convert to String + * @return the String representation of the argument + */ + /*public static String toOctalString(long l) + { + return toUnsignedString(l, 3); + }*/ + + /** + * Converts the long to a String assuming it is + * unsigned in base 2. + * + * @param l the long to convert to String + * @return the String representation of the argument + */ + /*public static String toBinaryString(long l) + { + return toUnsignedString(l, 1); + }*/ + + /** + * Converts the long to a String and assumes + * a radix of 10. + * + * @param num the long to convert to String + * @return the String representation of the argument + * @see #toString(long, int) + */ + public static String toString(long num) + { + //return toString(num, 10); + return String.valueOf(num); + } + + /** + * Converts the specified String into an int + * using the specified radix (base). The string must not be null + * or empty. It may begin with an optional '-', which will negate the answer, + * provided that there are also valid digits. Each digit is parsed as if by + * Character.digit(d, radix), and must be in the range + * 0 to radix - 1. Finally, the result must be + * within MIN_VALUE to MAX_VALUE, inclusive. + * Unlike Double.parseDouble, you may not have a leading '+'; and 'l' or + * 'L' as the last character is only valid in radices 22 or greater, where + * it is a digit and not a type indicator. + * + * @param str the String to convert + * @param radix the radix (base) to use in the conversion + * @return the String argument converted to long + * @throws NumberFormatException if s cannot be parsed as a + * long + */ + public static long parseLong(String str, int radix) + { + return parseLong(str, radix, false); + } + + /** + * Converts the specified String into a long. + * This function assumes a radix of 10. + * + * @param s the String to convert + * @return the int value of s + * @throws NumberFormatException if s cannot be parsed as a + * long + * @see #parseLong(String, int) + */ + public static long parseLong(String s) + { + return parseLong(s, 10, false); + } + + /** + * Creates a new Long object using the String + * and specified radix (base). + * + * @param s the String to convert + * @param radix the radix (base) to convert with + * @return the new Long + * @throws NumberFormatException if s cannot be parsed as a + * long + * @see #parseLong(String, int) + */ + public static Long valueOf(String s, int radix) + { + return valueOf(parseLong(s, radix, false)); + } + + /** + * Creates a new Long object using the String, + * assuming a radix of 10. + * + * @param s the String to convert + * @return the new Long + * @throws NumberFormatException if s cannot be parsed as a + * long + * @see #Long(String) + * @see #parseLong(String) + */ + public static Long valueOf(String s) + { + return valueOf(parseLong(s, 10, false)); + } + + /** + * Returns a Long object wrapping the value. + * + * @param val the value to wrap + * @return the Long + * @since 1.5 + */ + public static Long valueOf(long val) + { + if (val < MIN_CACHE || val > MAX_CACHE) + return new Long(val); + else + return longCache[((int)val) - MIN_CACHE]; + } + + /** + * Convert the specified String into a Long. + * The String may represent decimal, hexadecimal, or + * octal numbers. + * + *

The extended BNF grammar is as follows:
+ *

+   * DecodableString:
+   *      ( [ - ] DecimalNumber )
+   *    | ( [ - ] ( 0x | 0X
+   *              | # ) HexDigit { HexDigit } )
+   *    | ( [ - ] 0 { OctalDigit } )
+   * DecimalNumber:
+   *        DecimalDigit except '0' { DecimalDigit }
+   * DecimalDigit:
+   *        Character.digit(d, 10) has value 0 to 9
+   * OctalDigit:
+   *        Character.digit(d, 8) has value 0 to 7
+   * DecimalDigit:
+   *        Character.digit(d, 16) has value 0 to 15
+   * 
+ * Finally, the value must be in the range MIN_VALUE to + * MAX_VALUE, or an exception is thrown. Note that you cannot + * use a trailing 'l' or 'L', unlike in Java source code. + * + * @param str the String to interpret + * @return the value of the String as a Long + * @throws NumberFormatException if s cannot be parsed as a + * long + * @throws NullPointerException if s is null + * @since 1.2 + */ + public static Long decode(String str) + { + return valueOf(parseLong(str, 10, true)); + } + + /** + * Return the value of this Long as a byte. + * + * @return the byte value + */ + public byte byteValue() + { + return (byte) value; + } + + /** + * Return the value of this Long as a short. + * + * @return the short value + */ + public short shortValue() + { + return (short) value; + } + + /** + * Return the value of this Long as an int. + * + * @return the int value + */ + public int intValue() + { + return (int) value; + } + + /** + * Return the value of this Long. + * + * @return the long value + */ + public long longValue() + { + return value; + } + + /** + * Return the value of this Long as a float. + * + * @return the float value + */ + public float floatValue() + { + return value; + } + + /** + * Return the value of this Long as a double. + * + * @return the double value + */ + public double doubleValue() + { + return value; + } + + /** + * Converts the Long value to a String and + * assumes a radix of 10. + * + * @return the String representation + */ + public String toString() + { + //return toString(value, 10); + return String.valueOf(value); + } + + /** + * Return a hashcode representing this Object. Long's hash + * code is calculated by (int) (value ^ (value >> 32)). + * + * @return this Object's hash code + */ + public int hashCode() + { + return (int) (value ^ (value >>> 32)); + } + + /** + * Returns true if obj is an instance of + * Long and represents the same long value. + * + * @param obj the object to compare + * @return whether these Objects are semantically equal + */ + public boolean equals(Object obj) + { + return obj instanceof Long && value == ((Long) obj).value; + } + + /** + * Get the specified system property as a Long. The + * decode() method will be used to interpret the value of + * the property. + * + * @param nm the name of the system property + * @return the system property as a Long, or null if the + * property is not found or cannot be decoded + * @throws SecurityException if accessing the system property is forbidden + * @see System#getProperty(String) + * @see #decode(String) + */ + public static Long getLong(String nm) + { + return getLong(nm, null); + } + + /** + * Get the specified system property as a Long, or use a + * default long value if the property is not found or is not + * decodable. The decode() method will be used to interpret + * the value of the property. + * + * @param nm the name of the system property + * @param val the default value + * @return the value of the system property, or the default + * @throws SecurityException if accessing the system property is forbidden + * @see System#getProperty(String) + * @see #decode(String) + */ + public static Long getLong(String nm, long val) + { + Long result = getLong(nm, null); + return result == null ? valueOf(val) : result; + } + + /** + * Get the specified system property as a Long, or use a + * default Long value if the property is not found or is + * not decodable. The decode() method will be used to + * interpret the value of the property. + * + * @param nm the name of the system property + * @param def the default value + * @return the value of the system property, or the default + * @throws SecurityException if accessing the system property is forbidden + * @see System#getProperty(String) + * @see #decode(String) + */ + public static Long getLong(String nm, Long def) + { + if (nm == null || "".equals(nm)) + return def; + nm = null;//System.getProperty(nm); + if (nm == null) + return def; + /*try + { + return decode(nm); + } + catch (NumberFormatException e) + { + return def; + }*/ + } + + /** + * Compare two Longs numerically by comparing their long + * values. The result is positive if the first is greater, negative if the + * second is greater, and 0 if the two are equal. + * + * @param l the Long to compare + * @return the comparison + * @since 1.2 + */ + public int compareTo(Long l) + { + if (value == l.value) + return 0; + // Returns just -1 or 1 on inequality; doing math might overflow the long. + return value > l.value ? 1 : -1; + } + + /** + * Return the number of bits set in x. + * @param x value to examine + * @since 1.5 + */ + public static int bitCount(long x) + { + // Successively collapse alternating bit groups into a sum. + x = ((x >> 1) & 0x5555555555555555L) + (x & 0x5555555555555555L); + x = ((x >> 2) & 0x3333333333333333L) + (x & 0x3333333333333333L); + int v = (int) ((x >>> 32) + x); + v = ((v >> 4) & 0x0f0f0f0f) + (v & 0x0f0f0f0f); + v = ((v >> 8) & 0x00ff00ff) + (v & 0x00ff00ff); + return ((v >> 16) & 0x0000ffff) + (v & 0x0000ffff); + } + + /** + * Rotate x to the left by distance bits. + * @param x the value to rotate + * @param distance the number of bits by which to rotate + * @since 1.5 + */ + public static long rotateLeft(long x, int distance) + { + // This trick works because the shift operators implicitly mask + // the shift count. + return (x << distance) | (x >>> - distance); + } + + /** + * Rotate x to the right by distance bits. + * @param x the value to rotate + * @param distance the number of bits by which to rotate + * @since 1.5 + */ + public static long rotateRight(long x, int distance) + { + // This trick works because the shift operators implicitly mask + // the shift count. + return (x << - distance) | (x >>> distance); + } + + /** + * Find the highest set bit in value, and return a new value + * with only that bit set. + * @param value the value to examine + * @since 1.5 + */ + public static long highestOneBit(long value) + { + value |= value >>> 1; + value |= value >>> 2; + value |= value >>> 4; + value |= value >>> 8; + value |= value >>> 16; + value |= value >>> 32; + return value ^ (value >>> 1); + } + + /** + * Return the number of leading zeros in value. + * @param value the value to examine + * @since 1.5 + */ + public static int numberOfLeadingZeros(long value) + { + value |= value >>> 1; + value |= value >>> 2; + value |= value >>> 4; + value |= value >>> 8; + value |= value >>> 16; + value |= value >>> 32; + return bitCount(~value); + } + + /** + * Find the lowest set bit in value, and return a new value + * with only that bit set. + * @param value the value to examine + * @since 1.5 + */ + public static long lowestOneBit(long value) + { + // Classic assembly trick. + return value & - value; + } + + /** + * Find the number of trailing zeros in value. + * @param value the value to examine + * @since 1.5 + */ + public static int numberOfTrailingZeros(long value) + { + return bitCount((value & -value) - 1); + } + + /** + * Return 1 if x is positive, -1 if it is negative, and 0 if it is + * zero. + * @param x the value to examine + * @since 1.5 + */ + public static int signum(long x) + { + return (int) ((x >> 63) | (-x >>> 63)); + + // The LHS propagates the sign bit through every bit in the word; + // if X < 0, every bit is set to 1, else 0. if X > 0, the RHS + // negates x and shifts the resulting 1 in the sign bit to the + // LSB, leaving every other bit 0. + + // Hacker's Delight, Section 2-7 + } + + /** + * Reverse the bytes in val. + * @since 1.5 + */ + /*public static long reverseBytes(long val) + { + int hi = Integer.reverseBytes((int) val); + int lo = Integer.reverseBytes((int) (val >>> 32)); + return (((long) hi) << 32) | lo; + }*/ + + /** + * Reverse the bits in val. + * @since 1.5 + */ + /*public static long reverse(long val) + { + long hi = Integer.reverse((int) val) & 0xffffffffL; + long lo = Integer.reverse((int) (val >>> 32)) & 0xffffffffL; + return (hi << 32) | lo; + }*/ + + /** + * Helper for converting unsigned numbers to String. + * + * @param num the number + * @param exp log2(digit) (ie. 1, 3, or 4 for binary, oct, hex) + */ + /*private static String toUnsignedString(long num, int exp) + { + // Compute string length + int size = 1; + long copy = num >>> exp; + while (copy != 0) + { + size++; + copy >>>= exp; + } + // Quick path for single character strings + if (size == 1) + return new String(digits, (int)num, 1, true); + + // Encode into buffer + int mask = (1 << exp) - 1; + char[] buffer = new char[size]; + int i = size; + do + { + buffer[--i] = digits[(int) num & mask]; + num >>>= exp; + } + while (num != 0); + + // Package constructor avoids an array copy. + return new String(buffer, i, size - i, true); + }*/ + + /** + * Helper for parsing longs. + * + * @param str the string to parse + * @param radix the radix to use, must be 10 if decode is true + * @param decode if called from decode + * @return the parsed long value + * @throws NumberFormatException if there is an error + * @throws NullPointerException if decode is true and str is null + * @see #parseLong(String, int) + * @see #decode(String) + */ + private static long parseLong(String str, int radix, boolean decode) + { + if (! decode && str == null) + throw new /*NumberFormat*/Exception("NumberFormatException"); + int index = 0; + int len = str.length(); + boolean isNeg = false; + if (len == 0) + throw new /*NumberFormat*/Exception("NumberFormatException"); + int ch = str.charAt(index); + if (ch == '-') + { + if (len == 1) + throw new /*NumberFormat*/Exception("NumberFormatException"); + isNeg = true; + ch = str.charAt(++index); + } + if (decode) + { + if (ch == '0') + { + if (++index == len) + return 0; + if ((str.charAt(index) & ~('x' ^ 'X')) == 'X') + { + radix = 16; + index++; + } + else + radix = 8; + } + else if (ch == '#') + { + radix = 16; + index++; + } + } + if (index == len) + throw new /*NumberFormat*/Exception("NumberFormatException"); + + long max = MAX_VALUE / radix; + // We can't directly write `max = (MAX_VALUE + 1) / radix'. + // So instead we fake it. + if (isNeg && MAX_VALUE % radix == radix - 1) + ++max; + + long val = 0; + while (index < len) + { + if (val < 0 || val > max) + throw new /*NumberFormat*/Exception("NumberFormatException"); + + ch = Character.digit(str.charAt(index++), radix); + val = val * radix + ch; + if (ch < 0 || (val < 0 && (! isNeg || val != MIN_VALUE))) + throw new /*NumberFormat*/Exception("NumberFormatException"); + } + return isNeg ? -val : val; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Math.java b/Robust/src/ClassLibrary/SSJavaInfer/Math.java new file mode 100644 index 00000000..be388569 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Math.java @@ -0,0 +1,136 @@ + +public class Math { + + static final double PI = 3.14159265358979323846; + + // an alias for setPI() + public static double PI() { + double PI = 3.14159265358979323846; + return PI; + } + + public static int abs(int x) { + return (x < 0) ? -x : x; + } + + public static long abs(long x) { + return (x < 0) ? -x : x; + } + + public static double abs(double x) { + return (x < 0) ? -x : x; + } + + public static float abs(float x) { + return (x < 0) ? -x : x; + } + + public static double max(double a, double b) { + return (a > b) ? a : b; + } + + public static float max(float a, float b) { + return (a > b) ? a : b; + } + + public static int max(int a, int b) { + return (a > b) ? a : b; + } + + public static long max(long a, long b) { + return (a > b) ? a : b; + } + + public static double min(double a, double b) { + return (a < b) ? a : b; + } + + public static float min(float a, float b) { + return (a < b) ? a : b; + } + + public static int min(int a, int b) { + return (a < b) ? a : b; + } + + public static long min(long a, long b) { + return (a < b) ? a : b; + } + + /** sqrt(a^2 + b^2) without under/overflow. **/ + public static double hypot(double a, double b) { + double r; + if (abs(a) > abs(b)) { + r = b / a; + r = abs(a) * sqrt(1 + r * r); + } else if (b != 0) { + r = a / b; + r = abs(b) * sqrt(1 + r * r); + } else { + r = 0.0; + } + return r; + } + + public static int round(float a) { + // this check for NaN, from JLS 15.21.1, saves a method call + return (int) floor(a + 0.5f); + } + + public static double rint(double x) { + double y = ceil(x); + double d = y - x; + if (d == 0.5) { + if (((int) y) % 2 == 0) { + return y; + } else { + return y - 1.0; + } + } else if (d < 0.5) { + return y; + } + return y - 1.0; + } + + public static native double sin(double a); + + public static native double cos(double a); + + public static native double asin(double a); + + public static native double acos(double a); + + public static native double tan(double a); + + public static native double atan(double a); + + public static native double atan2(double a, double b); + + public static native double exp(double a); + + public static native double sqrt(double a); + + public static native double log(double a); + + public static native double pow(double a, double b); + + public static native double ceil(double a); + + public static native double floor(double a); + + public static native float sinf(float a); + + public static native float cosf(float a); + + public static native float expf(float a); + + public static native float sqrtf(float a); + + public static native float logf(float a); + + public static native float powf(float a, float b); + + public static native float ceilf(float a); + + public static native float IEEEremainder(float f1, float f2); +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Number.java b/Robust/src/ClassLibrary/SSJavaInfer/Number.java new file mode 100644 index 00000000..a1de2fe2 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Number.java @@ -0,0 +1,163 @@ +/* Number.java =- abstract superclass of numeric objects + Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + +//package java.lang; + +//import java.io.Serializable; + +/** + * Number is a generic superclass of all the numeric classes, including the + * wrapper classes {@link Byte}, {@link Short}, {@link Integer}, {@link Long}, + * {@link Float}, and {@link Double}. Also worth mentioning are the classes in + * {@link java.math}. + * + * It provides ways to convert numeric objects to any primitive. + * + * @author Paul Fisher + * @author John Keiser + * @author Warren Levy + * @author Eric Blake (ebb9@email.byu.edu) + * @since 1.0 + * @status updated to 1.4 + */ +public/* abstract */class Number // implements Serializable +{ + /** + * Compatible with JDK 1.1+. + */ + // private static final long serialVersionUID = -8742448824652078965L; + + /** + * Table for calculating digits, used in Character, Long, and Integer. + */ + /* static */final char[] digits; + + /** + * The basic constructor (often called implicitly). + */ + public Number() { + digits = new char[36]; + digits[0] = '0'; + digits[1] = '1'; + digits[2] = '2'; + digits[3] = '3'; + digits[4] = '4'; + digits[5] = '5'; + digits[6] = '6'; + digits[7] = '7'; + digits[8] = '8'; + digits[9] = '9'; + digits[10] = 'a'; + digits[11] = 'b'; + digits[12] = 'c'; + digits[13] = 'd'; + digits[14] = 'e'; + digits[15] = 'f'; + digits[16] = 'g'; + digits[17] = 'h'; + digits[18] = 'i'; + digits[19] = 'j'; + digits[20] = 'k'; + digits[21] = 'l'; + digits[22] = 'm'; + digits[23] = 'n'; + digits[24] = 'o'; + digits[25] = 'p'; + digits[26] = 'q'; + digits[27] = 'r'; + digits[28] = 's'; + digits[29] = 't'; + digits[30] = 'u'; + digits[31] = 'v'; + digits[32] = 'w'; + digits[33] = 'x'; + digits[34] = 'y'; + digits[35] = 'z'; + } + + /** + * Return the value of this Number as an int. + * + * @return the int value + */ + public/* abstract */int intValue() { + } + + /** + * Return the value of this Number as a long. + * + * @return the long value + */ + public/* abstract */long longValue() { + } + + /** + * Return the value of this Number as a float. + * + * @return the float value + */ + public/* abstract */float floatValue() { + } + + /** + * Return the value of this Number as a float. + * + * @return the double value + */ + public/* abstract */double doubleValue() { + } + + /** + * Return the value of this Number as a byte. + * + * @return the byte value + * @since 1.1 + */ + public byte byteValue() { + return (byte) intValue(); + } + + /** + * Return the value of this Number as a short. + * + * @return the short value + * @since 1.1 + */ + public short shortValue() { + return (short) intValue(); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Object.java b/Robust/src/ClassLibrary/SSJavaInfer/Object.java new file mode 100644 index 00000000..f9531aa3 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Object.java @@ -0,0 +1,22 @@ +import String; + +public class Object { + + public native int hashCode(); + + /* DON'T USE THIS METHOD UNLESS NECESSARY */ + /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */ + public native int getType(); + + public boolean equals(Object o) { + if (o == this) + return true; + return false; + } + + @TRUST + public String toString() { + return "Object" + hashCode(); + } + +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/OutputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/OutputStream.java new file mode 100644 index 00000000..eee7fce6 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/OutputStream.java @@ -0,0 +1,23 @@ +public class OutputStream { + public OutputStream() { + } + + public void write(int ch) { + System.printString("Called unimplemented write(int)\n"); + } + + public void write(byte[] b) { + System.printString("Called unimplemented write(byte[])\n"); + } + + public void write(byte[] b, int off, int len) { + System.printString("Called unimplemented write(byte[],int,int)\n"); + } + + public void flush() { + } + + public void close() { + System.printString("Called unimplemented close()\n"); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/PrintStream.java b/Robust/src/ClassLibrary/SSJavaInfer/PrintStream.java new file mode 100644 index 00000000..3e7f2e3b --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/PrintStream.java @@ -0,0 +1,629 @@ +/* PrintStream.java -- OutputStream for printing output + Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.io; + +/*import java.util.Locale; + import java.util.Formatter; + + import gnu.classpath.SystemProperties; + */ +/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 + * "The Java Language Specification", ISBN 0-201-63451-1 + * Status: Believed complete and correct to 1.3 + */ + +/** + * This class prints Java primitive values and object to a stream as text. None + * of the methods in this class throw an exception. However, errors can be + * detected by calling the checkError() method. Additionally, this + * stream can be designated as "autoflush" when created so that any writes are + * automatically flushed to the underlying output sink when the current line is + * terminated. + *

+ * This class converts char's into byte's using the system default encoding. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey (tromey@cygnus.com) + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) + */ +public class PrintStream extends FilterOutputStream // implements Appendable +{ + /* + * Notice the implementation is quite similar to OutputStreamWriter. This + * leads to some minor duplication, because neither inherits from the other, + * and we want to maximize performance. + */ + + // Line separator string. + private static final char[] line_separator = { '\n' }/* + * SystemProperties. + * getProperty + * ("line.separator", + * "\n").toCharArray() + */; + + /** + * Encoding name + */ + private final String encoding; + + /** + * This boolean indicates whether or not an error has ever occurred on this + * stream. + */ + private boolean error_occurred = false; + + /** + * This is true if auto-flush is enabled, false + * otherwise + */ + private final boolean auto_flush; + + /** + * This method initializes a new PrintStream object to write to + * the specified output File. Doesn't autoflush. + * + * @param file + * The File to write to. + * @throws FileNotFoundException + * if an error occurs while opening the file. + * + * @since 1.5 + */ + public PrintStream(File file) + // throws FileNotFoundException + { + this(new FileOutputStream(file), false); + } + + /** + * This method initializes a new PrintStream object to write to + * the specified output File. Doesn't autoflush. + * + * @param file + * The File to write to. + * @param encoding + * The name of the character encoding to use for this object. + * @throws FileNotFoundException + * If an error occurs while opening the file. + * @throws UnsupportedEncodingException + * If the charset specified by encoding is invalid. + * + * @since 1.5 + */ + public PrintStream(File file, String encoding) + // throws FileNotFoundException,UnsupportedEncodingException + { + this(new FileOutputStream(file), false, encoding); + } + + /** + * This method initializes a new PrintStream object to write to + * the specified output File. Doesn't autoflush. + * + * @param fileName + * The name of the File to write to. + * @throws FileNotFoundException + * if an error occurs while opening the file, + * + * @since 1.5 + */ + public PrintStream(String fileName) + // throws FileNotFoundException + { + this(new FileOutputStream(new File(fileName)), false); + } + + /** + * This method initializes a new PrintStream object to write to + * the specified output File. Doesn't autoflush. + * + * @param fileName + * The name of the File to write to. + * @param encoding + * The name of the character encoding to use for this object. + * @throws FileNotFoundException + * if an error occurs while opening the file. + * @throws UnsupportedEncodingException + * If the charset specified by encoding is invalid. + * + * @since 1.5 + */ + public PrintStream(String fileName, String encoding) + // throws FileNotFoundException,UnsupportedEncodingException + { + this(new FileOutputStream(new File(fileName)), false, encoding); + } + + /** + * This method initializes a new PrintStream object to write to + * the specified output sink. Doesn't autoflush. + * + * @param out + * The OutputStream to write to. + */ + public PrintStream(OutputStream out) { + this(out, false); + } + + /** + * This method initializes a new PrintStream object to write to + * the specified output sink. This constructor also allows "auto-flush" + * functionality to be specified where the stream will be flushed after every + * print or println call, when the + * write methods with array arguments are called, or when a + * single new-line character is written. + *

+ * + * @param out + * The OutputStream to write to. + * @param auto_flush + * true to flush the stream after every line, + * false otherwise + */ + public PrintStream(OutputStream out, boolean auto_flush) { + super(out); + /* + * String encoding; try { encoding = + * SystemProperties.getProperty("file.encoding"); } catch (SecurityException + * e){ encoding = "ISO8859_1"; } catch (IllegalArgumentException e){ + * encoding = "ISO8859_1"; } catch (NullPointerException e){ encoding = + * "ISO8859_1"; } + */ + this.encoding = "ISO8859_1"; // encoding; + this.auto_flush = auto_flush; + } + + /** + * This method initializes a new PrintStream object to write to + * the specified output sink. This constructor also allows "auto-flush" + * functionality to be specified where the stream will be flushed after every + * print or println call, when the + * write methods with array arguments are called, or when a + * single new-line character is written. + *

+ * + * @param out + * The OutputStream to write to. + * @param auto_flush + * true to flush the stream after every line, + * false otherwise + * @param encoding + * The name of the character encoding to use for this object. + */ + public PrintStream(OutputStream out, boolean auto_flush, String encoding) + // throws UnsupportedEncodingException + { + super(out); + + new String(new byte[] { 0 }, encoding); // check if encoding is supported + this.encoding = encoding; + this.auto_flush = auto_flush; + } + + /** + * This method checks to see if an error has occurred on this stream. Note + * that once an error has occurred, this method will continue to report + * true forever for this stream. Before checking for an error + * condition, this method flushes the stream. + * + * @return true if an error has occurred, false + * otherwise + */ + public boolean checkError() { + flush(); + return error_occurred; + } + + /** + * This method can be called by subclasses to indicate that an error has + * occurred and should be reported by checkError. + */ + protected void setError() { + error_occurred = true; + } + + /** + * This method closes this stream and all underlying streams. + */ + public void close() { + /* + * try { flush(); out.close(); } catch (InterruptedIOException iioe) { + * Thread.currentThread().interrupt(); } catch (IOException e) { setError + * (); } + */ + } + + /** + * This method flushes any buffered bytes to the underlying stream and then + * flushes that stream as well. + */ + public void flush() { + /* + * try { out.flush(); } catch (InterruptedIOException iioe) { + * Thread.currentThread().interrupt(); } catch (IOException e) { setError + * (); } + */ + } + + private synchronized void print(String str, boolean println) { + /* + * try { writeChars(str, 0, str.length()); if (println) + * writeChars(line_separator, 0, line_separator.length); if (auto_flush) + * flush(); } catch (InterruptedIOException iioe) { + * Thread.currentThread().interrupt(); } catch (IOException e) { setError + * (); } + */ + } + + private synchronized void print(char[] chars, int pos, int len, boolean println) { + /* + * try { writeChars(chars, pos, len); if (println) + * writeChars(line_separator, 0, line_separator.length); if (auto_flush) + * flush(); } catch (InterruptedIOException iioe) { + * Thread.currentThread().interrupt(); } catch (IOException e) { setError + * (); } + */ + } + + private void writeChars(char[] buf, int offset, int count) + // throws IOException + { + /* + * byte[] bytes = (new String(buf, offset, count)).getBytes(encoding); + * out.write(bytes, 0, bytes.length); + */ + } + + private void writeChars(String str, int offset, int count) + // throws IOException + { + /* + * byte[] bytes = str.substring(offset, offset+count).getBytes(encoding); + * out.write(bytes, 0, bytes.length); + */ + } + + /** + * This methods prints a boolean value to the stream. true values + * are printed as "true" and false values are printed as "false". + * + * @param bool + * The boolean value to print + */ + public void print(boolean bool) { + print(String.valueOf(bool), false); + } + + /** + * This method prints an integer to the stream. The value printed is + * determined using the String.valueOf() method. + * + * @param inum + * The int value to be printed + */ + public void print(int inum) { + print(String.valueOf(inum), false); + } + + /** + * This method prints a long to the stream. The value printed is determined + * using the String.valueOf() method. + * + * @param lnum + * The long value to be printed + */ + public void print(long lnum) { + print(String.valueOf(lnum), false); + } + + /** + * This method prints a float to the stream. The value printed is determined + * using the String.valueOf() method. + * + * @param fnum + * The float value to be printed + */ + public void print(float fnum) { + print(String.valueOf(fnum), false); + } + + /** + * This method prints a double to the stream. The value printed is determined + * using the String.valueOf() method. + * + * @param dnum + * The double value to be printed + */ + public void print(double dnum) { + print(String.valueOf(dnum), false); + } + + /** + * This method prints an Object to the stream. The actual value + * printed is determined by calling the String.valueOf() method. + * + * @param obj + * The Object to print. + */ + public void print(Object obj) { + print(obj == null ? "null" : obj.toString(), false); + } + + /** + * This method prints a String to the stream. The actual value + * printed depends on the system default encoding. + * + * @param str + * The String to print. + */ + public void print(String str) { + print(str == null ? "null" : str, false); + } + + /** + * This method prints a char to the stream. The actual value printed is + * determined by the character encoding in use. + * + * @param ch + * The char value to be printed + */ + public synchronized void print(char ch) { + print(new char[] { ch }, 0, 1, false); + } + + /** + * This method prints an array of characters to the stream. The actual value + * printed depends on the system default encoding. + * + * @param charArray + * The array of characters to print. + */ + public void print(char[] charArray) { + print(charArray, 0, charArray.length, false); + } + + /** + * This method prints a line separator sequence to the stream. The value + * printed is determined by the system property

line.separator and + * is not necessarily the Unix '\n' newline character. + */ + public void println() { + print(line_separator, 0, line_separator.length, false); + } + + /** + * This methods prints a boolean value to the stream. true values + * are printed as "true" and false values are printed as "false". + *

+ * This method prints a line termination sequence after printing the value. + * + * @param bool + * The boolean value to print + */ + public void println(boolean bool) { + print(String.valueOf(bool), true); + } + + /** + * This method prints an integer to the stream. The value printed is + * determined using the String.valueOf() method. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param inum + * The int value to be printed + */ + public void println(int inum) { + print(String.valueOf(inum), true); + } + + /** + * This method prints a long to the stream. The value printed is determined + * using the String.valueOf() method. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param lnum + * The long value to be printed + */ + public void println(long lnum) { + print(String.valueOf(lnum), true); + } + + /** + * This method prints a float to the stream. The value printed is determined + * using the String.valueOf() method. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param fnum + * The float value to be printed + */ + public void println(float fnum) { + print(String.valueOf(fnum), true); + } + + /** + * This method prints a double to the stream. The value printed is determined + * using the String.valueOf() method. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param dnum + * The double value to be printed + */ + public void println(double dnum) { + print(String.valueOf(dnum), true); + } + + /** + * This method prints an Object to the stream. The actual value + * printed is determined by calling the String.valueOf() method. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param obj + * The Object to print. + */ + public void println(Object obj) { + print(obj == null ? "null" : obj.toString(), true); + } + + /** + * This method prints a String to the stream. The actual value + * printed depends on the system default encoding. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param str + * The String to print. + */ + public void println(String str) { + print(str == null ? "null" : str, true); + } + + /** + * This method prints a char to the stream. The actual value printed is + * determined by the character encoding in use. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param ch + * The char value to be printed + */ + public synchronized void println(char ch) { + print(new char[] { ch }, 0, 1, true); + } + + /** + * This method prints an array of characters to the stream. The actual value + * printed depends on the system default encoding. + *

+ * This method prints a line termination sequence after printing the value. + * + * @param charArray + * The array of characters to print. + */ + public void println(char[] charArray) { + print(charArray, 0, charArray.length, true); + } + + /** + * This method writes a byte of data to the stream. If auto-flush is enabled, + * printing a newline character will cause the stream to be flushed after the + * character is written. + * + * @param oneByte + * The byte to be written + */ + public void write(int oneByte) { + /* + * try { out.write (oneByte & 0xff); + * + * if (auto_flush && (oneByte == '\n')) flush (); } catch + * (InterruptedIOException iioe) { Thread.currentThread ().interrupt (); } + * catch (IOException e) { setError (); } + */ + } + + /** + * This method writes len bytes from the specified array starting + * at index offset into the array. + * + * @param buffer + * The array of bytes to write + * @param offset + * The index into the array to start writing from + * @param len + * The number of bytes to write + */ + public void write(byte[] buffer, int offset, int len) { + /* + * try { out.write (buffer, offset, len); + * + * if (auto_flush) flush (); } catch (InterruptedIOException iioe) { + * Thread.currentThread ().interrupt (); } catch (IOException e) { setError + * (); } + */ + } + + /** @since 1.5 */ + public PrintStream append(char c) { + print(c); + return this; + } + + /** @since 1.5 */ + /* + * public PrintStream append(CharSequence cs) { print(cs == null ? "null" : + * cs.toString()); return this; } + */ + + /** @since 1.5 */ + /* + * public PrintStream append(CharSequence cs, int start, int end) { print(cs + * == null ? "null" : cs.subSequence(start, end).toString()); return this; } + */ + + /** @since 1.5 */ + /* + * public PrintStream printf(String format, Object... args) { return this; + * //format(format, args); } + */ + + /** @since 1.5 */ + /* + * public PrintStream printf(Locale locale, String format, Object... args) { + * return format(locale, format, args); } + */ + + /** @since 1.5 */ + /* + * public PrintStream format(String format, Object... args) { return this; + * //format(Locale.getDefault(), format, args); } + */ + + /** @since 1.5 */ + /* + * public PrintStream format(Locale locale, String format, Object... args) { + * Formatter f = new Formatter(this, locale); f.format(format, args); return + * this; } + */ +} // class PrintStream diff --git a/Robust/src/ClassLibrary/SSJavaInfer/PushbackInputStream.java b/Robust/src/ClassLibrary/SSJavaInfer/PushbackInputStream.java new file mode 100644 index 00000000..103c2da0 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/PushbackInputStream.java @@ -0,0 +1,338 @@ +/* PushbackInputStream.java -- An input stream that can unread bytes + Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.io; + +/** + * This subclass of FilterInputStream provides the ability to + * unread data from a stream. It maintains an internal buffer of unread data + * that is supplied to the next read operation. This is conceptually similar to + * mark/reset functionality, except that in this case the position to reset the + * stream to does not need to be known in advance. + *

+ * The default pushback buffer size one byte, but this can be overridden by the + * creator of the stream. + *

+ * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy (warrenl@cygnus.com) + */ + +public class PushbackInputStream extends FilterInputStream { + /** + * This is the default buffer size + */ + + private static final int DEFAULT_BUFFER_SIZE = 1; + + /** + * This is the buffer that is used to store the pushed back data + */ + + protected byte[] buf; + + /** + * This is the position in the buffer from which the next byte will be read. + * Bytes are stored in reverse order in the buffer, starting from + * buf[buf.length - 1] to buf[0]. Thus when + * pos is 0 the buffer is full and buf.length when + * it is empty + */ + + protected int pos; + + /** + * This method initializes a PushbackInputStream to read from the + * specified subordinate InputStream with a default pushback + * buffer size of 1. + * + * @param in + * The subordinate stream to read from + */ + public PushbackInputStream(InputStream in) { + this(in, DEFAULT_BUFFER_SIZE); + } + + /** + * This method initializes a PushbackInputStream to read from the + * specified subordinate InputStream with the specified buffer + * size + * + * @param in + * The subordinate InputStream to read from + * @param size + * The pushback buffer size to use + */ + public PushbackInputStream(InputStream in, int size) { + super(in); + if (size < 0) + throw new IllegalArgumentException(); + buf = new byte[size]; + pos = buf.length; + } + + /** + * This method returns the number of bytes that can be read from this stream + * before a read can block. A return of 0 indicates that blocking might (or + * might not) occur on the very next read attempt. + *

+ * This method will return the number of bytes available from the pushback + * buffer plus the number of bytes available from the underlying stream. + * + * @return The number of bytes that can be read before blocking could occur + * + * @exception IOException + * If an error occurs + */ + public int available() throws IOException { + try { + return (buf.length - pos) + super.available(); + } catch (NullPointerException npe) { + throw new IOException("Stream closed"); + } + } + + /** + * This method closes the stream and releases any associated resources. + * + * @exception IOException + * If an error occurs. + */ + public synchronized void close() throws IOException { + buf = null; + super.close(); + } + + /** + * This method returns false to indicate that it does not support + * mark/reset functionality. + * + * @return This method returns false to indicate that this class + * does not support mark/reset functionality + */ + public boolean markSupported() { + return false; + } + + /** + * This method always throws an IOException in this class because mark/reset + * functionality is not supported. + * + * @exception IOException + * Always thrown for this class + */ + public void reset() throws IOException { + throw new IOException("Mark not supported in this class"); + } + + /** + * This method reads an unsigned byte from the input stream and returns it as + * an int in the range of 0-255. This method also will return -1 if the end of + * the stream has been reached. The byte returned will be read from the + * pushback buffer, unless the buffer is empty, in which case the byte will be + * read from the underlying stream. + *

+ * This method will block until the byte can be read. + * + * @return The byte read or -1 if end of stream + * + * @exception IOException + * If an error occurs + */ + public synchronized int read() throws IOException { + if (pos < buf.length) + return ((int) buf[pos++]) & 0xFF; + + return super.read(); + } + + /** + * This method read bytes from a stream and stores them into a caller supplied + * buffer. It starts storing the data at index offset into the + * buffer and attempts to read len bytes. This method can return + * before reading the number of bytes requested. The actual number of bytes + * read is returned as an int. A -1 is returned to indicate the end of the + * stream. + *

+ * This method will block until some data can be read. + *

+ * This method first reads bytes from the pushback buffer in order to satisfy + * the read request. If the pushback buffer cannot provide all of the bytes + * requested, the remaining bytes are read from the underlying stream. + * + * @param b + * The array into which the bytes read should be stored + * @param off + * The offset into the array to start storing bytes + * @param len + * The requested number of bytes to read + * + * @return The actual number of bytes read, or -1 if end of stream. + * + * @exception IOException + * If an error occurs. + */ + + public synchronized int read(byte[] b, int off, int len) throws IOException { + int numBytes = Math.min(buf.length - pos, len); + + if (numBytes > 0) { + + System.arraycopy(buf, pos, b, off, numBytes); + pos += numBytes; + len -= numBytes; + off += numBytes; + } + + if (len > 0) { + len = super.read(b, off, len); + if (len == -1) // EOF + return numBytes > 0 ? numBytes : -1; + numBytes += len; + } + return numBytes; + } + + /** + * This method pushes a single byte of data into the pushback buffer. The byte + * pushed back is the one that will be returned as the first byte of the next + * read. + *

+ * If the pushback buffer is full, this method throws an exception. + *

+ * The argument to this method is an int. Only the low eight bits + * of this value are pushed back. + * + * @param b + * The byte to be pushed back, passed as an int + * + * @exception IOException + * If the pushback buffer is full. + */ + public synchronized void unread(int b) throws IOException { + if (pos <= 0) + throw new IOException("Insufficient space in pushback buffer"); + + buf[--pos] = (byte) b; + } + + /** + * This method pushes all of the bytes in the passed byte array into the + * pushback bfer. These bytes are pushed in reverse order so that the next + * byte read from the stream after this operation will be b[0] + * followed by b[1], etc. + *

+ * If the pushback buffer cannot hold all of the requested bytes, an exception + * is thrown. + * + * @param b + * The byte array to be pushed back + * + * @exception IOException + * If the pushback buffer is full + */ + public synchronized void unread(byte[] b) throws IOException { + unread(b, 0, b.length); + } + + /** + * This method pushed back bytes from the passed in array into the pushback + * buffer. The bytes from b[offset] to + * b[offset + len] are pushed in reverse order so that the next + * byte read from the stream after this operation will be + * b[offset] followed by b[offset + 1], etc. + *

+ * If the pushback buffer cannot hold all of the requested bytes, an exception + * is thrown. + * + * @param b + * The byte array to be pushed back + * @param off + * The index into the array where the bytes to be push start + * @param len + * The number of bytes to be pushed. + * + * @exception IOException + * If the pushback buffer is full + */ + public synchronized void unread(byte[] b, int off, int len) throws IOException { + if (pos < len) + throw new IOException("Insufficient space in pushback buffer"); + + // Note the order that these bytes are being added is the opposite + // of what would be done if they were added to the buffer one at a time. + // See the Java Class Libraries book p. 1390. + System.arraycopy(b, off, buf, pos - len, len); + + // Don't put this into the arraycopy above, an exception might be thrown + // and in that case we don't want to modify pos. + pos -= len; + } + + /** + * This method skips the specified number of bytes in the stream. It returns + * the actual number of bytes skipped, which may be less than the requested + * amount. + *

+ * This method first discards bytes from the buffer, then calls the + * skip method on the underlying InputStream to skip + * additional bytes if necessary. + * + * @param n + * The requested number of bytes to skip + * + * @return The actual number of bytes skipped. + * + * @exception IOException + * If an error occurs + * + * @since 1.2 + */ + public synchronized long skip(long n) throws IOException { + final long origN = n; + + if (n > 0L) { + int numread = (int) Math.min((long) (buf.length - pos), n); + pos += numread; + n -= numread; + if (n > 0) + n -= super.skip(n); + } + + return origN - n; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Random.java b/Robust/src/ClassLibrary/SSJavaInfer/Random.java new file mode 100644 index 00000000..d9a34220 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Random.java @@ -0,0 +1,405 @@ +/* Random.java -- a pseudo-random number generator + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + +/** + * This class generates pseudorandom numbers. It uses the same algorithm as the + * original JDK-class, so that your programs behave exactly the same way, if + * started with the same seed. + * + * The algorithm is described in The Art of Computer Programming, + * Volume 2 by Donald Knuth in Section 3.2.1. It is a 48-bit seed, linear + * congruential formula. + * + * If two instances of this class are created with the same seed and the same + * calls to these classes are made, they behave exactly the same way. This + * should be even true for foreign implementations (like this), so every port + * must use the same algorithm as described here. + * + * If you want to implement your own pseudorandom algorithm, you should extend + * this class and overload the next() and + * setSeed(long) method. In that case the above paragraph doesn't + * apply to you. + * + * This class shouldn't be used for security sensitive purposes (like generating + * passwords or encryption keys. See SecureRandom in package + * java.security for this purpose. + * + * For simple random doubles between 0.0 and 1.0, you may consider using + * Math.random instead. + * + * @see java.security.SecureRandom + * @see Math#random() + * @author Jochen Hoenicke + * @author Eric Blake (ebb9@email.byu.edu) + * @status updated to 1.4 + */ + +public class Random { + /** + * True if the next nextGaussian is available. This is used by nextGaussian, + * which generates two gaussian numbers by one call, and returns the second on + * the second call. + * + * @serial whether nextNextGaussian is available + * @see #nextGaussian() + * @see #nextNextGaussian + */ + + private boolean haveNextNextGaussian; + + /** + * The next nextGaussian, when available. This is used by nextGaussian, which + * generates two gaussian numbers by one call, and returns the second on the + * second call. + * + * @serial the second gaussian of a pair + * @see #nextGaussian() + * @see #haveNextNextGaussian + */ + + private double nextNextGaussian; + + /** + * The seed. This is the number set by setSeed and which is used in next. + * + * @serial the internal state of this generator + * @see #next(int) + */ + + private long seed; + + /** + * Creates a new pseudorandom number generator. The seed is initialized to the + * current time, as if by setSeed(System.currentTimeMillis());. + * + * @see System#currentTimeMillis() + */ + public Random() { + setSeed(System.currentTimeMillis()); + } + + /** + * Creates a new pseudorandom number generator, starting with the specified + * seed, using setSeed(seed);. + * + * @param seed + * the initial seed + */ + public Random(long seed) { + setSeed(seed); + } + + /** + * Sets the seed for this pseudorandom number generator. As described above, + * two instances of the same random class, starting with the same seed, should + * produce the same results, if the same methods are called. The + * implementation for java.util.Random is: + * + *

+   * public synchronized void setSeed(long seed) {
+   *   this.seed = (seed ˆ 0x5DEECE66DL) & ((1L << 48) - 1);
+   *   haveNextNextGaussian = false;
+   * }
+   * 
+ * + * @param seed + * the new seed + */ + public synchronized void setSeed(long seed) { + this.seed = (seed ^ 0x5DEECE66DL) & ((1L << 48) - 1); + haveNextNextGaussian = false; + } + + /** + * Generates the next pseudorandom number. This returns an int value whose + * bits low order bits are independent chosen random bits (0 and + * 1 are equally likely). The implementation for java.util.Random is: + * + *
+   * protected synchronized int next(int bits) {
+   *   seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
+   *   return (int) (seed >>> (48 - bits));
+   * }
+   * 
+ * + * @param bits + * the number of random bits to generate, in the range 1..32 + * @return the next pseudorandom value + * @since 1.1 + */ + protected synchronized int next(int bits) { + seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); + return (int) (seed >>> (48 - bits)); + } + + /** + * Fills an array of bytes with random numbers. All possible values are + * (approximately) equally likely. The JDK documentation gives no + * implementation, but it seems to be: + * + *
+   * public void nextBytes(byte[] bytes)
+   *      {
+   *      for (int i = 0; i < bytes.length; i += 4)
+   *      {
+   *      int random = next(32);
+   *      for (int j = 0; i + j < bytes.length && j < 4; j++)
+   *      {
+   *       bytes[i+j] = (byte) (random & 0xff)
+   *       random >>= 8;
+   *      }
+   *      }
+   *      }
+   * 
+ * + * @param bytes + * the byte array that should be filled + * @throws NullPointerException + * if bytes is null + * @since 1.1 + */ + public void nextBytes(byte[] bytes) { + int random; + // Do a little bit unrolling of the above algorithm. + int max = bytes.length & ~0x3; + for (int i = 0; i < max; i += 4) { + random = next(32); + bytes[i] = (byte) random; + bytes[i + 1] = (byte) (random >> 8); + bytes[i + 2] = (byte) (random >> 16); + bytes[i + 3] = (byte) (random >> 24); + } + if (max < bytes.length) { + random = next(32); + for (int j = max; j < bytes.length; j++) { + bytes[j] = (byte) random; + random >>= 8; + } + } + } + + /** + * Generates the next pseudorandom number. This returns an int value whose 32 + * bits are independent chosen random bits (0 and 1 are equally likely). The + * implementation for java.util.Random is: + * + *
+   * public int nextInt() {
+   *   return next(32);
+   * }
+   * 
+ * + * @return the next pseudorandom value + */ + public int nextInt() { + return next(32); + } + + /** + * Generates the next pseudorandom number. This returns a value between + * 0(inclusive) and n(exclusive), and each value has the same + * likelihodd (1/n). (0 and 1 are equally likely). The + * implementation for java.util.Random is: + * + *
+   * public int nextInt(int n) {
+   *   if (n <= 0)
+   *     throw new IllegalArgumentException("n must be positive");
+   * 
+   *   if ((n & -n) == n) // i.e., n is a power of 2
+   *     return (int) ((n * (long) next(31)) >> 31);
+   * 
+   *   int bits, val;
+   *   do {
+   *     bits = next(31);
+   *     val = bits % n;
+   *   } while (bits - val + (n - 1) < 0);
+   * 
+   *   return val;
+   * }
+   * 
+ * + *

+ * This algorithm would return every value with exactly the same probability, + * if the next()-method would be a perfect random number generator. + * + * The loop at the bottom only accepts a value, if the random number was + * between 0 and the highest number less then 1<<31, which is divisible by n. + * The probability for this is high for small n, and the worst case is 1/2 + * (for n=(1<<30)+1). + * + * The special treatment for n = power of 2, selects the high bits of the + * random number (the loop at the bottom would select the low order bits). + * This is done, because the low order bits of linear congruential number + * generators (like the one used in this class) are known to be ``less + * random'' than the high order bits. + * + * @param n + * the upper bound + * @throws IllegalArgumentException + * if the given upper bound is negative + * @return the next pseudorandom value + * @since 1.2 + */ + public int nextInt(int n) { + if (n <= 0) + System.printString("ERROR: n must be positive\n"); + if ((n & -n) == n) // i.e., n is a power of 2 + return (int) ((n * (long) next(31)) >> 31); + int bits, val; + do { + bits = next(31); + val = bits % n; + } while (bits - val + (n - 1) < 0); + return val; + } + + /** + * Generates the next pseudorandom long number. All bits of this long are + * independently chosen and 0 and 1 have equal likelihood. The implementation + * for java.util.Random is: + * + *

+   * public long nextLong() {
+   *   return ((long) next(32) << 32) + next(32);
+   * }
+   * 
+ * + * @return the next pseudorandom value + */ + public long nextLong() { + return ((long) next(32) << 32) + next(32); + } + + /** + * Generates the next pseudorandom boolean. True and false have the same + * probability. The implementation is: + * + *
+   * public boolean nextBoolean() {
+   *   return next(1) != 0;
+   * }
+   * 
+ * + * @return the next pseudorandom boolean + * @since 1.2 + */ + public boolean nextBoolean() { + return next(1) != 0; + } + + /** + * Generates the next pseudorandom float uniformly distributed between 0.0f + * (inclusive) and 1.0f (exclusive). The implementation is as follows. + * + *
+   * public float nextFloat() {
+   *   return next(24) / ((float) (1 << 24));
+   * }
+   * 
+ * + * @return the next pseudorandom float + */ + public float nextFloat() { + return next(24) / (float) (1 << 24); + } + + /** + * Generates the next pseudorandom double uniformly distributed between 0.0 + * (inclusive) and 1.0 (exclusive). The implementation is as follows. + * + *
+   * public double nextDouble() {
+   *   return (((long) next(26) << 27) + next(27)) / (double) (1L << 53);
+   * }
+   * 
+ * + * @return the next pseudorandom double + */ + public double nextDouble() { + return (((long) next(26) << 27) + next(27)) / (double) (1L << 53); + } + + /** + * Generates the next pseudorandom, Gaussian (normally) distributed double + * value, with mean 0.0 and standard deviation 1.0. The algorithm is as + * follows. + * + *
+   * public synchronized double nextGaussian() {
+   *   if (haveNextNextGaussian) {
+   *     haveNextNextGaussian = false;
+   *     return nextNextGaussian;
+   *   } else {
+   *     double v1, v2, s;
+   *     do {
+   *       v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0
+   *       v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0
+   *       s = v1 * v1 + v2 * v2;
+   *     } while (s >= 1);
+   * 
+   *     double norm = Math.sqrt(-2 * Math.log(s) / s);
+   *     nextNextGaussian = v2 * norm;
+   *     haveNextNextGaussian = true;
+   *     return v1 * norm;
+   *   }
+   * }
+   * 
+ * + *

+ * This is described in section 3.4.1 of The Art of Computer + * Programming, Volume 2 by Donald Knuth. + * + * @return the next pseudorandom Gaussian distributed double + */ + public synchronized double nextGaussian() { + if (haveNextNextGaussian) { + haveNextNextGaussian = false; + return nextNextGaussian; + } + double v1, v2, s; + do { + v1 = 2 * nextDouble() - 1; // Between -1.0 and 1.0. + v2 = 2 * nextDouble() - 1; // Between -1.0 and 1.0. + s = v1 * v1 + v2 * v2; + } while (s >= 1); + double norm = Math.sqrt(-2 * Math.log(s) / s); + nextNextGaussian = v2 * norm; + haveNextNextGaussian = true; + return v1 * norm; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/SSJAVA.java b/Robust/src/ClassLibrary/SSJavaInfer/SSJAVA.java new file mode 100644 index 00000000..0fe1de15 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/SSJAVA.java @@ -0,0 +1,69 @@ +import Benchmarks.SSJava.EyeTracking.LOC; + +public class SSJAVA { + + // Definitely written analysis assumes that the first parameter may have write + // effects through the below methods + + static void arrayinit(float array[], float value) { + for (int i = 0; i < array.length; i++) { + array[i] = value; + } + } + + static void arrayinit(int array[], int value) { + for (int i = 0; i < array.length; i++) { + array[i] = value; + } + } + + static void arrayinit(float array[][][], int size_1, int size_2, int size_3, float value) { + + for (int idx1 = 0; idx1 < size_1; idx1++) { + if (array[idx1].length != size_2) { + throw new Error("Array initilizatiion failed to assign to all of elements."); + } + for (int idx2 = 0; idx2 < size_2; idx2++) { + if (array[idx1][idx2].length != size_3) { + throw new Error("Array initilizatiion failed to assign to all of elements."); + } + for (int idx3 = 0; idx3 < size_3; idx3++) { + array[idx1][idx2][idx3] = value; + } + } + } + } + + static void arrayinit(float array[][], int size_1, int size_2, float value) { + + for (int idx1 = 0; idx1 < size_1; idx1++) { + if (array[idx1].length != size_2) { + throw new Error("Array initilizatiion failed to assign to all of elements."); + } + for (int idx2 = 0; idx2 < size_2; idx2++) { + array[idx1][idx2] = value; + } + } + } + + static void arraycopy(float array[][], float src[][], int size_1, int size_2) { + + for (int idx1 = 0; idx1 < size_1; idx1++) { + if (array[idx1].length != size_2 || src[idx1].length != size_2) { + throw new Error("Array initilizatiion failed to assign to all of elements."); + } + for (int idx2 = 0; idx2 < size_2; idx2++) { + array[idx1][idx2] = src[idx1][idx2]; + } + } + } + + static void append(Object array[], Object item) { + for (int i = 1; i < array.length; i++) { + array[i - 1] = array[i]; + array[i] = null; + } + array[array.length - 1] = item; + } + +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/String.java b/Robust/src/ClassLibrary/SSJavaInfer/String.java new file mode 100644 index 00000000..e2b6d7e4 --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/String.java @@ -0,0 +1,521 @@ +import Vector; + +public class String { + + char value[]; + + int count; + + int offset; + + private int cachedHashcode; + + private String() { + } + + public String(char c) { + char[] str = new char[1]; + str[0] = c; + String(str); + } + + public String(char str[]) { + char charstr[] = new char[str.length]; + for (int i = 0; i < str.length; i++) + charstr[i] = str[i]; + this.value = charstr; + this.count = str.length; + this.offset = 0; + } + + public String(byte str[]) { + char charstr[] = new char[str.length]; + for (int i = 0; i < str.length; i++) + charstr[i] = (char) str[i]; + this.value = charstr; + this.count = str.length; + this.offset = 0; + } + + public String(byte str[], int offset, int length) { + if (length > (str.length - offset)) + length = str.length - offset; + char charstr[] = new char[length]; + for (int i = 0; i < length; i++) + charstr[i] = (char) str[i + offset]; + this.value = charstr; + this.count = length; + this.offset = 0; + } + + public String(byte str[], String encoding) { + int length = this.count; + if (length > (str.length)) + length = str.length; + char charstr[] = new char[length]; + for (int i = 0; i < length; i++) + charstr[i] = (char) str[i]; + this.value = charstr; + this.count = length; + this.offset = 0; + } + + public String(char str[], int offset, int length) { + if (length > (str.length - offset)) + length = str.length - offset; + char charstr[] = new char[length]; + for (int i = 0; i < length; i++) + charstr[i] = str[i + offset]; + this.value = charstr; + this.count = length; + this.offset = 0; + } + + public String(String str) { + this.value = str.value; + this.count = str.count; + this.offset = str.offset; + } + + public String(StringBuffer strbuf) { + value = new char[strbuf.length()]; + count = strbuf.length(); + offset = 0; + for (int i = 0; i < count; i++) + value[i] = strbuf.value[i]; + } + + public boolean endsWith(String suffix) { + return regionMatches(count - suffix.count, suffix, 0, suffix.count); + } + + public String substring(int beginIndex) { + return substring(beginIndex, this.count); + } + + public String subString(int beginIndex, int endIndex) { + return substring(beginIndex, endIndex); + } + + public String substring(int beginIndex, int endIndex) { + String str = new String(); + if (beginIndex > this.count || endIndex > this.count || beginIndex > endIndex) { + // FIXME + System.printString("Index error: " + beginIndex + " " + endIndex + " " + count + "\n" + this); + } + str.value = this.value; + str.count = endIndex - beginIndex; + str.offset = this.offset + beginIndex; + return str; + } + + public String subString(int beginIndex) { + return this.subString(beginIndex, this.count); + } + + public int lastindexOf(int ch) { + return this.lastindexOf(ch, count - 1); + } + + public int lastIndexOf(char ch) { + return this.lastindexOf((int) ch, count - 1); + } + + public static String concat2(String s1, String s2) { + if (s1 == null) + return "null".concat(s2); + else + return s1.concat(s2); + } + + public String concat(String str) { + String newstr = new String(); + newstr.count = this.count + str.count; + char charstr[] = new char[newstr.count]; + newstr.offset = 0; + for (int i = 0; i < count; i++) { + charstr[i] = value[i + offset]; + } + for (int i = 0; i < str.count; i++) { + charstr[i + count] = str.value[i + str.offset]; + } + newstr.value = charstr; + return newstr; + } + + public int lastindexOf(int ch, int fromIndex) { + for (int i = fromIndex; i > 0; i--) + if (this.charAt(i) == ch) + return i; + return -1; + } + + public String replace(char oldch, char newch) { + char[] buffer = new char[count]; + for (int i = 0; i < count; i++) { + char x = charAt(i); + if (x == oldch) + x = newch; + buffer[i] = x; + } + return new String(buffer); + } + + public String toUpperCase() { + char[] buffer = new char[count]; + for (int i = 0; i < count; i++) { + char x = charAt(i); + if (x >= 'a' && x <= 'z') { + x = (char) ((x - 'a') + 'A'); + } + buffer[i] = x; + } + return new String(buffer); + } + + public String toLowerCase() { + char[] buffer = new char[count]; + for (int i = 0; i < count; i++) { + char x = charAt(i); + if (x >= 'A' && x <= 'Z') { + x = (char) ((x - 'A') + 'a'); + } + buffer[i] = x; + } + return new String(buffer); + } + + public int indexOf(int ch) { + return this.indexOf(ch, 0); + } + + public int indexOf(int ch, int fromIndex) { + for (int i = fromIndex; i < count; i++) + if (this.charAt(i) == ch) + return i; + return -1; + } + + public int indexOf(String str) { + return this.indexOf(str, 0); + } + + public int indexOf(String str, int fromIndex) { + if (fromIndex < 0) + fromIndex = 0; + for (int i = fromIndex; i <= (count - str.count); i++) + if (regionMatches(i, str, 0, str.count)) + return i; + return -1; + } + + public int indexOfIgnoreCase(String str, int fromIndex) { + if (fromIndex < 0) + fromIndex = 0; + } + + public int lastIndexOf(String str, int fromIndex) { + int k = count - str.count; + if (k > fromIndex) + k = fromIndex; + for (; k >= 0; k--) { + if (regionMatches(k, str, 0, str.count)) + return k; + } + return -1; + } + + public int lastIndexOf(String str) { + return lastIndexOf(str, count - str.count); + } + + public boolean startsWith(String str) { + return regionMatches(0, str, 0, str.count); + } + + public boolean startsWith(String str, int toffset) { + return regionMatches(toffset, str, 0, str.count); + } + + public boolean regionMatches(int toffset, String other, int ooffset, int len) { + if (toffset < 0 || ooffset < 0 || (toffset + len) > count || (ooffset + len) > other.count) + return false; + for (int i = 0; i < len; i++) + if (other.value[i + other.offset + ooffset] != this.value[i + this.offset + toffset]) + return false; + return true; + } + + public char[] toCharArray() { + char str[] = new char[count]; + for (int i = 0; i < count; i++) + str[i] = value[i + offset]; + return str; + } + + public byte[] getBytes() { + byte str[] = new byte[count]; + for (int i = 0; i < count; i++) + str[i] = (byte) value[i + offset]; + return str; + } + + public void getChars(char dst[], int dstBegin) { + getChars(0, count, dst, dstBegin); + } + + public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin) { + if ((srcBegin < 0) || (srcEnd > count) || (srcBegin > srcEnd)) { + // FIXME + System.printString("Index error: " + srcBegin + " " + srcEnd + " " + count + "\n" + this); + System.exit(-1); + } + int len = srcEnd - srcBegin; + int j = dstBegin; + for (int i = srcBegin; i < srcEnd; i++) + dst[j++] = value[i + offset]; + return; + } + + public int length() { + return count; + } + + public char charAt(int i) { + return value[i + offset]; + } + + public String toString() { + return this; + } + + public static String valueOf(Object o) { + if (o == null) + return "null"; + else + return o.toString(); + } + + public static String valueOf(boolean b) { + if (b) + return new String("true"); + else + return new String("false"); + } + + public static String valueOf(char c) { + char ar[] = new char[1]; + ar[0] = c; + return new String(ar); + } + + public static String valueOf(int x) { + int length = 0; + int tmp; + if (x < 0) + tmp = -x; + else + tmp = x; + TERMINATE: do { + tmp = tmp / 10; + length = length + 1; + } while (tmp != 0); + + char chararray[]; + if (x < 0) + chararray = new char[length + 1]; + else + chararray = new char[length]; + int voffset; + if (x < 0) { + chararray[0] = '-'; + voffset = 1; + x = -x; + } else + voffset = 0; + + TERMINATE: do { + chararray[--length + voffset] = (char) (x % 10 + '0'); + x = x / 10; + } while (length != 0); + return new String(chararray); + } + + public static String valueOf(double val) { + char[] chararray = new char[20]; + String s = new String(); + s.offset = 0; + s.count = convertdoubletochar(val, chararray); + s.value = chararray; + return s; + } + + public static native int convertdoubletochar(double val, char[] chararray); + + public static String valueOf(long x) { + int length = 0; + long tmp; + if (x < 0) + tmp = -x; + else + tmp = x; + + TERMINATE: do { + tmp = tmp / 10; + length = length + 1; + } while (tmp != 0); + + char chararray[]; + if (x < 0) + chararray = new char[length + 1]; + else + chararray = new char[length]; + int voffset; + if (x < 0) { + chararray[0] = '-'; + voffset = 1; + x = -x; + } else + voffset = 0; + + TERMINATE: do { + chararray[--length + voffset] = (char) (x % 10 + '0'); + x = x / 10; + } while (length != 0); + return new String(chararray); + } + + public int compareTo(String s) { + int smallerlength = count < s.count ? count : s.count; + + for (int i = 0; i < smallerlength; i++) { + int valDiff = this.charAt(i) - s.charAt(i); + if (valDiff != 0) { + return valDiff; + } + } + return count - s.count; + } + + public int hashCode() { + if (cachedHashcode != 0) + return cachedHashcode; + int hashcode = 0; + for (int i = 0; i < count; i++) + hashcode = hashcode * 31 + value[i + offset]; + cachedHashcode = hashcode; + return hashcode; + } + + public boolean equals(Object o) { + if (o.getType() != getType()) + return false; + String s = (String) o; + if (s.count != count) + return false; + for (int i = 0; i < count; i++) { + if (s.value[i + s.offset] != value[i + offset]) + return false; + } + return true; + } + + public boolean equalsIgnoreCase(String s) { + if (s.count != count) + return false; + for (int i = 0; i < count; i++) { + char l = s.value[i + s.offset]; + char r = value[i + offset]; + if (l >= 'a' && l <= 'z') + l = (char) ((l - 'a') + 'A'); + if (r >= 'a' && r <= 'z') + r = (char) ((r - 'a') + 'A'); + if (l != r) + return false; + } + return true; + } + + public Vector split() { + Vector splitted = new Vector(); + int i; + int cnt = 0; + + // skip first spaces + for (i = 0; i < count; i++) { + if (value[i + offset] != '\n' && value[i + offset] != '\t' && value[i + offset] != ' ') + break; + } + + int oldi = i; + + while (i < count) { + if (value[i + offset] == '\n' || value[i + offset] == '\t' || value[i + offset] == ' ') { + String t = new String(); + t.value = value; + t.offset = oldi; + t.count = i - oldi; + splitted.addElement(t); + + // skip extra spaces + while (i < count && (value[i + offset] == '\n' || value[i + offset] == '\t' || value[i + offset] == ' ')) { + i++; + } + oldi = i; + } else { + i++; + } + } + + if (i != oldi) { + String t = new String(); + t.value = value; + t.offset = oldi; + t.count = i - oldi; + splitted.addElement(t); + } + + return splitted; + } + + public boolean contains(String str) { + int i, j; + char[] strChar = str.toCharArray(); + int cnt; + + for (i = 0; i < count; i++) { + if (value[i] == strChar[0]) { + cnt = 0; + for (j = 0; j < str.length() && i + j < count; j++) { + if (value[i + j] == strChar[j]) + cnt++; + } + if (cnt == str.length()) + return true; + } + } + + return false; + + } + + public String trim() { + int len = count; + int st = 0; + int off = offset; /* avoid getfield opcode */ + char[] val = value; /* avoid getfield opcode */ + + while ((st < len) && (val[off + st] <= ' ')) { + st++; + } + while ((st < len) && (val[off + len - 1] <= ' ')) { + len--; + } + return ((st > 0) || (len < count)) ? substring(st, len) : this; + } + + public boolean matches(String regex) { + System.println("String.matches() is not fully supported"); + return this.equals(regex); + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/StringBuffer.java b/Robust/src/ClassLibrary/SSJavaInfer/StringBuffer.java new file mode 100644 index 00000000..c683bf1f --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/StringBuffer.java @@ -0,0 +1,149 @@ + +public class StringBuffer { + + char value[]; + + int count; + + // private static final int DEFAULTSIZE=16; + + public StringBuffer(String str) { + value = new char[str.count + 16]; // 16 is DEFAULTSIZE + count = str.count; + for (int i = 0; i < count; i++) + value[i] = str.value[i + str.offset]; + } + + public StringBuffer() { + value = new char[16]; // 16 is DEFAULTSIZE + count = 0; + } + + public StringBuffer(int i) { + value = new char[i]; + count = 0; + } + + public int length() { + return count; + } + + public int capacity() { + return value.length; + } + + public char charAt(int x) { + return value[x]; + } + + public StringBuffer append(char c) { + String str = String.valueOf(c); + return append(str); + } + + public StringBuffer append(String s) { + if ((s.count + count) > value.length) { + // Need to allocate + char newvalue[] = new char[s.count + count + 16]; // 16 + // is + // DEFAULTSIZE + for (int i = 0; i < count; i++) + newvalue[i] = value[i]; + for (int i = 0; i < s.count; i++) + newvalue[i + count] = s.value[i + s.offset]; + value = newvalue; + count += s.count; + } else { + for (int i = 0; i < s.count; i++) { + value[i + count] = s.value[i + s.offset]; + } + count += s.count; + } + return this; + } + + public void ensureCapacity(int i) { + int size = 2 * count; + if (i > size) + size = i; + if (i > value.length) { + char newvalue[] = new char[i]; + for (int ii = 0; ii < count; ii++) + newvalue[ii] = value[ii]; + value = newvalue; + } + } + + public StringBuffer append(StringBuffer s) { + if ((s.count + count) > value.length) { + // Need to allocate + char newvalue[] = new char[s.count + count + 16]; // 16 is DEFAULTSIZE + for (int i = 0; i < count; i++) + newvalue[i] = value[i]; + for (int i = 0; i < s.count; i++) + newvalue[i + count] = s.value[i]; + value = newvalue; + count += s.count; + } else { + for (int i = 0; i < s.count; i++) { + value[i + count] = s.value[i]; + } + count += s.count; + } + return this; + } + + public int indexOf(String str) { + return indexOf(str, 0); + } + + public synchronized int indexOf(String str, int fromIndex) { + String vstr = new String(value, 0, count); + return vstr.indexOf(str, fromIndex); + } + + public String toString() { + return new String(this); + } + + public synchronized StringBuffer replace(int start, int end, String str) { + if (start < 0) { + // FIXME + System.printString("StringIndexOutOfBoundsException: " + start + "\n"); + } + if (start > count) { + // FIXME + System.printString("StringIndexOutOfBoundsException: start > length()\n"); + } + if (start > end) { + // FIXME + System.printString("StringIndexOutOfBoundsException: start > end\n"); + } + if (end > count) + end = count; + + if (end > count) + end = count; + int len = str.length(); + int newCount = count + len - (end - start); + if (newCount > value.length) + expandCapacity(newCount); + + System.arraycopy(value, end, value, start + len, count - end); + str.getChars(value, start); + count = newCount; + return this; + } + + void expandCapacity(int minimumCapacity) { + int newCapacity = (value.length + 1) * 2; + if (newCapacity < 0) { + newCapacity = 0x7fffffff /* Integer.MAX_VALUE */; + } else if (minimumCapacity > newCapacity) { + newCapacity = minimumCapacity; + } + char newValue[] = new char[newCapacity]; + System.arraycopy(value, 0, newValue, 0, count); + value = newValue; + } +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/System.java b/Robust/src/ClassLibrary/SSJavaInfer/System.java new file mode 100644 index 00000000..3b4f5c9c --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/System.java @@ -0,0 +1,91 @@ + +public class System { + public static void printInt(int x) { + String s = String.valueOf(x); + printString(s); + } + + public static native void gc(); + + public static native long currentTimeMillis(); + + public static native long microTimes(); + + public static native long getticks(); + + public static native void printString(String s); + + public static void println(String s) { + System.printString(s + "\n"); + } + + public static void println(int o) { + System.printString("" + o + "\n"); + } + + public static void println(double o) { + System.printString("" + o + "\n"); + } + + public static void println(long o) { + System.printString("" + o + "\n"); + } + + public static void println() { + System.printString("\n"); + } + + public static void print(String s) { + System.printString(s); + } + + public static void print(Object o) { + System.printString("" + o); + } + + public static void print(int o) { + System.printString("" + o); + } + + public static void print(double o) { + System.printString("" + o); + } + + public static void print(long o) { + System.printString("" + o); + } + + public static void error() { + System + .printString("Error (Use Breakpoint on ___System______error method for more information!)\n"); + } + + public static native void exit(int status); + + public static native void printI(int status); + + public static native void clearPrefetchCache(); + + public static native void rangePrefetch(Object o, short[] offsets); + + public static native void deepArrayCopy(Object dst, Object src); + + public static native void Assert(boolean status); + + /* Only used for microbenchmark testing of SingleTM version */ + public static native void logevent(int event); + + public static native void logevent(); + + /* Only used for microbenchmark testing of SingleTM version */ + public static native void initLog(); + + public static native void flushToFile(int threadid); + + /* Only used for microbenchmark testing of SingleTM version */ + + public static native void arraycopy(Object src, int srcPos, Object dst, int destPos, int length); + + // for disjoint reachability analysis + public static void genReach(); +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Throwable.java b/Robust/src/ClassLibrary/SSJavaInfer/Throwable.java new file mode 100644 index 00000000..cbf042df --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Throwable.java @@ -0,0 +1,509 @@ +/* java.lang.Throwable -- Root class for all Exceptions and Errors + Copyright (C) 1998, 1999, 2002, 2004, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +//package java.lang; + +/*import gnu.classpath.SystemProperties; + + import gnu.java.lang.CPStringBuilder; + + import java.io.PrintStream; + import java.io.PrintWriter; + import java.io.Serializable;*/ + +/** + * Throwable is the superclass of all exceptions that can be raised. + * + *

+ * There are two special cases: {@link Error} and {@link RuntimeException}: + * these two classes (and their subclasses) are considered unchecked exceptions, + * and are either frequent enough or catastrophic enough that you do not need to + * declare them in throws clauses. Everything else is a checked + * exception, and is ususally a subclass of {@link Exception}; these exceptions + * have to be handled or declared. + * + *

+ * Instances of this class are usually created with knowledge of the execution + * context, so that you can get a stack trace of the problem spot in the code. + * Also, since JDK 1.4, Throwables participate in "exception chaining." This + * means that one exception can be caused by another, and preserve the + * information of the original. + * + *

+ * One reason this is useful is to wrap exceptions to conform to an interface. + * For example, it would be bad design to require all levels of a program + * interface to be aware of the low-level exceptions thrown at one level of + * abstraction. Another example is wrapping a checked exception in an unchecked + * one, to communicate that failure occured while still obeying the method + * throws clause of a superclass. + * + *

+ * A cause is assigned in one of two ways; but can only be assigned once in the + * lifetime of the Throwable. There are new constructors added to several + * classes in the exception hierarchy that directly initialize the cause, or you + * can use the initCause method. This second method is especially + * useful if the superclass has not been retrofitted with new constructors:
+ * + *

+ * try {
+ *   lowLevelOp();
+ * } catch (LowLevelException lle) {
+ *   throw (HighLevelException) new HighLevelException().initCause(lle);
+ * }
+ * 
+ * + * Notice the cast in the above example; without it, your method would need a + * throws clase that declared Throwable, defeating the purpose of chainig your + * exceptions. + * + *

+ * By convention, exception classes have two constructors: one with no + * arguments, and one that takes a String for a detail message. Further, classes + * which are likely to be used in an exception chain also provide a constructor + * that takes a Throwable, with or without a detail message string. + * + *

+ * Another 1.4 feature is the StackTrace, a means of reflection that allows the + * program to inspect the context of the exception, and which is serialized, so + * that remote procedure calls can correctly pass exceptions. + * + * @author Brian Jones + * @author John Keiser + * @author Mark Wielaard + * @author Tom Tromey + * @author Eric Blake (ebb9@email.byu.edu) + * @since 1.0 + * @status updated to 1.4 + */ +public class Throwable // implements Serializable +{ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -3042686055658047285L; + + /** + * The detail message. + * + * @serial specific details about the exception, may be null + */ + private final String detailMessage; + + /** + * The cause of the throwable, including null for an unknown or non-chained + * cause. This may only be set once; so the field is set to this + * until initialized. + * + * @serial the cause, or null if unknown, or this if not yet set + * @since 1.4 + */ + private Throwable cause = null;// this; + + /** + * The stack trace, in a serialized form. + * + * @serial the elements of the stack trace; this is non-null, and has no null + * entries + * @since 1.4 + */ + // private StackTraceElement[] stackTrace; + + /** + * Instantiate this Throwable with an empty message. The cause remains + * uninitialized. {@link #fillInStackTrace()} will be called to set up the + * stack trace. + */ + public Throwable() { + // this((String) null); + detailMessage = null; + } + + /** + * Instantiate this Throwable with the given message. The cause remains + * uninitialized. {@link #fillInStackTrace()} will be called to set up the + * stack trace. + * + * @param message + * the message to associate with the Throwable + */ + public Throwable(String message) { + // fillInStackTrace(); + detailMessage = message; + } + + /** + * Instantiate this Throwable with the given message and cause. Note that the + * message is unrelated to the message of the cause. + * {@link #fillInStackTrace()} will be called to set up the stack trace. + * + * @param message + * the message to associate with the Throwable + * @param cause + * the cause, may be null + * @since 1.4 + */ + public Throwable(String message, Throwable cause) { + // this(message); + detailMessage = message; + this.cause = cause; + } + + /** + * Instantiate this Throwable with the given cause. The message is then built + * as cause == null ? null : cause.toString(). + * {@link #fillInStackTrace()} will be called to set up the stack trace. + * + * @param cause + * the cause, may be null + * @since 1.4 + */ + public Throwable(Throwable causem) { + // this(cause == null ? null : cause.toString(), cause); + String message = causem == null ? null : causem.toString(); + detailMessage = message; + this.cause = causem; + } + + /** + * Get the message associated with this Throwable. + * + * @return the error message associated with this Throwable, may be null + */ + public String getMessage() { + return detailMessage; + } + + /** + * Get a localized version of this Throwable's error message. This method must + * be overridden in a subclass of Throwable to actually produce + * locale-specific methods. The Throwable implementation just returns + * getMessage(). + * + * @return a localized version of this error message + * @see #getMessage() + * @since 1.1 + */ + public String getLocalizedMessage() { + return getMessage(); + } + + /** + * Returns the cause of this exception, or null if the cause is not known or + * non-existant. This cause is initialized by the new constructors, or by + * calling initCause. + * + * @return the cause of this Throwable + * @since 1.4 + */ + public Throwable getCause() { + return cause == this ? null : cause; + } + + /** + * Initialize the cause of this Throwable. This may only be called once during + * the object lifetime, including implicitly by chaining constructors. + * + * @param cause + * the cause of this Throwable, may be null + * @return this + * @throws IllegalArgumentException + * if cause is this (a Throwable can't be its own cause!) + * @throws IllegalStateException + * if the cause has already been set + * @since 1.4 + */ + public Throwable initCause(Throwable cause) { + /* + * if (cause == this) throw new IllegalArgumentException(); if (this.cause + * != this) throw new IllegalStateException(); + */ + this.cause = cause; + return this; + } + + /** + * Get a human-readable representation of this Throwable. The detail message + * is retrieved by getLocalizedMessage(). Then, with a null detail message, + * this string is simply the object's class name; otherwise the string is + * getClass().getName() + ": " + message. + * + * @return a human-readable String represting this Throwable + */ + /* + * public String toString() { String msg = getLocalizedMessage(); return + * getClass().getName() + (msg == null ? "" : ": " + msg); } + */ + + /** + * Print a stack trace to the standard error stream. This stream is the + * current contents of System.err. The first line of output is + * the result of {@link #toString()}, and the remaining lines represent the + * data created by {@link #fillInStackTrace()}. While the format is + * unspecified, this implementation uses the suggested format, demonstrated by + * this example:
+ * + *

+   * public class Junk {
+   *   public static void main(String args[]) {
+   *     try {
+   *       a();
+   *     } catch (HighLevelException e) {
+   *       e.printStackTrace();
+   *     }
+   *   }
+   * 
+   *   static void a() throws HighLevelException {
+   *     try {
+   *       b();
+   *     } catch (MidLevelException e) {
+   *       throw new HighLevelException(e);
+   *     }
+   *   }
+   * 
+   *   static void b() throws MidLevelException {
+   *     c();
+   *   }
+   * 
+   *   static void c() throws MidLevelException {
+   *     try {
+   *       d();
+   *     } catch (LowLevelException e) {
+   *       throw new MidLevelException(e);
+   *     }
+   *   }
+   * 
+   *   static void d() throws LowLevelException {
+   *     e();
+   *   }
+   * 
+   *   static void e() throws LowLevelException {
+   *     throw new LowLevelException();
+   *   }
+   * }
+   * 
+   * class HighLevelException extends Exception {
+   *   HighLevelException(Throwable cause) {
+   *     super(cause);
+   *   }
+   * }
+   * 
+   * class MidLevelException extends Exception {
+   *   MidLevelException(Throwable cause) {
+   *     super(cause);
+   *   }
+   * }
+   * 
+   * class LowLevelException extends Exception {
+   * }
+   * 
+ *

+ * + *

+   *  HighLevelException: MidLevelException: LowLevelException
+   *          at Junk.a(Junk.java:13)
+   *          at Junk.main(Junk.java:4)
+   *  Caused by: MidLevelException: LowLevelException
+   *          at Junk.c(Junk.java:23)
+   *          at Junk.b(Junk.java:17)
+   *          at Junk.a(Junk.java:11)
+   *          ... 1 more
+   *  Caused by: LowLevelException
+   *          at Junk.e(Junk.java:30)
+   *          at Junk.d(Junk.java:27)
+   *          at Junk.c(Junk.java:21)
+   *          ... 3 more
+   * 
+ */ + public void printStackTrace() { + // printStackTrace(System.err); + } + + /** + * Print a stack trace to the specified PrintStream. See + * {@link #printStackTrace()} for the sample format. + * + * @param s + * the PrintStream to write the trace to + */ + /* + * public void printStackTrace(PrintStream s) { s.print(stackTraceString()); } + */ + + /** + * Prints the exception, the detailed message and the stack trace associated + * with this Throwable to the given PrintWriter. The actual + * output written is implemention specific. Use the result of + * getStackTrace() when more precise information is needed. + * + *

+ * This implementation first prints a line with the result of this object's + * toString() method.
+ * Then for all elements given by getStackTrace it prints a line + * containing three spaces, the string "at " and the result of calling the + * toString() method on the StackTraceElement + * object. If getStackTrace() returns an empty array it prints a + * line containing three spaces and the string + * "<<No stacktrace available>>".
+ * Then if getCause() doesn't return null it adds a line starting + * with "Caused by: " and the result of calling toString() on the + * cause.
+ * Then for every cause (of a cause, etc) the stacktrace is printed the same + * as for the top level Throwable except that as soon as all the + * remaining stack frames of the cause are the same as the the last stack + * frames of the throwable that the cause is wrapped in then a line starting + * with three spaces and the string "... X more" is printed, where X is the + * number of remaining stackframes. + * + * @param pw + * the PrintWriter to write the trace to + * @since 1.1 + */ + /* + * public void printStackTrace (PrintWriter pw) { + * pw.print(stackTraceString()); } + */ + + /* + * We use inner class to avoid a static initializer in this basic class. + */ + /* + * private static class StaticData { static final String nl = + * SystemProperties.getProperty("line.separator"); } + */ + + // Create whole stack trace in a stringbuffer so we don't have to print + // it line by line. This prevents printing multiple stack traces from + // different threads to get mixed up when written to the same PrintWriter. + /* + * private String stackTraceString() { CPStringBuilder sb = new + * CPStringBuilder(); + * + * // Main stacktrace StackTraceElement[] stack = getStackTrace(); + * stackTraceStringBuffer(sb, this.toString(), stack, 0); + * + * // The cause(s) Throwable cause = getCause(); while (cause != null) { // + * Cause start first line sb.append("Caused by: "); + * + * // Cause stacktrace StackTraceElement[] parentStack = stack; stack = + * cause.getStackTrace(); if (parentStack == null || parentStack.length == 0) + * stackTraceStringBuffer(sb, cause.toString(), stack, 0); else { int equal = + * 0; // Count how many of the last stack frames are equal int frame = + * stack.length-1; int parentFrame = parentStack.length-1; while (frame > 0 && + * parentFrame > 0) { if (stack[frame].equals(parentStack[parentFrame])) { + * equal++; frame--; parentFrame--; } else break; } stackTraceStringBuffer(sb, + * cause.toString(), stack, equal); } cause = cause.getCause(); } + * + * return sb.toString(); } + */ + + // Adds to the given StringBuffer a line containing the name and + // all stacktrace elements minus the last equal ones. + /* + * private static void stackTraceStringBuffer(CPStringBuilder sb, String name, + * StackTraceElement[] stack, int equal) { String nl = StaticData.nl; // + * (finish) first line sb.append(name); sb.append(nl); + * + * // The stacktrace if (stack == null || stack.length == 0) { + * sb.append(" <>"); sb.append(nl); } else { for + * (int i = 0; i < stack.length-equal; i++) { sb.append(" at "); + * sb.append(stack[i] == null ? "<>" : stack[i].toString()); + * sb.append(nl); } if (equal > 0) { sb.append(" ..."); sb.append(equal); + * sb.append(" more"); sb.append(nl); } } } + */ + + /** + * Fill in the stack trace with the current execution stack. + * + * @return this same throwable + * @see #printStackTrace() + */ + /* + * public Throwable fillInStackTrace() { vmState = + * VMThrowable.fillInStackTrace(this); stackTrace = null; // Should be + * regenerated when used. + * + * return this; } + */ + + /** + * Provides access to the information printed in {@link #printStackTrace()}. + * The array is non-null, with no null entries, although the virtual machine + * is allowed to skip stack frames. If the array is not 0-length, then slot 0 + * holds the information on the stack frame where the Throwable was created + * (or at least where fillInStackTrace() was called). + * + * @return an array of stack trace information, as available from the VM + * @since 1.4 + */ + /* + * public StackTraceElement[] getStackTrace() { if (stackTrace == null) if + * (vmState == null) stackTrace = new StackTraceElement[0]; else { stackTrace + * = vmState.getStackTrace(this); vmState = null; // No longer needed } + * + * return stackTrace; } + */ + + /** + * Change the stack trace manually. This method is designed for remote + * procedure calls, which intend to alter the stack trace before or after + * serialization according to the context of the remote call. + *

+ * The contents of the given stacktrace is copied so changes to the original + * array do not change the stack trace elements of this throwable. + * + * @param stackTrace + * the new trace to use + * @throws NullPointerException + * if stackTrace is null or has null elements + * @since 1.4 + */ + /* + * public void setStackTrace(StackTraceElement[] stackTrace) { int i = + * stackTrace.length; StackTraceElement[] st = new StackTraceElement[i]; + * + * while (--i >= 0) { st[i] = stackTrace[i]; if (st[i] == null) throw new + * NullPointerException("Element " + i + " null"); } + * + * this.stackTrace = st; } + */ + + /** + * VM state when fillInStackTrace was called. Used by getStackTrace() to get + * an array of StackTraceElements. Cleared when no longer needed. + */ + // private transient VMThrowable vmState; +} diff --git a/Robust/src/ClassLibrary/SSJavaInfer/Vector.java b/Robust/src/ClassLibrary/SSJavaInfer/Vector.java new file mode 100644 index 00000000..ecf3579c --- /dev/null +++ b/Robust/src/ClassLibrary/SSJavaInfer/Vector.java @@ -0,0 +1,149 @@ +public class Vector { + Object[] array; + int size; + int capacityIncrement; + + public Vector() { + capacityIncrement = 0; + size = 0; + array = new Object[10]; + } + + public Vector(int size) { + capacityIncrement = 0; + this.size = 0; + array = new Object[size]; + } + + // used for internal cloning + private Vector(int size, int capacityIncrement, Object[] array) { + this.size = size; + this.capacityIncrement = capacityIncrement; + this.array = new Object[array.length]; + System.arraycopy(array, 0, this.array, 0, size); + } + + public Vector clone() { + return new Vector(size, capacityIncrement, array); + } + + public boolean isEmpty() { + return size == 0; + } + + public void clear() { + size = 0; + array = new Object[10]; + } + + public int indexOf(Object elem) { + return indexOf(elem, 0); + } + + public int indexOf(Object elem, int index) { + for (int i = index; i < size; i++) { + if (elem.equals(array[i])) + return i; + } + return -1; + } + + public boolean contains(Object e) { + return indexOf(e) != -1; + } + + public boolean remove(Object o) { + int in = indexOf(o); + if (in != -1) { + removeElementAt(in); + return true; + } + + return false; + } + + public Object elementAt(int index) { + if (index < 0 | index >= size) { + System.printString("Illegal Vector.elementAt\n"); + System.exit(-1); + return null; + } + return array[index]; + } + + public void setElementAt(Object obj, int index) { + if (index < size) + array[index] = obj; + else { + System.printString("Illegal Vector.setElementAt\n"); + System.exit(-1); + } + } + + private void ensureCapacity(int minCapacity) { + if (minCapacity > array.length) { + int newsize; + if (capacityIncrement <= 0) + newsize = array.length * 2; + else + newsize = array.length + capacityIncrement; + if (newsize < minCapacity) + newsize = minCapacity; + Object[] newarray = new Object[newsize]; + for (int i = 0; i < size; i++) + newarray[i] = array[i]; + array = newarray; + } + } + + public int size() { + return size; + } + + public Enumeration elements() { + System.printString("Vector.elements not implemented\n"); + System.exit(-1); + } + + public void addElement(Object obj) { + if (size == array.length) { + ensureCapacity(size + 1); + } + array[size++] = obj; + } + + public void insertElementAt(Object obj, int index) { + if (index < 0 || index > size) { + System.printString("Illegal Vector.insertElementAt\n"); + System.exit(-1); + } + + if (size == array.length) { + ensureCapacity(size + 1); + } + size++; + for (int i = size - 1; i > index; --i) { + array[i] = array[i - 1]; + } + array[index] = obj; + } + + public void removeElementAt(int index) { + if (index < 0 || index >= size) { + System.printString("Illegal Vector.removeElementAt\n"); + System.exit(-1); + } + removeElement(array, index, size); + size--; + array[size] = null; + } + + public static native void removeElement(Object[] array, int index, int size); + + public void removeAllElements() { + int s = size; + for (int i = 0; i < s; ++i) { + removeElementAt(0); + } + } +} -- 2.34.1