Enable film grain synthesis in film mode

Allow the film grain synthesis mode to turn on in the film content
mode. This only allows the bit-stream to turn on, but still not
use it on any frame.

STATS_CHANGED

Change-Id: Ie7eb5acaff8117472548221e2631f97366949c43
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 2bde02b..ad41af2 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -2505,7 +2505,6 @@
     const AV1_COMP *const cpi, struct aom_write_bit_buffer *wb) {
   const AV1_COMMON *const cm = &cpi->common;
   const aom_film_grain_t *const pars = &cm->cur_frame->film_grain_params;
-
   aom_wb_write_bit(wb, pars->apply_grain);
   if (!pars->apply_grain) return;
 
diff --git a/av1/encoder/encoder_utils.c b/av1/encoder/encoder_utils.c
index 302d424..a4c1dc0 100644
--- a/av1/encoder/encoder_utils.c
+++ b/av1/encoder/encoder_utils.c
@@ -9,6 +9,8 @@
  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
  */
 
+#include "aom/aomcx.h"
+
 #include "aom_ports/system_state.h"
 
 #include "av1/encoder/bitstream.h"
@@ -595,6 +597,13 @@
 
     aom_film_grain_table_read(cpi->film_grain_table,
                               tune_cfg->film_grain_table_filename, &cm->error);
+  } else if (tune_cfg->content == AOM_CONTENT_FILM) {
+    cm->seq_params.film_grain_params_present = 1;
+    cm->film_grain_params.bit_depth = cm->seq_params.bit_depth;
+    if (oxcf->tool_cfg.enable_monochrome)
+      reset_film_grain_chroma_params(&cm->film_grain_params);
+    if (cm->seq_params.color_range == AOM_CR_FULL_RANGE)
+      cm->film_grain_params.clip_to_restricted_range = 0;
   } else {
 #if CONFIG_DENOISE
     cm->seq_params.film_grain_params_present = (cpi->oxcf.noise_level > 0);