00001
00020 #ifndef _BIARIDECOD_H_
00021 #define _BIARIDECOD_H_
00022
00023
00024
00025
00026
00027
00028
00029
00030 static const byte rLPS_table_64x4[64][4]=
00031 {
00032 { 128, 176, 208, 240},
00033 { 128, 167, 197, 227},
00034 { 128, 158, 187, 216},
00035 { 123, 150, 178, 205},
00036 { 116, 142, 169, 195},
00037 { 111, 135, 160, 185},
00038 { 105, 128, 152, 175},
00039 { 100, 122, 144, 166},
00040 { 95, 116, 137, 158},
00041 { 90, 110, 130, 150},
00042 { 85, 104, 123, 142},
00043 { 81, 99, 117, 135},
00044 { 77, 94, 111, 128},
00045 { 73, 89, 105, 122},
00046 { 69, 85, 100, 116},
00047 { 66, 80, 95, 110},
00048 { 62, 76, 90, 104},
00049 { 59, 72, 86, 99},
00050 { 56, 69, 81, 94},
00051 { 53, 65, 77, 89},
00052 { 51, 62, 73, 85},
00053 { 48, 59, 69, 80},
00054 { 46, 56, 66, 76},
00055 { 43, 53, 63, 72},
00056 { 41, 50, 59, 69},
00057 { 39, 48, 56, 65},
00058 { 37, 45, 54, 62},
00059 { 35, 43, 51, 59},
00060 { 33, 41, 48, 56},
00061 { 32, 39, 46, 53},
00062 { 30, 37, 43, 50},
00063 { 29, 35, 41, 48},
00064 { 27, 33, 39, 45},
00065 { 26, 31, 37, 43},
00066 { 24, 30, 35, 41},
00067 { 23, 28, 33, 39},
00068 { 22, 27, 32, 37},
00069 { 21, 26, 30, 35},
00070 { 20, 24, 29, 33},
00071 { 19, 23, 27, 31},
00072 { 18, 22, 26, 30},
00073 { 17, 21, 25, 28},
00074 { 16, 20, 23, 27},
00075 { 15, 19, 22, 25},
00076 { 14, 18, 21, 24},
00077 { 14, 17, 20, 23},
00078 { 13, 16, 19, 22},
00079 { 12, 15, 18, 21},
00080 { 12, 14, 17, 20},
00081 { 11, 14, 16, 19},
00082 { 11, 13, 15, 18},
00083 { 10, 12, 15, 17},
00084 { 10, 12, 14, 16},
00085 { 9, 11, 13, 15},
00086 { 9, 11, 12, 14},
00087 { 8, 10, 12, 14},
00088 { 8, 9, 11, 13},
00089 { 7, 9, 11, 12},
00090 { 7, 9, 10, 12},
00091 { 7, 8, 10, 11},
00092 { 6, 8, 9, 11},
00093 { 6, 7, 9, 10},
00094 { 6, 7, 8, 9},
00095 { 2, 2, 2, 2}
00096 };
00097
00098
00099 static const byte AC_next_state_MPS_64[64] =
00100 {
00101 1,2,3,4,5,6,7,8,9,10,
00102 11,12,13,14,15,16,17,18,19,20,
00103 21,22,23,24,25,26,27,28,29,30,
00104 31,32,33,34,35,36,37,38,39,40,
00105 41,42,43,44,45,46,47,48,49,50,
00106 51,52,53,54,55,56,57,58,59,60,
00107 61,62,62,63
00108 };
00109
00110
00111 static const byte AC_next_state_LPS_64[64] =
00112 {
00113 0, 0, 1, 2, 2, 4, 4, 5, 6, 7,
00114 8, 9, 9,11,11,12,13,13,15,15,
00115 16,16,18,18,19,19,21,21,22,22,
00116 23,24,24,25,26,26,27,27,28,29,
00117 29,30,30,30,31,32,32,33,33,33,
00118 34,34,35,35,35,36,36,36,37,37,
00119 37,38,38,63
00120 };
00121
00122 static const byte renorm_table_32[32]={6,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
00123
00124
00125 extern void arideco_start_decoding(DecodingEnvironmentPtr eep, unsigned char *code_buffer, int firstbyte, int *code_len);
00126 extern int arideco_bits_read(DecodingEnvironmentPtr dep);
00127 extern void arideco_done_decoding(DecodingEnvironmentPtr dep);
00128 extern void biari_init_context (int qp, BiContextTypePtr ctx, const char* ini);
00129 extern unsigned int biari_decode_symbol(DecodingEnvironmentPtr dep, BiContextTypePtr bi_ct );
00130 extern unsigned int biari_decode_symbol_eq_prob(DecodingEnvironmentPtr dep);
00131 extern unsigned int biari_decode_final(DecodingEnvironmentPtr dep);
00132 extern unsigned int getbyte(DecodingEnvironmentPtr dep);
00133 extern unsigned int getword(DecodingEnvironmentPtr dep);
00134 #endif // BIARIDECOD_H_
00135