ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

svq1_vlc.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program 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
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 // These tables are modified versions of the FFmpeg ones so that they
00024 // will work with our BitStream class directly.
00025 
00026 #ifndef IMAGE_CODECS_SVQ1_VLC_H
00027 #define IMAGE_CODECS_SVQ1_VLC_H
00028 
00029 #include "common/scummsys.h"
00030 
00031 namespace Image {
00032 
00033 static const byte s_svq1BlockTypeLengths[4] = {
00034     1, 2, 3, 3
00035 };
00036 
00037 static const uint32 s_svq1BlockTypeCodes[4] = {
00038     1, 1, 1, 0
00039 };
00040 
00041 static const byte s_svq1IntraMultistageLengths0[8] = {
00042     5, 1, 3, 3, 4, 4, 5, 4
00043 };
00044 
00045 static const uint32 s_svq1IntraMultistageCodes0[8] = {
00046     1, 1, 3, 2, 3, 2, 0, 1
00047 };
00048 
00049 static const byte s_svq1IntraMultistageLengths1[8] = {
00050     4, 2, 3, 3, 3, 3, 4, 3
00051 };
00052 
00053 static const uint32 s_svq1IntraMultistageCodes1[8] = {
00054     1, 3, 5, 4, 3, 2, 0, 1
00055 };
00056 
00057 static const byte s_svq1IntraMultistageLengths2[8] = {
00058     5, 1, 3, 5, 4, 3, 4, 4
00059 };
00060 
00061 static const uint32 s_svq1IntraMultistageCodes2[8] = {
00062     1, 1, 3, 0, 3, 2, 2, 1
00063 };
00064 
00065 static const byte s_svq1IntraMultistageLengths3[8] = {
00066     6, 1, 2, 6, 4, 4, 5, 4
00067 };
00068 
00069 static const uint32 s_svq1IntraMultistageCodes3[8] = {
00070     1, 1, 1, 0, 3, 2, 1, 1
00071 };
00072 
00073 static const byte s_svq1IntraMultistageLengths4[8] = {
00074     6, 1, 2, 5, 5, 6, 5, 3
00075 };
00076 
00077 static const uint32 s_svq1IntraMultistageCodes4[8] = {
00078     1, 1, 1, 3, 2, 0, 1, 1
00079 };
00080 
00081 static const byte s_svq1IntraMultistageLengths5[8] = {
00082     7, 1, 2, 3, 4, 6, 7, 5
00083 };
00084 
00085 static const uint32 s_svq1IntraMultistageCodes5[8] = {
00086     1, 1, 1, 1, 1, 1, 0, 1
00087 };
00088 
00089 static const byte *s_svq1IntraMultistageLengths[6] = {
00090     s_svq1IntraMultistageLengths0, s_svq1IntraMultistageLengths1, s_svq1IntraMultistageLengths2,
00091     s_svq1IntraMultistageLengths3, s_svq1IntraMultistageLengths4, s_svq1IntraMultistageLengths5
00092 };
00093 
00094 static const uint32 *s_svq1IntraMultistageCodes[6] = {
00095     s_svq1IntraMultistageCodes0, s_svq1IntraMultistageCodes1, s_svq1IntraMultistageCodes2,
00096     s_svq1IntraMultistageCodes3, s_svq1IntraMultistageCodes4, s_svq1IntraMultistageCodes5
00097 };
00098 
00099 static const byte s_svq1InterMultistageLengths0[8] = {
00100     2, 3, 3, 3, 3, 3, 4, 4
00101 };
00102 
00103 static const uint32 s_svq1InterMultistageCodes0[8] = {
00104     3, 5, 4, 3, 2, 1, 1, 0
00105 };
00106 
00107 static const byte s_svq1InterMultistageLengths1[8] = {
00108     2, 3, 3, 3, 3, 3, 4, 4
00109 };
00110 
00111 static const uint32 s_svq1InterMultistageCodes1[8] = {
00112     3, 5, 4, 3, 2, 1, 1, 0
00113 };
00114 
00115 static const byte s_svq1InterMultistageLengths2[8] = {
00116     1, 3, 3, 4, 4, 4, 5, 5
00117 };
00118 
00119 static const uint32 s_svq1InterMultistageCodes2[8] = {
00120     1, 3, 2, 3, 2, 1, 1, 0
00121 };
00122 
00123 static const byte s_svq1InterMultistageLengths3[8] = {
00124     1, 3, 3, 4, 4, 4, 5, 5
00125 };
00126 
00127 static const uint32 s_svq1InterMultistageCodes3[8] = {
00128     1, 3, 2, 3, 2, 1, 1, 0
00129 };
00130 
00131 static const byte s_svq1InterMultistageLengths4[8] = {
00132     1, 3, 3, 4, 4, 4, 5, 5
00133 };
00134 
00135 static const uint32 s_svq1InterMultistageCodes4[8] = {
00136     1, 3, 2, 3, 2, 1, 1, 0
00137 };
00138 
00139 static const byte s_svq1InterMultistageLengths5[8] = {
00140     1, 2, 3, 5, 5, 5, 6, 6
00141 };
00142 
00143 static const uint32 s_svq1InterMultistageCodes5[8] = {
00144     1, 1, 1, 3, 2, 1, 1, 0
00145 };
00146 
00147 static const byte *s_svq1InterMultistageLengths[6] = {
00148     s_svq1InterMultistageLengths0, s_svq1InterMultistageLengths1, s_svq1InterMultistageLengths2,
00149     s_svq1InterMultistageLengths3, s_svq1InterMultistageLengths4, s_svq1InterMultistageLengths5
00150 };
00151 
00152 static const uint32 *s_svq1InterMultistageCodes[6] = {
00153     s_svq1InterMultistageCodes0, s_svq1InterMultistageCodes1, s_svq1InterMultistageCodes2,
00154     s_svq1InterMultistageCodes3, s_svq1InterMultistageCodes4, s_svq1InterMultistageCodes5
00155 };
00156 
00157 static const byte s_svq1IntraMeanLengths[256] = {
00158     6, 7, 17, 20, 20, 20, 20, 20, 20, 19,
00159     11, 9, 11, 14, 14, 15, 16, 12, 10, 11,
00160     11, 9, 8, 8, 7, 4, 4, 6, 7, 8,
00161     8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
00162     9, 9, 9, 9, 9, 9, 9, 9, 8, 8,
00163     8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
00164     8, 8, 8, 8, 7, 8, 8, 8, 8, 8,
00165     8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
00166     8, 8, 8, 8, 8, 7, 8, 8, 7, 8,
00167     8, 8, 8, 8, 7, 8, 7, 7, 8, 7,
00168     7, 8, 7, 8, 8, 8, 7, 7, 8, 7,
00169     8, 7, 7, 7, 7, 7, 7, 7, 7, 7,
00170     7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
00171     8, 8, 8, 8, 8, 8, 8, 7, 7, 7,
00172     7, 7, 7, 7, 7, 7, 7, 7, 6, 6,
00173     7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
00174     8, 8, 8, 8, 8, 8, 8, 8, 8, 9,
00175     9, 9, 9, 9, 8, 8, 9, 9, 9, 9,
00176     9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
00177     9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
00178     9, 9, 9, 9, 10, 10, 10, 10, 10, 10,
00179     10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00180     10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00181     10, 10, 10, 11, 11, 11, 10, 11, 11, 11,
00182     11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
00183     11, 11, 11, 11, 11, 14
00184 };
00185 
00186 static const uint32 s_svq1IntraMeanCodes[256] = {
00187     55, 86, 1, 1, 2, 3, 0, 4, 5, 3,
00188     21, 66, 20, 3, 2, 1, 1, 1, 43, 24,
00189     12, 65, 120, 108, 85, 15, 14, 52, 81, 114,
00190     110, 64, 63, 62, 61, 60, 59, 58, 57, 56,
00191     55, 67, 70, 71, 69, 68, 73, 72, 74, 121,
00192     118, 119, 113, 117, 116, 115, 106, 85, 112, 111,
00193     82, 109, 76, 107, 64, 105, 104, 103, 102, 101,
00194     100, 99, 98, 97, 96, 95, 94, 93, 92, 91,
00195     90, 89, 88, 87, 86, 61, 84, 83, 63, 81,
00196     80, 79, 78, 77, 65, 75, 83, 62, 72, 79,
00197     82, 69, 80, 67, 66, 65, 66, 67, 62, 68,
00198     60, 69, 70, 71, 72, 73, 74, 75, 76, 77,
00199     78, 88, 89, 90, 91, 92, 93, 68, 73, 41,
00200     63, 61, 59, 44, 40, 37, 38, 94, 87, 84,
00201     95, 98, 99, 100, 97, 101, 103, 102, 53, 54,
00202     96, 57, 58, 56, 55, 54, 53, 52, 51, 50,
00203     49, 48, 45, 43, 42, 39, 64, 70, 71, 38,
00204     37, 36, 35, 34, 46, 47, 31, 54, 29, 33,
00205     27, 28, 25, 26, 24, 23, 22, 30, 32, 39,
00206     40, 41, 42, 43, 44, 45, 46, 47, 48, 53,
00207     49, 50, 51, 52, 25, 42, 23, 22, 21, 40,
00208     38, 37, 34, 33, 24, 20, 41, 18, 13, 14,
00209     15, 16, 17, 26, 27, 28, 29, 30, 31, 32,
00210     19, 35, 36, 9, 8, 7, 39, 5, 11, 6,
00211     4, 3, 2, 1, 10, 22, 25, 23, 13, 14,
00212     15, 16, 17, 18, 19, 1
00213 };
00214 
00215 static const byte s_svq1InterMeanLengths[512] = {
00216     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00217     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00218     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00219     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00220     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00221     22, 22, 22, 21, 22, 22, 22, 22, 22, 22,
00222     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00223     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00224     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00225     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00226     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00227     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00228     22, 22, 22, 22, 22, 22, 22, 22, 22, 21,
00229     22, 22, 22, 22, 22, 22, 20, 21, 22, 21,
00230     22, 22, 20, 22, 22, 21, 19, 18, 20, 22,
00231     22, 21, 20, 19, 20, 20, 19, 19, 19, 18,
00232     19, 18, 19, 20, 19, 19, 18, 18, 18, 19,
00233     18, 18, 18, 17, 19, 18, 18, 17, 18, 18,
00234     18, 17, 17, 17, 17, 16, 16, 16, 16, 16,
00235     16, 16, 16, 16, 15, 16, 15, 15, 15, 15,
00236     15, 15, 15, 15, 14, 14, 14, 14, 14, 14,
00237     14, 14, 14, 13, 13, 13, 13, 13, 13, 13,
00238     13, 12, 12, 12, 12, 12, 12, 11, 11, 11,
00239     11, 11, 11, 10, 10, 10, 10, 10, 10, 9,
00240     9, 9, 9, 9, 8, 8, 8, 8, 7, 7,
00241     7, 6, 6, 5, 5, 4, 1, 3, 5, 5,
00242     6, 6, 7, 7, 7, 7, 8, 8, 8, 9,
00243     9, 9, 9, 9, 10, 10, 10, 10, 11, 11,
00244     11, 11, 11, 11, 11, 12, 12, 12, 12, 12,
00245     12, 13, 13, 13, 13, 13, 13, 13, 13, 13,
00246     14, 14, 14, 14, 14, 14, 14, 14, 15, 15,
00247     15, 15, 15, 15, 15, 15, 15, 15, 16, 16,
00248     16, 16, 16, 16, 16, 16, 16, 16, 17, 17,
00249     17, 17, 17, 17, 17, 17, 18, 17, 17, 17,
00250     17, 17, 17, 17, 19, 18, 18, 19, 18, 18,
00251     19, 18, 18, 18, 19, 18, 19, 19, 18, 20,
00252     20, 19, 19, 19, 19, 19, 19, 18, 19, 20,
00253     19, 19, 21, 20, 19, 20, 19, 19, 20, 20,
00254     22, 20, 22, 22, 21, 22, 22, 21, 21, 22,
00255     22, 20, 22, 22, 21, 22, 22, 22, 20, 22,
00256     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00257     22, 22, 22, 22, 21, 21, 22, 22, 22, 21,
00258     22, 21, 22, 22, 22, 22, 22, 22, 22, 22,
00259     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00260     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00261     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00262     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00263     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00264     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00265     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00266     22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
00267     22, 22
00268 };
00269 
00270 static const uint32 s_svq1InterMeanCodes[512] = {
00271     90, 212, 213, 214, 215, 216, 217, 218, 219, 220,
00272     221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
00273     232, 203, 233, 234, 231, 236, 237, 238, 239, 240,
00274     241, 242, 243, 244, 245, 246, 247, 248, 258, 235,
00275     249, 252, 253, 254, 256, 92, 96, 257, 113, 260,
00276     261, 251, 255, 134, 250, 124, 117, 259, 120, 211,
00277     123, 130, 210, 209, 208, 207, 206, 205, 204, 195,
00278     202, 201, 200, 199, 198, 197, 139, 196, 194, 193,
00279     192, 191, 190, 189, 188, 187, 186, 185, 97, 132,
00280     133, 134, 135, 136, 137, 138, 140, 141, 142, 143,
00281     144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
00282     154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
00283     164, 165, 166, 167, 168, 169, 170, 171, 127, 143,
00284     172, 173, 174, 175, 176, 177, 83, 144, 178, 145,
00285     179, 180, 84, 181, 182, 140, 52, 61, 85, 183,
00286     184, 139, 86, 61, 87, 88, 64, 67, 71, 42,
00287     46, 44, 70, 89, 73, 45, 56, 54, 57, 69,
00288     40, 48, 53, 32, 68, 50, 49, 31, 47, 46,
00289     45, 33, 34, 35, 36, 39, 35, 32, 29, 37,
00290     30, 36, 42, 38, 33, 41, 34, 35, 36, 27,
00291     26, 29, 31, 39, 23, 24, 25, 27, 28, 30,
00292     37, 32, 33, 19, 20, 21, 22, 23, 24, 25,
00293     26, 24, 23, 21, 20, 19, 18, 15, 16, 18,
00294     19, 27, 26, 14, 19, 15, 16, 17, 18, 13,
00295     20, 21, 12, 19, 15, 14, 16, 17, 12, 9,
00296     10, 8, 9, 9, 8, 5, 1, 3, 7, 6,
00297     11, 10, 14, 15, 11, 13, 11, 13, 12, 15,
00298     16, 17, 14, 18, 23, 20, 22, 21, 25, 24,
00299     23, 22, 21, 20, 17, 25, 26, 22, 29, 27,
00300     28, 32, 28, 35, 34, 33, 31, 30, 27, 29,
00301     36, 22, 26, 34, 29, 31, 21, 35, 24, 32,
00302     41, 40, 38, 37, 25, 28, 30, 23, 44, 43,
00303     28, 33, 45, 40, 31, 27, 26, 34, 45, 50,
00304     44, 39, 49, 51, 47, 43, 55, 42, 46, 48,
00305     41, 40, 38, 37, 47, 51, 52, 48, 58, 59,
00306     49, 60, 43, 41, 72, 39, 66, 65, 38, 82,
00307     81, 63, 62, 57, 60, 59, 58, 37, 56, 80,
00308     55, 54, 135, 79, 53, 78, 51, 50, 77, 76,
00309     131, 75, 129, 128, 142, 126, 125, 132, 141, 122,
00310     121, 74, 119, 118, 137, 116, 115, 114, 73, 112,
00311     111, 110, 109, 108, 107, 106, 105, 104, 103, 102,
00312     101, 100, 99, 98, 138, 136, 95, 94, 93, 133,
00313     91, 131, 89, 88, 87, 86, 85, 84, 83, 82,
00314     81, 80, 79, 78, 77, 76, 75, 74, 73, 72,
00315     71, 70, 69, 68, 67, 66, 65, 64, 63, 62,
00316     61, 60, 59, 58, 57, 56, 55, 54, 53, 52,
00317     51, 50, 49, 48, 47, 46, 45, 44, 43, 42,
00318     41, 40, 39, 38, 37, 36, 35, 34, 33, 32,
00319     31, 30, 29, 28, 27, 26, 25, 24, 23, 22,
00320     21, 20, 19, 18, 17, 16, 15, 14, 13, 12,
00321     11, 10, 9, 8, 7, 6, 5, 4, 3, 2,
00322     1, 0
00323 };
00324 
00325 static const byte s_svq1MotionComponentLengths[33] = {
00326     1, 2, 3, 4, 6, 7, 7, 7, 9, 9,
00327     9, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00328     10, 10, 10, 10, 10, 11, 11, 11, 11, 11,
00329     11, 12, 12
00330 };
00331 
00332 static const uint32 s_svq1MotionComponentCodes[33] = {
00333     1, 1, 1, 1, 3, 5, 4, 3, 11, 10,
00334     9, 17, 16, 15, 14, 13, 12, 11, 10, 9,
00335     8, 7, 6, 5, 4, 7, 6, 5, 4, 3,
00336     2, 3, 2
00337 };
00338 
00339 } // End of namespace Image
00340 
00341 #endif


Generated on Sat Jun 22 2019 05:00:58 for ResidualVM by doxygen 1.7.1
curved edge   curved edge