armVCM4P2_Huff_Tables_VLC.c revision 78e52bfac041d71ce53b5b13c2abf78af742b09d
1/*
2 * Copyright (C) 2007-2008 ARM Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17 /**
18 *
19 * File Name:  armVCM4P2_Huff_Tables_VLC.c
20 * OpenMAX DL: v1.0.2
21 * Revision:   9641
22 * Date:       Thursday, February 7, 2008
23 *
24 *
25 *
26 *
27 * File:        armVCM4P2_Huff_Tables_VLC.c
28 * Description: Contains all the Huffman tables used in MPEG4 codec
29 *
30 */
31
32#include "omxtypes.h"
33#include "armOMX.h"
34
35#include "armCOMM_Bitstream.h"
36
37/*
38*  For Intra
39*  last = 0
40*/
41const OMX_U8 armVCM4P2_IntraL0RunIdx[11] =
42{
43    0, 27, 37, 42, 46, 49, 52,
44    55, 58, 60, 62
45};
46
47/* Entry defined for all values
48*  for run = 0 to 14
49*  Note: the last entry is to terminate while decoding
50*/
51const ARM_VLC32 armVCM4P2_IntraVlcL0[68] =
52{
53        {2,    2},
54        {3,    6},
55        {4,    15},
56        {5,    13},
57        {5,    12},
58        {6,    21},
59        {6,    19},
60        {6,    18},
61        {7,    23},
62        {8,    31},
63        {8,    30},
64        {8,    29},
65        {9,    37},
66        {9,    36},
67        {9,    35},
68        {9,    33},
69        {10,   33},
70        {10,   32},
71        {10,   15},
72        {10,   14},
73        {11,    7},
74        {11,    6},
75        {11,   32},
76        {11,   33},
77        {12,   80},
78        {12,   81},
79        {12,   82},
80        {4,    14},
81        {6,    20},
82        {7,    22},
83        {8,    28},
84        {9,    32},
85        {9,    31},
86        {10,   13},
87        {11,   34},
88        {12,   83},
89        {12,   85},
90        {5,    11},
91        {7,    21},
92        {9,    30},
93        {10,   12},
94        {12,   86},
95        {6,    17},
96        {8,    27},
97        {9,    29},
98        {10,   11},
99        {6,    16},
100        {9,    34},
101        {10,   10},
102        {6,    13},
103        {9,    28},
104        {10,    8},
105        {7,    18},
106        {9,    27},
107        {12,   84},
108        {7,    20},
109        {9,    26},
110        {12,   87},
111        {8,    25},
112        {10,    9},
113        {8,    24},
114        {11,   35},
115        {8,    23},
116        {9,    25},
117        {9,    24},
118        {10,    7},
119        {12,   88},
120        {0,     0}
121};
122
123/*
124*  For Intra
125*  last = 1
126*/
127
128const OMX_U8 armVCM4P2_IntraL1RunIdx[8] =
129{
130    0,  8, 11, 13, 15, 17, 19, 21
131};
132
133/* Entry defined for all values
134*  for run = 0 to 20
135*  *  Note: the last entry is to terminate while decoding
136*/
137const ARM_VLC32 armVCM4P2_IntraVlcL1[36] =
138{
139        {4,     7},
140        {6,    12},
141        {8,    22},
142        {9,    23},
143        {10,    6},
144        {11,    5},
145        {11,    4},
146        {12,   89},
147        {6,    15},
148        {9,    22},
149        {10,    5},
150        {6,    14},
151        {10,    4},
152        {7,    17},
153        {11,   36},
154        {7,    16},
155        {11,   37},
156        {7,    19},
157        {12,   90},
158        {8,    21},
159        {12,   91},
160        {8,    20},
161        {8,    19},
162        {8,    26},
163        {9,    21},
164        {9,    20},
165        {9,    19},
166        {9,    18},
167        {9,    17},
168        {11,   38},
169        {11,   39},
170        {12,   92},
171        {12,   93},
172        {12,   94},
173        {12,   95},
174        {0,     0}
175};
176
177/* LMAX table for Intra (Last == 0)*/
178const OMX_U8 armVCM4P2_IntraL0LMAX[15] =
179{
180   27, 10,  5,  4,  3,  3,  3,
181    3,  2,  2,  1,  1,  1,  1,  1
182};
183
184/* LMAX table for Intra (Last == 1)*/
185const OMX_U8 armVCM4P2_IntraL1LMAX[21] =
186{
187    8,  3,  2,  2,  2,  2,  2,  1,
188	1,  1,  1,  1,  1,  1,  1,  1,
189	1,  1,  1,  1,  1
190};
191
192/* RMAX table for Intra (Last == 0)
193   Level - 1 Indexed
194*/
195const OMX_U8 armVCM4P2_IntraL0RMAX[27] =
196{
197   14,  9,  7,  3,  2,  1,	1,
198    1,  1,  1,  0,  0,  0, 	0,
199    0,  0,  0,  0,  0,  0,  0,
200    0,  0,  0,  0,  0,  0
201};
202
203/* RMAX table for Intra (Last == 1)
204   Level - 1 Indexed
205*/
206const OMX_U8 armVCM4P2_IntraL1RMAX[8] =
207{
208   20,  6,  1,  0,  0,  0,  0,  0
209};
210
211/*
212*  For Inter
213*  last = 0
214*/
215const OMX_U8 armVCM4P2_InterL0RunIdx[12] =
216{
217     0,  12,  18,  22,  25,  28,
218    31,  34,  36,  38,  40,  42
219};
220
221/* Entry defined for all values
222*  for run = 0 to 26
223*  Note: the last entry is to terminate while decoding
224*/
225const ARM_VLC32 armVCM4P2_InterVlcL0[59] =
226{
227        {2,     2},
228        {4,    15},
229        {6,    21},
230        {7,    23},
231        {8,    31},
232        {9,    37},
233        {9,    36},
234        {10,   33},
235        {10,   32},
236        {11,    7},
237        {11,    6},
238        {11,   32},
239        {3,     6},
240        {6,    20},
241        {8,    30},
242        {10,   15},
243        {11,   33},
244        {12,   80},
245        {4,    14},
246        {8,    29},
247        {10,   14},
248        {12,   81},
249        {5,    13},
250        {9,    35},
251        {10,   13},
252        {5,    12},
253        {9,    34},
254        {12,   82},
255        {5,    11},
256        {10,   12},
257        {12,   83},
258        {6,    19},
259        {10,   11},
260        {12,   84},
261        {6,    18},
262        {10,   10},
263        {6,    17},
264        {10,    9},
265        {6,    16},
266        {10,    8},
267        {7,    22},
268        {12,   85},
269        {7,    21},
270        {7,    20},
271        {8,    28},
272        {8,    27},
273        {9,    33},
274        {9,    32},
275        {9,    31},
276        {9,    30},
277        {9,    29},
278        {9,    28},
279        {9,    27},
280        {9,    26},
281        {11,   34},
282        {11,   35},
283        {12,   86},
284        {12,   87},
285        {0,     0}
286};
287
288
289/*
290*  For Intra
291*  last = 1
292*/
293
294const OMX_U8 armVCM4P2_InterL1RunIdx[3] =
295{
296    0, 3, 5
297};
298
299/* Entry defined for all values
300*  for run = 0 to 40
301*  Note: the last entry is to terminate while decoding
302*/
303const ARM_VLC32 armVCM4P2_InterVlcL1[45] =
304{
305        {4,     7},
306        {9,    25},
307        {11,    5},
308        {6,    15},
309        {11,    4},
310        {6,    14},
311        {6,    13},
312        {6,    12},
313        {7,    19},
314        {7,    18},
315        {7,    17},
316        {7,    16},
317        {8,    26},
318        {8,    25},
319        {8,    24},
320        {8,    23},
321        {8,    22},
322        {8,    21},
323        {8,    20},
324        {8,    19},
325        {9,    24},
326        {9,    23},
327        {9,    22},
328        {9,    21},
329        {9,    20},
330        {9,    19},
331        {9,    18},
332        {9,    17},
333        {10,    7},
334        {10,    6},
335        {10,    5},
336        {10,    4},
337        {11,   36},
338        {11,   37},
339        {11,   38},
340        {11,   39},
341        {12,   88},
342        {12,   89},
343        {12,   90},
344        {12,   91},
345        {12,   92},
346        {12,   93},
347        {12,   94},
348        {12,   95},
349        { 0,    0}
350};
351
352/* LMAX table for Intra (Last == 0)*/
353const OMX_U8 armVCM4P2_InterL0LMAX[27] =
354{
355   12,  6,  4,  3,  3,  3,  3,  2,
356    2,  2,  2,  1,  1,  1,  1,  1,
357    1,  1,  1,  1,  1,  1,  1,  1,
358    1,  1,  1,
359};
360
361/* LMAX table for Intra (Last == 1)*/
362const OMX_U8 armVCM4P2_InterL1LMAX[41] =
363{
364    3,  2,  1,  1,  1,  1,  1,  1,
365	1,  1,  1,  1,  1,  1,  1,  1,
366	1,  1,  1,  1,  1,  1,  1,  1,
367	1,  1,  1,  1,  1,  1,  1,  1,
368	1,  1,  1,  1,  1,  1,  1,  1,
369	1,
370};
371
372/* RMAX table for Intra (Last == 0)
373   Level - 1 Indexed
374*/
375const OMX_U8 armVCM4P2_InterL0RMAX[12] =
376{
377   26, 10,  6,  2,  1,  1,
378    0,  0,  0,  0,  0,  0
379};
380
381/* RMAX table for Intra (Last == 1)
382   Level - 1 Indexed
383*/
384const OMX_U8 armVCM4P2_InterL1RMAX[3] =
385{
386   40,  1,  0
387};
388
389/*
390*  For Intra - Luminance
391*/
392
393const ARM_VLC32 armVCM4P2_aIntraDCLumaIndex[14] =
394{
395        {3,     3},
396        {2,     3},
397        {2,     2},
398        {3,     2},
399        {3,     1},
400        {4,     1},
401        {5,     1},
402        {6,     1},
403        {7,     1},
404        {8,     1},
405        {9,     1},
406        {10,    1},
407        {11,    1},
408        {0,     0}
409};
410
411/*
412*  For Intra - Chrominance
413*/
414
415const ARM_VLC32 armVCM4P2_aIntraDCChromaIndex[14] =
416{
417        {2,     3},
418        {2,     2},
419        {2,     1},
420        {3,     1},
421        {4,     1},
422        {5,     1},
423        {6,     1},
424        {7,     1},
425        {8,     1},
426        {9,     1},
427        {10,    1},
428        {11,    1},
429        {12,    1},
430        {0,     0}
431};
432
433/*
434 *  Motion vector decoding table
435 */
436
437const ARM_VLC32 armVCM4P2_aVlcMVD[66] =
438{
439        {13,     5},
440        {13,     7},
441        {12,     5},
442        {12,     7},
443        {12,     9},
444        {12,    11},
445        {12,    13},
446        {12,    15},
447        {11,     9},
448        {11,    11},
449        {11,    13},
450        {11,    15},
451        {11,    17},
452        {11,    19},
453        {11,    21},
454        {11,    23},
455        {11,    25},
456        {11,    27},
457        {11,    29},
458        {11,    31},
459        {11,    33},
460        {11,    35},
461        {10,    19},
462        {10,    21},
463        {10,    23},
464        {8,      7},
465        {8,      9},
466        {8,     11},
467        {7,      7},
468        {5,      3},
469        {4,      3},
470        {3,      3},
471        {1,      1},
472        {3,      2},
473        {4,      2},
474        {5,      2},
475        {7,      6},
476        {8,     10},
477        {8,      8},
478        {8,      6},
479        {10,    22},
480        {10,    20},
481        {10,    18},
482        {11,    34},
483        {11,    32},
484        {11,    30},
485        {11,    28},
486        {11,    26},
487        {11,    24},
488        {11,    22},
489        {11,    20},
490        {11,    18},
491        {11,    16},
492        {11,    14},
493        {11,    12},
494        {11,    10},
495        {11,     8},
496        {12,    14},
497        {12,    12},
498        {12,    10},
499        {12,     8},
500        {12,     6},
501        {12,     4},
502        {13,     6},
503        {13,     4},
504        { 0,     0}
505};
506
507/* End of file */
508
509
510
511