Quicktime H.264 Gamma Shift Compensation
Since many years post production people around the world fight against an inherent issue with gamma shifts in Quicktime files, either during encoding or decoding. Here is our way helping it.

While the main reason seemed that they wanted to support old operating system versions with 1.8 display gamma and new ones with 2.2 gamma, the result is mainly a big mess and confusion for users in the post production world.
While producing some trailers for “Cold Storage” some years ago we were faced with exact this issue as well and felt almost unable to deliver the results from grading to the web and players. As the movie plays in a dark bunker, we had lots of dark gray to black shades. Banding and clipping took place and the results were simply disappointing, far away from what we had seen in the grading suite.
While working closely with Rising Sun Research, the original developers of CineSpace, we were able to create a precompensation 3D LUT that allows to eliminate most issues.
It was created by sending a 1000 color patches image through the H.264 encoder and then analyzing the exported results seen in a Quicktime player. There was clearly the gamma shift and a difference between the color values. While analyzing the differences you can calculate a precompensation 3D lookup table (3D LUT) that modifies color values before they are send into the encoder in a way, so that they look correct when being returned from the encoder. Unfortunately this process causes some clipping, but for the first time we were able to predict colors of H.264 files created with Quicktime.
See here how the results with 3D LUT looks like, compared to the original file:
comparison-h264-745-versus-original
We found that legal colors (such as in REC709) survive this process pretty well. When you deal with full range colors, you will experience some significant clipping.
See here the very dark trailer footage in the comparison:
