Allintra: turn off cdef for allintra mode

CDEF tends to blur images.
For the concern of perceptual quality, we disable it for allintra mode.

If omitted, when all intra mode is used, cdef is turned off.
If users set --enable-cdef=1 from the command line, cdef is turned on
regardless of all intra mode.

Change-Id: I8dad9b771746b974a1049beed43123f5d91f2783
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 2109f54..27091e2 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -2396,6 +2396,14 @@
     ctx->config.enc = &priv->cfg;
 
     priv->extra_cfg = default_extra_cfg;
+    // Special handling:
+    // By default, if omitted, --enable-cdef = 1.
+    // Here we set its default value to 0 when --allintra is turned on.
+    // However, if users set --enable-cdef = 1 from command line,
+    // The encoder still respects it.
+    if (priv->cfg.g_usage == ALLINTRA) {
+      priv->extra_cfg.enable_cdef = 0;
+    }
     aom_once(av1_initialize_enc);
 
     res = validate_config(priv, &priv->cfg, &priv->extra_cfg);