[NORMATIVE] Film grain gauss values and update_parameters

BUG=aomedia:1474
BUG=aomedia:1347

Change-Id: I6ccd2562101906aeae521afbfb5e6aae6dac70b8
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index d53e3d0..b8bbecd 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -2155,15 +2155,10 @@
   }
 
   pars->random_seed = aom_rb_read_literal(rb, 16);
-
-  pars->update_parameters = aom_rb_read_bit(rb);
-
-  if (!pars->update_parameters && cm->frame_type != INTER_FRAME) {
-    aom_internal_error(
-        &cm->error, AOM_CODEC_UNSUP_BITSTREAM,
-        "Film grain parameters prediction is only allowed in inter-frames");
-    return;
-  }
+  if (cm->frame_type == INTER_FRAME)
+    pars->update_parameters = aom_rb_read_bit(rb);
+  else
+    pars->update_parameters = 1;
 
 #if CONFIG_FILM_GRAIN_SHOWEX
   if (!pars->update_parameters) {
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 95f1751..5265287 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -2717,8 +2717,10 @@
   pars->random_seed += 3245;  // For film grain test vectors purposes
   if (!pars->random_seed)     // Random seed should not be zero
     pars->random_seed += 1735;
-
-  aom_wb_write_bit(wb, pars->update_parameters);
+  if (cm->frame_type == INTER_FRAME)
+    aom_wb_write_bit(wb, pars->update_parameters);
+  else
+    pars->update_parameters = 1;
 #if CONFIG_FILM_GRAIN_SHOWEX
   if (!pars->update_parameters) {
     RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
@@ -3354,7 +3356,7 @@
   if (cm->film_grain_params_present && cm->show_frame) {
 #endif
     int flip_back_update_parameters_flag = 0;
-    if (cm->frame_type == KEY_FRAME &&
+    if (cm->frame_type != INTER_FRAME &&
         cm->film_grain_params.update_parameters == 0) {
       cm->film_grain_params.update_parameters = 1;
       flip_back_update_parameters_flag = 1;