sei: fix byte alignment following HRD SEI
hrd: add a comment about when an APS is required, update SEI
rc: fix crash in 2 pass for faster preset (ultrafast - faster)
quant: move enums for scan order to TComRom together with the tables
quant: use ScanType enum as type for scanType, other cleanups
scaling: replace pow(2.0, -2.0 * transformShift) with shift adjustment

Result is the same
defs: remove FULL_NBIT, no change to logic
scaling: further simplify scaling list calculation

It does more operations with ints, but mainly I just find this more readable
defs: cleanup CommonDef.h and TypeDef.h again

TypeDef.h only defines enums, CommonDef.h only defines constants (grouped
together logically).  Remove doxygenness
typedef: remove redundant ChromaFormat enums
move quant defines from TComRom.h to CommonDef.h; they are not table sizes
scaling: cleanup
scaling: factor prec into scalingBits

This makes errScale clearly function to remove quantCoeff^2, and add this
cost scale factor (which is just a bit shift).  By factoring it this way, we
can probably remove the need for doubles in the near future by not using the
scaled coefficients in the stupid first place.
quant: improve documentation and code clarity, no logic change
quant: inline getRateSigCoef(), getRateSigCoeffGroup() and getICost()
quant: hoist lambda multiplication out of getICRateCost()
quant: getICRate() and getICRateCost() do not need to be class methods
TEncSearch: fix output non-determination bug

When temporal candidates end up as MVP candidates, they can reach beyond the
available region of valid pixels in the reference picture. In that case, we
should not try to measure distortion there, it only introduces non-determinism.
Just take the other MVP without contest. If both MVP were out of range, we
default to mvpIdx = 0.

Note that there was never any risk of a decode error since when ME runs it
clamps all motion vectors to the range of available pixels.  The setting of
this mvmin/mvmax range is assigned just after picking the best of the two MVP
candidates.
quant: don't bother with extra temp variables
quant: return signal cost from getRateLast(), do not include lambda