diff --git a/BPTCEncoder/include/BC7Compressor.h b/BPTCEncoder/include/BC7Compressor.h index 22eb2ce..b05b574 100755 --- a/BPTCEncoder/include/BC7Compressor.h +++ b/BPTCEncoder/include/BC7Compressor.h @@ -50,12 +50,12 @@ namespace BC7C // Compress the image given as RGBA data to BC7 format. Width and Height are the dimensions of // the image in pixels. - void CompressImageBC7(const unsigned char *inBuf, unsigned char *outBuf, int width, int height); + void CompressImageBC7(const unsigned char *inBuf, unsigned char *outBuf, unsigned int width, unsigned int height); // Compress the image given as RGBA data to BC7 format using an algorithm optimized for SIMD // enabled platforms. Width and Height are the dimensions of the image in pixels. - void CompressImageBC7SIMD(const unsigned char* inBuf, unsigned char* outBuf, int width, int height); + void CompressImageBC7SIMD(const unsigned char* inBuf, unsigned char* outBuf, unsigned int width, unsigned int height); // Decompress the image given as BC7 data to R8G8B8A8 format. Width and Height are the dimensions of the image in pixels. - void DecompressImageBC7SIMD(const unsigned char* inBuf, unsigned char* outBuf, int width, int height); + void DecompressImageBC7SIMD(const unsigned char* inBuf, unsigned char* outBuf, unsigned int width, unsigned int height); } diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index cfd7c8b..32ec122 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -1392,13 +1392,13 @@ namespace BC7C // 4-byte RGBA format. The width and height parameters specify the size of the image in pixels. // The buffer pointed to by outBuf should be large enough to store the compressed image. This // implementation has an 4:1 compression ratio. - void CompressImageBC7(const uint8* inBuf, uint8* outBuf, int width, int height) + void CompressImageBC7(const unsigned char *inBuf, unsigned char *outBuf, unsigned int width, unsigned int height) { uint32 block[16]; BC7CompressionMode::ResetNumUses(); BC7CompressionMode::MaxAnnealingIterations = min(BC7CompressionMode::kMaxAnnealingIterations, GetQualityLevel()); - for(int j = 0; j < height; j += 4, inBuf += width * 4 * 4) + for(int j = 0; j < height; j += 4) { for(int i = 0; i < width; i += 4) { diff --git a/BPTCEncoder/src/BC7CompressorSIMD.cpp b/BPTCEncoder/src/BC7CompressorSIMD.cpp index f357900..c84784c 100755 --- a/BPTCEncoder/src/BC7CompressorSIMD.cpp +++ b/BPTCEncoder/src/BC7CompressorSIMD.cpp @@ -978,7 +978,7 @@ namespace BC7C // 4-byte RGBA format. The width and height parameters specify the size of the image in pixels. // The buffer pointed to by outBuf should be large enough to store the compressed image. This // implementation has an 4:1 compression ratio. - void CompressImageBC7SIMD(const uint8* inBuf, uint8* outBuf, int width, int height) + void CompressImageBC7SIMD(const unsigned char *inBuf, unsigned char *outBuf, unsigned int width, unsigned int height) { ALIGN_SSE uint32 block[16]; @@ -987,7 +987,7 @@ namespace BC7C BC7CompressionModeSIMD::MaxAnnealingIterations = GetQualityLevel(); - for(int j = 0; j < height; j += 4, inBuf += width * 4 * 4) + for(int j = 0; j < height; j += 4) { for(int i = 0; i < width; i += 4) {