Skip to main content
Participant
August 7, 2020
Question

ATF PVTRC compressed data issue

  • August 7, 2020
  • 0 replies
  • 154 views

I started writing some utilities to decode ATF files and I spent time learning about the compressed format according to https://www.adobe.com/devnet/archive/flashruntimes/articles/atf-file-format.html. So, I generated two different ATF files from the same PNG image. One was generated with format 2 (ATFRAWCOMPRESSED) and one with format 3 (ATFCOMPRESSED).

 

Given that this is supposed to be lossless, I should be able to take the PVRTC data from the second file and it should match the data from the first one. So, after getting the LZMA and JPEG-XR working properly, I got it match except on a few locations. After examining https://github.com/firefalcom/dds2atf/blob/master/pvr2atfcore.cpp#L1269, I can tell from the data I recovered that the code is indeed storing the lower bit of color 0 into the PVRTCTopData but then it stores color 1 as 5:5:4. This means that the original data cannot be 100% fully recovered.

 

According to the PVRTC specification http://cdn.imgtec.com/sdk-documentation/PVRTC%20Specification%20and%20User%20Guide.pdf, color 0 (color Ashould be 5:5:4, not color 5:5:4 (see figure 9 and table 1 below 1).

 

Any thoughts? Just an odditiy and even though we don't have the source for png2atf, it seems to match the behavior of the old version of dds2atf.

    This topic has been closed for replies.