Add encoder/decoder support for var-refs

Check the availability of the reference frames at the frame level at
both encoder and decoder, and if a reference frame is not available
for a specific video frame, remove the signaling of such reference
frame info at the block level.

This patch adds the consideration of the bit saving inside the RD
optimization loop.

Change-Id: I4c22f1b843b21c7d2b47e118c99c3ad615a3d4e4
8 files changed