Diigopost: Protected: What To Read For Set-Top-Box Interview?

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

diigopost

H O LM I E N U XE N G A L B I O S U H T

C O M M A N D S

Search
Category Archives: set-top-box
Recent Posts
AUGUST 16, 2015 · 10:25
Time complexity in algorithms
AM
Ajax
PHP-2
Protected: What to read for Set-top- PHP

box interview? Design Pattern

This content is password protected. To view it please enter your password


below:
Archives
November 2016 (1)
Password: Enter March 2016 (2)
February 2016 (1)
December 2015 (2)
November 2015 (4)
October 2015 (4)
September 2015 (1)
August 2015 (6)
July 2015 (4)
June 2015 (12)
May 2015 (9)
April 2015 (16)
March 2015 (11)
February 2015 (2)
Report this ad
December 2014 (1)

July 2014 (2)


June 2014 (1)
May 2014 (1)
April 2014 (4)
March 2014 (4)
February 2014 (5)
December 2013 (1)
June 2013 (2)
November 2009 (1)

Report this ad
Categories
algorithms (3)
Filed under set-top-box Enter your password to view comments.
android (2)
Tagged as set-top-box
C++ (6)
debug (4)
decoder (1)
APRIL 14, 2015 · 11:21
design pattern (1)
AM
device driver (2)
inspiration (1)
Set top box+ kernel (15)
linux (7)
Tuner- operating system (1)
puzzle (1)
Tuner received signal from physical transmission medium,once signal received
set-top-box (2)
tuner isolate a physical channel from a multiplex of channel and convert to
shell (1)
baseband ( I think baseband means remove carrier freqency and get orignal
base band frequency). what it do it lock on a specific frequency and take single stagefright (1)

physical channel which have MPTS like DD_Channel broadcast on xxxx Uncategorized (61)

frequency and it has 5-10 channel (MPTS) like


DD_1,DD_News,DD_bharti,DD_Sport. and Zee broadcast its channel on a
different frequency yyyy which has a bookey (MPTS)of 5-6 channel like zee TV,
zee cinema, zee classic. so thats why when we do zap between zee to DD it
requrired between two different frequencies.

Demodulator-
Demodulator receive single MPTS signal from tuner and convert it to digital
binary signal, also check for stream error. after this signal is forwarded to
demultiplexer.

Blitter-
A blitter is capable of copying large quantities of data from one memory area to
another relatively quickly, and in parallel with the CPU, whilst freeing up the
CPU’s more complex ISA for more general operations.

Today the vast majority of set top boxes have a blitter – a hardware device for
doing DMA copies of memory with some small combinatorial functions (for
blending). The blitter can copy memory from one or more sources, combine the
data and write to one destination. It can also scale the output. Speeds of copying
are high at scale factors of 1.0 and slower at other scale factors. It is thus easy
and fast to copy whole screens now at high refresh rates. Companies with
graphics libraries for set top boxes compiled their libraries with the blitter drivers
enabled and allowed images and filled boxes to be drawn quickly.

Note from wiki [do my company still use blitter or GPU]

Blitters have been replaced by the modern graphics processing unit. Modern Report this ad

GPUs are designed primarily for 3D graphics, and have added the ability to
modify bitmaps in mathematically advanced ways, allowing arbitrary image
transformations, texture decompression and filtering, shading for illumination
models, alpha blend compositing operations, and depth-buffer
comparison/update.

Memory-
A set-top box may have both SRAM or DRAM/SDRAM or if it is less cost than it
only has DRAM as it is cheap. SRAM will be used to support time critical tasks
such as MPEG processing and DRAM for interactive applications.

Note – SRAM (Static RAM) is faster than DRAM(Dynamic RAM) DRAM require
constantly refersh to retain the data so required more power. Structurally, SRAM
needs a lot more transistors in order to store a certain amount of memory. A
DRAM module only needs a transistor and a capacitor for every bit of data
where SRAM needs 6 transistors. Because the number of transistors in a
memory module determine its capacity, a DRAM module can have almost 6
times more capacity with a similar transistor count to an SRAM module. This
ultimately boils down to price, which is what most buyers are really concerned
with.
The most prominent use of SRAM is in the cache memory of processors where
speed is very essential, and the low power consumption translates to less heat
that needs to be dissipated. Even hard drives, optical drives, and other devices
that needs cache memory or buffers use SRAM modules.

Read more: Difference Between SRAM and DRAM | Difference Between |


SRAM vs DRAM http://www.differencebetween.net/technology/difference-
between-sram-and-dram/#ixzz3i2ybe8qn

Smart_card-
It is responsible for CA control and placed between DEMOD –>smartCard–
>DEMUX

Demux
An MPEG2 DeMux accepts the digital stream output from the A/D converter, and
extracts the system clock reference from the pack header. Using a function that
measures progress, the system reference clock is reported. All of the above
information is stored in a table that is updated as new stream IDs are found. A
progress report is sent to notify the application, which in turn either pre-
determines what elementary streams needs to be sent to the audio and video
decoders, or selects the stream on the fly using the progress
report’s information.

Flow of data in set-top box

The tuner receives modulated digital transmission from the antenna and passes
it on to the demodulator. This demodulator takes into account the type of
demodulation (like QPSK ) and forward error correction to give out a transport
stream, which is a digital stream of bytes known as data packets. According to
DVB standards, a transport stream is of the size of 188 bytes. It then goes into
the demux where the content is separated in audio/video packetised elementary
stream (PES) and data packets known as sections, as per DVB standards. PES
is a mechanism to carry audio/video elementary streams in packet format inside
an MPEG-2 transport stream.Sections are the data packets containing
information regarding the audio/video content and other metadata. Once the
demux does its job, audio/video is sent to MPEG-2/MPEG-4 decoder which
gives the output to the RF port to display the video on television. The data
packets are sent to the processor used by the STB software to enable viewing.
This data can be persistent or kept in RAM as per the needs and performance.
Any kind of user request, be it tuning or a purchase, goes through the CPU. In
between, the most important functionality of descrambling is performed by a
descrambler embedded inside the ICAM part of the chipset. In some variants of
STBs, a descrambler can be a part of a decoder, or it can exist independently
Between Demod and Demux. The descrambler takes care of decrypting the
encrypted transport stream using the control word technique. Generally, these
descramblers and control word algorithms are closely-guarded secrets with CA
solution providers to prevent hackers from decrypting the signal. These are
developed in conjunction with chipset vendors in a very secured environment.

As mentioned earlier, the most important part in an STB design is ICAM or CA


module, which is responsible for the viewer’s access to the content available on
air. It maintains all the transactions and performs validations to check the
entitlement of the viewer to selected programme. ICAM module consists of
Entitlement Control Message (ECM) and Entitlement Manage ment Message
(EMM) acquisition and management, descrambler and smart card interface.
ECMs and EMMs are the ways of communication used by broadcaster to an
STB. Smart card interface provides access to secured information like
passwords, parental lock information, purchase information and all other kinds of
transactional details. The most important part is the descrambler that uses the
secure control word to descramble the video. It is the key to enable the video to
be decoded. The input transport stream is sent to descrambler as an input
having a specific parity. Depending on this parity, respective control word is
generated and used to descramble the video. The descrambling is done in
hardware due to performance and security reasons. Doing it in hardware does
not expose the control word beyond silicon and it does it much faster without
stopping the input stream.

Click on this link for More details of


Demuxer-
Set Top Box (STB) is an instrument which converts the transmitted digital video
signals to the data or the signals which can be displayed on the standard LCD,
LED and Analogue TVs. Front end in STB consists of Tuner and Demodulator.
The hardware configuration of all DVB-receivers is same except for
demodulator, which is different for different DVB receivers as their transmission
schemes are different.

Major modules in the STB are Demodulator, Descrambler, CA Module, MPEG-2


Transport Stream De-multiplexer, MPEG-2 Decoder, CPU and Modem. STB is
tuned to select one of the appropriate frequency from the multiple frequencies
present in the space. Depending upon the transmission schemes the
demodulator will be different. Demodulator converts the RF signal into the
original signal. Output of the demodulator is MPEG-2 transport stream.
When an MPEG-2 TS carries encrypted (or scrambled) services, the TS also
carries two types of messages called EMM (Entitlement Management Message)
and ECM (Entitlement Control Message).

An EMM carries a list of Pay TV services which the owner of that STB is entitled
to view and also the date up to which he is entitled to receive them.

The ECM on the other hand carries a data element called control word (CW),
which is used by the descrambler in the STB to descramble the picture and
make it intelligible again. Both these messages are carried in the TS in an
‘encrypted’ form.

The MPEG-2 syntax enables broadcasters to transmit proprietary Conditional


Access information in the transport stream in the form of Entitlement
Management Messages (EMMs). EMMs update the subscription options or pay-
per-view rights for each subscriber or for groups of subscribers. The Conditional
Access Table (CAT) tells the decoder where to find EMMs in the transport
stream by listing the PID value for the packets containing each EMM. The CAT is
always found on PID 0x0001.

Since we may not want to give our content away for free, we need some way of
encrypting our services. This is handled by the conditional access (CA) system.
The algorithm that is used for this is proprietary to each Vendor. In a DVB
system, scrambling can work at either the level of the entire transport stream or
on the level of individual elementary streams. In the case of scrambled
elementary streams, not all of the data is actually scrambled – the packet
headers are left unscrambled so that decoders can work out their contents and
handle them correctly. In the case of transport stream scrambling, only the
headers of the transport packets are left unencrypted – everything else is
scrambled.

As well as an encrypting the data that’s supposed to be encrypted, the CA


system adds two types of data to the stream. These are known as CA
messages, and consist of Entitlement Control Messages (ECM) and Entitlement
Management Messages (EMM). These control the ability of individual or group
of users to watch scrambled content. The scrambling process relies on three
pieces of information: The Control Word The Service Key The User Key

Decoding with PSI Tables

The following steps outline the process followed by a decoder to display a


certain program, in this case Program 1: Create the PAT. To do this, extract the
contents of packets with PID=0x0000 and build the PAT. Read the PAT to
identify the PID of the packets carrying the PMT for Program 1. The PAT shows
the PMT PID for Program 1 is on PID=0x0065. Extract the contents of the
packets with PID=0x0065 and build the PMT. Read the PMT for Program 1 to
find the PIDs that identify the audio and video packets and PCR for Program 1.
The PMT shows the video to be in packets with PID=0x0131, the German audio
in packets with PID=0x0132 and the English in packets with PID=0x0133. In
most cases, the PID for the video stream also carries the PCR.

In the PMT, find the ECM PID for Program 1. The PMT shows the ECM to be in
packets with PID=0x0150. Locate packets with PID=0x0150 and extract the
ECM for Program 1. Extract the video for Program 1 from packets with
PID=0x0131. If the user has selected the German sound track, locate and extract
the audio track from packets with PID=0x0132. If the user has requested the
English sound track, locate and extract the audio from packets on PID=0x0133.
Using the ECM on PID=0x0150, descramble the video and audio for Program 1.
Assemble the video and audio into PESs. Use the DTS and PTS in the header of
each PES packet to determine when to decode and present the packet’s
contents to the viewer.

MPEG-2

MPEG-2 was developed as a frame- or field-based standard that allows digital


broadcasting applications to deliver multiplexed programs efficiently.

MPEG-2 is a set of standards for building a single digital transport stream, or


multiplex, which can carry more number of programs, depending upon the level
of compression used and the communications bandwidth available.

MPEG standard covers rules for:

Compressing audio and video content

Transporting the multiplex across a network

Encapsulating data into the multiplex.

What the MPEG-2 standard does not regulate is the handling of multiple
transport streams simultaneously.

Because a set-top box, or Integrated Receiver Decoder (IRD), operating in a live


network environment must be able to manage several transport streams
simultaneously, extensions to the MPEG-2 system layer were developed by
Digital Video Broadcasting (DVB) and Advanced Television Systems Committee
(ATSC).

MPEG-2 Video Compression


Once video content is digitized, compression can begin.

Video compression takes advantage of the considerable redundancy that exists


within each video frame and between consecutive frames.

There are two main types of MPEG video compression, spatial encoding and
temporal encoding. Spatial Encoding eliminates redundancy between adjacent
pixels in a video frame. It also makes use of the eye’s inability to detect certain
visual degradations including noise in a “busy” picture area.

Spatial encoding relies on similarities between adjacent pixels in plain areas of a


picture. For instance, a picture that contains a blue sky background will likely
contain several rows identical blue pixels. Spatial encoding can code only one
set of these pixels and then indicate that the rest are identical, thus eliminating
redundant data from the bit stream.

The spatial encoding process involves the following steps:

Discrete Cosine Transform (DCT)

Quantization

Weighting

Scanning

Entropy coding

Discrete Cosine Transform (DCT) divides a picture into blocks of 8×8 pixels then
transforms the pixel intensities into a series of frequency-based values, or
coefficients. Because of spatial redundancy, many of the coefficients end up with
zero or near-zero values. These can be dropped from the series of coefficients
so the video frame is expressed in as few bits as possible.

Sometimes, however even greater compression is needed, so the word length of


the remaining coefficients must be expressed in even fewer bits.

Following DCT, the video frame is quantized, meaning that coefficients are
reorganized in order of visual importance. After quantization, the weighting
process strategically places degradation, or noise, into more detailed or complex
picture areas where the viewer is least likely to notice it. The DCT coefficients
are then scanned such that the most significant coefficients are sent first,
followed by less significant coefficients and finally an indication in the code that
the remaining coefficients are all zero. The final step in spatial encoding is
entropy coding which resizes coefficients based on the number of times they
occur. Frequently repeated coefficients are expressed in the fewest number of
bits, thus greatly decreasing the total bandwidth needed to transmit the
coefficients.

Temporal encoding-
Temporal Encoding eliminates redundancy between sequential frames in the
video frame. Temporal coding takes advantage of the similarities between
sequential frames and encodes only the differences from one frame to the next.
This is accomplished through two types of temporal encoding: inter-frame
prediction and motion prediction. Inter-frame prediction takes advantage of the
similarities between sequential frames by encoding a complete reference frame
only periodically, and then using that frame to predict the preceding and
following frames. The reference frame is called an Intra-coded frame, or I-frame.
I-frames are used as a reference to predict P-frames and B-frames.

This means that instead of transmitting all the DCT coefficients for a P-frame,
the encoder transmits only those coefficients that differ from the preceding I-
frame or P-frame. At the decoder, P-frames are re-created using I- or P-frame as
a reference and applying the differentials. Bidirectional predicted frames, or B-
frames, are predicted in the same fashion from either preceding or subsequent I-
or P-frames.

Using only one I-frame as a basis for creating all the other frames in a video
stream would leave the stream extremely vulnerable to error, since an error in
the I-frame would propagate throughout the entire sequence. For this reason,
frames are divided into Groups of Pictures (GOPs), usually 12-15 frames long.
Each GOP begins with an I-frame, providing for rapid error correction when an I-
frame begins corrupted.

Decoding Compressed Stream


Using only one I-frame as a basis for creating all the other frames in a video
stream would leave the stream extremely vulnerable to error, since an error in
the I-frame would propagate throughout the entire sequence. For this reason,
frames are divided into Groups of Pictures (GOPs), usually 12-15 frames long.
Each GOP begins with an I-frame, providing for rapid error correction when an I-
frame begins corrupted.

Transport Stream System Layer-


We have discussed about compressing and decompressing a single video or
audio stream, but MPEG-2 transport streams simultaneously carry many
programs or services with audio, video and data all interlaced together. A
decoder must be able to sort through the transport stream, organizing the video,
audio and data streams by program or service. It must also know when to
present each part of the program or service to the viewer. This is where the
MPEG-2 System Layer comes into play.

The system layer specifies the structure of the transport stream, the transmission
mechanism for MPEG-2 compressed data. Among other things, this structure
provides for rapid synchronization and error correction at the decoder. The
system layer also defines Program Specific Information (PSI) tables. These act
as a table of contents, allowing the decoder to quickly sort and access
information in the transport stream.

Creating a Transport Stream


Once a video or audio stream is compressed, it becomes an Elementary Stream.
Each elementary stream can contain either MPEG-2 encoded audio, MPEG-2
encoded video, or data encapsulated in an MPEG-2 stream. Each of the
elementary streams has a ‘Packet Identifier’ (usually known as a PID) that acts
as a unique identifier for that stream within the transport stream. The only
restriction on the number of elementary streams in any transport stream is that
each elementary stream must have a unique PID value within its containing
transport stream.
Elementry Stream frame.

Creating a Transport Stream


These streams are simply a continuous set of video frames or audio data, which
is not really suitable for multiplexing. Therefore, we split these streams into
packets in order to make the multiplexing process easier. The result of this is a
Packetized Elementary Stream (PES) with variable-length packets, each
containing a header and a payload. The payload contains a single frame of
video or audio. The header includes timing information that tells the decoder
when to decode and present the frame.

