]> granicus.if.org Git - libvpx/commitdiff
Small speed up for super_block_uvrd
authorhui su <huisu@google.com>
Thu, 17 Mar 2016 18:20:59 +0000 (11:20 -0700)
committerhui su <huisu@google.com>
Fri, 18 Mar 2016 16:28:10 +0000 (09:28 -0700)
Eearly termination if U plane RD cost is large enough.

No notable compression performance changes.

Change-Id: Ieeefc5859cb55d94391b502b4bd840bc8bcb2578

vp10/encoder/rdopt.c

index 6543b339f9e6f2f0d89b7f3145132b46273d3267..63163d76cdb58df9240821e300c2da024beedd12 100644 (file)
@@ -3496,6 +3496,11 @@ static int super_block_uvrd(const VP10_COMP *cpi, MACROBLOCK *x,
     *distortion += pndist;
     *sse += pnsse;
     *skippable &= pnskip;
+    if (RDCOST(x->rdmult, x->rddiv, *rate, *distortion) > ref_best_rd &&
+        RDCOST(x->rdmult, x->rddiv, 0, *sse) > ref_best_rd) {
+      is_cost_valid = 0;
+      break;
+    }
   }
 
   if (!is_cost_valid) {
@@ -9424,6 +9429,8 @@ void vp10_rd_pick_inter_mode_sub8x8(struct VP10_COMP *cpi,
         distortion2 += distortion_uv;
         skippable = skippable && uv_skippable;
         total_sse += uv_sse;
+      } else {
+        continue;
       }
     }