Skip navigation
Currently Being Moderated

Format of huffman compressed data in PRC compressed tessellation?

Apr 19, 2012 1:49 PM

Tags: #3d #3dpdf

Hi there,

 

I've been looking to see if I can make our application create 3D pdf files using the PRC file format. I downloaded the PRC file format document from ISO and tried to read a few example files I found on the web to make sure I understood how it worked. It's all fine until I try to read huffman compressed data in a PRC_TYPE_TESS_3D_COMPRESSED section. The standard says that I should be able to read the huffman compressed data by using the opposite of the 'WriteUnsignedInteger' but if I do that I get invalid integers. If I try to read the unsigned integers by just reading 32bits directly the data doesn't seem to make sense if I try to decode the leaf data for the fuffman tree.

Does anybody know if there is any documentation on this or any examples? I'm at the point of giving up...

I'm a bit bewildered that there is an ISO standard but the example files that I have just don't seem to match it...

Any help would be be fantastic.

Thanks

 

Miles Thornton

 
Replies
  • Currently Being Moderated
    May 18, 2012 12:59 PM   in reply to Miles Thornton

    Dear Miles,

     

    while I can only share your bewilderment (I have also tried and failed to decode PRC_TYPE_TESS_3D_COMPRESSED),

    may I ask you to clarify a bit what "PRC file format document from ISO" did you deal with - the old one avialable for free at

    http://pdf.editme.com/files/PDFE/SC2N570-PRC-WD.pdf or the one currently being sold at http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm ?csnumber=54948 ?

    If you have got your hands on the latter, please, tell us if it is worth its price.

    Is it an much improved relative to SC2N570-PRC-WD.pdf?

     

                                   Sincerely, Michail

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 30, 2012 1:40 AM   in reply to Miles Thornton

    Miles,

    the number of pages of the current ISO draft is different from the one at bsigroup, so the text may not be the same.

    Your text is called "BS ISO 14739-1", while ISO draft is "ISO/DIS 14739-1.2", that "2" may indicate the next iteration.

     

    On the other hand, it seems a new dratf (1.3) is coming in August:

     

    http://www.techsoft3d.com/developers/article/prc-iso-update

     

    http://www.pdfa.org/2012/06/iso-standards-pdf-week-in-mississauga/

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 15, 2012 9:33 PM   in reply to mvid

    Well, there is some progress going on.

    ISO draft is not being sold now and there are more details on what took place within ISO at

    http://3dpdfconsortium.org/news-and-events/3-the-3d-pdf-standard/37-pd f-week-may-2012-update.html

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 16, 2012 9:50 AM   in reply to Miles Thornton

    More news - ISO draft is being sold again, it is now "ISO/DIS 14739-1.3" (was "ISO/DIS 14739-1.2")

    http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?cs number=54948

    If there is someone here who has got his hands on the new draft - please, report if it is worth its price.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 22, 2012 1:46 AM   in reply to mvid

    More news.

    Status of the draft at the ISO page indicates voting takes place on it.

    Vote was to be terminated by 2012-12-16.

    Anyone in the know of the results here?

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2013 1:10 PM   in reply to mvid

    Got my hands on "ISO/DIS 14739-1.3".

     

    Dissapointed. Not that much improvement relative to the free public draft from AIIM.

    "Caveat emptor".

     

    The following pseudocode (the same in both drafts),

    does not set pcArray[0] to anythimg and uses its junk value in the second "for" cycle.

    An evident bug.

     

    I am sure there are more gems like that, hidden in less obvious ways.

     

    I am afraid the text travels thru ISO process without being read.

    And Adobe/TechSoft just want an ISO stamp on a for propaganda purposes.

    (Anyone remembers Windows NT POSIX compliance joke?)

     

    ------------------------------------------

    void WriteCompressedIntegerArray(int* piArray, unsigned uIntArraySize,bool bWriteCompressStrategy=true)

    {

    unsigned u;

    char* pcArray=new char[uIntArraySize];

     

    for( u=1; u<uIntArraySize; u++)

    pcArray[u] = (char) GetNumberOfBitsUsedToStoreInteger(piArray[u]);

     

    WriteCharacterArray(pcArray,uIntArraySize, 6, bWriteCompressStrategy);

     

    for( u=0;u < uIntArraySize; u++)

    WriteIntegerWithVariableBitNumber(piArray[u], pcArray[u]);

     

    delete [] pcArray;

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 29, 2013 10:35 PM   in reply to Miles Thornton

    On a different note I think that I am actually making some progress at reading the compressed tessellation.

     

    Did you succede?

     

    The current ISO draft has changed the pseudocode description of Huffman compressed data storage, but the new description refers to undocumented subroutines and variables. At least their names seem to imply something.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 2, 2013 11:37 PM   in reply to mvid

    OK, on one hand the current ISO draft turned out to be good enough to allow recovery of Huffman encoded data from a PRC file, but on the other I was able to cope with the large amount of errors and omissions in the description of how the compression results are packed into bit fields only due to the fact that both the compression input and output were predictable, so "reverse engineering" was easy.

     

    Since the error ratio is likely to be the same in other parts of the specification  (and not mauch lower then in the free pre-ISO draft), attempts to reproduce the results of vaguely defined process of highly compressing tessellation and/or to look into other murky areas of PRC format seem risky.

     

    BTW, PDF3D team claims to produce, "independent of Adobe", highly compressed PRC tessellations in PDF output of their products. So reverse-engineering of PRC may be possible, given enough motivation and resourses, but for a casual developer the current ISO draft of the PRC standard is an investment of questionable value.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points