Chapter 7. MPEG-2 SYSTEM LAYER


 

7.0 Introduction

7.1 MPEG-2 Elementary Stream

7.2 MPEG-2 Packetized Elementary Stream

7.3 MPEG-2 Program Stream

7.4 MPEG-2 Transport Stream

 


 

7.0 Introduction

The compressed image and video data is stored and transmitted in a standard format known as a compression stream. The discussion in this section will be restricted exclusively to the presentation of the video compression stream standards associated with the MPEG-2 systems layer: elementary stream (ES), packetized elementary stream (PES), program stream (PS), and transport stream (TS)

            The MPEG-2 systems layer is responsible for the integration and synchronization of the elementary streams (ES): audio and video streams, as well as an unlimited number of data and control streams that can be used for various applications such as subtitles in multiple languages. This is accomplished by first packetizing the ESs thus forming the packetized elementary streams (PES). These PESs contain timestamps from a system clock for synchronization.

 

Figure 1: MPEG-2 Audio and Video Systems Layer

            The PESs are subsequently multiplexed to form a single output stream for transmission in one of two modes: program stream (PS) and transport stream (TS). The PS is provided for error-free environments such as storage in CD-ROM. It is used for multiplexing PESs that share a common time-base, using long variable-length packets.[1] The TS is designed for noisy environments such as communication over ATM networks. This mode permits multiplexing streams (PESs and PSs) that do not necessarily share a common time-base, using fixed-length (188 bytes) packets. An example of the MPEG-2 systems layer illustrating the multiplexing of the packetized audio and video elementary streams is depicted in Fig. 2

7.1 MPEG-2 Elementary Stream

As indicated earlier, MPEG-2 systems layer supports an unlimited number of elementary streams (ES). Our focus is centered on the presentation of the ES format associated with the video stream. The structure of the video ES format is dictated by the nested MPEG-2 compression standard: video sequence, group of pictures (GOP), pictures, slices, and macroblocks. The video ES is defined as a collection of access units (pictures) from one source. An illustration of the video ES format is depicted in Fig. 2. A corresponding glossary of the video ES format is provided in Table 1. Note that the unshaded segment of the video ES format presented in Fig. 2 is used to denote that any permutation of the fields within this segment can be repeated as specified by the video compression standard.

 

SH

 

 

SE

 

EUD0

 

GOPH

 

 

EUD1

 

PH

 

PCE

 

EUD2

 

PDS

 

SDMB

 

 

SE

 

 

Figure 2: Video Elementary Stream Format

Abbr

Function

SH

Sequence Header

SE

Sequence Extension

EUD0

Extension and User Data 0

GOPH

Group Of Picture Header

EUD1

Extension and User Data 1

PH

Picture Header

PCE

Picture Coding Extension

EUD2

Extension and User Data 2

PDS

Picture Data containing Slices

SDMB

Slices Data containing Macro-Blocks

SE

Sequence End

Table 1: Video Elementary Stream Format Glossary

7.2 MPEG-2 Packetized Elementary Stream

The MPEG-2 systems layer packetizes all ESs---audio, video, data, and control streams---thus forming the packetized elementary streams (PES). Each PES is a variable-length packet with a variable format that corresponds to a single ES.

            The format of the PES header is defined by the stream ID (SID) used to identify the type of ES. The PES packet length (PESPL) indicates the number of bytes in the PES packet. The scrambling mode is represented by the scrambling control  (SC). The PES header data length (PESHDL) indicates the number of bytes in the optional PES header (OPESH) fields, as well as stuffing bytes (SB) used to satisfy the communication network requirements.

            The PES header contains timestamps to allow for synchronization by the decoder. Two different timestamps are used: presentation timestamp (PTS) and decoding timestamp (DTS). The PTS specifies the time at which the access unit should be removed from the decoder buffer and presented. The DTS represents the time at which the access unit must be decoded. The DTS is optional and it is only used if the decoding time differs from the presentation time.[2]

            The elementary stream clock reference (ESCR) indicates the intended time of arrival of the packet at the system target decoder (STD). The rate at which the STD receives the PES is indicated by the elementary stream rate (ESR). Error checking is provided by the PES cyclic redundancy check (PESCRC).

The pack header field (PHF) is a PS pack header. The program packet sequence counter (PPSC) indicates the number of system streams. The STD buffer size is specified by the P-STD buffer (PSTDB) field.

A nested representation of the PES header is depicted in Fig. 3. The corresponding glossary of the PES header is provided in Table 2. Note that the unshaded boxes presented in Fig. 3are used to represent optional fields in the PES header.

 

PSCP

 

 

SID

 

PESPL

 

OPESH

 

 

SB

 

Primary PES Header

 

10

 

 

SC

 

P

 

DAI

 

C

 

O/C

 

Flags

(7)

 

PESHDL

 

OF1

 

Optional PES Header

 

PTS/

DTS

 

ESCR

 

ESR

 

DSMTM

 

ACI

 

PESCRC

 

PESE

 

Optional Fields 1

 

Flags

(5)

 

OF2

 

PES Extension

 

PESPD

 

PHF

 

PPSC

 

PSTDB

 

PESEF

 

Optional Fields 2

Figure 3: PES Header

Abbr

Function

PSCP

Packet Start Code Prefix

SID

Stream Identification

PESPL

