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
97e5f060
Commit
97e5f060
authored
Jan 30, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented fi32 -> fl32/s16 conversion in format.c.
parent
5bd2bacf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
modules/audio_filter/converter/format.c
modules/audio_filter/converter/format.c
+28
-1
No files found.
modules/audio_filter/converter/format.c
View file @
97e5f060
...
@@ -356,7 +356,32 @@ static block_t *S32toFl32(filter_t *filter, block_t *b)
...
@@ -356,7 +356,32 @@ static block_t *S32toFl32(filter_t *filter, block_t *b)
*
dst
++
=
(
float
)(
*
src
++
)
/
2147483648
.
0
;
*
dst
++
=
(
float
)(
*
src
++
)
/
2147483648
.
0
;
return
b
;
return
b
;
}
}
static
block_t
*
Fi32toFl32
(
filter_t
*
filter
,
block_t
*
b
)
{
VLC_UNUSED
(
filter
);
vlc_fixed_t
*
src
=
(
vlc_fixed_t
*
)
b
->
p_buffer
;
float
*
dst
=
(
float
*
)
src
;
for
(
int
i
=
b
->
i_buffer
/
4
;
i
--
;)
*
dst
++
=
*
src
++
/
(
float
)
FIXED32_ONE
;
return
b
;
}
static
block_t
*
Fi32toS16
(
filter_t
*
filter
,
block_t
*
b
)
{
VLC_UNUSED
(
filter
);
vlc_fixed_t
*
src
=
(
vlc_fixed_t
*
)
b
->
p_buffer
;
int16_t
*
dst
=
(
int16_t
*
)
src
;
for
(
int
i
=
b
->
i_buffer
/
4
;
i
--
;)
{
const
vlc_fixed_t
v
=
*
src
++
;
if
(
v
>=
FIXED32_ONE
)
*
dst
++
=
INT16_MAX
;
else
if
(
v
<=
-
FIXED32_ONE
)
*
dst
++
=
INT16_MIN
;
else
*
dst
++
=
v
>>
(
32
-
FIXED32_FRACBITS
);
}
b
->
i_buffer
/=
2
;
return
b
;
}
/* */
/* */
static
void
X8toX16
(
block_t
*
bdst
,
const
block_t
*
bsrc
)
static
void
X8toX16
(
block_t
*
bdst
,
const
block_t
*
bsrc
)
...
@@ -473,6 +498,8 @@ static const struct {
...
@@ -473,6 +498,8 @@ static const struct {
vlc_fourcc_t
dst
;
vlc_fourcc_t
dst
;
cvt_direct_t
convert
;
cvt_direct_t
convert
;
}
cvt_directs
[]
=
{
}
cvt_directs
[]
=
{
{
VLC_CODEC_FI32
,
VLC_CODEC_FL32
,
Fi32toFl32
},
{
VLC_CODEC_FI32
,
VLC_CODEC_S16N
,
Fi32toS16
},
{
VLC_CODEC_S32N
,
VLC_CODEC_FL32
,
S32toFl32
},
{
VLC_CODEC_S32N
,
VLC_CODEC_FL32
,
S32toFl32
},
{
VLC_CODEC_S24N
,
VLC_CODEC_S16N
,
S24toS16
},
{
VLC_CODEC_S24N
,
VLC_CODEC_S16N
,
S24toS16
},
...
...
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