net.sourceforge.jaad.aac.gain.IMDCT Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcodec Show documentation
Show all versions of jcodec Show documentation
Pure Java implementation of video/audio codecs and formats
package net.sourceforge.jaad.aac.gain;
import static java.lang.System.arraycopy;
import net.sourceforge.jaad.aac.AACException;
import net.sourceforge.jaad.aac.syntax.ICSInfo.WindowSequence;
/**
* This class is part of JAAD ( jaadec.sourceforge.net ) that is distributed
* under the Public Domain license. Code changes provided by the JCodec project
* are distributed under FreeBSD license.
*
* @author in-somnia
*/
//inverse modified discrete cosine transform
class IMDCT implements GCConstants, IMDCTTables, Windows {
private static final float[][] LONG_WINDOWS = {SINE_256, KBD_256};
private static final float[][] SHORT_WINDOWS = {SINE_32, KBD_32};
private final int frameLen, shortFrameLen, lbLong, lbShort, lbMid;
IMDCT(int frameLen) {
this.frameLen = frameLen;
lbLong = frameLen/BANDS;
shortFrameLen = frameLen/8;
lbShort = shortFrameLen/BANDS;
lbMid = (lbLong-lbShort)/2;
}
void process(float[] _in, float[] out, int winShape, int winShapePrev, WindowSequence winSeq) throws AACException {
final float[] buf = new float[frameLen];
int b, j, i;
if(winSeq.equals(WindowSequence.EIGHT_SHORT_SEQUENCE)) {
for(b = 0; b