Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * Copyright (C) 2010 David Conrad | ||
3 | * Copyright (C) 2010 Ronald S. Bultje | ||
4 | * Copyright (C) 2014 Peter Ross | ||
5 | * | ||
6 | * This file is part of FFmpeg. | ||
7 | * | ||
8 | * FFmpeg is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU Lesser General Public | ||
10 | * License as published by the Free Software Foundation; either | ||
11 | * version 2.1 of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * FFmpeg is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * Lesser General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public | ||
19 | * License along with FFmpeg; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | /** | ||
24 | * @file | ||
25 | * VP8 compatible video decoder | ||
26 | */ | ||
27 | |||
28 | #include "config_components.h" | ||
29 | |||
30 | #include "libavutil/common.h" | ||
31 | #include "libavutil/intreadwrite.h" | ||
32 | |||
33 | #include "mathops.h" | ||
34 | #include "vp8dsp.h" | ||
35 | |||
36 | #define MK_IDCT_DC_ADD4_C(name) \ | ||
37 | static void name ## _idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], \ | ||
38 | ptrdiff_t stride) \ | ||
39 | { \ | ||
40 | name ## _idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); \ | ||
41 | name ## _idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); \ | ||
42 | name ## _idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); \ | ||
43 | name ## _idct_dc_add_c(dst + stride * 4 + 4, block[3], stride); \ | ||
44 | } \ | ||
45 | \ | ||
46 | static void name ## _idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], \ | ||
47 | ptrdiff_t stride) \ | ||
48 | { \ | ||
49 | name ## _idct_dc_add_c(dst + 0, block[0], stride); \ | ||
50 | name ## _idct_dc_add_c(dst + 4, block[1], stride); \ | ||
51 | name ## _idct_dc_add_c(dst + 8, block[2], stride); \ | ||
52 | name ## _idct_dc_add_c(dst + 12, block[3], stride); \ | ||
53 | } | ||
54 | |||
55 | #if CONFIG_VP7_DECODER | ||
56 | 2 | static void vp7_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16]) | |
57 | { | ||
58 | int i; | ||
59 | unsigned a1, b1, c1, d1; | ||
60 | int16_t tmp[16]; | ||
61 | |||
62 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 2 times.
|
10 | for (i = 0; i < 4; i++) { |
63 | 8 | a1 = (dc[i * 4 + 0] + dc[i * 4 + 2]) * 23170; | |
64 | 8 | b1 = (dc[i * 4 + 0] - dc[i * 4 + 2]) * 23170; | |
65 | 8 | c1 = dc[i * 4 + 1] * 12540 - dc[i * 4 + 3] * 30274; | |
66 | 8 | d1 = dc[i * 4 + 1] * 30274 + dc[i * 4 + 3] * 12540; | |
67 | 8 | tmp[i * 4 + 0] = (int)(a1 + d1) >> 14; | |
68 | 8 | tmp[i * 4 + 3] = (int)(a1 - d1) >> 14; | |
69 | 8 | tmp[i * 4 + 1] = (int)(b1 + c1) >> 14; | |
70 | 8 | tmp[i * 4 + 2] = (int)(b1 - c1) >> 14; | |
71 | } | ||
72 | |||
73 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 2 times.
|
10 | for (i = 0; i < 4; i++) { |
74 | 8 | a1 = (tmp[i + 0] + tmp[i + 8]) * 23170; | |
75 | 8 | b1 = (tmp[i + 0] - tmp[i + 8]) * 23170; | |
76 | 8 | c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274; | |
77 | 8 | d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540; | |
78 | 8 | AV_ZERO64(dc + i * 4); | |
79 | 8 | block[0][i][0] = (int)(a1 + d1 + 0x20000) >> 18; | |
80 | 8 | block[3][i][0] = (int)(a1 - d1 + 0x20000) >> 18; | |
81 | 8 | block[1][i][0] = (int)(b1 + c1 + 0x20000) >> 18; | |
82 | 8 | block[2][i][0] = (int)(b1 - c1 + 0x20000) >> 18; | |
83 | } | ||
84 | 2 | } | |
85 | |||
86 | 28 | static void vp7_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16]) | |
87 | { | ||
88 | 28 | int i, val = (23170 * (23170 * dc[0] >> 14) + 0x20000) >> 18; | |
89 | 28 | dc[0] = 0; | |
90 | |||
91 |
2/2✓ Branch 0 taken 112 times.
✓ Branch 1 taken 28 times.
|
140 | for (i = 0; i < 4; i++) { |
92 | 112 | block[i][0][0] = val; | |
93 | 112 | block[i][1][0] = val; | |
94 | 112 | block[i][2][0] = val; | |
95 | 112 | block[i][3][0] = val; | |
96 | } | ||
97 | 28 | } | |
98 | |||
99 | 660 | static void vp7_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) | |
100 | { | ||
101 | int i; | ||
102 | unsigned a1, b1, c1, d1; | ||
103 | int16_t tmp[16]; | ||
104 | |||
105 |
2/2✓ Branch 0 taken 2640 times.
✓ Branch 1 taken 660 times.
|
3300 | for (i = 0; i < 4; i++) { |
106 | 2640 | a1 = (block[i * 4 + 0] + block[i * 4 + 2]) * 23170; | |
107 | 2640 | b1 = (block[i * 4 + 0] - block[i * 4 + 2]) * 23170; | |
108 | 2640 | c1 = block[i * 4 + 1] * 12540 - block[i * 4 + 3] * 30274; | |
109 | 2640 | d1 = block[i * 4 + 1] * 30274 + block[i * 4 + 3] * 12540; | |
110 | 2640 | AV_ZERO64(block + i * 4); | |
111 | 2640 | tmp[i * 4 + 0] = (int)(a1 + d1) >> 14; | |
112 | 2640 | tmp[i * 4 + 3] = (int)(a1 - d1) >> 14; | |
113 | 2640 | tmp[i * 4 + 1] = (int)(b1 + c1) >> 14; | |
114 | 2640 | tmp[i * 4 + 2] = (int)(b1 - c1) >> 14; | |
115 | } | ||
116 | |||
117 |
2/2✓ Branch 0 taken 2640 times.
✓ Branch 1 taken 660 times.
|
3300 | for (i = 0; i < 4; i++) { |
118 | 2640 | a1 = (tmp[i + 0] + tmp[i + 8]) * 23170; | |
119 | 2640 | b1 = (tmp[i + 0] - tmp[i + 8]) * 23170; | |
120 | 2640 | c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274; | |
121 | 2640 | d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540; | |
122 | 2640 | dst[0 * stride + i] = av_clip_uint8(dst[0 * stride + i] + | |
123 | 2640 | ((int)(a1 + d1 + 0x20000) >> 18)); | |
124 | 2640 | dst[3 * stride + i] = av_clip_uint8(dst[3 * stride + i] + | |
125 | 2640 | ((int)(a1 - d1 + 0x20000) >> 18)); | |
126 | 2640 | dst[1 * stride + i] = av_clip_uint8(dst[1 * stride + i] + | |
127 | 2640 | ((int)(b1 + c1 + 0x20000) >> 18)); | |
128 | 2640 | dst[2 * stride + i] = av_clip_uint8(dst[2 * stride + i] + | |
129 | 2640 | ((int)(b1 - c1 + 0x20000) >> 18)); | |
130 | } | ||
131 | 660 | } | |
132 | |||
133 | 529 | static void vp7_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) | |
134 | { | ||
135 | 529 | int i, dc = (23170 * (23170 * block[0] >> 14) + 0x20000) >> 18; | |
136 | 529 | block[0] = 0; | |
137 | |||
138 |
2/2✓ Branch 0 taken 2116 times.
✓ Branch 1 taken 529 times.
|
2645 | for (i = 0; i < 4; i++) { |
139 | 2116 | dst[0] = av_clip_uint8(dst[0] + dc); | |
140 | 2116 | dst[1] = av_clip_uint8(dst[1] + dc); | |
141 | 2116 | dst[2] = av_clip_uint8(dst[2] + dc); | |
142 | 2116 | dst[3] = av_clip_uint8(dst[3] + dc); | |
143 | 2116 | dst += stride; | |
144 | } | ||
145 | 529 | } | |
146 | |||
147 | 250 | MK_IDCT_DC_ADD4_C(vp7) | |
148 | #endif /* CONFIG_VP7_DECODER */ | ||
149 | |||
150 | // TODO: Maybe add dequant | ||
151 | #if CONFIG_VP8_DECODER | ||
152 | 24673 | static void vp8_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16]) | |
153 | { | ||
154 | int i, t0, t1, t2, t3; | ||
155 | |||
156 |
2/2✓ Branch 0 taken 98692 times.
✓ Branch 1 taken 24673 times.
|
123365 | for (i = 0; i < 4; i++) { |
157 | 98692 | t0 = dc[0 * 4 + i] + dc[3 * 4 + i]; | |
158 | 98692 | t1 = dc[1 * 4 + i] + dc[2 * 4 + i]; | |
159 | 98692 | t2 = dc[1 * 4 + i] - dc[2 * 4 + i]; | |
160 | 98692 | t3 = dc[0 * 4 + i] - dc[3 * 4 + i]; | |
161 | |||
162 | 98692 | dc[0 * 4 + i] = t0 + t1; | |
163 | 98692 | dc[1 * 4 + i] = t3 + t2; | |
164 | 98692 | dc[2 * 4 + i] = t0 - t1; | |
165 | 98692 | dc[3 * 4 + i] = t3 - t2; | |
166 | } | ||
167 | |||
168 |
2/2✓ Branch 0 taken 98692 times.
✓ Branch 1 taken 24673 times.
|
123365 | for (i = 0; i < 4; i++) { |
169 | 98692 | t0 = dc[i * 4 + 0] + dc[i * 4 + 3] + 3; // rounding | |
170 | 98692 | t1 = dc[i * 4 + 1] + dc[i * 4 + 2]; | |
171 | 98692 | t2 = dc[i * 4 + 1] - dc[i * 4 + 2]; | |
172 | 98692 | t3 = dc[i * 4 + 0] - dc[i * 4 + 3] + 3; // rounding | |
173 | 98692 | AV_ZERO64(dc + i * 4); | |
174 | |||
175 | 98692 | block[i][0][0] = (t0 + t1) >> 3; | |
176 | 98692 | block[i][1][0] = (t3 + t2) >> 3; | |
177 | 98692 | block[i][2][0] = (t0 - t1) >> 3; | |
178 | 98692 | block[i][3][0] = (t3 - t2) >> 3; | |
179 | } | ||
180 | 24673 | } | |
181 | |||
182 | 10419 | static void vp8_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16]) | |
183 | { | ||
184 | 10419 | int i, val = (dc[0] + 3) >> 3; | |
185 | 10419 | dc[0] = 0; | |
186 | |||
187 |
2/2✓ Branch 0 taken 41676 times.
✓ Branch 1 taken 10419 times.
|
52095 | for (i = 0; i < 4; i++) { |
188 | 41676 | block[i][0][0] = val; | |
189 | 41676 | block[i][1][0] = val; | |
190 | 41676 | block[i][2][0] = val; | |
191 | 41676 | block[i][3][0] = val; | |
192 | } | ||
193 | 10419 | } | |
194 | |||
195 | #define MUL_20091(a) ((((a) * 20091) >> 16) + (a)) | ||
196 | #define MUL_35468(a) (((a) * 35468) >> 16) | ||
197 | |||
198 | 217478 | static void vp8_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) | |
199 | { | ||
200 | int i, t0, t1, t2, t3; | ||
201 | int16_t tmp[16]; | ||
202 | |||
203 |
2/2✓ Branch 0 taken 869912 times.
✓ Branch 1 taken 217478 times.
|
1087390 | for (i = 0; i < 4; i++) { |
204 | 869912 | t0 = block[0 * 4 + i] + block[2 * 4 + i]; | |
205 | 869912 | t1 = block[0 * 4 + i] - block[2 * 4 + i]; | |
206 | 869912 | t2 = MUL_35468(block[1 * 4 + i]) - MUL_20091(block[3 * 4 + i]); | |
207 | 869912 | t3 = MUL_20091(block[1 * 4 + i]) + MUL_35468(block[3 * 4 + i]); | |
208 | 869912 | block[0 * 4 + i] = 0; | |
209 | 869912 | block[1 * 4 + i] = 0; | |
210 | 869912 | block[2 * 4 + i] = 0; | |
211 | 869912 | block[3 * 4 + i] = 0; | |
212 | |||
213 | 869912 | tmp[i * 4 + 0] = t0 + t3; | |
214 | 869912 | tmp[i * 4 + 1] = t1 + t2; | |
215 | 869912 | tmp[i * 4 + 2] = t1 - t2; | |
216 | 869912 | tmp[i * 4 + 3] = t0 - t3; | |
217 | } | ||
218 | |||
219 |
2/2✓ Branch 0 taken 869912 times.
✓ Branch 1 taken 217478 times.
|
1087390 | for (i = 0; i < 4; i++) { |
220 | 869912 | t0 = tmp[0 * 4 + i] + tmp[2 * 4 + i]; | |
221 | 869912 | t1 = tmp[0 * 4 + i] - tmp[2 * 4 + i]; | |
222 | 869912 | t2 = MUL_35468(tmp[1 * 4 + i]) - MUL_20091(tmp[3 * 4 + i]); | |
223 | 869912 | t3 = MUL_20091(tmp[1 * 4 + i]) + MUL_35468(tmp[3 * 4 + i]); | |
224 | |||
225 | 869912 | dst[0] = av_clip_uint8(dst[0] + ((t0 + t3 + 4) >> 3)); | |
226 | 869912 | dst[1] = av_clip_uint8(dst[1] + ((t1 + t2 + 4) >> 3)); | |
227 | 869912 | dst[2] = av_clip_uint8(dst[2] + ((t1 - t2 + 4) >> 3)); | |
228 | 869912 | dst[3] = av_clip_uint8(dst[3] + ((t0 - t3 + 4) >> 3)); | |
229 | 869912 | dst += stride; | |
230 | } | ||
231 | 217478 | } | |
232 | |||
233 | 753190 | static void vp8_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) | |
234 | { | ||
235 | 753190 | int i, dc = (block[0] + 4) >> 3; | |
236 | 753190 | block[0] = 0; | |
237 | |||
238 |
2/2✓ Branch 0 taken 3012760 times.
✓ Branch 1 taken 753190 times.
|
3765950 | for (i = 0; i < 4; i++) { |
239 | 3012760 | dst[0] = av_clip_uint8(dst[0] + dc); | |
240 | 3012760 | dst[1] = av_clip_uint8(dst[1] + dc); | |
241 | 3012760 | dst[2] = av_clip_uint8(dst[2] + dc); | |
242 | 3012760 | dst[3] = av_clip_uint8(dst[3] + dc); | |
243 | 3012760 | dst += stride; | |
244 | } | ||
245 | 753190 | } | |
246 | |||
247 | 324328 | MK_IDCT_DC_ADD4_C(vp8) | |
248 | #endif /* CONFIG_VP8_DECODER */ | ||
249 | |||
250 | // because I like only having two parameters to pass functions... | ||
251 | #define LOAD_PIXELS \ | ||
252 | int av_unused p3 = p[-4 * stride]; \ | ||
253 | int av_unused p2 = p[-3 * stride]; \ | ||
254 | int av_unused p1 = p[-2 * stride]; \ | ||
255 | int av_unused p0 = p[-1 * stride]; \ | ||
256 | int av_unused q0 = p[ 0 * stride]; \ | ||
257 | int av_unused q1 = p[ 1 * stride]; \ | ||
258 | int av_unused q2 = p[ 2 * stride]; \ | ||
259 | int av_unused q3 = p[ 3 * stride]; | ||
260 | |||
261 | #define clip_int8(n) (cm[(n) + 0x80] - 0x80) | ||
262 | |||
263 | 10224527 | static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, | |
264 | int is4tap, int is_vp7) | ||
265 | { | ||
266 | 10224527 | LOAD_PIXELS | |
267 | int a, f1, f2; | ||
268 | 10224527 | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; | |
269 | |||
270 | 10224527 | a = 3 * (q0 - p0); | |
271 | |||
272 |
2/2✓ Branch 0 taken 5535645 times.
✓ Branch 1 taken 4688882 times.
|
10224527 | if (is4tap) |
273 | 5535645 | a += clip_int8(p1 - q1); | |
274 | |||
275 | 10224527 | a = clip_int8(a); | |
276 | |||
277 | // We deviate from the spec here with c(a+3) >> 3 | ||
278 | // since that's what libvpx does. | ||
279 | 10224527 | f1 = FFMIN(a + 4, 127) >> 3; | |
280 | |||
281 |
2/2✓ Branch 0 taken 781851 times.
✓ Branch 1 taken 9442676 times.
|
10224527 | if (is_vp7) |
282 | 781851 | f2 = f1 - ((a & 7) == 4); | |
283 | else | ||
284 | 9442676 | f2 = FFMIN(a + 3, 127) >> 3; | |
285 | |||
286 | // Despite what the spec says, we do need to clamp here to | ||
287 | // be bitexact with libvpx. | ||
288 | 10224527 | p[-1 * stride] = cm[p0 + f2]; | |
289 | 10224527 | p[ 0 * stride] = cm[q0 - f1]; | |
290 | |||
291 | // only used for _inner on blocks without high edge variance | ||
292 |
2/2✓ Branch 0 taken 4688882 times.
✓ Branch 1 taken 5535645 times.
|
10224527 | if (!is4tap) { |
293 | 4688882 | a = (f1 + 1) >> 1; | |
294 | 4688882 | p[-2 * stride] = cm[p1 + a]; | |
295 | 4688882 | p[ 1 * stride] = cm[q1 - a]; | |
296 | } | ||
297 | 10224527 | } | |
298 | |||
299 | 781851 | static av_always_inline void vp7_filter_common(uint8_t *p, ptrdiff_t stride, | |
300 | int is4tap) | ||
301 | { | ||
302 | 781851 | filter_common(p, stride, is4tap, IS_VP7); | |
303 | 781851 | } | |
304 | |||
305 | 9442676 | static av_always_inline void vp8_filter_common(uint8_t *p, ptrdiff_t stride, | |
306 | int is4tap) | ||
307 | { | ||
308 | 9442676 | filter_common(p, stride, is4tap, IS_VP8); | |
309 | 9442676 | } | |
310 | |||
311 | 1279520 | static av_always_inline int vp7_simple_limit(uint8_t *p, ptrdiff_t stride, | |
312 | int flim) | ||
313 | { | ||
314 | 1279520 | LOAD_PIXELS | |
315 | 1279520 | return FFABS(p0 - q0) <= flim; | |
316 | } | ||
317 | |||
318 | 33287168 | static av_always_inline int vp8_simple_limit(uint8_t *p, ptrdiff_t stride, | |
319 | int flim) | ||
320 | { | ||
321 | 33287168 | LOAD_PIXELS | |
322 | 33287168 | return 2 * FFABS(p0 - q0) + (FFABS(p1 - q1) >> 1) <= flim; | |
323 | } | ||
324 | |||
325 | /** | ||
326 | * E - limit at the macroblock edge | ||
327 | * I - limit for interior difference | ||
328 | */ | ||
329 | #define NORMAL_LIMIT(vpn) \ | ||
330 | static av_always_inline int vp ## vpn ## _normal_limit(uint8_t *p, \ | ||
331 | ptrdiff_t stride, \ | ||
332 | int E, int I) \ | ||
333 | { \ | ||
334 | LOAD_PIXELS \ | ||
335 | return vp ## vpn ## _simple_limit(p, stride, E) && \ | ||
336 | FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && \ | ||
337 | FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && \ | ||
338 | FFABS(q2 - q1) <= I && FFABS(q1 - q0) <= I; \ | ||
339 | } | ||
340 | |||
341 |
14/14✓ Branch 1 taken 1203840 times.
✓ Branch 2 taken 75616 times.
✓ Branch 3 taken 1171818 times.
✓ Branch 4 taken 32022 times.
✓ Branch 5 taken 1155791 times.
✓ Branch 6 taken 16027 times.
✓ Branch 7 taken 1151635 times.
✓ Branch 8 taken 4156 times.
✓ Branch 9 taken 1131867 times.
✓ Branch 10 taken 19768 times.
✓ Branch 11 taken 1129150 times.
✓ Branch 12 taken 2717 times.
✓ Branch 13 taken 1128287 times.
✓ Branch 14 taken 863 times.
|
1279456 | NORMAL_LIMIT(7) |
342 |
14/14✓ Branch 1 taken 31620484 times.
✓ Branch 2 taken 1115228 times.
✓ Branch 3 taken 31016879 times.
✓ Branch 4 taken 603605 times.
✓ Branch 5 taken 30736959 times.
✓ Branch 6 taken 279920 times.
✓ Branch 7 taken 30629486 times.
✓ Branch 8 taken 107473 times.
✓ Branch 9 taken 30232699 times.
✓ Branch 10 taken 396787 times.
✓ Branch 11 taken 30039438 times.
✓ Branch 12 taken 193261 times.
✓ Branch 13 taken 29968241 times.
✓ Branch 14 taken 71197 times.
|
32735712 | NORMAL_LIMIT(8) |
343 | |||
344 | // high edge variance | ||
345 | 31096528 | static av_always_inline int hev(uint8_t *p, ptrdiff_t stride, int thresh) | |
346 | { | ||
347 | 31096528 | LOAD_PIXELS | |
348 |
4/4✓ Branch 0 taken 27453302 times.
✓ Branch 1 taken 3643226 times.
✓ Branch 2 taken 1401296 times.
✓ Branch 3 taken 26052006 times.
|
31096528 | return FFABS(p1 - p0) > thresh || FFABS(q1 - q0) > thresh; |
349 | } | ||
350 | |||
351 | 21363124 | static av_always_inline void filter_mbedge(uint8_t *p, ptrdiff_t stride) | |
352 | { | ||
353 | int a0, a1, a2, w; | ||
354 | 21363124 | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; | |
355 | |||
356 | 21363124 | LOAD_PIXELS | |
357 | |||
358 | 21363124 | w = clip_int8(p1 - q1); | |
359 | 21363124 | w = clip_int8(w + 3 * (q0 - p0)); | |
360 | |||
361 | 21363124 | a0 = (27 * w + 63) >> 7; | |
362 | 21363124 | a1 = (18 * w + 63) >> 7; | |
363 | 21363124 | a2 = (9 * w + 63) >> 7; | |
364 | |||
365 | 21363124 | p[-3 * stride] = cm[p2 + a2]; | |
366 | 21363124 | p[-2 * stride] = cm[p1 + a1]; | |
367 | 21363124 | p[-1 * stride] = cm[p0 + a0]; | |
368 | 21363124 | p[ 0 * stride] = cm[q0 - a0]; | |
369 | 21363124 | p[ 1 * stride] = cm[q1 - a1]; | |
370 | 21363124 | p[ 2 * stride] = cm[q2 - a2]; | |
371 | 21363124 | } | |
372 | |||
373 | #define LOOP_FILTER(vpn, dir, size, stridea, strideb, maybe_inline) \ | ||
374 | static maybe_inline \ | ||
375 | void vpn ## _ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, \ | ||
376 | ptrdiff_t stride, \ | ||
377 | int flim_E, int flim_I, \ | ||
378 | int hev_thresh) \ | ||
379 | { \ | ||
380 | int i; \ | ||
381 | for (i = 0; i < size; i++) \ | ||
382 | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | ||
383 | flim_E, flim_I)) { \ | ||
384 | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | ||
385 | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | ||
386 | else \ | ||
387 | filter_mbedge(dst + i * stridea, strideb); \ | ||
388 | } \ | ||
389 | } \ | ||
390 | \ | ||
391 | static maybe_inline \ | ||
392 | void vpn ## _ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, \ | ||
393 | ptrdiff_t stride, \ | ||
394 | int flim_E, \ | ||
395 | int flim_I, \ | ||
396 | int hev_thresh) \ | ||
397 | { \ | ||
398 | int i; \ | ||
399 | for (i = 0; i < size; i++) \ | ||
400 | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | ||
401 | flim_E, flim_I)) { \ | ||
402 | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | ||
403 | if (hv) \ | ||
404 | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | ||
405 | else \ | ||
406 | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | ||
407 | } \ | ||
408 | } | ||
409 | |||
410 | #define UV_LOOP_FILTER(vpn, dir, stridea, strideb) \ | ||
411 | LOOP_FILTER(vpn, dir, 8, stridea, strideb, av_always_inline) \ | ||
412 | static void vpn ## _ ## dir ## _loop_filter8uv_c(uint8_t *dstU, \ | ||
413 | uint8_t *dstV, \ | ||
414 | ptrdiff_t stride, int fE, \ | ||
415 | int fI, int hev_thresh) \ | ||
416 | { \ | ||
417 | vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \ | ||
418 | vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \ | ||
419 | } \ | ||
420 | \ | ||
421 | static void vpn ## _ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, \ | ||
422 | uint8_t *dstV, \ | ||
423 | ptrdiff_t stride, \ | ||
424 | int fE, int fI, \ | ||
425 | int hev_thresh) \ | ||
426 | { \ | ||
427 | vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \ | ||
428 | hev_thresh); \ | ||
429 | vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \ | ||
430 | hev_thresh); \ | ||
431 | } | ||
432 | |||
433 | #define LOOP_FILTER_SIMPLE(vpn) \ | ||
434 | static void vpn ## _v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \ | ||
435 | int flim) \ | ||
436 | { \ | ||
437 | int i; \ | ||
438 | for (i = 0; i < 16; i++) \ | ||
439 | if (vpn ## _simple_limit(dst + i, stride, flim)) \ | ||
440 | vpn ## _filter_common(dst + i, stride, 1); \ | ||
441 | } \ | ||
442 | \ | ||
443 | static void vpn ## _h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \ | ||
444 | int flim) \ | ||
445 | { \ | ||
446 | int i; \ | ||
447 | for (i = 0; i < 16; i++) \ | ||
448 | if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \ | ||
449 | vpn ## _filter_common(dst + i * stride, 1, 1); \ | ||
450 | } | ||
451 | |||
452 | #define LOOP_FILTERS(vpn) \ | ||
453 | LOOP_FILTER(vpn, v, 16, 1, stride, ) \ | ||
454 | LOOP_FILTER(vpn, h, 16, stride, 1, ) \ | ||
455 | UV_LOOP_FILTER(vpn, v, 1, stride) \ | ||
456 | UV_LOOP_FILTER(vpn, h, stride, 1) \ | ||
457 | LOOP_FILTER_SIMPLE(vpn) \ | ||
458 | |||
459 | static const uint8_t subpel_filters[7][6] = { | ||
460 | { 0, 6, 123, 12, 1, 0 }, | ||
461 | { 2, 11, 108, 36, 8, 1 }, | ||
462 | { 0, 9, 93, 50, 6, 0 }, | ||
463 | { 3, 16, 77, 77, 16, 3 }, | ||
464 | { 0, 6, 50, 93, 9, 0 }, | ||
465 | { 1, 8, 36, 108, 11, 2 }, | ||
466 | { 0, 1, 12, 123, 6, 0 }, | ||
467 | }; | ||
468 | |||
469 | #define PUT_PIXELS(WIDTH) \ | ||
470 | static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t dststride, \ | ||
471 | const uint8_t *src, ptrdiff_t srcstride, \ | ||
472 | int h, int x, int y) \ | ||
473 | { \ | ||
474 | int i; \ | ||
475 | for (i = 0; i < h; i++, dst += dststride, src += srcstride) \ | ||
476 | memcpy(dst, src, WIDTH); \ | ||
477 | } | ||
478 | |||
479 |
2/2✓ Branch 0 taken 5391408 times.
✓ Branch 1 taken 339550 times.
|
5730958 | PUT_PIXELS(16) |
480 |
2/2✓ Branch 0 taken 5415736 times.
✓ Branch 1 taken 679427 times.
|
6095163 | PUT_PIXELS(8) |
481 |
2/2✓ Branch 0 taken 327104 times.
✓ Branch 1 taken 78426 times.
|
405530 | PUT_PIXELS(4) |
482 | |||
483 | #define FILTER_6TAP(src, F, stride) \ | ||
484 | cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \ | ||
485 | F[0] * src[x - 2 * stride] + F[3] * src[x + 1 * stride] - \ | ||
486 | F[4] * src[x + 2 * stride] + F[5] * src[x + 3 * stride] + 64) >> 7] | ||
487 | |||
488 | #define FILTER_4TAP(src, F, stride) \ | ||
489 | cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \ | ||
490 | F[3] * src[x + 1 * stride] - F[4] * src[x + 2 * stride] + 64) >> 7] | ||
491 | |||
492 | #define VP8_EPEL_H(SIZE, TAPS) \ | ||
493 | static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \ | ||
494 | ptrdiff_t dststride, \ | ||
495 | const uint8_t *src, \ | ||
496 | ptrdiff_t srcstride, \ | ||
497 | int h, int mx, int my) \ | ||
498 | { \ | ||
499 | const uint8_t *filter = subpel_filters[mx - 1]; \ | ||
500 | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | ||
501 | int x, y; \ | ||
502 | for (y = 0; y < h; y++) { \ | ||
503 | for (x = 0; x < SIZE; x++) \ | ||
504 | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ | ||
505 | dst += dststride; \ | ||
506 | src += srcstride; \ | ||
507 | } \ | ||
508 | } | ||
509 | |||
510 | #define VP8_EPEL_V(SIZE, TAPS) \ | ||
511 | static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \ | ||
512 | ptrdiff_t dststride, \ | ||
513 | const uint8_t *src, \ | ||
514 | ptrdiff_t srcstride, \ | ||
515 | int h, int mx, int my) \ | ||
516 | { \ | ||
517 | const uint8_t *filter = subpel_filters[my - 1]; \ | ||
518 | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | ||
519 | int x, y; \ | ||
520 | for (y = 0; y < h; y++) { \ | ||
521 | for (x = 0; x < SIZE; x++) \ | ||
522 | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ | ||
523 | dst += dststride; \ | ||
524 | src += srcstride; \ | ||
525 | } \ | ||
526 | } | ||
527 | |||
528 | #define VP8_EPEL_HV(SIZE, HTAPS, VTAPS) \ | ||
529 | static void \ | ||
530 | put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, \ | ||
531 | ptrdiff_t dststride, \ | ||
532 | const uint8_t *src, \ | ||
533 | ptrdiff_t srcstride, \ | ||
534 | int h, int mx, \ | ||
535 | int my) \ | ||
536 | { \ | ||
537 | const uint8_t *filter = subpel_filters[mx - 1]; \ | ||
538 | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | ||
539 | int x, y; \ | ||
540 | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | ||
541 | uint8_t *tmp = tmp_array; \ | ||
542 | src -= (2 - (VTAPS == 4)) * srcstride; \ | ||
543 | \ | ||
544 | for (y = 0; y < h + VTAPS - 1; y++) { \ | ||
545 | for (x = 0; x < SIZE; x++) \ | ||
546 | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | ||
547 | tmp += SIZE; \ | ||
548 | src += srcstride; \ | ||
549 | } \ | ||
550 | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | ||
551 | filter = subpel_filters[my - 1]; \ | ||
552 | \ | ||
553 | for (y = 0; y < h; y++) { \ | ||
554 | for (x = 0; x < SIZE; x++) \ | ||
555 | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | ||
556 | dst += dststride; \ | ||
557 | tmp += SIZE; \ | ||
558 | } \ | ||
559 | } | ||
560 | |||
561 |
4/4✓ Branch 0 taken 512 times.
✓ Branch 1 taken 32 times.
✓ Branch 2 taken 32 times.
✓ Branch 3 taken 2 times.
|
546 | VP8_EPEL_H(16, 4) |
562 |
4/4✓ Branch 0 taken 812032 times.
✓ Branch 1 taken 101504 times.
✓ Branch 2 taken 101504 times.
✓ Branch 3 taken 13323 times.
|
926859 | VP8_EPEL_H(8, 4) |
563 |
4/4✓ Branch 0 taken 158048 times.
✓ Branch 1 taken 39512 times.
✓ Branch 2 taken 39512 times.
✓ Branch 3 taken 8655 times.
|
206215 | VP8_EPEL_H(4, 4) |
564 |
4/4✓ Branch 0 taken 2627328 times.
✓ Branch 1 taken 164208 times.
✓ Branch 2 taken 164208 times.
✓ Branch 3 taken 10860 times.
|
2802396 | VP8_EPEL_H(16, 6) |
565 |
4/4✓ Branch 0 taken 845760 times.
✓ Branch 1 taken 105720 times.
✓ Branch 2 taken 105720 times.
✓ Branch 3 taken 12798 times.
|
964278 | VP8_EPEL_H(8, 6) |
566 |
4/4✓ Branch 0 taken 366848 times.
✓ Branch 1 taken 91712 times.
✓ Branch 2 taken 91712 times.
✓ Branch 3 taken 21989 times.
|
480549 | VP8_EPEL_H(4, 6) |
567 |
4/4✓ Branch 0 taken 512 times.
✓ Branch 1 taken 32 times.
✓ Branch 2 taken 32 times.
✓ Branch 3 taken 2 times.
|
546 | VP8_EPEL_V(16, 4) |
568 |
4/4✓ Branch 0 taken 645888 times.
✓ Branch 1 taken 80736 times.
✓ Branch 2 taken 80736 times.
✓ Branch 3 taken 10643 times.
|
737267 | VP8_EPEL_V(8, 4) |
569 |
4/4✓ Branch 0 taken 144160 times.
✓ Branch 1 taken 36040 times.
✓ Branch 2 taken 36040 times.
✓ Branch 3 taken 7921 times.
|
188121 | VP8_EPEL_V(4, 4) |
570 |
4/4✓ Branch 0 taken 2144768 times.
✓ Branch 1 taken 134048 times.
✓ Branch 2 taken 134048 times.
✓ Branch 3 taken 8895 times.
|
2287711 | VP8_EPEL_V(16, 6) |
571 |
4/4✓ Branch 0 taken 664448 times.
✓ Branch 1 taken 83056 times.
✓ Branch 2 taken 83056 times.
✓ Branch 3 taken 9791 times.
|
757295 | VP8_EPEL_V(8, 6) |
572 |
4/4✓ Branch 0 taken 330864 times.
✓ Branch 1 taken 82716 times.
✓ Branch 2 taken 82716 times.
✓ Branch 3 taken 19992 times.
|
433572 | VP8_EPEL_V(4, 6) |
573 | |||
574 |
8/8✓ Branch 0 taken 608 times.
✓ Branch 1 taken 38 times.
✓ Branch 2 taken 38 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 512 times.
✓ Branch 5 taken 32 times.
✓ Branch 6 taken 32 times.
✓ Branch 7 taken 2 times.
|
1192 | VP8_EPEL_HV(16, 4, 4) |
575 |
8/8✓ Branch 0 taken 1280776 times.
✓ Branch 1 taken 160097 times.
✓ Branch 2 taken 160097 times.
✓ Branch 3 taken 15283 times.
✓ Branch 4 taken 913984 times.
✓ Branch 5 taken 114248 times.
✓ Branch 6 taken 114248 times.
✓ Branch 7 taken 15283 times.
|
2484388 | VP8_EPEL_HV(8, 4, 4) |
576 |
8/8✓ Branch 0 taken 417612 times.
✓ Branch 1 taken 104403 times.
✓ Branch 2 taken 104403 times.
✓ Branch 3 taken 13913 times.
✓ Branch 4 taken 250656 times.
✓ Branch 5 taken 62664 times.
✓ Branch 6 taken 62664 times.
✓ Branch 7 taken 13913 times.
|
849248 | VP8_EPEL_HV(4, 4, 4) |
577 |
8/8✓ Branch 0 taken 672 times.
✓ Branch 1 taken 42 times.
✓ Branch 2 taken 42 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 512 times.
✓ Branch 5 taken 32 times.
✓ Branch 6 taken 32 times.
✓ Branch 7 taken 2 times.
|
1260 | VP8_EPEL_HV(16, 4, 6) |
578 |
8/8✓ Branch 0 taken 778488 times.
✓ Branch 1 taken 97311 times.
✓ Branch 2 taken 97311 times.
✓ Branch 3 taken 7835 times.
✓ Branch 4 taken 465088 times.
✓ Branch 5 taken 58136 times.
✓ Branch 6 taken 58136 times.
✓ Branch 7 taken 7835 times.
|
1406858 | VP8_EPEL_HV(8, 4, 6) |
579 |
8/8✓ Branch 0 taken 307532 times.
✓ Branch 1 taken 76883 times.
✓ Branch 2 taken 76883 times.
✓ Branch 3 taken 8087 times.
✓ Branch 4 taken 145792 times.
✓ Branch 5 taken 36448 times.
✓ Branch 6 taken 36448 times.
✓ Branch 7 taken 8087 times.
|
574742 | VP8_EPEL_HV(4, 4, 6) |
580 |
8/8✓ Branch 0 taken 608 times.
✓ Branch 1 taken 38 times.
✓ Branch 2 taken 38 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 512 times.
✓ Branch 5 taken 32 times.
✓ Branch 6 taken 32 times.
✓ Branch 7 taken 2 times.
|
1192 | VP8_EPEL_HV(16, 6, 4) |
581 |
8/8✓ Branch 0 taken 830200 times.
✓ Branch 1 taken 103775 times.
✓ Branch 2 taken 103775 times.
✓ Branch 3 taken 9933 times.
✓ Branch 4 taken 591808 times.
✓ Branch 5 taken 73976 times.
✓ Branch 6 taken 73976 times.
✓ Branch 7 taken 9933 times.
|
1609692 | VP8_EPEL_HV(8, 6, 4) |
582 |
8/8✓ Branch 0 taken 276108 times.
✓ Branch 1 taken 69027 times.
✓ Branch 2 taken 69027 times.
✓ Branch 3 taken 9113 times.
✓ Branch 4 taken 166752 times.
✓ Branch 5 taken 41688 times.
✓ Branch 6 taken 41688 times.
✓ Branch 7 taken 9113 times.
|
562688 | VP8_EPEL_HV(4, 6, 4) |
583 |
8/8✓ Branch 0 taken 5355216 times.
✓ Branch 1 taken 334701 times.
✓ Branch 2 taken 334701 times.
✓ Branch 3 taken 16793 times.
✓ Branch 4 taken 4011776 times.
✓ Branch 5 taken 250736 times.
✓ Branch 6 taken 250736 times.
✓ Branch 7 taken 16793 times.
|
9969222 | VP8_EPEL_HV(16, 6, 6) |
584 |
8/8✓ Branch 0 taken 1489592 times.
✓ Branch 1 taken 186199 times.
✓ Branch 2 taken 186199 times.
✓ Branch 3 taken 13475 times.
✓ Branch 4 taken 950592 times.
✓ Branch 5 taken 118824 times.
✓ Branch 6 taken 118824 times.
✓ Branch 7 taken 13475 times.
|
2758682 | VP8_EPEL_HV(8, 6, 6) |
585 |
8/8✓ Branch 0 taken 1004488 times.
✓ Branch 1 taken 251122 times.
✓ Branch 2 taken 251122 times.
✓ Branch 3 taken 27526 times.
✓ Branch 4 taken 453968 times.
✓ Branch 5 taken 113492 times.
✓ Branch 6 taken 113492 times.
✓ Branch 7 taken 27526 times.
|
1850596 | VP8_EPEL_HV(4, 6, 6) |
586 | |||
587 | #define VP8_BILINEAR(SIZE) \ | ||
588 | static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, \ | ||
589 | const uint8_t *src, ptrdiff_t sstride, \ | ||
590 | int h, int mx, int my) \ | ||
591 | { \ | ||
592 | int a = 8 - mx, b = mx; \ | ||
593 | int x, y; \ | ||
594 | for (y = 0; y < h; y++) { \ | ||
595 | for (x = 0; x < SIZE; x++) \ | ||
596 | dst[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | ||
597 | dst += dstride; \ | ||
598 | src += sstride; \ | ||
599 | } \ | ||
600 | } \ | ||
601 | \ | ||
602 | static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, \ | ||
603 | const uint8_t *src, ptrdiff_t sstride, \ | ||
604 | int h, int mx, int my) \ | ||
605 | { \ | ||
606 | int c = 8 - my, d = my; \ | ||
607 | int x, y; \ | ||
608 | for (y = 0; y < h; y++) { \ | ||
609 | for (x = 0; x < SIZE; x++) \ | ||
610 | dst[x] = (c * src[x] + d * src[x + sstride] + 4) >> 3; \ | ||
611 | dst += dstride; \ | ||
612 | src += sstride; \ | ||
613 | } \ | ||
614 | } \ | ||
615 | \ | ||
616 | static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, \ | ||
617 | ptrdiff_t dstride, \ | ||
618 | const uint8_t *src, \ | ||
619 | ptrdiff_t sstride, \ | ||
620 | int h, int mx, int my) \ | ||
621 | { \ | ||
622 | int a = 8 - mx, b = mx; \ | ||
623 | int c = 8 - my, d = my; \ | ||
624 | int x, y; \ | ||
625 | uint8_t tmp_array[(2 * SIZE + 1) * SIZE]; \ | ||
626 | uint8_t *tmp = tmp_array; \ | ||
627 | for (y = 0; y < h + 1; y++) { \ | ||
628 | for (x = 0; x < SIZE; x++) \ | ||
629 | tmp[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | ||
630 | tmp += SIZE; \ | ||
631 | src += sstride; \ | ||
632 | } \ | ||
633 | tmp = tmp_array; \ | ||
634 | for (y = 0; y < h; y++) { \ | ||
635 | for (x = 0; x < SIZE; x++) \ | ||
636 | dst[x] = (c * tmp[x] + d * tmp[x + SIZE] + 4) >> 3; \ | ||
637 | dst += dstride; \ | ||
638 | tmp += SIZE; \ | ||
639 | } \ | ||
640 | } | ||
641 | |||
642 |
8/8✓ Branch 0 taken 444304 times.
✓ Branch 1 taken 27769 times.
✓ Branch 2 taken 27769 times.
✓ Branch 3 taken 1775 times.
✓ Branch 4 taken 185216 times.
✓ Branch 5 taken 11576 times.
✓ Branch 6 taken 11576 times.
✓ Branch 7 taken 761 times.
|
1341280 | VP8_BILINEAR(16) |
643 |
8/8✓ Branch 0 taken 283480 times.
✓ Branch 1 taken 35435 times.
✓ Branch 2 taken 35435 times.
✓ Branch 3 taken 4182 times.
✓ Branch 4 taken 124992 times.
✓ Branch 5 taken 15624 times.
✓ Branch 6 taken 15624 times.
✓ Branch 7 taken 1963 times.
|
927426 | VP8_BILINEAR(8) |
644 |
8/8✓ Branch 0 taken 96024 times.
✓ Branch 1 taken 24006 times.
✓ Branch 2 taken 24006 times.
✓ Branch 3 taken 5073 times.
✓ Branch 4 taken 39856 times.
✓ Branch 5 taken 9964 times.
✓ Branch 6 taken 9964 times.
✓ Branch 7 taken 2302 times.
|
349846 | VP8_BILINEAR(4) |
645 | |||
646 | #define VP78_MC_FUNC(IDX, SIZE) \ | ||
647 | dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \ | ||
648 | dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \ | ||
649 | dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \ | ||
650 | dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \ | ||
651 | dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \ | ||
652 | dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \ | ||
653 | dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \ | ||
654 | dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \ | ||
655 | dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c | ||
656 | |||
657 | #define VP78_BILINEAR_MC_FUNC(IDX, SIZE) \ | ||
658 | dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \ | ||
659 | dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \ | ||
660 | dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \ | ||
661 | dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \ | ||
662 | dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \ | ||
663 | dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \ | ||
664 | dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \ | ||
665 | dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \ | ||
666 | dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c | ||
667 | |||
668 | 76 | av_cold void ff_vp78dsp_init(VP8DSPContext *dsp) | |
669 | { | ||
670 | 76 | VP78_MC_FUNC(0, 16); | |
671 | 76 | VP78_MC_FUNC(1, 8); | |
672 | 76 | VP78_MC_FUNC(2, 4); | |
673 | |||
674 | 76 | VP78_BILINEAR_MC_FUNC(0, 16); | |
675 | 76 | VP78_BILINEAR_MC_FUNC(1, 8); | |
676 | 76 | VP78_BILINEAR_MC_FUNC(2, 4); | |
677 | |||
678 | #if ARCH_AARCH64 | ||
679 | ff_vp78dsp_init_aarch64(dsp); | ||
680 | #elif ARCH_ARM | ||
681 | ff_vp78dsp_init_arm(dsp); | ||
682 | #elif ARCH_PPC | ||
683 | ff_vp78dsp_init_ppc(dsp); | ||
684 | #elif ARCH_RISCV | ||
685 | ff_vp78dsp_init_riscv(dsp); | ||
686 | #elif ARCH_X86 | ||
687 | 76 | ff_vp78dsp_init_x86(dsp); | |
688 | #endif | ||
689 | 76 | } | |
690 | |||
691 | #if CONFIG_VP7_DECODER | ||
692 |
6/6✓ Branch 1 taken 1128325 times.
✓ Branch 2 taken 151195 times.
✓ Branch 4 taken 20154 times.
✓ Branch 5 taken 1108201 times.
✓ Branch 8 taken 1279456 times.
✓ Branch 9 taken 106309 times.
|
2824352 | LOOP_FILTERS(vp7) |
693 | |||
694 | 16 | av_cold void ff_vp7dsp_init(VP8DSPContext *dsp) | |
695 | { | ||
696 | 16 | dsp->vp8_luma_dc_wht = vp7_luma_dc_wht_c; | |
697 | 16 | dsp->vp8_luma_dc_wht_dc = vp7_luma_dc_wht_dc_c; | |
698 | 16 | dsp->vp8_idct_add = vp7_idct_add_c; | |
699 | 16 | dsp->vp8_idct_dc_add = vp7_idct_dc_add_c; | |
700 | 16 | dsp->vp8_idct_dc_add4y = vp7_idct_dc_add4y_c; | |
701 | 16 | dsp->vp8_idct_dc_add4uv = vp7_idct_dc_add4uv_c; | |
702 | |||
703 | 16 | dsp->vp8_v_loop_filter16y = vp7_v_loop_filter16_c; | |
704 | 16 | dsp->vp8_h_loop_filter16y = vp7_h_loop_filter16_c; | |
705 | 16 | dsp->vp8_v_loop_filter8uv = vp7_v_loop_filter8uv_c; | |
706 | 16 | dsp->vp8_h_loop_filter8uv = vp7_h_loop_filter8uv_c; | |
707 | |||
708 | 16 | dsp->vp8_v_loop_filter16y_inner = vp7_v_loop_filter16_inner_c; | |
709 | 16 | dsp->vp8_h_loop_filter16y_inner = vp7_h_loop_filter16_inner_c; | |
710 | 16 | dsp->vp8_v_loop_filter8uv_inner = vp7_v_loop_filter8uv_inner_c; | |
711 | 16 | dsp->vp8_h_loop_filter8uv_inner = vp7_h_loop_filter8uv_inner_c; | |
712 | |||
713 | 16 | dsp->vp8_v_loop_filter_simple = vp7_v_loop_filter_simple_c; | |
714 | 16 | dsp->vp8_h_loop_filter_simple = vp7_h_loop_filter_simple_c; | |
715 | |||
716 | #if ARCH_RISCV | ||
717 | ff_vp7dsp_init_riscv(dsp); | ||
718 | #endif | ||
719 | 16 | } | |
720 | #endif /* CONFIG_VP7_DECODER */ | ||
721 | |||
722 | #if CONFIG_VP8_DECODER | ||
723 |
6/6✓ Branch 1 taken 30459326 times.
✓ Branch 2 taken 2827842 times.
✓ Branch 4 taken 5575888 times.
✓ Branch 5 taken 24978275 times.
✓ Branch 8 taken 32735712 times.
✓ Branch 9 taken 2944273 times.
|
74328396 | LOOP_FILTERS(vp8) |
724 | |||
725 | 73 | av_cold void ff_vp8dsp_init(VP8DSPContext *dsp) | |
726 | { | ||
727 | 73 | dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c; | |
728 | 73 | dsp->vp8_luma_dc_wht_dc = vp8_luma_dc_wht_dc_c; | |
729 | 73 | dsp->vp8_idct_add = vp8_idct_add_c; | |
730 | 73 | dsp->vp8_idct_dc_add = vp8_idct_dc_add_c; | |
731 | 73 | dsp->vp8_idct_dc_add4y = vp8_idct_dc_add4y_c; | |
732 | 73 | dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c; | |
733 | |||
734 | 73 | dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c; | |
735 | 73 | dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c; | |
736 | 73 | dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c; | |
737 | 73 | dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c; | |
738 | |||
739 | 73 | dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c; | |
740 | 73 | dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c; | |
741 | 73 | dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c; | |
742 | 73 | dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c; | |
743 | |||
744 | 73 | dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c; | |
745 | 73 | dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c; | |
746 | |||
747 | #if ARCH_AARCH64 | ||
748 | ff_vp8dsp_init_aarch64(dsp); | ||
749 | #elif ARCH_ARM | ||
750 | ff_vp8dsp_init_arm(dsp); | ||
751 | #elif ARCH_RISCV | ||
752 | ff_vp8dsp_init_riscv(dsp); | ||
753 | #elif ARCH_X86 | ||
754 | 73 | ff_vp8dsp_init_x86(dsp); | |
755 | #elif ARCH_MIPS | ||
756 | ff_vp8dsp_init_mips(dsp); | ||
757 | #elif ARCH_LOONGARCH | ||
758 | ff_vp8dsp_init_loongarch(dsp); | ||
759 | #endif | ||
760 | 73 | } | |
761 | #endif /* CONFIG_VP8_DECODER */ | ||
762 |