All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.jaad.aac.error.RVLC Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy