From b68ab2609c67d07b6f12ed65125d76bf9a054479 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <michaelni@gmx.at> Date: Thu, 27 Nov 2003 13:38:00 +0000 Subject: [PATCH] dont read from b frames if draw_horiz_band==NULL Originally committed as revision 2533 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mpegvideo.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index bfd086bf695..94444140762 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2571,6 +2571,7 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) qpel_mc_func (*op_qpix)[16]; const int linesize= s->current_picture.linesize[0]; //not s->linesize as this woulnd be wrong for field pics const int uvlinesize= s->current_picture.linesize[1]; + const int readable= s->pict_type != B_TYPE || s->encoding || s->avctx->draw_horiz_band; /* avoid copy if macroblock skipped in last frame too */ /* skip only during decoding as we might trash the buffers during encoding a bit */ @@ -2606,11 +2607,15 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) dct_linesize = linesize; dct_offset = linesize * 8; } - - dest_y= s->dest[0]; - dest_cb= s->dest[1]; - dest_cr= s->dest[2]; - + if(readable){ + dest_y= s->dest[0]; + dest_cb= s->dest[1]; + dest_cr= s->dest[2]; + }else{ + dest_y = s->edge_emu_buffer+32; //FIXME cleanup scratchpad pointers + dest_cb= s->edge_emu_buffer+48; + dest_cr= s->edge_emu_buffer+56; + } if (!s->mb_intra) { /* motion handling */ /* decoding or more than one mb_type (MC was allready done otherwise) */ @@ -2688,6 +2693,11 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) } } } + if(!readable){ + s->dsp.put_pixels_tab[0][0](s->dest[0], dest_y , linesize,16); + s->dsp.put_pixels_tab[1][0](s->dest[1], dest_cb, uvlinesize, 8); + s->dsp.put_pixels_tab[1][0](s->dest[2], dest_cr, uvlinesize, 8); + } } } -- GitLab