Tải bản đầy đủ (.pdf) (171 trang)

Công nghệ Multimedia- Chương 1: Nền tảng kĩ thuật nén- vuson.tk docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (973.12 KB, 171 trang )

9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
1
Công nghệ Multimedia
 Khái quát
 Giớithiệu
 Chương 1: Nềntảng kĩ thuật nén
 Chương 2: Các kĩ thuật multimedia
 Jpeg
 Mpeg-1/Mpeg-2 Audio&Video
 Mpeg-4
 Mpeg-7 (Giớithiệuvắntắt)
 HDTV (Giớithiệuvắntắt)
 H261/H263 (Giớithiệuvắntắt)
 Model-Based coding (Giớithiệuvắntắt)

Chương 3: Mạng multimedia
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
2
Multimedia Technology
 Overview
 Introduction
 Chapter 1: Background of compression
techniques
 Chapter 2: Multimedia technologies
 JPEG
 MPEG-1/MPEG-2 Audio & Video
 MPEG-4
 MPEG-7 (brief introduction)
 HDTV (brief introduction)


 H261/H263 (brief introduction)
 Model base coding (MBC) (brief introduction)
 Chapter 3: Multimedia Network
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
3
Giớithiệu
 Tầm quan trọng củacáckĩ thuật Multimedia: -> Multimedia có ở
khắpnơi
 Trong PC:
 Real player, Quicktime, Media
 Âm nhạc, hình ảnh miễn phí trên internet (mp2, mp3, mp4, asf, ra, ram, mid,
DIVX, v v )
 Hộithảotrựctuyến âm thanh, hình ảnh
 Dịch vụ quảng cáo trên web, truyềnsố liệu
 Giáo dụctừ xa.
 Y họctừ xa

 Trong truyềnhìnhvàcácthiếtbịđiệntử dân dụng:
 DVB-T/DVB-C/DVB-S (Digital Video Broadcastsing-Terrestrial/Cable/Satellite _
Truyềnhìnhsố mặt đất/cáp/vệ tinh) -> biểudiễn MPEG-2 chấtlượng cao hơn
hẳntruyềnhìnhtương tự truyềnthống.
 Truyềnhìnhtương tác -> Các ứng dụng internet trên truyền hình (Mail,Web, E-
commerce_thương mại điệntử) -> không cần đợiPC để khởi động, tắtmáy.
 Các đầu đọc CD/VCD/DVD/Mp3
 Đồng thờixuấthiệntrêncácthiếtbị cầmtay ( ĐTDĐ thế hệ 3G, PDA
không dây)
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
4

Introduction
 The importance of Multimedia technologies: Æ Multimedia everywhere !!
 On PCs:
 Real Player, QuickTime, Windows Media.
 Music and Video are free on the INTERNET (mp2, mp3, mp4, asf, mpeg,
mov, ra, ram, mid, DIVX, etc)
 Video/Audio Conferences.
 Webcast/ Streaming Applications
 Distance Learning (or Tele-Education)
 Tele-Medicine
 Tele-xxx (Let’s imagine !!)
 On TVs and other home electronic devices:
 DVB-T/DVB-C/DVB-S (Digital Video Broadcasting –
Terrestrial/Cable/Satellite) Æ shows MPEG-2 superior quality over
traditional analog TV !!
 Interactive TV Æ Internet applications (Mail, Web, E-commerce) on a TV !!
Æ No need to wait for a PC to startup and shutdown !!
 CD/VCD/DVD/Mp3 players
 Also appearing in Handheld devices (3G Mobile phones, wireless PDA) !!
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
5
Giớithiệu(2)
 Mạng Multimedia
 Internet đượcthiếtkế vào những năm 60 cho các
mạng tốc độ thấpvớinhững ứng dụng vănbản
nhàm chán. -> Độ trễ cao, jitter cao.
 -> Những ứng dụng multimedia yêu cầucósự biến
đổimạnh mẽ củacơ sở hạ tầng internet.
 Nhiềucơ cấutổ chức được nghiên cứuvàtriểnkhai

để hỗ trợ cho thế hệ multimedia internet tiếp theo.
(VD: intServ, DiffServ)
 Trong tương lai, tấtcả mọitivi(vàPC) sẽ kếtnối
internet và bắtsóngmiễn phí với hàng triệutrạm
phát sóng trên toàn thế giới.
 Hiệntại, mạng multimedia chạy trên ATM (đãcổ),
IPv4, và tương lai là IPv6 -> nên sẽ bảo đảm được
chấtlượng d
ịch vụ QoS (Quality of Service)
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
6
Introduction (2)
 Multimedia network
 The Internet was designed in the 60s for low-speed inter-
networks with boring textual applications Æ High delay,
high jitter.
 Æ Multimedia applications require drastic modifications
of the INTERNET infrastructure.
 Many frameworks have been being investigated and
deployed to support the next generation multimedia
Internet. (e.g. IntServ, DiffServ)
 In the future, all TVs (and PCs) will be connected to the
Internet and freely tuned to any of millions broadcast
stations all over the World.
 At present, multimedia networks run over ATM (almost
obsolete), IPv4, and in the future IPv6 Æ should
guarantee QoS (Quality of Service) !!
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology

7
Chương 1: Nềntảng kĩ thuậtnén
 Tạisaophảinén?
 Trong truyền thông: Để thu hẹpdải thông trong các ứng
dụng mạng multimedia như streaming, video theo yêu cầu
VOD (video on demand), internet phone.
 Các vậtchứakĩ thuậtsố (VCD, DVD, băng v v ) -> giảm
kích cỡ, giảmgiácả, tăng dung lượng và chấtlượng cất
giữ âm thanh, hình ảnh.
 Hệ số nén hay tỉ lệ nén
 Tỉ lệ giữadữ liệu nguồnvàdữ liệu nén (VD: 10:1)
 2 loại nén:
 Nén không tổnhao
 Nén tổnhao
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
8
Chapter 1: Background of compression
techniques
 Why compression ?
 For communication: reduce bandwidth in multimedia
network applications such as Streaming media, Video-on-
Demand (VOD), Internet Phone
 Digital storage (VCD, DVD, tape, etc) Æ Reduce size &
cost, increase media capacity & quality.
 Compression factor or compression ratio
 Ratio between the source data and the compressed data.
(e.g. 10:1)
 2 types of compression:
 Lossless compression

 Lossy compression
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
9
2.1. Nội dung thông tin và dư thừa
 Nội dung thông tin:
 Entropy là đạilượng đocủanội dung thông tin. Entropy
quy định giớihạndướicủatốc độ bit hay dòng dữ liệu.
 -> Biểudiễnbởibits/đơnvị nguồn đầura(như bits/pixel)
 Tín hiệu càng nhiều thông tin thì entropy càng cao
 Nén tổn hao thì làm giảm entropy còn nén không tổn hao
thì không
 Dư thừa thông tin:
 Là sựkhác nhau giữatốc độ thông tin và tốc độ bit
 Thường thường tốc độ thông tin thấphơntốc độ bit rấtnhiều
 Nén là đểloạibỏ sựdư thừa
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
10
Information content and redundancy
 Information rate
 Entropy is the measure of information content.
 Æ Expressed in bits/source output unit (such as bits/pixel).
 The more information in the signal, the higher the
entropy.
 Lossy compression reduce entropy while lossless
compression does not.
 Redundancy
 The difference between the information rate and bit
rate.

 Usually the information rate is much less than the bit
rate.
 Compression is to eliminate the redundancy.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
11
2.2. Entropy (Bổ sung 1)
 For a discrete source X with a finite alphabet of N symbols (x0, . . ., xN.1)
and a probability mass function of p(x), the entropy of the source in
bits/symbol is given by
and measures the average number of bits/symbol required to describe the
source.
 Such a discrete source is encountered in image compression, in which the
acquired digital image pixels can take on only a finite number of values as
determined by the number of bits used to represent each pixel.
 It is easy to show (using the method of Lagrange multipliers) that the
uniform distribution achieves maximum entropy, given by H(X) = log2 N.
 A uniformly distributed source can be considered to have maximum
randomness when compared with sources having other distributions
 Combining this with the intuitive English text example mentioned previously,
 it is apparent that entropy provides a measure of the compressibility of a
source. Î High entropy indicates more randomness; hence the source
requires more bits on average to describe a symbol.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
12
Entropy (bổ sung 2)
 Calculating Entropy—An Example
 An example illustrates the computation of entropy the difficulty in
determining the entropy of a fixed-length signal. Consider the

four-point signal [3/4 1/4 0 0].
 There are three distinct values (or symbols) in this signal, with
probabilities 1/4, 1/4, and 1/2 for the symbols 3/4, 1/4, and 0,
respectively. The entropy of the signal is then computed as
 This indicates that a variable length code requires 1.5
bits/symbol on average to represent this source.
 In fact, a variable-length code that achieves this entropy is [10 11
0] for the symbols [3/4 1/4 0].
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
13
2.3. Nén không tổnhao
 Dữ liệugiảimãgiống hệtdữ liệu nguồn
 VD: Các file đầuracủacácchương trình tiệních
như pkzip hay Gzip
 Hệ sốnén khoảng 2:1 – 5:1 (tùy theo độ dư thừa
thông tin)
 Không thể bảo đảm1 tỉ lệ truyềncố định -> vì tốc
độ dữliệu đầurabiến đổi -> nảysinhcácvấn đề
cho cơ cấughivàtruyền thông.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
14
Lossless Compression
 The data from the decoder is identical to the
source data.
 Example: archives resulting from utilities such as
pkzip or Gzip
 Compression factor is around 2:1.
 Can not guarantee a fix compression ratio Æ

The output data rate is variable Æ problems
for recoding mechanisms or communication
channel.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
15
2.4. Nén tổnhao:
 Dữ liệugiải nén khác dữliệu nguồnnhưng sự khác
biệt không thể phân biệt được rõ ràng bằng tai
hoặcmắtthường.
 Phù hợpvới âm thanh, hình ảnh nén.
 Hệ sốnén cao hơnso với nén không tổnhao(lêntới
100:1)
 Dựatrênnhững kiếnthứcvề sự nhậnthứcvề thị
