Coverage Report

Created: 2026-05-16 07:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/ffmpeg/libavcodec/aacpsdsp_template.c
Line
Count
Source
1
/*
2
 * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
3
 *
4
 * This file is part of FFmpeg.
5
 *
6
 * FFmpeg is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * FFmpeg is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with FFmpeg; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
 *
20
 * Note: Rounding-to-nearest used unless otherwise stated
21
 *
22
 */
23
#include <stdint.h>
24
25
#include "config.h"
26
#include "libavutil/attributes.h"
27
#include "aacpsdsp.h"
28
29
static void ps_add_squares_c(INTFLOAT *restrict dst,
30
                             const INTFLOAT (*src)[2], int n)
31
3.61M
{
32
119M
    for (int i = 0; i < n; i++)
33
115M
        dst[i] += (UINTFLOAT)AAC_MADD28(src[i][0], src[i][0], src[i][1], src[i][1]);
34
3.61M
}
aacpsdsp_fixed.c:ps_add_squares_c
Line
Count
Source
31
1.77M
{
32
58.4M
    for (int i = 0; i < n; i++)
33
56.7M
        dst[i] += (UINTFLOAT)AAC_MADD28(src[i][0], src[i][0], src[i][1], src[i][1]);
34
1.77M
}
aacpsdsp_float.c:ps_add_squares_c
Line
Count
Source
31
1.84M
{
32
60.8M
    for (int i = 0; i < n; i++)
33
58.9M
        dst[i] += (UINTFLOAT)AAC_MADD28(src[i][0], src[i][0], src[i][1], src[i][1]);
34
1.84M
}
35
36
static void ps_mul_pair_single_c(INTFLOAT (*restrict dst)[2],
37
                                 INTFLOAT (*src0)[2], INTFLOAT *src1,
38
                                 int n)
39
1.90M
{
40
62.8M
    for (int i = 0; i < n; i++) {
41
60.9M
        dst[i][0] = AAC_MUL16(src0[i][0], src1[i]);
42
60.9M
        dst[i][1] = AAC_MUL16(src0[i][1], src1[i]);
43
60.9M
    }
44
1.90M
}
aacpsdsp_fixed.c:ps_mul_pair_single_c
Line
Count
Source
39
893k
{
40
29.4M
    for (int i = 0; i < n; i++) {
41
28.5M
        dst[i][0] = AAC_MUL16(src0[i][0], src1[i]);
42
28.5M
        dst[i][1] = AAC_MUL16(src0[i][1], src1[i]);
43
28.5M
    }
44
893k
}
aacpsdsp_float.c:ps_mul_pair_single_c
Line
Count
Source
39
1.01M
{
40
33.3M
    for (int i = 0; i < n; i++) {
41
32.3M
        dst[i][0] = AAC_MUL16(src0[i][0], src1[i]);
42
32.3M
        dst[i][1] = AAC_MUL16(src0[i][1], src1[i]);
43
32.3M
    }
44
1.01M
}
45
46
static void ps_hybrid_analysis_c(INTFLOAT (*restrict out)[2],
47
                                 INTFLOAT (*in)[2],
48
                                 const INTFLOAT (*filter)[8][2],
49
                                 ptrdiff_t stride, int n)
