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
0b764e2a
Commit
0b764e2a
authored
Jan 30, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move FL32->FI32 conversion to fixed plugin
parent
e71c332d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
32 deletions
+29
-32
modules/audio_filter/converter/fixed.c
modules/audio_filter/converter/fixed.c
+18
-0
modules/audio_filter/converter/float.c
modules/audio_filter/converter/float.c
+11
-32
No files found.
modules/audio_filter/converter/fixed.c
View file @
0b764e2a
...
...
@@ -138,6 +138,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_S16ToF32
(
filter_t
*
,
block_t
*
);
static
block_t
*
Do_U8ToF32
(
filter_t
*
,
block_t
*
);
...
...
@@ -152,6 +153,10 @@ static int CreateTo( vlc_object_t *p_this )
switch
(
p_filter
->
fmt_in
.
audio
.
i_format
)
{
case
VLC_CODEC_FL32
:
p_filter
->
pf_audio_filter
=
Do_FL32ToF32
;
break
;
case
VLC_CODEC_S16N
:
p_filter
->
pf_audio_filter
=
Do_S16ToF32
;
break
;
...
...
@@ -223,3 +228,16 @@ out:
block_Release
(
p_in_buf
);
return
p_out_buf
;
}
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
;
for
(
unsigned
i
=
p_in_buf
->
i_nb_samples
*
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
)
;
i
--
;
)
{
*
p_out
++
=
(
vlc_fixed_t
)(
*
p_in
++
*
(
float
)
FIXED32_ONE
);
}
return
p_in_buf
;
}
modules/audio_filter/converter/float.c
View file @
0b764e2a
...
...
@@ -43,16 +43,14 @@
*****************************************************************************/
static
int
Create_F32ToFL32
(
vlc_object_t
*
);
static
block_t
*
Do_F32ToFL32
(
filter_t
*
,
block_t
*
);
static
block_t
*
Do_FL32ToF32
(
filter_t
*
,
block_t
*
);
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin
()
set_description
(
N_
(
"Floating-point audio format conversions"
)
)
add_submodule
()
set_capability
(
"audio filter"
,
10
)
set_callbacks
(
Create_F32ToFL32
,
NULL
)
set_capability
(
"audio filter"
,
10
)
set_callbacks
(
Create_F32ToFL32
,
NULL
)
vlc_module_end
()
/*****************************************************************************
...
...
@@ -62,26 +60,19 @@ static int Create_F32ToFL32( vlc_object_t *p_this )
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
if
(
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_FI32
||
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FL32
)
&&
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_FL32
||
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FI32
)
)
{
if
(
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FL32
||
!
AOUT_FMTS_SIMILAR
(
&
p_filter
->
fmt_in
.
audio
,
&
p_filter
->
fmt_out
.
audio
)
)
return
VLC_EGENERIC
;
}
if
(
!
AOUT_FMTS_SIMILAR
(
&
p_filter
->
fmt_in
.
audio
,
&
p_filter
->
fmt_out
.
audio
)
)
switch
(
p_filter
->
fmt_in
.
audio
.
i_format
)
{
return
VLC_EGENERIC
;
}
case
VLC_CODEC_FI32
:
p_filter
->
pf_audio_filter
=
Do_F32ToFL32
;
break
;
if
(
p_filter
->
fmt_in
.
audio
.
i_format
==
VLC_CODEC_FI32
)
{
p_filter
->
pf_audio_filter
=
Do_F32ToFL32
;
}
else
{
p_filter
->
pf_audio_filter
=
Do_FL32ToF32
;
default:
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
...
...
@@ -101,16 +92,4 @@ static block_t *Do_F32ToFL32( filter_t * p_filter, block_t * p_in_buf )
return
p_in_buf
;
}
static
block_t
*
Do_FL32ToF32
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
{
int
i
;
float
*
p_in
=
(
float
*
)
p_in_buf
->
p_buffer
;
vlc_fixed_t
*
p_out
=
(
vlc_fixed_t
*
)
p_in_buf
->
p_buffer
;
for
(
i
=
p_in_buf
->
i_nb_samples
*
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
)
;
i
--
;
)
{
*
p_out
++
=
(
vlc_fixed_t
)(
*
p_in
++
*
(
float
)
FIXED32_ONE
);
}
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