[vlc-commits] packetizer: h264: fill colour_desc

Thomas Guillem git at videolan.org
Sun Apr 17 13:14:15 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Apr 16 17:47:13 2016 +0300| [bca172eed49a003d38aa71a75364f74979e8dba2] | committer: Thomas Guillem

packetizer: h264: fill colour_desc

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

 modules/packetizer/h264_nal.c |   15 +++++++++++++--
 modules/packetizer/h264_nal.h |    6 ++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/modules/packetizer/h264_nal.c b/modules/packetizer/h264_nal.c
index 71d946f..ea2a036 100644
--- a/modules/packetizer/h264_nal.c
+++ b/modules/packetizer/h264_nal.c
@@ -427,11 +427,22 @@ static bool h264_parse_sequence_parameter_set_rbsp( bs_t *p_bs,
         i_tmp = bs_read( p_bs, 1 );
         if( i_tmp )
         {
-            bs_read( p_bs, 4 );
+            bs_read( p_bs, 3 );
+            p_sps->vui.colour.b_full_range = bs_read( p_bs, 1 );
             /* colour desc */
             i_tmp = bs_read( p_bs, 1 );
             if ( i_tmp )
-                bs_read( p_bs, 24 );
+            {
+                p_sps->vui.colour.i_colour_primaries = bs_read( p_bs, 8 );
+                p_sps->vui.colour.i_transfer_characteristics = bs_read( p_bs, 8 );
+                p_sps->vui.colour.i_matrix_coefficients = bs_read( p_bs, 8 );
+            }
+            else
+            {
+                p_sps->vui.colour.i_colour_primaries = HXXX_PRIMARIES_UNSPECIFIED;
+                p_sps->vui.colour.i_transfer_characteristics = HXXX_TRANSFER_UNSPECIFIED;
+                p_sps->vui.colour.i_matrix_coefficients = HXXX_MATRIX_UNSPECIFIED;
+            }
         }
 
         /* chroma loc info */
diff --git a/modules/packetizer/h264_nal.h b/modules/packetizer/h264_nal.h
index f59148a..f8f55c6 100644
--- a/modules/packetizer/h264_nal.h
+++ b/modules/packetizer/h264_nal.h
@@ -112,6 +112,12 @@ struct h264_sequence_parameter_set_t
     struct {
         bool b_valid;
         int i_sar_num, i_sar_den;
+        struct {
+            bool b_full_range;
+            uint8_t i_colour_primaries;
+            uint8_t i_transfer_characteristics;
+            uint8_t i_matrix_coefficients;
+        } colour;
         bool b_timing_info_present_flag;
         uint32_t i_num_units_in_tick;
         uint32_t i_time_scale;



More information about the vlc-commits mailing list