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
228be859
Commit
228be859
authored
Aug 12, 2002
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This conversion should make more sense.
parent
0220726f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
modules/audio_filter/converter/fixed32tofloat32.c
modules/audio_filter/converter/fixed32tofloat32.c
+19
-5
No files found.
modules/audio_filter/converter/fixed32tofloat32.c
View file @
228be859
...
...
@@ -2,7 +2,7 @@
* fixed32float32.c : converter from fixed32 to float32 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: fixed32tofloat32.c,v 1.
1 2002/08/12 20:35:18
jpsaman Exp $
* $Id: fixed32tofloat32.c,v 1.
2 2002/08/12 21:40:40
jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
...
...
@@ -90,10 +90,24 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
for
(
i
=
0
;
i
<
p_in_buf
->
i_nb_samples
*
p_filter
->
input
.
i_channels
;
i
++
)
{
// if ( *p_in >= 1.0 ) *p_out = 32767;
// else if ( *p_in < -1.0 ) *p_out = -32768;
// else *p_out = *p_in * 32768.0;
*
p_out
=
(
float
)
*
p_in
;
/* convert vlc_fixed_t into s32 */
// s32 temp;
// if ( *p_in >= 8 ) temp = 32767;
// else if ( *p_in < -8 ) temp = -32768;
// else temp = *p_in * (s32) 4096; // (32768/8);
/* convert s32 into float */
// if (temp >= 32768)
// *p_out = (float) 1.0;
// else if (temp <= -32768)
// *p_out = (float) -1.0;
// else *p_out = (float) (temp/32768.0);
/* combined conversion */
if
(
*
p_in
>=
8
)
*
p_out
=
(
float
)
1
.
0
;
else
if
(
*
p_in
<
-
8
)
*
p_out
=
(
float
)
-
1
.
0
;
else
*
p_out
=
(
float
)
(
*
p_in
/
8
.
0
);
p_in
++
;
p_out
++
;
}
...
...
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