vlc.h File Reference

header for (CA)VLC coding functions More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int se_v (char *tracestring, Bitstream *bitstream)
int ue_v (char *tracestring, Bitstream *bitstream)
Boolean u_1 (char *tracestring, Bitstream *bitstream)
int u_v (int LenInBits, char *tracestring, Bitstream *bitstream)
int i_v (int LenInBits, char *tracestring, Bitstream *bitstream)
void linfo_ue (int len, int info, int *value1, int *dummy)
void linfo_se (int len, int info, int *value1, int *dummy)
void linfo_cbp_intra (int len, int info, int *cbp, int *dummy)
void linfo_cbp_inter (int len, int info, int *cbp, int *dummy)
void linfo_levrun_inter (int len, int info, int *level, int *irun)
void linfo_levrun_c2x2 (int len, int info, int *level, int *irun)
int uvlc_startcode_follows (Slice *currSlice, int dummy)
int readSyntaxElement_VLC (SyntaxElement *sym, Bitstream *currStream)
int readSyntaxElement_UVLC (SyntaxElement *sym, ImageParameters *img, struct datapartition *dp)
int readSyntaxElement_Intra4x4PredictionMode (SyntaxElement *sym, ImageParameters *img, Bitstream *currStream)
int GetVLCSymbol (byte buffer[], int totbitoffset, int *info, int bytecount)
int GetVLCSymbol_IntraMode (byte buffer[], int totbitoffset, int *info, int bytecount)
int readSyntaxElement_FLC (SyntaxElement *sym, Bitstream *currStream)
int readSyntaxElement_NumCoeffTrailingOnes (SyntaxElement *sym, Bitstream *currStream, char *type)
int readSyntaxElement_NumCoeffTrailingOnesChromaDC (SyntaxElement *sym, Bitstream *currStream)
int readSyntaxElement_Level_VLC0 (SyntaxElement *sym, Bitstream *currStream)
int readSyntaxElement_Level_VLCN (SyntaxElement *sym, int vlc, Bitstream *currStream)
int readSyntaxElement_TotalZeros (SyntaxElement *sym, Bitstream *currStream)
int readSyntaxElement_TotalZerosChromaDC (SyntaxElement *sym, Bitstream *currStream)
int readSyntaxElement_Run (SyntaxElement *sym, Bitstream *currStream)
int GetBits (byte buffer[], int totbitoffset, int *info, int bitcount, int numbits)
int ShowBits (byte buffer[], int totbitoffset, int bitcount, int numbits)
int more_rbsp_data (byte buffer[], int totbitoffset, int bytecount)


Detailed Description

header for (CA)VLC coding functions

Author:
Karsten Suehring

Definition in file vlc.h.


Function Documentation

int GetBits ( byte  buffer[],
int  totbitoffset,
int *  info,
int  bitcount,
int  numbits 
)

Reads bits from the bitstream buffer.

Parameters:
buffer containing VLC-coded data bits
totbitoffset bit offset from start of partition
info returns value of the read bits
bitcount total bytes in bitstream
numbits number of bits to read

Definition at line 1234 of file vlc.c.

Referenced by readIPCM_CABAC(), and readSyntaxElement_FLC().

int GetVLCSymbol ( byte  buffer[],
int  totbitoffset,
int *  info,
int  bytecount 
)

read one exp-golomb VLC symbol

Parameters:
buffer containing VLC-coded data bits
totbitoffset bit offset from start of partition
info returns the value of the symbol
bytecount buffer length
Returns:
bits read

Definition at line 557 of file vlc.c.

Referenced by readSyntaxElement_VLC().

int i_v ( int  LenInBits,
char *  tracestring,
Bitstream *  bitstream 
)

i_v, reads an i(v) syntax element, the length in bits is stored in the global UsedBits variable

Parameters:
LenInBits length of the syntax element
tracestring the string for the trace file
bitstream the stream to be read from
Returns:
the value of the coded syntax element

Definition at line 200 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, linfo_ue(), syntaxelement::mapping, readSyntaxElement_FLC(), SE_HEADER, and syntaxelement::type.

Referenced by interpret_picture_timing_info().

Here is the call graph for this function:

void linfo_cbp_inter ( int  len,
int  info,
int *  cbp,
int *  dummy 
)

Input:
length and info
Output:
cbp (inter)

Definition at line 310 of file vlc.c.

References linfo_ue(), and NCBP.

Referenced by readCBPandCoeffsFromNAL().

Here is the call graph for this function:

void linfo_cbp_intra ( int  len,
int  info,
int *  cbp,
int *  dummy 
)

Input:
length and info
Output:
cbp (intra)

Definition at line 290 of file vlc.c.

