Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
4e57a0f3
Commit
4e57a0f3
authored
Apr 27, 2023
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/afir_template: avoid multiplications if memcpy is enough
parent
19148a5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
afir_template.c
libavfilter/afir_template.c
+8
-5
No files found.
libavfilter/afir_template.c
View file @
4e57a0f3
...
...
@@ -294,6 +294,7 @@ static int fn(fir_quantum)(AVFilterContext *ctx, AVFrame *out, int ch, int ioffs
const
int
nb_samples
=
FFMIN
(
min_part_size
,
out
->
nb_samples
-
offset
);
const
int
nb_segments
=
s
->
nb_segments
[
selir
];
const
float
dry_gain
=
s
->
dry_gain
;
const
float
wet_gain
=
s
->
wet_gain
;
for
(
int
segment
=
0
;
segment
<
nb_segments
;
segment
++
)
{
AudioFIRSegment
*
seg
=
&
s
->
seg
[
selir
][
segment
];
...
...
@@ -310,7 +311,9 @@ static int fn(fir_quantum)(AVFilterContext *ctx, AVFrame *out, int ch, int ioffs
int
j
;
seg
->
part_index
[
ch
]
=
seg
->
part_index
[
ch
]
%
nb_partitions
;
if
(
min_part_size
>=
8
)
{
if
(
dry_gain
==
1
.
f
)
{
memcpy
(
src
+
input_offset
,
in
,
nb_samples
*
sizeof
(
*
src
));
}
else
if
(
min_part_size
>=
8
)
{
#if DEPTH == 32
s
->
fdsp
->
vector_fmul_scalar
(
src
+
input_offset
,
in
,
dry_gain
,
FFALIGN
(
nb_samples
,
4
));
#else
...
...
@@ -374,19 +377,19 @@ static int fn(fir_quantum)(AVFilterContext *ctx, AVFrame *out, int ch, int ioffs
seg
->
part_index
[
ch
]
=
(
seg
->
part_index
[
ch
]
+
1
)
%
nb_partitions
;
}
if
(
s
->
wet_gain
==
1
.
f
)
if
(
wet_gain
==
1
.
f
)
return
0
;
if
(
min_part_size
>=
8
)
{
#if DEPTH == 32
s
->
fdsp
->
vector_fmul_scalar
(
ptr
,
ptr
,
s
->
wet_gain
,
FFALIGN
(
nb_samples
,
4
));
s
->
fdsp
->
vector_fmul_scalar
(
ptr
,
ptr
,
wet_gain
,
FFALIGN
(
nb_samples
,
4
));
#else
s
->
fdsp
->
vector_dmul_scalar
(
ptr
,
ptr
,
s
->
wet_gain
,
FFALIGN
(
nb_samples
,
8
));
s
->
fdsp
->
vector_dmul_scalar
(
ptr
,
ptr
,
wet_gain
,
FFALIGN
(
nb_samples
,
8
));
#endif
emms_c
();
}
else
{
for
(
int
n
=
0
;
n
<
nb_samples
;
n
++
)
ptr
[
n
]
*=
s
->
wet_gain
;
ptr
[
n
]
*=
wet_gain
;
}
return
0
;
...
...
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