Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
90ec26de
Commit
90ec26de
authored
Feb 24, 2006
by
Benjamin Pracht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a 7.x / 5.x -> 4.0 downmixing routine (for AAC mostly, for a52 this is done by liba52)
parent
d163757d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
20 deletions
+66
-20
modules/audio_filter/channel_mixer/simple.c
modules/audio_filter/channel_mixer/simple.c
+66
-20
No files found.
modules/audio_filter/channel_mixer/simple.c
View file @
90ec26de
...
...
@@ -68,9 +68,15 @@ static int Create( vlc_object_t *p_this )
return
-
1
;
}
/* Only conversion to Stereo right now */
/* Only conversion to Stereo
and 4.0
right now */
if
(
p_filter
->
output
.
i_physical_channels
!=
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
)
return
-
1
;
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
&&
p_filter
->
output
.
i_physical_channels
!=
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
)
)
{
return
-
1
;
}
/* Only from 7/7.1/5/5.1 */
if
(
(
p_filter
->
input
.
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
...
...
@@ -105,28 +111,68 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out_buf
->
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
p_in_buf
->
i_nb_bytes
*
i_output_nb
/
i_input_nb
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_MIDDLELEFT
)
for
(
i
=
p_in_buf
->
i_nb_samples
;
i
--
;
)
if
(
p_filter
->
output
.
i_physical_channels
==
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
)
{
*
p_dest
=
p_src
[
6
]
+
0
.
5
*
p_src
[
0
]
+
p_src
[
2
]
/
4
+
p_src
[
4
]
/
4
;
p_dest
++
;
*
p_dest
=
p_src
[
6
]
+
0
.
5
*
p_src
[
1
]
+
p_src
[
3
]
/
4
+
p_src
[
5
]
/
4
;
p_dest
++
;
p_src
+=
7
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_LFE
)
p_src
++
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_MIDDLELEFT
)
for
(
i
=
p_in_buf
->
i_nb_samples
;
i
--
;
)
{
*
p_dest
=
p_src
[
6
]
+
0
.
5
*
p_src
[
0
]
+
p_src
[
2
]
/
4
+
p_src
[
4
]
/
4
;
p_dest
++
;
*
p_dest
=
p_src
[
6
]
+
0
.
5
*
p_src
[
1
]
+
p_src
[
3
]
/
4
+
p_src
[
5
]
/
4
;
p_dest
++
;
p_src
+=
7
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_LFE
)
p_src
++
;
}
else
for
(
i
=
p_in_buf
->
i_nb_samples
;
i
--
;
)
{
*
p_dest
=
p_src
[
4
]
+
0
.
5
*
p_src
[
0
]
+
0
.
33
*
p_src
[
2
];
p_dest
++
;
*
p_dest
=
p_src
[
4
]
+
0
.
5
*
p_src
[
1
]
+
0
.
33
*
p_src
[
3
];
p_dest
++
;
p_src
+=
5
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_LFE
)
p_src
++
;
}
}
else
for
(
i
=
p_in_buf
->
i_nb_samples
;
i
--
;
)
{
*
p_dest
=
p_src
[
4
]
+
0
.
5
*
p_src
[
0
]
+
0
.
33
*
p_src
[
2
];
p_dest
++
;
*
p_dest
=
p_src
[
4
]
+
0
.
5
*
p_src
[
1
]
+
0
.
33
*
p_src
[
3
];
p_dest
++
;
p_src
+=
5
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_MIDDLELEFT
)
for
(
i
=
p_in_buf
->
i_nb_samples
;
i
--
;
)
{
*
p_dest
=
p_src
[
6
]
+
0
.
5
*
p_src
[
0
]
+
p_src
[
2
]
/
6
;
p_dest
++
;
*
p_dest
=
p_src
[
6
]
+
0
.
5
*
p_src
[
1
]
+
p_src
[
3
]
/
6
;
p_dest
++
;
*
p_dest
=
p_src
[
2
]
/
6
+
p_src
[
4
];
p_dest
++
;
*
p_dest
=
p_src
[
3
]
/
6
+
p_src
[
5
];
p_dest
++
;
p_src
+=
7
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_LFE
)
p_src
++
;
}
else
for
(
i
=
p_in_buf
->
i_nb_samples
;
i
--
;
)
{
*
p_dest
=
p_src
[
4
]
+
0
.
5
*
p_src
[
0
];
p_dest
++
;
*
p_dest
=
p_src
[
4
]
+
0
.
5
*
p_src
[
1
];
p_dest
++
;
*
p_dest
=
p_src
[
2
];
p_dest
++
;
*
p_dest
=
p_src
[
3
];
p_dest
++
;
p_src
+=
5
;
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_LFE
)
p_src
++
;
}
if
(
p_filter
->
input
.
i_physical_channels
&
AOUT_CHAN_LFE
)
p_src
++
;
}
}
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