This limits the ETC1 encoder to only utilizing 4 colors per block, just like DXT1. These 4 colors are on a line parallel to the grayscale axis. Fully lossless conversion (of this ETC1 subset format) to DXT1 is not possible in all cases, but it may be possible to do a "good enough" conversion.
The ETC1->DXT1 conversion step uses a precomputed 18-bit lookup table (5*3+3 bits) to accelerate the conversion of the ETC1 base color, intensity table index, and selectors to DXT1 low/high color endpoints and selectors. Each table entry contains the best DXT1 low/high color endpoints to use, along with a 4 entry table specifying which DXT1 selector to use for each ETC1 selector. I used crunch's DXT1 endpoint optimizer to build this table.
ETC1 (subset):
Error: Max: 80, Mean: 3.802, MSE: 30.247, RMSE: 5.500, PSNR: 33.324
Converted directly to DXT1 using the lookup table approach, then decoded (in software using crnlib):
Error: Max: 73, Mean: 3.966, MSE: 32.873, RMSE: 5.733, PSNR: 32.962
Delta image:
Grayscale delta histogram:
These results are extremely promising. The next step is to work on the artifacts and do more testing. If this conversion step can be made to work well enough it means that a lossy "universal crunch" format that can be quickly and efficiently transcoded to either DXT1 or ETC1 is actually possible.
No comments:
Post a Comment