Coverage Report

Created: 2026-10-28 08:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/ffmpeg/libavcodec/rv40dsp.c
Line
Count
Source
1
/*
2
 * RV40 decoder motion compensation functions
3
 * Copyright (c) 2008 Konstantin Shishkov
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
 * @file
24
 * RV40 decoder motion compensation functions
25
 */
26
27
#include "libavutil/attributes_internal.h"
28
#include "libavutil/common.h"
29
#include "libavutil/intreadwrite.h"
30
#include "h264qpel.h"
31
#include "mathops.h"
32
#include "pixels.h"
33
#include "rnd_avg.h"
34
#include "rv34dsp.h"
35
#include "libavutil/avassert.h"
36
37
#define RV40_LOWPASS(OPNAME, OP) \
38
static void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride,\
39
535k
                                                     const int h, const int C1, const int C2, const int SHIFT){\
40
535k
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
41
535k
    int i;\
42
6.17M
    for(i = 0; i < h; i++)\
43
5.64M
    {\
44
5.64M
        OP(dst[0], (src[-2] + src[ 3] - 5*(src[-1]+src[2]) + src[0]*C1 + src[1]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
45
5.64M
        OP(dst[1], (src[-1] + src[ 4] - 5*(src[ 0]+src[3]) + src[1]*C1 + src[2]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
46
5.64M
        OP(dst[2], (src[ 0] + src[ 5] - 5*(src[ 1]+src[4]) + src[2]*C1 + src[3]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
47
5.64M
        OP(dst[3], (src[ 1] + src[ 6] - 5*(src[ 2]+src[5]) + src[3]*C1 + src[4]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
48
5.64M
        OP(dst[4], (src[ 2] + src[ 7] - 5*(src[ 3]+src[6]) + src[4]*C1 + src[5]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
49
5.64M
        OP(dst[5], (src[ 3] + src[ 8] - 5*(src[ 4]+src[7]) + src[5]*C1 + src[6]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
50
5.64M
        OP(dst[6], (src[ 4] + src[ 9] - 5*(src[ 5]+src[8]) + src[6]*C1 + src[7]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
51
5.64M
        OP(dst[7], (src[ 5] + src[10] - 5*(src[ 6]+src[9]) + src[7]*C1 + src[8]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
52
5.64M
        dst += dstStride;\
53
5.64M
        src += srcStride;\
54
5.64M
    }\
55
535k
}\
rv40dsp.c:put_rv40_qpel8_h_lowpass
Line
Count
Source
39
517k
                                                     const int h, const int C1, const int C2, const int SHIFT){\
40
517k
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
41
517k
    int i;\
42
6.01M
    for(i = 0; i < h; i++)\
43
5.49M
    {\
44
5.49M
        OP(dst[0], (src[-2] + src[ 3] - 5*(src[-1]+src[2]) + src[0]*C1 + src[1]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
45
5.49M
        OP(dst[1], (src[-1] + src[ 4] - 5*(src[ 0]+src[3]) + src[1]*C1 + src[2]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
46
5.49M
        OP(dst[2], (src[ 0] + src[ 5] - 5*(src[ 1]+src[4]) + src[2]*C1 + src[3]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
47
5.49M
        OP(dst[3], (src[ 1] + src[ 6] - 5*(src[ 2]+src[5]) + src[3]*C1 + src[4]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
48
5.49M
        OP(dst[4], (src[ 2] + src[ 7] - 5*(src[ 3]+src[6]) + src[4]*C1 + src[5]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
49
5.49M
        OP(dst[5], (src[ 3] + src[ 8] - 5*(src[ 4]+src[7]) + src[5]*C1 + src[6]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
50
5.49M
        OP(dst[6], (src[ 4] + src[ 9] - 5*(src[ 5]+src[8]) + src[6]*C1 + src[7]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
51
5.49M
        OP(dst[7], (src[ 5] + src[10] - 5*(src[ 6]+src[9]) + src[7]*C1 + src[8]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
52
5.49M
        dst += dstStride;\
53
5.49M
        src += srcStride;\
54
5.49M
    }\
55
517k
}\
rv40dsp.c:avg_rv40_qpel8_h_lowpass
Line
Count
Source
39
18.2k
                                                     const int h, const int C1, const int C2, const int SHIFT){\
40
18.2k
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
41
18.2k
    int i;\
42
164k
    for(i = 0; i < h; i++)\
43
145k
    {\
44
145k
        OP(dst[0], (src[-2] + src[ 3] - 5*(src[-1]+src[2]) + src[0]*C1 + src[1]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
45
145k
        OP(dst[1], (src[-1] + src[ 4] - 5*(src[ 0]+src[3]) + src[1]*C1 + src[2]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
46
145k
        OP(dst[2], (src[ 0] + src[ 5] - 5*(src[ 1]+src[4]) + src[2]*C1 + src[3]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
47
145k
        OP(dst[3], (src[ 1] + src[ 6] - 5*(src[ 2]+src[5]) + src[3]*C1 + src[4]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
48
145k
        OP(dst[4], (src[ 2] + src[ 7] - 5*(src[ 3]+src[6]) + src[4]*C1 + src[5]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
49
145k
        OP(dst[5], (src[ 3] + src[ 8] - 5*(src[ 4]+src[7]) + src[5]*C1 + src[6]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
50
145k
        OP(dst[6], (src[ 4] + src[ 9] - 5*(src[ 5]+src[8]) + src[6]*C1 + src[7]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
51
145k
        OP(dst[7], (src[ 5] + src[10] - 5*(src[ 6]+src[9]) + src[7]*C1 + src[8]*C2 + (1<<(SHIFT-1))) >> SHIFT);\
52
145k
        dst += dstStride;\
53
145k
        src += srcStride;\
54
145k
    }\
55
18.2k
}\
56
\
57
static void OPNAME ## rv40_qpel8_v_lowpass(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride,\
58
524k
                                           const int w, const int C1, const int C2, const int SHIFT){\
59
524k
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
60
524k
    int i;\
61
4.72M
    for(i = 0; i < w; i++)\
62
4.19M
    {\
63
4.19M
        const int srcB  = src[-2*srcStride];\
64
4.19M
        const int srcA  = src[-1*srcStride];\
65
4.19M
        const int src0  = src[0 *srcStride];\
66
4.19M
        const int src1  = src[1 *srcStride];\
67
4.19M
        const int src2  = src[2 *srcStride];\
68
4.19M
        const int src3  = src[3 *srcStride];\
69
4.19M
        const int src4  = src[4 *srcStride];\
70
4.19M
        const int src5  = src[5 *srcStride];\
71
4.19M
        const int src6  = src[6 *srcStride];\
72
4.19M
        const int src7  = src[7 *srcStride];\
73
4.19M
        const int src8  = src[8 *srcStride];\
74
4.19M
        const int src9  = src[9 *srcStride];\
75
4.19M
        const int src10 = src[10*srcStride];\
76
4.19M
        OP(dst[0*dstStride], (srcB + src3  - 5*(srcA+src2) + src0*C1 + src1*C2 + (1<<(SHIFT-1))) >> SHIFT);\
77
4.19M
        OP(dst[1*dstStride], (srcA + src4  - 5*(src0+src3) + src1*C1 + src2*C2 + (1<<(SHIFT-1))) >> SHIFT);\
78
4.19M
        OP(dst[2*dstStride], (src0 + src5  - 5*(src1+src4) + src2*C1 + src3*C2 + (1<<(SHIFT-1))) >> SHIFT);\
79
4.19M
        OP(dst[3*dstStride], (src1 + src6  - 5*(src2+src5) + src3*C1 + src4*C2 + (1<<(SHIFT-1))) >> SHIFT);\
80
4.19M
        OP(dst[4*dstStride], (src2 + src7  - 5*(src3+src6) + src4*C1 + src5*C2 + (1<<(SHIFT-1))) >> SHIFT);\
81
4.19M
        OP(dst[5*dstStride], (src3 + src8  - 5*(src4+src7) + src5*C1 + src6*C2 + (1<<(SHIFT-1))) >> SHIFT);\
82
4.19M
        OP(dst[6*dstStride], (src4 + src9  - 5*(src5+src8) + src6*C1 + src7*C2 + (1<<(SHIFT-1))) >> SHIFT);\
83
4.19M
        OP(dst[7*dstStride], (src5 + src10 - 5*(src6+src9) + src7*C1 + src8*C2 + (1<<(SHIFT-1))) >> SHIFT);\
84
4.19M
        dst++;\
85
4.19M
        src++;\
86
4.19M
    }\
87
524k
}\
rv40dsp.c:put_rv40_qpel8_v_lowpass
Line
Count
Source
58
483k
                                           const int w, const int C1, const int C2, const int SHIFT){\
59
483k
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
60
483k
    int i;\
61
4.34M
    for(i = 0; i < w; i++)\
62
3.86M
    {\
63
3.86M
        const int srcB  = src[-2*srcStride];\
64
3.86M
        const int srcA  = src[-1*srcStride];\
65
3.86M
        const int src0  = src[0 *srcStride];\
66
3.86M
        const int src1  = src[1 *srcStride];\
67
3.86M
        const int src2  = src[2 *srcStride];\
68
3.86M
        const int src3  = src[3 *srcStride];\
69
3.86M
        const int src4  = src[4 *srcStride];\
70
3.86M
        const int src5  = src[5 *srcStride];\
71
3.86M
        const int src6  = src[6 *srcStride];\
72
3.86M
        const int src7  = src[7 *srcStride];\
73
3.86M
        const int src8  = src[8 *srcStride];\
74
3.86M
        const int src9  = src[9 *srcStride];\
75
3.86M
        const int src10 = src[10*srcStride];\
76
3.86M
        OP(dst[0*dstStride], (srcB + src3  - 5*(srcA+src2) + src0*C1 + src1*C2 + (1<<(SHIFT-1))) >> SHIFT);\
77
3.86M
        OP(dst[1*dstStride], (srcA + src4  - 5*(src0+src3) + src1*C1 + src2*C2 + (1<<(SHIFT-1))) >> SHIFT);\
78
3.86M
        OP(dst[2*dstStride], (src0 + src5  - 5*(src1+src4) + src2*C1 + src3*C2 + (1<<(SHIFT-1))) >> SHIFT);\
79
3.86M
        OP(dst[3*dstStride], (src1 + src6  - 5*(src2+src5) + src3*C1 + src4*C2 + (1<<(SHIFT-1))) >> SHIFT);\
80
3.86M
        OP(dst[4*dstStride], (src2 + src7  - 5*(src3+src6) + src4*C1 + src5*C2 + (1<<(SHIFT-1))) >> SHIFT);\
81
3.86M
        OP(dst[5*dstStride], (src3 + src8  - 5*(src4+src7) + src5*C1 + src6*C2 + (1<<(SHIFT-1))) >> SHIFT);\
82
3.86M
        OP(dst[6*dstStride], (src4 + src9  - 5*(src5+src8) + src6*C1 + src7*C2 + (1<<(SHIFT-1))) >> SHIFT);\
83
3.86M
        OP(dst[7*dstStride], (src5 + src10 - 5*(src6+src9) + src7*C1 + src8*C2 + (1<<(SHIFT-1))) >> SHIFT);\
84
3.86M
        dst++;\
85
3.86M
        src++;\
86
3.86M
    }\
87
483k
}\
rv40dsp.c:avg_rv40_qpel8_v_lowpass
Line
Count
Source
58
41.7k
                                           const int w, const int C1, const int C2, const int SHIFT){\
59
41.7k
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
60
41.7k
    int i;\
61
376k
    for(i = 0; i < w; i++)\
62
334k
    {\
63
334k
        const int srcB  = src[-2*srcStride];\
64
334k
        const int srcA  = src[-1*srcStride];\
65
334k
        const int src0  = src[0 *srcStride];\
66
334k
        const int src1  = src[1 *srcStride];\
67
334k
        const int src2  = src[2 *srcStride];\
68
334k
        const int src3  = src[3 *srcStride];\
69
334k
        const int src4  = src[4 *srcStride];\
70
334k
        const int src5  = src[5 *srcStride];\
71
334k
        const int src6  = src[6 *srcStride];\
72
334k
        const int src7  = src[7 *srcStride];\
73
334k
        const int src8  = src[8 *srcStride];\
74
334k
        const int src9  = src[9 *srcStride];\
75
334k
        const int src10 = src[10*srcStride];\
76
334k
        OP(dst[0*dstStride], (srcB + src3  - 5*(srcA+src2) + src0*C1 + src1*C2 + (1<<(SHIFT-1))) >> SHIFT);\
77
334k
        OP(dst[1*dstStride], (srcA + src4  - 5*(src0+src3) + src1*C1 + src2*C2 + (1<<(SHIFT-1))) >> SHIFT);\
78
334k
        OP(dst[2*dstStride], (src0 + src5  - 5*(src1+src4) + src2*C1 + src3*C2 + (1<<(SHIFT-1))) >> SHIFT);\
79
334k
        OP(dst[3*dstStride], (src1 + src6  - 5*(src2+src5) + src3*C1 + src4*C2 + (1<<(SHIFT-1))) >> SHIFT);\
80
334k
        OP(dst[4*dstStride], (src2 + src7  - 5*(src3+src6) + src4*C1 + src5*C2 + (1<<(SHIFT-1))) >> SHIFT);\
81
334k
        OP(dst[5*dstStride], (src3 + src8  - 5*(src4+src7) + src5*C1 + src6*C2 + (1<<(SHIFT-1))) >> SHIFT);\
82
334k
        OP(dst[6*dstStride], (src4 + src9  - 5*(src5+src8) + src6*C1 + src7*C2 + (1<<(SHIFT-1))) >> SHIFT);\
83
334k
        OP(dst[7*dstStride], (src5 + src10 - 5*(src6+src9) + src7*C1 + src8*C2 + (1<<(SHIFT-1))) >> SHIFT);\
84
334k
        dst++;\
85
334k
        src++;\
86
334k
    }\
87
41.7k
}\
88
\
89
static void OPNAME ## rv40_qpel16_v_lowpass(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride,\
90
76.9k
                                            const int w, const int C1, const int C2, const int SHIFT){\
91
76.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
92
76.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
93
76.9k
    src += 8*srcStride;\
94
76.9k
    dst += 8*dstStride;\
95
76.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, w-8, C1, C2, SHIFT);\
96
76.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, w-8, C1, C2, SHIFT);\
97
76.9k
}\
rv40dsp.c:put_rv40_qpel16_v_lowpass
Line
Count
Source
90
67.9k
                                            const int w, const int C1, const int C2, const int SHIFT){\
91
67.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
92
67.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
93
67.9k
    src += 8*srcStride;\
94
67.9k
    dst += 8*dstStride;\
95
67.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, w-8, C1, C2, SHIFT);\
96
67.9k
    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, w-8, C1, C2, SHIFT);\
97
67.9k
}\
rv40dsp.c:avg_rv40_qpel16_v_lowpass
Line
Count
Source
90
8.97k
                                            const int w, const int C1, const int C2, const int SHIFT){\
91
8.97k
    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
92
8.97k
    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
93
8.97k
    src += 8*srcStride;\
94
8.97k
    dst += 8*dstStride;\
95
8.97k
    OPNAME ## rv40_qpel8_v_lowpass(dst  , src  , dstStride, srcStride, w-8, C1, C2, SHIFT);\
96
8.97k
    OPNAME ## rv40_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride, w-8, C1, C2, SHIFT);\
97
8.97k
}\
98
\
99
static void OPNAME ## rv40_qpel16_h_lowpass(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride,\
100
82.7k
                                            const int h, const int C1, const int C2, const int SHIFT){\
101
82.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
102
82.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
103
82.7k
    src += 8*srcStride;\
104
82.7k
    dst += 8*dstStride;\
105
82.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, h-8, C1, C2, SHIFT);\
106
82.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, h-8, C1, C2, SHIFT);\
107
82.7k
}\
rv40dsp.c:put_rv40_qpel16_h_lowpass
Line
Count
Source
100
78.7k
                                            const int h, const int C1, const int C2, const int SHIFT){\
101
78.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
102
78.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
103
78.7k
    src += 8*srcStride;\
104
78.7k
    dst += 8*dstStride;\
105
78.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, h-8, C1, C2, SHIFT);\
106
78.7k
    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, h-8, C1, C2, SHIFT);\
107
78.7k
}\
rv40dsp.c:avg_rv40_qpel16_h_lowpass
Line
Count
Source
100
4.04k
                                            const int h, const int C1, const int C2, const int SHIFT){\
101
4.04k
    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, 8, C1, C2, SHIFT);\
102
4.04k
    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, 8, C1, C2, SHIFT);\
103
4.04k
    src += 8*srcStride;\
104
4.04k
    dst += 8*dstStride;\
105
4.04k
    OPNAME ## rv40_qpel8_h_lowpass(dst  , src  , dstStride, srcStride, h-8, C1, C2, SHIFT);\
106
4.04k
    OPNAME ## rv40_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride, h-8, C1, C2, SHIFT);\
107
4.04k
}\
108
\
109
110
#define RV40_MC(OPNAME, SIZE) \
111
31.7k
static void OPNAME ## rv40_qpel ## SIZE ## _mc10_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
112
31.7k
{\
113
31.7k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
114
31.7k
}\
rv40dsp.c:put_rv40_qpel16_mc10_c
Line
Count
Source
111
9.97k
static void OPNAME ## rv40_qpel ## SIZE ## _mc10_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
112
9.97k
{\
113
9.97k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
114
9.97k
}\
rv40dsp.c:avg_rv40_qpel16_mc10_c
Line
Count
Source
111
2.15k
static void OPNAME ## rv40_qpel ## SIZE ## _mc10_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
112
2.15k
{\
113
2.15k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
114
2.15k
}\
rv40dsp.c:put_rv40_qpel8_mc10_c
Line
Count
Source
111
18.3k
static void OPNAME ## rv40_qpel ## SIZE ## _mc10_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
112
18.3k
{\
113
18.3k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
114
18.3k
}\
rv40dsp.c:avg_rv40_qpel8_mc10_c
Line
Count
Source
111
1.22k
static void OPNAME ## rv40_qpel ## SIZE ## _mc10_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
112
1.22k
{\
113
1.22k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
114
1.22k
}\
115
\
116
39.5k
static void OPNAME ## rv40_qpel ## SIZE ## _mc30_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
117
39.5k
{\
118
39.5k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
119
39.5k
}\
rv40dsp.c:put_rv40_qpel16_mc30_c
Line
Count
Source
116
13.7k
static void OPNAME ## rv40_qpel ## SIZE ## _mc30_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
117
13.7k
{\
118
13.7k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
119
13.7k
}\
rv40dsp.c:avg_rv40_qpel16_mc30_c
Line
Count
Source
116
1.89k
static void OPNAME ## rv40_qpel ## SIZE ## _mc30_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
117
1.89k
{\
118
1.89k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
119
1.89k
}\
rv40dsp.c:put_rv40_qpel8_mc30_c
Line
Count
Source
116
23.0k
static void OPNAME ## rv40_qpel ## SIZE ## _mc30_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
117
23.0k
{\
118
23.0k
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
119
23.0k
}\
rv40dsp.c:avg_rv40_qpel8_mc30_c
Line
Count
Source
116
840
static void OPNAME ## rv40_qpel ## SIZE ## _mc30_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
117
840
{\
118
840
    OPNAME ## rv40_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
119
840
}\
120
\
121
50.8k
static void OPNAME ## rv40_qpel ## SIZE ## _mc01_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
122
50.8k
{\
123
50.8k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
124
50.8k
}\
rv40dsp.c:put_rv40_qpel16_mc01_c
Line
Count
Source
121
10.5k
static void OPNAME ## rv40_qpel ## SIZE ## _mc01_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
122
10.5k
{\
123
10.5k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
124
10.5k
}\
rv40dsp.c:avg_rv40_qpel16_mc01_c
Line
Count
Source
121
1.34k
static void OPNAME ## rv40_qpel ## SIZE ## _mc01_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
122
1.34k
{\
123
1.34k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
124
1.34k
}\
rv40dsp.c:put_rv40_qpel8_mc01_c
Line
Count
Source
121
38.1k
static void OPNAME ## rv40_qpel ## SIZE ## _mc01_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
122
38.1k
{\
123
38.1k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
124
38.1k
}\
rv40dsp.c:avg_rv40_qpel8_mc01_c
Line
Count
Source
121
834
static void OPNAME ## rv40_qpel ## SIZE ## _mc01_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
122
834
{\
123
834
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 52, 20, 6);\
124
834
}\
125
\
126
17.7k
static void OPNAME ## rv40_qpel ## SIZE ## _mc11_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
127
17.7k
{\
128
17.7k
    uint8_t full[SIZE*(SIZE+5)];\
129
17.7k
    uint8_t * const full_mid = full + SIZE*2;\
130
17.7k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
131
17.7k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
132
17.7k
}\
rv40dsp.c:put_rv40_qpel16_mc11_c
Line
Count
Source
126
9.23k
static void OPNAME ## rv40_qpel ## SIZE ## _mc11_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
127
9.23k
{\
128
9.23k
    uint8_t full[SIZE*(SIZE+5)];\
129
9.23k
    uint8_t * const full_mid = full + SIZE*2;\
130
9.23k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
131
9.23k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
132
9.23k
}\
rv40dsp.c:avg_rv40_qpel16_mc11_c
Line
Count
Source
126
1.05k
static void OPNAME ## rv40_qpel ## SIZE ## _mc11_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
127
1.05k
{\
128
1.05k
    uint8_t full[SIZE*(SIZE+5)];\
129
1.05k
    uint8_t * const full_mid = full + SIZE*2;\
130
1.05k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
131
1.05k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
132
1.05k
}\
rv40dsp.c:put_rv40_qpel8_mc11_c
Line
Count
Source
126
7.05k
static void OPNAME ## rv40_qpel ## SIZE ## _mc11_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
127
7.05k
{\
128
7.05k
    uint8_t full[SIZE*(SIZE+5)];\
129
7.05k
    uint8_t * const full_mid = full + SIZE*2;\
130
7.05k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
131
7.05k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
132
7.05k
}\
rv40dsp.c:avg_rv40_qpel8_mc11_c
Line
Count
Source
126
450
static void OPNAME ## rv40_qpel ## SIZE ## _mc11_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
127
450
{\
128
450
    uint8_t full[SIZE*(SIZE+5)];\
129
450
    uint8_t * const full_mid = full + SIZE*2;\
130
450
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
131
450
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
132
450
}\
133
\
134
82.9k
static void OPNAME ## rv40_qpel ## SIZE ## _mc21_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
135
82.9k
{\
136
82.9k
    uint8_t full[SIZE*(SIZE+5)];\
137
82.9k
    uint8_t * const full_mid = full + SIZE*2;\
138
82.9k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
139
82.9k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
140
82.9k
}\
rv40dsp.c:put_rv40_qpel16_mc21_c
Line
Count
Source
134
4.23k
static void OPNAME ## rv40_qpel ## SIZE ## _mc21_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
135
4.23k
{\
136
4.23k
    uint8_t full[SIZE*(SIZE+5)];\
137
4.23k
    uint8_t * const full_mid = full + SIZE*2;\
138
4.23k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
139
4.23k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
140
4.23k
}\
rv40dsp.c:avg_rv40_qpel16_mc21_c
Line
Count
Source
134
759
static void OPNAME ## rv40_qpel ## SIZE ## _mc21_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
135
759
{\
136
759
    uint8_t full[SIZE*(SIZE+5)];\
137
759
    uint8_t * const full_mid = full + SIZE*2;\
138
759
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
139
759
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
140
759
}\
rv40dsp.c:put_rv40_qpel8_mc21_c
Line
Count
Source
134
77.4k
static void OPNAME ## rv40_qpel ## SIZE ## _mc21_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
135
77.4k
{\
136
77.4k
    uint8_t full[SIZE*(SIZE+5)];\
137
77.4k
    uint8_t * const full_mid = full + SIZE*2;\
138
77.4k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
139
77.4k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
140
77.4k
}\
rv40dsp.c:avg_rv40_qpel8_mc21_c
Line
Count
Source
134
560
static void OPNAME ## rv40_qpel ## SIZE ## _mc21_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
135
560
{\
136
560
    uint8_t full[SIZE*(SIZE+5)];\
137
560
    uint8_t * const full_mid = full + SIZE*2;\
138
560
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
139
560
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
140
560
}\
141
\
142
15.3k
static void OPNAME ## rv40_qpel ## SIZE ## _mc31_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
143
15.3k
{\
144
15.3k
    uint8_t full[SIZE*(SIZE+5)];\
145
15.3k
    uint8_t * const full_mid = full + SIZE*2;\
146
15.3k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
147
15.3k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
148
15.3k
}\
rv40dsp.c:put_rv40_qpel16_mc31_c
Line
Count
Source
142
3.49k
static void OPNAME ## rv40_qpel ## SIZE ## _mc31_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
143
3.49k
{\
144
3.49k
    uint8_t full[SIZE*(SIZE+5)];\
145
3.49k
    uint8_t * const full_mid = full + SIZE*2;\
146
3.49k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
147
3.49k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
148
3.49k
}\
rv40dsp.c:avg_rv40_qpel16_mc31_c
Line
Count
Source
142
731
static void OPNAME ## rv40_qpel ## SIZE ## _mc31_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
143
731
{\
144
731
    uint8_t full[SIZE*(SIZE+5)];\
145
731
    uint8_t * const full_mid = full + SIZE*2;\
146
731
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
147
731
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
148
731
}\
rv40dsp.c:put_rv40_qpel8_mc31_c
Line
Count
Source
142
10.6k
static void OPNAME ## rv40_qpel ## SIZE ## _mc31_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
143
10.6k
{\
144
10.6k
    uint8_t full[SIZE*(SIZE+5)];\
145
10.6k
    uint8_t * const full_mid = full + SIZE*2;\
146
10.6k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
147
10.6k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
148
10.6k
}\
rv40dsp.c:avg_rv40_qpel8_mc31_c
Line
Count
Source
142
462
static void OPNAME ## rv40_qpel ## SIZE ## _mc31_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
143
462
{\
144
462
    uint8_t full[SIZE*(SIZE+5)];\
145
462
    uint8_t * const full_mid = full + SIZE*2;\
146
462
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
147
462
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 52, 20, 6);\
148
462
}\
149
\
150
18.7k
static void OPNAME ## rv40_qpel ## SIZE ## _mc12_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
151
18.7k
{\
152
18.7k
    uint8_t full[SIZE*(SIZE+5)];\
153
18.7k
    uint8_t * const full_mid = full + SIZE*2;\
154
18.7k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
155
18.7k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
156
18.7k
}\
rv40dsp.c:put_rv40_qpel16_mc12_c
Line
Count
Source
150
4.34k
static void OPNAME ## rv40_qpel ## SIZE ## _mc12_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
151
4.34k
{\
152
4.34k
    uint8_t full[SIZE*(SIZE+5)];\
153
4.34k
    uint8_t * const full_mid = full + SIZE*2;\
154
4.34k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
155
4.34k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
156
4.34k
}\
rv40dsp.c:avg_rv40_qpel16_mc12_c
Line
Count
Source
150
545
static void OPNAME ## rv40_qpel ## SIZE ## _mc12_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
151
545
{\
152
545
    uint8_t full[SIZE*(SIZE+5)];\
153
545
    uint8_t * const full_mid = full + SIZE*2;\
154
545
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
155
545
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
156
545
}\
rv40dsp.c:put_rv40_qpel8_mc12_c
Line
Count
Source
150
13.2k
static void OPNAME ## rv40_qpel ## SIZE ## _mc12_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
151
13.2k
{\
152
13.2k
    uint8_t full[SIZE*(SIZE+5)];\
153
13.2k
    uint8_t * const full_mid = full + SIZE*2;\
154
13.2k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
155
13.2k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
156
13.2k
}\
rv40dsp.c:avg_rv40_qpel8_mc12_c
Line
Count
Source
150
547
static void OPNAME ## rv40_qpel ## SIZE ## _mc12_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
151
547
{\
152
547
    uint8_t full[SIZE*(SIZE+5)];\
153
547
    uint8_t * const full_mid = full + SIZE*2;\
154
547
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
155
547
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
156
547
}\
157
\
158
13.1k
static void OPNAME ## rv40_qpel ## SIZE ## _mc22_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
159
13.1k
{\
160
13.1k
    uint8_t full[SIZE*(SIZE+5)];\
161
13.1k
    uint8_t * const full_mid = full + SIZE*2;\
162
13.1k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
163
13.1k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
164
13.1k
}\
rv40dsp.c:put_rv40_qpel16_mc22_c
Line
Count
Source
158
4.31k
static void OPNAME ## rv40_qpel ## SIZE ## _mc22_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
159
4.31k
{\
160
4.31k
    uint8_t full[SIZE*(SIZE+5)];\
161
4.31k
    uint8_t * const full_mid = full + SIZE*2;\
162
4.31k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
163
4.31k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
164
4.31k
}\
rv40dsp.c:avg_rv40_qpel16_mc22_c
Line
Count
Source
158
765
static void OPNAME ## rv40_qpel ## SIZE ## _mc22_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
159
765
{\
160
765
    uint8_t full[SIZE*(SIZE+5)];\
161
765
    uint8_t * const full_mid = full + SIZE*2;\
162
765
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
163
765
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
164
765
}\
rv40dsp.c:put_rv40_qpel8_mc22_c
Line
Count
Source
158
7.47k
static void OPNAME ## rv40_qpel ## SIZE ## _mc22_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
159
7.47k
{\
160
7.47k
    uint8_t full[SIZE*(SIZE+5)];\
161
7.47k
    uint8_t * const full_mid = full + SIZE*2;\
162
7.47k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
163
7.47k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
164
7.47k
}\
rv40dsp.c:avg_rv40_qpel8_mc22_c
Line
Count
Source
158
594
static void OPNAME ## rv40_qpel ## SIZE ## _mc22_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
159
594
{\
160
594
    uint8_t full[SIZE*(SIZE+5)];\
161
594
    uint8_t * const full_mid = full + SIZE*2;\
162
594
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
163
594
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
164
594
}\
165
\
166
34.0k
static void OPNAME ## rv40_qpel ## SIZE ## _mc32_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
167
34.0k
{\
168
34.0k
    uint8_t full[SIZE*(SIZE+5)];\
169
34.0k
    uint8_t * const full_mid = full + SIZE*2;\
170
34.0k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
171
34.0k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
172
34.0k
}\
rv40dsp.c:put_rv40_qpel16_mc32_c
Line
Count
Source
166
12.2k
static void OPNAME ## rv40_qpel ## SIZE ## _mc32_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
167
12.2k
{\
168
12.2k
    uint8_t full[SIZE*(SIZE+5)];\
169
12.2k
    uint8_t * const full_mid = full + SIZE*2;\
170
12.2k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
171
12.2k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
172
12.2k
}\
rv40dsp.c:avg_rv40_qpel16_mc32_c
Line
Count
Source
166
741
static void OPNAME ## rv40_qpel ## SIZE ## _mc32_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
167
741
{\
168
741
    uint8_t full[SIZE*(SIZE+5)];\
169
741
    uint8_t * const full_mid = full + SIZE*2;\
170
741
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
171
741
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
172
741
}\
rv40dsp.c:put_rv40_qpel8_mc32_c
Line
Count
Source
166
20.6k
static void OPNAME ## rv40_qpel ## SIZE ## _mc32_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
167
20.6k
{\
168
20.6k
    uint8_t full[SIZE*(SIZE+5)];\
169
20.6k
    uint8_t * const full_mid = full + SIZE*2;\
170
20.6k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
171
20.6k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
172
20.6k
}\
rv40dsp.c:avg_rv40_qpel8_mc32_c
Line
Count
Source
166
539
static void OPNAME ## rv40_qpel ## SIZE ## _mc32_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
167
539
{\
168
539
    uint8_t full[SIZE*(SIZE+5)];\
169
539
    uint8_t * const full_mid = full + SIZE*2;\
170
539
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 52, 6);\
171
539
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 20, 5);\
172
539
}\
173
\
174
26.9k
static void OPNAME ## rv40_qpel ## SIZE ## _mc03_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
175
26.9k
{\
176
26.9k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
177
26.9k
}\
rv40dsp.c:put_rv40_qpel16_mc03_c
Line
Count
Source
174
8.59k
static void OPNAME ## rv40_qpel ## SIZE ## _mc03_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
175
8.59k
{\
176
8.59k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
177
8.59k
}\
rv40dsp.c:avg_rv40_qpel16_mc03_c
Line
Count
Source
174
1.45k
static void OPNAME ## rv40_qpel ## SIZE ## _mc03_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
175
1.45k
{\
176
1.45k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
177
1.45k
}\
rv40dsp.c:put_rv40_qpel8_mc03_c
Line
Count
Source
174
16.1k
static void OPNAME ## rv40_qpel ## SIZE ## _mc03_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
175
16.1k
{\
176
16.1k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
177
16.1k
}\
rv40dsp.c:avg_rv40_qpel8_mc03_c
Line
Count
Source
174
744
static void OPNAME ## rv40_qpel ## SIZE ## _mc03_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
175
744
{\
176
744
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, src, stride, stride, SIZE, 20, 52, 6);\
177
744
}\
178
\
179
13.2k
static void OPNAME ## rv40_qpel ## SIZE ## _mc13_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
180
13.2k
{\
181
13.2k
    uint8_t full[SIZE*(SIZE+5)];\
182
13.2k
    uint8_t * const full_mid = full + SIZE*2;\
183
13.2k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
184
13.2k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
185
13.2k
}\
rv40dsp.c:put_rv40_qpel16_mc13_c
Line
Count
Source
179
6.31k
static void OPNAME ## rv40_qpel ## SIZE ## _mc13_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
180
6.31k
{\
181
6.31k
    uint8_t full[SIZE*(SIZE+5)];\
182
6.31k
    uint8_t * const full_mid = full + SIZE*2;\
183
6.31k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
184
6.31k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
185
6.31k
}\
rv40dsp.c:avg_rv40_qpel16_mc13_c
Line
Count
Source
179
543
static void OPNAME ## rv40_qpel ## SIZE ## _mc13_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
180
543
{\
181
543
    uint8_t full[SIZE*(SIZE+5)];\
182
543
    uint8_t * const full_mid = full + SIZE*2;\
183
543
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
184
543
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
185
543
}\
rv40dsp.c:put_rv40_qpel8_mc13_c
Line
Count
Source
179
5.77k
static void OPNAME ## rv40_qpel ## SIZE ## _mc13_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
180
5.77k
{\
181
5.77k
    uint8_t full[SIZE*(SIZE+5)];\
182
5.77k
    uint8_t * const full_mid = full + SIZE*2;\
183
5.77k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
184
5.77k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
185
5.77k
}\
rv40dsp.c:avg_rv40_qpel8_mc13_c
Line
Count
Source
179
636
static void OPNAME ## rv40_qpel ## SIZE ## _mc13_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
180
636
{\
181
636
    uint8_t full[SIZE*(SIZE+5)];\
182
636
    uint8_t * const full_mid = full + SIZE*2;\
183
636
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 52, 20, 6);\
184
636
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
185
636
}\
186
\
187
20.8k
static void OPNAME ## rv40_qpel ## SIZE ## _mc23_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
188
20.8k
{\
189
20.8k
    uint8_t full[SIZE*(SIZE+5)];\
190
20.8k
    uint8_t * const full_mid = full + SIZE*2;\
191
20.8k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
192
20.8k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
193
20.8k
}\
rv40dsp.c:put_rv40_qpel16_mc23_c
Line
Count
Source
187
4.66k
static void OPNAME ## rv40_qpel ## SIZE ## _mc23_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
188
4.66k
{\
189
4.66k
    uint8_t full[SIZE*(SIZE+5)];\
190
4.66k
    uint8_t * const full_mid = full + SIZE*2;\
191
4.66k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
192
4.66k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
193
4.66k
}\
rv40dsp.c:avg_rv40_qpel16_mc23_c
Line
Count
Source
187
1.03k
static void OPNAME ## rv40_qpel ## SIZE ## _mc23_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
188
1.03k
{\
189
1.03k
    uint8_t full[SIZE*(SIZE+5)];\
190
1.03k
    uint8_t * const full_mid = full + SIZE*2;\
191
1.03k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
192
1.03k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
193
1.03k
}\
rv40dsp.c:put_rv40_qpel8_mc23_c
Line
Count
Source
187
14.6k
static void OPNAME ## rv40_qpel ## SIZE ## _mc23_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
188
14.6k
{\
189
14.6k
    uint8_t full[SIZE*(SIZE+5)];\
190
14.6k
    uint8_t * const full_mid = full + SIZE*2;\
191
14.6k
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
192
14.6k
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
193
14.6k
}\
rv40dsp.c:avg_rv40_qpel8_mc23_c
Line
Count
Source
187
521
static void OPNAME ## rv40_qpel ## SIZE ## _mc23_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
188
521
{\
189
521
    uint8_t full[SIZE*(SIZE+5)];\
190
521
    uint8_t * const full_mid = full + SIZE*2;\
191
521
    put_rv40_qpel ## SIZE ## _h_lowpass(full, src - 2*stride, SIZE, stride, SIZE+5, 20, 20, 5);\
192
521
    OPNAME ## rv40_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE, SIZE, 20, 52, 6);\
193
521
}\
194
\
195
196
3.84M
#define op_avg(a, b)  a = (((a)+cm[b]+1)>>1)
197
74.8M
#define op_put(a, b)  a = cm[b]
198
199
74.8M
RV40_LOWPASS(put_       , op_put)
200
3.84M
RV40_LOWPASS(avg_       , op_avg)
201
202
#undef op_avg
203
#undef op_put
204
205
RV40_MC(put_, 8)
206
RV40_MC(put_, 16)
207
RV40_MC(avg_, 8)
208
RV40_MC(avg_, 16)
209
210
#define PIXOP2(OPNAME, OP)                                              \
211
static inline void OPNAME ## _pixels8_xy2_8_c(uint8_t *block,           \
212
                                              const uint8_t *pixels,    \
213
                                              ptrdiff_t line_size,      \
214
14.1k
                                              int h)                    \
215
14.1k
{                                                                       \
216
14.1k
    /* FIXME HIGH BIT DEPTH */                                          \
217
14.1k
    int j;                                                              \
218
14.1k
                                                                        \
219
42.5k
    for (j = 0; j < 2; j++) {                                           \
220
28.3k
        int i;                                                          \
221
28.3k
        const uint32_t a = AV_RN32(pixels);                             \
222
28.3k
        const uint32_t b = AV_RN32(pixels + 1);                         \
223
28.3k
        uint32_t l0 = (a & 0x03030303UL) +                              \
224
28.3k
                      (b & 0x03030303UL) +                              \
225
28.3k
                           0x02020202UL;                                \
226
28.3k
        uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) +                       \
227
28.3k
                      ((b & 0xFCFCFCFCUL) >> 2);                        \
228
28.3k
        uint32_t l1, h1;                                                \
229
28.3k
                                                                        \
230
28.3k
        pixels += line_size;                                            \
231
205k
        for (i = 0; i < h; i += 2) {                                    \
232
177k
            uint32_t a = AV_RN32(pixels);                               \
233
177k
            uint32_t b = AV_RN32(pixels + 1);                           \
234
177k
            l1 = (a & 0x03030303UL) +                                   \
235
177k
                 (b & 0x03030303UL);                                    \
236
177k
            h1 = ((a & 0xFCFCFCFCUL) >> 2) +                            \
237
177k
                 ((b & 0xFCFCFCFCUL) >> 2);                             \
238
177k
            OP(*((uint32_t *) block),                                   \
239
177k
               h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));            \
240
177k
            pixels += line_size;                                        \
241
177k
            block  += line_size;                                        \
242
177k
            a = AV_RN32(pixels);                                        \
243
177k
            b = AV_RN32(pixels + 1);                                    \
244
177k
            l0 = (a & 0x03030303UL) +                                   \
245
177k
                 (b & 0x03030303UL) +                                   \
246
177k
                      0x02020202UL;                                     \
247
177k
            h0 = ((a & 0xFCFCFCFCUL) >> 2) +                            \
248
177k
                 ((b & 0xFCFCFCFCUL) >> 2);                             \
249
177k
            OP(*((uint32_t *) block),                                   \
250
177k
               h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));            \
251
177k
            pixels += line_size;                                        \
252
177k
            block  += line_size;                                        \
253
177k
        }                                                               \
254
28.3k
        pixels += 4 - line_size * (h + 1);                              \
255
28.3k
        block  += 4 - line_size * h;                                    \
256
28.3k
    }                                                                   \
257
14.1k
}                                                                       \
rv40dsp.c:put_pixels8_xy2_8_c
Line
Count
Source
214
12.1k
                                              int h)                    \
215
12.1k
{                                                                       \
216
12.1k
    /* FIXME HIGH BIT DEPTH */                                          \
217
12.1k
    int j;                                                              \
218
12.1k
                                                                        \
219
36.4k
    for (j = 0; j < 2; j++) {                                           \
220
24.3k
        int i;                                                          \
221
24.3k
        const uint32_t a = AV_RN32(pixels);                             \
222
24.3k
        const uint32_t b = AV_RN32(pixels + 1);                         \
223
24.3k
        uint32_t l0 = (a & 0x03030303UL) +                              \
224
24.3k
                      (b & 0x03030303UL) +                              \
225
24.3k
                           0x02020202UL;                                \
226
24.3k
        uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) +                       \
227
24.3k
                      ((b & 0xFCFCFCFCUL) >> 2);                        \
228
24.3k
        uint32_t l1, h1;                                                \
229
24.3k
                                                                        \
230
24.3k
        pixels += line_size;                                            \
231
173k
        for (i = 0; i < h; i += 2) {                                    \
232
149k
            uint32_t a = AV_RN32(pixels);                               \
233
149k
            uint32_t b = AV_RN32(pixels + 1);                           \
234
149k
            l1 = (a & 0x03030303UL) +                                   \
235
149k
                 (b & 0x03030303UL);                                    \
236
149k
            h1 = ((a & 0xFCFCFCFCUL) >> 2) +                            \
237
149k
                 ((b & 0xFCFCFCFCUL) >> 2);                             \
238
149k
            OP(*((uint32_t *) block),                                   \
239
149k
               h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));            \
240
149k
            pixels += line_size;                                        \
241
149k
            block  += line_size;                                        \
242
149k
            a = AV_RN32(pixels);                                        \
243
149k
            b = AV_RN32(pixels + 1);                                    \
244
149k
            l0 = (a & 0x03030303UL) +                                   \
245
149k
                 (b & 0x03030303UL) +                                   \
246
149k
                      0x02020202UL;                                     \
247
149k
            h0 = ((a & 0xFCFCFCFCUL) >> 2) +                            \
248
149k
                 ((b & 0xFCFCFCFCUL) >> 2);                             \
249
149k
            OP(*((uint32_t *) block),                                   \
250
149k
               h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));            \
251
149k
            pixels += line_size;                                        \
252
149k
            block  += line_size;                                        \
253
149k
        }                                                               \
254
24.3k
        pixels += 4 - line_size * (h + 1);                              \
255
24.3k
        block  += 4 - line_size * h;                                    \
256
24.3k
    }                                                                   \
257
12.1k
}                                                                       \
rv40dsp.c:avg_pixels8_xy2_8_c
Line
Count
Source
214
2.03k
                                              int h)                    \
215
2.03k
{                                                                       \
216
2.03k
    /* FIXME HIGH BIT DEPTH */                                          \
217
2.03k
    int j;                                                              \
218
2.03k
                                                                        \
219
6.09k
    for (j = 0; j < 2; j++) {                                           \
220
4.06k
        int i;                                                          \
221
4.06k
        const uint32_t a = AV_RN32(pixels);                             \
222
4.06k
        const uint32_t b = AV_RN32(pixels + 1);                         \
223
4.06k
        uint32_t l0 = (a & 0x03030303UL) +                              \
224
4.06k
                      (b & 0x03030303UL) +                              \
225
4.06k
                           0x02020202UL;                                \
226
4.06k
        uint32_t h0 = ((a & 0xFCFCFCFCUL) >> 2) +                       \
227
4.06k
                      ((b & 0xFCFCFCFCUL) >> 2);                        \
228
4.06k
        uint32_t l1, h1;                                                \
229
4.06k
                                                                        \
230
4.06k
        pixels += line_size;                                            \
231
31.7k
        for (i = 0; i < h; i += 2) {                                    \
232
27.6k
            uint32_t a = AV_RN32(pixels);                               \
233
27.6k
            uint32_t b = AV_RN32(pixels + 1);                           \
234
27.6k
            l1 = (a & 0x03030303UL) +                                   \
235
27.6k
                 (b & 0x03030303UL);                                    \
236
27.6k
            h1 = ((a & 0xFCFCFCFCUL) >> 2) +                            \
237
27.6k
                 ((b & 0xFCFCFCFCUL) >> 2);                             \
238
27.6k
            OP(*((uint32_t *) block),                                   \
239
27.6k
               h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));            \
240
27.6k
            pixels += line_size;                                        \
241
27.6k
            block  += line_size;                                        \
242
27.6k
            a = AV_RN32(pixels);                                        \
243
27.6k
            b = AV_RN32(pixels + 1);                                    \
244
27.6k
            l0 = (a & 0x03030303UL) +                                   \
245
27.6k
                 (b & 0x03030303UL) +                                   \
246
27.6k
                      0x02020202UL;                                     \
247
27.6k
            h0 = ((a & 0xFCFCFCFCUL) >> 2) +                            \
248
27.6k
                 ((b & 0xFCFCFCFCUL) >> 2);                             \
249
27.6k
            OP(*((uint32_t *) block),                                   \
250
27.6k
               h0 + h1 + (((l0 + l1) >> 2) & 0x0F0F0F0FUL));            \
251
27.6k
            pixels += line_size;                                        \
252
27.6k
            block  += line_size;                                        \
253
27.6k
        }                                                               \
254
4.06k
        pixels += 4 - line_size * (h + 1);                              \
255
4.06k
        block  += 4 - line_size * h;                                    \
256
4.06k
    }                                                                   \
257
2.03k
}                                                                       \
258
                                                                        \
259
CALL_2X_PIXELS(OPNAME ## _pixels16_xy2_8_c,                             \
260
               OPNAME ## _pixels8_xy2_8_c,                              \
261
               8)                                                       \
262
263
55.3k
#define op_avg(a, b) a = rnd_avg32(a, b)
264
298k
#define op_put(a, b) a = b
265
55.3k
PIXOP2(avg, op_avg)
266
298k
PIXOP2(put, op_put)
267
#undef op_avg
268
#undef op_put
269
270
static void put_rv40_qpel16_mc33_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
271
3.25k
{
272
3.25k
    put_pixels16_xy2_8_c(dst, src, stride, 16);
273
3.25k
}
274
static void avg_rv40_qpel16_mc33_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
275
714
{
276
714
    avg_pixels16_xy2_8_c(dst, src, stride, 16);
277
714
}
278
static void put_rv40_qpel8_mc33_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
279
5.65k
{
280
5.65k
    put_pixels8_xy2_8_c(dst, src, stride, 8);
281
5.65k
}
282
static void avg_rv40_qpel8_mc33_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
283
602
{
284
602
    avg_pixels8_xy2_8_c(dst, src, stride, 8);
285
602
}
286
287
attribute_visibility_hidden const int ff_rv40_bias[4][4] = {
288
    {  0, 16, 32, 16 },
289
    { 32, 28, 32, 28 },
290
    {  0, 32, 16, 32 },
291
    { 32, 28, 32, 28 }
292
};
293
294
#define RV40_CHROMA_MC(OPNAME, OP)\
295
static void OPNAME ## rv40_chroma_mc4_c(uint8_t *dst /*align 8*/,\
296
                                        const uint8_t *src /*align 1*/,\
297
460k
                                        ptrdiff_t stride, int h, int x, int y)\
298
460k
{\
299
460k
    const int A = (8-x) * (8-y);\
300
460k
    const int B = (  x) * (8-y);\
301
460k
    const int C = (8-x) * (  y);\
302
460k
    const int D = (  x) * (  y);\
303
460k
    int i;\
304
460k
    int bias = ff_rv40_bias[y>>1][x>>1];\
305
460k
    \
306
460k
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
307
460k
\
308
460k
    if(D){\
309
1.50M
        for(i = 0; i < h; i++){\
310
1.32M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
311
1.32M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
312
1.32M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
313
1.32M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
314
1.32M
            dst += stride;\
315
1.32M
            src += stride;\
316
1.32M
        }\
317
273k
    }else{\
318
273k
        const int E = B + C;\
319
273k
        const ptrdiff_t step = C ? stride : 1;\
320
2.11M
        for(i = 0; i < h; i++){\
321
1.84M
            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
322
1.84M
            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
323
1.84M
            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
324
1.84M
            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
325
1.84M
            dst += stride;\
326
1.84M
            src += stride;\
327
1.84M
        }\
328
273k
    }\
329
460k
}\
rv40dsp.c:put_rv40_chroma_mc4_c
Line
Count
Source
297
431k
                                        ptrdiff_t stride, int h, int x, int y)\
298
431k
{\
299
431k
    const int A = (8-x) * (8-y);\
300
431k
    const int B = (  x) * (8-y);\
301
431k
    const int C = (8-x) * (  y);\
302
431k
    const int D = (  x) * (  y);\
303
431k
    int i;\
304
431k
    int bias = ff_rv40_bias[y>>1][x>>1];\
305
431k
    \
306
431k
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
307
431k
\
308
431k
    if(D){\
309
1.46M
        for(i = 0; i < h; i++){\
310
1.28M
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
311
1.28M
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
312
1.28M
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
313
1.28M
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
314
1.28M
            dst += stride;\
315
1.28M
            src += stride;\
316
1.28M
        }\
317
253k
    }else{\
318
253k
        const int E = B + C;\
319
253k
        const ptrdiff_t step = C ? stride : 1;\
320
2.01M
        for(i = 0; i < h; i++){\
321
1.76M
            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
322
1.76M
            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
323
1.76M
            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
324
1.76M
            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
325
1.76M
            dst += stride;\
326
1.76M
            src += stride;\
327
1.76M
        }\
328
253k
    }\
329
431k
}\
rv40dsp.c:avg_rv40_chroma_mc4_c
Line
Count
Source
297
28.8k
                                        ptrdiff_t stride, int h, int x, int y)\
298
28.8k
{\
299
28.8k
    const int A = (8-x) * (8-y);\
300
28.8k
    const int B = (  x) * (8-y);\
301
28.8k
    const int C = (8-x) * (  y);\
302
28.8k
    const int D = (  x) * (  y);\
303
28.8k
    int i;\
304
28.8k
    int bias = ff_rv40_bias[y>>1][x>>1];\
305
28.8k
    \
306
28.8k
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
307
28.8k
\
308
28.8k
    if(D){\
309
44.0k
        for(i = 0; i < h; i++){\
310
35.2k
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
311
35.2k
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
312
35.2k
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
313
35.2k
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
314
35.2k
            dst += stride;\
315
35.2k
            src += stride;\
316
35.2k
        }\
317
20.0k
    }else{\
318
20.0k
        const int E = B + C;\
319
20.0k
        const ptrdiff_t step = C ? stride : 1;\
320
100k
        for(i = 0; i < h; i++){\
321
80.2k
            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
322
80.2k
            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
323
80.2k
            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
324
80.2k
            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
325
80.2k
            dst += stride;\
326
80.2k
            src += stride;\
327
80.2k
        }\
328
20.0k
    }\
329
28.8k
}\
330
\
331
static void OPNAME ## rv40_chroma_mc8_c(uint8_t *dst/*align 8*/,\
332
                                        const uint8_t *src/*align 1*/,\
333
7.43M
                                        ptrdiff_t stride, int h, int x, int y)\
334
7.43M
{\
335
7.43M
    const int A = (8-x) * (8-y);\
336
7.43M
    const int B = (  x) * (8-y);\
337
7.43M
    const int C = (8-x) * (  y);\
338
7.43M
    const int D = (  x) * (  y);\
339
7.43M
    int i;\
340
7.43M
    int bias = ff_rv40_bias[y>>1][x>>1];\
341
7.43M
    \
342
7.43M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
343
7.43M
\
344
7.43M
    if(D){\
345
1.08M
        for(i = 0; i < h; i++){\
346
962k
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
347
962k
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
348
962k
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
349
962k
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
350
962k
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + bias));\
351
962k
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + bias));\
352
962k
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + bias));\
353
962k
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + bias));\
354
962k
            dst += stride;\
