Remove PVQ_CHROMA_RD codes

Which was a workaround to balance the quality between
luma and chroma when PVQ is enabled, by
1) skipping PVQ DC RDO for chroma and
2) using smaller lambda value (x0.5) for intra prediction of chroma,
intended to spend more bits and thus improve quality for chroma.

The change in metric for 5 frames of objective-1-fast is:
PSNR  PSNR-HVS  SSIM  CIEDE-2000  PSNR Cb PSNR Cr  MS-SSIM
-1.45 -1.54     -1.46 4.62        13.71   14.87     -1.47

For still images (subset1)
PSNR  PSNR-HVS  SSIM  CIEDE-2000  PSNR Cb PSNR Cr  MS-SSIM VMAF
-1.52 -1.54     -1.60 2.56        11.92   12.17     -1.52  -1.66

Change-Id: I31c4d7a7de2939f6004c112649f7303f0e944156
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 5f4e981..7de97d9 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -1155,9 +1155,6 @@
   int has_dc_skip = 1;
   int i;
   int off = od_qm_offset(tx_size, plane ? 1 : 0);
-#if PVQ_CHROMA_RD
-  double save_pvq_lambda;
-#endif
 
   DECLARE_ALIGNED(16, tran_low_t, coeff_pvq[OD_TXSIZE_MAX * OD_TXSIZE_MAX]);
   DECLARE_ALIGNED(16, tran_low_t, ref_coeff_pvq[OD_TXSIZE_MAX * OD_TXSIZE_MAX]);
@@ -1198,12 +1195,6 @@
     in_int32[i] = coeff_pvq[i] << (OD_COEFF_SHIFT - coeff_shift);
   }
 
-#if PVQ_CHROMA_RD
-  if (plane != 0) {
-    save_pvq_lambda = daala_enc->pvq_norm_lambda;
-    daala_enc->pvq_norm_lambda *= 0.8;
-  }
-#endif
   if (abs(in_int32[0] - ref_int32[0]) < pvq_dc_quant * 141 / 256) { /* 0.55 */
     out_int32[0] = 0;
   } else {
@@ -1260,9 +1251,7 @@
 #error "CONFIG_PVQ currently requires CONFIG_DAALA_EC."
 #endif
   assert(*rate >= 0);
-#if PVQ_CHROMA_RD
-  if (plane != 0) daala_enc->pvq_norm_lambda = save_pvq_lambda;
-#endif
+
   return ac_dc_coded;
 }
 
diff --git a/av1/encoder/pvq_encoder.c b/av1/encoder/pvq_encoder.c
index e4b9feb..7ba5762 100644
--- a/av1/encoder/pvq_encoder.c
+++ b/av1/encoder/pvq_encoder.c
@@ -892,11 +892,7 @@
     n = OD_DIV_R0(abs(in[0] - ref[0]), dc_quant);
     if (n == 0) {
       out[0] = 0;
-#if PVQ_CHROMA_RD
-    } else if (pli == 0) {
-#else
     } else {
-#endif
       int tell2;
       od_rollback_buffer dc_buf;
 
@@ -1010,11 +1006,7 @@
       n = OD_DIV_R0(abs(in[0] - ref[0]), dc_quant);
       if (n == 0) {
         out[0] = 0;
-#if PVQ_CHROMA_RD
-      } else if (pli == 0) {
-#else
       } else {
-#endif
         int tell2;
         od_rollback_buffer dc_buf;
 
diff --git a/av1/encoder/pvq_encoder.h b/av1/encoder/pvq_encoder.h
index f826667..9023102 100644
--- a/av1/encoder/pvq_encoder.h
+++ b/av1/encoder/pvq_encoder.h
@@ -19,8 +19,6 @@
 # include "av1/common/pvq.h"
 # include "av1/encoder/encint.h"
 
-#define PVQ_CHROMA_RD 1
-
 void aom_encode_band_pvq_splits(aom_writer *w, od_pvq_codeword_ctx *adapt,
  const int *y, int n, int k, int level);
 
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 1320568..8717c0c 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -4768,20 +4768,9 @@
 #endif  // CONFIG_PALETTE
 
 #if CONFIG_PVQ
-    // For chroma channels, multiply lambda by 0.5 when doing intra prediction
-    // NOTE: Chroma intra prediction itself has a separate RDO,
-    // though final chroma intra mode's D and R is simply added to
-    // those of luma then global RDO is performed to decide the modes of SB.
-    // Also, for chroma, the RDO cannot decide tx_size (follow luma's decision)
-    // or tx_type (DCT only), then only the intra prediction is
-    // chroma's own mode decision based on separate RDO.
-    // TODO(yushin) : Seek for more reasonable solution than this.
-    this_rd = RDCOST(x->rdmult >> (1 * PVQ_CHROMA_RD), x->rddiv, this_rate,
-                     tokenonly_rd_stats.dist);
     od_encode_rollback(&x->daala_enc, &buf);
-#else
-    this_rd = RDCOST(x->rdmult, x->rddiv, this_rate, tokenonly_rd_stats.dist);
 #endif
+    this_rd = RDCOST(x->rdmult, x->rddiv, this_rate, tokenonly_rd_stats.dist);
 
     if (this_rd < best_rd) {
       best_mbmi = *mbmi;