50
3.52M
{
51
3.52M
    INT64FLOAT inre0[6], inre1[6], inim0[6], inim1[6];
52
53
24.6M
    for (int j = 0; j < 6; j++) {
54
21.1M
        inre0[j] = in[j][0] + in[12 - j][0];
55
21.1M
        inre1[j] = in[j][1] - in[12 - j][1];
56
21.1M
        inim0[j] = in[j][1] + in[12 - j][1];
57
21.1M
        inim1[j] = in[j][0] - in[12 - j][0];
58
21.1M
    }
59
60
27.6M
    for (int i = 0; i < n; i++) {
61
24.1M
        INT64FLOAT sum_re = (INT64FLOAT)filter[i][6][0] * in[6][0];
62
24.1M
        INT64FLOAT sum_im = (INT64FLOAT)filter[i][6][0] * in[6][1];
63
64
168M
        for (int j = 0; j < 6; j++) {
65
144M
            sum_re += (INT64FLOAT)filter[i][j][0] * inre0[j] -
66
144M
                      (INT64FLOAT)filter[i][j][1] * inre1[j];
67
144M
            sum_im += (INT64FLOAT)filter[i][j][0] * inim0[j] +
68
144M
                      (INT64FLOAT)filter[i][j][1] * inim1[j];
69
144M
        }
70
#if USE_FIXED
71
        out[i * stride][0] = (int)((sum_re + 0x40000000) >> 31);
72
        out[i * stride][1] = (int)((sum_im + 0x40000000) >> 31);
73
#else
74
        out[i * stride][0] = sum_re;
75
        out[i * stride][1] = sum_im;
76
#endif /* USE_FIXED */
77
24.1M
    }
78
3.52M
}
aacpsdsp_fixed.c:ps_hybrid_analysis_c
Line
Count
Source
50
2.13M
{
51
2.13M
    INT64FLOAT inre0[6], inre1[6], inim0[6], inim1[6];
52
53
14.9M
    for (int j = 0; j < 6; j++) {
54
12.8M
        inre0[j] = in[j][0] + in[12 - j][0];
55
12.8M
        inre1[j] = in[j][1] - in[12 - j][1];
56
12.8M
        inim0[j] = in[j][1] + in[12 - j][1];
57
12.8M
        inim1[j] = in[j][0] - in[12 - j][0];
58
12.8M
    }
59
60
16.3M
    for (int i = 0; i < n; i++) {
61
14.2M
        INT64FLOAT sum_re = (INT64FLOAT)filter[i][6][0] * in[6][0];
62
14.2M
        INT64FLOAT sum_im = (INT64FLOAT)filter[i][6][0] * in[6][1];
63
64
99.6M
        for (int j = 0; j < 6; j++) {
65
85.3M
            sum_re += (INT64FLOAT)filter[i][j][0] * inre0[j] -
66
85.3M
                      (INT64FLOAT)filter[i][j][1] * inre1[j];
67
85.3M
            sum_im += (INT64FLOAT)filter[i][j][0] * inim0[j] +
68
85.3M
                      (INT64FLOAT)filter[i][j][1] * inim1[j];
69
85.3M
        }
70
14.2M
#if USE_FIXED
71
14.2M
        out[i * stride][0] = (int)((sum_re + 0x40000000) >> 31);
72
14.2M
        out[i * stride][1] = (int)((sum_im + 0x40000000) >> 31);
73
#else
74
        out[i * stride][0] = sum_re;
75
        out[i * stride][1] = sum_im;
76
#endif /* USE_FIXED */
77
14.2M
    }
78
2.13M
}
aacpsdsp_float.c:ps_hybrid_analysis_c
Line
Count
Source
50
1.38M
{
51
1.38M
    INT64FLOAT inre0[6], inre1[6], inim0[6], inim1[6];
52
53
9.71M
    for (int j = 0; j < 6; j++) {
54
8.32M
        inre0[j] = in[j][0] + in[12 - j][0];
55
8.32M
        inre1[j] = in[j][1] - in[12 - j][1];
56
8.32M
        inim0[j] = in[j][1] + in[12 - j][1];
57
8.32M
        inim1[j] = in[j][0] - in[12 - j][0];
58
8.32M
    }
59
60
11.2M
    for (int i = 0; i < n; i++) {
61
9.90M
        INT64FLOAT sum_re = (INT64FLOAT)filter[i][6][0] * in[6][0];
62
9.90M
        INT64FLOAT sum_im = (INT64FLOAT)filter[i][6][0] * in[6][1];
63
64
69.3M
        for (int j = 0; j < 6; j++) {
65
59.4M
            sum_re += (INT64FLOAT)filter[i][j][0] * inre0[j] -
66
59.4M
                      (INT64FLOAT)filter[i][j][1] * inre1[j];
67
59.4M
            sum_im += (INT64FLOAT)filter[i][j][0] * inim0[j] +
68
59.4M
                      (INT64FLOAT)filter[i][j][1] * inim1[j];
69
59.4M
        }
70
#if USE_FIXED
71
        out[i * stride][0] = (int)((sum_re + 0x40000000) >> 31);
72
        out[i * stride][1] = (int)((sum_im + 0x40000000) >> 31);
73
#else
74
9.90M
        out[i * stride][0] = sum_re;
75
9.90M
        out[i * stride][1] = sum_im;
76
9.90M
#endif /* USE_FIXED */
77
9.90M
    }
78
1.38M
}
79
80
static void ps_hybrid_analysis_ileave_c(INTFLOAT (*restrict out)[32][2],
81
                                        INTFLOAT L[2][38][64],
82
                                        int i, int len)