355
962k
            src += stride;\
356
962k
        }\
357
7.30M
    }else{\
358
7.30M
        const int E = B + C;\
359
7.30M
        const ptrdiff_t step = C ? stride : 1;\
360
65.2M
        for(i = 0; i < h; i++){\
361
57.9M
            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
362
57.9M
            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
363
57.9M
            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
364
57.9M
            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
365
57.9M
            OP(dst[4], (A*src[4] + E*src[step+4] + bias));\
366
57.9M
            OP(dst[5], (A*src[5] + E*src[step+5] + bias));\
367
57.9M
            OP(dst[6], (A*src[6] + E*src[step+6] + bias));\
368
57.9M
            OP(dst[7], (A*src[7] + E*src[step+7] + bias));\
369
57.9M
            dst += stride;\
370
57.9M
            src += stride;\
371
57.9M
        }\
372
7.30M
    }\
373
7.43M
}
rv40dsp.c:put_rv40_chroma_mc8_c
Line
Count
Source
333
7.15M
                                        ptrdiff_t stride, int h, int x, int y)\
334
7.15M
{\
335
7.15M
    const int A = (8-x) * (8-y);\
336
7.15M
    const int B = (  x) * (8-y);\
337
7.15M
    const int C = (8-x) * (  y);\
338
7.15M
    const int D = (  x) * (  y);\
339
7.15M
    int i;\
340
7.15M
    int bias = ff_rv40_bias[y>>1][x>>1];\
341
7.15M
    \
342
7.15M
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
343
7.15M
\
344
7.15M
    if(D){\
345
935k
        for(i = 0; i < h; i++){\
346
827k
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
347
827k
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
348
827k
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
349
827k
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
350
827k
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + bias));\
351
827k
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + bias));\
352
827k
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + bias));\
353
827k
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + bias));\
354
827k
            dst += stride;\
