com.twilight.h264.decoder
Class GetBitContext

java.lang.Object
  extended by com.twilight.h264.decoder.GetBitContext

public class GetBitContext
extends Object


Field Summary
static int[] av_reverse
           
 int[] buffer
           
 int buffer_end
           
 int buffer_offset
           
 long cache
           
 long cache0
           
 long cache1
           
static int[] ff_golomb_vlc_len
           
static int[] ff_se_golomb_vlc_code
           
static int[] ff_ue_golomb_len
           
static int[] ff_ue_golomb_vlc_code
           
 int index
           
static int INIT_VLC_LE
           
static int INIT_VLC_USE_NEW_STATIC
           
static int MIN_CACHE_BITS
           
 int size_in_bits
           
 
Constructor Summary
GetBitContext()
           
 
Method Summary
 void align_get_bits()
           
static int alloc_table(VLC vlc, int size, int use_static)
           
static long bitswap_32(long x)
           
static int build_table(VLC vlc, int table_nb_bits, int nb_codes, VLCcode[] codes_base, int codes_offset, int flags)
          Build VLC decoding tables suitable for use with get_vlc().
 long check_marker(String msg)
           
 long decode012()
           
 long decode210()
           
 int get_bits_count()
           
 int get_bits_left()
           
 long get_bits_long(int n, String message)
          reads 0-32 bits.
 long get_bits(int n, String message)
          reads 1-17 bits.
 long get_bits1(String message)
           
 int get_sbits_long(int n, String message)
          reads 0-32 bits as a signed integer.
 int get_sbits(int n)
           
 int get_se_golomb(String message)
          read signed exp golomb code.
 int get_ue_golomb_31(String message)
          read unsigned exp golomb code, constraint to a max of 31.
 int get_ue_golomb(String message)
          read unsigned exp golomb code.
 int get_vlc2(short[][] table_base, int table_offset, int bits, int max_depth, String message)
          parses a vlc code, faster then get_vlc()
 int get_xbits(int n)
          read mpeg1 dc style vlc (sign bit + mantisse with no MSB).
 void init_get_bits(int[] buffer, int buffer_offset, int bit_size)
          init GetBitContext.
 GetBitContext makeCopy()
           
 long show_bits_long(int n)
          shows 0-32 bits.
 long show_bits(int n)
          shows 1-17 bits.
 long show_bits1()
           
 void skip_bits_long(int n)
           
 void skip_bits(int n)
           
 void skip_bits1()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_CACHE_BITS

public static final int MIN_CACHE_BITS
See Also:
Constant Field Values

INIT_VLC_LE

public static final int INIT_VLC_LE
See Also:
Constant Field Values

INIT_VLC_USE_NEW_STATIC

public static final int INIT_VLC_USE_NEW_STATIC
See Also:
Constant Field Values

av_reverse

public static final int[] av_reverse

ff_golomb_vlc_len

public static final int[] ff_golomb_vlc_len

ff_ue_golomb_vlc_code

public static final int[] ff_ue_golomb_vlc_code

ff_se_golomb_vlc_code

public static final int[] ff_se_golomb_vlc_code

ff_ue_golomb_len

public static final int[] ff_ue_golomb_len

buffer

public int[] buffer

buffer_offset

public int buffer_offset

buffer_end

public int buffer_end

index

public int index

cache

public long cache

cache0

public long cache0

cache1

public long cache1

size_in_bits

public int size_in_bits
Constructor Detail

GetBitContext

public GetBitContext()
Method Detail

bitswap_32

public static final long bitswap_32(long x)

makeCopy

public GetBitContext makeCopy()

get_bits_count

public int get_bits_count()

skip_bits_long

public void skip_bits_long(int n)

get_xbits

public int get_xbits(int n)
read mpeg1 dc style vlc (sign bit + mantisse with no MSB). if MSB not set it is negative

Parameters:
n - length in bits

get_sbits

public int get_sbits(int n)

get_bits

public long get_bits(int n,
                     String message)
reads 1-17 bits. Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't


show_bits

public long show_bits(int n)
shows 1-17 bits. Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't


skip_bits

public void skip_bits(int n)

get_bits1

public long get_bits1(String message)

show_bits1

public long show_bits1()

skip_bits1

public void skip_bits1()

get_bits_long

public long get_bits_long(int n,
                          String message)
reads 0-32 bits.


get_sbits_long

public int get_sbits_long(int n,
                          String message)
reads 0-32 bits as a signed integer.


show_bits_long

public long show_bits_long(int n)
shows 0-32 bits.


check_marker

public long check_marker(String msg)

init_get_bits

public void init_get_bits(int[] buffer,
                          int buffer_offset,
                          int bit_size)
init GetBitContext.

Parameters:
buffer - bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then the actual read bits because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
bit_size - the size of the buffer in bits While GetBitContext stores the buffer size, for performance reasons you are responsible for checking for the buffer end yourself (take advantage of the padding)!

align_get_bits

public void align_get_bits()

decode012

public long decode012()

decode210

public long decode210()

get_bits_left

public int get_bits_left()

alloc_table

public static int alloc_table(VLC vlc,
                              int size,
                              int use_static)

build_table

public static int build_table(VLC vlc,
                              int table_nb_bits,
                              int nb_codes,
                              VLCcode[] codes_base,
                              int codes_offset,
                              int flags)
Build VLC decoding tables suitable for use with get_vlc().

Parameters:
vlc - the context to be initted
table_nb_bits - max length of vlc codes to store directly in this table (Longer codes are delegated to subtables.)
nb_codes - number of elements in codes[]
codes - descriptions of the vlc codes These must be ordered such that codes going into the same subtable are contiguous. Sorting by VLCcode.code is sufficient, though not necessary.

get_vlc2

public int get_vlc2(short[][] table_base,
                    int table_offset,
                    int bits,
                    int max_depth,
                    String message)
parses a vlc code, faster then get_vlc()

Parameters:
bits - is the number of bits which will be read at once, must be identical to nb_bits in init_vlc()
max_depth - is the number of times bits bits must be read to completely read the longest vlc code = (max_vlc_length + bits - 1) / bits

get_ue_golomb

public int get_ue_golomb(String message)
read unsigned exp golomb code.


get_ue_golomb_31

public int get_ue_golomb_31(String message)
read unsigned exp golomb code, constraint to a max of 31. the return value is undefined if the stored value exceeds 31.


get_se_golomb

public int get_se_golomb(String message)
read signed exp golomb code.



Copyright © 2013. All Rights Reserved.