mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-09 14:45:39 +00:00
Change interface of compression/decompression jobs.
This commit is contained in:
parent
8e76d149ba
commit
f70b26a47f
|
@ -1628,16 +1628,16 @@ namespace BC7C {
|
||||||
// large enough to store the compressed image. This implementation has an 4:1
|
// large enough to store the compressed image. This implementation has an 4:1
|
||||||
// compression ratio.
|
// compression ratio.
|
||||||
void Compress(const CompressionJob &cj) {
|
void Compress(const CompressionJob &cj) {
|
||||||
const uint32 *inPixels = reinterpret_cast<const uint32 *>(cj.inBuf);
|
const uint32 *inPixels = reinterpret_cast<const uint32 *>(cj.InBuf());
|
||||||
unsigned char *outBuf = cj.outBuf;
|
unsigned char *outBuf = cj.OutBuf();
|
||||||
for(uint32 j = 0; j < cj.height; j += 4) {
|
for(uint32 j = 0; j < cj.Height(); j += 4) {
|
||||||
for(uint32 i = 0; i < cj.width; i += 4) {
|
for(uint32 i = 0; i < cj.Width(); i += 4) {
|
||||||
|
|
||||||
uint32 block[16];
|
uint32 block[16];
|
||||||
memcpy(block, inPixels + j*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block, inPixels + j*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
memcpy(block + 4, inPixels + (j+1)*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block + 4, inPixels + (j+1)*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
memcpy(block + 8, inPixels + (j+2)*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block + 8, inPixels + (j+2)*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
memcpy(block + 12, inPixels + (j+3)*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block + 12, inPixels + (j+3)*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
|
|
||||||
CompressBC7Block(block, outBuf);
|
CompressBC7Block(block, outBuf);
|
||||||
|
|
||||||
|
@ -1723,20 +1723,20 @@ namespace BC7C {
|
||||||
#endif // HAS_ATOMICS
|
#endif // HAS_ATOMICS
|
||||||
|
|
||||||
void CompressWithStats(const CompressionJob &cj, std::ostream *logStream) {
|
void CompressWithStats(const CompressionJob &cj, std::ostream *logStream) {
|
||||||
const uint32 *inPixels = reinterpret_cast<const uint32 *>(cj.inBuf);
|
const uint32 *inPixels = reinterpret_cast<const uint32 *>(cj.InBuf());
|
||||||
unsigned char *outBuf = cj.outBuf;
|
unsigned char *outBuf = cj.OutBuf();
|
||||||
|
|
||||||
for(uint32 j = 0; j < cj.height; j += 4) {
|
for(uint32 j = 0; j < cj.Height(); j += 4) {
|
||||||
for(uint32 i = 0; i < cj.width; i += 4) {
|
for(uint32 i = 0; i < cj.Width(); i += 4) {
|
||||||
|
|
||||||
uint32 block[16];
|
uint32 block[16];
|
||||||
memcpy(block, inPixels + j*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block, inPixels + j*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
memcpy(block + 4, inPixels + (j+1)*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block + 4, inPixels + (j+1)*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
memcpy(block + 8, inPixels + (j+2)*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block + 8, inPixels + (j+2)*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
memcpy(block + 12, inPixels + (j+3)*cj.width + i, 4 * sizeof(uint32));
|
memcpy(block + 12, inPixels + (j+3)*cj.RowBytes() + i, 4 * sizeof(uint32));
|
||||||
|
|
||||||
if(logStream) {
|
if(logStream) {
|
||||||
uint64 blockIdx = reinterpret_cast<uint64>(inPixels + j*cj.width + i);
|
uint64 blockIdx = reinterpret_cast<uint64>(inPixels + j*cj.Width() + i);
|
||||||
CompressBC7Block(block, outBuf, BlockLogger(blockIdx, *logStream));
|
CompressBC7Block(block, outBuf, BlockLogger(blockIdx, *logStream));
|
||||||
} else {
|
} else {
|
||||||
CompressBC7Block(block, outBuf);
|
CompressBC7Block(block, outBuf);
|
||||||
|
@ -2757,19 +2757,19 @@ namespace BC7C {
|
||||||
// Convert the image from a BC7 buffer to a RGBA8 buffer
|
// Convert the image from a BC7 buffer to a RGBA8 buffer
|
||||||
void Decompress(const DecompressionJob &dj) {
|
void Decompress(const DecompressionJob &dj) {
|
||||||
|
|
||||||
const uint8 *inBuf = dj.inBuf;
|
const uint8 *inBuf = dj.InBuf();
|
||||||
uint32 *outBuf = reinterpret_cast<uint32 *>(dj.outBuf);
|
uint32 *outBuf = reinterpret_cast<uint32 *>(dj.OutBuf());
|
||||||
|
|
||||||
for(unsigned int j = 0; j < dj.height; j += 4) {
|
for(unsigned int j = 0; j < dj.Height(); j += 4) {
|
||||||
for(unsigned int i = 0; i < dj.width; i += 4) {
|
for(unsigned int i = 0; i < dj.Width(); i += 4) {
|
||||||
|
|
||||||
uint32 pixels[16];
|
uint32 pixels[16];
|
||||||
DecompressBC7Block(inBuf, pixels);
|
DecompressBC7Block(inBuf, pixels);
|
||||||
|
|
||||||
memcpy(outBuf + j*dj.width + i, pixels, 4 * sizeof(pixels[0]));
|
memcpy(outBuf + j*dj.Width() + i, pixels, 4 * sizeof(pixels[0]));
|
||||||
memcpy(outBuf + (j+1)*dj.width + i, pixels+4, 4 * sizeof(pixels[0]));
|
memcpy(outBuf + (j+1)*dj.Width() + i, pixels+4, 4 * sizeof(pixels[0]));
|
||||||
memcpy(outBuf + (j+2)*dj.width + i, pixels+8, 4 * sizeof(pixels[0]));
|
memcpy(outBuf + (j+2)*dj.Width() + i, pixels+8, 4 * sizeof(pixels[0]));
|
||||||
memcpy(outBuf + (j+3)*dj.width + i, pixels+12, 4 * sizeof(pixels[0]));
|
memcpy(outBuf + (j+3)*dj.Width() + i, pixels+12, 4 * sizeof(pixels[0]));
|
||||||
|
|
||||||
inBuf += 16;
|
inBuf += 16;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,40 +61,70 @@
|
||||||
// inBuf - (width * height * 4) bytes
|
// inBuf - (width * height * 4) bytes
|
||||||
// outBuf - (width * height) bytes
|
// outBuf - (width * height) bytes
|
||||||
struct CompressionJob {
|
struct CompressionJob {
|
||||||
const unsigned char *inBuf;
|
private:
|
||||||
unsigned char *outBuf;
|
const uint8 *m_InBuf;
|
||||||
const uint32 width;
|
uint8 *m_OutBuf;
|
||||||
const uint32 height;
|
const uint32 m_Width;
|
||||||
|
const uint32 m_Height;
|
||||||
|
const uint32 m_RowBytes;
|
||||||
|
|
||||||
|
public:
|
||||||
|
const uint8 *InBuf() const { return m_InBuf; }
|
||||||
|
uint8 *OutBuf() const { return m_OutBuf; }
|
||||||
|
uint32 Width() const { return m_Width; }
|
||||||
|
uint32 Height() const { return m_Height; }
|
||||||
|
uint32 RowBytes() const { return m_RowBytes; }
|
||||||
|
|
||||||
CompressionJob(
|
CompressionJob(
|
||||||
const unsigned char *_inBuf,
|
const uint8 *_inBuf,
|
||||||
unsigned char *_outBuf,
|
unsigned char *_outBuf,
|
||||||
const uint32 _width,
|
const uint32 _width,
|
||||||
const uint32 _height)
|
const uint32 _height)
|
||||||
: inBuf(_inBuf)
|
: m_InBuf(_inBuf)
|
||||||
, outBuf(_outBuf)
|
, m_OutBuf(_outBuf)
|
||||||
, width(_width)
|
, m_Width(_width)
|
||||||
, height(_height)
|
, m_Height(_height)
|
||||||
|
, m_RowBytes(_width)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
CompressionJob(
|
||||||
|
const uint8 *_inBuf,
|
||||||
|
unsigned char *_outBuf,
|
||||||
|
const uint32 _width,
|
||||||
|
const uint32 _height,
|
||||||
|
const uint32 _rowbytes)
|
||||||
|
: m_InBuf(_inBuf)
|
||||||
|
, m_OutBuf(_outBuf)
|
||||||
|
, m_Width(_width)
|
||||||
|
, m_Height(_height)
|
||||||
|
, m_RowBytes(_rowbytes)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
// This struct mirrors that for a compression job, but is used to decompress a BC7 stream. Here, inBuf
|
// This struct mirrors that for a compression job, but is used to decompress a BC7 stream. Here, inBuf
|
||||||
// is a buffer of BC7 data, and outBuf is the destination where we will copy the decompressed R8G8B8A8 data
|
// is a buffer of BC7 data, and outBuf is the destination where we will copy the decompressed R8G8B8A8 data
|
||||||
struct DecompressionJob {
|
struct DecompressionJob {
|
||||||
const unsigned char *const inBuf;
|
private:
|
||||||
unsigned char *const outBuf;
|
const uint8 *m_InBuf;
|
||||||
const uint32 width;
|
uint8 *m_OutBuf;
|
||||||
const uint32 height;
|
const uint32 m_Width;
|
||||||
|
const uint32 m_Height;
|
||||||
|
|
||||||
|
public:
|
||||||
|
const uint8 *InBuf() const { return m_InBuf; }
|
||||||
|
uint8 *OutBuf() const { return m_OutBuf; }
|
||||||
|
uint32 Width() const { return m_Width; }
|
||||||
|
uint32 Height() const { return m_Height; }
|
||||||
|
|
||||||
DecompressionJob(
|
DecompressionJob(
|
||||||
const unsigned char *_inBuf,
|
const uint8 *_inBuf,
|
||||||
unsigned char *_outBuf,
|
unsigned char *_outBuf,
|
||||||
const uint32 _width,
|
const uint32 _width,
|
||||||
const uint32 _height)
|
const uint32 _height)
|
||||||
: inBuf(_inBuf)
|
: m_InBuf(_inBuf)
|
||||||
, outBuf(_outBuf)
|
, m_OutBuf(_outBuf)
|
||||||
, width(_width)
|
, m_Width(_width)
|
||||||
, height(_height)
|
, m_Height(_height)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -40,13 +40,13 @@ namespace DXTC
|
||||||
uint8 minColor[4];
|
uint8 minColor[4];
|
||||||
uint8 maxColor[4];
|
uint8 maxColor[4];
|
||||||
|
|
||||||
uint8 *outBuf = cj.outBuf;
|
uint8 *outBuf = cj.OutBuf();
|
||||||
const uint8 *inBuf = cj.inBuf;
|
const uint8 *inBuf = cj.InBuf();
|
||||||
for(int j = 0; j < cj.height; j += 4, inBuf += cj.width * 4 * 4)
|
for(int j = 0; j < cj.Height(); j += 4, inBuf += cj.Width() * 4 * 4)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < cj.width; i += 4)
|
for(int i = 0; i < cj.Width(); i += 4)
|
||||||
{
|
{
|
||||||
ExtractBlock(inBuf + i * 4, cj.width, block);
|
ExtractBlock(inBuf + i * 4, cj.Width(), block);
|
||||||
GetMinMaxColors(block, minColor, maxColor);
|
GetMinMaxColors(block, minColor, maxColor);
|
||||||
EmitWord(outBuf, ColorTo565(maxColor));
|
EmitWord(outBuf, ColorTo565(maxColor));
|
||||||
EmitWord(outBuf, ColorTo565(minColor));
|
EmitWord(outBuf, ColorTo565(minColor));
|
||||||
|
@ -64,13 +64,13 @@ namespace DXTC
|
||||||
uint8 minColor[4];
|
uint8 minColor[4];
|
||||||
uint8 maxColor[4];
|
uint8 maxColor[4];
|
||||||
|
|
||||||
uint8 *outBuf = cj.outBuf;
|
uint8 *outBuf = cj.OutBuf();
|
||||||
const uint8 *inBuf = cj.inBuf;
|
const uint8 *inBuf = cj.InBuf();
|
||||||
for(int j = 0; j < cj.height; j += 4, inBuf += cj.width * 4 * 4)
|
for(int j = 0; j < cj.Height(); j += 4, inBuf += cj.Width() * 4 * 4)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < cj.width; i += 4)
|
for(int i = 0; i < cj.Width(); i += 4)
|
||||||
{
|
{
|
||||||
ExtractBlock(inBuf + i * 4, cj.width, block);
|
ExtractBlock(inBuf + i * 4, cj.Width(), block);
|
||||||
GetMinMaxColorsWithAlpha(block, minColor, maxColor);
|
GetMinMaxColorsWithAlpha(block, minColor, maxColor);
|
||||||
EmitByte(outBuf, maxColor[3]);
|
EmitByte(outBuf, maxColor[3]);
|
||||||
EmitByte(outBuf, minColor[3]);
|
EmitByte(outBuf, minColor[3]);
|
||||||
|
|
|
@ -92,26 +92,26 @@ namespace DXTC
|
||||||
|
|
||||||
void DecompressDXT1(const DecompressionJob &dcj)
|
void DecompressDXT1(const DecompressionJob &dcj)
|
||||||
{
|
{
|
||||||
assert(!(dcj.height & 3));
|
assert(!(dcj.Height() & 3));
|
||||||
assert(!(dcj.width & 3));
|
assert(!(dcj.Width() & 3));
|
||||||
|
|
||||||
uint32 blockW = dcj.width >> 2;
|
uint32 blockW = dcj.Width() >> 2;
|
||||||
uint32 blockH = dcj.height >> 2;
|
uint32 blockH = dcj.Height() >> 2;
|
||||||
|
|
||||||
const uint32 blockSz = 8;
|
const uint32 blockSz = 8;
|
||||||
|
|
||||||
uint32 *outPixels = reinterpret_cast<uint32 *>(dcj.outBuf);
|
uint32 *outPixels = reinterpret_cast<uint32 *>(dcj.OutBuf());
|
||||||
|
|
||||||
uint32 outBlock[16];
|
uint32 outBlock[16];
|
||||||
for(int j = 0; j < blockH; j++) {
|
for(int j = 0; j < blockH; j++) {
|
||||||
for(int i = 0; i < blockW; i++) {
|
for(int i = 0; i < blockW; i++) {
|
||||||
|
|
||||||
uint32 offset = (j * blockW + i) * blockSz;
|
uint32 offset = (j * blockW + i) * blockSz;
|
||||||
DecompressDXT1Block(dcj.inBuf + offset, outBlock);
|
DecompressDXT1Block(dcj.InBuf() + offset, outBlock);
|
||||||
|
|
||||||
for(uint32 y = 0; y < 4; y++)
|
for(uint32 y = 0; y < 4; y++)
|
||||||
for(uint32 x = 0; x < 4; x++) {
|
for(uint32 x = 0; x < 4; x++) {
|
||||||
offset = (j*4 + y)*dcj.width + ((i*4)+x);
|
offset = (j*4 + y)*dcj.Width() + ((i*4)+x);
|
||||||
outPixels[offset] = outBlock[y*4 + x];
|
outPixels[offset] = outBlock[y*4 + x];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,8 @@ namespace ETCC {
|
||||||
rg_etc1::pack_etc1_block_init();
|
rg_etc1::pack_etc1_block_init();
|
||||||
|
|
||||||
// Assume block-stream order
|
// Assume block-stream order
|
||||||
uint32 blockSizeX = cj.width / 4;
|
uint32 blockSizeX = cj.Width() / 4;
|
||||||
uint32 blockSizeY = cj.height / 4;
|
uint32 blockSizeY = cj.Height() / 4;
|
||||||
|
|
||||||
for(uint32 j = 0; j < blockSizeY; j++)
|
for(uint32 j = 0; j < blockSizeY; j++)
|
||||||
for(uint32 i = 0; i < blockSizeX; i++) {
|
for(uint32 i = 0; i < blockSizeX; i++) {
|
||||||
|
@ -72,12 +72,12 @@ namespace ETCC {
|
||||||
|
|
||||||
for(uint32 y = 0; y < 4; y++) {
|
for(uint32 y = 0; y < 4; y++) {
|
||||||
for(uint32 x = 0; x < 4; x++) {
|
for(uint32 x = 0; x < 4; x++) {
|
||||||
const uint32 *in = reinterpret_cast<const uint32 *>(cj.inBuf);
|
const uint32 *in = reinterpret_cast<const uint32 *>(cj.InBuf());
|
||||||
pixels[y*4 + x] = in[(j*4 + y)*cj.width + (i*4 + x)];
|
pixels[y*4 + x] = in[(j*4 + y)*cj.Width() + (i*4 + x)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pack_etc1_block(cj.outBuf + blockIdx * 8, pixels, params);
|
pack_etc1_block(cj.OutBuf() + blockIdx * 8, pixels, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace PVRTCC
|
} // namespace PVRTCC
|
||||||
|
|
|
@ -57,18 +57,18 @@ namespace ETCC {
|
||||||
|
|
||||||
void Decompress(const DecompressionJob &cj) {
|
void Decompress(const DecompressionJob &cj) {
|
||||||
|
|
||||||
uint32 blocksX = cj.width / 4;
|
uint32 blocksX = cj.Width() / 4;
|
||||||
uint32 blocksY = cj.width / 4;
|
uint32 blocksY = cj.Height() / 4;
|
||||||
|
|
||||||
for(uint32 j = 0; j < blocksX; j++) {
|
for(uint32 j = 0; j < blocksX; j++) {
|
||||||
for(uint32 i = 0; i < blocksY; i++) {
|
for(uint32 i = 0; i < blocksY; i++) {
|
||||||
uint32 pixels[16];
|
uint32 pixels[16];
|
||||||
uint32 blockIdx = j*blocksX + i;
|
uint32 blockIdx = j*blocksX + i;
|
||||||
rg_etc1::unpack_etc1_block(cj.inBuf + blockIdx * 8, pixels);
|
rg_etc1::unpack_etc1_block(cj.InBuf() + blockIdx * 8, pixels);
|
||||||
for(uint32 y = 0; y < 4; y++)
|
for(uint32 y = 0; y < 4; y++)
|
||||||
for(uint32 x = 0; x < 4; x++) {
|
for(uint32 x = 0; x < 4; x++) {
|
||||||
uint32 *out = reinterpret_cast<uint32 *>(cj.outBuf);
|
uint32 *out = reinterpret_cast<uint32 *>(cj.OutBuf());
|
||||||
out[(j*4 + y)*cj.width + (i*4 + x)] = pixels[y*4 + x];
|
out[(j*4 + y)*cj.Width() + (i*4 + x)] = pixels[y*4 + x];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -918,8 +918,8 @@ namespace PVRTCC {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Compress(const CompressionJob &cj, bool bTwoBit, EWrapMode wrapMode) {
|
void Compress(const CompressionJob &cj, bool bTwoBit, EWrapMode wrapMode) {
|
||||||
const uint32 width = cj.width;
|
const uint32 width = cj.Width();
|
||||||
const uint32 height = cj.height;
|
const uint32 height = cj.Height();
|
||||||
|
|
||||||
// Make sure that width and height are a power of two.
|
// Make sure that width and height are a power of two.
|
||||||
assert((width & (width - 1)) == 0);
|
assert((width & (width - 1)) == 0);
|
||||||
|
@ -929,10 +929,10 @@ namespace PVRTCC {
|
||||||
(CompressionLabel *)calloc(width * height, sizeof(CompressionLabel));
|
(CompressionLabel *)calloc(width * height, sizeof(CompressionLabel));
|
||||||
|
|
||||||
// First traverse forward...
|
// First traverse forward...
|
||||||
LabelImageForward(labels, cj.inBuf, width, height);
|
LabelImageForward(labels, cj.InBuf(), width, height);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
gDbgPixels = reinterpret_cast<const uint32 *>(cj.inBuf);
|
gDbgPixels = reinterpret_cast<const uint32 *>(cj.InBuf());
|
||||||
|
|
||||||
Image original(width, height);
|
Image original(width, height);
|
||||||
for(uint32 j = 0; j < height; j++)
|
for(uint32 j = 0; j < height; j++)
|
||||||
|
@ -961,10 +961,10 @@ namespace PVRTCC {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Then combine everything...
|
// Then combine everything...
|
||||||
GenerateLowHighImages(labels, cj.inBuf, cj.outBuf, width, height);
|
GenerateLowHighImages(labels, cj.InBuf(), cj.OutBuf(), width, height);
|
||||||
|
|
||||||
// Then compute modulation values
|
// Then compute modulation values
|
||||||
GenerateModulationValues(cj.outBuf, cj.inBuf, width, height);
|
GenerateModulationValues(cj.OutBuf(), cj.InBuf(), width, height);
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
free(labels);
|
free(labels);
|
||||||
|
|
|
@ -65,12 +65,12 @@ namespace PVRTCC {
|
||||||
const EWrapMode) {
|
const EWrapMode) {
|
||||||
pvrtexture::CPVRTextureHeader pvrTexHdr;
|
pvrtexture::CPVRTextureHeader pvrTexHdr;
|
||||||
pvrTexHdr.setPixelFormat(pvrtexture::PVRStandard8PixelType);
|
pvrTexHdr.setPixelFormat(pvrtexture::PVRStandard8PixelType);
|
||||||
pvrTexHdr.setWidth(cj.width);
|
pvrTexHdr.setWidth(cj.Width());
|
||||||
pvrTexHdr.setHeight(cj.height);
|
pvrTexHdr.setHeight(cj.Height());
|
||||||
pvrTexHdr.setIsFileCompressed(false);
|
pvrTexHdr.setIsFileCompressed(false);
|
||||||
pvrTexHdr.setIsPreMultiplied(false);
|
pvrTexHdr.setIsPreMultiplied(false);
|
||||||
|
|
||||||
pvrtexture::CPVRTexture pvrTex = pvrtexture::CPVRTexture(pvrTexHdr, cj.inBuf);
|
pvrtexture::CPVRTexture pvrTex = pvrtexture::CPVRTexture(pvrTexHdr, cj.InBuf());
|
||||||
bool result = pvrtexture::Transcode(pvrTex,
|
bool result = pvrtexture::Transcode(pvrTex,
|
||||||
ePVRTPF_PVRTCI_4bpp_RGBA,
|
ePVRTPF_PVRTCI_4bpp_RGBA,
|
||||||
ePVRTVarTypeUnsignedByte,
|
ePVRTVarTypeUnsignedByte,
|
||||||
|
@ -79,7 +79,7 @@ namespace PVRTCC {
|
||||||
assert(result);
|
assert(result);
|
||||||
(void)result;
|
(void)result;
|
||||||
|
|
||||||
memcpy(cj.outBuf, static_cast<uint8 *>(pvrTex.getDataPtr()), cj.width * cj.height / 2);
|
memcpy(cj.OutBuf(), static_cast<uint8 *>(pvrTex.getDataPtr()), cj.Width() * cj.Height() / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace PVRTCC
|
} // namespace PVRTCC
|
||||||
|
|
|
@ -277,8 +277,8 @@ namespace PVRTCC {
|
||||||
const bool bTwoBitMode,
|
const bool bTwoBitMode,
|
||||||
const EWrapMode wrapMode,
|
const EWrapMode wrapMode,
|
||||||
bool bDebugImages) {
|
bool bDebugImages) {
|
||||||
const uint32 w = dcj.width;
|
const uint32 w = dcj.Width();
|
||||||
const uint32 h = dcj.height;
|
const uint32 h = dcj.Height();
|
||||||
|
|
||||||
assert(w > 0);
|
assert(w > 0);
|
||||||
assert(h > 0);
|
assert(h > 0);
|
||||||
|
@ -301,7 +301,7 @@ namespace PVRTCC {
|
||||||
uint32 idx = Interleave(j, i);
|
uint32 idx = Interleave(j, i);
|
||||||
|
|
||||||
uint32 offset = idx * kBlockSize;
|
uint32 offset = idx * kBlockSize;
|
||||||
blocks.push_back( Block(dcj.inBuf + offset) );
|
blocks.push_back( Block(dcj.InBuf() + offset) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,9 +381,9 @@ namespace PVRTCC {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bTwoBitMode) {
|
if(bTwoBitMode) {
|
||||||
Decompress2BPP(imgA, imgB, blocks, dcj.outBuf, bDebugImages);
|
Decompress2BPP(imgA, imgB, blocks, dcj.OutBuf(), bDebugImages);
|
||||||
} else {
|
} else {
|
||||||
Decompress4BPP(imgA, imgB, blocks, dcj.outBuf, bDebugImages);
|
Decompress4BPP(imgA, imgB, blocks, dcj.OutBuf(), bDebugImages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue