Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComRom.cpp


Ignore:
Timestamp:
11 May 2012, 21:20:17 (12 years ago)
Author:
hschwarz
Message:

updated trunk (move to HM6.1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r21 r56  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license.
     4 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2011, ISO/IEC
     6 * Copyright (c) 2010-2012, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    1515 *    this list of conditions and the following disclaimer in the documentation
    1616 *    and/or other materials provided with the distribution.
    17  *  * Neither the name of the ISO/IEC nor the names of its contributors may
     17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
    1818 *    be used to endorse or promote products derived from this software without
    1919 *    specific prior written permission.
     
    3232 */
    3333
    34 
    35 
    3634/** \file     TComRom.cpp
    3735    \brief    global variables & functions
     
    4240#include <stdlib.h>
    4341#include <stdio.h>
    44 
    4542// ====================================================================================================================
    4643// Initialize / destroy functions
    4744// ====================================================================================================================
     45
     46//! \ingroup TLibCommon
     47//! \{
    4848
    4949// initialize ROM variables
     
    7070    g_auiFrameScanY [ i ] = new UInt[ c*c ];
    7171    initFrameScanXY( g_auiFrameScanXY[i], g_auiFrameScanX[i], g_auiFrameScanY[i], c, c );
    72 #if QC_MDCS
    7372    g_auiSigLastScan[0][i] = new UInt[ c*c ];
    7473    g_auiSigLastScan[1][i] = new UInt[ c*c ];
    7574    g_auiSigLastScan[2][i] = new UInt[ c*c ];
    76     initSigLastScan( g_auiSigLastScan[0][i], g_auiSigLastScan[1][i], g_auiSigLastScan[2][i], c, c, i);
    77 #endif //QC_MDCS
     75    g_auiSigLastScan[3][i] = new UInt[ c*c ];
     76    initSigLastScan( g_auiSigLastScan[0][i], g_auiSigLastScan[1][i], g_auiSigLastScan[2][i], g_auiSigLastScan[3][i], c, c, i);
    7877
    7978    c <<= 1;
    8079  } 
     80
     81  g_sigScanNSQT[0] = new UInt[ 64 ];  // 4x16
     82  g_sigScanNSQT[1] = new UInt[ 256 ]; // 8x32
     83  g_sigScanNSQT[2] = new UInt[ 64 ];  // 16x4
     84  g_sigScanNSQT[3] = new UInt[ 256 ]; // 32x8
     85 
     86  static int diagScanX[ 16 ] =
     87  {
     88    0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 2, 3, 3
     89  };
     90  static int diagScanY[ 16 ] =
     91  {
     92    0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 3, 2, 3
     93  };
     94 
     95  Int j;
     96  // 4x16 scan
     97  for (i = 0; i < 4; i++)
     98  {
     99    for (j = 0; j < 16; j++)
     100    {
     101      g_sigScanNSQT[ 0 ][ 16 * i + j ] = 16 * i + 4 * diagScanY[ j ] + diagScanX[ j ];
     102    }
     103  }
     104 
     105  // 8x32 scan
     106  for (i = 0; i < 16; i++)
     107  {
     108    Int x = g_sigCGScanNSQT[ 1 ][ i ] & 1;
     109    Int y = g_sigCGScanNSQT[ 1 ][ i ] >> 1;
     110   
     111    for (j = 0; j < 16; j++)
     112    {
     113      g_sigScanNSQT[ 1 ][ 16 * i + j ] = 32 * y + 4 * x + 8 * diagScanY[ j ] + diagScanX[ j ];
     114    }
     115  }
     116 
     117  // 16x4 scan
     118  for (i = 0; i < 4; i++)
     119  {
     120    for (j = 0; j < 16; j++)
     121    {
     122      g_sigScanNSQT[ 2 ][ 16 * i + j ] = 4 * i + 16 * diagScanY[ j ] + diagScanX[ j ];
     123    }
     124  }
     125 
     126  // 32x8 scan
     127  for (i = 0; i < 16; i++)
     128  {
     129    Int x = g_sigCGScanNSQT[ 3 ][ i ] & 7;
     130    Int y = g_sigCGScanNSQT[ 3 ][ i ] >> 3;
     131   
     132    for (j = 0; j < 16; j++)
     133    {
     134      g_sigScanNSQT[ 3 ][ 16 * i + j ] = 128 * y + 4 * x + 32 * diagScanY[ j ] + diagScanX[ j ];
     135    }
     136  }
    81137}
    82138
     
    90146    delete[] g_auiFrameScanX [i];
    91147    delete[] g_auiFrameScanY [i];
    92 #if QC_MDCS
    93148    delete[] g_auiSigLastScan[0][i];
    94149    delete[] g_auiSigLastScan[1][i];
    95150    delete[] g_auiSigLastScan[2][i];
    96 #endif //QC_MDCS
     151    delete[] g_auiSigLastScan[3][i];
     152  }
     153  for (i = 0; i < 4; i++)
     154  {
     155    delete[] g_sigScanNSQT[ i ];   
    97156  }
    98157
     
    131190UInt g_auiRasterToPelX  [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
    132191UInt g_auiRasterToPelY  [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
    133 
    134 UInt g_auiPUOffset[4] = { 0, 8, 4, 4 };
     192UInt g_motionRefer   [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
     193
     194UInt g_auiPUOffset[8] = { 0, 8, 4, 4, 2, 10, 1, 5};
    135195
    136196Void initZscanToRaster ( Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt*& rpuiCurrIdx )
     
    167227}
    168228
     229/** generate motion data compression mapping table
     230* \param uiMaxCUWidth, width of LCU
     231* \param uiMaxCUHeight, hight of LCU
     232* \param uiMaxDepth, max depth of LCU
     233* \returns Void
     234*/
     235Void initMotionReferIdx ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth )
     236{
     237  Int  minCUWidth  = (Int)uiMaxCUWidth  >> ( (Int)uiMaxDepth - 1 );
     238  Int  minCUHeight = (Int)uiMaxCUHeight >> ( (Int)uiMaxDepth - 1 );
     239
     240  Int  numPartInWidth  = (Int)uiMaxCUWidth  / (Int)minCUWidth;
     241  Int  numPartInHeight = (Int)uiMaxCUHeight / (Int)minCUHeight;
     242
     243  for ( Int i = 0; i < numPartInWidth*numPartInHeight; i++ )
     244  {
     245    g_motionRefer[i] = i;
     246  }
     247
     248  Int compressionNum = 2;
     249
     250  for ( Int i = numPartInWidth*(numPartInHeight-1); i < numPartInWidth*numPartInHeight; i += compressionNum*2)
     251  {
     252    for ( Int j = 1; j < compressionNum; j++ )
     253    {
     254      g_motionRefer[g_auiRasterToZscan[i+j]] = g_auiRasterToZscan[i];
     255    }
     256  }
     257
     258  for ( Int i = numPartInWidth*(numPartInHeight-1)+compressionNum*2-1; i < numPartInWidth*numPartInHeight; i += compressionNum*2)
     259  {
     260    for ( Int j = 1; j < compressionNum; j++ )
     261    {
     262      g_motionRefer[g_auiRasterToZscan[i-j]] = g_auiRasterToZscan[i];
     263    }
     264  }
     265}
     266
    169267Void initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth )
    170268{
     
    197295};
    198296
    199 #if MTK_SAO
    200 Int  LevelRowCol2Idx(int level, int row, int col)
    201 {
    202   Int idx;
    203   if (level == 0)
    204   {
    205     idx = 0;
    206   }
    207   else if (level == 1)
    208   {
    209     idx = 1 + row*2 + col;
    210   }
    211   else if (level == 2)
    212   {
    213     idx = 5 + row*4 + col;
    214   }
    215   else if (level == 3)
    216   {
    217     idx = 21 + row*8 + col;
    218   }
    219   else // (level == 4)
    220   {
    221     idx = 85 + row*16 + col;
    222   }
    223   return idx;
    224 }
    225 
    226 void Idx2LevelRowCol(int idx, int *level, int *row, int *col)
    227 {
    228   if (idx == 0)
    229   {
    230     *level = 0;
    231     *row = 0;
    232     *col = 0;
    233   }
    234   else if (idx>=1 && idx<=4)
    235   {
    236     *level = 1;
    237     *row = (idx-1) / 2;
    238     *col = (idx-1) % 2;
    239   }
    240   else if (idx>=5 && idx<=20)
    241   {
    242     *level = 2;
    243     *row = (idx-5) / 4;
    244     *col = (idx-5) % 4;
    245   }
    246   else if (idx>=21 && idx<=84)
    247   {
    248     *level = 3;
    249     *row = (idx-21) / 8;
    250     *col = (idx-21) % 8;
    251   }
    252   else // (idx>=85 && idx<=340)
    253   {
    254     *level = 4;
    255     *row = (idx-85) / 16;
    256     *col = (idx-85) % 16;
    257   }
    258 }
    259 #endif
    260 
    261 #if E243_CORE_TRANSFORMS
    262   UInt g_auiQ[6] = {26214,23302,20560,18396,16384,14564};   
    263   UInt g_auiIQ[6] = {40,45,51,57,64,72};
    264 
    265   const short g_aiT4[4][4] = {
    266     { 64, 64, 64, 64},
    267     { 83, 36,-36,-83},
    268     { 64,-64,-64, 64},
    269     { 36,-83, 83,-36}
    270   };
    271 
    272   const short g_aiT8[8][8] = {
    273     { 64, 64, 64, 64, 64, 64, 64, 64},
    274     { 89, 75, 50, 18,-18,-50,-75,-89},
    275     { 83, 36,-36,-83,-83,-36, 36, 83},
    276     { 75,-18,-89,-50, 50, 89, 18,-75},
    277     { 64,-64,-64, 64, 64,-64,-64, 64},
    278     { 50,-89, 18, 75,-75,-18, 89,-50},
    279     { 36,-83, 83,-36,-36, 83,-83, 36},
    280     { 18,-50, 75,-89, 89,-75, 50,-18}
    281   };
    282 
    283  const short g_aiT16[16][16] = {
    284     { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
    285     { 90, 87, 80, 70, 57, 43, 25,  9, -9,-25,-43,-57,-70,-80,-87,-90},
    286     { 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89},
    287     { 87, 57,  9,-43,-80,-90,-70,-25, 25, 70, 90, 80, 43, -9,-57,-87},
    288     { 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83},
    289     { 80,  9,-70,-87,-25, 57, 90, 43,-43,-90,-57, 25, 87, 70, -9,-80},
    290     { 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75},
    291     { 70,-43,-87,  9, 90, 25,-80,-57, 57, 80,-25,-90, -9, 87, 43,-70},
    292     { 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64},
    293     { 57,-80,-25, 90, -9,-87, 43, 70,-70,-43, 87,  9,-90, 25, 80,-57},
    294     { 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50},
    295     { 43,-90, 57, 25,-87, 70,  9,-80, 80, -9,-70, 87,-25,-57, 90,-43},
    296     { 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36},
    297     { 25,-70, 90,-80, 43,  9,-57, 87,-87, 57, -9,-43, 80,-90, 70,-25},
    298     { 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18},
    299     {  9,-25, 43,-57, 70,-80, 87,-90, 90,-87, 80,-70, 57,-43, 25, -9}
    300  };
    301 
    302   const short g_aiT32[32][32] = {
    303     { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
    304     { 90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13,  4, -4,-13,-22,-31,-38,-46,-54,-61,-67,-73,-78,-82,-85,-88,-90,-90},
    305     { 90, 87, 80, 70, 57, 43, 25,  9, -9,-25,-43,-57,-70,-80,-87,-90,-90,-87,-80,-70,-57,-43,-25, -9,  9, 25, 43, 57, 70, 80, 87, 90},
    306     { 90, 82, 67, 46, 22, -4,-31,-54,-73,-85,-90,-88,-78,-61,-38,-13, 13, 38, 61, 78, 88, 90, 85, 73, 54, 31,  4,-22,-46,-67,-82,-90},
    307     { 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89, 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89},
    308     { 88, 67, 31,-13,-54,-82,-90,-78,-46, -4, 38, 73, 90, 85, 61, 22,-22,-61,-85,-90,-73,-38,  4, 46, 78, 90, 82, 54, 13,-31,-67,-88},
    309     { 87, 57,  9,-43,-80,-90,-70,-25, 25, 70, 90, 80, 43, -9,-57,-87,-87,-57, -9, 43, 80, 90, 70, 25,-25,-70,-90,-80,-43,  9, 57, 87},
    310     { 85, 46,-13,-67,-90,-73,-22, 38, 82, 88, 54, -4,-61,-90,-78,-31, 31, 78, 90, 61,  4,-54,-88,-82,-38, 22, 73, 90, 67, 13,-46,-85},
    311     { 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83},
    312     { 82, 22,-54,-90,-61, 13, 78, 85, 31,-46,-90,-67,  4, 73, 88, 38,-38,-88,-73, -4, 67, 90, 46,-31,-85,-78,-13, 61, 90, 54,-22,-82},
    313     { 80,  9,-70,-87,-25, 57, 90, 43,-43,-90,-57, 25, 87, 70, -9,-80,-80, -9, 70, 87, 25,-57,-90,-43, 43, 90, 57,-25,-87,-70,  9, 80},
    314     { 78, -4,-82,-73, 13, 85, 67,-22,-88,-61, 31, 90, 54,-38,-90,-46, 46, 90, 38,-54,-90,-31, 61, 88, 22,-67,-85,-13, 73, 82,  4,-78},
    315     { 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75, 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75},
    316     { 73,-31,-90,-22, 78, 67,-38,-90,-13, 82, 61,-46,-88, -4, 85, 54,-54,-85,  4, 88, 46,-61,-82, 13, 90, 38,-67,-78, 22, 90, 31,-73},
    317     { 70,-43,-87,  9, 90, 25,-80,-57, 57, 80,-25,-90, -9, 87, 43,-70,-70, 43, 87, -9,-90,-25, 80, 57,-57,-80, 25, 90,  9,-87,-43, 70},
    318     { 67,-54,-78, 38, 85,-22,-90,  4, 90, 13,-88,-31, 82, 46,-73,-61, 61, 73,-46,-82, 31, 88,-13,-90, -4, 90, 22,-85,-38, 78, 54,-67},
    319     { 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64},
    320     { 61,-73,-46, 82, 31,-88,-13, 90, -4,-90, 22, 85,-38,-78, 54, 67,-67,-54, 78, 38,-85,-22, 90,  4,-90, 13, 88,-31,-82, 46, 73,-61},
    321     { 57,-80,-25, 90, -9,-87, 43, 70,-70,-43, 87,  9,-90, 25, 80,-57,-57, 80, 25,-90,  9, 87,-43,-70, 70, 43,-87, -9, 90,-25,-80, 57},
    322     { 54,-85, -4, 88,-46,-61, 82, 13,-90, 38, 67,-78,-22, 90,-31,-73, 73, 31,-90, 22, 78,-67,-38, 90,-13,-82, 61, 46,-88,  4, 85,-54},
    323     { 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50, 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50},
    324     { 46,-90, 38, 54,-90, 31, 61,-88, 22, 67,-85, 13, 73,-82,  4, 78,-78, -4, 82,-73,-13, 85,-67,-22, 88,-61,-31, 90,-54,-38, 90,-46},
    325     { 43,-90, 57, 25,-87, 70,  9,-80, 80, -9,-70, 87,-25,-57, 90,-43,-43, 90,-57,-25, 87,-70, -9, 80,-80,  9, 70,-87, 25, 57,-90, 43},
    326     { 38,-88, 73, -4,-67, 90,-46,-31, 85,-78, 13, 61,-90, 54, 22,-82, 82,-22,-54, 90,-61,-13, 78,-85, 31, 46,-90, 67,  4,-73, 88,-38},
    327     { 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36},
    328     { 31,-78, 90,-61,  4, 54,-88, 82,-38,-22, 73,-90, 67,-13,-46, 85,-85, 46, 13,-67, 90,-73, 22, 38,-82, 88,-54, -4, 61,-90, 78,-31},
    329     { 25,-70, 90,-80, 43,  9,-57, 87,-87, 57, -9,-43, 80,-90, 70,-25,-25, 70,-90, 80,-43, -9, 57,-87, 87,-57,  9, 43,-80, 90,-70, 25},
    330     { 22,-61, 85,-90, 73,-38, -4, 46,-78, 90,-82, 54,-13,-31, 67,-88, 88,-67, 31, 13,-54, 82,-90, 78,-46,  4, 38,-73, 90,-85, 61,-22},
    331     { 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18, 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18},
    332     { 13,-38, 61,-78, 88,-90, 85,-73, 54,-31,  4, 22,-46, 67,-82, 90,-90, 82,-67, 46,-22, -4, 31,-54, 73,-85, 90,-88, 78,-61, 38,-13},
    333     {  9,-25, 43,-57, 70,-80, 87,-90, 90,-87, 80,-70, 57,-43, 25, -9, -9, 25,-43, 57,-70, 80,-87, 90,-90, 87,-80, 70,-57, 43,-25,  9},
    334     {  4,-13, 22,-31, 38,-46, 54,-61, 67,-73, 78,-82, 85,-88, 90,-90, 90,-90, 88,-85, 82,-78, 73,-67, 61,-54, 46,-38, 31,-22, 13, -4}
    335   };
    336 
    337 #else //E243_CORE_TRANSFORMS
    338 // ====================================================================================================================
    339 // Quantization & DeQuantization
    340 // ====================================================================================================================
    341 
    342 UInt g_aiQuantCoef4[6] =
    343 {
    344   102, 93, 79, 73, 64, 57
    345 };
    346 
    347 Int g_aiDequantCoef4[6] =
    348 {
    349   10, 11, 13, 14, 16,18
    350 };
    351 
    352 UInt g_aiQuantCoef[6][16] =
    353 {
    354   {
    355     13107, 8066,13107, 8066,
    356     8066, 5243, 8066, 5243,
    357     13107, 8066,13107, 8066,
    358     8066, 5243, 8066, 5243
    359   },
    360   {
    361     11916, 7490,11916, 7490,
    362     7490, 4660, 7490, 4660,
    363     11916, 7490,11916, 7490,
    364     7490, 4660, 7490, 4660
    365   },
    366   {
    367     10082, 6554,10082, 6554,
    368     6554, 4194, 6554, 4194,
    369     10082, 6554,10082, 6554,
    370     6554, 4194, 6554, 4194
    371   },
    372   {
    373     9362, 5825, 9362, 5825,
    374     5825, 3647, 5825, 3647,
    375     9362, 5825, 9362, 5825,
    376     5825, 3647, 5825, 3647
    377   },
    378   {
    379     8192, 5243, 8192, 5243,
    380     5243, 3355, 5243, 3355,
    381     8192, 5243, 8192, 5243,
    382     5243, 3355, 5243, 3355
    383   },
    384   {
    385     7282, 4559, 7282, 4559,
    386     4559, 2893, 4559, 2893,
    387     7282, 4559, 7282, 4559,
    388     4559, 2893, 4559, 2893
    389   }
    390 };
    391 
    392 Int g_aiDequantCoef[6][16] =
    393 {
    394   {
    395     10, 13, 10, 13,
    396     13, 16, 13, 16,
    397     10, 13, 10, 13,
    398     13, 16, 13, 16
    399   },
    400   {
    401     11, 14, 11, 14,
    402     14, 18, 14, 18,
    403     11, 14, 11, 14,
    404     14, 18, 14, 18
    405   },
    406   {
    407     13, 16, 13, 16,
    408     16, 20, 16, 20,
    409     13, 16, 13, 16,
    410     16, 20, 16, 20
    411   },
    412   {
    413     14, 18, 14, 18,
    414     18, 23, 18, 23,
    415     14, 18, 14, 18,
    416     18, 23, 18, 23
    417   },
    418   {
    419     16, 20, 16, 20,
    420     20, 25, 20, 25,
    421     16, 20, 16, 20,
    422     20, 25, 20, 25
    423   },
    424   {
    425     18, 23, 18, 23,
    426     23, 29, 23, 29,
    427     18, 23, 18, 23,
    428     23, 29, 23, 29
    429   }
    430 };
    431 
    432 UInt g_aiQuantCoef4096[6] =
    433 {
    434   26, 23, 20, 18, 16, 14
    435 }; // 9
    436 // {51, 47, 39, 37, 32, 28}; // 10
    437 // {102, 93, 79, 73, 64, 57}; // 11
    438 
    439 UInt g_aiDeQuantCoef4096[6] =
    440 {
    441   10, 11, 13, 14, 16, 18
    442 }; // 9
    443 // {20, 22, 26, 28, 32, 36}; // 10
    444 // {40, 44, 52, 56, 64, 72}; // 11
    445 
    446 UInt g_aiQuantCoef1024[6][1024] =
    447 {
    448   {
    449     102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    450     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 104, 103, 103, 103, 103, 103,
    451     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    452     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    453     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    454     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    455     103, 103, 103, 103, 103, 103, 104, 103, 103, 103, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 103, 103, 103, 104, 103, 103, 103, 103, 103,
    456     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    457     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    458     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    459     103, 103, 103, 103, 103, 103, 104, 103, 103, 103, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 103, 103, 103, 104, 103, 103, 103, 103, 103,
    460     103, 104, 104, 104, 103, 104, 104, 103, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 103, 104, 104, 103, 104, 104, 104,
    461     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    462     103, 104, 104, 104, 103, 104, 104, 103, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 103, 104, 104, 103, 104, 104, 104,
    463     103, 103, 103, 103, 103, 103, 104, 103, 103, 103, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 103, 103, 103, 104, 103, 103, 103, 103, 103,
    464     103, 104, 104, 104, 103, 104, 104, 103, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 103, 104, 104, 103, 104, 104, 104,
    465     102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    466     103, 104, 104, 104, 103, 104, 104, 103, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 103, 104, 104, 103, 104, 104, 104,
    467     103, 103, 103, 103, 103, 103, 104, 103, 103, 103, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 103, 103, 103, 104, 103, 103, 103, 103, 103,
    468     103, 104, 104, 104, 103, 104, 104, 103, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 103, 104, 104, 103, 104, 104, 104,
    469     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    470     103, 104, 104, 104, 103, 104, 104, 103, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 103, 104, 104, 103, 104, 104, 104,
    471     103, 103, 103, 103, 103, 103, 104, 103, 103, 103, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 103, 103, 103, 104, 103, 103, 103, 103, 103,
    472     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    473     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    474     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    475     103, 104, 103, 103, 103, 103, 104, 103, 103, 103, 104, 104, 103, 104, 104, 104, 103, 104, 104, 104, 103, 104, 104, 103, 103, 103, 104, 103, 103, 103, 103, 103,
    476     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    477     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    478     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    479     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
    480     103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 104, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103
    481   },
    482   {
    483     93, 94, 94, 94, 93, 94, 94, 93, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 93, 93, 94, 94, 93, 94, 94, 94,
    484     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    485     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    486     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    487     93, 94, 94, 94, 93, 94, 94, 93, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 93, 93, 94, 94, 93, 94, 94, 94,
    488     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    489     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    490     93, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94,
    491     93, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94,
    492     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    493     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    494     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    495     93, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94,
    496     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    497     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    498     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    499     93, 94, 94, 94, 93, 94, 94, 93, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 93, 93, 94, 94, 93, 94, 94, 94,
    500     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    501     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    502     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    503     93, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94,
    504     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    505     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    506     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    507     93, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    508     93, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 93, 94, 94, 94,
    509     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    510     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    511     93, 94, 94, 94, 93, 94, 94, 93, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 93, 94, 94, 94, 94, 93, 94, 94, 93, 94, 94, 94,
    512     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    513     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
    514     94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94
    515   },
    516   {
    517     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    518     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    519     79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80,
    520     79, 80, 80, 79, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 80, 79, 79, 80, 80,
    521     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    522     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    523     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    524     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    525     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    526     79, 80, 79, 79, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 79, 79, 79, 79, 80,
    527     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    528     79, 80, 80, 80, 79, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80,
    529     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    530     79, 80, 80, 80, 79, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 79, 80, 80, 80,
    531     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    532     79, 80, 80, 80, 79, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80,
    533     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    534     79, 80, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80,
    535     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    536     79, 80, 80, 80, 79, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 79, 80, 80, 80,
    537     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    538     79, 80, 80, 80, 79, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 79, 80, 80, 80,
    539     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    540     79, 80, 79, 79, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 79, 79, 79, 79, 80,
    541     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    542     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 79, 79, 79, 80, 79, 80, 79, 79, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    543     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80,
    544     79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 80, 79, 79, 80, 80,
    545     79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
    546     79, 80, 80, 79, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 79, 79, 79, 79, 80,
    547     79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 79, 79, 79, 80, 80, 79, 79, 80, 80,
    548     79, 80, 80, 80, 79, 80, 80, 79, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 80, 80, 80, 79, 79, 80, 80, 79, 80, 80, 80
    549   },
    550   {
    551     73, 74, 74, 73, 73, 74, 74, 73, 73, 73, 74, 74, 73, 74, 74, 74, 73, 74, 74, 74, 73, 74, 74, 73, 73, 73, 74, 73, 73, 73, 73, 74,
    552     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    553     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    554     73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    555     73, 74, 74, 74, 73, 74, 74, 73, 73, 74, 74, 74, 73, 74, 74, 74, 73, 74, 74, 74, 73, 74, 74, 74, 73, 73, 74, 74, 73, 74, 74, 74,
    556     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    557     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    558     73, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74,
    559     73, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74,
    560     73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    561     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    562     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    563     73, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74,
    564     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    565     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    566     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    567     73, 74, 73, 73, 73, 74, 74, 73, 73, 73, 74, 74, 73, 74, 74, 74, 73, 74, 74, 74, 73, 74, 74, 73, 73, 73, 74, 73, 73, 73, 73, 74,
    568     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    569     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    570     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    571     73, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74,
    572     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    573     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    574     73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    575     73, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74,
    576     73, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74,
    577     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    578     73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    579     73, 74, 74, 74, 73, 74, 74, 73, 73, 74, 74, 74, 73, 74, 74, 74, 73, 74, 74, 74, 73, 74, 74, 74, 73, 73, 74, 74, 73, 74, 74, 74,
    580     73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    581     73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
    582     74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74
    583   },
    584   {
    585     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    586     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    587     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    588     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    589     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    590     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    591     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    592     64, 64, 64, 64, 64, 64, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 64, 64, 64, 64, 64,
    593     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65,
    594     64, 65, 65, 65, 64, 65, 65, 64, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 64, 65, 65, 64, 65, 65, 65,
    595     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    596     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    597     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 64, 65, 65,
    598     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    599     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    600     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    601     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    602     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    603     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    604     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    605     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65,
    606     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    607     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    608     64, 65, 65, 65, 64, 65, 65, 64, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 64, 65, 65, 64, 65, 65, 65,
    609     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65,
    610     64, 65, 64, 64, 64, 64, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 64, 64, 64, 64, 65,
    611     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    612     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    613     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    614     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    615     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    616     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65
    617   },
    618   {
    619     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    620     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 58, 57, 57, 57, 57, 57,
    621     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    622     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    623     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    624     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    625     57, 57, 57, 57, 57, 57, 58, 57, 57, 57, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 57, 57, 57, 58, 57, 57, 57, 57, 57,
    626     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    627     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    628     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    629     57, 57, 57, 57, 57, 57, 58, 57, 57, 57, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 57, 57, 57, 58, 57, 57, 57, 57, 57,
    630     57, 58, 58, 58, 57, 58, 58, 57, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 57, 58, 58, 57, 58, 58, 58,
    631     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    632     57, 58, 58, 58, 57, 58, 58, 57, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 57, 58, 58, 57, 58, 58, 58,
    633     57, 57, 57, 57, 57, 57, 58, 57, 57, 57, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 57, 57, 57, 58, 57, 57, 57, 57, 57,
    634     57, 58, 58, 58, 57, 58, 58, 57, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 57, 58, 58, 57, 58, 58, 58,
    635     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    636     57, 58, 58, 58, 57, 58, 58, 57, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 57, 58, 58, 57, 58, 58, 58,
    637     57, 57, 57, 57, 57, 57, 58, 57, 57, 57, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 57, 57, 57, 58, 57, 57, 57, 57, 57,
    638     57, 58, 58, 58, 57, 58, 58, 57, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 57, 58, 58, 57, 58, 58, 58,
    639     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    640     57, 58, 58, 58, 57, 58, 58, 57, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 57, 58, 58, 57, 58, 58, 58,
    641     57, 57, 57, 57, 57, 57, 58, 57, 57, 57, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 57, 57, 57, 58, 57, 57, 57, 57, 57,
    642     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    643     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    644     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    645     57, 58, 57, 57, 57, 57, 58, 57, 57, 57, 58, 58, 57, 58, 58, 58, 57, 58, 58, 58, 57, 58, 58, 57, 57, 57, 58, 57, 57, 57, 57, 57,
    646     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    647     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    648     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    649     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
    650     57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57
    651   }
    652 };
    653 UInt g_aiDeQuantCoef1024[6][1024] =
    654 {
    655   {
    656     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    657     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    658     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    659     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    660     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    661     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    662     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    663     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    664     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    665     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    666     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    667     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    668     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    669     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    670     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    671     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    672     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    673     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    674     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    675     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    676     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    677     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    678     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    679     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    680     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    681     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    682     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    683     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    684     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    685     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    686     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
    687     40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40
    688   },
    689   {
    690     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    691     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    692     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 44, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    693     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    694     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    695     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    696     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    697     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    698     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    699     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    700     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    701     44, 45, 44, 44, 44, 45, 45, 44, 44, 44, 45, 45, 44, 45, 45, 45, 44, 45, 45, 45, 44, 45, 45, 44, 44, 44, 45, 44, 44, 44, 44, 45,
    702     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    703     44, 45, 44, 44, 44, 45, 45, 44, 44, 44, 45, 45, 44, 45, 45, 45, 44, 45, 45, 45, 44, 45, 45, 44, 44, 44, 45, 44, 44, 44, 44, 45,
    704     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    705     44, 45, 45, 44, 44, 45, 45, 44, 44, 44, 45, 45, 44, 45, 45, 45, 44, 45, 45, 45, 44, 45, 45, 44, 44, 44, 45, 44, 44, 44, 44, 45,
    706     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    707     44, 45, 45, 44, 44, 45, 45, 44, 44, 44, 45, 45, 44, 45, 45, 45, 44, 45, 45, 45, 44, 45, 45, 44, 44, 44, 45, 45, 44, 44, 45, 45,
    708     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    709     44, 45, 44, 44, 44, 45, 45, 44, 44, 44, 45, 45, 44, 45, 45, 45, 44, 45, 45, 45, 44, 45, 45, 44, 44, 44, 45, 44, 44, 44, 44, 45,
    710     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    711     44, 45, 45, 44, 44, 45, 45, 44, 44, 44, 45, 45, 44, 45, 45, 45, 44, 45, 45, 45, 44, 45, 45, 44, 44, 44, 45, 44, 44, 44, 44, 45,
    712     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    713     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    714     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    715     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    716     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 45, 44, 44, 44, 44, 44,
    717     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    718     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    719     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    720     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
    721     44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44
    722   },
    723   {
    724     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    725     52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 53, 52, 52, 53, 53,
    726     52, 53, 52, 52, 52, 53, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 52, 52, 52, 52, 53,
    727     52, 53, 52, 52, 52, 52, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 52, 52, 52, 52, 52,
    728     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    729     52, 53, 53, 52, 52, 53, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 53, 52, 52, 53, 53,
    730     52, 53, 53, 53, 52, 53, 53, 52, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 52, 53, 53, 52, 53, 53, 53,
    731     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    732     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    733     52, 52, 52, 52, 52, 52, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 52, 52, 52, 52, 52,
    734     52, 53, 53, 53, 52, 53, 53, 52, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 52, 53, 53, 52, 53, 53, 53,
    735     52, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53,
    736     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    737     52, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53,
    738     52, 53, 53, 53, 52, 53, 53, 52, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 52, 53, 53, 52, 53, 53, 53,
    739     52, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53,
    740     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    741     52, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53,
    742     52, 53, 53, 53, 52, 53, 53, 52, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 52, 53, 53, 52, 53, 53, 53,
    743     52, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53,
    744     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    745     52, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 53, 53, 53, 53, 53, 53, 52, 53, 53, 52, 53, 53, 53,
    746     52, 53, 53, 53, 52, 53, 53, 52, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 52, 53, 53, 52, 53, 53, 53,
    747     52, 52, 52, 52, 52, 52, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 52, 52, 52, 52, 52,
    748     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 53, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    749     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    750     52, 53, 53, 53, 52, 53, 53, 52, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 52, 53, 53, 52, 53, 53, 53,
    751     52, 53, 52, 52, 52, 53, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 52, 52, 52, 52, 53,
    752     52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
    753     52, 52, 52, 52, 52, 52, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 52, 52, 52, 52, 52,
    754     52, 53, 52, 52, 52, 53, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 52, 52, 52, 52, 53,
    755     52, 53, 53, 52, 52, 53, 53, 52, 52, 52, 53, 53, 52, 53, 53, 53, 52, 53, 53, 53, 52, 53, 53, 52, 52, 52, 53, 53, 52, 52, 53, 53
    756   },
    757   {
    758     56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
    759     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    760     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    761     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    762     56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
    763     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    764     56, 57, 57, 57, 56, 57, 57, 56, 57, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 56, 57, 57, 57,
    765     56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
    766     56, 56, 56, 56, 56, 56, 57, 56, 56, 56, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 56, 56, 56, 57, 56, 56, 56, 56, 56,
    767     56, 57, 57, 57, 56, 57, 57, 56, 56, 56, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 56, 56, 56, 57, 57, 56, 56, 57, 57,
    768     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 56, 57, 57, 57,
    769     56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57,
    770     56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 56, 56, 56, 57, 56, 56, 56, 56, 56,
    771     56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57,
    772     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    773     56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57,
    774     56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
    775     56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57,
    776     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    777     56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57,
    778     56, 56, 56, 56, 56, 56, 57, 56, 56, 56, 57, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 56, 56, 56, 57, 56, 56, 56, 56, 56,
    779     56, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57,
    780     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    781     56, 57, 57, 57, 56, 57, 57, 56, 56, 56, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 56, 56, 56, 57, 57, 56, 57, 57, 57,
    782     56, 56, 56, 56, 56, 56, 57, 56, 56, 56, 57, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 56, 56, 56, 57, 56, 56, 56, 56, 56,
    783     56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 57, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
    784     56, 57, 57, 57, 56, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, 57, 56, 57, 57, 57,
    785     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    786     56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
    787     56, 57, 57, 57, 56, 57, 57, 56, 56, 56, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    788     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57,
    789     56, 57, 57, 57, 56, 57, 57, 56, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 57, 57, 57, 56, 56, 57, 57, 56, 57, 57, 57
    790   },
    791   {
    792     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    793     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    794     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    795     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    796     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    797     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    798     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    799     64, 64, 64, 64, 64, 64, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 64, 64, 64, 64, 64,
    800     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65,
    801     64, 65, 65, 65, 64, 65, 65, 64, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 64, 65, 65, 64, 65, 65, 65,
    802     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    803     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    804     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 64, 65, 65,
    805     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    806     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    807     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    808     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    809     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    810     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    811     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    812     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65,
    813     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    814     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    815     64, 65, 65, 65, 64, 65, 65, 64, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 64, 65, 65, 64, 65, 65, 65,
    816     64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65,
    817     64, 65, 64, 64, 64, 64, 65, 64, 64, 64, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 64, 64, 64, 65, 64, 64, 64, 64, 65,
    818     64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65,
    819     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    820     64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
    821     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 64, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    822     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65,
    823     64, 65, 65, 65, 64, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 65, 65, 65
    824   },
    825   {
    826     72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
    827     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    828     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    829     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    830     72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 72, 73, 72, 73, 72, 73, 72, 73, 72, 73, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
    831     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    832     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    833     72, 73, 73, 73, 72, 73, 73, 72, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 72, 73, 73, 72, 73, 73, 73,
    834     72, 73, 73, 73, 72, 73, 73, 72, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 72, 73, 73, 72, 73, 73, 73,
    835     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    836     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    837     72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
    838     72, 73, 73, 73, 72, 73, 73, 72, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 72, 73, 73, 72, 73, 73, 73,
    839     72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
    840     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    841     72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
    842     72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
    843     72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
    844     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    845     72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
    846     72, 73, 73, 73, 72, 73, 73, 72, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 72, 73, 73, 72, 73, 73, 73,
    847     72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
    848     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    849     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    850     72, 73, 73, 73, 72, 73, 73, 72, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 72, 73, 73, 72, 73, 73, 73,
    851     72, 73, 73, 73, 72, 73, 73, 72, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 73, 73, 73, 72, 72, 73, 73, 72, 73, 73, 73,
    852     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    853     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    854     72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 72, 73, 72, 73, 72, 73, 72, 73, 72, 73, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
    855     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    856     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73,
    857     72, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 72, 73, 73, 73
    858   }
    859 };
    860 
    861 UInt g_aiQuantCoef256[6][256] =
    862 {
    863   {
    864     207, 209, 209, 208, 207, 209, 208, 209, 207, 209, 208, 209, 207, 208, 209, 209,
    865     209, 212, 212, 211, 209, 211, 210, 212, 209, 212, 210, 211, 209, 211, 212, 212,
    866     209, 212, 212, 211, 209, 211, 210, 212, 209, 212, 210, 211, 209, 211, 212, 212,
    867     208, 211, 211, 210, 208, 210, 209, 211, 208, 211, 209, 210, 208, 210, 211, 211,
    868     207, 209, 209, 208, 207, 208, 208, 209, 207, 209, 208, 208, 207, 208, 209, 209,
    869     209, 211, 211, 210, 208, 210, 210, 211, 209, 211, 210, 210, 208, 210, 211, 211,
    870     208, 210, 210, 209, 208, 210, 209, 210, 208, 211, 209, 210, 208, 209, 210, 210,
    871     209, 212, 212, 211, 209, 211, 210, 212, 209, 212, 210, 211, 209, 211, 212, 212,
    872     207, 209, 209, 208, 207, 209, 208, 209, 207, 210, 208, 209, 207, 208, 209, 209,
    873     209, 212, 212, 211, 209, 211, 211, 212, 210, 212, 210, 211, 209, 211, 212, 212,
    874     208, 210, 210, 209, 208, 210, 209, 210, 208, 210, 209, 210, 208, 209, 210, 210,
    875     209, 211, 211, 210, 208, 210, 210, 211, 209, 211, 210, 210, 208, 210, 211, 211,
    876     207, 209, 209, 208, 207, 208, 208, 209, 207, 209, 208, 208, 207, 208, 209, 209,
    877     208, 211, 211, 210, 208, 210, 209, 211, 208, 211, 209, 210, 208, 210, 211, 211,
    878     209, 212, 212, 211, 209, 211, 210, 212, 209, 212, 210, 211, 209, 211, 212, 212,
    879     209, 212, 212, 211, 209, 211, 210, 212, 209, 212, 210, 211, 209, 211, 212, 212
    880   },
    881   {
    882     188, 190, 190, 189, 188, 190, 189, 190, 188, 190, 189, 190, 188, 189, 190, 190,
    883     190, 192, 192, 191, 190, 192, 191, 192, 190, 193, 191, 192, 190, 191, 192, 192,
    884     190, 192, 192, 191, 190, 192, 191, 192, 190, 192, 191, 192, 190, 191, 192, 192,
    885     189, 191, 191, 190, 189, 191, 190, 191, 189, 192, 190, 191, 189, 190, 191, 191,
    886     188, 190, 190, 189, 188, 189, 189, 190, 188, 190, 189, 189, 188, 189, 190, 190,
    887     190, 192, 192, 191, 189, 191, 191, 192, 190, 192, 191, 191, 189, 191, 192, 192,
    888     189, 191, 191, 190, 189, 191, 190, 191, 189, 191, 190, 191, 189, 190, 191, 191,
    889     190, 192, 192, 191, 190, 192, 191, 193, 190, 193, 191, 192, 190, 191, 192, 192,
    890     188, 190, 190, 189, 188, 190, 189, 190, 188, 190, 189, 190, 188, 189, 190, 190,
    891     190, 193, 192, 192, 190, 192, 191, 193, 190, 193, 191, 192, 190, 192, 192, 193,
    892     189, 191, 191, 190, 189, 191, 190, 191, 189, 191, 190, 191, 189, 190, 191, 191,
    893     190, 192, 192, 191, 189, 191, 191, 192, 190, 192, 191, 191, 189, 191, 192, 192,
    894     188, 190, 190, 189, 188, 189, 189, 190, 188, 190, 189, 189, 188, 189, 190, 190,
    895     189, 191, 191, 190, 189, 191, 190, 191, 189, 192, 190, 191, 189, 190, 191, 191,
    896     190, 192, 192, 191, 190, 192, 191, 192, 190, 192, 191, 192, 190, 191, 192, 192,
    897     190, 192, 192, 191, 190, 192, 191, 192, 190, 193, 191, 192, 190, 191, 192, 192
    898   },
    899   {
    900     159, 161, 161, 160, 159, 160, 160, 161, 159, 161, 160, 160, 159, 160, 161, 161,
    901     161, 163, 163, 162, 161, 162, 162, 163, 161, 163, 162, 162, 161, 162, 163, 163,
    902     161, 163, 163, 162, 161, 162, 162, 163, 161, 163, 162, 162, 161, 162, 163, 163,
    903     160, 162, 162, 161, 160, 161, 161, 162, 160, 162, 161, 161, 160, 161, 162, 162,
    904     159, 161, 161, 160, 159, 160, 160, 161, 159, 161, 160, 160, 159, 160, 161, 161,
    905     160, 162, 162, 161, 160, 162, 161, 162, 160, 162, 161, 162, 160, 161, 162, 162,
    906     160, 162, 162, 161, 160, 161, 161, 162, 160, 162, 161, 161, 160, 161, 162, 162,
    907     161, 163, 163, 162, 161, 162, 162, 163, 161, 163, 162, 162, 161, 162, 163, 163,
    908     159, 161, 161, 160, 159, 160, 160, 161, 159, 161, 160, 160, 159, 160, 161, 161,
    909     161, 163, 163, 162, 161, 162, 162, 163, 161, 163, 162, 162, 161, 162, 163, 163,
    910     160, 162, 162, 161, 160, 161, 161, 162, 160, 162, 161, 161, 160, 161, 162, 162,
    911     160, 162, 162, 161, 160, 162, 161, 162, 160, 162, 161, 162, 160, 161, 162, 162,
    912     159, 161, 161, 160, 159, 160, 160, 161, 159, 161, 160, 160, 159, 160, 161, 161,
    913     160, 162, 162, 161, 160, 161, 161, 162, 160, 162, 161, 161, 160, 161, 162, 162,
    914     161, 163, 163, 162, 161, 162, 162, 163, 161, 163, 162, 162, 161, 162, 163, 163,
    915     161, 163, 163, 162, 161, 162, 162, 163, 161, 163, 162, 162, 161, 162, 163, 163
    916   },
    917   {
    918     148, 150, 150, 149, 148, 149, 149, 150, 148, 150, 149, 149, 148, 149, 150, 150,
    919     150, 151, 151, 150, 149, 151, 150, 151, 150, 151, 150, 151, 149, 150, 151, 151,
    920     150, 151, 151, 150, 149, 151, 150, 151, 150, 151, 150, 151, 149, 150, 151, 151,
    921     149, 150, 150, 150, 149, 150, 150, 150, 149, 150, 150, 150, 149, 150, 150, 150,
    922     148, 149, 149, 149, 148, 149, 149, 149, 148, 149, 149, 149, 148, 149, 149, 149,
    923     149, 151, 151, 150, 149, 150, 150, 151, 149, 151, 150, 150, 149, 150, 151, 151,
    924     149, 150, 150, 150, 149, 150, 149, 150, 149, 150, 149, 150, 149, 150, 150, 150,
    925     150, 151, 151, 150, 149, 151, 150, 151, 150, 151, 150, 151, 149, 150, 151, 151,
    926     148, 150, 150, 149, 148, 149, 149, 150, 148, 150, 149, 149, 148, 149, 150, 150,
    927     150, 151, 151, 150, 149, 151, 150, 151, 150, 151, 150, 151, 149, 150, 151, 151,
    928     149, 150, 150, 150, 149, 150, 149, 150, 149, 150, 149, 150, 149, 150, 150, 150,
    929     149, 151, 151, 150, 149, 150, 150, 151, 149, 151, 150, 150, 149, 150, 151, 151,
    930     148, 149, 149, 149, 148, 149, 149, 149, 148, 149, 149, 149, 148, 149, 149, 149,
    931     149, 150, 150, 150, 149, 150, 150, 150, 149, 150, 150, 150, 149, 150, 150, 150,
    932     150, 151, 151, 150, 149, 151, 150, 151, 150, 151, 150, 151, 149, 150, 151, 151,
    933     150, 151, 151, 150, 149, 151, 150, 151, 150, 151, 150, 151, 149, 150, 151, 151
    934   },
    935   {
    936     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    937     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132,
    938     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132,
    939     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    940     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    941     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    942     130, 131, 131, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 131, 131,
    943     131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132,
    944     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    945     131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132,
    946     130, 131, 131, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 131, 131,
    947     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    948     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    949     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    950     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132,
    951     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132
    952   },
    953   {
    954     115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116,
    955     116, 118, 118, 117, 116, 117, 117, 118, 116, 118, 117, 117, 116, 117, 118, 118,
    956     116, 118, 118, 117, 116, 117, 117, 118, 116, 118, 117, 117, 116, 117, 118, 118,
    957     116, 117, 117, 116, 116, 117, 116, 117, 116, 117, 116, 117, 116, 116, 117, 117,
    958     115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116,
    959     116, 117, 117, 117, 116, 117, 116, 117, 116, 117, 116, 117, 116, 117, 117, 117,
    960     116, 117, 117, 116, 116, 116, 116, 117, 116, 117, 116, 116, 116, 116, 117, 117,
    961     116, 118, 118, 117, 116, 117, 117, 118, 116, 118, 117, 117, 116, 117, 118, 118,
    962     115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116,
    963     116, 118, 118, 117, 116, 117, 117, 118, 116, 118, 117, 117, 116, 117, 118, 118,
    964     116, 117, 117, 116, 116, 116, 116, 117, 116, 117, 116, 116, 116, 116, 117, 117,
    965     116, 117, 117, 117, 116, 117, 116, 117, 116, 117, 116, 117, 116, 117, 117, 117,
    966     115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116, 115, 116, 116, 116,
    967     116, 117, 117, 116, 116, 117, 116, 117, 116, 117, 116, 117, 116, 116, 117, 117,
    968     116, 118, 118, 117, 116, 117, 117, 118, 116, 118, 117, 117, 116, 117, 118, 118,
    969     116, 118, 118, 117, 116, 117, 117, 118, 116, 118, 117, 117, 116, 117, 118, 118
    970   }
    971  
    972 };
    973 UInt g_aiDeQuantCoef256[6][256] =
    974 {
    975   {
    976     81, 82, 82, 81, 81, 81, 81, 82, 81, 82, 81, 81, 81, 81, 82, 82,
    977     82, 83, 83, 82, 82, 82, 82, 83, 82, 83, 82, 82, 82, 82, 83, 83,
    978     82, 83, 83, 82, 82, 82, 82, 83, 82, 83, 82, 82, 82, 82, 83, 83,
    979     81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82,
    980     81, 82, 82, 81, 81, 81, 81, 82, 81, 82, 81, 81, 81, 81, 82, 82,
    981     81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82,
    982     81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82,
    983     82, 83, 83, 82, 82, 82, 82, 83, 82, 83, 82, 82, 82, 82, 83, 83,
    984     81, 82, 82, 81, 81, 81, 81, 82, 81, 82, 81, 81, 81, 81, 82, 82,
    985     82, 83, 83, 82, 82, 82, 82, 83, 82, 83, 82, 82, 82, 82, 83, 83,
    986     81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82,
    987     81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82,
    988     81, 82, 82, 81, 81, 81, 81, 82, 81, 82, 81, 81, 81, 81, 82, 82,
    989     81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82, 81, 82, 82, 82,
    990     82, 83, 83, 82, 82, 82, 82, 83, 82, 83, 82, 82, 82, 82, 83, 83,
    991     82, 83, 83, 82, 82, 82, 82, 83, 82, 83, 82, 82, 82, 82, 83, 83
    992   },
    993   {
    994     89, 90, 90, 90, 89, 90, 89, 90, 89, 90, 89, 90, 89, 90, 90, 90,
    995     90, 91, 91, 90, 90, 91, 90, 91, 90, 91, 90, 91, 90, 90, 91, 91,
    996     90, 91, 91, 90, 90, 91, 90, 91, 90, 91, 90, 91, 90, 90, 91, 91,
    997     90, 90, 90, 90, 89, 90, 90, 91, 90, 91, 90, 90, 89, 90, 90, 90,
    998     89, 90, 90, 89, 89, 90, 89, 90, 89, 90, 89, 90, 89, 89, 90, 90,
    999     90, 91, 91, 90, 90, 90, 90, 91, 90, 91, 90, 90, 90, 90, 91, 91,
    1000     89, 90, 90, 90, 89, 90, 90, 90, 89, 90, 90, 90, 89, 90, 90, 90,
    1001     90, 91, 91, 91, 90, 91, 90, 91, 90, 91, 90, 91, 90, 91, 91, 91,
    1002     89, 90, 90, 90, 89, 90, 89, 90, 89, 90, 89, 90, 89, 90, 90, 90,
    1003     90, 91, 91, 91, 90, 91, 90, 91, 90, 91, 90, 91, 90, 91, 91, 91,
    1004     89, 90, 90, 90, 89, 90, 90, 90, 89, 90, 90, 90, 89, 90, 90, 90,
    1005     90, 91, 91, 90, 90, 90, 90, 91, 90, 91, 90, 90, 90, 90, 91, 91,
    1006     89, 90, 90, 89, 89, 90, 89, 90, 89, 90, 89, 90, 89, 89, 90, 90,
    1007     90, 90, 90, 90, 89, 90, 90, 91, 90, 91, 90, 90, 89, 90, 90, 90,
    1008     90, 91, 91, 90, 90, 91, 90, 91, 90, 91, 90, 91, 90, 90, 91, 91,
    1009     90, 91, 91, 90, 90, 91, 90, 91, 90, 91, 90, 91, 90, 90, 91, 91
    1010   },
    1011   {
    1012     105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106,
    1013     106, 107, 107, 107, 106, 107, 107, 108, 106, 108, 107, 107, 106, 107, 107, 107,
    1014     106, 107, 107, 107, 106, 107, 107, 107, 106, 108, 107, 107, 106, 107, 107, 107,
    1015     106, 107, 107, 106, 106, 107, 106, 107, 106, 107, 106, 107, 106, 106, 107, 107,
    1016     105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106,
    1017     106, 107, 107, 107, 106, 107, 106, 107, 106, 107, 106, 107, 106, 107, 107, 107,
    1018     106, 107, 107, 106, 106, 106, 106, 107, 106, 107, 106, 106, 106, 106, 107, 107,
    1019     106, 108, 107, 107, 106, 107, 107, 108, 106, 108, 107, 107, 106, 107, 107, 108,
    1020     105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106,
    1021     106, 108, 108, 107, 106, 107, 107, 108, 106, 108, 107, 107, 106, 107, 108, 108,
    1022     106, 107, 107, 106, 106, 106, 106, 107, 106, 107, 106, 106, 106, 106, 107, 107,
    1023     106, 107, 107, 107, 106, 107, 106, 107, 106, 107, 106, 107, 106, 107, 107, 107,
    1024     105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106, 105, 106, 106, 106,
    1025     106, 107, 107, 106, 106, 107, 106, 107, 106, 107, 106, 107, 106, 106, 107, 107,
    1026     106, 107, 107, 107, 106, 107, 107, 107, 106, 108, 107, 107, 106, 107, 107, 107,
    1027     106, 107, 107, 107, 106, 107, 107, 108, 106, 108, 107, 107, 106, 107, 107, 107
    1028   },
    1029   {
    1030     113, 115, 114, 114, 113, 114, 114, 115, 113, 115, 114, 114, 113, 114, 114, 114,
    1031     115, 116, 116, 115, 114, 115, 115, 116, 115, 116, 115, 115, 114, 115, 116, 116,
    1032     114, 116, 116, 115, 114, 115, 115, 116, 114, 116, 115, 115, 114, 115, 116, 116,
    1033     114, 115, 115, 115, 114, 115, 114, 115, 114, 115, 114, 115, 114, 115, 115, 115,
    1034     113, 114, 114, 114, 113, 114, 114, 114, 113, 114, 114, 114, 113, 114, 114, 114,
    1035     114, 115, 115, 115, 114, 115, 115, 115, 114, 115, 115, 115, 114, 115, 115, 115,
    1036     114, 115, 115, 114, 114, 115, 114, 115, 114, 115, 114, 115, 114, 114, 115, 115,
    1037     115, 116, 116, 115, 114, 115, 115, 116, 115, 116, 115, 115, 114, 115, 116, 116,
    1038     113, 115, 114, 114, 113, 114, 114, 115, 113, 115, 114, 114, 113, 114, 114, 115,
    1039     115, 116, 116, 115, 114, 115, 115, 116, 115, 116, 115, 115, 114, 115, 116, 116,
    1040     114, 115, 115, 114, 114, 115, 114, 115, 114, 115, 114, 115, 114, 114, 115, 115,
    1041     114, 115, 115, 115, 114, 115, 115, 115, 114, 115, 115, 115, 114, 115, 115, 115,
    1042     113, 114, 114, 114, 113, 114, 114, 114, 113, 114, 114, 114, 113, 114, 114, 114,
    1043     114, 115, 115, 115, 114, 115, 114, 115, 114, 115, 114, 115, 114, 115, 115, 115,
    1044     114, 116, 116, 115, 114, 115, 115, 116, 114, 116, 115, 115, 114, 115, 116, 116,
    1045     114, 116, 116, 115, 114, 115, 115, 116, 115, 116, 115, 115, 114, 115, 116, 116
    1046   },
    1047   {
    1048     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    1049     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132,
    1050     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132,
    1051     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    1052     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    1053     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    1054     130, 131, 131, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 131, 131,
    1055     131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132,
    1056     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    1057     131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132, 131, 132, 132, 132,
    1058     130, 131, 131, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 131, 131,
    1059     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    1060     129, 131, 131, 130, 129, 130, 130, 131, 129, 131, 130, 130, 129, 130, 131, 131,
    1061     130, 132, 132, 131, 130, 131, 131, 132, 130, 132, 131, 131, 130, 131, 132, 132,
    1062     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132,
    1063     131, 132, 132, 132, 131, 132, 131, 132, 131, 132, 131, 132, 131, 132, 132, 132
    1064   },
    1065   {
    1066     146, 147, 147, 146, 146, 147, 146, 147, 146, 147, 146, 147, 145, 146, 147, 147,
    1067     147, 149, 149, 148, 147, 148, 148, 149, 147, 149, 148, 148, 147, 148, 149, 149,
    1068     147, 149, 149, 148, 147, 148, 148, 149, 147, 149, 148, 148, 147, 148, 149, 149,
    1069     146, 148, 148, 147, 146, 147, 147, 148, 146, 148, 147, 147, 146, 147, 148, 148,
    1070     146, 147, 147, 146, 145, 147, 146, 147, 146, 147, 146, 147, 145, 146, 147, 147,
    1071     147, 148, 148, 147, 147, 148, 147, 148, 147, 148, 147, 148, 147, 147, 148, 148,
    1072     146, 148, 148, 147, 146, 147, 147, 148, 146, 148, 147, 147, 146, 147, 148, 148,
    1073     147, 149, 149, 148, 147, 148, 148, 149, 147, 149, 148, 148, 147, 148, 149, 149,
    1074     146, 147, 147, 146, 146, 147, 146, 147, 146, 147, 146, 147, 146, 146, 147, 147,
    1075     147, 149, 149, 148, 147, 148, 148, 149, 147, 149, 148, 148, 147, 148, 149, 149,
    1076     146, 148, 148, 147, 146, 147, 147, 148, 146, 148, 147, 147, 146, 147, 148, 148,
    1077     147, 148, 148, 147, 147, 148, 147, 148, 147, 148, 147, 148, 147, 147, 148, 148,
    1078     145, 147, 147, 146, 145, 147, 146, 147, 146, 147, 146, 147, 145, 146, 147, 147,
    1079     146, 148, 148, 147, 146, 147, 147, 148, 146, 148, 147, 147, 146, 147, 148, 148,
    1080     147, 149, 149, 148, 147, 148, 148, 149, 147, 149, 148, 148, 147, 148, 149, 149,
    1081     147, 149, 149, 148, 147, 148, 148, 149, 147, 149, 148, 148, 147, 148, 149, 149
    1082   }
    1083 };
    1084 
    1085 
    1086 Int g_aiDequantCoef64[6][64] =
    1087 {
    1088   {
    1089     20,  19, 25, 19, 20, 19, 25, 19,
    1090     19,  18, 24, 18, 19, 18, 24, 18,
    1091     25,  24, 32, 24, 25, 24, 32, 24,
    1092     19,  18, 24, 18, 19, 18, 24, 18,
    1093     20,  19, 25, 19, 20, 19, 25, 19,
    1094     19,  18, 24, 18, 19, 18, 24, 18,
    1095     25,  24, 32, 24, 25, 24, 32, 24,
    1096     19,  18, 24, 18, 19, 18, 24, 18
    1097   },
    1098   {
    1099     22,  21, 28, 21, 22, 21, 28, 21,
    1100     21,  19, 26, 19, 21, 19, 26, 19,
    1101     28,  26, 35, 26, 28, 26, 35, 26,
    1102     21,  19, 26, 19, 21, 19, 26, 19,
    1103     22,  21, 28, 21, 22, 21, 28, 21,
    1104     21,  19, 26, 19, 21, 19, 26, 19,
    1105     28,  26, 35, 26, 28, 26, 35, 26,
    1106     21,  19, 26, 19, 21, 19, 26, 19
    1107   },
    1108   {
    1109     26,  24, 33, 24, 26, 24, 33, 24,
    1110     24,  23, 31, 23, 24, 23, 31, 23,
    1111     33,  31, 42, 31, 33, 31, 42, 31,
    1112     24,  23, 31, 23, 24, 23, 31, 23,
    1113     26,  24, 33, 24, 26, 24, 33, 24,
    1114     24,  23, 31, 23, 24, 23, 31, 23,
    1115     33,  31, 42, 31, 33, 31, 42, 31,
    1116     24,  23, 31, 23, 24, 23, 31, 23
    1117   },
    1118   {
    1119     28,  26, 35, 26, 28, 26, 35, 26,
    1120     26,  25, 33, 25, 26, 25, 33, 25,
    1121     35,  33, 45, 33, 35, 33, 45, 33,
    1122     26,  25, 33, 25, 26, 25, 33, 25,
    1123     28,  26, 35, 26, 28, 26, 35, 26,
    1124     26,  25, 33, 25, 26, 25, 33, 25,
    1125     35,  33, 45, 33, 35, 33, 45, 33,
    1126     26,  25, 33, 25, 26, 25, 33, 25
    1127   },
    1128   {
    1129     32,  30, 40, 30, 32, 30, 40, 30,
    1130     30,  28, 38, 28, 30, 28, 38, 28,
    1131     40,  38, 51, 38, 40, 38, 51, 38,
    1132     30,  28, 38, 28, 30, 28, 38, 28,
    1133     32,  30, 40, 30, 32, 30, 40, 30,
    1134     30,  28, 38, 28, 30, 28, 38, 28,
    1135     40,  38, 51, 38, 40, 38, 51, 38,
    1136     30,  28, 38, 28, 30, 28, 38, 28
    1137   },
    1138   {
    1139     36,  34, 46, 34, 36, 34, 46, 34,
    1140     34,  32, 43, 32, 34, 32, 43, 32,
    1141     46,  43, 58, 43, 46, 43, 58, 43,
    1142     34,  32, 43, 32, 34, 32, 43, 32,
    1143     36,  34, 46, 34, 36, 34, 46, 34,
    1144     34,  32, 43, 32, 34, 32, 43, 32,
    1145     46,  43, 58, 43, 46, 43, 58, 43,
    1146     34,  32, 43, 32, 34, 32, 43, 32
    1147   }
    1148  
    1149 };
    1150 
    1151 UInt g_aiQuantCoef64[6][64] =
    1152 {
    1153   {
    1154     0x3333, 0x2fbe, 0x4189, 0x2fbe, 0x3333, 0x2fbe, 0x4189, 0x2fbe,
    1155     0x2fbe, 0x2ca4, 0x3c79, 0x2ca4, 0x2fbe, 0x2ca4, 0x3c79, 0x2ca4,
    1156     0x4189, 0x3c79, 0x51ec, 0x3c79, 0x4189, 0x3c79, 0x51ec, 0x3c79,
    1157     0x2fbe, 0x2ca4, 0x3c79, 0x2ca4, 0x2fbe, 0x2ca4, 0x3c79, 0x2ca4,
    1158     0x3333, 0x2fbe, 0x4189, 0x2fbe, 0x3333, 0x2fbe, 0x4189, 0x2fbe,
    1159     0x2fbe, 0x2ca4, 0x3c79, 0x2ca4, 0x2fbe, 0x2ca4, 0x3c79, 0x2ca4,
    1160     0x4189, 0x3c79, 0x51ec, 0x3c79, 0x4189, 0x3c79, 0x51ec, 0x3c79,
    1161     0x2fbe, 0x2ca4, 0x3c79, 0x2ca4, 0x2fbe, 0x2ca4, 0x3c79, 0x2ca4,
    1162   },
    1163   {
    1164     0x2e8c, 0x2b32, 0x3a84, 0x2b32, 0x2e8c, 0x2b32, 0x3a84, 0x2b32,
    1165     0x2b32, 0x2a4a, 0x37d2, 0x2a4a, 0x2b32, 0x2a4a, 0x37d2, 0x2a4a,
    1166     0x3a84, 0x37d2, 0x4ae6, 0x37d2, 0x3a84, 0x37d2, 0x4ae6, 0x37d2,
    1167     0x2b32, 0x2a4a, 0x37d2, 0x2a4a, 0x2b32, 0x2a4a, 0x37d2, 0x2a4a,
    1168     0x2e8c, 0x2b32, 0x3a84, 0x2b32, 0x2e8c, 0x2b32, 0x3a84, 0x2b32,
    1169     0x2b32, 0x2a4a, 0x37d2, 0x2a4a, 0x2b32, 0x2a4a, 0x37d2, 0x2a4a,
    1170     0x3a84, 0x37d2, 0x4ae6, 0x37d2, 0x3a84, 0x37d2, 0x4ae6, 0x37d2,
    1171     0x2b32, 0x2a4a, 0x37d2, 0x2a4a, 0x2b32, 0x2a4a, 0x37d2, 0x2a4a,
    1172   },
    1173   {
    1174     0x2762, 0x25cb, 0x31a6, 0x25cb, 0x2762, 0x25cb, 0x31a6, 0x25cb,
    1175     0x25cb, 0x22ef, 0x2ed1, 0x22ef, 0x25cb, 0x22ef, 0x2ed1, 0x22ef,
    1176     0x31a6, 0x2ed1, 0x3e6a, 0x2ed1, 0x31a6, 0x2ed1, 0x3e6a, 0x2ed1,
    1177     0x25cb, 0x22ef, 0x2ed1, 0x22ef, 0x25cb, 0x22ef, 0x2ed1, 0x22ef,
    1178     0x2762, 0x25cb, 0x31a6, 0x25cb, 0x2762, 0x25cb, 0x31a6, 0x25cb,
    1179     0x25cb, 0x22ef, 0x2ed1, 0x22ef, 0x25cb, 0x22ef, 0x2ed1, 0x22ef,
    1180     0x31a6, 0x2ed1, 0x3e6a, 0x2ed1, 0x31a6, 0x2ed1, 0x3e6a, 0x2ed1,
    1181     0x25cb, 0x22ef, 0x2ed1, 0x22ef, 0x25cb, 0x22ef, 0x2ed1, 0x22ef,
    1182   },
    1183   {
    1184     0x2492, 0x22e3, 0x2ed0, 0x22e3, 0x2492, 0x22e3, 0x2ed0, 0x22e3,
    1185     0x22e3, 0x2024, 0x2bfb, 0x2024, 0x22e3, 0x2024, 0x2bfb, 0x2024,
    1186     0x2ed0, 0x2bfb, 0x3a41, 0x2bfb, 0x2ed0, 0x2bfb, 0x3a41, 0x2bfb,
    1187     0x22e3, 0x2024, 0x2bfb, 0x2024, 0x22e3, 0x2024, 0x2bfb, 0x2024,
    1188     0x2492, 0x22e3, 0x2ed0, 0x22e3, 0x2492, 0x22e3, 0x2ed0, 0x22e3,
    1189     0x22e3, 0x2024, 0x2bfb, 0x2024, 0x22e3, 0x2024, 0x2bfb, 0x2024,
    1190     0x2ed0, 0x2bfb, 0x3a41, 0x2bfb, 0x2ed0, 0x2bfb, 0x3a41, 0x2bfb,
    1191     0x22e3, 0x2024, 0x2bfb, 0x2024, 0x22e3, 0x2024, 0x2bfb, 0x2024,
    1192   },
    1193   {
    1194     0x2000, 0x1e3c, 0x28f6, 0x1e3c, 0x2000, 0x1e3c, 0x28f6, 0x1e3c,
    1195     0x1e3c, 0x1cb2, 0x2631, 0x1cb2, 0x1e3c, 0x1cb2, 0x2631, 0x1cb2,
    1196     0x28f6, 0x2631, 0x3367, 0x2631, 0x28f6, 0x2631, 0x3367, 0x2631,
    1197     0x1e3c, 0x1cb2, 0x2631, 0x1cb2, 0x1e3c, 0x1cb2, 0x2631, 0x1cb2,
    1198     0x2000, 0x1e3c, 0x28f6, 0x1e3c, 0x2000, 0x1e3c, 0x28f6, 0x1e3c,
    1199     0x1e3c, 0x1cb2, 0x2631, 0x1cb2, 0x1e3c, 0x1cb2, 0x2631, 0x1cb2,
    1200     0x28f6, 0x2631, 0x3367, 0x2631, 0x28f6, 0x2631, 0x3367, 0x2631,
    1201     0x1e3c, 0x1cb2, 0x2631, 0x1cb2, 0x1e3c, 0x1cb2, 0x2631, 0x1cb2,
    1202   },
    1203   {
    1204     0x1c72, 0x1aae, 0x239e, 0x1aae, 0x1c72, 0x1aae, 0x239e, 0x1aae,
    1205     0x1aae, 0x191c, 0x21c0, 0x191c, 0x1aae, 0x191c, 0x21c0, 0x191c,
    1206     0x239e, 0x21c0, 0x2d32, 0x21c0, 0x239e, 0x21c0, 0x2d32, 0x21c0,
    1207     0x1aae, 0x191c, 0x21c0, 0x191c, 0x1aae, 0x191c, 0x21c0, 0x191c,
    1208     0x1c72, 0x1aae, 0x239e, 0x1aae, 0x1c72, 0x1aae, 0x239e, 0x1aae,
    1209     0x1aae, 0x191c, 0x21c0, 0x191c, 0x1aae, 0x191c, 0x21c0, 0x191c,
    1210     0x239e, 0x21c0, 0x2d32, 0x21c0, 0x239e, 0x21c0, 0x2d32, 0x21c0,
    1211     0x1aae, 0x191c, 0x21c0, 0x191c, 0x1aae, 0x191c, 0x21c0, 0x191c,
    1212   }
    1213 };
    1214 #endif //E243_CORE_TRANSFORMS
     297
     298Int g_quantScales[6] =
     299{
     300  26214,23302,20560,18396,16384,14564
     301};   
     302
     303Int g_invQuantScales[6] =
     304{
     305  40,45,51,57,64,72
     306};
     307
     308const short g_aiT4[4][4] =
     309{
     310  { 64, 64, 64, 64},
     311  { 83, 36,-36,-83},
     312  { 64,-64,-64, 64},
     313  { 36,-83, 83,-36}
     314};
     315
     316const short g_aiT8[8][8] =
     317{
     318  { 64, 64, 64, 64, 64, 64, 64, 64},
     319  { 89, 75, 50, 18,-18,-50,-75,-89},
     320  { 83, 36,-36,-83,-83,-36, 36, 83},
     321  { 75,-18,-89,-50, 50, 89, 18,-75},
     322  { 64,-64,-64, 64, 64,-64,-64, 64},
     323  { 50,-89, 18, 75,-75,-18, 89,-50},
     324  { 36,-83, 83,-36,-36, 83,-83, 36},
     325  { 18,-50, 75,-89, 89,-75, 50,-18}
     326};
     327
     328const short g_aiT16[16][16] =
     329{
     330  { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
     331  { 90, 87, 80, 70, 57, 43, 25,  9, -9,-25,-43,-57,-70,-80,-87,-90},
     332  { 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89},
     333  { 87, 57,  9,-43,-80,-90,-70,-25, 25, 70, 90, 80, 43, -9,-57,-87},
     334  { 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83},
     335  { 80,  9,-70,-87,-25, 57, 90, 43,-43,-90,-57, 25, 87, 70, -9,-80},
     336  { 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75},
     337  { 70,-43,-87,  9, 90, 25,-80,-57, 57, 80,-25,-90, -9, 87, 43,-70},
     338  { 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64},
     339  { 57,-80,-25, 90, -9,-87, 43, 70,-70,-43, 87,  9,-90, 25, 80,-57},
     340  { 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50},
     341  { 43,-90, 57, 25,-87, 70,  9,-80, 80, -9,-70, 87,-25,-57, 90,-43},
     342  { 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36},
     343  { 25,-70, 90,-80, 43,  9,-57, 87,-87, 57, -9,-43, 80,-90, 70,-25},
     344  { 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18},
     345  {  9,-25, 43,-57, 70,-80, 87,-90, 90,-87, 80,-70, 57,-43, 25, -9}
     346};
     347
     348const short g_aiT32[32][32] =
     349{
     350  { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
     351  { 90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13,  4, -4,-13,-22,-31,-38,-46,-54,-61,-67,-73,-78,-82,-85,-88,-90,-90},
     352  { 90, 87, 80, 70, 57, 43, 25,  9, -9,-25,-43,-57,-70,-80,-87,-90,-90,-87,-80,-70,-57,-43,-25, -9,  9, 25, 43, 57, 70, 80, 87, 90},
     353  { 90, 82, 67, 46, 22, -4,-31,-54,-73,-85,-90,-88,-78,-61,-38,-13, 13, 38, 61, 78, 88, 90, 85, 73, 54, 31,  4,-22,-46,-67,-82,-90},
     354  { 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89, 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89},
     355  { 88, 67, 31,-13,-54,-82,-90,-78,-46, -4, 38, 73, 90, 85, 61, 22,-22,-61,-85,-90,-73,-38,  4, 46, 78, 90, 82, 54, 13,-31,-67,-88},
     356  { 87, 57,  9,-43,-80,-90,-70,-25, 25, 70, 90, 80, 43, -9,-57,-87,-87,-57, -9, 43, 80, 90, 70, 25,-25,-70,-90,-80,-43,  9, 57, 87},
     357  { 85, 46,-13,-67,-90,-73,-22, 38, 82, 88, 54, -4,-61,-90,-78,-31, 31, 78, 90, 61,  4,-54,-88,-82,-38, 22, 73, 90, 67, 13,-46,-85},
     358  { 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83},
     359  { 82, 22,-54,-90,-61, 13, 78, 85, 31,-46,-90,-67,  4, 73, 88, 38,-38,-88,-73, -4, 67, 90, 46,-31,-85,-78,-13, 61, 90, 54,-22,-82},
     360  { 80,  9,-70,-87,-25, 57, 90, 43,-43,-90,-57, 25, 87, 70, -9,-80,-80, -9, 70, 87, 25,-57,-90,-43, 43, 90, 57,-25,-87,-70,  9, 80},
     361  { 78, -4,-82,-73, 13, 85, 67,-22,-88,-61, 31, 90, 54,-38,-90,-46, 46, 90, 38,-54,-90,-31, 61, 88, 22,-67,-85,-13, 73, 82,  4,-78},
     362  { 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75, 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75},
     363  { 73,-31,-90,-22, 78, 67,-38,-90,-13, 82, 61,-46,-88, -4, 85, 54,-54,-85,  4, 88, 46,-61,-82, 13, 90, 38,-67,-78, 22, 90, 31,-73},
     364  { 70,-43,-87,  9, 90, 25,-80,-57, 57, 80,-25,-90, -9, 87, 43,-70,-70, 43, 87, -9,-90,-25, 80, 57,-57,-80, 25, 90,  9,-87,-43, 70},
     365  { 67,-54,-78, 38, 85,-22,-90,  4, 90, 13,-88,-31, 82, 46,-73,-61, 61, 73,-46,-82, 31, 88,-13,-90, -4, 90, 22,-85,-38, 78, 54,-67},
     366  { 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64},
     367  { 61,-73,-46, 82, 31,-88,-13, 90, -4,-90, 22, 85,-38,-78, 54, 67,-67,-54, 78, 38,-85,-22, 90,  4,-90, 13, 88,-31,-82, 46, 73,-61},
     368  { 57,-80,-25, 90, -9,-87, 43, 70,-70,-43, 87,  9,-90, 25, 80,-57,-57, 80, 25,-90,  9, 87,-43,-70, 70, 43,-87, -9, 90,-25,-80, 57},
     369  { 54,-85, -4, 88,-46,-61, 82, 13,-90, 38, 67,-78,-22, 90,-31,-73, 73, 31,-90, 22, 78,-67,-38, 90,-13,-82, 61, 46,-88,  4, 85,-54},
     370  { 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50, 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50},
     371  { 46,-90, 38, 54,-90, 31, 61,-88, 22, 67,-85, 13, 73,-82,  4, 78,-78, -4, 82,-73,-13, 85,-67,-22, 88,-61,-31, 90,-54,-38, 90,-46},
     372  { 43,-90, 57, 25,-87, 70,  9,-80, 80, -9,-70, 87,-25,-57, 90,-43,-43, 90,-57,-25, 87,-70, -9, 80,-80,  9, 70,-87, 25, 57,-90, 43},
     373  { 38,-88, 73, -4,-67, 90,-46,-31, 85,-78, 13, 61,-90, 54, 22,-82, 82,-22,-54, 90,-61,-13, 78,-85, 31, 46,-90, 67,  4,-73, 88,-38},
     374  { 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36},
     375  { 31,-78, 90,-61,  4, 54,-88, 82,-38,-22, 73,-90, 67,-13,-46, 85,-85, 46, 13,-67, 90,-73, 22, 38,-82, 88,-54, -4, 61,-90, 78,-31},
     376  { 25,-70, 90,-80, 43,  9,-57, 87,-87, 57, -9,-43, 80,-90, 70,-25,-25, 70,-90, 80,-43, -9, 57,-87, 87,-57,  9, 43,-80, 90,-70, 25},
     377  { 22,-61, 85,-90, 73,-38, -4, 46,-78, 90,-82, 54,-13,-31, 67,-88, 88,-67, 31, 13,-54, 82,-90, 78,-46,  4, 38,-73, 90,-85, 61,-22},
     378  { 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18, 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18},
     379  { 13,-38, 61,-78, 88,-90, 85,-73, 54,-31,  4, 22,-46, 67,-82, 90,-90, 82,-67, 46,-22, -4, 31,-54, 73,-85, 90,-88, 78,-61, 38,-13},
     380  {  9,-25, 43,-57, 70,-80, 87,-90, 90,-87, 80,-70, 57,-43, 25, -9, -9, 25,-43, 57,-70, 80,-87, 90,-90, 87,-80, 70,-57, 43,-25,  9},
     381  {  4,-13, 22,-31, 38,-46, 54,-61, 67,-73, 78,-82, 85,-88, 90,-90, 90,-90, 88,-85, 82,-78, 73,-67, 61,-54, 46,-38, 31,-22, 13, -4}
     382};
     383
    1215384const UChar g_aucChromaScale[52]=
    1216385{
     
    1220389  37,38,38,38,39,39,39,39
    1221390};
    1222 // ====================================================================================================================
    1223 // TENTM VLC table
    1224 // ====================================================================================================================
    1225 
    1226 #if RUNLEVEL_TABLE_CUT || CAVLC_RQT_CBP
    1227 #define M1 MAX_UINT
    1228 #else
    1229 #define M1 (UInt)-1
    1230 #endif
    1231 
    1232 // Below table need to be optimized
    1233 const UInt g_auiCbpVlcNum[2][8] =
    1234 {
    1235   {0, 0, 0, 0, 0, 0, 0, 0},
    1236   {0, 0, 0, 0, 0, 0, 0, 0}
    1237 };
    1238 
    1239 #if CAVLC_RQT_CBP
    1240 const UInt g_auiCBP_YUV_TableE[4][8] =
    1241 {
    1242   {2,5,6,7,0,3,4,1},
    1243   {0,4,6,7,1,2,3,5},
    1244   {2,5,6,7,0,3,4,1},
    1245   {0,4,6,7,1,2,3,5}
    1246 };
    1247 const UInt g_auiCBP_YUV_TableD[4][8] =
    1248 {
    1249   {4,7,0,5,6,1,2,3},
    1250   {0,4,5,6,1,7,2,3},
    1251   {4,7,0,5,6,1,2,3},
    1252   {0,4,5,6,1,7,2,3}
    1253 };
    1254 const UInt g_auiCBP_YS_TableE[2][4] =
    1255 {
    1256   {3,  2, 0, 1},
    1257   {2, M1, 0, 1}
    1258 };
    1259 
    1260 const UInt g_auiCBP_YS_TableD[2][4] =
    1261 {
    1262   {  2,  3,  1,  0},
    1263   {  2,  3,  0, M1}
    1264 };
    1265 
    1266 const UInt g_auiCBP_YC_TableE[2][4] =
    1267 {
    1268   {  2,  1,  3,  0},
    1269   {  0,  2,  1,  3}
    1270 };
    1271 
    1272 const UInt g_auiCBP_YC_TableD[2][4] =
    1273 {
    1274   {3,1,0,2},
    1275   {0,2,1,3}
    1276 };
    1277 
    1278 const UInt g_auiCBP_YCS_Table[2][8] =
    1279 {
    1280   {  0,  3,  9, 11,  8, 20, 42, 43},
    1281   {  1,  1,  1,  1,  1,  1,  0, M1}
    1282 };
    1283 
    1284 const UInt g_auiCBP_YCS_TableLen[2][8] =
    1285 {
    1286   {  1,  2,  4,  4,  4,  5,  6,  6},
    1287   {  1,  2,  3,  4,  5,  6,  6,  0}
    1288 };
    1289 
    1290 const UInt g_auiCBP_YCS_TableE[2][8] =
    1291 {
    1292   {4,  5,  6,  7,  1,  2,  0,  3},
    1293   {0,  7,  5,  6,  2,  1,  4,  3}
    1294 };
    1295 
    1296 const UInt g_auiCBP_YCS_TableD[2][8] =
    1297 {
    1298   {6,  4,  5,  7,  0,  1,  2,  3},
    1299   {0,  5,  4,  7,  6,  2,  3, 1}
    1300 };
    1301 
    1302 const UInt g_auiCBP_4Y_TableE[2][15] =
    1303 {
    1304   {14, 13, 10, 12,  9,  8,  4, 11,  7,  6,  3,  5,  2,  1,  0},
    1305   { 0,  1,  4,  2,  5,  6, 10,  3,  7,  8, 11,  9, 12, 13, 14}
    1306 };
    1307 
    1308 const UInt g_auiCBP_4Y_TableD[2][15] =
    1309 {
    1310   {14, 13, 12, 10, 6, 11, 9, 8, 5, 4, 2, 7, 3, 1, 0},
    1311   {0, 1, 3, 7, 2, 4, 5, 8, 9, 11, 6, 10 ,12, 13, 14}
    1312 };
    1313 
    1314 const UInt g_auiCBP_4Y_VlcNum[15] =
    1315 {
    1316   1,  2,  2,  2, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
    1317 };
    1318 #else
    1319 const UInt g_auiCBPTableE[2][8] =
    1320 {
    1321   {2,0,6,4,5,3,7,1},
    1322   {0,1,6,3,4,2,7,5}
    1323 };
    1324 
    1325 const UInt g_auiCBPTableD[2][8] =
    1326 {
    1327   {1,7,0,5,3,4,2,6},
    1328   {0,1,5,3,4,7,2,6}
    1329 };
    1330 
    1331 const UInt g_auiBlkCBPTableE[2][15] =
    1332 {
    1333   {14, 13, 10, 12, 9, 8, 4, 11, 7, 6, 3, 5, 2, 1, 0},
    1334   {0, 1, 4, 2, 5, 6, 10, 3, 7, 8, 11, 9, 12, 13, 14}
    1335 };
    1336 
    1337 const UInt g_auiBlkCBPTableD[2][15] =
    1338 {
    1339   {14, 13, 12, 10, 6, 11, 9, 8, 5, 4, 2, 7, 3, 1, 0},
    1340   {0, 1, 3, 7, 2, 4, 5, 8, 9, 11, 6, 10 ,12, 13, 14}
    1341 };
    1342 
    1343 const UInt g_auiBlkCbpVlcNum[15] =
    1344 {
    1345   1,  2,  2,  2, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
    1346 };
    1347 #endif
    1348 
    1349 #if UNIFY_INTER_TABLE
    1350 const UInt g_auiComMI1TableE[9] = {0,1,2,3,4,5,6,7,8};
    1351 const UInt g_auiComMI1TableD[9] = {0,1,2,3,4,5,6,7,8};
    1352 #else
    1353 const UInt g_auiMI1TableE[8] = {0,2,1,4,3,6,5,7};
    1354 const UInt g_auiMI1TableD[8] = {0,2,1,4,3,6,5,7};
    1355 const UInt g_auiMI2TableE[15] = {0,1,3,2,6,5,4,7,9,8,13,12,11,14,10};
    1356 const UInt g_auiMI2TableD[15] = {0,1,3,2,6,5,4,7,9,8,14,12,11,10,13};
    1357 
    1358 const UInt g_auiMI1TableENoL1[8] = {0,1,6,7,2,4,3,5};
    1359 const UInt g_auiMI1TableDNoL1[8] = {0,1,4,6,5,7,2,3};
    1360 const UInt g_auiMI2TableENoL1[15] = {0,1,2,12,14,13,3,4,6,5,10,9,8,11,7};
    1361 const UInt g_auiMI2TableDNoL1[15] = {0,1,2,6,7,9,8,14,12,11,10,13,3,5,4};
    1362 
    1363 #if MS_LCEC_ONE_FRAME
    1364 // as there are two lists used for bi-directional prediction, and one list for uni-directional prediction
    1365 // for uni-directional prediction, when pcSlice->getNoBackPredFlag() is true, list 0 is used for uni-directional prediction
    1366 // when pcSlice->getNoBackPredFlag() is false, combined list is used for uni-directional prediction
    1367 // the meaning of the elements are as follows:
    1368 /*
    1369  0: uni-directional prediction, frame 0
    1370  1: uni-directional prediction, frame 1
    1371  2: uni-directional prediction, frame 2
    1372  3: uni-directional prediction, frame 3
    1373  4: bi-directional prediction, frame (0, 0)
    1374  5: bi-directional prediction, frame (0, 1)
    1375  6: bi-directional prediction, frame (1, 0)
    1376  7: bi-directional prediction, frame (1, 1)
    1377  8: exception, for uni-directional prediction, if combined list, reference frame index >= 4 (count from 0) is exception
    1378  if GPB (only list0 is used), reference frame index >= 2 (count from 0) is exception
    1379  for bi-directional prediction, reference frame index >= 2 (count from 0 ) is exception
    1380  */
    1381 const UInt g_auiMI1TableEOnly1Ref[8] = {0,3,1,4,2,6,5,7};
    1382 const UInt g_auiMI1TableDOnly1Ref[8] = {0,2,4,1,3,6,5,7};
    1383 const UInt g_auiMI1TableEOnly1RefNoL1[8] = {0,2,3,4,1,6,5,7};
    1384 const UInt g_auiMI1TableDOnly1RefNoL1[8] = {0,4,1,2,3,6,5,7};
    1385 #endif
    1386 #endif
    1387 
    1388 #if QC_LCEC_INTER_MODE
    1389 const UInt g_auiInterModeTableE[4][7] = {{0,1,2,3,4,5,6},{0,1,2,3,4,5,6},{0,1,2,3,4,5,6},{6,0,1,2,3,4,5}};
    1390 const UInt g_auiInterModeTableD[4][7] = {{0,1,2,3,4,5,6},{0,1,2,3,4,5,6},{0,1,2,3,4,5,6},{1,2,3,4,5,6,0}};
    1391 #endif
    1392 
    1393 
    1394 
    1395 // Below table need to be optimized
    1396 const UInt g_auiMITableVlcNum[15] =
    1397 {
    1398   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    1399 };
    1400 
    1401 
    1402 const UInt g_auiLPTableE4[3][32] =
    1403 {
    1404   {0,1,2,3,5,4,7,6,9,11,14,8,16,15,10,13,12,17,18,19,25,23,20,22,28,26,29,24,30,31,27,21},  //4x4I
    1405   {0,1,2,7,5,3,6,4,11,8,12,10,9,14,13,15,16,17,21,27,26,18,19,23,29,20,25,28,22,30,24,31},  //4x4P
    1406   {0,1,2,7,5,3,6,4,11,8,12,10,9,14,13,15,16,17,21,27,26,18,19,23,29,20,25,28,22,30,24,31}   //4x4B
    1407 };
    1408 
    1409 const UInt g_auiLPTableD4[3][32] =
    1410 {
    1411   {0,1,2,3,5,4,7,6,11,8,14,9,16,15,10,13,12,17,18,19,22,31,23,21,27,20,25,30,24,26,28,29},  //4x4I
    1412   {0,1,2,5,7,4,6,3,9,12,11,8,10,14,13,15,16,17,21,22,25,18,28,23,30,26,20,19,27,24,29,31},  //4x4P
    1413   {0,1,2,5,7,4,6,3,9,12,11,8,10,14,13,15,16,17,21,22,25,18,28,23,30,26,20,19,27,24,29,31}   //4x4B
    1414 };
    1415 
    1416 #if !CAVLC_COEF_LRG_BLK
    1417 const UInt g_auiLPTableE8[8][128] =
    1418 {
    1419   {0,2,1,4,7,3,6,11,13,9,18,22,19,17,8,10,20,24,28,27,21,26,38,42,37,31,23,12,16,33,30,44,45,49,46,36,57,50,55,47,39,43,35,75,66,56,60,58,54,70,63,29,77,87,69,48,51,64,71,65,80,85,76,94,5,15,14,34,52,25,41,72,74,53,59,81,82,68,40,62,95,127,89,84,67,73,126,79,125,93,90,61,32,124,123,83,86,122,88,78,121,92,91,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96}, //U
    1420   {0,2,1,4,7,3,6,11,13,9,18,22,19,17,8,10,20,24,28,27,21,26,38,42,37,31,23,12,16,33,30,44,45,49,46,36,57,50,55,47,39,43,35,75,66,56,60,58,54,70,63,29,77,87,69,48,51,64,71,65,80,85,76,94,5,15,14,34,52,25,41,72,74,53,59,81,82,68,40,62,95,127,89,84,67,73,126,79,125,93,90,61,32,124,123,83,86,122,88,78,121,92,91,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96}, //V
    1421  
    1422   {0,1,2,6,7,3,5,12,11,10,8,17,20,22,9,13,32,21,14,25,16,29,62,59,42,28,15,18,19,26,35,36,30,48,56,39,91,72,63,37,38,44,23,27,41,47,40,58,77,83,52,65,57,33,53,60,54,69,89,45,34,51,46,49,4,31,24,71,88,70,92,103,119,93,55,95,122,127,106,123,125,76,66,126,108,112,117,107,124,111,68,97,85,114,113,121,116,115,79,82,105,120,110,118,109,102,100,84,101,90,104,94,96,78,86,99,81,75,87,98,80,73,74,67,64,61,43,50}, //8x8I
    1423   {0,1,2,7,5,3,11,16,6,8,14,18,13,19,9,15,21,22,24,25,20,31,44,36,37,30,23,10,4,26,28,33,39,45,49,40,55,56,59,43,42,32,12,17,38,48,50,60,74,79,75,47,51,27,35,53,65,73,76,66,46,80,77,83,29,71,69,88,92,81,90,106,97,86,85,116,127,115,93,101,114,126,113,102,87,84,104,125,124,123,122,82,34,103,121,120,107,112,94,41,68,105,111,119,110,95,61,57,96,109,118,108,52,54,100,117,99,62,78,98,91,58,64,89,67,72,63,70}, //8x8P
    1424   {0,1,2,7,5,3,11,16,6,8,14,18,13,19,9,15,21,22,24,25,20,31,44,36,37,30,23,10,4,26,28,33,39,45,49,40,55,56,59,43,42,32,12,17,38,48,50,60,74,79,75,47,51,27,35,53,65,73,76,66,46,80,77,83,29,71,69,88,92,81,90,106,97,86,85,116,127,115,93,101,114,126,113,102,87,84,104,125,124,123,122,82,34,103,121,120,107,112,94,41,68,105,111,119,110,95,61,57,96,109,118,108,52,54,100,117,99,62,78,98,91,58,64,89,67,72,63,70}, //8x8B
    1425  
    1426   {0,1,2,5,4,3,6,7,8,9,10,11,13,12,15,16,20,17,14,18,23,29,26,19,24,38,22,34,32,46,21,39,41,30,28,45,27,40,56,59,35,42,51,48,44,43,47,54,58,36,53,63,61,37,55,65,50,62,60,52,57,49,31,25,33,64,67,69,72,70,80,86,95,99,89,123,88,96,94,113,101,91,98,93,83,108,110,107,103,105,79,77,90,85,127,81,114,104,118,84,97,102,122,87,106,109,92,117,126,78,116,71,112,120,82,121,75,66,111,124,76,100,125,68,73,115,119,74}, //16x16I
    1427   {0,2,1,4,5,3,6,7,8,11,14,13,12,10,9,15,17,16,20,23,22,26,31,30,27,21,25,19,24,32,28,29,36,35,40,37,47,42,44,38,33,34,41,43,45,39,48,49,54,59,60,57,52,51,56,58,61,55,65,62,63,64,67,69,18,50,46,72,66,53,70,73,71,74,89,81,79,77,68,83,78,84,80,87,90,96,127,93,95,86,94,75,82,99,107,126,92,100,88,76,85,106,125,124,98,97,105,104,123,122,121,103,91,102,120,119,118,117,101,116,115,114,113,112,111,110,109,108}, //16x16P
    1428   {0,2,1,4,5,3,6,7,8,11,14,13,12,10,9,15,17,16,20,23,22,26,31,30,27,21,25,19,24,32,28,29,36,35,40,37,47,42,44,38,33,34,41,43,45,39,48,49,54,59,60,57,52,51,56,58,61,55,65,62,63,64,67,69,18,50,46,72,66,53,70,73,71,74,89,81,79,77,68,83,78,84,80,87,90,96,127,93,95,86,94,75,82,99,107,126,92,100,88,76,85,106,125,124,98,97,105,104,123,122,121,103,91,102,120,119,118,117,101,116,115,114,113,112,111,110,109,108}  //16x16B
    1429 };
    1430 
    1431 const UInt g_auiLPTableD8[8][128] =
    1432 {
    1433   {0,2,1,5,3,64,6,4,14,9,15,7,27,8,66,65,28,13,10,12,16,20,11,26,17,69,21,19,18,51,30,25,92,29,67,42,35,24,22,40,78,70,23,41,31,32,34,39,55,33,37,56,68,73,48,38,45,36,47,74,46,91,79,50,57,59,44,84,77,54,49,58,71,85,72,43,62,52,99,87,60,75,76,95,83,61,96,53,98,82,90,102,101,89,63,80,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,100,97,94,93,88,86,81}, //U
    1434   {0,2,1,5,3,64,6,4,14,9,15,7,27,8,66,65,28,13,10,12,16,20,11,26,17,69,21,19,18,51,30,25,92,29,67,42,35,24,22,40,78,70,23,41,31,32,34,39,55,33,37,56,68,73,48,38,45,36,47,74,46,91,79,50,57,59,44,84,77,54,49,58,71,85,72,43,62,52,99,87,60,75,76,95,83,61,96,53,98,82,90,102,101,89,63,80,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,100,97,94,93,88,86,81}, //V
    1435  
    1436   {0,1,2,5,64,6,3,4,10,14,9,8,7,15,18,26,20,11,27,28,12,17,13,42,66,19,29,43,25,21,32,65,16,53,60,30,31,39,40,35,46,44,24,126,41,59,62,45,33,63,127,61,50,54,56,74,34,52,47,23,55,125,22,38,124,51,82,123,90,57,69,67,37,121,122,117,81,48,113,98,120,116,99,49,107,92,114,118,68,58,109,36,70,73,111,75,112,91,119,115,106,108,105,71,110,100,78,87,84,104,102,89,85,94,93,97,96,86,103,72,101,95,76,79,88,80,83,77}, //8x8I
    1437   {0,1,2,5,28,4,8,3,9,14,27,6,42,12,10,15,7,43,11,13,20,16,17,26,18,19,29,53,30,64,25,21,41,31,92,54,23,24,44,32,35,99,40,39,22,33,60,51,45,34,46,52,112,55,113,36,37,107,121,38,47,106,117,126,122,56,59,124,100,66,127,65,125,57,48,50,58,62,118,49,61,69,91,63,85,74,73,84,67,123,70,120,68,78,98,105,108,72,119,116,114,79,83,93,86,101,71,96,111,109,104,102,97,82,80,77,75,115,110,103,95,94,90,89,88,87,81,76}, //8x8P
    1438   {0,1,2,5,28,4,8,3,9,14,27,6,42,12,10,15,7,43,11,13,20,16,17,26,18,19,29,53,30,64,25,21,41,31,92,54,23,24,44,32,35,99,40,39,22,33,60,51,45,34,46,52,112,55,113,36,37,107,121,38,47,106,117,126,122,56,59,124,100,66,127,65,125,57,48,50,58,62,118,49,61,69,91,63,85,74,73,84,67,123,70,120,68,78,98,105,108,72,119,116,114,79,83,93,86,101,71,96,111,109,104,102,97,82,80,77,75,115,110,103,95,94,90,89,88,87,81,76}, //8x8B
    1439  
    1440   {0,1,2,5,4,3,6,7,8,9,10,11,13,12,18,14,15,17,19,23,16,30,26,20,24,63,22,36,34,21,33,62,28,64,27,40,49,53,25,31,37,32,41,45,44,35,29,46,43,61,56,42,59,50,47,54,38,60,48,39,58,52,57,51,65,55,117,66,123,67,69,111,68,124,127,116,120,91,109,90,70,95,114,84,99,93,71,103,76,74,92,81,106,83,78,72,77,100,82,73,121,80,101,88,97,89,104,87,85,105,86,118,112,79,96,125,110,107,98,126,113,115,102,75,119,122,108,94}, //16x16I
    1441   {0,2,1,5,3,4,6,7,8,14,13,9,12,11,10,15,17,16,64,27,18,25,20,19,28,26,21,24,30,31,23,22,29,40,41,33,32,35,39,45,34,42,37,43,38,44,66,36,46,47,65,53,52,69,48,57,54,51,55,49,50,56,59,60,61,58,68,62,78,63,70,72,67,71,73,91,99,77,80,76,82,75,92,79,81,100,89,83,98,74,84,112,96,87,90,88,85,105,104,93,97,118,113,111,107,106,101,94,127,126,125,124,123,122,121,120,119,117,116,115,114,110,109,108,103,102,95,86}, //16x16P
    1442   {0,2,1,5,3,4,6,7,8,14,13,9,12,11,10,15,17,16,64,27,18,25,20,19,28,26,21,24,30,31,23,22,29,40,41,33,32,35,39,45,34,42,37,43,38,44,66,36,46,47,65,53,52,69,48,57,54,51,55,49,50,56,59,60,61,58,68,62,78,63,70,72,67,71,73,91,99,77,80,76,82,75,92,79,81,100,89,83,98,74,84,112,96,87,90,88,85,105,104,93,97,118,113,111,107,106,101,94,127,126,125,124,123,122,121,120,119,117,116,115,114,110,109,108,103,102,95,86}  //16x16B 
    1443 };
    1444 #endif
    1445 
    1446 #if LCEC_INTRA_MODE
    1447 #if MTK_DCM_MPM
    1448 
    1449 const UInt  g_auiIntraModeTableD17[2][16]=
    1450 {
    1451   {0, 15, 11, 10, 13,  7,  9, 4, 14,  2, 3, 6,  8, 5, 12, 1},
    1452   {14,10,  9,  0, 13,  7,  2, 8,  3, 12, 6, 4, 11, 1,  5, 0} 
    1453 };
    1454 const UInt  g_auiIntraModeTableE17[2][16]=
    1455 {
    1456   {0, 15,  9, 10,  7, 13, 11, 5, 12, 6, 3,  2, 14, 4,  8, 1},
    1457   {3, 13,  6,  8, 11, 14, 10, 5,  7, 2, 1, 12,  9, 4,  0, 0}
    1458 };
    1459 const UInt  g_auiIntraModeTableD34[2][33]=
    1460 {
    1461   {2, 0, 29, 30, 20,  1, 21, 28, 15,  7, 16,  8, 11, 31, 22, 19, 32, 10, 27, 14,  4, 18, 12, 23, 17, 24, 26,  6, 25,  5, 9, 3, 13},
    1462   {2, 1, 28,  0, 29, 20, 27, 19, 15, 21,  7, 14, 10, 11, 30, 31, 18, 16, 26,  8, 17,  4, 22,  9, 23,  6, 25, 13, 24, 12, 3, 5,  0}
    1463 };
    1464 const UInt  g_auiIntraModeTableE34[2][33]=
    1465 {
    1466   {1, 5, 0, 31, 20, 29, 27,  9, 11, 30, 17, 12, 22, 32, 19, 8, 10, 24, 21, 15, 4, 6, 14, 23, 25, 28, 26, 18, 7, 2,  3, 13, 16},
    1467   {3, 1, 0, 30, 21, 31, 25, 10, 19, 23, 12, 13, 29, 27, 11, 8, 17, 20, 16,  7, 5, 9, 22, 24, 28, 26, 18,  6, 2, 4, 14, 15,  0}
    1468 };
    1469 
    1470 #else
    1471 const UInt  g_auiIntraModeTableD17[16]={15,0,11,7,14,10,13,4,9,2,3,1,8,6,12,5};
    1472 const UInt  g_auiIntraModeTableE17[16]={1,11,9,10,7,15,13,3,12,8,5,2,14,6,4,0};
    1473 
    1474 const UInt  g_auiIntraModeTableD34[33]={0,29,1,2,30,20,28,15,32,21,27,11,10,7,19,14,16,23,22,8,4,18,31,26,17,9,25,6,3,12,13,24,5};
    1475 const UInt  g_auiIntraModeTableE34[33]={0,2,3,28,20,32,27,13,19,25,12,11,29,30,15,7,16,24,21,14,5,9,18,17,31,26,23,10,6,1,4,22,8};
    1476 #endif
    1477 #endif
    1478 
    1479 const UInt g_auiLastPosVlcIndex[10] = {0,0,0,0,0,0,0,0,0,0};
    1480 
    1481 const UInt g_auiLastPosVlcNum[10][17] =
    1482 {
    1483   {10,10,10,10, 2,2,2,7,9,9,9,9,9,4,4,4,4},
    1484   {10,10,10,10,10,2,9,9,9,9,9,9,9,4,4,4,4},
    1485 #if CAVLC_COEF_LRG_BLK
    1486   { 2, 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4,13},
    1487   { 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,13},
    1488   { 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,13},
    1489   {10,10,10, 4, 4, 4, 4,12,12,12,12,12,12,12,12,12,12},
    1490   {10,10,10,10, 4, 4,12,12,12,12,12,12,12,12,12,12,12},
    1491   {10,10,10,10, 4, 4,12,12,12,12,12,12,12,12,12,12,12},
    1492 #else
    1493   { 2, 2, 2, 2, 2,7,7,7,7,7,7,7,7,7,4,4,4},
    1494   { 2, 2, 2, 2, 7,7,7,7,7,7,7,7,7,7,7,7,4},
    1495   { 2, 2, 2, 2, 7,7,7,7,7,7,7,7,7,7,7,7,4},
    1496   {10, 1, 2, 2, 2,2,7,7,7,7,9,9,9,4,4,4,4},
    1497   {10,10, 2, 2, 7,7,7,7,7,7,7,7,4,4,4,4,4},
    1498   {10,10, 2, 2, 7,7,7,7,7,7,7,7,4,4,4,4,4},
    1499 #endif
    1500   { 2, 2, 2, 2, 7,7,7,7,7,7,7,7,7,7,7,7,4},
    1501   { 2, 2, 2, 2, 7,7,7,7,7,7,7,7,7,7,7,7,4}
    1502 };
    1503 
    1504 
    1505 
    1506 #if RUNLEVEL_TABLE_CUT
    1507 const UInt g_auiLumaRun8x8[28][29] =
    1508 {
    1509   {1,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1510   {2,   1,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1511   {1,   3,   2,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1512   {2,   1,   3,   4,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1513   {1,   5,   3,   2,   4,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1514   {1,   2,   6,   5,   3,   4,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1515   {2,   1,   3,   5,   4,   7,   6,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1516   {1,   5,   4,   2,   3,   6,   8,   7,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1517   {1,   3,   8,   7,   5,   2,   4,   9,   6,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1518   {1,   2,   5,   9,   8,   7,   3,   4,  10,   6,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1519   {2,   1,   3,   4,   7,   8,   5,   6,   9,  11,  10,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1520   {1,   4,   3,   2,   5,   7,   6,   8,  10,  11,  12,   9,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1521   {1,   2,   6,   7,   5,   3,   4,   8,   9,  13,  11,  12,  10,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1522   {1,   2,   4,   8,   9,   7,   6,   3,   5,  12,  14,  13,  11,  10,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1523   {1,   2,   3,   5,   9,  10,   8,   7,   4,   6,  12,  15,  14,  13,  11,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1524   {1,   2,   3,   4,   5,   8,  10,   7,   6,   9,  11,  13,  16,  14,  15,  12,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1525   {1,   3,   4,   2,   5,   6,  10,   9,   7,   8,  11,  12,  13,  15,  16,  17,  14,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1526   {1,   2,   4,   7,   6,   3,   5,   8,   9,  10,  11,  17,  15,  13,  14,  16,  18,  12,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1527   {1,   2,   5,   7,   9,  10,   6,   3,   4,   8,  11,  16,  19,  17,  15,  13,  14,  18,  12,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1528   {1,   3,   5,   7,   9,  14,  12,   8,   6,   2,   4,  15,  17,  19,  18,  16,  10,  11,  20,  13,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1529   {1,   2,   4,   6,   9,   8,  15,  14,  13,   7,   3,   5,  16,  18,  21,  19,  17,  10,  12,  20,  11,   0,  M1,  M1,  M1,  M1,  M1,  M1,  M1},
    1530   {2,   1,   3,   4,   5,   8,   9,  11,  13,  10,   6,   7,  12,  14,  19,  22,  21,  17,  15,  18,  20,  16,   0,  M1,  M1,  M1,  M1,  M1,  M1},
    1531   {1,   5,   4,   2,   3,   6,   8,   7,  11,  12,   9,  10,  13,  14,  15,  18,  22,  21,  17,  19,  20,  23,  16,   0,  M1,  M1,  M1,  M1,  M1},
    1532   {1,   4,   8,   6,   5,   2,   3,   7,   9,  12,  10,  11,  13,  16,  15,  14,  18,  20,  21,  19,  23,  22,  24,  17,   0,  M1,  M1,  M1,  M1},
    1533   {1,   3,   7,  12,  10,   6,   5,   2,   4,   8,   9,  11,  13,  16,  23,  20,  15,  14,  18,  19,  21,  24,  25,  22,  17,   0,  M1,  M1,  M1},
    1534   {1,   2,   5,   9,  13,  11,  10,   8,   6,   3,   4,   7,  12,  15,  18,  25,  22,  19,  16,  14,  17,  21,  26,  23,  24,  20,   0,  M1,  M1},
    1535   {1,   2,   4,   7,  11,  15,  12,   9,  10,   8,   5,   3,   6,  14,  16,  22,  23,  24,  20,  19,  13,  18,  26,  27,  25,  21,  17,   0,  M1},
    1536   {1,   2,   3,   5,   6,  10,  14,  13,  11,   9,  12,   7,   4,   8,  16,  18,  21,  23,  25,  20,  22,  15,  19,  27,  28,  26,  24,  17,   0}
    1537 };
    1538 #else
    1539 const UInt g_auiLumaRun8x8[29][2][64] =
    1540 {
    1541   /* 0 */
    1542   {
    1543     {
    1544       1,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1545       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1546       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1547       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1548     },
    1549     {
    1550       2, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1551       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1552       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1553       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1554     }
    1555   },
    1556   /* 1 */
    1557   {
    1558     {
    1559       2,  1,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1560       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1561       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1562       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1563     },
    1564     {
    1565       4,  3, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1566       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1567       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1568       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1569     }
    1570   },
    1571   /* 2 */
    1572   {
    1573     {
    1574       1,  3,  2,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1575       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1576       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1577       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1578     },
    1579     {
    1580       4,  6,  5, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1581       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1582       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1583       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1584     }
    1585   },
    1586   /* 3 */
    1587   {
    1588     {
    1589       2,  1,  3,  4,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1590       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1591       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1592       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1593     },
    1594     {
    1595       6,  5,  7,  8, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1596       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1597       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1598       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1599     }
    1600   },
    1601   /* 4 */
    1602   {
    1603     {
    1604       1,  5,  3,  2,  4,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1605       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1606       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1607       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1608     },
    1609     {
    1610       6, 10,  8,  7,  9, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1611       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1612       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1613       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1614     }
    1615   },
    1616   /* 5 */
    1617   {
    1618     {
    1619       1,  2,  6,  5,  3,  4,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1620       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1621       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1622       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1623     },
    1624     {
    1625       7,  8, 11, 10,  9, 12, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1626       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1627       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1628       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1629     }
    1630   },
    1631   /* 6 */
    1632   {
    1633     {
    1634       2,  1,  3,  5,  4,  7,  6,  0, M1, M1, M1, M1, M1, M1, M1, M1,
    1635       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1636       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1637       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1638     },
    1639     {
    1640       9,  8, 10, 12, 11, 13, 14, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1641       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1642       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1643       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1644     }
    1645   },
    1646   /* 7 */
    1647   {
    1648     {
    1649       1,  5,  4,  2,  3,  6,  8,  7,  0, M1, M1, M1, M1, M1, M1, M1,
    1650       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1651       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1652       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1653     },
    1654     {
    1655       9, 13, 12, 10, 11, 14, 15, 16, M1, M1, M1, M1, M1, M1, M1, M1,
    1656       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1657       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1658       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1659     }
    1660   },
    1661   /* 8 */
    1662   {
    1663     {
    1664       1,  3,  8,  7,  5,  2,  4,  9,  6,  0, M1, M1, M1, M1, M1, M1,
    1665       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1666       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1667       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1668     },
    1669     {
    1670       10, 12, 16, 15, 14, 11, 13, 18, 17, M1, M1, M1, M1, M1, M1, M1,
    1671       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1672       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1673       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1674     }
    1675   },
    1676   /* 9 */
    1677   {
    1678     {
    1679       1,  2,  5, 10,  9,  7,  3,  4, 11,  6,  0, M1, M1, M1, M1, M1,
    1680       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1681       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1682       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1683     },
    1684     {
    1685       8, 12, 15, 17, 18, 16, 13, 14, 20, 19, M1, M1, M1, M1, M1, M1,
    1686       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1687       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1688       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1689     }
    1690   },
    1691   {
    1692     {
    1693       2,  1,  3,  4,  7,  8,  5,  6,  9, 11, 10,  0, M1, M1, M1, M1,
    1694       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1695       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1696       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1697     },
    1698     {
    1699       13, 12, 14, 15, 17, 18, 16, 19, 20, 22, 21, M1, M1, M1, M1, M1,
    1700       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1701       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1702       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1703     }
    1704   },
    1705   {
    1706     {
    1707       1,  4,  3,  2,  5,  7,  6,  8, 10, 11, 12,  9,  0, M1, M1, M1,
    1708       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1709       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1710       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1711     },
    1712     {
    1713       13, 17, 15, 14, 16, 19, 18, 20, 22, 23, 24, 21, M1, M1, M1, M1,
    1714       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1715       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1716       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1717     }
    1718   },
    1719   {
    1720     {
    1721       1,  2,  6,  7,  5,  3,  4,  8,  9, 13, 11, 12, 10,  0, M1, M1,
    1722       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1723       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1724       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1725     },
    1726     {
    1727       14, 16, 18, 21, 19, 15, 17, 20, 22, 26, 23, 24, 25, M1, M1, M1,
    1728       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1729       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1730       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1731     }
    1732   },
    1733   {
    1734     {
    1735       1,  2,  4,  8,  9,  7,  6,  3,  5, 12, 14, 13, 11, 10,  0, M1,
    1736       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1737       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1738       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1739     },
    1740     {
    1741       15, 16, 19, 21, 23, 22, 20, 17, 18, 26, 28, 27, 24, 25, M1, M1,
    1742       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1743       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1744       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1745     }
    1746   },
    1747   {
    1748     {
    1749       1,  2,  3,  5,  9, 10,  8,  7,  4,  6, 13, 16, 15, 14, 12,  0,
    1750       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1751       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1752       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1753     },
    1754     {
    1755       11, 17, 18, 20, 22, 24, 23, 26, 19, 21, 27, 30, 29, 25, 28, M1,
    1756       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1757       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1758       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1759     }
    1760   },
    1761   {
    1762     {
    1763       1,  2,  3,  4,  5,  8, 10,  7,  6,  9, 11, 13, 18, 15, 16, 12,
    1764       0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1765       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1766       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1767     },
    1768     {
    1769       14, 17, 19, 20, 21, 23, 25, 24, 22, 26, 27, 29, 31, 28, 32, 30,
    1770       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1771       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1772       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1773     }
    1774   },
    1775   {
    1776     {
    1777       1,  3,  4,  2,  5,  6, 10,  9,  7,  8, 11, 12, 13, 16, 17, 18,
    1778       14,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1779       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1780       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1781     },
    1782     {
    1783       15, 19, 22, 20, 21, 24, 26, 25, 23, 27, 32, 29, 28, 30, 33, 34,
    1784       31, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1785       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1786       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1787     }
    1788   },
    1789   {
    1790     {
    1791       1,  2,  4,  7,  6,  3,  5,  8,  9, 10, 11, 18, 15, 13, 14, 17,
    1792       19, 12,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1793       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1794       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1795     },
    1796     {
    1797       16, 21, 24, 25, 26, 20, 22, 27, 23, 28, 30, 35, 31, 29, 34, 33,
    1798       36, 32, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1799       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1800       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1801     }
    1802   },
    1803   {
    1804     {
    1805       1,  2,  5,  7,  9, 10,  6,  3,  4,  8, 11, 17, 20, 18, 15, 13,
    1806       14, 19, 12,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1807       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1808       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1809     },
    1810     {
    1811       16, 21, 24, 25, 29, 28, 27, 23, 22, 26, 31, 36, 34, 37, 33, 32,
    1812       30, 38, 35, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1813       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1814       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1815     }
    1816   },
    1817   {
    1818     {
    1819       1,  3,  5,  7,  9, 14, 12,  8,  6,  2,  4, 15, 18, 21, 20, 16,
    1820       10, 11, 22, 13,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1821       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1822       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1823     },
    1824     {
    1825       17, 23, 25, 27, 29, 31, 33, 30, 26, 19, 24, 35, 37, 39, 40, 36,
    1826       32, 28, 38, 34, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1827       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1828       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1829     }
    1830   },
    1831   {
    1832     {
    1833       0,  2,  4,  7, 10,  9, 16, 15, 14,  8,  3,  5, 17, 19, 22, 20,
    1834       18, 11, 13, 21, 12,  1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1835       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1836       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1837     },
    1838     {
    1839       6, 23, 25, 29, 27, 31, 30, 34, 38, 32, 24, 26, 36, 82, 39, 37,
    1840       83, 28, 33, 84, 35, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1841       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1842       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1843     }
    1844   },
    1845   {
    1846     {
    1847       2,  1,  3,  4,  5,  8,  9, 11, 13, 10,  6,  7, 12, 14, 21, 24,
    1848       23, 18, 15, 19, 22, 16,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1849       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1850       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1851     },
    1852     {
    1853       20, 17, 25, 26, 27, 28, 31, 34, 35, 30, 29, 32, 33, 36, 37, 43,
    1854       44, 38, 39, 40, 41, 42, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1855       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1856       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1857     }
    1858   },
    1859   {
    1860     {
    1861       1,  5,  4,  2,  3,  6,  8,  7, 11, 12,  9, 10, 13, 14, 15, 18,
    1862       22, 21, 17, 19, 20, 25, 16,  0, M1, M1, M1, M1, M1, M1, M1, M1,
    1863       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1864       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1865     },
    1866     {
    1867       26, 28, 27, 23, 24, 29, 31, 32, 38, 34, 30, 33, 35, 37, 36, 43,
    1868       44, 40, 41, 85, 42, 86, 39, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1869       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1870       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1871     }
    1872   },
    1873   {
    1874     {
    1875       1,  4,  8,  6,  5,  2,  3,  7,  9, 12, 10, 11, 13, 16, 15, 14,
    1876       18, 20, 21, 19, 23, 22, 25, 17,  0, M1, M1, M1, M1, M1, M1, M1,
    1877       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1878       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1879     },
    1880     {
    1881       24, 28, 33, 29, 31, 26, 27, 34, 35, 36, 32, 30, 37, 40, 38, 42,
    1882       45, 47, 39, 43, 46, 41, 87, 44, M1, M1, M1, M1, M1, M1, M1, M1,
    1883       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1884       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1885     }
    1886   },
    1887   {
    1888     {
    1889       0,  3,  7, 12, 10,  6,  5,  2,  4,  8,  9, 11, 13, 17, 24, 21,
    1890       16, 15, 19, 20, 22, 25, 26, 23, 18,  1, M1, M1, M1, M1, M1, M1,
    1891       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1892       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1893     },
    1894     {
    1895       14, 28, 34, 36, 33, 35, 31, 27, 30, 29, 32, 37, 40, 46, 38, 44,
    1896       39, 47, 48, 49, 45, 41, 42, 50, 43, M1, M1, M1, M1, M1, M1, M1,
    1897       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1898       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1899     }
    1900   },
    1901   {
    1902     {
    1903       0,  2,  5,  9, 13, 11, 10,  8,  6,  3,  4,  7, 12, 15, 19, 26,
    1904       23, 20, 16, 14, 18, 22, 27, 24, 25, 21,  1, M1, M1, M1, M1, M1,
    1905       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1906       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1907     },
    1908     {
    1909       17, 28, 31, 36, 35, 39, 37, 34, 33, 30, 29, 32, 38, 43, 86, 87,
    1910       45, 46, 44, 41, 40, 88, 48, 89, 47, 42, M1, M1, M1, M1, M1, M1,
    1911       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1912       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1913     }
    1914   },
    1915   {
    1916     {
    1917       1,  2,  4,  7, 11, 15, 12,  9, 10,  8,  5,  3,  6, 14, 16, 23,
    1918       24, 25, 21, 20, 13, 19, 27, 28, 26, 22, 17,  0, M1, M1, M1, M1,
    1919       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1920       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1921     },
    1922     {
    1923       18, 29, 31, 33, 39, 36, 35, 38, 41, 40, 34, 30, 32, 43, 48, 53,
    1924       90, 49, 42, 50, 37, 44, 51, 47, 52, 45, 46, M1, M1, M1, M1, M1,
    1925       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1926       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1927     }
    1928   },
    1929   {
    1930     {
    1931       0,  2,  3,  5,  7, 11, 15, 14, 12, 10, 13,  8,  4,  9, 17, 19,
    1932       22, 24, 26, 21, 23, 16, 20, 29, 30, 28, 25, 18,  1, M1, M1, M1,
    1933       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1934       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1935     },
    1936     {
    1937       6, 27, 31, 33, 34, 38, 39, 37, 40, 42, 41, 35, 32, 36, 44, 45,
    1938       87, 48, 88, 49, 46, 89, 43, 47, 90, 50, 51, 91, M1, M1, M1, M1,
    1939       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1,
    1940       M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1
    1941     }
    1942   },
    1943   {
    1944     {
    1945       0,  1,  2,  3,  4,  5,  7,  9, 10, 13,  8, 12, 11,  6, 14, 15,
    1946       18, 20, 24, 31, 32, 30, 28, 26, 22, 25, 33, 37, 38, 17, 19, 21,
    1947       23, 29, 36, 34, 45, 40, 43, 42, 44, 39, 35, 46, 48, 53, 54, 51,
    1948       61, 62, 67, 66, 68, 65, 73, 74, 71, 69, 86, 82, 90, 88, 98, 94
    1949     },
    1950     {
    1951       16, 27, 41, 47, 50, 57, 58, 60, 59, 55, 52, 63, 56, 49, 64, 70,
    1952       72, 77, 76, 80, 84, 81, 79, 78, 75, 83, 85, 87, 91, 95, 92,104,
    1953       89, 93, 96, 99,100,102,101, 97,105,103,106,107,108,109,110,111,
    1954       112,113,114,115,116,117,118,119,120,121,122,123,124,125,126, M1
    1955     }
    1956   }
    1957 };
    1958 #endif
    1959 
    1960 #if  QC_MOD_LCEC
    1961 const UInt g_auiLumaRunTr14x4[5][15]=
    1962 {
    1963     {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
    1964     {2, 3, 4, 5, 6, 5, 6, 7, 7, 7, 7, 7, 6, 4, 2},
    1965     {2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 3, 3, 3, 2, M1},
    1966     {2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, M1, M1},
    1967     {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, M1, M1, M1}
    1968 };
    1969 const UInt g_auiLumaRunTr18x8[5][29]=
    1970 {
    1971     {0, 1, 2, 2, 2, 2, 2, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 8, 7, 8, 8, 9, 10, 10, 10, 12, 10, 9, 8},
    1972     {2, 4, 4, 6, 6, 8, 8, 10, 11, 13, 15, 13, 14, 15, 16, 18, 18, 21, 20, 21, 22, 23, 25, 25, 26, 27, 28, 29, 27},
    1973     {2, 3, 4, 5, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 19, 19},
    1974     {2, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 13, 13},
    1975     {2, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 8}
    1976 };
    1977 
    1978 #if CAVLC_COEF_LRG_BLK
    1979 const UInt *g_pLumaRunTr14x4[5] = {
    1980   &g_auiLumaRunTr14x4[0][0], &g_auiLumaRunTr14x4[1][0], &g_auiLumaRunTr14x4[2][0],
    1981   &g_auiLumaRunTr14x4[3][0], &g_auiLumaRunTr14x4[4][0]
    1982 };
    1983 
    1984 const UInt *g_pLumaRunTr18x8[5] = {
    1985   &g_auiLumaRunTr18x8[0][0], &g_auiLumaRunTr18x8[1][0], &g_auiLumaRunTr18x8[2][0],
    1986   &g_auiLumaRunTr18x8[3][0], &g_auiLumaRunTr18x8[4][0]
    1987 };
    1988 #endif
    1989 #endif
    1990 
    1991 #if QC_MOD_LCEC
    1992 const UInt g_auiVlcTable8x8Inter[29] = {8,0,0,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,3};
    1993 const UInt g_auiVlcTable8x8Intra[29] = {8,0,0,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,3};
    1994 #if CAVLC_COEF_LRG_BLK
    1995 const UInt g_auiVlcTable16x16Intra[29] = {8,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5,1,1,1,1,1,1,1,1,1,1,2};
    1996 const UInt g_auiVlcTable16x16Inter[29] = {8,0,1,1,1,1,2,2,2,2,2,2,2,6,6,6,6,6,6,3,3,3,3,3,3,3,3,3,3};
    1997 #endif
    1998 #else
    1999 const UInt g_auiVlcTable8x8[28] = {8,0,0,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6};
    2000 #endif
    2001 
    2002 #if LCEC_INTRA_MODE
    2003 #if MTK_DCM_MPM
    2004 const UInt huff17_2[2][17]=
    2005 {
    2006   {1, 7, 6, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 3, 2, 1, 0},
    2007   {1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 0},
    2008 };
    2009 const UInt lengthHuff17_2[2][17]=
    2010 {
    2011   {1, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6},
    2012   {1, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0},
    2013 };
    2014 const UInt huff34_2[2][34]=
    2015 {
    2016   {1, 0, 7, 6, 5, 4, 3, 2, 23, 22, 21, 20, 19, 18, 17, 16, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 127, 126, 125, 124 },
    2017   {1, 0, 5, 4, 3, 2, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51,50, 0 }
    2018 };
    2019 const UInt lengthHuff34_2[2][34]=
    2020 {
    2021   {1, 4,  5,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  6,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  8,  8,  8, 8 },
    2022   {1, 4,  5,  5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7, 0 }
    2023 };
    2024 #else
    2025 const UInt huff17_2[2][17]=
    2026 {
    2027   {1, 7, 6, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 3, 2, 1, 0},
    2028   {3, 5, 9, 8, 7, 6, 5, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
    2029 };
    2030 const UInt lengthHuff17_2[2][17]=
    2031 {
    2032   {1, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6},
    2033   {2, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}
    2034 };
    2035 const UInt huff34_2[2][34]=
    2036 {
    2037   {1, 7, 13, 12, 11, 10, 9, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 0},
    2038   {3, 11, 10, 9, 17, 16, 15, 14, 13, 12, 11, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 0}
    2039 };
    2040 const UInt lengthHuff34_2[2][34]=
    2041 {
    2042   {1, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8},
    2043   {2, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7}
    2044 };
    2045 #endif
    2046 #endif
    2047 
    2048 #if RUNLEVEL_TABLE_CUT
    2049 const UInt g_acstructLumaRun8x8[28][29] =
    2050 {
    2051   {  1,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2052   {  2,  1,  0, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2053   {  3,  0,  2,  1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2054   {  4,  1,  0,  2,  3, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2055   {  5,  0,  3,  2,  4,  1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2056   {  6,  0,  1,  4,  5,  3,  2, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2057   {  7,  1,  0,  2,  4,  3,  6,  5, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2058   {  8,  0,  3,  4,  2,  1,  5,  7,  6, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2059   {  9,  0,  5,  1,  6,  4,  8,  3,  2,  7, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2060   { 10,  0,  1,  6,  7,  2,  9,  5,  4,  3,  8, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2061   { 11,  1,  0,  2,  3,  6,  7,  4,  5,  8, 10,  9, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2062   { 12,  0,  3,  2,  1,  4,  6,  5,  7, 11,  8,  9, 10, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2063   { 13,  0,  1,  5,  6,  4,  2,  3,  7,  8, 12, 10, 11,  9, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2064   { 14,  0,  1,  7,  2,  8,  6,  5,  3,  4, 13, 12,  9, 11, 10, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2065   { 15,  0,  1,  2,  8,  3,  9,  7,  6,  4,  5, 14, 10, 13, 12, 11, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2066   { 16,  0,  1,  2,  3,  4,  8,  7,  5,  9,  6, 10, 15, 11, 13, 14, 12, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2067   { 17,  0,  3,  1,  2,  4,  5,  8,  9,  7,  6, 10, 11, 12, 16, 13, 14, 15, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2068   { 18,  0,  1,  5,  2,  6,  4,  3,  7,  8,  9, 10, 17, 13, 14, 12, 15, 11, 16, M1, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2069   { 19,  0,  1,  7,  8,  2,  6,  3,  9,  4,  5, 10, 18, 15, 16, 14, 11, 13, 17, 12, M1, M1, M1, M1, M1, M1, M1, M1, M1},
    2070   { 20,  0,  9,  1, 10,  2,  8,  3,  7,  4, 16, 17,  6, 19,  5, 11, 15, 12, 14, 13, 18, M1, M1, M1, M1, M1, M1, M1, M1},
    2071   { 21,  0,  1, 10,  2, 11,  3,  9,  5,  4, 17, 20, 18,  8,  7,  6, 12, 16, 13, 15, 19, 14, M1, M1, M1, M1, M1, M1, M1},
    2072   { 22,  1,  0,  2,  3,  4, 10, 11,  5,  6,  9,  7, 12,  8, 13, 18, 21, 17, 19, 14, 20, 16, 15, M1, M1, M1, M1, M1, M1},
    2073   { 23,  0,  3,  4,  2,  1,  5,  7,  6, 10, 11,  8,  9, 12, 13, 14, 22, 18, 15, 19, 20, 17, 16, 21, M1, M1, M1, M1, M1},
    2074   { 24,  0,  5,  6,  1,  4,  3,  7,  2,  8, 10, 11,  9, 12, 15, 14, 13, 23, 16, 19, 17, 18, 21, 20, 22, M1, M1, M1, M1},
    2075   { 25,  0,  7,  1,  8,  6,  5,  2,  9, 10,  4, 11,  3, 12, 17, 16, 13, 24, 18, 19, 15, 20, 23, 14, 21, 22, M1, M1, M1},
    2076   { 26,  0,  1,  9, 10,  2,  8, 11,  7,  3,  6,  5, 12,  4, 19, 13, 18, 20, 14, 17, 25, 21, 16, 23, 24, 15, 22, M1, M1},
    2077   { 27,  0,  1, 11,  2, 10, 12,  3,  9,  7,  8,  4,  6, 20, 13,  5, 14, 26, 21, 19, 18, 25, 15, 16, 17, 24, 22, 23, M1},
    2078   { 28,  0,  1,  2, 12,  3,  4, 11, 13,  9,  5,  8, 10,  7,  6, 21, 14, 27, 15, 22, 19, 16, 20, 17, 26, 18, 25, 23, 24}
    2079 };
    2080 #else
    2081 const LastCoeffStruct g_acstructLumaRun8x8[29][127] =
    2082 {
    2083   {
    2084     {0,1},{0,0},{1,0},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2085     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2086     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2087     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2088     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2089     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2090     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2091     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2092   },
    2093  
    2094   {
    2095     {0,2},{0,1},{0,0},{1,1},{1,0},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2096     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2097     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2098     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2099     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2100     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2101     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2102     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2103   },
    2104  
    2105   {
    2106     {0,3},{0,0},{0,2},{0,1},{1,0},{1,2},{1,1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2107     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2108     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2109     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2110     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2111     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2112     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2113     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2114   },
    2115  
    2116   {
    2117     {0,4},{0,1},{0,0},{0,2},{0,3},{1,1},{1,0},{1,2},{1,3},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2118     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2119     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2120     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2121     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2122     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2123     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2124     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2125   },
    2126  
    2127   {
    2128     {0,5},{0,0},{0,3},{0,2},{0,4},{0,1},{1,0},{1,3},{1,2},{1,4},{1,1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2129     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2130     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2131     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2132     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2133     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2134     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2135     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2136   },
    2137  
    2138   {
    2139     {0,6},{0,0},{0,1},{0,4},{0,5},{0,3},{0,2},{1,0},{1,1},{1,4},{1,3},{1,2},{1,5},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2140     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2141     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2142     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2143     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2144     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2145     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2146     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2147   },
    2148  
    2149   {
    2150     {0,7},{0,1},{0,0},{0,2},{0,4},{0,3},{0,6},{0,5},{1,1},{1,0},{1,2},{1,4},{1,3},{1,5},{1,6},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2151     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2152     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2153     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2154     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2155     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2156     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2157     {M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2158   },
    2159  
    2160   {
    2161     {0,8},{0,0},{0,3},{0,4},{0,2},{0,1},{0,5},{0,7},{0,6},{1,0},{1,3},{1,4},{1,2},{1,1},{1,5},{1,6},{1,7},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2162     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2163     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2164     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2165     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2166     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2167     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2168     {M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2169   },
    2170  
    2171   {
    2172     {0,9},{0,0},{0,5},{0,1},{0,6},{0,4},{0,8},{0,3},{0,2},{0,7},{1,0},{1,5},{1,1},{1,6},{1,4},{1,3},{1,2},{1,8},{1,7},{M1,M1},{M1,M1},{M1,M1},
    2173     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2174     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2175     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2176     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2177     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2178     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2179     {M1,M1},{M1,M1},{M1,M1}
    2180   },
    2181  
    2182   {
    2183     {0,10},{0,0},{0,1},{0,6},{0,7},{0,2},{0,9},{0,5},{1,0},{0,4},{0,3},{0,8},{1,1},{1,6},{1,7},{1,2},{1,5},{1,3},{1,4},{1,9},{1,8},{M1,M1},
    2184     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2185     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2186     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2187     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2188     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2189     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2190     {M1,M1},{M1,M1},{M1,M1}
    2191   },
    2192  
    2193   {
    2194     {0,11},{0,1},{0,0},{0,2},{0,3},{0,6},{0,7},{0,4},{0,5},{0,8},{0,10},{0,9},{1,1},{1,0},{1,2},{1,3},{1,6},{1,4},{1,5},{1,7},{1,8},{1,10},
    2195     {1,9},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2196     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2197     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2198     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2199     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2200     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2201     {M1,M1},{M1,M1},{M1,M1}
    2202   },
    2203  
    2204   {
    2205     {0,12},{0,0},{0,3},{0,2},{0,1},{0,4},{0,6},{0,5},{0,7},{0,11},{0,8},{0,9},{0,10},{1,0},{1,3},{1,2},{1,4},{1,1},{1,6},{1,5},{1,7},{1,11},
    2206     {1,8},{1,9},{1,10},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2207     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2208     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2209     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2210     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2211     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2212     {M1,M1},{M1,M1}
    2213   },
    2214  
    2215   {
    2216     {0,13},{0,0},{0,1},{0,5},{0,6},{0,4},{0,2},{0,3},{0,7},{0,8},{0,12},{0,10},{0,11},{0,9},{1,0},{1,5},{1,1},{1,6},{1,2},{1,4},{1,7},{1,3},
    2217     {1,8},{1,10},{1,11},{1,12},{1,9},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2218     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2219     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2220     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2221     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2222     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2223     {M1,M1},{M1,M1}
    2224   },
    2225  
    2226   {
    2227     {0,14},{0,0},{0,1},{0,7},{0,2},{0,8},{0,6},{0,5},{0,3},{0,4},{0,13},{0,12},{0,9},{0,11},{0,10},{1,0},{1,1},{1,7},{1,8},{1,2},{1,6},{1,3},
    2228     {1,5},{1,4},{1,12},{1,13},{1,9},{1,11},{1,10},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2229     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2230     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2231     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2232     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2233     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2234     {M1,M1},{M1,M1}
    2235   },
    2236  
    2237   {
    2238     {0,15},{0,0},{0,1},{0,2},{0,8},{0,3},{0,9},{0,7},{0,6},{0,4},{0,5},{1,0},{0,14},{0,10},{0,13},{0,12},{0,11},{1,1},{1,2},{1,8},{1,3},{1,9},
    2239     {1,4},{1,6},{1,5},{1,13},{1,7},{1,10},{1,14},{1,12},{1,11},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2240     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2241     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2242     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2243     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2244     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2245     {M1,M1}
    2246   },
    2247  
    2248   {
    2249     {0,16},{0,0},{0,1},{0,2},{0,3},{0,4},{0,8},{0,7},{0,5},{0,9},{0,6},{0,10},{0,15},{0,11},{1,0},{0,13},{0,14},{1,1},{0,12},{1,2},{1,3},{1,4},
    2250     {1,8},{1,5},{1,7},{1,6},{1,9},{1,10},{1,13},{1,11},{1,15},{1,12},{1,14},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2251     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2252     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2253     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2254     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2255     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2256     {M1,M1}
    2257   },
    2258  
    2259   {
    2260     {0,17},{0,0},{0,3},{0,1},{0,2},{0,4},{0,5},{0,8},{0,9},{0,7},{0,6},{0,10},{0,11},{0,12},{0,16},{1,0},{0,13},{0,14},{0,15},{1,1},{1,3},
    2261     {1,4},{1,2},{1,8},{1,5},{1,7},{1,6},{1,9},{1,12},{1,11},{1,13},{1,16},{1,10},{1,14},{1,15},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2262     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2263     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2264     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2265     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2266     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2267     {M1,M1}
    2268   },
    2269  
    2270   {
    2271     {0,18},{0,0},{0,1},{0,5},{0,2},{0,6},{0,4},{0,3},{0,7},{0,8},{0,9},{0,10},{0,17},{0,13},{0,14},{0,12},{1,0},{0,15},{0,11},{0,16},{1,5},
    2272     {1,1},{1,6},{1,8},{1,2},{1,3},{1,4},{1,7},{1,9},{1,13},{1,10},{1,12},{1,17},{1,15},{1,14},{1,11},{1,16},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2273     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2274     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2275     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2276     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2277     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2278     {M1,M1}
    2279   },
    2280  
    2281   {
    2282     {0,19},{0,0},{0,1},{0,7},{0,8},{0,2},{0,6},{0,3},{0,9},{0,4},{0,5},{0,10},{0,18},{0,15},{0,16},{0,14},{1,0},{0,11},{0,13},{0,17},{0,12},
    2283     {1,1},{1,8},{1,7},{1,2},{1,3},{1,9},{1,6},{1,5},{1,4},{1,16},{1,10},{1,15},{1,14},{1,12},{1,18},{1,11},{1,13},{1,17},{M1,M1},{M1,M1},
    2284     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2285     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2286     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2287     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2288     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2289     {M1,M1}
    2290   },
    2291  
    2292   {
    2293     {0,20},{0,0},{0,9},{0,1},{0,10},{0,2},{0,8},{0,3},{0,7},{0,4},{0,16},{0,17},{0,6},{0,19},{0,5},{0,11},{0,15},{1,0},{0,12},{1,9},{0,14},
    2294     {0,13},{0,18},{1,1},{1,10},{1,2},{1,8},{1,3},{1,17},{1,4},{1,7},{1,5},{1,16},{1,6},{1,19},{1,11},{1,15},{1,12},{1,18},{1,13},{1,14},
    2295     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2296     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2297     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2298     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2299     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2300     {M1,M1}
    2301   },
    2302  
    2303   {
    2304     {0,0},{0,21},{0,1},{0,10},{0,2},{0,11},{1,0},{0,3},{0,9},{0,5},{0,4},{0,17},{0,20},{0,18},{0,8},{0,7},{0,6},{0,12},{0,16},{0,13},{0,15},
    2305     {0,19},{0,14},{1,1},{1,10},{1,2},{1,11},{1,4},{1,17},{1,3},{1,6},{1,5},{1,9},{1,18},{1,7},{1,20},{1,12},{1,15},{1,8},{1,14},{M1,M1},
    2306     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2307     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2308     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{1,13},{1,16},{1,19},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2309     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2310     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2311     {M1,M1}
    2312   },
    2313  
    2314   {
    2315     {0,22},{0,1},{0,0},{0,2},{0,3},{0,4},{0,10},{0,11},{0,5},{0,6},{0,9},{0,7},{0,12},{0,8},{0,13},{0,18},{0,21},{1,1},{0,17},{0,19},{1,0},
    2316     {0,14},{0,20},{0,16},{0,15},{1,2},{1,3},{1,4},{1,5},{1,10},{1,9},{1,6},{1,11},{1,12},{1,7},{1,8},{1,13},{1,14},{1,17},{1,18},{1,19},{1,20},
    2317     {1,21},{1,15},{1,16},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2318     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2319     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2320     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2321     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2322   },
    2323  
    2324   {
    2325     {0,23},{0,0},{0,3},{0,4},{0,2},{0,1},{0,5},{0,7},{0,6},{0,10},{0,11},{0,8},{0,9},{0,12},{0,13},{0,14},{0,22},{0,18},{0,15},{0,19},{0,20},
    2326     {0,17},{0,16},{1,3},{1,4},{0,21},{1,0},{1,2},{1,1},{1,5},{1,10},{1,6},{1,7},{1,11},{1,9},{1,12},{1,14},{1,13},{1,8},{1,22},{1,17},{1,18},
    2327     {1,20},{1,15},{1,16},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2328     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2329     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{1,19},{1,21},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2330     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2331     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2332   },
    2333  
    2334   {
    2335     {0,24},{0,0},{0,5},{0,6},{0,1},{0,4},{0,3},{0,7},{0,2},{0,8},{0,10},{0,11},{0,9},{0,12},{0,15},{0,14},{0,13},{0,23},{0,16},{0,19},{0,17},
    2336     {0,18},{0,21},{0,20},{1,0},{0,22},{1,5},{1,6},{1,1},{1,3},{1,11},{1,4},{1,10},{1,2},{1,7},{1,8},{1,9},{1,12},{1,14},{1,18},{1,13},{1,21},
    2337     {1,15},{1,19},{1,23},{1,16},{1,20},{1,17},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2338     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2339     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{1,22},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2340     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2341     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2342   },
    2343   {
    2344     {0,0},{0,25},{0,7},{0,1},{0,8},{0,6},{0,5},{0,2},{0,9},{0,10},{0,4},{0,11},{0,3},{0,12},{1,0},{0,17},{0,16},{0,13},{0,24},{0,18},{0,19},
    2345     {0,15},{0,20},{0,23},{0,14},{0,21},{0,22},{1,7},{1,1},{1,9},{1,8},{1,6},{1,10},{1,4},{1,2},{1,5},{1,3},{1,11},{1,14},{1,16},{1,12},{1,21},
    2346     {1,22},{1,24},{1,15},{1,20},{1,13},{1,17},{1,18},{1,19},{1,23},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2347     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2348     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2349     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2350     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2351   },
    2352   {
    2353     {0,0},{0,26},{0,1},{0,9},{0,10},{0,2},{0,8},{0,11},{0,7},{0,3},{0,6},{0,5},{0,12},{0,4},{0,19},{0,13},{0,18},{1,0},{0,20},{0,14},{0,17},
    2354     {0,25},{0,21},{0,16},{0,23},{0,24},{0,15},{0,22},{1,1},{1,10},{1,9},{1,2},{1,11},{1,8},{1,7},{1,4},{1,3},{1,6},{1,12},{1,5},{1,20},{1,19},
    2355     {1,25},{1,13},{1,18},{1,16},{1,17},{1,24},{1,22},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2356     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2357     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{1,14},{1,15},{1,21},{1,23},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2358     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2359     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2360   },
    2361   {
    2362     {0,27},{0,0},{0,1},{0,11},{0,2},{0,10},{0,12},{0,3},{0,9},{0,7},{0,8},{0,4},{0,6},{0,20},{0,13},{0,5},{0,14},{0,26},{1,0},{0,21},{0,19},
    2363     {0,18},{0,25},{0,15},{0,16},{0,17},{0,24},{0,22},{0,23},{1,1},{1,11},{1,2},{1,12},{1,3},{1,10},{1,6},{1,5},{1,20},{1,7},{1,4},{1,9},{1,8},
    2364     {1,18},{1,13},{1,21},{1,25},{1,26},{1,23},{1,14},{1,17},{1,19},{1,22},{1,24},{1,15},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2365     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2366     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{1,16},{M1,M1},{M1,M1},{M1,M1},
    2367     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2368     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2369   },
    2370  
    2371   {
    2372     {0,0},{0,28},{0,1},{0,2},{0,12},{0,3},{1,0},{0,4},{0,11},{0,13},{0,9},{0,5},{0,8},{0,10},{0,7},{0,6},{0,21},{0,14},{0,27},{0,15},{0,22},
    2373     {0,19},{0,16},{0,20},{0,17},{0,26},{0,18},{1,1},{0,25},{0,23},{0,24},{1,2},{1,12},{1,3},{1,4},{1,11},{1,13},{1,7},{1,5},{1,6},{1,8},{1,10},
    2374     {1,9},{1,22},{1,14},{1,15},{1,20},{1,23},{1,17},{1,19},{1,25},{1,26},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2375     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2376     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{1,16},{1,18},{1,21},{1,24},{1,27},{M1,M1},{M1,M1},{M1,M1},
    2377     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},
    2378     {M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1},{M1,M1}
    2379   },
    2380  
    2381   {
    2382     {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,13},{0,6},{0,10},{0,7},{0,8},{0,12},{0,11},{0,9},{0,14},{0,15},{1,0},{0,29},{0,16},{0,30},{0,17},
    2383     {0,31},{0,24},{0,32},{0,18},{0,25},{0,23},{1,1},{0,22},{0,33},{0,21},{0,19},{0,20},{0,26},{0,35},{0,42},{0,34},{0,27},{0,28},{0,41},{0,37},
    2384     {1,2},{0,39},{0,38},{0,40},{0,36},{0,43},{1,3},{0,44},{1,13},{1,4},{0,47},{1,10},{0,45},{0,46},{1,9},{1,12},{1,5},{1,6},{1,8},{1,7},{0,48},
    2385     {0,49},{1,11},{1,14},{0,53},{0,51},{0,50},{0,52},{0,57},{1,15},{0,56},{1,16},{0,54},{0,55},{1,24},{1,18},{1,17},{1,23},{1,22},{1,19},
    2386     {1,21},{0,59},{1,25},{1,20},{1,26},{0,58},{1,27},{0,61},{1,32},{0,60},{1,28},{1,30},{1,33},{0,63},{1,29},{1,34},{1,39},{0,62},{1,35},
    2387     {1,36},{1,38},{1,37},{1,41},{1,31},{1,40},{1,42},{1,43},{1,44},{1,45},{1,46},{1,47},{1,48},{1,49},{1,50},{1,51},{1,52},{1,53},{1,54},
    2388     {1,55},{1,56},{1,57},{1,58},{1,59},{1,60},{1,61},{1,62}
    2389   }
    2390 };
    2391 #endif
     391
    2392392
    2393393// Mode-Dependent DCT/DST
    2394 #if INTRA_DST_TYPE_7
    2395394const short g_as_DST_MAT_4 [4][4]=
    2396395{
     
    2400399  {55,  -84,    74,  -29},
    2401400};
     401
     402#if !LOGI_INTRA_NAME_3MPM
    2402403// Mapping each Unified Directional Intra prediction direction to DCT/DST transform
    2403404// 0 implies use DCT, 1 implies DST
    2404 #if ADD_PLANAR_MODE
    2405 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
    2406 const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+8] =
    2407 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    2408 const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+4] =
     405
     406#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     407const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+NUM_DMM_MODE] =
    2409408#else
    2410409const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE] =
    2411410#endif
    2412 #else
     411{ //0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
     412  1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
    2413413#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
    2414 const UChar g_aucDCTDSTMode_Vert[34+8] =
    2415 #elif
    2416 const UChar g_aucDCTDSTMode_Vert[34+4] =
    2417 #else
    2418 const UChar g_aucDCTDSTMode_Vert[34] =
    2419 #endif
    2420 #endif
    2421 { //0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
    2422   1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 ,0
    2423 #if ADD_PLANAR_MODE
    2424 ,1
    2425 #endif
    2426 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
    2427 ,0,0,0,0,0,0,0,0
     414  , 0, 0, 0, 0, 0, 0, 0, 0
    2428415#elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    2429 ,0,0,0,0
    2430 #endif
    2431 };
    2432 #if ADD_PLANAR_MODE
    2433 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
    2434 const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+8] =
    2435 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    2436 const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+4] =
     416  , 0, 0, 0, 0
     417#endif
     418};
     419#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     420const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+NUM_DMM_MODE] =
    2437421#else
    2438422const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE] =
    2439423#endif
    2440 #else
     424{ //0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
     425  1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0
    2441426#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
    2442 const UChar g_aucDCTDSTMode_Hor[34+8] =
    2443 #elif
    2444 const UChar g_aucDCTDSTMode_Hor[34+4] =
    2445 #else
    2446 const UChar g_aucDCTDSTMode_Hor[34] =
    2447 #endif
    2448 #endif
    2449 { //0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
    2450   0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 ,1
    2451 #if ADD_PLANAR_MODE
    2452 ,1
    2453 #endif
    2454 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
    2455 ,0,0,0,0,0,0,0,0
     427  , 0, 0, 0, 0, 0, 0, 0, 0
    2456428#elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    2457 ,0,0,0,0
    2458 #endif
    2459 };
    2460 #endif  // for INTRA_DST_TYPE_7
    2461 
     429  , 0, 0, 0, 0
     430#endif
     431};
     432#endif
    2462433
    2463434
     
    2478449};
    2479450#else // FAST_UDI_USE_MPM
    2480 #if SAMSUNG_FAST_UDI_MODESET==0
    2481451const UChar g_aucIntraModeNumFast[7] =
    2482452{
     
    2489459  4   // 128x128  33
    2490460};
    2491 #else
    2492 const UChar g_aucIntraModeNumFast[7] =
    2493 {
    2494   3,  //   2x2
    2495   9,  //   4x4
    2496   9,  //   8x8
    2497   9,  //  16x16   33
    2498   9,  //  32x32   33
    2499   5,  //  64x64   33
    2500   4   // 128x128  33
    2501 };
    2502 #endif
    2503461#endif // FAST_UDI_USE_MPM
    2504462
     
    2507465const UChar g_aucConvertTxtTypeToIdx[4] = { 0, 1, 1, 2 };
    2508466
     467#if !LOGI_INTRA_NAME_3MPM
    2509468// ====================================================================================================================
    2510469// Angular Intra prediction
     
    2514473//   Indexing this array with the mode indicated in the bitstream
    2515474//   gives a logical index used in the prediction functions.
    2516 #if ADD_PLANAR_MODE
    2517475const UChar g_aucAngIntraModeOrder[NUM_INTRA_MODE] =
    2518 #else
    2519 const UChar g_aucAngIntraModeOrder[34] =
    2520 #endif
    2521476{     //  ModeOrder LogicalOrderInPredFunctions
     477  34, //  PLANAR_IDX PLANAR PLANAR
    2522478  9,  //  0 VER     DC
    2523479  25, //  1 HOR     VER-8 (diagonal from top-left to bottom-right = HOR-8)
    2524480  0,  //  2 DC      VER-7
    2525   1,  //  3 VER-8   VER-6
    2526   5,  //  4 VER-4   VER-5
    2527   13, //  5 VER+4   VER-4
    2528   17, //  6 VER+8   VER-3
    2529   21, //  7 HOR-4   VER-2
    2530   29, //  8 HOR+4   VER-1
    2531   33, //  9 HOR+8   VER
    2532   3,  // 10 VER-6   VER+1
    2533   7,  // 11 VER-2   VER+2
    2534   11, // 12 VER+2   VER+3
    2535   15, // 13 VER+6   VER+4
    2536   19, // 14 HOR-6   VER+5
    2537   23, // 15 HOR-2   VER+6
    2538   27, // 16 HOR+2   VER+7
    2539   31, // 17 HOR+6   VER+8
    2540   2,  // 18 VER-7   HOR-7
    2541   4,  // 19 VER-5   HOR-6
    2542   6,  // 20 VER-3   HOR-5
    2543   8,  // 21 VER-1   HOR-4
    2544   10, // 22 VER+1   HOR-3
    2545   12, // 23 VER+3   HOR-2
    2546   14, // 24 VER+5   HOR-1
    2547   16, // 25 VER+7   HOR
    2548   18, // 26 HOR-7   HOR+1
    2549   20, // 27 HOR-5   HOR+2
    2550   22, // 28 HOR-3   HOR+3
    2551   24, // 29 HOR-1   HOR+4
    2552   26, // 30 HOR+1   HOR+5
    2553   28, // 31 HOR+3   HOR+6
    2554   30, // 32 HOR+5   HOR+7
    2555   32, // 33 HOR+7   HOR+8
    2556 #if ADD_PLANAR_MODE
    2557   0, // PLANAR_IDX PLANAR PLANAR (add any other mode earlier; this mode is designed to be the last in the list)
    2558 #endif
     481  1,  //  4 VER-8   VER-6
     482  5,  //  5 VER-4   VER-5
     483  13, //  6 VER+4   VER-4
     484  17, //  7 VER+8   VER-3
     485  21, //  8 HOR-4   VER-2
     486  29, //  9 HOR+4   VER-1
     487  33, // 10 HOR+8   VER
     488  3,  // 11 VER-6   VER+1
     489  7,  // 12 VER-2   VER+2
     490  11, // 13 VER+2   VER+3
     491  15, // 14 VER+6   VER+4
     492  19, // 15 HOR-6   VER+5
     493  23, // 16 HOR-2   VER+6
     494  27, // 17 HOR+2   VER+7
     495  31, // 18 HOR+6   VER+8
     496  2,  // 19 VER-7   HOR-7
     497  4,  // 20 VER-5   HOR-6
     498  6,  // 21 VER-3   HOR-5
     499  8,  // 22 VER-1   HOR-4
     500  10, // 23 VER+1   HOR-3
     501  12, // 24 VER+3   HOR-2
     502  14, // 25 VER+5   HOR-1
     503  16, // 26 VER+7   HOR
     504  18, // 27 HOR-7   HOR+1
     505  20, // 28 HOR-5   HOR+2
     506  22, // 29 HOR-3   HOR+3
     507  24, // 30 HOR-1   HOR+4
     508  26, // 31 HOR+1   HOR+5
     509  28, // 32 HOR+3   HOR+6
     510  30, // 33 HOR+5   HOR+7
     511  32, // 34 HOR+7   HOR+8
     512  0, // LM_CHROMA_IDX
    2559513};
    2560514
    2561515const UChar g_aucIntraModeNumAng[7] =
    2562516{
    2563   3,  //   2x2
    2564   17,  //   4x4
    2565   34,  //   8x8
    2566   34,  //  16x16
    2567   34,  //  32x32
    2568   3,  //  64x64
    2569   5   // 128x128
     517  4,  //   2x2
     518  18,  //   4x4
     519  35,  //   8x8
     520  35,  //  16x16
     521  35,  //  32x32
     522  35,  //  64x64
     523  6   // 128x128
    2570524};
    2571525
     
    2577531  6,  //  16x16   34   5+esc
    2578532  6,  //  32x32   34   5+esc
    2579   2,  //  64x64    3   1+1
     533  6,  //  64x64   34   5+esc
    2580534  3   // 128x128   5   2+1
    2581535};
    2582 
    2583 const UChar g_aucAngModeMapping[4][34] = // intra mode conversion for most probable
    2584 {
    2585   {2,3,2,2,4, 4,4,0,0,0, 0,0,0,0,2, 2,2,2,2,2, 2,1,1,1,1, 1,1,1,1,1, 2,2,2,2},               // conversion to 5 modes
    2586   {2,3,3,2,4, 4,4,2,0,0, 0,2,5,5,5, 2,6,6,3,2, 7,7,7,2,1, 1,1,2,8,8, 8,2,2,2},               // conversion to 9 modes
    2587   {2,3,3,10,10, 4,11,11,0,0, 0,12,12,5,5, 13,13,6,14,14, 7,7,15,15,1, 1,1,16,16,8, 8,2,2,9}, // conversion to 17 modes
    2588   {2,2,2,2,2, 2,2,0,0,0, 0,0,0,0,2, 2,2,2,2,2, 2,1,1,1,1, 1,1,1,1,1, 2,2,2,2}                // conversion to 3 modes
    2589 };
    2590 
     536#endif
     537
     538// ====================================================================================================================
     539// Bit-depth
     540// ====================================================================================================================
     541
     542UInt g_uiBitDepth     = 8;    // base bit-depth
     543UInt g_uiBitIncrement = 0;    // increments
     544UInt g_uiIBDI_MAX     = 255;  // max. value after  IBDI
     545UInt g_uiBASE_MAX     = 255;  // max. value before IBDI
     546
     547UInt g_uiPCMBitDepthLuma     = 8;    // PCM bit-depth
     548UInt g_uiPCMBitDepthChroma   = 8;    // PCM bit-depth
     549
     550// ====================================================================================================================
     551// Depth model modes
     552// ====================================================================================================================
    2591553#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     554Int g_iDeltaDCsQuantOffset = 0;
     555
    2592556const WedgeResolution g_aeWedgeResolutionList[5] =
    2593557{
     
    2618582  32,
    2619583  64,
    2620   128 
    2621 };
    2622 
    2623 double g_dDeltaDCsQuantOffset = 0.0;
    2624 #endif
    2625 
    2626 // ====================================================================================================================
    2627 // Bit-depth
    2628 // ====================================================================================================================
    2629 
    2630 UInt g_uiBitDepth     = 8;    // base bit-depth
    2631 UInt g_uiBitIncrement = 0;    // increments
    2632 UInt g_uiIBDI_MAX     = 255;  // max. value after  IBDI
    2633 UInt g_uiBASE_MAX     = 255;  // max. value before IBDI
     584  128
     585};
     586#endif
    2634587
    2635588// ====================================================================================================================
    2636589// Misc.
    2637590// ====================================================================================================================
     591
    2638592Char  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
    2639593
     
    2653607UInt* g_auiFrameScanX [ MAX_CU_DEPTH  ];
    2654608UInt* g_auiFrameScanY [ MAX_CU_DEPTH  ];
    2655 #if QC_MDCS
    2656 UInt* g_auiSigLastScan[3][ MAX_CU_DEPTH ];
    2657 #endif //QC_MDCS
    2658 
    2659 #if PCP_SIGMAP_SIMPLE_LAST
    2660 UInt g_uiCtxXYOffset[ MAX_CU_DEPTH ] =
    2661 {
    2662   15, 15, 15, 8, 3, 0, 0
    2663 };
    2664 
    2665 UInt g_uiCtxXY[ 31 ] =
    2666 {
    2667   0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10
    2668 };
    2669 #endif
    2670 
    2671 // scanning order to 8x8 context model mapping table
    2672 UInt  g_auiAntiScan8  [64];
    2673 
    2674 #if E253
     609UInt* g_auiSigLastScan[4][ MAX_CU_DEPTH ];
     610UInt *g_sigScanNSQT[ 4 ]; // scan for non-square partitions
     611UInt g_sigCGScanNSQT[ 4 ][ 16 ] =
     612{
     613  { 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
     614  { 0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 15 },
     615  { 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
     616  { 0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15 }
     617};
     618
     619#if MULTILEVEL_SIGMAP_EXT
     620const UInt g_sigLastScan8x8[ 4 ][ 4 ] =
     621{
     622  {0, 1, 2, 3},
     623  {0, 1, 2, 3},
     624  {0, 1, 2, 3},
     625  {0, 2, 1, 3}
     626};
     627UInt g_sigLastScanCG32x32[ 64 ];
     628#endif
     629
     630UInt* g_auiNonSquareSigLastScan[ 4 ];
     631
     632const UInt g_uiMinInGroup[ 10 ] = {0,1,2,3,4,6,8,12,16,24};
     633const UInt g_uiGroupIdx[ 32 ]   = {0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9};
     634#if LAST_CTX_REDUCTION
     635const UInt g_uiLastCtx[ 28 ]    =
     636{
     637  0,   1,  2,  2,                         // 4x4    4
     638  3,   4,  5,  5, 2,  2,                  // 8x8    6 
     639  6,   7,  8,  8, 9,  9, 2, 2,            // 16x16  8
     640  10, 11, 12, 12, 13, 13, 14, 14, 2, 2    // 32x32  10
     641};
     642#else
     643const UInt g_uiLastCtx[ 28 ]    =
     644{
     645  0,   1,  2,  2,                         // 4x4    4
     646  3,   4,  5,  5, 6,  6,                  // 8x8    6 
     647  7,   8,  9,  9, 10, 10, 11, 11,         // 16x16  8
     648  12, 13, 14, 14, 15, 15, 16, 16, 17, 17  // 32x32  10
     649};
     650#endif
     651
    2675652// Rice parameters for absolute transform levels
     653#if EIGHT_BITS_RICE_CODE
     654const UInt g_auiGoRiceRange[5] =
     655{
     656  7, 14, 26, 46, 78
     657};
     658
     659const UInt g_auiGoRicePrefixLen[5] =
     660{
     661  8, 7, 6, 5, 4
     662};
     663#else
    2676664const UInt g_auiGoRiceRange[4] =
    2677665{
     
    2681669const UInt g_auiGoRicePrefixLen[4] =
    2682670{
    2683   8, 10, 11, 8
    2684 };
    2685 
     671  8, 10, 10, 8
     672};
     673#endif
     674
     675#if EIGHT_BITS_RICE_CODE
     676const UInt g_aauiGoRiceUpdate[5][24] =
     677{
     678#if RESTRICT_GR1GR2FLAG_NUMBER
     679  {
     680    0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     681  },
     682  {
     683    1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     684  },
     685  {
     686    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     687  },
     688  {
     689    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     690  },
     691  {
     692    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
     693  }
     694#else
     695  {
     696    0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     697  },
     698  {
     699    1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     700  },
     701  {
     702    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     703  },
     704  {
     705    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
     706  },
     707  {
     708    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
     709  }
     710#endif
     711};
     712#else
    2686713const UInt g_aauiGoRiceUpdate[4][16] =
    2687714{
    2688   {
    2689     0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3
    2690   },
    2691   {
    2692     1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3
    2693   },
    2694   {
    2695     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3
     715#if RESTRICT_GR1GR2FLAG_NUMBER
     716  {
     717    0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
     718  },
     719  {
     720    1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
     721  },
     722  {
     723    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
     724  },
     725  {
     726    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
     727  }
     728#else 
     729  {
     730    0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3
     731  },
     732  {
     733    1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3
     734  },
     735  {
     736    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3
    2696737  },
    2697738  {
    2698739    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
    2699740  }
     741#endif
    2700742};
    2701743#endif
     
    2743785    // termination condition
    2744786    if ( c >= iWidth*iHeight ) break;
    2745   }
    2746  
    2747   // LTR_2D_CONTEXT_MAPPING
    2748   if (iWidth == 8 && iHeight == 8)
    2749   {
    2750     for( c = 0; c < iWidth*iHeight; c++)
    2751     {
    2752       g_auiAntiScan8[pBuff[c]] = c;
    2753     }
    2754   }
     787  } 
    2755788}
    2756789
    2757 #if QC_MDCS
    2758 Void initSigLastScan(UInt* pBuffZ, UInt* pBuffH, UInt* pBuffV, Int iWidth, Int iHeight, Int iDepth)
    2759 {
    2760 
    2761     memcpy(pBuffZ, g_auiFrameScanXY[iDepth], sizeof(UInt)*iWidth*iHeight);
    2762 
    2763     UInt uiCnt = 0;
     790Void initSigLastScan(UInt* pBuffZ, UInt* pBuffH, UInt* pBuffV, UInt* pBuffD, Int iWidth, Int iHeight, Int iDepth)
     791{
     792  const UInt  uiNumScanPos  = UInt( iWidth * iWidth );
     793  UInt        uiNextScanPos = 0;
     794
     795  if( iWidth < 16 )
     796  {
     797#if MULTILEVEL_SIGMAP_EXT
     798  UInt* pBuffTemp = pBuffD;
     799  if( iWidth == 8 )
     800  {
     801    pBuffTemp = g_sigLastScanCG32x32;
     802  }
     803#endif
     804  for( UInt uiScanLine = 0; uiNextScanPos < uiNumScanPos; uiScanLine++ )
     805  {
     806    int    iPrimDim  = int( uiScanLine );
     807    int    iScndDim  = 0;
     808    while( iPrimDim >= iWidth )
     809    {
     810      iScndDim++;
     811      iPrimDim--;
     812    }
     813    while( iPrimDim >= 0 && iScndDim < iWidth )
     814    {
     815#if MULTILEVEL_SIGMAP_EXT
     816      pBuffTemp[ uiNextScanPos ] = iPrimDim * iWidth + iScndDim ;
     817#else
     818      pBuffD[ uiNextScanPos ] = iPrimDim * iWidth + iScndDim ;
     819#endif
     820      uiNextScanPos++;
     821      iScndDim++;
     822      iPrimDim--;
     823    }
     824  }
     825  }
     826#if MULTILEVEL_SIGMAP_EXT
     827  if( iWidth > 4 )
     828#else
     829  else
     830#endif
     831  {
     832    UInt uiNumBlkSide = iWidth >> 2;
     833    UInt uiNumBlks    = uiNumBlkSide * uiNumBlkSide;
     834    UInt log2Blk      = g_aucConvertToBit[ uiNumBlkSide ] + 1;
     835
     836    for( UInt uiBlk = 0; uiBlk < uiNumBlks; uiBlk++ )
     837    {
     838      uiNextScanPos   = 0;
     839      UInt initBlkPos = g_auiSigLastScan[ SCAN_DIAG ][ log2Blk ][ uiBlk ];
     840#if MULTILEVEL_SIGMAP_EXT
     841      if( iWidth == 32 )
     842      {
     843        initBlkPos = g_sigLastScanCG32x32[ uiBlk ];
     844      }
     845#endif
     846      UInt offsetY    = initBlkPos / uiNumBlkSide;
     847      UInt offsetX    = initBlkPos - offsetY * uiNumBlkSide;
     848      UInt offsetD    = 4 * ( offsetX + offsetY * iWidth );
     849      UInt offsetScan = 16 * uiBlk;
     850      for( UInt uiScanLine = 0; uiNextScanPos < 16; uiScanLine++ )
     851      {
     852        int    iPrimDim  = int( uiScanLine );
     853        int    iScndDim  = 0;
     854        while( iPrimDim >= 4 )
     855        {
     856          iScndDim++;
     857          iPrimDim--;
     858        }
     859        while( iPrimDim >= 0 && iScndDim < 4 )
     860        {
     861          pBuffD[ uiNextScanPos + offsetScan ] = iPrimDim * iWidth + iScndDim + offsetD;
     862          uiNextScanPos++;
     863          iScndDim++;
     864          iPrimDim--;
     865        }
     866      }
     867    }
     868  }
     869 
     870  memcpy(pBuffZ, g_auiFrameScanXY[iDepth], sizeof(UInt)*iWidth*iHeight);
     871
     872  UInt uiCnt = 0;
     873  for(Int iY=0; iY < iHeight; iY++)
     874  {
     875    for(Int iX=0; iX < iWidth; iX++)
     876    {
     877      pBuffH[uiCnt] = iY*iWidth + iX;
     878      uiCnt ++;
     879    }
     880  }
     881
     882  uiCnt = 0;
     883  for(Int iX=0; iX < iWidth; iX++)
     884  {
    2764885    for(Int iY=0; iY < iHeight; iY++)
    2765886    {
    2766       for(Int iX=0; iX < iWidth; iX++)
     887      pBuffV[uiCnt] = iY*iWidth + iX;
     888      uiCnt ++;
     889    }
     890  }   
     891}
     892
     893Void initNonSquareSigLastScan(UInt* pBuffZ, UInt uiWidth, UInt uiHeight)
     894{
     895
     896  Int x, y, c = 0;
     897
     898  // starting point
     899  pBuffZ[ c++ ] = 0;
     900
     901  // loop
     902  if ( uiWidth > uiHeight )
     903  {
     904    x=0; y=1;
     905    while (1)
     906    {
     907      // increase loop
     908      while ( y>=0 )
    2767909      {
    2768         pBuffH[uiCnt] = iY*iWidth + iX;
    2769         uiCnt ++;
     910        if ( x >= 0 && x < uiWidth && y >= 0 && y < uiHeight )
     911        {
     912          pBuffZ[ c++ ] = x + y * uiWidth;
     913        }
     914        x++;
     915        y--;
    2770916      }
    2771     }
    2772 
    2773     uiCnt = 0;
    2774     for(Int iX=0; iX < iWidth; iX++)
    2775     {
    2776       for(Int iY=0; iY < iHeight; iY++)
     917      y=0;
     918
     919      // decrease loop
     920      while ( x>=0 )
    2777921      {
    2778         pBuffV[uiCnt] = iY*iWidth + iX;
    2779         uiCnt ++;
     922        if ( x >= 0 && x < uiWidth && y >= 0 && y < uiHeight )
     923        {
     924          pBuffZ[ c++ ] = x + y * uiWidth;
     925        }
     926        x--;
     927        y++;
    2780928      }
    2781     }
    2782    
     929      x=0;
     930
     931      // termination condition
     932      if ( c >= uiWidth * uiHeight )
     933        break;
     934    }
     935  }
     936  else
     937  {
     938    x=1; y=0;
     939    while (1)
     940    {
     941      // increase loop
     942      while ( x>=0 )
     943      {
     944        if ( x >= 0 && x < uiWidth && y >= 0 && y < uiHeight )
     945        {
     946          pBuffZ[ c++ ] = x + y * uiWidth;
     947        }
     948        x--;
     949        y++;
     950      }
     951      x=0;
     952
     953      // decrease loop
     954      while ( y>=0 )
     955      {
     956        if ( x >= 0 && x < uiWidth && y >= 0 && y < uiHeight )
     957        {
     958          pBuffZ[ c++ ] = x + y * uiWidth;
     959        }
     960        x++;
     961        y--;
     962      }
     963      y=0;
     964
     965      // termination condition
     966      if ( c >= uiWidth * uiHeight )
     967        break;
     968    }
     969  }
    2783970}
    2784 #endif //QC_MDCS
    2785 
    2786 #if CHROMA_CODEWORD_SWITCH
    2787 const UChar ChromaMapping[2][5] =
    2788 {
    2789   {0, 1, 3, 2, 4},
    2790   {0, 1, 2, 4, 3}
    2791 };
    2792 #endif
     971
     972#if SCALING_LIST
     973Int g_quantIntraDefault4x4[16] =
     974{
     975  16,16,17,21,
     976  16,17,20,25,
     977  17,20,30,41,
     978  21,25,41,70
     979};
     980Int g_quantInterDefault4x4[16] =
     981{
     982  16,16,17,21,
     983  16,17,21,24,
     984  17,21,24,36,
     985  21,24,36,57
     986};
     987
     988Int g_quantIntraDefault8x8[64] =
     989{
     990  16,16,16,16,17,18,21,24,
     991  16,16,16,16,17,19,22,25,
     992  16,16,17,18,20,22,25,29,
     993  16,16,18,21,24,27,31,36,
     994  17,17,20,24,30,35,41,47,
     995  18,19,22,27,35,44,54,65,
     996  21,22,25,31,41,54,70,88,
     997  24,25,29,36,47,65,88,115
     998};
     999
     1000Int g_quantInterDefault8x8[64] =
     1001{
     1002  16,16,16,16,17,18,20,24,
     1003  16,16,16,17,18,20,24,25,
     1004  16,16,17,18,20,24,25,28,
     1005  16,17,18,20,24,25,28,33,
     1006  17,18,20,24,25,28,33,41,
     1007  18,20,24,25,28,33,41,54,
     1008  20,24,25,28,33,41,54,71,
     1009  24,25,28,33,41,54,71,91
     1010};
     1011#else
     1012Int g_quantIntraDefault4x4[16] =
     1013{
     1014   6,13,20,28,
     1015  13,20,28,32,
     1016  20,28,32,37,
     1017  28,32,37,42
     1018};
     1019Int g_quantInterDefault4x4[16] =
     1020{
     1021  10,14,20,24,
     1022  14,20,24,27,
     1023  20,24,27,30,
     1024  24,27,30,34
     1025};
     1026
     1027Int g_quantIntraDefault8x8[64] =
     1028{
     1029   6,10,13,16,18,23,25,27,
     1030  10,11,16,18,23,25,27,29,
     1031  13,16,18,23,25,27,29,31,
     1032  16,18,23,25,27,29,31,33,
     1033  18,23,25,27,29,31,33,36,
     1034  23,25,27,29,31,33,36,38,
     1035  25,27,29,31,33,36,38,40,
     1036  27,29,31,33,36,38,40,42
     1037};
     1038
     1039Int g_quantInterDefault8x8[64] =
     1040{
     1041   9,13,15,17,19,21,22,24,
     1042  13,13,17,19,21,22,24,25,
     1043  15,17,19,21,22,24,25,27,
     1044  17,19,21,22,24,25,27,28,
     1045  19,21,22,24,25,27,28,30,
     1046  21,22,24,25,27,28,30,32,
     1047  22,24,25,27,28,30,32,33,
     1048  24,25,27,28,30,32,33,35
     1049};
     1050
     1051Int g_quantIntraDefault16x16[256] =
     1052{
     1053  16,16,16,16,16,16,16,16,17,17,18,19,21,22,24,27,
     1054  16,16,16,16,16,16,16,16,17,18,18,20,21,23,25,27,
     1055  16,16,16,16,16,16,16,17,17,18,19,20,22,23,25,28,
     1056  16,16,16,16,16,16,17,17,18,19,20,21,23,25,27,29,
     1057  16,16,16,16,17,17,18,19,20,21,22,23,25,27,29,31,
     1058  16,16,16,16,17,18,19,20,22,23,24,26,27,29,32,34,
     1059  16,16,16,17,18,19,21,23,24,25,27,29,31,33,36,39,
     1060  16,16,17,17,19,20,23,25,27,29,31,33,35,38,41,44,
     1061  17,17,17,18,20,22,24,27,30,32,35,38,41,44,47,51,
     1062  17,18,18,19,21,23,25,29,32,36,40,43,47,51,55,60,
     1063  18,18,19,20,22,24,27,31,35,40,44,49,54,59,65,70,
     1064  19,20,20,21,23,26,29,33,38,43,49,56,62,69,75,82,
     1065  21,21,22,23,25,27,31,35,41,47,54,62,70,79,88,97,
     1066  22,23,23,25,27,29,33,38,44,51,59,69,79,90,101,113,
     1067  24,25,25,27,29,32,36,41,47,55,65,75,88,101,115,130,
     1068  27,27,28,29,31,34,39,44,51,60,70,82,97,113,130,149
     1069};
     1070
     1071Int g_quantInterDefault16x16[256] =
     1072{
     1073  16,16,16,16,16,16,16,16,17,17,18,19,20,21,22,27,
     1074  16,16,16,16,16,16,16,17,17,18,19,20,21,22,27,27,
     1075  16,16,16,16,16,16,17,17,18,19,20,21,22,27,27,28,
     1076  16,16,16,16,16,17,17,18,19,20,21,22,27,27,28,29,
     1077  16,16,16,16,17,17,18,19,20,21,22,27,27,28,29,30,
     1078  16,16,16,17,17,18,19,20,21,22,27,27,28,29,30,32,
     1079  16,16,17,17,18,19,20,21,22,27,27,28,29,30,32,36,
     1080  16,17,17,18,19,20,21,22,27,27,28,29,30,32,36,40,
     1081  17,17,18,19,20,21,22,27,27,28,29,30,32,36,40,45,
     1082  17,18,19,20,21,22,27,27,28,29,30,32,36,40,45,52,
     1083  18,19,20,21,22,27,27,28,29,30,32,36,40,45,52,59,
     1084  19,20,21,22,27,27,28,29,30,32,36,40,45,52,59,68,
     1085  20,21,22,27,27,28,29,30,32,36,40,45,52,59,68,79,
     1086  21,22,27,27,28,29,30,32,36,40,45,52,59,68,79,91,
     1087  22,27,27,28,29,30,32,36,40,45,52,59,68,79,91,103,
     1088  27,27,28,29,30,32,36,40,45,52,59,68,79,91,103,117
     1089};
     1090
     1091Int g_quantIntraDefault32x32[1024] =
     1092{
     1093  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,27,28,
     1094  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,23,23,24,25,27,28,
     1095  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,18,19,20,20,21,22,23,24,25,26,27,28,
     1096  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,21,22,23,24,25,26,27,28,
     1097  16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,20,21,22,23,23,24,25,26,28,29,
     1098  16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,18,19,19,20,21,21,22,23,24,25,26,27,28,30,
     1099  16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,18,18,19,19,20,20,21,21,22,23,24,25,26,27,28,29,30,
     1100  16,16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,19,19,20,20,21,21,22,23,24,25,26,27,28,29,30,31,
     1101  16,16,16,16,16,16,16,16,17,17,17,18,18,18,19,19,20,20,21,21,22,22,23,24,25,26,27,28,29,30,31,33,
     1102  16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,20,20,21,22,22,23,23,24,25,26,27,28,29,30,31,33,34,
     1103  16,16,16,16,16,16,16,17,17,18,18,19,19,20,20,21,22,22,23,23,24,25,26,26,27,28,29,30,32,33,34,36,
     1104  16,16,16,16,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,25,26,27,28,29,30,31,32,33,35,36,38,
     1105  16,16,16,16,16,16,17,17,18,19,19,20,21,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,36,37,39,40,
     1106  16,16,16,16,16,17,17,18,18,19,20,21,22,23,24,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,41,43,
     1107  16,16,16,16,17,17,17,18,19,20,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,41,42,44,46,
     1108  16,16,17,17,17,17,18,18,19,20,21,22,23,24,26,27,28,29,31,32,33,34,35,37,38,39,41,42,44,45,47,49,
     1109  17,17,17,17,17,18,18,19,20,20,22,23,24,25,27,28,30,31,32,34,35,36,38,39,41,42,44,45,47,49,51,53,
     1110  17,17,17,17,18,18,19,19,20,21,22,23,25,26,28,29,31,33,34,36,37,39,41,42,44,45,47,49,51,53,55,57,
     1111  17,17,18,18,18,18,19,20,21,22,23,24,25,27,29,31,32,34,36,38,40,42,43,45,47,49,51,53,55,57,60,62,
     1112  18,18,18,18,19,19,20,20,21,22,23,25,26,28,30,32,34,36,38,40,42,44,46,48,51,53,55,57,60,62,65,67,
     1113  18,18,18,19,19,19,20,21,22,23,24,25,27,29,31,33,35,37,40,42,44,47,49,52,54,57,59,62,65,67,70,73,
     1114  19,19,19,19,20,20,21,21,22,23,25,26,28,30,32,34,36,39,42,44,47,50,52,55,58,61,64,67,70,73,76,79,
     1115  19,19,20,20,20,21,21,22,23,24,26,27,29,31,33,35,38,41,43,46,49,52,56,59,62,65,69,72,75,79,82,86,
     1116  20,20,20,21,21,21,22,23,24,25,26,28,30,32,34,37,39,42,45,48,52,55,59,62,66,70,74,77,81,85,89,93,
     1117  21,21,21,21,22,22,23,24,25,26,27,29,31,33,35,38,41,44,47,51,54,58,62,66,70,74,79,83,88,92,97,101,
     1118  22,22,22,22,23,23,24,25,26,27,28,30,32,34,36,39,42,45,49,53,57,61,65,70,74,79,84,89,94,99,104,110,
     1119  22,23,23,23,23,24,25,26,27,28,29,31,33,35,38,41,44,47,51,55,59,64,69,74,79,84,90,95,101,107,113,119,
     1120  23,23,24,24,24,25,26,27,28,29,30,32,34,37,39,42,45,49,53,57,62,67,72,77,83,89,95,101,108,114,121,128,
     1121  24,24,25,25,25,26,27,28,29,30,32,33,36,38,41,44,47,51,55,60,65,70,75,81,88,94,101,108,115,122,130,138,
     1122  25,25,26,26,26,27,28,29,30,31,33,35,37,39,42,45,49,53,57,62,67,73,79,85,92,99,107,114,122,131,139,148,
     1123  27,27,27,27,28,28,29,30,31,33,34,36,39,41,44,47,51,55,60,65,70,76,82,89,97,104,113,121,130,139,149,159,
     1124  28,28,28,28,29,30,30,31,33,34,36,38,40,43,46,49,53,57,62,67,73,79,86,93,101,110,119,128,138,148,159,170
     1125};
     1126
     1127Int g_quantInterDefault32x32[1024] =
     1128{
     1129  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,
     1130  16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,
     1131  16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,
     1132  16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,
     1133  16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,
     1134  16,16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,
     1135  16,16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,
     1136  16,16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,
     1137  16,16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,
     1138  16,16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,
     1139  16,16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,
     1140  16,16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,
     1141  16,16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,
     1142  16,16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,
     1143  16,16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,
     1144  16,17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,
     1145  17,17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,
     1146  17,17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,
     1147  17,18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,
     1148  18,18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,
     1149  18,19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,
     1150  19,19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,
     1151  19,20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,
     1152  20,21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,
     1153  21,22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,
     1154  22,22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,87,
     1155  22,23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,87,94,
     1156  23,24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,87,94,101,
     1157  24,25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,87,94,101,108,
     1158  25,26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,87,94,101,108,115,
     1159  26,28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,87,94,101,108,115,123,
     1160  28,28,28,28,29,30,30,31,32,33,34,35,36,38,40,42,45,48,52,56,60,64,69,74,80,87,94,101,108,115,123,131
     1161};
     1162#endif
     1163UInt g_scalingListSize   [4] = {16,64,256,1024};
     1164UInt g_scalingListSizeX  [4] = { 4, 8, 16,  32};
     1165UInt g_scalingListNum[SCALING_LIST_SIZE_NUM]={6,6,6,2};
     1166Int  g_eTTable[4] = {0,3,1,2};
    27931167
    27941168#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    2795 std::vector<std::vector<TComWedgelet> > g_aacWedgeLists;
    2796 std::vector<std::vector<TComWedgeRef> > g_aacWedgeRefLists;
     1169std::vector< std::vector<TComWedgelet> > g_aacWedgeLists;
     1170std::vector< std::vector<TComWedgeRef> > g_aacWedgeRefLists;
    27971171
    27981172Void initWedgeLists()
     
    28071181    g_aacWedgeRefLists.push_back( acWedgeRefList );
    28081182  }
    2809 
    28101183  return;
    28111184}
     
    28151188  assert( uiWidth == uiHeight );
    28161189
    2817   UChar  uhStartX = 0, uhStartY = 0, uhEndX = 0, uhEndY = 0;
    2818   Int    iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0;
     1190  UChar    uhStartX,    uhStartY,    uhEndX,    uhEndY;
     1191  Int   iStepStartX, iStepStartY, iStepEndX, iStepEndY;
     1192
    28191193  UInt uiBlockSize = 0;
    28201194  switch( eWedgeRes )
     
    28251199  }
    28261200
    2827   Bool bValid;
    28281201  TComWedgelet cTempWedgelet( uiWidth, uiHeight );
    2829   TComWedgeRef cTempWedgeRef;
    28301202  for( UInt uiOri = 0; uiOri < 6; uiOri++ )
    28311203  {
     
    28441216    {
    28451217      for( Int iL = 0; iL < uiBlockSize; iL++ )
    2846         {
     1218      {
    28471219        cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes );
    2848 
    2849         bValid = cTempWedgelet.checkNotPlain();
    2850         if( bValid )
    2851         {
    2852           for( UInt uiPos = 0; uiPos < racWedgeList.size(); uiPos++ )
    2853           {
    2854            if( !cTempWedgelet.checkNotIdentical( racWedgeList[uiPos].getPattern() ) )
    2855            {
    2856              cTempWedgeRef.setWedgeRef( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), uiPos );
    2857              racWedgeRefList.push_back( cTempWedgeRef );
    2858              bValid = false;
    2859              break;
    2860            }
    2861           }
    2862         }
    2863         if( bValid )
    2864         {
    2865           for( UInt uiPos = 0; uiPos < racWedgeList.size(); uiPos++ )
    2866           {
    2867             if( !cTempWedgelet.checkNotInvIdentical( racWedgeList[uiPos].getPattern() ) )
    2868             {
    2869               cTempWedgeRef.setWedgeRef( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), uiPos );
    2870               racWedgeRefList.push_back( cTempWedgeRef );
    2871               bValid = false;
    2872               break;
    2873             }
    2874           }
    2875         }
    2876         if( bValid )
    2877         {
    2878           racWedgeList.push_back( cTempWedgelet );
    2879         }
     1220        addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList );
    28801221      }
    28811222    }
    28821223  }
    28831224}
    2884 #endif
     1225
     1226Void addWedgeletToList( TComWedgelet cWedgelet, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList )
     1227{
     1228  Bool bValid = cWedgelet.checkNotPlain();
     1229  if( bValid )
     1230  {
     1231    for( UInt uiPos = 0; uiPos < racWedgeList.size(); uiPos++ )
     1232    {
     1233      if( cWedgelet.checkIdentical( racWedgeList[uiPos].getPattern() ) )
     1234      {
     1235        TComWedgeRef cWedgeRef;
     1236        cWedgeRef.setWedgeRef( cWedgelet.getStartX(), cWedgelet.getStartY(), cWedgelet.getEndX(), cWedgelet.getEndY(), uiPos );
     1237        racWedgeRefList.push_back( cWedgeRef );
     1238        bValid = false;
     1239        return;
     1240      }
     1241    }
     1242  }
     1243  if( bValid )
     1244  {
     1245    for( UInt uiPos = 0; uiPos < racWedgeList.size(); uiPos++ )
     1246    {
     1247      if( cWedgelet.checkInvIdentical( racWedgeList[uiPos].getPattern() ) )
     1248      {
     1249        TComWedgeRef cWedgeRef;
     1250        cWedgeRef.setWedgeRef( cWedgelet.getStartX(), cWedgelet.getStartY(), cWedgelet.getEndX(), cWedgelet.getEndY(), uiPos );
     1251        racWedgeRefList.push_back( cWedgeRef );
     1252        bValid = false;
     1253        return;
     1254      }
     1255    }
     1256  }
     1257  if( bValid )
     1258  {
     1259    racWedgeList.push_back( cWedgelet );
     1260    TComWedgeRef cWedgeRef;
     1261    cWedgeRef.setWedgeRef( cWedgelet.getStartX(), cWedgelet.getStartY(), cWedgelet.getEndX(), cWedgelet.getEndY(), (UInt)(racWedgeList.size()-1) );
     1262    racWedgeRefList.push_back( cWedgeRef );
     1263  }
     1264}
     1265#endif
     1266
     1267//! \}
Note: See TracChangeset for help on using the changeset viewer.