Add QPRD support as subme=10
Refactor trellis lambda selection to be done in analyse_init instead of in trellis.
This will allow for more easy adaption of lambda later on; for now it allows constant lambda across variable QPs.
QPRD is only available with adaptive quantization enabled and generally improves SSIM and visual quality.
Additionally, weight the SSD values from RD based on the relative QP offset for chroma; helps visually at high QPs where chroma has a lower QP than luma.
This fixes some visual artifacts created by QPRD at high QPs.
Note that this generally hurts PSNR and SSIM, and so is only on when psy-RD is on.
/* Rate-distortion optimal QP selection.
* FIXME: More than half of the benefit of this function seems to be
* in the way it improves the coding of chroma DC (by decimating or
* finding a better way to code a single DC coefficient.)
* There must be a more efficient way to get that portion of the benefit
* without doing full QP-RD, but RD-decimation doesn't seem to do the
* trick. */