mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-26 01:18:03 +00:00
Change signed to unsigned in order to match the function pointer typedef prototype.
Changed the function prototype to match that of the typedef in the rest of the library, and fixed a bug where we would iterate too far with the initial buffer.
This commit is contained in:
parent
662e3c8f57
commit
87375f4c14
3 changed files with 7 additions and 7 deletions
|
@ -50,12 +50,12 @@ namespace BC7C
|
||||||
|
|
||||||
// Compress the image given as RGBA data to BC7 format. Width and Height are the dimensions of
|
// Compress the image given as RGBA data to BC7 format. Width and Height are the dimensions of
|
||||||
// the image in pixels.
|
// 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
|
// 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.
|
// 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.
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1392,13 +1392,13 @@ namespace BC7C
|
||||||
// 4-byte RGBA format. The width and height parameters specify the size of the image in pixels.
|
// 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
|
// The buffer pointed to by outBuf should be large enough to store the compressed image. This
|
||||||
// implementation has an 4:1 compression ratio.
|
// 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];
|
uint32 block[16];
|
||||||
BC7CompressionMode::ResetNumUses();
|
BC7CompressionMode::ResetNumUses();
|
||||||
BC7CompressionMode::MaxAnnealingIterations = min(BC7CompressionMode::kMaxAnnealingIterations, GetQualityLevel());
|
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)
|
for(int i = 0; i < width; i += 4)
|
||||||
{
|
{
|
||||||
|
|
|
@ -978,7 +978,7 @@ namespace BC7C
|
||||||
// 4-byte RGBA format. The width and height parameters specify the size of the image in pixels.
|
// 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
|
// The buffer pointed to by outBuf should be large enough to store the compressed image. This
|
||||||
// implementation has an 4:1 compression ratio.
|
// 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];
|
ALIGN_SSE uint32 block[16];
|
||||||
|
|
||||||
|
@ -987,7 +987,7 @@ namespace BC7C
|
||||||
|
|
||||||
BC7CompressionModeSIMD::MaxAnnealingIterations = GetQualityLevel();
|
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)
|
for(int i = 0; i < width; i += 4)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue