FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/vvc/data.c
Date: 2024-12-12 01:08:13
Exec Total Coverage
Lines: 7 7 100.0%
Functions: 1 1 100.0%
Branches: 5 6 83.3%

Line Branch Exec Source
1 /*
2 * VVC shared tables
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <stdint.h>
22
23 #include "libavutil/avassert.h"
24
25 #include "data.h"
26
27 const uint8_t ff_vvc_diag_scan_x[5][5][16*16] = {
28 {
29 //1x1
30 { 0, },
31 //1x2
32 { 0, 0, },
33 //1x4
34 { 0, 0, 0, 0, },
35 //1x8
36 { 0, 0, 0, 0, 0, 0, 0, 0, },
37 //1x16
38 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
39 },
40 {
41 //2x1
42 { 0, 1, },
43 //2x2
44 { 0, 0, 1, 1, },
45 //2x4
46 { 0, 0, 1, 0, 1, 0, 1, 1, },
47 //2x8
48 { 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, },
49 //2x16
50 {
51 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
52 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1,
53 },
54 },
55 {
56 //4x1
57 { 0, 1, 2, 3, },
58 //4x2
59 { 0, 0, 1, 1, 2, 2, 3, 3, },
60 //4x4
61 { 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 2, 3, 3, },
62 //4x8
63 {
64 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1,
65 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 2, 3, 3,
66 },
67 //4x16
68 {
69 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1,
70 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1,
71 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1,
72 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 2, 3, 3,
73 },
74 },
75 {
76 //8x1
77 { 0, 1, 2, 3, 4, 5, 6, 7, },
78 //8x2
79 { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, },
80 //8x4
81 {
82 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 4, 2, 3,
83 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 6, 7, 7,
84 },
85 //8x8
86 {
87 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0,
88 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3,
89 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6,
90 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 5, 6, 7, 6, 7, 7,
91 },
92 //8x16
93 {
94 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0,
95 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3,
96 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3,
97 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3,
98 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3,
99 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3,
100 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6,
101 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 5, 6, 7, 6, 7, 7,
102 },
103 },
104 {
105 //16x1
106 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, },
107 //16x2
108 {
109 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
110 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15,
111 },
112 //16x4
113 {
114 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 4, 2, 3,
115 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7,
116 8, 9, 7, 8, 9, 10, 8, 9, 10, 11, 9, 10, 11, 12, 10, 11,
117 12, 13, 11, 12, 13, 14, 12, 13, 14, 15, 13, 14, 15, 14, 15, 15,
118 },
119 //16x8
120 {
121 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0,
122 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3,
123 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5,
124 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7,
125 8, 9, 10, 11, 5, 6, 7, 8, 9, 10, 11, 12, 6, 7, 8, 9,
126 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 14, 8, 9, 10, 11,
127 12, 13, 14, 15, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14,
128 15, 11, 12, 13, 14, 15, 12, 13, 14, 15, 13, 14, 15, 14, 15, 15,
129 },
130 //16x16
131 {
132 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0,
133 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3,
134 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2,
135 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8,
136 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1,
137 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2, 3, 4,
138 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6,
139 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7,
140 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 8,
141 9, 10, 11, 12, 13, 14, 15, 2, 3, 4, 5, 6, 7, 8, 9, 10,
142 11, 12, 13, 14, 15, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
143 14, 15, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 6,
144 7, 8, 9, 10, 11, 12, 13, 14, 15, 6, 7, 8, 9, 10, 11, 12,
145 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11,
146 12, 13, 14, 15, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14,
147 15, 11, 12, 13, 14, 15, 12, 13, 14, 15, 13, 14, 15, 14, 15, 15,
148 },
149 },
150 };
151
152 const uint8_t ff_vvc_diag_scan_y[5][5][16*16] = {
153 {
154 //1x1
155 { 0, },
156 //1x2
157 { 0, 1, },
158 //1x4
159 { 0, 1, 2, 3, },
160 //1x8
161 { 0, 1, 2, 3, 4, 5, 6, 7, },
162 //1x16
163 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, },
164 },
165 {
166 //2x1
167 { 0, 0, },
168 //2x2
169 { 0, 1, 0, 1, },
170 //2x4
171 { 0, 1, 0, 2, 1, 3, 2, 3, },
172 //2x8
173 { 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 7, },
174 //2x16
175 {
176 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8,
177 7, 9, 8, 10, 9, 11, 10, 12, 11, 13, 12, 14, 13, 15, 14, 15,
178 },
179 },
180 {
181 //4x1
182 { 0, 0, 0, 0, },
183 //4x2
184 { 0, 1, 0, 1, 0, 1, 0, 1, },
185 //4x4
186 { 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 3, 2, 3, },
187 //4x8
188 {
189 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 5, 4,
190 3, 2, 6, 5, 4, 3, 7, 6, 5, 4, 7, 6, 5, 7, 6, 7,
191 },
192 //4x16
193 {
194 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 5, 4,
195 3, 2, 6, 5, 4, 3, 7, 6, 5, 4, 8, 7, 6, 5, 9, 8,
196 7, 6, 10, 9, 8, 7, 11, 10, 9, 8, 12, 11, 10, 9, 13, 12,
197 11, 10, 14, 13, 12, 11, 15, 14, 13, 12, 15, 14, 13, 15, 14, 15,
198 },
199 },
200 {
201 //8x1
202 { 0, 0, 0, 0, 0, 0, 0, 0, },
203 //8x2
204 { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, },
205 //8x4
206 {
207 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2,
208 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 3, 2, 3,
209 },
210 //8x8
211 {
212 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5,
213 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
214 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3,
215 2, 7, 6, 5, 4, 3, 7, 6, 5, 4, 7, 6, 5, 7, 6, 7,
216 },
217 //8x16
218 {
219 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5,
220 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
221 3, 2, 1, 0, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6,
222 5, 4, 3, 2, 10, 9, 8, 7, 6, 5, 4, 3, 11, 10, 9, 8,
223 7, 6, 5, 4, 12, 11, 10, 9, 8, 7, 6, 5, 13, 12, 11, 10,
224 9, 8, 7, 6, 14, 13, 12, 11, 10, 9, 8, 7, 15, 14, 13, 12,
225 11, 10, 9, 8, 15, 14, 13, 12, 11, 10, 9, 15, 14, 13, 12, 11,
226 10, 15, 14, 13, 12, 11, 15, 14, 13, 12, 15, 14, 13, 15, 14, 15,
227 },
228 },
229 {
230 //16x1
231 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
232 //16x2
233 {
234 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
235 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
236 },
237 //16x4
238 {
239 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2,
240 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2,
241 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2,
242 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 3, 2, 3,
243 },
244 //16x8
245 {
246 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5,
247 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
248 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
249 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
250 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
251 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
252 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3,
253 2, 7, 6, 5, 4, 3, 7, 6, 5, 4, 7, 6, 5, 7, 6, 7,
254 },
255 //16x16
256 {
257 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5,
258 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4,
259 3, 2, 1, 0, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7,
260 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2,
261 1, 0, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 12, 11,
262 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 13, 12, 11, 10, 9,
263 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, 10, 9, 8,
264 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8,
265 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8,
266 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7,
267 6, 5, 4, 3, 2, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5,
268 4, 3, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 15, 14,
269 13, 12, 11, 10, 9, 8, 7, 6, 5, 15, 14, 13, 12, 11, 10, 9,
270 8, 7, 6, 15, 14, 13, 12, 11, 10, 9, 8, 7, 15, 14, 13, 12,
271 11, 10, 9, 8, 15, 14, 13, 12, 11, 10, 9, 15, 14, 13, 12, 11,
272 10, 15, 14, 13, 12, 11, 15, 14, 13, 12, 15, 14, 13, 15, 14, 15,
273 },
274 },
275 };
276
277 const uint8_t ff_vvc_scaling_pred_8[8 * 8] = {
278 8, 8, 8, 8, 8, 8, 8, 8,
279 8, 8, 8, 8, 8, 8, 8, 8,
280 8, 8, 8, 8, 8, 8, 8, 8,
281 8, 8, 8, 8, 8, 8, 8, 8,
282 8, 8, 8, 8, 8, 8, 8, 8,
283 8, 8, 8, 8, 8, 8, 8, 8,
284 8, 8, 8, 8, 8, 8, 8, 8,
285 8, 8, 8, 8, 8, 8, 8, 8,
286 };
287
288 const uint8_t ff_vvc_scaling_pred_16[8 * 8] = {
289 16, 16, 16, 16, 16, 16, 16, 16,
290 16, 16, 16, 16, 16, 16, 16, 16,
291 16, 16, 16, 16, 16, 16, 16, 16,
292 16, 16, 16, 16, 16, 16, 16, 16,
293 16, 16, 16, 16, 16, 16, 16, 16,
294 16, 16, 16, 16, 16, 16, 16, 16,
295 16, 16, 16, 16, 16, 16, 16, 16,
296 16, 16, 16, 16, 16, 16, 16, 16,
297 };
298
299 const int ff_vvc_scaling_list0[8 * 8] = {
300 0, 0, 0, 0, 0, 0, 0, 0,
301 0, 0, 0, 0, 0, 0, 0, 0,
302 0, 0, 0, 0, 0, 0, 0, 0,
303 0, 0, 0, 0, 0, 0, 0, 0,
304 0, 0, 0, 0, 0, 0, 0, 0,
305 0, 0, 0, 0, 0, 0, 0, 0,
306 0, 0, 0, 0, 0, 0, 0, 0,
307 0, 0, 0, 0, 0, 0, 0, 0,
308 };
309
310 static const uint8_t mip_matrix_4x4[16][16][4] = {
311 {
312 { 32, 30, 90, 28 },
313 { 32, 32, 72, 28 },
314 { 34, 77, 53, 30 },
315 { 51, 124, 36, 37 },
316 { 31, 31, 95, 37 },
317 { 33, 31, 70, 50 },
318 { 52, 80, 25, 60 },
319 { 78, 107, 1, 65 },
320 { 31, 29, 37, 95 },
321 { 38, 34, 19, 101 },
322 { 73, 85, 0, 81 },
323 { 92, 99, 0, 65 },
324 { 34, 29, 14, 111 },
325 { 48, 48, 7, 100 },
326 { 80, 91, 0, 74 },
327 { 89, 97, 0, 64 }
328 },
329 {
330 { 31, 23, 34, 29 },
331 { 31, 43, 34, 31 },
332 { 30, 95, 34, 32 },
333 { 29, 100, 35, 33 },
334 { 31, 23, 34, 29 },
335 { 31, 43, 34, 31 },
336 { 30, 95, 34, 32 },
337 { 29, 99, 35, 33 },
338 { 31, 24, 35, 29 },
339 { 31, 44, 34, 31 },
340 { 30, 95, 35, 32 },
341 { 29, 99, 35, 33 },
342 { 31, 24, 35, 30 },
343 { 31, 44, 35, 31 },
344 { 30, 95, 35, 32 },
345 { 29, 99, 35, 33 }
346 },
347 {
348 { 32, 32, 36, 58 },
349 { 32, 29, 26, 66 },
350 { 36, 37, 23, 61 },
351 { 79, 84, 3, 37 },
352 { 32, 32, 30, 69 },
353 { 33, 29, 24, 71 },
354 { 44, 16, 21, 70 },
355 { 96, 18, 0, 57 },
356 { 32, 31, 24, 74 },
357 { 33, 30, 23, 71 },
358 { 36, 24, 24, 71 },
359 { 59, 9, 16, 68 },
360 { 32, 32, 23, 75 },
361 { 33, 30, 24, 70 },
362 { 32, 30, 25, 71 },
363 { 36, 26, 25, 70 }
364 },
365 {
366 { 32, 33, 34, 32 },
367 { 32, 30, 22, 38 },
368 { 29, 46, 25, 38 },
369 { 53, 123, 28, 22 },
370 { 32, 33, 30, 37 },
371 { 32, 30, 21, 38 },
372 { 32, 40, 24, 38 },
373 { 64, 116, 26, 17 },
374 { 32, 32, 23, 49 },
375 { 32, 30, 21, 39 },
376 { 34, 39, 24, 37 },
377 { 72, 109, 23, 16 },
378 { 33, 31, 17, 60 },
379 { 32, 31, 21, 39 },
380 { 35, 41, 24, 37 },
381 { 72, 106, 22, 18 }
382 },
383 {
384 { 34, 25, 89, 20 },
385 { 38, 32, 47, 24 },
386 { 40, 86, 29, 27 },
387 { 38, 98, 32, 29 },
388 { 34, 31, 94, 40 },
389 { 44, 25, 83, 27 },
390 { 54, 72, 43, 16 },
391 { 47, 94, 33, 22 },
392 { 33, 31, 36, 94 },
393 { 43, 23, 51, 76 },
394 { 62, 55, 64, 25 },
395 { 57, 89, 38, 15 },
396 { 32, 32, 28, 101 },
397 { 38, 26, 33, 94 },
398 { 55, 38, 68, 47 },
399 { 59, 80, 52, 16 }
400 },
401 {
402 { 28, 30, 68, 29 },
403 { 23, 48, 23, 48 },
404 { 39, 98, 16, 42 },
405 { 84, 86, 20, 17 },
406 { 25, 31, 52, 74 },
407 { 38, 68, 5, 70 },
408 { 95, 78, 7, 21 },
409 { 127, 54, 12, 0 },
410 { 30, 47, 14, 107 },
411 { 79, 76, 0, 53 },
412 { 127, 59, 7, 1 },
413 { 127, 51, 9, 0 },
414 { 50, 71, 1, 96 },
415 { 109, 69, 7, 25 },
416 { 127, 56, 9, 0 },
417 { 123, 53, 13, 0 }
418 },
419 {
420 { 40, 20, 72, 18 },
421 { 48, 29, 44, 18 },
422 { 53, 81, 35, 18 },
423 { 48, 96, 33, 22 },
424 { 45, 23, 79, 49 },
425 { 61, 21, 56, 49 },
426 { 72, 52, 32, 48 },
427 { 65, 69, 20, 50 },
428 { 41, 27, 29, 96 },
429 { 49, 22, 28, 94 },
430 { 52, 22, 28, 93 },
431 { 49, 27, 27, 92 },
432 { 37, 29, 26, 98 },
433 { 39, 28, 28, 97 },
434 { 38, 28, 30, 97 },
435 { 38, 29, 30, 95 }
436 },
437 {
438 { 33, 27, 43, 27 },
439 { 32, 29, 31, 31 },
440 { 31, 73, 33, 31 },
441 { 35, 104, 34, 28 },
442 { 32, 30, 63, 22 },
443 { 33, 26, 33, 29 },
444 { 33, 57, 33, 30 },
445 { 37, 100, 35, 27 },
446 { 32, 31, 85, 25 },
447 { 34, 25, 39, 25 },
448 { 35, 39, 32, 28 },
449 { 40, 91, 35, 25 },
450 { 32, 30, 77, 50 },
451 { 34, 26, 54, 22 },
452 { 37, 31, 34, 27 },
453 { 45, 75, 34, 23 }
454 },
455 {
456 { 34, 25, 77, 19 },
457 { 36, 34, 56, 24 },
458 { 41, 83, 39, 30 },
459 { 47, 96, 28, 35 },
460 { 34, 31, 70, 65 },
461 { 38, 29, 53, 77 },
462 { 43, 36, 37, 83 },
463 { 48, 39, 28, 83 },
464 { 33, 31, 31, 98 },
465 { 33, 31, 30, 99 },
466 { 34, 30, 31, 98 },
467 { 36, 29, 31, 96 },
468 { 32, 32, 30, 97 },
469 { 32, 32, 31, 96 },
470 { 31, 33, 33, 96 },
471 { 32, 33, 34, 94 }
472 },
473 {
474 { 30, 30, 93, 19 },
475 { 31, 59, 67, 34 },
476 { 31, 79, 36, 59 },
477 { 30, 67, 17, 79 },
478 { 30, 38, 68, 69 },
479 { 29, 40, 43, 91 },
480 { 26, 35, 32, 101 },
481 { 23, 32, 30, 101 },
482 { 26, 34, 30, 101 },
483 { 23, 33, 30, 102 },
484 { 20, 32, 31, 102 },
485 { 18, 33, 32, 102 },
486 { 23, 33, 31, 100 },
487 { 20, 34, 32, 100 },
488 { 18, 35, 33, 100 },
489 { 18, 35, 33, 100 }
490 },
491 {
492 { 31, 54, 90, 26 },
493 { 32, 60, 53, 61 },
494 { 34, 49, 37, 84 },
495 { 34, 39, 35, 89 },
496 { 35, 38, 41, 88 },
497 { 35, 35, 32, 96 },
498 { 35, 31, 33, 96 },
499 { 35, 32, 35, 94 },
500 { 34, 34, 30, 97 },
501 { 35, 32, 33, 95 },
502 { 35, 32, 34, 94 },
503 { 35, 34, 34, 93 },
504 { 34, 34, 34, 93 },
505 { 35, 34, 34, 93 },
506 { 35, 34, 34, 92 },
507 { 36, 34, 35, 91 }
508 },
509 {
510 { 32, 29, 54, 24 },
511 { 31, 32, 34, 29 },
512 { 31, 43, 34, 29 },
513 { 32, 67, 36, 28 },
514 { 31, 34, 69, 37 },
515 { 31, 35, 46, 33 },
516 { 30, 35, 39, 33 },
517 { 30, 42, 39, 36 },
518 { 31, 35, 39, 88 },
519 { 30, 38, 41, 84 },
520 { 30, 39, 40, 81 },
521 { 39, 46, 38, 78 },
522 { 31, 36, 34, 96 },
523 { 34, 38, 37, 93 },
524 { 55, 42, 38, 82 },
525 { 89, 53, 38, 65 }
526 },
527 {
528 { 32, 33, 43, 29 },
529 { 32, 30, 29, 33 },
530 { 31, 47, 31, 33 },
531 { 33, 100, 31, 31 },
532 { 32, 33, 74, 25 },
533 { 32, 32, 34, 31 },
534 { 32, 33, 30, 33 },
535 { 32, 68, 30, 32 },
536 { 32, 31, 91, 40 },
537 { 32, 32, 58, 26 },
538 { 31, 31, 30, 32 },
539 { 31, 42, 30, 33 },
540 { 32, 31, 49, 85 },
541 { 32, 31, 83, 35 },
542 { 31, 33, 48, 29 },
543 { 31, 36, 32, 33 }
544 },
545 {
546 { 31, 29, 81, 35 },
547 { 32, 28, 34, 50 },
548 { 31, 75, 16, 43 },
549 { 34, 103, 29, 32 },
550 { 32, 32, 53, 78 },
551 { 31, 28, 36, 88 },
552 { 30, 52, 18, 73 },
553 { 52, 88, 17, 35 },
554 { 32, 32, 35, 94 },
555 { 30, 31, 35, 95 },
556 { 36, 29, 31, 92 },
557 { 100, 43, 16, 40 },
558 { 32, 32, 35, 93 },
559 { 30, 32, 38, 93 },
560 { 55, 18, 37, 83 },
561 { 127, 0, 30, 40 }
562 },
563 {
564 { 31, 22, 47, 30 },
565 { 31, 48, 25, 34 },
566 { 30, 95, 31, 32 },
567 { 32, 103, 33, 32 },
568 { 30, 24, 57, 31 },
569 { 30, 47, 26, 34 },
570 { 31, 95, 31, 32 },
571 { 43, 97, 35, 25 },
572 { 29, 26, 44, 63 },
573 { 37, 38, 24, 47 },
574 { 74, 63, 28, 20 },
575 { 110, 58, 34, 3 },
576 { 46, 22, 5, 108 },
577 { 93, 5, 9, 77 },
578 { 127, 0, 17, 52 },
579 { 127, 0, 15, 50 }
580 },
581 {
582 { 32, 27, 68, 24 },
583 { 35, 23, 35, 28 },
584 { 35, 64, 29, 29 },
585 { 37, 104, 33, 28 },
586 { 32, 32, 91, 40 },
587 { 36, 23, 67, 36 },
588 { 49, 23, 39, 28 },
589 { 60, 67, 30, 20 },
590 { 32, 32, 36, 95 },
591 { 35, 29, 38, 93 },
592 { 50, 16, 30, 84 },
593 { 72, 16, 15, 65 },
594 { 32, 32, 27, 100 },
595 { 33, 32, 29, 100 },
596 { 37, 29, 30, 98 },
597 { 48, 21, 29, 90 }
598 }
599 };
600
601 static const uint8_t mip_matrix_8x8[8][16][8] = {
602 {
603 { 30, 63, 46, 37, 25, 33, 33, 34 },
604 { 30, 60, 66, 38, 32, 31, 32, 33 },
605 { 29, 45, 74, 42, 32, 32, 32, 33 },
606 { 30, 39, 62, 58, 32, 33, 32, 33 },
607 { 30, 66, 55, 39, 32, 30, 30, 36 },
608 { 29, 54, 69, 40, 33, 31, 31, 33 },
609 { 28, 48, 71, 43, 32, 33, 32, 33 },
610 { 28, 41, 72, 46, 32, 34, 32, 33 },
611 { 30, 66, 56, 40, 32, 33, 28, 33 },
612 { 29, 55, 69, 39, 33, 33, 30, 32 },
613 { 27, 46, 72, 43, 33, 33, 32, 33 },
614 { 27, 42, 69, 48, 32, 34, 32, 33 },
615 { 30, 63, 55, 40, 32, 33, 35, 30 },
616 { 29, 56, 66, 40, 33, 33, 33, 30 },
617 { 27, 47, 69, 44, 33, 33, 33, 32 },
618 { 27, 42, 65, 50, 32, 34, 32, 33 }
619 },
620 {
621 { 32, 33, 30, 31, 74, 30, 31, 32 },
622 { 33, 56, 28, 30, 41, 29, 32, 32 },
623 { 33, 77, 52, 26, 29, 34, 30, 32 },
624 { 33, 37, 80, 41, 31, 34, 30, 32 },
625 { 32, 32, 33, 31, 59, 76, 28, 31 },
626 { 33, 31, 31, 30, 78, 40, 28, 32 },
627 { 33, 47, 28, 29, 53, 27, 31, 31 },
628 { 33, 61, 44, 28, 34, 32, 31, 31 },
629 { 32, 31, 34, 30, 26, 64, 76, 27 },
630 { 32, 31, 34, 29, 45, 86, 36, 29 },
631 { 33, 27, 34, 29, 73, 55, 25, 32 },
632 { 33, 33, 34, 30, 62, 33, 30, 31 },
633 { 32, 31, 34, 30, 30, 29, 58, 74 },
634 { 32, 31, 35, 29, 27, 53, 77, 35 },
635 { 32, 30, 36, 29, 40, 80, 44, 31 },
636 { 33, 28, 37, 30, 58, 60, 31, 33 }
637 },
638 {
639 { 32, 51, 27, 32, 27, 50, 29, 32 },
640 { 32, 95, 42, 29, 29, 42, 30, 32 },
641 { 32, 27, 99, 34, 31, 41, 29, 32 },
642 { 32, 34, 21, 104, 31, 42, 30, 32 },
643 { 32, 45, 30, 32, 9, 88, 40, 30 },
644 { 32, 77, 38, 30, 9, 76, 38, 30 },
645 { 32, 38, 78, 33, 14, 67, 37, 30 },
646 { 32, 30, 30, 87, 20, 59, 38, 31 },
647 { 33, 37, 32, 32, 27, 18, 106, 34 },
648 { 34, 44, 34, 31, 25, 17, 108, 31 },
649 { 36, 39, 45, 31, 24, 15, 108, 30 },
650 { 37, 31, 31, 54, 25, 14, 101, 32 },
651 { 36, 33, 32, 30, 29, 37, 13, 110 },
652 { 39, 32, 32, 29, 27, 37, 15, 108 },
653 { 44, 33, 31, 27, 25, 37, 16, 106 },
654 { 47, 30, 31, 32, 25, 34, 19, 102 }
655 },
656 {
657 { 32, 48, 35, 35, 47, 68, 31, 31 },
658 { 32, 33, 59, 40, 27, 71, 33, 30 },
659 { 32, 29, 47, 65, 24, 62, 37, 30 },
660 { 33, 33, 31, 81, 26, 50, 42, 32 },
661 { 32, 30, 40, 38, 30, 70, 55, 31 },
662 { 32, 20, 46, 50, 26, 55, 64, 31 },
663 { 33, 30, 29, 66, 25, 41, 72, 33 },
664 { 36, 34, 27, 69, 26, 31, 67, 39 },
665 { 33, 28, 36, 40, 30, 26, 85, 47 },
666 { 36, 27, 33, 50, 31, 20, 79, 53 },
667 { 43, 30, 26, 57, 28, 17, 67, 62 },
668 { 51, 27, 28, 55, 22, 23, 49, 70 },
669 { 38, 29, 32, 39, 28, 30, 22, 104 },
670 { 51, 31, 28, 43, 24, 31, 17, 102 },
671 { 69, 23, 30, 40, 15, 38, 10, 95 },
672 { 77, 13, 35, 38, 8, 43, 8, 90 }
673 },
674 {
675 { 32, 38, 32, 33, 101, 40, 29, 32 },
676 { 32, 40, 37, 32, 100, 36, 30, 32 },
677 { 32, 37, 46, 35, 94, 33, 30, 31 },
678 { 33, 34, 30, 62, 81, 35, 30, 31 },
679 { 32, 32, 33, 32, 22, 102, 39, 29 },
680 { 32, 31, 33, 33, 26, 104, 34, 28 },
681 { 33, 33, 33, 33, 31, 103, 32, 28 },
682 { 33, 32, 34, 36, 37, 94, 33, 28 },
683 { 32, 33, 32, 32, 34, 24, 99, 36 },
684 { 32, 34, 33, 33, 33, 30, 98, 32 },
685 { 33, 33, 34, 33, 31, 37, 95, 29 },
686 { 33, 33, 33, 36, 30, 46, 85, 31 },
687 { 32, 33, 32, 33, 30, 34, 23, 104 },
688 { 32, 34, 33, 33, 31, 32, 30, 98 },
689 { 32, 33, 34, 34, 31, 29, 39, 91 },
690 { 33, 33, 32, 37, 32, 30, 47, 82 }
691 },
692 {
693 { 32, 52, 48, 31, 38, 76, 26, 32 },
694 { 33, 19, 62, 50, 25, 50, 51, 31 },
695 { 33, 30, 20, 74, 29, 29, 54, 51 },
696 { 34, 35, 23, 56, 31, 25, 41, 76 },
697 { 33, 25, 38, 39, 28, 39, 83, 35 },
698 { 35, 28, 25, 47, 31, 23, 57, 74 },
699 { 37, 35, 22, 38, 31, 27, 30, 101 },
700 { 38, 32, 33, 29, 30, 31, 27, 103 },
701 { 34, 32, 27, 37, 32, 25, 41, 92 },
702 { 38, 33, 28, 32, 30, 31, 18, 111 },
703 { 40, 32, 33, 27, 29, 33, 18, 111 },
704 { 40, 32, 34, 27, 28, 33, 23, 105 },
705 { 35, 32, 30, 33, 31, 33, 20, 107 },
706 { 38, 31, 33, 30, 29, 33, 21, 106 },
707 { 40, 32, 33, 29, 29, 34, 22, 105 },
708 { 40, 32, 33, 30, 29, 34, 24, 101 }
709 },
710 {
711 { 32, 28, 31, 33, 92, 33, 30, 31 },
712 { 33, 30, 28, 33, 71, 26, 32, 30 },
713 { 33, 60, 26, 33, 47, 28, 33, 30 },
714 { 33, 63, 44, 36, 37, 31, 33, 30 },
715 { 33, 30, 31, 33, 43, 90, 33, 29 },
716 { 33, 28, 29, 34, 71, 71, 26, 30 },
717 { 33, 30, 26, 33, 86, 45, 28, 30 },
718 { 33, 38, 29, 32, 74, 32, 33, 29 },
719 { 33, 32, 30, 32, 29, 41, 95, 27 },
720 { 34, 31, 29, 33, 26, 71, 73, 22 },
721 { 34, 31, 29, 33, 37, 88, 46, 25 },
722 { 33, 32, 28, 34, 55, 75, 36, 28 },
723 { 34, 31, 30, 32, 33, 27, 43, 89 },
724 { 35, 32, 28, 33, 33, 23, 77, 59 },
725 { 34, 33, 28, 33, 30, 35, 91, 37 },
726 { 34, 34, 28, 34, 33, 53, 74, 31 }
727 },
728 {
729 { 33, 49, 26, 32, 26, 52, 28, 31 },
730 { 33, 71, 72, 24, 30, 32, 34, 31 },
731 { 32, 23, 70, 68, 32, 32, 32, 32 },
732 { 31, 33, 21, 106, 33, 32, 32, 33 },
733 { 34, 47, 32, 29, 5, 86, 44, 26 },
734 { 34, 44, 89, 28, 28, 37, 33, 30 },
735 { 32, 27, 46, 89, 33, 31, 31, 32 },
736 { 30, 33, 20, 107, 33, 33, 32, 33 },
737 { 35, 39, 42, 27, 26, 24, 92, 35 },
738 { 34, 27, 87, 43, 30, 34, 38, 31 },
739 { 31, 31, 32, 100, 32, 33, 30, 32 },
740 { 29, 32, 22, 106, 33, 33, 32, 33 },
741 { 35, 29, 47, 32, 32, 32, 17, 100 },
742 { 34, 24, 69, 60, 34, 33, 28, 44 },
743 { 31, 33, 31, 99, 32, 33, 32, 31 },
744 { 29, 33, 25, 103, 33, 33, 32, 35 }
745 }
746 };
747
748 static const uint8_t mip_matrix_16x16[6][64][7] = {
749 {
750 { 42, 37, 33, 27, 44, 33, 35 },
751 { 71, 39, 34, 24, 36, 35, 36 },
752 { 77, 46, 35, 33, 30, 34, 36 },
753 { 64, 60, 35, 33, 31, 32, 36 },
754 { 49, 71, 38, 32, 32, 31, 36 },
755 { 42, 66, 50, 33, 31, 32, 36 },
756 { 40, 52, 67, 33, 31, 32, 35 },
757 { 38, 43, 75, 33, 32, 32, 35 },
758 { 56, 40, 33, 26, 43, 38, 36 },
759 { 70, 49, 34, 30, 28, 38, 38 },
760 { 65, 57, 36, 34, 28, 33, 39 },
761 { 59, 60, 39, 33, 30, 31, 38 },
762 { 55, 60, 43, 33, 30, 31, 38 },
763 { 51, 61, 47, 33, 30, 32, 37 },
764 { 46, 62, 51, 34, 30, 32, 37 },
765 { 42, 60, 55, 33, 31, 32, 37 },
766 { 60, 42, 34, 30, 37, 43, 38 },
767 { 68, 52, 35, 35, 22, 37, 40 },
768 { 62, 58, 37, 34, 28, 31, 40 },
769 { 58, 59, 41, 33, 30, 30, 39 },
770 { 56, 59, 44, 34, 30, 31, 38 },
771 { 53, 60, 45, 33, 30, 31, 38 },
772 { 49, 65, 45, 33, 30, 31, 38 },
773 { 45, 64, 47, 33, 31, 32, 38 },
774 { 59, 44, 35, 31, 34, 43, 41 },
775 { 66, 53, 36, 35, 25, 31, 43 },
776 { 61, 58, 38, 34, 29, 30, 40 },
777 { 59, 57, 41, 33, 30, 31, 39 },
778 { 57, 58, 43, 33, 30, 31, 39 },
779 { 54, 61, 43, 33, 31, 31, 39 },
780 { 51, 64, 43, 33, 31, 31, 39 },
781 { 48, 64, 45, 33, 32, 31, 39 },
782 { 57, 45, 35, 30, 35, 40, 44 },
783 { 65, 54, 37, 33, 33, 24, 44 },
784 { 63, 56, 38, 34, 30, 29, 39 },
785 { 61, 56, 41, 34, 30, 32, 39 },
786 { 58, 58, 42, 33, 31, 31, 39 },
787 { 54, 62, 41, 33, 31, 31, 39 },
788 { 51, 65, 42, 33, 31, 31, 39 },
789 { 48, 63, 43, 33, 32, 31, 39 },
790 { 55, 46, 35, 30, 36, 38, 47 },
791 { 65, 53, 37, 32, 36, 26, 40 },
792 { 65, 54, 38, 33, 31, 30, 38 },
793 { 63, 55, 39, 33, 30, 32, 38 },
794 { 59, 58, 40, 33, 31, 31, 39 },
795 { 54, 64, 40, 33, 31, 30, 40 },
796 { 49, 66, 40, 32, 32, 30, 41 },
797 { 48, 64, 42, 32, 32, 30, 41 },
798 { 54, 46, 35, 30, 34, 39, 49 },
799 { 64, 52, 36, 32, 34, 34, 35 },
800 { 65, 53, 37, 33, 32, 32, 37 },
801 { 63, 55, 38, 33, 31, 31, 39 },
802 { 59, 60, 38, 33, 31, 31, 40 },
803 { 54, 64, 38, 33, 32, 30, 40 },
804 { 49, 66, 39, 33, 32, 29, 41 },
805 { 47, 64, 42, 32, 33, 29, 42 },
806 { 51, 46, 35, 31, 33, 37, 54 },
807 { 61, 51, 36, 32, 33, 38, 36 },
808 { 63, 53, 37, 32, 32, 34, 37 },
809 { 62, 55, 37, 33, 32, 32, 39 },
810 { 58, 59, 37, 33, 32, 31, 40 },
811 { 53, 63, 38, 33, 32, 31, 40 },
812 { 49, 64, 40, 33, 33, 30, 41 },
813 { 46, 62, 42, 33, 33, 30, 42 }
814 },
815 {
816 { 39, 34, 33, 58, 44, 31, 32 },
817 { 60, 38, 32, 40, 51, 30, 31 },
818 { 73, 49, 31, 39, 48, 32, 31 },
819 { 60, 73, 30, 39, 46, 33, 32 },
820 { 43, 87, 35, 38, 45, 33, 32 },
821 { 35, 78, 54, 36, 45, 33, 32 },
822 { 33, 47, 86, 35, 44, 33, 32 },
823 { 31, 17, 114, 34, 44, 34, 33 },
824 { 43, 37, 32, 53, 70, 30, 31 },
825 { 53, 50, 30, 42, 72, 31, 30 },
826 { 52, 66, 30, 39, 70, 32, 30 },
827 { 46, 78, 35, 37, 68, 34, 30 },
828 { 43, 75, 48, 37, 66, 34, 30 },
829 { 40, 62, 68, 35, 65, 35, 30 },
830 { 33, 37, 97, 33, 62, 37, 31 },
831 { 26, 14, 122, 32, 59, 38, 33 },
832 { 40, 39, 33, 34, 87, 37, 30 },
833 { 45, 54, 32, 34, 84, 41, 29 },
834 { 41, 70, 35, 33, 83, 40, 29 },
835 { 37, 73, 44, 32, 82, 40, 30 },
836 { 37, 65, 60, 31, 81, 41, 29 },
837 { 35, 48, 82, 30, 79, 43, 29 },
838 { 28, 27, 108, 28, 76, 45, 30 },
839 { 19, 11, 127, 27, 70, 46, 32 },
840 { 38, 40, 34, 27, 73, 62, 28 },
841 { 39, 54, 35, 30, 73, 62, 28 },
842 { 33, 65, 41, 29, 75, 59, 28 },
843 { 30, 65, 53, 27, 76, 58, 29 },
844 { 29, 53, 72, 26, 77, 58, 29 },
845 { 27, 35, 95, 24, 77, 60, 28 },
846 { 19, 19, 117, 23, 74, 61, 30 },
847 { 9, 16, 127, 23, 68, 60, 34 },
848 { 35, 40, 35, 29, 44, 89, 30 },
849 { 33, 51, 39, 29, 49, 86, 30 },
850 { 28, 57, 49, 28, 53, 83, 30 },
851 { 24, 52, 65, 26, 56, 82, 30 },
852 { 22, 39, 86, 24, 58, 82, 30 },
853 { 18, 22, 108, 23, 59, 82, 31 },
854 { 10, 13, 125, 22, 58, 80, 33 },
855 { 0, 19, 127, 22, 56, 74, 40 },
856 { 33, 40, 36, 31, 28, 90, 45 },
857 { 29, 46, 44, 29, 31, 92, 43 },
858 { 24, 45, 58, 28, 34, 91, 43 },
859 { 19, 37, 78, 26, 37, 91, 43 },
860 { 15, 22, 99, 25, 38, 91, 42 },
861 { 11, 11, 118, 24, 39, 90, 44 },
862 { 2, 11, 127, 23, 41, 85, 48 },
863 { 0, 17, 127, 23, 43, 75, 55 },
864 { 31, 37, 39, 30, 28, 54, 82 },
865 { 27, 37, 52, 28, 30, 58, 79 },
866 { 22, 30, 70, 27, 32, 58, 79 },
867 { 15, 19, 91, 26, 33, 58, 79 },
868 { 10, 8, 111, 25, 34, 58, 79 },
869 { 5, 2, 125, 25, 35, 57, 80 },
870 { 0, 9, 127, 25, 36, 53, 84 },
871 { 0, 13, 127, 25, 39, 47, 88 },
872 { 28, 29, 46, 28, 39, 2, 123 },
873 { 24, 24, 62, 27, 41, 1, 125 },
874 { 19, 14, 81, 25, 43, 0, 126 },
875 { 13, 4, 101, 24, 44, 0, 127 },
876 { 6, 0, 116, 23, 45, 0, 127 },
877 { 0, 0, 126, 23, 45, 1, 127 },
878 { 0, 4, 127, 25, 44, 2, 127 },
879 { 0, 9, 127, 25, 44, 3, 127 }
880 },
881 {
882 { 30, 32, 32, 42, 34, 32, 32 },
883 { 63, 26, 34, 16, 38, 32, 32 },
884 { 98, 26, 34, 25, 34, 33, 32 },
885 { 75, 61, 30, 31, 32, 33, 32 },
886 { 36, 94, 32, 30, 33, 32, 32 },
887 { 26, 76, 58, 30, 33, 32, 32 },
888 { 30, 39, 91, 31, 32, 33, 31 },
889 { 32, 23, 105, 32, 32, 32, 32 },
890 { 34, 30, 33, 31, 52, 29, 32 },
891 { 66, 24, 34, 11, 41, 33, 32 },
892 { 97, 28, 34, 24, 34, 33, 32 },
893 { 71, 65, 30, 30, 32, 33, 32 },
894 { 34, 92, 35, 30, 33, 32, 32 },
895 { 26, 70, 64, 29, 34, 32, 32 },
896 { 30, 37, 94, 30, 33, 32, 31 },
897 { 32, 23, 105, 31, 33, 33, 31 },
898 { 37, 29, 33, 8, 79, 27, 32 },
899 { 71, 22, 35, 5, 50, 32, 32 },
900 { 98, 29, 34, 23, 34, 34, 32 },
901 { 66, 70, 30, 31, 31, 33, 32 },
902 { 31, 92, 38, 30, 33, 32, 32 },
903 { 26, 66, 68, 29, 34, 32, 31 },
904 { 30, 34, 97, 30, 34, 33, 31 },
905 { 31, 22, 106, 30, 34, 33, 31 },
906 { 40, 28, 34, 0, 76, 46, 28 },
907 { 76, 21, 35, 0, 55, 35, 32 },
908 { 97, 32, 34, 21, 37, 33, 33 },
909 { 61, 75, 29, 30, 32, 32, 32 },
910 { 29, 92, 40, 29, 33, 32, 32 },
911 { 26, 62, 73, 29, 34, 32, 31 },
912 { 29, 32, 99, 30, 34, 33, 30 },
913 { 31, 22, 107, 30, 34, 33, 31 },
914 { 42, 27, 34, 1, 48, 79, 25 },
915 { 80, 20, 35, 0, 48, 47, 31 },
916 { 94, 36, 32, 17, 40, 33, 33 },
917 { 55, 80, 29, 27, 35, 31, 32 },
918 { 27, 90, 43, 28, 34, 32, 31 },
919 { 26, 58, 76, 29, 33, 33, 30 },
920 { 29, 30, 101, 29, 34, 34, 30 },
921 { 31, 21, 108, 29, 35, 34, 30 },
922 { 44, 26, 34, 6, 30, 80, 40 },
923 { 81, 21, 35, 0, 41, 52, 35 },
924 { 90, 41, 31, 14, 41, 35, 33 },
925 { 51, 82, 29, 24, 37, 32, 32 },
926 { 27, 87, 47, 27, 35, 32, 31 },
927 { 26, 54, 79, 29, 34, 33, 30 },
928 { 29, 29, 102, 28, 34, 33, 30 },
929 { 31, 21, 108, 28, 35, 33, 31 },
930 { 47, 26, 34, 7, 34, 44, 75 },
931 { 80, 24, 34, 0, 41, 41, 50 },
932 { 84, 45, 31, 12, 40, 36, 36 },
933 { 49, 81, 31, 22, 37, 33, 32 },
934 { 28, 81, 51, 26, 35, 33, 31 },
935 { 28, 51, 81, 28, 34, 33, 30 },
936 { 29, 30, 101, 28, 35, 33, 31 },
937 { 31, 22, 107, 28, 35, 33, 32 },
938 { 48, 27, 34, 10, 40, 16, 97 },
939 { 75, 27, 34, 3, 42, 26, 66 },
940 { 77, 47, 33, 12, 40, 32, 43 },
941 { 49, 75, 36, 21, 37, 33, 35 },
942 { 32, 72, 55, 25, 36, 33, 32 },
943 { 30, 49, 81, 27, 35, 33, 31 },
944 { 30, 32, 98, 28, 35, 32, 32 },
945 { 31, 24, 104, 28, 35, 32, 33 }
946 },
947 {
948 { 36, 29, 33, 43, 47, 29, 31 },
949 { 74, 20, 35, 19, 47, 34, 32 },
950 { 92, 35, 32, 29, 31, 40, 34 },
951 { 53, 80, 26, 33, 28, 36, 37 },
952 { 24, 91, 41, 31, 31, 31, 38 },
953 { 25, 57, 74, 31, 32, 30, 37 },
954 { 32, 28, 99, 32, 32, 29, 36 },
955 { 34, 20, 105, 33, 32, 30, 35 },
956 { 50, 26, 34, 33, 74, 30, 31 },
957 { 75, 28, 33, 23, 46, 47, 33 },
958 { 64, 58, 29, 30, 26, 46, 40 },
959 { 31, 85, 37, 31, 27, 33, 44 },
960 { 22, 67, 64, 30, 31, 28, 42 },
961 { 29, 35, 93, 31, 32, 27, 40 },
962 { 33, 20, 105, 32, 33, 27, 37 },
963 { 34, 19, 106, 33, 32, 29, 36 },
964 { 51, 29, 33, 25, 72, 51, 30 },
965 { 61, 42, 31, 30, 31, 60, 39 },
966 { 40, 70, 34, 32, 24, 41, 50 },
967 { 22, 72, 54, 30, 31, 27, 50 },
968 { 25, 44, 83, 30, 33, 25, 44 },
969 { 32, 23, 102, 32, 33, 26, 40 },
970 { 34, 18, 107, 32, 33, 28, 37 },
971 { 34, 19, 105, 33, 32, 30, 35 },
972 { 45, 35, 32, 30, 39, 79, 33 },
973 { 43, 53, 33, 35, 24, 53, 55 },
974 { 27, 67, 45, 32, 29, 27, 61 },
975 { 22, 53, 72, 30, 33, 22, 52 },
976 { 28, 31, 95, 31, 33, 25, 43 },
977 { 32, 20, 105, 32, 33, 27, 38 },
978 { 34, 18, 107, 32, 32, 29, 36 },
979 { 34, 20, 105, 33, 31, 31, 35 },
980 { 38, 40, 32, 35, 23, 72, 54 },
981 { 31, 55, 39, 34, 29, 32, 73 },
982 { 22, 57, 60, 31, 35, 18, 64 },
983 { 25, 39, 86, 31, 35, 22, 49 },
984 { 30, 24, 101, 32, 33, 27, 40 },
985 { 33, 19, 106, 32, 32, 30, 36 },
986 { 34, 18, 107, 33, 31, 31, 35 },
987 { 34, 20, 104, 33, 31, 32, 34 },
988 { 33, 42, 35, 34, 28, 39, 82 },
989 { 26, 51, 50, 33, 34, 18, 80 },
990 { 23, 46, 74, 31, 35, 20, 59 },
991 { 27, 32, 93, 32, 34, 26, 44 },
992 { 31, 22, 103, 32, 32, 30, 37 },
993 { 33, 19, 106, 33, 31, 31, 35 },
994 { 34, 19, 106, 33, 31, 32, 34 },
995 { 35, 21, 103, 34, 31, 32, 34 },
996 { 29, 41, 41, 33, 34, 20, 92 },
997 { 24, 44, 62, 34, 35, 18, 73 },
998 { 24, 37, 83, 34, 33, 25, 52 },
999 { 28, 28, 97, 33, 32, 30, 40 },
1000 { 32, 23, 103, 33, 31, 32, 36 },
1001 { 34, 20, 105, 34, 30, 33, 34 },
1002 { 35, 20, 104, 34, 30, 33, 33 },
1003 { 35, 22, 102, 34, 30, 33, 34 },
1004 { 27, 38, 51, 34, 34, 20, 86 },
1005 { 26, 37, 71, 35, 34, 24, 64 },
1006 { 27, 33, 87, 35, 32, 30, 47 },
1007 { 30, 28, 96, 34, 31, 32, 39 },
1008 { 32, 24, 100, 35, 30, 32, 36 },
1009 { 34, 23, 101, 34, 30, 33, 34 },
1010 { 35, 23, 101, 34, 30, 32, 34 },
1011 { 34, 24, 99, 35, 30, 33, 34 }
1012 },
1013 {
1014 { 39, 30, 31, 67, 33, 34, 31 },
1015 { 72, 21, 32, 43, 39, 33, 31 },
1016 { 100, 23, 32, 35, 39, 34, 31 },
1017 { 75, 63, 24, 32, 38, 34, 32 },
1018 { 32, 98, 26, 29, 37, 35, 32 },
1019 { 22, 77, 55, 29, 36, 35, 31 },
1020 { 31, 37, 90, 31, 35, 35, 32 },
1021 { 35, 22, 100, 33, 33, 36, 33 },
1022 { 47, 29, 32, 74, 54, 32, 31 },
1023 { 71, 24, 32, 60, 50, 36, 30 },
1024 { 86, 31, 30, 46, 48, 37, 30 },
1025 { 65, 63, 25, 34, 46, 39, 30 },
1026 { 33, 85, 32, 28, 43, 40, 30 },
1027 { 26, 64, 60, 27, 39, 41, 30 },
1028 { 33, 33, 87, 29, 35, 41, 31 },
1029 { 37, 23, 93, 32, 33, 41, 32 },
1030 { 41, 32, 32, 45, 84, 32, 32 },
1031 { 55, 31, 32, 50, 70, 40, 30 },
1032 { 62, 37, 31, 45, 61, 45, 29 },
1033 { 53, 55, 31, 36, 55, 48, 29 },
1034 { 38, 63, 40, 29, 48, 50, 28 },
1035 { 34, 49, 60, 27, 43, 51, 29 },
1036 { 38, 30, 78, 28, 38, 50, 31 },
1037 { 40, 24, 83, 30, 36, 48, 33 },
1038 { 35, 33, 33, 29, 75, 58, 29 },
1039 { 39, 35, 33, 34, 68, 59, 29 },
1040 { 41, 39, 34, 36, 61, 62, 29 },
1041 { 41, 43, 37, 33, 54, 64, 28 },
1042 { 41, 43, 45, 30, 48, 65, 29 },
1043 { 42, 36, 56, 27, 44, 63, 30 },
1044 { 42, 30, 65, 27, 41, 60, 33 },
1045 { 42, 28, 68, 28, 37, 56, 36 },
1046 { 33, 34, 33, 31, 42, 88, 30 },
1047 { 31, 36, 34, 31, 44, 84, 31 },
1048 { 31, 37, 35, 32, 43, 83, 31 },
1049 { 35, 35, 39, 32, 40, 82, 31 },
1050 { 40, 32, 44, 31, 38, 81, 31 },
1051 { 44, 30, 48, 30, 37, 78, 33 },
1052 { 44, 30, 52, 28, 37, 72, 36 },
1053 { 43, 30, 55, 29, 35, 66, 40 },
1054 { 32, 33, 33, 34, 25, 85, 48 },
1055 { 30, 34, 34, 33, 25, 88, 44 },
1056 { 30, 34, 36, 34, 25, 90, 41 },
1057 { 33, 32, 38, 34, 25, 90, 40 },
1058 { 38, 29, 41, 34, 26, 88, 40 },
1059 { 42, 29, 41, 33, 27, 85, 41 },
1060 { 43, 30, 42, 31, 28, 80, 43 },
1061 { 42, 31, 45, 31, 30, 72, 47 },
1062 { 32, 33, 33, 33, 26, 54, 79 },
1063 { 31, 32, 34, 35, 20, 68, 68 },
1064 { 32, 32, 35, 36, 17, 76, 62 },
1065 { 34, 31, 36, 36, 17, 79, 59 },
1066 { 37, 29, 37, 36, 18, 78, 58 },
1067 { 39, 29, 37, 35, 20, 77, 58 },
1068 { 41, 30, 37, 34, 22, 74, 58 },
1069 { 40, 31, 40, 32, 26, 68, 59 },
1070 { 33, 31, 34, 33, 29, 31, 98 },
1071 { 34, 30, 34, 35, 23, 45, 88 },
1072 { 34, 31, 34, 36, 20, 54, 82 },
1073 { 35, 31, 34, 36, 18, 59, 78 },
1074 { 36, 31, 34, 37, 19, 60, 76 },
1075 { 38, 30, 34, 36, 20, 61, 74 },
1076 { 39, 31, 35, 35, 22, 60, 73 },
1077 { 39, 31, 37, 34, 24, 59, 71 }
1078 },
1079 {
1080 { 30, 33, 32, 55, 32, 32, 32 },
1081 { 47, 30, 31, 29, 36, 32, 32 },
1082 { 81, 28, 32, 28, 34, 32, 32 },
1083 { 85, 46, 29, 32, 32, 33, 32 },
1084 { 54, 82, 26, 32, 32, 33, 32 },
1085 { 30, 90, 38, 31, 32, 33, 32 },
1086 { 30, 56, 73, 31, 33, 32, 32 },
1087 { 37, 21, 102, 32, 32, 32, 32 },
1088 { 33, 32, 31, 68, 39, 31, 31 },
1089 { 38, 32, 31, 43, 34, 33, 31 },
1090 { 63, 30, 31, 29, 34, 32, 32 },
1091 { 82, 37, 30, 29, 33, 32, 32 },
1092 { 71, 63, 27, 31, 32, 33, 32 },
1093 { 44, 86, 30, 30, 33, 33, 32 },
1094 { 33, 72, 55, 30, 32, 32, 31 },
1095 { 37, 37, 86, 31, 32, 33, 31 },
1096 { 34, 33, 32, 60, 61, 29, 32 },
1097 { 36, 33, 31, 56, 38, 32, 31 },
1098 { 51, 30, 31, 38, 33, 33, 32 },
1099 { 75, 31, 31, 30, 33, 33, 32 },
1100 { 80, 47, 29, 30, 32, 33, 31 },
1101 { 60, 73, 27, 30, 33, 33, 31 },
1102 { 41, 78, 41, 30, 33, 32, 31 },
1103 { 38, 53, 68, 30, 32, 33, 31 },
1104 { 33, 33, 32, 43, 77, 35, 30 },
1105 { 35, 33, 31, 55, 54, 29, 32 },
1106 { 43, 32, 31, 46, 39, 31, 32 },
1107 { 64, 30, 31, 35, 34, 33, 32 },
1108 { 79, 37, 30, 31, 32, 33, 31 },
1109 { 73, 57, 28, 30, 32, 33, 31 },
1110 { 54, 73, 33, 30, 32, 33, 31 },
1111 { 43, 64, 52, 30, 32, 33, 31 },
1112 { 33, 33, 32, 34, 68, 58, 28 },
1113 { 34, 33, 31, 45, 70, 33, 31 },
1114 { 38, 33, 31, 48, 52, 29, 32 },
1115 { 54, 31, 31, 40, 39, 31, 32 },
1116 { 73, 32, 31, 34, 34, 33, 31 },
1117 { 77, 45, 29, 31, 32, 32, 32 },
1118 { 65, 63, 30, 31, 31, 33, 31 },
1119 { 51, 66, 42, 30, 32, 33, 31 },
1120 { 33, 32, 32, 34, 44, 81, 31 },
1121 { 34, 33, 31, 38, 66, 52, 28 },
1122 { 36, 33, 30, 44, 62, 34, 31 },
1123 { 47, 31, 31, 43, 48, 30, 32 },
1124 { 64, 31, 31, 38, 38, 32, 32 },
1125 { 75, 38, 30, 33, 34, 32, 32 },
1126 { 71, 53, 30, 31, 32, 33, 32 },
1127 { 59, 61, 37, 30, 32, 33, 32 },
1128 { 33, 32, 31, 35, 31, 71, 54 },
1129 { 34, 33, 31, 37, 49, 70, 33 },
1130 { 36, 33, 31, 41, 60, 48, 30 },
1131 { 43, 32, 31, 43, 54, 35, 31 },
1132 { 56, 31, 31, 40, 44, 32, 32 },
1133 { 68, 35, 30, 36, 37, 32, 32 },
1134 { 70, 45, 30, 33, 34, 33, 32 },
1135 { 63, 55, 35, 31, 33, 33, 32 },
1136 { 33, 32, 31, 33, 34, 36, 87 },
1137 { 34, 32, 31, 36, 38, 62, 52 },
1138 { 36, 33, 31, 39, 50, 57, 36 },
1139 { 41, 33, 31, 41, 53, 43, 33 },
1140 { 50, 33, 31, 41, 48, 36, 32 },
1141 { 59, 35, 31, 37, 41, 34, 32 },
1142 { 65, 42, 31, 35, 36, 33, 32 },
1143 { 62, 49, 35, 33, 34, 34, 33 }
1144 }
1145 };
1146
1147 98271 const uint8_t* ff_vvc_get_mip_matrix(const int size_id, const int mode_id)
1148 {
1149
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 98271 times.
98271 av_assert0(size_id < 3);
1150
2/2
✓ Branch 0 taken 10369 times.
✓ Branch 1 taken 87902 times.
98271 if (size_id == 0)
1151 10369 return &mip_matrix_4x4[mode_id][0][0];
1152
2/2
✓ Branch 0 taken 45257 times.
✓ Branch 1 taken 42645 times.
87902 if (size_id == 1)
1153 45257 return &mip_matrix_8x8[mode_id][0][0];
1154 42645 return &mip_matrix_16x16[mode_id][0][0];
1155 }
1156
1157 // DCT-8
1158 #define DEFINE_DCT8_P4_MATRIX(a,b,c,d) \
1159 { \
1160 { a, b, c, d }, \
1161 { b, 0, -b, -b }, \
1162 { c, -b, -d, a }, \
1163 { d, -b, a, -c }, \
1164 }
1165
1166 #define DEFINE_DCT8_P8_MATRIX(a,b,c,d,e,f,g,h) \
1167 { \
1168 { a, b, c, d, e, f, g, h }, \
1169 { b, e, h, -g, -d, -a, -c, -f }, \
1170 { c, h, -e, -a, -f, g, b, d }, \
1171 { d, -g, -a, -h, c, e, -f, -b }, \
1172 { e, -d, -f, c, g, -b, -h, a }, \
1173 { f, -a, g, e, -b, h, d, -c }, \
1174 { g, -c, b, -f, -h, d, -a, e }, \
1175 { h, -f, d, -b, a, -c, e, -g }, \
1176 }
1177
1178 #define DEFINE_DCT8_P16_MATRIX(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
1179 { \
1180 { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p }, \
1181 { b, e, h, k, n, 0, -n, -k, -h, -e, -b, -b, -e, -h, -k, -n }, \
1182 { c, h, m, -p, -k, -f, -a, -e, -j, -o, n, i, d, b, g, l }, \
1183 { d, k, -p, -i, -b, -f, -m, n, g, a, h, o, -l, -e, -c, -j }, \
1184 { e, n, -k, -b, -h, 0, h, b, k, -n, -e, -e, -n, k, b, h }, \
1185 { f, 0, -f, -f, 0, f, f, 0, -f, -f, 0, f, f, 0, -f, -f }, \
1186 { g, -n, -a, -m, h, f, -o, -b, -l, i, e, -p, -c, -k, j, d }, \
1187 { h, -k, -e, n, b, 0, -b, -n, e, k, -h, -h, k, e, -n, -b }, \
1188 { i, -h, -j, g, k, -f, -l, e, m, -d, -n, c, o, -b, -p, a }, \
1189 { j, -e, -o, a, -n, -f, i, k, -d, -p, b, -m, -g, h, l, -c }, \
1190 { k, -b, n, h, -e, 0, e, -h, -n, b, -k, -k, b, -n, -h, e }, \
1191 { l, -b, i, o, -e, f, -p, -h, c, -m, -k, a, -j, -n, d, -g }, \
1192 { m, -e, d, -l, -n, f, -c, k, o, -g, b, -j, -p, h, -a, i }, \
1193 { n, -h, b, -e, k, 0, -k, e, -b, h, -n, -n, h, -b, e, -k }, \
1194 { o, -k, g, -c, b, -f, j, -n, -p, l, -h, d, -a, e, -i, m }, \
1195 { p, -n, l, -j, h, -f, d, -b, a, -c, e, -g, i, -k, m, -o }, \
1196 }
1197
1198 #define DEFINE_DCT8_P32_MATRIX(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F) \
1199 { \
1200 { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F }, \
1201 { b, e, h, k, n, q, t, w, z, C, F, -E, -B, -y, -v, -s, -p, -m, -j, -g, -d, -a, -c, -f, -i, -l, -o, -r, -u, -x, -A, -D }, \
1202 { c, h, m, r, w, B, 0, -B, -w, -r, -m, -h, -c, -c, -h, -m, -r, -w, -B, 0, B, w, r, m, h, c, c, h, m, r, w, B }, \
1203 { d, k, r, y, F, -A, -t, -m, -f, -b, -i, -p, -w, -D, C, v, o, h, a, g, n, u, B, -E, -x, -q, -j, -c, -e, -l, -s, -z }, \
1204 { e, n, w, F, -y, -p, -g, -c, -l, -u, -D, A, r, i, a, j, s, B, -C, -t, -k, -b, -h, -q, -z, E, v, m, d, f, o, x }, \
1205 { f, q, B, -A, -p, -e, -g, -r, -C, z, o, d, h, s, D, -y, -n, -c, -i, -t, -E, x, m, b, j, u, F, -w, -l, -a, -k, -v }, \
1206 { g, t, 0, -t, -g, -g, -t, 0, t, g, g, t, 0, -t, -g, -g, -t, 0, t, g, g, t, 0, -t, -g, -g, -t, 0, t, g, g, t }, \
1207 { h, w, -B, -m, -c, -r, 0, r, c, m, B, -w, -h, -h, -w, B, m, c, r, 0, -r, -c, -m, -B, w, h, h, w, -B, -m, -c, -r }, \
1208 { i, z, -w, -f, -l, -C, t, c, o, F, -q, -a, -r, E, n, d, u, -B, -k, -g, -x, y, h, j, A, -v, -e, -m, -D, s, b, p }, \
1209 { j, C, -r, -b, -u, z, g, m, F, -o, -e, -x, w, d, p, -E, -l, -h, -A, t, a, s, -B, -i, -k, -D, q, c, v, -y, -f, -n }, \
1210 { k, F, -m, -i, -D, o, g, B, -q, -e, -z, s, c, x, -u, -a, -v, w, b, t, -y, -d, -r, A, f, p, -C, -h, -n, E, j, l }, \
1211 { l, -E, -h, -p, A, d, t, -w, -a, -x, s, e, B, -o, -i, -F, k, m, -D, -g, -q, z, c, u, -v, -b, -y, r, f, C, -n, -j }, \
1212 { m, -B, -c, -w, r, h, 0, -h, -r, w, c, B, -m, -m, B, c, w, -r, -h, 0, h, r, -w, -c, -B, m, m, -B, -c, -w, r, h }, \
1213 { n, -y, -c, -D, i, s, -t, -h, E, d, x, -o, -m, z, b, C, -j, -r, u, g, -F, -e, -w, p, l, -A, -a, -B, k, q, -v, -f }, \
1214 { o, -v, -h, C, a, D, -g, -w, n, p, -u, -i, B, b, E, -f, -x, m, q, -t, -j, A, c, F, -e, -y, l, r, -s, -k, z, d }, \
1215 { p, -s, -m, v, j, -y, -g, B, d, -E, -a, -F, c, C, -f, -z, i, w, -l, -t, o, q, -r, -n, u, k, -x, -h, A, e, -D, -b }, \
1216 { q, -p, -r, o, s, -n, -t, m, u, -l, -v, k, w, -j, -x, i, y, -h, -z, g, A, -f, -B, e, C, -d, -D, c, E, -b, -F, a }, \
1217 { r, -m, -w, h, B, -c, 0, c, -B, -h, w, m, -r, -r, m, w, -h, -B, c, 0, -c, B, h, -w, -m, r, r, -m, -w, h, B, -c }, \
1218 { s, -j, -B, a, -C, -i, t, r, -k, -A, b, -D, -h, u, q, -l, -z, c, -E, -g, v, p, -m, -y, d, -F, -f, w, o, -n, -x, e }, \
1219 { t, -g, 0, g, -t, -t, g, 0, -g, t, t, -g, 0, g, -t, -t, g, 0, -g, t, t, -g, 0, g, -t, -t, g, 0, -g, t, t, -g }, \
1220 { u, -d, B, n, -k, -E, g, -r, -x, a, -y, -q, h, -F, -j, o, A, -c, v, t, -e, C, m, -l, -D, f, -s, -w, b, -z, -p, i }, \
1221 { v, -a, w, u, -b, x, t, -c, y, s, -d, z, r, -e, A, q, -f, B, p, -g, C, o, -h, D, n, -i, E, m, -j, F, l, -k }, \
1222 { w, -c, r, B, -h, m, 0, -m, h, -B, -r, c, -w, -w, c, -r, -B, h, -m, 0, m, -h, B, r, -c, w, w, -c, r, B, -h, m }, \
1223 { x, -f, m, -E, -q, b, -t, -B, j, -i, A, u, -c, p, F, -n, e, -w, -y, g, -l, D, r, -a, s, C, -k, h, -z, -v, d, -o }, \
1224 { y, -i, h, -x, -z, j, -g, w, A, -k, f, -v, -B, l, -e, u, C, -m, d, -t, -D, n, -c, s, E, -o, b, -r, -F, p, -a, q }, \
1225 { z, -l, c, -q, E, u, -g, h, -v, -D, p, -b, m, -A, -y, k, -d, r, -F, -t, f, -i, w, C, -o, a, -n, B, x, -j, e, -s }, \
1226 { A, -o, c, -j, v, F, -t, h, -e, q, -C, -y, m, -a, l, -x, -D, r, -f, g, -s, E, w, -k, b, -n, z, B, -p, d, -i, u }, \
1227 { B, -r, h, -c, m, -w, 0, w, -m, c, -h, r, -B, -B, r, -h, c, -m, w, 0, -w, m, -c, h, -r, B, B, -r, h, -c, m, -w }, \
1228 { C, -u, m, -e, d, -l, t, -B, -D, v, -n, f, -c, k, -s, A, E, -w, o, -g, b, -j, r, -z, -F, x, -p, h, -a, i, -q, y }, \
1229 { D, -x, r, -l, f, -a, g, -m, s, -y, E, C, -w, q, -k, e, -b, h, -n, t, -z, F, B, -v, p, -j, d, -c, i, -o, u, -A }, \
1230 { E, -A, w, -s, o, -k, g, -c, b, -f, j, -n, r, -v, z, -D, -F, B, -x, t, -p, l, -h, d, -a, e, -i, m, -q, u, -y, C }, \
1231 { F, -D, B, -z, x, -v, t, -r, p, -n, l, -j, h, -f, d, -b, a, -c, e, -g, i, -k, m, -o, q, -s, u, -w, y, -A, C, -E }, \
1232 }
1233
1234 const int8_t ff_vvc_dct8_4x4[4][4] = DEFINE_DCT8_P4_MATRIX(84, 74, 55, 29);
1235 const int8_t ff_vvc_dct8_8x8[8][8] = DEFINE_DCT8_P8_MATRIX(86, 85, 78, 71, 60, 46, 32, 17);
1236 const int8_t ff_vvc_dct8_16x16[16][16] = DEFINE_DCT8_P16_MATRIX(88, 88, 87, 85, 81, 77, 73, 68, 62, 55, 48, 40, 33, 25, 17, 8);
1237 const int8_t ff_vvc_dct8_32x32[32][32] = DEFINE_DCT8_P32_MATRIX(90, 90, 89, 88, 87, 86, 85, 84, 82, 80, 78, 77, 74, 72, 68, 66, 63, 60, 56, 53, 50, 46, 42, 38, 34, 30, 26, 21, 17, 13, 9, 4);
1238
1239 // DST-7
1240 #define DEFINE_DST7_P4_MATRIX(a,b,c,d) \
1241 { \
1242 { a, b, c, d }, \
1243 { c, c, 0, -c }, \
1244 { d, -a, -c, b }, \
1245 { b, -d, c, -a }, \
1246 }
1247
1248 #define DEFINE_DST7_P8_MATRIX(a,b,c,d,e,f,g,h) \
1249 { \
1250 { a, b, c, d, e, f, g, h }, \
1251 { c, f, h, e, b, -a, -d, -g }, \
1252 { e, g, b, -c, -h, -d, a, f }, \
1253 { g, c, -d, -f, a, h, b, -e }, \
1254 { h, -a, -g, b, f, -c, -e, d }, \
1255 { f, -e, -a, g, -d, -b, h, -c }, \
1256 { d, -h, e, -a, -c, g, -f, b }, \
1257 { b, -d, f, -h, g, -e, c, -a }, \
1258 }
1259
1260 #define DEFINE_DST7_P16_MATRIX(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
1261 { \
1262 { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p }, \
1263 { c, f, i, l, o, o, l, i, f, c, 0, -c, -f, -i, -l, -o }, \
1264 { e, j, o, m, h, c, -b, -g, -l, -p, -k, -f, -a, d, i, n }, \
1265 { g, n, l, e, -b, -i, -p, -j, -c, d, k, o, h, a, -f, -m }, \
1266 { i, o, f, -c, -l, -l, -c, f, o, i, 0, -i, -o, -f, c, l }, \
1267 { k, k, 0, -k, -k, 0, k, k, 0, -k, -k, 0, k, k, 0, -k }, \
1268 { m, g, -f, -n, -a, l, h, -e, -o, -b, k, i, -d, -p, -c, j }, \
1269 { o, c, -l, -f, i, i, -f, -l, c, o, 0, -o, -c, l, f, -i }, \
1270 { p, -a, -o, b, n, -c, -m, d, l, -e, -k, f, j, -g, -i, h }, \
1271 { n, -e, -i, j, d, -o, a, m, -f, -h, k, c, -p, b, l, -g }, \
1272 { l, -i, -c, o, -f, -f, o, -c, -i, l, 0, -l, i, c, -o, f }, \
1273 { j, -m, c, g, -p, f, d, -n, i, a, -k, l, -b, -h, o, -e }, \
1274 { h, -p, i, -a, -g, o, -j, b, f, -n, k, -c, -e, m, -l, d }, \
1275 { f, -l, o, -i, c, c, -i, o, -l, f, 0, -f, l, -o, i, -c }, \
1276 { d, -h, l, -p, m, -i, e, -a, -c, g, -k, o, -n, j, -f, b }, \
1277 { b, -d, f, -h, j, -l, n, -p, o, -m, k, -i, g, -e, c, -a }, \
1278 }
1279
1280 #define DEFINE_DST7_P32_MATRIX(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F) \
1281 { \
1282 { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F }, \
1283 { c, f, i, l, o, r, u, x, A, D, F, C, z, w, t, q, n, k, h, e, b, -a, -d, -g, -j, -m, -p, -s, -v, -y, -B, -E }, \
1284 { e, j, o, t, y, D, D, y, t, o, j, e, 0, -e, -j, -o, -t, -y, -D, -D, -y, -t, -o, -j, -e, 0, e, j, o, t, y, D }, \
1285 { g, n, u, B, D, w, p, i, b, -e, -l, -s, -z, -F, -y, -r, -k, -d, c, j, q, x, E, A, t, m, f, -a, -h, -o, -v, -C }, \
1286 { i, r, A, C, t, k, b, -g, -p, -y, -E, -v, -m, -d, e, n, w, F, x, o, f, -c, -l, -u, -D, -z, -q, -h, a, j, s, B }, \
1287 { k, v, F, u, j, -a, -l, -w, -E, -t, -i, b, m, x, D, s, h, -c, -n, -y, -C, -r, -g, d, o, z, B, q, f, -e, -p, -A }, \
1288 { m, z, z, m, 0, -m, -z, -z, -m, 0, m, z, z, m, 0, -m, -z, -z, -m, 0, m, z, z, m, 0, -m, -z, -z, -m, 0, m, z }, \
1289 { o, D, t, e, -j, -y, -y, -j, e, t, D, o, 0, -o, -D, -t, -e, j, y, y, j, -e, -t, -D, -o, 0, o, D, t, e, -j, -y }, \
1290 { q, E, n, -c, -t, -B, -k, f, w, y, h, -i, -z, -v, -e, l, C, s, b, -o, -F, -p, a, r, D, m, -d, -u, -A, -j, g, x }, \
1291 { s, A, h, -k, -D, -p, c, v, x, e, -n, -F, -m, f, y, u, b, -q, -C, -j, i, B, r, -a, -t, -z, -g, l, E, o, -d, -w }, \
1292 { u, w, b, -s, -y, -d, q, A, f, -o, -C, -h, m, E, j, -k, -F, -l, i, D, n, -g, -B, -p, e, z, r, -c, -x, -t, a, v }, \
1293 { w, s, -d, -A, -o, h, E, k, -l, -D, -g, p, z, c, -t, -v, a, x, r, -e, -B, -n, i, F, j, -m, -C, -f, q, y, b, -u }, \
1294 { y, o, -j, -D, -e, t, t, -e, -D, -j, o, y, 0, -y, -o, j, D, e, -t, -t, e, D, j, -o, -y, 0, y, o, -j, -D, -e, t }, \
1295 { A, k, -p, -v, e, F, f, -u, -q, j, B, a, -z, -l, o, w, -d, -E, -g, t, r, -i, -C, -b, y, m, -n, -x, c, D, h, -s }, \
1296 { C, g, -v, -n, o, u, -h, -B, a, D, f, -w, -m, p, t, -i, -A, b, E, e, -x, -l, q, s, -j, -z, c, F, d, -y, -k, r }, \
1297 { E, c, -B, -f, y, i, -v, -l, s, o, -p, -r, m, u, -j, -x, g, A, -d, -D, a, F, b, -C, -e, z, h, -w, -k, t, n, -q }, \
1298 { F, -a, -E, b, D, -c, -C, d, B, -e, -A, f, z, -g, -y, h, x, -i, -w, j, v, -k, -u, l, t, -m, -s, n, r, -o, -q, p }, \
1299 { D, -e, -y, j, t, -o, -o, t, j, -y, -e, D, 0, -D, e, y, -j, -t, o, o, -t, -j, y, e, -D, 0, D, -e, -y, j, t, -o }, \
1300 { B, -i, -s, r, j, -A, -a, C, -h, -t, q, k, -z, -b, D, -g, -u, p, l, -y, -c, E, -f, -v, o, m, -x, -d, F, -e, -w, n }, \
1301 { z, -m, -m, z, 0, -z, m, m, -z, 0, z, -m, -m, z, 0, -z, m, m, -z, 0, z, -m, -m, z, 0, -z, m, m, -z, 0, z, -m }, \
1302 { x, -q, -g, E, -j, -n, A, -c, -u, t, d, -B, m, k, -D, f, r, -w, -a, y, -p, -h, F, -i, -o, z, -b, -v, s, e, -C, l }, \
1303 { v, -u, -a, w, -t, -b, x, -s, -c, y, -r, -d, z, -q, -e, A, -p, -f, B, -o, -g, C, -n, -h, D, -m, -i, E, -l, -j, F, -k }, \
1304 { t, -y, e, o, -D, j, j, -D, o, e, -y, t, 0, -t, y, -e, -o, D, -j, -j, D, -o, -e, y, -t, 0, t, -y, e, o, -D, j }, \
1305 { r, -C, k, g, -y, v, -d, -n, F, -o, -c, u, -z, h, j, -B, s, -a, -q, D, -l, -f, x, -w, e, m, -E, p, b, -t, A, -i }, \
1306 { p, -F, q, -a, -o, E, -r, b, n, -D, s, -c, -m, C, -t, d, l, -B, u, -e, -k, A, -v, f, j, -z, w, -g, -i, y, -x, h }, \
1307 { n, -B, w, -i, -e, s, -F, r, -d, -j, x, -A, m, a, -o, C, -v, h, f, -t, E, -q, c, k, -y, z, -l, -b, p, -D, u, -g }, \
1308 { l, -x, C, -q, e, g, -s, E, -v, j, b, -n, z, -A, o, -c, -i, u, -F, t, -h, -d, p, -B, y, -m, a, k, -w, D, -r, f }, \
1309 { j, -t, D, -y, o, -e, -e, o, -y, D, -t, j, 0, -j, t, -D, y, -o, e, e, -o, y, -D, t, -j, 0, j, -t, D, -y, o, -e }, \
1310 { h, -p, x, -F, y, -q, i, -a, -g, o, -w, E, -z, r, -j, b, f, -n, v, -D, A, -s, k, -c, -e, m, -u, C, -B, t, -l, d }, \
1311 { f, -l, r, -x, D, -C, w, -q, k, -e, -a, g, -m, s, -y, E, -B, v, -p, j, -d, -b, h, -n, t, -z, F, -A, u, -o, i, -c }, \
1312 { d, -h, l, -p, t, -x, B, -F, C, -y, u, -q, m, -i, e, -a, -c, g, -k, o, -s, w, -A, E, -D, z, -v, r, -n, j, -f, b }, \
1313 { b, -d, f, -h, j, -l, n, -p, r, -t, v, -x, z, -B, D, -F, E, -C, A, -y, w, -u, s, -q, o, -m, k, -i, g, -e, c, -a }, \
1314 }
1315
1316 const int8_t ff_vvc_dst7_4x4[4][4] = DEFINE_DST7_P4_MATRIX (29, 55, 74, 84);
1317 const int8_t ff_vvc_dst7_8x8[8][8] = DEFINE_DST7_P8_MATRIX (17, 32, 46, 60, 71, 78, 85, 86);
1318 const int8_t ff_vvc_dst7_16x16[16][16] = DEFINE_DST7_P16_MATRIX( 8, 17, 25, 33, 40, 48, 55, 62, 68, 73, 77, 81, 85, 87, 88, 88);
1319 const int8_t ff_vvc_dst7_32x32[32][32] = DEFINE_DST7_P32_MATRIX( 4, 9, 13, 17, 21, 26, 30, 34, 38, 42, 46, 50, 53, 56, 60, 63, 66, 68, 72, 74, 77, 78, 80, 82, 84, 85, 86, 87, 88, 89, 90, 90);
1320
1321 const int8_t ff_vvc_lfnst_8x8[4][2][16][48] = {
1322 { //0
1323 {
1324 { -117, 28, 18, 2, 4, 1, 2, 1, 32, -18, -2, 0, -1, 0, 0, 0, 14, -1, -3, 0, -1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 },
1325 { -29, -91, 47, 1, 9, 0, 3, 0, -54, 26, -8, 3, 0, 1, 0, 0, 33, 5, -9, -1, -2, 0, -1, 0, -3, 3, 0, 0, 0, 0, 0, 0, 7, 2, -2, 0, -1, 1, 0, 0, 2, 1, -1, 0, 0, 0, 0, 0 },
1326 { -10, 62, -11, -8, -2, -2, -1, -1, -95, 3, 32, 0, 4, 0, 2, 0, 32, -30, -4, 4, -1, 1, 0, 0, 6, 2, -5, 0, 0, 0, 0, 0, 6, -3, 0, 0, 2, 0, -1, 0, 2, -1, 0, 0, 1, 0, 0, 0 },
1327 { -15, 15, -10, -2, 1, 0, 1, 0, 10, 112, -20, -17, -4, -4, -1, -2, -20, -26, 31, 1, 0, 0, 0, 0, 2, -16, -1, 6, 0, 1, 0, 0, 1, -4, 0, 0, 0, -3, 0, 1, 0, -1, 0, 0, 0, -2, 0, 0 },
1328 { 32, 39, 92, -44, 4, -10, 1, -4, 26, 12, -15, 13, -5, 2, -2, 0, 29, -16, -22, 8, 0, 1, 0, 1, -20, 6, 4, -3, 1, 0, 0, 0, 1, -4, -3, 2, -4, 1, 0, 0, 1, -1, -2, 1, -2, 0, 0, 0 },
1329 { -10, 1, 50, -15, 2, -3, 1, -1, -28, -15, 14, 6, 1, 1, 1, 0, -99, -4, 9, 5, 5, 2, 2, 1, 44, -10, -11, 1, -2, 0, -1, 0, -5, 4, -3, 0, 8, -1, -2, 0, -2, 1, -1, 0, 4, 0, -1, 0 },
1330 { 1, -33, -11, -14, 7, -2, 2, 0, 29, -12, 37, -7, -4, 0, -1, 0, 6, -99, 3, 26, -1, 5, 0, 2, 14, 30, -27, -2, 1, -1, 0, -1, -6, 6, 6, -3, 1, 3, -3, 0, -1, 1, 1, 0, 0, 1, -1, 0 },
1331 { 0, 6, -6, 21, -4, 2, 0, 0, -20, -24, -104, 30, 5, 5, 1, 2, -7, -46, 10, -14, 7, 0, 1, 0, 9, 21, 7, -6, -2, -1, 0, -1, 2, 2, 5, -2, 0, 3, 4, -1, 0, 0, 1, 0, 0, 1, 2, -1 },
1332 { -13, -13, -37, -101, 29, -11, 8, -3, -12, -15, -20, 2, -11, 5, -2, 1, -12, 10, 26, 12, -6, 0, -1, 0, -32, -2, 11, 3, 3, -1, 1, 0, 11, -5, -1, 6, -4, 2, 1, 0, 3, -1, 1, 2, -1, 0, 0, 0 },
1333 { 6, 1, -14, -36, 9, -3, 2, 0, 10, 9, -18, -1, -3, 1, 0, 0, 38, 26, -13, -1, -5, -1, -1, 0, 102, 3, -14, -1, -5, -1, -2, 0, -29, 10, 10, 0, 10, -4, -1, 1, -7, 1, 2, 1, 2, -1, 0, 0 },
1334 { -12, -2, -26, -12, -9, 2, -1, 1, -3, 30, 4, 34, -4, 0, -1, 0, -30, 3, -92, 14, 19, 0, 3, 0, -11, 34, 21, -33, 1, -2, 0, -1, -9, -4, 18, 3, 2, 0, 0, -2, -1, -1, 3, 0, 0, 0, 0, -1 },
1335 { 0, -3, 0, -4, -15, 6, -3, 1, -7, -15, -28, -86, 19, -5, 4, -1, -5, -17, -41, 42, -6, 2, -1, 1, -1, -40, 37, 13, -4, 2, -1, 1, -10, 13, -1, -4, 4, -4, 3, 4, -2, 2, -1, -1, 1, -1, 1, 2 },
1336 { -1, 9, 13, 5, 14, -2, 2, -1, -8, 3, -4, -62, 4, 1, 1, 0, -12, 23, 16, -11, -17, 0, -1, 0, -11, 97, -3, -3, 0, -6, 0, -2, -21, -5, 23, 0, 2, -2, -1, 6, -3, -3, 1, 0, 0, 0, 0, 2 },
1337 { 6, 2, -3, 2, 10, -1, 2, 0, 8, 3, -1, -20, 0, 1, 0, 0, -4, 4, -16, 0, -2, 0, 1, 0, 34, 23, 6, -7, -4, -2, -1, 0, 108, -5, -30, 6, -27, 10, 7, -2, 11, -3, -1, 1, -4, 1, 0, 1 },
1338 { 6, 9, -2, 35, 110, -22, 11, -4, -2, 0, -3, 1, -18, 12, -3, 2, -5, -4, -22, 8, -25, 3, 0, 0, -3, -21, 2, -3, 9, -2, 1, 0, -7, 1, 3, -5, 3, 0, -1, 0, 0, 1, 0, -1, 1, 0, 0, 0 },
1339 { -1, 7, -2, 9, -11, 5, -1, 1, -7, 2, -22, 4, -13, 0, -1, 0, 0, 28, 0, 76, 4, -6, 0, -2, -13, 5, -76, -4, 33, -1, 3, 0, 9, 18, -3, -35, -4, -1, 6, 1, 1, 2, 0, -3, -1, 0, 2, 0 },
1340 },
1341 {
1342 { -108, 48, 9, 1, 1, 1, 0, 0, 44, -6, -9, -1, -1, 0, -1, 0, 9, -9, -1, 1, 0, 0, 0, 0, 3, -1, 1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0 },
1343 { 55, 66, -37, -5, -6, -1, -2, 0, 67, -30, -20, 4, -2, 0, -1, 0, -31, -19, 14, 4, 1, 1, 1, 0, -6, 3, 5, -2, 0, 0, 0, 0, -7, -1, 1, 0, -1, 1, 1, 0, -2, -1, 1, 0, 0, 0, 0, 0 },
1344 { 2, 86, -21, -13, -4, -2, -1, -1, -88, 5, 6, 4, 5, 1, 1, 0, 14, -5, 0, 3, 0, 0, 0, 0, 10, -5, -2, 0, -1, 0, 0, 0, 6, -5, 0, 1, 2, -1, 0, 0, 1, -1, 0, 0, 1, 0, 0, 0 },
1345 { -24, -21, -38, 19, 0, 4, -1, 2, -23, -89, 31, 20, 2, 3, 1, 1, -30, 26, 36, -8, -2, -2, 0, -1, 14, 18, -7, -9, -1, -1, 0, 0, 1, 3, -2, -1, 3, 2, -2, -1, 0, 1, 0, 0, 1, 1, -1, 0 },
1346 { 9, 20, 98, -26, -3, -5, 0, -2, -9, -26, 15, -16, 2, 0, 1, 0, -61, -3, -2, 3, 7, 1, 1, 0, 12, 16, -6, -1, 0, -1, 0, 0, 2, 0, -8, 1, 3, 1, -1, 1, 0, -1, -2, 0, 1, 0, -1, 0 },
1347 { -21, -7, -37, 10, 2, 2, -1, 1, -10, 69, -5, -7, -2, -2, 0, -1, -93, 2, 19, 0, 3, 0, 2, 0, 17, 4, 0, 0, -1, 0, 0, 0, 5, -4, -2, 0, 4, -2, 0, 1, 0, 0, 0, 0, 2, -1, 0, 0 },
1348 { -10, -25, 4, -17, 8, -2, 2, -1, -27, -17, -71, 25, 8, 2, 1, 1, -4, -66, 28, 36, -5, 3, 0, 1, -10, 20, 33, -13, -8, 0, 0, -1, 3, 6, -3, -7, -1, 3, 3, -1, 1, 0, -1, 0, 0, 1, 1, -1 },
1349 { 2, 5, 10, 64, -9, 4, -3, 1, -4, 8, 62, 3, -17, 1, -2, 0, -3, -75, 5, -14, 1, 4, 0, 1, -36, 3, 18, -4, 4, 0, 1, 0, 1, 14, -2, -8, -2, 1, -3, 0, 2, 2, -1, -2, 0, 1, -1, 0 },
1350 { -11, -15, -28, -97, 6, -1, 4, -1, 7, 3, 57, -15, 10, -2, 0, -1, -1, -27, 13, 6, 1, -1, 0, 0, -34, -6, 0, 3, 4, 1, 2, 0, -2, 8, 1, 5, -2, 0, -3, 1, 1, 1, 0, 2, -1, 0, -1, 0 },
1351 { 9, 13, 24, -6, 7, -2, 1, -1, 16, 39, 20, 47, -2, -2, -2, 0, 28, 23, 76, -5, -25, -3, -3, -1, 6, 36, -7, -39, -4, -1, 0, -1, 2, -4, -18, -3, -1, -1, -2, -2, 1, -2, -2, 0, 0, 0, -1, -1 },
1352 { -7, 11, 12, 7, 2, -1, 0, -1, -14, -1, -24, 11, 2, 0, 0, 0, -20, 48, 11, -13, -5, -2, 0, -1, -105, -19, 17, 0, 6, 2, 3, 0, -14, 8, 8, 2, 1, 2, -1, -2, 3, 0, -1, 0, 0, 0, 0, 0 },
1353 { 0, 0, 7, -6, 23, -3, 3, -1, 5, 1, 18, 96, 13, -9, -1, -1, -21, -7, -42, 14, -24, -3, 0, 0, 11, -47, -7, 3, -5, 9, 1, 2, 0, -1, 19, -1, 1, 0, -1, -6, -1, 1, 2, 0, 1, 0, 0, -2 },
1354 { -2, -6, -1, -10, 0, 1, 1, 0, -7, -2, -28, 20, -15, 4, -3, 1, -2, -32, -2, -66, 3, 7, 1, 2, -11, 13, -70, 5, 43, -2, 3, 0, 8, -14, -3, 43, -1, 2, 7, -1, 1, -2, 1, 3, -1, 1, 1, 0 },
1355 { -1, 6, -16, 0, 24, -3, 1, -1, 2, 6, 6, 16, 18, -7, 1, -1, -3, 11, -63, 9, 4, -5, 2, -1, -22, 94, -4, -6, -4, -4, 1, -2, 10, 23, -19, -5, 0, -6, -4, 6, 3, -2, 1, 1, 0, -1, 0, 0 },
1356 { -5, -6, -3, -19, -104, 18, -4, 3, 0, 6, 0, 35, -41, 20, -2, 2, -2, 10, -18, 16, 21, 3, -2, 0, -2, 11, 6, -10, 6, -3, -1, 0, -1, 5, -1, -6, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1 },
1357 { -1, -2, 0, 23, -9, 0, -2, 0, 1, 1, 8, -1, 29, 1, 1, 0, 3, -6, 13, 76, 30, -11, -1, -2, -26, -8, -69, 7, -9, -7, 3, -1, -10, -34, -25, 13, -1, 0, 11, 5, 1, -1, 1, -2, 0, 0, 2, 0 },
1358 }
1359 },
1360 { //1
1361 {
1362 { 110, -49, -3, -4, -1, -1, 0, -1, -38, -1, 10, 0, 2, 0, 1, 0, -9, 13, 1, -2, 0, 0, 0, 0, -4, 2, -3, 0, 0, 0, 0, 0, -2, 2, 0, 1, -1, 1, 0, 0, -1, 1, 0, 0, -1, 0, 0, 0 },
1363 { -43, -19, 17, -1, 3, 0, 1, 0, -98, 46, 14, -1, 2, 0, 1, 0, 26, 26, -15, -3, -2, -1, -1, 0, 11, -7, -9, 2, 0, 0, 0, 0, 9, -3, -1, 2, 3, -3, 0, 0, 4, -1, 0, 0, 2, -1, 0, 0 },
1364 { -19, 17, -7, 3, -2, 1, -1, 0, -32, -59, 29, 3, 4, 0, 2, 0, -72, 43, 34, -9, 3, -2, 1, -1, 13, 36, -18, -10, 0, -2, 0, -1, 3, 0, -12, 3, 6, 1, -3, 2, 1, -1, -2, 0, 3, 1, -1, 1 },
1365 { -35, -103, 39, 1, 7, 0, 2, 0, 38, -13, 25, -6, 1, -1, 0, 0, -1,