Mercurial > libavcodec.hg
comparison error_resilience.c @ 903:22ee74da2cd3 libavcodec
cleanup
adding AVVideoFrame
moving quality, pict_type, key_frame, qscale_table, ... to AVVideoFrame
removing obsolete variables in AVCodecContext
skiping of MBs in b frames
correctly initalizing AVCodecContext
picture buffer cleanup
| author | michaelni |
|---|---|
| date | Wed, 04 Dec 2002 10:04:03 +0000 |
| parents | eacc2dd8fd9d |
| children | 06776293eabb |
comparison
equal
deleted
inserted
replaced
| 902:6acc8394960d | 903:22ee74da2cd3 |
|---|---|
| 462 | 462 |
| 463 s->mb_x= mb_x; | 463 s->mb_x= mb_x; |
| 464 s->mb_y= mb_y; | 464 s->mb_y= mb_y; |
| 465 for(j=0; j<pred_count; j++){ | 465 for(j=0; j<pred_count; j++){ |
| 466 int score=0; | 466 int score=0; |
| 467 UINT8 *src= s->current_picture[0] + mb_x*16 + mb_y*16*s->linesize; | 467 UINT8 *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; |
| 468 | 468 |
| 469 s->motion_val[mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0]; | 469 s->motion_val[mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0]; |
| 470 s->motion_val[mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1]; | 470 s->motion_val[mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1]; |
| 471 MPV_decode_mb(s, s->block); | 471 MPV_decode_mb(s, s->block); |
| 472 | 472 |
| 554 | 554 |
| 555 j++; | 555 j++; |
| 556 if((j%skip_amount) != 0) continue; //skip a few to speed things up | 556 if((j%skip_amount) != 0) continue; //skip a few to speed things up |
| 557 | 557 |
| 558 if(s->pict_type==I_TYPE){ | 558 if(s->pict_type==I_TYPE){ |
| 559 UINT8 *mb_ptr = s->current_picture[0] + mb_x*16 + mb_y*16*s->linesize; | 559 UINT8 *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; |
| 560 UINT8 *last_mb_ptr= s->last_picture [0] + mb_x*16 + mb_y*16*s->linesize; | 560 UINT8 *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize; |
| 561 | 561 |
| 562 is_intra_likely += s->dsp.pix_abs16x16(last_mb_ptr, mb_ptr , s->linesize); | 562 is_intra_likely += s->dsp.pix_abs16x16(last_mb_ptr, mb_ptr , s->linesize); |
| 563 is_intra_likely -= s->dsp.pix_abs16x16(last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize); | 563 is_intra_likely -= s->dsp.pix_abs16x16(last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize); |
| 564 }else{ | 564 }else{ |
| 565 if(s->mbintra_table[i]) //HACK (this is allways inited but we should use mb_type[]) | 565 if(s->mbintra_table[i]) //HACK (this is allways inited but we should use mb_type[]) |
| 800 error= s->error_status_table[i]; | 800 error= s->error_status_table[i]; |
| 801 | 801 |
| 802 if(s->mb_type[i]&MB_TYPE_INTRA) continue; //intra | 802 if(s->mb_type[i]&MB_TYPE_INTRA) continue; //intra |
| 803 // if(error&MV_ERROR) continue; //inter data damaged FIXME is this good? | 803 // if(error&MV_ERROR) continue; //inter data damaged FIXME is this good? |
| 804 | 804 |
| 805 dest_y = s->current_picture[0] + mb_x*16 + mb_y*16*s->linesize; | 805 dest_y = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; |
| 806 dest_cb= s->current_picture[1] + mb_x*8 + mb_y*8 *s->uvlinesize; | 806 dest_cb= s->current_picture.data[1] + mb_x*8 + mb_y*8 *s->uvlinesize; |
| 807 dest_cr= s->current_picture[2] + mb_x*8 + mb_y*8 *s->uvlinesize; | 807 dest_cr= s->current_picture.data[2] + mb_x*8 + mb_y*8 *s->uvlinesize; |
| 808 | 808 |
| 809 dc_ptr= &s->dc_val[0][mb_x*2+1 + (mb_y*2+1)*(s->mb_width*2+2)]; | 809 dc_ptr= &s->dc_val[0][mb_x*2+1 + (mb_y*2+1)*(s->mb_width*2+2)]; |
| 810 for(n=0; n<4; n++){ | 810 for(n=0; n<4; n++){ |
| 811 dc=0; | 811 dc=0; |
| 812 for(y=0; y<8; y++){ | 812 for(y=0; y<8; y++){ |
| 850 error= s->error_status_table[i]; | 850 error= s->error_status_table[i]; |
| 851 | 851 |
| 852 if(!(s->mb_type[i]&MB_TYPE_INTRA)) continue; //inter | 852 if(!(s->mb_type[i]&MB_TYPE_INTRA)) continue; //inter |
| 853 if(!(error&AC_ERROR)) continue; //undamaged | 853 if(!(error&AC_ERROR)) continue; //undamaged |
| 854 | 854 |
| 855 dest_y = s->current_picture[0] + mb_x*16 + mb_y*16*s->linesize; | 855 dest_y = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; |
| 856 dest_cb= s->current_picture[1] + mb_x*8 + mb_y*8 *s->uvlinesize; | 856 dest_cb= s->current_picture.data[1] + mb_x*8 + mb_y*8 *s->uvlinesize; |
| 857 dest_cr= s->current_picture[2] + mb_x*8 + mb_y*8 *s->uvlinesize; | 857 dest_cr= s->current_picture.data[2] + mb_x*8 + mb_y*8 *s->uvlinesize; |
| 858 | 858 |
| 859 put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y); | 859 put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y); |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 #endif | 862 #endif |
| 863 | 863 |
| 864 if(s->avctx->error_concealment&FF_EC_DEBLOCK){ | 864 if(s->avctx->error_concealment&FF_EC_DEBLOCK){ |
| 865 /* filter horizontal block boundaries */ | 865 /* filter horizontal block boundaries */ |
| 866 h_block_filter(s, s->current_picture[0], s->mb_width*2, s->mb_height*2, s->linesize , 1); | 866 h_block_filter(s, s->current_picture.data[0], s->mb_width*2, s->mb_height*2, s->linesize , 1); |
| 867 h_block_filter(s, s->current_picture[1], s->mb_width , s->mb_height , s->uvlinesize, 0); | 867 h_block_filter(s, s->current_picture.data[1], s->mb_width , s->mb_height , s->uvlinesize, 0); |
| 868 h_block_filter(s, s->current_picture[2], s->mb_width , s->mb_height , s->uvlinesize, 0); | 868 h_block_filter(s, s->current_picture.data[2], s->mb_width , s->mb_height , s->uvlinesize, 0); |
| 869 | 869 |
| 870 /* filter vertical block boundaries */ | 870 /* filter vertical block boundaries */ |
| 871 v_block_filter(s, s->current_picture[0], s->mb_width*2, s->mb_height*2, s->linesize , 1); | 871 v_block_filter(s, s->current_picture.data[0], s->mb_width*2, s->mb_height*2, s->linesize , 1); |
| 872 v_block_filter(s, s->current_picture[1], s->mb_width , s->mb_height , s->uvlinesize, 0); | 872 v_block_filter(s, s->current_picture.data[1], s->mb_width , s->mb_height , s->uvlinesize, 0); |
| 873 v_block_filter(s, s->current_picture[2], s->mb_width , s->mb_height , s->uvlinesize, 0); | 873 v_block_filter(s, s->current_picture.data[2], s->mb_width , s->mb_height , s->uvlinesize, 0); |
| 874 } | 874 } |
| 875 | 875 |
| 876 /* clean a few tables */ | 876 /* clean a few tables */ |
| 877 for(i=0; i<s->mb_num; i++){ | 877 for(i=0; i<s->mb_num; i++){ |
| 878 int error= s->error_status_table[i]; | 878 int error= s->error_status_table[i]; |
