aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-08-13 14:40:33 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-08-13 14:40:33 +0000
commit1765920791ab459ab2155a3285459f8fe856daf5 (patch)
treef574c76452c802f8eb058beb98107ce6d3441e33 /libavcodec
parentbaced9f5986a466c957456f5cf32a722d8b35512 (diff)
downloadffmpeg-1765920791ab459ab2155a3285459f8fe856daf5.tar.gz
minor optimization
Originally committed as revision 3386 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 0800aa9aac..6f51545afd 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -3484,15 +3484,15 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x - 1;
//block_index is not used by mpeg2, so it is not affected by chroma_format
- s->dest[0] = s->current_picture.data[0] + (s->mb_x - 1)*16;
- s->dest[1] = s->current_picture.data[1] + (s->mb_x - 1)*(16 >> s->chroma_x_shift);
- s->dest[2] = s->current_picture.data[2] + (s->mb_x - 1)*(16 >> s->chroma_x_shift);
-
+ s->dest[0] = s->current_picture.data[0] + ((s->mb_x - 1) << 4);
+ s->dest[1] = s->current_picture.data[1] + ((s->mb_x - 1) << (4 - s->chroma_x_shift));
+ s->dest[2] = s->current_picture.data[2] + ((s->mb_x - 1) << (4 - s->chroma_x_shift));
+
if(!(s->pict_type==B_TYPE && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
{
- s->dest[0] += s->mb_y * linesize * 16;
- s->dest[1] += s->mb_y * uvlinesize * (16 >> s->chroma_y_shift);
- s->dest[2] += s->mb_y * uvlinesize * (16 >> s->chroma_y_shift);
+ s->dest[0] += s->mb_y * linesize << 4;
+ s->dest[1] += s->mb_y * uvlinesize << (4 - s->chroma_y_shift);
+ s->dest[2] += s->mb_y * uvlinesize << (4 - s->chroma_y_shift);
}
}