h->i_height -= 2 * bs_read_ue( &s ); }
/* vui: ignored */ }
else if( nal->i_type >= NAL_SLICE && nal->i_type <= NAL_SLICE_IDR ) {
int i_tmp;
/* i_first_mb */ bs_read_ue( &s ); /* picture type */
switch( bs_read_ue( &s ) ) {
case 0: case 5: /* P */ case 1: case 6: /* B */ case 3: case 8: /* SP */ h->b_key = 0; break;
case 2: case 7: /* I */ case 4: case 9: /* SI */
h->b_key = (nal->i_type == NAL_SLICE_IDR); break; }
/* pps id */
bs_read_ue( &s );
/* frame num */
i_tmp = bs_read( &s, h->i_log2_max_frame_num );
if( i_tmp != h->i_frame_num ) *pb_nal_start = 1;
h->i_frame_num = i_tmp;
if( nal->i_type == NAL_SLICE_IDR ) {
i_tmp = bs_read_ue( &s );
if( h->i_nal_type == NAL_SLICE_IDR && h->i_idr_pic_id != i_tmp ) *pb_nal_start = 1;
h->i_idr_pic_id = i_tmp; }
if( h->i_poc_type == 0 ) {
i_tmp = bs_read( &s, h->i_log2_max_poc_lsb ); if( i_tmp != h->i_poc ) *pb_nal_start = 1; h->i_poc = i_tmp; } }
h->i_nal_type = nal->i_type; h->i_ref_idc = nal->i_ref_idc; }
static int ParseNAL( nal_t *nal, avi_t *a, h264_t *h, int *pb_slice ) {
int b_flush = 0; int b_star