diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-09-27 02:39:55 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-09-27 02:39:55 +0000 |
commit | 4f8a831994889f2a90669dc230c14d203d52083d (patch) | |
tree | bda1bf3ac88ece871b88a36ff6a4d95eb4ef81a3 /libavcodec/mpegvideo.c | |
parent | 718455951c74269a95117b117a2790c4edeef979 (diff) | |
download | ffmpeg-4f8a831994889f2a90669dc230c14d203d52083d.tar.gz |
set AVCodecContext.width/height to the picture width/height instead of the one stored in the bitstream (that only matters if lowres!=0)
Originally committed as revision 3518 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 95c146429e..c89926ff3e 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1720,11 +1720,13 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){ uint8_t *ptr; int i; int h_chroma_shift, v_chroma_shift; + const int width = s->avctx->width; + const int height= s->avctx->height; 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 >> v_chroma_shift); + memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*height:pict->linesize[i]*height >> v_chroma_shift); pict->data[i]= s->visualization_buffer[i]; } pict->type= FF_BUFFER_TYPE_COPY; @@ -1764,7 +1766,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){ int xy= mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*s->b8_stride; int mx= (pict->motion_val[direction][xy][0]>>shift) + sx; int my= (pict->motion_val[direction][xy][1]>>shift) + sy; - draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100); + draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100); } }else if(IS_16X8(pict->mb_type[mb_index])){ int i; @@ -1778,7 +1780,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){ if(IS_INTERLACED(pict->mb_type[mb_index])) my*=2; - draw_arrow(ptr, sx, sy, mx+sx, my+sy, s->width, s->height, s->linesize, 100); + draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100); } }else{ int sx= mb_x*16 + 8; @@ -1786,7 +1788,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){ int xy= mb_x*2 + mb_y*2*s->b8_stride; int mx= (pict->motion_val[direction][xy][0]>>shift) + sx; int my= (pict->motion_val[direction][xy][1]>>shift) + sy; - draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100); + draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100); } } } @@ -3702,7 +3704,7 @@ void ff_draw_horiz_band(MpegEncContext *s, int y, int h){ if(s->first_field && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return; } - h= FFMIN(h, (s->height>>s->avctx->lowres) - y); + h= FFMIN(h, s->avctx->height - y); if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER)) src= (AVFrame*)s->current_picture_ptr; |