Coverage Report

Created: 2026-07-16 06:32

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/dav1d/src/mc_tmpl.c
Line
Count
Source
1
/*
2
 * Copyright © 2018, VideoLAN and dav1d authors
3
 * Copyright © 2018, Two Orioles, LLC
4
 * All rights reserved.
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions are met:
8
 *
9
 * 1. Redistributions of source code must retain the above copyright notice, this
10
 *    list of conditions and the following disclaimer.
11
 *
12
 * 2. Redistributions in binary form must reproduce the above copyright notice,
13
 *    this list of conditions and the following disclaimer in the documentation
14
 *    and/or other materials provided with the distribution.
15
 *
16
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 */
27
28
#include "config.h"
29
30
#include <stdlib.h>
31
#include <string.h>
32
33
#include "common/attributes.h"
34
#include "common/intops.h"
35
36
#include "src/mc.h"
37
#include "src/tables.h"
38
39
#if BITDEPTH == 8
40
1.83M
#define get_intermediate_bits(bitdepth_max) 4
41
// Output in interval [-5132, 9212], fits in int16_t as is
42
158M
#define PREP_BIAS 0
43
#else
44
// 4 for 10 bits/component, 2 for 12 bits/component
45
#define get_intermediate_bits(bitdepth_max) (14 - bitdepth_from_max(bitdepth_max))
46
// Output in interval [-20588, 36956] (10-bit), [-20602, 36983] (12-bit)
47
// Subtract a bias to ensure the output fits in int16_t
48
#define PREP_BIAS 8192
49
#endif
50
51
static NOINLINE void
52
put_c(pixel *dst, const ptrdiff_t dst_stride,
53
      const pixel *src, const ptrdiff_t src_stride, const int w, int h)
54
496k
{
55
8.91M
    do {
56
8.91M
        pixel_copy(dst, src, w);
57
58
8.91M
        dst += dst_stride;
59
8.91M
        src += src_stride;
60
8.91M
    } while (--h);
61
496k
}
62
63
static NOINLINE void
64
prep_c(int16_t *tmp, const pixel *src, const ptrdiff_t src_stride,
65
       const int w, int h HIGHBD_DECL_SUFFIX)
66
72.5k
{
67
72.5k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
68
1.85M
    do {
69
71.0M
        for (int x = 0; x < w; x++)
70
69.1M
            tmp[x] = (src[x] << intermediate_bits) - PREP_BIAS;
71
72
1.85M
        tmp += w;
73
1.85M
        src += src_stride;
74
1.85M
    } while (--h);
75
72.5k
}
76
77
#define FILTER_8TAP(src, x, F, stride) \
78
233M
    (F[0] * src[x + -3 * stride] + \
79
233M
     F[1] * src[x + -2 * stride] + \
80
233M
     F[2] * src[x + -1 * stride] + \
81
233M
     F[3] * src[x + +0 * stride] + \
82
233M
     F[4] * src[x + +1 * stride] + \
83
233M
     F[5] * src[x + +2 * stride] + \
84
233M
     F[6] * src[x + +3 * stride] + \
85
233M
     F[7] * src[x + +4 * stride])
86
87
#define FILTER_8TAP2(src, x, F) \
88
161M
    (F[0] * src[0][x] + \
89
161M
     F[1] * src[1][x] + \
90
161M
     F[2] * src[2][x] + \
91
161M
     F[3] * src[3][x] + \
92
161M
     F[4] * src[4][x] + \
93
161M
     F[5] * src[5][x] + \
94
161M
     F[6] * src[6][x] + \
95
161M
     F[7] * src[7][x])
96
97
#define DAV1D_FILTER_8TAP_RND(src, x, F, stride, sh) \
98
212M
    ((FILTER_8TAP(src, x, F, stride) + ((1 << (sh)) >> 1)) >> (sh))
99
100
#define DAV1D_FILTER_8TAP_RND2(src, x, F, stride, rnd, sh) \
101
21.7M
    ((FILTER_8TAP(src, x, F, stride) + (rnd)) >> (sh))
102
103
#define DAV1D_FILTER_8TAP_RND3(src, x, F, sh) \
104
161M
    ((FILTER_8TAP2(src, x, F) + ((1 << (sh)) >> 1)) >> (sh))
105
106
#define DAV1D_FILTER_8TAP_CLIP(src, x, F, stride, sh) \
107
41.5M
    iclip_pixel(DAV1D_FILTER_8TAP_RND(src, x, F, stride, sh))
108
109
#define DAV1D_FILTER_8TAP_CLIP2(src, x, F, stride, rnd, sh) \
110
21.7M
    iclip_pixel(DAV1D_FILTER_8TAP_RND2(src, x, F, stride, rnd, sh))
111
112
#define DAV1D_FILTER_8TAP_CLIP3(src, x, F, sh) \
113
115M
    iclip_pixel(DAV1D_FILTER_8TAP_RND3(src, x, F, sh))
114
115
#define GET_H_FILTER(mx) \
116
112M
    const int8_t *const fh = !(mx) ? NULL : w > 4 ? \
117
102M
        dav1d_mc_subpel_filters[filter_type & 3][(mx) - 1] : \
118
102M
        dav1d_mc_subpel_filters[3 + (filter_type & 1)][(mx) - 1]
119
120
#define GET_V_FILTER(my) \
121
6.05M
    const int8_t *const fv = !(my) ? NULL : h > 4 ? \
122
4.86M
        dav1d_mc_subpel_filters[filter_type >> 2][(my) - 1] : \
123
4.86M
        dav1d_mc_subpel_filters[3 + ((filter_type >> 2) & 1)][(my) - 1]
124
125
#define GET_FILTERS() \
126
540k
    GET_H_FILTER(mx); \
127
540k
    GET_V_FILTER(my)
128
129
static NOINLINE void
130
put_8tap_c(pixel *dst, ptrdiff_t dst_stride,
131
           const pixel *src, ptrdiff_t src_stride,
132
           const int w, int h, const int mx, const int my,
133
           const int filter_type HIGHBD_DECL_SUFFIX)
134
430k
{
135
430k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
136
430k
    const int intermediate_rnd = 32 + ((1 << (6 - intermediate_bits)) >> 1);
137
138
430k
    GET_FILTERS();
139
430k
    dst_stride = PXSTRIDE(dst_stride);
140
430k
    src_stride = PXSTRIDE(src_stride);
141
142
430k
    if (fh) {
143
158k
        if (fv) {
144
90.9k
            int tmp_h = h + 7;
145
90.9k
            int16_t mid[128 * 135], *mid_ptr = mid;
146
147
90.9k
            src -= src_stride * 3;
148
1.66M
            do {
149
40.7M
                for (int x = 0; x < w; x++)
150
39.0M
                    mid_ptr[x] = DAV1D_FILTER_8TAP_RND(src, x, fh, 1,
151
1.66M
                                                       6 - intermediate_bits);
152
153
1.66M
                mid_ptr += 128;
154
1.66M
                src += src_stride;
155
1.66M
            } while (--tmp_h);
156
157
90.9k
            mid_ptr = mid + 128 * 3;
158
1.05M
            do {
159
31.1M
                for (int x = 0; x < w; x++)
160
30.0M
                    dst[x] = DAV1D_FILTER_8TAP_CLIP(mid_ptr, x, fv, 128,
161
1.05M
                                                    6 + intermediate_bits);
162
163
1.05M
                mid_ptr += 128;
164
1.05M
                dst += dst_stride;
165
1.05M
            } while (--h);
166
90.9k
        } else {
167
770k
            do {
168
22.5M
                for (int x = 0; x < w; x++) {
169
21.7M
                    dst[x] = DAV1D_FILTER_8TAP_CLIP2(src, x, fh, 1,
170
21.7M
                                                     intermediate_rnd, 6);
171
21.7M
                }
172
173
770k
                dst += dst_stride;
174
770k
                src += src_stride;
175
770k
            } while (--h);
176
67.3k
        }
177
272k
    } else if (fv) {
178
448k
        do {
179
11.8M
            for (int x = 0; x < w; x++)
180
11.4M
                dst[x] = DAV1D_FILTER_8TAP_CLIP(src, x, fv, src_stride, 6);
181
182
448k
            dst += dst_stride;
183
448k
            src += src_stride;
184
448k
        } while (--h);
185
41.0k
    } else
186
231k
        put_c(dst, dst_stride, src, src_stride, w, h);
187
430k
}
188
189
static NOINLINE void
190
put_8tap_scaled_c(pixel *dst, const ptrdiff_t dst_stride,
191
                  const pixel *src, ptrdiff_t src_stride,
192
                  const int w, int h, const int mx, int my,
193
                  const int dx, const int dy, const int filter_type
194
                  HIGHBD_DECL_SUFFIX)
195
226k
{
196
226k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
197
226k
    const int intermediate_rnd = (1 << intermediate_bits) >> 1;
198
226k
    int16_t mid[128 * 8];
199
226k
    int16_t *mid_ptrs[8];
200
226k
    int in_y = -8;
201
226k
    src_stride = PXSTRIDE(src_stride);
202
203
2.03M
    for (int i = 0; i < 8; i++)
204
1.80M
        mid_ptrs[i] = &mid[128 * i];
205
206
226k
    src -= src_stride * 3;
207
208
3.80M
    for (int y = 0; y < h; y++) {
209
3.57M
        int x;
210
3.57M
        int src_y = my >> 10;
211
3.57M
        GET_V_FILTER((my & 0x3ff) >> 6);
212
213
6.67M
        while (in_y < src_y) {
214
3.09M
            int imx = mx, ioff = 0;
215
3.09M
            int16_t *mid_ptr = mid_ptrs[0];
216
217
24.7M
            for (int i = 0; i < 7; i++)
218
21.6M
                mid_ptrs[i] = mid_ptrs[i + 1];
219
3.09M
            mid_ptrs[7] = mid_ptr;
220
221
82.6M
            for (x = 0; x < w; x++) {
222
79.5M
                GET_H_FILTER(imx >> 6);
223
79.5M
                mid_ptr[x] = fh ? DAV1D_FILTER_8TAP_RND(src, ioff, fh, 1,
224
79.5M
                                                        6 - intermediate_bits) :
225
79.5M
                                  src[ioff] << intermediate_bits;
226
79.5M
                imx += dx;
227
79.5M
                ioff += imx >> 10;
228
79.5M
                imx &= 0x3ff;
229
79.5M
            }
230
231
3.09M
            src += src_stride;
232
3.09M
            in_y++;
233
3.09M
        }
234
235
135M
        for (x = 0; x < w; x++)
236
131M
            dst[x] = fv ? DAV1D_FILTER_8TAP_CLIP3(mid_ptrs, x, fv,
237
131M
                                                  6 + intermediate_bits) :
238
131M
                          iclip_pixel((mid_ptrs[3][x] + intermediate_rnd) >>
239
16.2M
                                              intermediate_bits);
240
241
3.57M
        my += dy;
242
3.57M
        dst += PXSTRIDE(dst_stride);
243
3.57M
    }
244
226k
}
245
246
static NOINLINE void
247
prep_8tap_c(int16_t *tmp, const pixel *src, ptrdiff_t src_stride,
248
            const int w, int h, const int mx, const int my,
249
            const int filter_type HIGHBD_DECL_SUFFIX)
250
109k
{
251
109k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
252
109k
    GET_FILTERS();
253
109k
    src_stride = PXSTRIDE(src_stride);
254
255
109k
    if (fh) {
256
33.7k
        if (fv) {
257
21.9k
            int tmp_h = h + 7;
258
21.9k
            int16_t mid[128 * 135], *mid_ptr = mid;
259
260
21.9k
            src -= src_stride * 3;
261
448k
            do {
262
9.69M
                for (int x = 0; x < w; x++)
263
9.24M
                    mid_ptr[x] = DAV1D_FILTER_8TAP_RND(src, x, fh, 1,
264
448k
                                                       6 - intermediate_bits);
265
266
448k
                mid_ptr += 128;
267
448k
                src += src_stride;
268
448k
            } while (--tmp_h);
269
270
21.9k
            mid_ptr = mid + 128 * 3;
271
295k
            do {
272
7.68M
                for (int x = 0; x < w; x++) {
273
7.38M
                    int t = DAV1D_FILTER_8TAP_RND(mid_ptr, x, fv, 128, 6) -
274
7.38M
                                  PREP_BIAS;
275
7.38M
                    assert(t >= INT16_MIN && t <= INT16_MAX);
276
7.38M
                    tmp[x] = t;
277
7.38M
                }
278
279
295k
                mid_ptr += 128;
280
295k
                tmp += w;
281
295k
            } while (--h);
282
21.9k
        } else {
283
227k
            do {
284
7.19M
                for (int x = 0; x < w; x++)
285
6.96M
                    tmp[x] = DAV1D_FILTER_8TAP_RND(src, x, fh, 1,
286
6.96M
                                                   6 - intermediate_bits) -
287
6.96M
                             PREP_BIAS;
288
289
227k
                tmp += w;
290
227k
                src += src_stride;
291
227k
            } while (--h);
292
11.8k
        }
293
75.2k
    } else if (fv) {
294
200k
        do {
295
5.75M
            for (int x = 0; x < w; x++)
296
5.55M
                tmp[x] = DAV1D_FILTER_8TAP_RND(src, x, fv, src_stride,
297
5.55M
                                               6 - intermediate_bits) -
298
5.55M
                         PREP_BIAS;
299
300
200k
            tmp += w;
301
200k
            src += src_stride;
302
200k
        } while (--h);
303
10.9k
    } else
304
64.2k
        prep_c(tmp, src, src_stride, w, h HIGHBD_TAIL_SUFFIX);
305
109k
}
306
307
static NOINLINE void
308
prep_8tap_scaled_c(int16_t *tmp, const pixel *src, ptrdiff_t src_stride,
309
                   const int w, int h, const int mx, int my,
310
                   const int dx, const int dy, const int filter_type
311
                   HIGHBD_DECL_SUFFIX)
312
90.6k
{
313
90.6k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
314
90.6k
    int16_t mid[128 * 8];
315
90.6k
    int16_t *mid_ptrs[8];
316
90.6k
    int in_y = -8;
317
90.6k
    src_stride = PXSTRIDE(src_stride);
318
319
816k
    for (int i = 0; i < 8; i++)
320
725k
        mid_ptrs[i] = &mid[128 * i];
321
322
90.6k
    src -= src_stride * 3;
323
324
2.02M
    for (int y = 0; y < h; y++) {
325
1.93M
        int x;
326
1.93M
        int src_y = my >> 10;
327
1.93M
        GET_V_FILTER((my & 0x3ff) >> 6);
328
329
3.36M
        while (in_y < src_y) {
330
1.42M
            int imx = mx, ioff = 0;
331
1.42M
            int16_t *mid_ptr = mid_ptrs[0];
332
333
11.4M
            for (int i = 0; i < 7; i++)
334
10.0M
                mid_ptrs[i] = mid_ptrs[i + 1];
335
1.42M
            mid_ptrs[7] = mid_ptr;
336
337
33.6M
            for (x = 0; x < w; x++) {
338
32.1M
                GET_H_FILTER(imx >> 6);
339
32.1M
                mid_ptr[x] = fh ? DAV1D_FILTER_8TAP_RND(src, ioff, fh, 1,
340
32.1M
                                                        6 - intermediate_bits) :
341
32.1M
                                  src[ioff] << intermediate_bits;
342
32.1M
                imx += dx;
343
32.1M
                ioff += imx >> 10;
344
32.1M
                imx &= 0x3ff;
345
32.1M
            }
346
347
1.42M
            src += src_stride;
348
1.42M
            in_y++;
349
1.42M
        }
350
351
56.1M
        for (x = 0; x < w; x++)
352
54.2M
            tmp[x] = (fv ? DAV1D_FILTER_8TAP_RND3(mid_ptrs, x, fv, 6)
353
54.2M
                         : mid_ptrs[3][x]) - PREP_BIAS;
354
355
1.93M
        my += dy;
356
1.93M
        tmp += w;
357
1.93M
    }
358
90.6k
}
359
360
#define filter_fns(type, type_h, type_v) \
361
static void put_8tap_##type##_c(pixel *const dst, \
362
                                const ptrdiff_t dst_stride, \
363
                                const pixel *const src, \
364
                                const ptrdiff_t src_stride, \
365
                                const int w, const int h, \
366
                                const int mx, const int my \
367
430k
                                HIGHBD_DECL_SUFFIX) \
368
430k
{ \
369
430k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
430k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
430k
} \
mc_tmpl.c:put_8tap_regular_c
Line
Count
Source
367
315k
                                HIGHBD_DECL_SUFFIX) \
368
315k
{ \
369
315k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
315k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
315k
} \
mc_tmpl.c:put_8tap_regular_smooth_c
Line
Count
Source
367
9.54k
                                HIGHBD_DECL_SUFFIX) \
368
9.54k
{ \
369
9.54k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
9.54k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
9.54k
} \
mc_tmpl.c:put_8tap_regular_sharp_c
Line
Count
Source
367
1.58k
                                HIGHBD_DECL_SUFFIX) \
368
1.58k
{ \
369
1.58k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
1.58k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
1.58k
} \
mc_tmpl.c:put_8tap_sharp_regular_c
Line
Count
Source
367
1.29k
                                HIGHBD_DECL_SUFFIX) \
368
1.29k
{ \
369
1.29k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
1.29k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
1.29k
} \
mc_tmpl.c:put_8tap_sharp_smooth_c
Line
Count
Source
367
970
                                HIGHBD_DECL_SUFFIX) \
368
970
{ \
369
970
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
970
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
970
} \
mc_tmpl.c:put_8tap_sharp_c
Line
Count
Source
367
16.6k
                                HIGHBD_DECL_SUFFIX) \
368
16.6k
{ \
369
16.6k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
16.6k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
16.6k
} \
mc_tmpl.c:put_8tap_smooth_regular_c
Line
Count
Source
367
9.84k
                                HIGHBD_DECL_SUFFIX) \
368
9.84k
{ \
369
9.84k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
9.84k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
9.84k
} \
mc_tmpl.c:put_8tap_smooth_c
Line
Count
Source
367
74.9k
                                HIGHBD_DECL_SUFFIX) \
368
74.9k
{ \
369
74.9k
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
74.9k
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
74.9k
} \
mc_tmpl.c:put_8tap_smooth_sharp_c
Line
Count
Source
367
931
                                HIGHBD_DECL_SUFFIX) \
368
931
{ \
369
931
    put_8tap_c(dst, dst_stride, src, src_stride, w, h, mx, my, \
370
931
               type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
371
931
} \
372
static void put_8tap_##type##_scaled_c(pixel *const dst, \
373
                                       const ptrdiff_t dst_stride, \
374
                                       const pixel *const src, \
375
                                       const ptrdiff_t src_stride, \
376
                                       const int w, const int h, \
377
                                       const int mx, const int my, \
378
                                       const int dx, const int dy \
379
226k
                                       HIGHBD_DECL_SUFFIX) \
380
226k
{ \
381
226k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
226k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
226k
} \
mc_tmpl.c:put_8tap_regular_scaled_c
Line
Count
Source
379
139k
                                       HIGHBD_DECL_SUFFIX) \
380
139k
{ \
381
139k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
139k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
139k
} \
mc_tmpl.c:put_8tap_regular_smooth_scaled_c
Line
Count
Source
379
5.70k
                                       HIGHBD_DECL_SUFFIX) \
380
5.70k
{ \
381
5.70k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
5.70k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
5.70k
} \
mc_tmpl.c:put_8tap_regular_sharp_scaled_c
Line
Count
Source
379
2.63k
                                       HIGHBD_DECL_SUFFIX) \
380
2.63k
{ \
381
2.63k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
2.63k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
2.63k
} \
mc_tmpl.c:put_8tap_sharp_regular_scaled_c
Line
Count
Source
379
2.69k
                                       HIGHBD_DECL_SUFFIX) \
380
2.69k
{ \
381
2.69k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
2.69k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
2.69k
} \
mc_tmpl.c:put_8tap_sharp_smooth_scaled_c
Line
Count
Source
379
1.45k
                                       HIGHBD_DECL_SUFFIX) \
380
1.45k
{ \
381
1.45k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
1.45k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
1.45k
} \
mc_tmpl.c:put_8tap_sharp_scaled_c
Line
Count
Source
379
25.0k
                                       HIGHBD_DECL_SUFFIX) \
380
25.0k
{ \
381
25.0k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
25.0k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
25.0k
} \
mc_tmpl.c:put_8tap_smooth_regular_scaled_c
Line
Count
Source
379
9.81k
                                       HIGHBD_DECL_SUFFIX) \
380
9.81k
{ \
381
9.81k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
9.81k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
9.81k
} \
mc_tmpl.c:put_8tap_smooth_scaled_c
Line
Count
Source
379
38.0k
                                       HIGHBD_DECL_SUFFIX) \
380
38.0k
{ \
381
38.0k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
38.0k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
38.0k
} \
mc_tmpl.c:put_8tap_smooth_sharp_scaled_c
Line
Count
Source
379
1.54k
                                       HIGHBD_DECL_SUFFIX) \
380
1.54k
{ \
381
1.54k
    put_8tap_scaled_c(dst, dst_stride, src, src_stride, w, h, mx, my, dx, dy, \
382
1.54k
                      type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
383
1.54k
} \
384
static void prep_8tap_##type##_c(int16_t *const tmp, \
385
                                 const pixel *const src, \
386
                                 const ptrdiff_t src_stride, \
387
                                 const int w, const int h, \
388
                                 const int mx, const int my \
389
109k
                                 HIGHBD_DECL_SUFFIX) \
390
109k
{ \
391
109k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
109k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
109k
} \
mc_tmpl.c:prep_8tap_regular_c
Line
Count
Source
389
53.4k
                                 HIGHBD_DECL_SUFFIX) \
390
53.4k
{ \
391
53.4k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
53.4k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
53.4k
} \
mc_tmpl.c:prep_8tap_regular_smooth_c
Line
Count
Source
389
1.22k
                                 HIGHBD_DECL_SUFFIX) \
390
1.22k
{ \
391
1.22k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
1.22k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
1.22k
} \
mc_tmpl.c:prep_8tap_regular_sharp_c
Line
Count
Source
389
2.34k
                                 HIGHBD_DECL_SUFFIX) \
390
2.34k
{ \
391
2.34k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
2.34k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
2.34k
} \
mc_tmpl.c:prep_8tap_sharp_regular_c
Line
Count
Source
389
3.81k
                                 HIGHBD_DECL_SUFFIX) \
390
3.81k
{ \
391
3.81k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
3.81k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
3.81k
} \
mc_tmpl.c:prep_8tap_sharp_smooth_c
Line
Count
Source
389
2.00k
                                 HIGHBD_DECL_SUFFIX) \
390
2.00k
{ \
391
2.00k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
2.00k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
2.00k
} \
mc_tmpl.c:prep_8tap_sharp_c
Line
Count
Source
389
8.94k
                                 HIGHBD_DECL_SUFFIX) \
390
8.94k
{ \
391
8.94k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
8.94k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
8.94k
} \
mc_tmpl.c:prep_8tap_smooth_regular_c
Line
Count
Source
389
2.29k
                                 HIGHBD_DECL_SUFFIX) \
390
2.29k
{ \
391
2.29k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
2.29k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
2.29k
} \
mc_tmpl.c:prep_8tap_smooth_c
Line
Count
Source
389
33.9k
                                 HIGHBD_DECL_SUFFIX) \
390
33.9k
{ \
391
33.9k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
33.9k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
33.9k
} \
mc_tmpl.c:prep_8tap_smooth_sharp_c
Line
Count
Source
389
1.05k
                                 HIGHBD_DECL_SUFFIX) \
