]> granicus.if.org Git - libvpx/commitdiff
Add comment for use of shift/mul instead of div.
authorRonald S. Bultje <rbultje@google.com>
Tue, 24 Jul 2012 22:46:49 +0000 (15:46 -0700)
committerRonald S. Bultje <rbultje@google.com>
Tue, 24 Jul 2012 22:46:49 +0000 (15:46 -0700)
Change-Id: Ia6a0090da2097ca9337f8179a6d7b6a09e12f2e6

vp8/common/quant_common.c

index a0b212cc40f7a900b92a937bf744095e79f941d8..05f921070288348b4224657d76a25f48bf5a64f8 100644 (file)
@@ -109,6 +109,9 @@ int vp8_ac2quant(int QIndex, int Delta)
     else if (QIndex < 0)
         QIndex = 0;
 
+    /* For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16.
+     * The smallest precision for that is '(x*6349) >> 12' but 16 is a good
+     * word size. */
     retval = (ac_qlookup[ QIndex ] * 101581) >> 16;
 
     if (retval < 8)