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
ff9fe43d
Commit
ff9fe43d
authored
Jan 30, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed: add S32N, rewrite FL32
parent
5505394d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
modules/audio_filter/converter/fixed.c
modules/audio_filter/converter/fixed.c
+33
-5
No files found.
modules/audio_filter/converter/fixed.c
View file @
ff9fe43d
...
...
@@ -76,6 +76,13 @@ static int CreateFrom( vlc_object_t *p_this )
return
VLC_SUCCESS
;;
}
union
dw
{
float
f
;
int32_t
s
;
uint32_t
u
;
};
/*****************************************************************************
* F32 to S16
*****************************************************************************/
...
...
@@ -139,6 +146,7 @@ static block_t *Do_F32ToS16( filter_t * p_filter, block_t * p_in_buf )
/*** Conversions from decoders to FI32 */
static
block_t
*
Do_FL32ToF32
(
filter_t
*
,
block_t
*
);
static
block_t
*
Do_S32ToF32
(
filter_t
*
,
block_t
*
);
static
block_t
*
Do_S16ToF32
(
filter_t
*
,
block_t
*
);
static
block_t
*
Do_U8ToF32
(
filter_t
*
,
block_t
*
);
...
...
@@ -157,6 +165,10 @@ static int CreateTo( vlc_object_t *p_this )
p_filter
->
pf_audio_filter
=
Do_FL32ToF32
;
break
;
case
VLC_CODEC_S32N
:
p_filter
->
pf_audio_filter
=
Do_S32ToF32
;
break
;
case
VLC_CODEC_S16N
:
p_filter
->
pf_audio_filter
=
Do_S16ToF32
;
break
;
...
...
@@ -231,13 +243,29 @@ out:
static
block_t
*
Do_FL32ToF32
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
{
const
float
*
p_in
=
(
float
*
)
p_in_buf
->
p_buffer
;
vlc_fixed_t
*
p_out
=
(
vlc_fixed_t
*
)
p_in_buf
->
p_buffer
;
unsigned
count
=
p_in_buf
->
i_nb_samples
*
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
);
union
dw
*
restrict
p
=
(
union
dw
*
)
p_in_buf
->
p_buffer
,
*
end
=
p
+
count
;
const
float
one
=
FIXED32_ONE
;
for
(
unsigned
i
=
p_in_buf
->
i_nb_samples
*
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
)
;
i
--
;
)
while
(
p
<
end
)
{
p
->
s
=
(
one
*
p
->
f
);
p
++
;
}
return
p_in_buf
;
}
static
block_t
*
Do_S32ToF32
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
{
unsigned
count
=
p_in_buf
->
i_nb_samples
*
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
);
int32_t
*
restrict
p
=
(
int32_t
*
)
p_in_buf
->
p_buffer
,
*
end
=
p
+
count
;
while
(
p
<
end
)
{
*
p_out
++
=
(
vlc_fixed_t
)(
*
p_in
++
*
(
float
)
FIXED32_ONE
);
*
p
=
*
p
>>
3
;
p
++
;
}
return
p_in_buf
;
}
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