Optimize the code to set the refernce frame right after reading the header.

Change-Id: I495cf4a366e06e3220ed132500b1ba1c8448f708
Correct the code format.

Change-Id: If2de420f8123a4e8bf635dd29205dd74ee174eee
Add adaptation option for VBR.

Allow min and maxQ to creep when the undershoot
or overshoot exceeds thresholds controlled by the
command line under_shoot_pct and over_shoot_pct
values.

Default is 100%,100% which ~disables adaptation.

Derf results for example undershoot% / overshoot%:-

Head:- Mean abs (%rate error) = 14.4%

This check in:-
25%/25% - Mean abs (%rate error) = 6.7%
                  PSNR hit -1% SSIM -0.1%

5% / 5%  - Mean abs (%rate error) = 2.2%
                 PSNR hit -3.3% SSIM - 1.1%

Most of the remaining error and most of the quality hit is
at extreme data rates. The adaptation code still has an
exception for material that is in effect static so that we
don't over adjust and over spend on YT slide show type
content.

Change-Id: If25a2449a415449c150acff23df713e9598d64c9
Merge "Add adaptation option for VBR."
Merge "Correct the code format."
Merge "Optimize the code to set the refernce frame right after reading the header."