355
827k
            src += stride;\
356
827k
        }\
357
7.04M
    }else{\
358
7.04M
        const int E = B + C;\
359
7.04M
        const ptrdiff_t step = C ? stride : 1;\
360
62.9M
        for(i = 0; i < h; i++){\
361
55.8M
            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
362
55.8M
            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
363
55.8M
            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
364
55.8M
            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
365
55.8M
            OP(dst[4], (A*src[4] + E*src[step+4] + bias));\
366
55.8M
            OP(dst[5], (A*src[5] + E*src[step+5] + bias));\
367
55.8M
            OP(dst[6], (A*src[6] + E*src[step+6] + bias));\
368
55.8M
            OP(dst[7], (A*src[7] + E*src[step+7] + bias));\
369
55.8M
            dst += stride;\
370
55.8M
            src += stride;\
371
55.8M
        }\
372
7.04M
    }\
373
7.15M
}
rv40dsp.c:avg_rv40_chroma_mc8_c
Line
Count
Source
333
279k
                                        ptrdiff_t stride, int h, int x, int y)\
334
279k
{\
335
279k
    const int A = (8-x) * (8-y);\
336
279k
    const int B = (  x) * (8-y);\
337
279k
    const int C = (8-x) * (  y);\
338
279k
    const int D = (  x) * (  y);\
339
279k
    int i;\
340
279k
    int bias = ff_rv40_bias[y>>1][x>>1];\
341
279k
    \
342
279k
    av_assert2(x<8 && y<8 && x>=0 && y>=0);\
343
279k
\
344
279k
    if(D){\
345
152k
        for(i = 0; i < h; i++){\
346
135k
            OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + bias));\
347
135k
            OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + bias));\
