diff options
Diffstat (limited to 'vp8/encoder/rdopt.c')
-rw-r--r-- | vp8/encoder/rdopt.c | 59 |
1 files changed, 17 insertions, 42 deletions
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 652c6ec8c..d4458b9bf 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -160,47 +160,8 @@ static int rd_iifactor [ 32 ] = { 4, 4, 3, 2, 1, 0, 0, 0, }; // 3* dc_qlookup[Q]*dc_qlookup[Q]; -#if !CONFIG_EXTEND_QRANGE -static int rdmult_lut[QINDEX_RANGE]= -{ - 48,75,108,147,192,243,300,300, - 363,432,507,588,675,768,867,867, - 972,1083,1200,1200,1323,1323,1452,1452, - 1587,1587,1728,1875,1875,2028,2187,2352, - 2523,2700,2883,3072,3267,3468,3675,3888, - 4107,4107,4332,4563,4800,5043,5292,5547, - 5808,6075,6348,6348,6627,6912,7203,7500, - 7803,8112,8427,8748,9075,9408,9747,10092, - 10443,10800,11163,11532,11907,12288,12675,13068, - 13467,13872,14283,14700,15123,15552,15987,16428, - 16875,17328,17328,17787,18252,18723,19200,19683, - 20172,20667,21168,21675,22188,22707,23232,23763, - 24843,25947,27075,27648,28812,30000,30603,31212, - 32448,33708,34992,36300,37632,38988,40368,41772, - 44652,46128,47628,49152,50700,52272,53868,55488, - 57132,58800,61347,63075,65712,68403,71148,73947, -}; -#else -static int rdmult_lut[QINDEX_RANGE]= -{ - 3,5,7,9,12,15,19,23, - 27,32,37,42,48,54,61,68, - 75,83,91,99,108,117,127,137, - 147,169,192,217,243,271,300,331, - 363,397,450,507,567,631,698,768, - 842,919,999,1083,1170,1261,1355,1452, - 1587,1728,1875,2028,2187,2352,2523,2700, - 2883,3072,3267,3468,3675,3888,4107,4332, - 4563,4800,5043,5292,5547,5808,6075,6348, - 6627,6912,7203,7500,7880,8269,8667,9075, - 9492,9919,10355,10800,11255,11719,12192,12675, - 13167,13669,14180,14700,15230,15769,16317,16875, - 18019,19200,20419,21675,22969,24300,25669,27075, - 28519,30000,31519,33075,34669,36300,37969,39675, - 41772,43923,46128,48387,50700,53067,55488,57963, - 61347,64827,69312,73947,78732,83667,89787,97200, -}; -#endif +static int rdmult_lut[QINDEX_RANGE]; + /* values are now correlated to quantizer */ static int sad_per_bit16lut[QINDEX_RANGE]; static int sad_per_bit4lut[QINDEX_RANGE]; @@ -220,6 +181,19 @@ void vp8_init_me_luts() } } +int compute_rd_mult( int qindex ) +{ + int q; + + q = vp8_dc_quant(qindex,0); +#if CONFIG_EXTEND_QRANGE + return (3 * q * q) >> 4; +#else + return (3 * q * q); +#endif + +} + void vp8cx_initialize_me_consts(VP8_COMP *cpi, int QIndex) { cpi->mb.sadperbit16 = sad_per_bit16lut[QIndex]; @@ -239,7 +213,8 @@ void vp8_initialize_rd_consts(VP8_COMP *cpi, int QIndex) // if (cpi->common.refresh_golden_frame || // cpi->common.refresh_alt_ref_frame) QIndex=(QIndex<0)? 0 : ((QIndex>127)?127 : QIndex); - cpi->RDMULT = rdmult_lut[QIndex]; + + cpi->RDMULT = compute_rd_mult(QIndex); // Extend rate multiplier along side quantizer zbin increases if (cpi->zbin_over_quant > 0) |