Video Codec Comparison Report

  • View
    221

  • Download
    0

Embed Size (px)

Text of Video Codec Comparison Report

  • 8/8/2019 Video Codec Comparison Report

    1/17

    Video compression: Performance of

    available codec software

    1 Introduction1.1 DigitalVideoA digital video is a collection of images presented sequentially to produce the effect of continuous

    motion. Ittakesadvantageofthespatiotemporalpropertiesofthehumaneyetosimulatecontinuityin

    motion. Thepersistenceofthehumaneyeissuchthatnanosecondsofexposuretoanimageresultsin

    millisecondsofimageontheretina.Hence, imagesplayedataspeedgreaterthanamillisecondwould

    appeartobecontinuous.Ingeneral,theeyecannotdifferentiatebetweenindividualimageswhenthey

    areplayedatarateof25persecondorhigher. Severalstandardsfortelevisionexist,whichdefinethe

    framerateofthevideobeingdisplayed.SomeofthemaretheNTSC,PALetc.Theframeratevariesfrom

    25fpsto60fpsdependingonthestandard.Thevideofileconsistsoftheindividualimages(alsoknownasframes)andthesequencinginformation.

    1.2 TheSizeBarrierConsideravideothatisbeingplayedoutattherateof30 imagespersecond.Fora640x480grayscale

    video represented in the raw lossless format, thatwouldbe640x480x30bytesper second. Fora30

    minutevideo,thiswouldbeapproximately16GB.Foracolourvideo,usingthreebytesperpixel,that

    wouldbe48GBnotevenincludingtheaudioandthesequencinginformation. Thisisalmostthesizeof2

    blueraydiscsforasmallsizedSDvideo.ForsomemodernHDtransmissions,theframesizesare ashigh

    as1920x1080whichwouldworkouttovideosizesbegreaterthan300GBwhenuncompressed.

    1.3 VideoCompressionItisimpossibletoevenimaginetransmittingvideosofsuchhugesizes.Toreducethesizeofthevideo

    tomanageableproportions,thevideosareusuallyneverstoredortransmittedintherawformat.Even

    in situations where compression is not required, the video is still compressed. This is because, the

    human eye is insensitive tohigher frequenciesandminute variations in colour and transmitting this

    informationwouldbeawasteofresources.Everyvideoissubjectedtosomekindofcompression.The

    compressionmethodisbasedupontheapplicationandbandwidthconstraintswherethevideoisused.

    Compressionmaybeclassified

    I. Baseduponthereproducibilityintoa. Losslesscompression

  • 8/8/2019 Video Codec Comparison Report

    2/17

    As the name indicates, videos compressed using thismethod can be reproduced to the

    original content without any change in data. Some methods which perform lossless

    compression are Huffman coding, Run Length Coding etc. The amount of compression

    achievedusingthesemethodsisverylesscomparedtothoseachievedusinglossmethods(

    whicharediscussednext).Further, theamountof compression isalsogreatlydependent

    uponthecontentofthevideo.

    b. LossycompressionThiscompression isperformedbydropping informationwhichdoesnotsignificantlyaffect

    thevisualizationofthevideo.Forexample,thehumaneyeisinsensitivetohighfrequencies

    and also does not recognizeminor variations in colours. Hence this information can be

    droppedwhileencodingthevideo.MethodssuchasJPEGperformlossycompression.

    II. Baseduponwherethecompressionisperformedintoa. Intraframecompression

    Thismethod

    takes

    advantage

    of

    the

    spatial

    redundancy

    present

    in

    each

    frame

    of

    the

    video and compresses each frame based upon one of the compressionmethods. In

    general, indoorvideoshaveauniform,nonchangingbackgroundandhaveaveryhigh

    spatialredundancywhichcanbegreatlycompressed.

    b. InterframecompressionThis method identifies the temporal redundancies between consecutive frames in a

    videoandattemptstoremovethem.Usually,videosdonothavemuchscenechanges

    andhencewillhavealotoftemporalredundancy.

    UsuallygoodvideoformatsimplementbothInterandintraframecompressiontechniques.

    1.4 VideoencodingformatsA video encoding format is a representation for compressed video. Such a format specifies the

    representation of each frame, the sequencing information between frames and compression and

    decompressionmethodsforinterandintraframeredundancy.

    Althoughmaximumcompressionistargeted,usually,allformatshaveacertainamountofredundancy

    inthem.Thisistomaintainperformanceinenvironmentswherethereisframedroppinganddataloss.

    Errorpropagation resistancemechanismsarepartof thespecificationsofallvideoencoding formats.Thesealsoassistinseekingofdata.Withoutthese,everytimewewatchamove,wewouldhavetostart

    fromthebeginningwithoutbeingabletocueforward.

  • 8/8/2019 Video Codec Comparison Report

    3/17

    Somepopularformatsforvideoencodingare:

    wmv Mpeg1 Mpeg4 Asf

    1.5 ContainerformatsContainerformatsaredifferentfromencodingformats.Theyholdcombinationsofthevideoandaudio

    encoded formats. They specify the bitrates of the audio and video and help maintain the

    synchronizationbetween the audio and video. Some containers aredesigned to holdonly a specific

    combinationofaudioandvideowhilesomearecapableofholdingseveralcombinations(butonlyone

    combinationata time).Twopopular container formatsare .aviand .wmv. .avi canbeused tohold

    severalvideoformatsincludingmpeg4andmpeg1

    Somevideoencodingformatsarecontainersinthemselvesandarecapableofholdingbothaudioand

    video.Forexample,MPEG1,MPEG4

    1.6 CodecAcodec isanacronym forCoderDecoder. It iscapableofencodinga setof images intoavideoand

    decodingavideo intoasetof images.Each imageusuallyconstitutesa frame in thevideo.However,

    severaladditionalframesareaddedforthereasonsdiscussedearlier.

    Eachcodeciscapableofworkingwithonlyaspecificvideoformat.However,severalcodecscanexistfor

    asingleformat.Usually,eachmultimediacompanyformathasitsowncodecforitsplayerforaformat.

    Forexample, theora,movareallcodecs for thempeg4 format.Codecs canbe ineither softwareor

    hardware.Thesoftwarecodecsareslowerandinexpensiveascomparedtothehardwarecodecswhich

    aremuchfaster.

    The specifications for a format are not rigid and provide for some variations. Although codecs

    implement a specified format, theymay vary in theirmethodof operation resulting in variations in

    qualityandperformance.

    2 CodecEvaluationWith the ever increasing need for bandwidth, codec designers tend to be over greedy and design

    algorithmswhichmightbadlyaffecttheaesthecityofthevideocontent.Hence,evaluationcriteriafor

    codecperformancesarerequiredtoverifythequalityofthecompressedvideos.

    2.1 CriteriaforComparisonThecodecsarecomparedbasedonthefollowingcriteria

  • 8/8/2019 Video Codec Comparison Report

    4/17

    1. QualityofVideo2. Performanceofthecodec

    2.2 QualityofvideoQualityofvideocorrespondstothelookandfeelofthevideo,theresolution,theartifacts,theblurring

    andothervisualaestheticcomponents.Thequalityofvideodependsonboththe formatofthevideoand the codec used to encode to that format. Usually, several codecs implement a single format.

    However,eachonediffers fromtheother.Qualityalsodependsontheamountof informationonthe

    video being encoded. Also, the performancewill not be constant throughout the video. Clipswith

    higherinformationhavemoreartifactsthansceneswithlittlemovementandscenechanges.Qualitycan

    bemeasuredasobjectiveorsubjective.

    2.2.1 ObjectiveQualityObjectivequalityistomeasurethequalityinmathematicaltermswhichmakesitveryeasytocompare

    andevaluate.Someofthemetricsavailabletomeasureobjectivequalityare:

    a. MeanSquareError(MSE):Itisthesecondmomentofthedifferenceanddescribesthevariancebetweentheoriginalframeandtheencodedframe.

    b. PeakSignaltoNoiseRatio(PSNR):Theratiobetweenthemaximumsignallevelandthenoise.Mathematically,itisgivenby:

    c. ColourDifference:Thisistheabsolutedifferenceoftheindividualcolourcomponentsbetweentheinputframeandtheoutputframe.Itiscalculatedby

    d. StructuralSimilarity(SSIM)[2]Thisisusedtomeasurethesimilaritybetweentwoimages.Itisanumberbetween0and1. Itisafunctionofluminance,contrastandstructuralsimilarity.Itis

    independentofthecolourcomponents.

    2.2.2 SubjectiveQualitySubjectivequality ismeasuredbyvisually inspectingtheencodedvideo forartifacts,blurring,blocking

    andoverallquality.

  • 8/8/2019 Video Codec Comparison Report

    5/17

    2.3 PerformanceoftheCodecTheperformanceofthecodecismeasuredasafunctionofthreequantities

    1. Compressionratioofthecodec(Filesize)2. Speedofencoding(compression)3. Speedofdecoding(decompression)

    2.3.1 CompressionratioofthecodecThecompressionratioofthecodecismeasuredbyencodingarepetitivesetofframesusingthecodecs

    toyieldvideosofdifferentformats.Thefilesizeoftheencodedvideototheuncompressedvideowill

    actasameasureofthecapacityforcompression.Byselectingappropriateframestocompress,wecan

    measureboththebestandworstcasescenarios.

    2.3.2 EncodingandDecodingspeedTheencodinganddecoding speedvary fromcodec tocodecandwithin the samecodec fordifferentframes.Higher the redundancy, slower the encoding and smaller is the size of the file. By selecting

    appropriateframestocompress,wecanmeasureboththebestandworstcasescenarios.

    2.4 BitRatesBitRateismeasuredinKiloBitspersecondandrepresentstheamountofdataflowperunittime.Itis

    animportantfactorthatdecidesthequalityofthevideo.Forexample,consideravideowhichhasabit

    rateof1000KbPS.Fora standarddefinitionvideo, thiswouldmean that therewouldbeabout29.8

    framesinthe1000KiloBitsi.eabout33KiloBitsperframeor4Kilobytesperframe.Thisrestrictsthe

    amountofdatathatcanbeusedtorepresentaframe.Lowerbitratesmeanhighercompressionand

    lowerqualityofvideo,morenoise,blocking,discolourationetc.

    Application BitRatesa Videostreaming 100500KbPS

    b SDvideo 5002000KbPS

    c HDvideo >2000KbPS

    Bymeasuringeachofthequantitiesdiscussedin2.3and2.4,wewillbeabletoidentifytheappropriate

    codecforas