diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-05 10:28:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-05 10:28:07 +0100 |
commit | df1724470d1cff4f67aeb4c0d039114373aeb001 (patch) | |
tree | 0208cb7c3fc85f52a30f534610136d43d24ca932 /thirdparty/cvtt/etc_notes.txt | |
parent | 2e44778cd2f3d004bac80c3cd3935a8835936e2c (diff) | |
parent | 419b342a9a716426159f7a51ae17390386ecc884 (diff) |
Merge pull request #49775 from fire/faster-cvtt
Faster CVTT by lowering default quality
Diffstat (limited to 'thirdparty/cvtt/etc_notes.txt')
-rw-r--r-- | thirdparty/cvtt/etc_notes.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/thirdparty/cvtt/etc_notes.txt b/thirdparty/cvtt/etc_notes.txt new file mode 100644 index 0000000000..bb041a8435 --- /dev/null +++ b/thirdparty/cvtt/etc_notes.txt @@ -0,0 +1,27 @@ +The ETC1 compressor uses modified cluster fit: + +Assume that there exists an ideal base color and set of selectors for a given table. +For a given table and set of selectors, the ideal base color can be determined by subtracting the offsets from each pixel and averaging them. +Doing that is equivalent to subtracting the average offset from the average color. +Because positive and negative selectors of the same magnitude cancel out, the search space of possible average offsets is reduced: 57 unique offsets for the first table and 81 for the others. +Most of the offsets result in the same color as another average offset due to quantization of the base color, so those can be de-duplicated. +So: +- Start with a high-precision average color. +- Apply precomputed luma offsets to it. +- Quantize and de-duplicate the base colors. +- Find the ideal selectors for each base color. + +Differential mode is solved by just finding the best legal combination from those attempts. + +There are several scenarios where this is not ideal: +- Clamping behavior can sometimes be leveraged for a more accurate block. +- Differentials can sometimes be moved slightly closer to become legal. +- This only works when MSE is the error metric (i.e. not normal maps) +- This only works when pixel weights are of equal importance (i.e. not using weight by alpha or edge deblocking) + +T and H mode just work by generating clustering assignments by computing a chrominance line and splitting the block in half by the chrominance midpoint and using those to determine the averages. + +Planar mode is just solved algebraically. + +If you want to emulate etc2comp's default settings, add the flag ETC_UseFakeBT709 to use its modified Rec. 709 error coefficients. +Doing that will significantly slow down encoding because it requires much more complicated quantization math.
\ No newline at end of file |