Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
9e526213
Commit
9e526213
authored
Nov 18, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_volume: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
aa97223f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
af_volume.c
libavfilter/af_volume.c
+8
-4
af_volume.h
libavfilter/af_volume.h
+1
-1
No files found.
libavfilter/af_volume.c
View file @
9e526213
...
...
@@ -111,6 +111,11 @@ static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx)
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
VolumeContext
*
vol
=
ctx
->
priv
;
vol
->
fdsp
=
avpriv_float_dsp_alloc
(
0
);
if
(
!
vol
->
fdsp
)
return
AVERROR
(
ENOMEM
);
return
set_expr
(
&
vol
->
volume_pexpr
,
vol
->
volume_expr
,
ctx
);
}
...
...
@@ -119,6 +124,7 @@ static av_cold void uninit(AVFilterContext *ctx)
VolumeContext
*
vol
=
ctx
->
priv
;
av_expr_free
(
vol
->
volume_pexpr
);
av_opt_free
(
vol
);
av_freep
(
&
vol
->
fdsp
);
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
@@ -233,11 +239,9 @@ static av_cold void volume_init(VolumeContext *vol)
vol
->
scale_samples
=
scale_samples_s32
;
break
;
case
AV_SAMPLE_FMT_FLT
:
avpriv_float_dsp_init
(
&
vol
->
fdsp
,
0
);
vol
->
samples_align
=
4
;
break
;
case
AV_SAMPLE_FMT_DBL
:
avpriv_float_dsp_init
(
&
vol
->
fdsp
,
0
);
vol
->
samples_align
=
8
;
break
;
}
...
...
@@ -428,13 +432,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
}
}
else
if
(
av_get_packed_sample_fmt
(
vol
->
sample_fmt
)
==
AV_SAMPLE_FMT_FLT
)
{
for
(
p
=
0
;
p
<
vol
->
planes
;
p
++
)
{
vol
->
fdsp
.
vector_fmul_scalar
((
float
*
)
out_buf
->
extended_data
[
p
],
vol
->
fdsp
->
vector_fmul_scalar
((
float
*
)
out_buf
->
extended_data
[
p
],
(
const
float
*
)
buf
->
extended_data
[
p
],
vol
->
volume
,
plane_samples
);
}
}
else
{
for
(
p
=
0
;
p
<
vol
->
planes
;
p
++
)
{
vol
->
fdsp
.
vector_dmul_scalar
((
double
*
)
out_buf
->
extended_data
[
p
],
vol
->
fdsp
->
vector_dmul_scalar
((
double
*
)
out_buf
->
extended_data
[
p
],
(
const
double
*
)
buf
->
extended_data
[
p
],
vol
->
volume
,
plane_samples
);
}
...
...
libavfilter/af_volume.h
View file @
9e526213
...
...
@@ -67,7 +67,7 @@ enum ReplayGainType {
typedef
struct
VolumeContext
{
const
AVClass
*
class
;
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
enum
PrecisionType
precision
;
enum
EvalMode
eval_mode
;
const
char
*
volume_expr
;
...
...
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