348
135k
            OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + bias));\
349
135k
            OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + bias));\
350
135k
            OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + bias));\
351
135k
            OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + bias));\
352
135k
            OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + bias));\
353
135k
            OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + bias));\
354
135k
            dst += stride;\
355
135k
            src += stride;\
356
135k
        }\
357
262k
    }else{\
358
262k
        const int E = B + C;\
359
262k
        const ptrdiff_t step = C ? stride : 1;\
360
2.36M
        for(i = 0; i < h; i++){\
361
2.10M
            OP(dst[0], (A*src[0] + E*src[step+0] + bias));\
362
2.10M
            OP(dst[1], (A*src[1] + E*src[step+1] + bias));\
363
2.10M
            OP(dst[2], (A*src[2] + E*src[step+2] + bias));\
364
2.10M
            OP(dst[3], (A*src[3] + E*src[step+3] + bias));\
365
2.10M
            OP(dst[4], (A*src[4] + E*src[step+4] + bias));\
366
2.10M
            OP(dst[5], (A*src[5] + E*src[step+5] + bias));\
367
2.10M
            OP(dst[6], (A*src[6] + E*src[step+6] + bias));\
368
2.10M
            OP(dst[7], (A*src[7] + E*src[step+7] + bias));\
369
2.10M
            dst += stride;\
370
2.10M
            src += stride;\
371
2.10M
        }\
372
262k
    }\
373
279k
}
374
375
18.3M
#define op_avg(a, b) a = (((a)+((b)>>6)+1)>>1)
376
465M
#define op_put(a, b) a = ((b)>>6)
377
378
465M
RV40_CHROMA_MC(put_, op_put)
379
18.3M
RV40_CHROMA_MC(avg_, op_avg)
380
381
#define RV40_WEIGHT_FUNC(size) \
382
70.8k
static void rv40_weight_func_rnd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
383
70.8k
{\
384
70.8k
    int i, j;\
385
70.8k
\
386
826k
    for (j = 0; j < size; j++) {\
387
9.81M
        for (i = 0; i < size; i++)\
388
9.06M
            dst[i] = ((((unsigned)w2 * src1[i]) >> 9) + (((unsigned)w1 * src2[i]) >> 9) + 0x10) >> 5;\
389
755k
        src1 += stride;\
390
755k
        src2 += stride;\
391
755k
        dst  += stride;\
392
755k
    }\
393
70.8k
}\
rv40dsp.c:rv40_weight_func_rnd_16
Line
Count
Source
382
23.6k
static void rv40_weight_func_rnd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
383
23.6k
{\
384
23.6k
    int i, j;\
385
23.6k
\
386
401k
    for (j = 0; j < size; j++) {\
387
6.41M
        for (i = 0; i < size; i++)\
388
6.04M
            dst[i] = ((((unsigned)w2 * src1[i]) >> 9) + (((unsigned)w1 * src2[i]) >> 9) + 0x10) >> 5;\
389
377k
        src1 += stride;\
390
377k
        src2 += stride;\
391
377k
        dst  += stride;\
392
377k
    }\
393
23.6k
}\
rv40dsp.c:rv40_weight_func_rnd_8
Line
Count
Source
382
47.2k
static void rv40_weight_func_rnd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
383
47.2k
{\
384
47.2k
    int i, j;\
385
47.2k
\
386
424k
    for (j = 0; j < size; j++) {\
387
3.39M
        for (i = 0; i < size; i++)\
388
3.02M
            dst[i] = ((((unsigned)w2 * src1[i]) >> 9) + (((unsigned)w1 * src2[i]) >> 9) + 0x10) >> 5;\
389
377k
        src1 += stride;\
390
377k
        src2 += stride;\
391
377k
        dst  += stride;\
392
377k
    }\
393
47.2k
}\
394
741k
static void rv40_weight_func_nornd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
395
741k
{\
396
741k
    int i, j;\
397
741k
\
398
8.64M
    for (j = 0; j < size; j++) {\
399
102M
        for (i = 0; i < size; i++)\
400
94.9M
            dst[i] = ((unsigned)w2 * src1[i] + (unsigned)w1 * src2[i] + 0x10) >> 5;\
401
7.90M
        src1 += stride;\
402
7.90M
        src2 += stride;\
403
7.90M
        dst  += stride;\
404
7.90M
    }\
405
741k
}
rv40dsp.c:rv40_weight_func_nornd_16
Line
Count
Source
394
247k
static void rv40_weight_func_nornd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
395
247k
{\
396
247k
    int i, j;\
397
247k
\
398
4.20M
    for (j = 0; j < size; j++) {\
399
67.2M
        for (i = 0; i < size; i++)\
400
63.2M
            dst[i] = ((unsigned)w2 * src1[i] + (unsigned)w1 * src2[i] + 0x10) >> 5;\
401
3.95M
        src1 += stride;\
402
3.95M
        src2 += stride;\
403
3.95M
        dst  += stride;\
404
3.95M
    }\
405
247k
}
rv40dsp.c:rv40_weight_func_nornd_8
Line
Count
Source
394
494k
static void rv40_weight_func_nornd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
395
494k
{\
396
494k
    int i, j;\
397
494k
\
398
4.44M
    for (j = 0; j < size; j++) {\
399
35.5M
        for (i = 0; i < size; i++)\
400
31.6M
            dst[i] = ((unsigned)w2 * src1[i] + (unsigned)w1 * src2[i] + 0x10) >> 5;\
401
3.95M
        src1 += stride;\
402
3.95M
        src2 += stride;\
403
3.95M
        dst  += stride;\
404
3.95M
    }\
405
494k
}
406
407
RV40_WEIGHT_FUNC(16)
408
RV40_WEIGHT_FUNC(8)
409
410
/**
411
 * dither values for deblocking filter - left/top values
412
 */
