org.jcodec.codecs.mpeg12.bitstream.PictureTemporalScalableExtension 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 org.jcodec.codecs.mpeg12.bitstream;
import java.io.IOException;
import org.jcodec.common.io.BitReader;
import org.jcodec.common.io.BitWriter;
/**
* This class is part of JCodec ( www.jcodec.org ) This software is distributed
* under FreeBSD License
*
* @author The JCodec project
*
*/
public class PictureTemporalScalableExtension {
public int reference_select_code;
public int forward_temporal_reference;
public int backward_temporal_reference;
public static PictureTemporalScalableExtension read(BitReader in) {
PictureTemporalScalableExtension ptse = new PictureTemporalScalableExtension();
ptse.reference_select_code = in.readNBit(2);
ptse.forward_temporal_reference = in.readNBit(10);
in.read1Bit();
ptse.backward_temporal_reference = in.readNBit(10);
return ptse;
}
public void write(BitWriter out) throws IOException {
out.writeNBit(reference_select_code, 2);
out.writeNBit(forward_temporal_reference, 10);
out.write1Bit(1); // todo: verify this
out.writeNBit(backward_temporal_reference, 10);
}
}