Home | History | Annotate | Download | only in src
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      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
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 #include    "mp4dec_api.h"
     19 #include    "mp4def.h"
     20 #include    "mp4lib_int.h"
     21 #include    "vlc_dec_tab.h"
     22 #include    "max_level.h"
     23 
     24 
     25 const int intra_max_level[2][NCOEFF_BLOCK] =
     26 {
     27     {27, 10,  5,  4,  3,  3,  3,  3,
     28         2,  2,  1,  1,  1,  1,  1,  0,
     29         0,  0,  0,  0,  0,  0,  0,  0,
     30         0,  0,  0,  0,  0,  0,  0,  0,
     31         0,  0,  0,  0,  0,  0,  0,  0,
     32         0,  0,  0,  0,  0,  0,  0,  0,
     33         0,  0,  0,  0,  0,  0,  0,  0,
     34         0,  0,  0,  0,  0,  0,  0,  0,
     35     },
     36 
     37     {8,  3,  2,  2,  2,  2,  2,  1,
     38      1,  1,  1,  1,  1,  1,  1,  1,
     39      1,  1,  1,  1,  1,  0,  0,  0,
     40      0,  0,  0,  0,  0,  0,  0,  0,
     41      0,  0,  0,  0,  0,  0,  0,  0,
     42      0,  0,  0,  0,  0,  0,  0,  0,
     43      0,  0,  0,  0,  0,  0,  0,  0,
     44      0,  0,  0,  0,  0,  0,  0,  0
     45     }
     46 };
     47 
     48 
     49 const int inter_max_level[2][NCOEFF_BLOCK] =
     50 {
     51     {12,  6,  4,  3,  3,  3,  3,  2,
     52         2,  2,  2,  1,  1,  1,  1,  1,
     53         1,  1,  1,  1,  1,  1,  1,  1,
     54         1,  1,  1,  0,  0,  0,  0,  0,
     55         0,  0,  0,  0,  0,  0,  0,  0,
     56         0,  0,  0,  0,  0,  0,  0,  0,
     57         0,  0,  0,  0,  0,  0,  0,  0,
     58         0,  0,  0,  0,  0,  0,  0,  0},
     59 
     60     {3,  2,  1,  1,  1,  1,  1,  1,
     61      1,  1,  1,  1,  1,  1,  1,  1,
     62      1,  1,  1,  1,  1,  1,  1,  1,
     63      1,  1,  1,  1,  1,  1,  1,  1,
     64      1,  1,  1,  1,  1,  1,  1,  1,
     65      1,  0,  0,  0,  0,  0,  0,  0,
     66      0,  0,  0,  0,  0,  0,  0,  0,
     67      0,  0,  0,  0,  0,  0,  0,  0}
     68 };
     69 
     70 
     71 const int intra_max_run0[28] = { 999, 14,  9,  7,  3,  2,  1,
     72                                  1,  1,  1,  1,  0,  0,  0,
     73                                  0,  0,  0,  0,  0,  0,  0,
     74                                  0,  0,  0,  0,  0,  0,  0
     75                                };
     76 
     77 
     78 const int intra_max_run1[9] = { 999, 20,  6,
     79                                 1,  0,  0,
     80                                 0,  0,  0
     81                               };
     82 
     83 const int inter_max_run0[13] = { 999,
     84                                  26, 10,  6,  2,  1,  1,
     85                                  0,  0,  0,  0,  0,  0
     86                                };
     87 
     88 
     89 const int inter_max_run1[4] = { 999, 40,  1,  0 };
     90 
     91 const VLCshorttab PV_TMNMVtab0[] =
     92 {
     93     {3, 4}, { -3, 4}, {2, 3}, {2, 3}, { -2, 3}, { -2, 3}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
     94     { -1, 2}, { -1, 2}, { -1, 2}, { -1, 2}
     95 };
     96 
     97 const VLCshorttab PV_TMNMVtab1[] =
     98 {
     99     {12, 10}, { -12, 10}, {11, 10}, { -11, 10}, {10, 9}, {10, 9}, { -10, 9}, { -10, 9},
    100     {9, 9}, {9, 9}, { -9, 9}, { -9, 9}, {8, 9}, {8, 9}, { -8, 9}, { -8, 9}, {7, 7}, {7, 7},
    101     {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, { -7, 7}, { -7, 7}, { -7, 7}, { -7, 7},
    102     { -7, 7}, { -7, 7}, { -7, 7}, { -7, 7}, {6, 7}, {6, 7}, {6, 7}, {6, 7}, {6, 7}, {6, 7},
    103     {6, 7}, {6, 7}, { -6, 7}, { -6, 7}, { -6, 7}, { -6, 7}, { -6, 7}, { -6, 7}, { -6, 7},
    104     { -6, 7}, {5, 7}, {5, 7}, {5, 7}, {5, 7}, {5, 7}, {5, 7}, {5, 7}, {5, 7}, { -5, 7},
    105     { -5, 7}, { -5, 7}, { -5, 7}, { -5, 7}, { -5, 7}, { -5, 7}, { -5, 7}, {4, 6}, {4, 6}, {4, 6},
    106     {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6},
    107     {4, 6}, {4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6},
    108     { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}, { -4, 6}
    109 };
    110 
    111 const VLCshorttab PV_TMNMVtab2[] =
    112 {
    113     {32, 12}, { -32, 12}, {31, 12}, { -31, 12}, {30, 11}, {30, 11}, { -30, 11}, { -30, 11},
    114     {29, 11}, {29, 11}, { -29, 11}, { -29, 11}, {28, 11}, {28, 11}, { -28, 11}, { -28, 11},
    115     {27, 11}, {27, 11}, { -27, 11}, { -27, 11}, {26, 11}, {26, 11}, { -26, 11}, { -26, 11},
    116     {25, 11}, {25, 11}, { -25, 11}, { -25, 11}, {24, 10}, {24, 10}, {24, 10}, {24, 10},
    117     { -24, 10}, { -24, 10}, { -24, 10}, { -24, 10}, {23, 10}, {23, 10}, {23, 10}, {23, 10},
    118     { -23, 10}, { -23, 10}, { -23, 10}, { -23, 10}, {22, 10}, {22, 10}, {22, 10}, {22, 10},
    119     { -22, 10}, { -22, 10}, { -22, 10}, { -22, 10}, {21, 10}, {21, 10}, {21, 10}, {21, 10},
    120     { -21, 10}, { -21, 10}, { -21, 10}, { -21, 10}, {20, 10}, {20, 10}, {20, 10}, {20, 10},
    121     { -20, 10}, { -20, 10}, { -20, 10}, { -20, 10}, {19, 10}, {19, 10}, {19, 10}, {19, 10},
    122     { -19, 10}, { -19, 10}, { -19, 10}, { -19, 10}, {18, 10}, {18, 10}, {18, 10}, {18, 10},
    123     { -18, 10}, { -18, 10}, { -18, 10}, { -18, 10}, {17, 10}, {17, 10}, {17, 10}, {17, 10},
    124     { -17, 10}, { -17, 10}, { -17, 10}, { -17, 10}, {16, 10}, {16, 10}, {16, 10}, {16, 10},
    125     { -16, 10}, { -16, 10}, { -16, 10}, { -16, 10}, {15, 10}, {15, 10}, {15, 10}, {15, 10},
    126     { -15, 10}, { -15, 10}, { -15, 10}, { -15, 10}, {14, 10}, {14, 10}, {14, 10}, {14, 10},
    127     { -14, 10}, { -14, 10}, { -14, 10}, { -14, 10}, {13, 10}, {13, 10}, {13, 10}, {13, 10},
    128     { -13, 10}, { -13, 10}, { -13, 10}, { -13, 10}
    129 };
    130 
    131 const VLCshorttab PV_MCBPCtab[] =
    132 {
    133     {VLC_ERROR, 0},
    134     {255, 9}, {52, 9}, {36, 9}, {20, 9}, {49, 9}, {35, 8}, {35, 8}, {19, 8}, {19, 8},
    135     {50, 8}, {50, 8}, {51, 7}, {51, 7}, {51, 7}, {51, 7}, {34, 7}, {34, 7}, {34, 7},
    136     {34, 7}, {18, 7}, {18, 7}, {18, 7}, {18, 7}, {33, 7}, {33, 7}, {33, 7}, {33, 7},
    137     {17, 7}, {17, 7}, {17, 7}, {17, 7}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6},
    138     {4, 6}, {4, 6}, {4, 6}, {48, 6}, {48, 6}, {48, 6}, {48, 6}, {48, 6}, {48, 6},
    139     {48, 6}, {48, 6}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5},
    140     {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5},
    141     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4},
    142     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4},
    143     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4},
    144     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
    145     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
    146     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
    147     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
    148     {16, 4}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
    149     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
    150     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
    151     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
    152     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
    153     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
    154     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
    155     {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
    156     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
    157     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
    158     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
    159     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
    160     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
    161     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
    162     {1, 3}, {1, 3}, {1, 3}
    163 };
    164 
    165 #ifdef PV_ANNEX_IJKT_SUPPORT
    166 const VLCshorttab PV_MCBPCtab1[] =
    167 {
    168     {5, 11}, {5, 11},  {5, 11}, {5, 11}, {21, 13}, {21, 13}, {37, 13}, {53, 13},
    169 };
    170 #endif
    171 const VLCshorttab PV_MCBPCtabintra[] =
    172 {
    173     {VLC_ERROR, 0},
    174     {20, 6}, {36, 6}, {52, 6}, {4, 4}, {4, 4}, {4, 4},
    175     {4, 4}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3},
    176     {19, 3}, {19, 3}, {19, 3}, {35, 3}, {35, 3}, {35, 3},
    177     {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {51, 3},
    178     {51, 3}, {51, 3}, {51, 3}, {51, 3}, {51, 3}, {51, 3},
    179     {51, 3}
    180 };
    181 
    182 
    183 
    184 const VLCshorttab PV_CBPYtab[48] =
    185 {
    186     {VLC_ERROR, 0}, {VLC_ERROR, 0}, {6, 6}, {9, 6}, {8, 5}, {8, 5}, {4, 5}, {4, 5},
    187     {2, 5}, {2, 5}, {1, 5}, {1, 5}, {0, 4}, {0, 4}, {0, 4}, {0, 4},
    188     {12, 4}, {12, 4}, {12, 4}, {12, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4},
    189     {14, 4}, {14, 4}, {14, 4}, {14, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4},
    190     {13, 4}, {13, 4}, {13, 4}, {13, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4},
    191     {11, 4}, {11, 4}, {11, 4}, {11, 4}, {7, 4}, {7, 4}, {7, 4}, {7, 4}
    192 };
    193 
    194 
    195 
    196 const VLCtab2 PV_DCT3Dtab0[] =
    197 {
    198     {0x8, 1, 1, 7}, {0x7, 1, 1, 7}, {0x6, 1, 1, 7}, {0x5, 1, 1, 7}, {0xc, 1, 0, 7}, {0xb, 1, 0, 7},
    199     {0xa, 1, 0, 7}, {0x0, 4, 0, 7}, {0x4, 1, 1, 6}, {0x4, 1, 1, 6}, {0x3, 1, 1, 6}, {0x3, 1, 1, 6},
    200     {0x2, 1, 1, 6}, {0x2, 1, 1, 6}, {0x1, 1, 1, 6}, {0x1, 1, 1, 6}, {0x9, 1, 0, 6}, {0x9, 1, 0, 6},
    201     {0x8, 1, 0, 6}, {0x8, 1, 0, 6}, {0x7, 1, 0, 6}, {0x7, 1, 0, 6}, {0x6, 1, 0, 6}, {0x6, 1, 0, 6},
    202     {0x1, 2, 0, 6}, {0x1, 2, 0, 6}, {0x0, 3, 0, 6}, {0x0, 3, 0, 6}, {0x5, 1, 0, 5}, {0x5, 1, 0, 5},
    203     {0x5, 1, 0, 5}, {0x5, 1, 0, 5}, {0x4, 1, 0, 5}, {0x4, 1, 0, 5}, {0x4, 1, 0, 5}, {0x4, 1, 0, 5},
    204     {0x3, 1, 0, 5}, {0x3, 1, 0, 5}, {0x3, 1, 0, 5}, {0x3, 1, 0, 5}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4},
    205     {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4},
    206     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    207     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    208     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    209     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    210     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    211     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3},
    212     {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3},
    213     {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3}, {0x1, 1, 0, 3},
    214     {0x2, 1, 0, 4}, {0x2, 1, 0, 4}, {0x2, 1, 0, 4}, {0x2, 1, 0, 4}, {0x2, 1, 0, 4}, {0x2, 1, 0, 4},
    215     {0x2, 1, 0, 4}, {0x2, 1, 0, 4}, {0x0, 2, 0, 4}, {0x0, 2, 0, 4}, {0x0, 2, 0, 4}, {0x0, 2, 0, 4},
    216     {0x0, 2, 0, 4}, {0x0, 2, 0, 4}, {0x0, 2, 0, 4}, {0x0, 2, 0, 4}
    217 };
    218 
    219 
    220 const VLCtab2 PV_DCT3Dtab1[] =
    221 {
    222     {0x0, 9, 0, 10}, {0x0, 8, 0, 10}, {0x18, 1, 1, 9}, {0x18, 1, 1, 9}, {0x17, 1, 1, 9}, {0x17, 1, 1, 9},
    223     {0x16, 1, 1, 9}, {0x16, 1, 1, 9}, {0x15, 1, 1, 9}, {0x15, 1, 1, 9}, {0x14, 1, 1, 9}, {0x14, 1, 1, 9},
    224     {0x13, 1, 1, 9}, {0x13, 1, 1, 9}, {0x12, 1, 1, 9}, {0x12, 1, 1, 9}, {0x11, 1, 1, 9}, {0x11, 1, 1, 9},
    225     {0x0, 2, 1, 9}, {0x0, 2, 1, 9}, {0x16, 1, 0, 9}, {0x16, 1, 0, 9}, {0x15, 1, 0, 9}, {0x15, 1, 0, 9},
    226     {0x14, 1, 0, 9}, {0x14, 1, 0, 9}, {0x13, 1, 0, 9}, {0x13, 1, 0, 9}, {0x12, 1, 0, 9}, {0x12, 1, 0, 9},
    227     {0x11, 1, 0, 9}, {0x11, 1, 0, 9}, {0x10, 1, 0, 9}, {0x10, 1, 0, 9}, {0xf, 1, 0, 9}, {0xf, 1, 0, 9},
    228     {0x4, 2, 0, 9}, {0x4, 2, 0, 9}, {0x3, 2, 0, 9}, {0x3, 2, 0, 9}, {0x0, 7, 0, 9}, {0x0, 7, 0, 9},
    229     {0x0, 6, 0, 9}, {0x0, 6, 0, 9}, {0x10, 1, 1, 8}, {0x10, 1, 1, 8}, {0x10, 1, 1, 8}, {0x10, 1, 1, 8},
    230     {0xf, 1, 1, 8}, {0xf, 1, 1, 8}, {0xf, 1, 1, 8}, {0xf, 1, 1, 8}, {0xe, 1, 1, 8}, {0xe, 1, 1, 8},
    231     {0xe, 1, 1, 8}, {0xe, 1, 1, 8}, {0xd, 1, 1, 8}, {0xd, 1, 1, 8}, {0xd, 1, 1, 8}, {0xd, 1, 1, 8},
    232     {0xc, 1, 1, 8}, {0xc, 1, 1, 8}, {0xc, 1, 1, 8}, {0xc, 1, 1, 8}, {0xb, 1, 1, 8}, {0xb, 1, 1, 8},
    233     {0xb, 1, 1, 8}, {0xb, 1, 1, 8}, {0xa, 1, 1, 8}, {0xa, 1, 1, 8}, {0xa, 1, 1, 8}, {0xa, 1, 1, 8},
    234     {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0xe, 1, 0, 8}, {0xe, 1, 0, 8},
    235     {0xe, 1, 0, 8}, {0xe, 1, 0, 8}, {0xd, 1, 0, 8}, {0xd, 1, 0, 8}, {0xd, 1, 0, 8}, {0xd, 1, 0, 8},
    236     {0x2, 2, 0, 8}, {0x2, 2, 0, 8}, {0x2, 2, 0, 8}, {0x2, 2, 0, 8}, {0x1, 3, 0, 8}, {0x1, 3, 0, 8},
    237     {0x1, 3, 0, 8}, {0x1, 3, 0, 8}, {0x0, 5, 0, 8}, {0x0, 5, 0, 8}, {0x0, 5, 0, 8}, {0x0, 5, 0, 8}
    238 };
    239 
    240 
    241 const VLCtab2 PV_DCT3Dtab2[] =
    242 {
    243     {0x1, 2, 1, 11}, {0x1, 2, 1, 11}, {0x0, 3, 1, 11}, {0x0, 3, 1, 11}, {0x0, 0xb, 0, 11}, {0x0, 0xb, 0, 11},
    244     {0x0, 0xa, 0, 11}, {0x0, 0xa, 0, 11}, {0x1c, 1, 1, 10}, {0x1c, 1, 1, 10}, {0x1c, 1, 1, 10}, {0x1c, 1, 1, 10},
    245     {0x1b, 1, 1, 10}, {0x1b, 1, 1, 10}, {0x1b, 1, 1, 10}, {0x1b, 1, 1, 10}, {0x1a, 1, 1, 10}, {0x1a, 1, 1, 10},
    246     {0x1a, 1, 1, 10}, {0x1a, 1, 1, 10}, {0x19, 1, 1, 10}, {0x19, 1, 1, 10}, {0x19, 1, 1, 10}, {0x19, 1, 1, 10},
    247     {0x9, 2, 0, 10}, {0x9, 2, 0, 10}, {0x9, 2, 0, 10}, {0x9, 2, 0, 10}, {0x8, 2, 0, 10}, {0x8, 2, 0, 10},
    248     {0x8, 2, 0, 10}, {0x8, 2, 0, 10}, {0x7, 2, 0, 10}, {0x7, 2, 0, 10}, {0x7, 2, 0, 10}, {0x7, 2, 0, 10},
    249     {0x6, 2, 0, 10}, {0x6, 2, 0, 10}, {0x6, 2, 0, 10}, {0x6, 2, 0, 10}, {0x5, 2, 0, 10}, {0x5, 2, 0, 10},
    250     {0x5, 2, 0, 10}, {0x5, 2, 0, 10}, {0x3, 3, 0, 10}, {0x3, 3, 0, 10}, {0x3, 3, 0, 10}, {0x3, 3, 0, 10},
    251     {0x2, 3, 0, 10}, {0x2, 3, 0, 10}, {0x2, 3, 0, 10}, {0x2, 3, 0, 10}, {0x1, 4, 0, 10}, {0x1, 4, 0, 10},
    252     {0x1, 4, 0, 10}, {0x1, 4, 0, 10}, {0x0, 0xc, 0, 11}, {0x0, 0xc, 0, 11}, {0x1, 5, 0, 11}, {0x1, 5, 0, 11},
    253     {0x17, 1, 0, 11}, {0x17, 1, 0, 11}, {0x18, 1, 0, 11}, {0x18, 1, 0, 11}, {0x1d, 1, 1, 11}, {0x1d, 1, 1, 11},
    254     {0x1e, 1, 1, 11}, {0x1e, 1, 1, 11}, {0x1f, 1, 1, 11}, {0x1f, 1, 1, 11}, {0x20, 1, 1, 11}, {0x20, 1, 1, 11},
    255     {0x1, 6, 0, 12}, {0x2, 4, 0, 12}, {0x4, 3, 0, 12}, {0x5, 3, 0, 12}, {0x6, 3, 0, 12}, {0xa, 2, 0, 12},
    256     {0x19, 1, 0, 12}, {0x1a, 1, 0, 12}, {0x21, 1, 1, 12}, {0x22, 1, 1, 12}, {0x23, 1, 1, 12}, {0x24, 1, 1, 12},
    257     {0x25, 1, 1, 12}, {0x26, 1, 1, 12}, {0x27, 1, 1, 12}, {0x28, 1, 1, 12}, {0xbf, 0xf, 1, 7},
    258     {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7},
    259     {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7},
    260     {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7},
    261     {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7},
    262     {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7}, {0xbf, 0xf, 1, 7},
    263     {0xbf, 0xf, 1, 7}
    264 };
    265 
    266 /* New tables for Intra luminance blocks */
    267 
    268 const VLCtab2 PV_DCT3Dtab3[] =
    269 {
    270     {0x4, 1, 1, 7}, {0x3, 1, 1, 7}, {0x6, 1, 0, 7}, {0x5, 1, 1, 7},
    271     {0x7, 1, 0, 7}, {0x2, 2, 0, 7}, {0x1, 3, 0, 7}, {0x0, 9, 0, 7},
    272     {0x0, 2, 1, 6}, {0x0, 2, 1, 6}, {0x5, 1, 0, 6}, {0x5, 1, 0, 6},
    273     {0x2, 1, 1, 6}, {0x2, 1, 1, 6}, {0x1, 1, 1, 6}, {0x1, 1, 1, 6},
    274     {0x4, 1, 0, 6}, {0x4, 1, 0, 6}, {0x3, 1, 0, 6}, {0x3, 1, 0, 6},
    275     {0x0, 8, 0, 6}, {0x0, 8, 0, 6}, {0x0, 7, 0, 6}, {0x0, 7, 0, 6},
    276     {0x1, 2, 0, 6}, {0x1, 2, 0, 6}, {0x0, 6, 0, 6}, {0x0, 6, 0, 6},
    277     {0x2, 1, 0, 5}, {0x2, 1, 0, 5}, {0x2, 1, 0, 5}, {0x2, 1, 0, 5},
    278     {0x0, 5, 0, 5}, {0x0, 5, 0, 5}, {0x0, 5, 0, 5}, {0x0, 5, 0, 5},
    279     {0x0, 4, 0, 5}, {0x0, 4, 0, 5}, {0x0, 4, 0, 5}, {0x0, 4, 0, 5},
    280     {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4},
    281     {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4},
    282     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    283     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    284     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    285     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    286     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    287     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    288     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    289     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    290     {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3},
    291     {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3},
    292     {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3},
    293     {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3},
    294     {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4},
    295     {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4},
    296     {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4},
    297     {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4}
    298 };
    299 
    300 const VLCtab2 PV_DCT3Dtab4[] =
    301 {
    302     {0x0, 0x12, 0, 10}, {0x0, 0x11, 0, 10}, {0xe, 1, 1, 9}, {0xe, 1, 1, 9},
    303     {0xd, 1, 1, 9}, {0xd, 1, 1, 9}, {0xc, 1, 1, 9}, {0xc, 1, 1, 9},
    304     {0xb, 1, 1, 9}, {0xb, 1, 1, 9}, {0xa, 1, 1, 9}, {0xa, 1, 1, 9},
    305     {0x1, 2, 1, 9}, {0x1, 2, 1, 9}, {0x0, 4, 1, 9}, {0x0, 4, 1, 9},
    306     {0xc, 1, 0, 9}, {0xc, 1, 0, 9}, {0xb, 1, 0, 9}, {0xb, 1, 0, 9},
    307     {0x7, 2, 0, 9}, {0x7, 2, 0, 9}, {0x6, 2, 0, 9}, {0x6, 2, 0, 9},
    308     {0x5, 2, 0, 9}, {0x5, 2, 0, 9}, {0x3, 3, 0, 9}, {0x3, 3, 0, 9},
    309     {0x2, 3, 0, 9}, {0x2, 3, 0, 9}, {0x1, 6, 0, 9}, {0x1, 6, 0, 9},
    310     {0x1, 5, 0, 9}, {0x1, 5, 0, 9}, {0x0, 0x10, 0, 9}, {0x0, 0x10, 0, 9},
    311     {0x4, 2, 0, 9}, {0x4, 2, 0, 9}, {0x0, 0xf, 0, 9}, {0x0, 0xf, 0, 9},
    312     {0x0, 0xe, 0, 9}, {0x0, 0xe, 0, 9}, {0x0, 0xd, 0, 9}, {0x0, 0xd, 0, 9},
    313     {0x8, 1, 1, 8}, {0x8, 1, 1, 8}, {0x8, 1, 1, 8}, {0x8, 1, 1, 8},
    314     {0x7, 1, 1, 8}, {0x7, 1, 1, 8}, {0x7, 1, 1, 8}, {0x7, 1, 1, 8},
    315     {0x6, 1, 1, 8}, {0x6, 1, 1, 8}, {0x6, 1, 1, 8}, {0x6, 1, 1, 8},
    316     {0x0, 3, 1, 8}, {0x0, 3, 1, 8}, {0x0, 3, 1, 8}, {0x0, 3, 1, 8},
    317     {0xa, 1, 0, 8}, {0xa, 1, 0, 8}, {0xa, 1, 0, 8}, {0xa, 1, 0, 8},
    318     {0x9, 1, 0, 8}, {0x9, 1, 0, 8}, {0x9, 1, 0, 8}, {0x9, 1, 0, 8},
    319     {0x8, 1, 0, 8}, {0x8, 1, 0, 8}, {0x8, 1, 0, 8}, {0x8, 1, 0, 8},
    320     {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0x9, 1, 1, 8},
    321     {0x3, 2, 0, 8}, {0x3, 2, 0, 8}, {0x3, 2, 0, 8}, {0x3, 2, 0, 8},
    322     {0x1, 4, 0, 8}, {0x1, 4, 0, 8}, {0x1, 4, 0, 8}, {0x1, 4, 0, 8},
    323     {0x0, 0xc, 0, 8}, {0x0, 0xc, 0, 8}, {0x0, 0xc, 0, 8}, {0x0, 0xc, 0, 8},
    324     {0x0, 0xb, 0, 8}, {0x0, 0xb, 0, 8}, {0x0, 0xb, 0, 8}, {0x0, 0xb, 0, 8},
    325     {0x0, 0xa, 0, 8}, {0x0, 0xa, 0, 8}, {0x0, 0xa, 0, 8}, {0x0, 0xa, 0, 8}
    326 };
    327 
    328 const VLCtab2 PV_DCT3Dtab5[] =
    329 {
    330     {0x0, 7, 1, 11}, {0x0, 7, 1, 11}, {0x0, 6, 1, 11}, {0x0, 6, 1, 11},
    331     {0x0, 0x16, 0, 11}, {0x0, 0x16, 0, 11}, {0x0, 0x15, 0, 11}, {0x0, 0x15, 0, 11},
    332     {0x2, 2, 1, 10}, {0x2, 2, 1, 10}, {0x2, 2, 1, 10}, {0x2, 2, 1, 10},
    333     {0x1, 3, 1, 10}, {0x1, 3, 1, 10}, {0x1, 3, 1, 10}, {0x1, 3, 1, 10},
    334     {0x0, 5, 1, 10}, {0x0, 5, 1, 10}, {0x0, 5, 1, 10}, {0x0, 5, 1, 10},
    335     {0xd, 1, 0, 10}, {0xd, 1, 0, 10}, {0xd, 1, 0, 10}, {0xd, 1, 0, 10},
    336     {0x5, 3, 0, 10}, {0x5, 3, 0, 10}, {0x5, 3, 0, 10}, {0x5, 3, 0, 10},
    337     {0x8, 2, 0, 10}, {0x8, 2, 0, 10}, {0x8, 2, 0, 10}, {0x8, 2, 0, 10},
    338     {0x4, 3, 0, 10}, {0x4, 3, 0, 10}, {0x4, 3, 0, 10}, {0x4, 3, 0, 10},
    339     {0x3, 4, 0, 10}, {0x3, 4, 0, 10}, {0x3, 4, 0, 10}, {0x3, 4, 0, 10},
    340     {0x2, 4, 0, 10}, {0x2, 4, 0, 10}, {0x2, 4, 0, 10}, {0x2, 4, 0, 10},
    341     {0x1, 7, 0, 10}, {0x1, 7, 0, 10}, {0x1, 7, 0, 10}, {0x1, 7, 0, 10},
    342     {0x0, 0x14, 0, 10}, {0x0, 0x14, 0, 10}, {0x0, 0x14, 0, 10}, {0x0, 0x14, 0, 10},
    343     {0x0, 0x13, 0, 10}, {0x0, 0x13, 0, 10}, {0x0, 0x13, 0, 10}, {0x0, 0x13, 0, 10},
    344     {0x0, 0x17, 0, 11}, {0x0, 0x17, 0, 11}, {0x0, 0x18, 0, 11}, {0x0, 0x18, 0, 11},
    345     {0x1, 8, 0, 11}, {0x1, 8, 0, 11}, {0x9, 2, 0, 11}, {0x9, 2, 0, 11},
    346     {0x3, 2, 1, 11}, {0x3, 2, 1, 11}, {0x4, 2, 1, 11}, {0x4, 2, 1, 11},
    347     {0xf, 1, 1, 11}, {0xf, 1, 1, 11}, {0x10, 1, 1, 11}, {0x10, 1, 1, 11},
    348     {0, 0x19, 0, 12}, {0, 0x1a, 0, 12}, {0, 0x1b, 0, 12}, {1, 9, 0, 12},
    349     {0x6, 3, 0, 12}, {0x1, 0xa, 0, 12}, {0x2, 5, 0, 12}, {0x7, 3, 0, 12},
    350     {0xe, 1, 0, 12}, {0x0, 8, 1, 12}, {0x5, 2, 1, 12}, {0x6, 2, 1, 12},
    351     {0x11, 1, 1, 12}, {0x12, 1, 1, 12}, {0x13, 1, 1, 12}, {0x14, 1, 1, 12},
    352     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7},
    353     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7},
    354     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7},
    355     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7},
    356     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7},
    357     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7},
    358     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7},
    359     {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}, {0x1b, 0xff, 0, 7}
    360 };
    361 
    362 #ifdef PV_ANNEX_IJKT_SUPPORT
    363 const VLCtab2 PV_DCT3Dtab6[] =
    364 {
    365     {0x0, 3, 1, 7}, {0x4, 1, 1, 7}, {0x6, 1, 1, 7}, {0x5, 1, 1, 7}, {0x1, 3, 0, 7}, {0x2, 2, 0, 7},
    366     {0x0, 9, 0, 7}, {0x5, 1, 0, 7}, {0x0, 2, 1, 6}, {0x0, 2, 1, 6}, {0x3, 1, 1, 6}, {0x3, 1, 1, 6},
    367     {0x2, 1, 1, 6}, {0x2, 1, 1, 6}, {0x1, 1, 1, 6}, {0x1, 1, 1, 6}, {0x0, 6, 0, 6}, {0x0, 6, 0, 6},
    368     {0x0, 7, 0, 6}, {0x0, 7, 0, 6}, {0x0, 8, 0, 6}, {0x0, 8, 0, 6}, {0x4, 1, 0, 6}, {0x4, 1, 0, 6},
    369     {0x1, 2, 0, 6}, {0x1, 2, 0, 6}, {0x3, 1, 0, 6}, {0x3, 1, 0, 6}, {0x2, 1, 0, 5}, {0x2, 1, 0, 5},
    370     {0x2, 1, 0, 5}, {0x2, 1, 0, 5}, {0x0, 4, 0, 5}, {0x0, 4, 0, 5}, {0x0, 4, 0, 5}, {0x0, 4, 0, 5},
    371     {0x0, 5, 0, 5}, {0x0, 5, 0, 5}, {0x0, 5, 0, 5}, {0x0, 5, 0, 5}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4},
    372     {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4}, {0x0, 1, 1, 4},
    373     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    374     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    375     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    376     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    377     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 1, 0, 2},
    378     {0x0, 1, 0, 2}, {0x0, 1, 0, 2}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3},
    379     {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3},
    380     {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3}, {0x0, 2, 0, 3},
    381     {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x0, 3, 0, 4},
    382     {0x0, 3, 0, 4}, {0x0, 3, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4},
    383     {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4}, {0x1, 1, 0, 4}
    384 };
    385 
    386 const VLCtab2 PV_DCT3Dtab7[] =
    387 {
    388     {0xb, 1, 0, 10}, {0xa, 1, 0, 10}, {0x0, 5, 1, 9}, {0x0, 5, 1, 9}, {0x0, 6, 1, 9}, {0x0, 6, 1, 9},
    389     {0x1, 2, 1, 9}, {0x1, 2, 1, 9}, {0x2, 2, 1, 9}, {0x2, 2, 1, 9}, {0xf, 1, 1, 9}, {0xf, 1, 1, 9},
    390     {0x10, 1, 1, 9}, {0x10, 1, 1, 9}, {0x12, 1, 1, 9}, {0x12, 1, 1, 9}, {0x11, 1, 1, 9}, {0x11, 1, 1, 9},
    391     {0xe, 1, 1, 9}, {0xe, 1, 1, 9}, {0x0, 13, 0, 9}, {0x0, 13, 0, 9}, {0x0, 14, 0, 9}, {0x0, 14, 0, 9},
    392     {0x0, 15, 0, 9}, {0x0, 15, 0, 9}, {0x0, 16, 0, 9}, {0x0, 16, 0, 9}, {0x0, 17, 0, 9}, {0x0, 17, 0, 9},
    393     {0x0, 18, 0, 9}, {0x0, 18, 0, 9}, {0x0, 11, 0, 9}, {0x0, 11, 0, 9}, {0x0, 12, 0, 9}, {0x0, 12, 0, 9},
    394     {0x5, 2, 0, 9}, {0x5, 2, 0, 9}, {0x4, 2, 0, 9}, {0x4, 2, 0, 9}, {0x9, 1, 0, 9}, {0x9, 1, 0, 9},
    395     {0x8, 1, 0, 9}, {0x8, 1, 0, 9}, {0x0, 4, 1, 8}, {0x0, 4, 1, 8}, {0x0, 4, 1, 8}, {0x0, 4, 1, 8},
    396     {0x7, 1, 1, 8}, {0x7, 1, 1, 8}, {0x7, 1, 1, 8}, {0x7, 1, 1, 8}, {0x8, 1, 1, 8}, {0x8, 1, 1, 8},
    397     {0x8, 1, 1, 8}, {0x8, 1, 1, 8}, {0xd, 1, 1, 8}, {0xd, 1, 1, 8}, {0xd, 1, 1, 8}, {0xd, 1, 1, 8},
    398     {0xc, 1, 1, 8}, {0xc, 1, 1, 8}, {0xc, 1, 1, 8}, {0xc, 1, 1, 8}, {0xb, 1, 1, 8}, {0xb, 1, 1, 8},
    399     {0xb, 1, 1, 8}, {0xb, 1, 1, 8}, {0xa, 1, 1, 8}, {0xa, 1, 1, 8}, {0xa, 1, 1, 8}, {0xa, 1, 1, 8},
    400     {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0x9, 1, 1, 8}, {0x0, 10, 0, 8}, {0x0, 10, 0, 8},
    401     {0x0, 10, 0, 8}, {0x0, 10, 0, 8}, {0x6, 1, 0, 8}, {0x6, 1, 0, 8}, {0x6, 1, 0, 8}, {0x6, 1, 0, 8},
    402     {0x3, 2, 0, 8}, {0x3, 2, 0, 8}, {0x3, 2, 0, 8}, {0x3, 2, 0, 8}, {0x1, 4, 0, 8}, {0x1, 4, 0, 8},
    403     {0x1, 4, 0, 8}, {0x1, 4, 0, 8}, {0x7, 1, 0, 8}, {0x7, 1, 0, 8}, {0x7, 1, 0, 8}, {0x7, 1, 0, 8}
    404 };
    405 
    406 
    407 const VLCtab2 PV_DCT3Dtab8[] =
    408 {
    409     {0x13, 0x1, 1, 11}, {0x13, 0x1, 1, 11}, {0x14, 0x1, 1, 11}, {0x14, 0x1, 1, 11}, {0x9, 0x2, 0, 11}, {0x9, 0x2, 0, 11},
    410     {0x4, 0x3, 0, 11}, {0x4, 0x3, 0, 11}, {0x0, 0x7, 1, 10}, {0x0, 0x7, 1, 10}, {0x0, 0x7, 1, 10}, {0x0, 0x7, 1, 10},
    411     {0x1, 0x3, 1, 10}, {0x1, 0x3, 1, 10}, {0x1, 0x3, 1, 10}, {0x1, 0x3, 1, 10}, {0x3, 0x2, 1, 10}, {0x3, 0x2, 1, 10},
    412     {0x3, 0x2, 1, 10}, {0x3, 0x2, 1, 10}, {0x4, 0x2, 1, 10}, {0x4, 0x2, 1, 10}, {0x4, 0x2, 1, 10}, {0x4, 0x2, 1, 10},
    413     {0xc, 0x1, 0, 10}, {0xc, 0x1, 0, 10}, {0xc, 0x1, 0, 10}, {0xc, 0x1, 0, 10}, {0x2, 0x4, 0, 10}, {0x2, 0x4, 0, 10},
    414     {0x2, 0x4, 0, 10}, {0x2, 0x4, 0, 10}, {0x8, 0x2, 0, 10}, {0x8, 0x2, 0, 10}, {0x8, 0x2, 0, 10}, {0x8, 0x2, 0, 10},
    415     {0x7, 0x2, 0, 10}, {0x7, 0x2, 0, 10}, {0x7, 0x2, 0, 10}, {0x7, 0x2, 0, 10}, {0x6, 0x2, 0, 10}, {0x6, 0x2, 0, 10},
    416     {0x6, 0x2, 0, 10}, {0x6, 0x2, 0, 10}, {0x3, 0x3, 0, 10}, {0x3, 0x3, 0, 10}, {0x3, 0x3, 0, 10}, {0x3, 0x3, 0, 10},
    417     {0x2, 0x3, 0, 10}, {0x2, 0x3, 0, 10}, {0x2, 0x3, 0, 10}, {0x2, 0x3, 0, 10}, {0x1, 0x5, 0, 10}, {0x1, 0x5, 0, 10},
    418     {0x1, 0x5, 0, 10}, {0x1, 0x5, 0, 10}, {0xd, 0x1, 0, 11}, {0xd, 0x1, 0, 11}, {0x1, 0x6, 0, 11}, {0x1, 0x6, 0, 11},
    419     {0x0, 0x14, 0, 11}, {0x0, 0x14, 0, 11}, {0x0, 0x13, 0, 11}, {0x0, 0x13, 0, 11}, {0x2, 0x3, 1, 11}, {0x2, 0x3, 1, 11},
    420     {0x1, 0x4, 1, 11}, {0x1, 0x4, 1, 11}, {0x0, 0x9, 1, 11}, {0x0, 0x9, 1, 11}, {0x0, 0x8, 1, 11}, {0x0, 0x8, 1, 11},
    421     {0x1, 0x7, 0, 12}, {0x3, 0x4, 0, 12}, {0x5, 0x3, 0, 12}, {0x0, 0x19, 0, 12}, {0x0, 0x18, 0, 12}, {0x0, 0x17, 0, 12},
    422     {0x0, 0x16, 0, 12}, {0x0, 0x15, 0, 12}, {0x15, 0x1, 1, 12}, {0x16, 0x1, 1, 12}, {0x17, 0x1, 1, 12}, {0x7, 0x2, 1, 12},
    423     {0x6, 0x2, 1, 12}, {0x5, 0x2, 1, 12}, {0x3, 0x3, 1, 12}, {0x0, 0xa, 1, 12}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7},
    424     {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7},
    425     {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7},
    426     {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7},
    427     {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7},
    428     {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}, {0x2f, 0x3f, 1, 7}
    429 };
    430 #endif
    431 /* RVLC tables */
    432 const int ptrRvlcTab[11] = {0, 24, 46, 66, 84, 100, 114, 126, 134, 140, 144};
    433 
    434 const VLCtab2 RvlcDCTtabIntra[170] = /* 00xxxx00 or 00xxxx01 */
    435 {
    436     {27, 255, 0, 5},    /* 0000 is escape code */
    437     {1, 1, 0, 4},
    438     {2, 1, 0, 5},
    439     {3, 1, 0, 5},
    440     {4, 1, 0, 6},
    441     {5, 1, 0, 6},
    442     {6, 1, 0, 7},
    443     {7, 1, 0, 7},
    444     {8, 1, 0, 8},
    445     {9, 1, 0, 8},
    446     {10, 1, 0, 9},
    447     {5, 2, 0, 9},
    448     {11, 1, 0, 10},
    449     {12, 1, 0, 10},
    450     {13, 1, 0, 11},
    451     {9, 2, 0, 11},
    452     {10, 2, 0, 12},
    453     {4, 4, 0, 12},
    454     {14, 1, 0, 13},
    455     {15, 1, 0, 13},
    456     {16, 1, 0, 14},
    457     {17, 1, 0, 14},
    458     {0, 27, 0, 15},
    459     {3, 9, 0, 15},
    460     /* 010xxxx00 or 010xxxx01 */
    461     {1, 2, 0, 5},
    462     {0, 4, 0, 5},
    463     {0, 5, 0, 6},
    464     {0, 6, 0, 6},
    465     {2, 2, 0, 7},
    466     {1, 3, 0, 7},
    467     {3, 2, 0, 8},
    468     {4, 2, 0, 8},
    469     {2, 3, 0, 9},
    470     {3, 3, 0, 9},
    471     {6, 2, 0, 10},
    472     {7, 2, 0, 10},
    473     {5, 3, 0, 11},
    474     {6, 3, 0, 11},
    475     {5, 4, 0, 12},
    476     {6, 4, 0, 12},
    477     {11, 2, 0, 13},
    478     {8, 3, 0, 13},
    479     {18, 1, 0, 14},
    480     {8, 4, 0, 14},
    481     {6, 5, 0, 15},
    482     {7, 5, 0, 15},
    483     /* 0110xxxx00 or 0110xxxx01 */
    484     {3, 1, 1, 6},
    485     {4, 1, 1, 6},
    486     {0, 7, 0, 7},
    487     {7, 1, 1, 7},
    488     {1, 4, 0, 8},
    489     {1, 5, 0, 8},
    490     {1, 6, 0, 9},
    491     {0, 10, 0, 9},
    492     {8, 2, 0, 10},
    493     {4, 3, 0, 10},
    494     {7, 3, 0, 11},
    495     {3, 4, 0, 11},
    496     {3, 5, 0, 12},
    497     {4, 5, 0, 12},
    498     {9, 3, 0, 13},
    499     {7, 4, 0, 13},
    500     {5, 5, 0, 14},
    501     {4, 6, 0, 14},
    502     {9, 4, 0, 15},
    503     {12, 2, 0, 15},
    504     /* 01110xxxx00 or 01110xxxx01 */
    505     {8, 1, 1, 7},
    506     {9, 1, 1, 7},
    507     {0, 8, 0, 8},
    508     {0, 9, 0, 8},
    509     {0, 11, 0, 9},
    510     {1, 2, 1, 9},
    511     {2, 4, 0, 10},
    512     {1, 7, 0, 10},
    513     {2, 5, 0, 11},
    514     {2, 6, 0, 11},
    515     {1, 10, 0, 12},
    516     {0, 18, 0, 12},
    517     {3, 6, 0, 13},
    518     {2, 7, 0, 13},
    519     {5, 6, 0, 14},
    520     {3, 7, 0, 14},
    521     {19, 1, 0, 15},
    522     {1, 5, 1, 15},
    523     /* 011110xxxx00 or 011110xxxx01 */
    524     {0, 2, 1, 8},
    525     {12, 1, 1, 8},
    526     {15, 1, 1, 9},
    527     {16, 1, 1, 9},
    528     {0, 12, 0, 10},
    529     {0, 13, 0, 10},
    530     {1, 8, 0, 11},
    531     {1, 9, 0, 11},
    532     {0, 19, 0, 12},
    533     {0, 22, 0, 12},
    534     {2, 8, 0, 13},
    535     {2, 9, 0, 13},
    536     {3, 8, 0, 14},
    537     {2, 10, 0, 14},
    538     {2, 3, 1, 15},
    539     {13, 2, 1, 15},
    540     /* 0111110xxxx00 or 0111110xxxx01 */
    541     {17, 1, 1, 9},
    542     {18, 1, 1, 9},
    543     {0, 14, 0, 10},
    544     {21, 1, 1, 10},
    545     {0, 15, 0, 11},
    546     {0, 16, 0, 11},
    547     {1, 3, 1, 12},
    548     {3, 2, 1, 12},
    549     {1, 11, 0, 13},
    550     {0, 20, 0, 13},
    551     {2, 11, 0, 14},
    552     {1, 12, 0, 14},
    553     {41, 1, 1, 15},
    554     {42, 1, 1, 15},
    555     /* 01111110xxxx00 or 01111110xxxx01 */
    556     {22, 1, 1, 10},
    557     {23, 1, 1, 10},
    558     {0, 17, 0, 11},
    559     {0, 3, 1, 11},
    560     {4, 2, 1, 12},
    561     {29, 1, 1, 12},
    562     {0, 21, 0, 13},
    563     {0, 23, 0, 13},
    564     {1, 13, 0, 14},
    565     {0, 24, 0, 14},
    566     {43, 1, 1, 15},
    567     {44, 1, 1, 15},
    568     /* 011111110xxxx00 or 011111110xxxx01 */
    569     {2, 2, 1, 11},
    570     {26, 1, 1, 11},
    571     {30, 1, 1, 12},
    572     {31, 1, 1, 12},
    573     {0, 4, 1, 13},
    574     {5, 2, 1, 13},
    575     {0, 25, 0, 14},
    576     {0, 26, 0, 14},
    577     /* 0111111110xxxx00 or 0111111110xxxx01 */
    578     {32, 1, 1, 12},
    579     {33, 1, 1, 12},
    580     {6, 2, 1, 13},
    581     {7, 2, 1, 13},
    582     {0, 5, 1, 14},
    583     {1, 4, 1, 14},
    584     /* 01111111110xxxx00 or 01111111110xxxx01 */
    585     {8, 2, 1, 13},
    586     {9, 2, 1, 13},
    587     {10, 2, 1, 14},
    588     {11, 2, 1, 14},
    589     /* 011111111110xxxx00 or 011111111110xxxx01 */
    590     {12, 2, 1, 14},
    591     {38, 1, 1, 14},
    592     /* 1xxxx10 or 1xxxx11 from 11 zeros to 0 zeros*/
    593     {0, 1, 0, 3},
    594     {0, 2, 0, 3},
    595     {0, 3, 0, 4},
    596     {0, 1, 1, 4},
    597     {1, 1, 1, 5},
    598     {2, 1, 1, 5},
    599     {5, 1, 1, 6},
    600     {6, 1, 1, 6},
    601     {10, 1, 1, 7},
    602     {11, 1, 1, 7},
    603     {13, 1, 1, 8},
    604     {14, 1, 1, 8},
    605     {19, 1, 1, 9},
    606     {20, 1, 1, 9},
    607     {24, 1, 1, 10},
    608     {25, 1, 1, 10},
    609     {27, 1, 1, 11},
    610     {28, 1, 1, 11},
    611     {34, 1, 1, 12},
    612     {35, 1, 1, 12},
    613     {36, 1, 1, 13},
    614     {37, 1, 1, 13},
    615     {39, 1, 1, 14},
    616     {40, 1, 1, 14}
    617 };
    618 
    619 const VLCtab2 RvlcDCTtabInter[170] = /* 00xxxx00 or 00xxxx01 */
    620 {
    621     {27, 255, 0, 5},    /* 0000 is escape code */
    622     {0, 2, 0, 4},
    623     {0, 3, 0, 5},
    624     {3, 1, 0, 5},
    625     {1, 2, 0, 6},
    626     {6, 1, 0, 6},
    627     {0, 4, 0, 7},
    628     {2, 2, 0, 7},
    629     {0, 5, 0, 8},
    630     {0, 6, 0, 8},
    631     {0, 7, 0, 9},
    632     {1, 4, 0, 9},
    633     {0, 8, 0, 10},
    634     {0, 9, 0, 10},
    635     {0, 10, 0, 11},
    636     {0, 11, 0, 11},
    637     {0, 12, 0, 12},
    638     {1, 7, 0, 12},
    639     {0, 13, 0, 13},
    640     {0, 14, 0, 13},
    641     {0, 17, 0, 14},
    642     {0, 18, 0, 14},
    643     {0, 19, 0, 15},
    644     {3, 7, 0, 15},
    645     /* 010xxxx00 or 010xxxx01 */
    646     {4, 1, 0, 5},
    647     {5, 1, 0, 5},
    648     {7, 1, 0, 6},
    649     {8, 1, 0, 6},
    650     {9, 1, 0, 7},
    651     {10, 1, 0, 7},
    652     {1, 3, 0, 8},
    653     {3, 2, 0, 8},
    654     {2, 3, 0, 9},
    655     {5, 2, 0, 9},
    656     {1, 5, 0, 10},
    657     {3, 3, 0, 10},
    658     {1, 6, 0, 11},
    659     {2, 4, 0, 11},
    660     {2, 5, 0, 12},
    661     {3, 4, 0, 12},
    662     {0, 15, 0, 13},
    663     {0, 16, 0, 13},
    664     {1, 9, 0, 14},
    665     {1, 10, 0, 14},
    666     {4, 5, 0, 15},
    667     {7, 4, 0, 15},
    668     /* 0110xxxx00 or 0110xxxx01 */
    669     {3, 1, 1, 6},
    670     {4, 1, 1, 6},
    671     {11, 1, 0, 7},
    672     {7, 1, 1, 7},
    673     {4, 2, 0, 8},
    674     {12, 1, 0, 8},
    675     {15, 1, 0, 9},
    676     {16, 1, 0, 9},
    677     {6, 2, 0, 10},
    678     {7, 2, 0, 10},
    679     {4, 3, 0, 11},
    680     {5, 3, 0, 11},
    681     {6, 3, 0, 12},
    682     {7, 3, 0, 12},
    683     {1, 8, 0, 13},
    684     {3, 5, 0, 13},
    685     {2, 6, 0, 14},
    686     {2, 7, 0, 14},
    687     {17, 2, 0, 15},
    688     {37, 1, 0, 15},
    689     /* 01110xxxx00 or 01110xxxx01 */
    690     {8, 1, 1, 7},
    691     {9, 1, 1, 7},
    692     {13, 1, 0, 8},
    693     {14, 1, 0, 8},
    694     {17, 1, 0, 9},
    695     {1, 2, 1, 9},
    696     {8, 2, 0, 10},
    697     {9, 2, 0, 10},
    698     {10, 2, 0, 11},
    699     {21, 1, 0, 11},
    700     {11, 2, 0, 12},
    701     {27, 1, 0, 12},
    702     {4, 4, 0, 13},
    703     {5, 4, 0, 13},
    704     {3, 6, 0, 14},
    705     {6, 4, 0, 14},
    706     {38, 1, 0, 15},
    707     {1, 5, 1, 15},
    708     /* 011110xxxx00 or 011110xxxx01 */
    709     {0, 2, 1, 8},
    710     {12, 1, 1, 8},
    711     {15, 1, 1, 9},
    712     {16, 1, 1, 9},
    713     {18, 1, 0, 10},
    714     {19, 1, 0, 10},
    715     {22, 1, 0, 11},
    716     {23, 1, 0, 11},
    717     {28, 1, 0, 12},
    718     {29, 1, 0, 12},
    719     {8, 3, 0, 13},
    720     {12, 2, 0, 13},
    721     {9, 3, 0, 14},
    722     {13, 2, 0, 14},
    723     {2, 3, 1, 15},
    724     {13, 2, 1, 15},
    725     /* 0111110xxxx00 or 0111110xxxx01 */
    726     {17, 1, 1, 9},
    727     {18, 1, 1, 9},
    728     {20, 1, 0, 10},
    729     {21, 1, 1, 10},
    730     {24, 1, 0, 11},
    731     {25, 1, 0, 11},
    732     {1, 3, 1, 12},
    733     {3, 2, 1, 12},
    734     {30, 1, 0, 13},
    735     {31, 1, 0, 13},
    736     {14, 2, 0, 14},
    737     {15, 2, 0, 14},
    738     {41, 1, 1, 15},
    739     {42, 1, 1, 15},
    740     /* 01111110xxxx00 or 01111110xxxx01 */
    741     {22, 1, 1, 10},
    742     {23, 1, 1, 10},
    743     {26, 1, 0, 11},
    744     {0, 3, 1, 11},
    745     {4, 2, 1, 12},
    746     {29, 1, 1, 12},
    747     {32, 1, 0, 13},
    748     {33, 1, 0, 13},
    749     {16, 2, 0, 14},
    750     {34, 1, 0, 14},
    751     {43, 1, 1, 15},
    752     {44, 1, 1, 15},
    753     /* 011111110xxxx00 or 011111110xxxx01 */
    754     {2, 2, 1, 11},
    755     {26, 1, 1, 11},
    756     {30, 1, 1, 12},
    757     {31, 1, 1, 12},
    758     {0, 4, 1, 13},
    759     {5, 2, 1, 13},
    760     {35, 1, 0, 14},
    761     {36, 1, 0, 14},
    762     /* 0111111110xxxx00 or 0111111110xxxx01 */
    763     {32, 1, 1, 12},
    764     {33, 1, 1, 12},
    765     {6, 2, 1, 13},
    766     {7, 2, 1, 13},
    767     {0, 5, 1, 14},
    768     {1, 4, 1, 14},
    769     /* 01111111110xxxx00 or 01111111110xxxx01 */
    770     {8, 2, 1, 13},
    771     {9, 2, 1, 13},
    772     {10, 2, 1, 14},
    773     {11, 2, 1, 14},
    774     /* 011111111110xxxx00 or 011111111110xxxx01 */
    775     {12, 2, 1, 14},
    776     {38, 1, 1, 14},
    777     /* 1xxxx10 or 1xxxx11 from 11 zeros to 0 zeros*/
    778     {0, 1, 0, 3},
    779     {1, 1, 0, 3},
    780     {2, 1, 0, 4},
    781     {0, 1, 1, 4},
    782     {1, 1, 1, 5},
    783     {2, 1, 1, 5},
    784     {5, 1, 1, 6},
    785     {6, 1, 1, 6},
    786     {10, 1, 1, 7},
    787     {11, 1, 1, 7},
    788     {13, 1, 1, 8},
    789     {14, 1, 1, 8},
    790     {19, 1, 1, 9},
    791     {20, 1, 1, 9},
    792     {24, 1, 1, 10},
    793     {25, 1, 1, 10},
    794     {27, 1, 1, 11},
    795     {28, 1, 1, 11},
    796     {34, 1, 1, 12},
    797     {35, 1, 1, 12},
    798     {36, 1, 1, 13},
    799     {37, 1, 1, 13},
    800     {39, 1, 1, 14},
    801     {40, 1, 1, 14}
    802 };
    803 
    804 /*----------------------------------------------------------------------------
    805 ; EXTERNAL FUNCTION REFERENCES
    806 ; Declare functions defined elsewhere and referenced in this module
    807 ----------------------------------------------------------------------------*/
    808 
    809 
    810 /*----------------------------------------------------------------------------
    811 ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
    812 ; Declare variables used in this module but defined elsewhere
    813 ----------------------------------------------------------------------------*/
    814 
    815 
    816 /*----------------------------------------------------------------------------
    817 ; FUNCTION CODE
    818 ----------------------------------------------------------------------------*/
    819 
    820 
    821 /*----------------------------------------------------------------------------
    822 ; Define all local variables
    823 ----------------------------------------------------------------------------*/
    824 
    825 
    826 /*----------------------------------------------------------------------------
    827 ; Function body here
    828 ----------------------------------------------------------------------------*/
    829 
    830 
    831 /*----------------------------------------------------------------------------
    832 ; Return nothing or data or data pointer
    833 ----------------------------------------------------------------------------*/
    834 
    835 
    836