lut_inverse_interp16: interpolate degenerate zeros in TRC curves
Degenerate TRC have runs of 0's / 1's from the left / right edge of
the TRC curve (a curve we want to invert, to be able to use a color
profile as a monitor profile). The inverse TRC of degenerate curves
is not well-defined in the run of 0's area (infinite slope).
Some monitor calibration software in the field produce 0 runs, thus
degenerate TRC, and QCMS setting the inverse of the run to 0's area
to 0 causes a color cast (burn) effect on web images corrected with
the associated color profile: issue 492379.
Fix that by interpolating the (imaginary) inverse in the 0 run area
instead of clamping the inverse to 0. Add more assert conditions to
the curve inversion algorithm and also check for an inverted binary
search range (these two changes from the related Mozilla bug).
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel,mac_blink_rel,win_blink_rel
BUG=458024
Review URL: https://codereview.chromium.org/
1185163003
Cr-Commit-Position: refs/heads/master@{#334996}