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
ae46fbee
Commit
ae46fbee
authored
Jun 09, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_amix: allow float planar sample format as input
parent
f0ece49e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
af_amix.c
libavfilter/af_amix.c
+15
-4
No files found.
libavfilter/af_amix.c
View file @
ae46fbee
...
...
@@ -162,6 +162,7 @@ typedef struct MixContext {
int
nb_channels
;
/**< number of channels */
int
sample_rate
;
/**< sample rate */
int
planar
;
AVAudioFifo
**
fifos
;
/**< audio fifo for each input */
uint8_t
*
input_state
;
/**< current state of each input */
float
*
input_scale
;
/**< mixing scale factor for each input */
...
...
@@ -225,6 +226,7 @@ static int config_output(AVFilterLink *outlink)
int
i
;
char
buf
[
64
];
s
->
planar
=
av_sample_fmt_is_planar
(
outlink
->
format
);
s
->
sample_rate
=
outlink
->
sample_rate
;
outlink
->
time_base
=
(
AVRational
){
1
,
outlink
->
sample_rate
};
s
->
next_pts
=
AV_NOPTS_VALUE
;
...
...
@@ -287,12 +289,20 @@ static int output_frame(AVFilterLink *outlink, int nb_samples)
for
(
i
=
0
;
i
<
s
->
nb_inputs
;
i
++
)
{
if
(
s
->
input_state
[
i
]
==
INPUT_ON
)
{
int
planes
,
plane_size
,
p
;
av_audio_fifo_read
(
s
->
fifos
[
i
],
(
void
**
)
in_buf
->
extended_data
,
nb_samples
);
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
));
planes
=
s
->
planar
?
s
->
nb_channels
:
1
;
plane_size
=
nb_samples
*
(
s
->
planar
?
1
:
s
->
nb_channels
);
plane_size
=
FFALIGN
(
plane_size
,
16
);
for
(
p
=
0
;
p
<
planes
;
p
++
)
{
s
->
fdsp
.
vector_fmac_scalar
((
float
*
)
out_buf
->
extended_data
[
p
],
(
float
*
)
in_buf
->
extended_data
[
p
],
s
->
input_scale
[
i
],
plane_size
);
}
}
}
avfilter_unref_buffer
(
in_buf
);
...
...
@@ -523,6 +533,7 @@ static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats
*
formats
=
NULL
;
ff_add_format
(
&
formats
,
AV_SAMPLE_FMT_FLT
);
ff_add_format
(
&
formats
,
AV_SAMPLE_FMT_FLTP
);
ff_set_common_formats
(
ctx
,
formats
);
ff_set_common_channel_layouts
(
ctx
,
ff_all_channel_layouts
());
ff_set_common_samplerates
(
ctx
,
ff_all_samplerates
());
...
...
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