390
1.05k
{ \
391
1.05k
    prep_8tap_c(tmp, src, src_stride, w, h, mx, my, \
392
1.05k
                type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
393
1.05k
} \
394
static void prep_8tap_##type##_scaled_c(int16_t *const tmp, \
395
                                        const pixel *const src, \
396
                                        const ptrdiff_t src_stride, \
397
                                        const int w, const int h, \
398
                                        const int mx, const int my, \
399
                                        const int dx, const int dy \
400
90.6k
                                        HIGHBD_DECL_SUFFIX) \
401
90.6k
{ \
402
90.6k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
90.6k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
90.6k
}
mc_tmpl.c:prep_8tap_regular_scaled_c
Line
Count
Source
400
34.8k
                                        HIGHBD_DECL_SUFFIX) \
401
34.8k
{ \
402
34.8k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
34.8k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
34.8k
}
mc_tmpl.c:prep_8tap_regular_smooth_scaled_c
Line
Count
Source
400
3.44k
                                        HIGHBD_DECL_SUFFIX) \
401
3.44k
{ \
402
3.44k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
3.44k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
3.44k
}
mc_tmpl.c:prep_8tap_regular_sharp_scaled_c
Line
Count
Source
400
7.11k
                                        HIGHBD_DECL_SUFFIX) \
401
7.11k
{ \
402
7.11k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
7.11k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
7.11k
}
mc_tmpl.c:prep_8tap_sharp_regular_scaled_c
Line
Count
Source
400
6.37k
                                        HIGHBD_DECL_SUFFIX) \
401
6.37k
{ \
402
6.37k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
6.37k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
6.37k
}
mc_tmpl.c:prep_8tap_sharp_smooth_scaled_c
Line
Count
Source
400
2.60k
                                        HIGHBD_DECL_SUFFIX) \
401
2.60k
{ \
402
2.60k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
2.60k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
2.60k
}
mc_tmpl.c:prep_8tap_sharp_scaled_c
Line
Count
Source
400
9.69k
                                        HIGHBD_DECL_SUFFIX) \
401
9.69k
{ \
402
9.69k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
9.69k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
9.69k
}
mc_tmpl.c:prep_8tap_smooth_regular_scaled_c
Line
Count
Source
400
5.60k
                                        HIGHBD_DECL_SUFFIX) \
401
5.60k
{ \
402
5.60k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
5.60k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
5.60k
}
mc_tmpl.c:prep_8tap_smooth_scaled_c
Line
Count
Source
400
18.1k
                                        HIGHBD_DECL_SUFFIX) \
401
18.1k
{ \
402
18.1k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
18.1k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
18.1k
}
mc_tmpl.c:prep_8tap_smooth_sharp_scaled_c
Line
Count
Source
400
2.83k
                                        HIGHBD_DECL_SUFFIX) \
401
2.83k
{ \
402
2.83k
    prep_8tap_scaled_c(tmp, src, src_stride, w, h, mx, my, dx, dy, \
403
2.83k
                       type_h | (type_v << 2) HIGHBD_TAIL_SUFFIX); \
404
2.83k
}
405
406
filter_fns(regular,        DAV1D_FILTER_8TAP_REGULAR, DAV1D_FILTER_8TAP_REGULAR)
407
filter_fns(regular_sharp,  DAV1D_FILTER_8TAP_REGULAR, DAV1D_FILTER_8TAP_SHARP)
408
filter_fns(regular_smooth, DAV1D_FILTER_8TAP_REGULAR, DAV1D_FILTER_8TAP_SMOOTH)
409
filter_fns(smooth,         DAV1D_FILTER_8TAP_SMOOTH,  DAV1D_FILTER_8TAP_SMOOTH)
410
filter_fns(smooth_regular, DAV1D_FILTER_8TAP_SMOOTH,  DAV1D_FILTER_8TAP_REGULAR)
411
filter_fns(smooth_sharp,   DAV1D_FILTER_8TAP_SMOOTH,  DAV1D_FILTER_8TAP_SHARP)
412
filter_fns(sharp,          DAV1D_FILTER_8TAP_SHARP,   DAV1D_FILTER_8TAP_SHARP)
413
filter_fns(sharp_regular,  DAV1D_FILTER_8TAP_SHARP,   DAV1D_FILTER_8TAP_REGULAR)
414
filter_fns(sharp_smooth,   DAV1D_FILTER_8TAP_SHARP,   DAV1D_FILTER_8TAP_SMOOTH)
415
416
#define FILTER_BILIN(src, x, mxy, stride) \
417
48.2M
    (16 * src[x] + ((mxy) * (src[x + stride] - src[x])))
418
419
#define FILTER_BILIN_RND(src, x, mxy, stride, sh) \
420
48.2M
    ((FILTER_BILIN(src, x, mxy, stride) + ((1 << (sh)) >> 1)) >> (sh))
421
422
#define FILTER_BILIN_CLIP(src, x, mxy, stride, sh) \
423
6.37M
    iclip_pixel(FILTER_BILIN_RND(src, x, mxy, stride, sh))
424
425
#define FILTER_BILIN2(src1, src2, x, mxy) \
426
27.9M
    (16 * src1[x] + ((mxy) * (src2[x] - src1[x])))
427
428
#define FILTER_BILIN_RND2(src1, src2, x, mxy, sh) \
429
27.9M
    ((FILTER_BILIN2(src1, src2, x, mxy) + ((1 << (sh)) >> 1)) >> (sh))
430
431
#define FILTER_BILIN_CLIP2(src1, src2, x, mxy, sh) \
432
22.2M
    iclip_pixel(FILTER_BILIN_RND2(src1, src2, x, mxy, sh))
433
434
static void put_bilin_c(pixel *dst, ptrdiff_t dst_stride,
435
                        const pixel *src, ptrdiff_t src_stride,
436
                        const int w, int h, const int mx, const int my
437
                        HIGHBD_DECL_SUFFIX)
438
334k
{
439
334k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
440
334k
    const int intermediate_rnd = (1 << intermediate_bits) >> 1;
441
334k
    dst_stride = PXSTRIDE(dst_stride);
442
334k
    src_stride = PXSTRIDE(src_stride);
443
444
334k
    if (mx) {
445
49.4k
        if (my) {
446
26.3k
            int16_t mid[128 * 129], *mid_ptr = mid;
447
26.3k
            int tmp_h = h + 1;
448
449
228k
            do {
450
3.26M
                for (int x = 0; x < w; x++)
451
3.03M
                    mid_ptr[x] = FILTER_BILIN_RND(src, x, mx, 1,
452
228k
                                                  4 - intermediate_bits);
453
454
228k
                mid_ptr += 128;
455
228k
                src += src_stride;
456
228k
            } while (--tmp_h);
457
458
26.3k
            mid_ptr = mid;
459
201k
            do {
460
3.03M
                for (int x = 0; x < w; x++)
461
2.83M
                    dst[x] = FILTER_BILIN_CLIP(mid_ptr, x, my, 128,
462
201k
                                               4 + intermediate_bits);
463
464
201k
                mid_ptr += 128;
465
201k
                dst += dst_stride;
466
201k
            } while (--h);
467
26.3k
        } else {
468
308k
            do {
469
10.8M
                for (int x = 0; x < w; x++) {
470
10.5M
                    const int px = FILTER_BILIN_RND(src, x, mx, 1,
471
10.5M
                                                    4 - intermediate_bits);
472
10.5M
                    dst[x] = iclip_pixel((px + intermediate_rnd) >> intermediate_bits);
473
10.5M
                }
474
475
308k
                dst += dst_stride;
476
308k
                src += src_stride;
477
308k
            } while (--h);
478
23.0k
        }
479
285k
    } else if (my) {
480
177k
        do {
481
3.72M
            for (int x = 0; x < w; x++)
482
3.54M
                dst[x] = FILTER_BILIN_CLIP(src, x, my, src_stride, 4);
483
484
177k
            dst += dst_stride;
485
177k
            src += src_stride;
486
177k
        } while (--h);
487
20.1k
    } else
488
264k
        put_c(dst, dst_stride, src, src_stride, w, h);
489
334k
}
490
491
static void put_bilin_scaled_c(pixel *dst, ptrdiff_t dst_stride,
492
                               const pixel *src, ptrdiff_t src_stride,
493
                               const int w, int h, const int mx, int my,
494
                               const int dx, const int dy
495
                               HIGHBD_DECL_SUFFIX)
