History

avcodec/sbcdsp_data: Make data static

This data is only used by sbcdsp.c, so delete sbcdsp_data.h, make a header out of sbcdsp_data.c and make the data contained therein static.

Andreas Rheinhardt committed 4 years ago

Commit ca48e7b1 parent 0ce88685 files · +303 −347Browse files

Unified · Split

5 files
  1. libavcodec/Makefile +1 −1
  2. libavcodec/sbcdsp.c +10 −10
  3. libavcodec/sbcdsp.h +2 −1
  4. libavcodec/sbcdsp_data.c +0 −331
  5. libavcodec/sbcdsp_data.h +290 −4
libavcodec/Makefile+1−1
@@ -717,7 +717,7 @@ OBJS-$(CONFIG_SUBVIEWER_DECODER) += subviewerdec.o ass.o · 716 unmodified lines
717OBJS-$(CONFIG_SUNRAST_DECODER) += sunrast.o717OBJS-$(CONFIG_SUNRAST_DECODER) += sunrast.o
718OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o718OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o
719OBJS-$(CONFIG_SBC_DECODER) += sbcdec.o sbc.o719OBJS-$(CONFIG_SBC_DECODER) += sbcdec.o sbc.o
720OBJS-$(CONFIG_SBC_ENCODER) += sbcenc.o sbc.o sbcdsp.o sbcdsp_data.o720OBJS-$(CONFIG_SBC_ENCODER) += sbcenc.o sbc.o sbcdsp.o
721OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263data.o721OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263data.o
722OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o h263data.o \722OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o h263data.o \
723 h263.o ituh263enc.o723 h263.o ituh263enc.o
libavcodec/sbcdsp.c+10−10
@@ -107,26 +107,26 @@ static inline void sbc_analyze_4b_4s_simd(SBCDSPContext *s, · 106 unmodified lines
107 int16_t *x, int32_t *out, int out_stride)107 int16_t *x, int32_t *out, int out_stride)
108{108{
109 /* Analyze blocks */109 /* Analyze blocks */
110 s->sbc_analyze_4(x + 12, out, ff_sbcdsp_analysis_consts_fixed4_simd_odd);110 s->sbc_analyze_4(x + 12, out, sbcdsp_analysis_consts_fixed4_simd_odd);
111 out += out_stride;111 out += out_stride;
112 s->sbc_analyze_4(x + 8, out, ff_sbcdsp_analysis_consts_fixed4_simd_even);112 s->sbc_analyze_4(x + 8, out, sbcdsp_analysis_consts_fixed4_simd_even);
113 out += out_stride;113 out += out_stride;
114 s->sbc_analyze_4(x + 4, out, ff_sbcdsp_analysis_consts_fixed4_simd_odd);114 s->sbc_analyze_4(x + 4, out, sbcdsp_analysis_consts_fixed4_simd_odd);
115 out += out_stride;115 out += out_stride;
116 s->sbc_analyze_4(x + 0, out, ff_sbcdsp_analysis_consts_fixed4_simd_even);116 s->sbc_analyze_4(x + 0, out, sbcdsp_analysis_consts_fixed4_simd_even);
117}117}
118 118
119static inline void sbc_analyze_4b_8s_simd(SBCDSPContext *s,119static inline void sbc_analyze_4b_8s_simd(SBCDSPContext *s,
120 int16_t *x, int32_t *out, int out_stride)120 int16_t *x, int32_t *out, int out_stride)
121{121{
122 /* Analyze blocks */122 /* Analyze blocks */
123 s->sbc_analyze_8(x + 24, out, ff_sbcdsp_analysis_consts_fixed8_simd_odd);123 s->sbc_analyze_8(x + 24, out, sbcdsp_analysis_consts_fixed8_simd_odd);
124 out += out_stride;124 out += out_stride;
125 s->sbc_analyze_8(x + 16, out, ff_sbcdsp_analysis_consts_fixed8_simd_even);125 s->sbc_analyze_8(x + 16, out, sbcdsp_analysis_consts_fixed8_simd_even);
126 out += out_stride;126 out += out_stride;
127 s->sbc_analyze_8(x + 8, out, ff_sbcdsp_analysis_consts_fixed8_simd_odd);127 s->sbc_analyze_8(x + 8, out, sbcdsp_analysis_consts_fixed8_simd_odd);
128 out += out_stride;128 out += out_stride;
129 s->sbc_analyze_8(x + 0, out, ff_sbcdsp_analysis_consts_fixed8_simd_even);129 s->sbc_analyze_8(x + 0, out, sbcdsp_analysis_consts_fixed8_simd_even);
130}130}
131 131
132static inline void sbc_analyze_1b_8s_simd_even(SBCDSPContext *s,132static inline void sbc_analyze_1b_8s_simd_even(SBCDSPContext *s,
@@ -137,7 +137,7 @@ static inline void sbc_analyze_1b_8s_simd_odd(SBCDSPContext *s, · 4 unmodified lines
137 int16_t *x, int32_t *out,137 int16_t *x, int32_t *out,
138 int out_stride)138 int out_stride)
139{139{
140 s->sbc_analyze_8(x, out, ff_sbcdsp_analysis_consts_fixed8_simd_odd);140 s->sbc_analyze_8(x, out, sbcdsp_analysis_consts_fixed8_simd_odd);
141 s->sbc_analyze_8s = sbc_analyze_1b_8s_simd_even;141 s->sbc_analyze_8s = sbc_analyze_1b_8s_simd_even;
142}142}
143 143
@@ -145,7 +145,7 @@ static inline void sbc_analyze_1b_8s_simd_even(SBCDSPContext *s, · 1 unmodified line
145 int16_t *x, int32_t *out,145 int16_t *x, int32_t *out,
146 int out_stride)146 int out_stride)
147{147{
148 s->sbc_analyze_8(x, out, ff_sbcdsp_analysis_consts_fixed8_simd_even);148 s->sbc_analyze_8(x, out, sbcdsp_analysis_consts_fixed8_simd_even);
149 s->sbc_analyze_8s = sbc_analyze_1b_8s_simd_odd;149 s->sbc_analyze_8s = sbc_analyze_1b_8s_simd_odd;
150}150}
151 151
libavcodec/sbcdsp.h+2−1
@@ -32,10 +32,11 @@ · 31 unmodified lines
32#ifndef AVCODEC_SBCDSP_H32#ifndef AVCODEC_SBCDSP_H
33#define AVCODEC_SBCDSP_H33#define AVCODEC_SBCDSP_H
34 34
35#include <stdint.h>
36
35#include "libavutil/mem_internal.h"37#include "libavutil/mem_internal.h"
36 38
37#include "sbc.h"39#include "sbc.h"
38#include "sbcdsp_data.h"
39 40
40#define SCALE_OUT_BITS 1541#define SCALE_OUT_BITS 15
41#define SBC_X_BUFFER_SIZE 32842#define SBC_X_BUFFER_SIZE 328
libavcodec/sbcdsp_data.c+0−331
@@ -1,331 +0,0 @@
1/*
2 * Bluetooth low-complexity, subband codec (SBC)
3 *
4 * Copyright (C) 2017 Aurelien Jacobs <aurel@gnuage.org>
5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
7 * Copyright (C) 2004-2005 Henryk Ploetz <henryk@ploetzli.ch>
8 * Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com>
9 *
10 * This file is part of FFmpeg.
11 *
12 * FFmpeg is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * FFmpeg is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with FFmpeg; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27/**
28 * @file
29 * miscellaneous SBC tables
30 */
31
32#include "libavutil/mem_internal.h"
33
34#include "sbcdsp_data.h"
35
36#define F_PROTO(x) ((int32_t) (((x) * 2) * ((int32_t) 1 << 15) + 0.5))
37#define F_COS(x) ((int32_t) (((x) ) * ((int32_t) 1 << 15) + 0.5))
38
39/*
40 * Constant tables for the use in SIMD optimized analysis filters
41 * Each table consists of two parts:
42 * 1. reordered "proto" table
43 * 2. reordered "cos" table
44 *
45 * Due to non-symmetrical reordering, separate tables for "even"
46 * and "odd" cases are needed
47 */
48
49DECLARE_ALIGNED(SBC_ALIGN, const int16_t, ff_sbcdsp_analysis_consts_fixed4_simd_even)[40 + 16] = {
50#define C0 1.0932568993
51#define C1 1.3056875580
52#define C2 1.3056875580
53#define C3 1.6772280856
54
55#define F(x) F_PROTO(x)
56 F(0.00000000E+00 * C0), F(3.83720193E-03 * C0),
57 F(5.36548976E-04 * C1), F(2.73370904E-03 * C1),
58 F(3.06012286E-03 * C2), F(3.89205149E-03 * C2),
59 F(0.00000000E+00 * C3), -F(1.49188357E-03 * C3),
60 F(1.09137620E-02 * C0), F(2.58767811E-02 * C0),
61 F(2.04385087E-02 * C1), F(3.21939290E-02 * C1),
62 F(7.76463494E-02 * C2), F(6.13245186E-03 * C2),
63 F(0.00000000E+00 * C3), -F(2.88757392E-02 * C3),
64 F(1.35593274E-01 * C0), F(2.94315332E-01 * C0),
65 F(1.94987841E-01 * C1), F(2.81828203E-01 * C1),
66 -F(1.94987841E-01 * C2), F(2.81828203E-01 * C2),
67 F(0.00000000E+00 * C3), -F(2.46636662E-01 * C3),
68 -F(1.35593274E-01 * C0), F(2.58767811E-02 * C0),
69 -F(7.76463494E-02 * C1), F(6.13245186E-03 * C1),
70 -F(2.04385087E-02 * C2), F(3.21939290E-02 * C2),
71 F(0.00000000E+00 * C3), F(2.88217274E-02 * C3),
72 -F(1.09137620E-02 * C0), F(3.83720193E-03 * C0),
73 -F(3.06012286E-03 * C1), F(3.89205149E-03 * C1),
74 -F(5.36548976E-04 * C2), F(2.73370904E-03 * C2),
75 F(0.00000000E+00 * C3), -F(1.86581691E-03 * C3),
76#undef F
77#define F(x) F_COS(x)
78 F(0.7071067812 / C0), F(0.9238795325 / C1),
79 -F(0.7071067812 / C0), F(0.3826834324 / C1),
80 -F(0.7071067812 / C0), -F(0.3826834324 / C1),
81 F(0.7071067812 / C0), -F(0.9238795325 / C1),
82 F(0.3826834324 / C2), -F(1.0000000000 / C3),
83 -F(0.9238795325 / C2), -F(1.0000000000 / C3),
84 F(0.9238795325 / C2), -F(1.0000000000 / C3),
85 -F(0.3826834324 / C2), -F(1.0000000000 / C3),
86#undef F
87
88#undef C0
89#undef C1
90#undef C2
91#undef C3
92};
93
94DECLARE_ALIGNED(SBC_ALIGN, const int16_t, ff_sbcdsp_analysis_consts_fixed4_simd_odd)[40 + 16] = {
95#define C0 1.3056875580
96#define C1 1.6772280856
97#define C2 1.0932568993
98#define C3 1.3056875580
99
100#define F(x) F_PROTO(x)
101 F(2.73370904E-03 * C0), F(5.36548976E-04 * C0),
102 -F(1.49188357E-03 * C1), F(0.00000000E+00 * C1),
103 F(3.83720193E-03 * C2), F(1.09137620E-02 * C2),
104 F(3.89205149E-03 * C3), F(3.06012286E-03 * C3),
105 F(3.21939290E-02 * C0), F(2.04385087E-02 * C0),
106 -F(2.88757392E-02 * C1), F(0.00000000E+00 * C1),
107 F(2.58767811E-02 * C2), F(1.35593274E-01 * C2),
108 F(6.13245186E-03 * C3), F(7.76463494E-02 * C3),
109 F(2.81828203E-01 * C0), F(1.94987841E-01 * C0),
110 -F(2.46636662E-01 * C1), F(0.00000000E+00 * C1),
111 F(2.94315332E-01 * C2), -F(1.35593274E-01 * C2),
112 F(2.81828203E-01 * C3), -F(1.94987841E-01 * C3),
113 F(6.13245186E-03 * C0), -F(7.76463494E-02 * C0),
114 F(2.88217274E-02 * C1), F(0.00000000E+00 * C1),
115 F(2.58767811E-02 * C2), -F(1.09137620E-02 * C2),
116 F(3.21939290E-02 * C3), -F(2.04385087E-02 * C3),
117 F(3.89205149E-03 * C0), -F(3.06012286E-03 * C0),
118 -F(1.86581691E-03 * C1), F(0.00000000E+00 * C1),
119 F(3.83720193E-03 * C2), F(0.00000000E+00 * C2),
120 F(2.73370904E-03 * C3), -F(5.36548976E-04 * C3),
121#undef F
122#define F(x) F_COS(x)
123 F(0.9238795325 / C0), -F(1.0000000000 / C1),
124 F(0.3826834324 / C0), -F(1.0000000000 / C1),
125 -F(0.3826834324 / C0), -F(1.0000000000 / C1),
126 -F(0.9238795325 / C0), -F(1.0000000000 / C1),
127 F(0.7071067812 / C2), F(0.3826834324 / C3),
128 -F(0.7071067812 / C2), -F(0.9238795325 / C3),
129 -F(0.7071067812 / C2), F(0.9238795325 / C3),
130 F(0.7071067812 / C2), -F(0.3826834324 / C3),
131#undef F
132
133#undef C0
134#undef C1
135#undef C2
136#undef C3
137};
138
139DECLARE_ALIGNED(SBC_ALIGN, const int16_t, ff_sbcdsp_analysis_consts_fixed8_simd_even)[80 + 64] = {
140#define C0 2.7906148894
141#define C1 2.4270044280
142#define C2 2.8015616024
143#define C3 3.1710363741
144#define C4 2.5377944043
145#define C5 2.4270044280
146#define C6 2.8015616024
147#define C7 3.1710363741
148
149#define F(x) F_PROTO(x)
150 F(0.00000000E+00 * C0), F(2.01182542E-03 * C0),
151 F(1.56575398E-04 * C1), F(1.78371725E-03 * C1),
152 F(3.43256425E-04 * C2), F(1.47640169E-03 * C2),
153 F(5.54620202E-04 * C3), F(1.13992507E-03 * C3),
154 -F(8.23919506E-04 * C4), F(0.00000000E+00 * C4),
155 F(2.10371989E-03 * C5), F(3.49717454E-03 * C5),
156 F(1.99454554E-03 * C6), F(1.64973098E-03 * C6),
157 F(1.61656283E-03 * C7), F(1.78805361E-04 * C7),
158 F(5.65949473E-03 * C0), F(1.29371806E-02 * C0),
159 F(8.02941163E-03 * C1), F(1.53184106E-02 * C1),
160 F(1.04584443E-02 * C2), F(1.62208471E-02 * C2),
161 F(1.27472335E-02 * C3), F(1.59045603E-02 * C3),
162 -F(1.46525263E-02 * C4), F(0.00000000E+00 * C4),
163 F(8.85757540E-03 * C5), F(5.31873032E-02 * C5),
164 F(2.92408442E-03 * C6), F(3.90751381E-02 * C6),
165 -F(4.91578024E-03 * C7), F(2.61098752E-02 * C7),
166 F(6.79989431E-02 * C0), F(1.46955068E-01 * C0),
167 F(8.29847578E-02 * C1), F(1.45389847E-01 * C1),
168 F(9.75753918E-02 * C2), F(1.40753505E-01 * C2),
169 F(1.11196689E-01 * C3), F(1.33264415E-01 * C3),
170 -F(1.23264548E-01 * C4), F(0.00000000E+00 * C4),
171 F(1.45389847E-01 * C5), -F(8.29847578E-02 * C5),
172 F(1.40753505E-01 * C6), -F(9.75753918E-02 * C6),
173 F(1.33264415E-01 * C7), -F(1.11196689E-01 * C7),
174 -F(6.79989431E-02 * C0), F(1.29371806E-02 * C0),
175 -F(5.31873032E-02 * C1), F(8.85757540E-03 * C1),
176 -F(3.90751381E-02 * C2), F(2.92408442E-03 * C2),
177 -F(2.61098752E-02 * C3), -F(4.91578024E-03 * C3),
178 F(1.46404076E-02 * C4), F(0.00000000E+00 * C4),
179 F(1.53184106E-02 * C5), -F(8.02941163E-03 * C5),
180 F(1.62208471E-02 * C6), -F(1.04584443E-02 * C6),
181 F(1.59045603E-02 * C7), -F(1.27472335E-02 * C7),
182 -F(5.65949473E-03 * C0), F(2.01182542E-03 * C0),
183 -F(3.49717454E-03 * C1), F(2.10371989E-03 * C1),
184 -F(1.64973098E-03 * C2), F(1.99454554E-03 * C2),
185 -F(1.78805361E-04 * C3), F(1.61656283E-03 * C3),
186 -F(9.02154502E-04 * C4), F(0.00000000E+00 * C4),
187 F(1.78371725E-03 * C5), -F(1.56575398E-04 * C5),
188 F(1.47640169E-03 * C6), -F(3.43256425E-04 * C6),
189 F(1.13992507E-03 * C7), -F(5.54620202E-04 * C7),
190#undef F
191#define F(x) F_COS(x)
192 F(0.7071067812 / C0), F(0.8314696123 / C1),
193 -F(0.7071067812 / C0), -F(0.1950903220 / C1),
194 -F(0.7071067812 / C0), -F(0.9807852804 / C1),
195 F(0.7071067812 / C0), -F(0.5555702330 / C1),
196 F(0.7071067812 / C0), F(0.5555702330 / C1),
197 -F(0.7071067812 / C0), F(0.9807852804 / C1),
198 -F(0.7071067812 / C0), F(0.1950903220 / C1),
199 F(0.7071067812 / C0), -F(0.8314696123 / C1),
200 F(0.9238795325 / C2), F(0.9807852804 / C3),
201 F(0.3826834324 / C2), F(0.8314696123 / C3),
202 -F(0.3826834324 / C2), F(0.5555702330 / C3),
203 -F(0.9238795325 / C2), F(0.1950903220 / C3),
204 -F(0.9238795325 / C2), -F(0.1950903220 / C3),
205 -F(0.3826834324 / C2), -F(0.5555702330 / C3),
206 F(0.3826834324 / C2), -F(0.8314696123 / C3),
207 F(0.9238795325 / C2), -F(0.9807852804 / C3),
208 -F(1.0000000000 / C4), F(0.5555702330 / C5),
209 -F(1.0000000000 / C4), -F(0.9807852804 / C5),
210 -F(1.0000000000 / C4), F(0.1950903220 / C5),
211 -F(1.0000000000 / C4), F(0.8314696123 / C5),
212 -F(1.0000000000 / C4), -F(0.8314696123 / C5),
213 -F(1.0000000000 / C4), -F(0.1950903220 / C5),
214 -F(1.0000000000 / C4), F(0.9807852804 / C5),
215 -F(1.0000000000 / C4), -F(0.5555702330 / C5),
216 F(0.3826834324 / C6), F(0.1950903220 / C7),
217 -F(0.9238795325 / C6), -F(0.5555702330 / C7),
218 F(0.9238795325 / C6), F(0.8314696123 / C7),
219 -F(0.3826834324 / C6), -F(0.9807852804 / C7),
220 -F(0.3826834324 / C6), F(0.9807852804 / C7),
221 F(0.9238795325 / C6), -F(0.8314696123 / C7),
222 -F(0.9238795325 / C6), F(0.5555702330 / C7),
223 F(0.3826834324 / C6), -F(0.1950903220 / C7),
224#undef F
225
226#undef C0
227#undef C1
228#undef C2
229#undef C3
230#undef C4
231#undef C5
232#undef C6
233#undef C7
234};
235
236DECLARE_ALIGNED(SBC_ALIGN, const int16_t, ff_sbcdsp_analysis_consts_fixed8_simd_odd)[80 + 64] = {
237#define C0 2.5377944043
238#define C1 2.4270044280
239#define C2 2.8015616024
240#define C3 3.1710363741
241#define C4 2.7906148894
242#define C5 2.4270044280
243#define C6 2.8015616024
244#define C7 3.1710363741
245
246#define F(x) F_PROTO(x)
247 F(0.00000000E+00 * C0), -F(8.23919506E-04 * C0),
248 F(1.56575398E-04 * C1), F(1.78371725E-03 * C1),
249 F(3.43256425E-04 * C2), F(1.47640169E-03 * C2),
250 F(5.54620202E-04 * C3), F(1.13992507E-03 * C3),
251 F(2.01182542E-03 * C4), F(5.65949473E-03 * C4),
252 F(2.10371989E-03 * C5), F(3.49717454E-03 * C5),
253 F(1.99454554E-03 * C6), F(1.64973098E-03 * C6),
254 F(1.61656283E-03 * C7), F(1.78805361E-04 * C7),
255 F(0.00000000E+00 * C0), -F(1.46525263E-02 * C0),
256 F(8.02941163E-03 * C1), F(1.53184106E-02 * C1),
257 F(1.04584443E-02 * C2), F(1.62208471E-02 * C2),
258 F(1.27472335E-02 * C3), F(1.59045603E-02 * C3),
259 F(1.29371806E-02 * C4), F(6.79989431E-02 * C4),
260 F(8.85757540E-03 * C5), F(5.31873032E-02 * C5),
261 F(2.92408442E-03 * C6), F(3.90751381E-02 * C6),
262 -F(4.91578024E-03 * C7), F(2.61098752E-02 * C7),
263 F(0.00000000E+00 * C0), -F(1.23264548E-01 * C0),
264 F(8.29847578E-02 * C1), F(1.45389847E-01 * C1),
265 F(9.75753918E-02 * C2), F(1.40753505E-01 * C2),
266 F(1.11196689E-01 * C3), F(1.33264415E-01 * C3),
267 F(1.46955068E-01 * C4), -F(6.79989431E-02 * C4),
268 F(1.45389847E-01 * C5), -F(8.29847578E-02 * C5),
269 F(1.40753505E-01 * C6), -F(9.75753918E-02 * C6),
270 F(1.33264415E-01 * C7), -F(1.11196689E-01 * C7),
271 F(0.00000000E+00 * C0), F(1.46404076E-02 * C0),
272 -F(5.31873032E-02 * C1), F(8.85757540E-03 * C1),
273 -F(3.90751381E-02 * C2), F(2.92408442E-03 * C2),
274 -F(2.61098752E-02 * C3), -F(4.91578024E-03 * C3),
275 F(1.29371806E-02 * C4), -F(5.65949473E-03 * C4),
276 F(1.53184106E-02 * C5), -F(8.02941163E-03 * C5),
277 F(1.62208471E-02 * C6), -F(1.04584443E-02 * C6),
278 F(1.59045603E-02 * C7), -F(1.27472335E-02 * C7),
279 F(0.00000000E+00 * C0), -F(9.02154502E-04 * C0),
280 -F(3.49717454E-03 * C1), F(2.10371989E-03 * C1),
281 -F(1.64973098E-03 * C2), F(1.99454554E-03 * C2),
282 -F(1.78805361E-04 * C3), F(1.61656283E-03 * C3),
283 F(2.01182542E-03 * C4), F(0.00000000E+00 * C4),
284 F(1.78371725E-03 * C5), -F(1.56575398E-04 * C5),
285 F(1.47640169E-03 * C6), -F(3.43256425E-04 * C6),
286 F(1.13992507E-03 * C7), -F(5.54620202E-04 * C7),
287#undef F
288#define F(x) F_COS(x)
289 -F(1.0000000000 / C0), F(0.8314696123 / C1),
290 -F(1.0000000000 / C0), -F(0.1950903220 / C1),
291 -F(1.0000000000 / C0), -F(0.9807852804 / C1),
292 -F(1.0000000000 / C0), -F(0.5555702330 / C1),
293 -F(1.0000000000 / C0), F(0.5555702330 / C1),
294 -F(1.0000000000 / C0), F(0.9807852804 / C1),
295 -F(1.0000000000 / C0), F(0.1950903220 / C1),
296 -F(1.0000000000 / C0), -F(0.8314696123 / C1),
297 F(0.9238795325 / C2), F(0.9807852804 / C3),
298 F(0.3826834324 / C2), F(0.8314696123 / C3),
299 -F(0.3826834324 / C2), F(0.5555702330 / C3),
300 -F(0.9238795325 / C2), F(0.1950903220 / C3),
301 -F(0.9238795325 / C2), -F(0.1950903220 / C3),
302 -F(0.3826834324 / C2), -F(0.5555702330 / C3),
303 F(0.3826834324 / C2), -F(0.8314696123 / C3),
304 F(0.9238795325 / C2), -F(0.9807852804 / C3),
305 F(0.7071067812 / C4), F(0.5555702330 / C5),
306 -F(0.7071067812 / C4), -F(0.9807852804 / C5),
307 -F(0.7071067812 / C4), F(0.1950903220 / C5),
308 F(0.7071067812 / C4), F(0.8314696123 / C5),
309 F(0.7071067812 / C4), -F(0.8314696123 / C5),
310 -F(0.7071067812 / C4), -F(0.1950903220 / C5),
311 -F(0.7071067812 / C4), F(0.9807852804 / C5),
312 F(0.7071067812 / C4), -F(0.5555702330 / C5),
313 F(0.3826834324 / C6), F(0.1950903220 / C7),
314 -F(0.9238795325 / C6), -F(0.5555702330 / C7),
315 F(0.9238795325 / C6), F(0.8314696123 / C7),
316 -F(0.3826834324 / C6), -F(0.9807852804 / C7),
317 -F(0.3826834324 / C6), F(0.9807852804 / C7),
318 F(0.9238795325 / C6), -F(0.8314696123 / C7),
319 -F(0.9238795325 / C6), F(0.5555702330 / C7),
320 F(0.3826834324 / C6), -F(0.1950903220 / C7),
321#undef F
322
323#undef C0
324#undef C1
325#undef C2
326#undef C3
327#undef C4
328#undef C5
329#undef C6
330#undef C7
331};
libavcodec/sbcdsp_data.h+290−4
@@ -32,11 +32,18 @@ · 31 unmodified lines
32#ifndef AVCODEC_SBCDSP_DATA_H32#ifndef AVCODEC_SBCDSP_DATA_H
33#define AVCODEC_SBCDSP_DATA_H33#define AVCODEC_SBCDSP_DATA_H
34 34
35#include <stdint.h>
36
37#include "libavutil/mem_internal.h"
38
35#include "sbc.h"39#include "sbc.h"
36 40
37#define SBC_PROTO_FIXED_SCALE 1641#define SBC_PROTO_FIXED_SCALE 16
38#define SBC_COS_TABLE_FIXED_SCALE 1542#define SBC_COS_TABLE_FIXED_SCALE 15
39 43
44#define F_PROTO(x) ((int32_t) (((x) * 2) * ((int32_t) 1 << 15) + 0.5))
45#define F_COS(x) ((int32_t) (((x) ) * ((int32_t) 1 << 15) + 0.5))
46
40/*47/*
41 * Constant tables for the use in SIMD optimized analysis filters48 * Constant tables for the use in SIMD optimized analysis filters
42 * Each table consists of two parts:49 * Each table consists of two parts:
@@ -47,9 +54,288 @@ · 4 unmodified lines
47 * and "odd" cases are needed54 * and "odd" cases are needed
48 */55 */
49 56
50extern const int16_t ff_sbcdsp_analysis_consts_fixed4_simd_even[];57DECLARE_ALIGNED(SBC_ALIGN, static const int16_t, sbcdsp_analysis_consts_fixed4_simd_even)[40 + 16] = {
51extern const int16_t ff_sbcdsp_analysis_consts_fixed4_simd_odd[];58#define C0 1.0932568993
52extern const int16_t ff_sbcdsp_analysis_consts_fixed8_simd_even[];59#define C1 1.3056875580
53extern const int16_t ff_sbcdsp_analysis_consts_fixed8_simd_odd[];60#define C2 1.3056875580
61#define C3 1.6772280856
62
63#define F(x) F_PROTO(x)
64 F(0.00000000E+00 * C0), F(3.83720193E-03 * C0),
65 F(5.36548976E-04 * C1), F(2.73370904E-03 * C1),
66 F(3.06012286E-03 * C2), F(3.89205149E-03 * C2),
67 F(0.00000000E+00 * C3), -F(1.49188357E-03 * C3),
68 F(1.09137620E-02 * C0), F(2.58767811E-02 * C0),
69 F(2.04385087E-02 * C1), F(3.21939290E-02 * C1),
70 F(7.76463494E-02 * C2), F(6.13245186E-03 * C2),
71 F(0.00000000E+00 * C3), -F(2.88757392E-02 * C3),
72 F(1.35593274E-01 * C0), F(2.94315332E-01 * C0),
73 F(1.94987841E-01 * C1), F(2.81828203E-01 * C1),
74 -F(1.94987841E-01 * C2), F(2.81828203E-01 * C2),
75 F(0.00000000E+00 * C3), -F(2.46636662E-01 * C3),
76 -F(1.35593274E-01 * C0), F(2.58767811E-02 * C0),
77 -F(7.76463494E-02 * C1), F(6.13245186E-03 * C1),
78 -F(2.04385087E-02 * C2), F(3.21939290E-02 * C2),
79 F(0.00000000E+00 * C3), F(2.88217274E-02 * C3),
80 -F(1.09137620E-02 * C0), F(3.83720193E-03 * C0),
81 -F(3.06012286E-03 * C1), F(3.89205149E-03 * C1),
82 -F(5.36548976E-04 * C2), F(2.73370904E-03 * C2),
83 F(0.00000000E+00 * C3), -F(1.86581691E-03 * C3),
84#undef F
85#define F(x) F_COS(x)
86 F(0.7071067812 / C0), F(0.9238795325 / C1),
87 -F(0.7071067812 / C0), F(0.3826834324 / C1),
88 -F(0.7071067812 / C0), -F(0.3826834324 / C1),
89 F(0.7071067812 / C0), -F(0.9238795325 / C1),
90 F(0.3826834324 / C2), -F(1.0000000000 / C3),
91 -F(0.9238795325 / C2), -F(1.0000000000 / C3),
92 F(0.9238795325 / C2), -F(1.0000000000 / C3),
93 -F(0.3826834324 / C2), -F(1.0000000000 / C3),
94#undef F
95
96#undef C0
97#undef C1
98#undef C2
99#undef C3
100};
101
102DECLARE_ALIGNED(SBC_ALIGN, static const int16_t, sbcdsp_analysis_consts_fixed4_simd_odd)[40 + 16] = {
103#define C0 1.3056875580
104#define C1 1.6772280856
105#define C2 1.0932568993
106#define C3 1.3056875580
107
108#define F(x) F_PROTO(x)
109 F(2.73370904E-03 * C0), F(5.36548976E-04 * C0),
110 -F(1.49188357E-03 * C1), F(0.00000000E+00 * C1),
111 F(3.83720193E-03 * C2), F(1.09137620E-02 * C2),
112 F(3.89205149E-03 * C3), F(3.06012286E-03 * C3),
113 F(3.21939290E-02 * C0), F(2.04385087E-02 * C0),
114 -F(2.88757392E-02 * C1), F(0.00000000E+00 * C1),
115 F(2.58767811E-02 * C2), F(1.35593274E-01 * C2),
116 F(6.13245186E-03 * C3), F(7.76463494E-02 * C3),
117 F(2.81828203E-01 * C0), F(1.94987841E-01 * C0),
118 -F(2.46636662E-01 * C1), F(0.00000000E+00 * C1),
119 F(2.94315332E-01 * C2), -F(1.35593274E-01 * C2),
120 F(2.81828203E-01 * C3), -F(1.94987841E-01 * C3),
121 F(6.13245186E-03 * C0), -F(7.76463494E-02 * C0),
122 F(2.88217274E-02 * C1), F(0.00000000E+00 * C1),
123 F(2.58767811E-02 * C2), -F(1.09137620E-02 * C2),
124 F(3.21939290E-02 * C3), -F(2.04385087E-02 * C3),
125 F(3.89205149E-03 * C0), -F(3.06012286E-03 * C0),
126 -F(1.86581691E-03 * C1), F(0.00000000E+00 * C1),
127 F(3.83720193E-03 * C2), F(0.00000000E+00 * C2),
128 F(2.73370904E-03 * C3), -F(5.36548976E-04 * C3),
129#undef F
130#define F(x) F_COS(x)
131 F(0.9238795325 / C0), -F(1.0000000000 / C1),
132 F(0.3826834324 / C0), -F(1.0000000000 / C1),
133 -F(0.3826834324 / C0), -F(1.0000000000 / C1),
134 -F(0.9238795325 / C0), -F(1.0000000000 / C1),
135 F(0.7071067812 / C2), F(0.3826834324 / C3),
136 -F(0.7071067812 / C2), -F(0.9238795325 / C3),
137 -F(0.7071067812 / C2), F(0.9238795325 / C3),
138 F(0.7071067812 / C2), -F(0.3826834324 / C3),
139#undef F
140
141#undef C0
142#undef C1
143#undef C2
144#undef C3
145};
146
147DECLARE_ALIGNED(SBC_ALIGN, static const int16_t, sbcdsp_analysis_consts_fixed8_simd_even)[80 + 64] = {
148#define C0 2.7906148894
149#define C1 2.4270044280
150#define C2 2.8015616024
151#define C3 3.1710363741
152#define C4 2.5377944043
153#define C5 2.4270044280
154#define C6 2.8015616024
155#define C7 3.1710363741
156
157#define F(x) F_PROTO(x)
158 F(0.00000000E+00 * C0), F(2.01182542E-03 * C0),
159 F(1.56575398E-04 * C1), F(1.78371725E-03 * C1),
160 F(3.43256425E-04 * C2), F(1.47640169E-03 * C2),
161 F(5.54620202E-04 * C3), F(1.13992507E-03 * C3),
162 -F(8.23919506E-04 * C4), F(0.00000000E+00 * C4),
163 F(2.10371989E-03 * C5), F(3.49717454E-03 * C5),
164 F(1.99454554E-03 * C6), F(1.64973098E-03 * C6),
165 F(1.61656283E-03 * C7), F(1.78805361E-04 * C7),
166 F(5.65949473E-03 * C0), F(1.29371806E-02 * C0),
167 F(8.02941163E-03 * C1), F(1.53184106E-02 * C1),
168 F(1.04584443E-02 * C2), F(1.62208471E-02 * C2),
169 F(1.27472335E-02 * C3), F(1.59045603E-02 * C3),
170 -F(1.46525263E-02 * C4), F(0.00000000E+00 * C4),
171 F(8.85757540E-03 * C5), F(5.31873032E-02 * C5),
172 F(2.92408442E-03 * C6), F(3.90751381E-02 * C6),
173 -F(4.91578024E-03 * C7), F(2.61098752E-02 * C7),
174 F(6.79989431E-02 * C0), F(1.46955068E-01 * C0),
175 F(8.29847578E-02 * C1), F(1.45389847E-01 * C1),
176 F(9.75753918E-02 * C2), F(1.40753505E-01 * C2),
177 F(1.11196689E-01 * C3), F(1.33264415E-01 * C3),
178 -F(1.23264548E-01 * C4), F(0.00000000E+00 * C4),
179 F(1.45389847E-01 * C5), -F(8.29847578E-02 * C5),
180 F(1.40753505E-01 * C6), -F(9.75753918E-02 * C6),
181 F(1.33264415E-01 * C7), -F(1.11196689E-01 * C7),
182 -F(6.79989431E-02 * C0), F(1.29371806E-02 * C0),
183 -F(5.31873032E-02 * C1), F(8.85757540E-03 * C1),
184 -F(3.90751381E-02 * C2), F(2.92408442E-03 * C2),
185 -F(2.61098752E-02 * C3), -F(4.91578024E-03 * C3),
186 F(1.46404076E-02 * C4), F(0.00000000E+00 * C4),
187 F(1.53184106E-02 * C5), -F(8.02941163E-03 * C5),
188 F(1.62208471E-02 * C6), -F(1.04584443E-02 * C6),
189 F(1.59045603E-02 * C7), -F(1.27472335E-02 * C7),
190 -F(5.65949473E-03 * C0), F(2.01182542E-03 * C0),
191 -F(3.49717454E-03 * C1), F(2.10371989E-03 * C1),
192 -F(1.64973098E-03 * C2), F(1.99454554E-03 * C2),
193 -F(1.78805361E-04 * C3), F(1.61656283E-03 * C3),
194 -F(9.02154502E-04 * C4), F(0.00000000E+00 * C4),
195 F(1.78371725E-03 * C5), -F(1.56575398E-04 * C5),
196 F(1.47640169E-03 * C6), -F(3.43256425E-04 * C6),
197 F(1.13992507E-03 * C7), -F(5.54620202E-04 * C7),
198#undef F
199#define F(x) F_COS(x)
200 F(0.7071067812 / C0), F(0.8314696123 / C1),
201 -F(0.7071067812 / C0), -F(0.1950903220 / C1),
202 -F(0.7071067812 / C0), -F(0.9807852804 / C1),
203 F(0.7071067812 / C0), -F(0.5555702330 / C1),
204 F(0.7071067812 / C0), F(0.5555702330 / C1),
205 -F(0.7071067812 / C0), F(0.9807852804 / C1),
206 -F(0.7071067812 / C0), F(0.1950903220 / C1),
207 F(0.7071067812 / C0), -F(0.8314696123 / C1),
208 F(0.9238795325 / C2), F(0.9807852804 / C3),
209 F(0.3826834324 / C2), F(0.8314696123 / C3),
210 -F(0.3826834324 / C2), F(0.5555702330 / C3),
211 -F(0.9238795325 / C2), F(0.1950903220 / C3),
212 -F(0.9238795325 / C2), -F(0.1950903220 / C3),
213 -F(0.3826834324 / C2), -F(0.5555702330 / C3),
214 F(0.3826834324 / C2), -F(0.8314696123 / C3),
215 F(0.9238795325 / C2), -F(0.9807852804 / C3),
216 -F(1.0000000000 / C4), F(0.5555702330 / C5),
217 -F(1.0000000000 / C4), -F(0.9807852804 / C5),
218 -F(1.0000000000 / C4), F(0.1950903220 / C5),
219 -F(1.0000000000 / C4), F(0.8314696123 / C5),
220 -F(1.0000000000 / C4), -F(0.8314696123 / C5),
221 -F(1.0000000000 / C4), -F(0.1950903220 / C5),
222 -F(1.0000000000 / C4), F(0.9807852804 / C5),
223 -F(1.0000000000 / C4), -F(0.5555702330 / C5),
224 F(0.3826834324 / C6), F(0.1950903220 / C7),
225 -F(0.9238795325 / C6), -F(0.5555702330 / C7),
226 F(0.9238795325 / C6), F(0.8314696123 / C7),
227 -F(0.3826834324 / C6), -F(0.9807852804 / C7),
228 -F(0.3826834324 / C6), F(0.9807852804 / C7),
229 F(0.9238795325 / C6), -F(0.8314696123 / C7),
230 -F(0.9238795325 / C6), F(0.5555702330 / C7),
231 F(0.3826834324 / C6), -F(0.1950903220 / C7),
232#undef F
233
234#undef C0
235#undef C1
236#undef C2
237#undef C3
238#undef C4
239#undef C5
240#undef C6
241#undef C7
242};
243
244DECLARE_ALIGNED(SBC_ALIGN, static const int16_t, sbcdsp_analysis_consts_fixed8_simd_odd)[80 + 64] = {
245#define C0 2.5377944043
246#define C1 2.4270044280
247#define C2 2.8015616024
248#define C3 3.1710363741
249#define C4 2.7906148894
250#define C5 2.4270044280
251#define C6 2.8015616024
252#define C7 3.1710363741
253
254#define F(x) F_PROTO(x)
255 F(0.00000000E+00 * C0), -F(8.23919506E-04 * C0),
256 F(1.56575398E-04 * C1), F(1.78371725E-03 * C1),
257 F(3.43256425E-04 * C2), F(1.47640169E-03 * C2),
258 F(5.54620202E-04 * C3), F(1.13992507E-03 * C3),
259 F(2.01182542E-03 * C4), F(5.65949473E-03 * C4),
260 F(2.10371989E-03 * C5), F(3.49717454E-03 * C5),
261 F(1.99454554E-03 * C6), F(1.64973098E-03 * C6),
262 F(1.61656283E-03 * C7), F(1.78805361E-04 * C7),
263 F(0.00000000E+00 * C0), -F(1.46525263E-02 * C0),
264 F(8.02941163E-03 * C1), F(1.53184106E-02 * C1),
265 F(1.04584443E-02 * C2), F(1.62208471E-02 * C2),
266 F(1.27472335E-02 * C3), F(1.59045603E-02 * C3),
267 F(1.29371806E-02 * C4), F(6.79989431E-02 * C4),
268 F(8.85757540E-03 * C5), F(5.31873032E-02 * C5),
269 F(2.92408442E-03 * C6), F(3.90751381E-02 * C6),
270 -F(4.91578024E-03 * C7), F(2.61098752E-02 * C7),
271 F(0.00000000E+00 * C0), -F(1.23264548E-01 * C0),
272 F(8.29847578E-02 * C1), F(1.45389847E-01 * C1),
273 F(9.75753918E-02 * C2), F(1.40753505E-01 * C2),
274 F(1.11196689E-01 * C3), F(1.33264415E-01 * C3),
275 F(1.46955068E-01 * C4), -F(6.79989431E-02 * C4),
276 F(1.45389847E-01 * C5), -F(8.29847578E-02 * C5),
277 F(1.40753505E-01 * C6), -F(9.75753918E-02 * C6),
278 F(1.33264415E-01 * C7), -F(1.11196689E-01 * C7),
279 F(0.00000000E+00 * C0), F(1.46404076E-02 * C0),
280 -F(5.31873032E-02 * C1), F(8.85757540E-03 * C1),
281 -F(3.90751381E-02 * C2), F(2.92408442E-03 * C2),
282 -F(2.61098752E-02 * C3), -F(4.91578024E-03 * C3),
283 F(1.29371806E-02 * C4), -F(5.65949473E-03 * C4),
284 F(1.53184106E-02 * C5), -F(8.02941163E-03 * C5),
285 F(1.62208471E-02 * C6), -F(1.04584443E-02 * C6),
286 F(1.59045603E-02 * C7), -F(1.27472335E-02 * C7),
287 F(0.00000000E+00 * C0), -F(9.02154502E-04 * C0),
288 -F(3.49717454E-03 * C1), F(2.10371989E-03 * C1),
289 -F(1.64973098E-03 * C2), F(1.99454554E-03 * C2),
290 -F(1.78805361E-04 * C3), F(1.61656283E-03 * C3),
291 F(2.01182542E-03 * C4), F(0.00000000E+00 * C4),
292 F(1.78371725E-03 * C5), -F(1.56575398E-04 * C5),
293 F(1.47640169E-03 * C6), -F(3.43256425E-04 * C6),
294 F(1.13992507E-03 * C7), -F(5.54620202E-04 * C7),
295#undef F
296#define F(x) F_COS(x)
297 -F(1.0000000000 / C0), F(0.8314696123 / C1),
298 -F(1.0000000000 / C0), -F(0.1950903220 / C1),
299 -F(1.0000000000 / C0), -F(0.9807852804 / C1),
300 -F(1.0000000000 / C0), -F(0.5555702330 / C1),
301 -F(1.0000000000 / C0), F(0.5555702330 / C1),
302 -F(1.0000000000 / C0), F(0.9807852804 / C1),
303 -F(1.0000000000 / C0), F(0.1950903220 / C1),
304 -F(1.0000000000 / C0), -F(0.8314696123 / C1),
305 F(0.9238795325 / C2), F(0.9807852804 / C3),
306 F(0.3826834324 / C2), F(0.8314696123 / C3),
307 -F(0.3826834324 / C2), F(0.5555702330 / C3),
308 -F(0.9238795325 / C2), F(0.1950903220 / C3),
309 -F(0.9238795325 / C2), -F(0.1950903220 / C3),
310 -F(0.3826834324 / C2), -F(0.5555702330 / C3),
311 F(0.3826834324 / C2), -F(0.8314696123 / C3),
312 F(0.9238795325 / C2), -F(0.9807852804 / C3),
313 F(0.7071067812 / C4), F(0.5555702330 / C5),
314 -F(0.7071067812 / C4), -F(0.9807852804 / C5),
315 -F(0.7071067812 / C4), F(0.1950903220 / C5),
316 F(0.7071067812 / C4), F(0.8314696123 / C5),
317 F(0.7071067812 / C4), -F(0.8314696123 / C5),
318 -F(0.7071067812 / C4), -F(0.1950903220 / C5),
319 -F(0.7071067812 / C4), F(0.9807852804 / C5),
320 F(0.7071067812 / C4), -F(0.5555702330 / C5),
321 F(0.3826834324 / C6), F(0.1950903220 / C7),
322 -F(0.9238795325 / C6), -F(0.5555702330 / C7),
323 F(0.9238795325 / C6), F(0.8314696123 / C7),
324 -F(0.3826834324 / C6), -F(0.9807852804 / C7),
325 -F(0.3826834324 / C6), F(0.9807852804 / C7),
326 F(0.9238795325 / C6), -F(0.8314696123 / C7),
327 -F(0.9238795325 / C6), F(0.5555702330 / C7),
328 F(0.3826834324 / C6), -F(0.1950903220 / C7),
329#undef F
330
331#undef C0
332#undef C1
333#undef C2
334#undef C3
335#undef C4
336#undef C5
337#undef C6
338#undef C7
339};
54 340
55#endif /* AVCODEC_SBCDSP_DATA_H */341#endif /* AVCODEC_SBCDSP_DATA_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t