[vlc-commits] packetizer: h264: parse vui bitstream restrictions

Francois Cartegnie git at videolan.org
Fri Jan 20 11:22:10 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Jun 11 14:01:47 2016 +0200| [27c6f383304fe56d081df95a2f1b0754f0a1696b] | committer: Thomas Guillem

packetizer: h264: parse vui bitstream restrictions

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/packetizer/h264_nal.c | 14 ++++++++++++--
 modules/packetizer/h264_nal.h |  4 ++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/modules/packetizer/h264_nal.c b/modules/packetizer/h264_nal.c
index 09744c3..1b0a902 100644
--- a/modules/packetizer/h264_nal.c
+++ b/modules/packetizer/h264_nal.c
@@ -453,12 +453,22 @@ static bool h264_parse_sequence_parameter_set_rbsp( bs_t *p_bs,
         }
 
         if( p_sps->vui.b_hrd_parameters_present_flag )
-            bs_read( p_bs, 1 );
+            bs_read( p_bs, 1 ); /* low delay hrd */
 
         /* pic struct info */
         p_sps->vui.b_pic_struct_present_flag = bs_read( p_bs, 1 );
 
-        /* + unparsed remains */
+        p_sps->vui.b_bitstream_restriction_flag = bs_read( p_bs, 1 );
+        if( p_sps->vui.b_bitstream_restriction_flag )
+        {
+            bs_read( p_bs, 1 ); /* motion vector pic boundaries */
+            bs_read_ue( p_bs ); /* max bytes per pic */
+            bs_read_ue( p_bs ); /* max bits per mb */
+            bs_read_ue( p_bs ); /* log2 max mv h */
+            bs_read_ue( p_bs ); /* log2 max mv v */
+            p_sps->vui.i_max_num_reorder_frames = bs_read_ue( p_bs );
+            bs_read_ue( p_bs ); /* max dec frame buffering */
+        }
     }
 
     return true;
diff --git a/modules/packetizer/h264_nal.h b/modules/packetizer/h264_nal.h
index 3ba2f1b..f10d96c 100644
--- a/modules/packetizer/h264_nal.h
+++ b/modules/packetizer/h264_nal.h
@@ -124,6 +124,10 @@ struct h264_sequence_parameter_set_t
         bool b_hrd_parameters_present_flag;
         uint8_t i_cpb_removal_delay_length_minus1;
         uint8_t i_dpb_output_delay_length_minus1;
+
+        /* restrictions */
+        uint8_t b_bitstream_restriction_flag;
+        uint8_t i_max_num_reorder_frames;
     } vui;
 };
 



More information about the vlc-commits mailing list