Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
f9dfd984
Commit
f9dfd984
authored
Aug 29, 2006
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
combine two channels into mono for the dowmix as last step.
parent
b19ddef0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
modules/audio_filter/converter/mono.c
modules/audio_filter/converter/mono.c
+25
-1
No files found.
modules/audio_filter/converter/mono.c
View file @
f9dfd984
...
...
@@ -55,6 +55,8 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block );
static
unsigned
int
stereo_to_mono
(
aout_instance_t
*
,
aout_filter_t
*
,
aout_buffer_t
*
,
aout_buffer_t
*
);
static
unsigned
int
mono
(
aout_instance_t
*
,
aout_filter_t
*
,
aout_buffer_t
*
,
aout_buffer_t
*
);
static
void
stereo2mono_downmix
(
aout_instance_t
*
,
aout_filter_t
*
,
aout_buffer_t
*
,
aout_buffer_t
*
);
...
...
@@ -349,7 +351,7 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data,
msg_Err
(
p_this
,
"out of memory"
);
return
-
1
;
}
memset
(
p_data
->
p_overflow_buffer
,
0
,
p_data
->
i_overflow_buffer_size
);
memset
(
p_data
->
p_overflow_buffer
,
0
,
p_data
->
i_overflow_buffer_size
);
/* end */
return
0
;
...
...
@@ -526,6 +528,8 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
{
stereo2mono_downmix
(
(
aout_instance_t
*
)
p_filter
,
&
aout_filter
,
&
in_buf
,
&
out_buf
);
i_samples
=
mono
(
(
aout_instance_t
*
)
p_filter
,
&
aout_filter
,
&
out_buf
,
&
in_buf
);
}
else
{
...
...
@@ -654,6 +658,26 @@ static void stereo2mono_downmix( aout_instance_t * p_aout, aout_filter_t * p_fil
}
}
/* Simple stereo to mono mixing. */
static
unsigned
int
mono
(
aout_instance_t
*
p_aout
,
aout_filter_t
*
p_filter
,
aout_buffer_t
*
p_output
,
aout_buffer_t
*
p_input
)
{
filter_sys_t
*
p_sys
=
(
filter_sys_t
*
)
p_filter
->
p_sys
;
int16_t
*
p_in
,
*
p_out
;
unsigned
int
n
=
0
,
r
=
0
;
p_in
=
(
int16_t
*
)
p_input
->
p_buffer
;
p_out
=
(
int16_t
*
)
p_output
->
p_buffer
;
while
(
n
<
(
p_input
->
i_nb_samples
*
p_sys
->
i_nb_channels
)
)
{
p_out
[
r
]
=
(
p_in
[
n
]
+
p_in
[
n
+
1
])
>>
1
;
r
++
;
n
+=
2
;
}
return
r
;
}
/* Simple stereo to mono mixing. */
static
unsigned
int
stereo_to_mono
(
aout_instance_t
*
p_aout
,
aout_filter_t
*
p_filter
,
aout_buffer_t
*
p_output
,
aout_buffer_t
*
p_input
)
...
...
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