astc_dec icon indicating copy to clipboard operation
astc_dec copied to clipboard

decompress success but image data is wrong

Open haroel opened this issue 1 year ago • 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

haroel avatar Mar 30 '23 12:03 haroel

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.

richgel999 avatar Dec 28 '23 05:12 richgel999