Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c5b827e0
Commit
c5b827e0
authored
Dec 20, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a52: decode to S32N in fixed point
parent
b68794c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
modules/audio_filter/converter/a52tofloat32.c
modules/audio_filter/converter/a52tofloat32.c
+27
-19
No files found.
modules/audio_filter/converter/a52tofloat32.c
View file @
c5b827e0
...
@@ -230,17 +230,19 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
...
@@ -230,17 +230,19 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
/*****************************************************************************
/*****************************************************************************
* Interleave: helper function to interleave channels
* Interleave: helper function to interleave channels
*****************************************************************************/
*****************************************************************************/
static
void
Interleave
(
sample_t
*
p_out
,
const
sample_t
*
p_in
,
static
void
Interleave
(
sample_t
*
restrict
p_out
,
const
sample_t
*
restrict
p_in
,
int
i_nb_channels
,
uint8_t
*
pi_chan_table
)
unsigned
i_nb_channels
,
uint8_t
*
restrict
pi_chan_table
)
{
{
/* We do not only have to interleave, but also reorder the channels */
/* We do not only have to interleave, but also reorder the channels */
for
(
unsigned
j
=
0
;
j
<
i_nb_channels
;
j
++
)
int
i
,
j
;
for
(
j
=
0
;
j
<
i_nb_channels
;
j
++
)
{
{
for
(
i
=
0
;
i
<
256
;
i
++
)
for
(
unsigned
i
=
0
;
i
<
256
;
i
++
)
{
{
#ifdef LIBA52_FIXED
p_out
[
i
*
i_nb_channels
+
pi_chan_table
[
j
]]
=
p_in
[
j
*
256
+
i
]
<<
4
;
#else
p_out
[
i
*
i_nb_channels
+
pi_chan_table
[
j
]]
=
p_in
[
j
*
256
+
i
];
p_out
[
i
*
i_nb_channels
+
pi_chan_table
[
j
]]
=
p_in
[
j
*
256
+
i
];
#endif
}
}
}
}
}
}
...
@@ -248,31 +250,37 @@ static void Interleave( sample_t * p_out, const sample_t * p_in,
...
@@ -248,31 +250,37 @@ static void Interleave( sample_t * p_out, const sample_t * p_in,
/*****************************************************************************
/*****************************************************************************
* Duplicate: helper function to duplicate a unique channel
* Duplicate: helper function to duplicate a unique channel
*****************************************************************************/
*****************************************************************************/
static
void
Duplicate
(
sample_t
*
p_out
,
const
sample_t
*
p_in
)
static
void
Duplicate
(
sample_t
*
restrict
p_out
,
const
sample_t
*
restrict
p_in
)
{
{
int
i
;
for
(
unsigned
i
=
256
;
i
--
;
)
for
(
i
=
256
;
i
--
;
)
{
{
*
p_out
++
=
*
p_in
;
#ifdef LIBA52_FIXED
*
p_out
++
=
*
p_in
;
sample_t
s
=
*
(
p_in
++
)
<<
4
;
p_in
++
;
#else
sample_t
s
=
*
(
p_in
++
);
#endif
*
p_out
++
=
s
;
*
p_out
++
=
s
;
}
}
}
}
/*****************************************************************************
/*****************************************************************************
* Exchange: helper function to exchange left & right channels
* Exchange: helper function to exchange left & right channels
*****************************************************************************/
*****************************************************************************/
static
void
Exchange
(
sample_t
*
p_out
,
const
sample_t
*
p_in
)
static
void
Exchange
(
sample_t
*
restrict
p_out
,
const
sample_t
*
restrict
p_in
)
{
{
int
i
;
const
sample_t
*
p_first
=
p_in
+
256
;
const
sample_t
*
p_first
=
p_in
+
256
;
const
sample_t
*
p_second
=
p_in
;
const
sample_t
*
p_second
=
p_in
;
for
(
i
=
0
;
i
<
256
;
i
++
)
for
(
unsigned
i
=
0
;
i
<
256
;
i
++
)
{
{
#ifdef LIBA52_FIXED
*
p_out
++
=
*
p_first
++
<<
4
;
*
p_out
++
=
*
p_second
++
<<
4
;
#else
*
p_out
++
=
*
p_first
++
;
*
p_out
++
=
*
p_first
++
;
*
p_out
++
=
*
p_second
++
;
*
p_out
++
=
*
p_second
++
;
#endif
}
}
}
}
...
@@ -370,7 +378,7 @@ static int OpenFilter( vlc_object_t *p_this )
...
@@ -370,7 +378,7 @@ static int OpenFilter( vlc_object_t *p_this )
if
(
p_filter
->
fmt_in
.
i_codec
!=
VLC_CODEC_A52
)
if
(
p_filter
->
fmt_in
.
i_codec
!=
VLC_CODEC_A52
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
#ifdef LIBA52_FIXED
#ifdef LIBA52_FIXED
if
(
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_
FI32
)
if
(
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_
S32N
)
#else
#else
if
(
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FL32
)
if
(
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FL32
)
#endif
#endif
...
...
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