Commit 8c5e982d authored by Thomas Guillem's avatar Thomas Guillem

packetizer: hevc: fill colorimetry

parent 3e775f90
......@@ -378,6 +378,11 @@ static block_t *ParseNonVCL(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_nal
(void) hevc_get_frame_rate( p_sps, p_dec->p_sys->rgi_p_decvps,
&p_dec->fmt_out.video.i_frame_rate,
&p_dec->fmt_out.video.i_frame_rate_base );
(void) hevc_get_colorimetry( p_sps,
&p_dec->fmt_out.video.primaries,
&p_dec->fmt_out.video.transfer,
&p_dec->fmt_out.video.space,
&p_dec->fmt_out.video.b_color_range_full);
}
}
}
......
......@@ -1040,6 +1040,24 @@ bool hevc_get_frame_rate( const hevc_sequence_parameter_set_t *p_sps,
return false;
}
bool hevc_get_colorimetry( const hevc_sequence_parameter_set_t *p_sps,
video_color_primaries_t *p_primaries,
video_transfer_func_t *p_transfer,
video_color_space_t *p_colorspace,
bool *p_full_range )
{
if( !p_sps->vui_parameters_present_flag )
return false;
*p_primaries =
hxxx_colour_primaries_to_vlc( p_sps->vui.vs.colour.colour_primaries );
*p_transfer =
hxxx_transfer_characteristics_to_vlc( p_sps->vui.vs.colour.transfer_characteristics );
*p_colorspace =
hxxx_matrix_coeffs_to_vlc( p_sps->vui.vs.colour.matrix_coeffs );
*p_full_range = p_sps->vui.vs.video_full_range_flag;
return true;
}
static bool hevc_parse_slice_segment_header_rbsp( bs_t *p_bs,
uint8_t i_nal_type,
hevc_sequence_parameter_set_t **pp_sps,
......
......@@ -21,6 +21,7 @@
# define HEVC_NAL_H
# include <vlc_common.h>
# include <vlc_es.h>
#define HEVC_VPS_MAX 16
#define HEVC_SPS_MAX 16
......@@ -174,6 +175,11 @@ bool hevc_get_picture_size( const hevc_sequence_parameter_set_t *, unsigned *p_w
bool hevc_get_frame_rate( const hevc_sequence_parameter_set_t *,
hevc_video_parameter_set_t ** /* HEVC_MAX_VPS || NULL */,
unsigned *pi_num, unsigned *pi_den );
bool hevc_get_colorimetry( const hevc_sequence_parameter_set_t *p_sps,
video_color_primaries_t *p_primaries,
video_transfer_func_t *p_transfer,
video_color_space_t *p_colorspace,
bool *p_full_range );
bool hevc_get_slice_type( const hevc_slice_segment_header_t *, enum hevc_slice_type_e * );
#endif /* HEVC_NAL_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment