• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavcodec/indeo4data.h

Go to the documentation of this file.
00001 /*
00002  * Indeo Video Interactive 4 compatible decoder
00003  * Copyright (c) 2009-2010 Maxim Poliakovski
00004  *
00005  * This file is part of Libav.
00006  *
00007  * Libav is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * Libav is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with Libav; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 
00027 #ifndef AVCODEC_INDEO4DATA_H
00028 #define AVCODEC_INDEO4DATA_H
00029 
00030 #include <stdint.h>
00031 #include "dsputil.h"
00032 #include "ivi_common.h"
00033 
00037 static const uint16_t ivi4_common_pic_sizes[14] = {
00038     640, 480, 320, 240, 160, 120, 704, 480, 352, 240, 352, 288, 176, 144
00039 };
00040 
00044 static const uint8_t ivi4_alternate_scan_8x8[64] = {
00045      0,  8,  1,  9, 16, 24,  2,  3, 17, 25, 10, 11, 32, 40, 48, 56,
00046      4,  5,  6,  7, 33, 41, 49, 57, 18, 19, 26, 27, 12, 13, 14, 15,
00047     34, 35, 43, 42, 50, 51, 59, 58, 20, 21, 22, 23, 31, 30, 29, 28,
00048     36, 37, 38, 39, 47, 46, 45, 44, 52, 53, 54, 55, 63, 62, 61, 60
00049 };
00050 
00051 static const uint8_t ivi4_alternate_scan_4x4[16] = {
00052     0, 1, 4, 5, 8, 12, 2, 3, 9, 13, 6, 7, 10, 11, 14, 15
00053 };
00054 
00055 static const uint8_t ivi4_vertical_scan_4x4[16] = {
00056     0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15
00057 };
00058 
00059 static const uint8_t ivi4_horizontal_scan_4x4[16] = {
00060     0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
00061 };
00062 
00063 static const uint8_t *scan_index_to_tab[15] = {
00064     // for 8x8 transforms
00065     ff_zigzag_direct,
00066     ivi4_alternate_scan_8x8,
00067     ff_ivi_horizontal_scan_8x8,
00068     ff_ivi_vertical_scan_8x8,
00069     ff_zigzag_direct,
00070 
00071     // for 4x4 transforms
00072     ff_ivi_direct_scan_4x4,
00073     ivi4_alternate_scan_4x4,
00074     ivi4_vertical_scan_4x4,
00075     ivi4_horizontal_scan_4x4,
00076     ff_ivi_direct_scan_4x4,
00077 
00078     // TODO: check if those are needed
00079     ff_ivi_horizontal_scan_8x8,
00080     ff_ivi_horizontal_scan_8x8,
00081     ff_ivi_horizontal_scan_8x8,
00082     ff_ivi_horizontal_scan_8x8,
00083     ff_ivi_horizontal_scan_8x8
00084 };
00085 
00089 static const uint16_t ivi4_quant_8x8_intra[9][64] = {
00090   {
00091       43,  342,  385,  470,  555,  555,  598,  726,
00092      342,  342,  470,  513,  555,  598,  726,  769,
00093      385,  470,  555,  555,  598,  726,  726,  811,
00094      470,  470,  555,  555,  598,  726,  769,  854,
00095      470,  555,  555,  598,  683,  726,  854, 1025,
00096      555,  555,  598,  683,  726,  854, 1025, 1153,
00097      555,  555,  598,  726,  811,  982, 1195, 1451,
00098      555,  598,  726,  811,  982, 1195, 1451, 1793
00099   },
00100   {
00101       86, 1195, 2390, 2390, 4865, 4865, 4865, 4865,
00102     1195, 1195, 2390, 2390, 4865, 4865, 4865, 4865,
00103     2390, 2390, 4865, 4865, 6827, 6827, 6827, 6827,
00104     2390, 2390, 4865, 4865, 6827, 6827, 6827, 6827,
00105     4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827,
00106     4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827,
00107     4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827,
00108     4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827
00109   },
00110   {
00111      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
00112      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
00113      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
00114      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
00115      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
00116      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
00117      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835,
00118      235, 1067, 1195, 1323, 1451, 1579, 1707, 1835
00119   },
00120   {
00121     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
00122     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
00123     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
00124     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
00125     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
00126     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
00127     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414,
00128     1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414
00129   },
00130   {
00131      897,  897,  897,  897,  897,  897,  897,  897,
00132     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
00133     1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238,
00134     1409, 1409, 1409, 1409, 1409, 1409, 1409, 1409,
00135     1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579,
00136     1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750,
00137     1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921,
00138     2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091
00139   },
00140   {
00141     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00142     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00143     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
00144     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
00145     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
00146     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
00147     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
00148     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414
00149   },
00150   {
00151     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
00152     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
00153     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
00154     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
00155     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
00156     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
00157     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390,
00158     2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390
00159   },
00160   {
00161       22,  171,  214,  257,  257,  299,  299,  342,
00162      171,  171,  257,  257,  299,  299,  342,  385,
00163      214,  257,  257,  299,  299,  342,  342,  385,
00164      257,  257,  257,  299,  299,  342,  385,  427,
00165      257,  257,  299,  299,  342,  385,  427,  513,
00166      257,  299,  299,  342,  385,  427,  513,  598,
00167      299,  299,  299,  385,  385,  470,  598,  726,
00168      299,  299,  385,  385,  470,  598,  726,  897
00169   },
00170   {
00171       86,  598, 1195, 1195, 2390, 2390, 2390, 2390,
00172      598,  598, 1195, 1195, 2390, 2390, 2390, 2390,
00173     1195, 1195, 2390, 2390, 3414, 3414, 3414, 3414,
00174     1195, 1195, 2390, 2390, 3414, 3414, 3414, 3414,
00175     2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414,
00176     2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414,
00177     2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414,
00178     2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414
00179   }
00180 };
00181 
00182 static const uint16_t ivi4_quant_8x8_inter[9][64] = {
00183   {
00184      427,  427,  470,  427,  427,  427,  470,  470,
00185      427,  427,  470,  427,  427,  427,  470,  470,
00186      470,  470,  470,  470,  470,  470,  470,  470,
00187      427,  427,  470,  470,  427,  427,  470,  470,
00188      427,  427,  470,  427,  427,  427,  470,  470,
00189      427,  427,  470,  427,  427,  427,  470,  470,
00190      470,  470,  470,  470,  470,  470,  470,  470,
00191      470,  470,  470,  470,  470,  470,  470,  470
00192   },
00193   {
00194     1707, 1707, 2433, 2433, 3414, 3414, 3414, 3414,
00195     1707, 1707, 2433, 2433, 3414, 3414, 3414, 3414,
00196     2433, 2433, 3414, 3414, 4822, 4822, 4822, 4822,
00197     2433, 2433, 3414, 3414, 4822, 4822, 4822, 4822,
00198     3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414,
00199     3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414,
00200     3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414,
00201     3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414
00202   },
00203   {
00204     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
00205     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
00206     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
00207     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
00208     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
00209     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
00210     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281,
00211     1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281
00212   },
00213   {
00214     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
00215     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
00216     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
00217     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
00218     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
00219     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
00220     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433,
00221     2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433
00222   },
00223   {
00224     1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
00225     1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
00226     1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281,
00227     1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238,
00228     1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
00229     1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
00230     1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281,
00231     1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281
00232   },
00233   {
00234     2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
00235     2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
00236     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
00237     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
00238     2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
00239     2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
00240     2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433,
00241     2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433
00242   },
00243   {
00244     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00245     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00246     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00247     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00248     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00249     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00250     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
00251     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707
00252   },
00253   {
00254       86,  171,  171,  214,  214,  214,  214,  257,
00255      171,  171,  214,  214,  214,  214,  257,  257,
00256      171,  214,  214,  214,  214,  257,  257,  257,
00257      214,  214,  214,  214,  257,  257,  257,  299,
00258      214,  214,  214,  257,  257,  257,  299,  299,
00259      214,  214,  257,  257,  257,  299,  299,  299,
00260      214,  257,  257,  257,  299,  299,  299,  342,
00261      257,  257,  257,  299,  299,  299,  342,  342
00262   },
00263   {
00264      854,  854, 1195, 1195, 1707, 1707, 1707, 1707,
00265      854,  854, 1195, 1195, 1707, 1707, 1707, 1707,
00266     1195, 1195, 1707, 1707, 2390, 2390, 2390, 2390,
00267     1195, 1195, 1707, 1707, 2390, 2390, 2390, 2390,
00268     1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707,
00269     1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707,
00270     1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707,
00271     1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707
00272   }
00273 };
00274 
00275 static const uint16_t ivi4_quant_4x4_intra[5][16] = {
00276   {
00277       22,  214,  257,  299,
00278      214,  257,  299,  342,
00279      257,  299,  342,  427,
00280      299,  342,  427,  513
00281   },
00282   {
00283      129, 1025, 1451, 1451,
00284     1025, 1025, 1451, 1451,
00285     1451, 1451, 2049, 2049,
00286     1451, 1451, 2049, 2049
00287   },
00288   {
00289       43,  171,  171,  171,
00290       43,  171,  171,  171,
00291       43,  171,  171,  171,
00292       43,  171,  171,  171
00293   },
00294   {
00295       43,   43,   43,   43,
00296      171,  171,  171,  171,
00297      171,  171,  171,  171,
00298      171,  171,  171,  171
00299   },
00300   {
00301       43,   43,   43,   43,
00302       43,   43,   43,   43,
00303       43,   43,   43,   43,
00304       43,   43,   43,   43
00305   }
00306 };
00307 
00308 static const uint16_t ivi4_quant_4x4_inter[5][16] = {
00309   {
00310      107,  214,  257,  299,
00311      214,  257,  299,  299,
00312      257,  299,  299,  342,
00313      299,  299,  342,  342
00314   },
00315   {
00316      513, 1025, 1238, 1238,
00317     1025, 1025, 1238, 1238,
00318     1238, 1238, 1451, 1451,
00319     1238, 1238, 1451, 1451
00320   },
00321   {
00322       43,  171,  171,  171,
00323       43,  171,  171,  171,
00324       43,  171,  171,  171,
00325       43,  171,  171,  171
00326   },
00327   {
00328       43,   43,   43,   43,
00329      171,  171,  171,  171,
00330      171,  171,  171,  171,
00331      171,  171,  171,  171
00332   },
00333   {
00334       43,   43,   43,   43,
00335       43,   43,   43,   43,
00336       43,   43,   43,   43,
00337       43,   43,   43,   43
00338   }
00339 };
00340 
00345 static const uint8_t quant_index_to_tab[22] = {
00346     0, 1, 0, 2, 1, 3, 0, 4, 1, 5, 0, 1, 6, 7, 8, // for 8x8 quant matrixes
00347     0, 1, 2, 2, 3, 3, 4                          // for 4x4 quant matrixes
00348 };
00349 
00350 #endif /* AVCODEC_INDEO4DATA_H */
Generated on Thu Jul 11 2013 15:38:20 for Libav by doxygen 1.7.1