home *** CD-ROM | disk | FTP | other *** search
/ Dream 44 / Amiga_Dream_44.iso / Linux / Apps / xanim.tgz / xanim / xanim27064 / xa_mpg.h < prev    next >
C/C++ Source or Header  |  1997-01-26  |  18KB  |  436 lines

  1.  
  2. /*
  3.  * xa_mpg.h
  4.  *
  5.  * Copyright (C) 1995,1996,1997 by Mark Podlipec.
  6.  * All rights reserved.
  7.  *
  8.  * This software may be freely copied, modified and redistributed without
  9.  * fee for non-commerical purposes provided that this copyright notice is
  10.  * preserved intact on all copies and modified copies.
  11.  *
  12.  * There is no warranty or other guarantee of fitness of this software.
  13.  * It is provided solely "as is". The author(s) disclaim(s) all
  14.  * responsibility and liability with respect to this software's usage
  15.  * or its effect upon hardware or computer systems.
  16.  *
  17.  */
  18.  
  19.  
  20. #include "xanim.h"
  21.  
  22. /*
  23.  * Copyright (c) 1992 The Regents of the University of California.
  24.  * All rights reserved.
  25.  *
  26.  * Permission to use, copy, modify, and distribute this software and its
  27.  * documentation for any purpose, without fee, and without written agreement is
  28.  * hereby granted, provided that the above copyright notice and the following
  29.  * two paragraphs appear in all copies of this software.
  30.  *
  31.  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
  32.  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  33.  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  34.  * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35.  *
  36.  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  37.  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  38.  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  39.  * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  40.  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  41.  */
  42.  
  43.  
  44. typedef struct
  45. {
  46.   unsigned int value;       /* value for macroblock_address_increment */
  47.   int num_bits;             /* length of the Huffman code */
  48. } mb_addr_inc_entry;
  49.  
  50. /* Structure for an entry in the decoding table of macroblock_type */
  51. typedef struct
  52. {
  53.   unsigned int mb_quant;              /* macroblock_quant */
  54.   unsigned int mb_motion_forward;     /* macroblock_motion_forward */
  55.   unsigned int mb_motion_backward;    /* macroblock_motion_backward */
  56.   unsigned int mb_pattern;            /* macroblock_pattern */
  57.   unsigned int mb_intra;              /* macroblock_intra */
  58.   int num_bits;                       /* length of the Huffman code */
  59. } mb_type_entry;
  60.  
  61. /* Structures for an entry in the decoding table of coded_block_pattern */
  62. typedef struct
  63. {
  64.   unsigned int cbp;            /* coded_block_pattern */
  65.   int num_bits;                /* length of the Huffman code */
  66. } coded_block_pattern_entry;
  67.  
  68. /* Structure for an entry in the decoding table of motion vectors */
  69. typedef struct
  70. {
  71.   int code;              /* value for motion_horizontal_forward_code,
  72.                           * motion_vertical_forward_code,
  73.                           * motion_horizontal_backward_code, or
  74.                           * motion_vertical_backward_code.
  75.                           */
  76.   int num_bits;          /* length of the Huffman code */
  77. } motion_vectors_entry;
  78.  
  79. typedef struct
  80. {
  81.   unsigned int value;    /* value of dct_dc_size (luminance or chrominance) */
  82.   int num_bits;          /* length of the Huffman code */
  83. } dct_dc_size_entry;
  84.  
  85.  
  86. #define ERROR -1
  87.  
  88. coded_block_pattern_entry coded_block_pattern[512] = 
  89. { {(unsigned int)ERROR, 0}, {(unsigned int)ERROR, 0}, {39, 9}, {27, 9}, {59, 9}, {55, 9}, {47, 9}, {31, 9},
  90.     {58, 8}, {58, 8}, {54, 8}, {54, 8}, {46, 8}, {46, 8}, {30, 8}, {30, 8},
  91.     {57, 8}, {57, 8}, {53, 8}, {53, 8}, {45, 8}, {45, 8}, {29, 8}, {29, 8},
  92.     {38, 8}, {38, 8}, {26, 8}, {26, 8}, {37, 8}, {37, 8}, {25, 8}, {25, 8},
  93.     {43, 8}, {43, 8}, {23, 8}, {23, 8}, {51, 8}, {51, 8}, {15, 8}, {15, 8},
  94.     {42, 8}, {42, 8}, {22, 8}, {22, 8}, {50, 8}, {50, 8}, {14, 8}, {14, 8},
  95.     {41, 8}, {41, 8}, {21, 8}, {21, 8}, {49, 8}, {49, 8}, {13, 8}, {13, 8},
  96.     {35, 8}, {35, 8}, {19, 8}, {19, 8}, {11, 8}, {11, 8}, {7, 8}, {7, 8},
  97.     {34, 7}, {34, 7}, {34, 7}, {34, 7}, {18, 7}, {18, 7}, {18, 7}, {18, 7},
  98.     {10, 7}, {10, 7}, {10, 7}, {10, 7}, {6, 7}, {6, 7}, {6, 7}, {6, 7}, 
  99.     {33, 7}, {33, 7}, {33, 7}, {33, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, 
  100.     {9, 7}, {9, 7}, {9, 7}, {9, 7}, {5, 7}, {5, 7}, {5, 7}, {5, 7}, 
  101.     {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, 
  102.     {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, 
  103.     {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, 
  104.     {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, 
  105.     {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5},
  106.     {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5},
  107.     {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, 
  108.     {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, 
  109.     {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, 
  110.     {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, 
  111.     {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, 
  112.     {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, 
  113.     {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, 
  114.     {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, 
  115.     {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, 
  116.     {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, 
  117.     {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, 
  118.     {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, 
  119.     {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, 
  120.     {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, 
  121.     {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, 
  122.     {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, 
  123.     {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, 
  124.     {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, 
  125.     {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, 
  126.     {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, 
  127.     {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, 
  128.     {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, 
  129.     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, 
  130.     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, 
  131.     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, 
  132.     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, 
  133.     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, 
  134.     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, 
  135.     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, 
  136.     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, 
  137.     {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, 
  138.     {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, 
  139.     {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, 
  140.     {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4},
  141.     {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4},
  142.     {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, 
  143.     {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, 
  144.     {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4},
  145.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, 
  146.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, 
  147.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, 
  148.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, 
  149.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, 
  150.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, 
  151.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, 
  152.     {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}
  153. };
  154.  
  155. /* Decoding table for dct_dc_size_luminance */
  156. dct_dc_size_entry dct_dc_size_luminance[128] =
  157. {   {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  158.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  159.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  160.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  161.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  162.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  163.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  164.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  165.     {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, 
  166.     {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, 
  167.     {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, 
  168.     {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, 
  169.     {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, 
  170.     {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, 
  171.     {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, 
  172.     {6, 5}, {6, 5}, {6, 5}, {6, 5}, {7, 6}, {7, 6}, {8, 7}, {(unsigned int)ERROR, 0}
  173. };
  174.  
  175. /* Decoding table for dct_dc_size_chrominance */
  176. dct_dc_size_entry dct_dc_size_chrominance[256] =
  177. { {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  178.     {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  179.     {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  180.     {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  181.     {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  182.     {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  183.     {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  184.     {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, 
  185.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  186.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  187.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  188.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  189.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  190.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  191.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  192.     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, 
  193.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  194.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  195.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  196.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  197.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  198.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  199.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  200.     {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, 
  201.     {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, 
  202.     {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, 
  203.     {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, 
  204.     {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, 
  205.     {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, 
  206.     {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, 
  207.     {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, 
  208.     {6, 6}, {6, 6}, {6, 6}, {6, 6}, {7, 7}, {7, 7}, {8, 8}, {(unsigned int)ERROR, 0}
  209. };
  210.  
  211. /* DCT coeff tables. */
  212.  
  213. unsigned short int dct_coeff_tbl_0[256] =
  214. {
  215. 0xffff, 0xffff, 0xffff, 0xffff, 
  216. 0xffff, 0xffff, 0xffff, 0xffff, 
  217. 0xffff, 0xffff, 0xffff, 0xffff, 
  218. 0xffff, 0xffff, 0xffff, 0xffff, 
  219. 0x052f, 0x051f, 0x050f, 0x04ff, 
  220. 0x183f, 0x402f, 0x3c2f, 0x382f, 
  221. 0x342f, 0x302f, 0x2c2f, 0x7c1f, 
  222. 0x781f, 0x741f, 0x701f, 0x6c1f, 
  223. 0x028e, 0x028e, 0x027e, 0x027e, 
  224. 0x026e, 0x026e, 0x025e, 0x025e, 
  225. 0x024e, 0x024e, 0x023e, 0x023e, 
  226. 0x022e, 0x022e, 0x021e, 0x021e, 
  227. 0x020e, 0x020e, 0x04ee, 0x04ee, 
  228. 0x04de, 0x04de, 0x04ce, 0x04ce, 
  229. 0x04be, 0x04be, 0x04ae, 0x04ae, 
  230. 0x049e, 0x049e, 0x048e, 0x048e, 
  231. 0x01fd, 0x01fd, 0x01fd, 0x01fd, 
  232. 0x01ed, 0x01ed, 0x01ed, 0x01ed, 
  233. 0x01dd, 0x01dd, 0x01dd, 0x01dd, 
  234. 0x01cd, 0x01cd, 0x01cd, 0x01cd, 
  235. 0x01bd, 0x01bd, 0x01bd, 0x01bd, 
  236. 0x01ad, 0x01ad, 0x01ad, 0x01ad, 
  237. 0x019d, 0x019d, 0x019d, 0x019d, 
  238. 0x018d, 0x018d, 0x018d, 0x018d, 
  239. 0x017d, 0x017d, 0x017d, 0x017d, 
  240. 0x016d, 0x016d, 0x016d, 0x016d, 
  241. 0x015d, 0x015d, 0x015d, 0x015d, 
  242. 0x014d, 0x014d, 0x014d, 0x014d, 
  243. 0x013d, 0x013d, 0x013d, 0x013d, 
  244. 0x012d, 0x012d, 0x012d, 0x012d, 
  245. 0x011d, 0x011d, 0x011d, 0x011d, 
  246. 0x010d, 0x010d, 0x010d, 0x010d, 
  247. 0x282c, 0x282c, 0x282c, 0x282c, 
  248. 0x282c, 0x282c, 0x282c, 0x282c, 
  249. 0x242c, 0x242c, 0x242c, 0x242c, 
  250. 0x242c, 0x242c, 0x242c, 0x242c, 
  251. 0x143c, 0x143c, 0x143c, 0x143c, 
  252. 0x143c, 0x143c, 0x143c, 0x143c, 
  253. 0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, 
  254. 0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, 
  255. 0x085c, 0x085c, 0x085c, 0x085c, 
  256. 0x085c, 0x085c, 0x085c, 0x085c, 
  257. 0x047c, 0x047c, 0x047c, 0x047c, 
  258. 0x047c, 0x047c, 0x047c, 0x047c, 
  259. 0x046c, 0x046c, 0x046c, 0x046c, 
  260. 0x046c, 0x046c, 0x046c, 0x046c, 
  261. 0x00fc, 0x00fc, 0x00fc, 0x00fc, 
  262. 0x00fc, 0x00fc, 0x00fc, 0x00fc, 
  263. 0x00ec, 0x00ec, 0x00ec, 0x00ec, 
  264. 0x00ec, 0x00ec, 0x00ec, 0x00ec, 
  265. 0x00dc, 0x00dc, 0x00dc, 0x00dc, 
  266. 0x00dc, 0x00dc, 0x00dc, 0x00dc, 
  267. 0x00cc, 0x00cc, 0x00cc, 0x00cc, 
  268. 0x00cc, 0x00cc, 0x00cc, 0x00cc, 
  269. 0x681c, 0x681c, 0x681c, 0x681c, 
  270. 0x681c, 0x681c, 0x681c, 0x681c, 
  271. 0x641c, 0x641c, 0x641c, 0x641c, 
  272. 0x641c, 0x641c, 0x641c, 0x641c, 
  273. 0x601c, 0x601c, 0x601c, 0x601c, 
  274. 0x601c, 0x601c, 0x601c, 0x601c, 
  275. 0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, 
  276. 0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, 
  277. 0x581c, 0x581c, 0x581c, 0x581c, 
  278. 0x581c, 0x581c, 0x581c, 0x581c, 
  279. };
  280.  
  281. unsigned short int dct_coeff_tbl_1[16] = 
  282. {
  283. 0x00bb, 0x202b, 0x103b, 0x00ab, 
  284. 0x084b, 0x1c2b, 0x541b, 0x501b, 
  285. 0x009b, 0x4c1b, 0x481b, 0x045b, 
  286. 0x0c3b, 0x008b, 0x182b, 0x441b, 
  287. };
  288.  
  289. unsigned short int dct_coeff_tbl_2[4] =
  290. {
  291. 0x4019, 0x1429, 0x0079, 0x0839, 
  292. };
  293.  
  294. unsigned short int dct_coeff_tbl_3[4] = 
  295. {
  296. 0x0449, 0x3c19, 0x3819, 0x1029, 
  297. };
  298.  
  299. unsigned short int dct_coeff_next[256] = 
  300. {
  301. 0xffff, 0xffff, 0xffff, 0xffff, 
  302. 0xf7d5, 0xf7d5, 0xf7d5, 0xf7d5, 
  303. 0x0826, 0x0826, 0x2416, 0x2416, 
  304. 0x0046, 0x0046, 0x2016, 0x2016, 
  305. 0x1c15, 0x1c15, 0x1c15, 0x1c15, 
  306. 0x1815, 0x1815, 0x1815, 0x1815, 
  307. 0x0425, 0x0425, 0x0425, 0x0425, 
  308. 0x1415, 0x1415, 0x1415, 0x1415, 
  309. 0x3417, 0x0067, 0x3017, 0x2c17, 
  310. 0x0c27, 0x0437, 0x0057, 0x2817, 
  311. 0x0034, 0x0034, 0x0034, 0x0034, 
  312. 0x0034, 0x0034, 0x0034, 0x0034, 
  313. 0x1014, 0x1014, 0x1014, 0x1014, 
  314. 0x1014, 0x1014, 0x1014, 0x1014, 
  315. 0x0c14, 0x0c14, 0x0c14, 0x0c14, 
  316. 0x0c14, 0x0c14, 0x0c14, 0x0c14, 
  317. 0x0023, 0x0023, 0x0023, 0x0023, 
  318. 0x0023, 0x0023, 0x0023, 0x0023, 
  319. 0x0023, 0x0023, 0x0023, 0x0023, 
  320. 0x0023, 0x0023, 0x0023, 0x0023, 
  321. 0x0813, 0x0813, 0x0813, 0x0813, 
  322. 0x0813, 0x0813, 0x0813, 0x0813, 
  323. 0x0813, 0x0813, 0x0813, 0x0813, 
  324. 0x0813, 0x0813, 0x0813, 0x0813, 
  325. 0x0412, 0x0412, 0x0412, 0x0412, 
  326. 0x0412, 0x0412, 0x0412, 0x0412, 
  327. 0x0412, 0x0412, 0x0412, 0x0412, 
  328. 0x0412, 0x0412, 0x0412, 0x0412, 
  329. 0x0412, 0x0412, 0x0412, 0x0412, 
  330. 0x0412, 0x0412, 0x0412, 0x0412, 
  331. 0x0412, 0x0412, 0x0412, 0x0412, 
  332. 0x0412, 0x0412, 0x0412, 0x0412, 
  333. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  334. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  335. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  336. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  337. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  338. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  339. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  340. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  341. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  342. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  343. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  344. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  345. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  346. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  347. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  348. 0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, 
  349. 0x0011, 0x0011, 0x0011, 0x0011, 
  350. 0x0011, 0x0011, 0x0011, 0x0011, 
  351. 0x0011, 0x0011, 0x0011, 0x0011, 
  352. 0x0011, 0x0011, 0x0011, 0x0011, 
  353. 0x0011, 0x0011, 0x0011, 0x0011, 
  354. 0x0011, 0x0011, 0x0011, 0x0011, 
  355. 0x0011, 0x0011, 0x0011, 0x0011, 
  356. 0x0011, 0x0011, 0x0011, 0x0011, 
  357. 0x0011, 0x0011, 0x0011, 0x0011, 
  358. 0x0011, 0x0011, 0x0011, 0x0011, 
  359. 0x0011, 0x0011, 0x0011, 0x0011, 
  360. 0x0011, 0x0011, 0x0011, 0x0011, 
  361. 0x0011, 0x0011, 0x0011, 0x0011, 
  362. 0x0011, 0x0011, 0x0011, 0x0011, 
  363. 0x0011, 0x0011, 0x0011, 0x0011, 
  364. 0x0011, 0x0011, 0x0011, 0x0011, 
  365. };
  366.  
  367. unsigned short int dct_coeff_first[256] = 
  368. {
  369. 0xffff, 0xffff, 0xffff, 0xffff, 
  370. 0xf7d5, 0xf7d5, 0xf7d5, 0xf7d5, 
  371. 0x0826, 0x0826, 0x2416, 0x2416, 
  372. 0x0046, 0x0046, 0x2016, 0x2016, 
  373. 0x1c15, 0x1c15, 0x1c15, 0x1c15, 
  374. 0x1815, 0x1815, 0x1815, 0x1815, 
  375. 0x0425, 0x0425, 0x0425, 0x0425, 
  376. 0x1415, 0x1415, 0x1415, 0x1415, 
  377. 0x3417, 0x0067, 0x3017, 0x2c17, 
  378. 0x0c27, 0x0437, 0x0057, 0x2817, 
  379. 0x0034, 0x0034, 0x0034, 0x0034, 
  380. 0x0034, 0x0034, 0x0034, 0x0034, 
  381. 0x1014, 0x1014, 0x1014, 0x1014, 
  382. 0x1014, 0x1014, 0x1014, 0x1014, 
  383. 0x0c14, 0x0c14, 0x0c14, 0x0c14, 
  384. 0x0c14, 0x0c14, 0x0c14, 0x0c14, 
  385. 0x0023, 0x0023, 0x0023, 0x0023, 
  386. 0x0023, 0x0023, 0x0023, 0x0023, 
  387. 0x0023, 0x0023, 0x0023, 0x0023, 
  388. 0x0023, 0x0023, 0x0023, 0x0023, 
  389. 0x0813, 0x0813, 0x0813, 0x0813, 
  390. 0x0813, 0x0813, 0x0813, 0x0813, 
  391. 0x0813, 0x0813, 0x0813, 0x0813, 
  392. 0x0813, 0x0813, 0x0813, 0x0813, 
  393. 0x0412, 0x0412, 0x0412, 0x0412, 
  394. 0x0412, 0x0412, 0x0412, 0x0412, 
  395. 0x0412, 0x0412, 0x0412, 0x0412, 
  396. 0x0412, 0x0412, 0x0412, 0x0412, 
  397. 0x0412, 0x0412, 0x0412, 0x0412, 
  398. 0x0412, 0x0412, 0x0412, 0x0412, 
  399. 0x0412, 0x0412, 0x0412, 0x0412, 
  400. 0x0412, 0x0412, 0x0412, 0x0412, 
  401. 0x0010, 0x0010, 0x0010, 0x0010, 
  402. 0x0010, 0x0010, 0x0010, 0x0010, 
  403. 0x0010, 0x0010, 0x0010, 0x0010, 
  404. 0x0010, 0x0010, 0x0010, 0x0010, 
  405. 0x0010, 0x0010, 0x0010, 0x0010, 
  406. 0x0010, 0x0010, 0x0010, 0x0010, 
  407. 0x0010, 0x0010, 0x0010, 0x0010, 
  408. 0x0010, 0x0010, 0x0010, 0x0010, 
  409. 0x0010, 0x0010, 0x0010, 0x0010, 
  410. 0x0010, 0x0010, 0x0010, 0x0010, 
  411. 0x0010, 0x0010, 0x0010, 0x0010, 
  412. 0x0010, 0x0010, 0x0010, 0x0010, 
  413. 0x0010, 0x0010, 0x0010, 0x0010, 
  414. 0x0010, 0x0010, 0x0010, 0x0010, 
  415. 0x0010, 0x0010, 0x0010, 0x0010, 
  416. 0x0010, 0x0010, 0x0010, 0x0010, 
  417. 0x0010, 0x0010, 0x0010, 0x0010, 
  418. 0x0010, 0x0010, 0x0010, 0x0010, 
  419. 0x0010, 0x0010, 0x0010, 0x0010, 
  420. 0x0010, 0x0010, 0x0010, 0x0010, 
  421. 0x0010, 0x0010, 0x0010, 0x0010, 
  422. 0x0010, 0x0010, 0x0010, 0x0010, 
  423. 0x0010, 0x0010, 0x0010, 0x0010, 
  424. 0x0010, 0x0010, 0x0010, 0x0010, 
  425. 0x0010, 0x0010, 0x0010, 0x0010, 
  426. 0x0010, 0x0010, 0x0010, 0x0010, 
  427. 0x0010, 0x0010, 0x0010, 0x0010, 
  428. 0x0010, 0x0010, 0x0010, 0x0010, 
  429. 0x0010, 0x0010, 0x0010, 0x0010, 
  430. 0x0010, 0x0010, 0x0010, 0x0010, 
  431. 0x0010, 0x0010, 0x0010, 0x0010, 
  432. 0x0010, 0x0010, 0x0010, 0x0010, 
  433. };
  434.  
  435.  
  436.