+
+ if(mb_x < mb_width/5){
+ mb_distance = mb_width/5 - mb_x;
+ mb_factor = (float)mb_distance / (float)(mb_width/5);
+ }else if(mb_x > 4*mb_width/5){
+ mb_distance = mb_x - 4*mb_width/5;
+ mb_factor = (float)mb_distance / (float)(mb_width/5);
+ }
+ if(mb_y < mb_height/5){
+ mb_distance = mb_height/5 - mb_y;
+ mb_factor = FFMAX(mb_factor, (float)mb_distance / (float)(mb_height/5));
+ }else if(mb_y > 4*mb_height/5){
+ mb_distance = mb_y - 4*mb_height/5;
+ mb_factor = FFMAX(mb_factor, (float)mb_distance / (float)(mb_height/5));
+ }
+
+ factor*= 1.0 - border_masking*mb_factor;
+