comparison mpeg12.c @ 6109:c8b9b73b979f libavcodec

Drop non key frames before the first key frame.
author michael
date Sat, 05 Jan 2008 01:14:09 +0000
parents 14a9ceb162d2
children 0ed0d9d578ad
comparison
equal deleted inserted replaced
6108:75804d49f33b 6109:c8b9b73b979f
2327 int mb_y= start_code - SLICE_MIN_START_CODE; 2327 int mb_y= start_code - SLICE_MIN_START_CODE;
2328 2328
2329 if(s2->last_picture_ptr==NULL){ 2329 if(s2->last_picture_ptr==NULL){
2330 /* Skip B-frames if we do not have reference frames. */ 2330 /* Skip B-frames if we do not have reference frames. */
2331 if(s2->pict_type==B_TYPE) break; 2331 if(s2->pict_type==B_TYPE) break;
2332 }
2333 if(s2->next_picture_ptr==NULL){
2332 /* Skip P-frames if we do not have reference frame no valid header. */ 2334 /* Skip P-frames if we do not have reference frame no valid header. */
2333 // if(s2->pict_type==P_TYPE && s2->first_field && !s2->first_slice) break; 2335 if(s2->pict_type==P_TYPE && (s2->first_field || s2->picture_structure==PICT_FRAME)) break;
2334 } 2336 }
2335 /* Skip B-frames if we are in a hurry. */ 2337 /* Skip B-frames if we are in a hurry. */
2336 if(avctx->hurry_up && s2->pict_type==B_TYPE) break; 2338 if(avctx->hurry_up && s2->pict_type==B_TYPE) break;
2337 if( (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==B_TYPE) 2339 if( (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==B_TYPE)
2338 ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=I_TYPE) 2340 ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=I_TYPE)