1 /************************************************************************
2 *
3 * getvlc.c, variable length code tables for tmndecode (H.263 decoder)
4 * Copyright (C) 1995, 1996 Telenor R&D, Norway
5 * Karl Olav Lillevold <Karl.Lillevold@nta.no>
6 *
7 * Contacts:
8 * Karl Olav Lillevold <Karl.Lillevold@nta.no>, or
9 * Robert Danielsen <Robert.Danielsen@nta.no>
10 *
11 * Telenor Research and Development http://www.nta.no/brukere/DVC/
12 * P.O.Box 83 tel.: +47 63 84 84 00
13 * N-2007 Kjeller, Norway fax.: +47 63 81 00 76
14 *
15 ************************************************************************/
16
17 /*
18 * Disclaimer of Warranty
19 *
20 * These software programs are available to the user without any
21 * license fee or royalty on an "as is" basis. Telenor Research and
22 * Development disclaims any and all warranties, whether express,
23 * implied, or statuary, including any implied warranties or
24 * merchantability or of fitness for a particular purpose. In no
25 * event shall the copyright-holder be liable for any incidental,
26 * punitive, or consequential damages of any kind whatsoever arising
27 * from the use of these programs.
28 *
29 * This disclaimer of warranty extends to the user of these programs
30 * and user's customers, employees, agents, transferees, successors,
31 * and assigns.
32 *
33 * Telenor Research and Development does not represent or warrant that
34 * the programs furnished hereunder are free of infringement of any
35 * third-party patents.
36 *
37 * Commercial implementations of H.263, including shareware, are
38 * subject to royalty fees to patent holders. Many of these patents
39 * are general enough such that they are unavoidable regardless of
40 * implementation design.
41 * */
42
43
44 /*
45 * based on mpeg2decode, (C) 1994, MPEG Software Simulation Group
46 * and mpeg2play, (C) 1994 Stefan Eckart
47 * <stefan@lis.e-technik.tu-muenchen.de>
48 *
49 */
50
51
52
53 #ifdef notdef
54 typedef struct {
55 int val, len;
56 } VLCtab;
57
58 typedef struct {
59 char run, level, len;
60 } DCTtab;
61 #endif
62
63
64 static VLCtab TMNMVtab0[] = {
65 {3,4}, {61,4}, {2,3}, {2,3}, {62,3}, {62,3},
66 {1,2}, {1,2}, {1,2}, {1,2}, {63,2}, {63,2}, {63,2}, {63,2}
67 };
68
69 static VLCtab TMNMVtab1[] = {
70 {12,10}, {52,10}, {11,10}, {53,10}, {10,9}, {10,9},
71 {54,9}, {54,9}, {9,9}, {9,9}, {55,9}, {55,9},
72 {8,9}, {8,9}, {56,9}, {56,9}, {7,7}, {7,7},
73 {7,7}, {7,7}, {7,7}, {7,7}, {7,7}, {7,7},
74 {57,7}, {57,7}, {57,7}, {57,7}, {57,7}, {57,7},
75 {57,7}, {57,7}, {6,7}, {6,7}, {6,7}, {6,7},
76 {6,7}, {6,7}, {6,7}, {6,7}, {58,7}, {58,7},
77 {58,7}, {58,7}, {58,7}, {58,7}, {58,7}, {58,7},
78 {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7},
79 {5,7}, {5,7}, {59,7}, {59,7}, {59,7}, {59,7},
80 {59,7}, {59,7}, {59,7}, {59,7}, {4,6}, {4,6},
81 {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6},
82 {4,6}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6},
83 {4,6}, {4,6}, {60,6}, {60,6},{60,6},{60,6},
84 {60,6},{60,6},{60,6},{60,6},{60,6},{60,6},
85 {60,6},{60,6},{60,6},{60,6},{60,6},{60,6}
86 };
87
88 static VLCtab TMNMVtab2[] = {
89 {32,12}, {31,12}, {33,12}, {30,11}, {30,11}, {34,11},
90 {34,11}, {29,11}, {29,11}, {35,11}, {35,11}, {28,11},
91 {28,11}, {36,11}, {36,11}, {27,11}, {27,11}, {37,11},
92 {37,11}, {26,11}, {26,11}, {38,11}, {38,11}, {25,11},
93 {25,11}, {39,11}, {39,11}, {24,10}, {24,10}, {24,10},
94 {24,10}, {40,10}, {40,10}, {40,10}, {40,10}, {23,10},
95 {23,10}, {23,10}, {23,10}, {41,10}, {41,10}, {41,10},
96 {41,10}, {22,10}, {22,10}, {22,10}, {22,10}, {42,10},
97 {42,10}, {42,10}, {42,10}, {21,10}, {21,10}, {21,10},
98 {21,10}, {43,10}, {43,10}, {43,10}, {43,10}, {20,10},
99 {20,10}, {20,10}, {20,10}, {44,10}, {44,10}, {44,10},
100 {44,10}, {19,10}, {19,10}, {19,10}, {19,10}, {45,10},
101 {45,10}, {45,10}, {45,10}, {18,10}, {18,10}, {18,10},
102 {18,10}, {46,10}, {46,10}, {46,10}, {46,10}, {17,10},
103 {17,10}, {17,10}, {17,10}, {47,10}, {47,10}, {47,10},
104 {47,10}, {16,10}, {16,10}, {16,10}, {16,10}, {48,10},
105 {48,10}, {48,10}, {48,10}, {15,10}, {15,10}, {15,10},
106 {15,10}, {49,10}, {49,10}, {49,10}, {49,10}, {14,10},
107 {14,10}, {14,10}, {14,10}, {50,10}, {50,10}, {50,10},
108 {50,10}, {13,10}, {13,10}, {13,10}, {13,10}, {51,10},
109 {51,10}, {51,10}, {51,10}
110 };
111
112
113 static VLCtab MCBPCtab[] = {
114 {-1,0},
115 {255,9}, {52,9}, {36,9}, {20,9}, {49,9}, {35,8}, {35,8}, {19,8}, {19,8},
116 {50,8}, {50,8}, {51,7}, {51,7}, {51,7}, {51,7}, {34,7}, {34,7}, {34,7},
117 {34,7}, {18,7}, {18,7}, {18,7}, {18,7}, {33,7}, {33,7}, {33,7}, {33,7},
118 {17,7}, {17,7}, {17,7}, {17,7}, {4,6}, {4,6}, {4,6}, {4,6}, {4,6},
119 {4,6}, {4,6}, {4,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6}, {48,6},
120 {48,6}, {48,6}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5},
121 {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5}, {3,5},
122 {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
123 {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
124 {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {32,4},
125 {32,4}, {32,4}, {32,4}, {32,4}, {32,4}, {16,4}, {16,4}, {16,4}, {16,4},
126 {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
127 {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
128 {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4}, {16,4},
129 {16,4}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
130 {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
131 {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
132 {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
133 {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
134 {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
135 {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3}, {2,3},
136 {2,3}, {2,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
137 {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
138 {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
139 {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
140 {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
141 {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
142 {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3},
143 {1,3}, {1,3}, {1,3},
144 };
145
146
147
148 static VLCtab MCBPCtabintra[] = {
149 {-1,0},
150 {20,6}, {36,6}, {52,6}, {4,4}, {4,4}, {4,4},
151 {4,4}, {19,3}, {19,3}, {19,3}, {19,3}, {19,3},
152 {19,3}, {19,3}, {19,3}, {35,3}, {35,3}, {35,3},
153 {35,3}, {35,3}, {35,3}, {35,3}, {35,3}, {51,3},
154 {51,3}, {51,3}, {51,3}, {51,3}, {51,3}, {51,3},
155 {51,3},
156 };
157
158
159
160 static VLCtab CBPYtab[48] =
161 { {-1,0}, {-1,0}, {9,6}, {6,6}, {7,5}, {7,5}, {11,5}, {11,5},
162 {13,5}, {13,5}, {14,5}, {14,5}, {15,4}, {15,4}, {15,4}, {15,4},
163 {3,4}, {3,4}, {3,4}, {3,4}, {5,4},{5,4},{5,4},{5,4},
164 {1,4}, {1,4}, {1,4}, {1,4}, {10,4}, {10,4}, {10,4}, {10,4},
165 {2,4}, {2,4}, {2,4}, {2,4}, {12,4}, {12,4}, {12,4}, {12,4},
166 {4,4}, {4,4}, {4,4}, {4,4}, {8,4}, {8,4}, {8,4}, {8,4},
167 };
168
169
170 #ifdef VLCTABLE
171 VLCtab DCT3Dtab0[] = {
172 {4225,7}, {4209,7}, {4193,7}, {4177,7}, {193,7}, {177,7},
173 {161,7}, {4,7}, {4161,6}, {4161,6}, {4145,6}, {4145,6},
174 {4129,6}, {4129,6}, {4113,6}, {4113,6}, {145,6}, {145,6},
175 {129,6}, {129,6}, {113,6}, {113,6}, {97,6}, {97,6},
176 {18,6}, {18,6}, {3,6}, {3,6}, {81,5}, {81,5},
177 {81,5}, {81,5}, {65,5}, {65,5}, {65,5}, {65,5},
178 {49,5}, {49,5}, {49,5}, {49,5}, {4097,4}, {4097,4},
179 {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4}, {4097,4},
180 {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2},
181 {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2},
182 {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2},
183 {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2},
184 {1,2}, {1,2}, {1,2}, {1,2}, {1,2}, {1,2},
185 {1,2}, {1,2}, {17,3}, {17,3}, {17,3}, {17,3},
186 {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3},
187 {17,3}, {17,3}, {17,3}, {17,3}, {17,3}, {17,3},
188 {33,4}, {33,4}, {33,4}, {33,4}, {33,4}, {33,4},
189 {33,4}, {33,4}, {2,4}, {2,4},{2,4},{2,4},
190 {2,4}, {2,4},{2,4},{2,4},
191 };
192
193
194 VLCtab DCT3Dtab1[] = {
195 {9,10}, {8,10}, {4481,9}, {4481,9}, {4465,9}, {4465,9},
196 {4449,9}, {4449,9}, {4433,9}, {4433,9}, {4417,9}, {4417,9},
197 {4401,9}, {4401,9}, {4385,9}, {4385,9}, {4369,9}, {4369,9},
198 {4098,9}, {4098,9}, {353,9}, {353,9}, {337,9}, {337,9},
199 {321,9}, {321,9}, {305,9}, {305,9}, {289,9}, {289,9},
200 {273,9}, {273,9}, {257,9}, {257,9}, {241,9}, {241,9},
201 {66,9}, {66,9}, {50,9}, {50,9}, {7,9}, {7,9},
202 {6,9}, {6,9}, {4353,8}, {4353,8}, {4353,8}, {4353,8},
203 {4337,8}, {4337,8}, {4337,8}, {4337,8}, {4321,8}, {4321,8},
204 {4321,8}, {4321,8}, {4305,8}, {4305,8}, {4305,8}, {4305,8},
205 {4289,8}, {4289,8}, {4289,8}, {4289,8}, {4273,8}, {4273,8},
206 {4273,8}, {4273,8}, {4257,8}, {4257,8}, {4257,8}, {4257,8},
207 {4241,8}, {4241,8}, {4241,8}, {4241,8}, {225,8}, {225,8},
208 {225,8}, {225,8}, {209,8}, {209,8}, {209,8}, {209,8},
209 {34,8}, {34,8}, {34,8}, {34,8}, {19,8}, {19,8},
210 {19,8}, {19,8}, {5,8}, {5,8}, {5,8}, {5,8},
211 };
212
213
214 VLCtab DCT3Dtab2[] = {
215 {4114,11}, {4114,11}, {4099,11}, {4099,11}, {11,11}, {11,11},
216 {10,11}, {10,11}, {4545,10}, {4545,10}, {4545,10}, {4545,10},
217 {4529,10}, {4529,10}, {4529,10}, {4529,10}, {4513,10}, {4513,10},
218 {4513,10}, {4513,10}, {4497,10}, {4497,10}, {4497,10}, {4497,10},
219 {146,10}, {146,10}, {146,10}, {146,10}, {130,10}, {130,10},
220 {130,10}, {130,10}, {114,10}, {114,10}, {114,10}, {114,10},
221 {98,10}, {98,10}, {98,10}, {98,10}, {82,10}, {82,10},
222 {82,10}, {82,10}, {51,10}, {51,10}, {51,10}, {51,10},
223 {35,10}, {35,10}, {35,10}, {35,10}, {20,10}, {20,10},
224 {20,10}, {20,10}, {12,11}, {12,11}, {21,11}, {21,11},
225 {369,11}, {369,11}, {385,11}, {385,11}, {4561,11}, {4561,11},
226 {4577,11}, {4577,11}, {4593,11}, {4593,11}, {4609,11}, {4609,11},
227 {22,12}, {36,12}, {67,12}, {83,12}, {99,12}, {162,12},
228 {401,12}, {417,12}, {4625,12}, {4641,12}, {4657,12}, {4673,12},
229 {4689,12}, {4705,12}, {4721,12}, {4737,12}, {7167,7},
230 {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7},
231 {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7},
232 {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7},
233 {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7},
234 {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7}, {7167,7},
235 {7167,7}, };
236
237 #endif
238
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.