(1) Es-elementary Streams (Original stream), the encoding of video, audio signals and other data is compressed into the data stream called the original stream. The original stream includes the access unit, such as the video source stream's access unit is a pair of image encoding data.
(2) Pes-packetized Elementary Streams (the original stream of the group), the grouping of the original stream is called the PES grouping, is a data structure used to transmit the original flow
(3) The program is a collection of program elements. The program element may be the original stream, which has a common time base to do the synchronized display.
(4) The transfer stream and program stream Ts-transport stream are translated as "transfer stream" Ps-program stream to translate "program stream" PS to transmit and save coded or other data for a program. The component unit of PS is PES grouping. TS are used to transmit and save coded or other data for multiple programs, and TS are composed of programs. PS for environments that are not prone to errors, and applications involving software processing, typical applications such as DVD-ROM file storage ts are suitable for environments prone to errors, and typical applications are the transmission of digital TV signals. TS and PS can be converted to each other, such as extracting the contents of a program from a TS and producing a valid PS is possible.
(5) The transmission stream packet and the PES packet original stream are divided into many PES groupings, keeping the serial order, and an PES packet contains only one raw stream encoded data. The PES packet length is large and can be up to 64K bytes. The PES grouping is divided into "group header (header)" and "Payload (payload)". Payload refers to the byte following the header byte. The first 4 bytes of the header form the starting code for the grouping, identifying the type and ID number of the original stream to which the group belongs. TS grouping is the data packet formed by the transmission stream data. Each TS packet length is 188 bytes, including the group header and payload, and the first 4 bytes are the header of the group, which contains some information about the grouping. When you need more information in some cases, add the Adjust field (adaption field) later. The relationship between the two: the PES grouping is inserted into the TS Group, and the first byte of each PES packet header is the first byte of the TS packet payload. A TS grouping of PID values only carries data from a raw stream.
(6) PSI Full Name program specific information, meaning the special information. The transmission stream is multiplexing, so how do you know the location of these programs in the transmission stream, to distinguish between different programs. So we need some additional information, which is PSI. The PSI is also inserted into the TS Group, and their PID is a specific value. The MPEG-2 provides 4 PSI, including PAT (Program Association table), CAT (Conditional Access table), PMT (program map), NIT (Network Information table), which contains the necessary and sufficient information for multiplexing and display programs. Applications may include more information, such as DVB-T in the definition of SDT (Service Description table), EIT (Environmental information table), BAT (program group related tables), TDT (Time and date table), collectively referred to as DVB-SI (service information). The PSI PID is specific, and the data packets containing the PSI must periodically appear in the transport stream.
The PID for the grouping of PMT in the program map table is specified by Pat, so the PAT is first solved and PMT is solved. PMT contains the PID of the video, audio, and data raw streams that belong to the same program. With PMT, we can find the PID of each original stream of a program, and then get the original stream based on the original flow PID.
Pat (Program Association table) Programme associated table Pat Pid=0 The PAT lists the program flows that exist in the transport stream PAT specifies that the first data for each program in the transport stream that corresponds to the grouping of PMT is the Pidpat that specifies the PID in which the NIT is grouped, and other data specifies the PID in which the PMT is grouped.
The pid=1cat for the grouping of the Condition Control information (ECM) and the Conditional Management information (EMM) is listed in the Conditional for cat (Access table) conditional Access tables. Cat for program encryption and decryption NIT (Network information table) network information tables NIT the PID that is grouped by pat specifies that NIT provides information about a set of transport flows, as well as information related to the characteristics of the network itself, such as network name, transmission parameters (such as frequency, modulation method, etc.). NIT is generally used in decoder internal data, of course, can also do for the EPG a display data provided to users as a reference. The relationship between several psi, as shown in the following illustration: First PAT Specifies the program that exists in the transport stream, and the PID number of the PMT that corresponds to each program. For example, program 1 corresponding to the PMT pid=22, and then find the pid=22 TS grouping, to solve PMT, get the original flow of the show PID, and then according to the original flow of the PID to find the appropriate TS packet, get the original stream of data, and then can be sent to the decoder decoder.
Data structure (1) TS groupings mentioned earlier, TS groupings are composed of 188 bytes, the structure of which is as follows:
Transport_packet () {
Sync_byte//8
Transport_error_indicator//1
Payload_unit_start_indicator//1
Transport_priority//1 PID 13
Transport_scrambling_control//2
Adaptation_field_control//2
Continuity_counter//4
if (adaptation_field_control== ' | | | adaptation_field_control== ' 11 ') {
Adaptation_field ()
}
if (adaptation_field_control== ' | | | adaptation_field_control== ' 11 ') {
for (i=0;i<n;i++) {
Data_byte &nbs