References linfo_ue(), and NCBP.

Referenced by readCBPandCoeffsFromNAL().

Here is the call graph for this function:

void linfo_levrun_c2x2 ( int  len,
int  info,
int *  level,
int *  irun 
)

Input:
length and info
Output:
level, run

Definition at line 364 of file vlc.c.

References LEVRUN3.

Referenced by readCBPandCoeffsFromNAL().

void linfo_levrun_inter ( int  len,
int  info,
int *  level,
int *  irun 
)

Input:
length and info
Output:
level, run

Definition at line 329 of file vlc.c.

References NTAB1.

Referenced by readCBPandCoeffsFromNAL(), and readCompCoeff4x4SMB_CABAC().

void linfo_se ( int  len,
int  info,
int *  value1,
int *  dummy 
)

mapping rule for se(v) syntax elements

Input:
lenght and info
Output:
signed mvd

Definition at line 271 of file vlc.c.

Referenced by readMotionInfoFromNAL(), and se_v().

void linfo_ue ( int  len,
int  info,
int *  value1,
int *  dummy 
)

mapping rule for ue(v) syntax elements

Input:
lenght and info
Output:
number in the code table

Definition at line 255 of file vlc.c.

Referenced by i_v(), linfo_cbp_inter(), linfo_cbp_intra(), prepareListforRefIdx(), read_ipred_modes(), read_one_macroblock(), u_v(), and ue_v().

int more_rbsp_data ( byte  buffer[],
int  totbitoffset,
int  bytecount 
)

test if bit buffer contains only stop bit

Parameters:
buffer buffer containing VLC-coded data bits
totbitoffset bit offset from start of partition
bytecount buffer length
Returns:
true if more bits available

Definition at line 494 of file vlc.c.

Referenced by InterpretPPS(), and uvlc_startcode_follows().

int readSyntaxElement_FLC ( SyntaxElement *  sym,
Bitstream *  currStream 
)

int readSyntaxElement_Intra4x4PredictionMode ( SyntaxElement *  sym,
ImageParameters *  img,
Bitstream *  currStream 
)

read next VLC codeword for 4x4 Intra Prediction Mode and map it to the corresponding Intra Prediction Direction

Definition at line 431 of file vlc.c.

References Bitstream::bitstream_length, Bitstream::frame_bitoffset, syntaxelement::inf, syntaxelement::len, Bitstream::streamBuffer, TRACE, and syntaxelement::value1.

Referenced by read_ipred_modes().

int readSyntaxElement_Level_VLC0 ( SyntaxElement *  sym,
Bitstream *  currStream 
)

read Level VLC0 codeword from UVLC-partition

Definition at line 888 of file vlc.c.

References Bitstream::bitstream_length, Bitstream::frame_bitoffset, syntaxelement::inf, syntaxelement::len, ShowBits(), and Bitstream::streamBuffer.

Referenced by readCoeff4x4_CAVLC().

Here is the call graph for this function:

int readSyntaxElement_Level_VLCN ( SyntaxElement *  sym,
int  vlc,
Bitstream *  currStream 
)

read Level VLC codeword from UVLC-partition

Definition at line 946 of file vlc.c.

References Bitstream::bitstream_length, Bitstream::frame_bitoffset, syntaxelement::inf, syntaxelement::len, ShowBits(), and Bitstream::streamBuffer.

Referenced by readCoeff4x4_CAVLC().

Here is the call graph for this function:

int readSyntaxElement_NumCoeffTrailingOnes ( SyntaxElement *  sym,
Bitstream *  currStream,
char *  type 
)

read NumCoeff/TrailingOnes codeword from UVLC-partition

Definition at line 717 of file vlc.c.

References Bitstream::bitstream_length, code_from_bitstream_2d(), Bitstream::frame_bitoffset, syntaxelement::len, ShowBits(), Bitstream::streamBuffer, syntaxelement::value1, and syntaxelement::value2.

Referenced by readCoeff4x4_CAVLC().

Here is the call graph for this function:

int readSyntaxElement_NumCoeffTrailingOnesChromaDC ( SyntaxElement *  sym,
Bitstream *  currStream 
)

read NumCoeff/TrailingOnes codeword from UVLC-partition ChromaDC

Definition at line 821 of file vlc.c.

References code_from_bitstream_2d(), syntaxelement::len, syntaxelement::value1, and syntaxelement::value2.

Referenced by readCoeff4x4_CAVLC().

Here is the call graph for this function:

int readSyntaxElement_Run ( SyntaxElement *  sym,
Bitstream *  currStream 
)

read Run codeword from UVLC-partition

Definition at line 1175 of file vlc.c.

References code_from_bitstream_2d(), syntaxelement::len, and syntaxelement::value1.

