Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
GSoC
GSoC2018
macOS
vlc
Commits
857f2745
Commit
857f2745
authored
Dec 21, 2018
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packetizer: a52: separate EAC3 bitstream parsing
parent
5718b12e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
19 deletions
+38
-19
modules/packetizer/a52.h
modules/packetizer/a52.h
+38
-19
No files found.
modules/packetizer/a52.h
View file @
857f2745
...
...
@@ -55,6 +55,9 @@ struct vlc_a52_bitstream_info
EAC3_STRMTYP_AC3_CONVERT
=
2
,
EAC3_STRMTYP_RESERVED
,
}
strmtyp
;
uint16_t
i_frmsiz
;
uint8_t
i_fscod2
;
uint8_t
i_numblkscod
;
uint8_t
i_substreamid
;
}
eac3
;
struct
...
...
@@ -211,44 +214,60 @@ static inline int vlc_a52_header_ParseAc3( vlc_a52_header_t *p_header,
/**
* It parse E-AC3 sync info
*/
static
inline
int
vlc_a52_header_ParseEac3
(
vlc_a52_header_t
*
p_header
,
const
uint8_t
*
p_buf
,
const
uint32_t
*
p_acmod
,
const
unsigned
*
pi_fscod_samplerates
)
static
inline
int
vlc_a52_ParseEac3BitstreamInfo
(
struct
vlc_a52_bitstream_info
*
bs
,
const
uint8_t
*
p_buf
,
size_t
i_buf
)
{
struct
vlc_a52_bitstream_info
*
bs
=
&
p_header
->
bs
;
bs_t
s
;
bs_init
(
&
s
,
(
void
*
)
p_buf
,
VLC_A52_HEADER_SIZE
);
bs_skip
(
&
s
,
16
);
/* start code */
bs_init
(
&
s
,
p_buf
,
i_buf
);
bs
->
eac3
.
strmtyp
=
bs_read
(
&
s
,
2
);
/* Stream Type */
bs
->
eac3
.
i_substreamid
=
bs_read
(
&
s
,
3
);
/* Substream Identification */
const
uint16_t
i_frmsiz
=
bs_read
(
&
s
,
11
);
if
(
i_frmsiz
<
2
)
bs
->
eac3
.
i_frmsiz
=
bs_read
(
&
s
,
11
);
if
(
bs
->
eac3
.
i_frmsiz
<
2
)
return
VLC_EGENERIC
;
p_header
->
i_size
=
2
*
(
i_frmsiz
+
1
);
bs
->
i_fscod
=
bs_read
(
&
s
,
2
);
if
(
bs
->
i_fscod
==
0x03
)
{
const
uint8_t
i_fscod2
=
bs_read
(
&
s
,
2
);
if
(
i_fscod2
==
0x03
)
bs
->
eac3
.
i_fscod2
=
bs_read
(
&
s
,
2
);
if
(
bs
->
eac3
.
i_fscod2
==
0x03
)
return
VLC_EGENERIC
;
p_header
->
i_rate
=
pi_fscod_samplerates
[
i_fscod2
]
/
2
;
bs
->
eac3
.
i_numblkscod
=
0x03
;
}
else
bs
->
eac3
.
i_numblkscod
=
bs_read
(
&
s
,
2
);
bs
->
i_acmod
=
bs_read
(
&
s
,
3
);
bs
->
i_lfeon
=
bs_read1
(
&
s
);
return
VLC_SUCCESS
;
}
static
inline
int
vlc_a52_header_ParseEac3
(
vlc_a52_header_t
*
p_header
,
const
uint8_t
*
p_buf
,
const
uint32_t
*
p_acmod
,
const
unsigned
*
pi_fscod_samplerates
)
{
if
(
vlc_a52_ParseEac3BitstreamInfo
(
&
p_header
->
bs
,
&
p_buf
[
2
],
/* start code */
VLC_A52_HEADER_SIZE
-
2
)
!=
VLC_SUCCESS
)
return
VLC_EGENERIC
;
const
struct
vlc_a52_bitstream_info
*
bs
=
&
p_header
->
bs
;
p_header
->
i_size
=
2
*
(
bs
->
eac3
.
i_frmsiz
+
1
);
if
(
bs
->
i_fscod
==
0x03
)
{
p_header
->
i_rate
=
pi_fscod_samplerates
[
bs
->
eac3
.
i_fscod2
]
/
2
;
p_header
->
i_blocks_per_sync_frame
=
6
;
}
else
{
static
const
int
pi_numblkscod
[
4
]
=
{
1
,
2
,
3
,
6
};
p_header
->
i_rate
=
pi_fscod_samplerates
[
bs
->
i_fscod
];
p_header
->
i_blocks_per_sync_frame
=
pi_numblkscod
[
bs
_read
(
&
s
,
2
)
];
p_header
->
i_blocks_per_sync_frame
=
pi_numblkscod
[
bs
->
eac3
.
i_numblkscod
];
}
bs
->
i_acmod
=
bs_read
(
&
s
,
3
);
bs
->
i_lfeon
=
bs_read1
(
&
s
);
p_header
->
i_channels_conf
=
p_acmod
[
bs
->
i_acmod
];
p_header
->
i_chan_mode
=
0
;
if
(
bs
->
i_acmod
==
0
)
...
...
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