Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
69feb2de
Commit
69feb2de
authored
May 27, 2016
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packetizer: h264: add h264_get_chroma_luma
parent
9e19a0db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
modules/packetizer/h264_nal.c
modules/packetizer/h264_nal.c
+16
-5
modules/packetizer/h264_nal.h
modules/packetizer/h264_nal.h
+8
-0
No files found.
modules/packetizer/h264_nal.c
View file @
69feb2de
...
...
@@ -273,20 +273,20 @@ static bool h264_parse_sequence_parameter_set_rbsp( bs_t *p_bs,
i_profile_idc
==
PROFILE_H264_MFC_HIGH
)
{
/* chroma_format_idc */
const
int
i_chroma_
format_
idc
=
bs_read_ue
(
p_bs
);
if
(
i_chroma_
format_
idc
==
3
)
p_sps
->
i_chroma_idc
=
bs_read_ue
(
p_bs
);
if
(
p_sps
->
i_chroma_idc
==
3
)
bs_skip
(
p_bs
,
1
);
/* separate_colour_plane_flag */
/* bit_depth_luma_minus8 */
bs_read_ue
(
p_bs
);
p_sps
->
i_bit_depth_luma
=
bs_read_ue
(
p_bs
)
+
8
;
/* bit_depth_chroma_minus8 */
bs_read_ue
(
p_bs
);
p_sps
->
i_bit_depth_chroma
=
bs_read_ue
(
p_bs
)
+
8
;
/* qpprime_y_zero_transform_bypass_flag */
bs_skip
(
p_bs
,
1
);
/* seq_scaling_matrix_present_flag */
i_tmp
=
bs_read
(
p_bs
,
1
);
if
(
i_tmp
)
{
for
(
int
i
=
0
;
i
<
((
3
!=
i_chroma_
format_
idc
)
?
8
:
12
);
i
++
)
for
(
int
i
=
0
;
i
<
((
3
!=
p_sps
->
i_chroma_idc
)
?
8
:
12
);
i
++
)
{
/* seq_scaling_list_present_flag[i] */
i_tmp
=
bs_read
(
p_bs
,
1
);
...
...
@@ -606,6 +606,17 @@ bool h264_get_picture_size( const h264_sequence_parameter_set_t *p_sps, unsigned
return
true
;
}
bool
h264_get_chroma_luma
(
const
h264_sequence_parameter_set_t
*
p_sps
,
uint8_t
*
pi_chroma_format
,
uint8_t
*
pi_depth_luma
,
uint8_t
*
pi_depth_chroma
)
{
if
(
p_sps
->
i_bit_depth_luma
==
0
)
return
false
;
*
pi_chroma_format
=
p_sps
->
i_chroma_idc
;
*
pi_depth_luma
=
p_sps
->
i_bit_depth_luma
;
*
pi_depth_chroma
=
p_sps
->
i_bit_depth_chroma
;
return
true
;
}
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
size_t
*
p_level
,
uint8_t
*
pi_nal_length_size
)
{
...
...
modules/packetizer/h264_nal.h
View file @
69feb2de
...
...
@@ -94,6 +94,11 @@ struct h264_sequence_parameter_set_t
{
int
i_id
;
int
i_profile
,
i_profile_compatibility
,
i_level
;
/* according to avcC, 3 bits max for those */
uint8_t
i_chroma_idc
;
uint8_t
i_bit_depth_luma
;
uint8_t
i_bit_depth_chroma
;
uint32_t
pic_width_in_mbs_minus1
;
uint32_t
pic_height_in_map_units_minus1
;
struct
...
...
@@ -170,6 +175,9 @@ uint8_t * h264_avcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf,
bool
h264_get_picture_size
(
const
h264_sequence_parameter_set_t
*
,
unsigned
*
p_w
,
unsigned
*
p_h
,
unsigned
*
p_vw
,
unsigned
*
p_vh
);
bool
h264_get_chroma_luma
(
const
h264_sequence_parameter_set_t
*
,
uint8_t
*
pi_chroma_format
,
uint8_t
*
pi_depth_luma
,
uint8_t
*
pi_depth_chroma
);
/* Get level and Profile */
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
size_t
*
p_level
,
uint8_t
*
p_nal_length_size
);
...
...
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