413
static const uint8_t rv40_dither_l[16] = {
414
    0x40, 0x50, 0x20, 0x60, 0x30, 0x50, 0x40, 0x30,
415
    0x50, 0x40, 0x50, 0x30, 0x60, 0x20, 0x50, 0x40
416
};
417
418
/**
419
 * dither values for deblocking filter - right/bottom values
420
 */
421
static const uint8_t rv40_dither_r[16] = {
422
    0x40, 0x30, 0x60, 0x20, 0x50, 0x30, 0x30, 0x40,
423
    0x40, 0x40, 0x50, 0x30, 0x20, 0x60, 0x30, 0x40
424
};
425
426
149M
#define CLIP_SYMM(a, b) av_clip(a, -(b), b)
427
/**
428
 * weaker deblocking very similar to the one described in 4.4.2 of JVT-A003r1
429
 */
430
static av_always_inline void rv40_weak_loop_filter(uint8_t *src,
431
                                                   const int step,
432
                                                   const ptrdiff_t stride,
433
                                                   const int filter_p1,
434
                                                   const int filter_q1,
435
                                                   const int alpha,
436
                                                   const int beta,
437
                                                   const int lim_p0q0,
438
                                                   const int lim_q1,
439
                                                   const int lim_p1)
440
53.3M
{
441
53.3M
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
442
53.3M
    int i, t, u, diff;
443
444
266M
    for (i = 0; i < 4; i++, src += stride) {
445
213M
        int diff_p1p0 = src[-2*step] - src[-1*step];
446
213M
        int diff_q1q0 = src[ 1*step] - src[ 0*step];
447
213M
        int diff_p1p2 = src[-2*step] - src[-3*step];
448
213M
        int diff_q1q2 = src[ 1*step] - src[ 2*step];
449
450
213M
        t = src[0*step] - src[-1*step];
451
213M
        if (!t)
452
150M
            continue;
453
454
62.6M
        u = (alpha * FFABS(t)) >> 7;
455
62.6M
        if (u > 3 - (filter_p1 && filter_q1))
456
5.76M
            continue;
457
458
56.8M
        t *= 1 << 2;
459
56.8M
        if (filter_p1 && filter_q1)
460
44.6M
            t += src[-2*step] - src[1*step];
461
462
56.8M
        diff = CLIP_SYMM((t + 4) >> 3, lim_p0q0);
463
56.8M
        src[-1*step] = cm[src[-1*step] + diff];
464
56.8M
        src[ 0*step] = cm[src[ 0*step] - diff];
465
466
56.8M
        if (filter_p1 && FFABS(diff_p1p2) <= beta) {
467
46.6M
            t = (diff_p1p0 + diff_p1p2 - diff) >> 1;
468
46.6M
            src[-2*step] = cm[src[-2*step] - CLIP_SYMM(t, lim_p1)];
469
46.6M
        }
470
471
56.8M
        if (filter_q1 && FFABS(diff_q1q2) <= beta) {
472
45.5M
            t = (diff_q1q0 + diff_q1q2 + diff) >> 1;
473
45.5M
            src[ 1*step] = cm[src[ 1*step] - CLIP_SYMM(t, lim_q1)];
474
45.5M
        }
475
56.8M
    }
476
53.3M
}
477
478
static void rv40_h_weak_loop_filter(uint8_t *src, const ptrdiff_t stride,
479
                                    const int filter_p1, const int filter_q1,
480
                                    const int alpha, const int beta,
481
                                    const int lim_p0q0, const int lim_q1,
482
                                    const int lim_p1)
