Mercurial > libavcodec.hg
comparison error_resilience.c @ 7924:926c3a5dcdd3 libavcodec
Ensure that no non-existing frame is used.
Fixes issue624.
| author | michael |
|---|---|
| date | Thu, 25 Sep 2008 19:25:28 +0000 |
| parents | 8195c970d077 |
| children | 8dc81763fb42 |
comparison
equal
deleted
inserted
replaced
| 7923:2c15748c530a | 7924:926c3a5dcdd3 |
|---|---|
| 549 } | 549 } |
| 550 | 550 |
| 551 static int is_intra_more_likely(MpegEncContext *s){ | 551 static int is_intra_more_likely(MpegEncContext *s){ |
| 552 int is_intra_likely, i, j, undamaged_count, skip_amount, mb_x, mb_y; | 552 int is_intra_likely, i, j, undamaged_count, skip_amount, mb_x, mb_y; |
| 553 | 553 |
| 554 if(s->last_picture_ptr==NULL) return 1; //no previous frame available -> use spatial prediction | 554 if(!s->last_picture_ptr || !s->last_picture_ptr->data[0]) return 1; //no previous frame available -> use spatial prediction |
| 555 | 555 |
| 556 undamaged_count=0; | 556 undamaged_count=0; |
| 557 for(i=0; i<s->mb_num; i++){ | 557 for(i=0; i<s->mb_num; i++){ |
| 558 const int mb_xy= s->mb_index2xy[i]; | 558 const int mb_xy= s->mb_index2xy[i]; |
| 559 const int error= s->error_status_table[mb_xy]; | 559 const int error= s->error_status_table[mb_xy]; |
