2 * Duck Truemotion v1 Decoding Tables
4 * Data in this file was originally part of VpVision from On2 which is
5 * distributed under the GNU GPL. It is redistributed with ffmpeg under the
6 * GNU LGPL using the common understanding that data tables necessary for
7 * decoding algorithms are not necessarily licensable.
9 * This file is part of FFmpeg.
11 * FFmpeg is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * FFmpeg is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with FFmpeg; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 #ifndef AVCODEC_TRUEMOTION1DATA_H
26 #define AVCODEC_TRUEMOTION1DATA_H
31 /* Y delta tables, skinny and fat */
32 static const int16_t ydt1
[8] = { 0, -2, 2, -6, 6, -12, 12, -12 };
33 static const int16_t ydt2
[8] = { 0, -2, 4, -6, 8, -12, 12, -12 };
34 static const int16_t ydt3
[8] = { 4, -6, 20, -20, 46, -46, 94, -94 };
35 static const int16_t fat_ydt3
[8] = { 0, -15, 50, -50, 115, -115, 235, -235 };
36 static const int16_t ydt4
[8] = { 0, -4, 4, -16, 16, -36, 36, -80 };
37 /* NOTE: This table breaks the [+,-] pattern that the rest of the
38 * tables maintain. Is this intentional? */
39 static const int16_t fat_ydt4
[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
41 /* C delta tables, skinny and fat */
42 static const int16_t cdt1
[8] = { 0, -1, 1, -2, 3, -4, 5, -4 };
43 static const int16_t cdt2
[8] = { 0, -4, 3, -16, 20, -32, 36, -32 };
44 static const int16_t fat_cdt2
[8] = { 0, -20, 15, -80, 100, -160, 180, -160 };
45 static const int16_t cdt3
[8] = { 0, -2, 2, -8, 8, -18, 18, -40 };
47 /* all the delta tables to choose from, at all 4 delta levels */
48 static const int16_t * const ydts
[] = { ydt1
, ydt2
, ydt3
, ydt4
, NULL
};
49 static const int16_t * const fat_ydts
[] = { fat_ydt3
, fat_ydt3
, fat_ydt3
, fat_ydt4
, NULL
};
50 static const int16_t * const cdts
[] = { cdt1
, cdt1
, cdt2
, cdt3
, NULL
};
51 static const int16_t * const fat_cdts
[] = { fat_cdt2
, fat_cdt2
, fat_cdt2
, fat_ydt4
, NULL
};
53 static const uint8_t pc_tbl2
[] = {
54 0x8,0x00,0x00,0x00,0x00,
55 0x8,0x00,0x00,0x00,0x00,
56 0x8,0x10,0x00,0x00,0x00,
57 0x8,0x01,0x00,0x00,0x00,
58 0x8,0x00,0x10,0x00,0x00,
59 0x8,0x00,0x01,0x00,0x00,
60 0x8,0x00,0x00,0x10,0x00,
61 0x8,0x00,0x00,0x01,0x00,
62 0x8,0x00,0x00,0x00,0x10,
63 0x8,0x00,0x00,0x00,0x01,
312 static const uint8_t pc_tbl3
[] = {
571 static const uint8_t pc_tbl4
[] = {
572 0x8,0x00,0x00,0x00,0x00,
573 0x8,0x00,0x00,0x00,0x00,
574 0x8,0x20,0x00,0x00,0x00,
575 0x8,0x00,0x00,0x00,0x01,
576 0x8,0x10,0x00,0x00,0x00,
577 0x8,0x00,0x00,0x00,0x02,
578 0x8,0x01,0x00,0x00,0x00,
579 0x8,0x00,0x00,0x00,0x10,
580 0x8,0x02,0x00,0x00,0x00,
830 static const uint8_t * const tables
[] = { pc_tbl2
, pc_tbl3
, pc_tbl4
};
832 #endif /* AVCODEC_TRUEMOTION1DATA_H */