More Related Content Similar to Mt video compression (20) Mt video compression4. EIE415MultimediaTechnology
Motion-CompensationPrediction
14EIE415MultimediaTechnology
Motion-Compensation
Moving
Object
(u,v)
Displaced
Object
timet
Previousframe
Currentframe
Stationary
background
Motioncompensation
•theprocessofcompensatingforthe
displacementofmovingobjectsfrom
oneframetoanother
•Predictionforluminancesignal
I(x,y,t)withthemovingobject:
)1,,(),,(ˆ−−−=tvyuxItyxI
15EIE415MultimediaTechnology
HybridCodingSchemewithMCPrediction
Motion
Estimation
Motion
Compensation
2D-DCT
CodingI(x,y,t)
I(x,y,t-1)
motionvector
(u,v)
e(x,y,t)
2D-DCT
Decoding
Motion
Compensation
Framememory
e(x,y,t)I(x,y,t)
I(x+u,y+v,t-1)
Encoder
Decoder
Motionestimation-theprocessoffinding
correspondingpixelsamongframes,i.e.
themotionvector(u,v).
Motionvector-therelativedisplacementof
aobjectfromoneframetoanother
Predictionerror:
Thepredictionerrorisencodedby
theDCTcodingmethod
Motioncompensationisperformedinboththe
encoderandthedecoder,butmotionestimation
isneededonlyinencoder
⇒asymmetricproperty
)1,,(),,(
),,(ˆ),,(),,(
−−−−
−=
tvyuxItyxI
tyxItyxItyxe
16EIE415MultimediaTechnology
BlockMatchingMotionEstimation
N
N
N
N
Block
searchwindow(-D,D)
D
D
D
D
framet
framet-1
tormotionvecfinalthe:),(
tormotionveccandidatetheofposition:),(
framereferenceintheblock:),(
framecurrentintheblock:),(
),(minarg),(
|),(),(|),(
1
l)(k,
1
0
1
0
1
vu
lk
I
I
lkSADvu
ljkiIjiIlkSAD
t
t
N
i
N
j
tt
⋅⋅
⋅⋅
=
++−=
−
−
=
−
=
−∑∑
MatchingCriterion:
SumAbsoluteDifference
Theblockthatgivesthebest
matchforagivenmatching
criterionischosenasthe
motionvector.
Fullsearching
mostaccurate
heavycomputation
Fastsearching
reducedcomputationcomplexity
deteriorationinpicturequality
5. 17EIE415MultimediaTechnology
CurrentframeReferenceframe
Searchingwindow
Thelocalcoordinatesystemusedinthe
searchingwindowareusedtodetermine
themotionvectorofthemacroblock.
Macroblock
ofinterest
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
Candidate
macroblockFullSearch
18EIE415MultimediaTechnology
Searchingwindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
1
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
MAE
Macroblock
ofinterest
MAEplaneinthewindow
CurrentframeReferenceframe
FullSearch
19EIE415MultimediaTechnology
12365978842
Searchingwindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
11
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
MAE
Macroblock
ofinterest
MAEplaneinthewindow
CurrentframeReferenceframe
FullSearch
20EIE415MultimediaTechnology
7387513483731
4365165242832
5179375493273
8592466675739
1105111028323847
4549317253786
7387513483735
9521478547771
1497825584322
8413373529463
17116861486351
62631183575654
12365978842
Searchingwindow
MAEplaneinthewindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
11
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
MAE
Macroblock
ofinterest
MAE
Macroblock
ofinterest
CurrentframeReferenceframe
FullSearch
6. 21EIE415MultimediaTechnology
7387513483731
4365165242832
5179375493273
8592466675739
1105111028323847
4549317253786
7387513483735
9521478547771
1497825584322
8413373529463
17116861486351
62631183575654
12365978842
Searchingwindow
MAEplaneinthewindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
11
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
CurrentframeReferenceframe
FullSearch
1
•minMAE=0happensat(-5,-2)
⇒themotionvectoroftheblockis(-5,-2).
•Realizationcomplexityishigh.
Macroblock
ofinterest
22EIE415MultimediaTechnology
n-StepHierachicalSearch(n-SHS)
(Tutorial)
23EIE415MultimediaTechnology
7387513483731
4365165242832
5179375493273
8592466675739
1105111028323847
4549317253786
7387513483735
9521478547771
1497825584322
8413373529463
17116861486351
62631183575654
12365978842
Searchingwindow
MAEplaneinthewindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
11
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
CurrentframeReferenceframe
Macroblock
ofinterest
39
52
3-stepsearch
Step1
6
37
3
3
24EIE415MultimediaTechnology
7387513483731
4365165242832
5179375493273
8592466675739
1105111028323847
4549317253786
7387513483735
9521478547771
1497825584322
8413373529463
17116861486351
62631183575654
12365978842
Searchingwindow
MAEplaneinthewindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
11
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
CurrentframeReferenceframe
Macroblock
ofinterest
39
526
37
3
3
51
635
25
9
6
3-stepsearch
Step2
7. 25EIE415MultimediaTechnology
7387513483731
4365165242832
5179375493273
8592466675739
1105111028323847
4549317253786
7387513483735
9521478547771
1497825584322
8413373529463
17116861486351
62631183575654
12365978842
Searchingwindow
MAEplaneinthewindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
11
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
CurrentframeReferenceframe
Macroblock
ofinterest
39
526
37
3
35
8102
3
1
751
635
25
9
6
3
3-stepsearch
Step3
26EIE415MultimediaTechnology
7387513483731
4365165242832
5179375493273
8592466675739
1105111028323847
4549317253786
7387513483735
9521478547771
1497825584322
8413373529463
17116861486351
62631183575654
12365978842
Searchingwindow
MAEplaneinthewindow
(0,-6)
(-6,0)(6,0)
(0,6)
(0,0)
11
-6-5-4-3-2-10123456x=
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6y=
CurrentframeReferenceframe
Macroblock
ofinterest
39
526
37
3
35
8102
3
1
751
635
25
9
6
31
1
•TwoinallcheckedcandidateblocksprovidestheminMAE.
⇒themotionvectorfortheconcernedblockis(-1,0)or(-1,-1).
•Lowcomplexitybutmaynotprovidethebestmotionvector.
3-stepsearch
Step3
27EIE415MultimediaTechnology
GlobalandLocalMinima
3-stepsearchcanbetrappedinthelocalminima
Localminimaofthedistortionfunctiongiving
predictionimageswithhighererrorthanfullsearch
So,manyresearchworkshavebeencarriedoutto
findalternativeapproachesforblockmatching
motionestimation.
EIE415MultimediaTechnology
Codec
9. 33EIE415MultimediaTechnology
TransmissionandDisplayOrder
IBBBPBBBIBBBPBBBI
1234567891011121314151617
DisplayOrder
IPBBBIBBBPBBBIBBB
1523496781310111217141516
TransmissionOrder
Rule:BeforeyousendaBframe,makesureallitsreferenceframeshavebeensent.
Sendthereferenceframefirstifnot.
34EIE415MultimediaTechnology
Example
AnMPEG-1systemusestheframesequenceshownas
below.Deriveasuitablereorderedsequencethatensures
firstly,onlytwoframesmustbestoredinthedecoder,and
secondly,therequiredIand/orP-framesareavailableto
decodeeachP-andB-frameastheyarereceived.
35EIE415MultimediaTechnology
Solution
Asuitablereorderedframesequencethat
meetsthedefinedrequirementsis:
I,P,B,B,P,B,B,P,B,B,I,B,B,...
1,4,2,3,7,5,6,10,8,9,13,11,12
36EIE415MultimediaTechnology
CodingofI-Picture
2-D
FDCT
QVLCI-Frame
Coded
I-Frame
Intraframecoding
8×8DCT
AnyweightingmatrixforDCTcoefficientspossible
DifferentialcodingofDCcoefficient
Uniformqunatization
Runlengthcodingofzeroswithzig-zagscan
Entropycoding
14. 53EIE415MultimediaTechnology
MPEGAchievements
BuiltMPEG-1,MPEG-2
Widelyadoptedinaudiovisualindustry
DigitalTV;VCD,DVD,Video-On-Demand,archiving,Musiconthe
Internet
MPEG-4isstillon-going
Firstversionreadyatendof1998
Secondversionwasapprovedattheendof1999
MPEG-7“MultimediaContentDescriptionInterface”
Workingdraftwasappearedattheendofyear1999
IShadbeenapprovedatJuly2001
EIE415MultimediaTechnology
MPEG-1
55EIE415MultimediaTechnology
History:MPEG-1
Audio/VideoonDigitalStorageMedia(1.5Mbit/s,
CIF)
StartLate1988
CommitteeDraft9/90(BitstreamSyntaxand
Decoding)
ISO/IEC11172-1…-5(Systems,Video,Audio,
Compliance,Software)
56EIE415MultimediaTechnology
MPEG-1
Progressivescanningwitharefreshrateof30Hz(forNTSC)
and25Hz(forPAL).
SupportI-,P-andB-frames
I-framesmustbeusedforthevariousrandom-access
functionsassociatedwithVCRs.
Anewlayercalledsliceisaddedinthestructureofthe
streamsuchthatthedecodercanresynchronizemorequickly
incaseoferror.
NTSC:Y=352×240Cb=Cr=176×120
PAL:Y=352×288Cb=Cr=176×144
17. 65EIE415MultimediaTechnology
Thereare5profilesassociatedwitheachlevel:
Simple
Main
Spatialresolution
Quantizationaccuracy
High.
Thedifferentcombinationsoflevelsandprofilesforma
frameworkforallstandardsactivitiesassociatedwithMPEG-
2.
OneofthemostpopularsettingistheMP@MLstandard
whichisfordigitaltelevisionbroadcasting.
advancedtelevision(ATV)inNorthAmerica,
digitalvideobroadcast(DVB)inEurope,and
multiplesub-Nyquistsamplingencoding(MUSE)inJapan.
66EIE415MultimediaTechnology
CommonMPEG-2ProfileandLevelsinSimplified
Form
Profile
Level
Spatial
resolution
layer
Simple
Pictures:I,P
Chroma:
4:2:0
Main
Pictures:
I,P,B
Chroma:
4:2:0
SNR
Pictures:
I,P,B
Chroma:
4:2:0
Spatial
Pictures:
I,P,B
Chroma:
4:2:2
High
Pictures:
I,P,B
Chroma:
4:2:2
HighEnhancementSamples/line
Lines/frame
Frames/sec
1920
1152
60
1920
1152
60
LowerSamples/line
Lines/frame
Frames/sec
960
576
30
High-
1440
EnhancementSamples/line
Lines/frame
Frames/sec
1440
1152
60
1440
1152
60
1440
1152
60
LowerSamples/line
Lines/frame
Frames/sec
720
576
30
720
576
30
MainEnhancementSamples/line
Lines/frame
Frames/sec
720
576
30
720
576
30
720
576
30
720
576
30
LowerSamples/line
Lines/frame
Frames/sec
352
288
30
LowEnhancementSamples/line
Lines/frame
Frames/sec
352
288
30
352
288
30
LowerSamples/line
Lines/frame
Frames/sec
67EIE415MultimediaTechnology
MPEG-2ScalableCodingConcepts
Reasons:
toprovideinteroperabilitybetweendifferentservices
togiveflexiblesupporttoreceiverswithdifferent
displaycapabilities
toprovidealayeredvideobitstreamthatisamenable
forprioritizedtransmission.
tomadeitpossiblefortransmissioninthepresenceof
channelerrors,suchasinATM
AnewfeatureofMPEG-2isbitstreamscalability,which
allowsforalayeredrepresentationofthecodedbitstream
68EIE415MultimediaTechnology
Exampleofuses
ScalingbetweenHDTVandSDTV(Standard
DefinitionTelevision)
importantforHDTVtobecompatiblewithSDTV
transmissionusingHDTVquality
butusingscalablecoding:
lowresolution-baselayer
highresolution-baselayer+enhancementlayer
21. 81EIE415MultimediaTechnology
History:MPEG-3
MPEG-3existedonceuponatime,butitsgoal,enabling
HDTV,couldbeaccomplishedusingthetoolsofMPEG-2,and
hencetheworkitemwasabandoned
EIE415MultimediaTechnology
MPEG-4
83EIE415MultimediaTechnology
MPEG-4:theDevelopments
OriginalTarget:AdvancedCodingatRatesLowerthan64
kbit/s
Moreinformationisindigitalform,…
Moreinformationison-line,…
Moreinformationisaudio/visual,…
Applications&servicesbecome‘multimedia’,.
Applications&servicesbecomeinteractive,…
Audiovisualinformationnowcoversallbitratesandall
networks
Inshort:multimediaishappening
84EIE415MultimediaTechnology
IssuesthatupcomingMPEG-4
standardsaddress
InJuly1994,thefocuswasshiftedfromcompression
newfunctionalities+compression
compressionnolongertheonlyreasonfordoingcoding
“lowbitrate’,althoughstillimportant,isnotMPEG-4’sonlyfocus!
HavingAVinformationavailablewhereveryouare
Reusingtheaudiovisualcontent,combiningelementsof
contentinnewways
Morefreedomtointeractwithwhatiswithinthecontent
27. 105EIE415MultimediaTechnology
Example:Codinga16x16residualmacroblock
All4x4lumaandchromablocksareorderedasfollowsandtransformed
witha4x4integertransform.
DCcoefficientsofblocks0,1…15areextractedtoformblock-1,whichis
furthertransformedwithanother4x4integertransform
DCcoefficientsofblocks18-21(22-25)areextractedtoformblock16
(17),whichisfurthertransformedwitha2x2integertransform
Blocksareencodedandsentaccordingtothesequentialorder.
NoteallDCcoefficientsinblocks0-15,18-21and22-25areremovedas
theyareencodedinblock-1,16&17.
106EIE415MultimediaTechnology
•Intra-predictionModes
Entropy
Coding
Scaling&Inv.
Transform
Motion-
Compensation
Control
Data
Quant.
Transf.coeffs
Motion
Data
Intra/Inter
Coder
Control
Decoder
Motion
Estimation
Transform/
Scal./Quant.-
Input
Video
Signal
Splitinto
Macroblocks
16x16pixels
Intra-frame
Prediction
De-blocking
Filter
Output
Video
Signal
Inolderstandards,blocksare
encodedindependentlyinintramode
withoutmakinguseoftheinterblock
correlation⇒inefficient
H.264supportsDirectionalspatial
predictioninintramode
(9typesfor4x4luma,1for4x4
chroma,4typesfor16x16luma)
•4x4lumacase:
e.g.,Mode1(horizontal):
a=b=c=d=I,e=f=g=h=J
i=j=k=l=K,m=n=o=p=L
QABCDEFGH
Iabcd
Jefgh
Kijkl
Lmnop
1
0
34
56
7
8
2-DC
107EIE415MultimediaTechnology
Ifablockisencodedinintramode,apredictionis
madebasedonpreviouslyencodedblocksandthe
predictionresultissubtractedfromthecurrentblock
priortoencoding.
Modesofprediction:
9optionalpredictionmodestopredicta4x4lumablock
4optionalmodestopredicta16x16lumablock
1modetoeachpredicta4x4chromablock.
108EIE415MultimediaTechnology