FFmpeg
sheervideodata.h
Go to the documentation of this file.
1 /*
2  * BitJazz SheerVideo decoder
3  * Copyright (c) 2016 Paul B Mahol
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_SHEERVIDEODATA_H
23 #define AVCODEC_SHEERVIDEODATA_H
24 
25 #include "libavutil/common.h"
26 
27 typedef struct SheerTable {
28  uint8_t lens[2 * 15];
29  uint16_t nb_16s;
30 } SheerTable;
31 
32 static const SheerTable rgb[2] = {
33  {
34  { 0, 0, 2, 2, 3, 3, 5, 5, 8, 8, 10, 9, 14, 15, 18,
35  17, 16, 13, 10, 10, 8, 7, 6, 5, 3, 2, 3, 0, 0, 0 }, 54
36  },
37  {
38  { 0, 2, 0, 2, 0, 1, 1, 0, 2, 1, 3, 3, 4, 7, 13,
39  11, 8, 4, 3, 3, 1, 2, 1, 0, 1, 0, 1, 2, 0, 0 }, 180
40  }
41 };
42 
43 static const SheerTable rgbi[2] = {
44  {
45  { 0, 0, 1, 3, 3, 3, 6, 8, 8, 11, 12, 15, 18, 21, 38,
46  0, 22, 19, 15, 12, 11, 7, 8, 6, 4, 2, 3, 0, 0, 0 }, 0
47  },
48  {
49  { 1, 0, 1, 1, 1, 1, 2, 1, 2, 4, 3, 5, 5, 6, 12,
50  14, 6, 6, 5, 3, 3, 3, 2, 1, 1, 2, 0, 1, 0, 0 }, 164
51  }
52 };
53 
54 static const SheerTable ybr[2] = {
55  {
56  { 0, 0, 2, 2, 2, 3, 5, 5, 7, 7, 8, 9, 13, 13, 19,
57  16, 14, 12, 9, 9, 7, 6, 6, 4, 4, 1, 2, 1, 0, 0 }, 70
58  },
59  {
60  { 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 3, 5, 5,
61  5, 5, 3, 2, 2, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0 }, 212
62  }
63 };
64 
65 static const SheerTable ybyr[2] = {
66  {
67  { 0, 0, 2, 2, 3, 3, 5, 5, 8, 8, 10, 10, 13, 15, 19,
68  18, 15, 12, 10, 10, 8, 7, 6, 5, 3, 2, 3, 0, 0, 0 }, 54
69  },
70  {
71  { 1, 1, 0, 1, 0, 1, 0, 1, 1, 2, 2, 3, 2, 5, 5,
72  5, 4, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 1, 0, 0 }, 208
73  }
74 };
75 
76 static const SheerTable byry[2] = {
77  {
78  { 0, 0, 2, 2, 2, 3, 5, 5, 7, 7, 8, 11, 10, 14, 19,
79  14, 16, 12, 10, 8, 7, 6, 6, 4, 4, 1, 2, 1, 0, 0 }, 70
80  },
81  {
82  { 1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 2, 3, 4, 6,
83  6, 4, 2, 3, 2, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0 }, 208
84  }
85 };
86 
87 static const SheerTable ybr10i[2] = {
88  {
89  { 0, 0, 1, 0, 3, 8, 9, 12, 19, 27, 27, 39, 50, 63, 93,
90  89, 64, 50, 38, 26, 26, 20, 12, 9, 8, 3, 0, 0, 0, 0 }, 328
91  },
92  {
93  { 0, 1, 1, 2, 2, 1, 2, 2, 4, 4, 6, 7, 9, 13, 28,
94  28, 12, 11, 6, 7, 5, 3, 3, 1, 1, 2, 2, 1, 0, 0 }, 860
95  }
96 };
97 
98 static const SheerTable ybr10[2] = {
99  {
100  { 0, 0, 0, 1, 6, 6, 8, 12, 18, 21, 27, 29, 36, 47, 71,
101  72, 46, 36, 29, 27, 21, 17, 13, 7, 7, 5, 0, 0, 0, 0 }, 462
102  },
103  {
104  { 0, 1, 2, 1, 2, 1, 1, 1, 2, 3, 2, 5, 6, 10, 20,
105  20, 10, 6, 4, 3, 2, 2, 2, 1, 1, 1, 2, 1, 0, 0 }, 912
106  }
107 };
108 
109 static const SheerTable rgbx[2] = {
110  {
111  { 0, 0, 0, 1, 3, 9, 10, 13, 19, 26, 28, 35, 40, 53, 77,
112  77, 50, 42, 34, 28, 25, 19, 13, 10, 8, 4, 0, 0, 0, 0 }, 400
113  },
114  {
115  { 0, 0, 1, 2, 6, 4, 3, 2, 3, 4, 6, 8, 10, 18, 39,
116  39, 18, 11, 8, 6, 4, 4, 1, 3, 5, 4, 3, 0, 0, 0 }, 812
117  }
118 };
119 
120 static const SheerTable yry10[2] = {
121  {
122  { 0, 0, 0, 1, 6, 6, 8, 12, 18, 21, 27, 29, 36, 47, 71,
123  72, 46, 36, 29, 27, 21, 17, 13, 7, 7, 5, 0, 0, 0, 0 }, 462
124  },
125  {
126  { 0, 1, 2, 1, 1, 1, 2, 3, 2, 4, 5, 5, 8, 14, 16,
127  18, 11, 7, 7, 4, 4, 3, 2, 2, 1, 1, 2, 1, 0, 0 }, 896
128  }
129 };
130 
131 static const SheerTable yry10i[2] = {
132  {
133  { 0, 0, 1, 0, 3, 8, 9, 12, 19, 27, 27, 40, 48, 64, 93,
134  89, 65, 49, 38, 26, 26, 20, 12, 9, 8, 3, 0, 0, 0, 0 }, 328
135  },
136  {
137  { 0, 1, 0, 3, 1, 3, 3, 3, 6, 7, 7, 12, 11, 19, 23,
138  20, 18, 12, 12, 8, 6, 5, 4, 3, 2, 2, 2, 1, 0, 0 }, 830
139  }
140 };
141 
142 static const SheerTable ybri[2] = {
143  {
144  { 0, 0, 2, 2, 2, 3, 5, 5, 7, 10, 11, 13, 15, 13, 26,
145  20, 16, 17, 12, 11, 9, 7, 5, 5, 3, 3, 1, 1, 0, 0 }, 32
146  },
147  {
148  { 1, 0, 1, 0, 1, 1, 0, 2, 1, 2, 2, 2, 3, 6, 6,
149  5, 6, 3, 2, 2, 2, 1, 2, 0, 1, 1, 0, 0, 1, 0 }, 202
150  }
151 };
152 
153 static const SheerTable byryi[2] = {
154  {
155  { 0, 0, 2, 2, 2, 2, 6, 5, 8, 8, 12, 12, 16, 14, 24,
156  20, 16, 18, 12, 12, 8, 7, 5, 6, 3, 1, 2, 1, 0, 0 }, 32
157  },
158  {
159  { 1, 0, 1, 1, 0, 2, 1, 2, 2, 3, 3, 4, 5, 4, 6,
160  7, 5, 4, 4, 3, 3, 2, 2, 2, 0, 1, 1, 1, 0, 0 }, 186
161  }
162 };
163 
164 static const SheerTable rgbxi[2] = {
165  {
166  { 0, 0, 1, 3, 2, 3, 4, 6, 16, 23, 27, 29, 24, 29, 76,
167  78, 29, 21, 29, 27, 23, 15, 7, 4, 3, 2, 3, 0, 0, 0 }, 540
168  },
169  {
170  { 0, 1, 1, 2, 0, 2, 6, 4, 3, 9, 7, 12, 13, 16, 29,
171  32, 17, 14, 12, 7, 8, 4, 4, 6, 2, 0, 2, 1, 0, 0 }, 810
172  }
173 };
174 
175 #endif /* AVCODEC_SHEERVIDEODATA_H */
rgbxi
static const SheerTable rgbxi[2]
Definition: sheervideodata.h:164
ybr
static const SheerTable ybr[2]
Definition: sheervideodata.h:54
rgb
Definition: rpzaenc.c:59
SheerTable::nb_16s
uint16_t nb_16s
Definition: sheervideodata.h:29
ybyr
static const SheerTable ybyr[2]
Definition: sheervideodata.h:65
rgbx
static const SheerTable rgbx[2]
Definition: sheervideodata.h:109
yry10i
static const SheerTable yry10i[2]
Definition: sheervideodata.h:131
yry10
static const SheerTable yry10[2]
Definition: sheervideodata.h:120
ybr10i
static const SheerTable ybr10i[2]
Definition: sheervideodata.h:87
SheerTable::lens
uint8_t lens[2 *15]
Definition: sheervideodata.h:28
ybri
static const SheerTable ybri[2]
Definition: sheervideodata.h:142
ybr10
static const SheerTable ybr10[2]
Definition: sheervideodata.h:98
common.h
SheerTable
Definition: sheervideodata.h:27
byry
static const SheerTable byry[2]
Definition: sheervideodata.h:76
rgbi
static const SheerTable rgbi[2]
Definition: sheervideodata.h:43
byryi
static const SheerTable byryi[2]
Definition: sheervideodata.h:153