richgel999/astc_dec

decompress success but image data is wrong

haroel opened this issue · 1 comments

                int xdim = header[ASTC_HEADER_MAGIC];
                int ydim = header[ASTC_HEADER_MAGIC + 1];
                texture->w = astcGetWidth(header);
                texture->h = astcGetHeight(header);
                dataLen = dataLen - ASTC_HEADER_SIZE;
                const unsigned char * ptrdata = data + ASTC_HEADER_SIZE;
                //         bool decompress(uint8_t* pDst, const uint8_t* data, bool isSRGB, int blockWidth, int blockHeight);
                uint32_t size_rgba = texture->w * texture->h * 4;
                uint8_t* pDst = new uint8_t[size_rgba];
                bool loadSucceed =  basisu::astc::decompress(pDst,ptrdata,false,xdim, ydim );

the image shows error

The display is different every time it is run

How to solve this problem?
image

image

Hi - I didn't write this decoder. It's part of Android's testing framework. I suggest you try ARM's decoder in astc-encoder:
https://github.com/ARM-software/astc-encoder

If you can send me the .KTX or .ASTC file, I'll check it out.