# HG changeset patch # User michaelni # Date 1032794169 0 # Node ID 199b324b26932934f645582f831a1e0269e7a835 # Parent a1c69cb685b304595fba2e33a44dc4f540f78067 fixing variance scaling for b frames (messed adaptive quants up) cliping too long MVs in b frames instead of setting them to 0 diff -r a1c69cb685b3 -r 199b324b2693 motion_est.c --- a/motion_est.c Mon Sep 23 14:56:11 2002 +0000 +++ b/motion_est.c Mon Sep 23 15:16:09 2002 +0000 @@ -1546,7 +1546,7 @@ score=fbmin; type= MB_TYPE_BIDIR; } - score= (score*score)>>8; + score= (score*score + 128*256)>>16; s->mc_mb_var_sum += score; s->mc_mb_var[mb_y*s->mb_width + mb_x] = score; //FIXME use SSD } @@ -1698,18 +1698,15 @@ int xy= (y+1)* (s->mb_width+2)+1; int i= y*s->mb_width; for(x=0; xmb_width; x++){ - if(s->mb_type[i]&type){ - if( fcode_tab[mv_table[xy][0] + MAX_MV] > f_code - || fcode_tab[mv_table[xy][0] + MAX_MV] == 0 - || fcode_tab[mv_table[xy][1] + MAX_MV] > f_code - || fcode_tab[mv_table[xy][1] + MAX_MV] == 0 ){ - if(s->mb_type[i]&(~type)) s->mb_type[i] &= ~type; - else{ - mv_table[xy][0] = 0; - mv_table[xy][1] = 0; - //this is certainly bad FIXME - } - } + if( fcode_tab[mv_table[xy][0] + MAX_MV] > f_code + || fcode_tab[mv_table[xy][0] + MAX_MV] == 0){ + if(mv_table[xy][0]>0) mv_table[xy][0]= (16< f_code + || fcode_tab[mv_table[xy][1] + MAX_MV] == 0){ + if(mv_table[xy][1]>0) mv_table[xy][1]= (16<