diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-01-02 01:29:35 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-01-02 01:29:35 +0000 |
commit | f5fb6b34fd1053d1fcb61e4f35de8fa8befb834b (patch) | |
tree | 4ce82906776a8321eb11c553ab68c0fe343c7726 /libavcodec/mpegvideo.c | |
parent | 0a13093de85c0077810fcafdaceb7f98c1d75743 (diff) | |
download | ffmpeg-f5fb6b34fd1053d1fcb61e4f35de8fa8befb834b.tar.gz |
motion estimation pre pass
Originally committed as revision 1389 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 139688f794..f773d9f306 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2789,6 +2789,19 @@ static void encode_picture(MpegEncContext *s, int picture_number) /* Estimate motion for every MB */ if(s->pict_type != I_TYPE){ + + if(s->pict_type != B_TYPE){ + if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ + for(mb_y=s->mb_height-1; mb_y >=0 ; mb_y--) { + for(mb_x=s->mb_width-1; mb_x >=0 ; mb_x--) { + s->mb_x = mb_x; + s->mb_y = mb_y; + ff_pre_estimate_p_frame_motion(s, mb_x, mb_y); + } + } + } + } + for(mb_y=0; mb_y < s->mb_height; mb_y++) { 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); |