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 (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 (int cbp, int dummy, int *len, int *info)
void cbp_linfo_inter (int cbp, int dummy, int *len, int *info)
void CAVLC_init (void)
int writeSyntaxElement_VLC (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_TotalZeros (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_TotalZerosChromaDC (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_Run (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_NumCoeffTrailingOnes (SyntaxElement *se, DataPartition *this_dataPart)
int writeSyntaxElement_NumCoeffTrailingOnesChromaDC (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 reset_mb_nz_coeff (int mb_number)


Detailed Description

Prototypes for VLC coding funtions.

Author:
Karsten Suehring

Definition in file vlc.h.


Function Documentation

void CAVLC_init ( void   ) 

Initializes the img->nz_coeff.

Input:
none
Output:
none \ side effects sets omg->nz_coef[][][][] to -1

Definition at line 793 of file lencod.c.

References ImageParameters::num_blk8x8_uv, ImageParameters::nz_coeff, and ImageParameters::PicSizeInMbs.

Referenced by start_slice().

void cbp_linfo_inter ( 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, ue_linfo(), and ImageParameters::yuv_format.

Referenced by writeCBP_VLC().

Here is the call graph for this function:

void cbp_linfo_intra ( 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, ue_linfo(), and ImageParameters::yuv_format.

Referenced by writeCBP_VLC().

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 327 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 386 of file vlc.c.

Referenced by dct_4x4_sp().

void reset_mb_nz_coeff ( 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 437 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(), cbp_linfo_intra(), 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 496 of file vlc.c.

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

Referenced by init_slice().

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 526 of file vlc.c.

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

Referenced by init_slice().

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 720 of file vlc.c.

References syntaxelement::len.

Referenced by init_slice().

void writeSE_Fix ( SyntaxElement *  se,
Bitstream *  bitstream 
)

generates UVLC code and passes the codeword to the buffer

Author:
Tian Dong

Definition at line 734 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 678 of file vlc.c.

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

Referenced by init_slice(), and writeMBLayer().

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 699 of file vlc.c.

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

Referenced by init_slice().

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 474 of file vlc.c.

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

Referenced by init_slice().

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 452 of file vlc.c.

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

Referenced by end_macroblock(), init_slice(), Partition_BC_Header(), and writeMBLayer().

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 659 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 563 of file vlc.c.

References syntaxelement::inf, syntaxelement::len, syntaxelement::mapping, 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 1210 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

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 1279 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

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 806 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

Here is the call graph for this function:

int writeSyntaxElement_NumCoeffTrailingOnesChromaDC ( SyntaxElement *  se,
DataPartition *  this_dataPart 
)

write VLC for NumCoeff and TrailingOnes for Chroma DC

Definition at line 904 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

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 1153 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

Here is the call graph for this function:

int writeSyntaxElement_TotalZeros ( SyntaxElement *  se,
DataPartition *  this_dataPart 
)

write VLC for TotalZeros

Definition at line 980 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

Here is the call graph for this function:

int writeSyntaxElement_TotalZerosChromaDC ( SyntaxElement *  se,
DataPartition *  this_dataPart 
)

write VLC for TotalZeros for Chroma DC

Definition at line 1053 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

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 779 of file vlc.c.

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

Referenced by writeCoeff4x4_CAVLC().

Here is the call graph for this function:

void writeUVLC2buffer ( SyntaxElement *  se,
Bitstream *  currStream 
)

void writeVlcByteAlign ( Bitstream *  currStream,
StatParameters *  cur_stats 
)

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

Parameters:
currStream the Bitstream the alignment should be established
cur_stats currently used statistics parameters

Definition at line 1423 of file vlc.c.

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

Referenced by start_slice().


Documentation generated with DoxyGen