From 221e00eaa909a8d923908f25542b013510bdb18c Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Thu, 19 May 2011 23:12:40 -0700 Subject: adjust sad per bit constants While investigating the effect of DC values on SAD and SSE in motion estimation, a side finding indicates the two table of constants need be adjusted. The adjustment was done by multiplying old constants by 90% with rounding. Also absorb the 1/2 scaling constant into the two tables. Refer to change Ifa285c3e for background of the 1/2 factor. Cif set test showed a very small gain on all metric. Change-Id: I04333527a823371175dd46cb04a817e5b9a8b752 --- vp8/encoder/rdopt.c | 65 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) (limited to 'vp8/encoder') diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index d4d6cd7c7..124de478c 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -155,51 +155,50 @@ static int rd_iifactor [ 32 ] = { 4, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - /* values are now correlated to quantizer */ static int sad_per_bit16lut[QINDEX_RANGE] = { + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, - 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 9, 9, - 9, 9, 9, 9, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 11, - 12, 12, 12, 12, 12, 12, 12, 13, - 13, 13, 13, 13, 13, 14, 14, 14, - 14, 14, 15, 15, 15, 15, 15, 15, - 16, 16, 16, 16, 16, 16, 17, 17, - 17, 17, 17, 17, 17, 18, 18, 18, - 18, 18, 19, 19, 19, 19, 19, 19, - 20, 20, 20, 21, 21, 21, 21, 22, - 22, 22, 23, 23, 23, 24, 24, 24, - 25, 25, 26, 26, 27, 27, 27, 28, - 28, 28, 29, 29, 30, 30, 31, 31 + 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 10, 10, + 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, + 12, 12, 13, 13, 13, 13, 14, 14 }; static int sad_per_bit4lut[QINDEX_RANGE] = { - 5, 5, 5, 5, 5, 5, 7, 7, + 2, 2, 2, 2, 2, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 5, 5, + 5, 5, 5, 5, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 11, 11, - 11, 11, 11, 11, 13, 13, 13, 13, - 13, 13, 14, 14, 14, 14, 14, 14, - 16, 16, 16, 16, 16, 16, 16, 17, - 17, 17, 17, 17, 17, 19, 19, 19, - 19, 19, 20, 20, 20, 20, 20, 20, - 22, 22, 22, 22, 22, 22, 23, 23, - 23, 23, 23, 23, 23, 25, 25, 25, - 25, 25, 26, 26, 26, 26, 26, 26, - 28, 28, 28, 29, 29, 29, 29, 31, - 31, 31, 32, 32, 32, 34, 34, 34, - 35, 35, 37, 37, 38, 38, 38, 40, - 40, 40, 41, 41, 43, 43, 44, 44, + 8, 8, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 11, 11, 11, + 12, 12, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 14, + 14, 14, 14, 14, 15, 15, 15, 15, + 16, 16, 16, 16, 17, 17, 17, 18, + 18, 18, 19, 19, 19, 20, 20, 20, }; void vp8cx_initialize_me_consts(VP8_COMP *cpi, int QIndex) { - cpi->mb.sadperbit16 = sad_per_bit16lut[QIndex]/2; - cpi->mb.sadperbit4 = sad_per_bit4lut[QIndex]/2; + cpi->mb.sadperbit16 = sad_per_bit16lut[QIndex]; + cpi->mb.sadperbit4 = sad_per_bit4lut[QIndex]; } void vp8_initialize_rd_consts(VP8_COMP *cpi, int Qvalue) -- cgit v1.2.3