looks like I've found a way to encode the 12-bit raw data from the CMV sensor to 8-bit, in a nearly lossless way: https://dl.dropboxusercontent.com/u/4124919/bleeding-edge/apertus/hdmi-raw/optimal_curve.html