[vlc-commits] packetizer: hevc: rework progressive test

Francois Cartegnie git at videolan.org
Thu Feb 15 10:14:46 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb  9 15:14:39 2018 +0100| [7b9643c06757d664eff6d703f7e45240f5430fae] | committer: Francois Cartegnie

packetizer: hevc: rework progressive test

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b9643c06757d664eff6d703f7e45240f5430fae
---

 modules/packetizer/hevc_nal.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c
index 38baf6d127..09a4cc90d1 100644
--- a/modules/packetizer/hevc_nal.c
+++ b/modules/packetizer/hevc_nal.c
@@ -1577,15 +1577,22 @@ bool hevc_frame_is_progressive( const hevc_sequence_parameter_set_t *p_sps,
         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 )
+    const hevc_inner_profile_tier_level_t *p_profile = &p_sps->profile_tier_level.general;
+    /* 1 & 0, 0 & 1, global */
+    if( p_profile->progressive_source_flag != p_profile->interlaced_source_flag )
+    {
+        return p_profile->progressive_source_flag > p_profile->interlaced_source_flag;
+    }
+    /* 1 & 1, defined in SEI */
+    else if( p_profile->progressive_source_flag )
     {
-        if( p_timing->source_scan_type < 2 )
-            return p_timing->source_scan_type != 0;
+        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;
+        }
     }
+    /* else 0 & 0, unspec */
 
     return true;
 }



More information about the vlc-commits mailing list