83
46.4k
{
84
2.84M
    for (; i < 64; i++) {
85
92.4M
        for (int j = 0; j < len; j++) {
86
89.6M
            out[i][j][0] = L[0][j][i];
87
89.6M
            out[i][j][1] = L[1][j][i];
88
89.6M
        }
89
2.80M
    }
90
46.4k
}
aacpsdsp_fixed.c:ps_hybrid_analysis_ileave_c
Line
Count
Source
83
21.7k
{
84
1.32M
    for (; i < 64; i++) {
85
43.1M
        for (int j = 0; j < len; j++) {
86
41.8M
            out[i][j][0] = L[0][j][i];
87
41.8M
            out[i][j][1] = L[1][j][i];
88
41.8M
        }
89
1.30M
    }
90
21.7k
}
aacpsdsp_float.c:ps_hybrid_analysis_ileave_c
Line
Count
Source
83
24.6k
{
84
1.51M
    for (; i < 64; i++) {
85
49.2M
        for (int j = 0; j < len; j++) {
86
47.7M
            out[i][j][0] = L[0][j][i];
87
47.7M
            out[i][j][1] = L[1][j][i];
88
47.7M
        }
89
1.49M
    }
90
24.6k
}
91
92
static void ps_hybrid_synthesis_deint_c(INTFLOAT out[2][38][64],
93
                                        INTFLOAT (*restrict in)[32][2],
94
                                        int i, int len)
95
92.8k
{
96
5.69M
    for (; i < 64; i++) {
97
184M
        for (int n = 0; n < len; n++) {
98
179M
            out[0][n][i] = in[i][n][0];
99
179M
            out[1][n][i] = in[i][n][1];
100
179M
        }
101
5.60M
    }
102
92.8k
}
aacpsdsp_fixed.c:ps_hybrid_synthesis_deint_c
Line
Count
Source
95
43.5k
{
96
2.65M
    for (; i < 64; i++) {
97
86.2M
        for (int n = 0; n < len; n++) {
98
83.6M
            out[0][n][i] = in[i][n][0];
99
83.6M
            out[1][n][i] = in[i][n][1];
100
83.6M
        }
101
2.61M
    }
102
43.5k
}
aacpsdsp_float.c:ps_hybrid_synthesis_deint_c
Line
Count
Source
95
49.2k
{
96
3.03M
    for (; i < 64; i++) {
97
98.5M
        for (int n = 0; n < len; n++) {
98
95.5M
            out[0][n][i] = in[i][n][0];
99
95.5M
            out[1][n][i] = in[i][n][1];
100
95.5M
        }
101
2.98M
    }
102
49.2k
}
103
104
static void ps_decorrelate_c(INTFLOAT (*out)[2], INTFLOAT (*delay)[2],
105
                             INTFLOAT (*ap_delay)[PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2],
106
                             const INTFLOAT phi_fract[2], const INTFLOAT (*Q_fract)[2],
107
                             const INTFLOAT *transient_gain,
108
                             INTFLOAT g_decay_slope,
109
                             int len)
