00001
00015 #ifndef _VLC_H_
00016 #define _VLC_H_
00017
00019 static const byte NCBP[2][48][2]=
00020 {
00021 {
00022 {15, 0},{ 0, 1},{ 7, 2},{11, 4},{13, 8},{14, 3},{ 3, 5},{ 5,10},{10,12},{12,15},{ 1, 7},{ 2,11},
00023 { 4,13},{ 8,14},{ 6, 6},{ 9, 9},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},
00024 { 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},
00025 { 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0}
00026 },
00027 {
00028 {47, 0},{31,16},{15, 1},{ 0, 2},{23, 4},{27, 8},{29,32},{30, 3},{ 7, 5},{11,10},{13,12},{14,15},
00029 {39,47},{43, 7},{45,11},{46,13},{16,14},{ 3, 6},{ 5, 9},{10,31},{12,35},{19,37},{21,42},{26,44},
00030 {28,33},{35,34},{37,36},{42,40},{44,39},{ 1,43},{ 2,45},{ 4,46},{ 8,17},{17,18},{18,20},{20,24},
00031 {24,19},{ 6,21},{ 9,26},{22,28},{25,23},{32,27},{33,29},{34,30},{36,22},{40,25},{38,38},{41,41}
00032 }
00033 };
00034
00036 static const byte NTAB1[4][8][2] =
00037 {
00038 {{1,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
00039 {{1,1},{1,2},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
00040 {{2,0},{1,3},{1,4},{1,5},{0,0},{0,0},{0,0},{0,0}},
00041 {{3,0},{2,1},{2,2},{1,6},{1,7},{1,8},{1,9},{4,0}},
00042 };
00043
00044 static const byte LEVRUN1[16]=
00045 {
00046 4,2,2,1,1,1,1,1,1,1,0,0,0,0,0,0,
00047 };
00048
00049
00050 static const byte NTAB2[4][8][2] =
00051 {
00052 {{1,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
00053 {{1,1},{2,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
00054 {{1,2},{3,0},{4,0},{5,0},{0,0},{0,0},{0,0},{0,0}},
00055 {{1,3},{1,4},{2,1},{3,1},{6,0},{7,0},{8,0},{9,0}},
00056 };
00057
00059 static const byte LEVRUN3[4] =
00060 {
00061 2,1,0,0
00062 };
00063
00064 static const byte NTAB3[2][2][2] =
00065 {
00066 {{1,0},{0,0}},
00067 {{2,0},{1,1}},
00068 };
00069
00070 extern int se_v (char *tracestring, Bitstream *bitstream);
00071 extern int ue_v (char *tracestring, Bitstream *bitstream);
00072 extern Boolean u_1 (char *tracestring, Bitstream *bitstream);
00073 extern int u_v (int LenInBits, char *tracestring, Bitstream *bitstream);
00074 extern int i_v (int LenInBits, char *tracestring, Bitstream *bitstream);
00075
00076
00077 extern void linfo_ue(int len, int info, int *value1, int *dummy);
00078 extern void linfo_se(int len, int info, int *value1, int *dummy);
00079
00080 extern void linfo_cbp_intra_normal(int len,int info,int *cbp, int *dummy);
00081 extern void linfo_cbp_inter_normal(int len,int info,int *cbp, int *dummy);
00082 extern void linfo_cbp_intra_other(int len,int info,int *cbp, int *dummy);
00083 extern void linfo_cbp_inter_other(int len,int info,int *cbp, int *dummy);
00084
00085 extern void linfo_levrun_inter(int len,int info,int *level,int *irun);
00086 extern void linfo_levrun_c2x2(int len,int info,int *level,int *irun);
00087
00088 extern int uvlc_startcode_follows(Slice *currSlice, int dummy);
00089
00090 extern int readSyntaxElement_VLC (SyntaxElement *sym, Bitstream *currStream);
00091 extern int readSyntaxElement_UVLC(SyntaxElement *sym, ImageParameters *p_Img, struct datapartition *dp);
00092 extern int readSyntaxElement_Intra4x4PredictionMode(SyntaxElement *sym, ImageParameters *p_Img, Bitstream *currStream);
00093
00094 extern int GetVLCSymbol (byte buffer[],int totbitoffset,int *info, int bytecount);
00095 extern int GetVLCSymbol_IntraMode (byte buffer[],int totbitoffset,int *info, int bytecount);
00096
00097 extern int readSyntaxElement_FLC (SyntaxElement *sym, Bitstream *currStream);
00098 extern int readSyntaxElement_NumCoeffTrailingOnes (SyntaxElement *sym, Bitstream *currStream, char *type);
00099 extern int readSyntaxElement_NumCoeffTrailingOnesChromaDC(ImageParameters *p_Img, SyntaxElement *sym, Bitstream *currStream);
00100 extern int readSyntaxElement_Level_VLC0 (SyntaxElement *sym, Bitstream *currStream);
00101 extern int readSyntaxElement_Level_VLCN (SyntaxElement *sym, int vlc, Bitstream *currStream);
00102 extern int readSyntaxElement_TotalZeros (SyntaxElement *sym, Bitstream *currStream);
00103 extern int readSyntaxElement_TotalZerosChromaDC (ImageParameters *p_Img, SyntaxElement *sym, Bitstream *currStream);
00104 extern int readSyntaxElement_Run (SyntaxElement *sym, Bitstream *currStream);
00105 extern int GetBits (byte buffer[],int totbitoffset,int *info, int bitcount, int numbits);
00106 extern int ShowBits (byte buffer[],int totbitoffset,int bitcount, int numbits);
00107
00108 extern int more_rbsp_data (byte buffer[],int totbitoffset,int bytecount);
00109
00110
00111 #endif
00112