Commit 74f42241 authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: h264: remove temp ep3b to rbsp conversions

parent e19f62b8
......@@ -778,8 +778,6 @@ static bool ParseSlice( decoder_t *p_dec, bool *pb_new_picture, slice_t *p_slice
int i_nal_ref_idc, int i_nal_type, const block_t *p_frag )
{
decoder_sys_t *p_sys = p_dec->p_sys;
uint8_t *pb_dec;
size_t i_dec = 0;
int i_slice_type;
slice_t slice;
bs_t s;
......@@ -787,12 +785,10 @@ static bool ParseSlice( decoder_t *p_dec, bool *pb_new_picture, slice_t *p_slice
if(p_frag->i_buffer < 6)
return false;
/* do not convert the whole frame */
pb_dec = hxxx_ep3b_to_rbsp(&p_frag->p_buffer[5], __MIN( p_frag->i_buffer - 5, 60 ), &i_dec);
if(!pb_dec)
return false;
bs_init( &s, pb_dec, i_dec );
bs_init( &s, &p_frag->p_buffer[5], p_frag->i_buffer - 5 );
unsigned i_bitflow = 0;
s.p_fwpriv = &i_bitflow;
s.pf_forward = hxxx_bsfw_ep3b_to_rbsp; /* Does the emulated 3bytes conversion to rbsp */
/* first_mb_in_slice */
/* int i_first_mb = */ bs_read_ue( &s );
......@@ -858,7 +854,6 @@ static bool ParseSlice( decoder_t *p_dec, bool *pb_new_picture, slice_t *p_slice
if( p_sys->i_pic_order_present_flag && !slice.i_field_pic_flag )
slice.i_delta_pic_order_cnt1 = bs_read_se( &s );
}
free( pb_dec );
/* Detection of the first VCL NAL unit of a primary coded picture
* (cf. 7.4.1.2.4) */
......
......@@ -402,8 +402,6 @@ int h264_get_spspps( uint8_t *p_buf, size_t i_buf,
int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
struct h264_nal_sps *p_sps )
{
uint8_t *pb_dec = NULL;
size_t i_dec = 0;
bs_t s;
int i_tmp;
......@@ -411,11 +409,12 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
return -1;
memset( p_sps, 0, sizeof(struct h264_nal_sps) );
pb_dec = hxxx_ep3b_to_rbsp( &p_sps_buf[5], i_sps_size - 5, &i_dec );
if( !pb_dec )
return -1;
bs_init( &s, pb_dec, i_dec );
bs_init( &s, &p_sps_buf[5], i_sps_size - 5 );
unsigned i_bitflow = 0;
s.p_fwpriv = &i_bitflow;
s.pf_forward = hxxx_bsfw_ep3b_to_rbsp; /* Does the emulated 3bytes conversion to rbsp */
int i_profile_idc = bs_read( &s, 8 );
p_sps->i_profile = i_profile_idc;
p_sps->i_profile_compatibility = bs_read( &s, 8 );
......@@ -423,10 +422,7 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
/* sps id */
p_sps->i_id = bs_read_ue( &s );
if( p_sps->i_id >= H264_SPS_MAX )
{
free( pb_dec );
return -1;
}
if( i_profile_idc == PROFILE_H264_HIGH ||
i_profile_idc == PROFILE_H264_HIGH_10 ||
......@@ -661,8 +657,6 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
/* + unparsed remains */
}
free( pb_dec );
return 0;
}
......
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