vlc.h File Reference

Prototypes for VLC coding funtions. More...

#include "enc_statistics.h"

Include dependency graph for vlc.h:

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

Go to the source code of this file.

Functions

Boolean u_1 (char *tracestring, int value, Bitstream *bitstream)
int se_v (char *tracestring, int value, Bitstream *bitstream)
int ue_v (char *tracestring, int value, Bitstream *bitstream)
int u_v (int n, char *tracestring, int value, Bitstream *bitstream)
void levrun_linfo_c2x2 (int level, int run, int *len, int *info)
void levrun_linfo_inter (int level, int run, int *len, int *info)
void writeSE_Fix (SyntaxElement *se, Bitstream *bitstream)
void writeSE_UVLC (SyntaxElement *se, DataPartition *dp)
void writeSE_SVLC (SyntaxElement *se, DataPartition *dp)
void writeSE_Flag (SyntaxElement *se, DataPartition *dp)
void writeSE_invFlag (SyntaxElement *se, DataPartition *dp)
void writeSE_Dummy (SyntaxElement *se, DataPartition *dp)
void writeCBP_VLC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp)
void writeIntraPredMode_CAVLC (SyntaxElement *se, DataPartition *dp)
int writeSyntaxElement2Buf_UVLC (SyntaxElement *se, Bitstream *this_streamBuffer)
void writeUVLC2buffer (SyntaxElement *se, Bitstream *currStream)
void writeVlcByteAlign (ImageParameters *p_Img, Bitstream *currStream, StatParameters *cur_stats)
int writeSyntaxElement2Buf_Fixed (SyntaxElement *se, Bitstream *this_streamBuffer)
int symbol2uvlc (SyntaxElement *se)
void ue_linfo (int n, int dummy, int *len, int *info)
void se_linfo (int mvd, int dummy, int *len, int *info)
void cbp_linfo_intra_normal (int cbp, int dummy, int *len, int *info)
void cbp_linfo_intra_other (int cbp, int dummy, int *len, int *info)
void cbp_linfo_inter_normal (int cbp, int dummy, int *len, int *info)
void cbp_linfo_inter_other (int cbp, int dummy, int *len, int *info)
int writeSyntaxElement_VLC (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_TotalZeros (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_TotalZerosChromaDC (ImageParameters *p_Img, SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_Run (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_NumCoeffTrailingOnes (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_NumCoeffTrailingOnesChromaDC (ImageParameters *p_Img, SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_Level_VLC1 (SyntaxElement *se, DataPartition *this_dataPart, int profile_idc)
int writeSyntaxElement_Level_VLCN (SyntaxElement *se, int vlc, DataPartition *this_dataPart, int profile_idc)
void writeUVLC_CAVLC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp)
void writeSVLC_CAVLC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp)
void writeFlag_CAVLC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp)
void reset_mb_nz_coeff (ImageParameters *p_Img, int mb_number)


Detailed Description

Prototypes for VLC coding funtions.

Author:
Karsten Suehring

Definition in file vlc.h.


Function Documentation

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

Input:
Number in the code table
Output:
length and info

Definition at line 335 of file vlc.c.

References NCBP, and ue_linfo().

Referenced by start_macroblock().

Here is the call graph for this function:

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

Input:
Number in the code table
Output:
length and info

Definition at line 322 of file vlc.c.

References NCBP, and ue_linfo().

Referenced by start_macroblock().

Here is the call graph for this function:

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

Input:
Number in the code table
Output:
length and info

Definition at line 309 of file vlc.c.

References NCBP, and ue_linfo().

Referenced by start_macroblock().

Here is the call graph for this function:

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

Input:
Number in the code table
Output:
length and info

Definition at line 295 of file vlc.c.

References NCBP, and ue_linfo().

Referenced by start_macroblock().

Here is the call graph for this function:

void levrun_linfo_c2x2 ( int  level,
int  run,
int *  len,
int *  info 
)

2x2 transform of chroma DC

Input:
level and run for coefficients
Output:
length and info
Note:
see ITU document for bit assignment

Definition at line 352 of file vlc.c.

void levrun_linfo_inter ( int  level,
int  run,
int *  len,
int *  info 
)

Single scan coefficients.

Input:
level and run for coefficients
Output:
length and info
Note:
see ITU document for bit assignment

Definition at line 399 of file vlc.c.

Referenced by dct_4x4_sp().

void reset_mb_nz_coeff ( ImageParameters p_Img,
int  mb_number 
)

void se_linfo ( int  se,
int  dummy,
int *  len,
int *  info 
)

mapping for se(v) syntax elements

Parameters:
se value to be mapped
dummy dummy parameter
len returns mapped value length
info returns mapped value

Definition at line 272 of file vlc.c.

Referenced by se_v(), and writeSE_SVLC().

int se_v ( char *  tracestring,
int  value,
Bitstream bitstream 
)

se_v, writes an se(v) syntax element, returns the length in bits

Parameters:
tracestring the string for the trace file
value the value to be coded
bitstream the target bitstream the value should be coded into
Returns:
Number of bits used by the coded syntax element
\ note This function writes always the bit buffer for the progressive scan flag, and should not be used (or should be modified appropriately) for the interlace crap When used in the context of the Parameter Sets, this is obviously not a problem.

Definition at line 117 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, se_linfo(), symbol2uvlc(), syntaxelement::value1, syntaxelement::value2, and writeUVLC2buffer().

Referenced by GeneratePic_parameter_set_rbsp(), GenerateSeq_parameter_set_rbsp(), pred_weight_table(), Scaling_List(), and SliceHeader().

Here is the call graph for this function:

int symbol2uvlc ( SyntaxElement sym  ) 

Makes code word and passes it back A code word has the following format: 0 0 0 ... 1 Xn ...X2 X1 X0.

Input:
Info : Xn..X2 X1 X0
Length : Total number of bits in the codeword

Definition at line 451 of file vlc.c.

References syntaxelement::bitpattern, syntaxelement::inf, and syntaxelement::len.

Referenced by se_v(), ue_v(), writeCBP_VLC(), writeSE_SVLC(), writeSE_UVLC(), and writeSyntaxElement2Buf_UVLC().

Boolean u_1 ( char *  tracestring,
int  value,
Bitstream bitstream 
)

u_1, writes a flag (u(1) syntax element, returns the length in bits, always 1

Parameters:
tracestring the string for the trace file
value the value to be coded
bitstream the target bitstream the value should be coded into
Returns:
Number of bits used by the coded syntax element (always 1)
\ note This function writes always the bit buffer for the progressive scan flag, and should not be used (or should be modified appropriately) for the interlace crap When used in the context of the Parameter Sets, this is obviously not a problem.

Definition at line 163 of file vlc.c.

References syntaxelement::bitpattern, syntaxelement::len, syntaxelement::value1, and writeUVLC2buffer().

Referenced by dec_ref_pic_marking(), GeneratePic_parameter_set_rbsp(), GenerateSeq_parameter_set_rbsp(), GenerateVUI_parameters_rbsp(), pred_weight_table(), ref_pic_list_reordering(), SliceHeader(), and WriteHRDParameters().

Here is the call graph for this function:

int u_v ( int  n,
char *  tracestring,
int  value,
Bitstream bitstream 
)

u_v, writes a n bit fixed length syntax element, returns the length in bits,

Parameters:
n length in bits
tracestring the string for the trace file
value the value to be coded
bitstream the target bitstream the value should be coded into
Returns:
Number of bits used by the coded syntax element
\ note This function writes always the bit buffer for the progressive scan flag, and should not be used (or should be modified appropriately) for the interlace crap When used in the context of the Parameter Sets, this is obviously not a problem.

Definition at line 210 of file vlc.c.

References syntaxelement::bitpattern, syntaxelement::len, syntaxelement::value1, and writeUVLC2buffer().

Referenced by GeneratePic_parameter_set_rbsp(), GenerateSEImessage_rbsp(), GenerateSeq_parameter_set_rbsp(), GenerateVUI_parameters_rbsp(), SliceHeader(), and WriteHRDParameters().

Here is the call graph for this function:

void ue_linfo ( int  ue,
int  dummy,
int *  len,
int *  info 
)

mapping for ue(v) syntax elements

Parameters:
ue value to be mapped
dummy dummy parameter
info returns mapped value
len returns mapped value length

Definition at line 245 of file vlc.c.

Referenced by cbp_linfo_inter_normal(), cbp_linfo_inter_other(), cbp_linfo_intra_normal(), cbp_linfo_intra_other(), ComposeSparePictureMessage(), CompressSpareMBMap(), FinalizeSpareMBMap(), FinalizeSubseqInfo(), RDCost_for_8x8blocks(), RDCost_for_macroblocks(), ue_v(), and writeSE_UVLC().

int ue_v ( char *  tracestring,
int  value,
Bitstream bitstream 
)

ue_v, writes an ue(v) syntax element, returns the length in bits

Parameters:
tracestring the string for the trace file
value the value to be coded
bitstream the target bitstream the value should be coded into
Returns:
Number of bits used by the coded syntax element
\ note This function writes always the bit buffer for the progressive scan flag, and should not be used (or should be modified appropriately) for the interlace crap When used in the context of the Parameter Sets, this is obviously not a problem.

Definition at line 72 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2uvlc(), ue_linfo(), syntaxelement::value1, syntaxelement::value2, and writeUVLC2buffer().

Referenced by dec_ref_pic_marking(), GeneratePic_parameter_set_rbsp(), GenerateSeq_parameter_set_rbsp(), GenerateVUI_parameters_rbsp(), pred_weight_table(), ref_pic_list_reordering(), SliceHeader(), and WriteHRDParameters().

Here is the call graph for this function:

void writeCBP_VLC ( Macroblock currMB,
SyntaxElement se,
DataPartition dp 
)

generates UVLC code and passes the codeword to the buffer

Definition at line 510 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, macroblock::mb_type, symbol2uvlc(), syntaxelement::type, syntaxelement::value1, syntaxelement::value2, Bitstream::write_flag, and writeUVLC2buffer().

Here is the call graph for this function:

void writeIntraPredMode_CAVLC ( SyntaxElement se,
DataPartition dp 
)

generates code and passes the codeword to the buffer

Definition at line 540 of file vlc.c.

References syntaxelement::bitpattern, syntaxelement::inf, syntaxelement::len, syntaxelement::type, syntaxelement::value1, Bitstream::write_flag, and writeUVLC2buffer().

Here is the call graph for this function:

void writeSE_Dummy ( SyntaxElement se,
DataPartition dp 
)

generates UVLC code and passes the codeword to the buffer

Author:
Tian Dong

Definition at line 734 of file vlc.c.

References syntaxelement::len.

void writeSE_Fix ( SyntaxElement se,
Bitstream bitstream 
)

generates UVLC code and passes the codeword to the buffer

Author:
Tian Dong

Definition at line 748 of file vlc.c.

References writeUVLC2buffer().

Here is the call graph for this function:

void writeSE_Flag ( SyntaxElement se,
DataPartition dp 
)

generates UVLC code and passes the codeword to the buffer

Author:
Tian Dong

Definition at line 692 of file vlc.c.

References syntaxelement::bitpattern, syntaxelement::len, syntaxelement::value1, and writeUVLC2buffer().

Referenced by writeMBLayerBSlice(), and writeMBLayerPSlice().

Here is the call graph for this function:

void writeSE_invFlag ( SyntaxElement se,
DataPartition dp 
)

generates UVLC code and passes the codeword to the buffer

Author:
Tian Dong

Definition at line 713 of file vlc.c.

References syntaxelement::bitpattern, syntaxelement::len, syntaxelement::value1, and writeUVLC2buffer().

Here is the call graph for this function:

void writeSE_SVLC ( SyntaxElement se,
DataPartition dp 
)

generates UVLC code and passes the codeword to the buffer

Definition at line 488 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, se_linfo(), symbol2uvlc(), syntaxelement::type, syntaxelement::value1, syntaxelement::value2, Bitstream::write_flag, and writeUVLC2buffer().

Here is the call graph for this function:

void writeSE_UVLC ( SyntaxElement se,
DataPartition dp 
)

generates UVLC code and passes the codeword to the buffer

Definition at line 466 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2uvlc(), syntaxelement::type, ue_linfo(), syntaxelement::value1, syntaxelement::value2, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by end_macroblock(), Partition_BC_Header(), writeMBLayerBSlice(), and writeMBLayerPSlice().

Here is the call graph for this function:

int writeSyntaxElement2Buf_Fixed ( SyntaxElement se,
Bitstream this_streamBuffer 
)

generates UVLC code and passes the codeword to the buffer

Author:
Tian Dong

Definition at line 673 of file vlc.c.

References syntaxelement::len, syntaxelement::type, and writeUVLC2buffer().

Referenced by FinalizeSubseqInfo().

Here is the call graph for this function:

int writeSyntaxElement2Buf_UVLC ( SyntaxElement se,
Bitstream this_streamBuffer 
)

generates UVLC code and passes the codeword to the buffer

Author:
Tian Dong

Definition at line 577 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2uvlc(), syntaxelement::type, syntaxelement::value1, syntaxelement::value2, and writeUVLC2buffer().

Referenced by ComposeSparePictureMessage(), CompressSpareMBMap(), FinalizeSpareMBMap(), and FinalizeSubseqInfo().

Here is the call graph for this function:

int writeSyntaxElement_Level_VLC1 ( SyntaxElement se,
DataPartition this_dataPart,
int  profile_idc 
)

write VLC for Coeff Level (VLC1)

Definition at line 1224 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

int writeSyntaxElement_Level_VLCN ( SyntaxElement se,
int  vlc,
DataPartition this_dataPart,
int  profile_idc 
)

write VLC for Coeff Level

Definition at line 1293 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

int writeSyntaxElement_NumCoeffTrailingOnes ( SyntaxElement se,
DataPartition this_dataPart 
)

write VLC for NumCoeff and TrailingOnes

Definition at line 820 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, syntaxelement::value2, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

int writeSyntaxElement_NumCoeffTrailingOnesChromaDC ( ImageParameters p_Img,
SyntaxElement se,
DataPartition this_dataPart 
)

write VLC for NumCoeff and TrailingOnes for Chroma DC

Definition at line 918 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, syntaxelement::value2, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

int writeSyntaxElement_Run ( SyntaxElement se,
DataPartition this_dataPart 
)

write VLC for Run Before Next Coefficient, VLC0

Definition at line 1167 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

int writeSyntaxElement_TotalZeros ( SyntaxElement se,
DataPartition this_dataPart 
)

write VLC for TotalZeros

Definition at line 994 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

int writeSyntaxElement_TotalZerosChromaDC ( ImageParameters p_Img,
SyntaxElement se,
DataPartition this_dataPart 
)

write VLC for TotalZeros for Chroma DC

Definition at line 1067 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

int writeSyntaxElement_VLC ( SyntaxElement se,
DataPartition this_dataPart 
)

generates VLC code and passes the codeword to the buffer

Definition at line 793 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, symbol2vlc(), syntaxelement::type, syntaxelement::value1, syntaxelement::value2, Bitstream::write_flag, and writeUVLC2buffer().

Referenced by writeCoeff4x4_CAVLC_444(), and writeCoeff4x4_CAVLC_normal().

Here is the call graph for this function:

void writeUVLC2buffer ( SyntaxElement se,
Bitstream currStream 
)

void writeVlcByteAlign ( ImageParameters p_Img,
Bitstream currStream,
StatParameters *  cur_stats 
)

puts the less than 8 bits in the byte buffer of the Bitstream into the streamBuffer.

Parameters:
p_Img ImageParameters for current picture encoding
currStream the Bitstream the alignment should be established
cur_stats currently used statistics parameters

Definition at line 1438 of file vlc.c.

References Bitstream::bits_to_go, Bitstream::byte_buf, Bitstream::byte_pos, and Bitstream::streamBuffer.

Referenced by start_slice().


Documentation generated with DoxyGen