diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h
index 01759b03319a08c0ae695afcd6bf7d3360986b9b..64c305a8d43c9ddf3a1d0b1526d928800988c95d 100644
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -32,7 +32,16 @@
 void vp8_initialize_common(void);
 
 #define MINQ 0
+
+/*#if CONFIG_EXTEND_QRANGE
+#define MAXQ 255
+#define QINDEX_BITS 8
+#else*/
 #define MAXQ 127
+#define QINDEX_BITS 7
+//#endif
+
+
 #define QINDEX_RANGE (MAXQ + 1)
 
 #define NUM_YV12_BUFFERS 4
diff --git a/vp8/common/quant_common.c b/vp8/common/quant_common.c
index 79c40d630f1743ee9eb320042ea96a8b7ccacb46..2b5488a497c2521cd8917cca8305a1581eeecf66 100644
--- a/vp8/common/quant_common.c
+++ b/vp8/common/quant_common.c
@@ -84,6 +84,10 @@ static int ac_qlookup[QINDEX_RANGE] =
     155,  158,  161,  164,  167,  170,  173,  177,  181,  185,  189,  193,  197,  201,  205,  209,
     213,  217,  221,  225,  229,  234,  239,  245,  249,  254,  259,  264,  269,  274,  279,  284,
 };
+
+//static int dc_qlookup[QINDEX_RANGE];
+//static int ac_qlookup[QINDEX_RANGE];
+
 #endif
 
 #if CONFIG_EXTEND_QRANGE
@@ -109,6 +113,7 @@ void vp8_init_quant_tables()
     {
         ac_qlookup[i] = current_val;
         current_val = (int)((double)current_val * 1.042);
+        //current_val = (int)((double)current_val * 1.01765);
         if ( current_val == last_val )
             current_val++;
         last_val = current_val;
@@ -132,8 +137,8 @@ int vp8_dc_quant(int QIndex, int Delta)
 
     QIndex = QIndex + Delta;
 
-    if (QIndex > 127)
-        QIndex = 127;
+    if (QIndex > MAXQ)
+        QIndex = MAXQ;
     else if (QIndex < 0)
         QIndex = 0;
 
@@ -147,8 +152,8 @@ int vp8_dc2quant(int QIndex, int Delta)
 
     QIndex = QIndex + Delta;
 
-    if (QIndex > 127)
-        QIndex = 127;
+    if (QIndex > MAXQ)
+        QIndex = MAXQ;
     else if (QIndex < 0)
         QIndex = 0;
 
@@ -166,8 +171,8 @@ int vp8_dc_uv_quant(int QIndex, int Delta)
 
     QIndex = QIndex + Delta;
 
-    if (QIndex > 127)
-        QIndex = 127;
+    if (QIndex > MAXQ)
+        QIndex = MAXQ;
     else if (QIndex < 0)
         QIndex = 0;
 
@@ -180,8 +185,8 @@ int vp8_ac_yquant(int QIndex)
 {
     int retval;
 
-    if (QIndex > 127)
-        QIndex = 127;
+    if (QIndex > MAXQ)
+        QIndex = MAXQ;
     else if (QIndex < 0)
         QIndex = 0;
 
@@ -195,8 +200,8 @@ int vp8_ac2quant(int QIndex, int Delta)
 
     QIndex = QIndex + Delta;
 
-    if (QIndex > 127)
-        QIndex = 127;
+    if (QIndex > MAXQ)
+        QIndex = MAXQ;
     else if (QIndex < 0)
         QIndex = 0;
 #if !CONFIG_EXTEND_QRANGE
@@ -216,8 +221,8 @@ int vp8_ac_uv_quant(int QIndex, int Delta)
 
     QIndex = QIndex + Delta;
 
-    if (QIndex > 127)
-        QIndex = 127;
+    if (QIndex > MAXQ)
+        QIndex = MAXQ;
     else if (QIndex < 0)
         QIndex = 0;
 
diff --git a/vp8/common/seg_common.c b/vp8/common/seg_common.c
index ee9ead4a5a843cc1070c44f6985c26ecc5fa6a11..cab642abc26072e098310d41277da362277f065a 100644
--- a/vp8/common/seg_common.c
+++ b/vp8/common/seg_common.c
@@ -12,7 +12,8 @@
 
 //#if CONFIG_SEGFEATURES
 const int segfeaturedata_signed[SEG_LVL_MAX] = {1, 1, 0, 0, 0, 0};
-const int vp8_seg_feature_data_bits[SEG_LVL_MAX] = {7, 6, 4, 4, 6, 2};
+const int vp8_seg_feature_data_bits[SEG_LVL_MAX] =
+              {QINDEX_BITS, 6, 4, 4, 6, 2};
 
 // These functions provide access to new segment level features.
 // Eventually these function may be "optimized out" but for the moment,
diff --git a/vp8/common/seg_common.h b/vp8/common/seg_common.h
index 876b806ada3805bbf0dc6afbb9f971820504e67c..6bd03eed8696320f1ca0fd529c8f9266dbf41975 100644
--- a/vp8/common/seg_common.h
+++ b/vp8/common/seg_common.h
@@ -9,6 +9,7 @@
  */
 
 #include "type_aliases.h"
+#include "onyxc_int.h"
 #include "vp8/common/blockd.h"
 
 #ifndef __INC_SEG_COMMON_H__
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 0659f930880479090da6ab8d48f0f24d85d2af05..6e8284f4684aa72cf124bb2bed8b47d4f9ff0d98 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -1204,7 +1204,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
     {
         int Q, q_update;
 
-        Q = vp8_read_literal(bc, 7);  /* AC 1st order Q = default */
+        Q = vp8_read_literal(bc, QINDEX_BITS);  /* AC 1st order Q = default */
         pc->base_qindex = Q;
         q_update = 0;
         pc->y1dc_delta_q = get_delta_q(bc, pc->y1dc_delta_q, &q_update);
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index 6f92ff0a7d00adc0aa7f8e057b60c3506c57a136..cad4ef2d6385d3f7e09774dbdd91825100db9177 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -28,26 +28,6 @@
 //#if CONFIG_SEGFEATURES
 #include "vp8/common/seg_common.h"
 
-const int vp8cx_base_skip_false_prob[128] =
-{
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    255, 255, 255, 255, 255, 255, 255, 255,
-    251, 248, 244, 240, 236, 232, 229, 225,
-    221, 217, 213, 208, 204, 199, 194, 190,
-    187, 183, 179, 175, 172, 168, 164, 160,
-    157, 153, 149, 145, 142, 138, 134, 130,
-    127, 124, 120, 117, 114, 110, 107, 104,
-    101, 98,  95,  92,  89,  86,  83, 80,
-    77,  74,  71,  68,  65,  62,  59, 56,
-    53,  50,  47,  44,  41,  38,  35, 32,
-    30,  28,  26,  24,  22,  20,  18, 16,
-};
-
 #if defined(SECTIONBITS_OUTPUT)
 unsigned __int64 Sectionbits[500];
 #endif
@@ -2252,8 +2232,8 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
     //signal here is multi token partition is enabled
     vp8_write_literal(bc, pc->multi_token_partition, 2);
 
-    // Frame Qbaseline quantizer index
-    vp8_write_literal(bc, pc->base_qindex, 7);
+    // Frame Q baseline quantizer index
+    vp8_write_literal(bc, pc->base_qindex, QINDEX_BITS);
 
     // Transmit Dc, Second order and Uv quantizer delta information
     put_delta_q(bc, pc->y1dc_delta_q);
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 0b3e83bb3a4ab17010730e457da46de0a436fc72..4b97ed4fea75e4144a4d659ae8e41b068fcc1ef7 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -157,10 +157,33 @@ extern unsigned int inter_b_modes[B_MODE_COUNT];
 extern void (*vp8_short_fdct4x4)(short *input, short *output, int pitch);
 extern void (*vp8_short_fdct8x4)(short *input, short *output, int pitch);
 
-extern const int qrounding_factors[129];
-extern const int qzbin_factors[129];
 extern void vp8cx_init_quantizer(VP8_COMP *cpi);
-extern const int vp8cx_base_skip_false_prob[128];
+
+/*#if CONFIG_EXTEND_QRANGE
+int vp8cx_base_skip_false_prob[QINDEX_RANGE];
+#else
+int vp8cx_base_skip_false_prob[QINDEX_RANGE] =
+{
+    255, 255, 255, 255, 255, 255, 255, 255,
+    255, 255, 255, 255, 255, 255, 255, 255,
+    255, 255, 255, 255, 255, 255, 255, 255,
+    255, 255, 255, 255, 255, 255, 255, 255,
+    255, 255, 255, 255, 255, 255, 255, 255,
+    255, 255, 255, 255, 255, 255, 255, 255,
+    255, 255, 255, 255, 255, 255, 255, 255,
+    251, 248, 244, 240, 236, 232, 229, 225,
+    221, 217, 213, 208, 204, 199, 194, 190,
+    187, 183, 179, 175, 172, 168, 164, 160,
+    157, 153, 149, 145, 142, 138, 134, 130,
+    127, 124, 120, 117, 114, 110, 107, 104,
+    101, 98,  95,  92,  89,  86,  83, 80,
+    77,  74,  71,  68,  65,  62,  59, 56,
+    53,  50,  47,  44,  41,  38,  35, 32,
+    30,  28,  26,  24,  22,  20,  18, 16,
+
+};
+#endif*/
+int vp8cx_base_skip_false_prob[QINDEX_RANGE];
 
 // Tables relating active max Q to active min Q
 static int kf_low_motion_minq[QINDEX_RANGE];
@@ -243,6 +266,28 @@ void init_minq_luts()
     }
 }
 
+void init_base_skip_probs()
+{
+    int i;
+    double q;
+    int skip_prob;
+
+    for ( i = 0; i < QINDEX_RANGE; i++ )
+    {
+        q = vp8_convert_qindex_to_q(i);
+
+        // Exponential decay caluclation of baseline skip prob with clamping
+        // Based on crude best fit of old table.
+        skip_prob = (int)( 564.25 * pow( 2.71828, (-0.012*q) ) );
+        if ( skip_prob < 1 )
+            skip_prob = 1;
+        else if ( skip_prob > 255 )
+            skip_prob = 255;
+
+        vp8cx_base_skip_false_prob[i] = skip_prob;
+    }
+}
+
 void vp8_initialize()
 {
     static int init_done = 0;
@@ -258,6 +303,7 @@ void vp8_initialize()
 #endif
         vp8_init_me_luts();
         init_minq_luts();
+        init_base_skip_probs();
         init_done = 1;
     }
 }
@@ -1829,7 +1875,25 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
 }
 
 
-// Quant MOD
+// TODO perhaps change number of steps expose to outside world when setting
+// max and min limits. Also this will likely want refining for the extended Q
+// range.
+//
+// Table that converts 0-63 Q range values passed in outside to the Qindex
+// range used internally.
+/*#if CONFIG_EXTEND_QRANGE
+static const int q_trans[] =
+{
+     0,    4,   8,  12,  16,  20,  24,  28,
+    32,   36,  40,  44,  48,  52,  56,  60,
+    64,   68,  72,  76,  80,  84,  88,  92,
+    96,  100, 104, 108, 112, 116, 120, 124,
+    128, 132, 136, 140, 144, 148, 152, 156,
+    160, 164, 168, 172, 176, 180, 184, 188,
+    192, 196, 200, 204, 208, 212, 216, 220,
+    224, 228, 232, 236, 240, 244, 249, 255,
+};
+#else*/
 static const int q_trans[] =
 {
     0,   1,  2,  3,  4,  5,  7,  8,
@@ -1841,6 +1905,7 @@ static const int q_trans[] =
     82,  85, 88, 91, 94, 97, 100, 103,
     106, 109, 112, 115, 118, 121, 124, 127,
 };
+//#endif
 
 int vp8_reverse_trans(int x)
 {
@@ -4292,11 +4357,6 @@ static void encode_frame_to_data_rate
     {
         vp8_clear_system_state();  //__asm emms;
 
-        /*
-        if(cpi->is_src_frame_alt_ref)
-            Q = 127;
-            */
-
         vp8_set_quantizer(cpi, Q);
         this_q = Q;
 
@@ -4344,7 +4404,8 @@ static void encode_frame_to_data_rate
                         */
                 }
 
-                //as this is for cost estimate, let's make sure it does not go extreme eitehr way
+                // as this is for cost estimate, let's make sure it does not
+                // get extreme either way
                 if (cpi->prob_skip_false < 5)
                     cpi->prob_skip_false = 5;
 
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index e2c4db6b9e035c03d47102dd43c4fc1c3a46335c..f47a4640803797b3cbf000fd43d78e5490acc53e 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -599,7 +599,7 @@ typedef struct VP8_COMP
     unsigned int time_pick_lpf;
     unsigned int time_encode_mb_row;
 
-    int base_skip_false_prob[128];
+    int base_skip_false_prob[QINDEX_RANGE];
 
     struct twopass_rc
     {
diff --git a/vp8/encoder/picklpf.c b/vp8/encoder/picklpf.c
index 008461964b3abc420b0b7667732ce8dbfc11c748..e42da0c96a44170dd5426d499f1bd8cc0d8b9059 100644
--- a/vp8/encoder/picklpf.c
+++ b/vp8/encoder/picklpf.c
@@ -107,18 +107,21 @@ static int vp8_calc_partial_ssl_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONF
 static int get_min_filter_level(VP8_COMP *cpi, int base_qindex)
 {
     int min_filter_level;
+    /*int q = (int) vp8_convert_qindex_to_q(base_qindex);
 
     if (cpi->source_alt_ref_active && cpi->common.refresh_golden_frame && !cpi->common.refresh_alt_ref_frame)
         min_filter_level = 0;
     else
     {
-        if (base_qindex <= 6)
+        if (q <= 10)
             min_filter_level = 0;
-        else if (base_qindex <= 16)
+        else if (q <= 64)
             min_filter_level = 1;
         else
-            min_filter_level = (base_qindex / 8);
+            min_filter_level = (q >> 6);
     }
+    */
+    min_filter_level = 0;
 
     return min_filter_level;
 }
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index c3d4145df93bb2e4dbec713dad4ce9c4c4495bbb..10d6e3cdbc4f0c1e67596ea2a6fc4dc1f72cf83e 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -278,7 +278,7 @@ void vp8_initialize_rd_consts(VP8_COMP *cpi, int QIndex)
     // for key frames, golden frames and arf frames.
     // if (cpi->common.refresh_golden_frame ||
     //     cpi->common.refresh_alt_ref_frame)
-    QIndex=(QIndex<0)? 0 : ((QIndex>127)?127 : QIndex);
+    QIndex=(QIndex<0)? 0 : ((QIndex>MAXQ)?MAXQ : QIndex);
 
     cpi->RDMULT = compute_rd_mult(QIndex);