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
f0ece49e
Commit
f0ece49e
authored
Jun 09, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_amix: use AVFloatDSPContext.vector_fmac_scalar()
parent
82b2df97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
af_amix.c
libavfilter/af_amix.c
+8
-11
No files found.
libavfilter/af_amix.c
View file @
f0ece49e
...
...
@@ -32,6 +32,7 @@
#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
...
...
@@ -152,6 +153,7 @@ static int frame_list_add_frame(FrameList *frame_list, int nb_samples, int64_t p
typedef
struct
MixContext
{
const
AVClass
*
class
;
/**< class for AVOptions */
AVFloatDSPContext
fdsp
;
int
nb_inputs
;
/**< number of inputs */
int
active_inputs
;
/**< number of input currently active */
...
...
@@ -263,14 +265,6 @@ static int config_output(AVFilterLink *outlink)
return
0
;
}
/* TODO: move optimized version from DSPContext to libavutil */
static
void
vector_fmac_scalar
(
float
*
dst
,
const
float
*
src
,
float
mul
,
int
len
)
{
int
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
dst
[
i
]
+=
src
[
i
]
*
mul
;
}
/**
* Read samples from the input FIFOs, mix, and write to the output link.
*/
...
...
@@ -295,9 +289,10 @@ static int output_frame(AVFilterLink *outlink, int nb_samples)
if
(
s
->
input_state
[
i
]
==
INPUT_ON
)
{
av_audio_fifo_read
(
s
->
fifos
[
i
],
(
void
**
)
in_buf
->
extended_data
,
nb_samples
);
vector_fmac_scalar
((
float
*
)
out_buf
->
extended_data
[
0
],
(
float
*
)
in_buf
->
extended_data
[
0
],
s
->
input_scale
[
i
],
nb_samples
*
s
->
nb_channels
);
s
->
fdsp
.
vector_fmac_scalar
((
float
*
)
out_buf
->
extended_data
[
0
],
(
float
*
)
in_buf
->
extended_data
[
0
],
s
->
input_scale
[
i
],
FFALIGN
(
nb_samples
*
s
->
nb_channels
,
16
));
}
}
avfilter_unref_buffer
(
in_buf
);
...
...
@@ -500,6 +495,8 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque)
ff_insert_inpad
(
ctx
,
i
,
&
pad
);
}
avpriv_float_dsp_init
(
&
s
->
fdsp
,
0
);
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