diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-03-15 14:57:17 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-03-15 14:57:17 +0000 |
commit | 4278e7a6f5a9c2fd3e43efdeee583972fe5fb72f (patch) | |
tree | c9110f7feeb3c988405e84a51695b84e6a1339b6 /libavcodec/mpegvideo.c | |
parent | d6231b9e70f0dc2413c668691e744687b939e411 (diff) | |
download | ffmpeg-4278e7a6f5a9c2fd3e43efdeee583972fe5fb72f.tar.gz |
optimization
Originally committed as revision 332 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 1b97cb699b..070058d8b8 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1123,6 +1123,12 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->avg_mb_var = s->avg_mb_var / s->mb_num; + s->block_wrap[0]= + s->block_wrap[1]= + s->block_wrap[2]= + s->block_wrap[3]= s->mb_width*2 + 2; + s->block_wrap[4]= + s->block_wrap[5]= s->mb_width + 2; for(mb_y=0; mb_y < s->mb_height; mb_y++) { /* Put GOB header based on RTP MTU */ /* TODO: Put all this stuff in a separate generic function */ @@ -1138,10 +1144,22 @@ static void encode_picture(MpegEncContext *s, int picture_number) } } + s->block_index[0]= s->block_wrap[0]*(mb_y*2 + 1) - 1; + s->block_index[1]= s->block_wrap[0]*(mb_y*2 + 1); + s->block_index[2]= s->block_wrap[0]*(mb_y*2 + 2) - 1; + s->block_index[3]= s->block_wrap[0]*(mb_y*2 + 2); + s->block_index[4]= s->block_wrap[4]*(mb_y + 1) + s->block_wrap[0]*(s->mb_height*2 + 2); + s->block_index[5]= s->block_wrap[4]*(mb_y + 1 + s->mb_height + 2) + s->block_wrap[0]*(s->mb_height*2 + 2); for(mb_x=0; mb_x < s->mb_width; mb_x++) { s->mb_x = mb_x; s->mb_y = mb_y; + s->block_index[0]+=2; + s->block_index[1]+=2; + s->block_index[2]+=2; + s->block_index[3]+=2; + s->block_index[4]++; + s->block_index[5]++; #if 0 /* compute motion vector and macro block type (intra or non intra) */ motion_x = 0; |