Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
0a45c7b7
Commit
0a45c7b7
authored
Dec 19, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LPCM: decode to S16N or S32N
parent
3b3a2b33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
35 deletions
+39
-35
modules/codec/lpcm.c
modules/codec/lpcm.c
+39
-35
No files found.
modules/codec/lpcm.c
View file @
0a45c7b7
...
...
@@ -256,11 +256,11 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
{
case
24
:
case
20
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S
24B
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
24
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S
32N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
32
;
break
;
default:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16
B
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16
N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
16
;
break
;
}
...
...
@@ -378,13 +378,13 @@ static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
/* */
if
(
i_bits
==
16
)
{
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16
B
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16
N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
16
;
}
else
{
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S
24B
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
24
;
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S
32N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
32
;
}
/* */
...
...
@@ -920,65 +920,69 @@ static int BdHeader( unsigned *pi_rate,
static
void
VobExtract
(
block_t
*
p_aout_buffer
,
block_t
*
p_block
,
unsigned
i_bits
)
{
uint8_t
*
p_out
=
p_aout_buffer
->
p_buffer
;
/* 20/24 bits LPCM use special packing */
if
(
i_bits
==
24
)
{
uint32_t
*
p_out
=
(
uint32_t
*
)
p_aout_buffer
->
p_buffer
;
while
(
p_block
->
i_buffer
/
12
)
{
/* Sample 1 */
p_out
[
0
]
=
p_block
->
p_buffer
[
0
];
p_out
[
1
]
=
p_block
->
p_buffer
[
1
];
p_out
[
2
]
=
p_block
->
p_buffer
[
8
]
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
0
]
<<
24
)
|
(
p_block
->
p_buffer
[
1
]
<<
16
)
|
(
p_block
->
p_buffer
[
8
]
<<
8
)
;
/* Sample 2 */
p_out
[
3
]
=
p_block
->
p_buffer
[
2
];
p_out
[
4
]
=
p_block
->
p_buffer
[
3
];
p_out
[
5
]
=
p_block
->
p_buffer
[
9
]
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
2
]
<<
24
)
|
(
p_block
->
p_buffer
[
3
]
<<
16
)
|
(
p_block
->
p_buffer
[
9
]
<<
8
)
;
/* Sample 3 */
p_out
[
6
]
=
p_block
->
p_buffer
[
4
];
p_out
[
7
]
=
p_block
->
p_buffer
[
5
];
p_out
[
8
]
=
p_block
->
p_buffer
[
10
]
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
4
]
<<
24
)
|
(
p_block
->
p_buffer
[
5
]
<<
16
)
|
(
p_block
->
p_buffer
[
10
]
<<
8
)
;
/* Sample 4 */
p_out
[
9
]
=
p_block
->
p_buffer
[
6
];
p_out
[
10
]
=
p_block
->
p_buffer
[
7
];
p_out
[
11
]
=
p_block
->
p_buffer
[
11
]
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
6
]
<<
24
)
|
(
p_block
->
p_buffer
[
7
]
<<
16
)
|
(
p_block
->
p_buffer
[
11
]
<<
8
)
;
p_block
->
i_buffer
-=
12
;
p_block
->
p_buffer
+=
12
;
p_out
+=
12
;
}
}
else
if
(
i_bits
==
20
)
{
uint32_t
*
p_out
=
(
uint32_t
*
)
p_aout_buffer
->
p_buffer
;
while
(
p_block
->
i_buffer
/
10
)
{
/* Sample 1 */
p_out
[
0
]
=
p_block
->
p_buffer
[
0
];
p_out
[
1
]
=
p_block
->
p_buffer
[
1
];
p_out
[
2
]
=
p_block
->
p_buffer
[
8
]
&
0xF0
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
0
]
<<
24
)
|
(
p_block
->
p_buffer
[
1
]
<<
16
)
|
((
p_block
->
p_buffer
[
8
]
&
0xF0
)
<<
8
)
;
/* Sample 2 */
p_out
[
3
]
=
p_block
->
p_buffer
[
2
];
p_out
[
4
]
=
p_block
->
p_buffer
[
3
];
p_out
[
5
]
=
p_block
->
p_buffer
[
8
]
<<
4
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
2
]
<<
24
)
|
(
p_block
->
p_buffer
[
3
]
<<
16
)
|
((
p_block
->
p_buffer
[
8
]
&
0x0F
)
<<
12
)
;
/* Sample 3 */
p_out
[
6
]
=
p_block
->
p_buffer
[
4
];
p_out
[
7
]
=
p_block
->
p_buffer
[
5
];
p_out
[
8
]
=
p_block
->
p_buffer
[
9
]
&
0xF0
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
4
]
<<
24
)
|
(
p_block
->
p_buffer
[
5
]
<<
16
)
|
((
p_block
->
p_buffer
[
9
]
&
0xF0
)
<<
8
)
;
/* Sample 4 */
p_out
[
9
]
=
p_block
->
p_buffer
[
6
];
p_out
[
10
]
=
p_block
->
p_buffer
[
7
];
p_out
[
11
]
=
p_block
->
p_buffer
[
9
]
<<
4
;
*
(
p_out
++
)
=
(
p_block
->
p_buffer
[
6
]
<<
24
)
|
(
p_block
->
p_buffer
[
7
]
<<
16
)
|
((
p_block
->
p_buffer
[
9
]
&
0x0F
)
<<
12
)
;
p_block
->
i_buffer
-=
10
;
p_block
->
p_buffer
+=
10
;
p_out
+=
12
;
}
}
else
{
assert
(
i_bits
==
16
);
memcpy
(
p_out
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
#ifdef WORDS_BIGENDIAN
memcpy
(
p_aout_buffer
->
p_buffer
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
#else
swab
(
p_block
->
p_buffer
,
p_aout_buffer
->
p_buffer
,
p_block
->
i_buffer
);
#endif
}
}
static
void
AobExtract
(
block_t
*
p_aout_buffer
,
...
...
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