110
1.71M
{
111
1.71M
    static const INTFLOAT a[] = { Q31(0.65143905753106f),
112
1.71M
                               Q31(0.56471812200776f),
113
1.71M
                               Q31(0.48954165955695f) };
114
1.71M
    INTFLOAT ag[PS_AP_LINKS];
115
1.71M
    int m, n;
116
117
6.84M
    for (m = 0; m < PS_AP_LINKS; m++)
118
5.13M
        ag[m] = AAC_MUL30(a[m], g_decay_slope);
119
120
56.4M
    for (n = 0; n < len; n++) {
121
54.7M
        INTFLOAT in_re = AAC_MSUB30(delay[n][0], phi_fract[0], delay[n][1], phi_fract[1]);
122
54.7M
        INTFLOAT in_im = AAC_MADD30(delay[n][0], phi_fract[1], delay[n][1], phi_fract[0]);
123
219M
        for (m = 0; m < PS_AP_LINKS; m++) {
124
164M
            INTFLOAT a_re                = AAC_MUL31(ag[m], in_re);
125
164M
            INTFLOAT a_im                = AAC_MUL31(ag[m], in_im);
126
164M
            INTFLOAT link_delay_re       = ap_delay[m][n+2-m][0];
127
164M
            INTFLOAT link_delay_im       = ap_delay[m][n+2-m][1];
128
164M
            INTFLOAT fractional_delay_re = Q_fract[m][0];
129
164M
            INTFLOAT fractional_delay_im = Q_fract[m][1];
130
164M
            INTFLOAT apd_re = in_re;
131
164M
            INTFLOAT apd_im = in_im;
132
164M
            in_re = AAC_MSUB30(link_delay_re, fractional_delay_re,
133
164M
                    link_delay_im, fractional_delay_im);
134
164M
            in_re -= (UINTFLOAT)a_re;
135
164M
            in_im = AAC_MADD30(link_delay_re, fractional_delay_im,
136
164M
                    link_delay_im, fractional_delay_re);
137
164M
            in_im -= (UINTFLOAT)a_im;
138
164M
            ap_delay[m][n+5][0] = apd_re + (UINTFLOAT)AAC_MUL31(ag[m], in_re);
139
164M
            ap_delay[m][n+5][1] = apd_im + (UINTFLOAT)AAC_MUL31(ag[m], in_im);
140
164M
        }
141
54.7M
        out[n][0] = AAC_MUL16(transient_gain[n], in_re);
142
54.7M
        out[n][1] = AAC_MUL16(transient_gain[n], in_im);
143
54.7M
    }
144
1.71M
}
aacpsdsp_fixed.c:ps_decorrelate_c
Line
Count
Source
110
879k
{
111
879k
    static const INTFLOAT a[] = { Q31(0.65143905753106f),
112
879k
                               Q31(0.56471812200776f),
113
879k
                               Q31(0.48954165955695f) };
114
879k
    INTFLOAT ag[PS_AP_LINKS];
115
879k
    int m, n;
116
117
3.51M
    for (m = 0; m < PS_AP_LINKS; m++)
118
2.63M
        ag[m] = AAC_MUL30(a[m], g_decay_slope);
119
120
29.0M
    for (n = 0; n < len; n++) {
121
28.1M
        INTFLOAT in_re = AAC_MSUB30(delay[n][0], phi_fract[0], delay[n][1], phi_fract[1]);
122
28.1M
        INTFLOAT in_im = AAC_MADD30(delay[n][0], phi_fract[1], delay[n][1], phi_fract[0]);
123
112M
        for (m = 0; m < PS_AP_LINKS; m++) {
124
84.3M
            INTFLOAT a_re                = AAC_MUL31(ag[m], in_re);
125
84.3M
            INTFLOAT a_im                = AAC_MUL31(ag[m], in_im);
126
84.3M
            INTFLOAT link_delay_re       = ap_delay[m][n+2-m][0];
127
84.3M
            INTFLOAT link_delay_im       = ap_delay[m][n+2-m][1];
128
84.3M
            INTFLOAT fractional_delay_re = Q_fract[m][0];
129
84.3M
            INTFLOAT fractional_delay_im = Q_fract[m][1];
130
84.3M
            INTFLOAT apd_re = in_re;
131
84.3M
            INTFLOAT apd_im = in_im;
132
84.3M
            in_re = AAC_MSUB30(link_delay_re, fractional_delay_re,
133
84.3M
                    link_delay_im, fractional_delay_im);
134
84.3M
            in_re -= (UINTFLOAT)a_re;
135
84.3M
            in_im = AAC_MADD30(link_delay_re, fractional_delay_im,
136
84.3M
                    link_delay_im, fractional_delay_re);
137
84.3M
            in_im -= (UINTFLOAT)a_im;
138
84.3M
            ap_delay[m][n+5][0] = apd_re + (UINTFLOAT)AAC_MUL31(ag[m], in_re);
139
84.3M
            ap_delay[m][n+5][1] = apd_im + (UINTFLOAT)AAC_MUL31(ag[m], in_im);
140
84.3M
        }
141
28.1M
        out[n][0] = AAC_MUL16(transient_gain[n], in_re);
142
28.1M
        out[n][1] = AAC_MUL16(transient_gain[n], in_im);
143
28.1M
    }
144
879k
}
aacpsdsp_float.c:ps_decorrelate_c
Line
Count
Source
110
832k
{
111
832k
    static const INTFLOAT a[] = { Q31(0.65143905753106f),
112
832k
                               Q31(0.56471812200776f),
113
832k
                               Q31(0.48954165955695f) };
114
832k
    INTFLOAT ag[PS_AP_LINKS];
115
832k
    int m, n;
116
117
3.33M
    for (m = 0; m < PS_AP_LINKS; m++)
118
2.49M
        ag[m] = AAC_MUL30(a[m], g_decay_slope);
119
120
27.4M
    for (n = 0; n < len; n++) {
121
26.6M
        INTFLOAT in_re = AAC_MSUB30(delay[n][0], phi_fract[0], delay[n][1], phi_fract[1]);
122
26.6M
        INTFLOAT in_im = AAC_MADD30(delay[n][0], phi_fract[1], delay[n][1], phi_fract[0]);
123
106M
        for (m = 0; m < PS_AP_LINKS; m++) {
124
79.9M
            INTFLOAT a_re                = AAC_MUL31(ag[m], in_re);
125
79.9M
            INTFLOAT a_im                = AAC_MUL31(ag[m], in_im);
126
79.9M
            INTFLOAT link_delay_re       = ap_delay[m][n+2-m][0];
127
79.9M
            INTFLOAT link_delay_im       = ap_delay[m][n+2-m][1];
128
79.9M
            INTFLOAT fractional_delay_re = Q_fract[m][0];
129
79.9M
            INTFLOAT fractional_delay_im = Q_fract[m][1];
130
79.9M
            INTFLOAT apd_re = in_re;
131
79.9M
            INTFLOAT apd_im = in_im;
132
79.9M
            in_re = AAC_MSUB30(link_delay_re, fractional_delay_re,
133
79.9M
                    link_delay_im, fractional_delay_im);
134
79.9M
            in_re -= (UINTFLOAT)a_re;
135
79.9M
            in_im = AAC_MADD30(link_delay_re, fractional_delay_im,
136
79.9M
                    link_delay_im, fractional_delay_re);
137
79.9M
            in_im -= (UINTFLOAT)a_im;
138
79.9M
            ap_delay[m][n+5][0] = apd_re + (UINTFLOAT)AAC_MUL31(ag[m], in_re);
139
79.9M
            ap_delay[m][n+5][1] = apd_im + (UINTFLOAT)AAC_MUL31(ag[m], in_im);
140
79.9M
        }
141
26.6M
        out[n][0] = AAC_MUL16(transient_gain[n], in_re);
142
26.6M
        out[n][1] = AAC_MUL16(transient_gain[n], in_im);
143
26.6M
    }
144
832k
}
145
146
static void ps_stereo_interpolate_c(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
147
                                    INTFLOAT h[2][4], INTFLOAT h_step[2][4],
148
                                    int len)