Referenced by readCoeff4x4_CAVLC().

Here is the call graph for this function:

int readSyntaxElement_TotalZeros ( SyntaxElement *  sym,
Bitstream *  currStream 
)

read Total Zeros codeword from UVLC-partition

Definition at line 1020 of file vlc.c.

References code_from_bitstream_2d(), syntaxelement::len, and syntaxelement::value1.

Referenced by readCoeff4x4_CAVLC().

Here is the call graph for this function:

int readSyntaxElement_TotalZerosChromaDC ( SyntaxElement *  sym,
Bitstream *  currStream 
)

read Total Zeros Chroma DC codeword from UVLC-partition

Definition at line 1084 of file vlc.c.

References code_from_bitstream_2d(), syntaxelement::len, and syntaxelement::value1.

Referenced by readCoeff4x4_CAVLC().

Here is the call graph for this function:

int readSyntaxElement_UVLC ( SyntaxElement *  sym,
ImageParameters *  img,
struct datapartition *  dp 
)

read next UVLC codeword from UVLC-partition and map it to the corresponding syntax element

Definition at line 419 of file vlc.c.

References datapartition::bitstream, and readSyntaxElement_VLC().

Here is the call graph for this function:

int readSyntaxElement_VLC ( SyntaxElement *  sym,
Bitstream *  currStream 
)

read next UVLC codeword from UVLC-partition and map it to the corresponding syntax element

Definition at line 394 of file vlc.c.

References Bitstream::bitstream_length, Bitstream::frame_bitoffset, GetVLCSymbol(), syntaxelement::inf, syntaxelement::len, syntaxelement::mapping, Bitstream::streamBuffer, syntaxelement::value1, and syntaxelement::value2.

Referenced by readSyntaxElement_UVLC(), se_v(), and ue_v().

Here is the call graph for this function:

int se_v ( char *  tracestring,
Bitstream *  bitstream 
)

ue_v, reads an se(v) syntax element, the length in bits is stored in the global UsedBits variable

Parameters:
tracestring the string for the trace file
bitstream the stream to be read from
Returns:
the value of the coded syntax element

Definition at line 131 of file vlc.c.

References syntaxelement::len, linfo_se(), syntaxelement::mapping, readSyntaxElement_VLC(), SE_HEADER, syntaxelement::type, and syntaxelement::value1.

Referenced by interpret_film_grain_characteristics_info(), interpret_pan_scan_rect_info(), interpret_post_filter_hints_info(), InterpretPPS(), pred_weight_table(), and RestOfSliceHeader().

Here is the call graph for this function:

int ShowBits ( byte  buffer[],
int  totbitoffset,
int  bitcount,
int  numbits 
)

Reads bits from the bitstream buffer.

Parameters:
buffer buffer containing VLC-coded data bits
totbitoffset bit offset from start of partition
bitcount total bytes in bitstream
numbits number of bits to read

Definition at line 1285 of file vlc.c.

Referenced by readSyntaxElement_Level_VLC0(), readSyntaxElement_Level_VLCN(), and readSyntaxElement_NumCoeffTrailingOnes().

Boolean u_1 ( char *  tracestring,
Bitstream *  bitstream 
)

int u_v ( int  LenInBits,
char *  tracestring,
Bitstream *  bitstream 
)

ue_v, reads an u(v) syntax element, the length in bits is stored in the global UsedBits variable

Parameters:
LenInBits length of the syntax element
tracestring the string for the trace file
bitstream the stream to be read from
Returns:
the value of the coded syntax element

Definition at line 165 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, linfo_ue(), syntaxelement::mapping, readSyntaxElement_FLC(), SE_HEADER, and syntaxelement::type.

Referenced by FirstPartOfSliceHeader(), interpret_buffering_period_info(), interpret_film_grain_characteristics_info(), interpret_motion_constrained_slice_group_set_info(), interpret_picture_timing_info(), interpret_post_filter_hints_info(), interpret_recovery_point_info(), interpret_subsequence_characteristics_info(), interpret_subsequence_layer_characteristics_info(), InterpretPPS(), RestOfSliceHeader(), and u_1().

Here is the call graph for this function:

int ue_v ( char *  tracestring,
Bitstream *  bitstream 
)

int uvlc_startcode_follows ( Slice *  currSlice,
int  dummy 
)

Check if there are symbols for the next MB.

Definition at line 528 of file vlc.c.

References assignSE2partition, datapartition::bitstream, Bitstream::bitstream_length, Slice::dp_mode, Bitstream::frame_bitoffset, more_rbsp_data(), Slice::partArr, and Bitstream::streamBuffer.

Here is the call graph for this function:


Documentation generated with DoxyGen