net.sourceforge.jaad.aac.error.RVLC 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.error;
import net.sourceforge.jaad.aac.AACException;
import net.sourceforge.jaad.aac.huffman.HCB;
import net.sourceforge.jaad.aac.syntax.IBitStream;
import net.sourceforge.jaad.aac.syntax.ICSInfo;
import net.sourceforge.jaad.aac.syntax.ICStream;
/**
* 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.
*
* Reversable variable length coding
* Decodes scalefactors if error resilience is used.
*
* @author in-somnia
*/
public class RVLC implements RVLCTables {
private static final int ESCAPE_FLAG = 7;
public void decode(IBitStream _in, ICStream ics, int[][] scaleFactors) throws AACException {
final int bits = (ics.getInfo().isEightShortFrame()) ? 11 : 9;
final boolean sfConcealment = _in.readBool();
final int revGlobalGain = _in.readBits(8);
final int rvlcSFLen = _in.readBits(bits);
final ICSInfo info = ics.getInfo();
final int windowGroupCount = info.getWindowGroupCount();
final int maxSFB = info.getMaxSFB();
final int[][] sfbCB = {{}}; //ics.getSectionData().getSfbCB();
int sf = ics.getGlobalGain();
int intensityPosition = 0;
int noiseEnergy = sf-90-256;
boolean intensityUsed = false, noiseUsed = false;
int sfb;
for(int g = 0; g