00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00028 #include "mqc.h"
00029
00030 typedef struct {
00031 uint16_t qe;
00032 uint8_t nmps;
00033 uint8_t nlps;
00034 uint8_t sw;
00035 } MqcCxState;
00036
00037 const static MqcCxState cx_states[47] = {
00038 {0x5601, 1, 1, 1},
00039 {0x3401, 2, 6, 0},
00040 {0x1801, 3, 9, 0},
00041 {0x0AC1, 4, 12, 0},
00042 {0x0521, 5, 29, 0},
00043 {0x0221, 38, 33, 0},
00044 {0x5601, 7, 6, 1},
00045 {0x5401, 8, 14, 0},
00046 {0x4801, 9, 14, 0},
00047 {0x3801, 10, 14, 0},
00048 {0x3001, 11, 17, 0},
00049 {0x2401, 12, 18, 0},
00050 {0x1C01, 13, 20, 0},
00051 {0x1601, 29, 21, 0},
00052 {0x5601, 15, 14, 1},
00053 {0x5401, 16, 14, 0},
00054 {0x5101, 17, 15, 0},
00055 {0x4801, 18, 16, 0},
00056 {0x3801, 19, 17, 0},
00057 {0x3401, 20, 18, 0},
00058 {0x3001, 21, 19, 0},
00059 {0x2801, 22, 19, 0},
00060 {0x2401, 23, 20, 0},
00061 {0x2201, 24, 21, 0},
00062 {0x1C01, 25, 22, 0},
00063 {0x1801, 26, 23, 0},
00064 {0x1601, 27, 24, 0},
00065 {0x1401, 28, 25, 0},
00066 {0x1201, 29, 26, 0},
00067 {0x1101, 30, 27, 0},
00068 {0x0AC1, 31, 28, 0},
00069 {0x09C1, 32, 29, 0},
00070 {0x08A1, 33, 30, 0},
00071 {0x0521, 34, 31, 0},
00072 {0x0441, 35, 32, 0},
00073 {0x02A1, 36, 33, 0},
00074 {0x0221, 37, 34, 0},
00075 {0x0141, 38, 35, 0},
00076 {0x0111, 39, 36, 0},
00077 {0x0085, 40, 37, 0},
00078 {0x0049, 41, 38, 0},
00079 {0x0025, 42, 39, 0},
00080 {0x0015, 43, 40, 0},
00081 {0x0009, 44, 41, 0},
00082 {0x0005, 45, 42, 0},
00083 {0x0001, 45, 43, 0},
00084 {0x5601, 46, 46, 0}
00085 };
00086
00087 uint16_t ff_mqc_qe [2*47];
00088 uint8_t ff_mqc_nlps[2*47];
00089 uint8_t ff_mqc_nmps[2*47];
00090
00091 void ff_mqc_init_contexts(MqcState *mqc)
00092 {
00093 int i;
00094 memset(mqc->cx_states, 0, sizeof(mqc->cx_states));
00095 mqc->cx_states[MQC_CX_UNI] = 2 * 46;
00096 mqc->cx_states[MQC_CX_RL] = 2 * 3;
00097 mqc->cx_states[0] = 2 * 4;
00098
00099 for (i = 0; i < 47; i++){
00100 ff_mqc_qe[2*i ] =
00101 ff_mqc_qe[2*i+1] = cx_states[i].qe;
00102
00103 ff_mqc_nlps[2*i ] = 2*cx_states[i].nlps + cx_states[i].sw;
00104 ff_mqc_nlps[2*i+1] = 2*cx_states[i].nlps + 1 - cx_states[i].sw;
00105 ff_mqc_nmps[2*i ] = 2*cx_states[i].nmps;
00106 ff_mqc_nmps[2*i+1] = 2*cx_states[i].nmps + 1;
00107 }
00108 }