rtc: Include segment q for variance thresholds

For variance based partitioning: the variance
thresholds are based on the qp for that superblock.
If the superblock has non-zero segment, use the
segment qp for setting the variance thresholds.

bdrate gains for nonrd_pick_mode (speed >= 7),
On rtc set:
speed 7: ~1.7% avg, several clips over 2%, max 7%.
speed 8: ~0.7% avg, max 6%.

Change-Id: I90468a84eb9a8bf27d72d387a7513ca4ff830e87
diff --git a/av1/encoder/var_based_part.c b/av1/encoder/var_based_part.c
index 4f1bd9c..712ce1c 100644
--- a/av1/encoder/var_based_part.c
+++ b/av1/encoder/var_based_part.c
@@ -646,7 +646,14 @@
 
   segment_id = xd->mi[0]->segment_id;
 
-  set_vbp_thresholds(cpi, thresholds, cm->base_qindex, content_state);
+  if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled &&
+      cyclic_refresh_segment_id_boosted(segment_id) &&
+      cpi->sf.use_nonrd_pick_mode) {
+    int q = av1_get_qindex(&cm->seg, segment_id, cm->base_qindex);
+    set_vbp_thresholds(cpi, thresholds, q, content_state);
+  } else {
+    set_vbp_thresholds(cpi, thresholds, cm->base_qindex, content_state);
+  }
 
   if (is_small_sb) {
     pixels_wide = 64;