496
72.4k
{
497
72.4k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
498
72.4k
    int16_t mid[128 * 2];
499
72.4k
    int in_y = -2;
500
501
951k
    do {
502
951k
        int x;
503
951k
        int y = my >> 10;
504
951k
        int16_t *mid1 = &mid[(y & 1) * 128];
505
951k
        int16_t *mid2 = &mid[((y + 1) & 1) * 128];
506
951k
        int dmy = my & 0x3ff;
507
508
1.63M
        while (in_y < y) {
509
681k
            int imx = mx, ioff = 0;
510
681k
            int16_t *mid_ptr = &mid[(in_y & 1) * 128];
511
512
16.9M
            for (x = 0; x < w; x++) {
513
16.2M
                mid_ptr[x] = FILTER_BILIN_RND(src, ioff, imx >> 6, 1,
514
16.2M
                                              4 - intermediate_bits);
515
16.2M
                imx += dx;
516
16.2M
                ioff += imx >> 10;
517
16.2M
                imx &= 0x3ff;
518
16.2M
            }
519
520
681k
            src += PXSTRIDE(src_stride);
521
681k
            in_y++;
522
681k
        }
523
524
23.2M
        for (x = 0; x < w; x++)
525
22.2M
            dst[x] = FILTER_BILIN_CLIP2(mid1, mid2, x, dmy >> 6,
526
951k
                                       4 + intermediate_bits);
527
528
951k
        my += dy;
529
951k
        dst += PXSTRIDE(dst_stride);
530
951k
    } while (--h);
531
72.4k
}
532
533
static void prep_bilin_c(int16_t *tmp,
534
                         const pixel *src, ptrdiff_t src_stride,
535
                         const int w, int h, const int mx, const int my
536
                         HIGHBD_DECL_SUFFIX)
537
28.0k
{
538
28.0k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
539
28.0k
    src_stride = PXSTRIDE(src_stride);
540
541
28.0k
    if (mx) {
542
15.3k
        if (my) {
543
10.8k
            int16_t mid[128 * 129], *mid_ptr = mid;
544
10.8k
            int tmp_h = h + 1;
545
546
136k
            do {
547
3.19M
                for (int x = 0; x < w; x++)
548
3.06M
                    mid_ptr[x] = FILTER_BILIN_RND(src, x, mx, 1,
549
136k
                                                  4 - intermediate_bits);
550
551
136k
                mid_ptr += 128;
552
136k
                src += src_stride;
553
136k
            } while (--tmp_h);
554
555
10.8k
            mid_ptr = mid;
556
126k
            do {
557
3.05M
                for (int x = 0; x < w; x++)
558
2.92M
                    tmp[x] = FILTER_BILIN_RND(mid_ptr, x, my, 128, 4) -
559
2.92M
                             PREP_BIAS;
560
561
126k
                mid_ptr += 128;
562
126k
                tmp += w;
563
126k
            } while (--h);
564
10.8k
        } else {
565
70.5k
            do {
566
1.94M
                for (int x = 0; x < w; x++)
567
1.87M
                    tmp[x] = FILTER_BILIN_RND(src, x, mx, 1,
568
1.87M
                                              4 - intermediate_bits) -
569
1.87M
                             PREP_BIAS;
570
571
70.5k
                tmp += w;
572
70.5k
                src += src_stride;
573
70.5k
            } while (--h);
574
4.52k
        }
575
15.3k
    } else if (my) {
576
61.2k
        do {
577
1.80M
            for (int x = 0; x < w; x++)
578
1.74M
                tmp[x] = FILTER_BILIN_RND(src, x, my, src_stride,
579
1.74M
                                          4 - intermediate_bits) - PREP_BIAS;
580
581
61.2k
            tmp += w;
582
61.2k
            src += src_stride;
583
61.2k
        } while (--h);
584
4.43k
    } else
585
8.29k
        prep_c(tmp, src, src_stride, w, h HIGHBD_TAIL_SUFFIX);
586
28.0k
}
587
588
static void prep_bilin_scaled_c(int16_t *tmp,
589
                                const pixel *src, ptrdiff_t src_stride,
590
                                const int w, int h, const int mx, int my,
591
                                const int dx, const int dy HIGHBD_DECL_SUFFIX)
592
10.5k
{
593
10.5k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
594
10.5k
    int16_t mid[128 * 2];
595
10.5k
    int in_y = -2;
596
597
209k
    do {
598
209k
        int x;
599
209k
        int y = my >> 10;
600
209k
        int16_t *mid1 = &mid[(y & 1) * 128];
601
209k
        int16_t *mid2 = &mid[((y + 1) & 1) * 128];
602
209k
        int dmy = my & 0x3ff;
603
604
295k
        while (in_y < y) {
605
86.4k
            int imx = mx, ioff = 0;
606
86.4k
            int16_t *mid_ptr = &mid[(in_y & 1) * 128];
607
608
2.54M
            for (x = 0; x < w; x++) {
609
2.45M
                mid_ptr[x] = FILTER_BILIN_RND(src, ioff, imx >> 6, 1,
610
2.45M
                                              4 - intermediate_bits);
611
2.45M
                imx += dx;
612
2.45M
                ioff += imx >> 10;
613
2.45M
                imx &= 0x3ff;
614
2.45M
            }
615
616
86.4k
            src += PXSTRIDE(src_stride);
617
86.4k
            in_y++;
618
86.4k
        }
619
620
5.89M
        for (x = 0; x < w; x++)
621
5.68M
            tmp[x] = FILTER_BILIN_RND2(mid1, mid2, x, dmy >> 6, 4) - PREP_BIAS;
622
623
209k
        my += dy;
624
209k
        tmp += w;
625
209k
    } while (--h);
626
10.5k
}
627
628
static void avg_c(pixel *dst, const ptrdiff_t dst_stride,
629
                  const int16_t *tmp1, const int16_t *tmp2, const int w, int h
630
                  HIGHBD_DECL_SUFFIX)
631
79.4k
{
632
79.4k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
633
79.4k
    const int sh = intermediate_bits + 1;
634
79.4k
    const int rnd = (1 << intermediate_bits) + PREP_BIAS * 2;
635
1.57M
    do {
636
47.7M
        for (int x = 0; x < w; x++)
637
46.1M
            dst[x] = iclip_pixel((tmp1[x] + tmp2[x] + rnd) >> sh);
638
639
1.57M
        tmp1 += w;
640
1.57M
        tmp2 += w;
641
1.57M
        dst += PXSTRIDE(dst_stride);
642
1.57M
    } while (--h);
643
79.4k
}
644
645
static void w_avg_c(pixel *dst, const ptrdiff_t dst_stride,
646
                    const int16_t *tmp1, const int16_t *tmp2, const int w, int h,
647
                    const int weight HIGHBD_DECL_SUFFIX)
648
17.2k
{
649
17.2k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
650
17.2k
    const int sh = intermediate_bits + 4;
651
17.2k
    const int rnd = (8 << intermediate_bits) + PREP_BIAS * 16;
652
321k
    do {
653
11.4M
        for (int x = 0; x < w; x++)
654
11.1M
            dst[x] = iclip_pixel((tmp1[x] * weight +
655
11.1M
                                  tmp2[x] * (16 - weight) + rnd) >> sh);
656
657
321k
        tmp1 += w;
658
321k
        tmp2 += w;
659
321k
        dst += PXSTRIDE(dst_stride);
660
321k
    } while (--h);
661
17.2k
}
662
663
static void mask_c(pixel *dst, const ptrdiff_t dst_stride,
664
                   const int16_t *tmp1, const int16_t *tmp2, const int w, int h,
665
                   const uint8_t *mask HIGHBD_DECL_SUFFIX)
