Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
255feecc
Commit
255feecc
authored
May 01, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_biquads: add timeline support
parent
01204c04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
af_biquads.c
libavfilter/af_biquads.c
+15
-7
No files found.
libavfilter/af_biquads.c
View file @
255feecc
...
...
@@ -120,7 +120,8 @@ typedef struct BiquadsContext {
void
(
*
filter
)(
struct
BiquadsContext
*
s
,
const
void
*
ibuf
,
void
*
obuf
,
int
len
,
double
*
i1
,
double
*
i2
,
double
*
o1
,
double
*
o2
,
double
b0
,
double
b1
,
double
b2
,
double
a1
,
double
a2
,
int
*
clippings
);
double
b0
,
double
b1
,
double
b2
,
double
a1
,
double
a2
,
int
*
clippings
,
int
disabled
);
}
BiquadsContext
;
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
...
...
@@ -177,7 +178,8 @@ static void biquad_## name (BiquadsContext *s, \
double *in1, double *in2, \
double *out1, double *out2, \
double b0, double b1, double b2, \
double a1, double a2, int *clippings) \
double a1, double a2, int *clippings, \
int disabled) \
{ \
const type *ibuf = input; \
type *obuf = output; \
...
...
@@ -192,7 +194,9 @@ static void biquad_## name (BiquadsContext *s, \
for (i = 0; i+1 < len; i++) { \
o2 = i2 * b2 + i1 * b1 + ibuf[i] * b0 + o2 * a2 + o1 * a1; \
i2 = ibuf[i]; \
if (need_clipping && o2 < min) { \
if (disabled) { \
obuf[i] = i2; \
} else if (need_clipping && o2 < min) { \
(*clippings)++; \
obuf[i] = min; \
} else if (need_clipping && o2 > max) { \
...
...
@@ -204,7 +208,9 @@ static void biquad_## name (BiquadsContext *s, \
i++; \
o1 = i1 * b2 + i2 * b1 + ibuf[i] * b0 + o1 * a2 + o2 * a1; \
i1 = ibuf[i]; \
if (need_clipping && o1 < min) { \
if (disabled) { \
obuf[i] = i1; \
} else if (need_clipping && o1 < min) { \
(*clippings)++; \
obuf[i] = min; \
} else if (need_clipping && o1 > max) { \
...
...
@@ -220,7 +226,9 @@ static void biquad_## name (BiquadsContext *s, \
i1 = ibuf[i]; \
o2 = o1; \
o1 = o0; \
if (need_clipping && o0 < min) { \
if (disabled) { \
obuf[i] = i1; \
} else if (need_clipping && o0 < min) { \
(*clippings)++; \
obuf[i] = min; \
} else if (need_clipping && o0 > max) { \
...
...
@@ -442,7 +450,7 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int jobnr, int nb_job
s
->
filter
(
s
,
buf
->
extended_data
[
ch
],
out_buf
->
extended_data
[
ch
],
buf
->
nb_samples
,
&
s
->
cache
[
ch
].
i1
,
&
s
->
cache
[
ch
].
i2
,
&
s
->
cache
[
ch
].
o1
,
&
s
->
cache
[
ch
].
o2
,
s
->
b0
,
s
->
b1
,
s
->
b2
,
s
->
a1
,
s
->
a2
,
&
s
->
cache
[
ch
].
clippings
);
s
->
b0
,
s
->
b1
,
s
->
b2
,
s
->
a1
,
s
->
a2
,
&
s
->
cache
[
ch
].
clippings
,
ctx
->
is_disabled
);
}
return
0
;
...
...
@@ -653,7 +661,7 @@ AVFilter ff_af_##name_ = { \
.outputs = outputs, \
.priv_class = &name_##_class, \
.process_command = process_command, \
.flags = AVFILTER_FLAG_SLICE_THREADS
,
\
.flags = AVFILTER_FLAG_SLICE_THREADS
| AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
\
}
#if CONFIG_EQUALIZER_FILTER
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment