Mercurial > libavcodec.hg
comparison mpegvideo.c @ 1393:ba99a78bcb37 libavcodec
make the h263 decoder more error tolerant
author | michaelni |
---|---|
date | Fri, 01 Aug 2003 11:00:03 +0000 |
parents | da0b3a50d209 |
children | b2ac20ff1458 |
comparison
equal
deleted
inserted
replaced
1392:13a02518ffb6 | 1393:ba99a78bcb37 |
---|---|
1002 | 1002 |
1003 if(s->last_picture_ptr) s->last_picture= *s->last_picture_ptr; | 1003 if(s->last_picture_ptr) s->last_picture= *s->last_picture_ptr; |
1004 if(s->next_picture_ptr) s->next_picture= *s->next_picture_ptr; | 1004 if(s->next_picture_ptr) s->next_picture= *s->next_picture_ptr; |
1005 if(s->new_picture_ptr ) s->new_picture = *s->new_picture_ptr; | 1005 if(s->new_picture_ptr ) s->new_picture = *s->new_picture_ptr; |
1006 | 1006 |
1007 if(s->pict_type != I_TYPE && s->last_picture_ptr==NULL){ | |
1008 fprintf(stderr, "warning: first frame is no keyframe\n"); | |
1009 assert(s->pict_type != B_TYPE); //these should have been dropped if we dont have a reference | |
1010 goto alloc; | |
1011 } | |
1012 | |
1013 assert(s->pict_type == I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0])); | |
1014 | |
1007 if(s->picture_structure!=PICT_FRAME){ | 1015 if(s->picture_structure!=PICT_FRAME){ |
1008 int i; | 1016 int i; |
1009 for(i=0; i<4; i++){ | 1017 for(i=0; i<4; i++){ |
1010 if(s->picture_structure == PICT_BOTTOM_FIELD){ | 1018 if(s->picture_structure == PICT_BOTTOM_FIELD){ |
1011 s->current_picture.data[i] += s->current_picture.linesize[i]; | 1019 s->current_picture.data[i] += s->current_picture.linesize[i]; |
1012 } | 1020 } |
1013 s->current_picture.linesize[i] *= 2; | 1021 s->current_picture.linesize[i] *= 2; |
1014 s->last_picture.linesize[i] *=2; | 1022 s->last_picture.linesize[i] *=2; |
1015 s->next_picture.linesize[i] *=2; | 1023 s->next_picture.linesize[i] *=2; |
1016 } | 1024 } |
1017 } | |
1018 | |
1019 if(s->pict_type != I_TYPE && s->last_picture_ptr==NULL){ | |
1020 fprintf(stderr, "warning: first frame is no keyframe\n"); | |
1021 assert(s->pict_type != B_TYPE); //these should have been dropped if we dont have a reference | |
1022 goto alloc; | |
1023 } | 1025 } |
1024 } | 1026 } |
1025 | 1027 |
1026 s->hurry_up= s->avctx->hurry_up; | 1028 s->hurry_up= s->avctx->hurry_up; |
1027 s->error_resilience= avctx->error_resilience; | 1029 s->error_resilience= avctx->error_resilience; |