Add option to skip applying denoising with denoise-noise-level

Adds --enable-dnl-denoising. This option only takes effect when
--denoise-noise-level > 0. When --enable-dnl-denoising is 1 (default),
the encoder denoises the frame for noise modeling and encodes the
denoise frame with film grain synthesis. When 0, the encoder denoises
the frame for noise modeling, but encodes the original (noisy) frame
with film grain synthesis.

BUG=aomedia:2817

Co-authored-by: Zak <zakdjeb@gmail.com>

Change-Id: I85a62fec6759ee70b23f5a24999a7eb6582d8b90
diff --git a/aom_dsp/noise_model.c b/aom_dsp/noise_model.c
index 1ad3a66..f56fdd5 100644
--- a/aom_dsp/noise_model.c
+++ b/aom_dsp/noise_model.c
@@ -1591,7 +1591,7 @@
 
 int aom_denoise_and_model_run(struct aom_denoise_and_model_t *ctx,
                               YV12_BUFFER_CONFIG *sd,
-                              aom_film_grain_t *film_grain) {
+                              aom_film_grain_t *film_grain, int apply_denoise) {
   const int block_size = ctx->block_size;
   const int use_highbd = (sd->flags & YV12_FLAG_HIGHBITDEPTH) != 0;
   uint8_t *raw_data[3] = {
@@ -1643,12 +1643,14 @@
     if (!film_grain->random_seed) {
       film_grain->random_seed = 7391;
     }
-    memcpy(raw_data[0], ctx->denoised[0],
-           (strides[0] * sd->y_height) << use_highbd);
-    memcpy(raw_data[1], ctx->denoised[1],
-           (strides[1] * sd->uv_height) << use_highbd);
-    memcpy(raw_data[2], ctx->denoised[2],
-           (strides[2] * sd->uv_height) << use_highbd);
+    if (apply_denoise) {
+      memcpy(raw_data[0], ctx->denoised[0],
+             (strides[0] * sd->y_height) << use_highbd);
+      memcpy(raw_data[1], ctx->denoised[1],
+             (strides[1] * sd->uv_height) << use_highbd);
+      memcpy(raw_data[2], ctx->denoised[2],
+             (strides[2] * sd->uv_height) << use_highbd);
+    }
   }
   return 1;
 }