[vlc-commits] packetizer: hevc: rename limits

Francois Cartegnie git at videolan.org
Tue Nov 1 10:27:05 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov  1 01:33:16 2016 +0100| [d144f1746ecdec2fe3ae38c0c575ff0a7ee9373e] | committer: Francois Cartegnie

packetizer: hevc: rename limits

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

 modules/mux/mp4/libmp4mux.c   | 10 +++++-----
 modules/packetizer/hevc.c     | 20 ++++++++++----------
 modules/packetizer/hevc_nal.c |  8 ++++----
 modules/packetizer/hevc_nal.h |  6 +++---
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index 775316f..18321e8 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -682,8 +682,8 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt, bool b_completeness)
         uint8_t * p_buffer;
     };
 
-    struct nal rg_vps[HEVC_VPS_MAX], rg_sps[HEVC_SPS_MAX],
-               rg_pps[HEVC_VPS_MAX], *p_sei = NULL, *p_nal = NULL;
+    struct nal rg_vps[HEVC_VPS_ID_MAX + 1], rg_sps[HEVC_SPS_ID_MAX + 1],
+               rg_pps[HEVC_VPS_ID_MAX + 1], *p_sei = NULL, *p_nal = NULL;
     uint8_t i_vps = 0, i_sps = 0, i_pps = 0, i_num_arrays = 0;
     size_t i_sei = 0;
 
@@ -720,7 +720,7 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt, bool b_completeness)
         switch (hevc_getNALType(p_buffer)) {
 
         case HEVC_NAL_VPS:
-            if(i_vps == HEVC_VPS_MAX)
+            if(i_vps > HEVC_VPS_ID_MAX)
                 break;
             p_nal = &rg_vps[i_vps++];
             p_nal->p_buffer = p_buffer;
@@ -734,7 +734,7 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt, bool b_completeness)
             break;
 
         case HEVC_NAL_SPS: {
-            if(i_sps == HEVC_SPS_MAX)
+            if(i_sps > HEVC_SPS_ID_MAX)
                 break;
             p_nal = &rg_sps[i_sps++];
             p_nal->p_buffer = p_buffer;
@@ -748,7 +748,7 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt, bool b_completeness)
             }
 
         case HEVC_NAL_PPS: {
-            if(i_pps == HEVC_PPS_MAX)
+            if(i_pps > HEVC_PPS_ID_MAX)
                 break;
             p_nal = &rg_pps[i_pps++];
             p_nal->p_buffer = p_buffer;
diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index e590f3a..c96ce5f 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -83,9 +83,9 @@ struct decoder_sys_t
     } frame, pre, post;
 
     uint8_t  i_nal_length_size;
-    hevc_video_parameter_set_t    *rgi_p_decvps[HEVC_VPS_MAX];
-    hevc_sequence_parameter_set_t *rgi_p_decsps[HEVC_SPS_MAX];
-    hevc_picture_parameter_set_t  *rgi_p_decpps[HEVC_PPS_MAX];
+    hevc_video_parameter_set_t    *rgi_p_decvps[HEVC_VPS_ID_MAX + 1];
+    hevc_sequence_parameter_set_t *rgi_p_decsps[HEVC_SPS_ID_MAX + 1];
+    hevc_picture_parameter_set_t  *rgi_p_decpps[HEVC_PPS_ID_MAX + 1];
     bool b_init_sequence_complete;
 
     /* */
@@ -230,19 +230,19 @@ static void Close(vlc_object_t *p_this)
     block_ChainRelease(p_sys->pre.p_chain);
     block_ChainRelease(p_sys->post.p_chain);
 
-    for(unsigned i=0;i<HEVC_PPS_MAX; i++)
+    for(unsigned i=0;i<=HEVC_PPS_ID_MAX; i++)
     {
         if(p_sys->rgi_p_decpps[i])
             hevc_rbsp_release_pps(p_sys->rgi_p_decpps[i]);
     }
 
-    for(unsigned i=0;i<HEVC_SPS_MAX; i++)
+    for(unsigned i=0;i<=HEVC_SPS_ID_MAX; i++)
     {
         if(p_sys->rgi_p_decsps[i])
             hevc_rbsp_release_sps(p_sys->rgi_p_decsps[i]);
     }
 
-    for(unsigned i=0;i<HEVC_VPS_MAX; i++)
+    for(unsigned i=0;i<=HEVC_VPS_ID_MAX; i++)
     {
         if(p_sys->rgi_p_decvps[i])
             hevc_rbsp_release_vps(p_sys->rgi_p_decvps[i]);
@@ -311,15 +311,15 @@ static bool InsertXPS(decoder_t *p_dec, uint8_t i_nal_type, uint8_t i_id,
     switch(i_nal_type)
     {
         case HEVC_NAL_VPS:
-            if(i_id >= HEVC_VPS_MAX)
+            if(i_id > HEVC_VPS_ID_MAX)
                 return false;
             break;
         case HEVC_NAL_SPS:
-            if(i_id >= HEVC_SPS_MAX)
+            if(i_id > HEVC_SPS_ID_MAX)
                 return false;
             break;
         case HEVC_NAL_PPS:
-            if(i_id >= HEVC_PPS_MAX)
+            if(i_id > HEVC_PPS_ID_MAX)
                 return false;
             break;
         default:
@@ -384,7 +384,7 @@ static bool InsertXPS(decoder_t *p_dec, uint8_t i_nal_type, uint8_t i_id,
 
 static bool XPSReady(decoder_sys_t *p_sys)
 {
-    for(unsigned i=0;i<HEVC_PPS_MAX; i++)
+    for(unsigned i=0;i<=HEVC_PPS_ID_MAX; i++)
     {
         const hevc_picture_parameter_set_t *p_pps = p_sys->rgi_p_decpps[i];
         if (p_pps)
diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c
index 464c115..3e4e7d9 100644
--- a/modules/packetizer/hevc_nal.c
+++ b/modules/packetizer/hevc_nal.c
@@ -771,7 +771,7 @@ static bool hevc_parse_sequence_parameter_set_rbsp( bs_t *p_bs,
         return false;
 
     p_sps->sps_seq_parameter_set_id = bs_read_ue( p_bs );
-    if( p_sps->sps_seq_parameter_set_id >= HEVC_SPS_MAX )
+    if( p_sps->sps_seq_parameter_set_id > HEVC_SPS_ID_MAX )
         return false;
 
     p_sps->chroma_format_idc = bs_read_ue( p_bs );
@@ -899,10 +899,10 @@ static bool hevc_parse_pic_parameter_set_rbsp( bs_t *p_bs,
     if( bs_remain( p_bs ) < 1 )
         return false;
     p_pps->pps_pic_parameter_set_id = bs_read_ue( p_bs );
-    if( p_pps->pps_pic_parameter_set_id >= HEVC_PPS_MAX || bs_remain( p_bs ) < 1 )
+    if( p_pps->pps_pic_parameter_set_id > HEVC_PPS_ID_MAX || bs_remain( p_bs ) < 1 )
         return false;
     p_pps->pps_seq_parameter_set_id = bs_read_ue( p_bs );
-    if( p_pps->pps_seq_parameter_set_id >= HEVC_SPS_MAX )
+    if( p_pps->pps_seq_parameter_set_id > HEVC_SPS_ID_MAX )
         return false;
     p_pps->dependent_slice_segments_enabled_flag = bs_read1( p_bs );
     p_pps->output_flag_present_flag = bs_read1( p_bs );
@@ -1099,7 +1099,7 @@ static bool hevc_parse_slice_segment_header_rbsp( bs_t *p_bs,
     if( i_nal_type >= HEVC_NAL_BLA_W_LP && i_nal_type <= HEVC_NAL_IRAP_VCL23 )
         p_sl->no_output_of_prior_pics_flag = bs_read1( p_bs );
     p_sl->slice_pic_parameter_set_id = bs_read_ue( p_bs );
-    if( p_sl->slice_pic_parameter_set_id >= HEVC_PPS_MAX || bs_remain( p_bs ) < 1 )
+    if( p_sl->slice_pic_parameter_set_id > HEVC_PPS_ID_MAX || bs_remain( p_bs ) < 1 )
         return false;
 
     const hevc_picture_parameter_set_t *p_pps = pp_pps[p_sl->slice_pic_parameter_set_id];
diff --git a/modules/packetizer/hevc_nal.h b/modules/packetizer/hevc_nal.h
index ad06819..9103869 100644
--- a/modules/packetizer/hevc_nal.h
+++ b/modules/packetizer/hevc_nal.h
@@ -23,9 +23,9 @@
 # include <vlc_common.h>
 # include <vlc_es.h>
 
-#define HEVC_VPS_MAX 16
-#define HEVC_SPS_MAX 16
-#define HEVC_PPS_MAX 64
+#define HEVC_VPS_ID_MAX 15
+#define HEVC_SPS_ID_MAX 15
+#define HEVC_PPS_ID_MAX 63
 
 enum hevc_general_profile_idc_e
 {



More information about the vlc-commits mailing list