I have some PVRTC 4bpp image data that needs to be flipped vertically in-place without decompression. The code I have written is mostly working but the flip currently introduces small artefacts and I'm unsure exactly why.
The PVRTC flip code first moves the 8-byte 4x4 compression blocks to their flipped position as calculated by the TwiddleUV() function from PVRTDecompress.cpp in the PowerVR SDK. This part appears to be correct.
Second, the code iterates through all the 8-byte compression blocks reversing the order of the second 4 bytes which contain the 4x4 modulation data stored in 2bpp. The first 4 bytes of the block contains color data which is left unchanged.
This seems to be very close to correct, but it leaves small artefacts in the flipped image that weren't there in the original and which manifest mostly as small greyish horizontal lines. If the flipping code is run twice then the artefacts go away and the image is unchanged from the original.
Can anyone with some PVRTC experience explain what else needs to be done to flip the compressed image data? I think the problem may be to do with the flipping of modulation data, but my forays into the PVRTC documentation haven't yielded the answer at this stage.
Many thanks,
Richard