PSI table 如何在TS 中傳輸的

Transport Stream packets shall be 188 bytes long.(日本的ISDB 規範使用204 bytes)

MPEG_transport_stream() {

    do 

    { 

        transport_packet()
    } while (nextbits() == sync_byte)
}


transport_packet(){
    sync_byte  (8 bslbf)
    transport_error_indicator (1 bslbf)
    payload_unit_start_indicator  (1 bslbf)
    transport_priority (1 bslbf )

     PID (13 uimsbf)
    transport_scrambling_control (2 bslbf)
    adaptation_field_control (2 bslbf )

    continuity_counter ( 4 uimsbf )

    if(adaptation_field_control=='10' || adaptation_field_control=='11'){ 

            adaptation_field() 

    }
    if(adaptation_field_control=='01' || adaptation_field_control=='11') {
            for (i=0;i<N;i++){ 

                data_byte (8 bslbf )

             } 

     }

}

sync_byte -- The sync_byte is a fixed 8 bit field whose value is '0100 0111' (0x47).


PSI(Program specific information)  用於解複用TS 中的節目(一個節目有一個或多個ES 流組成)。

In order to successfully demultiplex a program, the decoder must be notified of both the transport_stream_id(to find the right multiplex) and the program_number of the service(to find the right program within the multiplex).


PSI 不會被加密:

Programs, elementary streams or parts thereof may be scrambled for conditional access. However, Program Specific Information shall not be scrambled.


在TS中,PSI 信息分爲4個表,PAT(Program Assocation Table),  PMT(Program Map Table), CAT(Conditional Access Table), NIT(Network Information Talbe)


PSI 表被分成一個或多個section在TS 中傳輸:

PSI tables shall be segmented into one or more sections that are carried within transports packets.


和PSI table 一起,在TS中還可能傳輸私有數據表(private data tables):

Along with ITU-T Rec. H.222.0 | ISO/IEC 13818-1-defined PSI tables, it is possible to carry private data tables.


If the private data is carried in Transport Stream packets with the same PID value as Transport Stream packets carrying Program Map Tables, (as identified in the Program Association Table), then the private_section syntax and semantics shall be used. The data carried in the private_data_bytes may be scrambled. However, no other fields of the private_section shall be scrambled. This private_section allows data to be transmitted with a minimum of structure.

The Network Information Table is optional and its contents are private. The NIT is a private table.


Section 可能是變長的,一個section的開始由TS 有效負載中的pointer_field 指示.

Sections may be variable in length. The beginning of a section is indicated by a pointer_field in the Transport Stream packet payload.


pointer_field -- This is an  8-bit field whose value shall be the number of bytes, immediately following the of the pointer_field until the first byte of the first section that is present in the payload of the Transport Stream packet (so a value of  0x00 in the pointer_field indicates that the section starts immediately after the pointer_field). When at least one section begins in a given Transport Stream Packet,  then the payload_unit_start_indicator shall be set to 1 and the first byte of the payload of that transport Stream packet shall contain the pointer. When no section begins in a given Transport Stream packet , then the payload_unit_start_indicator shall be set to 0 and no pointer shall be sent in the payload of that packet.


PSI table 最大的section 不會超過1024 bytes. 私有section 不超過4096 bytes.

對於超過1024 bytes 的超大section 在13818 附錄C Allocation of program_number 中有做說明, 這種情況,一個節目會有多個program_number(也即service_id)

(In general, though, a broadcaster may prefer to logically split up the Transport Stream into several programs, where the PCR_PID (location of the clock reference) is always the same)

section_number (8 uimsbf), last_section_number(8 uimsbf) 用於判斷是否已經接收到一個完整的section.

總結:PSI 的各個table 使用相應的section 格式,然後封裝在TS 的payload 中傳輸;一個section的開始,由pointer_field 指示。

section 中的 current_next_indicator 標記當前收的section是否可用.(current_next_indicator -- A 1 bit indicator, which when set to '1' indicates that the Program Association Table sent is currently applicable. When the bit is set to '0', it indicates that the table sent is not yet applicable and shall be the next table to become valid.)




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章