Sunday, February 7, 2021

More RDO BC7 encoding - new algorithm

I sat down and implemented another RDO BC7 algorithm, using what I learned from the previous one. Amazingly it's beating the way more complex one, except perhaps at really high quality levels (really low lambdas). Very surprising! The source is here, and the post-processing function (the entropy reduction transform in function bc7enc_reduce_entropy()) is here

The latest bc7enc_rdo repo is here.

I expected it to perform worse, yet it's blowing the more complex one away. The new algorithm is compatible with all the BC7 modes, too. The previous one was mostly hardwired for the main modes (mostly 1/6).


The new algorithm is much stronger:

RDO BC7 new algorithm - lambda 1.0, 4KB window size 
bc7enc -o -u4 -zc4096 J:\dev\test_images\xmen_1024.png -e -E -z1.0

37.15 dB, 3.97 bits/texel (Deflate)



RDO BC7 new algorithm - lambda 3.0, 4KB window size 
bc7enc -o -u4 -zc4096 J:\dev\test_images\xmen_1024.png -e -E -z3.0

32.071 dB, 3.12 bits/texel (Deflate)



The new algorithm degrades way more gracefully:

lambda=4.0
30.812 dB, 2.94 bits/texel


lambda=5.0
29.883 2.69 bits/texel (Deflate)


lambda=5.0, window size 8KB
29.826 dB, 2.59 bits/texel (Deflate)




No comments:

Post a Comment