[Live-devel] where can I find a specification of ADTS header?

Neeraj Prasad neeraj.prasad at gmail.com
Tue Aug 25 10:03:04 PDT 2009


The ADTS header is defined below -
    unsigned int obj_type = 0;
    unsigned int num_data_block = frame_length / 1024;

    // include the header length also
    frame_length += 7;
    /* We want the same metadata */
    /* Generate ADTS header */
    if(adts_header == NULL) return;
    /* Sync point over a full byte */
    adts_header[0] = 0xFF;
    /* Sync point continued over first 4 bits + static 4 bits
    * (ID, layer, protection)*/
    adts_header[1] = 0xF1;
    /* Object type over first 2 bits */
    adts_header[2] = obj_type << 6;
    /* rate index over next 4 bits */
    adts_header[2] |= (rate_idx << 2);
    /* channels over last 2 bits */
    adts_header[2] |= (channels & 0x4) >> 2;
    /* channels continued over next 2 bits + 4 bits at zero */
    adts_header[3] = (channels & 0x3) << 6;
    /* frame size over last 2 bits */
    adts_header[3] |= (frame_length & 0x1800) >> 11;
    /* frame size continued over full byte */
    adts_header[4] = (frame_length & 0x1FF8) >> 3;
    /* frame size continued first 3 bits */
    adts_header[5] = (frame_length & 0x7) << 5;
    /* buffer fullness (0x7FF for VBR) over 5 last bits*/
    adts_header[5] |= 0x1F;
    /* buffer fullness (0x7FF for VBR) continued over 6 first bits + 2 zeros
     * number of raw data blocks */
    adts_header[6] = 0xFA;

    // set the num_data_block

On Tue, Aug 25, 2009 at 5:39 PM, Steve Jiekak <devaureshy at gmail.com> wrote:

> Do somebody know where I can find a document where
> the header format for ADTS is described??
>
> Thanks,
> Steve
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
>


-- 
~neeraj

'Smoke like a hippie, drink like a pirate and code like a hacker' :D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20090825/ab44bf01/attachment.html>


More information about the live-devel mailing list