Packetized Elementary Stream Packet Length

OPESH

Optional Packetized Elementary Stream Header

SB

Stuffing Bytes

SC

Scrambling Control

P

Priority

DAI

Data Alignment Indicator

C

Copyright

O/C

Original/Copy

Flags (7)

7 Flags

PESHDL

Packetized Elementary Stream Header Data Length

OF1

Optional  Fields 1

PTS/DTS

Presentation Time-Stamps / Decoding Time-Stamps

ESCR

Elementary Stream Clock Reference

ESR

Elementary Stream Rate

DSMTM

DSM Trick Mode

ACI

Additional Copy Information

PESCRC

Packetized Elementary Stream Cyclic Redundancy Check

PESE

Packetized Elementary Stream Extension

Flags (5)

5 Flags

OF2

Optional Fields 2

PESPD

Packetized Elementary Stream Private Data

PHF

Pack Header Field

PPSC

Program Packet Sequence Counter

PSTDB

P-STD Buffer

PESEF

Packetized Elementary Stream Extension Field

Table 2: PES Header Glossary

7.3 MPEG-2 Program Stream

A program stream (PS) multiplexes several PESs, which share a common time-base, to form a single stream for transmission in error-free environments. The PS is intended for the storage and retrieval of programs from digital storage media such as CD-ROM. The PS uses relatively long variable-length packet. For a more detailed presentation of the MPEG-2 PS refer to X.

7.4 MPEG-2 Transport Stream

A transport stream (TS) permits multiplexing streams (PESs and PSs) that do not necessarily share a common time-base for transmission in noisy environments. The TS is designed for broadcasting over communication networks such as ATM networks. The TS uses small fixed-length packets (188 bytes) that make them more resilient to packet loss or damage during transmission. The TS provides the input to the transport layer in the OSI reference model.[3]

            The TS packet is composed of a four-byte header followed by 184 bytes shared between the variable-length adaptation field and the TS packet payload. An illustration of the TS header is depicted in Fig. 4. The corresponding glossary of the TS header is provided in Table 3. Note that the unshaded box appearing in Fig. 4 is used to represent the optional adaptation field (AF).

 

SB

 

 

TEI

 

PUSI

 

TSC

 

TP

 

PID

 

AFC

 

CC

 

AF

 

Figure 4: TS Header  

Abbr

Function

SB

Synchronization Byte

TEI

Transport Error Indicator

PUSI

Payload Unit Start Indicator

TSC

Transport Scrambling Control

TP

Transport Priority

PID

Packet Identifier

AFC

Adaptation Field Control

CC

Continuity Counter

AF

Adaptation Field (Optional)

Table 3: TS Header Glossary

The TS header includes a synchronization byte (SB) designed for detection of the beginning of each TS packet. The transport error indicator (TEI) points to the detection of an uncorrectable bit error in this TS packet. The payload unit start indicator (PUSI) is used to ascertain if the TS payload contains PES packets or program-specific information (PSI). The packet ID (PID) identifies the type and source of payload in the TS packet. The presence or absence of the adaptation field (AF) and payload is indicated by the adaptation field control (AFC). The continuity counter (CC) provides the number of TS packets with the same PID, which is used to determine packet loss.

            The optional adaptation field (AF) contains additional information that need not be included in every TS packet. One of the most important fields in the AF is the program clock reference (PCR). The PCR is a 42-bit field composed of a 9-bit segment incremented at 27 MHz as well as a 33-bit segment incremented at 90 KHz.[4] The PCR is used along with a voltage controlled oscillator as a time reference for synchronization of the encoder and decoder clock.

A PES header must always follow the TS header and possible AF. The TS payload may consist of the PES packets or PSI. The PSI provides control and management information used to associate particular ESs with distinct programs. A program is once again defined as a collection of ESs that share a common time-base. This is accomplished by means of a program description provided by a set of PSI associated signaling tables (AST): program association tables (PAT), program map tables (PMT), network information tables (NIT), and conditional access tables (CAT). The PSI tables are sent periodically and carried in sections along with cyclic redundancy check (CRC) protection in the TS payload.

 

I Picture

 

 

P Picture

 

 

P Picture

 

Elementary Stream (ES)

 

PES

Header

 

I Picture

 

 

 

 

PES

Header

 

P Picture

 

Packetized Elementary Stream (PES)

0                                187B      0                                    187B       0                              187B

 

TS

Header

 

PES Data

 

 

TS

Header

 

PES Data

 

 

TS

Header

 

PES

Data

 

Stuffing

 

Transport Stream (TS)

Figure 5: TS Packets

An example illustrating the formation of the TS packets is depicted in Fig. 5. The choice of the size of the fixed-length TS packets---188 bytes---is motivated by the fact that the payload of the ATM Adaptation Layer-1 (AAL-1) cell is 47 bytes. Therefore, four AAL-1 cells can accommodate a single TS packet. A detailed discussion of the mapping of the TS packets to ATM networks is presented in the next section.

 


[1] The MPEG-2 program stream (PS) is similar to the MPEG-1 systems stream.

[2] This is the situation for MPEG-2 video elementary stream profiles that contain B-Pictures.

[3] The transport stream  (TS), however, is not considered as part of the transport layer.

[4] The 33-bit segment incremented at 90 KHz is compatible with the MPEG-1 system clock.