Make error-resilient behavior explicit

This commit explicitly set valid_for_referencing to 1 for missing
reference buffers in inter decoding in error resilient mode when
Decoder has already allocated new buffers and filled them with
neutral grey.

The commit also added comment to explain such behavior is not
normative, fixed a TODO as well..

BUG=aomedia:2420

Change-Id: I7c31738b644570f958352097cf2649ce122aa678
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index dca1a13..4f79d72 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -4933,8 +4933,6 @@
           }
           // If no corresponding buffer exists, allocate a new buffer with all
           // pixels set to neutral grey.
-          // TODO(https://crbug.com/aomedia/2420): The spec seems to say we
-          // just need to set pbi->valid_for_referencing[ref_idx] to 0.
           int buf_idx = get_free_fb(cm);
           if (buf_idx == INVALID_IDX) {
             aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
@@ -4954,8 +4952,23 @@
                                "Failed to allocate frame buffer");
           }
           unlock_buffer_pool(pool);
-          set_planes_to_neutral_grey(seq_params, &buf->buf, 0);
+          // According to the specification, valid bitstreams are required to
+          // never use missing reference frames so the filling process for
+          // missing frames is not normatively defined and RefValid for missing
+          // frames is set to 0.
 
+          // To make libaom more robust when the bitstream has been corrupted
+          // by the loss of some frames of data, this code adds a neutral grey
+          // buffer in place of missing frames, i.e.
+          //
+          set_planes_to_neutral_grey(seq_params, &buf->buf, 0);
+          //
+          // and allows the frames to be used for referencing, i.e.
+          //
+          pbi->valid_for_referencing[ref_idx] = 1;
+          //
+          // Please note such behavior is not normative and other decoders may
+          // use a different approach.
           cm->ref_frame_map[ref_idx] = buf;
           buf->order_hint = order_hint;
         }