QCP文件格式解析

General view of qcp subchunks

        <QLCM-form>
        RIFF( 'QLCM'
        <format chunk 'fmt'>                       // required
        [<variable rate chunk - 'vrat'>]           // required
        [<label chunk 'labl'>]                     // optional
        [<offsets in increments chunk - 'offs'>]   // optional

        <codec packet data chunk - 'data'>         // required
        [<configuration chunk - 'cnfg'>]           // optional
        [<text chunk - 'text'>]                    //  optional
        )

Detailed view of qcp subchunks

       RIFF 'QLCM' {
        BYTE[4] id    = {'R', 'I', 'F', 'F'}
        UINT32 size   = size of RIFF chunk excluding id and size
        BYTE[4]       = {'Q', 'L', 'C', 'M'}
   
        <format chunk - 'fmt '>  {
            BYTE[4] id     = {'f', 'm', 't', ' '}
            UINT32 size    = size of 'fmt ' subchunk excluding id and
                             size
            BYTE mjv       = major version of this format (see note 1)
            BYTE mnv       = minor version of this format (see note 1)
            struct type_qpl_info {
                struct GUID {
                    UINT32    Data1;
                    UINT16    Data2;
                    UINT16    Data3;
                    BYTE      Data4[ 8 ];
                } = Id;                          // unique ID of this
                                                 //    codec
                UINT16    Version;               // version # of the
                                                 //    codec
                BYTE      Name[80];              // proper name of the
                                                 //    codec
                UINT16    avgBitsPerSec;         // avg bps of the
                                                 //    codec
                UINT16    bytesPerPacket;        // size of a packet in
                                                 //    bytes (max rate)
                                                 // including header
                                                 //    byte for that
                                                 //    packet
                UINT16    samplesPerBlock;       // size of a block in
                                                 //    samples
                                                 // encoder encodes one
                                                 //    block into one
                                                 //    packet
                                                 // decoder decodes one
                                                 //    packet into one
                                                 //    block
                UINT16    samplesPerSec;         // sps of input needed
                                                 //    for the encoder
                                                 // and output from the decoder

                UINT16    bitsPerSample;         // bits per sample of
                                                 //    the above
                // contains rate header format info
                struct type_qpl_variable_rate {
                    UINT32    numOfRates;         // # of rates
                    // high byte = rate, low byte = size of following
                    // packet
                    UINT16    bytesPerPacket[8];
                } = variableRate;
   
                UINT32    reserved[5];            // reserved
            } = codec info
        }  
        <variable rate chunk - 'vrat'> {
            BYTE[4]   id         = {'v', 'r', 'a', 't'}
            UINT32    size       = size of 'vrat' subchunk excluding id and size
            UINT32    variableRate;
                // if ( == 0 ) packet data is fixed rate
                // else if ( < 0xFFFF0000 ) variable rate
            UINT32    sizeInPackets;
                // the data chunk size in packets
        }
        [<label chunk - 'labl'>]  // see Optional chunks
        [<offsets in increments chunk - 'offs'>] // see Optional chunks
        <codec packet data chunk - 'data'> {
            BYTE[4] id    = {'d', 'a', 't', 'a'}
            UINT32 size   = size of 'data' subchunk excluding id and size
            BYTE[ ]       = actual packet data (see note 2)
        }
        [<configuration chunk - 'cnfg'>] // see Optional chunks  
        [<text chunk - 'text'>]          // see Optional chunks
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值