History

avfilter/af_afir: Move ff_afir_init() to header

This allows to inline it in af_afir.c (regardless of interposing); moreover it removes a dependency of the checkasm test on lavfi/af_afir.o.

Andreas Rheinhardt committed 4 years ago

Commit ea398201 parent 0df18f22 files · +28 −26Browse files

Showing the changes to libavfilter (2 of 2 files). Show all

Unified · Split

2 files
  1. libavfilter/af_afir.c +0 −25
  2. libavfilter/af_afirdsp.h +28 −1
libavfilter/af_afir.c+0−25
@@ -110,23 +110,6 @@ typedef struct AudioFIRContext { · 109 unmodified lines
110110 AVFloatDSPContext *fdsp;
111111 } AudioFIRContext;
112112
113−static void fcmul_add_c(float *sum, const float *t, const float *c, ptrdiff_t len)
114−{
115− int n;
116−
117− for (n = 0; n < len; n++) {
118− const float cre = c[2 * n ];
119− const float cim = c[2 * n + 1];
120− const float tre = t[2 * n ];
121− const float tim = t[2 * n + 1];
122−
123− sum[2 * n ] += tre * cre - tim * cim;
124− sum[2 * n + 1] += tre * cim + tim * cre;
125− }
126−
127− sum[2 * n] += t[2 * n] * c[2 * n];
128−}
129−
130113 static void direct(const float *in, const AVComplexFloat *ir, int len, float *out)
131114 {
132115 for (int n = 0; n < len; n++)
@@ -884,14 +867,6 @@ static int config_video(AVFilterLink *outlink) · 751 unmodified lines
884867 return 0;
885868 }
886869
887−void ff_afir_init(AudioFIRDSPContext *dsp)
888−{
889− dsp->fcmul_add = fcmul_add_c;
890−
891− if (ARCH_X86)
892− ff_afir_init_x86(dsp);
893−}
894−
895870 static av_cold int init(AVFilterContext *ctx)
896871 {
897872 AudioFIRContext *s = ctx->priv;
libavfilter/af_afirdsp.h+28−1
@@ -23,12 +23,39 @@ · 22 unmodified lines
2323
2424 #include <stddef.h>
2525
26+#include "config.h"
27+#include "libavutil/attributes.h"
28+
2629 typedef struct AudioFIRDSPContext {
2730 void (*fcmul_add)(float *sum, const float *t, const float *c,
2831 ptrdiff_t len);
2932 } AudioFIRDSPContext;
3033
31−void ff_afir_init(AudioFIRDSPContext *s);
3234 void ff_afir_init_x86(AudioFIRDSPContext *s);
3335
36+static void fcmul_add_c(float *sum, const float *t, const float *c, ptrdiff_t len)
37+{
38+ int n;
39+
40+ for (n = 0; n < len; n++) {
41+ const float cre = c[2 * n ];
42+ const float cim = c[2 * n + 1];
43+ const float tre = t[2 * n ];
44+ const float tim = t[2 * n + 1];
45+
46+ sum[2 * n ] += tre * cre - tim * cim;
47+ sum[2 * n + 1] += tre * cim + tim * cre;
48+ }
49+
50+ sum[2 * n] += t[2 * n] * c[2 * n];
51+}
52+
53+static av_unused void ff_afir_init(AudioFIRDSPContext *dsp)
54+{
55+ dsp->fcmul_add = fcmul_add_c;
56+
57+ if (ARCH_X86)
58+ ff_afir_init_x86(dsp);
59+}
60+
3461 #endif /* AVFILTER_AFIRDSP_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