666
20.5k
{
667
20.5k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
668
20.5k
    const int sh = intermediate_bits + 6;
669
20.5k
    const int rnd = (32 << intermediate_bits) + PREP_BIAS * 64;
670
358k
    do {
671
9.27M
        for (int x = 0; x < w; x++)
672
8.91M
            dst[x] = iclip_pixel((tmp1[x] * mask[x] +
673
8.91M
                                  tmp2[x] * (64 - mask[x]) + rnd) >> sh);
674
675
358k
        tmp1 += w;
676
358k
        tmp2 += w;
677
358k
        mask += w;
678
358k
        dst += PXSTRIDE(dst_stride);
679
358k
    } while (--h);
680
20.5k
}
681
682
14.5M
#define blend_px(a, b, m) (((a * (64 - m) + b * m) + 32) >> 6)
683
static void blend_c(pixel *dst, const ptrdiff_t dst_stride, const pixel *tmp,
684
                    const int w, int h, const uint8_t *mask)
685
26.4k
{
686
244k
    do {
687
2.93M
        for (int x = 0; x < w; x++) {
688
2.69M
            dst[x] = blend_px(dst[x], tmp[x], mask[x]);
689
2.69M
        }
690
244k
        dst += PXSTRIDE(dst_stride);
691
244k
        tmp += w;
692
244k
        mask += w;
693
244k
    } while (--h);
694
26.4k
}
695
696
static void blend_v_c(pixel *dst, const ptrdiff_t dst_stride, const pixel *tmp,
697
                      const int w, int h)
698
80.0k
{
699
80.0k
    const uint8_t *const mask = &dav1d_obmc_masks[w];
700
1.00M
    do {
701
7.74M
        for (int x = 0; x < (w * 3) >> 2; x++) {
702
6.74M
            dst[x] = blend_px(dst[x], tmp[x], mask[x]);
703
6.74M
        }
704
1.00M
        dst += PXSTRIDE(dst_stride);
705
1.00M
        tmp += w;
706
1.00M
    } while (--h);
707
80.0k
}
708
709
static void blend_h_c(pixel *dst, const ptrdiff_t dst_stride, const pixel *tmp,
710
                      const int w, int h)
711
72.5k
{
712
72.5k
    const uint8_t *mask = &dav1d_obmc_masks[h];
713
72.5k
    h = (h * 3) >> 2;
714
350k
    do {
715
350k
        const int m = *mask++;
716
5.44M
        for (int x = 0; x < w; x++) {
717
5.09M
            dst[x] = blend_px(dst[x], tmp[x], m);
718
5.09M
        }
719
350k
        dst += PXSTRIDE(dst_stride);
720
350k
        tmp += w;
721
350k
    } while (--h);
722
72.5k
}
723
724
static void w_mask_c(pixel *dst, const ptrdiff_t dst_stride,
725
                     const int16_t *tmp1, const int16_t *tmp2, const int w, int h,
726
                     uint8_t *mask, const int sign,
727
                     const int ss_hor, const int ss_ver HIGHBD_DECL_SUFFIX)
728
6.97k
{
729
    // store mask at 2x2 resolution, i.e. store 2x1 sum for even rows,
730
    // and then load this intermediate to calculate final value for odd rows
731
6.97k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
732
6.97k
    const int bitdepth = bitdepth_from_max(bitdepth_max);
733
6.97k
    const int sh = intermediate_bits + 6;
734
6.97k
    const int rnd = (32 << intermediate_bits) + PREP_BIAS * 64;
735
6.97k
    const int mask_sh = bitdepth + intermediate_bits - 4;
736
6.97k
    const int mask_rnd = 1 << (mask_sh - 5);
737
305k
    do {
738
9.31M
        for (int x = 0; x < w; x++) {
739
9.01M
            const int tmpdiff = tmp1[x] - tmp2[x];
740
9.01M
            const int m = imin(38 + ((abs(tmpdiff) + mask_rnd) >> mask_sh), 64);
741
9.01M
            dst[x] = iclip_pixel((tmpdiff * m + tmp2[x] * 64 + rnd) >> sh);
742
743
9.01M
            if (ss_hor) {
744
4.00M
                x++;
745
746
4.00M
                const int tmpdiff = tmp1[x] - tmp2[x];
747
4.00M
                const int n = imin(38 + ((abs(tmpdiff) + mask_rnd) >> mask_sh), 64);
748
4.00M
                dst[x] = iclip_pixel((tmpdiff * n + tmp2[x] * 64 + rnd) >> sh);
749
750
4.00M
                if (h & ss_ver) {
751
1.99M
                    mask[x >> 1] = (m + n + mask[x >> 1] + 2 - sign) >> 2;
752
2.01M
                } else if (ss_ver) {
753
1.99M
                    mask[x >> 1] = m + n;
754
1.99M
                } else {
755
25.2k
                    mask[x >> 1] = (m + n + 1 - sign) >> 1;
756
25.2k
                }
757
5.00M
            } else {
758
5.00M
                mask[x] = m;
759
5.00M
            }
760
9.01M
        }
761
762
305k
        tmp1 += w;
763
305k
        tmp2 += w;
764
305k
        dst += PXSTRIDE(dst_stride);
765
305k
        if (!ss_ver || (h & 1)) mask += w >> ss_hor;
766
305k
    } while (--h);
767
6.97k
}
768
769
#define w_mask_fns(ssn, ss_hor, ss_ver) \
770
static void w_mask_##ssn##_c(pixel *const dst, const ptrdiff_t dst_stride, \
771
                             const int16_t *const tmp1, const int16_t *const tmp2, \
772
                             const int w, const int h, uint8_t *mask, \
773
6.97k
                             const int sign HIGHBD_DECL_SUFFIX) \
774
6.97k
{ \
775
6.97k
    w_mask_c(dst, dst_stride, tmp1, tmp2, w, h, mask, sign, ss_hor, ss_ver \
776
6.97k
             HIGHBD_TAIL_SUFFIX); \
777
6.97k
}
mc_tmpl.c:w_mask_444_c
Line
Count
Source
773
2.37k
                             const int sign HIGHBD_DECL_SUFFIX) \
774
2.37k
{ \
775
2.37k
    w_mask_c(dst, dst_stride, tmp1, tmp2, w, h, mask, sign, ss_hor, ss_ver \
776
2.37k
             HIGHBD_TAIL_SUFFIX); \
777
2.37k
}
mc_tmpl.c:w_mask_422_c
Line
Count
Source
773
263
                             const int sign HIGHBD_DECL_SUFFIX) \
774
263
{ \
775
263
    w_mask_c(dst, dst_stride, tmp1, tmp2, w, h, mask, sign, ss_hor, ss_ver \
776
263
             HIGHBD_TAIL_SUFFIX); \
777
263
}
mc_tmpl.c:w_mask_420_c
Line
Count
Source
773
4.34k
                             const int sign HIGHBD_DECL_SUFFIX) \
774
4.34k
{ \
775
4.34k
    w_mask_c(dst, dst_stride, tmp1, tmp2, w, h, mask, sign, ss_hor, ss_ver \
776
4.34k
             HIGHBD_TAIL_SUFFIX); \
777
4.34k
}
778
779
w_mask_fns(444, 0, 0);
780
w_mask_fns(422, 1, 0);
781
w_mask_fns(420, 1, 1);
782
783
#undef w_mask_fns
784
785
#define FILTER_WARP_RND(src, x, F, stride, sh) \
786
61.4M
    ((F[0] * src[x - 3 * stride] + \
787
61.4M
      F[1] * src[x - 2 * stride] + \
788
61.4M
      F[2] * src[x - 1 * stride] + \
789
61.4M
      F[3] * src[x + 0 * stride] + \
790
61.4M
      F[4] * src[x + 1 * stride] + \
791
61.4M
      F[5] * src[x + 2 * stride] + \
792
61.4M
      F[6] * src[x + 3 * stride] + \
793
61.4M
      F[7] * src[x + 4 * stride] + \
794
61.4M
      ((1 << (sh)) >> 1)) >> (sh))
795
796
#define FILTER_WARP_CLIP(src, x, F, stride, sh) \
797
18.3M
    iclip_pixel(FILTER_WARP_RND(src, x, F, stride, sh))
798
799
static void warp_affine_8x8_c(pixel *dst, const ptrdiff_t dst_stride,
800
                              const pixel *src, const ptrdiff_t src_stride,
801
                              const int16_t *const abcd, int mx, int my
802
                              HIGHBD_DECL_SUFFIX)
