lut_inverse_interp16: better handle degenerate 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), but the inverse curve is
not well-defined in those regions. Return 0 or 1 for the inverse in
those regions. Also ensure the binary search parameters are bounded
to a valid search range.


Review URL:

Cr-Commit-Position: refs/heads/master@{#321930}
2 files changed