Refine along fitted line for faster BC1 encoding #78
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This PR implements an idea I had a while ago to make BC1 encoding faster.
The reason BC1 encoding is so slow is that the refinement algorithm I implemented is very expensive for 3 color channels (dimensions). However, it's quite fast for 1 dimension. So the idea is: instead of trying out endpoint variations in 3D space, vary the distance of the endpoints from their midpoint.
This works surprisingly well. It can't reach the quality of refinement in 3D space, but it also doesn't have to. Since line refinement is about 3x faster than 3D refinement, I can use line refinement to cut down the number of iterations 3D color refinement has to do. So I can improve performance, while keeping the quality the same.
And that's exactly what I did. I changed the parameters of BC1 encoding to have similar levels of quality, while being faster thanks to line refinement:
(Fast quality isn't affected, because it doesn't do any refinement.)