static threshold fix for realtime
authorJim Bankoski <jimbankoski@google.com>
Mon, 20 Aug 2012 19:58:31 +0000 (12:58 -0700)
committerJim Bankoski <jimbankoski@google.com>
Mon, 20 Aug 2012 19:58:31 +0000 (12:58 -0700)
This code allows us to skip encoding if the sse
is less than the error we could possibly encode.

Change-Id: Iefb590dc0ee30b660495218398c7969f7d5fd19f

vp8/encoder/pickinter.c

index c9d63c64ed060ac5a89f855c1d30e375515fc41c..b67f04b8590a8b3ec2535a12546d9dc1104eaa94 100644 (file)
@@ -458,7 +458,15 @@ void get_lower_res_motion_info(VP8_COMP *cpi, MACROBLOCKD *xd, int *dissim,
 
 static void check_for_encode_breakout(unsigned int sse, MACROBLOCK* x)
 {
-    if (sse < x->encode_breakout)
+    MACROBLOCKD *xd = &x->e_mbd;
+
+    unsigned int threshold = (xd->block[0].dequant[1]
+        * xd->block[0].dequant[1] >>4);
+
+    if(threshold < x->encode_breakout)
+        threshold = x->encode_breakout;
+
+    if (sse < threshold )
     {
         /* Check u and v to make sure skip is ok */
         unsigned int sse2 = 0;