00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CABAC_H_
00021 #define _CABAC_H_
00022
00023 static const byte maxpos [] = {15, 14, 63, 31, 31, 15, 3, 14, 7, 15, 15, 14, 63, 31, 31, 15, 15, 14, 63, 31, 31, 15};
00024 static const byte c1isdc [] = { 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1};
00025
00026 static const byte type2ctx_bcbp[] = { 0, 1, 2, 3, 3, 4, 5, 6, 5, 5, 10, 11, 12, 13, 13, 14, 16, 17, 18, 19, 19, 20};
00027 static const byte type2ctx_map [] = { 0, 1, 2, 3, 4, 5, 6, 7, 6, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
00028 static const byte type2ctx_last[] = { 0, 1, 2, 3, 4, 5, 6, 7, 6, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
00029 static const byte type2ctx_one [] = { 0, 1, 2, 3, 3, 4, 5, 6, 5, 5, 10, 11, 12, 13, 13, 14, 16, 17, 18, 19, 19, 20};
00030 static const byte type2ctx_abs [] = { 0, 1, 2, 3, 3, 4, 5, 6, 5, 5, 10, 11, 12, 13, 13, 14, 16, 17, 18, 19, 19, 20};
00031 static const byte max_c2 [] = { 4, 4, 4, 4, 4, 4, 3, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4};
00032
00033
00034 extern const byte* pos2ctx_map [];
00035 extern const byte* pos2ctx_map_int [];
00036 extern const byte* pos2ctx_last [];
00037
00038
00039 extern MotionInfoContexts* create_contexts_MotionInfo (void);
00040 extern TextureInfoContexts* create_contexts_TextureInfo(void);
00041
00042 extern void delete_contexts_MotionInfo (MotionInfoContexts *enco_ctx);
00043 extern void delete_contexts_TextureInfo (TextureInfoContexts *enco_ctx);
00044 extern void writeMB_I_typeInfo_CABAC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00045 extern void writeMB_B_typeInfo_CABAC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00046 extern void writeMB_P_typeInfo_CABAC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00047 extern void writeIntraPredMode_CABAC (SyntaxElement *se, DataPartition *dp);
00048 extern void writeB8_typeInfo_CABAC (SyntaxElement *se, DataPartition *dp);
00049 extern void writeB8_B_typeInfo_CABAC (SyntaxElement *se, DataPartition *dp);
00050
00051 extern void writeRefPic_B_CABAC (SyntaxElement *se, DataPartition *dp);
00052 extern void writeRefPic_P_CABAC (SyntaxElement *se, DataPartition *dp);
00053
00054 extern void writeMVD_CABAC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00055 extern void writeCBP_CABAC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00056 extern void writeDquant_CABAC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00057 extern void writeRunLevel_CABAC (Macroblock* currMB, SyntaxElement *se, DataPartition *dp);
00058 extern void writeCIPredMode_CABAC (Macroblock* currMB, SyntaxElement *se, DataPartition *dp);
00059 extern void print_ctx_TextureInfo (TextureInfoContexts *enco_ctx);
00060 extern void writeMB_Pskip_flagInfo_CABAC(Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00061 extern void writeMB_Bskip_flagInfo_CABAC(Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00062 extern void writeFieldModeInfo_CABAC (Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00063 extern void writeCBP_BIT_CABAC (Macroblock *currMB, int b8, int bit, int cbp, EncodingEnvironmentPtr eep_dp, TextureInfoContexts *ctx);
00064
00065 extern void CheckAvailabilityOfNeighborsCABAC (Macroblock* currMB);
00066 extern void writeMB_transform_size_CABAC(Macroblock *currMB, SyntaxElement *se, DataPartition *dp);
00067
00068 extern void write_and_store_CBP_block_bit_444 (Macroblock* currMB, EncodingEnvironmentPtr eep_dp, int type, int cbp_bit, TextureInfoContexts* tex_ctx);
00069 extern void write_and_store_CBP_block_bit (Macroblock* currMB, EncodingEnvironmentPtr eep_dp, int type, int cbp_bit, TextureInfoContexts* tex_ctx);
00070
00071
00072 #endif // CABAC_H
00073