Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
44207900
Commit
44207900
authored
Sep 26, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deal with saturation correctly for S16N volume
parent
f0ee4072
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
modules/audio_mixer/fixed32.c
modules/audio_mixer/fixed32.c
+18
-4
No files found.
modules/audio_mixer/fixed32.c
View file @
44207900
...
...
@@ -78,17 +78,31 @@ static void FilterFI32 (audio_mixer_t *mixer, block_t *block, float volume)
static
void
FilterS16N
(
audio_mixer_t
*
mixer
,
block_t
*
block
,
float
volume
)
{
const
int32_t
mult
=
volume
*
0x10000
;
int32_t
mult
=
volume
*
0x1
.
p16
;
if
(
mult
==
0x10000
)
return
;
int16_t
*
p
=
(
int16_t
*
)
block
->
p_buffer
;
for
(
size_t
n
=
block
->
i_buffer
/
sizeof
(
*
p
);
n
>
0
;
n
--
)
if
(
mult
<
0x10000
)
{
*
p
=
(
*
p
*
mult
)
>>
16
;
p
++
;
for
(
size_t
n
=
block
->
i_buffer
/
sizeof
(
*
p
);
n
>
0
;
n
--
)
{
*
p
=
(
*
p
*
mult
)
>>
16
;
p
++
;
}
}
else
{
mult
>>=
4
;
for
(
size_t
n
=
block
->
i_buffer
/
sizeof
(
*
p
);
n
>
0
;
n
--
)
{
int32_t
v
=
(
*
p
*
mult
)
>>
12
;
if
(
abs
(
v
)
>
0x7fff
)
v
=
0x8000
;
*
(
p
++
)
=
v
;
}
}
(
void
)
mixer
;
...
...
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