comparison h264.c @ 8966:328b7d545d0b libavcodec

Parse dpb_output_delay in SEI picture structure. Patch by Ivan Schreter, schreter gmx net
author cehoyos
date Wed, 18 Feb 2009 00:36:07 +0000
parents a5dce344904a
children f0abc5f9e726
comparison
equal deleted inserted replaced
8965:a5dce344904a 8966:328b7d545d0b
2207 2207
2208 h->thread_context[0] = h; 2208 h->thread_context[0] = h;
2209 h->outputed_poc = INT_MIN; 2209 h->outputed_poc = INT_MIN;
2210 h->prev_poc_msb= 1<<16; 2210 h->prev_poc_msb= 1<<16;
2211 h->sei_recovery_frame_cnt = -1; 2211 h->sei_recovery_frame_cnt = -1;
2212 h->sei_dpb_output_delay = 0;
2212 return 0; 2213 return 0;
2213 } 2214 }
2214 2215
2215 static int frame_start(H264Context *h){ 2216 static int frame_start(H264Context *h){
2216 MpegEncContext * const s = &h->s; 2217 MpegEncContext * const s = &h->s;
3142 idr(h); 3143 idr(h);
3143 if(h->s.current_picture_ptr) 3144 if(h->s.current_picture_ptr)
3144 h->s.current_picture_ptr->reference= 0; 3145 h->s.current_picture_ptr->reference= 0;
3145 h->s.first_field= 0; 3146 h->s.first_field= 0;
3146 h->sei_recovery_frame_cnt = -1; 3147 h->sei_recovery_frame_cnt = -1;
3148 h->sei_dpb_output_delay = 0;
3147 ff_mpeg_flush(avctx); 3149 ff_mpeg_flush(avctx);
3148 } 3150 }
3149 3151
3150 /** 3152 /**
3151 * Find a Picture in the short term reference list by frame number. 3153 * Find a Picture in the short term reference list by frame number.
6780 6782
6781 static int decode_picture_timing(H264Context *h){ 6783 static int decode_picture_timing(H264Context *h){
6782 MpegEncContext * const s = &h->s; 6784 MpegEncContext * const s = &h->s;
6783 if(h->sps.nal_hrd_parameters_present_flag || h->sps.vcl_hrd_parameters_present_flag){ 6785 if(h->sps.nal_hrd_parameters_present_flag || h->sps.vcl_hrd_parameters_present_flag){
6784 skip_bits(&s->gb, h->sps.cpb_removal_delay_length); /* cpb_removal_delay */ 6786 skip_bits(&s->gb, h->sps.cpb_removal_delay_length); /* cpb_removal_delay */
6785 skip_bits(&s->gb, h->sps.dpb_output_delay_length); /* dpb_output_delay */ 6787 h->sei_dpb_output_delay = get_bits(&s->gb, h->sps.dpb_output_delay_length);
6786 } 6788 }
6787 if(h->sps.pic_struct_present_flag){ 6789 if(h->sps.pic_struct_present_flag){
6788 unsigned int i, num_clock_ts; 6790 unsigned int i, num_clock_ts;
6789 h->sei_pic_struct = get_bits(&s->gb, 4); 6791 h->sei_pic_struct = get_bits(&s->gb, 4);
6790 6792
7689 if (!FIELD_PICTURE) 7691 if (!FIELD_PICTURE)
7690 ff_er_frame_end(s); 7692 ff_er_frame_end(s);
7691 7693
7692 MPV_frame_end(s); 7694 MPV_frame_end(s);
7693 h->sei_recovery_frame_cnt = -1; 7695 h->sei_recovery_frame_cnt = -1;
7696 h->sei_dpb_output_delay = 0;
7694 7697
7695 if (cur->field_poc[0]==INT_MAX || cur->field_poc[1]==INT_MAX) { 7698 if (cur->field_poc[0]==INT_MAX || cur->field_poc[1]==INT_MAX) {
7696 /* Wait for second field. */ 7699 /* Wait for second field. */
7697 *data_size = 0; 7700 *data_size = 0;
7698 7701