added support for DXT1 format and refactor deblocking code