FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/vp9dsp_template.c
Date: 2024-04-19 17:50:32
Exec Total Coverage
Lines: 1360 1392 97.7%
Functions: 274 308 89.0%
Branches: 326 337 96.7%

Line Branch Exec Source
1 /*
2 * VP9 compatible video decoder
3 *
4 * Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
5 * Copyright (C) 2013 Clément Bœsch <u pkh me>
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #include "libavutil/common.h"
25 #include "bit_depth_template.c"
26 #include "vp9dsp.h"
27
28 #if BIT_DEPTH != 12
29
30 // FIXME see whether we can merge parts of this (perhaps at least 4x4 and 8x8)
31 // back with h264pred.[ch]
32
33 127788 static void vert_4x4_c(uint8_t *_dst, ptrdiff_t stride,
34 const uint8_t *left, const uint8_t *_top)
35 {
36 127788 pixel *dst = (pixel *) _dst;
37 127788 const pixel *top = (const pixel *) _top;
38 127788 pixel4 p4 = AV_RN4PA(top);
39
40 127788 stride /= sizeof(pixel);
41 127788 AV_WN4PA(dst + stride * 0, p4);
42 127788 AV_WN4PA(dst + stride * 1, p4);
43 127788 AV_WN4PA(dst + stride * 2, p4);
44 127788 AV_WN4PA(dst + stride * 3, p4);
45 127788 }
46
47 27099 static void vert_8x8_c(uint8_t *_dst, ptrdiff_t stride,
48 const uint8_t *left, const uint8_t *_top)
49 {
50 27099 pixel *dst = (pixel *) _dst;
51 27099 const pixel *top = (const pixel *) _top;
52 27099 pixel4 p4a = AV_RN4PA(top + 0);
53 27099 pixel4 p4b = AV_RN4PA(top + 4);
54 int y;
55
56 27099 stride /= sizeof(pixel);
57
2/2
✓ Branch 0 taken 216792 times.
✓ Branch 1 taken 27099 times.
243891 for (y = 0; y < 8; y++) {
58 216792 AV_WN4PA(dst + 0, p4a);
59 216792 AV_WN4PA(dst + 4, p4b);
60 216792 dst += stride;
61 }
62 27099 }
63
64 6390 static void vert_16x16_c(uint8_t *_dst, ptrdiff_t stride,
65 const uint8_t *left, const uint8_t *_top)
66 {
67 6390 pixel *dst = (pixel *) _dst;
68 6390 const pixel *top = (const pixel *) _top;
69 6390 pixel4 p4a = AV_RN4PA(top + 0);
70 6390 pixel4 p4b = AV_RN4PA(top + 4);
71 6390 pixel4 p4c = AV_RN4PA(top + 8);
72 6390 pixel4 p4d = AV_RN4PA(top + 12);
73 int y;
74
75 6390 stride /= sizeof(pixel);
76
2/2
✓ Branch 0 taken 102240 times.
✓ Branch 1 taken 6390 times.
108630 for (y = 0; y < 16; y++) {
77 102240 AV_WN4PA(dst + 0, p4a);
78 102240 AV_WN4PA(dst + 4, p4b);
79 102240 AV_WN4PA(dst + 8, p4c);
80 102240 AV_WN4PA(dst + 12, p4d);
81 102240 dst += stride;
82 }
83 6390 }
84
85 1042 static void vert_32x32_c(uint8_t *_dst, ptrdiff_t stride,
86 const uint8_t *left, const uint8_t *_top)
87 {
88 1042 pixel *dst = (pixel *) _dst;
89 1042 const pixel *top = (const pixel *) _top;
90 1042 pixel4 p4a = AV_RN4PA(top + 0);
91 1042 pixel4 p4b = AV_RN4PA(top + 4);
92 1042 pixel4 p4c = AV_RN4PA(top + 8);
93 1042 pixel4 p4d = AV_RN4PA(top + 12);
94 1042 pixel4 p4e = AV_RN4PA(top + 16);
95 1042 pixel4 p4f = AV_RN4PA(top + 20);
96 1042 pixel4 p4g = AV_RN4PA(top + 24);
97 1042 pixel4 p4h = AV_RN4PA(top + 28);
98 int y;
99
100 1042 stride /= sizeof(pixel);
101
2/2
✓ Branch 0 taken 33344 times.
✓ Branch 1 taken 1042 times.
34386 for (y = 0; y < 32; y++) {
102 33344 AV_WN4PA(dst + 0, p4a);
103 33344 AV_WN4PA(dst + 4, p4b);
104 33344 AV_WN4PA(dst + 8, p4c);
105 33344 AV_WN4PA(dst + 12, p4d);
106 33344 AV_WN4PA(dst + 16, p4e);
107 33344 AV_WN4PA(dst + 20, p4f);
108 33344 AV_WN4PA(dst + 24, p4g);
109 33344 AV_WN4PA(dst + 28, p4h);
110 33344 dst += stride;
111 }
112 1042 }
113
114 278319 static void hor_4x4_c(uint8_t *_dst, ptrdiff_t stride,
115 const uint8_t *_left, const uint8_t *top)
116 {
117 278319 pixel *dst = (pixel *) _dst;
118 278319 const pixel *left = (const pixel *) _left;
119
120 278319 stride /= sizeof(pixel);
121 278319 AV_WN4PA(dst + stride * 0, PIXEL_SPLAT_X4(left[3]));
122 278319 AV_WN4PA(dst + stride * 1, PIXEL_SPLAT_X4(left[2]));
123 278319 AV_WN4PA(dst + stride * 2, PIXEL_SPLAT_X4(left[1]));
124 278319 AV_WN4PA(dst + stride * 3, PIXEL_SPLAT_X4(left[0]));
125 278319 }
126
127 74390 static void hor_8x8_c(uint8_t *_dst, ptrdiff_t stride,
128 const uint8_t *_left, const uint8_t *top)
129 {
130 74390 pixel *dst = (pixel *) _dst;
131 74390 const pixel *left = (const pixel *) _left;
132 int y;
133
134 74390 stride /= sizeof(pixel);
135
2/2
✓ Branch 0 taken 595120 times.
✓ Branch 1 taken 74390 times.
669510 for (y = 0; y < 8; y++) {
136 595120 pixel4 p4 = PIXEL_SPLAT_X4(left[7 - y]);
137
138 595120 AV_WN4PA(dst + 0, p4);
139 595120 AV_WN4PA(dst + 4, p4);
140 595120 dst += stride;
141 }
142 74390 }
143
144 13695 static void hor_16x16_c(uint8_t *_dst, ptrdiff_t stride,
145 const uint8_t *_left, const uint8_t *top)
146 {
147 13695 pixel *dst = (pixel *) _dst;
148 13695 const pixel *left = (const pixel *) _left;
149 int y;
150
151 13695 stride /= sizeof(pixel);
152
2/2
✓ Branch 0 taken 219120 times.
✓ Branch 1 taken 13695 times.
232815 for (y = 0; y < 16; y++) {
153 219120 pixel4 p4 = PIXEL_SPLAT_X4(left[15 - y]);
154
155 219120 AV_WN4PA(dst + 0, p4);
156 219120 AV_WN4PA(dst + 4, p4);
157 219120 AV_WN4PA(dst + 8, p4);
158 219120 AV_WN4PA(dst + 12, p4);
159 219120 dst += stride;
160 }
161 13695 }
162
163 1474 static void hor_32x32_c(uint8_t *_dst, ptrdiff_t stride,
164 const uint8_t *_left, const uint8_t *top)
165 {
166 1474 pixel *dst = (pixel *) _dst;
167 1474 const pixel *left = (const pixel *) _left;
168 int y;
169
170 1474 stride /= sizeof(pixel);
171
2/2
✓ Branch 0 taken 47168 times.
✓ Branch 1 taken 1474 times.
48642 for (y = 0; y < 32; y++) {
172 47168 pixel4 p4 = PIXEL_SPLAT_X4(left[31 - y]);
173
174 47168 AV_WN4PA(dst + 0, p4);
175 47168 AV_WN4PA(dst + 4, p4);
176 47168 AV_WN4PA(dst + 8, p4);
177 47168 AV_WN4PA(dst + 12, p4);
178 47168 AV_WN4PA(dst + 16, p4);
179 47168 AV_WN4PA(dst + 20, p4);
180 47168 AV_WN4PA(dst + 24, p4);
181 47168 AV_WN4PA(dst + 28, p4);
182 47168 dst += stride;
183 }
184 1474 }
185
186 #endif /* BIT_DEPTH != 12 */
187
188 78331 static void tm_4x4_c(uint8_t *_dst, ptrdiff_t stride,
189 const uint8_t *_left, const uint8_t *_top)
190 {
191 78331 pixel *dst = (pixel *) _dst;
192 78331 const pixel *left = (const pixel *) _left;
193 78331 const pixel *top = (const pixel *) _top;
194 78331 int y, tl = top[-1];
195
196 78331 stride /= sizeof(pixel);
197
2/2
✓ Branch 0 taken 313324 times.
✓ Branch 1 taken 78331 times.
391655 for (y = 0; y < 4; y++) {
198 313324 int l_m_tl = left[3 - y] - tl;
199
200 313324 dst[0] = av_clip_pixel(top[0] + l_m_tl);
201 313324 dst[1] = av_clip_pixel(top[1] + l_m_tl);
202 313324 dst[2] = av_clip_pixel(top[2] + l_m_tl);
203 313324 dst[3] = av_clip_pixel(top[3] + l_m_tl);
204 313324 dst += stride;
205 }
206 78331 }
207
208 20021 static void tm_8x8_c(uint8_t *_dst, ptrdiff_t stride,
209 const uint8_t *_left, const uint8_t *_top)
210 {
211 20021 pixel *dst = (pixel *) _dst;
212 20021 const pixel *left = (const pixel *) _left;
213 20021 const pixel *top = (const pixel *) _top;
214 20021 int y, tl = top[-1];
215
216 20021 stride /= sizeof(pixel);
217
2/2
✓ Branch 0 taken 160168 times.
✓ Branch 1 taken 20021 times.
180189 for (y = 0; y < 8; y++) {
218 160168 int l_m_tl = left[7 - y] - tl;
219
220 160168 dst[0] = av_clip_pixel(top[0] + l_m_tl);
221 160168 dst[1] = av_clip_pixel(top[1] + l_m_tl);
222 160168 dst[2] = av_clip_pixel(top[2] + l_m_tl);
223 160168 dst[3] = av_clip_pixel(top[3] + l_m_tl);
224 160168 dst[4] = av_clip_pixel(top[4] + l_m_tl);
225 160168 dst[5] = av_clip_pixel(top[5] + l_m_tl);
226 160168 dst[6] = av_clip_pixel(top[6] + l_m_tl);
227 160168 dst[7] = av_clip_pixel(top[7] + l_m_tl);
228 160168 dst += stride;
229 }
230 20021 }
231
232 2568 static void tm_16x16_c(uint8_t *_dst, ptrdiff_t stride,
233 const uint8_t *_left, const uint8_t *_top)
234 {
235 2568 pixel *dst = (pixel *) _dst;
236 2568 const pixel *left = (const pixel *) _left;
237 2568 const pixel *top = (const pixel *) _top;
238 2568 int y, tl = top[-1];
239
240 2568 stride /= sizeof(pixel);
241
2/2
✓ Branch 0 taken 41088 times.
✓ Branch 1 taken 2568 times.
43656 for (y = 0; y < 16; y++) {
242 41088 int l_m_tl = left[15 - y] - tl;
243
244 41088 dst[ 0] = av_clip_pixel(top[ 0] + l_m_tl);
245 41088 dst[ 1] = av_clip_pixel(top[ 1] + l_m_tl);
246 41088 dst[ 2] = av_clip_pixel(top[ 2] + l_m_tl);
247 41088 dst[ 3] = av_clip_pixel(top[ 3] + l_m_tl);
248 41088 dst[ 4] = av_clip_pixel(top[ 4] + l_m_tl);
249 41088 dst[ 5] = av_clip_pixel(top[ 5] + l_m_tl);
250 41088 dst[ 6] = av_clip_pixel(top[ 6] + l_m_tl);
251 41088 dst[ 7] = av_clip_pixel(top[ 7] + l_m_tl);
252 41088 dst[ 8] = av_clip_pixel(top[ 8] + l_m_tl);
253 41088 dst[ 9] = av_clip_pixel(top[ 9] + l_m_tl);
254 41088 dst[10] = av_clip_pixel(top[10] + l_m_tl);
255 41088 dst[11] = av_clip_pixel(top[11] + l_m_tl);
256 41088 dst[12] = av_clip_pixel(top[12] + l_m_tl);
257 41088 dst[13] = av_clip_pixel(top[13] + l_m_tl);
258 41088 dst[14] = av_clip_pixel(top[14] + l_m_tl);
259 41088 dst[15] = av_clip_pixel(top[15] + l_m_tl);
260 41088 dst += stride;
261 }
262 2568 }
263
264 386 static void tm_32x32_c(uint8_t *_dst, ptrdiff_t stride,
265 const uint8_t *_left, const uint8_t *_top)
266 {
267 386 pixel *dst = (pixel *) _dst;
268 386 const pixel *left = (const pixel *) _left;
269 386 const pixel *top = (const pixel *) _top;
270 386 int y, tl = top[-1];
271
272 386 stride /= sizeof(pixel);
273
2/2
✓ Branch 0 taken 12352 times.
✓ Branch 1 taken 386 times.
12738 for (y = 0; y < 32; y++) {
274 12352 int l_m_tl = left[31 - y] - tl;
275
276 12352 dst[ 0] = av_clip_pixel(top[ 0] + l_m_tl);
277 12352 dst[ 1] = av_clip_pixel(top[ 1] + l_m_tl);
278 12352 dst[ 2] = av_clip_pixel(top[ 2] + l_m_tl);
279 12352 dst[ 3] = av_clip_pixel(top[ 3] + l_m_tl);
280 12352 dst[ 4] = av_clip_pixel(top[ 4] + l_m_tl);
281 12352 dst[ 5] = av_clip_pixel(top[ 5] + l_m_tl);
282 12352 dst[ 6] = av_clip_pixel(top[ 6] + l_m_tl);
283 12352 dst[ 7] = av_clip_pixel(top[ 7] + l_m_tl);
284 12352 dst[ 8] = av_clip_pixel(top[ 8] + l_m_tl);
285 12352 dst[ 9] = av_clip_pixel(top[ 9] + l_m_tl);
286 12352 dst[10] = av_clip_pixel(top[10] + l_m_tl);
287 12352 dst[11] = av_clip_pixel(top[11] + l_m_tl);
288 12352 dst[12] = av_clip_pixel(top[12] + l_m_tl);
289 12352 dst[13] = av_clip_pixel(top[13] + l_m_tl);
290 12352 dst[14] = av_clip_pixel(top[14] + l_m_tl);
291 12352 dst[15] = av_clip_pixel(top[15] + l_m_tl);
292 12352 dst[16] = av_clip_pixel(top[16] + l_m_tl);
293 12352 dst[17] = av_clip_pixel(top[17] + l_m_tl);
294 12352 dst[18] = av_clip_pixel(top[18] + l_m_tl);
295 12352 dst[19] = av_clip_pixel(top[19] + l_m_tl);
296 12352 dst[20] = av_clip_pixel(top[20] + l_m_tl);
297 12352 dst[21] = av_clip_pixel(top[21] + l_m_tl);
298 12352 dst[22] = av_clip_pixel(top[22] + l_m_tl);
299 12352 dst[23] = av_clip_pixel(top[23] + l_m_tl);
300 12352 dst[24] = av_clip_pixel(top[24] + l_m_tl);
301 12352 dst[25] = av_clip_pixel(top[25] + l_m_tl);
302 12352 dst[26] = av_clip_pixel(top[26] + l_m_tl);
303 12352 dst[27] = av_clip_pixel(top[27] + l_m_tl);
304 12352 dst[28] = av_clip_pixel(top[28] + l_m_tl);
305 12352 dst[29] = av_clip_pixel(top[29] + l_m_tl);
306 12352 dst[30] = av_clip_pixel(top[30] + l_m_tl);
307 12352 dst[31] = av_clip_pixel(top[31] + l_m_tl);
308 12352 dst += stride;
309 }
310 386 }
311
312 #if BIT_DEPTH != 12
313
314 353773 static void dc_4x4_c(uint8_t *_dst, ptrdiff_t stride,
315 const uint8_t *_left, const uint8_t *_top)
316 {
317 353773 pixel *dst = (pixel *) _dst;
318 353773 const pixel *left = (const pixel *) _left;
319 353773 const pixel *top = (const pixel *) _top;
320 353773 pixel4 dc = PIXEL_SPLAT_X4((left[0] + left[1] + left[2] + left[3] +
321 top[0] + top[1] + top[2] + top[3] + 4) >> 3);
322
323 353773 stride /= sizeof(pixel);
324 353773 AV_WN4PA(dst + stride * 0, dc);
325 353773 AV_WN4PA(dst + stride * 1, dc);
326 353773 AV_WN4PA(dst + stride * 2, dc);
327 353773 AV_WN4PA(dst + stride * 3, dc);
328 353773 }
329
330 142833 static void dc_8x8_c(uint8_t *_dst, ptrdiff_t stride,
331 const uint8_t *_left, const uint8_t *_top)
332 {
333 142833 pixel *dst = (pixel *) _dst;
334 142833 const pixel *left = (const pixel *) _left;
335 142833 const pixel *top = (const pixel *) _top;
336 142833 pixel4 dc = PIXEL_SPLAT_X4
337 ((left[0] + left[1] + left[2] + left[3] + left[4] + left[5] +
338 left[6] + left[7] + top[0] + top[1] + top[2] + top[3] +
339 top[4] + top[5] + top[6] + top[7] + 8) >> 4);
340 int y;
341
342 142833 stride /= sizeof(pixel);
343
2/2
✓ Branch 0 taken 1142664 times.
✓ Branch 1 taken 142833 times.
1285497 for (y = 0; y < 8; y++) {
344 1142664 AV_WN4PA(dst + 0, dc);
345 1142664 AV_WN4PA(dst + 4, dc);
346 1142664 dst += stride;
347 }
348 142833 }
349
350 20481 static void dc_16x16_c(uint8_t *_dst, ptrdiff_t stride,
351 const uint8_t *_left, const uint8_t *_top)
352 {
353 20481 pixel *dst = (pixel *) _dst;
354 20481 const pixel *left = (const pixel *) _left;
355 20481 const pixel *top = (const pixel *) _top;
356 20481 pixel4 dc = PIXEL_SPLAT_X4
357 ((left[0] + left[1] + left[2] + left[3] + left[4] + left[5] + left[6] +
358 left[7] + left[8] + left[9] + left[10] + left[11] + left[12] +
359 left[13] + left[14] + left[15] + top[0] + top[1] + top[2] + top[3] +
360 top[4] + top[5] + top[6] + top[7] + top[8] + top[9] + top[10] +
361 top[11] + top[12] + top[13] + top[14] + top[15] + 16) >> 5);
362 int y;
363
364 20481 stride /= sizeof(pixel);
365
2/2
✓ Branch 0 taken 327696 times.
✓ Branch 1 taken 20481 times.
348177 for (y = 0; y < 16; y++) {
366 327696 AV_WN4PA(dst + 0, dc);
367 327696 AV_WN4PA(dst + 4, dc);
368 327696 AV_WN4PA(dst + 8, dc);
369 327696 AV_WN4PA(dst + 12, dc);
370 327696 dst += stride;
371 }
372 20481 }
373
374 5642 static void dc_32x32_c(uint8_t *_dst, ptrdiff_t stride,
375 const uint8_t *_left, const uint8_t *_top)
376 {
377 5642 pixel *dst = (pixel *) _dst;
378 5642 const pixel *left = (const pixel *) _left;
379 5642 const pixel *top = (const pixel *) _top;
380 5642 pixel4 dc = PIXEL_SPLAT_X4
381 ((left[0] + left[1] + left[2] + left[3] + left[4] + left[5] + left[6] +
382 left[7] + left[8] + left[9] + left[10] + left[11] + left[12] +
383 left[13] + left[14] + left[15] + left[16] + left[17] + left[18] +
384 left[19] + left[20] + left[21] + left[22] + left[23] + left[24] +
385 left[25] + left[26] + left[27] + left[28] + left[29] + left[30] +
386 left[31] + top[0] + top[1] + top[2] + top[3] + top[4] + top[5] +
387 top[6] + top[7] + top[8] + top[9] + top[10] + top[11] + top[12] +
388 top[13] + top[14] + top[15] + top[16] + top[17] + top[18] + top[19] +
389 top[20] + top[21] + top[22] + top[23] + top[24] + top[25] + top[26] +
390 top[27] + top[28] + top[29] + top[30] + top[31] + 32) >> 6);
391 int y;
392
393 5642 stride /= sizeof(pixel);
394
2/2
✓ Branch 0 taken 180544 times.
✓ Branch 1 taken 5642 times.
186186 for (y = 0; y < 32; y++) {
395 180544 AV_WN4PA(dst + 0, dc);
396 180544 AV_WN4PA(dst + 4, dc);
397 180544 AV_WN4PA(dst + 8, dc);
398 180544 AV_WN4PA(dst + 12, dc);
399 180544 AV_WN4PA(dst + 16, dc);
400 180544 AV_WN4PA(dst + 20, dc);
401 180544 AV_WN4PA(dst + 24, dc);
402 180544 AV_WN4PA(dst + 28, dc);
403 180544 dst += stride;
404 }
405 5642 }
406
407 9204 static void dc_left_4x4_c(uint8_t *_dst, ptrdiff_t stride,
408 const uint8_t *_left, const uint8_t *top)
409 {
410 9204 pixel *dst = (pixel *) _dst;
411 9204 const pixel *left = (const pixel *) _left;
412 9204 pixel4 dc = PIXEL_SPLAT_X4((left[0] + left[1] + left[2] + left[3] + 2) >> 2);
413
414 9204 stride /= sizeof(pixel);
415 9204 AV_WN4PA(dst + stride * 0, dc);
416 9204 AV_WN4PA(dst + stride * 1, dc);
417 9204 AV_WN4PA(dst + stride * 2, dc);
418 9204 AV_WN4PA(dst + stride * 3, dc);
419 9204 }
420
421 3370 static void dc_left_8x8_c(uint8_t *_dst, ptrdiff_t stride,
422 const uint8_t *_left, const uint8_t *top)
423 {
424 3370 pixel *dst = (pixel *) _dst;
425 3370 const pixel *left = (const pixel *) _left;
426 3370 pixel4 dc = PIXEL_SPLAT_X4
427 ((left[0] + left[1] + left[2] + left[3] +
428 left[4] + left[5] + left[6] + left[7] + 4) >> 3);
429 int y;
430
431 3370 stride /= sizeof(pixel);
432
2/2
✓ Branch 0 taken 26960 times.
✓ Branch 1 taken 3370 times.
30330 for (y = 0; y < 8; y++) {
433 26960 AV_WN4PA(dst + 0, dc);
434 26960 AV_WN4PA(dst + 4, dc);
435 26960 dst += stride;
436 }
437 3370 }
438
439 1189 static void dc_left_16x16_c(uint8_t *_dst, ptrdiff_t stride,
440 const uint8_t *_left, const uint8_t *top)
441 {
442 1189 pixel *dst = (pixel *) _dst;
443 1189 const pixel *left = (const pixel *) _left;
444 1189 pixel4 dc = PIXEL_SPLAT_X4
445 ((left[0] + left[1] + left[2] + left[3] + left[4] + left[5] +
446 left[6] + left[7] + left[8] + left[9] + left[10] + left[11] +
447 left[12] + left[13] + left[14] + left[15] + 8) >> 4);
448 int y;
449
450 1189 stride /= sizeof(pixel);
451
2/2
✓ Branch 0 taken 19024 times.
✓ Branch 1 taken 1189 times.
20213 for (y = 0; y < 16; y++) {
452 19024 AV_WN4PA(dst + 0, dc);
453 19024 AV_WN4PA(dst + 4, dc);
454 19024 AV_WN4PA(dst + 8, dc);
455 19024 AV_WN4PA(dst + 12, dc);
456 19024 dst += stride;
457 }
458 1189 }
459
460 1350 static void dc_left_32x32_c(uint8_t *_dst, ptrdiff_t stride,
461 const uint8_t *_left, const uint8_t *top)
462 {
463 1350 pixel *dst = (pixel *) _dst;
464 1350 const pixel *left = (const pixel *) _left;
465 1350 pixel4 dc = PIXEL_SPLAT_X4
466 ((left[0] + left[1] + left[2] + left[3] + left[4] + left[5] +
467 left[6] + left[7] + left[8] + left[9] + left[10] + left[11] +
468 left[12] + left[13] + left[14] + left[15] + left[16] + left[17] +
469 left[18] + left[19] + left[20] + left[21] + left[22] + left[23] +
470 left[24] + left[25] + left[26] + left[27] + left[28] + left[29] +
471 left[30] + left[31] + 16) >> 5);
472 int y;
473
474 1350 stride /= sizeof(pixel);
475
2/2
✓ Branch 0 taken 43200 times.
✓ Branch 1 taken 1350 times.
44550 for (y = 0; y < 32; y++) {
476 43200 AV_WN4PA(dst + 0, dc);
477 43200 AV_WN4PA(dst + 4, dc);
478 43200 AV_WN4PA(dst + 8, dc);
479 43200 AV_WN4PA(dst + 12, dc);
480 43200 AV_WN4PA(dst + 16, dc);
481 43200 AV_WN4PA(dst + 20, dc);
482 43200 AV_WN4PA(dst + 24, dc);
483 43200 AV_WN4PA(dst + 28, dc);
484 43200 dst += stride;
485 }
486 1350 }
487
488 11040 static void dc_top_4x4_c(uint8_t *_dst, ptrdiff_t stride,
489 const uint8_t *left, const uint8_t *_top)
490 {
491 11040 pixel *dst = (pixel *) _dst;
492 11040 const pixel *top = (const pixel *) _top;
493 11040 pixel4 dc = PIXEL_SPLAT_X4((top[0] + top[1] + top[2] + top[3] + 2) >> 2);
494
495 11040 stride /= sizeof(pixel);
496 11040 AV_WN4PA(dst + stride * 0, dc);
497 11040 AV_WN4PA(dst + stride * 1, dc);
498 11040 AV_WN4PA(dst + stride * 2, dc);
499 11040 AV_WN4PA(dst + stride * 3, dc);
500 11040 }
501
502 7211 static void dc_top_8x8_c(uint8_t *_dst, ptrdiff_t stride,
503 const uint8_t *left, const uint8_t *_top)
504 {
505 7211 pixel *dst = (pixel *) _dst;
506 7211 const pixel *top = (const pixel *) _top;
507 7211 pixel4 dc = PIXEL_SPLAT_X4
508 ((top[0] + top[1] + top[2] + top[3] +
509 top[4] + top[5] + top[6] + top[7] + 4) >> 3);
510 int y;
511
512 7211 stride /= sizeof(pixel);
513
2/2
✓ Branch 0 taken 57688 times.
✓ Branch 1 taken 7211 times.
64899 for (y = 0; y < 8; y++) {
514 57688 AV_WN4PA(dst + 0, dc);
515 57688 AV_WN4PA(dst + 4, dc);
516 57688 dst += stride;
517 }
518 7211 }
519
520 2608 static void dc_top_16x16_c(uint8_t *_dst, ptrdiff_t stride,
521 const uint8_t *left, const uint8_t *_top)
522 {
523 2608 pixel *dst = (pixel *) _dst;
524 2608 const pixel *top = (const pixel *) _top;
525 2608 pixel4 dc = PIXEL_SPLAT_X4
526 ((top[0] + top[1] + top[2] + top[3] + top[4] + top[5] +
527 top[6] + top[7] + top[8] + top[9] + top[10] + top[11] +
528 top[12] + top[13] + top[14] + top[15] + 8) >> 4);
529 int y;
530
531 2608 stride /= sizeof(pixel);
532
2/2
✓ Branch 0 taken 41728 times.
✓ Branch 1 taken 2608 times.
44336 for (y = 0; y < 16; y++) {
533 41728 AV_WN4PA(dst + 0, dc);
534 41728 AV_WN4PA(dst + 4, dc);
535 41728 AV_WN4PA(dst + 8, dc);
536 41728 AV_WN4PA(dst + 12, dc);
537 41728 dst += stride;
538 }
539 2608 }
540
541 820 static void dc_top_32x32_c(uint8_t *_dst, ptrdiff_t stride,
542 const uint8_t *left, const uint8_t *_top)
543 {
544 820 pixel *dst = (pixel *) _dst;
545 820 const pixel *top = (const pixel *) _top;
546 820 pixel4 dc = PIXEL_SPLAT_X4
547 ((top[0] + top[1] + top[2] + top[3] + top[4] + top[5] +
548 top[6] + top[7] + top[8] + top[9] + top[10] + top[11] +
549 top[12] + top[13] + top[14] + top[15] + top[16] + top[17] +
550 top[18] + top[19] + top[20] + top[21] + top[22] + top[23] +
551 top[24] + top[25] + top[26] + top[27] + top[28] + top[29] +
552 top[30] + top[31] + 16) >> 5);
553 int y;
554
555 820 stride /= sizeof(pixel);
556
2/2
✓ Branch 0 taken 26240 times.
✓ Branch 1 taken 820 times.
27060 for (y = 0; y < 32; y++) {
557 26240 AV_WN4PA(dst + 0, dc);
558 26240 AV_WN4PA(dst + 4, dc);
559 26240 AV_WN4PA(dst + 8, dc);
560 26240 AV_WN4PA(dst + 12, dc);
561 26240 AV_WN4PA(dst + 16, dc);
562 26240 AV_WN4PA(dst + 20, dc);
563 26240 AV_WN4PA(dst + 24, dc);
564 26240 AV_WN4PA(dst + 28, dc);
565 26240 dst += stride;
566 }
567 820 }
568
569 #endif /* BIT_DEPTH != 12 */
570
571 386 static void dc_128_4x4_c(uint8_t *_dst, ptrdiff_t stride,
572 const uint8_t *left, const uint8_t *top)
573 {
574 386 pixel *dst = (pixel *) _dst;
575 386 pixel4 val = PIXEL_SPLAT_X4(128 << (BIT_DEPTH - 8));
576
577 386 stride /= sizeof(pixel);
578 386 AV_WN4PA(dst + stride * 0, val);
579 386 AV_WN4PA(dst + stride * 1, val);
580 386 AV_WN4PA(dst + stride * 2, val);
581 386 AV_WN4PA(dst + stride * 3, val);
582 386 }
583
584 223 static void dc_128_8x8_c(uint8_t *_dst, ptrdiff_t stride,
585 const uint8_t *left, const uint8_t *top)
586 {
587 223 pixel *dst = (pixel *) _dst;
588 223 pixel4 val = PIXEL_SPLAT_X4(128 << (BIT_DEPTH - 8));
589 int y;
590
591 223 stride /= sizeof(pixel);
592
2/2
✓ Branch 0 taken 1784 times.
✓ Branch 1 taken 223 times.
2007 for (y = 0; y < 8; y++) {
593 1784 AV_WN4PA(dst + 0, val);
594 1784 AV_WN4PA(dst + 4, val);
595 1784 dst += stride;
596 }
597 223 }
598
599 131 static void dc_128_16x16_c(uint8_t *_dst, ptrdiff_t stride,
600 const uint8_t *left, const uint8_t *top)
601 {
602 131 pixel *dst = (pixel *) _dst;
603 131 pixel4 val = PIXEL_SPLAT_X4(128 << (BIT_DEPTH - 8));
604 int y;
605
606 131 stride /= sizeof(pixel);
607
2/2
✓ Branch 0 taken 2096 times.
✓ Branch 1 taken 131 times.
2227 for (y = 0; y < 16; y++) {
608 2096 AV_WN4PA(dst + 0, val);
609 2096 AV_WN4PA(dst + 4, val);
610 2096 AV_WN4PA(dst + 8, val);
611 2096 AV_WN4PA(dst + 12, val);
612 2096 dst += stride;
613 }
614 131 }
615
616 127 static void dc_128_32x32_c(uint8_t *_dst, ptrdiff_t stride,
617 const uint8_t *left, const uint8_t *top)
618 {
619 127 pixel *dst = (pixel *) _dst;
620 127 pixel4 val = PIXEL_SPLAT_X4(128 << (BIT_DEPTH - 8));
621 int y;
622
623 127 stride /= sizeof(pixel);
624
2/2
✓ Branch 0 taken 4064 times.
✓ Branch 1 taken 127 times.
4191 for (y = 0; y < 32; y++) {
625 4064 AV_WN4PA(dst + 0, val);
626 4064 AV_WN4PA(dst + 4, val);
627 4064 AV_WN4PA(dst + 8, val);
628 4064 AV_WN4PA(dst + 12, val);
629 4064 AV_WN4PA(dst + 16, val);
630 4064 AV_WN4PA(dst + 20, val);
631 4064 AV_WN4PA(dst + 24, val);
632 4064 AV_WN4PA(dst + 28, val);
633 4064 dst += stride;
634 }
635 127 }
636
637 2528 static void dc_127_4x4_c(uint8_t *_dst, ptrdiff_t stride,
638 const uint8_t *left, const uint8_t *top)
639 {
640 2528 pixel *dst = (pixel *) _dst;
641 2528 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) - 1);
642
643 2528 stride /= sizeof(pixel);
644 2528 AV_WN4PA(dst + stride * 0, val);
645 2528 AV_WN4PA(dst + stride * 1, val);
646 2528 AV_WN4PA(dst + stride * 2, val);
647 2528 AV_WN4PA(dst + stride * 3, val);}
648
649 334 static void dc_127_8x8_c(uint8_t *_dst, ptrdiff_t stride,
650 const uint8_t *left, const uint8_t *top)
651 {
652 334 pixel *dst = (pixel *) _dst;
653 334 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) - 1);
654 int y;
655
656 334 stride /= sizeof(pixel);
657
2/2
✓ Branch 0 taken 2672 times.
✓ Branch 1 taken 334 times.
3006 for (y = 0; y < 8; y++) {
658 2672 AV_WN4PA(dst + 0, val);
659 2672 AV_WN4PA(dst + 4, val);
660 2672 dst += stride;
661 }
662 334 }
663
664 178 static void dc_127_16x16_c(uint8_t *_dst, ptrdiff_t stride,
665 const uint8_t *left, const uint8_t *top)
666 {
667 178 pixel *dst = (pixel *) _dst;
668 178 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) - 1);
669 int y;
670
671 178 stride /= sizeof(pixel);
672
2/2
✓ Branch 0 taken 2848 times.
✓ Branch 1 taken 178 times.
3026 for (y = 0; y < 16; y++) {
673 2848 AV_WN4PA(dst + 0, val);
674 2848 AV_WN4PA(dst + 4, val);
675 2848 AV_WN4PA(dst + 8, val);
676 2848 AV_WN4PA(dst + 12, val);
677 2848 dst += stride;
678 }
679 178 }
680
681 83 static void dc_127_32x32_c(uint8_t *_dst, ptrdiff_t stride,
682 const uint8_t *left, const uint8_t *top)
683 {
684 83 pixel *dst = (pixel *) _dst;
685 83 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) - 1);
686 int y;
687
688 83 stride /= sizeof(pixel);
689
2/2
✓ Branch 0 taken 2656 times.
✓ Branch 1 taken 83 times.
2739 for (y = 0; y < 32; y++) {
690 2656 AV_WN4PA(dst + 0, val);
691 2656 AV_WN4PA(dst + 4, val);
692 2656 AV_WN4PA(dst + 8, val);
693 2656 AV_WN4PA(dst + 12, val);
694 2656 AV_WN4PA(dst + 16, val);
695 2656 AV_WN4PA(dst + 20, val);
696 2656 AV_WN4PA(dst + 24, val);
697 2656 AV_WN4PA(dst + 28, val);
698 2656 dst += stride;
699 }
700 83 }
701
702 2229 static void dc_129_4x4_c(uint8_t *_dst, ptrdiff_t stride,
703 const uint8_t *left, const uint8_t *top)
704 {
705 2229 pixel *dst = (pixel *) _dst;
706 2229 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) + 1);
707
708 2229 stride /= sizeof(pixel);
709 2229 AV_WN4PA(dst + stride * 0, val);
710 2229 AV_WN4PA(dst + stride * 1, val);
711 2229 AV_WN4PA(dst + stride * 2, val);
712 2229 AV_WN4PA(dst + stride * 3, val);
713 2229 }
714
715 348 static void dc_129_8x8_c(uint8_t *_dst, ptrdiff_t stride,
716 const uint8_t *left, const uint8_t *top)
717 {
718 348 pixel *dst = (pixel *) _dst;
719 348 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) + 1);
720 int y;
721
722 348 stride /= sizeof(pixel);
723
2/2
✓ Branch 0 taken 2784 times.
✓ Branch 1 taken 348 times.
3132 for (y = 0; y < 8; y++) {
724 2784 AV_WN4PA(dst + 0, val);
725 2784 AV_WN4PA(dst + 4, val);
726 2784 dst += stride;
727 }
728 348 }
729
730 258 static void dc_129_16x16_c(uint8_t *_dst, ptrdiff_t stride,
731 const uint8_t *left, const uint8_t *top)
732 {
733 258 pixel *dst = (pixel *) _dst;
734 258 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) + 1);
735 int y;
736
737 258 stride /= sizeof(pixel);
738
2/2
✓ Branch 0 taken 4128 times.
✓ Branch 1 taken 258 times.
4386 for (y = 0; y < 16; y++) {
739 4128 AV_WN4PA(dst + 0, val);
740 4128 AV_WN4PA(dst + 4, val);
741 4128 AV_WN4PA(dst + 8, val);
742 4128 AV_WN4PA(dst + 12, val);
743 4128 dst += stride;
744 }
745 258 }
746
747 140 static void dc_129_32x32_c(uint8_t *_dst, ptrdiff_t stride,
748 const uint8_t *left, const uint8_t *top)
749 {
750 140 pixel *dst = (pixel *) _dst;
751 140 pixel4 val = PIXEL_SPLAT_X4((128 << (BIT_DEPTH - 8)) + 1);
752 int y;
753
754 140 stride /= sizeof(pixel);
755
2/2
✓ Branch 0 taken 4480 times.
✓ Branch 1 taken 140 times.
4620 for (y = 0; y < 32; y++) {
756 4480 AV_WN4PA(dst + 0, val);
757 4480 AV_WN4PA(dst + 4, val);
758 4480 AV_WN4PA(dst + 8, val);
759 4480 AV_WN4PA(dst + 12, val);
760 4480 AV_WN4PA(dst + 16, val);
761 4480 AV_WN4PA(dst + 20, val);
762 4480 AV_WN4PA(dst + 24, val);
763 4480 AV_WN4PA(dst + 28, val);
764 4480 dst += stride;
765 }
766 140 }
767
768 #if BIT_DEPTH != 12
769
770 #if BIT_DEPTH == 8
771 #define memset_bpc memset
772 #else
773 8040 static inline void memset_bpc(uint16_t *dst, int val, int len) {
774 int n;
775
2/2
✓ Branch 0 taken 45272 times.
✓ Branch 1 taken 8040 times.
53312 for (n = 0; n < len; n++) {
776 45272 dst[n] = val;
777 }
778 8040 }
779 #endif
780
781 #define DST(x, y) dst[(x) + (y) * stride]
782
783 20364 static void diag_downleft_4x4_c(uint8_t *_dst, ptrdiff_t stride,
784 const uint8_t *left, const uint8_t *_top)
785 {
786 20364 pixel *dst = (pixel *) _dst;
787 20364 const pixel *top = (const pixel *) _top;
788 20364 int a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
789 20364 a4 = top[4], a5 = top[5], a6 = top[6], a7 = top[7];
790
791 20364 stride /= sizeof(pixel);
792 20364 DST(0,0) = (a0 + a1 * 2 + a2 + 2) >> 2;
793 20364 DST(1,0) = DST(0,1) = (a1 + a2 * 2 + a3 + 2) >> 2;
794 20364 DST(2,0) = DST(1,1) = DST(0,2) = (a2 + a3 * 2 + a4 + 2) >> 2;
795 20364 DST(3,0) = DST(2,1) = DST(1,2) = DST(0,3) = (a3 + a4 * 2 + a5 + 2) >> 2;
796 20364 DST(3,1) = DST(2,2) = DST(1,3) = (a4 + a5 * 2 + a6 + 2) >> 2;
797 20364 DST(3,2) = DST(2,3) = (a5 + a6 * 2 + a7 + 2) >> 2;
798 20364 DST(3,3) = a7; // note: this is different from vp8 and such
799 20364 }
800
801 #define def_diag_downleft(size) \
802 static void diag_downleft_##size##x##size##_c(uint8_t *_dst, ptrdiff_t stride, \
803 const uint8_t *left, const uint8_t *_top) \
804 { \
805 pixel *dst = (pixel *) _dst; \
806 const pixel *top = (const pixel *) _top; \
807 int i, j; \
808 pixel v[size - 1]; \
809 \
810 stride /= sizeof(pixel); \
811 for (i = 0; i < size - 2; i++) \
812 v[i] = (top[i] + top[i + 1] * 2 + top[i + 2] + 2) >> 2; \
813 v[size - 2] = (top[size - 2] + top[size - 1] * 3 + 2) >> 2; \
814 \
815 for (j = 0; j < size; j++) { \
816 memcpy(dst + j*stride, v + j, (size - 1 - j) * sizeof(pixel)); \
817 memset_bpc(dst + j*stride + size - 1 - j, top[size - 1], j + 1); \
818 } \
819 }
820
821
5/5
✓ Branch 0 taken 34014 times.
✓ Branch 1 taken 5669 times.
✓ Branch 2 taken 44112 times.
✓ Branch 3 taken 6754 times.
✓ Branch 4 taken 155 times.
85035 def_diag_downleft(8)
822
5/5
✓ Branch 0 taken 15792 times.
✓ Branch 1 taken 1128 times.
✓ Branch 2 taken 17856 times.
✓ Branch 3 taken 1308 times.
✓ Branch 4 taken 12 times.
34968 def_diag_downleft(16)
823
5/5
✓ Branch 0 taken 4560 times.
✓ Branch 1 taken 152 times.
✓ Branch 2 taken 4288 times.
✓ Branch 3 taken 710 times.
✓ Branch 4 taken 18 times.
9576 def_diag_downleft(32)
824
825 57827 static void diag_downright_4x4_c(uint8_t *_dst, ptrdiff_t stride,
826 const uint8_t *_left, const uint8_t *_top)
827 {
828 57827 pixel *dst = (pixel *) _dst;
829 57827 const pixel *top = (const pixel *) _top;
830 57827 const pixel *left = (const pixel *) _left;
831 57827 int tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
832 57827 l0 = left[3], l1 = left[2], l2 = left[1], l3 = left[0];
833
834 57827 stride /= sizeof(pixel);
835 57827 DST(0,3) = (l1 + l2 * 2 + l3 + 2) >> 2;
836 57827 DST(0,2) = DST(1,3) = (l0 + l1 * 2 + l2 + 2) >> 2;
837 57827 DST(0,1) = DST(1,2) = DST(2,3) = (tl + l0 * 2 + l1 + 2) >> 2;
838 57827 DST(0,0) = DST(1,1) = DST(2,2) = DST(3,3) = (l0 + tl * 2 + a0 + 2) >> 2;
839 57827 DST(1,0) = DST(2,1) = DST(3,2) = (tl + a0 * 2 + a1 + 2) >> 2;
840 57827 DST(2,0) = DST(3,1) = (a0 + a1 * 2 + a2 + 2) >> 2;
841 57827 DST(3,0) = (a1 + a2 * 2 + a3 + 2) >> 2;
842 57827 }
843
844 #define def_diag_downright(size) \
845 static void diag_downright_##size##x##size##_c(uint8_t *_dst, ptrdiff_t stride, \
846 const uint8_t *_left, const uint8_t *_top) \
847 { \
848 pixel *dst = (pixel *) _dst; \
849 const pixel *top = (const pixel *) _top; \
850 const pixel *left = (const pixel *) _left; \
851 int i, j; \
852 pixel v[size + size - 1]; \
853 \
854 stride /= sizeof(pixel); \
855 for (i = 0; i < size - 2; i++) { \
856 v[i ] = (left[i] + left[i + 1] * 2 + left[i + 2] + 2) >> 2; \
857 v[size + 1 + i] = (top[i] + top[i + 1] * 2 + top[i + 2] + 2) >> 2; \
858 } \
859 v[size - 2] = (left[size - 2] + left[size - 1] * 2 + top[-1] + 2) >> 2; \
860 v[size - 1] = (left[size - 1] + top[-1] * 2 + top[ 0] + 2) >> 2; \
861 v[size ] = (top[-1] + top[0] * 2 + top[ 1] + 2) >> 2; \
862 \
863 for (j = 0; j < size; j++) \
864 memcpy(dst + j*stride, v + size - 1 - j, size * sizeof(pixel)); \
865 }
866
867
4/4
✓ Branch 0 taken 41100 times.
✓ Branch 1 taken 6850 times.
✓ Branch 2 taken 54800 times.
✓ Branch 3 taken 6850 times.
102750 def_diag_downright(8)
868
4/4
✓ Branch 0 taken 12754 times.
✓ Branch 1 taken 911 times.
✓ Branch 2 taken 14576 times.
✓ Branch 3 taken 911 times.
28241 def_diag_downright(16)
869
4/4
✓ Branch 0 taken 5100 times.
✓ Branch 1 taken 170 times.
✓ Branch 2 taken 5440 times.
✓ Branch 3 taken 170 times.
10710 def_diag_downright(32)
870
871 44165 static void vert_right_4x4_c(uint8_t *_dst, ptrdiff_t stride,
872 const uint8_t *_left, const uint8_t *_top)
873 {
874 44165 pixel *dst = (pixel *) _dst;
875 44165 const pixel *top = (const pixel *) _top;
876 44165 const pixel *left = (const pixel *) _left;
877 44165 int tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
878 44165 l0 = left[3], l1 = left[2], l2 = left[1];
879
880 44165 stride /= sizeof(pixel);
881 44165 DST(0,3) = (l0 + l1 * 2 + l2 + 2) >> 2;
882 44165 DST(0,2) = (tl + l0 * 2 + l1 + 2) >> 2;
883 44165 DST(0,0) = DST(1,2) = (tl + a0 + 1) >> 1;
884 44165 DST(0,1) = DST(1,3) = (l0 + tl * 2 + a0 + 2) >> 2;
885 44165 DST(1,0) = DST(2,2) = (a0 + a1 + 1) >> 1;
886 44165 DST(1,1) = DST(2,3) = (tl + a0 * 2 + a1 + 2) >> 2;
887 44165 DST(2,0) = DST(3,2) = (a1 + a2 + 1) >> 1;
888 44165 DST(2,1) = DST(3,3) = (a0 + a1 * 2 + a2 + 2) >> 2;
889 44165 DST(3,0) = (a2 + a3 + 1) >> 1;
890 44165 DST(3,1) = (a1 + a2 * 2 + a3 + 2) >> 2;
891 44165 }
892
893 #define def_vert_right(size) \
894 static void vert_right_##size##x##size##_c(uint8_t *_dst, ptrdiff_t stride, \
895 const uint8_t *_left, const uint8_t *_top) \
896 { \
897 pixel *dst = (pixel *) _dst; \
898 const pixel *top = (const pixel *) _top; \
899 const pixel *left = (const pixel *) _left; \
900 int i, j; \
901 pixel ve[size + size/2 - 1], vo[size + size/2 - 1]; \
902 \
903 stride /= sizeof(pixel); \
904 for (i = 0; i < size/2 - 2; i++) { \
905 vo[i] = (left[i*2 + 3] + left[i*2 + 2] * 2 + left[i*2 + 1] + 2) >> 2; \
906 ve[i] = (left[i*2 + 4] + left[i*2 + 3] * 2 + left[i*2 + 2] + 2) >> 2; \
907 } \
908 vo[size/2 - 2] = (left[size - 1] + left[size - 2] * 2 + left[size - 3] + 2) >> 2; \
909 ve[size/2 - 2] = (top[-1] + left[size - 1] * 2 + left[size - 2] + 2) >> 2; \
910 \
911 ve[size/2 - 1] = (top[-1] + top[0] + 1) >> 1; \
912 vo[size/2 - 1] = (left[size - 1] + top[-1] * 2 + top[0] + 2) >> 2; \
913 for (i = 0; i < size - 1; i++) { \
914 ve[size/2 + i] = (top[i] + top[i + 1] + 1) >> 1; \
915 vo[size/2 + i] = (top[i - 1] + top[i] * 2 + top[i + 1] + 2) >> 2; \
916 } \
917 \
918 for (j = 0; j < size / 2; j++) { \
919 memcpy(dst + j*2 *stride, ve + size/2 - 1 - j, size * sizeof(pixel)); \
920 memcpy(dst + (j*2 + 1)*stride, vo + size/2 - 1 - j, size * sizeof(pixel)); \
921 } \
922 }
923
924
6/6
✓ Branch 0 taken 9738 times.
✓ Branch 1 taken 4869 times.
✓ Branch 2 taken 34083 times.
✓ Branch 3 taken 4869 times.
✓ Branch 4 taken 19476 times.
✓ Branch 5 taken 4869 times.
68166 def_vert_right(8)
925
6/6
✓ Branch 0 taken 5610 times.
✓ Branch 1 taken 935 times.
✓ Branch 2 taken 14025 times.
✓ Branch 3 taken 935 times.
✓ Branch 4 taken 7480 times.
✓ Branch 5 taken 935 times.
28050 def_vert_right(16)
926
6/6
✓ Branch 0 taken 2646 times.
✓ Branch 1 taken 189 times.
✓ Branch 2 taken 5859 times.
✓ Branch 3 taken 189 times.
✓ Branch 4 taken 3024 times.
✓ Branch 5 taken 189 times.
11718 def_vert_right(32)
927
928 47549 static void hor_down_4x4_c(uint8_t *_dst, ptrdiff_t stride,
929 const uint8_t *_left, const uint8_t *_top)
930 {
931 47549 pixel *dst = (pixel *) _dst;
932 47549 const pixel *top = (const pixel *) _top;
933 47549 const pixel *left = (const pixel *) _left;
934 47549 int l0 = left[3], l1 = left[2], l2 = left[1], l3 = left[0],
935 47549 tl = top[-1], a0 = top[0], a1 = top[1], a2 = top[2];
936
937 47549 stride /= sizeof(pixel);
938 47549 DST(2,0) = (tl + a0 * 2 + a1 + 2) >> 2;
939 47549 DST(3,0) = (a0 + a1 * 2 + a2 + 2) >> 2;
940 47549 DST(0,0) = DST(2,1) = (tl + l0 + 1) >> 1;
941 47549 DST(1,0) = DST(3,1) = (a0 + tl * 2 + l0 + 2) >> 2;
942 47549 DST(0,1) = DST(2,2) = (l0 + l1 + 1) >> 1;
943 47549 DST(1,1) = DST(3,2) = (tl + l0 * 2 + l1 + 2) >> 2;
944 47549 DST(0,2) = DST(2,3) = (l1 + l2 + 1) >> 1;
945 47549 DST(1,2) = DST(3,3) = (l0 + l1 * 2 + l2 + 2) >> 2;
946 47549 DST(0,3) = (l2 + l3 + 1) >> 1;
947 47549 DST(1,3) = (l1 + l2 * 2 + l3 + 2) >> 2;
948 47549 }
949
950 #define def_hor_down(size) \
951 static void hor_down_##size##x##size##_c(uint8_t *_dst, ptrdiff_t stride, \
952 const uint8_t *_left, const uint8_t *_top) \
953 { \
954 pixel *dst = (pixel *) _dst; \
955 const pixel *top = (const pixel *) _top; \
956 const pixel *left = (const pixel *) _left; \
957 int i, j; \
958 pixel v[size * 3 - 2]; \
959 \
960 stride /= sizeof(pixel); \
961 for (i = 0; i < size - 2; i++) { \
962 v[i*2 ] = (left[i + 1] + left[i + 0] + 1) >> 1; \
963 v[i*2 + 1] = (left[i + 2] + left[i + 1] * 2 + left[i + 0] + 2) >> 2; \
964 v[size*2 + i] = (top[i - 1] + top[i] * 2 + top[i + 1] + 2) >> 2; \
965 } \
966 v[size*2 - 2] = (top[-1] + left[size - 1] + 1) >> 1; \
967 v[size*2 - 4] = (left[size - 1] + left[size - 2] + 1) >> 1; \
968 v[size*2 - 1] = (top[0] + top[-1] * 2 + left[size - 1] + 2) >> 2; \
969 v[size*2 - 3] = (top[-1] + left[size - 1] * 2 + left[size - 2] + 2) >> 2; \
970 \
971 for (j = 0; j < size; j++) \
972 memcpy(dst + j*stride, v + size*2 - 2 - j*2, size * sizeof(pixel)); \
973 }
974
975
4/4
✓ Branch 0 taken 30348 times.
✓ Branch 1 taken 5058 times.
✓ Branch 2 taken 40464 times.
✓ Branch 3 taken 5058 times.
75870 def_hor_down(8)
976
4/4
✓ Branch 0 taken 8148 times.
✓ Branch 1 taken 582 times.
✓ Branch 2 taken 9312 times.
✓ Branch 3 taken 582 times.
18042 def_hor_down(16)
977
4/4
✓ Branch 0 taken 2310 times.
✓ Branch 1 taken 77 times.
✓ Branch 2 taken 2464 times.
✓ Branch 3 taken 77 times.
4851 def_hor_down(32)
978
979 36962 static void vert_left_4x4_c(uint8_t *_dst, ptrdiff_t stride,
980 const uint8_t *left, const uint8_t *_top)
981 {
982 36962 pixel *dst = (pixel *) _dst;
983 36962 const pixel *top = (const pixel *) _top;
984 36962 int a0 = top[0], a1 = top[1], a2 = top[2], a3 = top[3],
985 36962 a4 = top[4], a5 = top[5], a6 = top[6];
986
987 36962 stride /= sizeof(pixel);
988 36962 DST(0,0) = (a0 + a1 + 1) >> 1;
989 36962 DST(0,1) = (a0 + a1 * 2 + a2 + 2) >> 2;
990 36962 DST(1,0) = DST(0,2) = (a1 + a2 + 1) >> 1;
991 36962 DST(1,1) = DST(0,3) = (a1 + a2 * 2 + a3 + 2) >> 2;
992 36962 DST(2,0) = DST(1,2) = (a2 + a3 + 1) >> 1;
993 36962 DST(2,1) = DST(1,3) = (a2 + a3 * 2 + a4 + 2) >> 2;
994 36962 DST(3,0) = DST(2,2) = (a3 + a4 + 1) >> 1;
995 36962 DST(3,1) = DST(2,3) = (a3 + a4 * 2 + a5 + 2) >> 2;
996 36962 DST(3,2) = (a4 + a5 + 1) >> 1;
997 36962 DST(3,3) = (a4 + a5 * 2 + a6 + 2) >> 2;
998 36962 }
999
1000 #define def_vert_left(size) \
1001 static void vert_left_##size##x##size##_c(uint8_t *_dst, ptrdiff_t stride, \
1002 const uint8_t *left, const uint8_t *_top) \
1003 { \
1004 pixel *dst = (pixel *) _dst; \
1005 const pixel *top = (const pixel *) _top; \
1006 int i, j; \
1007 pixel ve[size - 1], vo[size - 1]; \
1008 \
1009 stride /= sizeof(pixel); \
1010 for (i = 0; i < size - 2; i++) { \
1011 ve[i] = (top[i] + top[i + 1] + 1) >> 1; \
1012 vo[i] = (top[i] + top[i + 1] * 2 + top[i + 2] + 2) >> 2; \
1013 } \
1014 ve[size - 2] = (top[size - 2] + top[size - 1] + 1) >> 1; \
1015 vo[size - 2] = (top[size - 2] + top[size - 1] * 3 + 2) >> 2; \
1016 \
1017 for (j = 0; j < size / 2; j++) { \
1018 memcpy(dst + j*2 * stride, ve + j, (size - j - 1) * sizeof(pixel)); \
1019 memset_bpc(dst + j*2 * stride + size - j - 1, top[size - 1], j + 1); \
1020 memcpy(dst + (j*2 + 1) * stride, vo + j, (size - j - 1) * sizeof(pixel)); \
1021 memset_bpc(dst + (j*2 + 1) * stride + size - j - 1, top[size - 1], j + 1); \
1022 } \
1023 }
1024
1025
6/6
✓ Branch 0 taken 39852 times.
✓ Branch 1 taken 6642 times.
✓ Branch 2 taken 25396 times.
✓ Branch 3 taken 6349 times.
✓ Branch 4 taken 1172 times.
✓ Branch 5 taken 293 times.
73062 def_vert_left(8)
1026
6/6
✓ Branch 0 taken 19390 times.
✓ Branch 1 taken 1385 times.
✓ Branch 2 taken 10376 times.
✓ Branch 3 taken 1297 times.
✓ Branch 4 taken 704 times.
✓ Branch 5 taken 88 times.
31855 def_vert_left(16)
1027
6/6
✓ Branch 0 taken 5760 times.
✓ Branch 1 taken 192 times.
✓ Branch 2 taken 2912 times.
✓ Branch 3 taken 182 times.
✓ Branch 4 taken 160 times.
✓ Branch 5 taken 10 times.
9024 def_vert_left(32)
1028
1029 51466 static void hor_up_4x4_c(uint8_t *_dst, ptrdiff_t stride,
1030 const uint8_t *_left, const uint8_t *top)
1031 {
1032 51466 pixel *dst = (pixel *) _dst;
1033 51466 const pixel *left = (const pixel *) _left;
1034 51466 int l0 = left[0], l1 = left[1], l2 = left[2], l3 = left[3];
1035
1036 51466 stride /= sizeof(pixel);
1037 51466 DST(0,0) = (l0 + l1 + 1) >> 1;
1038 51466 DST(1,0) = (l0 + l1 * 2 + l2 + 2) >> 2;
1039 51466 DST(0,1) = DST(2,0) = (l1 + l2 + 1) >> 1;
1040 51466 DST(1,1) = DST(3,0) = (l1 + l2 * 2 + l3 + 2) >> 2;
1041 51466 DST(0,2) = DST(2,1) = (l2 + l3 + 1) >> 1;
1042 51466 DST(1,2) = DST(3,1) = (l2 + l3 * 3 + 2) >> 2;
1043 51466 DST(0,3) = DST(1,3) = DST(2,2) = DST(2,3) = DST(3,2) = DST(3,3) = l3;
1044 51466 }
1045
1046 #define def_hor_up(size) \
1047 static void hor_up_##size##x##size##_c(uint8_t *_dst, ptrdiff_t stride, \
1048 const uint8_t *_left, const uint8_t *top) \
1049 { \
1050 pixel *dst = (pixel *) _dst; \
1051 const pixel *left = (const pixel *) _left; \
1052 int i, j; \
1053 pixel v[size*2 - 2]; \
1054 \
1055 stride /= sizeof(pixel); \
1056 for (i = 0; i < size - 2; i++) { \
1057 v[i*2 ] = (left[i] + left[i + 1] + 1) >> 1; \
1058 v[i*2 + 1] = (left[i] + left[i + 1] * 2 + left[i + 2] + 2) >> 2; \
1059 } \
1060 v[size*2 - 4] = (left[size - 2] + left[size - 1] + 1) >> 1; \
1061 v[size*2 - 3] = (left[size - 2] + left[size - 1] * 3 + 2) >> 2; \
1062 \
1063 for (j = 0; j < size / 2; j++) \
1064 memcpy(dst + j*stride, v + j*2, size * sizeof(pixel)); \
1065 for (j = size / 2; j < size; j++) { \
1066 memcpy(dst + j*stride, v + j*2, (size*2 - 2 - j*2) * sizeof(pixel)); \
1067 memset_bpc(dst + j*stride + size*2 - 2 - j*2, left[size - 1], \
1068 2 + j*2 - size); \
1069 } \
1070 }
1071
1072
7/7
✓ Branch 0 taken 58146 times.
✓ Branch 1 taken 9691 times.
✓ Branch 2 taken 38764 times.
✓ Branch 3 taken 9691 times.
✓ Branch 4 taken 37252 times.
✓ Branch 5 taken 10825 times.
✓ Branch 6 taken 378 times.
145365 def_hor_up(8)
1073
7/7
✓ Branch 0 taken 24976 times.
✓ Branch 1 taken 1784 times.
✓ Branch 2 taken 14272 times.
✓ Branch 3 taken 1784 times.
✓ Branch 4 taken 14080 times.
✓ Branch 5 taken 1952 times.
✓ Branch 6 taken 24 times.
55304 def_hor_up(16)
1074
7/7
✓ Branch 0 taken 5040 times.
✓ Branch 1 taken 168 times.
✓ Branch 2 taken 2688 times.
✓ Branch 3 taken 168 times.
✓ Branch 4 taken 2432 times.
✓ Branch 5 taken 408 times.
✓ Branch 6 taken 16 times.
10584 def_hor_up(32)
1075
1076 #undef DST
1077
1078 #endif /* BIT_DEPTH != 12 */
1079
1080 #if BIT_DEPTH != 8
1081 void ff_vp9dsp_intrapred_init_10(VP9DSPContext *dsp);
1082 #endif
1083 #if BIT_DEPTH != 10
1084 static
1085 #endif
1086 746 av_cold void FUNC(ff_vp9dsp_intrapred_init)(VP9DSPContext *dsp)
1087 {
1088 #define init_intra_pred_bd_aware(tx, sz) \
1089 dsp->intra_pred[tx][TM_VP8_PRED] = tm_##sz##_c; \
1090 dsp->intra_pred[tx][DC_128_PRED] = dc_128_##sz##_c; \
1091 dsp->intra_pred[tx][DC_127_PRED] = dc_127_##sz##_c; \
1092 dsp->intra_pred[tx][DC_129_PRED] = dc_129_##sz##_c
1093
1094 #if BIT_DEPTH == 12
1095 75 ff_vp9dsp_intrapred_init_10(dsp);
1096 #define init_intra_pred(tx, sz) \
1097 init_intra_pred_bd_aware(tx, sz)
1098 #else
1099 #define init_intra_pred(tx, sz) \
1100 dsp->intra_pred[tx][VERT_PRED] = vert_##sz##_c; \
1101 dsp->intra_pred[tx][HOR_PRED] = hor_##sz##_c; \
1102 dsp->intra_pred[tx][DC_PRED] = dc_##sz##_c; \
1103 dsp->intra_pred[tx][DIAG_DOWN_LEFT_PRED] = diag_downleft_##sz##_c; \
1104 dsp->intra_pred[tx][DIAG_DOWN_RIGHT_PRED] = diag_downright_##sz##_c; \
1105 dsp->intra_pred[tx][VERT_RIGHT_PRED] = vert_right_##sz##_c; \
1106 dsp->intra_pred[tx][HOR_DOWN_PRED] = hor_down_##sz##_c; \
1107 dsp->intra_pred[tx][VERT_LEFT_PRED] = vert_left_##sz##_c; \
1108 dsp->intra_pred[tx][HOR_UP_PRED] = hor_up_##sz##_c; \
1109 dsp->intra_pred[tx][LEFT_DC_PRED] = dc_left_##sz##_c; \
1110 dsp->intra_pred[tx][TOP_DC_PRED] = dc_top_##sz##_c; \
1111 init_intra_pred_bd_aware(tx, sz)
1112 #endif
1113
1114 746 init_intra_pred(TX_4X4, 4x4);
1115 746 init_intra_pred(TX_8X8, 8x8);
1116 746 init_intra_pred(TX_16X16, 16x16);
1117 746 init_intra_pred(TX_32X32, 32x32);
1118
1119 #undef init_intra_pred
1120 #undef init_intra_pred_bd_aware
1121 746 }
1122
1123 #define itxfm_wrapper(type_a, type_b, sz, bits, has_dconly) \
1124 static void type_a##_##type_b##_##sz##x##sz##_add_c(uint8_t *_dst, \
1125 ptrdiff_t stride, \
1126 int16_t *_block, int eob) \
1127 { \
1128 int i, j; \
1129 pixel *dst = (pixel *) _dst; \
1130 dctcoef *block = (dctcoef *) _block, tmp[sz * sz], out[sz]; \
1131 \
1132 stride /= sizeof(pixel); \
1133 if (has_dconly && eob == 1) { \
1134 const int t = ((((dctint) block[0] * 11585 + (1 << 13)) >> 14) \
1135 * 11585 + (1 << 13)) >> 14; \
1136 block[0] = 0; \
1137 for (i = 0; i < sz; i++) { \
1138 for (j = 0; j < sz; j++) \
1139 dst[j * stride] = av_clip_pixel(dst[j * stride] + \
1140 (bits ? \
1141 (int)(t + (1U << (bits - 1))) >> bits : \
1142 t)); \
1143 dst++; \
1144 } \
1145 return; \
1146 } \
1147 \
1148 for (i = 0; i < sz; i++) \
1149 type_a##sz##_1d(block + i, sz, tmp + i * sz, 0); \
1150 memset(block, 0, sz * sz * sizeof(*block)); \
1151 for (i = 0; i < sz; i++) { \
1152 type_b##sz##_1d(tmp + i, sz, out, 1); \
1153 for (j = 0; j < sz; j++) \
1154 dst[j * stride] = av_clip_pixel(dst[j * stride] + \
1155 (bits ? \
1156 (int)(out[j] + (1U << (bits - 1))) >> bits : \
1157 out[j])); \
1158 dst++; \
1159 } \
1160 }
1161
1162 #define itxfm_wrap(sz, bits) \
1163 itxfm_wrapper(idct, idct, sz, bits, 1) \
1164 itxfm_wrapper(iadst, idct, sz, bits, 0) \
1165 itxfm_wrapper(idct, iadst, sz, bits, 0) \
1166 itxfm_wrapper(iadst, iadst, sz, bits, 0)
1167
1168 #define IN(x) ((dctint) in[(x) * stride])
1169
1170 3507364 static av_always_inline void idct4_1d(const dctcoef *in, ptrdiff_t stride,
1171 dctcoef *out, int pass)
1172 {
1173 dctint t0, t1, t2, t3;
1174
1175 3507364 t0 = ((IN(0) + IN(2)) * 11585 + (1 << 13)) >> 14;
1176 3507364 t1 = ((IN(0) - IN(2)) * 11585 + (1 << 13)) >> 14;
1177 3507364 t2 = (IN(1) * 6270 - IN(3) * 15137 + (1 << 13)) >> 14;
1178 3507364 t3 = (IN(1) * 15137 + IN(3) * 6270 + (1 << 13)) >> 14;
1179
1180 3507364 out[0] = t0 + t3;
1181 3507364 out[1] = t1 + t2;
1182 3507364 out[2] = t1 - t2;
1183 3507364 out[3] = t0 - t3;
1184 3507364 }
1185
1186 1519020 static av_always_inline void iadst4_1d(const dctcoef *in, ptrdiff_t stride,
1187 dctcoef *out, int pass)
1188 {
1189 dctint t0, t1, t2, t3;
1190
1191 1519020 t0 = 5283 * IN(0) + 15212 * IN(2) + 9929 * IN(3);
1192 1519020 t1 = 9929 * IN(0) - 5283 * IN(2) - 15212 * IN(3);
1193 1519020 t2 = 13377 * (IN(0) - IN(2) + IN(3));
1194 1519020 t3 = 13377 * IN(1);
1195
1196 1519020 out[0] = (t0 + t3 + (1 << 13)) >> 14;
1197 1519020 out[1] = (t1 + t3 + (1 << 13)) >> 14;
1198 1519020 out[2] = (t2 + (1 << 13)) >> 14;
1199 1519020 out[3] = (t0 + t1 - t3 + (1 << 13)) >> 14;
1200 1519020 }
1201
1202
13/13
✓ Branch 0 taken 113652 times.
✓ Branch 1 taken 1514444 times.
✓ Branch 2 taken 2113814 times.
✓ Branch 3 taken 454608 times.
✓ Branch 4 taken 5180720 times.
✓ Branch 5 taken 1295180 times.
✓ Branch 6 taken 1181528 times.
✓ Branch 7 taken 1627046 times.
✓ Branch 8 taken 332916 times.
✓ Branch 10 taken 5326656 times.
✓ Branch 11 taken 1331664 times.
✓ Branch 12 taken 1331664 times.
✓ Branch 13 taken 332916 times.
36188284 itxfm_wrap(4, 4)
1203
1204 2969888 static av_always_inline void idct8_1d(const dctcoef *in, ptrdiff_t stride,
1205 dctcoef *out, int pass)
1206 {
1207 dctint t0, t0a, t1, t1a, t2, t2a, t3, t3a, t4, t4a, t5, t5a, t6, t6a, t7, t7a;
1208
1209 2969888 t0a = ((IN(0) + IN(4)) * 11585 + (1 << 13)) >> 14;
1210 2969888 t1a = ((IN(0) - IN(4)) * 11585 + (1 << 13)) >> 14;
1211 2969888 t2a = (IN(2) * 6270 - IN(6) * 15137 + (1 << 13)) >> 14;
1212 2969888 t3a = (IN(2) * 15137 + IN(6) * 6270 + (1 << 13)) >> 14;
1213 2969888 t4a = (IN(1) * 3196 - IN(7) * 16069 + (1 << 13)) >> 14;
1214 2969888 t5a = (IN(5) * 13623 - IN(3) * 9102 + (1 << 13)) >> 14;
1215 2969888 t6a = (IN(5) * 9102 + IN(3) * 13623 + (1 << 13)) >> 14;
1216 2969888 t7a = (IN(1) * 16069 + IN(7) * 3196 + (1 << 13)) >> 14;
1217
1218 2969888 t0 = t0a + t3a;
1219 2969888 t1 = t1a + t2a;
1220 2969888 t2 = t1a - t2a;
1221 2969888 t3 = t0a - t3a;
1222 2969888 t4 = t4a + t5a;
1223 2969888 t5a = t4a - t5a;
1224 2969888 t7 = t7a + t6a;
1225 2969888 t6a = t7a - t6a;
1226
1227 2969888 t5 = ((t6a - t5a) * 11585 + (1 << 13)) >> 14;
1228 2969888 t6 = ((t6a + t5a) * 11585 + (1 << 13)) >> 14;
1229
1230 2969888 out[0] = t0 + t7;
1231 2969888 out[1] = t1 + t6;
1232 2969888 out[2] = t2 + t5;
1233 2969888 out[3] = t3 + t4;
1234 2969888 out[4] = t3 - t4;
1235 2969888 out[5] = t2 - t5;
1236 2969888 out[6] = t1 - t6;
1237 2969888 out[7] = t0 - t7;
1238 2969888 }
1239
1240 761408 static av_always_inline void iadst8_1d(const dctcoef *in, ptrdiff_t stride,
1241 dctcoef *out, int pass)
1242 {
1243 dctint t0, t0a, t1, t1a, t2, t2a, t3, t3a, t4, t4a, t5, t5a, t6, t6a, t7, t7a;
1244
1245 761408 t0a = 16305 * IN(7) + 1606 * IN(0);
1246 761408 t1a = 1606 * IN(7) - 16305 * IN(0);
1247 761408 t2a = 14449 * IN(5) + 7723 * IN(2);
1248 761408 t3a = 7723 * IN(5) - 14449 * IN(2);
1249 761408 t4a = 10394 * IN(3) + 12665 * IN(4);
1250 761408 t5a = 12665 * IN(3) - 10394 * IN(4);
1251 761408 t6a = 4756 * IN(1) + 15679 * IN(6);
1252 761408 t7a = 15679 * IN(1) - 4756 * IN(6);
1253
1254 761408 t0 = (t0a + t4a + (1 << 13)) >> 14;
1255 761408 t1 = (t1a + t5a + (1 << 13)) >> 14;
1256 761408 t2 = (t2a + t6a + (1 << 13)) >> 14;
1257 761408 t3 = (t3a + t7a + (1 << 13)) >> 14;
1258 761408 t4 = (t0a - t4a + (1 << 13)) >> 14;
1259 761408 t5 = (t1a - t5a + (1 << 13)) >> 14;
1260 761408 t6 = (t2a - t6a + (1 << 13)) >> 14;
1261 761408 t7 = (t3a - t7a + (1 << 13)) >> 14;
1262
1263 761408 t4a = 15137U * t4 + 6270U * t5;
1264 761408 t5a = 6270U * t4 - 15137U * t5;
1265 761408 t6a = 15137U * t7 - 6270U * t6;
1266 761408 t7a = 6270U * t7 + 15137U * t6;
1267
1268 761408 out[0] = t0 + t2;
1269 761408 out[7] = -(t1 + t3);
1270 761408 t2 = t0 - t2;
1271 761408 t3 = t1 - t3;
1272
1273 761408 out[1] = -((dctint)((1U << 13) + t4a + t6a) >> 14);
1274 761408 out[6] = (dctint)((1U << 13) + t5a + t7a) >> 14;
1275 761408 t6 = (dctint)((1U << 13) + t4a - t6a) >> 14;
1276 761408 t7 = (dctint)((1U << 13) + t5a - t7a) >> 14;
1277
1278 761408 out[3] = -((dctint)((t2 + t3) * 11585U + (1 << 13)) >> 14);
1279 761408 out[4] = (dctint)((t2 - t3) * 11585U + (1 << 13)) >> 14;
1280 761408 out[2] = (dctint)((t6 + t7) * 11585U + (1 << 13)) >> 14;
1281 761408 out[5] = -((dctint)((t6 - t7) * 11585U + (1 << 13)) >> 14);
1282 761408 }
1283
1284
13/13
✓ Branch 0 taken 34570 times.
✓ Branch 1 taken 755189 times.
✓ Branch 2 taken 2287049 times.
✓ Branch 3 taken 276560 times.
✓ Branch 4 taken 5048976 times.
✓ Branch 5 taken 631122 times.
✓ Branch 6 taken 596552 times.
✓ Branch 7 taken 1343665 times.
✓ Branch 8 taken 158637 times.
✓ Branch 10 taken 10152768 times.
✓ Branch 11 taken 1269096 times.
✓ Branch 12 taken 1269096 times.
✓ Branch 13 taken 158637 times.
42826592 itxfm_wrap(8, 5)
1285
1286 1130576 static av_always_inline void idct16_1d(const dctcoef *in, ptrdiff_t stride,
1287 dctcoef *out, int pass)
1288 {
1289 dctint t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
1290 dctint t0a, t1a, t2a, t3a, t4a, t5a, t6a, t7a;
1291 dctint t8a, t9a, t10a, t11a, t12a, t13a, t14a, t15a;
1292
1293 1130576 t0a = (dctint)((IN(0) + IN(8)) * 11585U + (1 << 13)) >> 14;
1294 1130576 t1a = (dctint)((IN(0) - IN(8)) * 11585U + (1 << 13)) >> 14;
1295 1130576 t2a = (dctint)(IN(4) * 6270U - IN(12) * 15137U + (1 << 13)) >> 14;
1296 1130576 t3a = (dctint)(IN(4) * 15137U + IN(12) * 6270U + (1 << 13)) >> 14;
1297 1130576 t4a = (dctint)(IN(2) * 3196U - IN(14) * 16069U + (1 << 13)) >> 14;
1298 1130576 t7a = (dctint)(IN(2) * 16069U + IN(14) * 3196U + (1 << 13)) >> 14;
1299 1130576 t5a = (dctint)(IN(10) * 13623U - IN(6) * 9102U + (1 << 13)) >> 14;
1300 1130576 t6a = (dctint)(IN(10) * 9102U + IN(6) * 13623U + (1 << 13)) >> 14;
1301 1130576 t8a = (dctint)(IN(1) * 1606U - IN(15) * 16305U + (1 << 13)) >> 14;
1302 1130576 t15a = (dctint)(IN(1) * 16305U + IN(15) * 1606U + (1 << 13)) >> 14;
1303 1130576 t9a = (dctint)(IN(9) * 12665U - IN(7) * 10394U + (1 << 13)) >> 14;
1304 1130576 t14a = (dctint)(IN(9) * 10394U + IN(7) * 12665U + (1 << 13)) >> 14;
1305 1130576 t10a = (dctint)(IN(5) * 7723U - IN(11) * 14449U + (1 << 13)) >> 14;
1306 1130576 t13a = (dctint)(IN(5) * 14449U + IN(11) * 7723U + (1 << 13)) >> 14;
1307 1130576 t11a = (dctint)(IN(13) * 15679U - IN(3) * 4756U + (1 << 13)) >> 14;
1308 1130576 t12a = (dctint)(IN(13) * 4756U + IN(3) * 15679U + (1 << 13)) >> 14;
1309
1310 1130576 t0 = t0a + t3a;
1311 1130576 t1 = t1a + t2a;
1312 1130576 t2 = t1a - t2a;
1313 1130576 t3 = t0a - t3a;
1314 1130576 t4 = t4a + t5a;
1315 1130576 t5 = t4a - t5a;
1316 1130576 t6 = t7a - t6a;
1317 1130576 t7 = t7a + t6a;
1318 1130576 t8 = t8a + t9a;
1319 1130576 t9 = t8a - t9a;
1320 1130576 t10 = t11a - t10a;
1321 1130576 t11 = t11a + t10a;
1322 1130576 t12 = t12a + t13a;
1323 1130576 t13 = t12a - t13a;
1324 1130576 t14 = t15a - t14a;
1325 1130576 t15 = t15a + t14a;
1326
1327 1130576 t5a = (dctint)((t6 - t5) * 11585U + (1 << 13)) >> 14;
1328 1130576 t6a = (dctint)((t6 + t5) * 11585U + (1 << 13)) >> 14;
1329 1130576 t9a = (dctint)( t14 * 6270U - t9 * 15137U + (1 << 13)) >> 14;
1330 1130576 t14a = (dctint)( t14 * 15137U + t9 * 6270U + (1 << 13)) >> 14;
1331 1130576 t10a = (dctint)(-(t13 * 15137U + t10 * 6270U) + (1 << 13)) >> 14;
1332 1130576 t13a = (dctint)( t13 * 6270U - t10 * 15137U + (1 << 13)) >> 14;
1333
1334 1130576 t0a = t0 + t7;
1335 1130576 t1a = t1 + t6a;
1336 1130576 t2a = t2 + t5a;
1337 1130576 t3a = t3 + t4;
1338 1130576 t4 = t3 - t4;
1339 1130576 t5 = t2 - t5a;
1340 1130576 t6 = t1 - t6a;
1341 1130576 t7 = t0 - t7;
1342 1130576 t8a = t8 + t11;
1343 1130576 t9 = t9a + t10a;
1344 1130576 t10 = t9a - t10a;
1345 1130576 t11a = t8 - t11;
1346 1130576 t12a = t15 - t12;
1347 1130576 t13 = t14a - t13a;
1348 1130576 t14 = t14a + t13a;
1349 1130576 t15a = t15 + t12;
1350
1351 1130576 t10a = (dctint)((t13 - t10) * 11585U + (1 << 13)) >> 14;
1352 1130576 t13a = (dctint)((t13 + t10) * 11585U + (1 << 13)) >> 14;
1353 1130576 t11 = (dctint)((t12a - t11a) * 11585U + (1 << 13)) >> 14;
1354 1130576 t12 = (dctint)((t12a + t11a) * 11585U + (1 << 13)) >> 14;
1355
1356 1130576 out[ 0] = t0a + t15a;
1357 1130576 out[ 1] = t1a + t14;
1358 1130576 out[ 2] = t2a + t13a;
1359 1130576 out[ 3] = t3a + t12;
1360 1130576 out[ 4] = t4 + t11;
1361 1130576 out[ 5] = t5 + t10a;
1362 1130576 out[ 6] = t6 + t9;
1363 1130576 out[ 7] = t7 + t8a;
1364 1130576 out[ 8] = t7 - t8a;
1365 1130576 out[ 9] = t6 - t9;
1366 1130576 out[10] = t5 - t10a;
1367 1130576 out[11] = t4 - t11;
1368 1130576 out[12] = t3a - t12;
1369 1130576 out[13] = t2a - t13a;
1370 1130576 out[14] = t1a - t14;
1371 1130576 out[15] = t0a - t15a;
1372 1130576 }
1373
1374 334320 static av_always_inline void iadst16_1d(const dctcoef *in, ptrdiff_t stride,
1375 dctcoef *out, int pass)
1376 {
1377 dctint t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
1378 dctint t0a, t1a, t2a, t3a, t4a, t5a, t6a, t7a;
1379 dctint t8a, t9a, t10a, t11a, t12a, t13a, t14a, t15a;
1380
1381 334320 t0 = IN(15) * 16364U + IN(0) * 804U;
1382 334320 t1 = IN(15) * 804U - IN(0) * 16364U;
1383 334320 t2 = IN(13) * 15893U + IN(2) * 3981U;
1384 334320 t3 = IN(13) * 3981U - IN(2) * 15893U;
1385 334320 t4 = IN(11) * 14811U + IN(4) * 7005U;
1386 334320 t5 = IN(11) * 7005U - IN(4) * 14811U;
1387 334320 t6 = IN(9) * 13160U + IN(6) * 9760U;
1388 334320 t7 = IN(9) * 9760U - IN(6) * 13160U;
1389 334320 t8 = IN(7) * 11003U + IN(8) * 12140U;
1390 334320 t9 = IN(7) * 12140U - IN(8) * 11003U;
1391 334320 t10 = IN(5) * 8423U + IN(10) * 14053U;
1392 334320 t11 = IN(5) * 14053U - IN(10) * 8423U;
1393 334320 t12 = IN(3) * 5520U + IN(12) * 15426U;
1394 334320 t13 = IN(3) * 15426U - IN(12) * 5520U;
1395 334320 t14 = IN(1) * 2404U + IN(14) * 16207U;
1396 334320 t15 = IN(1) * 16207U - IN(14) * 2404U;
1397
1398 334320 t0a = (dctint)((1U << 13) + t0 + t8 ) >> 14;
1399 334320 t1a = (dctint)((1U << 13) + t1 + t9 ) >> 14;
1400 334320 t2a = (dctint)((1U << 13) + t2 + t10) >> 14;
1401 334320 t3a = (dctint)((1U << 13) + t3 + t11) >> 14;
1402 334320 t4a = (dctint)((1U << 13) + t4 + t12) >> 14;
1403 334320 t5a = (dctint)((1U << 13) + t5 + t13) >> 14;
1404 334320 t6a = (dctint)((1U << 13) + t6 + t14) >> 14;
1405 334320 t7a = (dctint)((1U << 13) + t7 + t15) >> 14;
1406 334320 t8a = (dctint)((1U << 13) + t0 - t8 ) >> 14;
1407 334320 t9a = (dctint)((1U << 13) + t1 - t9 ) >> 14;
1408 334320 t10a = (dctint)((1U << 13) + t2 - t10) >> 14;
1409 334320 t11a = (dctint)((1U << 13) + t3 - t11) >> 14;
1410 334320 t12a = (dctint)((1U << 13) + t4 - t12) >> 14;
1411 334320 t13a = (dctint)((1U << 13) + t5 - t13) >> 14;
1412 334320 t14a = (dctint)((1U << 13) + t6 - t14) >> 14;
1413 334320 t15a = (dctint)((1U << 13) + t7 - t15) >> 14;
1414
1415 334320 t8 = t8a * 16069U + t9a * 3196U;
1416 334320 t9 = t8a * 3196U - t9a * 16069U;
1417 334320 t10 = t10a * 9102U + t11a * 13623U;
1418 334320 t11 = t10a * 13623U - t11a * 9102U;
1419 334320 t12 = t13a * 16069U - t12a * 3196U;
1420 334320 t13 = t13a * 3196U + t12a * 16069U;
1421 334320 t14 = t15a * 9102U - t14a * 13623U;
1422 334320 t15 = t15a * 13623U + t14a * 9102U;
1423
1424 334320 t0 = t0a + t4a;
1425 334320 t1 = t1a + t5a;
1426 334320 t2 = t2a + t6a;
1427 334320 t3 = t3a + t7a;
1428 334320 t4 = t0a - t4a;
1429 334320 t5 = t1a - t5a;
1430 334320 t6 = t2a - t6a;
1431 334320 t7 = t3a - t7a;
1432 334320 t8a = (dctint)((1U << 13) + t8 + t12) >> 14;
1433 334320 t9a = (dctint)((1U << 13) + t9 + t13) >> 14;
1434 334320 t10a = (dctint)((1U << 13) + t10 + t14) >> 14;
1435 334320 t11a = (dctint)((1U << 13) + t11 + t15) >> 14;
1436 334320 t12a = (dctint)((1U << 13) + t8 - t12) >> 14;
1437 334320 t13a = (dctint)((1U << 13) + t9 - t13) >> 14;
1438 334320 t14a = (dctint)((1U << 13) + t10 - t14) >> 14;
1439 334320 t15a = (dctint)((1U << 13) + t11 - t15) >> 14;
1440
1441 334320 t4a = t4 * 15137U + t5 * 6270U;
1442 334320 t5a = t4 * 6270U - t5 * 15137U;
1443 334320 t6a = t7 * 15137U - t6 * 6270U;
1444 334320 t7a = t7 * 6270U + t6 * 15137U;
1445 334320 t12 = t12a * 15137U + t13a * 6270U;
1446 334320 t13 = t12a * 6270U - t13a * 15137U;
1447 334320 t14 = t15a * 15137U - t14a * 6270U;
1448 334320 t15 = t15a * 6270U + t14a * 15137U;
1449
1450 334320 out[ 0] = t0 + t2;
1451 334320 out[15] = -(t1 + t3);
1452 334320 t2a = t0 - t2;
1453 334320 t3a = t1 - t3;
1454 334320 out[ 3] = -((dctint)((1U << 13) + t4a + t6a) >> 14);
1455 334320 out[12] = (dctint)((1U << 13) + t5a + t7a) >> 14;
1456 334320 t6 = (dctint)((1U << 13) + t4a - t6a) >> 14;
1457 334320 t7 = (dctint)((1U << 13) + t5a - t7a) >> 14;
1458 334320 out[ 1] = -(t8a + t10a);
1459 334320 out[14] = t9a + t11a;
1460 334320 t10 = t8a - t10a;
1461 334320 t11 = t9a - t11a;
1462 334320 out[ 2] = (dctint)((1U << 13) + t12 + t14) >> 14;
1463 334320 out[13] = -((dctint)((1U << 13) + t13 + t15) >> 14);
1464 334320 t14a = (dctint)((1U << 13) + t12 - t14) >> 14;
1465 334320 t15a = (dctint)((1U << 13) + t13 - t15) >> 14;
1466
1467 334320 out[ 7] = (dctint)(-(t2a + t3a) * 11585U + (1 << 13)) >> 14;
1468 334320 out[ 8] = (dctint)( (t2a - t3a) * 11585U + (1 << 13)) >> 14;
1469 334320 out[ 4] = (dctint)( (t7 + t6) * 11585U + (1 << 13)) >> 14;
1470 334320 out[11] = (dctint)( (t7 - t6) * 11585U + (1 << 13)) >> 14;
1471 334320 out[ 6] = (dctint)( (t11 + t10) * 11585U + (1 << 13)) >> 14;
1472 334320 out[ 9] = (dctint)( (t11 - t10) * 11585U + (1 << 13)) >> 14;
1473 334320 out[ 5] = (dctint)(-(t14a + t15a) * 11585U + (1 << 13)) >> 14;
1474 334320 out[10] = (dctint)( (t14a - t15a) * 11585U + (1 << 13)) >> 14;
1475 334320 }
1476
1477
13/13
✓ Branch 0 taken 8406 times.
✓ Branch 1 taken 309838 times.
✓ Branch 2 taken 2169540 times.
✓ Branch 3 taken 134496 times.
✓ Branch 4 taken 4641120 times.
✓ Branch 5 taken 290070 times.
✓ Branch 6 taken 281664 times.
✓ Branch 7 taken 468388 times.
✓ Branch 8 taken 28174 times.
✓ Branch 10 taken 7212544 times.
✓ Branch 11 taken 450784 times.
✓ Branch 12 taken 450784 times.
✓ Branch 13 taken 28174 times.
31049360 itxfm_wrap(16, 6)
1478
1479 649536 static av_always_inline void idct32_1d(const dctcoef *in, ptrdiff_t stride,
1480 dctcoef *out, int pass)
1481 {
1482 649536 dctint t0a = (dctint)((IN(0) + IN(16)) * 11585U + (1 << 13)) >> 14;
1483 649536 dctint t1a = (dctint)((IN(0) - IN(16)) * 11585U + (1 << 13)) >> 14;
1484 649536 dctint t2a = (dctint)(IN( 8) * 6270U - IN(24) * 15137U + (1 << 13)) >> 14;
1485 649536 dctint t3a = (dctint)(IN( 8) * 15137U + IN(24) * 6270U + (1 << 13)) >> 14;
1486 649536 dctint t4a = (dctint)(IN( 4) * 3196U - IN(28) * 16069U + (1 << 13)) >> 14;
1487 649536 dctint t7a = (dctint)(IN( 4) * 16069U + IN(28) * 3196U + (1 << 13)) >> 14;
1488 649536 dctint t5a = (dctint)(IN(20) * 13623U - IN(12) * 9102U + (1 << 13)) >> 14;
1489 649536 dctint t6a = (dctint)(IN(20) * 9102U + IN(12) * 13623U + (1 << 13)) >> 14;
1490 649536 dctint t8a = (dctint)(IN( 2) * 1606U - IN(30) * 16305U + (1 << 13)) >> 14;
1491 649536 dctint t15a = (dctint)(IN( 2) * 16305U + IN(30) * 1606U + (1 << 13)) >> 14;
1492 649536 dctint t9a = (dctint)(IN(18) * 12665U - IN(14) * 10394U + (1 << 13)) >> 14;
1493 649536 dctint t14a = (dctint)(IN(18) * 10394U + IN(14) * 12665U + (1 << 13)) >> 14;
1494 649536 dctint t10a = (dctint)(IN(10) * 7723U - IN(22) * 14449U + (1 << 13)) >> 14;
1495 649536 dctint t13a = (dctint)(IN(10) * 14449U + IN(22) * 7723U + (1 << 13)) >> 14;
1496 649536 dctint t11a = (dctint)(IN(26) * 15679U - IN( 6) * 4756U + (1 << 13)) >> 14;
1497 649536 dctint t12a = (dctint)(IN(26) * 4756U + IN( 6) * 15679U + (1 << 13)) >> 14;
1498 649536 dctint t16a = (dctint)(IN( 1) * 804U - IN(31) * 16364U + (1 << 13)) >> 14;
1499 649536 dctint t31a = (dctint)(IN( 1) * 16364U + IN(31) * 804U + (1 << 13)) >> 14;
1500 649536 dctint t17a = (dctint)(IN(17) * 12140U - IN(15) * 11003U + (1 << 13)) >> 14;
1501 649536 dctint t30a = (dctint)(IN(17) * 11003U + IN(15) * 12140U + (1 << 13)) >> 14;
1502 649536 dctint t18a = (dctint)(IN( 9) * 7005U - IN(23) * 14811U + (1 << 13)) >> 14;
1503 649536 dctint t29a = (dctint)(IN( 9) * 14811U + IN(23) * 7005U + (1 << 13)) >> 14;
1504 649536 dctint t19a = (dctint)(IN(25) * 15426U - IN( 7) * 5520U + (1 << 13)) >> 14;
1505 649536 dctint t28a = (dctint)(IN(25) * 5520U + IN( 7) * 15426U + (1 << 13)) >> 14;
1506 649536 dctint t20a = (dctint)(IN( 5) * 3981U - IN(27) * 15893U + (1 << 13)) >> 14;
1507 649536 dctint t27a = (dctint)(IN( 5) * 15893U + IN(27) * 3981U + (1 << 13)) >> 14;
1508 649536 dctint t21a = (dctint)(IN(21) * 14053U - IN(11) * 8423U + (1 << 13)) >> 14;
1509 649536 dctint t26a = (dctint)(IN(21) * 8423U + IN(11) * 14053U + (1 << 13)) >> 14;
1510 649536 dctint t22a = (dctint)(IN(13) * 9760U - IN(19) * 13160U + (1 << 13)) >> 14;
1511 649536 dctint t25a = (dctint)(IN(13) * 13160U + IN(19) * 9760U + (1 << 13)) >> 14;
1512 649536 dctint t23a = (dctint)(IN(29) * 16207U - IN( 3) * 2404U + (1 << 13)) >> 14;
1513 649536 dctint t24a = (dctint)(IN(29) * 2404U + IN( 3) * 16207U + (1 << 13)) >> 14;
1514
1515 649536 dctint t0 = t0a + t3a;
1516 649536 dctint t1 = t1a + t2a;
1517 649536 dctint t2 = t1a - t2a;
1518 649536 dctint t3 = t0a - t3a;
1519 649536 dctint t4 = t4a + t5a;
1520 649536 dctint t5 = t4a - t5a;
1521 649536 dctint t6 = t7a - t6a;
1522 649536 dctint t7 = t7a + t6a;
1523 649536 dctint t8 = t8a + t9a;
1524 649536 dctint t9 = t8a - t9a;
1525 649536 dctint t10 = t11a - t10a;
1526 649536 dctint t11 = t11a + t10a;
1527 649536 dctint t12 = t12a + t13a;
1528 649536 dctint t13 = t12a - t13a;
1529 649536 dctint t14 = t15a - t14a;
1530 649536 dctint t15 = t15a + t14a;
1531 649536 dctint t16 = t16a + t17a;
1532 649536 dctint t17 = t16a - t17a;
1533 649536 dctint t18 = t19a - t18a;
1534 649536 dctint t19 = t19a + t18a;
1535 649536 dctint t20 = t20a + t21a;
1536 649536 dctint t21 = t20a - t21a;
1537 649536 dctint t22 = t23a - t22a;
1538 649536 dctint t23 = t23a + t22a;
1539 649536 dctint t24 = t24a + t25a;
1540 649536 dctint t25 = t24a - t25a;
1541 649536 dctint t26 = t27a - t26a;
1542 649536 dctint t27 = t27a + t26a;
1543 649536 dctint t28 = t28a + t29a;
1544 649536 dctint t29 = t28a - t29a;
1545 649536 dctint t30 = t31a - t30a;
1546 649536 dctint t31 = t31a + t30a;
1547
1548 649536 t5a = (dctint)((t6 - t5) * 11585U + (1 << 13)) >> 14;
1549 649536 t6a = (dctint)((t6 + t5) * 11585U + (1 << 13)) >> 14;
1550 649536 t9a = (dctint)( t14 * 6270U - t9 * 15137U + (1 << 13)) >> 14;
1551 649536 t14a = (dctint)( t14 * 15137U + t9 * 6270U + (1 << 13)) >> 14;
1552 649536 t10a = (dctint)(-(t13 * 15137U + t10 * 6270U) + (1 << 13)) >> 14;
1553 649536 t13a = (dctint)( t13 * 6270U - t10 * 15137U + (1 << 13)) >> 14;
1554 649536 t17a = (dctint)( t30 * 3196U - t17 * 16069U + (1 << 13)) >> 14;
1555 649536 t30a = (dctint)( t30 * 16069U + t17 * 3196U + (1 << 13)) >> 14;
1556 649536 t18a = (dctint)(-(t29 * 16069U + t18 * 3196U) + (1 << 13)) >> 14;
1557 649536 t29a = (dctint)( t29 * 3196U - t18 * 16069U + (1 << 13)) >> 14;
1558 649536 t21a = (dctint)( t26 * 13623U - t21 * 9102U + (1 << 13)) >> 14;
1559 649536 t26a = (dctint)( t26 * 9102U + t21 * 13623U + (1 << 13)) >> 14;
1560 649536 t22a = (dctint)(-(t25 * 9102U + t22 * 13623U) + (1 << 13)) >> 14;
1561 649536 t25a = (dctint)( t25 * 13623U - t22 * 9102U + (1 << 13)) >> 14;
1562
1563 649536 t0a = t0 + t7;
1564 649536 t1a = t1 + t6a;
1565 649536 t2a = t2 + t5a;
1566 649536 t3a = t3 + t4;
1567 649536 t4a = t3 - t4;
1568 649536 t5 = t2 - t5a;
1569 649536 t6 = t1 - t6a;
1570 649536 t7a = t0 - t7;
1571 649536 t8a = t8 + t11;
1572 649536 t9 = t9a + t10a;
1573 649536 t10 = t9a - t10a;
1574 649536 t11a = t8 - t11;
1575 649536 t12a = t15 - t12;
1576 649536 t13 = t14a - t13a;
1577 649536 t14 = t14a + t13a;
1578 649536 t15a = t15 + t12;
1579 649536 t16a = t16 + t19;
1580 649536 t17 = t17a + t18a;
1581 649536 t18 = t17a - t18a;
1582 649536 t19a = t16 - t19;
1583 649536 t20a = t23 - t20;
1584 649536 t21 = t22a - t21a;
1585 649536 t22 = t22a + t21a;
1586 649536 t23a = t23 + t20;
1587 649536 t24a = t24 + t27;
1588 649536 t25 = t25a + t26a;
1589 649536 t26 = t25a - t26a;
1590 649536 t27a = t24 - t27;
1591 649536 t28a = t31 - t28;
1592 649536 t29 = t30a - t29a;
1593 649536 t30 = t30a + t29a;
1594 649536 t31a = t31 + t28;
1595
1596 649536 t10a = (dctint)((t13 - t10) * 11585U + (1 << 13)) >> 14;
1597 649536 t13a = (dctint)((t13 + t10) * 11585U + (1 << 13)) >> 14;
1598 649536 t11 = (dctint)((t12a - t11a) * 11585U + (1 << 13)) >> 14;
1599 649536 t12 = (dctint)((t12a + t11a) * 11585U + (1 << 13)) >> 14;
1600 649536 t18a = (dctint)( t29 * 6270U - t18 * 15137U + (1 << 13)) >> 14;
1601 649536 t29a = (dctint)( t29 * 15137U + t18 * 6270U + (1 << 13)) >> 14;
1602 649536 t19 = (dctint)( t28a * 6270U - t19a * 15137U + (1 << 13)) >> 14;
1603 649536 t28 = (dctint)( t28a * 15137U + t19a * 6270U + (1 << 13)) >> 14;
1604 649536 t20 = (dctint)(-(t27a * 15137U + t20a * 6270U) + (1 << 13)) >> 14;
1605 649536 t27 = (dctint)( t27a * 6270U - t20a * 15137U + (1 << 13)) >> 14;
1606 649536 t21a = (dctint)(-(t26 * 15137U + t21 * 6270U) + (1 << 13)) >> 14;
1607 649536 t26a = (dctint)( t26 * 6270U - t21 * 15137U + (1 << 13)) >> 14;
1608
1609 649536 t0 = t0a + t15a;
1610 649536 t1 = t1a + t14;
1611 649536 t2 = t2a + t13a;
1612 649536 t3 = t3a + t12;
1613 649536 t4 = t4a + t11;
1614 649536 t5a = t5 + t10a;
1615 649536 t6a = t6 + t9;
1616 649536 t7 = t7a + t8a;
1617 649536 t8 = t7a - t8a;
1618 649536 t9a = t6 - t9;
1619 649536 t10 = t5 - t10a;
1620 649536 t11a = t4a - t11;
1621 649536 t12a = t3a - t12;
1622 649536 t13 = t2a - t13a;
1623 649536 t14a = t1a - t14;
1624 649536 t15 = t0a - t15a;
1625 649536 t16 = t16a + t23a;
1626 649536 t17a = t17 + t22;
1627 649536 t18 = t18a + t21a;
1628 649536 t19a = t19 + t20;
1629 649536 t20a = t19 - t20;
1630 649536 t21 = t18a - t21a;
1631 649536 t22a = t17 - t22;
1632 649536 t23 = t16a - t23a;
1633 649536 t24 = t31a - t24a;
1634 649536 t25a = t30 - t25;
1635 649536 t26 = t29a - t26a;
1636 649536 t27a = t28 - t27;
1637 649536 t28a = t28 + t27;
1638 649536 t29 = t29a + t26a;
1639 649536 t30a = t30 + t25;
1640 649536 t31 = t31a + t24a;
1641
1642 649536 t20 = (dctint)((t27a - t20a) * 11585U + (1 << 13)) >> 14;
1643 649536 t27 = (dctint)((t27a + t20a) * 11585U + (1 << 13)) >> 14;
1644 649536 t21a = (dctint)((t26 - t21 ) * 11585U + (1 << 13)) >> 14;
1645 649536 t26a = (dctint)((t26 + t21 ) * 11585U + (1 << 13)) >> 14;
1646 649536 t22 = (dctint)((t25a - t22a) * 11585U + (1 << 13)) >> 14;
1647 649536 t25 = (dctint)((t25a + t22a) * 11585U + (1 << 13)) >> 14;
1648 649536 t23a = (dctint)((t24 - t23 ) * 11585U + (1 << 13)) >> 14;
1649 649536 t24a = (dctint)((t24 + t23 ) * 11585U + (1 << 13)) >> 14;
1650
1651 649536 out[ 0] = t0 + t31;
1652 649536 out[ 1] = t1 + t30a;
1653 649536 out[ 2] = t2 + t29;
1654 649536 out[ 3] = t3 + t28a;
1655 649536 out[ 4] = t4 + t27;
1656 649536 out[ 5] = t5a + t26a;
1657 649536 out[ 6] = t6a + t25;
1658 649536 out[ 7] = t7 + t24a;
1659 649536 out[ 8] = t8 + t23a;
1660 649536 out[ 9] = t9a + t22;
1661 649536 out[10] = t10 + t21a;
1662 649536 out[11] = t11a + t20;
1663 649536 out[12] = t12a + t19a;
1664 649536 out[13] = t13 + t18;
1665 649536 out[14] = t14a + t17a;
1666 649536 out[15] = t15 + t16;
1667 649536 out[16] = t15 - t16;
1668 649536 out[17] = t14a - t17a;
1669 649536 out[18] = t13 - t18;
1670 649536 out[19] = t12a - t19a;
1671 649536 out[20] = t11a - t20;
1672 649536 out[21] = t10 - t21a;
1673 649536 out[22] = t9a - t22;
1674 649536 out[23] = t8 - t23a;
1675 649536 out[24] = t7 - t24a;
1676 649536 out[25] = t6a - t25;
1677 649536 out[26] = t5a - t26a;
1678 649536 out[27] = t4 - t27;
1679 649536 out[28] = t3 - t28a;
1680 649536 out[29] = t2 - t29;
1681 649536 out[30] = t1 - t30a;
1682 649536 out[31] = t0 - t31;
1683 649536 }
1684
1685
12/12
✓ Branch 0 taken 3411 times.
✓ Branch 1 taken 10149 times.
✓ Branch 2 taken 3492864 times.
✓ Branch 3 taken 109152 times.
✓ Branch 4 taken 109152 times.
✓ Branch 5 taken 3411 times.
✓ Branch 7 taken 324768 times.
✓ Branch 8 taken 10149 times.
✓ Branch 10 taken 10392576 times.
✓ Branch 11 taken 324768 times.
✓ Branch 12 taken 324768 times.
✓ Branch 13 taken 10149 times.
14657688 itxfm_wrapper(idct, idct, 32, 6, 1)
1686
1687 229432 static av_always_inline void iwht4_1d(const dctcoef *in, ptrdiff_t stride,
1688 dctcoef *out, int pass)
1689 {
1690 int t0, t1, t2, t3, t4;
1691
1692
2/2
✓ Branch 0 taken 114716 times.
✓ Branch 1 taken 114716 times.
229432 if (pass == 0) {
1693 114716