00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _BIARIENCOD_H_
00024 #define _BIARIENCOD_H_
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #define B_BITS 10 // Number of bits to represent the whole coding interval
00035 #define BITS_TO_LOAD 16
00036 #define MAX_BITS 26 //(B_BITS + BITS_TO_LOAD)
00037 #define MASK_BITS 18 //(MAX_BITS - 8)
00038 #define ONE 0x04000000 //(1 << MAX_BITS)
00039 #define ONE_M1 0x03FFFFFF //(ONE - 1)
00040 #define HALF 0x01FE //(1 << (B_BITS-1)) - 2
00041 #define QUARTER 0x0100 //(1 << (B_BITS-2))
00042 #define MIN_BITS_TO_GO 0
00043 #define B_LOAD_MASK 0xFFFF // ((1<<BITS_TO_LOAD) - 1)
00044
00045 extern int get_pic_bin_count(ImageParameters *p_Img);
00046 extern void reset_pic_bin_count(ImageParameters *p_Img);
00047 extern void set_pic_bin_count (ImageParameters *p_Img, EncodingEnvironmentPtr eep);
00048
00049 extern void arienco_start_encoding(EncodingEnvironmentPtr eep, unsigned char *code_buffer, int *code_len);
00050 extern void arienco_reset_EC (EncodingEnvironmentPtr eep);
00051 extern void arienco_done_encoding (Macroblock *currMB, EncodingEnvironmentPtr eep);
00052 extern void biari_init_context (int qp, BiContextTypePtr ctx, const char* ini);
00053 extern void biari_encode_symbol (EncodingEnvironmentPtr eep, signed short symbol, BiContextTypePtr bi_ct );
00054 extern void biari_encode_symbol_eq_prob(EncodingEnvironmentPtr eep, signed short symbol);
00055 extern void biari_encode_symbol_final(EncodingEnvironmentPtr eep, signed short symbol);
00056
00057
00058
00059
00060
00061
00062
00063 static inline int arienco_bits_written(EncodingEnvironmentPtr eep)
00064 {
00065 return (((*eep->Ecodestrm_len) + eep->Epbuf + 1) << 3) + (eep->Echunks_outstanding * BITS_TO_LOAD) + BITS_TO_LOAD - eep->Ebits_to_go;
00066 }
00067
00068 #endif // BIARIENCOD_H
00069