Skip to content

Bitstream Class Reference

devongovett edited this page Nov 12, 2012 · 7 revisions

The AV.Bitstream class wraps an AV.Stream and adds methods to read data on an individual bit level. It is commonly used by decoders in Aurora.

Constructor

Properties

Methods

Constructor

new AV.Bitstream(stream)

Creates a AV.Bitstream with the given AV.Stream.

Properties

AV.Bitstream#bitPosition

The bit position within the current byte.

Methods

AV.Bitstream#copy()

Returns a new Bitstream backed by the same data at the same bit position.

AV.Bitstream#offset()

Returns the current offset from the start of the stream in bits.

AV.Bitstream#available(bits)

Returns whether or not the bitstream has the specified number of bits, as a boolean.

AV.Bitstream#advance(bits)

Advances the current bit offset by the specified number of bits. Advancing the bit stream also advances the backing Stream.

AV.Bitstream#align()

Byte aligns the bitstream to the next available byte.

AV.Bitstream#read(bits, signed)

Reads the specified number of bits from the bitstream, up to 40 bits, and advances the current bit position. If signed is set to true, the bits are interpreted as a signed integer, otherwise they are interpreted as unsigned.

AV.Bitstream#peek(bits, signed)

Reads the specified number of bits from the bitstream, up to 40 bits, without advancing the bit position. If signed is set to true, the bits are interpreted as a signed integer, otherwise they are interpreted as unsigned.

AV.Bitstream#readLSB(bits, signed)

Reads the specified number of bits from the bitstream in little endian word order, up to 40 bits, and advances the current bit position. If signed is set to true, the bits are interpreted as a signed integer, otherwise they are interpreted as unsigned.

AV.Bitstream#peekLSB(bits, signed)

Reads the specified number of bits from the bitstream in little endian word order, up to 40 bits, without advancing the bit position. If signed is set to true, the bits are interpreted as a signed integer, otherwise they are interpreted as unsigned.