sound.jarnbjo.vorbis.Residue2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of etyllica Show documentation
Show all versions of etyllica Show documentation
A game engine made in pure java.
/*
* $ProjectName$
* $ProjectRevision$
* -----------------------------------------------------------
* $Id: Residue2.java,v 1.2 2003/03/16 01:11:12 jarnbjo Exp $
* -----------------------------------------------------------
*
* $Author: jarnbjo $
*
* Description:
*
* Copyright 2002-2003 Tor-Einar Jarnbjo
* -----------------------------------------------------------
*
* Change History
* -----------------------------------------------------------
* $Log: Residue2.java,v $
* Revision 1.2 2003/03/16 01:11:12 jarnbjo
* no message
*
*
*/
package sound.jarnbjo.vorbis;
import java.io.IOException;
import sound.jarnbjo.util.io.BitInputStream;
public class Residue2 extends Residue {
private double[][] decodedVectors;
private Residue2() {
}
protected Residue2(BitInputStream source, SetupHeader header) throws VorbisFormatException, IOException {
super(source, header);
}
protected int getType() {
return 2;
}
protected void decodeResidue(VorbisStream vorbis, BitInputStream source, Mode mode, int ch, boolean[] doNotDecodeFlags, float[][] vectors) throws VorbisFormatException, IOException {
Look look=getLook(vorbis, mode);
CodeBook codeBook=vorbis.getSetupHeader().getCodeBooks()[getClassBook()];
int classvalsPerCodeword=codeBook.getDimensions();
int nToRead=getEnd()-getBegin();
int partitionsToRead=nToRead/getPartitionSize(); // partvals
int samplesPerPartition=getPartitionSize();
int partitionsPerWord=look.getPhraseBook().getDimensions();
int partWords=(partitionsToRead+partitionsPerWord-1)/partitionsPerWord;
int realCh=0;
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy