0% found this document useful (0 votes)
23 views

Encoder Testing 25W - 14588 - 0

The document discusses testing digital encoders that compress video for digital television broadcasting. It focuses on issues encoder designers face when testing for compliance with the MPEG-2 standard and measurement solutions that help characterize and test encoders.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Encoder Testing 25W - 14588 - 0

The document discusses testing digital encoders that compress video for digital television broadcasting. It focuses on issues encoder designers face when testing for compliance with the MPEG-2 standard and measurement solutions that help characterize and test encoders.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Application Note

Encoder Testing

New Design Challenges Brought on by the Move to DTV


As broadcasters make the transition from exclusively analog video broadcasting to programming that
includes compressed digital video, digital encoder designers are faced with the need to understand the
MPEG-2 compression standard and the role it plays in designing robust MPEG equipment.

The MPEG-2 (ISO/IEC 13818) standard, finalized in 1994, includes Understanding the MPEG-2 standard
several sections on the system layer (Program and Transport MPEG-2 is today’s dominant digital compression standard because it
Stream) as well as a definition of the Elementary Streams (video, enables the delivery of high quality transmission of multiple programs
audio and data). in a single digital signal, and because it paves the way for high defi-
The standard was written for MPEG-2 decoders. There is no specifi- nition TV. Its compression algorithm is based on discrete cosine
cation for MPEG-2 encoders. This approach allows encoder designers transform (DCT) coding and interframe motion compensation. Today’s
to implement any design they want, as long as any MPEG-2 decoder encoders provide internal conversion from PAL or NTSC to a data
following the ISO/IEC 13818 standard can properly decode the output stream of 270 Mb/s, and/or have a direct SDI input. Using MPEG-2
of that design. While encoders are typically more complicated and compression, spatial and temporal redundancies within the moving
much more expensive than decoders, testing an encoder for compli- pictures are removed and the data stream is compressed to less
ance with the MPEG-2 standard is somewhat simpler than verifying a than 3 Mb/s. In addition, the audio is compressed down to less
decoder. It is not, however, a trivial task. than 400 kb/s.
This application note will focus on the particular issues encoder The output stream of an MPEG-2 audio or video encoder is called
designers face when testing for MPEG-2 compliance and the meas- an Elementary Stream (ES). An Elementary Stream can be broken
urement solutions Tektronix provides that streamline encoder charac- into convenient-sized data blocks in a Packetized Elementary
terization and testing. Stream (PES).

1 www.tektronix.com/video_audio
Encoder Testing
Application Note

These data blocks need header information to identify the start of the the decoder clock to the encoder clock, the SPTS is more common
packets and must include time stamps because packetizing disrupts than the PS.
the time axis. A TS is more than just a multiplex of audio and video PES. In addition
Figure 1 shows that video and audio PES can be combined to form a to the compressed audio, video and data, a TS includes a great deal
Program Stream (PS), provided the audio and video encoders are of metadata describing the bit stream. This includes the Program
locked to a common clock. Time stamps in each PES ensure lip-sync Association Table (PAT) that lists every program in the transport
between the video and audio. Program streams have variable length stream. Each entry in the PAT points to a Program Map Table (PMT)
packets with headers. They find use in data transfers to and from that lists the elementary streams making up each program. Some
optical and hard disks, which are error free and in which files of programs will be open, but some programs may be subject to
arbitrary sizes are expected. DVD uses program streams. conditional access (encryption) and this information is also carried
For transmission and digital broadcasting, several programs and their in the metadata.
associated PES can be multiplexed into a single Transport Stream (TS). The TS consists of fixed-sized data packets, each containing 188 bytes
A TS differs from a PS in that the PES packets are further subdivided (Figure 2). Each packet carries a packet identifier code (PID). Packets
into short fixed-size packets and in that multiple programs encoded in the same elementary stream all have the same PID, so the decoder
with different clocks can be carried. This is possible because a trans- (or demultiplexer) can select the elementary stream(s) it wants and
port stream has a program clock reference (PCR) mechanism that reject the remainder. Packet continuity counts ensure that every
allows transmission of multiple clocks, one of which is selected and packet that is needed to decode a stream is received. An effective
regenerated at the decoder. The ATSC standard, however, mandates synchronization system is needed so that decoders can correctly
that each picture frame be placed in a single PES. identify the beginning of each packet and deserialize the bit stream
A Single Program Transport Stream (SPTS) is also possible and may be into words.
found between an encoder and a multiplexer. Since a TS can genlock

Video Video Video


Packetizer
Data Encoder PES Program Program
Stream
MUX Stream
Audio Audio Audio (DVD)
Packetizer
Data Encoder PES

Elementary Single
Stream Transport Program
Stream
MUX Transport
Stream
Data

Figure 1: Encoding, packetizing, and multiplexing data flow.

2 www.tektronix.com/video_audio
Encoder Testing
Application Note

Testing for decodability errors overall bandwidth and efficiency of the transport stream under test.
The most critical error, with respect to the decodability of the encoded And its graphic and dynamic displays show the data rates,
signal, is loss of the transport stream sync. That is, the sync byte is percentage of use and global data information for each program,
missing (typically, because no signal is present). The sync byte always PID and the transport stream.
contains a value of hexadecimal 47 (decimal 71). Whenever an Other tests of decodability require that we take a closer look at the
unlocked MPEG-2 receiver reads its first 47h, it then expects another construction of the MPEG-2 transport stream. Referring again to
sync byte to arrive 188 bytes later. The number of consecutive packets Figure 2, transport stream segments of direct interest here are the
with good sync bytes required to achieve lock is device dependent, but packet ID (PID), the scrambling control field, the continuity counter
it typically ranges from two to six. Without these consecutive good and the payload. Because the payload of each packet is identified by
sync bytes, a receiving device cannot remain locked up with (synchro- its PID value, proper transmission of the PID is essential to decoding
nized to) the transmitted signal. the transport stream. Other referencing information that can be con-
The Tektronix MTS300 Multi-Standard MPEG Test System can be used tained in the payload relates PID values to specific programs in a
for real-time monitoring and analysis of the quality of the sync byte in transport stream.
the transport stream. It provides status-at-a-glance display of the

Transport Packet = 188 bytes

Sync Transport Payload Transport PID Transport Adaptation Continuity


Byte Error Unit Priority Scrambling Field Counter
Header Indicator Start Control
(4 bytes) Indicator

71 0 1 0 0 0 1 0
8 1 1 1 13 2 2 4

Payload

Program 0 PID 16 Program Association Table (PAT)


Program 1 PID 22
184 Program 3 PID 33
… …
Program k PID k
… …
PID = Packet ID

Figure 2: An MPEG-2 transport stream.

www.tektronix.com/video_audio 3
Encoder Testing
Application Note

In Figure 3, which continues in greater detail the referencing begun in Here, at the low level of reference that is the program map table, are
Figure 2, we see that PIDs can identify (“point to”) further sets of PIDs. the PIDs of the audio, video and data packets of that program (data
Program specific information is usually sent every 100 ms or so to packets traditionally comprised teletext but now also include web
ensure that any consumer can access any desired program as swiftly access information for internet access applications like WebTV). In
as possible after switching on, or after switching to a new TS. It also Figure 3, the program association table indicates that the PMT of pro-
ensures that consumer receivers are updated with any program gram 3 will arrive in a PID 33 packet. Upon consulting the table of PID
changes. An example of such a program change would be when a 33, the decoder sees that the video content for program 3 is in all the
channel switches from showing shopping-club programming to local- packets with a PID value of 19, and the audio is in all the packets with
area programming late at night. This information is indicated in the PID values of 81 and 82. Figure 3 shows how all these differently
program association table (PAT), which in fact is the top level of the functioning packets are carried in the transport stream by a time divi-
MPEG-2 transport stream hierarchy, and whose packet ID is always 0. sion multiplexing process.
This table lists all the programs in the transport stream and associates
each program with another PID, that of a packet with a program map
table (PMT) as its payload.

PID 0

Network Information
Table (NIT)
Program Association
Table (PAT)
Private
Program 0 PID 16 Network
Program 1 PID 22 Data
PID 22 Program 3 PID 33
… … PID 33
Program k PID k
… …
Conditional Access
Table (CAT)/EMM
Stream Type PID Program Map Stream Type PID
1 Video 54 1 Video 19 Conditional
Tables (PMT) PID 1
2 Audio 48 2 Audio 81 Access
3 Audio 49 3 Audio 82 Data
… … … … … …
k' Data k' k'' Data k''
… … … … … …

Header

Program 1 Program 3 Program 1 Program 3 Program 3 Program 3 Program 1 Program 3 Program 3


PAT CAT/EMM
PMT PMT Audio 1 Audio 2 Video 1 Video 1 Video 1 Audio 1 Video 1

PIDs 0 22 33 1 48 82 19 19 54 81 19
0 188 bytes
Transport Stream Packets PID = Packet ID
EMM = Entitlement Management Message

Figure 3: Audio, video, and data packets of an MPEG-2 transport stream.

4 www.tektronix.com/video_audio
Encoder Testing
Application Note

Figure 4 is a screen shot from the MTS300 MPEG-2 analyzer that counter, which increments with each successive packet for a particular
summarizes some of the elements of Figures 2 and 3. program. A continuity-count error occurs when successive counter
The hierarchical view on the top left presents a graphic view of every words contain the same count (indicating a repeated packet) more
component in the transport stream. It contains an icon for every than twice, or the count is out of order, or packets are lost.
stream component, enabling the designer to easily see how many pro- To test for PMT errors, recall that the program map table carries the
gram streams are present as well as the video and audio content of PID values of the packets containing the actual audio, video and data
each. Each icon represents the top layer of a number of lower analy- for a particular program. Like the PAT error, a PMT error occurs if the
sis and information layers. The analyzer creates the hierarchical view program map table comes too infrequently or its scrambling control
using the program association table (PAT) and the program map table field indicates that the table is scrambled (is not 0). This is not to say
in the program specific information (PSI) data of the transport stream. that the program cannot be scrambled – only that the table listing the
A check for PAT error is called for in our example. Recall that, once PID values of the audio and video elements may not be, by the rules
synchronized, decoders first look for PID 0, which the MPEG-2 stan- of MPEG-2.
dard reserves for the program association table. But if PID 0 fails to PID errors are the last of the critical decodability errors to test. When
occur often enough (at least every half second), or is missing the table a PID referred to in the program association table or program map
in its payload, or indicates that its contents are scrambled, a PAT error table does not occur within an expected, user-definable time interval, a
is flagged and the decoder will not be able to process the stream. PID error is flagged.
(Scrambling for each packet is indicated in the 2-bit scrambling con- As should be apparent, any one of these decodability error conditions
trol field shown in Figure 2.) is likely to prevent programs within a transport stream from being
Continuity-count errors are the next to be checked. Each packet of decoded at all, and therefore warrants continuous monitoring in
audio, video and data in a transport stream has its own continuity operational settings.

Figure 4: Hierarchical views of the packets in Figure 3 displayed on an MPEG-2 analyzer.

www.tektronix.com/video_audio 5
Encoder Testing
Application Note

Data monitoring axis, requiring that the remultiplexer update the PCR data.
Due to the increase in demand on accessing Internet services through Consequently, it is important to test for PCR jitter after the data is
cable and satellite communications, IP data monitoring has become an remultiplexed. The system graphically indicates the times at which
important issue. The Tektronix MTS300 real-time analyzer performs IP PCRs were received.
monitoring with detailed viewing of EN 301 192 (DVB Data Broadcasting) Further, each PCR can be opened to display the PCR data, as shown
tables, syntactic control of the tables with error reporting and the in Figure 6. To measure jitter, the analyzer predicts the PCR value by
ability to monitor data flow of the broadcast session. using the previous PCR and the bit rate to produce interpolated PCR,
Analyses performed include: or PCRI. The actual PCR value is subtracted from PCRI to give an
estimate of the jitter. The figure also shows the time since the
• Intra-PSI analysis
previous PCR arrived.
• Inter SI/PSI analysis (data broadcast descriptors)
• Consistence of data carousel
• TCP/IP session monitoring
Several new tables are now available within the hierarchical display.
Digital Storage Media Command and Control (DSM-CC) from ISO/IEC
13818-6 defines the following types: Multiprotocol encapsulation, U-N
messages, and Stream descriptors. EN 301 192 defines the following
tables: 1-layer Data carousel, Multi-protocol encapsulation, 2-layer
Data carousel, Data Piping, and Data Streaming. Figure 5 shows mul-
tiple DSM-CC elements along with their IP traffic sessions.

Timing analysis
To display real-time video and audio correctly, the transport stream
must also deliver accurate timing to the decoders. Correct transfer of
program clock data is critical because this data controls the entire tim-
Figure 6: Graphical representation of PCR data, overlaid with specific
ing of the decoding process. This task can be confirmed by analyzing information on one PCR.
the PCR (program clock reference) and time-stamp data.
PCR data from a multiplexer may be precise, but demultiplexing may
put the packets of a given program at a different place on the time