149
2.94M
{
150
2.94M
    INTFLOAT h0 = h[0][0];
151
2.94M
    INTFLOAT h1 = h[0][1];
152
2.94M
    INTFLOAT h2 = h[0][2];
153
2.94M
    INTFLOAT h3 = h[0][3];
154
2.94M
    UINTFLOAT hs0 = h_step[0][0];
155
2.94M
    UINTFLOAT hs1 = h_step[0][1];
156
2.94M
    UINTFLOAT hs2 = h_step[0][2];
157
2.94M
    UINTFLOAT hs3 = h_step[0][3];
158
2.94M
    int n;
159
160
55.0M
    for (n = 0; n < len; n++) {
161
        //l is s, r is d
162
52.1M
        INTFLOAT l_re = l[n][0];
163
52.1M
        INTFLOAT l_im = l[n][1];
164
52.1M
        INTFLOAT r_re = r[n][0];
165
52.1M
        INTFLOAT r_im = r[n][1];
166
52.1M
        h0 += hs0;
167
52.1M
        h1 += hs1;
168
52.1M
        h2 += hs2;
169
52.1M
        h3 += hs3;
170
52.1M
        l[n][0] = AAC_MADD30(h0, l_re, h2, r_re);
171
52.1M
        l[n][1] = AAC_MADD30(h0, l_im, h2, r_im);
172
52.1M
        r[n][0] = AAC_MADD30(h1, l_re, h3, r_re);
173
52.1M
        r[n][1] = AAC_MADD30(h1, l_im, h3, r_im);
174
52.1M
    }
175
2.94M
}
aacpsdsp_fixed.c:ps_stereo_interpolate_c
Line
Count
Source
149
1.89M
{
150
1.89M
    INTFLOAT h0 = h[0][0];
151
1.89M
    INTFLOAT h1 = h[0][1];
152
1.89M
    INTFLOAT h2 = h[0][2];
153
1.89M
    INTFLOAT h3 = h[0][3];
154
1.89M
    UINTFLOAT hs0 = h_step[0][0];
155
1.89M
    UINTFLOAT hs1 = h_step[0][1];
156
1.89M
    UINTFLOAT hs2 = h_step[0][2];
157
1.89M
    UINTFLOAT hs3 = h_step[0][3];
158
1.89M
    int n;
159
160
36.3M
    for (n = 0; n < len; n++) {
161
        //l is s, r is d
162
34.4M
        INTFLOAT l_re = l[n][0];
163
34.4M
        INTFLOAT l_im = l[n][1];
164
34.4M
        INTFLOAT r_re = r[n][0];
165
34.4M
        INTFLOAT r_im = r[n][1];
166
34.4M
        h0 += hs0;
167
34.4M
        h1 += hs1;
168
34.4M
        h2 += hs2;
169
34.4M
        h3 += hs3;
170
34.4M
        l[n][0] = AAC_MADD30(h0, l_re, h2, r_re);
171
34.4M
        l[n][1] = AAC_MADD30(h0, l_im, h2, r_im);
172
34.4M
        r[n][0] = AAC_MADD30(h1, l_re, h3, r_re);
173
34.4M
        r[n][1] = AAC_MADD30(h1, l_im, h3, r_im);
174
34.4M
    }
175
1.89M
}
aacpsdsp_float.c:ps_stereo_interpolate_c
Line
Count
Source
149
1.04M
{
150
1.04M
    INTFLOAT h0 = h[0][0];
151
1.04M
    INTFLOAT h1 = h[0][1];
152
1.04M
    INTFLOAT h2 = h[0][2];
153
1.04M
    INTFLOAT h3 = h[0][3];
154
1.04M
    UINTFLOAT hs0 = h_step[0][0];
155
1.04M
    UINTFLOAT hs1 = h_step[0][1];
156
1.04M
    UINTFLOAT hs2 = h_step[0][2];
157
1.04M
    UINTFLOAT hs3 = h_step[0][3];
158
1.04M
    int n;
159
160
18.7M
    for (n = 0; n < len; n++) {
161
        //l is s, r is d
162
17.7M
        INTFLOAT l_re = l[n][0];
163
17.7M
        INTFLOAT l_im = l[n][1];
164
17.7M
        INTFLOAT r_re = r[n][0];
165
17.7M
        INTFLOAT r_im = r[n][1];
166
17.7M
        h0 += hs0;
167
17.7M
        h1 += hs1;
168
17.7M
        h2 += hs2;
169
17.7M
        h3 += hs3;
170
17.7M
        l[n][0] = AAC_MADD30(h0, l_re, h2, r_re);
171
17.7M
        l[n][1] = AAC_MADD30(h0, l_im, h2, r_im);
172
17.7M
        r[n][0] = AAC_MADD30(h1, l_re, h3, r_re);
173
17.7M
        r[n][1] = AAC_MADD30(h1, l_im, h3, r_im);
174
17.7M
    }
175
1.04M
}
176
177
static void ps_stereo_interpolate_ipdopd_c(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
178
                                           INTFLOAT h[2][4], INTFLOAT h_step[2][4],
179
                                           int len)
