CLPI file:

    4 bytes == 0x48444D56 ("HDMV" in hex)
    4 bytes == 0x30323030 ("0200" in hex, version number? VLC checks 0100 too)
    32-bit BE uint - offset to Sequence entry (seq_offset)
    32-bit BE uint - Program entry (pgm_offset)
    32-bit BE uint - CPI start (cpi_offset)
    32-bit BE uint - Mark start (mark_offset)
    32-bit BE uint - Extension start (ext_offset)

Sequence struct, @ offset 'seq_offset':

    32-bit uint /* Sequence entry length */
    1 byte - unknown (ID?)
    1 byte - ATC sequence count (From VLC: MUST be 1?)
    32-bit uint - ATC start (From VLC: MUST be 0)
    1 bytes - Number of STC entries following - n_stc
    1 bytes - STC ID offset (from VLC: Must be 0?)
    Followed by n_stc entries of STC entry.

STC entry:
    16-bit BE uint - PCR PID
    32-bit BE uint - Packet at which to set STC start
    32-bit BE uint - First PTS. shift left 1 bit to get 33 bit PTS
    32-bit BE uint - End PTS. shift left 1 bit to get 33 bit PTS
    
Program entry (@ pgm_offset)
    32-bit uint /* Program entry length */
    1 byte - unknown (ID?)
    1 byte - n_pgm_entries; count of program entries (from VLC: must be 1?)
    32-bit BE uint - offset to program sequence start (pgm_seq_offset)
    16-bit BE uint - PMT PID
    1 byte - stream entry count (n_stream_entry)
    1 byte - group count (VLC says: Must be 1?)
    followed by n_stream_entry instances of Stream Entry

Stream entry:
    16-bit BE - PID
    1 byte - length
    1 byte - Type
    remainder... unknown

CPI table (@cpi_offset):
    32-bit BE uint - CPI table size (may be 0)
    12-bit BE uint - unknown
    4 bit - Type (From VLC: Must be 1)
    Followed by EP map

EP map:
    - location ep_map used as base for coarse table offset
    1 byte unknown
    1 byte - n_epmap_entries
    n epmap_entry:
        16-bit BE uint - PMT PID     
        10-bits unknown
        4-bits - Type
        16-bits - Coarse - n_coarse_entries
        18-bits - Fine - n_fine_entries
        32-bits - Coarse table offset (coarse_table_offset relative to ep_map)
        
@ coarse table offset:
    - location ep_map_coarse used as base for fine table offset
    32-bit BE uint - relative offset to fine table
    n_coarse_entries of:
        18 bits - first_fine_idx, first entry in the fine table for this coarse
        14 bits - PTS - (VLC uses (PTS & ~1) << 19 as top bits of PTS)
        32 bits - packet (VLC uses (packet & ~((1<<17)-1) as top bits of packet)

@ fine table offset:
    1 bit - angle switch point marker
    3 bits - unknown (VLC says I end position offset)
    11 bits - PTS. PTS << 9 = lower 20 bits of PTS
    17 bits - packet num. Lower 17 bits of packet to seek to

