Index: /trunk/FACT++/src/ratecontrol.cc
===================================================================
--- /trunk/FACT++/src/ratecontrol.cc	(revision 15360)
+++ /trunk/FACT++/src/ratecontrol.cc	(revision 15361)
@@ -196,5 +196,5 @@
 
             const float dif = fabs(sdata.fBoardRate[i]-mb)/db;
-            if (dif>5)
+            if (dif>3)
             {
                 if (fVerbose)
@@ -221,5 +221,5 @@
 
 
-                    const float step = (log10(sdata.fPatchRate[i*4+j])-log10(mp+5*dp))/0.039;
+                    const float step = (log10(sdata.fPatchRate[i*4+j])-log10(mp+3.5*dp))/0.039;
                     //  * (dif-5)/dif
                     Step(i*4+j, step);
@@ -227,8 +227,8 @@
                 }
 
-                // For pixels below the meadian correct also back to median+3*deviation
+                // For pixels below the median correct also back to median+3*deviation
                 if (sdata.fPatchRate[i*4+j]<mp)
                 {
-                    const float step = (log10(sdata.fPatchRate[i*4+j])-log10(mp+3*dp))/0.039;
+                    const float step = (log10(sdata.fPatchRate[i*4+j])-log10(mp+3.5*dp))/0.039;
                     Step(i*4+j, step);
                     continue;
@@ -481,5 +481,8 @@
         //fThresholdMin = max(uint16_t(36.0833*pow(avg, 0.638393)+184.037), fThresholdReference);
         //fThresholdMin = max(uint16_t(42.4*pow(avg, 0.642)+182), fThresholdReference);
-        fThresholdMin = max(uint16_t(41.6*pow(avg, 0.642)+175), fThresholdReference);
+        //fThresholdMin = max(uint16_t(41.6*pow(avg+1, 0.642)+175), fThresholdReference);
+        //fThresholdMin = max(uint16_t(42.3*pow(avg, 0.655)+190), fThresholdReference);
+        fThresholdMin = max(uint16_t(46.6*pow(avg, 0.627)+187), fThresholdReference);
+        //fThresholdMin = max(uint16_t(41.6*pow(avg, 0.642)+175), fThresholdReference);
         fThresholds.assign(160, fThresholdMin);
 
@@ -493,5 +496,5 @@
             avg2 += vec[i];
 
-            if (vec[i]-avg>6*avg_dev)
+            if (vec[i]-avg>3.5*avg_dev)
             {
                 fThresholds[i] = max(uint16_t(40.5*pow(vec[i], 0.642)+164), fThresholdReference);