483
26.6M
{
484
26.6M
    rv40_weak_loop_filter(src, stride, 1, filter_p1, filter_q1,
485
26.6M
                          alpha, beta, lim_p0q0, lim_q1, lim_p1);
486
26.6M
}
487
488
static void rv40_v_weak_loop_filter(uint8_t *src, const ptrdiff_t stride,
489
                                    const int filter_p1, const int filter_q1,
490
                                    const int alpha, const int beta,
491
                                    const int lim_p0q0, const int lim_q1,
492
                                    const int lim_p1)
493
26.6M
{
494
26.6M
    rv40_weak_loop_filter(src, 1, stride, filter_p1, filter_q1,
495
26.6M
                          alpha, beta, lim_p0q0, lim_q1, lim_p1);
496
26.6M
}
497
498
static av_always_inline void rv40_strong_loop_filter(uint8_t *src,
499
                                                     const int step,
500
                                                     const ptrdiff_t stride,
501
                                                     const int alpha,
502
                                                     const int lims,
503
                                                     const int dmode,
504
                                                     const int chroma)
505
19.4M
{
506
19.4M
    int i;
507
508
97.1M
    for(i = 0; i < 4; i++, src += stride){
509
77.7M
        int sflag, p0, q0, p1, q1;
510
77.7M
        int t = src[0*step] - src[-1*step];
511
512
77.7M
        if (!t)
513
58.7M
            continue;
514
515
18.9M
        sflag = (alpha * FFABS(t)) >> 7;
516
18.9M
        if (sflag > 1)
517
1.30M
            continue;
518
519
17.6M
        p0 = (25*src[-3*step] + 26*src[-2*step] + 26*src[-1*step] +
520
17.6M
              26*src[ 0*step] + 25*src[ 1*step] +
521
17.6M
              rv40_dither_l[dmode + i]) >> 7;
522
523
17.6M
        q0 = (25*src[-2*step] + 26*src[-1*step] + 26*src[ 0*step] +
524
17.6M
              26*src[ 1*step] + 25*src[ 2*step] +
525
17.6M
              rv40_dither_r[dmode + i]) >> 7;
526
527
17.6M
        if (sflag) {
528
1.63M
            p0 = av_clip(p0, src[-1*step] - lims, src[-1*step] + lims);
529
1.63M
            q0 = av_clip(q0, src[ 0*step] - lims, src[ 0*step] + lims);
530
1.63M
        }
531
532
17.6M
        p1 = (25*src[-4*step] + 26*src[-3*step] + 26*src[-2*step] + 26*p0 +
533
17.6M
              25*src[ 0*step] + rv40_dither_l[dmode + i]) >> 7;
534
17.6M
        q1 = (25*src[-1*step] + 26*q0 + 26*src[ 1*step] + 26*src[ 2*step] +
535
17.6M
              25*src[ 3*step] + rv40_dither_r[dmode + i]) >> 7;
536
537
17.6M
        if (sflag) {
538
1.63M
            p1 = av_clip(p1, src[-2*step] - lims, src[-2*step] + lims);
539
1.63M
            q1 = av_clip(q1, src[ 1*step] - lims, src[ 1*step] + lims);
540
1.63M
        }
541
542
17.6M
        src[-2*step] = p1;
543
17.6M
        src[-1*step] = p0;
544
17.6M
        src[ 0*step] = q0;
545
17.6M
        src[ 1*step] = q1;
546
547
17.6M
        if(!chroma){
548
8.79M
            src[-3*step] = (25*src[-1*step] + 26*src[-2*step] +
549
8.79M
                            51*src[-3*step] + 26*src[-4*step] + 64) >> 7;
550
8.79M
            src[ 2*step] = (25*src[ 0*step] + 26*src[ 1*step] +
551
8.79M
                            51*src[ 2*step] + 26*src[ 3*step] + 64) >> 7;
552
8.79M
        }
553
17.6M
    }
554
19.4M
}
555
556
static void rv40_h_strong_loop_filter(uint8_t *src, const ptrdiff_t stride,
557
                                      const int alpha, const int lims,
558
                                      const int dmode, const int chroma)
559
10.1M
{
560
10.1M
    rv40_strong_loop_filter(src, stride, 1, alpha, lims, dmode, chroma);
561
10.1M
}
562
563
static void rv40_v_strong_loop_filter(uint8_t *src, const ptrdiff_t stride,
564
                                      const int alpha, const int lims,
565
                                      const int dmode, const int chroma)
566
9.25M
{
567
9.25M
    rv40_strong_loop_filter(src, 1, stride, alpha, lims, dmode, chroma);
568
9.25M
}
569
570
static av_always_inline int rv40_loop_filter_strength(uint8_t *src,
571
                                                      int step, ptrdiff_t stride,
572
                                                      int beta, int beta2,
573
                                                      int edge,
574
                                                      int *p1, int *q1)
575
102M
{
576
102M
    int sum_p1p0 = 0, sum_q1q0 = 0, sum_p1p2 = 0, sum_q1q2 = 0;
577
102M
    int strong0 = 0, strong1 = 0;
578
102M
    uint8_t *ptr;
579
102M
    int i;
580
581
511M
    for (i = 0, ptr = src; i < 4; i++, ptr += stride) {
582
409M
        sum_p1p0 += ptr[-2*step] - ptr[-1*step];
583
409M
        sum_q1q0 += ptr[ 1*step] - ptr[ 0*step];
584
409M
    }
585
586
102M
    *p1 = FFABS(sum_p1p0) < (beta << 2);
587
102M
    *q1 = FFABS(sum_q1q0) < (beta << 2);
588
589
102M
    if(!*p1 && !*q1)
590
29.4M
        return 0;
591
592
72.7M
    if (!edge)
593
51.8M
        return 0;
594
595
104M
    for (i = 0, ptr = src; i < 4; i++, ptr += stride) {
596
83.8M
        sum_p1p2 += ptr[-2*step] - ptr[-3*step];
597
83.8M
        sum_q1q2 += ptr[ 1*step] - ptr[ 2*step];
598
83.8M
    }
599
600
20.9M
    strong0 = *p1 && (FFABS(sum_p1p2) < beta2);
601
20.9M
    strong1 = *q1 && (FFABS(sum_q1q2) < beta2);
602
603
20.9M
    return strong0 && strong1;
604
72.7M
}
605
606
static int rv40_h_loop_filter_strength(uint8_t *src, ptrdiff_t stride,
607
                                       int beta, int beta2, int edge,
608
                                       int *p1, int *q1)
