aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-01-04 17:13:14 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-01-04 17:13:14 +0000
commit0982834b04d3c607171b3ab8b2093fec3575e18f (patch)
treeeb6b1ab64ee6e28bc8319e3bbd2b6ccbb2355645
parent5ac59c559b18c2585bae2dd29b77d2b38b7e3449 (diff)
downloadffmpeg-0982834b04d3c607171b3ab8b2093fec3575e18f.tar.gz
non YV12 vissualization fix by (Wolfgang Hesseler <qv at multimediaware dot com>)
Originally committed as revision 2662 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mpegvideo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 827e2ad5b4..6bd124ccb7 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1491,10 +1491,12 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
int mb_y;
uint8_t *ptr;
int i;
+ int h_chroma_shift, v_chroma_shift;
s->low_delay=0; //needed to see the vectors without trashing the buffers
+ avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift);
for(i=0; i<3; i++){
- memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*s->height:pict->linesize[i]*s->height/2);
+ memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*s->height:pict->linesize[i]*s->height >> v_chroma_shift);
pict->data[i]= s->visualization_buffer[i];
}
pict->type= FF_BUFFER_TYPE_COPY;