changeset 1746:67949dc3117b libavcodec

dont calculate stuff if its not used ...
author michael
date Wed, 14 Jan 2004 02:35:04 +0000
parents fe5e2c14a04c
children 8cfd36bfe504
files motion_est.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/motion_est.c	Wed Jan 14 02:21:39 2004 +0000
+++ b/motion_est.c	Wed Jan 14 02:35:04 2004 +0000
@@ -840,7 +840,8 @@
         dmin4= s->me.sub_motion_search(s, &mx4, &my4, dmin4, 
 					  pred_x4, pred_y4, src_data, ref_data, stride, uvstride, size, h, mv_penalty);
         
-        if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
+        if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]
+           && s->avctx->mb_decision == FF_MB_DECISION_SIMPLE){
             int dxy;
             const int offset= ((block&1) + (block>>1)*stride)*8;
             uint8_t *dest_y = s->me.scratchpad + offset;
@@ -990,7 +991,8 @@
             mv_table[xy][0]= mx_i;
             mv_table[xy][1]= my_i;
             
-            if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
+            if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]
+               && s->avctx->mb_decision == FF_MB_DECISION_SIMPLE){
                 int dxy;
 
                 //FIXME chroma ME