609
51.6M
{
610
51.6M
    return rv40_loop_filter_strength(src, stride, 1, beta, beta2, edge, p1, q1);
611
51.6M
}
612
613
static int rv40_v_loop_filter_strength(uint8_t *src, ptrdiff_t stride,
614
                                       int beta, int beta2, int edge,
615
                                       int *p1, int *q1)
616
50.6M
{
617
50.6M
    return rv40_loop_filter_strength(src, 1, stride, beta, beta2, edge, p1, q1);
618
50.6M
}
619
620
av_cold void ff_rv40dsp_init(RV34DSPContext *c)
621
7.59k
{
622
7.59k
    H264QpelContext qpel;
623
624
7.59k
    ff_rv34dsp_init(c);
625
7.59k
    ff_h264qpel_init(&qpel, 8);
626
627
7.59k
    c->put_pixels_tab[0][ 0] = qpel.put_h264_qpel_pixels_tab[0][0];
628
7.59k
    c->put_pixels_tab[0][ 1] = put_rv40_qpel16_mc10_c;
629
7.59k
    c->put_pixels_tab[0][ 2] = qpel.put_h264_qpel_pixels_tab[0][2];
630
7.59k
    c->put_pixels_tab[0][ 3] = put_rv40_qpel16_mc30_c;
631
7.59k
    c->put_pixels_tab[0][ 4] = put_rv40_qpel16_mc01_c;
632
7.59k
    c->put_pixels_tab[0][ 5] = put_rv40_qpel16_mc11_c;
633
7.59k
    c->put_pixels_tab[0][ 6] = put_rv40_qpel16_mc21_c;
634
7.59k
    c->put_pixels_tab[0][ 7] = put_rv40_qpel16_mc31_c;
635
7.59k
    c->put_pixels_tab[0][ 8] = qpel.put_h264_qpel_pixels_tab[0][8];
636
7.59k
    c->put_pixels_tab[0][ 9] = put_rv40_qpel16_mc12_c;
637
7.59k
    c->put_pixels_tab[0][10] = put_rv40_qpel16_mc22_c;
638
7.59k
    c->put_pixels_tab[0][11] = put_rv40_qpel16_mc32_c;
639
7.59k
    c->put_pixels_tab[0][12] = put_rv40_qpel16_mc03_c;
640
7.59k
    c->put_pixels_tab[0][13] = put_rv40_qpel16_mc13_c;
641
7.59k
    c->put_pixels_tab[0][14] = put_rv40_qpel16_mc23_c;
642
7.59k
    c->put_pixels_tab[0][15] = put_rv40_qpel16_mc33_c;
643
7.59k
    c->avg_pixels_tab[0][ 0] = qpel.avg_h264_qpel_pixels_tab[0][0];
644
7.59k
    c->avg_pixels_tab[0][ 1] = avg_rv40_qpel16_mc10_c;
645
7.59k
    c->avg_pixels_tab[0][ 2] = qpel.avg_h264_qpel_pixels_tab[0][2];
646
7.59k
    c->avg_pixels_tab[0][ 3] = avg_rv40_qpel16_mc30_c;
647
7.59k
    c->avg_pixels_tab[0][ 4] = avg_rv40_qpel16_mc01_c;
648
7.59k
    c->avg_pixels_tab[0][ 5] = avg_rv40_qpel16_mc11_c;
649
7.59k
    c->avg_pixels_tab[0][ 6] = avg_rv40_qpel16_mc21_c;
650
7.59k
    c->avg_pixels_tab[0][ 7] = avg_rv40_qpel16_mc31_c;
651
7.59k
    c->avg_pixels_tab[0][ 8] = qpel.avg_h264_qpel_pixels_tab[0][8];
652
7.59k
    c->avg_pixels_tab[0][ 9] = avg_rv40_qpel16_mc12_c;
653
7.59k
    c->avg_pixels_tab[0][10] = avg_rv40_qpel16_mc22_c;
654
7.59k
    c->avg_pixels_tab[0][11] = avg_rv40_qpel16_mc32_c;
655
7.59k
    c->avg_pixels_tab[0][12] = avg_rv40_qpel16_mc03_c;
656
7.59k
    c->avg_pixels_tab[0][13] = avg_rv40_qpel16_mc13_c;
657
7.59k
    c->avg_pixels_tab[0][14] = avg_rv40_qpel16_mc23_c;
658
7.59k
    c->avg_pixels_tab[0][15] = avg_rv40_qpel16_mc33_c;
659
7.59k
    c->put_pixels_tab[1][ 0] = qpel.put_h264_qpel_pixels_tab[1][0];
660
7.59k
    c->put_pixels_tab[1][ 1] = put_rv40_qpel8_mc10_c;
661
7.59k
    c->put_pixels_tab[1][ 2] = qpel.put_h264_qpel_pixels_tab[1][2];
662
7.59k
    c->put_pixels_tab[1][ 3] = put_rv40_qpel8_mc30_c;
663
7.59k
    c->put_pixels_tab[1][ 4] = put_rv40_qpel8_mc01_c;
664
7.59k
    c->put_pixels_tab[1][ 5] = put_rv40_qpel8_mc11_c;
665
7.59k
    c->put_pixels_tab[1][ 6] = put_rv40_qpel8_mc21_c;
666
7.59k
    c->put_pixels_tab[1][ 7] = put_rv40_qpel8_mc31_c;
667
7.59k
    c->put_pixels_tab[1][ 8] = qpel.put_h264_qpel_pixels_tab[1][8];
668
7.59k
    c->put_pixels_tab[1][ 9] = put_rv40_qpel8_mc12_c;
669
7.59k
    c->put_pixels_tab[1][10] = put_rv40_qpel8_mc22_c;
670
7.59k
    c->put_pixels_tab[1][11] = put_rv40_qpel8_mc32_c;
671
7.59k
    c->put_pixels_tab[1][12] = put_rv40_qpel8_mc03_c;
672
7.59k
    c->put_pixels_tab[1][13] = put_rv40_qpel8_mc13_c;
673
7.59k
    c->put_pixels_tab[1][14] = put_rv40_qpel8_mc23_c;
674
7.59k
    c->put_pixels_tab[1][15] = put_rv40_qpel8_mc33_c;
675
7.59k
    c->avg_pixels_tab[1][ 0] = qpel.avg_h264_qpel_pixels_tab[1][0];
676
7.59k
    c->avg_pixels_tab[1][ 1] = avg_rv40_qpel8_mc10_c;
677
7.59k
    c->avg_pixels_tab[1][ 2] = qpel.avg_h264_qpel_pixels_tab[1][2];
678
7.59k
    c->avg_pixels_tab[1][ 3] = avg_rv40_qpel8_mc30_c;
679
7.59k
    c->avg_pixels_tab[1][ 4] = avg_rv40_qpel8_mc01_c;
680
7.59k
    c->avg_pixels_tab[1][ 5] = avg_rv40_qpel8_mc11_c;
681
7.59k
    c->avg_pixels_tab[1][ 6] = avg_rv40_qpel8_mc21_c;
682
7.59k
    c->avg_pixels_tab[1][ 7] = avg_rv40_qpel8_mc31_c;
683
7.59k
    c->avg_pixels_tab[1][ 8] = qpel.avg_h264_qpel_pixels_tab[1][8];
684
7.59k
    c->avg_pixels_tab[1][ 9] = avg_rv40_qpel8_mc12_c;
685
7.59k
    c->avg_pixels_tab[1][10] = avg_rv40_qpel8_mc22_c;
686
7.59k
    c->avg_pixels_tab[1][11] = avg_rv40_qpel8_mc32_c;
687
7.59k
    c->avg_pixels_tab[1][12] = avg_rv40_qpel8_mc03_c;
688
7.59k
    c->avg_pixels_tab[1][13] = avg_rv40_qpel8_mc13_c;
689
7.59k
    c->avg_pixels_tab[1][14] = avg_rv40_qpel8_mc23_c;
690
7.59k
    c->avg_pixels_tab[1][15] = avg_rv40_qpel8_mc33_c;
691
692
7.59k
    c->put_chroma_pixels_tab[0] = put_rv40_chroma_mc8_c;
693
7.59k
    c->put_chroma_pixels_tab[1] = put_rv40_chroma_mc4_c;
694
7.59k
    c->avg_chroma_pixels_tab[0] = avg_rv40_chroma_mc8_c;
695
7.59k
    c->avg_chroma_pixels_tab[1] = avg_rv40_chroma_mc4_c;
696
697
7.59k
    c->rv40_weight_pixels_tab[0][0] = rv40_weight_func_rnd_16;
698
7.59k
    c->rv40_weight_pixels_tab[0][1] = rv40_weight_func_rnd_8;
699
7.59k
    c->rv40_weight_pixels_tab[1][0] = rv40_weight_func_nornd_16;
700
7.59k
    c->rv40_weight_pixels_tab[1][1] = rv40_weight_func_nornd_8;
701
702
7.59k
    c->rv40_weak_loop_filter[0]     = rv40_h_weak_loop_filter;
703
7.59k
    c->rv40_weak_loop_filter[1]     = rv40_v_weak_loop_filter;
704
7.59k
    c->rv40_strong_loop_filter[0]   = rv40_h_strong_loop_filter;
705
7.59k
    c->rv40_strong_loop_filter[1]   = rv40_v_strong_loop_filter;
706
7.59k
    c->rv40_loop_filter_strength[0] = rv40_h_loop_filter_strength;
707
7.59k
    c->rv40_loop_filter_strength[1] = rv40_v_loop_filter_strength;
708
709
#if ARCH_AARCH64
710
    ff_rv40dsp_init_aarch64(c);
711
#elif ARCH_ARM
712
    ff_rv40dsp_init_arm(c);
713
#elif ARCH_RISCV
714
    ff_rv40dsp_init_riscv(c);
715
#elif ARCH_X86 && HAVE_X86ASM
716
    ff_rv40dsp_init_x86(c);
717
#endif
718
7.59k
}