00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 typedef struct
00055 {
00056 unsigned int code;
00057 int len;
00058 } VLCtable;
00059
00060
00061
00062
00063 static VLCtable mvtab[33] =
00064 {
00065 {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
00066 {11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10},
00067 {12,10}, {11,10}, {10,10}, {9,10}, {8,10}, {7,10}, {6,10}, {5,10},
00068 {4,10}, {7,11}, {6,11}, {5,11}, {4,11}, {3,11}, {2,11}, {3,12},
00069 {2,12}
00070 };
00071
00072
00073
00074
00075
00076
00077 static VLCtable cbpcm_intra_tab[15] =
00078 {
00079 {0x01,9}, {0x01,1}, {0x01,4}, {0x00,0},
00080 {0x00,0}, {0x01,3}, {0x01,6}, {0x00,0},
00081 {0x00,0}, {0x02,3}, {0x02,6}, {0x00,0},
00082 {0x00,0}, {0x03,3}, {0x03,6}
00083 };
00084
00085
00086
00087
00088
00089 static VLCtable cbpcm_inter_tab[29] =
00090 {
00091 {1,1}, {3,3}, {2,3}, {3,5}, {4,6}, {1,9}, {0,0}, {0,0},
00092 {3,4}, {7,7}, {5,7}, {4,8}, {4,9}, {0,0}, {0,0}, {0,0},
00093 {2,4}, {6,7}, {4,7}, {3,8}, {3,9}, {0,0}, {0,0}, {0,0},
00094 {5,6}, {5,9}, {5,8}, {3,7}, {2,9}
00095 };
00096
00097
00098
00099
00100 static VLCtable cbpy_tab[16] =
00101 {
00102 {3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4},
00103 {2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
00104 };
00105
00106
00107
00108
00109
00110
00111
00112 static VLCtable coeff_tab0[2][12] =
00113 {
00114
00115 {
00116 {0x02, 2}, {0x0f, 4}, {0x15, 6}, {0x17, 7},
00117 {0x1f, 8}, {0x25, 9}, {0x24, 9}, {0x21,10},
00118 {0x20,10}, {0x07,11}, {0x06,11}, {0x20,11}
00119 },
00120
00121 {
00122 {0x06, 3}, {0x14, 6}, {0x1e, 8}, {0x0f,10},
00123 {0x21,11}, {0x50,12}, {0x00, 0}, {0x00, 0},
00124 {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00125 }
00126 };
00127
00128
00129
00130 static VLCtable coeff_tab1[25][4] =
00131 {
00132
00133 {
00134 {0x0e, 4}, {0x1d, 8}, {0x0e,10}, {0x51,12}
00135 },
00136
00137 {
00138 {0x0d, 5}, {0x23, 9}, {0x0d,10}, {0x00, 0}
00139 },
00140
00141 {
00142 {0x0c, 5}, {0x22, 9}, {0x52,12}, {0x00, 0}
00143 },
00144 {
00145 {0x0b, 5}, {0x0c,10}, {0x53,12}, {0x00, 0}
00146 },
00147 {
00148 {0x13, 6}, {0x0b,10}, {0x54,12}, {0x00, 0}
00149 },
00150 {
00151 {0x12, 6}, {0x0a,10}, {0x00, 0}, {0x00, 0}
00152 },
00153 {
00154 {0x11, 6}, {0x09,10}, {0x00, 0}, {0x00, 0}
00155 },
00156 {
00157 {0x10, 6}, {0x08,10}, {0x00, 0}, {0x00, 0}
00158 },
00159 {
00160 {0x16, 7}, {0x55,12}, {0x00, 0}, {0x00, 0}
00161 },
00162 {
00163 {0x15, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00164 },
00165 {
00166 {0x14, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00167 },
00168 {
00169 {0x1c, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00170 },
00171 {
00172 {0x1b, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00173 },
00174 {
00175 {0x21, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00176 },
00177 {
00178 {0x20, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00179 },
00180 {
00181 {0x1f, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00182 },
00183 {
00184 {0x1e, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00185 },
00186 {
00187 {0x1d, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00188 },
00189 {
00190 {0x1c, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00191 },
00192 {
00193 {0x1b, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00194 },
00195 {
00196 {0x1a, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00197 },
00198 {
00199 {0x22,11}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00200 },
00201 {
00202 {0x23,11}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00203 },
00204 {
00205 {0x56,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00206 },
00207 {
00208 {0x57,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}
00209 }
00210 };
00211
00212
00213
00214 static VLCtable coeff_tab2[2][3] =
00215 {
00216
00217 {
00218 {0x07, 4}, {0x19, 9}, {0x05,11}
00219 },
00220
00221 {
00222 {0x0f, 6}, {0x04,11}, {0x00, 0}
00223 }
00224 };
00225
00226
00227
00228 static VLCtable coeff_tab3[40] =
00229 {
00230 {0x0e, 6}, {0x0d, 6}, {0x0c, 6},
00231 {0x13, 7}, {0x12, 7}, {0x11, 7}, {0x10, 7},
00232 {0x1a, 8}, {0x19, 8}, {0x18, 8}, {0x17, 8},
00233 {0x16, 8}, {0x15, 8}, {0x14, 8}, {0x13, 8},
00234 {0x18, 9}, {0x17, 9}, {0x16, 9}, {0x15, 9},
00235 {0x14, 9}, {0x13, 9}, {0x12, 9}, {0x11, 9},
00236 {0x07,10}, {0x06,10}, {0x05,10}, {0x04,10},
00237 {0x24,11}, {0x25,11}, {0x26,11}, {0x27,11},
00238 {0x58,12}, {0x59,12}, {0x5a,12}, {0x5b,12},
00239 {0x5c,12}, {0x5d,12}, {0x5e,12}, {0x5f,12},
00240 {0x00, 0}
00241 };