richgel999 / astc_dec

Single source file LDR ASTC texture decompression in C++ (derived from Google's open source Android project)
Apache License 2.0
42 stars 5 forks source link

decompress success but image data is wrong #2

Open haroel opened 1 year ago

haroel commented 1 year ago
                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

richgel999 commented 10 months ago

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.