Packetized elementary stream

Format of a TS packet

The header has the following fields: • The header starts with a well-known
Synchronisation Byte (8 bits). This has the bit pattern 0x47 (0100 0111). • A set
of three fag bits are used to indicate how the payload should be processed. 1.
The first flag indicates a transport error. 2. The second fag indicates the start of a
payload (payload unit start indicator) 3. The third fag indicates transport priority
bit. • The fags are followed by a 13 bit Packet Identifer (PID). This is used to
uniquely identify the stream to which the packet belongs (e.g. PES packets
corresponding to an ES) generated by the multiplexer. The PID allows the
receiver to differentiate the stream to which each received packet belongs.
Some PID values are predefined and are used to indicate various streams of
control information. A packet with an unknown PID, or one with a PID which is
not required by the receiver, is silently discarded. The particula PID value of
0x1FFF is reserved to indicate that the packet is a null packet (and is to be
ignored by the receiver).

If the information carried in the PES header is corrupted, the entire PES packet
will be lost. The key features of a Packet Header are as follows: Sync Byte sets
the start of a TS packet and allows transmission synchronization. Transport
Error indicator indicates the packet is in error. Packet Identifier (PID) enables the
decoder to sort through the packets in a transport stream to reconstruct
programmes. Program Clock Reference (PCR) provides 27MHz clock recovery
information.

During the encoding process, the packetized elementary streams are packetized
again and the data from the stream is stored in transport packets. Each
transport packet has a length of 188 bytes, and PES has variable length
Header. which is much smaller than a PES packet and so a single PES packet
will be split across several transport packets. The packet size was initially
chosen to simplify mapping of MPEG-2 packets over ATM (Asynchronous
Transfer Mode), which uses cells with a payload of 47 bytes (47×4=188). Like
the PES packet, each transport packet also contains a header and a payload.
This extra level of packetization allows the stream to support much more
powerful error correcting techniques.

PES packets are used to provide a way of multiplexing several streams into one
bigger stream and are more concerned with identifying the type of data
contained in the packet and the time and which it should be decoded and
displayed. Transport packets on the other hand are almost purely concerned
with providing error correction. Once the audio or video stream has been divided
into transport packets, it is multiplexed, or merged with similarly packetized
content for other services. A multiplex composed of one or more services is
called a Transport Stream.

Timing and presentation is done by Timing: PCR,


DTS and PTS fields in stream.
Before the transport stream is created, the encoder adds PTSs and DTSs to
each frame in the PES. It also places the PCR for each program into the
transport stream.

PSI TABLE
PMT-
Each Program Map Table (PMT) literally maps out a specific program, listing the
PID values for the packets containing the program’s video, audio and data
components. With this information, the decoder can easily locate, decode and
display the program’s contents. The PMT also indicates the PID value for a
program’s Entitlement Control Message (ECM). The ECM supplies the decoder
with the keys necessary to descramble the audio and video for a program.

Conditional Access Table (CAT)


The MPEG-2 syntax enables broadcasters to transmit proprietary Conditional
Access information in the transport stream in the form of Entitlement
Management Messages (EMMs). EMMs update the subscription options or pay-
per-view rights for each subscriber or for groups of subscribers. The Conditional
Access Table (CAT) tells the decoder where to find EMMs in the transport
stream by listing the PID value for the packets containing each EMM. The CAT is
always found on PID 0x0001.

Network Information Table (NIT)


The Network Information Table (NIT) provides information regarding a network
on which various transport streams reside. This table is specified, but not
defined by MPEG-2. It is defined by DVB. The ATSC standard does not use this
table.
DVB Tables
Event Information Table (EIT)

The Event Information Table (EIT) defines all the events in the network,
including their description, start time and duration. According to MPEG an event
is a collection of elementary streams with a common time base set to start and
end at the same time. We often refer to events as “TV programs”. Three different
types of EITs can be transmitted simultaneously: the EIT Present, the EIT
Following and the EIT Schedule. The EIT Present describes the events currently
being broadcast on the transport stream being accessed by the viewer. The EIT
Following provides information about the next events to be broadcast on the
same transport stream.

Filed under set-top-box Leave a comment


Tagged as set-top-box
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Close and accept


diigopost · Hope Create a free website or blog at WordPress.com.

You might also like