sanm_data.h
Go to the documentation of this file.
1 /*
2  * LucasArts Smush video decoder
3  * Copyright (c) 2006 Cyril Zorin
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVCODEC_SANM_DATA_H
23 #define AVCODEC_SANM_DATA_H
24 
25 #include <stdint.h>
26 
27 #define GLYPH_COORD_VECT_SIZE 16
28 
29 static const int8_t glyph4_x[GLYPH_COORD_VECT_SIZE] =
30  { 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 2, 1 };
31 static const int8_t glyph4_y[GLYPH_COORD_VECT_SIZE] =
32  { 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 2, 1, 1, 1, 2, 2 };
33 static const int8_t glyph8_x[GLYPH_COORD_VECT_SIZE] =
34  { 0, 2, 5, 7, 7, 7, 7, 7, 7, 5, 2, 0, 0, 0, 0, 0 };
35 static const int8_t glyph8_y[GLYPH_COORD_VECT_SIZE] =
36  { 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1 };
37 
38 static const int8_t motion_vectors[256][2] =
39 {
40  { 0, 0}, { -1, -43}, { 6, -43}, { -9, -42}, { 13, -41},
41  {-16, -40}, { 19, -39}, {-23, -36}, { 26, -34}, { -2, -33},
42  { 4, -33}, {-29, -32}, { -9, -32}, { 11, -31}, {-16, -29},
43  { 32, -29}, { 18, -28}, {-34, -26}, {-22, -25}, { -1, -25},
44  { 3, -25}, { -7, -24}, { 8, -24}, { 24, -23}, { 36, -23},
45  {-12, -22}, { 13, -21}, {-38, -20}, { 0, -20}, {-27, -19},
46  { -4, -19}, { 4, -19}, {-17, -18}, { -8, -17}, { 8, -17},
47  { 18, -17}, { 28, -17}, { 39, -17}, {-12, -15}, { 12, -15},
48  {-21, -14}, { -1, -14}, { 1, -14}, {-41, -13}, { -5, -13},
49  { 5, -13}, { 21, -13}, {-31, -12}, {-15, -11}, { -8, -11},
50  { 8, -11}, { 15, -11}, { -2, -10}, { 1, -10}, { 31, -10},
51  {-23, -9}, {-11, -9}, { -5, -9}, { 4, -9}, { 11, -9},
52  { 42, -9}, { 6, -8}, { 24, -8}, {-18, -7}, { -7, -7},
53  { -3, -7}, { -1, -7}, { 2, -7}, { 18, -7}, {-43, -6},
54  {-13, -6}, { -4, -6}, { 4, -6}, { 8, -6}, {-33, -5},
55  { -9, -5}, { -2, -5}, { 0, -5}, { 2, -5}, { 5, -5},
56  { 13, -5}, {-25, -4}, { -6, -4}, { -3, -4}, { 3, -4},
57  { 9, -4}, {-19, -3}, { -7, -3}, { -4, -3}, { -2, -3},
58  { -1, -3}, { 0, -3}, { 1, -3}, { 2, -3}, { 4, -3},
59  { 6, -3}, { 33, -3}, {-14, -2}, {-10, -2}, { -5, -2},
60  { -3, -2}, { -2, -2}, { -1, -2}, { 0, -2}, { 1, -2},
61  { 2, -2}, { 3, -2}, { 5, -2}, { 7, -2}, { 14, -2},
62  { 19, -2}, { 25, -2}, { 43, -2}, { -7, -1}, { -3, -1},
63  { -2, -1}, { -1, -1}, { 0, -1}, { 1, -1}, { 2, -1},
64  { 3, -1}, { 10, -1}, { -5, 0}, { -3, 0}, { -2, 0},
65  { -1, 0}, { 1, 0}, { 2, 0}, { 3, 0}, { 5, 0},
66  { 7, 0}, {-10, 1}, { -7, 1}, { -3, 1}, { -2, 1},
67  { -1, 1}, { 0, 1}, { 1, 1}, { 2, 1}, { 3, 1},
68  {-43, 2}, {-25, 2}, {-19, 2}, {-14, 2}, { -5, 2},
69  { -3, 2}, { -2, 2}, { -1, 2}, { 0, 2}, { 1, 2},
70  { 2, 2}, { 3, 2}, { 5, 2}, { 7, 2}, { 10, 2},
71  { 14, 2}, {-33, 3}, { -6, 3}, { -4, 3}, { -2, 3},
72  { -1, 3}, { 0, 3}, { 1, 3}, { 2, 3}, { 4, 3},
73  { 19, 3}, { -9, 4}, { -3, 4}, { 3, 4}, { 7, 4},
74  { 25, 4}, {-13, 5}, { -5, 5}, { -2, 5}, { 0, 5},
75  { 2, 5}, { 5, 5}, { 9, 5}, { 33, 5}, { -8, 6},
76  { -4, 6}, { 4, 6}, { 13, 6}, { 43, 6}, {-18, 7},
77  { -2, 7}, { 0, 7}, { 2, 7}, { 7, 7}, { 18, 7},
78  {-24, 8}, { -6, 8}, {-42, 9}, {-11, 9}, { -4, 9},
79  { 5, 9}, { 11, 9}, { 23, 9}, {-31, 10}, { -1, 10},
80  { 2, 10}, {-15, 11}, { -8, 11}, { 8, 11}, { 15, 11},
81  { 31, 12}, {-21, 13}, { -5, 13}, { 5, 13}, { 41, 13},
82  { -1, 14}, { 1, 14}, { 21, 14}, {-12, 15}, { 12, 15},
83  {-39, 17}, {-28, 17}, {-18, 17}, { -8, 17}, { 8, 17},
84  { 17, 18}, { -4, 19}, { 0, 19}, { 4, 19}, { 27, 19},
85  { 38, 20}, {-13, 21}, { 12, 22}, {-36, 23}, {-24, 23},
86  { -8, 24}, { 7, 24}, { -3, 25}, { 1, 25}, { 22, 25},
87  { 34, 26}, {-18, 28}, {-32, 29}, { 16, 29}, {-11, 31},
88  { 9, 32}, { 29, 32}, { -4, 33}, { 2, 33}, {-26, 34},
89  { 23, 36}, {-19, 39}, { 16, 40}, {-13, 41}, { 9, 42},
90  { -6, 43}, { 1, 43}, { 0, 0}, { 0, 0}, { 0, 0},
91 };
92 
93 static const int8_t c37_mv[] = {
94  0, 0, 1, 0, 2, 0, 3, 0, 5, 0,
95  8, 0, 13, 0, 21, 0, -1, 0, -2, 0,
96  -3, 0, -5, 0, -8, 0, -13, 0, -17, 0,
97  -21, 0, 0, 1, 1, 1, 2, 1, 3, 1,
98  5, 1, 8, 1, 13, 1, 21, 1, -1, 1,
99  -2, 1, -3, 1, -5, 1, -8, 1, -13, 1,
100  -17, 1, -21, 1, 0, 2, 1, 2, 2, 2,
101  3, 2, 5, 2, 8, 2, 13, 2, 21, 2,
102  -1, 2, -2, 2, -3, 2, -5, 2, -8, 2,
103  -13, 2, -17, 2, -21, 2, 0, 3, 1, 3,
104  2, 3, 3, 3, 5, 3, 8, 3, 13, 3,
105  21, 3, -1, 3, -2, 3, -3, 3, -5, 3,
106  -8, 3, -13, 3, -17, 3, -21, 3, 0, 5,
107  1, 5, 2, 5, 3, 5, 5, 5, 8, 5,
108  13, 5, 21, 5, -1, 5, -2, 5, -3, 5,
109  -5, 5, -8, 5, -13, 5, -17, 5, -21, 5,
110  0, 8, 1, 8, 2, 8, 3, 8, 5, 8,
111  8, 8, 13, 8, 21, 8, -1, 8, -2, 8,
112  -3, 8, -5, 8, -8, 8, -13, 8, -17, 8,
113  -21, 8, 0, 13, 1, 13, 2, 13, 3, 13,
114  5, 13, 8, 13, 13, 13, 21, 13, -1, 13,
115  -2, 13, -3, 13, -5, 13, -8, 13, -13, 13,
116  -17, 13, -21, 13, 0, 21, 1, 21, 2, 21,
117  3, 21, 5, 21, 8, 21, 13, 21, 21, 21,
118  -1, 21, -2, 21, -3, 21, -5, 21, -8, 21,
119  -13, 21, -17, 21, -21, 21, 0, -1, 1, -1,
120  2, -1, 3, -1, 5, -1, 8, -1, 13, -1,
121  21, -1, -1, -1, -2, -1, -3, -1, -5, -1,
122  -8, -1, -13, -1, -17, -1, -21, -1, 0, -2,
123  1, -2, 2, -2, 3, -2, 5, -2, 8, -2,
124  13, -2, 21, -2, -1, -2, -2, -2, -3, -2,
125  -5, -2, -8, -2, -13, -2, -17, -2, -21, -2,
126  0, -3, 1, -3, 2, -3, 3, -3, 5, -3,
127  8, -3, 13, -3, 21, -3, -1, -3, -2, -3,
128  -3, -3, -5, -3, -8, -3, -13, -3, -17, -3,
129  -21, -3, 0, -5, 1, -5, 2, -5, 3, -5,
130  5, -5, 8, -5, 13, -5, 21, -5, -1, -5,
131  -2, -5, -3, -5, -5, -5, -8, -5, -13, -5,
132  -17, -5, -21, -5, 0, -8, 1, -8, 2, -8,
133  3, -8, 5, -8, 8, -8, 13, -8, 21, -8,
134  -1, -8, -2, -8, -3, -8, -5, -8, -8, -8,
135  -13, -8, -17, -8, -21, -8, 0, -13, 1, -13,
136  2, -13, 3, -13, 5, -13, 8, -13, 13, -13,
137  21, -13, -1, -13, -2, -13, -3, -13, -5, -13,
138  -8, -13, -13, -13, -17, -13, -21, -13, 0, -17,
139  1, -17, 2, -17, 3, -17, 5, -17, 8, -17,
140  13, -17, 21, -17, -1, -17, -2, -17, -3, -17,
141  -5, -17, -8, -17, -13, -17, -17, -17, -21, -17,
142  0, -21, 1, -21, 2, -21, 3, -21, 5, -21,
143  8, -21, 13, -21, 21, -21, -1, -21, -2, -21,
144  -3, -21, -5, -21, -8, -21, -13, -21, -17, -21,
145  0, 0, -8, -29, 8, -29, -18, -25, 17, -25,
146  0, -23, -6, -22, 6, -22, -13, -19, 12, -19,
147  0, -18, 25, -18, -25, -17, -5, -17, 5, -17,
148  -10, -15, 10, -15, 0, -14, -4, -13, 4, -13,
149  19, -13, -19, -12, -8, -11, -2, -11, 0, -11,
150  2, -11, 8, -11, -15, -10, -4, -10, 4, -10,
151  15, -10, -6, -9, -1, -9, 1, -9, 6, -9,
152  -29, -8, -11, -8, -8, -8, -3, -8, 3, -8,
153  8, -8, 11, -8, 29, -8, -5, -7, -2, -7,
154  0, -7, 2, -7, 5, -7, -22, -6, -9, -6,
155  -6, -6, -3, -6, -1, -6, 1, -6, 3, -6,
156  6, -6, 9, -6, 22, -6, -17, -5, -7, -5,
157  -4, -5, -2, -5, 0, -5, 2, -5, 4, -5,
158  7, -5, 17, -5, -13, -4, -10, -4, -5, -4,
159  -3, -4, -1, -4, 0, -4, 1, -4, 3, -4,
160  5, -4, 10, -4, 13, -4, -8, -3, -6, -3,
161  -4, -3, -3, -3, -2, -3, -1, -3, 0, -3,
162  1, -3, 2, -3, 4, -3, 6, -3, 8, -3,
163  -11, -2, -7, -2, -5, -2, -3, -2, -2, -2,
164  -1, -2, 0, -2, 1, -2, 2, -2, 3, -2,
165  5, -2, 7, -2, 11, -2, -9, -1, -6, -1,
166  -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
167  1, -1, 2, -1, 3, -1, 4, -1, 6, -1,
168  9, -1, -31, 0, -23, 0, -18, 0, -14, 0,
169  -11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
170  -2, 0, -1, 0, 0, -31, 1, 0, 2, 0,
171  3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
172  14, 0, 18, 0, 23, 0, 31, 0, -9, 1,
173  -6, 1, -4, 1, -3, 1, -2, 1, -1, 1,
174  0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
175  6, 1, 9, 1, -11, 2, -7, 2, -5, 2,
176  -3, 2, -2, 2, -1, 2, 0, 2, 1, 2,
177  2, 2, 3, 2, 5, 2, 7, 2, 11, 2,
178  -8, 3, -6, 3, -4, 3, -2, 3, -1, 3,
179  0, 3, 1, 3, 2, 3, 3, 3, 4, 3,
180  6, 3, 8, 3, -13, 4, -10, 4, -5, 4,
181  -3, 4, -1, 4, 0, 4, 1, 4, 3, 4,
182  5, 4, 10, 4, 13, 4, -17, 5, -7, 5,
183  -4, 5, -2, 5, 0, 5, 2, 5, 4, 5,
184  7, 5, 17, 5, -22, 6, -9, 6, -6, 6,
185  -3, 6, -1, 6, 1, 6, 3, 6, 6, 6,
186  9, 6, 22, 6, -5, 7, -2, 7, 0, 7,
187  2, 7, 5, 7, -29, 8, -11, 8, -8, 8,
188  -3, 8, 3, 8, 8, 8, 11, 8, 29, 8,
189  -6, 9, -1, 9, 1, 9, 6, 9, -15, 10,
190  -4, 10, 4, 10, 15, 10, -8, 11, -2, 11,
191  0, 11, 2, 11, 8, 11, 19, 12, -19, 13,
192  -4, 13, 4, 13, 0, 14, -10, 15, 10, 15,
193  -5, 17, 5, 17, 25, 17, -25, 18, 0, 18,
194  -12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
195  -17, 25, 18, 25, -8, 29, 8, 29, 0, 31,
196  0, 0, -6, -22, 6, -22, -13, -19, 12, -19,
197  0, -18, -5, -17, 5, -17, -10, -15, 10, -15,
198  0, -14, -4, -13, 4, -13, 19, -13, -19, -12,
199  -8, -11, -2, -11, 0, -11, 2, -11, 8, -11,
200  -15, -10, -4, -10, 4, -10, 15, -10, -6, -9,
201  -1, -9, 1, -9, 6, -9, -11, -8, -8, -8,
202  -3, -8, 0, -8, 3, -8, 8, -8, 11, -8,
203  -5, -7, -2, -7, 0, -7, 2, -7, 5, -7,
204  -22, -6, -9, -6, -6, -6, -3, -6, -1, -6,
205  1, -6, 3, -6, 6, -6, 9, -6, 22, -6,
206  -17, -5, -7, -5, -4, -5, -2, -5, -1, -5,
207  0, -5, 1, -5, 2, -5, 4, -5, 7, -5,
208  17, -5, -13, -4, -10, -4, -5, -4, -3, -4,
209  -2, -4, -1, -4, 0, -4, 1, -4, 2, -4,
210  3, -4, 5, -4, 10, -4, 13, -4, -8, -3,
211  -6, -3, -4, -3, -3, -3, -2, -3, -1, -3,
212  0, -3, 1, -3, 2, -3, 3, -3, 4, -3,
213  6, -3, 8, -3, -11, -2, -7, -2, -5, -2,
214  -4, -2, -3, -2, -2, -2, -1, -2, 0, -2,
215  1, -2, 2, -2, 3, -2, 4, -2, 5, -2,
216  7, -2, 11, -2, -9, -1, -6, -1, -5, -1,
217  -4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
218  1, -1, 2, -1, 3, -1, 4, -1, 5, -1,
219  6, -1, 9, -1, -23, 0, -18, 0, -14, 0,
220  -11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
221  -2, 0, -1, 0, 0, -23, 1, 0, 2, 0,
222  3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
223  14, 0, 18, 0, 23, 0, -9, 1, -6, 1,
224  -5, 1, -4, 1, -3, 1, -2, 1, -1, 1,
225  0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
226  5, 1, 6, 1, 9, 1, -11, 2, -7, 2,
227  -5, 2, -4, 2, -3, 2, -2, 2, -1, 2,
228  0, 2, 1, 2, 2, 2, 3, 2, 4, 2,
229  5, 2, 7, 2, 11, 2, -8, 3, -6, 3,
230  -4, 3, -3, 3, -2, 3, -1, 3, 0, 3,
231  1, 3, 2, 3, 3, 3, 4, 3, 6, 3,
232  8, 3, -13, 4, -10, 4, -5, 4, -3, 4,
233  -2, 4, -1, 4, 0, 4, 1, 4, 2, 4,
234  3, 4, 5, 4, 10, 4, 13, 4, -17, 5,
235  -7, 5, -4, 5, -2, 5, -1, 5, 0, 5,
236  1, 5, 2, 5, 4, 5, 7, 5, 17, 5,
237  -22, 6, -9, 6, -6, 6, -3, 6, -1, 6,
238  1, 6, 3, 6, 6, 6, 9, 6, 22, 6,
239  -5, 7, -2, 7, 0, 7, 2, 7, 5, 7,
240  -11, 8, -8, 8, -3, 8, 0, 8, 3, 8,
241  8, 8, 11, 8, -6, 9, -1, 9, 1, 9,
242  6, 9, -15, 10, -4, 10, 4, 10, 15, 10,
243  -8, 11, -2, 11, 0, 11, 2, 11, 8, 11,
244  19, 12, -19, 13, -4, 13, 4, 13, 0, 14,
245  -10, 15, 10, 15, -5, 17, 5, 17, 0, 18,
246  -12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
247 };
248 #endif /* AVCODEC_SANM_DATA_H */
static const int8_t c37_mv[]
Definition: sanm_data.h:93
static const int8_t glyph4_x[GLYPH_COORD_VECT_SIZE]
Definition: sanm_data.h:29
static const int8_t glyph4_y[GLYPH_COORD_VECT_SIZE]
Definition: sanm_data.h:31
#define GLYPH_COORD_VECT_SIZE
Definition: sanm_data.h:27
static const int8_t glyph8_x[GLYPH_COORD_VECT_SIZE]
Definition: sanm_data.h:33
static const int8_t motion_vectors[256][2]
Definition: sanm_data.h:38
static const int8_t glyph8_y[GLYPH_COORD_VECT_SIZE]
Definition: sanm_data.h:35