diff options
Diffstat (limited to 'src/libffmpeg/libavcodec/error_resilience.c')
-rw-r--r-- | src/libffmpeg/libavcodec/error_resilience.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/libffmpeg/libavcodec/error_resilience.c b/src/libffmpeg/libavcodec/error_resilience.c index 4ac92bfd2..5ac2190b3 100644 --- a/src/libffmpeg/libavcodec/error_resilience.c +++ b/src/libffmpeg/libavcodec/error_resilience.c @@ -30,6 +30,14 @@ #include "mpegvideo.h" #include "common.h" +static void decode_mb(MpegEncContext *s){ + s->dest[0] = s->current_picture.data[0] + (s->mb_y * 16* s->linesize ) + s->mb_x * 16; + s->dest[1] = s->current_picture.data[1] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8; + s->dest[2] = s->current_picture.data[2] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8; + + MPV_decode_mb(s, s->block); +} + /** * replaces the current MB with a flat dc only version. */ @@ -346,7 +354,7 @@ static void guess_mv(MpegEncContext *s){ s->mb_y= mb_y; s->mv[0][0][0]= 0; s->mv[0][0][1]= 0; - MPV_decode_mb(s, s->block); + decode_mb(s); } } return; @@ -480,7 +488,7 @@ int score_sum=0; s->motion_val[mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0]; s->motion_val[mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1]; - MPV_decode_mb(s, s->block); + decode_mb(s); if(mb_x>0 && fixed[mb_xy-1]){ int k; @@ -513,7 +521,7 @@ score_sum+= best_score; s->motion_val[mot_index][0]= s->mv[0][0][0]= mv_predictor[best_pred][0]; s->motion_val[mot_index][1]= s->mv[0][0][1]= mv_predictor[best_pred][1]; - MPV_decode_mb(s, s->block); + decode_mb(s); if(s->mv[0][0][0] != prev_x || s->mv[0][0][1] != prev_y){ @@ -848,7 +856,7 @@ void ff_er_frame_end(MpegEncContext *s){ s->mb_x= mb_x; s->mb_y= mb_y; - MPV_decode_mb(s, s->block); + decode_mb(s); } } @@ -888,12 +896,16 @@ void ff_er_frame_end(MpegEncContext *s){ s->dsp.clear_blocks(s->block[0]); s->mb_x= mb_x; s->mb_y= mb_y; - MPV_decode_mb(s, s->block); + decode_mb(s); } } }else guess_mv(s); +#ifdef HAVE_XVMC + /* the filters below are not XvMC compatible, skip them */ + if(s->avctx->xvmc_acceleration) goto ec_clean; +#endif /* fill DC for inter blocks */ for(mb_y=0; mb_y<s->mb_height; mb_y++){ for(mb_x=0; mb_x<s->mb_width; mb_x++){ @@ -979,6 +991,9 @@ void ff_er_frame_end(MpegEncContext *s){ v_block_filter(s, s->current_picture.data[2], s->mb_width , s->mb_height , s->uvlinesize, 0); } +#ifdef HAVE_XVMC +ec_clean: +#endif /* clean a few tables */ for(i=0; i<s->mb_num; i++){ const int mb_xy= s->mb_index2xy[i]; |