comparison rv40data.h @ 5937:7b5731b088ed libavcodec

Data tables for future RV30/40 decoder
author kostya
date Sat, 24 Nov 2007 17:42:16 +0000
parents
children 337a95c66190
comparison
equal deleted inserted replaced
5936:1f3008bae163 5937:7b5731b088ed
1 /*
2 * RealVideo 4 decoder
3 * copyright (c) 2007 Konstantin Shishkov
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 /**
23 * @file rv40data.h
24 * Miscellaneous RV40 tables.
25 */
26
27 #ifndef FFMPEG_RV40DATA_H
28 #define FFMPEG_RV40DATA_H
29
30 #include <stdint.h>
31
32 /**
33 * Standard widths and heights coded in RV40
34 */
35 //@{
36 static const int rv40_standard_widths[] = { 160, 172, 240, 320, 352, 640, 704, 0};
37 static const int rv40_standard_heights[] = { 120, 132, 144, 240, 288, 480, 0, 0};
38 static const int rv40_standard_heights2[] = { 180, 360, 576, 0};
39 //@}
40
41 #define MODE2_PATTERNS_NUM 20
42 /**
43 * Intra types table
44 *
45 * These values are actually coded 3-tuples
46 * used for detecting standard block configurations
47 */
48 static const uint16_t rv40_aic_table_index[MODE2_PATTERNS_NUM] = {
49 0x000, 0x100, 0x200,
50 0x011, 0x111, 0x211, 0x511, 0x611,
51 0x022, 0x122, 0x222, 0x722,
52 0x272, 0x227,
53 0x822, 0x282, 0x228,
54 0x112, 0x116, 0x221
55 };
56
57 /**
58 * Luma quantizer values
59 * Second table is used for inter blocks
60 */
61 static const uint8_t rv40_luma_dc_quant[2][32] = {
62 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
63 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 22, 22, 22, 22 },
64 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
65 16, 17, 18, 19, 20, 20, 21, 21, 22, 23, 23, 23, 24, 24, 24, 24 }
66 };
67
68 /**
69 * @begingroup loopfilter coefficients used by RV40 loop filter
70 * @{
71 */
72 /**
73 * Dither values for deblocking filter - left/top values
74 */
75 static const uint8_t rv40_dither_l[16] = {
76 0x40, 0x50, 0x20, 0x60, 0x30, 0x50, 0x40, 0x30,
77 0x50, 0x40, 0x50, 0x30, 0x60, 0x20, 0x50, 0x40
78 };
79 /**
80 * Dither values for deblocking filter - right/bottom values
81 */
82 static const uint8_t rv40_dither_r[16] = {
83 0x40, 0x30, 0x60, 0x20, 0x50, 0x30, 0x30, 0x40,
84 0x40, 0x40, 0x50, 0x30, 0x20, 0x60, 0x30, 0x40
85 };
86
87 /** alpha parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
88 static const uint8_t rv40_alpha_tab[32] = {
89 128, 128, 128, 128, 128, 128, 128, 128,
90 128, 128, 122, 96, 75, 59, 47, 37,
91 29, 23, 18, 15, 13, 11, 10, 9,
92 8, 7, 6, 5, 4, 3, 2, 1
93 };
94 /** beta parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
95 static const uint8_t rv40_beta_tab[32] = {
96 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 4, 4, 4, 6, 6,
97 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 15, 16, 17
98 };
99 /** clip table for RV40 loop filter - the same as in JVT-A003r1 */
100 static const uint8_t rv40_filter_clip_tbl[3][32] = {
101 {
102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
104 },
105 {
106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
107 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5
108 },
109 {
110 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
111 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 7, 8, 9
112 }
113 };
114 /** @} */ // end loopfilter group
115
116 #endif /* FFMPEG_RV40DATA_H */