mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-08-21 16:55:05 +02:00
249 lines
12 KiB
C
249 lines
12 KiB
C
/*
|
|
* LucasArts Smush video decoder
|
|
* Copyright (c) 2006 Cyril Zorin
|
|
*
|
|
* This file is part of FFmpeg.
|
|
*
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef AVCODEC_SANM_DATA_H
|
|
#define AVCODEC_SANM_DATA_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#define GLYPH_COORD_VECT_SIZE 16
|
|
|
|
static const int8_t glyph4_x[GLYPH_COORD_VECT_SIZE] =
|
|
{ 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 2, 1 };
|
|
static const int8_t glyph4_y[GLYPH_COORD_VECT_SIZE] =
|
|
{ 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 2, 1, 1, 1, 2, 2 };
|
|
static const int8_t glyph8_x[GLYPH_COORD_VECT_SIZE] =
|
|
{ 0, 2, 5, 7, 7, 7, 7, 7, 7, 5, 2, 0, 0, 0, 0, 0 };
|
|
static const int8_t glyph8_y[GLYPH_COORD_VECT_SIZE] =
|
|
{ 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1 };
|
|
|
|
static const int8_t motion_vectors[256][2] =
|
|
{
|
|
{ 0, 0}, { -1, -43}, { 6, -43}, { -9, -42}, { 13, -41},
|
|
{-16, -40}, { 19, -39}, {-23, -36}, { 26, -34}, { -2, -33},
|
|
{ 4, -33}, {-29, -32}, { -9, -32}, { 11, -31}, {-16, -29},
|
|
{ 32, -29}, { 18, -28}, {-34, -26}, {-22, -25}, { -1, -25},
|
|
{ 3, -25}, { -7, -24}, { 8, -24}, { 24, -23}, { 36, -23},
|
|
{-12, -22}, { 13, -21}, {-38, -20}, { 0, -20}, {-27, -19},
|
|
{ -4, -19}, { 4, -19}, {-17, -18}, { -8, -17}, { 8, -17},
|
|
{ 18, -17}, { 28, -17}, { 39, -17}, {-12, -15}, { 12, -15},
|
|
{-21, -14}, { -1, -14}, { 1, -14}, {-41, -13}, { -5, -13},
|
|
{ 5, -13}, { 21, -13}, {-31, -12}, {-15, -11}, { -8, -11},
|
|
{ 8, -11}, { 15, -11}, { -2, -10}, { 1, -10}, { 31, -10},
|
|
{-23, -9}, {-11, -9}, { -5, -9}, { 4, -9}, { 11, -9},
|
|
{ 42, -9}, { 6, -8}, { 24, -8}, {-18, -7}, { -7, -7},
|
|
{ -3, -7}, { -1, -7}, { 2, -7}, { 18, -7}, {-43, -6},
|
|
{-13, -6}, { -4, -6}, { 4, -6}, { 8, -6}, {-33, -5},
|
|
{ -9, -5}, { -2, -5}, { 0, -5}, { 2, -5}, { 5, -5},
|
|
{ 13, -5}, {-25, -4}, { -6, -4}, { -3, -4}, { 3, -4},
|
|
{ 9, -4}, {-19, -3}, { -7, -3}, { -4, -3}, { -2, -3},
|
|
{ -1, -3}, { 0, -3}, { 1, -3}, { 2, -3}, { 4, -3},
|
|
{ 6, -3}, { 33, -3}, {-14, -2}, {-10, -2}, { -5, -2},
|
|
{ -3, -2}, { -2, -2}, { -1, -2}, { 0, -2}, { 1, -2},
|
|
{ 2, -2}, { 3, -2}, { 5, -2}, { 7, -2}, { 14, -2},
|
|
{ 19, -2}, { 25, -2}, { 43, -2}, { -7, -1}, { -3, -1},
|
|
{ -2, -1}, { -1, -1}, { 0, -1}, { 1, -1}, { 2, -1},
|
|
{ 3, -1}, { 10, -1}, { -5, 0}, { -3, 0}, { -2, 0},
|
|
{ -1, 0}, { 1, 0}, { 2, 0}, { 3, 0}, { 5, 0},
|
|
{ 7, 0}, {-10, 1}, { -7, 1}, { -3, 1}, { -2, 1},
|
|
{ -1, 1}, { 0, 1}, { 1, 1}, { 2, 1}, { 3, 1},
|
|
{-43, 2}, {-25, 2}, {-19, 2}, {-14, 2}, { -5, 2},
|
|
{ -3, 2}, { -2, 2}, { -1, 2}, { 0, 2}, { 1, 2},
|
|
{ 2, 2}, { 3, 2}, { 5, 2}, { 7, 2}, { 10, 2},
|
|
{ 14, 2}, {-33, 3}, { -6, 3}, { -4, 3}, { -2, 3},
|
|
{ -1, 3}, { 0, 3}, { 1, 3}, { 2, 3}, { 4, 3},
|
|
{ 19, 3}, { -9, 4}, { -3, 4}, { 3, 4}, { 7, 4},
|
|
{ 25, 4}, {-13, 5}, { -5, 5}, { -2, 5}, { 0, 5},
|
|
{ 2, 5}, { 5, 5}, { 9, 5}, { 33, 5}, { -8, 6},
|
|
{ -4, 6}, { 4, 6}, { 13, 6}, { 43, 6}, {-18, 7},
|
|
{ -2, 7}, { 0, 7}, { 2, 7}, { 7, 7}, { 18, 7},
|
|
{-24, 8}, { -6, 8}, {-42, 9}, {-11, 9}, { -4, 9},
|
|
{ 5, 9}, { 11, 9}, { 23, 9}, {-31, 10}, { -1, 10},
|
|
{ 2, 10}, {-15, 11}, { -8, 11}, { 8, 11}, { 15, 11},
|
|
{ 31, 12}, {-21, 13}, { -5, 13}, { 5, 13}, { 41, 13},
|
|
{ -1, 14}, { 1, 14}, { 21, 14}, {-12, 15}, { 12, 15},
|
|
{-39, 17}, {-28, 17}, {-18, 17}, { -8, 17}, { 8, 17},
|
|
{ 17, 18}, { -4, 19}, { 0, 19}, { 4, 19}, { 27, 19},
|
|
{ 38, 20}, {-13, 21}, { 12, 22}, {-36, 23}, {-24, 23},
|
|
{ -8, 24}, { 7, 24}, { -3, 25}, { 1, 25}, { 22, 25},
|
|
{ 34, 26}, {-18, 28}, {-32, 29}, { 16, 29}, {-11, 31},
|
|
{ 9, 32}, { 29, 32}, { -4, 33}, { 2, 33}, {-26, 34},
|
|
{ 23, 36}, {-19, 39}, { 16, 40}, {-13, 41}, { 9, 42},
|
|
{ -6, 43}, { 1, 43}, { 0, 0}, { 0, 0}, { 0, 0},
|
|
};
|
|
|
|
static const int8_t c37_mv[] = {
|
|
0, 0, 1, 0, 2, 0, 3, 0, 5, 0,
|
|
8, 0, 13, 0, 21, 0, -1, 0, -2, 0,
|
|
-3, 0, -5, 0, -8, 0, -13, 0, -17, 0,
|
|
-21, 0, 0, 1, 1, 1, 2, 1, 3, 1,
|
|
5, 1, 8, 1, 13, 1, 21, 1, -1, 1,
|
|
-2, 1, -3, 1, -5, 1, -8, 1, -13, 1,
|
|
-17, 1, -21, 1, 0, 2, 1, 2, 2, 2,
|
|
3, 2, 5, 2, 8, 2, 13, 2, 21, 2,
|
|
-1, 2, -2, 2, -3, 2, -5, 2, -8, 2,
|
|
-13, 2, -17, 2, -21, 2, 0, 3, 1, 3,
|
|
2, 3, 3, 3, 5, 3, 8, 3, 13, 3,
|
|
21, 3, -1, 3, -2, 3, -3, 3, -5, 3,
|
|
-8, 3, -13, 3, -17, 3, -21, 3, 0, 5,
|
|
1, 5, 2, 5, 3, 5, 5, 5, 8, 5,
|
|
13, 5, 21, 5, -1, 5, -2, 5, -3, 5,
|
|
-5, 5, -8, 5, -13, 5, -17, 5, -21, 5,
|
|
0, 8, 1, 8, 2, 8, 3, 8, 5, 8,
|
|
8, 8, 13, 8, 21, 8, -1, 8, -2, 8,
|
|
-3, 8, -5, 8, -8, 8, -13, 8, -17, 8,
|
|
-21, 8, 0, 13, 1, 13, 2, 13, 3, 13,
|
|
5, 13, 8, 13, 13, 13, 21, 13, -1, 13,
|
|
-2, 13, -3, 13, -5, 13, -8, 13, -13, 13,
|
|
-17, 13, -21, 13, 0, 21, 1, 21, 2, 21,
|
|
3, 21, 5, 21, 8, 21, 13, 21, 21, 21,
|
|
-1, 21, -2, 21, -3, 21, -5, 21, -8, 21,
|
|
-13, 21, -17, 21, -21, 21, 0, -1, 1, -1,
|
|
2, -1, 3, -1, 5, -1, 8, -1, 13, -1,
|
|
21, -1, -1, -1, -2, -1, -3, -1, -5, -1,
|
|
-8, -1, -13, -1, -17, -1, -21, -1, 0, -2,
|
|
1, -2, 2, -2, 3, -2, 5, -2, 8, -2,
|
|
13, -2, 21, -2, -1, -2, -2, -2, -3, -2,
|
|
-5, -2, -8, -2, -13, -2, -17, -2, -21, -2,
|
|
0, -3, 1, -3, 2, -3, 3, -3, 5, -3,
|
|
8, -3, 13, -3, 21, -3, -1, -3, -2, -3,
|
|
-3, -3, -5, -3, -8, -3, -13, -3, -17, -3,
|
|
-21, -3, 0, -5, 1, -5, 2, -5, 3, -5,
|
|
5, -5, 8, -5, 13, -5, 21, -5, -1, -5,
|
|
-2, -5, -3, -5, -5, -5, -8, -5, -13, -5,
|
|
-17, -5, -21, -5, 0, -8, 1, -8, 2, -8,
|
|
3, -8, 5, -8, 8, -8, 13, -8, 21, -8,
|
|
-1, -8, -2, -8, -3, -8, -5, -8, -8, -8,
|
|
-13, -8, -17, -8, -21, -8, 0, -13, 1, -13,
|
|
2, -13, 3, -13, 5, -13, 8, -13, 13, -13,
|
|
21, -13, -1, -13, -2, -13, -3, -13, -5, -13,
|
|
-8, -13, -13, -13, -17, -13, -21, -13, 0, -17,
|
|
1, -17, 2, -17, 3, -17, 5, -17, 8, -17,
|
|
13, -17, 21, -17, -1, -17, -2, -17, -3, -17,
|
|
-5, -17, -8, -17, -13, -17, -17, -17, -21, -17,
|
|
0, -21, 1, -21, 2, -21, 3, -21, 5, -21,
|
|
8, -21, 13, -21, 21, -21, -1, -21, -2, -21,
|
|
-3, -21, -5, -21, -8, -21, -13, -21, -17, -21,
|
|
0, 0, -8, -29, 8, -29, -18, -25, 17, -25,
|
|
0, -23, -6, -22, 6, -22, -13, -19, 12, -19,
|
|
0, -18, 25, -18, -25, -17, -5, -17, 5, -17,
|
|
-10, -15, 10, -15, 0, -14, -4, -13, 4, -13,
|
|
19, -13, -19, -12, -8, -11, -2, -11, 0, -11,
|
|
2, -11, 8, -11, -15, -10, -4, -10, 4, -10,
|
|
15, -10, -6, -9, -1, -9, 1, -9, 6, -9,
|
|
-29, -8, -11, -8, -8, -8, -3, -8, 3, -8,
|
|
8, -8, 11, -8, 29, -8, -5, -7, -2, -7,
|
|
0, -7, 2, -7, 5, -7, -22, -6, -9, -6,
|
|
-6, -6, -3, -6, -1, -6, 1, -6, 3, -6,
|
|
6, -6, 9, -6, 22, -6, -17, -5, -7, -5,
|
|
-4, -5, -2, -5, 0, -5, 2, -5, 4, -5,
|
|
7, -5, 17, -5, -13, -4, -10, -4, -5, -4,
|
|
-3, -4, -1, -4, 0, -4, 1, -4, 3, -4,
|
|
5, -4, 10, -4, 13, -4, -8, -3, -6, -3,
|
|
-4, -3, -3, -3, -2, -3, -1, -3, 0, -3,
|
|
1, -3, 2, -3, 4, -3, 6, -3, 8, -3,
|
|
-11, -2, -7, -2, -5, -2, -3, -2, -2, -2,
|
|
-1, -2, 0, -2, 1, -2, 2, -2, 3, -2,
|
|
5, -2, 7, -2, 11, -2, -9, -1, -6, -1,
|
|
-4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
|
|
1, -1, 2, -1, 3, -1, 4, -1, 6, -1,
|
|
9, -1, -31, 0, -23, 0, -18, 0, -14, 0,
|
|
-11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
|
|
-2, 0, -1, 0, 0, -31, 1, 0, 2, 0,
|
|
3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
|
|
14, 0, 18, 0, 23, 0, 31, 0, -9, 1,
|
|
-6, 1, -4, 1, -3, 1, -2, 1, -1, 1,
|
|
0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
|
|
6, 1, 9, 1, -11, 2, -7, 2, -5, 2,
|
|
-3, 2, -2, 2, -1, 2, 0, 2, 1, 2,
|
|
2, 2, 3, 2, 5, 2, 7, 2, 11, 2,
|
|
-8, 3, -6, 3, -4, 3, -2, 3, -1, 3,
|
|
0, 3, 1, 3, 2, 3, 3, 3, 4, 3,
|
|
6, 3, 8, 3, -13, 4, -10, 4, -5, 4,
|
|
-3, 4, -1, 4, 0, 4, 1, 4, 3, 4,
|
|
5, 4, 10, 4, 13, 4, -17, 5, -7, 5,
|
|
-4, 5, -2, 5, 0, 5, 2, 5, 4, 5,
|
|
7, 5, 17, 5, -22, 6, -9, 6, -6, 6,
|
|
-3, 6, -1, 6, 1, 6, 3, 6, 6, 6,
|
|
9, 6, 22, 6, -5, 7, -2, 7, 0, 7,
|
|
2, 7, 5, 7, -29, 8, -11, 8, -8, 8,
|
|
-3, 8, 3, 8, 8, 8, 11, 8, 29, 8,
|
|
-6, 9, -1, 9, 1, 9, 6, 9, -15, 10,
|
|
-4, 10, 4, 10, 15, 10, -8, 11, -2, 11,
|
|
0, 11, 2, 11, 8, 11, 19, 12, -19, 13,
|
|
-4, 13, 4, 13, 0, 14, -10, 15, 10, 15,
|
|
-5, 17, 5, 17, 25, 17, -25, 18, 0, 18,
|
|
-12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
|
|
-17, 25, 18, 25, -8, 29, 8, 29, 0, 31,
|
|
0, 0, -6, -22, 6, -22, -13, -19, 12, -19,
|
|
0, -18, -5, -17, 5, -17, -10, -15, 10, -15,
|
|
0, -14, -4, -13, 4, -13, 19, -13, -19, -12,
|
|
-8, -11, -2, -11, 0, -11, 2, -11, 8, -11,
|
|
-15, -10, -4, -10, 4, -10, 15, -10, -6, -9,
|
|
-1, -9, 1, -9, 6, -9, -11, -8, -8, -8,
|
|
-3, -8, 0, -8, 3, -8, 8, -8, 11, -8,
|
|
-5, -7, -2, -7, 0, -7, 2, -7, 5, -7,
|
|
-22, -6, -9, -6, -6, -6, -3, -6, -1, -6,
|
|
1, -6, 3, -6, 6, -6, 9, -6, 22, -6,
|
|
-17, -5, -7, -5, -4, -5, -2, -5, -1, -5,
|
|
0, -5, 1, -5, 2, -5, 4, -5, 7, -5,
|
|
17, -5, -13, -4, -10, -4, -5, -4, -3, -4,
|
|
-2, -4, -1, -4, 0, -4, 1, -4, 2, -4,
|
|
3, -4, 5, -4, 10, -4, 13, -4, -8, -3,
|
|
-6, -3, -4, -3, -3, -3, -2, -3, -1, -3,
|
|
0, -3, 1, -3, 2, -3, 3, -3, 4, -3,
|
|
6, -3, 8, -3, -11, -2, -7, -2, -5, -2,
|
|
-4, -2, -3, -2, -2, -2, -1, -2, 0, -2,
|
|
1, -2, 2, -2, 3, -2, 4, -2, 5, -2,
|
|
7, -2, 11, -2, -9, -1, -6, -1, -5, -1,
|
|
-4, -1, -3, -1, -2, -1, -1, -1, 0, -1,
|
|
1, -1, 2, -1, 3, -1, 4, -1, 5, -1,
|
|
6, -1, 9, -1, -23, 0, -18, 0, -14, 0,
|
|
-11, 0, -7, 0, -5, 0, -4, 0, -3, 0,
|
|
-2, 0, -1, 0, 0, -23, 1, 0, 2, 0,
|
|
3, 0, 4, 0, 5, 0, 7, 0, 11, 0,
|
|
14, 0, 18, 0, 23, 0, -9, 1, -6, 1,
|
|
-5, 1, -4, 1, -3, 1, -2, 1, -1, 1,
|
|
0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
|
|
5, 1, 6, 1, 9, 1, -11, 2, -7, 2,
|
|
-5, 2, -4, 2, -3, 2, -2, 2, -1, 2,
|
|
0, 2, 1, 2, 2, 2, 3, 2, 4, 2,
|
|
5, 2, 7, 2, 11, 2, -8, 3, -6, 3,
|
|
-4, 3, -3, 3, -2, 3, -1, 3, 0, 3,
|
|
1, 3, 2, 3, 3, 3, 4, 3, 6, 3,
|
|
8, 3, -13, 4, -10, 4, -5, 4, -3, 4,
|
|
-2, 4, -1, 4, 0, 4, 1, 4, 2, 4,
|
|
3, 4, 5, 4, 10, 4, 13, 4, -17, 5,
|
|
-7, 5, -4, 5, -2, 5, -1, 5, 0, 5,
|
|
1, 5, 2, 5, 4, 5, 7, 5, 17, 5,
|
|
-22, 6, -9, 6, -6, 6, -3, 6, -1, 6,
|
|
1, 6, 3, 6, 6, 6, 9, 6, 22, 6,
|
|
-5, 7, -2, 7, 0, 7, 2, 7, 5, 7,
|
|
-11, 8, -8, 8, -3, 8, 0, 8, 3, 8,
|
|
8, 8, 11, 8, -6, 9, -1, 9, 1, 9,
|
|
6, 9, -15, 10, -4, 10, 4, 10, 15, 10,
|
|
-8, 11, -2, 11, 0, 11, 2, 11, 8, 11,
|
|
19, 12, -19, 13, -4, 13, 4, 13, 0, 14,
|
|
-10, 15, 10, 15, -5, 17, 5, 17, 0, 18,
|
|
-12, 19, 13, 19, -6, 22, 6, 22, 0, 23,
|
|
};
|
|
#endif /* AVCODEC_SANM_DATA_H */
|