Coverage Report

Created: 2026-02-14 06:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/ffmpeg/libavcodec/h264chroma_template.c
Line
Count
Source
1
/*
2
 * Copyright (c) 2000, 2001 Fabrice Bellard
3
 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
4
 *
5
 * This file is part of FFmpeg.
6
 *
7
 * FFmpeg is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
12
 * FFmpeg is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with FFmpeg; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 */
21
22
23
#include <stddef.h>
24
25
#include "libavutil/avassert.h"
26
#include "bit_depth_template.c"
27
28
#define H264_CHROMA_MC(OPNAME, OP)\
29
37.4M
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
30
37.4M
{\
31
37.4M
    pixel *dst = (pixel*)_dst;\
32
37.4M
    const pixel *src = (const pixel*)_src;\
33
37.4M
    const int A=(8-x)*(8-y);\
34
37.4M
    const int B=(  x)*(8-y);\
35
37.4M
    const int C=(8-x)*(  y);\
36
37.4M
    const int D=(  x)*(  y);\
37
37.4M
    int i;\
38
37.4M
    stride >>= sizeof(pixel)-1;\
39
37.4M
    \
40
37.4M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
41
37.4M
\
42
37.4M
    if(D){\
43
24.3M
        for(i=0; i<h; i++){\
44
18.3M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
45
18.3M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
46
18.3M
            dst+= stride;\
47
18.3M
            src+= stride;\
48
18.3M
        }\
49
31.5M
    } else if (B + C) {\
50
5.83M
        const int E= B+C;\
51
5.83M
        const ptrdiff_t step = C ? stride : 1;\
52
23.6M
        for(i=0; i<h; i++){\
53
17.7M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
54
17.7M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
55
17.7M
            dst+= stride;\
56
17.7M
            src+= stride;\
57
17.7M
        }\
58
25.6M
    } else {\
59
92.0M
        for ( i = 0; i < h; i++){\
60
66.4M
            OP(dst[0], A * src[0]);\
61
66.4M
            OP(dst[1], A * src[1]);\
62
66.4M
            dst += stride;\
63
66.4M
            src += stride;\
64
66.4M
        }\
65
25.6M
    }\
66
37.4M
}\
h264chroma.c:put_h264_chroma_mc2_16_c
Line
Count
Source
29
12.5M
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
30
12.5M
{\
31
12.5M
    pixel *dst = (pixel*)_dst;\
32
12.5M
    const pixel *src = (const pixel*)_src;\
33
12.5M
    const int A=(8-x)*(8-y);\
34
12.5M
    const int B=(  x)*(8-y);\
35
12.5M
    const int C=(8-x)*(  y);\
36
12.5M
    const int D=(  x)*(  y);\
37
12.5M
    int i;\
38
12.5M
    stride >>= sizeof(pixel)-1;\
39
12.5M
    \
40
12.5M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
41
12.5M
\
42
12.5M
    if(D){\
43
12.9M
        for(i=0; i<h; i++){\
44
10.1M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
45
10.1M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
46
10.1M
            dst+= stride;\
47
10.1M
            src+= stride;\
48
10.1M
        }\
49
9.76M
    } else if (B + C) {\
50
2.81M
        const int E= B+C;\
51
2.81M
        const ptrdiff_t step = C ? stride : 1;\
52
13.1M
        for(i=0; i<h; i++){\
53
10.2M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
54
10.2M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
55
10.2M
            dst+= stride;\
56
10.2M
            src+= stride;\
57
10.2M
        }\
58
6.95M
    } else {\
59
29.5M
        for ( i = 0; i < h; i++){\
60
22.5M
            OP(dst[0], A * src[0]);\
61
22.5M
            OP(dst[1], A * src[1]);\
62
22.5M
            dst += stride;\
63
22.5M
            src += stride;\
64
22.5M
        }\
65
6.95M
    }\
66
12.5M
}\
h264chroma.c:avg_h264_chroma_mc2_16_c
Line
Count
Source
29
6.55M
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
30
6.55M
{\
31
6.55M
    pixel *dst = (pixel*)_dst;\
32
6.55M
    const pixel *src = (const pixel*)_src;\
33
6.55M
    const int A=(8-x)*(8-y);\
34
6.55M
    const int B=(  x)*(8-y);\
35
6.55M
    const int C=(8-x)*(  y);\
36
6.55M
    const int D=(  x)*(  y);\
37
6.55M
    int i;\
38
6.55M
    stride >>= sizeof(pixel)-1;\
39
6.55M
    \
40
6.55M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
41
6.55M
\
42
6.55M
    if(D){\
43
2.57M
        for(i=0; i<h; i++){\
44
1.89M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
45
1.89M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
46
1.89M
            dst+= stride;\
47
1.89M
            src+= stride;\
48
1.89M
        }\
49
5.87M
    } else if (B + C) {\
50
674k
        const int E= B+C;\
51
674k
        const ptrdiff_t step = C ? stride : 1;\
52
2.68M
        for(i=0; i<h; i++){\
53
2.00M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
54
2.00M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
55
2.00M
            dst+= stride;\
56
2.00M
            src+= stride;\
57
2.00M
        }\
58
5.20M
    } else {\
59
21.6M
        for ( i = 0; i < h; i++){\
60
16.4M
            OP(dst[0], A * src[0]);\
61
16.4M
            OP(dst[1], A * src[1]);\
62
16.4M
            dst += stride;\
63
16.4M
            src += stride;\
64
16.4M
        }\
65
5.20M
    }\
66
6.55M
}\
h264chroma.c:put_h264_chroma_mc2_8_c
Line
Count
Source
29
16.3M
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
30
16.3M
{\
31
16.3M
    pixel *dst = (pixel*)_dst;\
32
16.3M
    const pixel *src = (const pixel*)_src;\
33
16.3M
    const int A=(8-x)*(8-y);\
34
16.3M
    const int B=(  x)*(8-y);\
35
16.3M
    const int C=(8-x)*(  y);\
36
16.3M
    const int D=(  x)*(  y);\
37
16.3M
    int i;\
38
16.3M
    stride >>= sizeof(pixel)-1;\
39
16.3M
    \
40
16.3M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
41
16.3M
\
42
16.3M
    if(D){\
43
8.53M
        for(i=0; i<h; i++){\
44
6.17M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
45
6.17M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
46
6.17M
            dst+= stride;\
47
6.17M
            src+= stride;\
48
6.17M
        }\
49
13.9M
    } else if (B + C) {\
50
2.24M
        const int E= B+C;\
51
2.24M
        const ptrdiff_t step = C ? stride : 1;\
52
7.55M
        for(i=0; i<h; i++){\
53
5.31M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
54
5.31M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
55
5.31M
            dst+= stride;\
56
5.31M
            src+= stride;\
57
5.31M
        }\
58
11.7M
    } else {\
59
35.4M
        for ( i = 0; i < h; i++){\
60
23.7M
            OP(dst[0], A * src[0]);\
61
23.7M
            OP(dst[1], A * src[1]);\
62
23.7M
            dst += stride;\
63
23.7M
            src += stride;\
64
23.7M
        }\
65
11.7M
    }\
66
16.3M
}\
h264chroma.c:avg_h264_chroma_mc2_8_c
Line
Count
Source
29
2.00M
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
30
2.00M
{\
31
2.00M
    pixel *dst = (pixel*)_dst;\
32
2.00M
    const pixel *src = (const pixel*)_src;\
33
2.00M
    const int A=(8-x)*(8-y);\
34
2.00M
    const int B=(  x)*(8-y);\
35
2.00M
    const int C=(8-x)*(  y);\
36
2.00M
    const int D=(  x)*(  y);\
37
2.00M
    int i;\
38
2.00M
    stride >>= sizeof(pixel)-1;\
39
2.00M
    \
40
2.00M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
41
2.00M
\
42
2.00M
    if(D){\
43
265k
        for(i=0; i<h; i++){\
44
166k
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
45
166k
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
46
166k
            dst+= stride;\
47
166k
            src+= stride;\
48
166k
        }\
49
1.90M
    } else if (B + C) {\
50
103k
        const int E= B+C;\
51
103k
        const ptrdiff_t step = C ? stride : 1;\
52
283k
        for(i=0; i<h; i++){\
53
180k
            OP(dst[0], (A*src[0] + E*src[step+0]));\
54
180k
            OP(dst[1], (A*src[1] + E*src[step+1]));\
55
180k
            dst+= stride;\
56
180k
            src+= stride;\
57
180k
        }\
58
1.79M
    } else {\
59
5.46M
        for ( i = 0; i < h; i++){\
60
3.66M
            OP(dst[0], A * src[0]);\
61
3.66M
            OP(dst[1], A * src[1]);\
62
3.66M
            dst += stride;\
63
3.66M
            src += stride;\
64
3.66M
        }\
65
1.79M
    }\
66
2.00M
}\
67
\
68
132M
static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
69
132M
{\
70
132M
    pixel *dst = (pixel*)_dst;\
71
132M
    const pixel *src = (const pixel*)_src;\
72
132M
    const int A=(8-x)*(8-y);\
73
132M
    const int B=(  x)*(8-y);\
74
132M
    const int C=(8-x)*(  y);\
75
132M
    const int D=(  x)*(  y);\
76
132M
    int i;\
77
132M
    stride >>= sizeof(pixel)-1;\
78
132M
    \
79
132M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
80
132M
\
81
132M
    if(D){\
82
133M
        for(i=0; i<h; i++){\
83
111M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
84
111M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
85
111M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
86
111M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
87
111M
            dst+= stride;\
88
111M
            src+= stride;\
89
111M
        }\
90
110M
    } else if (B + C) {\
91
20.2M
        const int E= B+C;\
92
20.2M
        const ptrdiff_t step = C ? stride : 1;\
93
126M
        for(i=0; i<h; i++){\
94
105M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
95
105M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
96
105M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
97
105M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
98
105M
            dst+= stride;\
99
105M
            src+= stride;\
100
105M
        }\
101
90.5M
    } else {\
102
549M
        for ( i = 0; i < h; i++){\
103
459M
            OP(dst[0], A * src[0]);\
104
459M
            OP(dst[1], A * src[1]);\
105
459M
            OP(dst[2], A * src[2]);\
106
459M
            OP(dst[3], A * src[3]);\
107
459M
            dst += stride;\
108
459M
            src += stride;\
109
459M
        }\
110
90.5M
    }\
111
132M
}\
h264chroma.c:put_h264_chroma_mc4_16_c
Line
Count
Source
68
34.2M
static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
69
34.2M
{\
70
34.2M
    pixel *dst = (pixel*)_dst;\
71
34.2M
    const pixel *src = (const pixel*)_src;\
72
34.2M
    const int A=(8-x)*(8-y);\
73
34.2M
    const int B=(  x)*(8-y);\
74
34.2M
    const int C=(8-x)*(  y);\
75
34.2M
    const int D=(  x)*(  y);\
76
34.2M
    int i;\
77
34.2M
    stride >>= sizeof(pixel)-1;\
78
34.2M
    \
79
34.2M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
80
34.2M
\
81
34.2M
    if(D){\
82
35.6M
        for(i=0; i<h; i++){\
83
30.4M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
84
30.4M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
85
30.4M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
86
30.4M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
87
30.4M
            dst+= stride;\
88
30.4M
            src+= stride;\
89
30.4M
        }\
90
29.1M
    } else if (B + C) {\
91
5.21M
        const int E= B+C;\
92
5.21M
        const ptrdiff_t step = C ? stride : 1;\
93
39.6M
        for(i=0; i<h; i++){\
94
34.4M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
95
34.4M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
96
34.4M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
97
34.4M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
98
34.4M
            dst+= stride;\
99
34.4M
            src+= stride;\
100
34.4M
        }\
101
23.8M
    } else {\
102
168M
        for ( i = 0; i < h; i++){\
103
144M
            OP(dst[0], A * src[0]);\
104
144M
            OP(dst[1], A * src[1]);\
105
144M
            OP(dst[2], A * src[2]);\
106
144M
            OP(dst[3], A * src[3]);\
107
144M
            dst += stride;\
108
144M
            src += stride;\
109
144M
        }\
110
23.8M
    }\
111
34.2M
}\
h264chroma.c:avg_h264_chroma_mc4_16_c
Line
Count
Source
68
16.8M
static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
69
16.8M
{\
70
16.8M
    pixel *dst = (pixel*)_dst;\
71
16.8M
    const pixel *src = (const pixel*)_src;\
72
16.8M
    const int A=(8-x)*(8-y);\
73
16.8M
    const int B=(  x)*(8-y);\
74
16.8M
    const int C=(8-x)*(  y);\
75
16.8M
    const int D=(  x)*(  y);\
76
16.8M
    int i;\
77
16.8M
    stride >>= sizeof(pixel)-1;\
78
16.8M
    \
79
16.8M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
80
16.8M
\
81
16.8M
    if(D){\
82
7.22M
        for(i=0; i<h; i++){\
83
6.40M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
84
6.40M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
85
6.40M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
86
6.40M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
87
6.40M
            dst+= stride;\
88
6.40M
            src+= stride;\
89
6.40M
        }\
90
16.0M
    } else if (B + C) {\
91
1.66M
        const int E= B+C;\
92
1.66M
        const ptrdiff_t step = C ? stride : 1;\
93
12.4M
        for(i=0; i<h; i++){\
94
10.7M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
95
10.7M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
96
10.7M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
97
10.7M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
98
10.7M
            dst+= stride;\
99
10.7M
            src+= stride;\
100
10.7M
        }\
101
14.3M
    } else {\
102
113M
        for ( i = 0; i < h; i++){\
103
98.8M
            OP(dst[0], A * src[0]);\
104
98.8M
            OP(dst[1], A * src[1]);\
105
98.8M
            OP(dst[2], A * src[2]);\
106
98.8M
            OP(dst[3], A * src[3]);\
107
98.8M
            dst += stride;\
108
98.8M
            src += stride;\
109
98.8M
        }\
110
14.3M
    }\
111
16.8M
}\
h264chroma.c:put_h264_chroma_mc4_8_c
Line
Count
Source
68
57.0M
static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
69
57.0M
{\
70
57.0M
    pixel *dst = (pixel*)_dst;\
71
57.0M
    const pixel *src = (const pixel*)_src;\
72
57.0M
    const int A=(8-x)*(8-y);\
73
57.0M
    const int B=(  x)*(8-y);\
74
57.0M
    const int C=(8-x)*(  y);\
75
57.0M
    const int D=(  x)*(  y);\
76
57.0M
    int i;\
77
57.0M
    stride >>= sizeof(pixel)-1;\
78
57.0M
    \
79
57.0M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
80
57.0M
\
81
57.0M
    if(D){\
82
75.4M
        for(i=0; i<h; i++){\
83
62.1M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
84
62.1M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
85
62.1M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
86
62.1M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
87
62.1M
            dst+= stride;\
88
62.1M
            src+= stride;\
89
62.1M
        }\
90
43.7M
    } else if (B + C) {\
91
11.5M
        const int E= B+C;\
92
11.5M
        const ptrdiff_t step = C ? stride : 1;\
93
64.5M
        for(i=0; i<h; i++){\
94
52.9M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
95
52.9M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
96
52.9M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
97
52.9M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
98
52.9M
            dst+= stride;\
99
52.9M
            src+= stride;\
100
52.9M
        }\
101
32.1M
    } else {\
102
166M
        for ( i = 0; i < h; i++){\
103
133M
            OP(dst[0], A * src[0]);\
104
133M
            OP(dst[1], A * src[1]);\
105
133M
            OP(dst[2], A * src[2]);\
106
133M
            OP(dst[3], A * src[3]);\
107
133M
            dst += stride;\
108
133M
            src += stride;\
109
133M
        }\
110
32.1M
    }\
111
57.0M
}\
h264chroma.c:avg_h264_chroma_mc4_8_c
Line
Count
Source
68
24.7M
static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
69
24.7M
{\
70
24.7M
    pixel *dst = (pixel*)_dst;\
71
24.7M
    const pixel *src = (const pixel*)_src;\
72
24.7M
    const int A=(8-x)*(8-y);\
73
24.7M
    const int B=(  x)*(8-y);\
74
24.7M
    const int C=(8-x)*(  y);\
75
24.7M
    const int D=(  x)*(  y);\
76
24.7M
    int i;\
77
24.7M
    stride >>= sizeof(pixel)-1;\
78
24.7M
    \
79
24.7M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
80
24.7M
\
81
24.7M
    if(D){\
82
15.1M
        for(i=0; i<h; i++){\
83
12.2M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
84
12.2M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
85
12.2M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
86
12.2M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
87
12.2M
            dst+= stride;\
88
12.2M
            src+= stride;\
89
12.2M
        }\
90
21.8M
    } else if (B + C) {\
91
1.80M
        const int E= B+C;\
92
1.80M
        const ptrdiff_t step = C ? stride : 1;\
93
9.52M
        for(i=0; i<h; i++){\
94
7.72M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
95
7.72M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
96
7.72M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
97
7.72M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
98
7.72M
            dst+= stride;\
99
7.72M
            src+= stride;\
100
7.72M
        }\
101
20.0M
    } else {\
102
101M
        for ( i = 0; i < h; i++){\
103
81.8M
            OP(dst[0], A * src[0]);\
104
81.8M
            OP(dst[1], A * src[1]);\
105
81.8M
            OP(dst[2], A * src[2]);\
106
81.8M
            OP(dst[3], A * src[3]);\
107
81.8M
            dst += stride;\
108
81.8M
            src += stride;\
109
81.8M
        }\
110
20.0M
    }\
111
24.7M
}\
112
\
113
201M
static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
114
201M
{\
115
201M
    pixel *dst = (pixel*)_dst;\
116
201M
    const pixel *src = (const pixel*)_src;\
117
201M
    const int A=(8-x)*(8-y);\
118
201M
    const int B=(  x)*(8-y);\
119
201M
    const int C=(8-x)*(  y);\
120
201M
    const int D=(  x)*(  y);\
121
201M
    int i;\
122
201M
    stride >>= sizeof(pixel)-1;\
123
201M
    \
124
201M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
125
201M
\
126
201M
    if(D){\
127
168M
        for(i=0; i<h; i++){\
128
150M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
129
150M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
130
150M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
131
150M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
132
150M
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
133
150M
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
134
150M
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
135
150M
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
136
150M
            dst+= stride;\
137
150M
            src+= stride;\
138
150M
        }\
139
184M
    } else if (B + C) {\
140
33.2M
        const int E= B+C;\
141
33.2M
        const ptrdiff_t step = C ? stride : 1;\
142
334M
        for(i=0; i<h; i++){\
143
301M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
144
301M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
145
301M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
146
301M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
147
301M
            OP(dst[4], (A*src[4] + E*src[step+4]));\
148
301M
            OP(dst[5], (A*src[5] + E*src[step+5]));\
149
301M
            OP(dst[6], (A*src[6] + E*src[step+6]));\
150
301M
            OP(dst[7], (A*src[7] + E*src[step+7]));\
151
301M
            dst+= stride;\
152
301M
            src+= stride;\
153
301M
        }\
154
151M
    } else {\
155
1.69G
        for ( i = 0; i < h; i++){\
156
1.54G
            OP(dst[0], A * src[0]);\
157
1.54G
            OP(dst[1], A * src[1]);\
158
1.54G
            OP(dst[2], A * src[2]);\
159
1.54G
            OP(dst[3], A * src[3]);\
160
1.54G
            OP(dst[4], A * src[4]);\
161
1.54G
            OP(dst[5], A * src[5]);\
162
1.54G
            OP(dst[6], A * src[6]);\
163
1.54G
            OP(dst[7], A * src[7]);\
164
1.54G
            dst += stride;\
165
1.54G
            src += stride;\
166
1.54G
        }\
167
151M
    }\
168
201M
}
h264chroma.c:put_h264_chroma_mc8_16_c
Line
Count
Source
113
77.6M
static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
114
77.6M
{\
115
77.6M
    pixel *dst = (pixel*)_dst;\
116
77.6M
    const pixel *src = (const pixel*)_src;\
117
77.6M
    const int A=(8-x)*(8-y);\
118
77.6M
    const int B=(  x)*(8-y);\
119
77.6M
    const int C=(8-x)*(  y);\
120
77.6M
    const int D=(  x)*(  y);\
121
77.6M
    int i;\
122
77.6M
    stride >>= sizeof(pixel)-1;\
123
77.6M
    \
124
77.6M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
125
77.6M
\
126
77.6M
    if(D){\
127
64.1M
        for(i=0; i<h; i++){\
128
58.2M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
129
58.2M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
130
58.2M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
131
58.2M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
132
58.2M
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
133
58.2M
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
134
58.2M
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
135
58.2M
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
136
58.2M
            dst+= stride;\
137
58.2M
            src+= stride;\
138
58.2M
        }\
139
71.6M
    } else if (B + C) {\
140
8.29M
        const int E= B+C;\
141
8.29M
        const ptrdiff_t step = C ? stride : 1;\
142
100M
        for(i=0; i<h; i++){\
143
92.3M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
144
92.3M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
145
92.3M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
146
92.3M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
147
92.3M
            OP(dst[4], (A*src[4] + E*src[step+4]));\
148
92.3M
            OP(dst[5], (A*src[5] + E*src[step+5]));\
149
92.3M
            OP(dst[6], (A*src[6] + E*src[step+6]));\
150
92.3M
            OP(dst[7], (A*src[7] + E*src[step+7]));\
151
92.3M
            dst+= stride;\
152
92.3M
            src+= stride;\
153
92.3M
        }\
154
63.3M
    } else {\
155
769M
        for ( i = 0; i < h; i++){\
156
705M
            OP(dst[0], A * src[0]);\
157
705M
            OP(dst[1], A * src[1]);\
158
705M
            OP(dst[2], A * src[2]);\
159
705M
            OP(dst[3], A * src[3]);\
160
705M
            OP(dst[4], A * src[4]);\
161
705M
            OP(dst[5], A * src[5]);\
162
705M
            OP(dst[6], A * src[6]);\
163
705M
            OP(dst[7], A * src[7]);\
164
705M
            dst += stride;\
165
705M
            src += stride;\
166
705M
        }\
167
63.3M
    }\
168
77.6M
}
h264chroma.c:avg_h264_chroma_mc8_16_c
Line
Count
Source
113
11.9M
static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
114
11.9M
{\
115
11.9M
    pixel *dst = (pixel*)_dst;\
116
11.9M
    const pixel *src = (const pixel*)_src;\
117
11.9M
    const int A=(8-x)*(8-y);\
118
11.9M
    const int B=(  x)*(8-y);\
119
11.9M
    const int C=(8-x)*(  y);\
120
11.9M
    const int D=(  x)*(  y);\
121
11.9M
    int i;\
122
11.9M
    stride >>= sizeof(pixel)-1;\
123
11.9M
    \
124
11.9M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
125
11.9M
\
126
11.9M
    if(D){\
127
9.10M
        for(i=0; i<h; i++){\
128
8.23M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
129
8.23M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
130
8.23M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
131
8.23M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
132
8.23M
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
133
8.23M
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
134
8.23M
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
135
8.23M
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
136
8.23M
            dst+= stride;\
137
8.23M
            src+= stride;\
138
8.23M
        }\
139
11.0M
    } else if (B + C) {\
140
2.14M
        const int E= B+C;\
141
2.14M
        const ptrdiff_t step = C ? stride : 1;\
142
25.1M
        for(i=0; i<h; i++){\
143
23.0M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
144
23.0M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
145
23.0M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
146
23.0M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
147
23.0M
            OP(dst[4], (A*src[4] + E*src[step+4]));\
148
23.0M
            OP(dst[5], (A*src[5] + E*src[step+5]));\
149
23.0M
            OP(dst[6], (A*src[6] + E*src[step+6]));\
150
23.0M
            OP(dst[7], (A*src[7] + E*src[step+7]));\
151
23.0M
            dst+= stride;\
152
23.0M
            src+= stride;\
153
23.0M
        }\
154
8.89M
    } else {\
155
108M
        for ( i = 0; i < h; i++){\
156
99.8M
            OP(dst[0], A * src[0]);\
157
99.8M
            OP(dst[1], A * src[1]);\
158
99.8M
            OP(dst[2], A * src[2]);\
159
99.8M
            OP(dst[3], A * src[3]);\
160
99.8M
            OP(dst[4], A * src[4]);\
161
99.8M
            OP(dst[5], A * src[5]);\
162
99.8M
            OP(dst[6], A * src[6]);\
163
99.8M
            OP(dst[7], A * src[7]);\
164
99.8M
            dst += stride;\
165
99.8M
            src += stride;\
166
99.8M
        }\
167
8.89M
    }\
168
11.9M
}
h264chroma.c:put_h264_chroma_mc8_8_c
Line
Count
Source
113
99.9M
static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
114
99.9M
{\
115
99.9M
    pixel *dst = (pixel*)_dst;\
116
99.9M
    const pixel *src = (const pixel*)_src;\
117
99.9M
    const int A=(8-x)*(8-y);\
118
99.9M
    const int B=(  x)*(8-y);\
119
99.9M
    const int C=(8-x)*(  y);\
120
99.9M
    const int D=(  x)*(  y);\
121
99.9M
    int i;\
122
99.9M
    stride >>= sizeof(pixel)-1;\
123
99.9M
    \
124
99.9M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
125
99.9M
\
126
99.9M
    if(D){\
127
84.1M
        for(i=0; i<h; i++){\
128
74.9M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
129
74.9M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
130
74.9M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
131
74.9M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
132
74.9M
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
133
74.9M
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
134
74.9M
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
135
74.9M
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
136
74.9M
            dst+= stride;\
137
74.9M
            src+= stride;\
138
74.9M
        }\
139
90.7M
    } else if (B + C) {\
140
21.3M
        const int E= B+C;\
141
21.3M
        const ptrdiff_t step = C ? stride : 1;\
142
195M
        for(i=0; i<h; i++){\
143
174M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
144
174M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
145
174M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
146
174M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
147
174M
            OP(dst[4], (A*src[4] + E*src[step+4]));\
148
174M
            OP(dst[5], (A*src[5] + E*src[step+5]));\
149
174M
            OP(dst[6], (A*src[6] + E*src[step+6]));\
150
174M
            OP(dst[7], (A*src[7] + E*src[step+7]));\
151
174M
            dst+= stride;\
152
174M
            src+= stride;\
153
174M
        }\
154
69.4M
    } else {\
155
733M
        for ( i = 0; i < h; i++){\
156
664M
            OP(dst[0], A * src[0]);\
157
664M
            OP(dst[1], A * src[1]);\
158
664M
            OP(dst[2], A * src[2]);\
159
664M
            OP(dst[3], A * src[3]);\
160
664M
            OP(dst[4], A * src[4]);\
161
664M
            OP(dst[5], A * src[5]);\
162
664M
            OP(dst[6], A * src[6]);\
163
664M
            OP(dst[7], A * src[7]);\
164
664M
            dst += stride;\
165
664M
            src += stride;\
166
664M
        }\
167
69.4M
    }\
168
99.9M
}
h264chroma.c:avg_h264_chroma_mc8_8_c
Line
Count
Source
113
12.1M
static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\
114
12.1M
{\
115
12.1M
    pixel *dst = (pixel*)_dst;\
116
12.1M
    const pixel *src = (const pixel*)_src;\
117
12.1M
    const int A=(8-x)*(8-y);\
118
12.1M
    const int B=(  x)*(8-y);\
119
12.1M
    const int C=(8-x)*(  y);\
120
12.1M
    const int D=(  x)*(  y);\
121
12.1M
    int i;\
122
12.1M
    stride >>= sizeof(pixel)-1;\
123
12.1M
    \
124
12.1M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
125
12.1M
\
126
12.1M
    if(D){\
127
10.6M
        for(i=0; i<h; i++){\
128
9.42M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
129
9.42M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
130
9.42M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
131
9.42M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
132
9.42M
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
133
9.42M
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
134
9.42M
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
135
9.42M
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
136
9.42M
            dst+= stride;\
137
9.42M
            src+= stride;\
138
9.42M
        }\
139
10.9M
    } else if (B + C) {\
140
1.49M
        const int E= B+C;\
141
1.49M
        const ptrdiff_t step = C ? stride : 1;\
142
13.1M
        for(i=0; i<h; i++){\
143
11.6M
            OP(dst[0], (A*src[0] + E*src[step+0]));\
144
11.6M
            OP(dst[1], (A*src[1] + E*src[step+1]));\
145
11.6M
            OP(dst[2], (A*src[2] + E*src[step+2]));\
146
11.6M
            OP(dst[3], (A*src[3] + E*src[step+3]));\
147
11.6M
            OP(dst[4], (A*src[4] + E*src[step+4]));\
148
11.6M
            OP(dst[5], (A*src[5] + E*src[step+5]));\
149
11.6M
            OP(dst[6], (A*src[6] + E*src[step+6]));\
150
11.6M
            OP(dst[7], (A*src[7] + E*src[step+7]));\
151
11.6M
            dst+= stride;\
152
11.6M
            src+= stride;\
153
11.6M
        }\
154
9.47M
    } else {\
155
87.4M
        for ( i = 0; i < h; i++){\
156
77.9M
            OP(dst[0], A * src[0]);\
157
77.9M
            OP(dst[1], A * src[1]);\
158
77.9M
            OP(dst[2], A * src[2]);\
159
77.9M
            OP(dst[3], A * src[3]);\
160
77.9M
            OP(dst[4], A * src[4]);\
161
77.9M
            OP(dst[5], A * src[5]);\
162
77.9M
            OP(dst[6], A * src[6]);\
163
77.9M
            OP(dst[7], A * src[7]);\
164
77.9M
            dst += stride;\
165
77.9M
            src += stride;\
166
77.9M
        }\
167
9.47M
    }\
168
12.1M
}
169
170
2.76G
#define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)
171
16.1G
#define op_put(a, b) a = (((b) + 32)>>6)
172
173
16.1G
H264_CHROMA_MC(put_       , op_put)
174
2.76G
H264_CHROMA_MC(avg_       , op_avg)
175
#undef op_avg
176
#undef op_put