fi.helsinki.cs.ohtu.mpeg2.audio.mpa
Class QuantizationTables

java.lang.Object
  extended by fi.helsinki.cs.ohtu.mpeg2.audio.mpa.QuantizationTables

public class QuantizationTables
extends java.lang.Object

Contains the tables used to quantize MPEG-1 Layer II audio samples.


Nested Class Summary
private static class QuantizationTables.QLevel
          Represents a quantization level.
static class QuantizationTables.QuantizationTable
          Represents a quantization table for MPEG-1 Layer II audio.
 
Field Summary
private static QuantizationTables.QLevel[] q
          This array contains the 'absolute' quantization levels.
private static java.util.HashMap<java.lang.Integer,QuantizationTables.QuantizationTable> qTables
           
private static byte[][] QUANTIZATION_TABLES
          Quantization tables suggested by 11172-3 (tables 3-B.2[a-d]).
private static int SBLIMIT
          The number of sub-bands
 
Constructor Summary
private QuantizationTables()
           
 
Method Summary
static QuantizationTables.QuantizationTable getTable(int table)
          Returns a quantization table by number.
static QuantizationTables.QuantizationTable getTable(int sampleRate, int bitratePerChannel)
          Returns a quantization table suitable for given sample and bitrates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SBLIMIT

private static final int SBLIMIT
The number of sub-bands

See Also:
Constant Field Values

q

private static final QuantizationTables.QLevel[] q
This array contains the 'absolute' quantization levels. The bit allocation and quantization code use levels relative to sub-band number. With the help of the sub-band number and a quantization table, the relative level is mapped to one of these absolute levels.


QUANTIZATION_TABLES

private static final byte[][] QUANTIZATION_TABLES
Quantization tables suggested by 11172-3 (tables 3-B.2[a-d]). There are four tables which are suitable for different sample and bit rates. For how to read a table, see the code of QuantizationTable(int).


qTables

private static final java.util.HashMap<java.lang.Integer,QuantizationTables.QuantizationTable> qTables
Constructor Detail

QuantizationTables

private QuantizationTables()
Method Detail

getTable

public static QuantizationTables.QuantizationTable getTable(int table)
Returns a quantization table by number. Invoking this method again with the same table number returns the same table instance as before. That is, the following holds always:
     QuantizationTable.getTable(i) == QuantizationTable.getTable(i)
 


getTable

public static QuantizationTables.QuantizationTable getTable(int sampleRate,
                                                            int bitratePerChannel)
Returns a quantization table suitable for given sample and bitrates. Invoking this method again with the same parameters returns the same table instance as before. That is, the following holds always:
     QuantizationTable.getTable(srate, brate) == QuantizationTable.getTable(srate, brate)