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