entropy: simplify sign hide flag
quant: improve variable names and comments (no behavior change)
quant: avoid an extra shift by adjusting the unquant coeff shift
quant: reduce conditional expression depths (mostly for readability)
quant: do not check CG bitmap for implied-present coeff groups
quant: use standard rd cost formula for sign-hiding [CHANGES OUTPUTS]

The previous RD formula was simply inexplicable, though it did work fairly well.

Old approach:
deltaU[blkPos] = (scaledCoeff[blkPos] - ((int)level << qbits)) >> (qbits - 8);
int64_t invQuant = ScalingList::s_invQuantScales[rem] << per;
int64_t rdFactor = (int64_t)((invQuant * invQuant) / (lambda2 * 16) + 0.5);
costUp = rdFactor * (-deltaU[blkPos]) + rateIncUp[blkPos];
 - wat? -

New approach:
int d = abs(signCoef) - UNQUANT(absLevel + 1);
costUp = (((uint64_t)(d * d)) << scaleBits) + lambda2 * rateIncUp[blkPos];

Using this approach the results are nearly the same (they appear to be slightly
better) but now we can probably add psycho-visual tunings to the sign hiding
feature
quant: header cleanups, no functional change
quant: cleanup chroma QP function

With a unique function name, protected access, and only called from one
location, the ttype check could be removed.
quant: remove floating point operations from RDOQ [CHANGES OUTPUTS]

The output changes are minor. On modern CPUs the performance benefit of this
change is negligable since SSE double operations are similar in performance to
int64 operations. As a future optimization, we need to figure out how to
multiply lambda2 (FIX8 24bits) by signal cost (FIX15 24bits) using 32-bit
integers since 32bit multiply is significantly cheaper than 64bit integer
multiply.

Similarly, unquantAbsLevel can be larger than 16bits so multiplation is done
with int64. Note that we use signed int64 because with psy-rdoq the costs
could go negative.

--HG--
extra : amend_source : c56c6760412e391c824fda7f50be55405539e959
quant: comment improvements

--HG--
extra : amend_source : 5e98cbc7ace3adb52ec06106dc583b46852ee46c
quant: improve flow and comments for last non-zero refinement

--HG--
extra : amend_source : 0b00522d13970c36d0d8417e89d1d28dd7762ff7