180
4.53M
{
181
4.53M
    INTFLOAT h00  = h[0][0],      h10  = h[1][0];
182
4.53M
    INTFLOAT h01  = h[0][1],      h11  = h[1][1];
183
4.53M
    INTFLOAT h02  = h[0][2],      h12  = h[1][2];
184
4.53M
    INTFLOAT h03  = h[0][3],      h13  = h[1][3];
185
4.53M
    UINTFLOAT hs00 = h_step[0][0], hs10 = h_step[1][0];
186
4.53M
    UINTFLOAT hs01 = h_step[0][1], hs11 = h_step[1][1];
187
4.53M
    UINTFLOAT hs02 = h_step[0][2], hs12 = h_step[1][2];
188
4.53M
    UINTFLOAT hs03 = h_step[0][3], hs13 = h_step[1][3];
189
4.53M
    int n;
190
191
68.1M
    for (n = 0; n < len; n++) {
192
        //l is s, r is d
193
63.5M
        INTFLOAT l_re = l[n][0];
194
63.5M
        INTFLOAT l_im = l[n][1];
195
63.5M
        INTFLOAT r_re = r[n][0];
196
63.5M
        INTFLOAT r_im = r[n][1];
197
63.5M
        h00 += hs00;
198
63.5M
        h01 += hs01;
199
63.5M
        h02 += hs02;
200
63.5M
        h03 += hs03;
201
63.5M
        h10 += hs10;
202
63.5M
        h11 += hs11;
203
63.5M
        h12 += hs12;
204
63.5M
        h13 += hs13;
205
206
63.5M
        l[n][0] = AAC_MSUB30_V8(h00, l_re, h02, r_re, h10, l_im, h12, r_im);
207
63.5M
        l[n][1] = AAC_MADD30_V8(h00, l_im, h02, r_im, h10, l_re, h12, r_re);
208
63.5M
        r[n][0] = AAC_MSUB30_V8(h01, l_re, h03, r_re, h11, l_im, h13, r_im);
209
63.5M
        r[n][1] = AAC_MADD30_V8(h01, l_im, h03, r_im, h11, l_re, h13, r_re);
210
63.5M
    }
211
4.53M
}
aacpsdsp_fixed.c:ps_stereo_interpolate_ipdopd_c
Line
Count
Source
180
1.12M
{
181
1.12M
    INTFLOAT h00  = h[0][0],      h10  = h[1][0];
182
1.12M
    INTFLOAT h01  = h[0][1],      h11  = h[1][1];
183
1.12M
    INTFLOAT h02  = h[0][2],      h12  = h[1][2];
184
1.12M
    INTFLOAT h03  = h[0][3],      h13  = h[1][3];
185
1.12M
    UINTFLOAT hs00 = h_step[0][0], hs10 = h_step[1][0];
186
1.12M
    UINTFLOAT hs01 = h_step[0][1], hs11 = h_step[1][1];
187
1.12M
    UINTFLOAT hs02 = h_step[0][2], hs12 = h_step[1][2];
188
1.12M
    UINTFLOAT hs03 = h_step[0][3], hs13 = h_step[1][3];
189
1.12M
    int n;
190
191
23.4M
    for (n = 0; n < len; n++) {
192
        //l is s, r is d
193
22.3M
        INTFLOAT l_re = l[n][0];
194
22.3M
        INTFLOAT l_im = l[n][1];
195
22.3M
        INTFLOAT r_re = r[n][0];
196
22.3M
        INTFLOAT r_im = r[n][1];
197
22.3M
        h00 += hs00;
198
22.3M
        h01 += hs01;
199
22.3M
        h02 += hs02;
200
22.3M
        h03 += hs03;
201
22.3M
        h10 += hs10;
202
22.3M
        h11 += hs11;
203
22.3M
        h12 += hs12;
204
22.3M
        h13 += hs13;
205
206
22.3M
        l[n][0] = AAC_MSUB30_V8(h00, l_re, h02, r_re, h10, l_im, h12, r_im);
207
22.3M
        l[n][1] = AAC_MADD30_V8(h00, l_im, h02, r_im, h10, l_re, h12, r_re);
208
22.3M
        r[n][0] = AAC_MSUB30_V8(h01, l_re, h03, r_re, h11, l_im, h13, r_im);
209
22.3M
        r[n][1] = AAC_MADD30_V8(h01, l_im, h03, r_im, h11, l_re, h13, r_re);
210
22.3M
    }
211
1.12M
}
aacpsdsp_float.c:ps_stereo_interpolate_ipdopd_c
Line
Count
Source
180
3.41M
{
181
3.41M
    INTFLOAT h00  = h[0][0],      h10  = h[1][0];
182
3.41M
    INTFLOAT h01  = h[0][1],      h11  = h[1][1];
183
3.41M
    INTFLOAT h02  = h[0][2],      h12  = h[1][2];
184
3.41M
    INTFLOAT h03  = h[0][3],      h13  = h[1][3];
185
3.41M
    UINTFLOAT hs00 = h_step[0][0], hs10 = h_step[1][0];
186
3.41M
    UINTFLOAT hs01 = h_step[0][1], hs11 = h_step[1][1];
187
3.41M
    UINTFLOAT hs02 = h_step[0][2], hs12 = h_step[1][2];
188
3.41M
    UINTFLOAT hs03 = h_step[0][3], hs13 = h_step[1][3];
189
3.41M
    int n;
190
191
44.6M
    for (n = 0; n < len; n++) {
192
        //l is s, r is d
193
41.2M
        INTFLOAT l_re = l[n][0];
194
41.2M
        INTFLOAT l_im = l[n][1];
195
41.2M
        INTFLOAT r_re = r[n][0];
196
41.2M
        INTFLOAT r_im = r[n][1];
197
41.2M
        h00 += hs00;
198
41.2M
        h01 += hs01;
199
41.2M
        h02 += hs02;
200
41.2M
        h03 += hs03;
201
41.2M
        h10 += hs10;
202
41.2M
        h11 += hs11;
203
41.2M
        h12 += hs12;
204
41.2M
        h13 += hs13;
205
206
41.2M
        l[n][0] = AAC_MSUB30_V8(h00, l_re, h02, r_re, h10, l_im, h12, r_im);
207
41.2M
        l[n][1] = AAC_MADD30_V8(h00, l_im, h02, r_im, h10, l_re, h12, r_re);
208
41.2M
        r[n][0] = AAC_MSUB30_V8(h01, l_re, h03, r_re, h11, l_im, h13, r_im);
209
41.2M
        r[n][1] = AAC_MADD30_V8(h01, l_im, h03, r_im, h11, l_re, h13, r_re);
210
41.2M
    }
211
3.41M
}
212
213
av_cold void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s)
214
148k
{
215
148k
    s->add_squares            = ps_add_squares_c;
216
148k
    s->mul_pair_single        = ps_mul_pair_single_c;
217
148k
    s->hybrid_analysis        = ps_hybrid_analysis_c;
218
148k
    s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_c;
219
148k
    s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_c;
220
148k
    s->decorrelate            = ps_decorrelate_c;
221
148k
    s->stereo_interpolate[0]  = ps_stereo_interpolate_c;
222
148k
    s->stereo_interpolate[1]  = ps_stereo_interpolate_ipdopd_c;
223
224
#if !USE_FIXED
225
#if ARCH_ARM
226
    ff_psdsp_init_arm(s);
227
#elif ARCH_AARCH64
228
    ff_psdsp_init_aarch64(s);
229
#elif ARCH_RISCV
230
    ff_psdsp_init_riscv(s);
231
#elif ARCH_X86 && HAVE_X86ASM
232
    ff_psdsp_init_x86(s);
233
#endif
234
#endif /* !USE_FIXED */
235
148k
}
ff_psdsp_init_fixed
Line
Count
Source
214
34.2k
{
215
34.2k
    s->add_squares            = ps_add_squares_c;
216
34.2k
    s->mul_pair_single        = ps_mul_pair_single_c;
217
34.2k
    s->hybrid_analysis        = ps_hybrid_analysis_c;
218
34.2k
    s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_c;
219
34.2k
    s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_c;
220
34.2k
    s->decorrelate            = ps_decorrelate_c;
221
34.2k
    s->stereo_interpolate[0]  = ps_stereo_interpolate_c;
222
34.2k
    s->stereo_interpolate[1]  = ps_stereo_interpolate_ipdopd_c;
223
224
#if !USE_FIXED
225
#if ARCH_ARM
226
    ff_psdsp_init_arm(s);
227
#elif ARCH_AARCH64
228
    ff_psdsp_init_aarch64(s);
229
#elif ARCH_RISCV
230
    ff_psdsp_init_riscv(s);
231
#elif ARCH_X86 && HAVE_X86ASM
232
    ff_psdsp_init_x86(s);
233
#endif
234
#endif /* !USE_FIXED */
235
34.2k
}
ff_psdsp_init
Line
Count
Source
214
113k
{
215
113k
    s->add_squares            = ps_add_squares_c;
216
113k
    s->mul_pair_single        = ps_mul_pair_single_c;
217
113k
    s->hybrid_analysis        = ps_hybrid_analysis_c;
218
113k
    s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_c;
219
113k
    s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_c;
220
113k
    s->decorrelate            = ps_decorrelate_c;
221
113k
    s->stereo_interpolate[0]  = ps_stereo_interpolate_c;
222
113k
    s->stereo_interpolate[1]  = ps_stereo_interpolate_ipdopd_c;
223
224
113k
#if !USE_FIXED
225
#if ARCH_ARM
226
    ff_psdsp_init_arm(s);
227
#elif ARCH_AARCH64
228
    ff_psdsp_init_aarch64(s);
229
#elif ARCH_RISCV
230
    ff_psdsp_init_riscv(s);
231
#elif ARCH_X86 && HAVE_X86ASM
232
    ff_psdsp_init_x86(s);
233
#endif
234
113k
#endif /* !USE_FIXED */
235
113k
}