Figure 5: Multiple DSM-CC elements along with their IP traffic or information.

6 www.tektronix.com/video_audio
Encoder Testing
Application Note

An alternate approach, shown in Figure 7, provides a graphical display Audio-to-video delay


of PCR jitter and PCR repetition rate, which is updated in real time. Problems such as audio-to-video delay and non-unity gain through
(For more information on PCR jitter, see Tektronix’ PCR Jitter Primer, systems can seriously compromise the final image and sound of a TV
Literature Number 25W-14617-0.) broadcast and indicate interoperability issues may exist between
Once PCR data is known to be correct, the video and audio time stamps MPEG-compliant equipment from different manufacturers. Testing for
can be analyzed. Figure 8 shows a time-stamp display for a selected either of these problems at the system level can be performed with
elementary stream. The time of arrival, the presentation time, and, standard analog or digital baseband audio and video test gear. End-
where appropriate, the decode times are all shown. to-end system testing will not, however, indicate whether the encoder
or the decoder is the source of the problem.
To isolate the source of audio-to-video delay or I/O amplitude inequali-
ty, an MPEG-2 test generator like the Tektronix MTS300, MTG100 or
MTG300 must serve as the transport stream source. These instru-
ments replace the baseband audio/video generators routing the regular
programming through the encoder. Injecting test signals with known
characteristics at various points in the stream helps to determine
which system components are operating correctly and which are not.

Conclusion
Pioneering work in MPEG test and picture quality analysis makes
Tektronix the obvious choice when testing and evaluating MPEG-2
based encoder designs. As communications standards converge – with
audio, data, images and video merging in new networks – innovative
test equipment from Tektronix will ensure the integrity of the overall
Figure 7: Real-time graphical display of PCR jitter and repetition. information system. The powerful MTS300 Multi-Standard MPEG Test
System, MTG 100 and 300 MPEG Test Signal Generators, and the
PQA300 Picture Quality Analysis System make the characterization,
test and analysis task much more manageable for the digital designer,
while delivering the finest test performance available.

Figure 8: Details of time stamp information for a selected ES.

www.tektronix.com/video_audio 7
Encoder Testing
Application Note

Contact Tektronix:

ASEAN Countries (65) 356-3900

Australia & New Zealand 61 (2) 9888-0100

Austria, Central Eastern Europe, Greece,


Turkey, Malta & Cyprus +43 2236 8092 0

Belgium +32 (2) 715 89 70

Brazil and South America 55 (11) 3741-8360

Canada 1 (800) 661-5625

Denmark +45 (44) 850 700

Finland +358 (9) 4783 400

France & North Africa +33 1 69 86 81 81

Germany +49 (221) 94 77 400

Hong Kong (852) 2585-6688

India (91) 80-2275577

Italy +39 (2) 25086 501

Japan (Sony/Tektronix Corporation) 81 (3) 3448-3111

Mexico, Central America & Caribbean 52 (5) 666-6333

The Netherlands +31 23 56 95555

Norway +47 22 07 07 00

People’s Republic of China 86 (10) 6235 1230

Republic of Korea 82 (2) 528-5299

South Africa (27 11) 254-8360

Spain & Portugal +34 91 372 6000


For Further Information Sweden +46 8 477 65 00
Tektronix maintains a comprehensive, constantly expanding collec-
tion of application notes, technical briefs and other resources to Switzerland +41 (41) 729 36 40
help engineers working on the cutting edge of technology. Taiwan 886 (2) 2722-9622
Please visit “Resources For You” on our Web site at
www.tektronix.com United Kingdom & Eire +44 (0)1344 392000

USA 1 (800) 426-2200

For other areas, contact: Tektronix, Inc. at 1 (503) 627-1924

Copyright © 2001, Tektronix, Inc. All rights reserved. Tektronix products are covered by U.S. and
foreign patents, issued and pending. Information in this publication supersedes that in all previously
published material. Specification and price change privileges reserved. TEKTRONIX and TEK
are registered trademarks of Tektronix, Inc. All other trade names referenced are the service marks,
trademarks or registered trademarks of their respective companies.
04/01 FLG5594/XBS 25W-14588-0

8 www.tektronix.com/video_audio

You might also like