Commit 5f88e3bd authored by Francois Cartegnie's avatar Francois Cartegnie

hevc_nal: add hevc_get_frame_rate

parent 4850b4c9
...@@ -1026,6 +1026,26 @@ static bool hevc_get_picture_CtbsYsize( const hevc_sequence_parameter_set_t *p_s ...@@ -1026,6 +1026,26 @@ static bool hevc_get_picture_CtbsYsize( const hevc_sequence_parameter_set_t *p_s
return true; return true;
} }
bool hevc_get_frame_rate( const hevc_sequence_parameter_set_t *p_sps,
const hevc_video_parameter_set_t **pp_vps,
unsigned *pi_num, unsigned *pi_den )
{
if( p_sps->vui_parameters_present_flag && p_sps->vui.vui_timing_info_present_flag )
{
*pi_den = p_sps->vui.timing.vui_num_units_in_tick;
*pi_num = p_sps->vui.timing.vui_time_scale;
return true;
}
else if( pp_vps && pp_vps[p_sps->sps_video_parameter_set_id] &&
pp_vps[p_sps->sps_video_parameter_set_id]->vps_timing_info_present_flag )
{
*pi_den = pp_vps[p_sps->sps_video_parameter_set_id]->vps_num_units_in_tick;
*pi_num = pp_vps[p_sps->sps_video_parameter_set_id]->vps_time_scale;
return true;
}
return false;
}
static bool hevc_parse_slice_segment_header_rbsp( bs_t *p_bs, static bool hevc_parse_slice_segment_header_rbsp( bs_t *p_bs,
const hevc_sequence_parameter_set_t **pp_sps, const hevc_sequence_parameter_set_t **pp_sps,
const hevc_picture_parameter_set_t **pp_pps, const hevc_picture_parameter_set_t **pp_pps,
......
...@@ -160,5 +160,8 @@ uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf, ...@@ -160,5 +160,8 @@ uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf,
bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id); bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id);
bool hevc_get_picture_size( const hevc_sequence_parameter_set_t *, unsigned *p_w, unsigned *p_h, bool hevc_get_picture_size( const hevc_sequence_parameter_set_t *, unsigned *p_w, unsigned *p_h,
unsigned *p_vw, unsigned *p_vh ); unsigned *p_vw, unsigned *p_vh );
bool hevc_get_frame_rate( const hevc_sequence_parameter_set_t *,
const hevc_video_parameter_set_t ** /* HEVC_MAX_VPS || NULL */,
unsigned *pi_num, unsigned *pi_den );
#endif /* HEVC_NAL_H */ #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