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
e6690ce0
Commit
e6690ce0
authored
Dec 07, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_biquads: pass filter ctx to av_log calls
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
bd5c860f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
af_biquads.c
libavfilter/af_biquads.c
+13
-11
No files found.
libavfilter/af_biquads.c
View file @
e6690ce0
...
...
@@ -111,7 +111,7 @@ typedef struct {
ChanCache
*
cache
;
void
(
*
filter
)(
const
void
*
ibuf
,
void
*
obuf
,
int
len
,
void
(
*
filter
)(
AVFilterContext
*
ctx
,
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
);
}
BiquadsContext
;
...
...
@@ -165,7 +165,8 @@ static int query_formats(AVFilterContext *ctx)
}
#define BIQUAD_FILTER(name, type, min, max, need_clipping) \
static void biquad_## name (const void *input, void *output, int len, \
static void biquad_## name (AVFilterContext *ctx, \
const void *input, void *output, int len, \
double *in1, double *in2, \
double *out1, double *out2, \
double b0, double b1, double b2, \
...
...
@@ -185,10 +186,10 @@ static void biquad_## name (const void *input, void *output, int len, \
o2 = i2 * b2 + i1 * b1 + ibuf[i] * b0 + o2 * a2 + o1 * a1; \
i2 = ibuf[i]; \
if (need_clipping && o2 < min) { \
av_log(
NULL, AV_LOG_WARNING, "clipping\n");
\
av_log(
ctx, AV_LOG_WARNING, "clipping\n");
\
obuf[i] = min; \
} else if (need_clipping && o2 > max) { \
av_log(
NULL, AV_LOG_WARNING, "clipping\n");
\
av_log(
ctx, AV_LOG_WARNING, "clipping\n");
\
obuf[i] = max; \
} else { \
obuf[i] = o2; \
...
...
@@ -197,10 +198,10 @@ static void biquad_## name (const void *input, void *output, int len, \
o1 = i1 * b2 + i2 * b1 + ibuf[i] * b0 + o1 * a2 + o2 * a1; \
i1 = ibuf[i]; \
if (need_clipping && o1 < min) { \
av_log(
NULL, AV_LOG_WARNING, "clipping\n");
\
av_log(
ctx, AV_LOG_WARNING, "clipping\n");
\
obuf[i] = min; \
} else if (need_clipping && o1 > max) { \
av_log(
NULL, AV_LOG_WARNING, "clipping\n");
\
av_log(
ctx, AV_LOG_WARNING, "clipping\n");
\
obuf[i] = max; \
} else { \
obuf[i] = o1; \
...
...
@@ -213,10 +214,10 @@ static void biquad_## name (const void *input, void *output, int len, \
o2 = o1; \
o1 = o0; \
if (need_clipping && o0 < min) { \
av_log(
NULL, AV_LOG_WARNING, "clipping\n");
\
av_log(
ctx, AV_LOG_WARNING, "clipping\n");
\
obuf[i] = min; \
} else if (need_clipping && o0 > max) { \
av_log(
NULL, AV_LOG_WARNING, "clipping\n");
\
av_log(
ctx, AV_LOG_WARNING, "clipping\n");
\
obuf[i] = max; \
} else { \
obuf[i] = o0; \
...
...
@@ -391,8 +392,9 @@ static int config_output(AVFilterLink *outlink)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
buf
)
{
BiquadsContext
*
s
=
inlink
->
dst
->
priv
;
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
AVFilterContext
*
ctx
=
inlink
->
dst
;
BiquadsContext
*
s
=
ctx
->
priv
;
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFrame
*
out_buf
;
int
nb_samples
=
buf
->
nb_samples
;
int
ch
;
...
...
@@ -409,7 +411,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
}
for
(
ch
=
0
;
ch
<
av_frame_get_channels
(
buf
);
ch
++
)
s
->
filter
(
buf
->
extended_data
[
ch
],
s
->
filter
(
ctx
,
buf
->
extended_data
[
ch
],
out_buf
->
extended_data
[
ch
],
nb_samples
,
&
s
->
cache
[
ch
].
i1
,
&
s
->
cache
[
ch
].
i2
,
&
s
->
cache
[
ch
].
o1
,
&
s
->
cache
[
ch
].
o2
,
...
...
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