Class: shaka.util.ExpGolomb

Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264. Based on https://github.com/videojs/mux.js/blob/main/lib/utils/exp-golomb.js

Constructor

new ExpGolomb(datanon-null)

Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264. Based on https://github.com/videojs/mux.js/blob/main/lib/utils/exp-golomb.js

Parameters:
Name Type Description
data Uint8Array
Source:

Members

data_ :Uint8Array

Type:
  • Uint8Array
Source:

workingBitsAvailable_ :number

Type:
  • number
Source:

workingBytesAvailable_ :number

Type:
  • number
Source:

workingWord_ :number

Type:
  • number
Source:

Methods

loadWord_()

Load the next word
Source:

readBits(size) → {number}

Read n bits
Parameters:
Name Type Description
size number
Source:
Returns:
Type
number

readBoolean() → {boolean}

Read 1 bit as boolean
Source:
Returns:
Type
boolean

readExpGolomb() → {number}

Return exponential Golomb
Source:
Returns:
Type
number

readSliceType() → {number}

Return the slice type
Source:
Returns:
Type
number

readUnsignedByte() → {number}

Read 8 bits
Source:
Returns:
Type
number

readUnsignedExpGolomb() → {number}

Return unsigned exponential Golomb
Source:
Returns:
Type
number

skipBits(count)

Skip n bits
Parameters:
Name Type Description
count number
Source:

skipExpGolomb()

Skip exponential Golomb
Source:

skipLeadingZeros_() → {number}

Return the number of skip leading zeros
Source:
Returns:
Type
number

skipScalingList(count)

The scaling list is optionally transmitted as part of a Sequence Parameter Set (SPS).
Parameters:
Name Type Description
count number the number of entries in this scaling list
Source:
See:
  • Recommendation ITU-T H.264, Section 7.3.2.1.1.1