Change to KF boost calculation.
Change to KF boost calculation.

This  change is a step in a larger change to the way boost and interval are
determined for ARF and Key frames.

This patch contains some pluming for the general case but focuses on the
key frame boost calculation. This now relies more heavily on the rate at
which the error score increases between the primary and secondary reference
frame. This seems to be less fragile when dealing with different frame sizes.
For example larger image formats tend in the first pass to see a higher
% of intra coded blocks and the use of this number in calculating the frame
decay factor was leading to much lower boost numbers for 4K, for example,
than the same clip coded at 2K.

This change does give overall gains but they are MUCH larger for the 4K Netflix
set. For the 4K Netflix set the average gain is around 3% with some clips > 20%
whereas for the same set at 2K the average gain is 0.5-1%.

In general for small image formats the boost is most often reduced a little whereas
4K clips the boost is increased. There are some -ve cases such as Akiyo at 352x288
where the reduced boost hurts the metrics, especially for SSIM, even while
the set as a whole improves. This is most notable at very low Q and may be the
subject of a future patch.

Some common code for KF and ARF was separated in this patch for the purposes of
tuning but may later be re-merged if appropriate.

Change-Id: Iaa15ac5a58d2be89181100d95cef6a8dc4b12d0d

ShiftMediaProject/libvpx,mwgoldsmith/libvpx,webmproject/libvpx,webmproject/libvpx,mwgoldsmith/vpx,ShiftMediaProject/libvpx,Topopiccione/libvpx,Topopiccione/libvpx,mwgoldsmith/vpx,mwgoldsmith/vpx,ShiftMediaProject/libvpx,mwgoldsmith/libvpx,mwgoldsmith/vpx,mwgoldsmith/vpx,mwgoldsmith/libvpx,Topopiccione/libvpx,ShiftMediaProject/libvpx,mwgoldsmith/vpx,mwgoldsmith/libvpx,webmproject/libvpx,Topopiccione/libvpx,webmproject/libvpx,mwgoldsmith/libvpx,webmproject/libvpx,mwgoldsmith/libvpx,Topopiccione/libvpx,webmproject/libvpx,Topopiccione/libvpx,ShiftMediaProject/libvpx