Commit d144f174 authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: hevc: rename limits

parent f63ee9ba
......@@ -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;
......
......@@ -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)
......
......@@ -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];
......
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment