]> git.sesse.net Git - movit/commit
Implement GammaCompressionEffect using ALU ops instead of texture lookups.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 9 Jan 2014 23:51:52 +0000 (00:51 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 9 Jan 2014 23:51:52 +0000 (00:51 +0100)
commit9ab1efe8dbd389f309a8a3e7f68c48f114a2b901
treed22bf5b5fc91be408e788dc9ae125f5c56812cce
parent93377952636717f15fd50961f6d3500861596cdc
Implement GammaCompressionEffect using ALU ops instead of texture lookups.

This is the same as GammaExpansionEffect; however, the numerical issues
are much much bigger, and it took forever to actually get the coefficients
right for proper accuracy.

Added accuracy tests to GammaCompressionEffect to make sure things are
fine; unsurprisingly, just as with GammaExpansionEffect, the old texture
code wasn't all that accurate. The effects were not as bad, though;
it primarily affects 10- and 12-bit processing, and Movit isn't ready
for 12-bit accuracy-wise.

The benchmark wins are huge; in a chain with effectively only a
GammaExpansionEffect and a GammaCompressionEffect, FPS on Sandy Bridge
(HD3000) goes up ~80%. Seemingly sampling that 4096x1 texture was really
expensive.
gamma_compression_effect.cpp
gamma_compression_effect.frag
gamma_compression_effect.h
gamma_compression_effect_test.cpp