giác và thính giác
 Có thểấn định 1 hệ số nén cố định
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
16
Lossy Compression
 The data from the expander is not identical to
the source data but the difference can not be
distinguished auditorily or visually.
 Suitable for audio and video compression.
 Compression factor is much higher than that of
lossless. (up to 100:1)
 Based on the understanding of
psychoacoustic and psychovisual perception.
 Can be forced to operate at a fixed
compression factor.

9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
17
2.5. Quá trình nén:
 Truyền thông (giảm chi phí kếtnốidữ liệu)
 Dữ liệu-> Bộ nén (mã hoá) -> kênh truyềndẫn-> bộ
giãn (giảimã) -> dữ liệu
 Cơ cấughi(tăng thời gian phát lại: tỉ lệ vớihệ số
nén)
 Dữ liệu -> nén (mã hoá) -> thiếtbị chứa(băng, đĩa,
Ram ) -> bộ giãn (giảimã) -> Dữ liệu
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
18
Process of Compression
 Communication (reduce the cost of the data
link)
 Data →Compressor (coder) →transmission channel
→Expander (decoder) →Data'
 Recording (extend playing time: in proportion
to compression factor
 Data →Compressor (coder) →Storage device
(tape, disk, RAM, etc.) →Expander (decoder) →
Data‘
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
19
2.6. Lấymẫuvàlượng tử hoá:
 Tạisaolấymẫu?
 Máy tính không thểxử lí trựctiếp tín hiệutương tự

 PCM (Pulse code modulation) - Điềuxungmã:
 Lấymẫu tín hiệutương tựở tốc độkhông đổivàsử dụng mộtsố bit
không đổi(thường là 8 hay 16) để biểudiễncácmẫu.
 Tốc độ bit = tốc độ lấymẫu* số bit/mẫu
 Lượng tử hoá:
 Ánh xạcác tín hiệutương tự đãlấymấu(cóđộ chính xác vô
hạn) sang các mứcrờirạc(độ chính xác hữuhạn)
 Biểudiễnmỗimứcrờirạcbằng 1 số.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
20
Sampling and quantization
 Why sampling?
 Computer can not process analog signal directly.
 PCM
 Sample the analog signal at a constant rate and
use a fixed number of bits (usually 8 or 16) to
represent the samples.
 bit rate = sampling rate * number of bits per
sample
 Quantization
 Map the sampled analog signal (generally, infinite
precision) to discrete level (finite precision).
 Represent each discrete level with a number.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
21
2.7. Mã hoá dự đoán:
 Dự đoán:
 Dùng các mẫutrước đó đểướclượng mẫuhiệnthời.

 Đốivớihầuhết tín hiệu, sự khác nhau củagiátrị dự đoán vớigiá
trị thựctế là nhỏ -> ta có thể dùng số bit nhỏ hơn để mã hoá sự
sai khác trong khi vẫnduytrìđược cùng 1 độ chính xác.
 Gửi đi độ sai khác củamẫuvớigiátrị dựđoán đượctạoratừ các
mẫutrước.
 Nhiễulàhoàntoànkhôngthể dự đoán được
 Hầuhết các Codec yêu cầudữliệuphải đượcxử lí trước, nếu
không Codec sẽ hoạt động kém khi có nhiễu.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
22
Predictive Coding (bổ sung)
 In predictive coding, rather than directly coding the data itself, the coded data consists of
a difference signal formed by subtracting a prediction of the data from the data
itself.
 The prediction for the current sample is usually formed using past data. A predictive
encoder and decoder are shown in Figure, with the difference signal given by d. If the
internal loop states are initialized to the same values at the beginning of the signal, then y
= x.
 If the predictor is ideal at removing redundancy, then the difference signal contains
only the “new” information at each time instant that is unrelated to previous data.
 This “new” information is sometimes referred to as the innovation, and d is called the
innovations process. If predictive coding is used, an appropriate predictor must be
determined.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
23
Predictive coding
 Prediction
 Use previous sample(s) to estimate the current

sample.
 For most signal, the difference of the prediction
and actual values is small. Æ We can use smaller
number of bits to code the difference while
maintaining the same accuracy !!
 Noise is completely unpredictable
 Most codec requires the data being preprocessed or
otherwise it may perform badly when the data contains
noise.
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
24
2.8. Mã hoá thống kê: Mã Huffman
 Gán mã ngắnchomẫucóxácsuấtxuấthiệncao
và gán mã dài cho mẫuítxuấthiệnhơn
 Î Sựgán bit dựatrênsự thống kê củadữliệu
nguồn.
 Thống kê dữ liệu nguồn đượcthựchiệntrướcquá
trình gán bit.
 Còn gọi là VLC – Variable Length Coding
 (Mộtvídụ về Huffman code) Î Mã Morse
9/14/2006
Nguyen Chan Hung – Hanoi University of Technology
25
Statistical coding: the Huffman code
 Assign short code to the most probable data
pattern and long code to the less frequent
data pattern.
 Bit assignment based on statistic of the
source data.

 The statistics of the data should be known
prior to the bit assignment.

×