comparison error_resilience.c @ 2357:30d8b99e00f3 libavcodec

reset ref_index
author michael
date Fri, 19 Nov 2004 13:08:25 +0000
parents 5ab35105671a
children a3e29f9ab677
comparison
equal deleted inserted replaced
2356:def33a002b94 2357:30d8b99e00f3
664 int i, mb_x, mb_y, error, error_type; 664 int i, mb_x, mb_y, error, error_type;
665 int distance; 665 int distance;
666 int threshold_part[4]= {100,100,100}; 666 int threshold_part[4]= {100,100,100};
667 int threshold= 50; 667 int threshold= 50;
668 int is_intra_likely; 668 int is_intra_likely;
669 int size = s->b8_stride * 2 * s->mb_height;
670 Picture *pic= s->current_picture_ptr;
669 671
670 if(!s->error_resilience || s->error_count==0 || 672 if(!s->error_resilience || s->error_count==0 ||
671 s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return; 673 s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
672 674
673 av_log(s->avctx, AV_LOG_INFO, "concealing %d errors\n", s->error_count); 675 av_log(s->avctx, AV_LOG_INFO, "concealing %d errors\n", s->error_count);
674 676
675 if(s->current_picture.motion_val[0] == NULL){ 677 if(s->current_picture.motion_val[0] == NULL){
676 int size = s->b8_stride * 2 * s->mb_height;
677 Picture *pic= s->current_picture_ptr;
678
679 av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n"); 678 av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
680 679
681 for(i=0; i<2; i++){ 680 for(i=0; i<2; i++){
682 pic->ref_index[i]= av_mallocz(size * sizeof(uint8_t)); 681 pic->ref_index[i]= av_mallocz(size * sizeof(uint8_t));
683 pic->motion_val_base[i]= av_mallocz((size+2) * 2 * sizeof(uint16_t)); 682 pic->motion_val_base[i]= av_mallocz((size+2) * 2 * sizeof(uint16_t));
685 } 684 }
686 pic->motion_subsample_log2= 3; 685 pic->motion_subsample_log2= 3;
687 s->current_picture= *s->current_picture_ptr; 686 s->current_picture= *s->current_picture_ptr;
688 } 687 }
689 688
689 for(i=0; i<2; i++){
690 if(pic->ref_index[i])
691 memset(pic->ref_index[i], 0, size * sizeof(uint8_t));
692 }
693
690 if(s->avctx->debug&FF_DEBUG_ER){ 694 if(s->avctx->debug&FF_DEBUG_ER){
691 for(mb_y=0; mb_y<s->mb_height; mb_y++){ 695 for(mb_y=0; mb_y<s->mb_height; mb_y++){
692 for(mb_x=0; mb_x<s->mb_width; mb_x++){ 696 for(mb_x=0; mb_x<s->mb_width; mb_x++){
693 int status= s->error_status_table[mb_x + mb_y*s->mb_stride]; 697 int status= s->error_status_table[mb_x + mb_y*s->mb_stride];
694 698