Optimize transform block rate-distortion search

The soft coefficient optimization process would monotonically
increase the transform block distortion and decrease the
coefficient rate cost. Such observation provides a lower bound
on the rate-distortion cost for the given transform block. This
commit compares this lower bound against the best available
rate-distortion cost value and skips unnecessary optimization
process. It speeds up the baseline encoding process by 15%.

Change-Id: Ida8098a2820cef60d59ec1e72f0bbb1acbd98165
diff --git a/av1/encoder/rd.h b/av1/encoder/rd.h
index c4916b5..ea5115b 100644
--- a/av1/encoder/rd.h
+++ b/av1/encoder/rd.h
@@ -457,6 +457,8 @@
   rd_stats->rdcost = 0;
   rd_stats->sse = 0;
   rd_stats->skip = 1;
+  rd_stats->zero_rate = 0;
+  rd_stats->ref_rdcost = INT64_MAX;
 #if CONFIG_DIST_8X8 && CONFIG_CB4X4
   rd_stats->dist_y = 0;
 #endif
@@ -484,6 +486,8 @@
   rd_stats->rdcost = INT64_MAX;
   rd_stats->sse = INT64_MAX;
   rd_stats->skip = 0;
+  rd_stats->zero_rate = 0;
+  rd_stats->ref_rdcost = INT64_MAX;
 #if CONFIG_DIST_8X8 && CONFIG_CB4X4
   rd_stats->dist_y = INT64_MAX;
 #endif