/src/ffmpeg/libavcodec/vp8dsp.c
Line | Count | 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 | 463k | ptrdiff_t stride) \ |
39 | 463k | { \ |
40 | 463k | name ## _idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); \ |
41 | 463k | name ## _idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); \ |
42 | 463k | name ## _idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); \ |
43 | 463k | name ## _idct_dc_add_c(dst + stride * 4 + 4, block[3], stride); \ |
44 | 463k | } \ vp8dsp.c:vp7_idct_dc_add4uv_c Line | Count | Source | 38 | 31.7k | ptrdiff_t stride) \ | 39 | 31.7k | { \ | 40 | 31.7k | name ## _idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); \ | 41 | 31.7k | name ## _idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); \ | 42 | 31.7k | name ## _idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); \ | 43 | 31.7k | name ## _idct_dc_add_c(dst + stride * 4 + 4, block[3], stride); \ | 44 | 31.7k | } \ |
vp8dsp.c:vp8_idct_dc_add4uv_c Line | Count | Source | 38 | 431k | ptrdiff_t stride) \ | 39 | 431k | { \ | 40 | 431k | name ## _idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); \ | 41 | 431k | name ## _idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); \ | 42 | 431k | name ## _idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); \ | 43 | 431k | name ## _idct_dc_add_c(dst + stride * 4 + 4, block[3], stride); \ | 44 | 431k | } \ |
|
45 | | \ |
46 | | static void name ## _idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], \ |
47 | 1.01M | ptrdiff_t stride) \ |
48 | 1.01M | { \ |
49 | 1.01M | name ## _idct_dc_add_c(dst + 0, block[0], stride); \ |
50 | 1.01M | name ## _idct_dc_add_c(dst + 4, block[1], stride); \ |
51 | 1.01M | name ## _idct_dc_add_c(dst + 8, block[2], stride); \ |
52 | 1.01M | name ## _idct_dc_add_c(dst + 12, block[3], stride); \ |
53 | 1.01M | } vp8dsp.c:vp7_idct_dc_add4y_c Line | Count | Source | 47 | 636k | ptrdiff_t stride) \ | 48 | 636k | { \ | 49 | 636k | name ## _idct_dc_add_c(dst + 0, block[0], stride); \ | 50 | 636k | name ## _idct_dc_add_c(dst + 4, block[1], stride); \ | 51 | 636k | name ## _idct_dc_add_c(dst + 8, block[2], stride); \ | 52 | 636k | name ## _idct_dc_add_c(dst + 12, block[3], stride); \ | 53 | 636k | } |
vp8dsp.c:vp8_idct_dc_add4y_c Line | Count | Source | 47 | 376k | ptrdiff_t stride) \ | 48 | 376k | { \ | 49 | 376k | name ## _idct_dc_add_c(dst + 0, block[0], stride); \ | 50 | 376k | name ## _idct_dc_add_c(dst + 4, block[1], stride); \ | 51 | 376k | name ## _idct_dc_add_c(dst + 8, block[2], stride); \ | 52 | 376k | name ## _idct_dc_add_c(dst + 12, block[3], stride); \ | 53 | 376k | } |
|
54 | | |
55 | | #if CONFIG_VP7_DECODER |
56 | | static void vp7_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16]) |
57 | 67.4k | { |
58 | 67.4k | int i; |
59 | 67.4k | unsigned a1, b1, c1, d1; |
60 | 67.4k | int16_t tmp[16]; |
61 | | |
62 | 337k | for (i = 0; i < 4; i++) { |
63 | 269k | a1 = (dc[i * 4 + 0] + dc[i * 4 + 2]) * 23170; |
64 | 269k | b1 = (dc[i * 4 + 0] - dc[i * 4 + 2]) * 23170; |
65 | 269k | c1 = dc[i * 4 + 1] * 12540 - dc[i * 4 + 3] * 30274; |
66 | 269k | d1 = dc[i * 4 + 1] * 30274 + dc[i * 4 + 3] * 12540; |
67 | 269k | tmp[i * 4 + 0] = (int)(a1 + d1) >> 14; |
68 | 269k | tmp[i * 4 + 3] = (int)(a1 - d1) >> 14; |
69 | 269k | tmp[i * 4 + 1] = (int)(b1 + c1) >> 14; |
70 | 269k | tmp[i * 4 + 2] = (int)(b1 - c1) >> 14; |
71 | 269k | } |
72 | | |
73 | 337k | for (i = 0; i < 4; i++) { |
74 | 269k | a1 = (tmp[i + 0] + tmp[i + 8]) * 23170; |
75 | 269k | b1 = (tmp[i + 0] - tmp[i + 8]) * 23170; |
76 | 269k | c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274; |
77 | 269k | d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540; |
78 | 269k | AV_ZERO64(dc + i * 4); |
79 | 269k | block[0][i][0] = (int)(a1 + d1 + 0x20000) >> 18; |
80 | 269k | block[3][i][0] = (int)(a1 - d1 + 0x20000) >> 18; |
81 | 269k | block[1][i][0] = (int)(b1 + c1 + 0x20000) >> 18; |
82 | 269k | block[2][i][0] = (int)(b1 - c1 + 0x20000) >> 18; |
83 | 269k | } |
84 | 67.4k | } |
85 | | |
86 | | static void vp7_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16]) |
87 | 119k | { |
88 | 119k | int i, val = (23170 * (23170 * dc[0] >> 14) + 0x20000) >> 18; |
89 | 119k | dc[0] = 0; |
90 | | |
91 | 598k | for (i = 0; i < 4; i++) { |
92 | 478k | block[i][0][0] = val; |
93 | 478k | block[i][1][0] = val; |
94 | 478k | block[i][2][0] = val; |
95 | 478k | block[i][3][0] = val; |
96 | 478k | } |
97 | 119k | } |
98 | | |
99 | | static void vp7_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) |
100 | 727k | { |
101 | 727k | int i; |
102 | 727k | unsigned a1, b1, c1, d1; |
103 | 727k | int16_t tmp[16]; |
104 | | |
105 | 3.63M | for (i = 0; i < 4; i++) { |
106 | 2.90M | a1 = (block[i * 4 + 0] + block[i * 4 + 2]) * 23170; |
107 | 2.90M | b1 = (block[i * 4 + 0] - block[i * 4 + 2]) * 23170; |
108 | 2.90M | c1 = block[i * 4 + 1] * 12540 - block[i * 4 + 3] * 30274; |
109 | 2.90M | d1 = block[i * 4 + 1] * 30274 + block[i * 4 + 3] * 12540; |
110 | 2.90M | AV_ZERO64(block + i * 4); |
111 | 2.90M | tmp[i * 4 + 0] = (int)(a1 + d1) >> 14; |
112 | 2.90M | tmp[i * 4 + 3] = (int)(a1 - d1) >> 14; |
113 | 2.90M | tmp[i * 4 + 1] = (int)(b1 + c1) >> 14; |
114 | 2.90M | tmp[i * 4 + 2] = (int)(b1 - c1) >> 14; |
115 | 2.90M | } |
116 | | |
117 | 3.63M | for (i = 0; i < 4; i++) { |
118 | 2.90M | a1 = (tmp[i + 0] + tmp[i + 8]) * 23170; |
119 | 2.90M | b1 = (tmp[i + 0] - tmp[i + 8]) * 23170; |
120 | 2.90M | c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274; |
121 | 2.90M | d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540; |
122 | 2.90M | dst[0 * stride + i] = av_clip_uint8(dst[0 * stride + i] + |
123 | 2.90M | ((int)(a1 + d1 + 0x20000) >> 18)); |
124 | 2.90M | dst[3 * stride + i] = av_clip_uint8(dst[3 * stride + i] + |
125 | 2.90M | ((int)(a1 - d1 + 0x20000) >> 18)); |
126 | 2.90M | dst[1 * stride + i] = av_clip_uint8(dst[1 * stride + i] + |
127 | 2.90M | ((int)(b1 + c1 + 0x20000) >> 18)); |
128 | 2.90M | dst[2 * stride + i] = av_clip_uint8(dst[2 * stride + i] + |
129 | 2.90M | ((int)(b1 - c1 + 0x20000) >> 18)); |
130 | 2.90M | } |
131 | 727k | } |
132 | | |
133 | | static void vp7_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) |
134 | 2.83M | { |
135 | 2.83M | int i, dc = (23170 * (23170 * block[0] >> 14) + 0x20000) >> 18; |
136 | 2.83M | block[0] = 0; |
137 | | |
138 | 14.1M | for (i = 0; i < 4; i++) { |
139 | 11.3M | dst[0] = av_clip_uint8(dst[0] + dc); |
140 | 11.3M | dst[1] = av_clip_uint8(dst[1] + dc); |
141 | 11.3M | dst[2] = av_clip_uint8(dst[2] + dc); |
142 | 11.3M | dst[3] = av_clip_uint8(dst[3] + dc); |
143 | 11.3M | dst += stride; |
144 | 11.3M | } |
145 | 2.83M | } |
146 | | |
147 | | MK_IDCT_DC_ADD4_C(vp7) |
148 | | #endif /* CONFIG_VP7_DECODER */ |
149 | | |
150 | | // TODO: Maybe add dequant |
151 | | #if CONFIG_VP8_DECODER |
152 | | static void vp8_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16]) |
153 | 83.6k | { |
154 | 83.6k | int i, t0, t1, t2, t3; |
155 | | |
156 | 418k | for (i = 0; i < 4; i++) { |
157 | 334k | t0 = dc[0 * 4 + i] + dc[3 * 4 + i]; |
158 | 334k | t1 = dc[1 * 4 + i] + dc[2 * 4 + i]; |
159 | 334k | t2 = dc[1 * 4 + i] - dc[2 * 4 + i]; |
160 | 334k | t3 = dc[0 * 4 + i] - dc[3 * 4 + i]; |
161 | | |
162 | 334k | dc[0 * 4 + i] = t0 + t1; |
163 | 334k | dc[1 * 4 + i] = t3 + t2; |
164 | 334k | dc[2 * 4 + i] = t0 - t1; |
165 | 334k | dc[3 * 4 + i] = t3 - t2; |
166 | 334k | } |
167 | | |
168 | 418k | for (i = 0; i < 4; i++) { |
169 | 334k | t0 = dc[i * 4 + 0] + dc[i * 4 + 3] + 3; // rounding |
170 | 334k | t1 = dc[i * 4 + 1] + dc[i * 4 + 2]; |
171 | 334k | t2 = dc[i * 4 + 1] - dc[i * 4 + 2]; |
172 | 334k | t3 = dc[i * 4 + 0] - dc[i * 4 + 3] + 3; // rounding |
173 | 334k | AV_ZERO64(dc + i * 4); |
174 | | |
175 | 334k | block[i][0][0] = (t0 + t1) >> 3; |
176 | 334k | block[i][1][0] = (t3 + t2) >> 3; |
177 | 334k | block[i][2][0] = (t0 - t1) >> 3; |
178 | 334k | block[i][3][0] = (t3 - t2) >> 3; |
179 | 334k | } |
180 | 83.6k | } |
181 | | |
182 | | static void vp8_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16]) |
183 | 55.2k | { |
184 | 55.2k | int i, val = (dc[0] + 3) >> 3; |
185 | 55.2k | dc[0] = 0; |
186 | | |
187 | 276k | for (i = 0; i < 4; i++) { |
188 | 221k | block[i][0][0] = val; |
189 | 221k | block[i][1][0] = val; |
190 | 221k | block[i][2][0] = val; |
191 | 221k | block[i][3][0] = val; |
192 | 221k | } |
193 | 55.2k | } |
194 | | |
195 | 48.5M | #define MUL_20091(a) ((((a) * 20091) >> 16) + (a)) |
196 | 48.5M | #define MUL_35468(a) (((a) * 35468) >> 16) |
197 | | |
198 | | static void vp8_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) |
199 | 3.03M | { |
200 | 3.03M | int i, t0, t1, t2, t3; |
201 | 3.03M | int16_t tmp[16]; |
202 | | |
203 | 15.1M | for (i = 0; i < 4; i++) { |
204 | 12.1M | t0 = block[0 * 4 + i] + block[2 * 4 + i]; |
205 | 12.1M | t1 = block[0 * 4 + i] - block[2 * 4 + i]; |
206 | 12.1M | t2 = MUL_35468(block[1 * 4 + i]) - MUL_20091(block[3 * 4 + i]); |
207 | 12.1M | t3 = MUL_20091(block[1 * 4 + i]) + MUL_35468(block[3 * 4 + i]); |
208 | 12.1M | block[0 * 4 + i] = 0; |
209 | 12.1M | block[1 * 4 + i] = 0; |
210 | 12.1M | block[2 * 4 + i] = 0; |
211 | 12.1M | block[3 * 4 + i] = 0; |
212 | | |
213 | 12.1M | tmp[i * 4 + 0] = t0 + t3; |
214 | 12.1M | tmp[i * 4 + 1] = t1 + t2; |
215 | 12.1M | tmp[i * 4 + 2] = t1 - t2; |
216 | 12.1M | tmp[i * 4 + 3] = t0 - t3; |
217 | 12.1M | } |
218 | | |
219 | 15.1M | for (i = 0; i < 4; i++) { |
220 | 12.1M | t0 = tmp[0 * 4 + i] + tmp[2 * 4 + i]; |
221 | 12.1M | t1 = tmp[0 * 4 + i] - tmp[2 * 4 + i]; |
222 | 12.1M | t2 = MUL_35468(tmp[1 * 4 + i]) - MUL_20091(tmp[3 * 4 + i]); |
223 | 12.1M | t3 = MUL_20091(tmp[1 * 4 + i]) + MUL_35468(tmp[3 * 4 + i]); |
224 | | |
225 | 12.1M | dst[0] = av_clip_uint8(dst[0] + ((t0 + t3 + 4) >> 3)); |
226 | 12.1M | dst[1] = av_clip_uint8(dst[1] + ((t1 + t2 + 4) >> 3)); |
227 | 12.1M | dst[2] = av_clip_uint8(dst[2] + ((t1 - t2 + 4) >> 3)); |
228 | 12.1M | dst[3] = av_clip_uint8(dst[3] + ((t0 - t3 + 4) >> 3)); |
229 | 12.1M | dst += stride; |
230 | 12.1M | } |
231 | 3.03M | } |
232 | | |
233 | | static void vp8_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) |
234 | 4.75M | { |
235 | 4.75M | int i, dc = (block[0] + 4) >> 3; |
236 | 4.75M | block[0] = 0; |
237 | | |
238 | 23.7M | for (i = 0; i < 4; i++) { |
239 | 19.0M | dst[0] = av_clip_uint8(dst[0] + dc); |
240 | 19.0M | dst[1] = av_clip_uint8(dst[1] + dc); |
241 | 19.0M | dst[2] = av_clip_uint8(dst[2] + dc); |
242 | 19.0M | dst[3] = av_clip_uint8(dst[3] + dc); |
243 | 19.0M | dst += stride; |
244 | 19.0M | } |
245 | 4.75M | } |
246 | | |
247 | | 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 | 803M | av_unused int p3 = p[-4 * stride]; \ |
253 | 803M | av_unused int p2 = p[-3 * stride]; \ |
254 | 803M | av_unused int p1 = p[-2 * stride]; \ |
255 | 803M | av_unused int p0 = p[-1 * stride]; \ |
256 | 803M | av_unused int q0 = p[ 0 * stride]; \ |
257 | 803M | av_unused int q1 = p[ 1 * stride]; \ |
258 | 803M | av_unused int q2 = p[ 2 * stride]; \ |
259 | 803M | av_unused int q3 = p[ 3 * stride]; |
260 | | |
261 | 421M | #define clip_int8(n) (cm[(n) + 0x80] - 0x80) |
262 | | |
263 | | static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, |
264 | | int is4tap, int is_vp7) |
265 | 197M | { |
266 | 197M | LOAD_PIXELS |
267 | 197M | int a, f1, f2; |
268 | 197M | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; |
269 | | |
270 | 197M | a = 3 * (q0 - p0); |
271 | | |
272 | 197M | if (is4tap) |
273 | 124M | a += clip_int8(p1 - q1); |
274 | | |
275 | 197M | 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 | 197M | f1 = FFMIN(a + 4, 127) >> 3; |
280 | | |
281 | 197M | if (is_vp7) |
282 | 120M | f2 = f1 - ((a & 7) == 4); |
283 | 77.5M | else |
284 | 77.5M | 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 | 197M | p[-1 * stride] = cm[p0 + f2]; |
289 | 197M | p[ 0 * stride] = cm[q0 - f1]; |
290 | | |
291 | | // only used for _inner on blocks without high edge variance |
292 | 197M | if (!is4tap) { |
293 | 73.2M | a = (f1 + 1) >> 1; |
294 | 73.2M | p[-2 * stride] = cm[p1 + a]; |
295 | 73.2M | p[ 1 * stride] = cm[q1 - a]; |
296 | 73.2M | } |
297 | 197M | } |
298 | | |
299 | | static av_always_inline void vp7_filter_common(uint8_t *p, ptrdiff_t stride, |
300 | | int is4tap) |
301 | 120M | { |
302 | 120M | filter_common(p, stride, is4tap, IS_VP7); |
303 | 120M | } |
304 | | |
305 | | static av_always_inline void vp8_filter_common(uint8_t *p, ptrdiff_t stride, |
306 | | int is4tap) |
307 | 77.5M | { |
308 | 77.5M | filter_common(p, stride, is4tap, IS_VP8); |
309 | 77.5M | } |
310 | | |
311 | | static av_always_inline int vp7_simple_limit(uint8_t *p, ptrdiff_t stride, |
312 | | int flim) |
313 | 134M | { |
314 | 134M | LOAD_PIXELS |
315 | 134M | return FFABS(p0 - q0) <= flim; |
316 | 134M | } |
317 | | |
318 | | static av_always_inline int vp8_simple_limit(uint8_t *p, ptrdiff_t stride, |
319 | | int flim) |
320 | 131M | { |
321 | 131M | LOAD_PIXELS |
322 | 131M | return 2 * FFABS(p0 - q0) + (FFABS(p1 - q1) >> 1) <= flim; |
323 | 131M | } |
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 | 153M | int E, int I) \ |
333 | 153M | { \ |
334 | 153M | LOAD_PIXELS \ |
335 | 153M | return vp ## vpn ## _simple_limit(p, stride, E) && \ |
336 | 153M | FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && \ |
337 | 153M | FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && \ |
338 | 153M | FFABS(q2 - q1) <= I && FFABS(q1 - q0) <= I; \ |
339 | 153M | } vp8dsp.c:vp7_normal_limit Line | Count | Source | 332 | 37.7M | int E, int I) \ | 333 | 37.7M | { \ | 334 | 37.7M | LOAD_PIXELS \ | 335 | 37.7M | return vp ## vpn ## _simple_limit(p, stride, E) && \ | 336 | 37.7M | FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && \ | 337 | 37.7M | FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && \ | 338 | 37.7M | FFABS(q2 - q1) <= I && FFABS(q1 - q0) <= I; \ | 339 | 37.7M | } |
vp8dsp.c:vp8_normal_limit Line | Count | Source | 332 | 115M | int E, int I) \ | 333 | 115M | { \ | 334 | 115M | LOAD_PIXELS \ | 335 | 115M | return vp ## vpn ## _simple_limit(p, stride, E) && \ | 336 | 115M | FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && \ | 337 | 115M | FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && \ | 338 | 115M | FFABS(q2 - q1) <= I && FFABS(q1 - q0) <= I; \ | 339 | 115M | } |
|
340 | | |
341 | | NORMAL_LIMIT(7) |
342 | | NORMAL_LIMIT(8) |
343 | | |
344 | | // high edge variance |
345 | | static av_always_inline int hev(uint8_t *p, ptrdiff_t stride, int thresh) |
346 | 136M | { |
347 | 136M | LOAD_PIXELS |
348 | 136M | return FFABS(p1 - p0) > thresh || FFABS(q1 - q0) > thresh; |
349 | 136M | } |
350 | | |
351 | | static av_always_inline void filter_mbedge(uint8_t *p, ptrdiff_t stride) |
352 | 49.9M | { |
353 | 49.9M | int a0, a1, a2, w; |
354 | 49.9M | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; |
355 | | |
356 | 49.9M | LOAD_PIXELS |
357 | | |
358 | 49.9M | w = clip_int8(p1 - q1); |
359 | 49.9M | w = clip_int8(w + 3 * (q0 - p0)); |
360 | | |
361 | 49.9M | a0 = (27 * w + 63) >> 7; |
362 | 49.9M | a1 = (18 * w + 63) >> 7; |
363 | 49.9M | a2 = (9 * w + 63) >> 7; |
364 | | |
365 | 49.9M | p[-3 * stride] = cm[p2 + a2]; |
366 | 49.9M | p[-2 * stride] = cm[p1 + a1]; |
367 | 49.9M | p[-1 * stride] = cm[p0 + a0]; |
368 | 49.9M | p[ 0 * stride] = cm[q0 - a0]; |
369 | 49.9M | p[ 1 * stride] = cm[q1 - a1]; |
370 | 49.9M | p[ 2 * stride] = cm[q2 - a2]; |
371 | 49.9M | } |
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 | 5.47M | int hev_thresh) \ |
379 | 5.47M | { \ |
380 | 5.47M | int i; \ |
381 | 63.8M | for (i = 0; i < size; i++) \ |
382 | 58.4M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ |
383 | 58.4M | flim_E, flim_I)) { \ |
384 | 53.5M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ |
385 | 53.5M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ |
386 | 53.5M | else \ |
387 | 53.5M | filter_mbedge(dst + i * stridea, strideb); \ |
388 | 53.5M | } \ |
389 | 5.47M | } \ vp8dsp.c:vp7_v_loop_filter16_c Line | Count | Source | 378 | 172k | int hev_thresh) \ | 379 | 172k | { \ | 380 | 172k | int i; \ | 381 | 2.92M | for (i = 0; i < size; i++) \ | 382 | 2.75M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 2.75M | flim_E, flim_I)) { \ | 384 | 2.50M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 2.50M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 2.50M | else \ | 387 | 2.50M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 2.50M | } \ | 389 | 172k | } \ |
vp8dsp.c:vp7_h_loop_filter16_c Line | Count | Source | 378 | 177k | int hev_thresh) \ | 379 | 177k | { \ | 380 | 177k | int i; \ | 381 | 3.02M | for (i = 0; i < size; i++) \ | 382 | 2.84M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 2.84M | flim_E, flim_I)) { \ | 384 | 2.60M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 2.60M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 2.60M | else \ | 387 | 2.60M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 2.60M | } \ | 389 | 177k | } \ |
vp8dsp.c:vp7_v_loop_filter8_c Line | Count | Source | 378 | 344k | int hev_thresh) \ | 379 | 344k | { \ | 380 | 344k | int i; \ | 381 | 3.10M | for (i = 0; i < size; i++) \ | 382 | 2.75M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 2.75M | flim_E, flim_I)) { \ | 384 | 2.60M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 2.60M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 2.60M | else \ | 387 | 2.60M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 2.60M | } \ | 389 | 344k | } \ |
vp8dsp.c:vp7_h_loop_filter8_c Line | Count | Source | 378 | 355k | int hev_thresh) \ | 379 | 355k | { \ | 380 | 355k | int i; \ | 381 | 3.20M | for (i = 0; i < size; i++) \ | 382 | 2.84M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 2.84M | flim_E, flim_I)) { \ | 384 | 2.71M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 2.71M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 2.71M | else \ | 387 | 2.71M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 2.71M | } \ | 389 | 355k | } \ |
vp8dsp.c:vp8_v_loop_filter16_c Line | Count | Source | 378 | 750k | int hev_thresh) \ | 379 | 750k | { \ | 380 | 750k | int i; \ | 381 | 12.7M | for (i = 0; i < size; i++) \ | 382 | 12.0M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 12.0M | flim_E, flim_I)) { \ | 384 | 10.9M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 10.9M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 10.9M | else \ | 387 | 10.9M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 10.9M | } \ | 389 | 750k | } \ |
vp8dsp.c:vp8_h_loop_filter16_c Line | Count | Source | 378 | 724k | int hev_thresh) \ | 379 | 724k | { \ | 380 | 724k | int i; \ | 381 | 12.3M | for (i = 0; i < size; i++) \ | 382 | 11.5M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 11.5M | flim_E, flim_I)) { \ | 384 | 10.1M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 10.1M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 10.1M | else \ | 387 | 10.1M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 10.1M | } \ | 389 | 724k | } \ |
vp8dsp.c:vp8_v_loop_filter8_c Line | Count | Source | 378 | 1.50M | int hev_thresh) \ | 379 | 1.50M | { \ | 380 | 1.50M | int i; \ | 381 | 13.5M | for (i = 0; i < size; i++) \ | 382 | 12.0M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 12.0M | flim_E, flim_I)) { \ | 384 | 11.2M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 11.2M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 11.2M | else \ | 387 | 11.2M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 11.2M | } \ | 389 | 1.50M | } \ |
vp8dsp.c:vp8_h_loop_filter8_c Line | Count | Source | 378 | 1.44M | int hev_thresh) \ | 379 | 1.44M | { \ | 380 | 1.44M | int i; \ | 381 | 13.0M | for (i = 0; i < size; i++) \ | 382 | 11.5M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 383 | 11.5M | flim_E, flim_I)) { \ | 384 | 10.7M | if (hev(dst + i * stridea, strideb, hev_thresh)) \ | 385 | 10.7M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 386 | 10.7M | else \ | 387 | 10.7M | filter_mbedge(dst + i * stridea, strideb); \ | 388 | 10.7M | } \ | 389 | 1.44M | } \ |
|
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 | 7.42M | int hev_thresh) \ |
397 | 7.42M | { \ |
398 | 7.42M | int i; \ |
399 | 102M | for (i = 0; i < size; i++) \ |
400 | 95.0M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ |
401 | 95.0M | flim_E, flim_I)) { \ |
402 | 83.3M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ |
403 | 83.3M | if (hv) \ |
404 | 83.3M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ |
405 | 83.3M | else \ |
406 | 83.3M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ |
407 | 83.3M | } \ |
408 | 7.42M | } vp8dsp.c:vp7_v_loop_filter16_inner_c Line | Count | Source | 396 | 622k | int hev_thresh) \ | 397 | 622k | { \ | 398 | 622k | int i; \ | 399 | 10.5M | for (i = 0; i < size; i++) \ | 400 | 9.96M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 9.96M | flim_E, flim_I)) { \ | 402 | 9.18M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 9.18M | if (hv) \ | 404 | 9.18M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 9.18M | else \ | 406 | 9.18M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 9.18M | } \ | 408 | 622k | } |
vp8dsp.c:vp7_h_loop_filter16_inner_c Line | Count | Source | 396 | 622k | int hev_thresh) \ | 397 | 622k | { \ | 398 | 622k | int i; \ | 399 | 10.5M | for (i = 0; i < size; i++) \ | 400 | 9.96M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 9.96M | flim_E, flim_I)) { \ | 402 | 9.12M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 9.12M | if (hv) \ | 404 | 9.12M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 9.12M | else \ | 406 | 9.12M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 9.12M | } \ | 408 | 622k | } |
vp8dsp.c:vp7_v_loop_filter8_inner_c Line | Count | Source | 396 | 415k | int hev_thresh) \ | 397 | 415k | { \ | 398 | 415k | int i; \ | 399 | 3.73M | for (i = 0; i < size; i++) \ | 400 | 3.32M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 3.32M | flim_E, flim_I)) { \ | 402 | 3.15M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 3.15M | if (hv) \ | 404 | 3.15M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 3.15M | else \ | 406 | 3.15M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 3.15M | } \ | 408 | 415k | } |
vp8dsp.c:vp7_h_loop_filter8_inner_c Line | Count | Source | 396 | 415k | int hev_thresh) \ | 397 | 415k | { \ | 398 | 415k | int i; \ | 399 | 3.73M | for (i = 0; i < size; i++) \ | 400 | 3.32M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 3.32M | flim_E, flim_I)) { \ | 402 | 3.15M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 3.15M | if (hv) \ | 404 | 3.15M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 3.15M | else \ | 406 | 3.15M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 3.15M | } \ | 408 | 415k | } |
vp8dsp.c:vp8_v_loop_filter16_inner_c Line | Count | Source | 396 | 1.60M | int hev_thresh) \ | 397 | 1.60M | { \ | 398 | 1.60M | int i; \ | 399 | 27.2M | for (i = 0; i < size; i++) \ | 400 | 25.6M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 25.6M | flim_E, flim_I)) { \ | 402 | 22.2M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 22.2M | if (hv) \ | 404 | 22.2M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 22.2M | else \ | 406 | 22.2M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 22.2M | } \ | 408 | 1.60M | } |
vp8dsp.c:vp8_h_loop_filter16_inner_c Line | Count | Source | 396 | 1.60M | int hev_thresh) \ | 397 | 1.60M | { \ | 398 | 1.60M | int i; \ | 399 | 27.2M | for (i = 0; i < size; i++) \ | 400 | 25.6M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 25.6M | flim_E, flim_I)) { \ | 402 | 21.2M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 21.2M | if (hv) \ | 404 | 21.2M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 21.2M | else \ | 406 | 21.2M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 21.2M | } \ | 408 | 1.60M | } |
vp8dsp.c:vp8_v_loop_filter8_inner_c Line | Count | Source | 396 | 1.06M | int hev_thresh) \ | 397 | 1.06M | { \ | 398 | 1.06M | int i; \ | 399 | 9.62M | for (i = 0; i < size; i++) \ | 400 | 8.55M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 8.55M | flim_E, flim_I)) { \ | 402 | 7.74M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 7.74M | if (hv) \ | 404 | 7.74M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 7.74M | else \ | 406 | 7.74M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 7.74M | } \ | 408 | 1.06M | } |
vp8dsp.c:vp8_h_loop_filter8_inner_c Line | Count | Source | 396 | 1.06M | int hev_thresh) \ | 397 | 1.06M | { \ | 398 | 1.06M | int i; \ | 399 | 9.62M | for (i = 0; i < size; i++) \ | 400 | 8.55M | if (vpn ## _normal_limit(dst + i * stridea, strideb, \ | 401 | 8.55M | flim_E, flim_I)) { \ | 402 | 7.47M | int hv = hev(dst + i * stridea, strideb, hev_thresh); \ | 403 | 7.47M | if (hv) \ | 404 | 7.47M | vpn ## _filter_common(dst + i * stridea, strideb, 1); \ | 405 | 7.47M | else \ | 406 | 7.47M | vpn ## _filter_common(dst + i * stridea, strideb, 0); \ | 407 | 7.47M | } \ | 408 | 1.06M | } |
|
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 | 1.82M | int fI, int hev_thresh) \ |
416 | 1.82M | { \ |
417 | 1.82M | vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \ |
418 | 1.82M | vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \ |
419 | 1.82M | } \ vp8dsp.c:vp7_v_loop_filter8uv_c Line | Count | Source | 415 | 172k | int fI, int hev_thresh) \ | 416 | 172k | { \ | 417 | 172k | vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \ | 418 | 172k | vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \ | 419 | 172k | } \ |
vp8dsp.c:vp7_h_loop_filter8uv_c Line | Count | Source | 415 | 177k | int fI, int hev_thresh) \ | 416 | 177k | { \ | 417 | 177k | vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \ | 418 | 177k | vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \ | 419 | 177k | } \ |
vp8dsp.c:vp8_v_loop_filter8uv_c Line | Count | Source | 415 | 750k | int fI, int hev_thresh) \ | 416 | 750k | { \ | 417 | 750k | vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \ | 418 | 750k | vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \ | 419 | 750k | } \ |
vp8dsp.c:vp8_h_loop_filter8uv_c Line | Count | Source | 415 | 724k | int fI, int hev_thresh) \ | 416 | 724k | { \ | 417 | 724k | vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \ | 418 | 724k | vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \ | 419 | 724k | } \ |
|
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 | 1.48M | int hev_thresh) \ |
426 | 1.48M | { \ |
427 | 1.48M | vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \ |
428 | 1.48M | hev_thresh); \ |
429 | 1.48M | vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \ |
430 | 1.48M | hev_thresh); \ |
431 | 1.48M | } vp8dsp.c:vp7_v_loop_filter8uv_inner_c Line | Count | Source | 425 | 207k | int hev_thresh) \ | 426 | 207k | { \ | 427 | 207k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \ | 428 | 207k | hev_thresh); \ | 429 | 207k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \ | 430 | 207k | hev_thresh); \ | 431 | 207k | } |
vp8dsp.c:vp7_h_loop_filter8uv_inner_c Line | Count | Source | 425 | 207k | int hev_thresh) \ | 426 | 207k | { \ | 427 | 207k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \ | 428 | 207k | hev_thresh); \ | 429 | 207k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \ | 430 | 207k | hev_thresh); \ | 431 | 207k | } |
vp8dsp.c:vp8_v_loop_filter8uv_inner_c Line | Count | Source | 425 | 534k | int hev_thresh) \ | 426 | 534k | { \ | 427 | 534k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \ | 428 | 534k | hev_thresh); \ | 429 | 534k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \ | 430 | 534k | hev_thresh); \ | 431 | 534k | } |
vp8dsp.c:vp8_h_loop_filter8uv_inner_c Line | Count | Source | 425 | 534k | int hev_thresh) \ | 426 | 534k | { \ | 427 | 534k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \ | 428 | 534k | hev_thresh); \ | 429 | 534k | vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \ | 430 | 534k | hev_thresh); \ | 431 | 534k | } |
|
432 | | |
433 | | #define LOOP_FILTER_SIMPLE(vpn) \ |
434 | | static void vpn ## _v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \ |
435 | 3.53M | int flim) \ |
436 | 3.53M | { \ |
437 | 3.53M | int i; \ |
438 | 60.0M | for (i = 0; i < 16; i++) \ |
439 | 56.5M | if (vpn ## _simple_limit(dst + i, stride, flim)) \ |
440 | 56.5M | vpn ## _filter_common(dst + i, stride, 1); \ |
441 | 3.53M | } \ vp8dsp.c:vp7_v_loop_filter_simple_c Line | Count | Source | 435 | 3.03M | int flim) \ | 436 | 3.03M | { \ | 437 | 3.03M | int i; \ | 438 | 51.5M | for (i = 0; i < 16; i++) \ | 439 | 48.5M | if (vpn ## _simple_limit(dst + i, stride, flim)) \ | 440 | 48.5M | vpn ## _filter_common(dst + i, stride, 1); \ | 441 | 3.03M | } \ |
vp8dsp.c:vp8_v_loop_filter_simple_c Line | Count | Source | 435 | 500k | int flim) \ | 436 | 500k | { \ | 437 | 500k | int i; \ | 438 | 8.51M | for (i = 0; i < 16; i++) \ | 439 | 8.01M | if (vpn ## _simple_limit(dst + i, stride, flim)) \ | 440 | 8.01M | vpn ## _filter_common(dst + i, stride, 1); \ | 441 | 500k | } \ |
|
442 | | \ |
443 | | static void vpn ## _h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \ |
444 | 3.49M | int flim) \ |
445 | 3.49M | { \ |
446 | 3.49M | int i; \ |
447 | 59.3M | for (i = 0; i < 16; i++) \ |
448 | 55.8M | if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \ |
449 | 55.8M | vpn ## _filter_common(dst + i * stride, 1, 1); \ |
450 | 3.49M | } vp8dsp.c:vp7_h_loop_filter_simple_c Line | Count | Source | 444 | 3.02M | int flim) \ | 445 | 3.02M | { \ | 446 | 3.02M | int i; \ | 447 | 51.4M | for (i = 0; i < 16; i++) \ | 448 | 48.4M | if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \ | 449 | 48.4M | vpn ## _filter_common(dst + i * stride, 1, 1); \ | 450 | 3.02M | } |
vp8dsp.c:vp8_h_loop_filter_simple_c Line | Count | Source | 444 | 467k | int flim) \ | 445 | 467k | { \ | 446 | 467k | int i; \ | 447 | 7.95M | for (i = 0; i < 16; i++) \ | 448 | 7.48M | if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \ | 449 | 7.48M | vpn ## _filter_common(dst + i * stride, 1, 1); \ | 450 | 467k | } |
|
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 | 3.10M | int h, int x, int y) \ |
473 | 3.10M | { \ |
474 | 3.10M | int i; \ |
475 | 30.9M | for (i = 0; i < h; i++, dst += dststride, src += srcstride) \ |
476 | 27.8M | memcpy(dst, src, WIDTH); \ |
477 | 3.10M | } vp8dsp.c:put_vp8_pixels16_c Line | Count | Source | 472 | 780k | int h, int x, int y) \ | 473 | 780k | { \ | 474 | 780k | int i; \ | 475 | 13.0M | for (i = 0; i < h; i++, dst += dststride, src += srcstride) \ | 476 | 12.2M | memcpy(dst, src, WIDTH); \ | 477 | 780k | } |
vp8dsp.c:put_vp8_pixels8_c Line | Count | Source | 472 | 1.54M | int h, int x, int y) \ | 473 | 1.54M | { \ | 474 | 1.54M | int i; \ | 475 | 13.8M | for (i = 0; i < h; i++, dst += dststride, src += srcstride) \ | 476 | 12.3M | memcpy(dst, src, WIDTH); \ | 477 | 1.54M | } |
vp8dsp.c:put_vp8_pixels4_c Line | Count | Source | 472 | 774k | int h, int x, int y) \ | 473 | 774k | { \ | 474 | 774k | int i; \ | 475 | 4.05M | for (i = 0; i < h; i++, dst += dststride, src += srcstride) \ | 476 | 3.27M | memcpy(dst, src, WIDTH); \ | 477 | 774k | } |
|
478 | | |
479 | | PUT_PIXELS(16) |
480 | | PUT_PIXELS(8) |
481 | | PUT_PIXELS(4) |
482 | | |
483 | | #define FILTER_6TAP(src, F, stride) \ |
484 | 272M | cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \ |
485 | 272M | F[0] * src[x - 2 * stride] + F[3] * src[x + 1 * stride] - \ |
486 | 272M | F[4] * src[x + 2 * stride] + F[5] * src[x + 3 * stride] + 64) >> 7] |
487 | | |
488 | | #define FILTER_4TAP(src, F, stride) \ |
489 | 63.0M | cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \ |
490 | 63.0M | 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 | 479k | int h, int mx, int my) \ |
498 | 479k | { \ |
499 | 479k | const uint8_t *filter = subpel_filters[mx - 1]; \ |
500 | 479k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ |
501 | 479k | int x, y; \ |
502 | 5.14M | for (y = 0; y < h; y++) { \ |
503 | 60.0M | for (x = 0; x < SIZE; x++) \ |
504 | 55.3M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ |
505 | 4.66M | dst += dststride; \ |
506 | 4.66M | src += srcstride; \ |
507 | 4.66M | } \ |
508 | 479k | } vp8dsp.c:put_vp8_epel16_h6_c Line | Count | Source | 497 | 156k | int h, int mx, int my) \ | 498 | 156k | { \ | 499 | 156k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 500 | 156k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 501 | 156k | int x, y; \ | 502 | 2.63M | for (y = 0; y < h; y++) { \ | 503 | 42.1M | for (x = 0; x < SIZE; x++) \ | 504 | 39.6M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ | 505 | 2.47M | dst += dststride; \ | 506 | 2.47M | src += srcstride; \ | 507 | 2.47M | } \ | 508 | 156k | } |
vp8dsp.c:put_vp8_epel8_h4_c Line | Count | Source | 497 | 76.6k | int h, int mx, int my) \ | 498 | 76.6k | { \ | 499 | 76.6k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 500 | 76.6k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 501 | 76.6k | int x, y; \ | 502 | 679k | for (y = 0; y < h; y++) { \ | 503 | 5.42M | for (x = 0; x < SIZE; x++) \ | 504 | 4.82M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ | 505 | 602k | dst += dststride; \ | 506 | 602k | src += srcstride; \ | 507 | 602k | } \ | 508 | 76.6k | } |
vp8dsp.c:put_vp8_epel8_h6_c Line | Count | Source | 497 | 138k | int h, int mx, int my) \ | 498 | 138k | { \ | 499 | 138k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 500 | 138k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 501 | 138k | int x, y; \ | 502 | 1.27M | for (y = 0; y < h; y++) { \ | 503 | 10.2M | for (x = 0; x < SIZE; x++) \ | 504 | 9.06M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ | 505 | 1.13M | dst += dststride; \ | 506 | 1.13M | src += srcstride; \ | 507 | 1.13M | } \ | 508 | 138k | } |
vp8dsp.c:put_vp8_epel4_h4_c Line | Count | Source | 497 | 22.6k | int h, int mx, int my) \ | 498 | 22.6k | { \ | 499 | 22.6k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 500 | 22.6k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 501 | 22.6k | int x, y; \ | 502 | 127k | for (y = 0; y < h; y++) { \ | 503 | 523k | for (x = 0; x < SIZE; x++) \ | 504 | 418k | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ | 505 | 104k | dst += dststride; \ | 506 | 104k | src += srcstride; \ | 507 | 104k | } \ | 508 | 22.6k | } |
vp8dsp.c:put_vp8_epel4_h6_c Line | Count | Source | 497 | 84.7k | int h, int mx, int my) \ | 498 | 84.7k | { \ | 499 | 84.7k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 500 | 84.7k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 501 | 84.7k | int x, y; \ | 502 | 436k | for (y = 0; y < h; y++) { \ | 503 | 1.75M | for (x = 0; x < SIZE; x++) \ | 504 | 1.40M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \ | 505 | 351k | dst += dststride; \ | 506 | 351k | src += srcstride; \ | 507 | 351k | } \ | 508 | 84.7k | } |
|
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 | 436k | int h, int mx, int my) \ |
516 | 436k | { \ |
517 | 436k | const uint8_t *filter = subpel_filters[my - 1]; \ |
518 | 436k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ |
519 | 436k | int x, y; \ |
520 | 4.43M | for (y = 0; y < h; y++) { \ |
521 | 47.7M | for (x = 0; x < SIZE; x++) \ |
522 | 43.7M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ |
523 | 3.99M | dst += dststride; \ |
524 | 3.99M | src += srcstride; \ |
525 | 3.99M | } \ |
526 | 436k | } vp8dsp.c:put_vp8_epel16_v6_c Line | Count | Source | 515 | 105k | int h, int mx, int my) \ | 516 | 105k | { \ | 517 | 105k | const uint8_t *filter = subpel_filters[my - 1]; \ | 518 | 105k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 519 | 105k | int x, y; \ | 520 | 1.75M | for (y = 0; y < h; y++) { \ | 521 | 28.0M | for (x = 0; x < SIZE; x++) \ | 522 | 26.4M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ | 523 | 1.65M | dst += dststride; \ | 524 | 1.65M | src += srcstride; \ | 525 | 1.65M | } \ | 526 | 105k | } |
vp8dsp.c:put_vp8_epel8_v4_c Line | Count | Source | 515 | 75.0k | int h, int mx, int my) \ | 516 | 75.0k | { \ | 517 | 75.0k | const uint8_t *filter = subpel_filters[my - 1]; \ | 518 | 75.0k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 519 | 75.0k | int x, y; \ | 520 | 664k | for (y = 0; y < h; y++) { \ | 521 | 5.30M | for (x = 0; x < SIZE; x++) \ | 522 | 4.71M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ | 523 | 589k | dst += dststride; \ | 524 | 589k | src += srcstride; \ | 525 | 589k | } \ | 526 | 75.0k | } |
vp8dsp.c:put_vp8_epel8_v6_c Line | Count | Source | 515 | 170k | int h, int mx, int my) \ | 516 | 170k | { \ | 517 | 170k | const uint8_t *filter = subpel_filters[my - 1]; \ | 518 | 170k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 519 | 170k | int x, y; \ | 520 | 1.55M | for (y = 0; y < h; y++) { \ | 521 | 12.4M | for (x = 0; x < SIZE; x++) \ | 522 | 11.0M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ | 523 | 1.38M | dst += dststride; \ | 524 | 1.38M | src += srcstride; \ | 525 | 1.38M | } \ | 526 | 170k | } |
vp8dsp.c:put_vp8_epel4_v4_c Line | Count | Source | 515 | 23.9k | int h, int mx, int my) \ | 516 | 23.9k | { \ | 517 | 23.9k | const uint8_t *filter = subpel_filters[my - 1]; \ | 518 | 23.9k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 519 | 23.9k | int x, y; \ | 520 | 141k | for (y = 0; y < h; y++) { \ | 521 | 585k | for (x = 0; x < SIZE; x++) \ | 522 | 468k | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ | 523 | 117k | dst += dststride; \ | 524 | 117k | src += srcstride; \ | 525 | 117k | } \ | 526 | 23.9k | } |
vp8dsp.c:put_vp8_epel4_v6_c Line | Count | Source | 515 | 61.4k | int h, int mx, int my) \ | 516 | 61.4k | { \ | 517 | 61.4k | const uint8_t *filter = subpel_filters[my - 1]; \ | 518 | 61.4k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 519 | 61.4k | int x, y; \ | 520 | 319k | for (y = 0; y < h; y++) { \ | 521 | 1.29M | for (x = 0; x < SIZE; x++) \ | 522 | 1.03M | dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \ | 523 | 258k | dst += dststride; \ | 524 | 258k | src += srcstride; \ | 525 | 258k | } \ | 526 | 61.4k | } |
|
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 | 1.22M | int my) \ |
536 | 1.22M | { \ |
537 | 1.22M | const uint8_t *filter = subpel_filters[mx - 1]; \ |
538 | 1.22M | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ |
539 | 1.22M | int x, y; \ |
540 | 1.22M | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ |
541 | 1.22M | uint8_t *tmp = tmp_array; \ |
542 | 1.22M | src -= (2 - (VTAPS == 4)) * srcstride; \ |
543 | 1.22M | \ |
544 | 16.8M | for (y = 0; y < h + VTAPS - 1; y++) { \ |
545 | 155M | for (x = 0; x < SIZE; x++) \ |
546 | 139M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ |
547 | 15.5M | tmp += SIZE; \ |
548 | 15.5M | src += srcstride; \ |
549 | 15.5M | } \ |
550 | 1.22M | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ |
551 | 1.22M | filter = subpel_filters[my - 1]; \ |
552 | 1.22M | \ |
553 | 11.5M | for (y = 0; y < h; y++) { \ |
554 | 107M | for (x = 0; x < SIZE; x++) \ |
555 | 96.9M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ |
556 | 10.3M | dst += dststride; \ |
557 | 10.3M | tmp += SIZE; \ |
558 | 10.3M | } \ |
559 | 1.22M | } vp8dsp.c:put_vp8_epel16_h6v6_c Line | Count | Source | 535 | 173k | int my) \ | 536 | 173k | { \ | 537 | 173k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 173k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 173k | int x, y; \ | 540 | 173k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 173k | uint8_t *tmp = tmp_array; \ | 542 | 173k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 173k | \ | 544 | 3.76M | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 61.0M | for (x = 0; x < SIZE; x++) \ | 546 | 57.4M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 3.59M | tmp += SIZE; \ | 548 | 3.59M | src += srcstride; \ | 549 | 3.59M | } \ | 550 | 173k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 173k | filter = subpel_filters[my - 1]; \ | 552 | 173k | \ | 553 | 2.89M | for (y = 0; y < h; y++) { \ | 554 | 46.3M | for (x = 0; x < SIZE; x++) \ | 555 | 43.6M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 2.72M | dst += dststride; \ | 557 | 2.72M | tmp += SIZE; \ | 558 | 2.72M | } \ | 559 | 173k | } |
vp8dsp.c:put_vp8_epel8_h4v4_c Line | Count | Source | 535 | 123k | int my) \ | 536 | 123k | { \ | 537 | 123k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 123k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 123k | int x, y; \ | 540 | 123k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 123k | uint8_t *tmp = tmp_array; \ | 542 | 123k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 123k | \ | 544 | 1.46M | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 12.0M | for (x = 0; x < SIZE; x++) \ | 546 | 10.7M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 1.33M | tmp += SIZE; \ | 548 | 1.33M | src += srcstride; \ | 549 | 1.33M | } \ | 550 | 123k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 123k | filter = subpel_filters[my - 1]; \ | 552 | 123k | \ | 553 | 1.09M | for (y = 0; y < h; y++) { \ | 554 | 8.72M | for (x = 0; x < SIZE; x++) \ | 555 | 7.75M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 969k | dst += dststride; \ | 557 | 969k | tmp += SIZE; \ | 558 | 969k | } \ | 559 | 123k | } |
vp8dsp.c:put_vp8_epel8_h6v4_c Line | Count | Source | 535 | 135k | int my) \ | 536 | 135k | { \ | 537 | 135k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 135k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 135k | int x, y; \ | 540 | 135k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 135k | uint8_t *tmp = tmp_array; \ | 542 | 135k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 135k | \ | 544 | 1.61M | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 13.2M | for (x = 0; x < SIZE; x++) \ | 546 | 11.7M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 1.47M | tmp += SIZE; \ | 548 | 1.47M | src += srcstride; \ | 549 | 1.47M | } \ | 550 | 135k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 135k | filter = subpel_filters[my - 1]; \ | 552 | 135k | \ | 553 | 1.20M | for (y = 0; y < h; y++) { \ | 554 | 9.60M | for (x = 0; x < SIZE; x++) \ | 555 | 8.54M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 1.06M | dst += dststride; \ | 557 | 1.06M | tmp += SIZE; \ | 558 | 1.06M | } \ | 559 | 135k | } |
vp8dsp.c:put_vp8_epel8_h4v6_c Line | Count | Source | 535 | 148k | int my) \ | 536 | 148k | { \ | 537 | 148k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 148k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 148k | int x, y; \ | 540 | 148k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 148k | uint8_t *tmp = tmp_array; \ | 542 | 148k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 148k | \ | 544 | 2.06M | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 17.2M | for (x = 0; x < SIZE; x++) \ | 546 | 15.3M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 1.91M | tmp += SIZE; \ | 548 | 1.91M | src += srcstride; \ | 549 | 1.91M | } \ | 550 | 148k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 148k | filter = subpel_filters[my - 1]; \ | 552 | 148k | \ | 553 | 1.32M | for (y = 0; y < h; y++) { \ | 554 | 10.5M | for (x = 0; x < SIZE; x++) \ | 555 | 9.37M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 1.17M | dst += dststride; \ | 557 | 1.17M | tmp += SIZE; \ | 558 | 1.17M | } \ | 559 | 148k | } |
vp8dsp.c:put_vp8_epel8_h6v6_c Line | Count | Source | 535 | 269k | int my) \ | 536 | 269k | { \ | 537 | 269k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 269k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 269k | int x, y; \ | 540 | 269k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 269k | uint8_t *tmp = tmp_array; \ | 542 | 269k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 269k | \ | 544 | 4.11M | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 34.5M | for (x = 0; x < SIZE; x++) \ | 546 | 30.7M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 3.84M | tmp += SIZE; \ | 548 | 3.84M | src += srcstride; \ | 549 | 3.84M | } \ | 550 | 269k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 269k | filter = subpel_filters[my - 1]; \ | 552 | 269k | \ | 553 | 2.76M | for (y = 0; y < h; y++) { \ | 554 | 22.4M | for (x = 0; x < SIZE; x++) \ | 555 | 19.9M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 2.49M | dst += dststride; \ | 557 | 2.49M | tmp += SIZE; \ | 558 | 2.49M | } \ | 559 | 269k | } |
vp8dsp.c:put_vp8_epel4_h4v4_c Line | Count | Source | 535 | 107k | int my) \ | 536 | 107k | { \ | 537 | 107k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 107k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 107k | int x, y; \ | 540 | 107k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 107k | uint8_t *tmp = tmp_array; \ | 542 | 107k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 107k | \ | 544 | 1.13M | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 5.13M | for (x = 0; x < SIZE; x++) \ | 546 | 4.11M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 1.02M | tmp += SIZE; \ | 548 | 1.02M | src += srcstride; \ | 549 | 1.02M | } \ | 550 | 107k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 107k | filter = subpel_filters[my - 1]; \ | 552 | 107k | \ | 553 | 812k | for (y = 0; y < h; y++) { \ | 554 | 3.52M | for (x = 0; x < SIZE; x++) \ | 555 | 2.81M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 704k | dst += dststride; \ | 557 | 704k | tmp += SIZE; \ | 558 | 704k | } \ | 559 | 107k | } |
vp8dsp.c:put_vp8_epel4_h6v4_c Line | Count | Source | 535 | 85.3k | int my) \ | 536 | 85.3k | { \ | 537 | 85.3k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 85.3k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 85.3k | int x, y; \ | 540 | 85.3k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 85.3k | uint8_t *tmp = tmp_array; \ | 542 | 85.3k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 85.3k | \ | 544 | 733k | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 3.24M | for (x = 0; x < SIZE; x++) \ | 546 | 2.59M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 648k | tmp += SIZE; \ | 548 | 648k | src += srcstride; \ | 549 | 648k | } \ | 550 | 85.3k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 85.3k | filter = subpel_filters[my - 1]; \ | 552 | 85.3k | \ | 553 | 477k | for (y = 0; y < h; y++) { \ | 554 | 1.96M | for (x = 0; x < SIZE; x++) \ | 555 | 1.56M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 392k | dst += dststride; \ | 557 | 392k | tmp += SIZE; \ | 558 | 392k | } \ | 559 | 85.3k | } |
vp8dsp.c:put_vp8_epel4_h4v6_c Line | Count | Source | 535 | 46.5k | int my) \ | 536 | 46.5k | { \ | 537 | 46.5k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 46.5k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 46.5k | int x, y; \ | 540 | 46.5k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 46.5k | uint8_t *tmp = tmp_array; \ | 542 | 46.5k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 46.5k | \ | 544 | 493k | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 2.23M | for (x = 0; x < SIZE; x++) \ | 546 | 1.78M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 447k | tmp += SIZE; \ | 548 | 447k | src += srcstride; \ | 549 | 447k | } \ | 550 | 46.5k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 46.5k | filter = subpel_filters[my - 1]; \ | 552 | 46.5k | \ | 553 | 260k | for (y = 0; y < h; y++) { \ | 554 | 1.07M | for (x = 0; x < SIZE; x++) \ | 555 | 856k | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 214k | dst += dststride; \ | 557 | 214k | tmp += SIZE; \ | 558 | 214k | } \ | 559 | 46.5k | } |
vp8dsp.c:put_vp8_epel4_h6v6_c Line | Count | Source | 535 | 138k | int my) \ | 536 | 138k | { \ | 537 | 138k | const uint8_t *filter = subpel_filters[mx - 1]; \ | 538 | 138k | const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \ | 539 | 138k | int x, y; \ | 540 | 138k | uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \ | 541 | 138k | uint8_t *tmp = tmp_array; \ | 542 | 138k | src -= (2 - (VTAPS == 4)) * srcstride; \ | 543 | 138k | \ | 544 | 1.44M | for (y = 0; y < h + VTAPS - 1; y++) { \ | 545 | 6.53M | for (x = 0; x < SIZE; x++) \ | 546 | 5.22M | tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \ | 547 | 1.30M | tmp += SIZE; \ | 548 | 1.30M | src += srcstride; \ | 549 | 1.30M | } \ | 550 | 138k | tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \ | 551 | 138k | filter = subpel_filters[my - 1]; \ | 552 | 138k | \ | 553 | 751k | for (y = 0; y < h; y++) { \ | 554 | 3.06M | for (x = 0; x < SIZE; x++) \ | 555 | 2.45M | dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \ | 556 | 612k | dst += dststride; \ | 557 | 612k | tmp += SIZE; \ | 558 | 612k | } \ | 559 | 138k | } |
|
560 | | |
561 | | VP8_EPEL_H(8, 4) |
562 | | VP8_EPEL_H(4, 4) |
563 | | VP8_EPEL_H(16, 6) |
564 | | VP8_EPEL_H(8, 6) |
565 | | VP8_EPEL_H(4, 6) |
566 | | VP8_EPEL_V(8, 4) |
567 | | VP8_EPEL_V(4, 4) |
568 | | VP8_EPEL_V(16, 6) |
569 | | VP8_EPEL_V(8, 6) |
570 | | VP8_EPEL_V(4, 6) |
571 | | |
572 | | VP8_EPEL_HV(8, 4, 4) |
573 | | VP8_EPEL_HV(4, 4, 4) |
574 | | VP8_EPEL_HV(8, 4, 6) |
575 | | VP8_EPEL_HV(4, 4, 6) |
576 | | VP8_EPEL_HV(8, 6, 4) |
577 | | VP8_EPEL_HV(4, 6, 4) |
578 | | VP8_EPEL_HV(16, 6, 6) |
579 | | VP8_EPEL_HV(8, 6, 6) |
580 | | VP8_EPEL_HV(4, 6, 6) |
581 | | |
582 | | #define VP8_BILINEAR(SIZE) \ |
583 | | static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, \ |
584 | | const uint8_t *src, ptrdiff_t sstride, \ |
585 | 139k | int h, int mx, int my) \ |
586 | 139k | { \ |
587 | 139k | int a = 8 - mx, b = mx; \ |
588 | 139k | int x, y; \ |
589 | 1.07M | for (y = 0; y < h; y++) { \ |
590 | 9.50M | for (x = 0; x < SIZE; x++) \ |
591 | 8.56M | dst[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ |
592 | 932k | dst += dstride; \ |
593 | 932k | src += sstride; \ |
594 | 932k | } \ |
595 | 139k | } \ vp8dsp.c:put_vp8_bilinear16_h_c Line | Count | Source | 585 | 20.5k | int h, int mx, int my) \ | 586 | 20.5k | { \ | 587 | 20.5k | int a = 8 - mx, b = mx; \ | 588 | 20.5k | int x, y; \ | 589 | 321k | for (y = 0; y < h; y++) { \ | 590 | 5.12M | for (x = 0; x < SIZE; x++) \ | 591 | 4.82M | dst[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | 592 | 301k | dst += dstride; \ | 593 | 301k | src += sstride; \ | 594 | 301k | } \ | 595 | 20.5k | } \ |
vp8dsp.c:put_vp8_bilinear8_h_c Line | Count | Source | 585 | 39.6k | int h, int mx, int my) \ | 586 | 39.6k | { \ | 587 | 39.6k | int a = 8 - mx, b = mx; \ | 588 | 39.6k | int x, y; \ | 589 | 345k | for (y = 0; y < h; y++) { \ | 590 | 2.75M | for (x = 0; x < SIZE; x++) \ | 591 | 2.44M | dst[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | 592 | 305k | dst += dstride; \ | 593 | 305k | src += sstride; \ | 594 | 305k | } \ | 595 | 39.6k | } \ |
vp8dsp.c:put_vp8_bilinear4_h_c Line | Count | Source | 585 | 79.2k | int h, int mx, int my) \ | 586 | 79.2k | { \ | 587 | 79.2k | int a = 8 - mx, b = mx; \ | 588 | 79.2k | int x, y; \ | 589 | 404k | for (y = 0; y < h; y++) { \ | 590 | 1.62M | for (x = 0; x < SIZE; x++) \ | 591 | 1.30M | dst[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | 592 | 325k | dst += dstride; \ | 593 | 325k | src += sstride; \ | 594 | 325k | } \ | 595 | 79.2k | } \ |
|
596 | | \ |
597 | | static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, \ |
598 | | const uint8_t *src, ptrdiff_t sstride, \ |
599 | 123k | int h, int mx, int my) \ |
600 | 123k | { \ |
601 | 123k | int c = 8 - my, d = my; \ |
602 | 123k | int x, y; \ |
603 | 943k | for (y = 0; y < h; y++) { \ |
604 | 8.09M | for (x = 0; x < SIZE; x++) \ |
605 | 7.27M | dst[x] = (c * src[x] + d * src[x + sstride] + 4) >> 3; \ |
606 | 819k | dst += dstride; \ |
607 | 819k | src += sstride; \ |
608 | 819k | } \ |
609 | 123k | } \ vp8dsp.c:put_vp8_bilinear16_v_c Line | Count | Source | 599 | 16.4k | int h, int mx, int my) \ | 600 | 16.4k | { \ | 601 | 16.4k | int c = 8 - my, d = my; \ | 602 | 16.4k | int x, y; \ | 603 | 258k | for (y = 0; y < h; y++) { \ | 604 | 4.12M | for (x = 0; x < SIZE; x++) \ | 605 | 3.87M | dst[x] = (c * src[x] + d * src[x + sstride] + 4) >> 3; \ | 606 | 242k | dst += dstride; \ | 607 | 242k | src += sstride; \ | 608 | 242k | } \ | 609 | 16.4k | } \ |
vp8dsp.c:put_vp8_bilinear8_v_c Line | Count | Source | 599 | 33.8k | int h, int mx, int my) \ | 600 | 33.8k | { \ | 601 | 33.8k | int c = 8 - my, d = my; \ | 602 | 33.8k | int x, y; \ | 603 | 305k | for (y = 0; y < h; y++) { \ | 604 | 2.44M | for (x = 0; x < SIZE; x++) \ | 605 | 2.17M | dst[x] = (c * src[x] + d * src[x + sstride] + 4) >> 3; \ | 606 | 271k | dst += dstride; \ | 607 | 271k | src += sstride; \ | 608 | 271k | } \ | 609 | 33.8k | } \ |
vp8dsp.c:put_vp8_bilinear4_v_c Line | Count | Source | 599 | 73.6k | int h, int mx, int my) \ | 600 | 73.6k | { \ | 601 | 73.6k | int c = 8 - my, d = my; \ | 602 | 73.6k | int x, y; \ | 603 | 378k | for (y = 0; y < h; y++) { \ | 604 | 1.52M | for (x = 0; x < SIZE; x++) \ | 605 | 1.22M | dst[x] = (c * src[x] + d * src[x + sstride] + 4) >> 3; \ | 606 | 305k | dst += dstride; \ | 607 | 305k | src += sstride; \ | 608 | 305k | } \ | 609 | 73.6k | } \ |
|
610 | | \ |
611 | | static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, \ |
612 | | ptrdiff_t dstride, \ |
613 | | const uint8_t *src, \ |
614 | | ptrdiff_t sstride, \ |
615 | 182k | int h, int mx, int my) \ |
616 | 182k | { \ |
617 | 182k | int a = 8 - mx, b = mx; \ |
618 | 182k | int c = 8 - my, d = my; \ |
619 | 182k | int x, y; \ |
620 | 182k | uint8_t tmp_array[(2 * SIZE + 1) * SIZE]; \ |
621 | 182k | uint8_t *tmp = tmp_array; \ |
622 | 1.55M | for (y = 0; y < h + 1; y++) { \ |
623 | 12.3M | for (x = 0; x < SIZE; x++) \ |
624 | 11.0M | tmp[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ |
625 | 1.36M | tmp += SIZE; \ |
626 | 1.36M | src += sstride; \ |
627 | 1.36M | } \ |
628 | 182k | tmp = tmp_array; \ |
629 | 1.36M | for (y = 0; y < h; y++) { \ |
630 | 11.0M | for (x = 0; x < SIZE; x++) \ |
631 | 9.85M | dst[x] = (c * tmp[x] + d * tmp[x + SIZE] + 4) >> 3; \ |
632 | 1.18M | dst += dstride; \ |
633 | 1.18M | tmp += SIZE; \ |
634 | 1.18M | } \ |
635 | 182k | } vp8dsp.c:put_vp8_bilinear16_hv_c Line | Count | Source | 615 | 19.5k | int h, int mx, int my) \ | 616 | 19.5k | { \ | 617 | 19.5k | int a = 8 - mx, b = mx; \ | 618 | 19.5k | int c = 8 - my, d = my; \ | 619 | 19.5k | int x, y; \ | 620 | 19.5k | uint8_t tmp_array[(2 * SIZE + 1) * SIZE]; \ | 621 | 19.5k | uint8_t *tmp = tmp_array; \ | 622 | 317k | for (y = 0; y < h + 1; y++) { \ | 623 | 5.05M | for (x = 0; x < SIZE; x++) \ | 624 | 4.76M | tmp[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | 625 | 297k | tmp += SIZE; \ | 626 | 297k | src += sstride; \ | 627 | 297k | } \ | 628 | 19.5k | tmp = tmp_array; \ | 629 | 297k | for (y = 0; y < h; y++) { \ | 630 | 4.72M | for (x = 0; x < SIZE; x++) \ | 631 | 4.44M | dst[x] = (c * tmp[x] + d * tmp[x + SIZE] + 4) >> 3; \ | 632 | 277k | dst += dstride; \ | 633 | 277k | tmp += SIZE; \ | 634 | 277k | } \ | 635 | 19.5k | } |
vp8dsp.c:put_vp8_bilinear8_hv_c Line | Count | Source | 615 | 53.7k | int h, int mx, int my) \ | 616 | 53.7k | { \ | 617 | 53.7k | int a = 8 - mx, b = mx; \ | 618 | 53.7k | int c = 8 - my, d = my; \ | 619 | 53.7k | int x, y; \ | 620 | 53.7k | uint8_t tmp_array[(2 * SIZE + 1) * SIZE]; \ | 621 | 53.7k | uint8_t *tmp = tmp_array; \ | 622 | 549k | for (y = 0; y < h + 1; y++) { \ | 623 | 4.46M | for (x = 0; x < SIZE; x++) \ | 624 | 3.96M | tmp[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | 625 | 495k | tmp += SIZE; \ | 626 | 495k | src += sstride; \ | 627 | 495k | } \ | 628 | 53.7k | tmp = tmp_array; \ | 629 | 495k | for (y = 0; y < h; y++) { \ | 630 | 3.97M | for (x = 0; x < SIZE; x++) \ | 631 | 3.53M | dst[x] = (c * tmp[x] + d * tmp[x + SIZE] + 4) >> 3; \ | 632 | 442k | dst += dstride; \ | 633 | 442k | tmp += SIZE; \ | 634 | 442k | } \ | 635 | 53.7k | } |
vp8dsp.c:put_vp8_bilinear4_hv_c Line | Count | Source | 615 | 108k | int h, int mx, int my) \ | 616 | 108k | { \ | 617 | 108k | int a = 8 - mx, b = mx; \ | 618 | 108k | int c = 8 - my, d = my; \ | 619 | 108k | int x, y; \ | 620 | 108k | uint8_t tmp_array[(2 * SIZE + 1) * SIZE]; \ | 621 | 108k | uint8_t *tmp = tmp_array; \ | 622 | 683k | for (y = 0; y < h + 1; y++) { \ | 623 | 2.87M | for (x = 0; x < SIZE; x++) \ | 624 | 2.30M | tmp[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \ | 625 | 575k | tmp += SIZE; \ | 626 | 575k | src += sstride; \ | 627 | 575k | } \ | 628 | 108k | tmp = tmp_array; \ | 629 | 575k | for (y = 0; y < h; y++) { \ | 630 | 2.33M | for (x = 0; x < SIZE; x++) \ | 631 | 1.86M | dst[x] = (c * tmp[x] + d * tmp[x + SIZE] + 4) >> 3; \ | 632 | 466k | dst += dstride; \ | 633 | 466k | tmp += SIZE; \ | 634 | 466k | } \ | 635 | 108k | } |
|
636 | | |
637 | | VP8_BILINEAR(16) |
638 | | VP8_BILINEAR(8) |
639 | | VP8_BILINEAR(4) |
640 | | |
641 | | #define VP78_MC_FUNC(IDX, SIZE) \ |
642 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \ |
643 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \ |
644 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \ |
645 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \ |
646 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \ |
647 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \ |
648 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \ |
649 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \ |
650 | 43.4k | dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c |
651 | | |
652 | | #define VP78_BILINEAR_MC_FUNC(IDX, SIZE) \ |
653 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \ |
654 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \ |
655 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \ |
656 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \ |
657 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \ |
658 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \ |
659 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \ |
660 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \ |
661 | 65.1k | dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c |
662 | | |
663 | | av_cold void ff_vp78dsp_init(VP8DSPContext *dsp) |
664 | 21.7k | { |
665 | 21.7k | dsp->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_c; |
666 | 21.7k | dsp->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_c; |
667 | 21.7k | dsp->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_c; |
668 | 21.7k | dsp->put_vp8_epel_pixels_tab[0][2][2] = put_vp8_epel16_h6v6_c; |
669 | | |
670 | 21.7k | VP78_MC_FUNC(1, 8); |
671 | 21.7k | VP78_MC_FUNC(2, 4); |
672 | | |
673 | 21.7k | VP78_BILINEAR_MC_FUNC(0, 16); |
674 | 21.7k | VP78_BILINEAR_MC_FUNC(1, 8); |
675 | 21.7k | VP78_BILINEAR_MC_FUNC(2, 4); |
676 | | |
677 | | #if ARCH_AARCH64 |
678 | | ff_vp78dsp_init_aarch64(dsp); |
679 | | #elif ARCH_ARM |
680 | | ff_vp78dsp_init_arm(dsp); |
681 | | #elif ARCH_PPC |
682 | | ff_vp78dsp_init_ppc(dsp); |
683 | | #elif ARCH_RISCV |
684 | | ff_vp78dsp_init_riscv(dsp); |
685 | | #elif ARCH_X86 && HAVE_X86ASM |
686 | | ff_vp78dsp_init_x86(dsp); |
687 | | #endif |
688 | 21.7k | } |
689 | | |
690 | | #if CONFIG_VP7_DECODER |
691 | | LOOP_FILTERS(vp7) |
692 | | |
693 | | av_cold void ff_vp7dsp_init(VP8DSPContext *dsp) |
694 | 7.04k | { |
695 | 7.04k | dsp->vp8_luma_dc_wht = vp7_luma_dc_wht_c; |
696 | 7.04k | dsp->vp8_luma_dc_wht_dc = vp7_luma_dc_wht_dc_c; |
697 | 7.04k | dsp->vp8_idct_add = vp7_idct_add_c; |
698 | 7.04k | dsp->vp8_idct_dc_add = vp7_idct_dc_add_c; |
699 | 7.04k | dsp->vp8_idct_dc_add4y = vp7_idct_dc_add4y_c; |
700 | 7.04k | dsp->vp8_idct_dc_add4uv = vp7_idct_dc_add4uv_c; |
701 | | |
702 | 7.04k | dsp->vp8_v_loop_filter16y = vp7_v_loop_filter16_c; |
703 | 7.04k | dsp->vp8_h_loop_filter16y = vp7_h_loop_filter16_c; |
704 | 7.04k | dsp->vp8_v_loop_filter8uv = vp7_v_loop_filter8uv_c; |
705 | 7.04k | dsp->vp8_h_loop_filter8uv = vp7_h_loop_filter8uv_c; |
706 | | |
707 | 7.04k | dsp->vp8_v_loop_filter16y_inner = vp7_v_loop_filter16_inner_c; |
708 | 7.04k | dsp->vp8_h_loop_filter16y_inner = vp7_h_loop_filter16_inner_c; |
709 | 7.04k | dsp->vp8_v_loop_filter8uv_inner = vp7_v_loop_filter8uv_inner_c; |
710 | 7.04k | dsp->vp8_h_loop_filter8uv_inner = vp7_h_loop_filter8uv_inner_c; |
711 | | |
712 | 7.04k | dsp->vp8_v_loop_filter_simple = vp7_v_loop_filter_simple_c; |
713 | 7.04k | dsp->vp8_h_loop_filter_simple = vp7_h_loop_filter_simple_c; |
714 | | |
715 | | #if ARCH_RISCV |
716 | | ff_vp7dsp_init_riscv(dsp); |
717 | | #endif |
718 | 7.04k | } |
719 | | #endif /* CONFIG_VP7_DECODER */ |
720 | | |
721 | | #if CONFIG_VP8_DECODER |
722 | | LOOP_FILTERS(vp8) |
723 | | |
724 | | av_cold void ff_vp8dsp_init(VP8DSPContext *dsp) |
725 | 14.6k | { |
726 | 14.6k | dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c; |
727 | 14.6k | dsp->vp8_luma_dc_wht_dc = vp8_luma_dc_wht_dc_c; |
728 | 14.6k | dsp->vp8_idct_add = vp8_idct_add_c; |
729 | 14.6k | dsp->vp8_idct_dc_add = vp8_idct_dc_add_c; |
730 | 14.6k | dsp->vp8_idct_dc_add4y = vp8_idct_dc_add4y_c; |
731 | 14.6k | dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c; |
732 | | |
733 | 14.6k | dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c; |
734 | 14.6k | dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c; |
735 | 14.6k | dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c; |
736 | 14.6k | dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c; |
737 | | |
738 | 14.6k | dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c; |
739 | 14.6k | dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c; |
740 | 14.6k | dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c; |
741 | 14.6k | dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c; |
742 | | |
743 | 14.6k | dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c; |
744 | 14.6k | dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c; |
745 | | |
746 | | #if ARCH_AARCH64 |
747 | | ff_vp8dsp_init_aarch64(dsp); |
748 | | #elif ARCH_ARM |
749 | | ff_vp8dsp_init_arm(dsp); |
750 | | #elif ARCH_RISCV |
751 | | ff_vp8dsp_init_riscv(dsp); |
752 | | #elif ARCH_X86 && HAVE_X86ASM |
753 | | ff_vp8dsp_init_x86(dsp); |
754 | | #elif ARCH_MIPS |
755 | | ff_vp8dsp_init_mips(dsp); |
756 | | #elif ARCH_LOONGARCH |
757 | | ff_vp8dsp_init_loongarch(dsp); |
758 | | #endif |
759 | 14.6k | } |
760 | | #endif /* CONFIG_VP8_DECODER */ |