[vlc-commits] packetizer: hevc_nal: retrieve source scan
Francois Cartegnie
git at videolan.org
Tue Oct 3 12:11:27 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Oct 2 13:45:20 2017 +0200| [3121eb4c45ca66aa10b9d1bace529817706b9385] | committer: Francois Cartegnie
packetizer: hevc_nal: retrieve source scan
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3121eb4c45ca66aa10b9d1bace529817706b9385
---
modules/packetizer/hevc_nal.c | 27 +++++++++++++++++++++++++++
modules/packetizer/hevc_nal.h | 2 ++
2 files changed, 29 insertions(+)
diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c
index 07f9d0fcfd..1cd76c1257 100644
--- a/modules/packetizer/hevc_nal.c
+++ b/modules/packetizer/hevc_nal.c
@@ -1308,6 +1308,7 @@ int hevc_compute_picture_order_count( const hevc_sequence_parameter_set_t *p_sps
struct hevc_sei_pic_timing_t
{
nal_u4_t pic_struct;
+ nal_u2_t source_scan_type;
};
void hevc_release_sei_pic_timing( hevc_sei_pic_timing_t *p_timing )
@@ -1322,13 +1323,39 @@ hevc_sei_pic_timing_t * hevc_decode_sei_pic_timing( bs_t *p_bs,
if( p_timing )
{
if( p_sps->vui.frame_field_info_present_flag )
+ {
p_timing->pic_struct = bs_read( p_bs, 4 );
+ p_timing->source_scan_type = bs_read( p_bs, 2 );
+ }
else
+ {
p_timing->pic_struct = 0;
+ p_timing->source_scan_type = 1;
+ }
}
return p_timing;
}
+bool hevc_frame_is_progressive( const hevc_sequence_parameter_set_t *p_sps,
+ const hevc_sei_pic_timing_t *p_timing )
+{
+ if( p_sps->vui_parameters_present_flag &&
+ p_sps->vui.field_seq_flag )
+ return false;
+
+ if( p_sps->profile_tier_level.general.interlaced_source_flag &&
+ !p_sps->profile_tier_level.general.progressive_source_flag )
+ return false;
+
+ if( p_timing && p_sps->vui.frame_field_info_present_flag )
+ {
+ if( p_timing->source_scan_type < 2 )
+ return p_timing->source_scan_type != 0;
+ }
+
+ return true;
+}
+
uint8_t hevc_get_num_clock_ts( const hevc_sequence_parameter_set_t *p_sps,
const hevc_sei_pic_timing_t *p_timing )
{
diff --git a/modules/packetizer/hevc_nal.h b/modules/packetizer/hevc_nal.h
index 2ed321cbe7..0b6ceeafdd 100644
--- a/modules/packetizer/hevc_nal.h
+++ b/modules/packetizer/hevc_nal.h
@@ -221,5 +221,7 @@ void hevc_release_sei_pic_timing( hevc_sei_pic_timing_t * );
uint8_t hevc_get_num_clock_ts( const hevc_sequence_parameter_set_t *,
const hevc_sei_pic_timing_t * /* can be NULL */ );
+bool hevc_frame_is_progressive( const hevc_sequence_parameter_set_t *,
+ const hevc_sei_pic_timing_t * /* can be NULL */);
#endif /* HEVC_NAL_H */
More information about the vlc-commits
mailing list