803
291k
{
804
291k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
805
291k
    int16_t mid[15 * 8], *mid_ptr = mid;
806
807
291k
    src -= 3 * PXSTRIDE(src_stride);
808
4.63M
    for (int y = 0; y < 15; y++, mx += abcd[1]) {
809
38.6M
        for (int x = 0, tmx = mx; x < 8; x++, tmx += abcd[0]) {
810
34.3M
            const int8_t *const filter =
811
34.3M
                dav1d_mc_warp_filter[64 + ((tmx + 512) >> 10)];
812
813
34.3M
            mid_ptr[x] = FILTER_WARP_RND(src, x, filter, 1,
814
34.3M
                                         7 - intermediate_bits);
815
34.3M
        }
816
4.33M
        src += PXSTRIDE(src_stride);
817
4.33M
        mid_ptr += 8;
818
4.33M
    }
819
820
291k
    mid_ptr = &mid[3 * 8];
821
2.61M
    for (int y = 0; y < 8; y++, my += abcd[3]) {
822
20.6M
        for (int x = 0, tmy = my; x < 8; x++, tmy += abcd[2]) {
823
18.3M
            const int8_t *const filter =
824
18.3M
                dav1d_mc_warp_filter[64 + ((tmy + 512) >> 10)];
825
826
18.3M
            dst[x] = FILTER_WARP_CLIP(mid_ptr, x, filter, 8,
827
18.3M
                                      7 + intermediate_bits);
828
18.3M
        }
829
2.31M
        mid_ptr += 8;
830
2.31M
        dst += PXSTRIDE(dst_stride);
831
2.31M
    }
832
291k
}
833
834
static void warp_affine_8x8t_c(int16_t *tmp, const ptrdiff_t tmp_stride,
835
                               const pixel *src, const ptrdiff_t src_stride,
836
                               const int16_t *const abcd, int mx, int my
837
                               HIGHBD_DECL_SUFFIX)
838
47.8k
{
839
47.8k
    const int intermediate_bits = get_intermediate_bits(bitdepth_max);
840
47.8k
    int16_t mid[15 * 8], *mid_ptr = mid;
841
842
47.8k
    src -= 3 * PXSTRIDE(src_stride);
843
765k
    for (int y = 0; y < 15; y++, mx += abcd[1]) {
844
6.45M
        for (int x = 0, tmx = mx; x < 8; x++, tmx += abcd[0]) {
845
5.74M
            const int8_t *const filter =
846
5.74M
                dav1d_mc_warp_filter[64 + ((tmx + 512) >> 10)];
847
848
5.74M
            mid_ptr[x] = FILTER_WARP_RND(src, x, filter, 1,
849
5.74M
                                         7 - intermediate_bits);
850
5.74M
        }
851
717k
        src += PXSTRIDE(src_stride);
852
717k
        mid_ptr += 8;
853
717k
    }
854
855
47.8k
    mid_ptr = &mid[3 * 8];
856
430k
    for (int y = 0; y < 8; y++, my += abcd[3]) {
857
3.44M
        for (int x = 0, tmy = my; x < 8; x++, tmy += abcd[2]) {
858
3.06M
            const int8_t *const filter =
859
3.06M
                dav1d_mc_warp_filter[64 + ((tmy + 512) >> 10)];
860
861
3.06M
            tmp[x] = FILTER_WARP_RND(mid_ptr, x, filter, 8, 7) - PREP_BIAS;
862
3.06M
        }
863
382k
        mid_ptr += 8;
864
382k
        tmp += tmp_stride;
865
382k
    }
866
47.8k
}
867
868
static void emu_edge_c(const intptr_t bw, const intptr_t bh,
869
                       const intptr_t iw, const intptr_t ih,
870
                       const intptr_t x, const intptr_t y,
871
                       pixel *dst, const ptrdiff_t dst_stride,
872
                       const pixel *ref, const ptrdiff_t ref_stride)
873
1.04M
{
874
    // find offset in reference of visible block to copy
875
1.04M
    ref += iclip((int) y, 0, (int) ih - 1) * PXSTRIDE(ref_stride) +
876
1.04M
           iclip((int) x, 0, (int) iw - 1);
877
878
    // number of pixels to extend (left, right, top, bottom)
879
1.04M
    const int left_ext = iclip((int) -x, 0, (int) bw - 1);
880
1.04M
    const int right_ext = iclip((int) (x + bw - iw), 0, (int) bw - 1);
881
1.04M
    assert(left_ext + right_ext < bw);
882
1.04M
    const int top_ext = iclip((int) -y, 0, (int) bh - 1);
883
1.04M
    const int bottom_ext = iclip((int) (y + bh - ih), 0, (int) bh - 1);
884
1.04M
    assert(top_ext + bottom_ext < bh);
885
886
    // copy visible portion first
887
1.04M
    pixel *blk = dst + top_ext * PXSTRIDE(dst_stride);
888
1.04M
    const int center_w = (int) (bw - left_ext - right_ext);
889
1.04M
    const int center_h = (int) (bh - top_ext - bottom_ext);
890
12.9M
    for (int y = 0; y < center_h; y++) {
891
11.9M
        pixel_copy(blk + left_ext, ref, center_w);
892
        // extend left edge for this line
893
11.9M
        if (left_ext)
894
3.17M
            pixel_set(blk, blk[left_ext], left_ext);
895
        // extend right edge for this line
896
11.9M
        if (right_ext)
897
8.29M
            pixel_set(blk + left_ext + center_w, blk[left_ext + center_w - 1],
898
8.29M
                      right_ext);
899
11.9M
        ref += PXSTRIDE(ref_stride);
900
11.9M
        blk += PXSTRIDE(dst_stride);
901
11.9M
    }
902
903
    // copy top
904
1.04M
    blk = dst + top_ext * PXSTRIDE(dst_stride);
905
2.33M
    for (int y = 0; y < top_ext; y++) {
906
1.29M
        pixel_copy(dst, blk, bw);
907
1.29M
        dst += PXSTRIDE(dst_stride);
908
1.29M
    }
909
910
    // copy bottom
911
1.04M
    dst += center_h * PXSTRIDE(dst_stride);
912
6.52M
    for (int y = 0; y < bottom_ext; y++) {
913
5.48M
        pixel_copy(dst, &dst[-PXSTRIDE(dst_stride)], bw);
914
5.48M
        dst += PXSTRIDE(dst_stride);
915
5.48M
    }
916
1.04M
}
917
918
static void resize_c(pixel *dst, const ptrdiff_t dst_stride,
919
                     const pixel *src, const ptrdiff_t src_stride,
920
                     const int dst_w, int h, const int src_w,
921
                     const int dx, const int mx0 HIGHBD_DECL_SUFFIX)
922
204k
{
923
7.98M
    do {
924
7.98M
        int mx = mx0, src_x = -1;
925
869M
        for (int x = 0; x < dst_w; x++) {
926
861M
            const int8_t *const F = dav1d_resize_filter[mx >> 8];
927
861M
            dst[x] = iclip_pixel((-(F[0] * src[iclip(src_x - 3, 0, src_w - 1)] +
928
861M
                                    F[1] * src[iclip(src_x - 2, 0, src_w - 1)] +
929
861M
                                    F[2] * src[iclip(src_x - 1, 0, src_w - 1)] +
930
861M
                                    F[3] * src[iclip(src_x + 0, 0, src_w - 1)] +
931
861M
                                    F[4] * src[iclip(src_x + 1, 0, src_w - 1)] +
932
861M
                                    F[5] * src[iclip(src_x + 2, 0, src_w - 1)] +
933
861M
                                    F[6] * src[iclip(src_x + 3, 0, src_w - 1)] +
934
861M
                                    F[7] * src[iclip(src_x + 4, 0, src_w - 1)]) +
935
861M
                                  64) >> 7);
936
861M
            mx += dx;
937
861M
            src_x += mx >> 14;
938
861M
            mx &= 0x3fff;
939
861M
        }
940
941
7.98M
        dst += PXSTRIDE(dst_stride);
942
7.98M
        src += PXSTRIDE(src_stride);
943
7.98M
    } while (--h);
944
204k
}
945
946
#if HAVE_ASM
947
#if ARCH_AARCH64 || ARCH_ARM
948
#include "src/arm/mc.h"
949
#elif ARCH_LOONGARCH64
950
#include "src/loongarch/mc.h"
951
#elif ARCH_PPC64LE
952
#include "src/ppc/mc.h"
953
#elif ARCH_RISCV
954
#include "src/riscv/mc.h"
955
#elif ARCH_X86
956
#include "src/x86/mc.h"
957
#endif
958
#endif
959
960
72.1k
COLD void bitfn(dav1d_mc_dsp_init)(Dav1dMCDSPContext *const c) {
961
721k
#define init_mc_fns(type, name) do { \
962
721k
    c->mc        [type] = put_##name##_c; \
963
721k
    c->mc_scaled [type] = put_##name##_scaled_c; \
964
721k
    c->mct       [type] = prep_##name##_c; \
965
721k
    c->mct_scaled[type] = prep_##name##_scaled_c; \
966
721k
} while (0)
967
968
72.1k
    init_mc_fns(FILTER_2D_8TAP_REGULAR,        8tap_regular);
969
72.1k
    init_mc_fns(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth);
970
72.1k
    init_mc_fns(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp);
971
72.1k
    init_mc_fns(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular);
972
72.1k
    init_mc_fns(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth);
973
72.1k
    init_mc_fns(FILTER_2D_8TAP_SHARP,          8tap_sharp);
974
72.1k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular);
975
72.1k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH,         8tap_smooth);
976
72.1k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp);
977
72.1k
    init_mc_fns(FILTER_2D_BILINEAR,            bilin);
978
979
72.1k
    c->avg      = avg_c;
980
72.1k
    c->w_avg    = w_avg_c;
981
72.1k
    c->mask     = mask_c;
982
72.1k
    c->blend    = blend_c;
983
72.1k
    c->blend_v  = blend_v_c;
984
72.1k
    c->blend_h  = blend_h_c;
985
72.1k
    c->w_mask[0] = w_mask_444_c;
986
72.1k
    c->w_mask[1] = w_mask_422_c;
987
72.1k
    c->w_mask[2] = w_mask_420_c;
988
72.1k
    c->warp8x8  = warp_affine_8x8_c;
989
72.1k
    c->warp8x8t = warp_affine_8x8t_c;
990
72.1k
    c->emu_edge = emu_edge_c;
991
72.1k
    c->resize   = resize_c;
992
993
#if HAVE_ASM
994
#if ARCH_AARCH64 || ARCH_ARM
995
    mc_dsp_init_arm(c);
996
#elif ARCH_LOONGARCH64
997
    mc_dsp_init_loongarch(c);
998
#elif ARCH_PPC64LE
999
    mc_dsp_init_ppc(c);
1000
#elif ARCH_RISCV
1001
    mc_dsp_init_riscv(c);
1002
#elif ARCH_X86
1003
    mc_dsp_init_x86(c);
1004
#endif
1005
#endif
1006
72.1k
}
dav1d_mc_dsp_init_8bpc
Line
Count
Source
960
32.3k
COLD void bitfn(dav1d_mc_dsp_init)(Dav1dMCDSPContext *const c) {
961
32.3k
#define init_mc_fns(type, name) do { \
962
32.3k
    c->mc        [type] = put_##name##_c; \
963
32.3k
    c->mc_scaled [type] = put_##name##_scaled_c; \
964
32.3k
    c->mct       [type] = prep_##name##_c; \
965
32.3k
    c->mct_scaled[type] = prep_##name##_scaled_c; \
966
32.3k
} while (0)
967
968
32.3k
    init_mc_fns(FILTER_2D_8TAP_REGULAR,        8tap_regular);
969
32.3k
    init_mc_fns(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth);
970
32.3k
    init_mc_fns(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp);
971
32.3k
    init_mc_fns(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular);
972
32.3k
    init_mc_fns(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth);
973
32.3k
    init_mc_fns(FILTER_2D_8TAP_SHARP,          8tap_sharp);
974
32.3k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular);
975
32.3k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH,         8tap_smooth);
976
32.3k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp);
977
32.3k
    init_mc_fns(FILTER_2D_BILINEAR,            bilin);
978
979
32.3k
    c->avg      = avg_c;
980
32.3k
    c->w_avg    = w_avg_c;
981
32.3k
    c->mask     = mask_c;
982
32.3k
    c->blend    = blend_c;
983
32.3k
    c->blend_v  = blend_v_c;
984
32.3k
    c->blend_h  = blend_h_c;
985
32.3k
    c->w_mask[0] = w_mask_444_c;
986
32.3k
    c->w_mask[1] = w_mask_422_c;
987
32.3k
    c->w_mask[2] = w_mask_420_c;
988
32.3k
    c->warp8x8  = warp_affine_8x8_c;
989
32.3k
    c->warp8x8t = warp_affine_8x8t_c;
990
32.3k
    c->emu_edge = emu_edge_c;
991
32.3k
    c->resize   = resize_c;
992
993
#if HAVE_ASM
994
#if ARCH_AARCH64 || ARCH_ARM
995
    mc_dsp_init_arm(c);
996
#elif ARCH_LOONGARCH64
997
    mc_dsp_init_loongarch(c);
998
#elif ARCH_PPC64LE
999
    mc_dsp_init_ppc(c);
1000
#elif ARCH_RISCV
1001
    mc_dsp_init_riscv(c);
1002
#elif ARCH_X86
1003
    mc_dsp_init_x86(c);
1004
#endif
1005
#endif
1006
32.3k
}
dav1d_mc_dsp_init_16bpc
Line
Count
Source
960
39.7k
COLD void bitfn(dav1d_mc_dsp_init)(Dav1dMCDSPContext *const c) {
961
39.7k
#define init_mc_fns(type, name) do { \
962
39.7k
    c->mc        [type] = put_##name##_c; \
963
39.7k
    c->mc_scaled [type] = put_##name##_scaled_c; \
964
39.7k
    c->mct       [type] = prep_##name##_c; \
965
39.7k
    c->mct_scaled[type] = prep_##name##_scaled_c; \
966
39.7k
} while (0)
967
968
39.7k
    init_mc_fns(FILTER_2D_8TAP_REGULAR,        8tap_regular);
969
39.7k
    init_mc_fns(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth);
970
39.7k
    init_mc_fns(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp);
971
39.7k
    init_mc_fns(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular);
972
39.7k
    init_mc_fns(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth);
973
39.7k
    init_mc_fns(FILTER_2D_8TAP_SHARP,          8tap_sharp);
974
39.7k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular);
975
39.7k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH,         8tap_smooth);
976
39.7k
    init_mc_fns(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp);
977
39.7k
    init_mc_fns(FILTER_2D_BILINEAR,            bilin);
978
979
39.7k
    c->avg      = avg_c;
980
39.7k
    c->w_avg    = w_avg_c;
981
39.7k
    c->mask     = mask_c;
982
39.7k
    c->blend    = blend_c;
983
39.7k
    c->blend_v  = blend_v_c;
984
39.7k
    c->blend_h  = blend_h_c;
985
39.7k
    c->w_mask[0] = w_mask_444_c;
986
39.7k
    c->w_mask[1] = w_mask_422_c;
987
39.7k
    c->w_mask[2] = w_mask_420_c;
988
39.7k
    c->warp8x8  = warp_affine_8x8_c;
989
39.7k
    c->warp8x8t = warp_affine_8x8t_c;
990
39.7k
    c->emu_edge = emu_edge_c;
991
39.7k
    c->resize   = resize_c;
992
993
#if HAVE_ASM
994
#if ARCH_AARCH64 || ARCH_ARM
995
    mc_dsp_init_arm(c);
996
#elif ARCH_LOONGARCH64
997
    mc_dsp_init_loongarch(c);
998
#elif ARCH_PPC64LE
999
    mc_dsp_init_ppc(c);
1000
#elif ARCH_RISCV
1001
    mc_dsp_init_riscv(c);
1002
#elif ARCH_X86
1003
    mc_dsp_init_x86(c);
1004
#endif
1005
#endif
1006
39.7k
}