diff mpegvideo.c @ 951:ad264a7d4f94 libavcodec

motion estimation pre pass
author michaelni
date Thu, 02 Jan 2003 01:29:35 +0000
parents 9be53be2d1a9
children f348d302a51e
line wrap: on
line diff
--- a/mpegvideo.c	Wed Jan 01 16:47:31 2003 +0000
+++ b/mpegvideo.c	Thu Jan 02 01:29:35 2003 +0000
@@ -2789,6 +2789,19 @@
 
     /* 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);