3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - Vector Length Coding tables - |
* - Vector Length Coding tables - |
5 |
* |
* |
6 |
* Copyright(C) 2002 Michael Militzer |
* Copyright(C) 2002 Michael Militzer <isibaar@xvid.org> |
7 |
* |
* |
8 |
|
* This file is part of XviD, a free MPEG-4 video encoder/decoder |
9 |
* |
* |
10 |
* This program is an implementation of a part of one or more MPEG-4 |
* XviD is free software; you can redistribute it and/or modify it |
11 |
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
* under the terms of the GNU General Public License as published by |
|
* to use this software module in hardware or software products are |
|
|
* advised that its use may infringe existing patents or copyrights, and |
|
|
* any such use would be at such party's own risk. The original |
|
|
* developer of this software module and his/her company, and subsequent |
|
|
* editors and their companies, will have no liability for use of this |
|
|
* software or modifications or derivatives thereof. |
|
|
* |
|
|
* This program is free software; you can redistribute it and/or modify |
|
|
* it under the terms of the GNU General Public License as published by |
|
12 |
* the Free Software Foundation; either version 2 of the License, or |
* the Free Software Foundation; either version 2 of the License, or |
13 |
* (at your option) any later version. |
* (at your option) any later version. |
14 |
* |
* |
21 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
* |
* |
24 |
|
* Under section 8 of the GNU General Public License, the copyright |
25 |
|
* holders of XVID explicitly forbid distribution in the following |
26 |
|
* countries: |
27 |
|
* |
28 |
|
* - Japan |
29 |
|
* - United States of America |
30 |
|
* |
31 |
|
* Linking XviD statically or dynamically with other modules is making a |
32 |
|
* combined work based on XviD. Thus, the terms and conditions of the |
33 |
|
* GNU General Public License cover the whole combination. |
34 |
|
* |
35 |
|
* As a special exception, the copyright holders of XviD give you |
36 |
|
* permission to link XviD with independent modules that communicate with |
37 |
|
* XviD solely through the VFW1.1 and DShow interfaces, regardless of the |
38 |
|
* license terms of these independent modules, and to copy and distribute |
39 |
|
* the resulting combined work under terms of your choice, provided that |
40 |
|
* every copy of the combined work is accompanied by a complete copy of |
41 |
|
* the source code of XviD (the version of XviD used to produce the |
42 |
|
* combined work), being distributed under the terms of the GNU General |
43 |
|
* Public License plus this exception. An independent module is a module |
44 |
|
* which is not derived from or based on XviD. |
45 |
|
* |
46 |
|
* Note that people who make modified versions of XviD are not obligated |
47 |
|
* to grant this special exception for their modified versions; it is |
48 |
|
* their choice whether to do so. The GNU General Public License gives |
49 |
|
* permission to release a modified version without this exception; this |
50 |
|
* exception also makes it possible to release a modified version which |
51 |
|
* carries forward this exception. |
52 |
|
* |
53 |
* $Id$ |
* $Id$ |
54 |
* |
* |
55 |
****************************************************************************/ |
****************************************************************************/ |
82 |
****************************************************************************/ |
****************************************************************************/ |
83 |
|
|
84 |
/* constants taken from momusys/vm_common/inlcude/max_level.h */ |
/* constants taken from momusys/vm_common/inlcude/max_level.h */ |
85 |
static char max_level[4][64] = { |
static char const max_level[4][64] = { |
86 |
/* intra, last = 0 */ |
/* intra, last = 0 */ |
87 |
{ |
{ |
88 |
27, 10, 5, 4, 3, 3, 3, 3, |
27, 10, 5, 4, 3, 3, 3, 3, |
132 |
} |
} |
133 |
}; |
}; |
134 |
|
|
135 |
static char max_run[4][256] = { |
static char const max_run[4][256] = { |
136 |
/* intra, last = 0 */ |
/* intra, last = 0 */ |
137 |
{ |
{ |
138 |
0, 14, 9, 7, 3, 2, 1, 1, |
0, 14, 9, 7, 3, 2, 1, 1, |
288 |
|
|
289 |
/* first part of coeffs for last = 0. Indexed by [run][level-1] */ |
/* first part of coeffs for last = 0. Indexed by [run][level-1] */ |
290 |
|
|
291 |
static VLC coeff_tab0[2][12] = { |
static VLC const coeff_tab0[2][12] = { |
292 |
/* run = 0 */ |
/* run = 0 */ |
293 |
{ |
{ |
294 |
{0x02, 2}, {0x0f, 4}, {0x15, 6}, {0x17, 7}, |
{0x02, 2}, {0x0f, 4}, {0x15, 6}, {0x17, 7}, |
306 |
|
|
307 |
/* rest of coeffs for last = 0. indexing by [run-2][level-1] */ |
/* rest of coeffs for last = 0. indexing by [run-2][level-1] */ |
308 |
|
|
309 |
static VLC coeff_tab1[25][4] = { |
static VLC const coeff_tab1[25][4] = { |
310 |
/* First row is run=2, then each row is run 2 + index */ |
/* First row is run=2, then each row is run 2 + index */ |
311 |
{{0x0e, 4}, {0x1d, 8}, {0x0e, 10}, {0x51, 12}}, |
{{0x0e, 4}, {0x1d, 8}, {0x0e, 10}, {0x51, 12}}, |
312 |
{{0x0d, 5}, {0x23, 9}, {0x0d, 10}, {0x00, 0}}, |
{{0x0d, 5}, {0x23, 9}, {0x0d, 10}, {0x00, 0}}, |
338 |
|
|
339 |
/* first coeffs of last = 1. indexing by [run][level-1] */ |
/* first coeffs of last = 1. indexing by [run][level-1] */ |
340 |
|
|
341 |
static VLC coeff_tab2[2][3] = { |
static VLC const coeff_tab2[2][3] = { |
342 |
/* run = 0 */ |
/* run = 0 */ |
343 |
{{0x07, 4}, {0x19, 9}, {0x05, 11}}, |
{{0x07, 4}, {0x19, 9}, {0x05, 11}}, |
344 |
/* run = 1 */ |
/* run = 1 */ |
347 |
|
|
348 |
/* rest of coeffs for last = 1. indexing by [run-2] */ |
/* rest of coeffs for last = 1. indexing by [run-2] */ |
349 |
|
|
350 |
static VLC coeff_tab3[40][1] = { |
static VLC const coeff_tab3[40][1] = { |
351 |
{{0x0e, 6}}, {{0x0d, 6}}, {{0x0c, 6}}, {{0x13, 7}}, |
{{0x0e, 6}}, {{0x0d, 6}}, {{0x0c, 6}}, {{0x13, 7}}, |
352 |
{{0x12, 7}}, {{0x11, 7}}, {{0x10, 7}}, {{0x1a, 8}}, |
{{0x12, 7}}, {{0x11, 7}}, {{0x10, 7}}, {{0x1a, 8}}, |
353 |
{{0x19, 8}}, {{0x18, 8}}, {{0x17, 8}}, {{0x16, 8}}, |
{{0x19, 8}}, {{0x18, 8}}, {{0x17, 8}}, {{0x16, 8}}, |
367 |
|
|
368 |
/* Coeffs for last = 0, run = 0. Indexed by [level-1] */ |
/* Coeffs for last = 0, run = 0. Indexed by [level-1] */ |
369 |
|
|
370 |
static VLC coeff_tab4[27] = { |
static VLC const coeff_tab4[27] = { |
371 |
/* run = 0 */ |
/* run = 0 */ |
372 |
{0x02, 2}, {0x06, 3}, {0x0f, 4}, |
{0x02, 2}, {0x06, 3}, {0x0f, 4}, |
373 |
{0x0d, 5}, {0x0c, 5}, {0x15, 6}, |
{0x0d, 5}, {0x0c, 5}, {0x15, 6}, |
382 |
|
|
383 |
/* Coeffs for last = 0, run = 1. Indexed by [level-1] */ |
/* Coeffs for last = 0, run = 1. Indexed by [level-1] */ |
384 |
|
|
385 |
static VLC coeff_tab5[10] = { |
static VLC const coeff_tab5[10] = { |
386 |
{0x0e, 4}, {0x14, 6}, {0x16, 7}, {0x1c, 8}, {0x20, 9}, |
{0x0e, 4}, {0x14, 6}, {0x16, 7}, {0x1c, 8}, {0x20, 9}, |
387 |
{0x1f, 9}, {0x0d, 10}, {0x22, 11}, {0x53, 12}, {0x55, 12} |
{0x1f, 9}, {0x0d, 10}, {0x22, 11}, {0x53, 12}, {0x55, 12} |
388 |
}; |
}; |
417 |
|
|
418 |
/* Coeffs for last = 0, run = 10 -> 14. Indexed by [run-10] */ |
/* Coeffs for last = 0, run = 10 -> 14. Indexed by [run-10] */ |
419 |
|
|
420 |
static VLC coeff_tab7[5][1] = { |
static VLC const coeff_tab7[5][1] = { |
421 |
{{0x17, 8}}, |
{{0x17, 8}}, |
422 |
{{0x19, 9}}, |
{{0x19, 9}}, |
423 |
{{0x18, 9}}, |
{{0x18, 9}}, |
427 |
|
|
428 |
/* Coeffs for last = 1, run = 0. Indexed by [level-1] */ |
/* Coeffs for last = 1, run = 0. Indexed by [level-1] */ |
429 |
|
|
430 |
static VLC coeff_tab8[8] = { |
static VLC const coeff_tab8[8] = { |
431 |
{0x07, 4}, {0x0c, 6}, {0x16, 8}, {0x17, 9}, |
{0x07, 4}, {0x0c, 6}, {0x16, 8}, {0x17, 9}, |
432 |
{0x06, 10}, {0x05, 11}, {0x04, 11}, {0x59, 12} |
{0x06, 10}, {0x05, 11}, {0x04, 11}, {0x59, 12} |
433 |
}; |
}; |
434 |
|
|
435 |
/* Coeffs for last = 1, run = 1 -> 6. Indexed by [run-1][level-1] */ |
/* Coeffs for last = 1, run = 1 -> 6. Indexed by [run-1][level-1] */ |
436 |
|
|
437 |
static VLC coeff_tab9[6][3] = { |
static VLC const coeff_tab9[6][3] = { |
438 |
/* run = 1 */ |
/* run = 1 */ |
439 |
{{0x0f, 6}, {0x16, 9}, {0x05, 10}}, |
{{0x0f, 6}, {0x16, 9}, {0x05, 10}}, |
440 |
|
|
456 |
|
|
457 |
/* Coeffs for last = 1, run = 7 -> 20. Indexed by [run-7] */ |
/* Coeffs for last = 1, run = 7 -> 20. Indexed by [run-7] */ |
458 |
|
|
459 |
static VLC coeff_tab10[14][1] = { |
static VLC const coeff_tab10[14][1] = { |
460 |
{{0x14, 8}}, |
{{0x14, 8}}, |
461 |
{{0x13, 8}}, |
{{0x13, 8}}, |
462 |
{{0x1a, 8}}, |
{{0x1a, 8}}, |
474 |
}; |
}; |
475 |
|
|
476 |
|
|
477 |
static VLC *coeff_intra_last0[15] = { |
static VLC const *coeff_intra_last0[15] = { |
478 |
coeff_tab4, |
coeff_tab4, |
479 |
coeff_tab5, |
coeff_tab5, |
480 |
coeff_tab6[0], |
coeff_tab6[0], |
492 |
coeff_tab7[4] |
coeff_tab7[4] |
493 |
}; |
}; |
494 |
|
|
495 |
static VLC *coeff_intra_last1[21] = { |
static VLC const *coeff_intra_last1[21] = { |
496 |
coeff_tab8, |
coeff_tab8, |
497 |
coeff_tab9[0], |
coeff_tab9[0], |
498 |
coeff_tab9[1], |
coeff_tab9[1], |
516 |
coeff_tab10[13], |
coeff_tab10[13], |
517 |
}; |
}; |
518 |
|
|
519 |
static VLC *coeff_inter_last0[27] = { |
static VLC const *coeff_inter_last0[27] = { |
520 |
coeff_tab0[0], |
coeff_tab0[0], |
521 |
coeff_tab0[1], |
coeff_tab0[1], |
522 |
coeff_tab1[0], |
coeff_tab1[0], |
546 |
coeff_tab1[24], |
coeff_tab1[24], |
547 |
}; |
}; |
548 |
|
|
549 |
static VLC *coeff_inter_last1[42] = { |
static VLC const *coeff_inter_last1[42] = { |
550 |
coeff_tab2[0], |
coeff_tab2[0], |
551 |
coeff_tab2[1], |
coeff_tab2[1], |
552 |
coeff_tab3[0], |
coeff_tab3[0], |
591 |
coeff_tab3[39], |
coeff_tab3[39], |
592 |
}; |
}; |
593 |
|
|
594 |
static VLC **coeff_vlc[4] = { |
static VLC const **coeff_vlc[4] = { |
595 |
coeff_intra_last0, |
coeff_intra_last0, |
596 |
coeff_intra_last1, |
coeff_intra_last1, |
597 |
coeff_inter_last0, |
coeff_inter_last0, |
604 |
* Example: cbpc = 01 and mode = 4 gives index = 0110 = 6. |
* Example: cbpc = 01 and mode = 4 gives index = 0110 = 6. |
605 |
*/ |
*/ |
606 |
|
|
607 |
static VLC mcbpc_intra_tab[15] = { |
static VLC const mcbpc_intra_tab[15] = { |
608 |
{0x01, 9}, {0x01, 1}, {0x01, 4}, {0x00, 0}, |
{0x01, 9}, {0x01, 1}, {0x01, 4}, {0x00, 0}, |
609 |
{0x00, 0}, {0x01, 3}, {0x01, 6}, {0x00, 0}, |
{0x00, 0}, {0x01, 3}, {0x01, 6}, {0x00, 0}, |
610 |
{0x00, 0}, {0x02, 3}, {0x02, 6}, {0x00, 0}, |
{0x00, 0}, {0x02, 3}, {0x02, 6}, {0x00, 0}, |
614 |
/* MCBPC inter. |
/* MCBPC inter. |
615 |
Addressing: 5 bit ccmmm (cc = CBPC, mmm = mode (1-4 binary)) */ |
Addressing: 5 bit ccmmm (cc = CBPC, mmm = mode (1-4 binary)) */ |
616 |
|
|
617 |
static VLC mcbpc_inter_tab[29] = { |
static VLC const mcbpc_inter_tab[29] = { |
618 |
{1, 1}, {3, 3}, {2, 3}, {3, 5}, {4, 6}, {1, 9}, {0, 0}, {0, 0}, |
{1, 1}, {3, 3}, {2, 3}, {3, 5}, {4, 6}, {1, 9}, {0, 0}, {0, 0}, |
619 |
{3, 4}, {7, 7}, {5, 7}, {4, 8}, {4, 9}, {0, 0}, {0, 0}, {0, 0}, |
{3, 4}, {7, 7}, {5, 7}, {4, 8}, {4, 9}, {0, 0}, {0, 0}, {0, 0}, |
620 |
{2, 4}, {6, 7}, {4, 7}, {3, 8}, {3, 9}, {0, 0}, {0, 0}, {0, 0}, |
{2, 4}, {6, 7}, {4, 7}, {3, 8}, {3, 9}, {0, 0}, {0, 0}, {0, 0}, |
621 |
{5, 6}, {5, 9}, {5, 8}, {3, 7}, {2, 9} |
{5, 6}, {5, 9}, {5, 8}, {3, 7}, {2, 9} |
622 |
}; |
}; |
623 |
|
|
624 |
static const VLC cbpy_tab[16] = { |
static VLC const cbpy_tab[16] = { |
625 |
{3, 4}, {5, 5}, {4, 5}, {9, 4}, {3, 5}, {7, 4}, {2, 6}, {11, 4}, |
{3, 4}, {5, 5}, {4, 5}, {9, 4}, {3, 5}, {7, 4}, {2, 6}, {11, 4}, |
626 |
{2, 5}, {3, 6}, {5, 4}, {10, 4}, {4, 4}, {8, 4}, {6, 4}, {3, 2} |
{2, 5}, {3, 6}, {5, 4}, {10, 4}, {4, 4}, {8, 4}, {6, 4}, {3, 2} |
627 |
}; |
}; |
628 |
|
|
629 |
static const VLC dcy_tab[511] = { |
static VLC const dcy_tab[511] = { |
630 |
{0x100, 15}, {0x101, 15}, {0x102, 15}, {0x103, 15}, |
{0x100, 15}, {0x101, 15}, {0x102, 15}, {0x103, 15}, |
631 |
{0x104, 15}, {0x105, 15}, {0x106, 15}, {0x107, 15}, |
{0x104, 15}, {0x105, 15}, {0x106, 15}, {0x107, 15}, |
632 |
{0x108, 15}, {0x109, 15}, {0x10a, 15}, {0x10b, 15}, |
{0x108, 15}, {0x109, 15}, {0x10a, 15}, {0x10b, 15}, |
757 |
{0x1fd, 15}, {0x1fe, 15}, {0x1ff, 15}, |
{0x1fd, 15}, {0x1fe, 15}, {0x1ff, 15}, |
758 |
}; |
}; |
759 |
|
|
760 |
static const VLC dcc_tab[511] = { |
static VLC const dcc_tab[511] = { |
761 |
{0x100, 16}, {0x101, 16}, {0x102, 16}, {0x103, 16}, |
{0x100, 16}, {0x101, 16}, {0x102, 16}, {0x103, 16}, |
762 |
{0x104, 16}, {0x105, 16}, {0x106, 16}, {0x107, 16}, |
{0x104, 16}, {0x105, 16}, {0x106, 16}, {0x107, 16}, |
763 |
{0x108, 16}, {0x109, 16}, {0x10a, 16}, {0x10b, 16}, |
{0x108, 16}, {0x109, 16}, {0x10a, 16}, {0x10b, 16}, |
889 |
}; |
}; |
890 |
|
|
891 |
|
|
892 |
static const VLC mb_motion_table[65] = { |
static VLC const mb_motion_table[65] = { |
893 |
{0x05, 13}, {0x07, 13}, {0x05, 12}, {0x07, 12}, |
{0x05, 13}, {0x07, 13}, {0x05, 12}, {0x07, 12}, |
894 |
{0x09, 12}, {0x0b, 12}, {0x0d, 12}, {0x0f, 12}, |
{0x09, 12}, {0x0b, 12}, {0x0d, 12}, {0x0f, 12}, |
895 |
{0x09, 11}, {0x0b, 11}, {0x0d, 11}, {0x0f, 11}, |
{0x09, 11}, {0x0b, 11}, {0x0d, 11}, {0x0f, 11}, |
914 |
* decoder tables * |
* decoder tables * |
915 |
******************************************************************/ |
******************************************************************/ |
916 |
|
|
917 |
static const VLC mcbpc_intra_table[64] = { |
static VLC const mcbpc_intra_table[64] = { |
918 |
{-1, 0}, {20, 6}, {36, 6}, {52, 6}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, |
{-1, 0}, {20, 6}, {36, 6}, {52, 6}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, |
919 |
{19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, |
{19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, |
920 |
{35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, |
{35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, |
926 |
}; |
}; |
927 |
|
|
928 |
|
|
929 |
static const VLC mcbpc_inter_table[257] = { |
static VLC const mcbpc_inter_table[257] = { |
930 |
{VLC_ERROR, 0}, {255, 9}, {52, 9}, {36, 9}, {20, 9}, {49, 9}, {35, 8}, {35, 8}, |
{VLC_ERROR, 0}, {255, 9}, {52, 9}, {36, 9}, {20, 9}, {49, 9}, {35, 8}, {35, 8}, |
931 |
{19, 8}, {19, 8}, {50, 8}, {50, 8}, {51, 7}, {51, 7}, {51, 7}, {51, 7}, |
{19, 8}, {19, 8}, {50, 8}, {50, 8}, {51, 7}, {51, 7}, {51, 7}, {51, 7}, |
932 |
{34, 7}, {34, 7}, {34, 7}, {34, 7}, {18, 7}, {18, 7}, {18, 7}, {18, 7}, |
{34, 7}, {34, 7}, {34, 7}, {34, 7}, {18, 7}, {18, 7}, {18, 7}, {18, 7}, |
962 |
{0, 1} |
{0, 1} |
963 |
}; |
}; |
964 |
|
|
965 |
static const VLC cbpy_table[64] = { |
static VLC const cbpy_table[64] = { |
966 |
{-1, 0}, {-1, 0}, {6, 6}, {9, 6}, {8, 5}, {8, 5}, {4, 5}, {4, 5}, |
{-1, 0}, {-1, 0}, {6, 6}, {9, 6}, {8, 5}, {8, 5}, {4, 5}, {4, 5}, |
967 |
{2, 5}, {2, 5}, {1, 5}, {1, 5}, {0, 4}, {0, 4}, {0, 4}, {0, 4}, |
{2, 5}, {2, 5}, {1, 5}, {1, 5}, {0, 4}, {0, 4}, {0, 4}, {0, 4}, |
968 |
{12, 4}, {12, 4}, {12, 4}, {12, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, |
{12, 4}, {12, 4}, {12, 4}, {12, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, |
974 |
}; |
}; |
975 |
|
|
976 |
|
|
977 |
VLC TMNMVtab0[] = { |
static VLC const TMNMVtab0[] = { |
978 |
{3, 4}, {-3, 4}, {2, 3}, {2, 3}, {-2, 3}, {-2, 3}, {1, 2}, |
{3, 4}, {-3, 4}, {2, 3}, {2, 3}, {-2, 3}, {-2, 3}, {1, 2}, |
979 |
{1, 2}, {1, 2}, {1, 2}, {-1, 2}, {-1, 2}, {-1, 2}, {-1, 2} |
{1, 2}, {1, 2}, {1, 2}, {-1, 2}, {-1, 2}, {-1, 2}, {-1, 2} |
980 |
}; |
}; |
981 |
|
|
982 |
VLC TMNMVtab1[] = { |
static VLC const TMNMVtab1[] = { |
983 |
{12, 10}, {-12, 10}, {11, 10}, {-11, 10}, |
{12, 10}, {-12, 10}, {11, 10}, {-11, 10}, |
984 |
{10, 9}, {10, 9}, {-10, 9}, {-10, 9}, |
{10, 9}, {10, 9}, {-10, 9}, {-10, 9}, |
985 |
{9, 9}, {9, 9}, {-9, 9}, {-9, 9}, |
{9, 9}, {9, 9}, {-9, 9}, {-9, 9}, |
1006 |
{-4, 6}, {-4, 6}, {-4, 6},{-4, 6} |
{-4, 6}, {-4, 6}, {-4, 6},{-4, 6} |
1007 |
}; |
}; |
1008 |
|
|
1009 |
VLC TMNMVtab2[] = { |
static VLC const TMNMVtab2[] = { |
1010 |
{32, 12}, {-32, 12}, {31, 12}, {-31, 12}, |
{32, 12}, {-32, 12}, {31, 12}, {-31, 12}, |
1011 |
{30, 11}, {30, 11}, {-30, 11}, {-30, 11}, |
{30, 11}, {30, 11}, {-30, 11}, {-30, 11}, |
1012 |
{29, 11}, {29, 11}, {-29, 11}, {-29, 11}, |
{29, 11}, {29, 11}, {-29, 11}, {-29, 11}, |
1041 |
}; |
}; |
1042 |
|
|
1043 |
|
|
1044 |
VLC DCT3Dtab0[] = { |
static VLC const DCT3Dtab0[] = { |
1045 |
{4225, 7}, {4209, 7}, {4193, 7}, {4177, 7}, {193, 7}, {177, 7}, |
{4225, 7}, {4209, 7}, {4193, 7}, {4177, 7}, {193, 7}, {177, 7}, |
1046 |
{161, 7}, {4, 7}, {4161, 6}, {4161, 6}, {4145, 6}, {4145, 6}, |
{161, 7}, {4, 7}, {4161, 6}, {4161, 6}, {4145, 6}, {4145, 6}, |
1047 |
{4129, 6}, {4129, 6}, {4113, 6}, {4113, 6}, {145, 6}, {145, 6}, |
{4129, 6}, {4129, 6}, {4113, 6}, {4113, 6}, {145, 6}, {145, 6}, |
1064 |
}; |
}; |
1065 |
|
|
1066 |
|
|
1067 |
VLC DCT3Dtab1[] = { |
static VLC const DCT3Dtab1[] = { |
1068 |
{9, 10}, {8, 10}, {4481, 9}, {4481, 9}, {4465, 9}, {4465, 9}, |
{9, 10}, {8, 10}, {4481, 9}, {4481, 9}, {4465, 9}, {4465, 9}, |
1069 |
{4449, 9}, {4449, 9}, {4433, 9}, {4433, 9}, {4417, 9}, {4417, 9}, |
{4449, 9}, {4449, 9}, {4433, 9}, {4433, 9}, {4417, 9}, {4417, 9}, |
1070 |
{4401, 9}, {4401, 9}, {4385, 9}, {4385, 9}, {4369, 9}, {4369, 9}, |
{4401, 9}, {4401, 9}, {4385, 9}, {4385, 9}, {4369, 9}, {4369, 9}, |
1083 |
{19, 8}, {19, 8}, {5, 8}, {5, 8}, {5, 8}, {5, 8} |
{19, 8}, {19, 8}, {5, 8}, {5, 8}, {5, 8}, {5, 8} |
1084 |
}; |
}; |
1085 |
|
|
1086 |
VLC DCT3Dtab2[] = { |
static VLC const DCT3Dtab2[] = { |
1087 |
{4114, 11}, {4114, 11}, {4099, 11}, {4099, 11}, {11, 11}, {11, 11}, |
{4114, 11}, {4114, 11}, {4099, 11}, {4099, 11}, {11, 11}, {11, 11}, |
1088 |
{10, 11}, {10, 11}, {4545, 10}, {4545, 10}, {4545, 10}, {4545, 10}, |
{10, 11}, {10, 11}, {4545, 10}, {4545, 10}, {4545, 10}, {4545, 10}, |
1089 |
{4529, 10}, {4529, 10}, {4529, 10}, {4529, 10}, {4513, 10}, {4513, 10}, |
{4529, 10}, {4529, 10}, {4529, 10}, {4529, 10}, {4513, 10}, {4513, 10}, |
1110 |
|
|
1111 |
/* New tables for Intra luminance blocks */ |
/* New tables for Intra luminance blocks */ |
1112 |
|
|
1113 |
VLC DCT3Dtab3[] = { |
static VLC const DCT3Dtab3[] = { |
1114 |
{0x10401, 7}, {0x10301, 7}, {0x00601, 7}, {0x10501, 7}, |
{0x10401, 7}, {0x10301, 7}, {0x00601, 7}, {0x10501, 7}, |
1115 |
{0x00701, 7}, {0x00202, 7}, {0x00103, 7}, {0x00009, 7}, |
{0x00701, 7}, {0x00202, 7}, {0x00103, 7}, {0x00009, 7}, |
1116 |
{0x10002, 6}, {0x10002, 6}, {0x00501, 6}, {0x00501, 6}, |
{0x10002, 6}, {0x10002, 6}, {0x00501, 6}, {0x00501, 6}, |
1142 |
}; |
}; |
1143 |
|
|
1144 |
|
|
1145 |
VLC DCT3Dtab4[] = { |
static VLC const DCT3Dtab4[] = { |
1146 |
{0x00012, 10}, {0x00011, 10}, {0x10e01, 9}, {0x10e01, 9}, |
{0x00012, 10}, {0x00011, 10}, {0x10e01, 9}, {0x10e01, 9}, |
1147 |
{0x10d01, 9}, {0x10d01, 9}, {0x10c01, 9}, {0x10c01, 9}, |
{0x10d01, 9}, {0x10d01, 9}, {0x10c01, 9}, {0x10c01, 9}, |
1148 |
{0x10b01, 9}, {0x10b01, 9}, {0x10a01, 9}, {0x10a01, 9}, |
{0x10b01, 9}, {0x10b01, 9}, {0x10a01, 9}, {0x10a01, 9}, |
1169 |
{0x0000a, 8}, {0x0000a, 8}, {0x0000a, 8}, {0x0000a, 8} |
{0x0000a, 8}, {0x0000a, 8}, {0x0000a, 8}, {0x0000a, 8} |
1170 |
}; |
}; |
1171 |
|
|
1172 |
VLC DCT3Dtab5[] = { |
static VLC const DCT3Dtab5[] = { |
1173 |
{0x10007, 11}, {0x10007, 11}, {0x10006, 11}, {0x10006, 11}, |
{0x10007, 11}, {0x10007, 11}, {0x10006, 11}, {0x10006, 11}, |
1174 |
{0x00016, 11}, {0x00016, 11}, {0x00015, 11}, {0x00015, 11}, |
{0x00016, 11}, {0x00016, 11}, {0x00015, 11}, {0x00015, 11}, |
1175 |
{0x10202, 10}, {0x10202, 10}, {0x10202, 10}, {0x10202, 10}, |
{0x10202, 10}, {0x10202, 10}, {0x10202, 10}, {0x10202, 10}, |
1202 |
{0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7} |
{0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7} |
1203 |
}; |
}; |
1204 |
|
|
1205 |
VLC ERRtab[] = { |
static short const dc_threshold[] = { |
1206 |
|
26708, 29545, 25120, 28265, 29281, 8313, 29557, 29541, |
1207 |
|
18208, 21838, 18208, 19536, 29472, 26223, 30580, 29281, |
1208 |
|
8293, 25956, 26994, 25974, 8292, 29286, 28015, 22560, |
1209 |
|
18774, 8260, 20557, 18245, 8244, 26664, 29812, 14960, |
1210 |
|
12079, 30583, 11895, 30328, 25705, 28462, 26482, 29472, |
1211 |
|
30063, 25458, 29541, 8233, 29505, 8299, 28518, 8306, |
1212 |
|
26740, 8293, 28531, 29301, 25955, 8307, 28532, 31008, |
1213 |
|
30063, 8306, 26980, 29811, 26994, 30050, 28532, 2674 |
1214 |
|
}; |
1215 |
|
|
1216 |
|
|
1217 |
|
static VLC const ERRtab[] = { |
1218 |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0}, |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0}, |
1219 |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0}, |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0}, |
1220 |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0}, |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0}, |
1222 |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0} |
{VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0} |
1223 |
}; |
}; |
1224 |
|
|
1225 |
static const VLC dc_lum_tab[] = { |
static VLC const dc_lum_tab[] = { |
1226 |
{0, 0}, {4, 3}, {3, 3}, {0, 3}, |
{0, 0}, {4, 3}, {3, 3}, {0, 3}, |
1227 |
{2, 2}, {2, 2}, {1, 2}, {1, 2}, |
{2, 2}, {2, 2}, {1, 2}, {1, 2}, |
1228 |
}; |
}; |