Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1b7ec33b
Commit
1b7ec33b
authored
Aug 17, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decoder for PCM 20-bits (VLC_CODEC_S20B)
This is also known as MIME audio/L20 (IETF RFC3190)
parent
e6d8827a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
modules/codec/araw.c
modules/codec/araw.c
+26
-0
No files found.
modules/codec/araw.c
View file @
1b7ec33b
...
...
@@ -169,6 +169,7 @@ static const int16_t alawtos16[256] =
static
void
DecodeAlaw
(
void
*
,
const
uint8_t
*
,
unsigned
);
static
void
DecodeUlaw
(
void
*
,
const
uint8_t
*
,
unsigned
);
static
void
DecodeS20B
(
void
*
,
const
uint8_t
*
,
unsigned
);
/*****************************************************************************
* DecoderOpen: probe the decoder and return score
...
...
@@ -200,6 +201,7 @@ static int DecoderOpen( vlc_object_t *p_this )
case
VLC_CODEC_S32B
:
case
VLC_CODEC_S24L
:
case
VLC_CODEC_S24B
:
case
VLC_CODEC_S20B
:
case
VLC_CODEC_S16L
:
case
VLC_CODEC_S16B
:
case
VLC_CODEC_S8
:
...
...
@@ -259,6 +261,13 @@ static int DecoderOpen( vlc_object_t *p_this )
p_dec
->
fmt_out
.
i_codec
=
p_dec
->
fmt_in
.
i_codec
;
p_dec
->
fmt_in
.
audio
.
i_bitspersample
=
24
;
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_S20B
)
{
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
32
;
p_sys
->
decode
=
DecodeS20B
;
p_dec
->
fmt_in
.
audio
.
i_bitspersample
=
20
;
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_S16L
||
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_S16B
)
{
...
...
@@ -400,6 +409,23 @@ static void DecodeUlaw( void *outp, const uint8_t *in, unsigned samples )
*
(
out
++
)
=
ulawtos16
[
*
(
in
++
)];
}
static
void
DecodeS20B
(
void
*
outp
,
const
uint8_t
*
in
,
unsigned
samples
)
{
int32_t
*
out
=
outp
;
while
(
samples
>=
2
)
{
*
(
out
++
)
=
U32_AT
(
in
)
&
~
0xFFF
;
*
(
out
++
)
=
U32_AT
(
in
+
1
)
<<
12
;
in
+=
5
;
samples
-=
2
;
}
/* No U32_AT() for the last odd sample: avoid off-by-one overflow! */
if
(
samples
)
*
(
out
++
)
=
((
U16_AT
(
in
)
<<
16
)
|
(
in
[
2
]
<<
8
))
&
~
0xFFF
;
}
/*****************************************************************************
* DecoderClose: decoder destruction
*****************************************************************************/
...
...
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