|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.cs.ohtu.mpeg2.audio.mpa.ScaleFactors
public class ScaleFactors
Implements scale factor calculations for MPEG-1 Layer I and II audio. The scale factors are used in the encoding process to implement an application specific (read 'home-made') floating-point representation of sub-band samples: The scale factor indices are coded along the scaled (and quantized) sub-band samples. Thus the scaling can be reversed while decoding.
Nested Class Summary | |
---|---|
private static class |
ScaleFactors.TxPattern
Transmission pattern defines how the three scale factors of a single sub-band are coded into the output stream. |
Field Summary | |
---|---|
private static double[] |
SCALEFACTORS
Scalefactors, taken from table 3-B.1 of ISO 11172-3. |
private static ScaleFactors.TxPattern[][] |
TRANS_PATTERN
Transmission patterns tabulated in 3-C.4 of the 11172 |
Constructor Summary | |
---|---|
private |
ScaleFactors()
|
Method Summary | |
---|---|
static int |
calcScale(double[] samples)
Calculates scale factor index for an array of samples. |
static int[] |
calcScale(double[][] samples)
Calculates scale factor indices for an array of sample arrays. |
static int |
calcScfsi(int[] scfis)
Calculates scale factor select information for given three scale factor indices and adjusts the indices accordingly. |
static double |
scale(double sample,
int scfi)
Scales the given sample with the scale factor indicated by the scale factor select index. |
static int |
search(double max)
Finds next largest scalefactor for a given value from SCALEFACTORS. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final double[] SCALEFACTORS
private static final ScaleFactors.TxPattern[][] TRANS_PATTERN
Constructor Detail |
---|
private ScaleFactors()
Method Detail |
---|
public static int calcScale(double[] samples)
samples
- The array of samples
public static int[] calcScale(double[][] samples)
samples
- The array of sample arrays [CHANNEL][SUBBAND]
public static int calcScfsi(int[] scfis)
scfis
- The array of three scale factor indices, contents
adjusted to match with the select information
public static int search(double max)
max
- A value that is compared to the scalefactors
public static double scale(double sample, int scfi)
sample
- The sample to scalescfi
- The scale factor index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |