Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
91307e82
Commit
91307e82
authored
May 30, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow float mixer to run with 1.0 multiplier
parent
c2239a91
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
modules/audio_mixer/float32.c
modules/audio_mixer/float32.c
+7
-6
No files found.
modules/audio_mixer/float32.c
View file @
91307e82
...
@@ -63,10 +63,6 @@ static int Create( vlc_object_t *p_this )
...
@@ -63,10 +63,6 @@ static int Create( vlc_object_t *p_this )
if
(
p_mixer
->
fmt
.
i_format
!=
VLC_CODEC_FL32
)
if
(
p_mixer
->
fmt
.
i_format
!=
VLC_CODEC_FL32
)
return
-
1
;
return
-
1
;
/* Use the trivial mixer when we can */
if
(
p_mixer
->
multiplier
==
1
.
0
&&
p_mixer
->
input
->
multiplier
==
1
.
0
)
return
-
1
;
p_mixer
->
mix
=
DoWork
;
p_mixer
->
mix
=
DoWork
;
return
0
;
return
0
;
}
}
...
@@ -77,6 +73,12 @@ static int Create( vlc_object_t *p_this )
...
@@ -77,6 +73,12 @@ static int Create( vlc_object_t *p_this )
static
void
ScaleWords
(
float
*
p_out
,
const
float
*
p_in
,
size_t
i_nb_words
,
static
void
ScaleWords
(
float
*
p_out
,
const
float
*
p_in
,
size_t
i_nb_words
,
float
f_multiplier
)
float
f_multiplier
)
{
{
if
(
f_multiplier
==
1
.
0
)
{
vlc_memcpy
(
p_out
,
p_in
,
i_nb_words
*
sizeof
(
float
)
);
return
;
}
for
(
size_t
i
=
0
;
i
<
i_nb_words
;
i
++
)
for
(
size_t
i
=
0
;
i
<
i_nb_words
;
i
++
)
*
p_out
++
=
*
p_in
++
*
f_multiplier
;
*
p_out
++
=
*
p_in
++
*
f_multiplier
;
}
}
...
@@ -89,12 +91,11 @@ static void ScaleWords( float * p_out, const float * p_in, size_t i_nb_words,
...
@@ -89,12 +91,11 @@ static void ScaleWords( float * p_out, const float * p_in, size_t i_nb_words,
*****************************************************************************/
*****************************************************************************/
static
void
DoWork
(
aout_mixer_t
*
p_mixer
,
aout_buffer_t
*
p_buffer
)
static
void
DoWork
(
aout_mixer_t
*
p_mixer
,
aout_buffer_t
*
p_buffer
)
{
{
const
float
f_multiplier_global
=
p_mixer
->
multiplier
;
const
int
i_nb_channels
=
aout_FormatNbChannels
(
&
p_mixer
->
fmt
);
const
int
i_nb_channels
=
aout_FormatNbChannels
(
&
p_mixer
->
fmt
);
int
i_nb_words
=
p_buffer
->
i_nb_samples
*
i_nb_channels
;
int
i_nb_words
=
p_buffer
->
i_nb_samples
*
i_nb_channels
;
aout_mixer_input_t
*
p_input
=
p_mixer
->
input
;
aout_mixer_input_t
*
p_input
=
p_mixer
->
input
;
float
f_multiplier
=
f_multiplier_global
*
p_input
->
multiplier
;
float
f_multiplier
=
p_mixer
->
multiplier
*
p_input
->
multiplier
;
float
*
p_out
=
(
float
*
)
p_buffer
->
p_buffer
;
float
*
p_out
=
(
float
*
)
p_buffer
->
p_buffer
;
float
*
p_in
=
(
float
*
)
p_input
->
begin
;
float
*
p_in
=
(
float
*
)
p_input
->
begin
;
...
...
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