vlc | branch: master | Francois Cartegnie <[email protected]> | Mon Dec 14 11:25:14 2015 +0100| [23ffa36771d83b44465e898b35378de39f0e2151] | committer: Francois Cartegnie
hevc_nal: retrieve vps/sps/pps id without decoding > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=23ffa36771d83b44465e898b35378de39f0e2151 --- modules/packetizer/hevc_nal.c | 17 +++++++++++++++++ modules/packetizer/hevc_nal.h | 1 + 2 files changed, 18 insertions(+) diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c index 5b83fc8..fa174cb 100644 --- a/modules/packetizer/hevc_nal.c +++ b/modules/packetizer/hevc_nal.c @@ -290,6 +290,23 @@ static bool hevc_parse_scaling_list_rbsp( bs_t *p_bs ) return true; } +/* Shortcut for retrieving vps/sps/pps id */ +bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id) +{ + if(unlikely(!hxxx_strip_AnnexB_startcode(&p_buf, &i_buf) || i_buf < 3)) + return false; + /* No need to lookup convert from emulation for that data */ + uint8_t i_nal_type = ((p_buf[0] & 0x7E) >> 1); + bs_t bs; + bs_init(&bs, &p_buf[2], i_buf - 2); + if(i_nal_type == HEVC_NAL_PPS) + *pi_id = bs_read_ue( &bs ); + else + *pi_id = bs_read( &bs, 4 ); + + return true; +} + static bool hevc_parse_inner_profile_tier_level_rbsp( bs_t *p_bs, hevc_inner_profile_tier_level_t *p_in ) { diff --git a/modules/packetizer/hevc_nal.h b/modules/packetizer/hevc_nal.h index 8f91653..aa30aee 100644 --- a/modules/packetizer/hevc_nal.h +++ b/modules/packetizer/hevc_nal.h @@ -142,5 +142,6 @@ void hevc_rbsp_release_pps( hevc_picture_parameter_set_t * ); uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf, size_t *pi_res, uint8_t *pi_nal_length_size ); +bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id); #endif /* HEVC_NAL_H */ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
