Latest post Wed, Nov 11 2015 11:04 AM by OleksiiK. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Wed, Nov 11 2015 2:21 AM

    • _Wil_
    • Not Ranked
    • Joined on Mon, Nov 9 2015
    • Posts 1
    • Points 15

    QT atom headers?

    Hi, 

     

    I was wondering whether these various atom structures that the QT DNx codecs generate are documented anywhere:

     

    aclr

    adhr

    ares

     

    Better yet, are there any helper libs / functions to help populate these fields?  The idea here is that we'd like to write the QT files directly in a 64 bit process, using the DNx codec to compress frames & pass them in directly, rather than rely on spawning a 32 bit process to use (antiquated) QT APIs.  It's bound to be faster if we do it directly...  I have most of this already in place, but these fields are the only things missing right now, and I'd hate to make up incorrect entries because we're guessing.

     

    Thanks

  • Wed, Nov 11 2015 11:04 AM In reply to

    • OleksiiK
    • Not Ranked
    • Joined on Mon, Dec 23 2013
    • Posts 25
    • Points 270
    • Avid Developer Moderator

    Re: QT atom headers?

    Hello, 

    These structures are (or were) not documented, but it is not a secret.

    Avid defines two codec components. First one is DNxHD codec component, it is identified by 'AVdn' value in cType filed of ImageDescription atom structure, vendor shall be 'AVID', name shall be 'DNxHD 709' or 'DNxHD RGB' depending on decodeColorMapping bescribed below, depth shall be 24 or 32 depending on alpha presence. 'ACLR', 'APRG', 'ARES' extensions are used for DNxHD codec component. In case of alpha 'AALP' extension is also used. I suppose you are not interested in alpha encodng with old DNxHD, so I skip definition of 'AALP' and description of alpha formats used with DNxHD codec component.

    Second one is DNxHR codec component, t is identified by 'AVdh' value in cType filed of ImageDescription atom structure, vendor shall be 'AVID', name shall be 'DNxHR', depth shall be 24 or 32 depending on alpha presence. 'ADHR' and 'ACLR' extensions are used together with DNxHR codec component.

    Extension are summarized below:

    struct colorMappingTypeExtension {

        UInt32  idSize;        // 24

        OSType  extensionType; // 'ACLR'

        OSType  id;            // 'ACLR'

        UInt32  version;       // '0001'

        // 1: CCIR (supercolors will be dropped, 16 will be displayed as black)

        // 2: FullRange (0 will be displayed as black, 16 will be displayed as dark grey)

        UInt32  decodeColorMapping;

        UInt32  reserved;       // must be 0

    };

     

    struct progressiveTypeExtension {

        UInt32  idSize;        // 24

        OSType  extensionType; // 'APRG'

        OSType  id;            // 'APRG'

        UInt32  version;       // '0001'

        // 1 (or progressive or 2 for interlaced

        UInt32  encodedProgressiveInterlaced;

        UInt32  reserved;      // must be 0

    };

     

    struct AvidDNxHRDescriptionExtension {

        UInt32  idSize;        // 32

        OSType  extensionType; // 'ADHR'

        UInt32  version;       // '0001'

        UInt32  compressionID;

        // 0: 4:2:2 Sub Sampling

        // 1: 4:2:0 Sub Sampling

        // 2: 4:4:4 Sub Sampling

        UInt32  subSamplingControl;

        // 1:  8-bits per sample

        // 2: 10-bits per sample

        // 3: 12-bits per sample

        UInt32  sampleBitDepth;

        // 0:  Bitstream is encoded using the YCBCR format rules and tables

        // 1:  Bitstream is encoded using the RGB format rules and tables – only Compression IDs 1256, 1270

        UInt16  CLF; //Color Format

        // 0: ITU-R BT.709

        // 1: ITU-R BT.2020     - Non-constant Luma mapping

        // 2: ITU-R BT.2020 C   – Constant Luma mapping

        // 3: Out-of-band       – Color volume described out-of-band

        UInt16  CLV; // Color Volume

        // 0: Alpha channel not present 

        // 1: Alpha channel present

        UInt16  ALP; //Alpha flag (RI-only, shall be 0b for HD rasters)

        // 0: Alpha has not been applied to video channels

        // 1: Alpha has been applied to the video channels prior to encoding

        UInt16  PMA; //Pre-multiplied Alpha

    };

     

    struct resolutionTypeExtension {

        UInt32  idSize;         // 120

        OSType  extensionType;  // 'ARES'

        OSType  id;             // 'ARES'

        UInt32  version;        // '0001'

        UInt32  compressionID;

        UInt32  fieldWidth;

        UInt32  fieldHeight;

        UInt32  numFields;

        UInt32  numBlackLines;  // must be 0

        // 4: HD1080i

        // 5: HD1080P

        // 6: HD720P

        UInt32  videoFormat;

        UInt8  reserved[80]; // must be 0 

    };

    Unfortunately, there are no helpers for it. But nevertheless, I hope this helps.

    Best regards,

    Oleksii.

Page 1 of 1 (2 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller