[CFL] Custom block-level DC_PRED

Adds the CfL experiment flag and computes a block-level DC_PRED that is
required by CfL in order to compute alpha_cb and alpha_cr.

The rate-distorsion impact of computing DC_PRED at the prediction block level
for chroma planes is rather small

Subset 1:
master_no_cdef@2017-04-18T20:37:05.712Z
  -> block_DCPRED_no_cdef@2017-04-18T20:38:07.381
  PSNR | PSNR Cb | PSNR Cr | PSNR HVS |   SSIM | MS SSIM | CIEDE 2000
0.0712 |  0.0337 | -0.1692 |   0.0693 | 0.0814 |  0.0710 |    -0.0063
Note: CDEF was disabled because of problematic asserts.

Change-Id: I44d1cde8605b108366f4bd4cedbf5159dbbb5880
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 1017f2e..b9f0a9e 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -5017,6 +5017,10 @@
   td->mb.e_mbd.tile_ctx = &this_tile->tctx;
 #endif  // #if CONFIG_EC_ADAPT
 
+#if CONFIG_CFL
+  td->mb.e_mbd.cfl = &this_tile->cfl;
+#endif
+
 #if CONFIG_PVQ
   td->mb.daala_enc.state.adapt = &this_tile->tctx.pvq_context;
 #endif  // CONFIG_PVQ
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 2739adb..b97a83f 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -104,6 +104,10 @@
 FILE *keyfile;
 #endif
 
+#if CONFIG_CFL
+CFL_CTX NULL_CFL;
+#endif
+
 #if CONFIG_INTERNAL_STATS
 typedef enum { Y, U, V, ALL } STAT_TYPE;
 #endif  // CONFIG_INTERNAL_STATS
@@ -932,6 +936,9 @@
 #if CONFIG_PVQ
                        NULL,
 #endif
+#if CONFIG_CFL
+                       &NULL_CFL,
+#endif
                        NULL);
   memset(cpi->mbmi_ext_base, 0,
          cm->mi_rows * cm->mi_cols * sizeof(*cpi->mbmi_ext_base));
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 1a58149..eceecdd 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -286,6 +286,9 @@
 #if CONFIG_PVQ
   PVQ_QUEUE pvq_q;
 #endif
+#if CONFIG_CFL
+  CFL_CTX cfl;
+#endif
 #if CONFIG_EC_ADAPT
   DECLARE_ALIGNED(16, FRAME_CONTEXT, tctx);
 #endif