FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
a64tables.h
Go to the documentation of this file.
1 /*
2  * a64 video encoder - tables used by a64 encoders
3  * Copyright (c) 2009 Tobias Bindhammer
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
24  * a64 video encoder - tables used by a64 encoders
25  */
26 
27 #ifndef AVCODEC_A64TABLES_H
28 #define AVCODEC_A64TABLES_H
29 
30 #include <stdint.h>
31 
32 /**
33  * dither patterns used vor rendering the multicolor charset
34  */
35 
36 static const uint8_t multi_dither_patterns[9][4][4] = {
37  {
38  {0, 0, 0, 0},
39  {0, 0, 0, 0},
40  {0, 0, 0, 0},
41  {0, 0, 0, 0}
42  },
43  {
44  {1, 0, 0, 0},
45  {0, 0, 0, 0},
46  {0, 0, 1, 0},
47  {0, 0, 0, 0}
48  },
49  {
50  {1, 0, 0, 0},
51  {0, 0, 1, 0},
52  {0, 1, 0, 0},
53  {0, 0, 0, 1}
54  },
55  {
56  {1, 0, 0, 0},
57  {0, 1, 0, 1},
58  {0, 0, 1, 0},
59  {0, 1, 0, 1}
60  },
61  {
62  {1, 0, 1, 0},
63  {0, 1, 0, 1},
64  {1, 0, 1, 0},
65  {0, 1, 0, 1}
66  },
67  {
68  {1, 1, 1, 0},
69  {0, 1, 0, 1},
70  {1, 0, 1, 1},
71  {0, 1, 0, 1}
72  },
73  {
74  {0, 1, 1, 1},
75  {1, 1, 0, 1},
76  {1, 0, 1, 1},
77  {1, 1, 1, 0}
78  },
79  {
80  {0, 1, 1, 1},
81  {1, 1, 1, 1},
82  {1, 1, 0, 1},
83  {1, 1, 1, 1}
84  },
85  {
86  {1, 1, 1, 1},
87  {1, 1, 1, 1},
88  {1, 1, 1, 1},
89  {1, 1, 1, 1}
90  },
91 };
92 
93 static const uint8_t interlaced_dither_patterns[9][8][4] = {
94  {
95  {0, 0, 0, 0}, {0, 0, 0, 0},
96  {0, 0, 0, 0}, {0, 0, 0, 0},
97  {0, 0, 0, 0}, {0, 0, 0, 0},
98  {0, 0, 0, 0}, {0, 0, 0, 0},
99  },
100  {
101  {1, 0, 1, 0}, {0, 0, 0, 0},
102  {0, 0, 0, 0}, {0, 0, 0, 0},
103  {1, 0, 1, 0}, {0, 0, 0, 0},
104  {0, 0, 0, 0}, {0, 0, 0, 0},
105  },
106  {
107  {1, 0, 1, 0}, {0, 0, 0, 0},
108  {0, 0, 0, 0}, {0, 1, 0, 1},
109  {1, 0, 1, 0}, {0, 0, 0, 0},
110  {0, 0, 0, 0}, {0, 1, 0, 1},
111  },
112  {
113  {1, 0, 1, 0}, {0, 1, 0, 1},
114  {0, 1, 0, 1}, {0, 0, 0, 0},
115  {1, 0, 1, 0}, {0, 1, 0, 1},
116  {0, 1, 0, 1}, {0, 0, 0, 0},
117  },
118  {
119  {1, 0, 1, 0}, {0, 1, 0, 1},
120  {0, 1, 0, 1}, {1, 0, 1, 0},
121  {1, 0, 1, 0}, {0, 1, 0, 1},
122  {0, 1, 0, 1}, {1, 0, 1, 0},
123  },
124  {
125  {1, 0, 1, 0}, {0, 1, 0, 1},
126  {1, 1, 1, 1}, {1, 0, 1, 0},
127  {1, 0, 1, 0}, {0, 1, 0, 1},
128  {1, 1, 1, 1}, {1, 0, 1, 0},
129  },
130  {
131  {1, 0, 1, 0}, {1, 1, 1, 1},
132  {1, 1, 1, 1}, {0, 1, 0, 1},
133  {1, 0, 1, 0}, {1, 1, 1, 1},
134  {1, 1, 1, 1}, {0, 1, 0, 1},
135  },
136  {
137  {1, 1, 1, 1}, {1, 1, 1, 1},
138  {1, 1, 1, 1}, {0, 1, 0, 1},
139  {1, 1, 1, 1}, {1, 1, 1, 1},
140  {1, 1, 1, 1}, {0, 1, 0, 1},
141  },
142  {
143  {1, 1, 1, 1}, {1, 1, 1, 1},
144  {1, 1, 1, 1}, {1, 1, 1, 1},
145  {1, 1, 1, 1}, {1, 1, 1, 1},
146  {1, 1, 1, 1}, {1, 1, 1, 1},
147  }
148 };
149 
150 #endif /* AVCODEC_A64TABLES_H */