Properly decide whether to enable optimize_b

BUG=aomedia:1610

Change-Id: I38f7d39cb8658ee110ac8380394219c6cc3b8e45
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 51403f8..de25a21 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -1984,7 +1984,7 @@
     const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type);
     RD_STATS this_rd_stats;
     av1_invalid_rd_stats(&this_rd_stats);
-    if (cpi->sf.optimize_coefficients != FULL_TRELLIS_OPT) {
+    if (!cpi->optimize_seg_arr[mbmi->segment_id]) {
       av1_xform_quant(
           cm, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
           USE_B_QUANT_NO_TRELLIS ? AV1_XFORM_QUANT_B : AV1_XFORM_QUANT_FP);