Hardware Acceleration

honggarae 18/03/2022 899

Processor

TheEnglishnameofhardwareaccelerationisHardwareacceleration;howdoesthesystemworkwhenhardwaredecodingtakeseffect?Thehardwarehasthreeprocessors,CPU,GPUandAPU(notanaccelerationprocessorbutasoundprocessor).TheyexchangedatathroughthePCI/AGP/PCIEbus.

1.TheCPUreadstheoriginaldata(DirectSHow'ssourcefilter)fromthefilesystem,andseparatesthecompressedvideodata(separator).Putitinsystemmemory.GPUandAPUdonotrun.

2.TheCPUgivesthecompressedaudioandvideodatatotheGPUandAPU.Atthistime,thebusisbusy.Thecompresseddataiscopiedfromthesystemmemorytothevideomemoryonthegraphicscardandthesoundmemoryonthesoundcard(ifany).

3.TheCPUrequirestheGPUandAPUtostarthardwaredecoding,theCPUisnotrunning,andtheGPUandAPUstarttobebusy.Ofcourse,theCPUwillregularlycheckhowbusytheGPUandAPUare.

4.TheGPUandAPUstarttodecodethevideodata(alreadyinthedisplayandsoundstorage)withtheirowncircuits,andthedecompresseddataisstillstoredinthedisplayandsoundstorage.

5.Theaudioandvideodatacannotbeplayedimmediatelyafterdecoding,becausepost-processingisrequired,suchasdeinterlace,3:2pulldown,Dopplereffect,etc.GPUandAPUusetheirownpost-processingcircuitsforprocessing.

6.Afterthepost-processing,theuncompresseddataisusedforplayback,andtheGPUisbusywithvideoscaling,brightness,gammaandotherthings.TheCPUisstillidle.

7.GPUandAPUarefinallybusy,whereisthefollowingvideodata?NotifytheCPU,GPUandAPUwilltakeabreakfirst.TheCPUisbusyagain,andgobacktostep1.

Technology

Thestructureofthecentralprocessingunitenablesittocompleteavarietyofdifferentinstructionsinashorttime.Whatinstructionsitcanhandleismainlylimitedbythesoftware.However,duetothestructureofthecentralprocessingunit,somerepetitivetaskscannotbeprocessedveryefficientlyandquickly.Thepossibilityofprocessoroptimizationislimitedduetosoftware.

Thisproblemcanbesolvedbyusingspecialhardwarecomponents(chipsorprocessors)designedforsuchrepetitivetasks.Thesespecialhardwarecomponentsdonothavetobeasflexibleasthecentralprocessingunit,sotheirhardwaredesignhasalreadytakenintoaccounttheneedtooptimizethehandlingofthesespecialproblems,sothatthecentralprocessingunithastimetohandleothertasks.

Sometaskscanbesolvedveryeffectivelybybreakingthemdownintothousandsofsmalltasks.Forexample,performFouriertransformonacertainfrequencybandorrenderasmallimage.Thesesmalltaskscanbecalculatedinparallelirrelevanttoeachother.Throughalargenumberofparallelcalculations,thatis,theapplicationofalargenumberofsmallprocessorsrunninginparalleltohandlethesespecialtasks,thetotalcalculationspeedcanbegreatlyimproved.Inmanycases,thecalculationspeedincreaseslinearlywiththenumberofparallelprocessors.Forexample,192streamprocessorsruninparallelonaGeForce200graphicscard.

Suchparallelcalculationsarealsomeaningfulfromtheperspectiveofefficientuseofenergy.Energyusageincreaseslinearlywiththenumberofparallelprocessors,andincreasesproportionallytothesquareoftheprocessorfrequency.Therefore,thefrequencyoftheparallelcomputingprocessordoesnotneedtobetoohigh,andtheenergyusedisrelativelysmall.

Application

Asyoucanseeabove,whenhardwaredecodingtakeseffect,theCPUcanreallybeidle,butinorderforittotakeeffect,someconditionsmustbemet.ThemostcriticalreasonisthattheCPU->systemmemory,GPU->graphicscardvideomemoryAPU->soundmemoryiscomparedtoPCI,AGP,andPCIEbuses.PCIis133MB/S,AGP8Xis2.1GB/S,PCIE16Xis4GB/S,whileCPU-systemmemory,GPU-videomemoryareseveraltimesfaster,andAPU->soundmemoryisfaster.ThosewhoareinterestedcancomparethespeedofthememorybusandtheAGP/PCIEbusofdifferenteras.BecausethebusinterconnectingtheCPUandGPUisveryslow,oncethevideodata(eitherbeforeorafterdecompression)ishandedovertotheGPUandAPU,theGPUandAPUareresponsibleforprocessingituntilitisfinallydisplayed.

IfthereisanyGPUorAPUinthefirst1-5steps->thesoundstoragecannotbedoneoryoudonotletitdo,thevideohardwaredecodingwillnottakeeffectandtheCPUwillberesponsible.

Ofcourse,youmayask,maybetheCPUisveryslow,maybetheGPUandAPUsharepartoftheworkwhentransferringdataontheturtle-speedbus,orisitfasterthanalltheCPUs?Maybeso,butintheDirectshowarchitecture,thefilters(separator,decoder,post-processing,andrenderer)thatrepresentthevariousaspectsofvideodataprocessingneedtonegotiateavideodatastoragemethodthateveryoneaccepts.IfacertainfiltersaysIcanonlyplayinthesystemmemory,everyonehastoplayinthememory,GPU\APUandvideomemoryhavetogiveup.

Computerdisplayusinghardwareaccelerationwillbefaster,butyouwillfindthatthedisplayareaisblackwhentheprojectororscreenshotistaken,thenyoumustturnoffhardwareacceleration(hardwareaccelerationreverseoperation).Thestepsare:

XPchangehardwareacceleration:

Graphicscard:right-clickonthedesktop--displayproperties--advancedinthesettingstab--troubleshoot--changethehardwareaccelerationsliderfromDrag"None"to"Full"

Sound:Openthesoundandmultimediapropertiesonthe"ControlPanel".

Inthe"DefaultDevice"listunder"Recording"onthe"Audio"tab,clicktherecordingdeviceyouwanttouse,andthenclick"Advanced".

Inthe"AdvancedAudioProperties"dialogbox,youcanconfigureperformancesettingsforsoundhardwareaccelerationandaudiorateconversion.

UnderWindowsVista,changethegraphicscardhardwareacceleration:right-clickonthedesktop-->Personalization-->DisplayProperties-->AdvancedSettings-->Troubleshooting-->Changethesettings,andthesoundcardisturnedonbydefault.Cannotbechanged.

Note:

1.Tosupporthardwareacceleration,thereareseveralrequirements:

First,hardwareaccelerationmustbesupportedonthehardware

Second,thedrivermustbeupgradedtothelatestversion

Thesoftwareyouwanttoaccelerate,suchasgames,mustsupporthardwareacceleration

2.Bydefault,Vista'shardwareaccelerationisfullyenabled,butthe"changesettings"itemneedsdriversupport,otherwiseitwillbegrayedoutandnotselectable.Atthistime,youcantrytoenterthecontrolcenterofthevideocardtomodify(suchasATI,NVIDIA,Realtek,IDE)ordownloadthelatestdriver.

Anothertemporarysolutionis:

(1.)Whendownloadingthegraphicscarddriver,donotdownloadthedriverforvista,chooseforXP

(2.)Therewillbeanerrormessageduringinstallation.Atthistime,exittheinstallationfirst,gotothedownloadeddriverfile,right-click,selectProperties-Compatibility,selectXPSP2inthecompatibilityoption,andthenyoucansuccessfullyinstall.

(3.)Afterinstallingandrestarting,gotoadjustthegraphicscardhardwaredriver,thebuttonisalreadyselectableandcanbeadjusted.ButthedisadvantageisthatitmaylosefunctionssuchasAero.

3Dacceleration

1.Classificationof3Dacceleration

3Dhardwareacceleration:referstoborrowingDirectXorOpenGLaccelerationofthegraphicscard,andgenerallyrequiresgraphicscardsupport.

3Dsoftwareacceleration:referstotheuseofCPUacceleration,whichislessefficient.

2.Therealizationmethodof3Dacceleration

Undertheconditionthatthegraphicscardsupports3Dacceleration,downloadandinstallthecorrespondinggraphicscarddriver.

3.3Daccelerationeffect

Thepictureisdetailed,thedetailsareperfect,andthesoundisrealistic.

Latest: optimization

Next: Ding Yuanzhu