Vorbis_I_spec.html 558 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html >
  4. <head><title>Vorbis I specification</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
  7. <meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
  8. <!-- html -->
  9. <meta name="src" content="Vorbis_I_spec.tex">
  10. <meta name="date" content="2009-06-02 19:28:00">
  11. <link rel="stylesheet" type="text/css" href="Vorbis_I_spec.css">
  12. </head><body
  13. >
  14. <div class="maketitle">
  15. <h2 class="titleHead">Vorbis I specification</h2>
  16. <div class="author" ><span
  17. class="cmr-17">Xiph.org Foundation</span></div>
  18. <br />
  19. <div class="date" ><span
  20. class="cmr-17">June 2, 2009</span></div>
  21. </div>
  22. <h3 class="likesectionHead"><a
  23. id="x1-1000"></a>Contents</h3>
  24. <div class="tableofcontents">
  25. &#x00A0;<span class="sectionToc" >1 <a
  26. href="#x1-20001" id="QQ2-1-2">Introduction and Description</a></span>
  27. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >1.1 <a
  28. href="#x1-30001.1" id="QQ2-1-3">Overview</a></span>
  29. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.1.1 <a
  30. href="#x1-40001.1.1" id="QQ2-1-4">Application</a></span>
  31. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.1.2 <a
  32. href="#x1-50001.1.2" id="QQ2-1-5">Classification</a></span>
  33. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.1.3 <a
  34. href="#x1-60001.1.3" id="QQ2-1-6">Assumptions</a></span>
  35. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.1.4 <a
  36. href="#x1-70001.1.4" id="QQ2-1-7">Codec Setup and Probability Model</a></span>
  37. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.1.5 <a
  38. href="#x1-90001.1.5" id="QQ2-1-9">Format Specification</a></span>
  39. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.1.6 <a
  40. href="#x1-100001.1.6" id="QQ2-1-10">Hardware Profile</a></span>
  41. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >1.2 <a
  42. href="#x1-110001.2" id="QQ2-1-11">Decoder Configuration</a></span>
  43. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.2.1 <a
  44. href="#x1-120001.2.1" id="QQ2-1-13">Global Config</a></span>
  45. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.2.2 <a
  46. href="#x1-130001.2.2" id="QQ2-1-14">Mode</a></span>
  47. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.2.3 <a
  48. href="#x1-140001.2.3" id="QQ2-1-15">Mapping</a></span>
  49. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.2.4 <a
  50. href="#x1-150001.2.4" id="QQ2-1-16">Floor</a></span>
  51. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.2.5 <a
  52. href="#x1-160001.2.5" id="QQ2-1-17">Residue</a></span>
  53. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.2.6 <a
  54. href="#x1-170001.2.6" id="QQ2-1-18">Codebooks</a></span>
  55. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >1.3 <a
  56. href="#x1-180001.3" id="QQ2-1-19">High-level Decode Process</a></span>
  57. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.3.1 <a
  58. href="#x1-190001.3.1" id="QQ2-1-20">Decode Setup</a></span>
  59. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >1.3.2 <a
  60. href="#x1-230001.3.2" id="QQ2-1-24">Decode Procedure</a></span>
  61. <br />&#x00A0;<span class="sectionToc" >2 <a
  62. href="#x1-360002" id="QQ2-1-39">Bitpacking Convention</a></span>
  63. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >2.1 <a
  64. href="#x1-370002.1" id="QQ2-1-40">Overview</a></span>
  65. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.1 <a
  66. href="#x1-380002.1.1" id="QQ2-1-41">octets, bytes and words</a></span>
  67. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.2 <a
  68. href="#x1-390002.1.2" id="QQ2-1-42">bit order</a></span>
  69. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.3 <a
  70. href="#x1-400002.1.3" id="QQ2-1-43">byte order</a></span>
  71. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.4 <a
  72. href="#x1-410002.1.4" id="QQ2-1-44">coding bits into byte sequences</a></span>
  73. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.5 <a
  74. href="#x1-420002.1.5" id="QQ2-1-45">signedness</a></span>
  75. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.6 <a
  76. href="#x1-430002.1.6" id="QQ2-1-46">coding example</a></span>
  77. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.7 <a
  78. href="#x1-440002.1.7" id="QQ2-1-47">decoding example</a></span>
  79. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.8 <a
  80. href="#x1-450002.1.8" id="QQ2-1-48">end-of-packet alignment</a></span>
  81. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >2.1.9 <a
  82. href="#x1-460002.1.9" id="QQ2-1-49">reading zero bits</a></span>
  83. <br />&#x00A0;<span class="sectionToc" >3 <a
  84. href="#x1-470003" id="QQ2-1-50">Probability Model and Codebooks</a></span>
  85. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >3.1 <a
  86. href="#x1-480003.1" id="QQ2-1-51">Overview</a></span>
  87. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >3.1.1 <a
  88. href="#x1-490003.1.1" id="QQ2-1-52">Bitwise operation</a></span>
  89. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >3.2 <a
  90. href="#x1-500003.2" id="QQ2-1-53">Packed codebook format</a></span>
  91. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >3.2.1 <a
  92. href="#x1-510003.2.1" id="QQ2-1-54">codebook decode</a></span>
  93. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >3.3 <a
  94. href="#x1-570003.3" id="QQ2-1-62">Use of the codebook abstraction</a></span>
  95. <br />&#x00A0;<span class="sectionToc" >4 <a
  96. href="#x1-580004" id="QQ2-1-63">Codec Setup and Packet Decode</a></span>
  97. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >4.1 <a
  98. href="#x1-590004.1" id="QQ2-1-64">Overview</a></span>
  99. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >4.2 <a
  100. href="#x1-600004.2" id="QQ2-1-65">Header decode and decode setup</a></span>
  101. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.2.1 <a
  102. href="#x1-610004.2.1" id="QQ2-1-66">Common header decode</a></span>
  103. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.2.2 <a
  104. href="#x1-620004.2.2" id="QQ2-1-67">Identification header</a></span>
  105. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.2.3 <a
  106. href="#x1-630004.2.3" id="QQ2-1-68">Comment header</a></span>
  107. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.2.4 <a
  108. href="#x1-640004.2.4" id="QQ2-1-69">Setup header</a></span>
  109. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >4.3 <a
  110. href="#x1-710004.3" id="QQ2-1-77">Audio packet decode and synthesis</a></span>
  111. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.1 <a
  112. href="#x1-720004.3.1" id="QQ2-1-78">packet type, mode and window decode</a></span>
  113. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.2 <a
  114. href="#x1-730004.3.2" id="QQ2-1-79">floor curve decode</a></span>
  115. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.3 <a
  116. href="#x1-740004.3.3" id="QQ2-1-80">nonzero vector propagate</a></span>
  117. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.4 <a
  118. href="#x1-750004.3.4" id="QQ2-1-81">residue decode</a></span>
  119. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.5 <a
  120. href="#x1-760004.3.5" id="QQ2-1-82">inverse coupling</a></span>
  121. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.6 <a
  122. href="#x1-770004.3.6" id="QQ2-1-83">dot product</a></span>
  123. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.7 <a
  124. href="#x1-780004.3.7" id="QQ2-1-84">inverse MDCT</a></span>
  125. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.8 <a
  126. href="#x1-790004.3.8" id="QQ2-1-85">overlap&#x02D9;add</a></span>
  127. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >4.3.9 <a
  128. href="#x1-800004.3.9" id="QQ2-1-86">output channel order</a></span>
  129. <br />&#x00A0;<span class="sectionToc" >5 <a
  130. href="#x1-810005" id="QQ2-1-87">comment field and header specification</a></span>
  131. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >5.1 <a
  132. href="#x1-820005.1" id="QQ2-1-88">Overview</a></span>
  133. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >5.2 <a
  134. href="#x1-830005.2" id="QQ2-1-89">Comment encoding</a></span>
  135. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >5.2.1 <a
  136. href="#x1-840005.2.1" id="QQ2-1-90">Structure</a></span>
  137. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >5.2.2 <a
  138. href="#x1-850005.2.2" id="QQ2-1-91">Content vector format</a></span>
  139. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >5.2.3 <a
  140. href="#x1-880005.2.3" id="QQ2-1-94">Encoding</a></span>
  141. <br />&#x00A0;<span class="sectionToc" >6 <a
  142. href="#x1-890006" id="QQ2-1-95">Floor type 0 setup and decode</a></span>
  143. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >6.1 <a
  144. href="#x1-900006.1" id="QQ2-1-96">Overview</a></span>
  145. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >6.2 <a
  146. href="#x1-910006.2" id="QQ2-1-97">Floor 0 format</a></span>
  147. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >6.2.1 <a
  148. href="#x1-920006.2.1" id="QQ2-1-98">header decode</a></span>
  149. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >6.2.2 <a
  150. href="#x1-930006.2.2" id="QQ2-1-99">packet decode</a></span>
  151. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >6.2.3 <a
  152. href="#x1-940006.2.3" id="QQ2-1-100">curve computation</a></span>
  153. <br />&#x00A0;<span class="sectionToc" >7 <a
  154. href="#x1-950007" id="QQ2-1-101">Floor type 1 setup and decode</a></span>
  155. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >7.1 <a
  156. href="#x1-960007.1" id="QQ2-1-102">Overview</a></span>
  157. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >7.2 <a
  158. href="#x1-970007.2" id="QQ2-1-103">Floor 1 format</a></span>
  159. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >7.2.1 <a
  160. href="#x1-980007.2.1" id="QQ2-1-104">model</a></span>
  161. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >7.2.2 <a
  162. href="#x1-990007.2.2" id="QQ2-1-109">header decode</a></span>
  163. <br />&#x00A0;<span class="sectionToc" >8 <a
  164. href="#x1-1020008" id="QQ2-1-112">Residue setup and decode</a></span>
  165. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >8.1 <a
  166. href="#x1-1030008.1" id="QQ2-1-113">Overview</a></span>
  167. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >8.2 <a
  168. href="#x1-1040008.2" id="QQ2-1-114">Residue format</a></span>
  169. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >8.3 <a
  170. href="#x1-1050008.3" id="QQ2-1-116">residue 0</a></span>
  171. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >8.4 <a
  172. href="#x1-1060008.4" id="QQ2-1-117">residue 1</a></span>
  173. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >8.5 <a
  174. href="#x1-1070008.5" id="QQ2-1-118">residue 2</a></span>
  175. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >8.6 <a
  176. href="#x1-1080008.6" id="QQ2-1-120">Residue decode</a></span>
  177. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >8.6.1 <a
  178. href="#x1-1090008.6.1" id="QQ2-1-121">header decode</a></span>
  179. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >8.6.2 <a
  180. href="#x1-1100008.6.2" id="QQ2-1-122">packet decode</a></span>
  181. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >8.6.3 <a
  182. href="#x1-1110008.6.3" id="QQ2-1-123">format 0 specifics</a></span>
  183. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >8.6.4 <a
  184. href="#x1-1120008.6.4" id="QQ2-1-124">format 1 specifics</a></span>
  185. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >8.6.5 <a
  186. href="#x1-1130008.6.5" id="QQ2-1-125">format 2 specifics</a></span>
  187. <br />&#x00A0;<span class="sectionToc" >9 <a
  188. href="#x1-1140009" id="QQ2-1-126">Helper equations</a></span>
  189. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >9.1 <a
  190. href="#x1-1150009.1" id="QQ2-1-127">Overview</a></span>
  191. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >9.2 <a
  192. href="#x1-1160009.2" id="QQ2-1-128">Functions</a></span>
  193. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >9.2.1 <a
  194. href="#x1-1170009.2.1" id="QQ2-1-129">ilog</a></span>
  195. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >9.2.2 <a
  196. href="#x1-1180009.2.2" id="QQ2-1-130">float32&#x02D9;unpack</a></span>
  197. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >9.2.3 <a
  198. href="#x1-1190009.2.3" id="QQ2-1-131">lookup1&#x02D9;values</a></span>
  199. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >9.2.4 <a
  200. href="#x1-1200009.2.4" id="QQ2-1-132">low&#x02D9;neighbor</a></span>
  201. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >9.2.5 <a
  202. href="#x1-1210009.2.5" id="QQ2-1-133">high&#x02D9;neighbor</a></span>
  203. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >9.2.6 <a
  204. href="#x1-1220009.2.6" id="QQ2-1-134">render&#x02D9;point</a></span>
  205. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >9.2.7 <a
  206. href="#x1-1230009.2.7" id="QQ2-1-135">render&#x02D9;line</a></span>
  207. <br />&#x00A0;<span class="sectionToc" >10 <a
  208. href="#x1-12400010" id="QQ2-1-136">Tables</a></span>
  209. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >10.1 <a
  210. href="#x1-12500010.1" id="QQ2-1-137">floor1_inverse_dB_table</a></span>
  211. <br />&#x00A0;<span class="sectionToc" >A <a
  212. href="#x1-126000A" id="QQ2-1-138">Embedding Vorbis into an Ogg stream</a></span>
  213. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >A.1 <a
  214. href="#x1-127000A.1" id="QQ2-1-139">Overview</a></span>
  215. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >A.1.1 <a
  216. href="#x1-128000A.1.1" id="QQ2-1-140">Restrictions</a></span>
  217. <br />&#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >A.1.2 <a
  218. href="#x1-129000A.1.2" id="QQ2-1-141">MIME type</a></span>
  219. <br />&#x00A0;&#x00A0;<span class="subsectionToc" >A.2 <a
  220. href="#x1-130000A.2" id="QQ2-1-142">Encapsulation</a></span>
  221. <br />&#x00A0;<span class="sectionToc" >B <a
  222. href="#x1-132000B" id="QQ2-1-144">Vorbis encapsulation in RTP</a></span>
  223. </div>
  224. <h3 class="sectionHead"><span class="titlemark">1 </span> <a
  225. id="x1-20001"></a>Introduction and Description</h3>
  226. <!--l. 6--><p class="noindent" >
  227. <h4 class="subsectionHead"><span class="titlemark">1.1 </span> <a
  228. id="x1-30001.1"></a>Overview</h4>
  229. <!--l. 8--><p class="noindent" >This document provides a high level description of the Vorbis codec&#8217;s construction. A bit-by-bit
  230. specification appears beginning in <a
  231. href="#x1-580004">Section&#x00A0;4<!--tex4ht:ref: vorbis:spec:codec --></a>, &#8220;<a
  232. href="#x1-580004">Codec Setup and Packet Decode<!--tex4ht:ref: vorbis:spec:codec --></a>&#8221;. The later
  233. sections assume a high-level understanding of the Vorbis decode process, which is provided
  234. here.
  235. <!--l. 15--><p class="noindent" >
  236. <h5 class="subsubsectionHead"><span class="titlemark">1.1.1 </span> <a
  237. id="x1-40001.1.1"></a>Application</h5>
  238. <!--l. 16--><p class="noindent" >Vorbis is a general purpose perceptual audio CODEC intended to allow maximum encoder
  239. flexibility, thus allowing it to scale competitively over an exceptionally wide range of bitrates. At
  240. the high quality/bitrate end of the scale (CD or DAT rate stereo, 16/24 bits) it is in the same
  241. league as MPEG-2 and MPC. Similarly, the 1.0 encoder can encode high-quality CD and DAT
  242. rate stereo at below 48kbps without resampling to a lower rate. Vorbis is also intended for lower
  243. and higher sample rates (from 8kHz telephony to 192kHz digital masters) and a range of channel
  244. representations (monaural, polyphonic, stereo, quadraphonic, 5.1, ambisonic, or up to 255
  245. discrete channels).
  246. <!--l. 29--><p class="noindent" >
  247. <h5 class="subsubsectionHead"><span class="titlemark">1.1.2 </span> <a
  248. id="x1-50001.1.2"></a>Classification</h5>
  249. <!--l. 30--><p class="noindent" >Vorbis I is a forward-adaptive monolithic transform CODEC based on the Modified Discrete
  250. Cosine Transform. The codec is structured to allow addition of a hybrid wavelet filterbank in
  251. Vorbis II to offer better transient response and reproduction using a transform better suited to
  252. localized time events.
  253. <!--l. 37--><p class="noindent" >
  254. <h5 class="subsubsectionHead"><span class="titlemark">1.1.3 </span> <a
  255. id="x1-60001.1.3"></a>Assumptions</h5>
  256. <!--l. 39--><p class="noindent" >The Vorbis CODEC design assumes a complex, psychoacoustically-aware encoder and simple,
  257. low-complexity decoder. Vorbis decode is computationally simpler than mp3, although it does
  258. require more working memory as Vorbis has no static probability model; the vector codebooks
  259. used in the first stage of decoding from the bitstream are packed in their entirety into the Vorbis
  260. bitstream headers. In packed form, these codebooks occupy only a few kilobytes; the extent to
  261. which they are pre-decoded into a cache is the dominant factor in decoder memory
  262. usage.
  263. <!--l. 50--><p class="noindent" >Vorbis provides none of its own framing, synchronization or protection against errors; it
  264. is solely a method of accepting input audio, dividing it into individual frames and
  265. compressing these frames into raw, unformatted &#8217;packets&#8217;. The decoder then accepts
  266. these raw packets in sequence, decodes them, synthesizes audio frames from them, and
  267. reassembles the frames into a facsimile of the original audio stream. Vorbis is a free-form
  268. variable bit rate (VBR) codec and packets have no minimum size, maximum size, or
  269. fixed/expected size. Packets are designed that they may be truncated (or padded)
  270. and remain decodable; this is not to be considered an error condition and is used
  271. extensively in bitrate management in peeling. Both the transport mechanism and
  272. decoder must allow that a packet may be any size, or end before or after packet decode
  273. expects.
  274. <!--l. 64--><p class="noindent" >Vorbis packets are thus intended to be used with a transport mechanism that provides free-form
  275. framing, sync, positioning and error correction in accordance with these design assumptions, such
  276. as Ogg (for file transport) or RTP (for network multicast). For purposes of a few examples in this
  277. document, we will assume that Vorbis is to be embedded in an Ogg stream specifically,
  278. although this is by no means a requirement or fundamental assumption in the Vorbis
  279. design.
  280. <!--l. 72--><p class="noindent" >The specification for embedding Vorbis into an Ogg transport stream is in <a
  281. href="#x1-126000A">Section&#x00A0;A<!--tex4ht:ref: vorbis:over:ogg --></a>,
  282. &#8220;<a
  283. href="#x1-126000A">Embedding Vorbis into an Ogg stream<!--tex4ht:ref: vorbis:over:ogg --></a>&#8221;.
  284. <!--l. 77--><p class="noindent" >
  285. <h5 class="subsubsectionHead"><span class="titlemark">1.1.4 </span> <a
  286. id="x1-70001.1.4"></a>Codec Setup and Probability Model</h5>
  287. <!--l. 79--><p class="noindent" >Vorbis&#8217; heritage is as a research CODEC and its current design reflects a desire to allow multiple
  288. decades of continuous encoder improvement before running out of room within the codec
  289. specification. For these reasons, configurable aspects of codec setup intentionally lean toward the
  290. extreme of forward adaptive.
  291. <!--l. 85--><p class="noindent" >The single most controversial design decision in Vorbis (and the most unusual for a Vorbis
  292. developer to keep in mind) is that the entire probability model of the codec, the Huffman and
  293. VQ codebooks, is packed into the bitstream header along with extensive CODEC setup
  294. parameters (often several hundred fields). This makes it impossible, as it would be with
  295. MPEG audio layers, to embed a simple frame type flag in each audio packet, or begin
  296. decode at any frame in the stream without having previously fetched the codec setup
  297. header.
  298. <!--l. 95--><p class="noindent" ><span class="likesubparagraphHead"><a
  299. id="x1-80001.1.4"></a><span
  300. class="cmbx-12">Note:</span></span> Vorbis <span
  301. class="cmti-12">can </span>initiate decode at any arbitrary packet within a bitstream so long as the codec
  302. has been initialized/setup with the setup headers.
  303. <!--l. 101--><p class="noindent" >Thus, Vorbis headers are both required for decode to begin and relatively large as bitstream
  304. headers go. The header size is unbounded, although for streaming a rule-of-thumb of 4kB or less
  305. is recommended (and Xiph.Org&#8217;s Vorbis encoder follows this suggestion).
  306. <!--l. 106--><p class="noindent" >Our own design work indicates the primary liability of the required header is in mindshare; it is
  307. an unusual design and thus causes some amount of complaint among engineers as this runs
  308. against current design trends (and also points out limitations in some existing software/interface
  309. designs, such as Windows&#8217; ACM codec framework). However, we find that it does not
  310. fundamentally limit Vorbis&#8217; suitable application space.
  311. <!--l. 115--><p class="noindent" >
  312. <h5 class="subsubsectionHead"><span class="titlemark">1.1.5 </span> <a
  313. id="x1-90001.1.5"></a>Format Specification</h5>
  314. <!--l. 116--><p class="noindent" >The Vorbis format is well-defined by its decode specification; any encoder that produces packets
  315. that are correctly decoded by the reference Vorbis decoder described below may be considered
  316. a proper Vorbis encoder. A decoder must faithfully and completely implement the
  317. specification defined below (except where noted) to be considered a proper Vorbis
  318. decoder.
  319. <!--l. 123--><p class="noindent" >
  320. <h5 class="subsubsectionHead"><span class="titlemark">1.1.6 </span> <a
  321. id="x1-100001.1.6"></a>Hardware Profile</h5>
  322. <!--l. 124--><p class="noindent" >Although Vorbis decode is computationally simple, it may still run into specific limitations of an
  323. embedded design. For this reason, embedded designs are allowed to deviate in limited ways from
  324. the &#8216;full&#8217; decode specification yet still be certified compliant. These optional omissions are
  325. labelled in the spec where relevant.
  326. <!--l. 131--><p class="noindent" >
  327. <h4 class="subsectionHead"><span class="titlemark">1.2 </span> <a
  328. id="x1-110001.2"></a>Decoder Configuration</h4>
  329. <!--l. 133--><p class="noindent" >Decoder setup consists of configuration of multiple, self-contained component abstractions that
  330. perform specific functions in the decode pipeline. Each different component instance of a specific
  331. type is semantically interchangeable; decoder configuration consists both of internal component
  332. configuration, as well as arrangement of specific instances into a decode pipeline. Componentry
  333. arrangement is roughly as follows:
  334. <div class="center"
  335. >
  336. <!--l. 141--><p class="noindent" >
  337. <!--l. 142--><p class="noindent" ><img
  338. src="components.png" alt="PIC"
  339. >
  340. <br /> <table class="caption"
  341. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;1: </td><td
  342. class="content">decoder pipeline configuration</td></tr></table><!--tex4ht:label?: x1-110011 -->
  343. </div>
  344. <!--l. 146--><p class="noindent" >
  345. <h5 class="subsubsectionHead"><span class="titlemark">1.2.1 </span> <a
  346. id="x1-120001.2.1"></a>Global Config</h5>
  347. <!--l. 147--><p class="noindent" >Global codec configuration consists of a few audio related fields (sample rate, channels), Vorbis
  348. version (always &#8217;0&#8217; in Vorbis I), bitrate hints, and the lists of component instances. All other
  349. configuration is in the context of specific components.
  350. <!--l. 152--><p class="noindent" >
  351. <h5 class="subsubsectionHead"><span class="titlemark">1.2.2 </span> <a
  352. id="x1-130001.2.2"></a>Mode</h5>
  353. <!--l. 154--><p class="noindent" >Each Vorbis frame is coded according to a master &#8217;mode&#8217;. A bitstream may use one or many
  354. modes.
  355. <!--l. 157--><p class="noindent" >The mode mechanism is used to encode a frame according to one of multiple possible
  356. methods with the intention of choosing a method best suited to that frame. Different
  357. modes are, e.g. how frame size is changed from frame to frame. The mode number of a
  358. frame serves as a top level configuration switch for all other specific aspects of frame
  359. decode.
  360. <!--l. 164--><p class="noindent" >A &#8217;mode&#8217; configuration consists of a frame size setting, window type (always 0, the Vorbis
  361. window, in Vorbis I), transform type (always type 0, the MDCT, in Vorbis I) and a mapping
  362. number. The mapping number specifies which mapping configuration instance to use for low-level
  363. packet decode and synthesis.
  364. <!--l. 171--><p class="noindent" >
  365. <h5 class="subsubsectionHead"><span class="titlemark">1.2.3 </span> <a
  366. id="x1-140001.2.3"></a>Mapping</h5>
  367. <!--l. 173--><p class="noindent" >A mapping contains a channel coupling description and a list of &#8217;submaps&#8217; that bundle sets
  368. of channel vectors together for grouped encoding and decoding. These submaps are
  369. not references to external components; the submap list is internal and specific to a
  370. mapping.
  371. <!--l. 178--><p class="noindent" >A &#8217;submap&#8217; is a configuration/grouping that applies to a subset of floor and residue vectors
  372. within a mapping. The submap functions as a last layer of indirection such that specific special
  373. floor or residue settings can be applied not only to all the vectors in a given mode, but also
  374. specific vectors in a specific mode. Each submap specifies the proper floor and residue
  375. instance number to use for decoding that submap&#8217;s spectral floor and spectral residue
  376. vectors.
  377. <!--l. 186--><p class="noindent" >As an example:
  378. <!--l. 188--><p class="noindent" >Assume a Vorbis stream that contains six channels in the standard 5.1 format. The sixth
  379. channel, as is normal in 5.1, is bass only. Therefore it would be wasteful to encode a
  380. full-spectrum version of it as with the other channels. The submapping mechanism can be used
  381. to apply a full range floor and residue encoding to channels 0 through 4, and a bass-only
  382. representation to the bass channel, thus saving space. In this example, channels 0-4 belong to
  383. submap 0 (which indicates use of a full-range floor) and channel 5 belongs to submap 1, which
  384. uses a bass-only representation.
  385. <!--l. 199--><p class="noindent" >
  386. <h5 class="subsubsectionHead"><span class="titlemark">1.2.4 </span> <a
  387. id="x1-150001.2.4"></a>Floor</h5>
  388. <!--l. 201--><p class="noindent" >Vorbis encodes a spectral &#8217;floor&#8217; vector for each PCM channel. This vector is a low-resolution
  389. representation of the audio spectrum for the given channel in the current frame, generally used
  390. akin to a whitening filter. It is named a &#8217;floor&#8217; because the Xiph.Org reference encoder has
  391. historically used it as a unit-baseline for spectral resolution.
  392. <!--l. 208--><p class="noindent" >A floor encoding may be of two types. Floor 0 uses a packed LSP representation on a dB
  393. amplitude scale and Bark frequency scale. Floor 1 represents the curve as a piecewise linear
  394. interpolated representation on a dB amplitude scale and linear frequency scale. The two floors
  395. are semantically interchangeable in encoding/decoding. However, floor type 1 provides more
  396. stable inter-frame behavior, and so is the preferred choice in all coupled-stereo and
  397. high bitrate modes. Floor 1 is also considerably less expensive to decode than floor
  398. 0.
  399. <!--l. 218--><p class="noindent" >Floor 0 is not to be considered deprecated, but it is of limited modern use. No known Vorbis
  400. encoder past Xiph.org&#8217;s own beta 4 makes use of floor 0.
  401. <!--l. 222--><p class="noindent" >The values coded/decoded by a floor are both compactly formatted and make use of entropy
  402. coding to save space. For this reason, a floor configuration generally refers to multiple
  403. codebooks in the codebook component list. Entropy coding is thus provided as an
  404. abstraction, and each floor instance may choose from any and all available codebooks when
  405. coding/decoding.
  406. <!--l. 230--><p class="noindent" >
  407. <h5 class="subsubsectionHead"><span class="titlemark">1.2.5 </span> <a
  408. id="x1-160001.2.5"></a>Residue</h5>
  409. <!--l. 231--><p class="noindent" >The spectral residue is the fine structure of the audio spectrum once the floor curve has been
  410. subtracted out. In simplest terms, it is coded in the bitstream using cascaded (multi-pass) vector
  411. quantization according to one of three specific packing/coding algorithms numbered
  412. 0 through 2. The packing algorithm details are configured by residue instance. As
  413. with the floor components, the final VQ/entropy encoding is provided by external
  414. codebook instances and each residue instance may choose from any and all available
  415. codebooks.
  416. <!--l. 241--><p class="noindent" >
  417. <h5 class="subsubsectionHead"><span class="titlemark">1.2.6 </span> <a
  418. id="x1-170001.2.6"></a>Codebooks</h5>
  419. <!--l. 243--><p class="noindent" >Codebooks are a self-contained abstraction that perform entropy decoding and, optionally, use
  420. the entropy-decoded integer value as an offset into an index of output value vectors, returning
  421. the indicated vector of values.
  422. <!--l. 248--><p class="noindent" >The entropy coding in a Vorbis I codebook is provided by a standard Huffman binary tree
  423. representation. This tree is tightly packed using one of several methods, depending on whether
  424. codeword lengths are ordered or unordered, or the tree is sparse.
  425. <!--l. 253--><p class="noindent" >The codebook vector index is similarly packed according to index characteristic. Most commonly,
  426. the vector index is encoded as a single list of values of possible values that are then permuted
  427. into a list of n-dimensional rows (lattice VQ).
  428. <!--l. 260--><p class="noindent" >
  429. <h4 class="subsectionHead"><span class="titlemark">1.3 </span> <a
  430. id="x1-180001.3"></a>High-level Decode Process</h4>
  431. <!--l. 262--><p class="noindent" >
  432. <h5 class="subsubsectionHead"><span class="titlemark">1.3.1 </span> <a
  433. id="x1-190001.3.1"></a>Decode Setup</h5>
  434. <!--l. 264--><p class="noindent" >Before decoding can begin, a decoder must initialize using the bitstream headers matching the
  435. stream to be decoded. Vorbis uses three header packets; all are required, in-order, by
  436. this specification. Once set up, decode may begin at any audio packet belonging to
  437. the Vorbis stream. In Vorbis I, all packets after the three initial headers are audio
  438. packets.
  439. <!--l. 271--><p class="noindent" >The header packets are, in order, the identification header, the comments header, and the setup
  440. header.
  441. <!--l. 274--><p class="noindent" ><span class="paragraphHead"><a
  442. id="x1-200001.3.1"></a><span
  443. class="cmbx-12">Identification Header</span></span>
  444. The identification header identifies the bitstream as Vorbis, Vorbis version, and the simple audio
  445. characteristics of the stream such as sample rate and number of channels.
  446. <!--l. 279--><p class="noindent" ><span class="paragraphHead"><a
  447. id="x1-210001.3.1"></a><span
  448. class="cmbx-12">Comment Header</span></span>
  449. The comment header includes user text comments (&#8220;tags&#8221;) and a vendor string for the
  450. application/library that produced the bitstream. The encoding and proper use of the comment
  451. header is described in <a
  452. href="#x1-810005">Section&#x00A0;5<!--tex4ht:ref: vorbis:spec:comment --></a>, &#8220;<a
  453. href="#x1-810005">comment field and header specification<!--tex4ht:ref: vorbis:spec:comment --></a>&#8221;.
  454. <!--l. 284--><p class="noindent" ><span class="paragraphHead"><a
  455. id="x1-220001.3.1"></a><span
  456. class="cmbx-12">Setup Header</span></span>
  457. The setup header includes extensive CODEC setup information as well as the complete VQ and
  458. Huffman codebooks needed for decode.
  459. <!--l. 289--><p class="noindent" >
  460. <h5 class="subsubsectionHead"><span class="titlemark">1.3.2 </span> <a
  461. id="x1-230001.3.2"></a>Decode Procedure</h5>
  462. <!--l. 291--><p class="noindent" >The decoding and synthesis procedure for all audio packets is fundamentally the same.
  463. <ol class="enumerate1" >
  464. <li
  465. class="enumerate" id="x1-23002x1">decode packet type flag
  466. </li>
  467. <li
  468. class="enumerate" id="x1-23004x2">decode mode number
  469. </li>
  470. <li
  471. class="enumerate" id="x1-23006x3">decode window shape (long windows only)
  472. </li>
  473. <li
  474. class="enumerate" id="x1-23008x4">decode floor
  475. </li>
  476. <li
  477. class="enumerate" id="x1-23010x5">decode residue into residue vectors
  478. </li>
  479. <li
  480. class="enumerate" id="x1-23012x6">inverse channel coupling of residue vectors
  481. </li>
  482. <li
  483. class="enumerate" id="x1-23014x7">generate floor curve from decoded floor data
  484. </li>
  485. <li
  486. class="enumerate" id="x1-23016x8">compute dot product of floor and residue, producing audio spectrum vector
  487. </li>
  488. <li
  489. class="enumerate" id="x1-23018x9">inverse monolithic transform of audio spectrum vector, always an MDCT in Vorbis
  490. I
  491. </li>
  492. <li
  493. class="enumerate" id="x1-23020x10">overlap/add left-hand output of transform with right-hand output of previous frame
  494. </li>
  495. <li
  496. class="enumerate" id="x1-23022x11">store right hand-data from transform of current frame for future lapping
  497. </li>
  498. <li
  499. class="enumerate" id="x1-23024x12">if not first frame, return results of overlap/add as audio result of current frame</li></ol>
  500. <!--l. 308--><p class="noindent" >Note that clever rearrangement of the synthesis arithmetic is possible; as an example, one can
  501. take advantage of symmetries in the MDCT to store the right-hand transform data of a partial
  502. MDCT for a 50% inter-frame buffer space savings, and then complete the transform later before
  503. overlap/add with the next frame. This optimization produces entirely equivalent output and is
  504. naturally perfectly legal. The decoder must be <span
  505. class="cmti-12">entirely mathematically equivalent </span>to the
  506. specification, it need not be a literal semantic implementation.
  507. <!--l. 317--><p class="noindent" ><span class="paragraphHead"><a
  508. id="x1-240001.3.2"></a><span
  509. class="cmbx-12">Packet type decode</span></span>
  510. Vorbis I uses four packet types. The first three packet types mark each of the three Vorbis
  511. headers described above. The fourth packet type marks an audio packet. All other packet types
  512. are reserved; packets marked with a reserved type should be ignored.
  513. <!--l. 324--><p class="noindent" >Following the three header packets, all packets in a Vorbis I stream are audio. The first step of
  514. audio packet decode is to read and verify the packet type; <span
  515. class="cmti-12">a non-audio packet when audio is</span>
  516. <span
  517. class="cmti-12">expected indicates stream corruption or a non-compliant stream. The decoder must ignore the</span>
  518. <span
  519. class="cmti-12">packet and not attempt decoding it to audio</span>.
  520. <!--l. 334--><p class="noindent" ><span class="paragraphHead"><a
  521. id="x1-250001.3.2"></a><span
  522. class="cmbx-12">Mode decode</span></span>
  523. Vorbis allows an encoder to set up multiple, numbered packet &#8217;modes&#8217;, as described earlier, all of
  524. which may be used in a given Vorbis stream. The mode is encoded as an integer used as a direct
  525. offset into the mode instance index.
  526. <!--l. 341--><p class="noindent" ><span class="paragraphHead"><a
  527. id="x1-260001.3.2"></a><span
  528. class="cmbx-12">Window shape decode (long windows only)</span></span>
  529. Vorbis frames may be one of two PCM sample sizes specified during codec setup. In Vorbis I,
  530. legal frame sizes are powers of two from 64 to 8192 samples. Aside from coupling, Vorbis
  531. handles channels as independent vectors and these frame sizes are in samples per
  532. channel.
  533. <!--l. 348--><p class="noindent" >Vorbis uses an overlapping transform, namely the MDCT, to blend one frame into the next,
  534. avoiding most inter-frame block boundary artifacts. The MDCT output of one frame is windowed
  535. according to MDCT requirements, overlapped 50% with the output of the previous frame and
  536. added. The window shape assures seamless reconstruction.
  537. <!--l. 354--><p class="noindent" >This is easy to visualize in the case of equal sized-windows:
  538. <div class="center"
  539. >
  540. <!--l. 356--><p class="noindent" >
  541. <!--l. 357--><p class="noindent" ><img
  542. src="window1.png" alt="PIC"
  543. >
  544. <br /> <table class="caption"
  545. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;2: </td><td
  546. class="content">overlap of two equal-sized windows</td></tr></table><!--tex4ht:label?: x1-260012 -->
  547. </div>
  548. <!--l. 361--><p class="noindent" >And slightly more complex in the case of overlapping unequal sized windows:
  549. <div class="center"
  550. >
  551. <!--l. 364--><p class="noindent" >
  552. <!--l. 365--><p class="noindent" ><img
  553. src="window2.png" alt="PIC"
  554. >
  555. <br /> <table class="caption"
  556. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;3: </td><td
  557. class="content">overlap of a long and a short window</td></tr></table><!--tex4ht:label?: x1-260023 -->
  558. </div>
  559. <!--l. 369--><p class="noindent" >In the unequal-sized window case, the window shape of the long window must be modified for
  560. seamless lapping as above. It is possible to correctly infer window shape to be applied to the
  561. current window from knowing the sizes of the current, previous and next window. It is legal for a
  562. decoder to use this method. However, in the case of a long window (short windows require no
  563. modification), Vorbis also codes two flag bits to specify pre- and post- window shape. Although
  564. not strictly necessary for function, this minor redundancy allows a packet to be fully decoded to
  565. the point of lapping entirely independently of any other packet, allowing easier abstraction of
  566. decode layers as well as allowing a greater level of easy parallelism in encode and
  567. decode.
  568. <!--l. 382--><p class="noindent" >A description of valid window functions for use with an inverse MDCT can be found in <span class="cite">[<a
  569. href="#XSporer/Brandenburg/Edler">1</a>]</span>.
  570. Vorbis windows all use the slope function
  571. <center class="math-display" >
  572. <img
  573. src="Vorbis_I_spec0x.png" alt="y = sin (.5 * &#x03C0; sin2((x + .5)&#x2215;n * &#x03C0;)).
  574. " class="math-display" ></center>
  575. <!--l. 385--><p class="nopar" >
  576. <!--l. 389--><p class="noindent" ><span class="paragraphHead"><a
  577. id="x1-270001.3.2"></a><span
  578. class="cmbx-12">floor decode</span></span>
  579. Each floor is encoded/decoded in channel order, however each floor belongs to a &#8217;submap&#8217; that
  580. specifies which floor configuration to use. All floors are decoded before residue decode
  581. begins.
  582. <!--l. 395--><p class="noindent" ><span class="paragraphHead"><a
  583. id="x1-280001.3.2"></a><span
  584. class="cmbx-12">residue decode</span></span>
  585. Although the number of residue vectors equals the number of channels, channel coupling may
  586. mean that the raw residue vectors extracted during decode do not map directly to specific
  587. channels. When channel coupling is in use, some vectors will correspond to coupled magnitude or
  588. angle. The coupling relationships are described in the codec setup and may differ from frame to
  589. frame, due to different mode numbers.
  590. <!--l. 404--><p class="noindent" >Vorbis codes residue vectors in groups by submap; the coding is done in submap order from
  591. submap 0 through n-1. This differs from floors which are coded using a configuration provided by
  592. submap number, but are coded individually in channel order.
  593. <!--l. 411--><p class="noindent" ><span class="paragraphHead"><a
  594. id="x1-290001.3.2"></a><span
  595. class="cmbx-12">inverse channel coupling</span></span>
  596. A detailed discussion of stereo in the Vorbis codec can be found in the document
  597. <a
  598. href="stereo.html" >Stereo Channel Coupling in the Vorbis CODEC</a>. Vorbis is not limited to only stereo
  599. coupling, but the stereo document also gives a good overview of the generic coupling
  600. mechanism.
  601. <!--l. 419--><p class="noindent" >Vorbis coupling applies to pairs of residue vectors at a time; decoupling is done in-place a
  602. pair at a time in the order and using the vectors specified in the current mapping
  603. configuration. The decoupling operation is the same for all pairs, converting square polar
  604. representation (where one vector is magnitude and the second angle) back to Cartesian
  605. representation.
  606. <!--l. 426--><p class="noindent" >After decoupling, in order, each pair of vectors on the coupling list, the resulting residue vectors
  607. represent the fine spectral detail of each output channel.
  608. <!--l. 432--><p class="noindent" ><span class="paragraphHead"><a
  609. id="x1-300001.3.2"></a><span
  610. class="cmbx-12">generate floor curve</span></span>
  611. The decoder may choose to generate the floor curve at any appropriate time. It is reasonable to
  612. generate the output curve when the floor data is decoded from the raw packet, or it
  613. can be generated after inverse coupling and applied to the spectral residue directly,
  614. combining generation and the dot product into one step and eliminating some working
  615. space.
  616. <!--l. 441--><p class="noindent" >Both floor 0 and floor 1 generate a linear-range, linear-domain output vector to be multiplied
  617. (dot product) by the linear-range, linear-domain spectral residue.
  618. <!--l. 447--><p class="noindent" ><span class="paragraphHead"><a
  619. id="x1-310001.3.2"></a><span
  620. class="cmbx-12">compute floor/residue dot product</span></span>
  621. This step is straightforward; for each output channel, the decoder multiplies the floor curve and
  622. residue vectors element by element, producing the finished audio spectrum of each
  623. channel.
  624. <!--l. 455--><p class="noindent" >One point is worth mentioning about this dot product; a common mistake in a fixed point
  625. implementation might be to assume that a 32 bit fixed-point representation for floor and
  626. residue and direct multiplication of the vectors is sufficient for acceptable spectral depth
  627. in all cases because it happens to mostly work with the current Xiph.Org reference
  628. encoder.
  629. <!--l. 462--><p class="noindent" >However, floor vector values can span <span
  630. class="cmsy-10x-x-120">~</span>140dB (<span
  631. class="cmsy-10x-x-120">~</span>24 bits unsigned), and the audio spectrum
  632. vector should represent a minimum of 120dB (<span
  633. class="cmsy-10x-x-120">~</span>21 bits with sign), even when output is to a 16
  634. bit PCM device. For the residue vector to represent full scale if the floor is nailed
  635. to <span
  636. class="cmsy-10x-x-120">-</span>140dB, it must be able to span 0 to +140dB. For the residue vector to reach
  637. full scale if the floor is nailed at 0dB, it must be able to represent <span
  638. class="cmsy-10x-x-120">-</span>140dB to +0dB.
  639. Thus, in order to handle full range dynamics, a residue vector may span <span
  640. class="cmsy-10x-x-120">-</span>140dB to
  641. +140dB entirely within spec. A 280dB range is approximately 48 bits with sign; thus the
  642. residue vector must be able to represent a 48 bit range and the dot product must
  643. be able to handle an effective 48 bit times 24 bit multiplication. This range may be
  644. achieved using large (64 bit or larger) integers, or implementing a movable binary point
  645. representation.
  646. <!--l. 479--><p class="noindent" ><span class="paragraphHead"><a
  647. id="x1-320001.3.2"></a><span
  648. class="cmbx-12">inverse monolithic transform (MDCT)</span></span>
  649. The audio spectrum is converted back into time domain PCM audio via an inverse Modified
  650. Discrete Cosine Transform (MDCT). A detailed description of the MDCT is available in
  651. <span class="cite">[<a
  652. href="#XSporer/Brandenburg/Edler">1</a>]</span>.
  653. <!--l. 485--><p class="noindent" >Note that the PCM produced directly from the MDCT is not yet finished audio; it must be
  654. lapped with surrounding frames using an appropriate window (such as the Vorbis window) before
  655. the MDCT can be considered orthogonal.
  656. <!--l. 492--><p class="noindent" ><span class="paragraphHead"><a
  657. id="x1-330001.3.2"></a><span
  658. class="cmbx-12">overlap/add data</span></span>
  659. Windowed MDCT output is overlapped and added with the right hand data of the previous
  660. window such that the 3/4 point of the previous window is aligned with the 1/4 point of the
  661. current window (as illustrated in the window overlap diagram). At this point, the audio data
  662. between the center of the previous frame and the center of the current frame is now finished and
  663. ready to be returned.
  664. <!--l. 501--><p class="noindent" ><span class="paragraphHead"><a
  665. id="x1-340001.3.2"></a><span
  666. class="cmbx-12">cache right hand data</span></span>
  667. The decoder must cache the right hand portion of the current frame to be lapped with the left
  668. hand portion of the next frame.
  669. <!--l. 507--><p class="noindent" ><span class="paragraphHead"><a
  670. id="x1-350001.3.2"></a><span
  671. class="cmbx-12">return finished audio data</span></span>
  672. The overlapped portion produced from overlapping the previous and current frame data
  673. is finished data to be returned by the decoder. This data spans from the center of
  674. the previous window to the center of the current window. In the case of same-sized
  675. windows, the amount of data to return is one-half block consisting of and only of the
  676. overlapped portions. When overlapping a short and long window, much of the returned
  677. range is not actually overlap. This does not damage transform orthogonality. Pay
  678. attention however to returning the correct data range; the amount of data to be returned
  679. is:
  680. <!--l. 519--><p class="noindent" >
  681. <div class="fancyvrb" id="fancyvrb1">
  682. <a
  683. id="x1-35002r1"></a><span
  684. class="cmr-6">1</span><span
  685. class="cmtt-8">&#x00A0;</span><span
  686. class="cmtt-8">&#x00A0;window_blocksize(previous_window)/4+window_blocksize(current_window)/4</span>
  687. </div>
  688. <!--l. 523--><p class="noindent" >from the center of the previous window to the center of the current window.
  689. <!--l. 526--><p class="noindent" >Data is not returned from the first frame; it must be used to &#8217;prime&#8217; the decode engine. The
  690. encoder accounts for this priming when calculating PCM offsets; after the first frame, the proper
  691. PCM output offset is &#8217;0&#8217; (as no data has been returned yet).
  692. <h3 class="sectionHead"><span class="titlemark">2 </span> <a
  693. id="x1-360002"></a>Bitpacking Convention</h3>
  694. <!--l. 6--><p class="noindent" >
  695. <h4 class="subsectionHead"><span class="titlemark">2.1 </span> <a
  696. id="x1-370002.1"></a>Overview</h4>
  697. <!--l. 8--><p class="noindent" >The Vorbis codec uses relatively unstructured raw packets containing arbitrary-width binary
  698. integer fields. Logically, these packets are a bitstream in which bits are coded one-by-one by the
  699. encoder and then read one-by-one in the same monotonically increasing order by the decoder.
  700. Most current binary storage arrangements group bits into a native word size of eight bits
  701. (octets), sixteen bits, thirty-two bits or, less commonly other fixed word sizes. The Vorbis
  702. bitpacking convention specifies the correct mapping of the logical packet bitstream into an actual
  703. representation in fixed-width words.
  704. <!--l. 19--><p class="noindent" >
  705. <h5 class="subsubsectionHead"><span class="titlemark">2.1.1 </span> <a
  706. id="x1-380002.1.1"></a>octets, bytes and words</h5>
  707. <!--l. 21--><p class="noindent" >In most contemporary architectures, a &#8217;byte&#8217; is synonymous with an &#8217;octet&#8217;, that is, eight bits.
  708. This has not always been the case; seven, ten, eleven and sixteen bit &#8217;bytes&#8217; have been used.
  709. For purposes of the bitpacking convention, a byte implies the native, smallest integer
  710. storage representation offered by a platform. On modern platforms, this is generally
  711. assumed to be eight bits (not necessarily because of the processor but because of the
  712. filesystem/memory architecture. Modern filesystems invariably offer bytes as the fundamental
  713. atom of storage). A &#8217;word&#8217; is an integer size that is a grouped multiple of this smallest
  714. size.
  715. <!--l. 32--><p class="noindent" >The most ubiquitous architectures today consider a &#8217;byte&#8217; to be an octet (eight bits) and a word
  716. to be a group of two, four or eight bytes (16, 32 or 64 bits). Note however that the Vorbis
  717. bitpacking convention is still well defined for any native byte size; Vorbis uses the native
  718. bit-width of a given storage system. This document assumes that a byte is one octet for purposes
  719. of example.
  720. <!--l. 39--><p class="noindent" >
  721. <h5 class="subsubsectionHead"><span class="titlemark">2.1.2 </span> <a
  722. id="x1-390002.1.2"></a>bit order</h5>
  723. <!--l. 41--><p class="noindent" >A byte has a well-defined &#8217;least significant&#8217; bit (LSb), which is the only bit set when the byte is
  724. storing the two&#8217;s complement integer value +1. A byte&#8217;s &#8217;most significant&#8217; bit (MSb) is at the
  725. opposite end of the byte. Bits in a byte are numbered from zero at the LSb to <span
  726. class="cmmi-12">n </span>(<span
  727. class="cmmi-12">n </span>= 7 in an
  728. octet) for the MSb.
  729. <!--l. 50--><p class="noindent" >
  730. <h5 class="subsubsectionHead"><span class="titlemark">2.1.3 </span> <a
  731. id="x1-400002.1.3"></a>byte order</h5>
  732. <!--l. 52--><p class="noindent" >Words are native groupings of multiple bytes. Several byte orderings are possible in a word; the
  733. common ones are 3-2-1-0 (&#8217;big endian&#8217; or &#8217;most significant byte first&#8217; in which the
  734. highest-valued byte comes first), 0-1-2-3 (&#8217;little endian&#8217; or &#8217;least significant byte first&#8217; in
  735. which the lowest value byte comes first) and less commonly 3-1-2-0 and 0-2-1-3 (&#8217;mixed
  736. endian&#8217;).
  737. <!--l. 59--><p class="noindent" >The Vorbis bitpacking convention specifies storage and bitstream manipulation at the byte, not
  738. word, level, thus host word ordering is of a concern only during optimization when writing high
  739. performance code that operates on a word of storage at a time rather than by byte.
  740. Logically, bytes are always coded and decoded in order from byte zero through byte
  741. <span
  742. class="cmmi-12">n</span>.
  743. <!--l. 68--><p class="noindent" >
  744. <h5 class="subsubsectionHead"><span class="titlemark">2.1.4 </span> <a
  745. id="x1-410002.1.4"></a>coding bits into byte sequences</h5>
  746. <!--l. 70--><p class="noindent" >The Vorbis codec has need to code arbitrary bit-width integers, from zero to 32 bits
  747. wide, into packets. These integer fields are not aligned to the boundaries of the byte
  748. representation; the next field is written at the bit position at which the previous field
  749. ends.
  750. <!--l. 75--><p class="noindent" >The encoder logically packs integers by writing the LSb of a binary integer to the logical
  751. bitstream first, followed by next least significant bit, etc, until the requested number of bits
  752. have been coded. When packing the bits into bytes, the encoder begins by placing
  753. the LSb of the integer to be written into the least significant unused bit position of
  754. the destination byte, followed by the next-least significant bit of the source integer
  755. and so on up to the requested number of bits. When all bits of the destination byte
  756. have been filled, encoding continues by zeroing all bits of the next byte and writing
  757. the next bit into the bit position 0 of that byte. Decoding follows the same process
  758. as encoding, but by reading bits from the byte stream and reassembling them into
  759. integers.
  760. <!--l. 90--><p class="noindent" >
  761. <h5 class="subsubsectionHead"><span class="titlemark">2.1.5 </span> <a
  762. id="x1-420002.1.5"></a>signedness</h5>
  763. <!--l. 92--><p class="noindent" >The signedness of a specific number resulting from decode is to be interpreted by the decoder
  764. given decode context. That is, the three bit binary pattern &#8217;b111&#8217; can be taken to represent
  765. either &#8217;seven&#8217; as an unsigned integer, or &#8217;-1&#8217; as a signed, two&#8217;s complement integer. The
  766. encoder and decoder are responsible for knowing if fields are to be treated as signed or
  767. unsigned.
  768. <!--l. 101--><p class="noindent" >
  769. <h5 class="subsubsectionHead"><span class="titlemark">2.1.6 </span> <a
  770. id="x1-430002.1.6"></a>coding example</h5>
  771. <!--l. 103--><p class="noindent" >Code the 4 bit integer value &#8217;12&#8217; [b1100] into an empty bytestream. Bytestream result:
  772. <!--l. 106--><p class="noindent" >
  773. <div class="fancyvrb" id="fancyvrb2">
  774. <a
  775. id="x1-43002r1"></a><span
  776. class="cmr-6">1</span><span
  777. class="cmtt-8">&#x00A0;</span><span
  778. class="cmtt-8">&#x00A0;</span><span
  779. class="cmtt-8">&#x00A0;</span><span
  780. class="cmtt-8">&#x00A0;</span><span
  781. class="cmtt-8">&#x00A0;</span><span
  782. class="cmtt-8">&#x00A0;</span><span
  783. class="cmtt-8">&#x00A0;</span><span
  784. class="cmtt-8">&#x00A0;</span><span
  785. class="cmtt-8">&#x00A0;</span><span
  786. class="cmtt-8">&#x00A0;</span><span
  787. class="cmtt-8">&#x00A0;</span><span
  788. class="cmtt-8">&#x00A0;</span><span
  789. class="cmtt-8">&#x00A0;</span><span
  790. class="cmtt-8">&#x00A0;</span><span
  791. class="cmtt-8">&#x00A0;</span><span
  792. class="cmtt-8">&#x00A0;|</span>
  793. <br class="fancyvrb" /><a
  794. id="x1-43004r2"></a><span
  795. class="cmr-6">2</span><span
  796. class="cmtt-8">&#x00A0;</span><span
  797. class="cmtt-8">&#x00A0;</span><span
  798. class="cmtt-8">&#x00A0;</span><span
  799. class="cmtt-8">&#x00A0;</span><span
  800. class="cmtt-8">&#x00A0;</span><span
  801. class="cmtt-8">&#x00A0;</span><span
  802. class="cmtt-8">&#x00A0;</span><span
  803. class="cmtt-8">&#x00A0;</span><span
  804. class="cmtt-8">&#x00A0;</span><span
  805. class="cmtt-8">&#x00A0;</span><span
  806. class="cmtt-8">&#x00A0;</span><span
  807. class="cmtt-8">&#x00A0;</span><span
  808. class="cmtt-8">&#x00A0;</span><span
  809. class="cmtt-8">&#x00A0;</span><span
  810. class="cmtt-8">&#x00A0;</span><span
  811. class="cmtt-8">&#x00A0;V</span>
  812. <br class="fancyvrb" /><a
  813. id="x1-43006r3"></a><span
  814. class="cmr-6">3</span><span
  815. class="cmtt-8">&#x00A0;</span><span
  816. class="cmtt-8">&#x00A0;</span>
  817. <br class="fancyvrb" /><a
  818. id="x1-43008r4"></a><span
  819. class="cmr-6">4</span><span
  820. class="cmtt-8">&#x00A0;</span><span
  821. class="cmtt-8">&#x00A0;</span><span
  822. class="cmtt-8">&#x00A0;</span><span
  823. class="cmtt-8">&#x00A0;</span><span
  824. class="cmtt-8">&#x00A0;</span><span
  825. class="cmtt-8">&#x00A0;</span><span
  826. class="cmtt-8">&#x00A0;</span><span
  827. class="cmtt-8">&#x00A0;</span><span
  828. class="cmtt-8">&#x00A0;</span><span
  829. class="cmtt-8">&#x00A0;7</span><span
  830. class="cmtt-8">&#x00A0;6</span><span
  831. class="cmtt-8">&#x00A0;5</span><span
  832. class="cmtt-8">&#x00A0;4</span><span
  833. class="cmtt-8">&#x00A0;3</span><span
  834. class="cmtt-8">&#x00A0;2</span><span
  835. class="cmtt-8">&#x00A0;1</span><span
  836. class="cmtt-8">&#x00A0;0</span>
  837. <br class="fancyvrb" /><a
  838. id="x1-43010r5"></a><span
  839. class="cmr-6">5</span><span
  840. class="cmtt-8">&#x00A0;</span><span
  841. class="cmtt-8">&#x00A0;byte</span><span
  842. class="cmtt-8">&#x00A0;0</span><span
  843. class="cmtt-8">&#x00A0;[0</span><span
  844. class="cmtt-8">&#x00A0;0</span><span
  845. class="cmtt-8">&#x00A0;0</span><span
  846. class="cmtt-8">&#x00A0;0</span><span
  847. class="cmtt-8">&#x00A0;1</span><span
  848. class="cmtt-8">&#x00A0;1</span><span
  849. class="cmtt-8">&#x00A0;0</span><span
  850. class="cmtt-8">&#x00A0;0]</span><span
  851. class="cmtt-8">&#x00A0;</span><span
  852. class="cmtt-8">&#x00A0;&#x003C;-</span>
  853. <br class="fancyvrb" /><a
  854. id="x1-43012r6"></a><span
  855. class="cmr-6">6</span><span
  856. class="cmtt-8">&#x00A0;</span><span
  857. class="cmtt-8">&#x00A0;byte</span><span
  858. class="cmtt-8">&#x00A0;1</span><span
  859. class="cmtt-8">&#x00A0;[</span><span
  860. class="cmtt-8">&#x00A0;</span><span
  861. class="cmtt-8">&#x00A0;</span><span
  862. class="cmtt-8">&#x00A0;</span><span
  863. class="cmtt-8">&#x00A0;</span><span
  864. class="cmtt-8">&#x00A0;</span><span
  865. class="cmtt-8">&#x00A0;</span><span
  866. class="cmtt-8">&#x00A0;</span><span
  867. class="cmtt-8">&#x00A0;</span><span
  868. class="cmtt-8">&#x00A0;</span><span
  869. class="cmtt-8">&#x00A0;</span><span
  870. class="cmtt-8">&#x00A0;</span><span
  871. class="cmtt-8">&#x00A0;</span><span
  872. class="cmtt-8">&#x00A0;</span><span
  873. class="cmtt-8">&#x00A0;</span><span
  874. class="cmtt-8">&#x00A0;]</span>
  875. <br class="fancyvrb" /><a
  876. id="x1-43014r7"></a><span
  877. class="cmr-6">7</span><span
  878. class="cmtt-8">&#x00A0;</span><span
  879. class="cmtt-8">&#x00A0;byte</span><span
  880. class="cmtt-8">&#x00A0;2</span><span
  881. class="cmtt-8">&#x00A0;[</span><span
  882. class="cmtt-8">&#x00A0;</span><span
  883. class="cmtt-8">&#x00A0;</span><span
  884. class="cmtt-8">&#x00A0;</span><span
  885. class="cmtt-8">&#x00A0;</span><span
  886. class="cmtt-8">&#x00A0;</span><span
  887. class="cmtt-8">&#x00A0;</span><span
  888. class="cmtt-8">&#x00A0;</span><span
  889. class="cmtt-8">&#x00A0;</span><span
  890. class="cmtt-8">&#x00A0;</span><span
  891. class="cmtt-8">&#x00A0;</span><span
  892. class="cmtt-8">&#x00A0;</span><span
  893. class="cmtt-8">&#x00A0;</span><span
  894. class="cmtt-8">&#x00A0;</span><span
  895. class="cmtt-8">&#x00A0;</span><span
  896. class="cmtt-8">&#x00A0;]</span>
  897. <br class="fancyvrb" /><a
  898. id="x1-43016r8"></a><span
  899. class="cmr-6">8</span><span
  900. class="cmtt-8">&#x00A0;</span><span
  901. class="cmtt-8">&#x00A0;byte</span><span
  902. class="cmtt-8">&#x00A0;3</span><span
  903. class="cmtt-8">&#x00A0;[</span><span
  904. class="cmtt-8">&#x00A0;</span><span
  905. class="cmtt-8">&#x00A0;</span><span
  906. class="cmtt-8">&#x00A0;</span><span
  907. class="cmtt-8">&#x00A0;</span><span
  908. class="cmtt-8">&#x00A0;</span><span
  909. class="cmtt-8">&#x00A0;</span><span
  910. class="cmtt-8">&#x00A0;</span><span
  911. class="cmtt-8">&#x00A0;</span><span
  912. class="cmtt-8">&#x00A0;</span><span
  913. class="cmtt-8">&#x00A0;</span><span
  914. class="cmtt-8">&#x00A0;</span><span
  915. class="cmtt-8">&#x00A0;</span><span
  916. class="cmtt-8">&#x00A0;</span><span
  917. class="cmtt-8">&#x00A0;</span><span
  918. class="cmtt-8">&#x00A0;]</span>
  919. <br class="fancyvrb" /><a
  920. id="x1-43018r9"></a><span
  921. class="cmr-6">9</span><span
  922. class="cmtt-8">&#x00A0;</span><span
  923. class="cmtt-8">&#x00A0;</span><span
  924. class="cmtt-8">&#x00A0;</span><span
  925. class="cmtt-8">&#x00A0;</span><span
  926. class="cmtt-8">&#x00A0;</span><span
  927. class="cmtt-8">&#x00A0;</span><span
  928. class="cmtt-8">&#x00A0;</span><span
  929. class="cmtt-8">&#x00A0;</span><span
  930. class="cmtt-8">&#x00A0;</span><span
  931. class="cmtt-8">&#x00A0;</span><span
  932. class="cmtt-8">&#x00A0;</span><span
  933. class="cmtt-8">&#x00A0;</span><span
  934. class="cmtt-8">&#x00A0;</span><span
  935. class="cmtt-8">&#x00A0;</span><span
  936. class="cmtt-8">&#x00A0;...</span>
  937. <br class="fancyvrb" /><a
  938. id="x1-43020r10"></a><span
  939. class="cmr-6">10</span><span
  940. class="cmtt-8">&#x00A0;</span><span
  941. class="cmtt-8">&#x00A0;byte</span><span
  942. class="cmtt-8">&#x00A0;n</span><span
  943. class="cmtt-8">&#x00A0;[</span><span
  944. class="cmtt-8">&#x00A0;</span><span
  945. class="cmtt-8">&#x00A0;</span><span
  946. class="cmtt-8">&#x00A0;</span><span
  947. class="cmtt-8">&#x00A0;</span><span
  948. class="cmtt-8">&#x00A0;</span><span
  949. class="cmtt-8">&#x00A0;</span><span
  950. class="cmtt-8">&#x00A0;</span><span
  951. class="cmtt-8">&#x00A0;</span><span
  952. class="cmtt-8">&#x00A0;</span><span
  953. class="cmtt-8">&#x00A0;</span><span
  954. class="cmtt-8">&#x00A0;</span><span
  955. class="cmtt-8">&#x00A0;</span><span
  956. class="cmtt-8">&#x00A0;</span><span
  957. class="cmtt-8">&#x00A0;</span><span
  958. class="cmtt-8">&#x00A0;]</span><span
  959. class="cmtt-8">&#x00A0;</span><span
  960. class="cmtt-8">&#x00A0;bytestream</span><span
  961. class="cmtt-8">&#x00A0;length</span><span
  962. class="cmtt-8">&#x00A0;==</span><span
  963. class="cmtt-8">&#x00A0;1</span><span
  964. class="cmtt-8">&#x00A0;byte</span>
  965. <br class="fancyvrb" /><a
  966. id="x1-43022r11"></a><span
  967. class="cmr-6">11</span><span
  968. class="cmtt-8">&#x00A0;</span><span
  969. class="cmtt-8">&#x00A0;</span>
  970. </div>
  971. <!--l. 121--><p class="noindent" >Continue by coding the 3 bit integer value &#8217;-1&#8217; [b111]:
  972. <!--l. 123--><p class="noindent" >
  973. <div class="fancyvrb" id="fancyvrb3">
  974. <a
  975. id="x1-43024r1"></a><span
  976. class="cmr-6">1</span><span
  977. class="cmtt-8">&#x00A0;</span><span
  978. class="cmtt-8">&#x00A0;</span><span
  979. class="cmtt-8">&#x00A0;</span><span
  980. class="cmtt-8">&#x00A0;</span><span
  981. class="cmtt-8">&#x00A0;</span><span
  982. class="cmtt-8">&#x00A0;</span><span
  983. class="cmtt-8">&#x00A0;</span><span
  984. class="cmtt-8">&#x00A0;</span><span
  985. class="cmtt-8">&#x00A0;</span><span
  986. class="cmtt-8">&#x00A0;|</span>
  987. <br class="fancyvrb" /><a
  988. id="x1-43026r2"></a><span
  989. class="cmr-6">2</span><span
  990. class="cmtt-8">&#x00A0;</span><span
  991. class="cmtt-8">&#x00A0;</span><span
  992. class="cmtt-8">&#x00A0;</span><span
  993. class="cmtt-8">&#x00A0;</span><span
  994. class="cmtt-8">&#x00A0;</span><span
  995. class="cmtt-8">&#x00A0;</span><span
  996. class="cmtt-8">&#x00A0;</span><span
  997. class="cmtt-8">&#x00A0;</span><span
  998. class="cmtt-8">&#x00A0;</span><span
  999. class="cmtt-8">&#x00A0;V</span>
  1000. <br class="fancyvrb" /><a
  1001. id="x1-43028r3"></a><span
  1002. class="cmr-6">3</span><span
  1003. class="cmtt-8">&#x00A0;</span><span
  1004. class="cmtt-8">&#x00A0;</span>
  1005. <br class="fancyvrb" /><a
  1006. id="x1-43030r4"></a><span
  1007. class="cmr-6">4</span><span
  1008. class="cmtt-8">&#x00A0;</span><span
  1009. class="cmtt-8">&#x00A0;</span><span
  1010. class="cmtt-8">&#x00A0;</span><span
  1011. class="cmtt-8">&#x00A0;</span><span
  1012. class="cmtt-8">&#x00A0;</span><span
  1013. class="cmtt-8">&#x00A0;</span><span
  1014. class="cmtt-8">&#x00A0;</span><span
  1015. class="cmtt-8">&#x00A0;</span><span
  1016. class="cmtt-8">&#x00A0;</span><span
  1017. class="cmtt-8">&#x00A0;7</span><span
  1018. class="cmtt-8">&#x00A0;6</span><span
  1019. class="cmtt-8">&#x00A0;5</span><span
  1020. class="cmtt-8">&#x00A0;4</span><span
  1021. class="cmtt-8">&#x00A0;3</span><span
  1022. class="cmtt-8">&#x00A0;2</span><span
  1023. class="cmtt-8">&#x00A0;1</span><span
  1024. class="cmtt-8">&#x00A0;0</span>
  1025. <br class="fancyvrb" /><a
  1026. id="x1-43032r5"></a><span
  1027. class="cmr-6">5</span><span
  1028. class="cmtt-8">&#x00A0;</span><span
  1029. class="cmtt-8">&#x00A0;byte</span><span
  1030. class="cmtt-8">&#x00A0;0</span><span
  1031. class="cmtt-8">&#x00A0;[0</span><span
  1032. class="cmtt-8">&#x00A0;1</span><span
  1033. class="cmtt-8">&#x00A0;1</span><span
  1034. class="cmtt-8">&#x00A0;1</span><span
  1035. class="cmtt-8">&#x00A0;1</span><span
  1036. class="cmtt-8">&#x00A0;1</span><span
  1037. class="cmtt-8">&#x00A0;0</span><span
  1038. class="cmtt-8">&#x00A0;0]</span><span
  1039. class="cmtt-8">&#x00A0;</span><span
  1040. class="cmtt-8">&#x00A0;&#x003C;-</span>
  1041. <br class="fancyvrb" /><a
  1042. id="x1-43034r6"></a><span
  1043. class="cmr-6">6</span><span
  1044. class="cmtt-8">&#x00A0;</span><span
  1045. class="cmtt-8">&#x00A0;byte</span><span
  1046. class="cmtt-8">&#x00A0;1</span><span
  1047. class="cmtt-8">&#x00A0;[</span><span
  1048. class="cmtt-8">&#x00A0;</span><span
  1049. class="cmtt-8">&#x00A0;</span><span
  1050. class="cmtt-8">&#x00A0;</span><span
  1051. class="cmtt-8">&#x00A0;</span><span
  1052. class="cmtt-8">&#x00A0;</span><span
  1053. class="cmtt-8">&#x00A0;</span><span
  1054. class="cmtt-8">&#x00A0;</span><span
  1055. class="cmtt-8">&#x00A0;</span><span
  1056. class="cmtt-8">&#x00A0;</span><span
  1057. class="cmtt-8">&#x00A0;</span><span
  1058. class="cmtt-8">&#x00A0;</span><span
  1059. class="cmtt-8">&#x00A0;</span><span
  1060. class="cmtt-8">&#x00A0;</span><span
  1061. class="cmtt-8">&#x00A0;</span><span
  1062. class="cmtt-8">&#x00A0;]</span>
  1063. <br class="fancyvrb" /><a
  1064. id="x1-43036r7"></a><span
  1065. class="cmr-6">7</span><span
  1066. class="cmtt-8">&#x00A0;</span><span
  1067. class="cmtt-8">&#x00A0;byte</span><span
  1068. class="cmtt-8">&#x00A0;2</span><span
  1069. class="cmtt-8">&#x00A0;[</span><span
  1070. class="cmtt-8">&#x00A0;</span><span
  1071. class="cmtt-8">&#x00A0;</span><span
  1072. class="cmtt-8">&#x00A0;</span><span
  1073. class="cmtt-8">&#x00A0;</span><span
  1074. class="cmtt-8">&#x00A0;</span><span
  1075. class="cmtt-8">&#x00A0;</span><span
  1076. class="cmtt-8">&#x00A0;</span><span
  1077. class="cmtt-8">&#x00A0;</span><span
  1078. class="cmtt-8">&#x00A0;</span><span
  1079. class="cmtt-8">&#x00A0;</span><span
  1080. class="cmtt-8">&#x00A0;</span><span
  1081. class="cmtt-8">&#x00A0;</span><span
  1082. class="cmtt-8">&#x00A0;</span><span
  1083. class="cmtt-8">&#x00A0;</span><span
  1084. class="cmtt-8">&#x00A0;]</span>
  1085. <br class="fancyvrb" /><a
  1086. id="x1-43038r8"></a><span
  1087. class="cmr-6">8</span><span
  1088. class="cmtt-8">&#x00A0;</span><span
  1089. class="cmtt-8">&#x00A0;byte</span><span
  1090. class="cmtt-8">&#x00A0;3</span><span
  1091. class="cmtt-8">&#x00A0;[</span><span
  1092. class="cmtt-8">&#x00A0;</span><span
  1093. class="cmtt-8">&#x00A0;</span><span
  1094. class="cmtt-8">&#x00A0;</span><span
  1095. class="cmtt-8">&#x00A0;</span><span
  1096. class="cmtt-8">&#x00A0;</span><span
  1097. class="cmtt-8">&#x00A0;</span><span
  1098. class="cmtt-8">&#x00A0;</span><span
  1099. class="cmtt-8">&#x00A0;</span><span
  1100. class="cmtt-8">&#x00A0;</span><span
  1101. class="cmtt-8">&#x00A0;</span><span
  1102. class="cmtt-8">&#x00A0;</span><span
  1103. class="cmtt-8">&#x00A0;</span><span
  1104. class="cmtt-8">&#x00A0;</span><span
  1105. class="cmtt-8">&#x00A0;</span><span
  1106. class="cmtt-8">&#x00A0;]</span>
  1107. <br class="fancyvrb" /><a
  1108. id="x1-43040r9"></a><span
  1109. class="cmr-6">9</span><span
  1110. class="cmtt-8">&#x00A0;</span><span
  1111. class="cmtt-8">&#x00A0;</span><span
  1112. class="cmtt-8">&#x00A0;</span><span
  1113. class="cmtt-8">&#x00A0;</span><span
  1114. class="cmtt-8">&#x00A0;</span><span
  1115. class="cmtt-8">&#x00A0;</span><span
  1116. class="cmtt-8">&#x00A0;</span><span
  1117. class="cmtt-8">&#x00A0;</span><span
  1118. class="cmtt-8">&#x00A0;</span><span
  1119. class="cmtt-8">&#x00A0;</span><span
  1120. class="cmtt-8">&#x00A0;</span><span
  1121. class="cmtt-8">&#x00A0;</span><span
  1122. class="cmtt-8">&#x00A0;</span><span
  1123. class="cmtt-8">&#x00A0;</span><span
  1124. class="cmtt-8">&#x00A0;...</span>
  1125. <br class="fancyvrb" /><a
  1126. id="x1-43042r10"></a><span
  1127. class="cmr-6">10</span><span
  1128. class="cmtt-8">&#x00A0;</span><span
  1129. class="cmtt-8">&#x00A0;byte</span><span
  1130. class="cmtt-8">&#x00A0;n</span><span
  1131. class="cmtt-8">&#x00A0;[</span><span
  1132. class="cmtt-8">&#x00A0;</span><span
  1133. class="cmtt-8">&#x00A0;</span><span
  1134. class="cmtt-8">&#x00A0;</span><span
  1135. class="cmtt-8">&#x00A0;</span><span
  1136. class="cmtt-8">&#x00A0;</span><span
  1137. class="cmtt-8">&#x00A0;</span><span
  1138. class="cmtt-8">&#x00A0;</span><span
  1139. class="cmtt-8">&#x00A0;</span><span
  1140. class="cmtt-8">&#x00A0;</span><span
  1141. class="cmtt-8">&#x00A0;</span><span
  1142. class="cmtt-8">&#x00A0;</span><span
  1143. class="cmtt-8">&#x00A0;</span><span
  1144. class="cmtt-8">&#x00A0;</span><span
  1145. class="cmtt-8">&#x00A0;</span><span
  1146. class="cmtt-8">&#x00A0;]</span><span
  1147. class="cmtt-8">&#x00A0;</span><span
  1148. class="cmtt-8">&#x00A0;bytestream</span><span
  1149. class="cmtt-8">&#x00A0;length</span><span
  1150. class="cmtt-8">&#x00A0;==</span><span
  1151. class="cmtt-8">&#x00A0;1</span><span
  1152. class="cmtt-8">&#x00A0;byte</span>
  1153. </div>
  1154. <!--l. 137--><p class="noindent" >Continue by coding the 7 bit integer value &#8217;17&#8217; [b0010001]:
  1155. <!--l. 139--><p class="noindent" >
  1156. <div class="fancyvrb" id="fancyvrb4">
  1157. <a
  1158. id="x1-43044r1"></a><span
  1159. class="cmr-6">1</span><span
  1160. class="cmtt-8">&#x00A0;</span><span
  1161. class="cmtt-8">&#x00A0;</span><span
  1162. class="cmtt-8">&#x00A0;</span><span
  1163. class="cmtt-8">&#x00A0;</span><span
  1164. class="cmtt-8">&#x00A0;</span><span
  1165. class="cmtt-8">&#x00A0;</span><span
  1166. class="cmtt-8">&#x00A0;</span><span
  1167. class="cmtt-8">&#x00A0;</span><span
  1168. class="cmtt-8">&#x00A0;</span><span
  1169. class="cmtt-8">&#x00A0;</span><span
  1170. class="cmtt-8">&#x00A0;</span><span
  1171. class="cmtt-8">&#x00A0;|</span>
  1172. <br class="fancyvrb" /><a
  1173. id="x1-43046r2"></a><span
  1174. class="cmr-6">2</span><span
  1175. class="cmtt-8">&#x00A0;</span><span
  1176. class="cmtt-8">&#x00A0;</span><span
  1177. class="cmtt-8">&#x00A0;</span><span
  1178. class="cmtt-8">&#x00A0;</span><span
  1179. class="cmtt-8">&#x00A0;</span><span
  1180. class="cmtt-8">&#x00A0;</span><span
  1181. class="cmtt-8">&#x00A0;</span><span
  1182. class="cmtt-8">&#x00A0;</span><span
  1183. class="cmtt-8">&#x00A0;</span><span
  1184. class="cmtt-8">&#x00A0;</span><span
  1185. class="cmtt-8">&#x00A0;</span><span
  1186. class="cmtt-8">&#x00A0;V</span>
  1187. <br class="fancyvrb" /><a
  1188. id="x1-43048r3"></a><span
  1189. class="cmr-6">3</span><span
  1190. class="cmtt-8">&#x00A0;</span><span
  1191. class="cmtt-8">&#x00A0;</span>
  1192. <br class="fancyvrb" /><a
  1193. id="x1-43050r4"></a><span
  1194. class="cmr-6">4</span><span
  1195. class="cmtt-8">&#x00A0;</span><span
  1196. class="cmtt-8">&#x00A0;</span><span
  1197. class="cmtt-8">&#x00A0;</span><span
  1198. class="cmtt-8">&#x00A0;</span><span
  1199. class="cmtt-8">&#x00A0;</span><span
  1200. class="cmtt-8">&#x00A0;</span><span
  1201. class="cmtt-8">&#x00A0;</span><span
  1202. class="cmtt-8">&#x00A0;</span><span
  1203. class="cmtt-8">&#x00A0;</span><span
  1204. class="cmtt-8">&#x00A0;7</span><span
  1205. class="cmtt-8">&#x00A0;6</span><span
  1206. class="cmtt-8">&#x00A0;5</span><span
  1207. class="cmtt-8">&#x00A0;4</span><span
  1208. class="cmtt-8">&#x00A0;3</span><span
  1209. class="cmtt-8">&#x00A0;2</span><span
  1210. class="cmtt-8">&#x00A0;1</span><span
  1211. class="cmtt-8">&#x00A0;0</span>
  1212. <br class="fancyvrb" /><a
  1213. id="x1-43052r5"></a><span
  1214. class="cmr-6">5</span><span
  1215. class="cmtt-8">&#x00A0;</span><span
  1216. class="cmtt-8">&#x00A0;byte</span><span
  1217. class="cmtt-8">&#x00A0;0</span><span
  1218. class="cmtt-8">&#x00A0;[1</span><span
  1219. class="cmtt-8">&#x00A0;1</span><span
  1220. class="cmtt-8">&#x00A0;1</span><span
  1221. class="cmtt-8">&#x00A0;1</span><span
  1222. class="cmtt-8">&#x00A0;1</span><span
  1223. class="cmtt-8">&#x00A0;1</span><span
  1224. class="cmtt-8">&#x00A0;0</span><span
  1225. class="cmtt-8">&#x00A0;0]</span>
  1226. <br class="fancyvrb" /><a
  1227. id="x1-43054r6"></a><span
  1228. class="cmr-6">6</span><span
  1229. class="cmtt-8">&#x00A0;</span><span
  1230. class="cmtt-8">&#x00A0;byte</span><span
  1231. class="cmtt-8">&#x00A0;1</span><span
  1232. class="cmtt-8">&#x00A0;[0</span><span
  1233. class="cmtt-8">&#x00A0;0</span><span
  1234. class="cmtt-8">&#x00A0;0</span><span
  1235. class="cmtt-8">&#x00A0;0</span><span
  1236. class="cmtt-8">&#x00A0;1</span><span
  1237. class="cmtt-8">&#x00A0;0</span><span
  1238. class="cmtt-8">&#x00A0;0</span><span
  1239. class="cmtt-8">&#x00A0;0]</span><span
  1240. class="cmtt-8">&#x00A0;</span><span
  1241. class="cmtt-8">&#x00A0;&#x003C;-</span>
  1242. <br class="fancyvrb" /><a
  1243. id="x1-43056r7"></a><span
  1244. class="cmr-6">7</span><span
  1245. class="cmtt-8">&#x00A0;</span><span
  1246. class="cmtt-8">&#x00A0;byte</span><span
  1247. class="cmtt-8">&#x00A0;2</span><span
  1248. class="cmtt-8">&#x00A0;[</span><span
  1249. class="cmtt-8">&#x00A0;</span><span
  1250. class="cmtt-8">&#x00A0;</span><span
  1251. class="cmtt-8">&#x00A0;</span><span
  1252. class="cmtt-8">&#x00A0;</span><span
  1253. class="cmtt-8">&#x00A0;</span><span
  1254. class="cmtt-8">&#x00A0;</span><span
  1255. class="cmtt-8">&#x00A0;</span><span
  1256. class="cmtt-8">&#x00A0;</span><span
  1257. class="cmtt-8">&#x00A0;</span><span
  1258. class="cmtt-8">&#x00A0;</span><span
  1259. class="cmtt-8">&#x00A0;</span><span
  1260. class="cmtt-8">&#x00A0;</span><span
  1261. class="cmtt-8">&#x00A0;</span><span
  1262. class="cmtt-8">&#x00A0;</span><span
  1263. class="cmtt-8">&#x00A0;]</span>
  1264. <br class="fancyvrb" /><a
  1265. id="x1-43058r8"></a><span
  1266. class="cmr-6">8</span><span
  1267. class="cmtt-8">&#x00A0;</span><span
  1268. class="cmtt-8">&#x00A0;byte</span><span
  1269. class="cmtt-8">&#x00A0;3</span><span
  1270. class="cmtt-8">&#x00A0;[</span><span
  1271. class="cmtt-8">&#x00A0;</span><span
  1272. class="cmtt-8">&#x00A0;</span><span
  1273. class="cmtt-8">&#x00A0;</span><span
  1274. class="cmtt-8">&#x00A0;</span><span
  1275. class="cmtt-8">&#x00A0;</span><span
  1276. class="cmtt-8">&#x00A0;</span><span
  1277. class="cmtt-8">&#x00A0;</span><span
  1278. class="cmtt-8">&#x00A0;</span><span
  1279. class="cmtt-8">&#x00A0;</span><span
  1280. class="cmtt-8">&#x00A0;</span><span
  1281. class="cmtt-8">&#x00A0;</span><span
  1282. class="cmtt-8">&#x00A0;</span><span
  1283. class="cmtt-8">&#x00A0;</span><span
  1284. class="cmtt-8">&#x00A0;</span><span
  1285. class="cmtt-8">&#x00A0;]</span>
  1286. <br class="fancyvrb" /><a
  1287. id="x1-43060r9"></a><span
  1288. class="cmr-6">9</span><span
  1289. class="cmtt-8">&#x00A0;</span><span
  1290. class="cmtt-8">&#x00A0;</span><span
  1291. class="cmtt-8">&#x00A0;</span><span
  1292. class="cmtt-8">&#x00A0;</span><span
  1293. class="cmtt-8">&#x00A0;</span><span
  1294. class="cmtt-8">&#x00A0;</span><span
  1295. class="cmtt-8">&#x00A0;</span><span
  1296. class="cmtt-8">&#x00A0;</span><span
  1297. class="cmtt-8">&#x00A0;</span><span
  1298. class="cmtt-8">&#x00A0;</span><span
  1299. class="cmtt-8">&#x00A0;</span><span
  1300. class="cmtt-8">&#x00A0;</span><span
  1301. class="cmtt-8">&#x00A0;</span><span
  1302. class="cmtt-8">&#x00A0;</span><span
  1303. class="cmtt-8">&#x00A0;...</span>
  1304. <br class="fancyvrb" /><a
  1305. id="x1-43062r10"></a><span
  1306. class="cmr-6">10</span><span
  1307. class="cmtt-8">&#x00A0;</span><span
  1308. class="cmtt-8">&#x00A0;byte</span><span
  1309. class="cmtt-8">&#x00A0;n</span><span
  1310. class="cmtt-8">&#x00A0;[</span><span
  1311. class="cmtt-8">&#x00A0;</span><span
  1312. class="cmtt-8">&#x00A0;</span><span
  1313. class="cmtt-8">&#x00A0;</span><span
  1314. class="cmtt-8">&#x00A0;</span><span
  1315. class="cmtt-8">&#x00A0;</span><span
  1316. class="cmtt-8">&#x00A0;</span><span
  1317. class="cmtt-8">&#x00A0;</span><span
  1318. class="cmtt-8">&#x00A0;</span><span
  1319. class="cmtt-8">&#x00A0;</span><span
  1320. class="cmtt-8">&#x00A0;</span><span
  1321. class="cmtt-8">&#x00A0;</span><span
  1322. class="cmtt-8">&#x00A0;</span><span
  1323. class="cmtt-8">&#x00A0;</span><span
  1324. class="cmtt-8">&#x00A0;</span><span
  1325. class="cmtt-8">&#x00A0;]</span><span
  1326. class="cmtt-8">&#x00A0;</span><span
  1327. class="cmtt-8">&#x00A0;bytestream</span><span
  1328. class="cmtt-8">&#x00A0;length</span><span
  1329. class="cmtt-8">&#x00A0;==</span><span
  1330. class="cmtt-8">&#x00A0;2</span><span
  1331. class="cmtt-8">&#x00A0;bytes</span>
  1332. <br class="fancyvrb" /><a
  1333. id="x1-43064r11"></a><span
  1334. class="cmr-6">11</span><span
  1335. class="cmtt-8">&#x00A0;</span><span
  1336. class="cmtt-8">&#x00A0;</span><span
  1337. class="cmtt-8">&#x00A0;</span><span
  1338. class="cmtt-8">&#x00A0;</span><span
  1339. class="cmtt-8">&#x00A0;</span><span
  1340. class="cmtt-8">&#x00A0;</span><span
  1341. class="cmtt-8">&#x00A0;</span><span
  1342. class="cmtt-8">&#x00A0;</span><span
  1343. class="cmtt-8">&#x00A0;</span><span
  1344. class="cmtt-8">&#x00A0;</span><span
  1345. class="cmtt-8">&#x00A0;</span><span
  1346. class="cmtt-8">&#x00A0;</span><span
  1347. class="cmtt-8">&#x00A0;</span><span
  1348. class="cmtt-8">&#x00A0;</span><span
  1349. class="cmtt-8">&#x00A0;</span><span
  1350. class="cmtt-8">&#x00A0;</span><span
  1351. class="cmtt-8">&#x00A0;</span><span
  1352. class="cmtt-8">&#x00A0;</span><span
  1353. class="cmtt-8">&#x00A0;</span><span
  1354. class="cmtt-8">&#x00A0;</span><span
  1355. class="cmtt-8">&#x00A0;</span><span
  1356. class="cmtt-8">&#x00A0;</span><span
  1357. class="cmtt-8">&#x00A0;</span><span
  1358. class="cmtt-8">&#x00A0;</span><span
  1359. class="cmtt-8">&#x00A0;</span><span
  1360. class="cmtt-8">&#x00A0;</span><span
  1361. class="cmtt-8">&#x00A0;</span><span
  1362. class="cmtt-8">&#x00A0;bit</span><span
  1363. class="cmtt-8">&#x00A0;cursor</span><span
  1364. class="cmtt-8">&#x00A0;==</span><span
  1365. class="cmtt-8">&#x00A0;6</span>
  1366. </div>
  1367. <!--l. 154--><p class="noindent" >Continue by coding the 13 bit integer value &#8217;6969&#8217; [b110 11001110 01]:
  1368. <!--l. 156--><p class="noindent" >
  1369. <div class="fancyvrb" id="fancyvrb5">
  1370. <a
  1371. id="x1-43066r1"></a><span
  1372. class="cmr-6">1</span><span
  1373. class="cmtt-8">&#x00A0;</span><span
  1374. class="cmtt-8">&#x00A0;</span><span
  1375. class="cmtt-8">&#x00A0;</span><span
  1376. class="cmtt-8">&#x00A0;</span><span
  1377. class="cmtt-8">&#x00A0;</span><span
  1378. class="cmtt-8">&#x00A0;</span><span
  1379. class="cmtt-8">&#x00A0;</span><span
  1380. class="cmtt-8">&#x00A0;</span><span
  1381. class="cmtt-8">&#x00A0;</span><span
  1382. class="cmtt-8">&#x00A0;</span><span
  1383. class="cmtt-8">&#x00A0;</span><span
  1384. class="cmtt-8">&#x00A0;</span><span
  1385. class="cmtt-8">&#x00A0;</span><span
  1386. class="cmtt-8">&#x00A0;</span><span
  1387. class="cmtt-8">&#x00A0;</span><span
  1388. class="cmtt-8">&#x00A0;</span><span
  1389. class="cmtt-8">&#x00A0;</span><span
  1390. class="cmtt-8">&#x00A0;|</span>
  1391. <br class="fancyvrb" /><a
  1392. id="x1-43068r2"></a><span
  1393. class="cmr-6">2</span><span
  1394. class="cmtt-8">&#x00A0;</span><span
  1395. class="cmtt-8">&#x00A0;</span><span
  1396. class="cmtt-8">&#x00A0;</span><span
  1397. class="cmtt-8">&#x00A0;</span><span
  1398. class="cmtt-8">&#x00A0;</span><span
  1399. class="cmtt-8">&#x00A0;</span><span
  1400. class="cmtt-8">&#x00A0;</span><span
  1401. class="cmtt-8">&#x00A0;</span><span
  1402. class="cmtt-8">&#x00A0;</span><span
  1403. class="cmtt-8">&#x00A0;</span><span
  1404. class="cmtt-8">&#x00A0;</span><span
  1405. class="cmtt-8">&#x00A0;</span><span
  1406. class="cmtt-8">&#x00A0;</span><span
  1407. class="cmtt-8">&#x00A0;</span><span
  1408. class="cmtt-8">&#x00A0;</span><span
  1409. class="cmtt-8">&#x00A0;</span><span
  1410. class="cmtt-8">&#x00A0;</span><span
  1411. class="cmtt-8">&#x00A0;V</span>
  1412. <br class="fancyvrb" /><a
  1413. id="x1-43070r3"></a><span
  1414. class="cmr-6">3</span><span
  1415. class="cmtt-8">&#x00A0;</span><span
  1416. class="cmtt-8">&#x00A0;</span>
  1417. <br class="fancyvrb" /><a
  1418. id="x1-43072r4"></a><span
  1419. class="cmr-6">4</span><span
  1420. class="cmtt-8">&#x00A0;</span><span
  1421. class="cmtt-8">&#x00A0;</span><span
  1422. class="cmtt-8">&#x00A0;</span><span
  1423. class="cmtt-8">&#x00A0;</span><span
  1424. class="cmtt-8">&#x00A0;</span><span
  1425. class="cmtt-8">&#x00A0;</span><span
  1426. class="cmtt-8">&#x00A0;</span><span
  1427. class="cmtt-8">&#x00A0;</span><span
  1428. class="cmtt-8">&#x00A0;</span><span
  1429. class="cmtt-8">&#x00A0;7</span><span
  1430. class="cmtt-8">&#x00A0;6</span><span
  1431. class="cmtt-8">&#x00A0;5</span><span
  1432. class="cmtt-8">&#x00A0;4</span><span
  1433. class="cmtt-8">&#x00A0;3</span><span
  1434. class="cmtt-8">&#x00A0;2</span><span
  1435. class="cmtt-8">&#x00A0;1</span><span
  1436. class="cmtt-8">&#x00A0;0</span>
  1437. <br class="fancyvrb" /><a
  1438. id="x1-43074r5"></a><span
  1439. class="cmr-6">5</span><span
  1440. class="cmtt-8">&#x00A0;</span><span
  1441. class="cmtt-8">&#x00A0;byte</span><span
  1442. class="cmtt-8">&#x00A0;0</span><span
  1443. class="cmtt-8">&#x00A0;[1</span><span
  1444. class="cmtt-8">&#x00A0;1</span><span
  1445. class="cmtt-8">&#x00A0;1</span><span
  1446. class="cmtt-8">&#x00A0;1</span><span
  1447. class="cmtt-8">&#x00A0;1</span><span
  1448. class="cmtt-8">&#x00A0;1</span><span
  1449. class="cmtt-8">&#x00A0;0</span><span
  1450. class="cmtt-8">&#x00A0;0]</span>
  1451. <br class="fancyvrb" /><a
  1452. id="x1-43076r6"></a><span
  1453. class="cmr-6">6</span><span
  1454. class="cmtt-8">&#x00A0;</span><span
  1455. class="cmtt-8">&#x00A0;byte</span><span
  1456. class="cmtt-8">&#x00A0;1</span><span
  1457. class="cmtt-8">&#x00A0;[0</span><span
  1458. class="cmtt-8">&#x00A0;1</span><span
  1459. class="cmtt-8">&#x00A0;0</span><span
  1460. class="cmtt-8">&#x00A0;0</span><span
  1461. class="cmtt-8">&#x00A0;1</span><span
  1462. class="cmtt-8">&#x00A0;0</span><span
  1463. class="cmtt-8">&#x00A0;0</span><span
  1464. class="cmtt-8">&#x00A0;0]</span>
  1465. <br class="fancyvrb" /><a
  1466. id="x1-43078r7"></a><span
  1467. class="cmr-6">7</span><span
  1468. class="cmtt-8">&#x00A0;</span><span
  1469. class="cmtt-8">&#x00A0;byte</span><span
  1470. class="cmtt-8">&#x00A0;2</span><span
  1471. class="cmtt-8">&#x00A0;[1</span><span
  1472. class="cmtt-8">&#x00A0;1</span><span
  1473. class="cmtt-8">&#x00A0;0</span><span
  1474. class="cmtt-8">&#x00A0;0</span><span
  1475. class="cmtt-8">&#x00A0;1</span><span
  1476. class="cmtt-8">&#x00A0;1</span><span
  1477. class="cmtt-8">&#x00A0;1</span><span
  1478. class="cmtt-8">&#x00A0;0]</span>
  1479. <br class="fancyvrb" /><a
  1480. id="x1-43080r8"></a><span
  1481. class="cmr-6">8</span><span
  1482. class="cmtt-8">&#x00A0;</span><span
  1483. class="cmtt-8">&#x00A0;byte</span><span
  1484. class="cmtt-8">&#x00A0;3</span><span
  1485. class="cmtt-8">&#x00A0;[0</span><span
  1486. class="cmtt-8">&#x00A0;0</span><span
  1487. class="cmtt-8">&#x00A0;0</span><span
  1488. class="cmtt-8">&#x00A0;0</span><span
  1489. class="cmtt-8">&#x00A0;0</span><span
  1490. class="cmtt-8">&#x00A0;1</span><span
  1491. class="cmtt-8">&#x00A0;1</span><span
  1492. class="cmtt-8">&#x00A0;0]</span><span
  1493. class="cmtt-8">&#x00A0;</span><span
  1494. class="cmtt-8">&#x00A0;&#x003C;-</span>
  1495. <br class="fancyvrb" /><a
  1496. id="x1-43082r9"></a><span
  1497. class="cmr-6">9</span><span
  1498. class="cmtt-8">&#x00A0;</span><span
  1499. class="cmtt-8">&#x00A0;</span><span
  1500. class="cmtt-8">&#x00A0;</span><span
  1501. class="cmtt-8">&#x00A0;</span><span
  1502. class="cmtt-8">&#x00A0;</span><span
  1503. class="cmtt-8">&#x00A0;</span><span
  1504. class="cmtt-8">&#x00A0;</span><span
  1505. class="cmtt-8">&#x00A0;</span><span
  1506. class="cmtt-8">&#x00A0;</span><span
  1507. class="cmtt-8">&#x00A0;</span><span
  1508. class="cmtt-8">&#x00A0;</span><span
  1509. class="cmtt-8">&#x00A0;</span><span
  1510. class="cmtt-8">&#x00A0;</span><span
  1511. class="cmtt-8">&#x00A0;</span><span
  1512. class="cmtt-8">&#x00A0;...</span>
  1513. <br class="fancyvrb" /><a
  1514. id="x1-43084r10"></a><span
  1515. class="cmr-6">10</span><span
  1516. class="cmtt-8">&#x00A0;</span><span
  1517. class="cmtt-8">&#x00A0;byte</span><span
  1518. class="cmtt-8">&#x00A0;n</span><span
  1519. class="cmtt-8">&#x00A0;[</span><span
  1520. class="cmtt-8">&#x00A0;</span><span
  1521. class="cmtt-8">&#x00A0;</span><span
  1522. class="cmtt-8">&#x00A0;</span><span
  1523. class="cmtt-8">&#x00A0;</span><span
  1524. class="cmtt-8">&#x00A0;</span><span
  1525. class="cmtt-8">&#x00A0;</span><span
  1526. class="cmtt-8">&#x00A0;</span><span
  1527. class="cmtt-8">&#x00A0;</span><span
  1528. class="cmtt-8">&#x00A0;</span><span
  1529. class="cmtt-8">&#x00A0;</span><span
  1530. class="cmtt-8">&#x00A0;</span><span
  1531. class="cmtt-8">&#x00A0;</span><span
  1532. class="cmtt-8">&#x00A0;</span><span
  1533. class="cmtt-8">&#x00A0;</span><span
  1534. class="cmtt-8">&#x00A0;]</span><span
  1535. class="cmtt-8">&#x00A0;</span><span
  1536. class="cmtt-8">&#x00A0;bytestream</span><span
  1537. class="cmtt-8">&#x00A0;length</span><span
  1538. class="cmtt-8">&#x00A0;==</span><span
  1539. class="cmtt-8">&#x00A0;4</span><span
  1540. class="cmtt-8">&#x00A0;bytes</span>
  1541. <br class="fancyvrb" /><a
  1542. id="x1-43086r11"></a><span
  1543. class="cmr-6">11</span><span
  1544. class="cmtt-8">&#x00A0;</span><span
  1545. class="cmtt-8">&#x00A0;</span>
  1546. </div>
  1547. <!--l. 173--><p class="noindent" >
  1548. <h5 class="subsubsectionHead"><span class="titlemark">2.1.7 </span> <a
  1549. id="x1-440002.1.7"></a>decoding example</h5>
  1550. <!--l. 175--><p class="noindent" >Reading from the beginning of the bytestream encoded in the above example:
  1551. <!--l. 177--><p class="noindent" >
  1552. <div class="fancyvrb" id="fancyvrb6">
  1553. <a
  1554. id="x1-44002r1"></a><span
  1555. class="cmr-6">1</span><span
  1556. class="cmtt-8">&#x00A0;</span><span
  1557. class="cmtt-8">&#x00A0;</span><span
  1558. class="cmtt-8">&#x00A0;</span><span
  1559. class="cmtt-8">&#x00A0;</span><span
  1560. class="cmtt-8">&#x00A0;</span><span
  1561. class="cmtt-8">&#x00A0;</span><span
  1562. class="cmtt-8">&#x00A0;</span><span
  1563. class="cmtt-8">&#x00A0;</span><span
  1564. class="cmtt-8">&#x00A0;</span><span
  1565. class="cmtt-8">&#x00A0;</span><span
  1566. class="cmtt-8">&#x00A0;</span><span
  1567. class="cmtt-8">&#x00A0;</span><span
  1568. class="cmtt-8">&#x00A0;</span><span
  1569. class="cmtt-8">&#x00A0;</span><span
  1570. class="cmtt-8">&#x00A0;</span><span
  1571. class="cmtt-8">&#x00A0;</span><span
  1572. class="cmtt-8">&#x00A0;</span><span
  1573. class="cmtt-8">&#x00A0;</span><span
  1574. class="cmtt-8">&#x00A0;</span><span
  1575. class="cmtt-8">&#x00A0;</span><span
  1576. class="cmtt-8">&#x00A0;</span><span
  1577. class="cmtt-8">&#x00A0;</span><span
  1578. class="cmtt-8">&#x00A0;</span><span
  1579. class="cmtt-8">&#x00A0;|</span>
  1580. <br class="fancyvrb" /><a
  1581. id="x1-44004r2"></a><span
  1582. class="cmr-6">2</span><span
  1583. class="cmtt-8">&#x00A0;</span><span
  1584. class="cmtt-8">&#x00A0;</span><span
  1585. class="cmtt-8">&#x00A0;</span><span
  1586. class="cmtt-8">&#x00A0;</span><span
  1587. class="cmtt-8">&#x00A0;</span><span
  1588. class="cmtt-8">&#x00A0;</span><span
  1589. class="cmtt-8">&#x00A0;</span><span
  1590. class="cmtt-8">&#x00A0;</span><span
  1591. class="cmtt-8">&#x00A0;</span><span
  1592. class="cmtt-8">&#x00A0;</span><span
  1593. class="cmtt-8">&#x00A0;</span><span
  1594. class="cmtt-8">&#x00A0;</span><span
  1595. class="cmtt-8">&#x00A0;</span><span
  1596. class="cmtt-8">&#x00A0;</span><span
  1597. class="cmtt-8">&#x00A0;</span><span
  1598. class="cmtt-8">&#x00A0;</span><span
  1599. class="cmtt-8">&#x00A0;</span><span
  1600. class="cmtt-8">&#x00A0;</span><span
  1601. class="cmtt-8">&#x00A0;</span><span
  1602. class="cmtt-8">&#x00A0;</span><span
  1603. class="cmtt-8">&#x00A0;</span><span
  1604. class="cmtt-8">&#x00A0;</span><span
  1605. class="cmtt-8">&#x00A0;</span><span
  1606. class="cmtt-8">&#x00A0;V</span>
  1607. <br class="fancyvrb" /><a
  1608. id="x1-44006r3"></a><span
  1609. class="cmr-6">3</span><span
  1610. class="cmtt-8">&#x00A0;</span><span
  1611. class="cmtt-8">&#x00A0;</span>
  1612. <br class="fancyvrb" /><a
  1613. id="x1-44008r4"></a><span
  1614. class="cmr-6">4</span><span
  1615. class="cmtt-8">&#x00A0;</span><span
  1616. class="cmtt-8">&#x00A0;</span><span
  1617. class="cmtt-8">&#x00A0;</span><span
  1618. class="cmtt-8">&#x00A0;</span><span
  1619. class="cmtt-8">&#x00A0;</span><span
  1620. class="cmtt-8">&#x00A0;</span><span
  1621. class="cmtt-8">&#x00A0;</span><span
  1622. class="cmtt-8">&#x00A0;</span><span
  1623. class="cmtt-8">&#x00A0;</span><span
  1624. class="cmtt-8">&#x00A0;7</span><span
  1625. class="cmtt-8">&#x00A0;6</span><span
  1626. class="cmtt-8">&#x00A0;5</span><span
  1627. class="cmtt-8">&#x00A0;4</span><span
  1628. class="cmtt-8">&#x00A0;3</span><span
  1629. class="cmtt-8">&#x00A0;2</span><span
  1630. class="cmtt-8">&#x00A0;1</span><span
  1631. class="cmtt-8">&#x00A0;0</span>
  1632. <br class="fancyvrb" /><a
  1633. id="x1-44010r5"></a><span
  1634. class="cmr-6">5</span><span
  1635. class="cmtt-8">&#x00A0;</span><span
  1636. class="cmtt-8">&#x00A0;byte</span><span
  1637. class="cmtt-8">&#x00A0;0</span><span
  1638. class="cmtt-8">&#x00A0;[1</span><span
  1639. class="cmtt-8">&#x00A0;1</span><span
  1640. class="cmtt-8">&#x00A0;1</span><span
  1641. class="cmtt-8">&#x00A0;1</span><span
  1642. class="cmtt-8">&#x00A0;1</span><span
  1643. class="cmtt-8">&#x00A0;1</span><span
  1644. class="cmtt-8">&#x00A0;0</span><span
  1645. class="cmtt-8">&#x00A0;0]</span><span
  1646. class="cmtt-8">&#x00A0;</span><span
  1647. class="cmtt-8">&#x00A0;&#x003C;-</span>
  1648. <br class="fancyvrb" /><a
  1649. id="x1-44012r6"></a><span
  1650. class="cmr-6">6</span><span
  1651. class="cmtt-8">&#x00A0;</span><span
  1652. class="cmtt-8">&#x00A0;byte</span><span
  1653. class="cmtt-8">&#x00A0;1</span><span
  1654. class="cmtt-8">&#x00A0;[0</span><span
  1655. class="cmtt-8">&#x00A0;1</span><span
  1656. class="cmtt-8">&#x00A0;0</span><span
  1657. class="cmtt-8">&#x00A0;0</span><span
  1658. class="cmtt-8">&#x00A0;1</span><span
  1659. class="cmtt-8">&#x00A0;0</span><span
  1660. class="cmtt-8">&#x00A0;0</span><span
  1661. class="cmtt-8">&#x00A0;0]</span>
  1662. <br class="fancyvrb" /><a
  1663. id="x1-44014r7"></a><span
  1664. class="cmr-6">7</span><span
  1665. class="cmtt-8">&#x00A0;</span><span
  1666. class="cmtt-8">&#x00A0;byte</span><span
  1667. class="cmtt-8">&#x00A0;2</span><span
  1668. class="cmtt-8">&#x00A0;[1</span><span
  1669. class="cmtt-8">&#x00A0;1</span><span
  1670. class="cmtt-8">&#x00A0;0</span><span
  1671. class="cmtt-8">&#x00A0;0</span><span
  1672. class="cmtt-8">&#x00A0;1</span><span
  1673. class="cmtt-8">&#x00A0;1</span><span
  1674. class="cmtt-8">&#x00A0;1</span><span
  1675. class="cmtt-8">&#x00A0;0]</span>
  1676. <br class="fancyvrb" /><a
  1677. id="x1-44016r8"></a><span
  1678. class="cmr-6">8</span><span
  1679. class="cmtt-8">&#x00A0;</span><span
  1680. class="cmtt-8">&#x00A0;byte</span><span
  1681. class="cmtt-8">&#x00A0;3</span><span
  1682. class="cmtt-8">&#x00A0;[0</span><span
  1683. class="cmtt-8">&#x00A0;0</span><span
  1684. class="cmtt-8">&#x00A0;0</span><span
  1685. class="cmtt-8">&#x00A0;0</span><span
  1686. class="cmtt-8">&#x00A0;0</span><span
  1687. class="cmtt-8">&#x00A0;1</span><span
  1688. class="cmtt-8">&#x00A0;1</span><span
  1689. class="cmtt-8">&#x00A0;0]</span><span
  1690. class="cmtt-8">&#x00A0;</span><span
  1691. class="cmtt-8">&#x00A0;bytestream</span><span
  1692. class="cmtt-8">&#x00A0;length</span><span
  1693. class="cmtt-8">&#x00A0;==</span><span
  1694. class="cmtt-8">&#x00A0;4</span><span
  1695. class="cmtt-8">&#x00A0;bytes</span>
  1696. <br class="fancyvrb" /><a
  1697. id="x1-44018r9"></a><span
  1698. class="cmr-6">9</span><span
  1699. class="cmtt-8">&#x00A0;</span><span
  1700. class="cmtt-8">&#x00A0;</span>
  1701. </div>
  1702. <!--l. 190--><p class="noindent" >We read two, two-bit integer fields, resulting in the returned numbers &#8217;b00&#8217; and &#8217;b11&#8217;. Two things
  1703. are worth noting here:
  1704. <ul class="itemize1">
  1705. <li class="itemize">Although these four bits were originally written as a single four-bit integer, reading
  1706. some other combination of bit-widths from the bitstream is well defined. There are
  1707. no artificial alignment boundaries maintained in the bitstream.
  1708. </li>
  1709. <li class="itemize">The second value is the two-bit-wide integer &#8217;b11&#8217;. This value may be interpreted
  1710. either as the unsigned value &#8217;3&#8217;, or the signed value &#8217;-1&#8217;. Signedness is dependent on
  1711. decode context.</li></ul>
  1712. <!--l. 208--><p class="noindent" >
  1713. <h5 class="subsubsectionHead"><span class="titlemark">2.1.8 </span> <a
  1714. id="x1-450002.1.8"></a>end-of-packet alignment</h5>
  1715. <!--l. 210--><p class="noindent" >The typical use of bitpacking is to produce many independent byte-aligned packets which are
  1716. embedded into a larger byte-aligned container structure, such as an Ogg transport bitstream.
  1717. Externally, each bytestream (encoded bitstream) must begin and end on a byte boundary. Often,
  1718. the encoded bitstream is not an integer number of bytes, and so there is unused (uncoded) space
  1719. in the last byte of a packet.
  1720. <!--l. 218--><p class="noindent" >Unused space in the last byte of a bytestream is always zeroed during the coding process. Thus,
  1721. should this unused space be read, it will return binary zeroes.
  1722. <!--l. 222--><p class="noindent" >Attempting to read past the end of an encoded packet results in an &#8217;end-of-packet&#8217; condition.
  1723. End-of-packet is not to be considered an error; it is merely a state indicating that there is
  1724. insufficient remaining data to fulfill the desired read size. Vorbis uses truncated packets as a
  1725. normal mode of operation, and as such, decoders must handle reading past the end of a packet as
  1726. a typical mode of operation. Any further read operations after an &#8217;end-of-packet&#8217; condition shall
  1727. also return &#8217;end-of-packet&#8217;.
  1728. <!--l. 233--><p class="noindent" >
  1729. <h5 class="subsubsectionHead"><span class="titlemark">2.1.9 </span> <a
  1730. id="x1-460002.1.9"></a>reading zero bits</h5>
  1731. <!--l. 235--><p class="noindent" >Reading a zero-bit-wide integer returns the value &#8217;0&#8217; and does not increment the stream cursor.
  1732. Reading to the end of the packet (but not past, such that an &#8217;end-of-packet&#8217; condition has not
  1733. triggered) and then reading a zero bit integer shall succeed, returning 0, and not trigger an
  1734. end-of-packet condition. Reading a zero-bit-wide integer after a previous read sets &#8217;end-of-packet&#8217;
  1735. shall also fail with &#8217;end-of-packet&#8217;.
  1736. <h3 class="sectionHead"><span class="titlemark">3 </span> <a
  1737. id="x1-470003"></a>Probability Model and Codebooks</h3>
  1738. <!--l. 6--><p class="noindent" >
  1739. <h4 class="subsectionHead"><span class="titlemark">3.1 </span> <a
  1740. id="x1-480003.1"></a>Overview</h4>
  1741. <!--l. 8--><p class="noindent" >Unlike practically every other mainstream audio codec, Vorbis has no statically configured
  1742. probability model, instead packing all entropy decoding configuration, VQ and Huffman, into the
  1743. bitstream itself in the third header, the codec setup header. This packed configuration consists of
  1744. multiple &#8217;codebooks&#8217;, each containing a specific Huffman-equivalent representation for decoding
  1745. compressed codewords as well as an optional lookup table of output vector values to which a
  1746. decoded Huffman value is applied as an offset, generating the final decoded output corresponding
  1747. to a given compressed codeword.
  1748. <!--l. 18--><p class="noindent" >
  1749. <h5 class="subsubsectionHead"><span class="titlemark">3.1.1 </span> <a
  1750. id="x1-490003.1.1"></a>Bitwise operation</h5>
  1751. <!--l. 19--><p class="noindent" >The codebook mechanism is built on top of the vorbis bitpacker. Both the codebooks themselves
  1752. and the codewords they decode are unrolled from a packet as a series of arbitrary-width values
  1753. read from the stream according to <a
  1754. href="#x1-360002">Section&#x00A0;2<!--tex4ht:ref: vorbis:spec:bitpacking --></a>, &#8220;<a
  1755. href="#x1-360002">Bitpacking Convention<!--tex4ht:ref: vorbis:spec:bitpacking --></a>&#8221;.
  1756. <!--l. 27--><p class="noindent" >
  1757. <h4 class="subsectionHead"><span class="titlemark">3.2 </span> <a
  1758. id="x1-500003.2"></a>Packed codebook format</h4>
  1759. <!--l. 29--><p class="noindent" >For purposes of the examples below, we assume that the storage system&#8217;s native byte width is
  1760. eight bits. This is not universally true; see <a
  1761. href="#x1-360002">Section&#x00A0;2<!--tex4ht:ref: vorbis:spec:bitpacking --></a>, &#8220;<a
  1762. href="#x1-360002">Bitpacking Convention<!--tex4ht:ref: vorbis:spec:bitpacking --></a>&#8221; for discussion
  1763. relating to non-eight-bit bytes.
  1764. <!--l. 34--><p class="noindent" >
  1765. <h5 class="subsubsectionHead"><span class="titlemark">3.2.1 </span> <a
  1766. id="x1-510003.2.1"></a>codebook decode</h5>
  1767. <!--l. 36--><p class="noindent" >A codebook begins with a 24 bit sync pattern, 0x564342:
  1768. <!--l. 38--><p class="noindent" >
  1769. <div class="fancyvrb" id="fancyvrb7">
  1770. <a
  1771. id="x1-51002r1"></a><span
  1772. class="cmr-6">1</span><span
  1773. class="cmtt-8">&#x00A0;</span><span
  1774. class="cmtt-8">&#x00A0;byte</span><span
  1775. class="cmtt-8">&#x00A0;0:</span><span
  1776. class="cmtt-8">&#x00A0;[</span><span
  1777. class="cmtt-8">&#x00A0;0</span><span
  1778. class="cmtt-8">&#x00A0;1</span><span
  1779. class="cmtt-8">&#x00A0;0</span><span
  1780. class="cmtt-8">&#x00A0;0</span><span
  1781. class="cmtt-8">&#x00A0;0</span><span
  1782. class="cmtt-8">&#x00A0;0</span><span
  1783. class="cmtt-8">&#x00A0;1</span><span
  1784. class="cmtt-8">&#x00A0;0</span><span
  1785. class="cmtt-8">&#x00A0;]</span><span
  1786. class="cmtt-8">&#x00A0;(0x42)</span>
  1787. <br class="fancyvrb" /><a
  1788. id="x1-51004r2"></a><span
  1789. class="cmr-6">2</span><span
  1790. class="cmtt-8">&#x00A0;</span><span
  1791. class="cmtt-8">&#x00A0;byte</span><span
  1792. class="cmtt-8">&#x00A0;1:</span><span
  1793. class="cmtt-8">&#x00A0;[</span><span
  1794. class="cmtt-8">&#x00A0;0</span><span
  1795. class="cmtt-8">&#x00A0;1</span><span
  1796. class="cmtt-8">&#x00A0;0</span><span
  1797. class="cmtt-8">&#x00A0;0</span><span
  1798. class="cmtt-8">&#x00A0;0</span><span
  1799. class="cmtt-8">&#x00A0;0</span><span
  1800. class="cmtt-8">&#x00A0;1</span><span
  1801. class="cmtt-8">&#x00A0;1</span><span
  1802. class="cmtt-8">&#x00A0;]</span><span
  1803. class="cmtt-8">&#x00A0;(0x43)</span>
  1804. <br class="fancyvrb" /><a
  1805. id="x1-51006r3"></a><span
  1806. class="cmr-6">3</span><span
  1807. class="cmtt-8">&#x00A0;</span><span
  1808. class="cmtt-8">&#x00A0;byte</span><span
  1809. class="cmtt-8">&#x00A0;2:</span><span
  1810. class="cmtt-8">&#x00A0;[</span><span
  1811. class="cmtt-8">&#x00A0;0</span><span
  1812. class="cmtt-8">&#x00A0;1</span><span
  1813. class="cmtt-8">&#x00A0;0</span><span
  1814. class="cmtt-8">&#x00A0;1</span><span
  1815. class="cmtt-8">&#x00A0;0</span><span
  1816. class="cmtt-8">&#x00A0;1</span><span
  1817. class="cmtt-8">&#x00A0;1</span><span
  1818. class="cmtt-8">&#x00A0;0</span><span
  1819. class="cmtt-8">&#x00A0;]</span><span
  1820. class="cmtt-8">&#x00A0;(0x56)</span>
  1821. </div>
  1822. <!--l. 44--><p class="noindent" >16 bit <span
  1823. class="cmtt-12">[codebook_dimensions] </span>and 24 bit <span
  1824. class="cmtt-12">[codebook_entries] </span>fields:
  1825. <!--l. 46--><p class="noindent" >
  1826. <div class="fancyvrb" id="fancyvrb8">
  1827. <a
  1828. id="x1-51008r1"></a><span
  1829. class="cmr-6">1</span><span
  1830. class="cmtt-8">&#x00A0;</span><span
  1831. class="cmtt-8">&#x00A0;</span>
  1832. <br class="fancyvrb" /><a
  1833. id="x1-51010r2"></a><span
  1834. class="cmr-6">2</span><span
  1835. class="cmtt-8">&#x00A0;</span><span
  1836. class="cmtt-8">&#x00A0;byte</span><span
  1837. class="cmtt-8">&#x00A0;3:</span><span
  1838. class="cmtt-8">&#x00A0;[</span><span
  1839. class="cmtt-8">&#x00A0;X</span><span
  1840. class="cmtt-8">&#x00A0;X</span><span
  1841. class="cmtt-8">&#x00A0;X</span><span
  1842. class="cmtt-8">&#x00A0;X</span><span
  1843. class="cmtt-8">&#x00A0;X</span><span
  1844. class="cmtt-8">&#x00A0;X</span><span
  1845. class="cmtt-8">&#x00A0;X</span><span
  1846. class="cmtt-8">&#x00A0;X</span><span
  1847. class="cmtt-8">&#x00A0;]</span>
  1848. <br class="fancyvrb" /><a
  1849. id="x1-51012r3"></a><span
  1850. class="cmr-6">3</span><span
  1851. class="cmtt-8">&#x00A0;</span><span
  1852. class="cmtt-8">&#x00A0;byte</span><span
  1853. class="cmtt-8">&#x00A0;4:</span><span
  1854. class="cmtt-8">&#x00A0;[</span><span
  1855. class="cmtt-8">&#x00A0;X</span><span
  1856. class="cmtt-8">&#x00A0;X</span><span
  1857. class="cmtt-8">&#x00A0;X</span><span
  1858. class="cmtt-8">&#x00A0;X</span><span
  1859. class="cmtt-8">&#x00A0;X</span><span
  1860. class="cmtt-8">&#x00A0;X</span><span
  1861. class="cmtt-8">&#x00A0;X</span><span
  1862. class="cmtt-8">&#x00A0;X</span><span
  1863. class="cmtt-8">&#x00A0;]</span><span
  1864. class="cmtt-8">&#x00A0;[codebook_dimensions]</span><span
  1865. class="cmtt-8">&#x00A0;(16</span><span
  1866. class="cmtt-8">&#x00A0;bit</span><span
  1867. class="cmtt-8">&#x00A0;unsigned)</span>
  1868. <br class="fancyvrb" /><a
  1869. id="x1-51014r4"></a><span
  1870. class="cmr-6">4</span><span
  1871. class="cmtt-8">&#x00A0;</span><span
  1872. class="cmtt-8">&#x00A0;</span>
  1873. <br class="fancyvrb" /><a
  1874. id="x1-51016r5"></a><span
  1875. class="cmr-6">5</span><span
  1876. class="cmtt-8">&#x00A0;</span><span
  1877. class="cmtt-8">&#x00A0;byte</span><span
  1878. class="cmtt-8">&#x00A0;5:</span><span
  1879. class="cmtt-8">&#x00A0;[</span><span
  1880. class="cmtt-8">&#x00A0;X</span><span
  1881. class="cmtt-8">&#x00A0;X</span><span
  1882. class="cmtt-8">&#x00A0;X</span><span
  1883. class="cmtt-8">&#x00A0;X</span><span
  1884. class="cmtt-8">&#x00A0;X</span><span
  1885. class="cmtt-8">&#x00A0;X</span><span
  1886. class="cmtt-8">&#x00A0;X</span><span
  1887. class="cmtt-8">&#x00A0;X</span><span
  1888. class="cmtt-8">&#x00A0;]</span>
  1889. <br class="fancyvrb" /><a
  1890. id="x1-51018r6"></a><span
  1891. class="cmr-6">6</span><span
  1892. class="cmtt-8">&#x00A0;</span><span
  1893. class="cmtt-8">&#x00A0;byte</span><span
  1894. class="cmtt-8">&#x00A0;6:</span><span
  1895. class="cmtt-8">&#x00A0;[</span><span
  1896. class="cmtt-8">&#x00A0;X</span><span
  1897. class="cmtt-8">&#x00A0;X</span><span
  1898. class="cmtt-8">&#x00A0;X</span><span
  1899. class="cmtt-8">&#x00A0;X</span><span
  1900. class="cmtt-8">&#x00A0;X</span><span
  1901. class="cmtt-8">&#x00A0;X</span><span
  1902. class="cmtt-8">&#x00A0;X</span><span
  1903. class="cmtt-8">&#x00A0;X</span><span
  1904. class="cmtt-8">&#x00A0;]</span>
  1905. <br class="fancyvrb" /><a
  1906. id="x1-51020r7"></a><span
  1907. class="cmr-6">7</span><span
  1908. class="cmtt-8">&#x00A0;</span><span
  1909. class="cmtt-8">&#x00A0;byte</span><span
  1910. class="cmtt-8">&#x00A0;7:</span><span
  1911. class="cmtt-8">&#x00A0;[</span><span
  1912. class="cmtt-8">&#x00A0;X</span><span
  1913. class="cmtt-8">&#x00A0;X</span><span
  1914. class="cmtt-8">&#x00A0;X</span><span
  1915. class="cmtt-8">&#x00A0;X</span><span
  1916. class="cmtt-8">&#x00A0;X</span><span
  1917. class="cmtt-8">&#x00A0;X</span><span
  1918. class="cmtt-8">&#x00A0;X</span><span
  1919. class="cmtt-8">&#x00A0;X</span><span
  1920. class="cmtt-8">&#x00A0;]</span><span
  1921. class="cmtt-8">&#x00A0;[codebook_entries]</span><span
  1922. class="cmtt-8">&#x00A0;(24</span><span
  1923. class="cmtt-8">&#x00A0;bit</span><span
  1924. class="cmtt-8">&#x00A0;unsigned)</span>
  1925. <br class="fancyvrb" /><a
  1926. id="x1-51022r8"></a><span
  1927. class="cmr-6">8</span><span
  1928. class="cmtt-8">&#x00A0;</span><span
  1929. class="cmtt-8">&#x00A0;</span>
  1930. </div>
  1931. <!--l. 57--><p class="noindent" >Next is the <span
  1932. class="cmtt-12">[ordered] </span>bit flag:
  1933. <!--l. 59--><p class="noindent" >
  1934. <div class="fancyvrb" id="fancyvrb9">
  1935. <a
  1936. id="x1-51024r1"></a><span
  1937. class="cmr-6">1</span><span
  1938. class="cmtt-8">&#x00A0;</span><span
  1939. class="cmtt-8">&#x00A0;</span>
  1940. <br class="fancyvrb" /><a
  1941. id="x1-51026r2"></a><span
  1942. class="cmr-6">2</span><span
  1943. class="cmtt-8">&#x00A0;</span><span
  1944. class="cmtt-8">&#x00A0;byte</span><span
  1945. class="cmtt-8">&#x00A0;8:</span><span
  1946. class="cmtt-8">&#x00A0;[</span><span
  1947. class="cmtt-8">&#x00A0;</span><span
  1948. class="cmtt-8">&#x00A0;</span><span
  1949. class="cmtt-8">&#x00A0;</span><span
  1950. class="cmtt-8">&#x00A0;</span><span
  1951. class="cmtt-8">&#x00A0;</span><span
  1952. class="cmtt-8">&#x00A0;</span><span
  1953. class="cmtt-8">&#x00A0;</span><span
  1954. class="cmtt-8">&#x00A0;</span><span
  1955. class="cmtt-8">&#x00A0;</span><span
  1956. class="cmtt-8">&#x00A0;</span><span
  1957. class="cmtt-8">&#x00A0;</span><span
  1958. class="cmtt-8">&#x00A0;</span><span
  1959. class="cmtt-8">&#x00A0;</span><span
  1960. class="cmtt-8">&#x00A0;</span><span
  1961. class="cmtt-8">&#x00A0;X</span><span
  1962. class="cmtt-8">&#x00A0;]</span><span
  1963. class="cmtt-8">&#x00A0;[ordered]</span><span
  1964. class="cmtt-8">&#x00A0;(1</span><span
  1965. class="cmtt-8">&#x00A0;bit)</span>
  1966. <br class="fancyvrb" /><a
  1967. id="x1-51028r3"></a><span
  1968. class="cmr-6">3</span><span
  1969. class="cmtt-8">&#x00A0;</span><span
  1970. class="cmtt-8">&#x00A0;</span>
  1971. </div>
  1972. <!--l. 65--><p class="noindent" >Each entry, numbering a total of <span
  1973. class="cmtt-12">[codebook_entries]</span>, is assigned a codeword length.
  1974. We now read the list of codeword lengths and store these lengths in the array
  1975. <span
  1976. class="cmtt-12">[codebook_codeword_lengths]</span>. Decode of lengths is according to whether the <span
  1977. class="cmtt-12">[ordered] </span>flag
  1978. is set or unset.
  1979. <ul class="itemize1">
  1980. <li class="itemize">If the <span
  1981. class="cmtt-12">[ordered] </span>flag is unset, the codeword list is not length ordered and the decoder
  1982. needs to read each codeword length one-by-one.
  1983. <!--l. 77--><p class="noindent" >The decoder first reads one additional bit flag, the <span
  1984. class="cmtt-12">[sparse] </span>flag. This flag determines
  1985. whether or not the codebook contains unused entries that are not to be included in
  1986. the codeword decode tree:
  1987. <!--l. 82--><p class="noindent" >
  1988. <div class="fancyvrb" id="fancyvrb10">
  1989. <a
  1990. id="x1-51030r1"></a><span
  1991. class="cmr-6">1</span><span
  1992. class="cmtt-8">&#x00A0;</span><span
  1993. class="cmtt-8">&#x00A0;byte</span><span
  1994. class="cmtt-8">&#x00A0;8:</span><span
  1995. class="cmtt-8">&#x00A0;[</span><span
  1996. class="cmtt-8">&#x00A0;</span><span
  1997. class="cmtt-8">&#x00A0;</span><span
  1998. class="cmtt-8">&#x00A0;</span><span
  1999. class="cmtt-8">&#x00A0;</span><span
  2000. class="cmtt-8">&#x00A0;</span><span
  2001. class="cmtt-8">&#x00A0;</span><span
  2002. class="cmtt-8">&#x00A0;</span><span
  2003. class="cmtt-8">&#x00A0;</span><span
  2004. class="cmtt-8">&#x00A0;</span><span
  2005. class="cmtt-8">&#x00A0;</span><span
  2006. class="cmtt-8">&#x00A0;</span><span
  2007. class="cmtt-8">&#x00A0;</span><span
  2008. class="cmtt-8">&#x00A0;X</span><span
  2009. class="cmtt-8">&#x00A0;1</span><span
  2010. class="cmtt-8">&#x00A0;]</span><span
  2011. class="cmtt-8">&#x00A0;[sparse]</span><span
  2012. class="cmtt-8">&#x00A0;flag</span><span
  2013. class="cmtt-8">&#x00A0;(1</span><span
  2014. class="cmtt-8">&#x00A0;bit)</span>
  2015. </div>
  2016. <!--l. 86--><p class="noindent" >The decoder now performs for each of the <span
  2017. class="cmtt-12">[codebook_entries] </span>codebook entries:
  2018. <!--l. 89--><p class="noindent" >
  2019. <div class="fancyvrb" id="fancyvrb11">
  2020. <a
  2021. id="x1-51032r1"></a><span
  2022. class="cmr-6">1</span><span
  2023. class="cmtt-8">&#x00A0;</span><span
  2024. class="cmtt-8">&#x00A0;</span>
  2025. <br class="fancyvrb" /><a
  2026. id="x1-51034r2"></a><span
  2027. class="cmr-6">2</span><span
  2028. class="cmtt-8">&#x00A0;</span><span
  2029. class="cmtt-8">&#x00A0;</span><span
  2030. class="cmtt-8">&#x00A0;</span><span
  2031. class="cmtt-8">&#x00A0;1)</span><span
  2032. class="cmtt-8">&#x00A0;if([sparse]</span><span
  2033. class="cmtt-8">&#x00A0;is</span><span
  2034. class="cmtt-8">&#x00A0;set)</span><span
  2035. class="cmtt-8">&#x00A0;</span><span
  2036. class="cmsy-8">{</span>
  2037. <br class="fancyvrb" /><a
  2038. id="x1-51036r3"></a><span
  2039. class="cmr-6">3</span><span
  2040. class="cmtt-8">&#x00A0;</span><span
  2041. class="cmtt-8">&#x00A0;</span>
  2042. <br class="fancyvrb" /><a
  2043. id="x1-51038r4"></a><span
  2044. class="cmr-6">4</span><span
  2045. class="cmtt-8">&#x00A0;</span><span
  2046. class="cmtt-8">&#x00A0;</span><span
  2047. class="cmtt-8">&#x00A0;</span><span
  2048. class="cmtt-8">&#x00A0;</span><span
  2049. class="cmtt-8">&#x00A0;</span><span
  2050. class="cmtt-8">&#x00A0;</span><span
  2051. class="cmtt-8">&#x00A0;</span><span
  2052. class="cmtt-8">&#x00A0;</span><span
  2053. class="cmtt-8">&#x00A0;</span><span
  2054. class="cmtt-8">&#x00A0;</span><span
  2055. class="cmtt-8">&#x00A0;2)</span><span
  2056. class="cmtt-8">&#x00A0;[flag]</span><span
  2057. class="cmtt-8">&#x00A0;=</span><span
  2058. class="cmtt-8">&#x00A0;read</span><span
  2059. class="cmtt-8">&#x00A0;one</span><span
  2060. class="cmtt-8">&#x00A0;bit;</span>
  2061. <br class="fancyvrb" /><a
  2062. id="x1-51040r5"></a><span
  2063. class="cmr-6">5</span><span
  2064. class="cmtt-8">&#x00A0;</span><span
  2065. class="cmtt-8">&#x00A0;</span><span
  2066. class="cmtt-8">&#x00A0;</span><span
  2067. class="cmtt-8">&#x00A0;</span><span
  2068. class="cmtt-8">&#x00A0;</span><span
  2069. class="cmtt-8">&#x00A0;</span><span
  2070. class="cmtt-8">&#x00A0;</span><span
  2071. class="cmtt-8">&#x00A0;</span><span
  2072. class="cmtt-8">&#x00A0;</span><span
  2073. class="cmtt-8">&#x00A0;</span><span
  2074. class="cmtt-8">&#x00A0;3)</span><span
  2075. class="cmtt-8">&#x00A0;if([flag]</span><span
  2076. class="cmtt-8">&#x00A0;is</span><span
  2077. class="cmtt-8">&#x00A0;set)</span><span
  2078. class="cmtt-8">&#x00A0;</span><span
  2079. class="cmsy-8">{</span>
  2080. <br class="fancyvrb" /><a
  2081. id="x1-51042r6"></a><span
  2082. class="cmr-6">6</span><span
  2083. class="cmtt-8">&#x00A0;</span><span
  2084. class="cmtt-8">&#x00A0;</span>
  2085. <br class="fancyvrb" /><a
  2086. id="x1-51044r7"></a><span
  2087. class="cmr-6">7</span><span
  2088. class="cmtt-8">&#x00A0;</span><span
  2089. class="cmtt-8">&#x00A0;</span><span
  2090. class="cmtt-8">&#x00A0;</span><span
  2091. class="cmtt-8">&#x00A0;</span><span
  2092. class="cmtt-8">&#x00A0;</span><span
  2093. class="cmtt-8">&#x00A0;</span><span
  2094. class="cmtt-8">&#x00A0;</span><span
  2095. class="cmtt-8">&#x00A0;</span><span
  2096. class="cmtt-8">&#x00A0;</span><span
  2097. class="cmtt-8">&#x00A0;</span><span
  2098. class="cmtt-8">&#x00A0;</span><span
  2099. class="cmtt-8">&#x00A0;</span><span
  2100. class="cmtt-8">&#x00A0;</span><span
  2101. class="cmtt-8">&#x00A0;</span><span
  2102. class="cmtt-8">&#x00A0;</span><span
  2103. class="cmtt-8">&#x00A0;4)</span><span
  2104. class="cmtt-8">&#x00A0;[length]</span><span
  2105. class="cmtt-8">&#x00A0;=</span><span
  2106. class="cmtt-8">&#x00A0;read</span><span
  2107. class="cmtt-8">&#x00A0;a</span><span
  2108. class="cmtt-8">&#x00A0;five</span><span
  2109. class="cmtt-8">&#x00A0;bit</span><span
  2110. class="cmtt-8">&#x00A0;unsigned</span><span
  2111. class="cmtt-8">&#x00A0;integer;</span>
  2112. <br class="fancyvrb" /><a
  2113. id="x1-51046r8"></a><span
  2114. class="cmr-6">8</span><span
  2115. class="cmtt-8">&#x00A0;</span><span
  2116. class="cmtt-8">&#x00A0;</span><span
  2117. class="cmtt-8">&#x00A0;</span><span
  2118. class="cmtt-8">&#x00A0;</span><span
  2119. class="cmtt-8">&#x00A0;</span><span
  2120. class="cmtt-8">&#x00A0;</span><span
  2121. class="cmtt-8">&#x00A0;</span><span
  2122. class="cmtt-8">&#x00A0;</span><span
  2123. class="cmtt-8">&#x00A0;</span><span
  2124. class="cmtt-8">&#x00A0;</span><span
  2125. class="cmtt-8">&#x00A0;</span><span
  2126. class="cmtt-8">&#x00A0;</span><span
  2127. class="cmtt-8">&#x00A0;</span><span
  2128. class="cmtt-8">&#x00A0;</span><span
  2129. class="cmtt-8">&#x00A0;</span><span
  2130. class="cmtt-8">&#x00A0;5)</span><span
  2131. class="cmtt-8">&#x00A0;codeword</span><span
  2132. class="cmtt-8">&#x00A0;length</span><span
  2133. class="cmtt-8">&#x00A0;for</span><span
  2134. class="cmtt-8">&#x00A0;this</span><span
  2135. class="cmtt-8">&#x00A0;entry</span><span
  2136. class="cmtt-8">&#x00A0;is</span><span
  2137. class="cmtt-8">&#x00A0;[length]+1;</span>
  2138. <br class="fancyvrb" /><a
  2139. id="x1-51048r9"></a><span
  2140. class="cmr-6">9</span><span
  2141. class="cmtt-8">&#x00A0;</span><span
  2142. class="cmtt-8">&#x00A0;</span>
  2143. <br class="fancyvrb" /><a
  2144. id="x1-51050r10"></a><span
  2145. class="cmr-6">10</span><span
  2146. class="cmtt-8">&#x00A0;</span><span
  2147. class="cmtt-8">&#x00A0;</span><span
  2148. class="cmtt-8">&#x00A0;</span><span
  2149. class="cmtt-8">&#x00A0;</span><span
  2150. class="cmtt-8">&#x00A0;</span><span
  2151. class="cmtt-8">&#x00A0;</span><span
  2152. class="cmtt-8">&#x00A0;</span><span
  2153. class="cmtt-8">&#x00A0;</span><span
  2154. class="cmtt-8">&#x00A0;</span><span
  2155. class="cmtt-8">&#x00A0;</span><span
  2156. class="cmtt-8">&#x00A0;</span><span
  2157. class="cmtt-8">&#x00A0;</span><span
  2158. class="cmtt-8">&#x00A0;</span><span
  2159. class="cmtt-8">&#x00A0;</span><span
  2160. class="cmsy-8">}</span><span
  2161. class="cmtt-8">&#x00A0;else</span><span
  2162. class="cmtt-8">&#x00A0;</span><span
  2163. class="cmsy-8">{</span>
  2164. <br class="fancyvrb" /><a
  2165. id="x1-51052r11"></a><span
  2166. class="cmr-6">11</span><span
  2167. class="cmtt-8">&#x00A0;</span><span
  2168. class="cmtt-8">&#x00A0;</span>
  2169. <br class="fancyvrb" /><a
  2170. id="x1-51054r12"></a><span
  2171. class="cmr-6">12</span><span
  2172. class="cmtt-8">&#x00A0;</span><span
  2173. class="cmtt-8">&#x00A0;</span><span
  2174. class="cmtt-8">&#x00A0;</span><span
  2175. class="cmtt-8">&#x00A0;</span><span
  2176. class="cmtt-8">&#x00A0;</span><span
  2177. class="cmtt-8">&#x00A0;</span><span
  2178. class="cmtt-8">&#x00A0;</span><span
  2179. class="cmtt-8">&#x00A0;</span><span
  2180. class="cmtt-8">&#x00A0;</span><span
  2181. class="cmtt-8">&#x00A0;</span><span
  2182. class="cmtt-8">&#x00A0;</span><span
  2183. class="cmtt-8">&#x00A0;</span><span
  2184. class="cmtt-8">&#x00A0;</span><span
  2185. class="cmtt-8">&#x00A0;</span><span
  2186. class="cmtt-8">&#x00A0;</span><span
  2187. class="cmtt-8">&#x00A0;6)</span><span
  2188. class="cmtt-8">&#x00A0;this</span><span
  2189. class="cmtt-8">&#x00A0;entry</span><span
  2190. class="cmtt-8">&#x00A0;is</span><span
  2191. class="cmtt-8">&#x00A0;unused.</span><span
  2192. class="cmtt-8">&#x00A0;</span><span
  2193. class="cmtt-8">&#x00A0;mark</span><span
  2194. class="cmtt-8">&#x00A0;it</span><span
  2195. class="cmtt-8">&#x00A0;as</span><span
  2196. class="cmtt-8">&#x00A0;such.</span>
  2197. <br class="fancyvrb" /><a
  2198. id="x1-51056r13"></a><span
  2199. class="cmr-6">13</span><span
  2200. class="cmtt-8">&#x00A0;</span><span
  2201. class="cmtt-8">&#x00A0;</span>
  2202. <br class="fancyvrb" /><a
  2203. id="x1-51058r14"></a><span
  2204. class="cmr-6">14</span><span
  2205. class="cmtt-8">&#x00A0;</span><span
  2206. class="cmtt-8">&#x00A0;</span><span
  2207. class="cmtt-8">&#x00A0;</span><span
  2208. class="cmtt-8">&#x00A0;</span><span
  2209. class="cmtt-8">&#x00A0;</span><span
  2210. class="cmtt-8">&#x00A0;</span><span
  2211. class="cmtt-8">&#x00A0;</span><span
  2212. class="cmtt-8">&#x00A0;</span><span
  2213. class="cmtt-8">&#x00A0;</span><span
  2214. class="cmtt-8">&#x00A0;</span><span
  2215. class="cmtt-8">&#x00A0;</span><span
  2216. class="cmtt-8">&#x00A0;</span><span
  2217. class="cmtt-8">&#x00A0;</span><span
  2218. class="cmtt-8">&#x00A0;</span><span
  2219. class="cmsy-8">}</span>
  2220. <br class="fancyvrb" /><a
  2221. id="x1-51060r15"></a><span
  2222. class="cmr-6">15</span><span
  2223. class="cmtt-8">&#x00A0;</span><span
  2224. class="cmtt-8">&#x00A0;</span>
  2225. <br class="fancyvrb" /><a
  2226. id="x1-51062r16"></a><span
  2227. class="cmr-6">16</span><span
  2228. class="cmtt-8">&#x00A0;</span><span
  2229. class="cmtt-8">&#x00A0;</span><span
  2230. class="cmtt-8">&#x00A0;</span><span
  2231. class="cmtt-8">&#x00A0;</span><span
  2232. class="cmtt-8">&#x00A0;</span><span
  2233. class="cmtt-8">&#x00A0;</span><span
  2234. class="cmtt-8">&#x00A0;</span><span
  2235. class="cmsy-8">}</span><span
  2236. class="cmtt-8">&#x00A0;else</span><span
  2237. class="cmtt-8">&#x00A0;the</span><span
  2238. class="cmtt-8">&#x00A0;sparse</span><span
  2239. class="cmtt-8">&#x00A0;flag</span><span
  2240. class="cmtt-8">&#x00A0;is</span><span
  2241. class="cmtt-8">&#x00A0;not</span><span
  2242. class="cmtt-8">&#x00A0;set</span><span
  2243. class="cmtt-8">&#x00A0;</span><span
  2244. class="cmsy-8">{</span>
  2245. <br class="fancyvrb" /><a
  2246. id="x1-51064r17"></a><span
  2247. class="cmr-6">17</span><span
  2248. class="cmtt-8">&#x00A0;</span><span
  2249. class="cmtt-8">&#x00A0;</span>
  2250. <br class="fancyvrb" /><a
  2251. id="x1-51066r18"></a><span
  2252. class="cmr-6">18</span><span
  2253. class="cmtt-8">&#x00A0;</span><span
  2254. class="cmtt-8">&#x00A0;</span><span
  2255. class="cmtt-8">&#x00A0;</span><span
  2256. class="cmtt-8">&#x00A0;</span><span
  2257. class="cmtt-8">&#x00A0;</span><span
  2258. class="cmtt-8">&#x00A0;</span><span
  2259. class="cmtt-8">&#x00A0;</span><span
  2260. class="cmtt-8">&#x00A0;</span><span
  2261. class="cmtt-8">&#x00A0;</span><span
  2262. class="cmtt-8">&#x00A0;7)</span><span
  2263. class="cmtt-8">&#x00A0;[length]</span><span
  2264. class="cmtt-8">&#x00A0;=</span><span
  2265. class="cmtt-8">&#x00A0;read</span><span
  2266. class="cmtt-8">&#x00A0;a</span><span
  2267. class="cmtt-8">&#x00A0;five</span><span
  2268. class="cmtt-8">&#x00A0;bit</span><span
  2269. class="cmtt-8">&#x00A0;unsigned</span><span
  2270. class="cmtt-8">&#x00A0;integer;</span>
  2271. <br class="fancyvrb" /><a
  2272. id="x1-51068r19"></a><span
  2273. class="cmr-6">19</span><span
  2274. class="cmtt-8">&#x00A0;</span><span
  2275. class="cmtt-8">&#x00A0;</span><span
  2276. class="cmtt-8">&#x00A0;</span><span
  2277. class="cmtt-8">&#x00A0;</span><span
  2278. class="cmtt-8">&#x00A0;</span><span
  2279. class="cmtt-8">&#x00A0;</span><span
  2280. class="cmtt-8">&#x00A0;</span><span
  2281. class="cmtt-8">&#x00A0;</span><span
  2282. class="cmtt-8">&#x00A0;</span><span
  2283. class="cmtt-8">&#x00A0;8)</span><span
  2284. class="cmtt-8">&#x00A0;the</span><span
  2285. class="cmtt-8">&#x00A0;codeword</span><span
  2286. class="cmtt-8">&#x00A0;length</span><span
  2287. class="cmtt-8">&#x00A0;for</span><span
  2288. class="cmtt-8">&#x00A0;this</span><span
  2289. class="cmtt-8">&#x00A0;entry</span><span
  2290. class="cmtt-8">&#x00A0;is</span><span
  2291. class="cmtt-8">&#x00A0;[length]+1;</span>
  2292. <br class="fancyvrb" /><a
  2293. id="x1-51070r20"></a><span
  2294. class="cmr-6">20</span><span
  2295. class="cmtt-8">&#x00A0;</span><span
  2296. class="cmtt-8">&#x00A0;</span>
  2297. <br class="fancyvrb" /><a
  2298. id="x1-51072r21"></a><span
  2299. class="cmr-6">21</span><span
  2300. class="cmtt-8">&#x00A0;</span><span
  2301. class="cmtt-8">&#x00A0;</span><span
  2302. class="cmtt-8">&#x00A0;</span><span
  2303. class="cmtt-8">&#x00A0;</span><span
  2304. class="cmtt-8">&#x00A0;</span><span
  2305. class="cmtt-8">&#x00A0;</span><span
  2306. class="cmtt-8">&#x00A0;</span><span
  2307. class="cmsy-8">}</span>
  2308. <br class="fancyvrb" /><a
  2309. id="x1-51074r22"></a><span
  2310. class="cmr-6">22</span><span
  2311. class="cmtt-8">&#x00A0;</span><span
  2312. class="cmtt-8">&#x00A0;</span>
  2313. </div>
  2314. </li>
  2315. <li class="itemize">If the <span
  2316. class="cmtt-12">[ordered] </span>flag is set, the codeword list for this codebook is encoded in
  2317. ascending length order. Rather than reading a length for every codeword, the
  2318. encoder reads the number of codewords per length. That is, beginning at entry
  2319. zero:
  2320. <!--l. 120--><p class="noindent" >
  2321. <div class="fancyvrb" id="fancyvrb12">
  2322. <a
  2323. id="x1-51076r1"></a><span
  2324. class="cmr-6">1</span><span
  2325. class="cmtt-8">&#x00A0;</span><span
  2326. class="cmtt-8">&#x00A0;</span><span
  2327. class="cmtt-8">&#x00A0;</span><span
  2328. class="cmtt-8">&#x00A0;1)</span><span
  2329. class="cmtt-8">&#x00A0;[current_entry]</span><span
  2330. class="cmtt-8">&#x00A0;=</span><span
  2331. class="cmtt-8">&#x00A0;0;</span>
  2332. <br class="fancyvrb" /><a
  2333. id="x1-51078r2"></a><span
  2334. class="cmr-6">2</span><span
  2335. class="cmtt-8">&#x00A0;</span><span
  2336. class="cmtt-8">&#x00A0;</span><span
  2337. class="cmtt-8">&#x00A0;</span><span
  2338. class="cmtt-8">&#x00A0;2)</span><span
  2339. class="cmtt-8">&#x00A0;[current_length]</span><span
  2340. class="cmtt-8">&#x00A0;=</span><span
  2341. class="cmtt-8">&#x00A0;read</span><span
  2342. class="cmtt-8">&#x00A0;a</span><span
  2343. class="cmtt-8">&#x00A0;five</span><span
  2344. class="cmtt-8">&#x00A0;bit</span><span
  2345. class="cmtt-8">&#x00A0;unsigned</span><span
  2346. class="cmtt-8">&#x00A0;integer</span><span
  2347. class="cmtt-8">&#x00A0;and</span><span
  2348. class="cmtt-8">&#x00A0;add</span><span
  2349. class="cmtt-8">&#x00A0;1;</span>
  2350. <br class="fancyvrb" /><a
  2351. id="x1-51080r3"></a><span
  2352. class="cmr-6">3</span><span
  2353. class="cmtt-8">&#x00A0;</span><span
  2354. class="cmtt-8">&#x00A0;</span><span
  2355. class="cmtt-8">&#x00A0;</span><span
  2356. class="cmtt-8">&#x00A0;3)</span><span
  2357. class="cmtt-8">&#x00A0;[number]</span><span
  2358. class="cmtt-8">&#x00A0;=</span><span
  2359. class="cmtt-8">&#x00A0;read</span><span
  2360. class="cmtt-8">&#x00A0;</span><a
  2361. href="#x1-1170009.2.1"><span
  2362. class="cmtt-8">ilog</span></a><span
  2363. class="cmtt-8">([codebook_entries]</span><span
  2364. class="cmtt-8">&#x00A0;-</span><span
  2365. class="cmtt-8">&#x00A0;[current_entry])</span><span
  2366. class="cmtt-8">&#x00A0;bits</span><span
  2367. class="cmtt-8">&#x00A0;as</span><span
  2368. class="cmtt-8">&#x00A0;an</span><span
  2369. class="cmtt-8">&#x00A0;unsigned</span><span
  2370. class="cmtt-8">&#x00A0;integer</span>
  2371. <br class="fancyvrb" /><a
  2372. id="x1-51082r4"></a><span
  2373. class="cmr-6">4</span><span
  2374. class="cmtt-8">&#x00A0;</span><span
  2375. class="cmtt-8">&#x00A0;</span><span
  2376. class="cmtt-8">&#x00A0;</span><span
  2377. class="cmtt-8">&#x00A0;4)</span><span
  2378. class="cmtt-8">&#x00A0;set</span><span
  2379. class="cmtt-8">&#x00A0;the</span><span
  2380. class="cmtt-8">&#x00A0;entries</span><span
  2381. class="cmtt-8">&#x00A0;[current_entry]</span><span
  2382. class="cmtt-8">&#x00A0;through</span><span
  2383. class="cmtt-8">&#x00A0;[current_entry]+[number]-1,</span><span
  2384. class="cmtt-8">&#x00A0;inclusive,</span>
  2385. <br class="fancyvrb" /><a
  2386. id="x1-51084r5"></a><span
  2387. class="cmr-6">5</span><span
  2388. class="cmtt-8">&#x00A0;</span><span
  2389. class="cmtt-8">&#x00A0;</span><span
  2390. class="cmtt-8">&#x00A0;</span><span
  2391. class="cmtt-8">&#x00A0;</span><span
  2392. class="cmtt-8">&#x00A0;</span><span
  2393. class="cmtt-8">&#x00A0;of</span><span
  2394. class="cmtt-8">&#x00A0;the</span><span
  2395. class="cmtt-8">&#x00A0;[codebook_codeword_lengths]</span><span
  2396. class="cmtt-8">&#x00A0;array</span><span
  2397. class="cmtt-8">&#x00A0;to</span><span
  2398. class="cmtt-8">&#x00A0;[current_length]</span>
  2399. <br class="fancyvrb" /><a
  2400. id="x1-51086r6"></a><span
  2401. class="cmr-6">6</span><span
  2402. class="cmtt-8">&#x00A0;</span><span
  2403. class="cmtt-8">&#x00A0;</span><span
  2404. class="cmtt-8">&#x00A0;</span><span
  2405. class="cmtt-8">&#x00A0;5)</span><span
  2406. class="cmtt-8">&#x00A0;set</span><span
  2407. class="cmtt-8">&#x00A0;[current_entry]</span><span
  2408. class="cmtt-8">&#x00A0;to</span><span
  2409. class="cmtt-8">&#x00A0;[number]</span><span
  2410. class="cmtt-8">&#x00A0;+</span><span
  2411. class="cmtt-8">&#x00A0;[current_entry]</span>
  2412. <br class="fancyvrb" /><a
  2413. id="x1-51088r7"></a><span
  2414. class="cmr-6">7</span><span
  2415. class="cmtt-8">&#x00A0;</span><span
  2416. class="cmtt-8">&#x00A0;</span><span
  2417. class="cmtt-8">&#x00A0;</span><span
  2418. class="cmtt-8">&#x00A0;6)</span><span
  2419. class="cmtt-8">&#x00A0;increment</span><span
  2420. class="cmtt-8">&#x00A0;[current_length]</span><span
  2421. class="cmtt-8">&#x00A0;by</span><span
  2422. class="cmtt-8">&#x00A0;1</span>
  2423. <br class="fancyvrb" /><a
  2424. id="x1-51090r8"></a><span
  2425. class="cmr-6">8</span><span
  2426. class="cmtt-8">&#x00A0;</span><span
  2427. class="cmtt-8">&#x00A0;</span><span
  2428. class="cmtt-8">&#x00A0;</span><span
  2429. class="cmtt-8">&#x00A0;7)</span><span
  2430. class="cmtt-8">&#x00A0;if</span><span
  2431. class="cmtt-8">&#x00A0;[current_entry]</span><span
  2432. class="cmtt-8">&#x00A0;is</span><span
  2433. class="cmtt-8">&#x00A0;greater</span><span
  2434. class="cmtt-8">&#x00A0;than</span><span
  2435. class="cmtt-8">&#x00A0;[codebook_entries]</span><span
  2436. class="cmtt-8">&#x00A0;ERROR</span><span
  2437. class="cmtt-8">&#x00A0;CONDITION;</span>
  2438. <br class="fancyvrb" /><a
  2439. id="x1-51092r9"></a><span
  2440. class="cmr-6">9</span><span
  2441. class="cmtt-8">&#x00A0;</span><span
  2442. class="cmtt-8">&#x00A0;</span><span
  2443. class="cmtt-8">&#x00A0;</span><span
  2444. class="cmtt-8">&#x00A0;</span><span
  2445. class="cmtt-8">&#x00A0;</span><span
  2446. class="cmtt-8">&#x00A0;the</span><span
  2447. class="cmtt-8">&#x00A0;decoder</span><span
  2448. class="cmtt-8">&#x00A0;will</span><span
  2449. class="cmtt-8">&#x00A0;not</span><span
  2450. class="cmtt-8">&#x00A0;be</span><span
  2451. class="cmtt-8">&#x00A0;able</span><span
  2452. class="cmtt-8">&#x00A0;to</span><span
  2453. class="cmtt-8">&#x00A0;read</span><span
  2454. class="cmtt-8">&#x00A0;this</span><span
  2455. class="cmtt-8">&#x00A0;stream.</span>
  2456. <br class="fancyvrb" /><a
  2457. id="x1-51094r10"></a><span
  2458. class="cmr-6">10</span><span
  2459. class="cmtt-8">&#x00A0;</span><span
  2460. class="cmtt-8">&#x00A0;</span><span
  2461. class="cmtt-8">&#x00A0;</span><span
  2462. class="cmtt-8">&#x00A0;8)</span><span
  2463. class="cmtt-8">&#x00A0;if</span><span
  2464. class="cmtt-8">&#x00A0;[current_entry]</span><span
  2465. class="cmtt-8">&#x00A0;is</span><span
  2466. class="cmtt-8">&#x00A0;less</span><span
  2467. class="cmtt-8">&#x00A0;than</span><span
  2468. class="cmtt-8">&#x00A0;[codebook_entries],</span><span
  2469. class="cmtt-8">&#x00A0;repeat</span><span
  2470. class="cmtt-8">&#x00A0;process</span><span
  2471. class="cmtt-8">&#x00A0;starting</span><span
  2472. class="cmtt-8">&#x00A0;at</span><span
  2473. class="cmtt-8">&#x00A0;3)</span>
  2474. <br class="fancyvrb" /><a
  2475. id="x1-51096r11"></a><span
  2476. class="cmr-6">11</span><span
  2477. class="cmtt-8">&#x00A0;</span><span
  2478. class="cmtt-8">&#x00A0;</span><span
  2479. class="cmtt-8">&#x00A0;</span><span
  2480. class="cmtt-8">&#x00A0;9)</span><span
  2481. class="cmtt-8">&#x00A0;done.</span>
  2482. </div>
  2483. </li></ul>
  2484. <!--l. 136--><p class="noindent" >After all codeword lengths have been decoded, the decoder reads the vector lookup table. Vorbis
  2485. I supports three lookup types:
  2486. <ol class="enumerate1" >
  2487. <li
  2488. class="enumerate" id="x1-51098x1">No lookup
  2489. </li>
  2490. <li
  2491. class="enumerate" id="x1-51100x2">Implicitly populated value mapping (lattice VQ)
  2492. </li>
  2493. <li
  2494. class="enumerate" id="x1-51102x3">Explicitly populated value mapping (tessellated or &#8217;foam&#8217; VQ)</li></ol>
  2495. <!--l. 149--><p class="noindent" >The lookup table type is read as a four bit unsigned integer:
  2496. <div class="fancyvrb" id="fancyvrb13">
  2497. <a
  2498. id="x1-51104r1"></a><span
  2499. class="cmr-6">1</span><span
  2500. class="cmtt-8">&#x00A0;</span><span
  2501. class="cmtt-8">&#x00A0;</span><span
  2502. class="cmtt-8">&#x00A0;</span><span
  2503. class="cmtt-8">&#x00A0;1)</span><span
  2504. class="cmtt-8">&#x00A0;[codebook_lookup_type]</span><span
  2505. class="cmtt-8">&#x00A0;=</span><span
  2506. class="cmtt-8">&#x00A0;read</span><span
  2507. class="cmtt-8">&#x00A0;four</span><span
  2508. class="cmtt-8">&#x00A0;bits</span><span
  2509. class="cmtt-8">&#x00A0;as</span><span
  2510. class="cmtt-8">&#x00A0;an</span><span
  2511. class="cmtt-8">&#x00A0;unsigned</span><span
  2512. class="cmtt-8">&#x00A0;integer</span>
  2513. </div>
  2514. <!--l. 154--><p class="noindent" >Codebook decode precedes according to <span
  2515. class="cmtt-12">[codebook_lookup_type]</span>:
  2516. <ul class="itemize1">
  2517. <li class="itemize">Lookup type zero indicates no lookup to be read. Proceed past lookup decode.
  2518. </li>
  2519. <li class="itemize">Lookup types one and two are similar, differing only in the number of lookup values to
  2520. be read. Lookup type one reads a list of values that are permuted in a set pattern to
  2521. build a list of vectors, each vector of order <span
  2522. class="cmtt-12">[codebook_dimensions] </span>scalars. Lookup
  2523. type two builds the same vector list, but reads each scalar for each vector explicitly,
  2524. rather than building vectors from a smaller list of possible scalar values. Lookup
  2525. decode proceeds as follows:
  2526. <!--l. 168--><p class="noindent" >
  2527. <div class="fancyvrb" id="fancyvrb14">
  2528. <a
  2529. id="x1-51106r1"></a><span
  2530. class="cmr-6">1</span><span
  2531. class="cmtt-8">&#x00A0;</span><span
  2532. class="cmtt-8">&#x00A0;</span><span
  2533. class="cmtt-8">&#x00A0;</span><span
  2534. class="cmtt-8">&#x00A0;1)</span><span
  2535. class="cmtt-8">&#x00A0;[codebook_minimum_value]</span><span
  2536. class="cmtt-8">&#x00A0;=</span><span
  2537. class="cmtt-8">&#x00A0;</span><a
  2538. href="#x1-1180009.2.2"><span
  2539. class="cmtt-8">float32_unpack</span></a><span
  2540. class="cmtt-8">(</span><span
  2541. class="cmtt-8">&#x00A0;read</span><span
  2542. class="cmtt-8">&#x00A0;32</span><span
  2543. class="cmtt-8">&#x00A0;bits</span><span
  2544. class="cmtt-8">&#x00A0;as</span><span
  2545. class="cmtt-8">&#x00A0;an</span><span
  2546. class="cmtt-8">&#x00A0;unsigned</span><span
  2547. class="cmtt-8">&#x00A0;integer)</span>
  2548. <br class="fancyvrb" /><a
  2549. id="x1-51108r2"></a><span
  2550. class="cmr-6">2</span><span
  2551. class="cmtt-8">&#x00A0;</span><span
  2552. class="cmtt-8">&#x00A0;</span><span
  2553. class="cmtt-8">&#x00A0;</span><span
  2554. class="cmtt-8">&#x00A0;2)</span><span
  2555. class="cmtt-8">&#x00A0;[codebook_delta_value]</span><span
  2556. class="cmtt-8">&#x00A0;=</span><span
  2557. class="cmtt-8">&#x00A0;</span><a
  2558. href="#x1-1180009.2.2"><span
  2559. class="cmtt-8">float32_unpack</span></a><span
  2560. class="cmtt-8">(</span><span
  2561. class="cmtt-8">&#x00A0;read</span><span
  2562. class="cmtt-8">&#x00A0;32</span><span
  2563. class="cmtt-8">&#x00A0;bits</span><span
  2564. class="cmtt-8">&#x00A0;as</span><span
  2565. class="cmtt-8">&#x00A0;an</span><span
  2566. class="cmtt-8">&#x00A0;unsigned</span><span
  2567. class="cmtt-8">&#x00A0;integer)</span>
  2568. <br class="fancyvrb" /><a
  2569. id="x1-51110r3"></a><span
  2570. class="cmr-6">3</span><span
  2571. class="cmtt-8">&#x00A0;</span><span
  2572. class="cmtt-8">&#x00A0;</span><span
  2573. class="cmtt-8">&#x00A0;</span><span
  2574. class="cmtt-8">&#x00A0;3)</span><span
  2575. class="cmtt-8">&#x00A0;[codebook_value_bits]</span><span
  2576. class="cmtt-8">&#x00A0;=</span><span
  2577. class="cmtt-8">&#x00A0;read</span><span
  2578. class="cmtt-8">&#x00A0;4</span><span
  2579. class="cmtt-8">&#x00A0;bits</span><span
  2580. class="cmtt-8">&#x00A0;as</span><span
  2581. class="cmtt-8">&#x00A0;an</span><span
  2582. class="cmtt-8">&#x00A0;unsigned</span><span
  2583. class="cmtt-8">&#x00A0;integer</span><span
  2584. class="cmtt-8">&#x00A0;and</span><span
  2585. class="cmtt-8">&#x00A0;add</span><span
  2586. class="cmtt-8">&#x00A0;1</span>
  2587. <br class="fancyvrb" /><a
  2588. id="x1-51112r4"></a><span
  2589. class="cmr-6">4</span><span
  2590. class="cmtt-8">&#x00A0;</span><span
  2591. class="cmtt-8">&#x00A0;</span><span
  2592. class="cmtt-8">&#x00A0;</span><span
  2593. class="cmtt-8">&#x00A0;4)</span><span
  2594. class="cmtt-8">&#x00A0;[codebook_sequence_p]</span><span
  2595. class="cmtt-8">&#x00A0;=</span><span
  2596. class="cmtt-8">&#x00A0;read</span><span
  2597. class="cmtt-8">&#x00A0;1</span><span
  2598. class="cmtt-8">&#x00A0;bit</span><span
  2599. class="cmtt-8">&#x00A0;as</span><span
  2600. class="cmtt-8">&#x00A0;a</span><span
  2601. class="cmtt-8">&#x00A0;boolean</span><span
  2602. class="cmtt-8">&#x00A0;flag</span>
  2603. <br class="fancyvrb" /><a
  2604. id="x1-51114r5"></a><span
  2605. class="cmr-6">5</span><span
  2606. class="cmtt-8">&#x00A0;</span><span
  2607. class="cmtt-8">&#x00A0;</span>
  2608. <br class="fancyvrb" /><a
  2609. id="x1-51116r6"></a><span
  2610. class="cmr-6">6</span><span
  2611. class="cmtt-8">&#x00A0;</span><span
  2612. class="cmtt-8">&#x00A0;</span><span
  2613. class="cmtt-8">&#x00A0;</span><span
  2614. class="cmtt-8">&#x00A0;if</span><span
  2615. class="cmtt-8">&#x00A0;(</span><span
  2616. class="cmtt-8">&#x00A0;[codebook_lookup_type]</span><span
  2617. class="cmtt-8">&#x00A0;is</span><span
  2618. class="cmtt-8">&#x00A0;1</span><span
  2619. class="cmtt-8">&#x00A0;)</span><span
  2620. class="cmtt-8">&#x00A0;</span><span
  2621. class="cmsy-8">{</span>
  2622. <br class="fancyvrb" /><a
  2623. id="x1-51118r7"></a><span
  2624. class="cmr-6">7</span><span
  2625. class="cmtt-8">&#x00A0;</span><span
  2626. class="cmtt-8">&#x00A0;</span>
  2627. <br class="fancyvrb" /><a
  2628. id="x1-51120r8"></a><span
  2629. class="cmr-6">8</span><span
  2630. class="cmtt-8">&#x00A0;</span><span
  2631. class="cmtt-8">&#x00A0;</span><span
  2632. class="cmtt-8">&#x00A0;</span><span
  2633. class="cmtt-8">&#x00A0;</span><span
  2634. class="cmtt-8">&#x00A0;</span><span
  2635. class="cmtt-8">&#x00A0;</span><span
  2636. class="cmtt-8">&#x00A0;5)</span><span
  2637. class="cmtt-8">&#x00A0;[codebook_lookup_values]</span><span
  2638. class="cmtt-8">&#x00A0;=</span><span
  2639. class="cmtt-8">&#x00A0;</span><a
  2640. href="#x1-1190009.2.3"><span
  2641. class="cmtt-8">lookup1_values</span></a><span
  2642. class="cmtt-8">([codebook_entries],</span><span
  2643. class="cmtt-8">&#x00A0;[codebook_dimensions]</span><span
  2644. class="cmtt-8">&#x00A0;)</span>
  2645. <br class="fancyvrb" /><a
  2646. id="x1-51122r9"></a><span
  2647. class="cmr-6">9</span><span
  2648. class="cmtt-8">&#x00A0;</span><span
  2649. class="cmtt-8">&#x00A0;</span>
  2650. <br class="fancyvrb" /><a
  2651. id="x1-51124r10"></a><span
  2652. class="cmr-6">10</span><span
  2653. class="cmtt-8">&#x00A0;</span><span
  2654. class="cmtt-8">&#x00A0;</span><span
  2655. class="cmtt-8">&#x00A0;</span><span
  2656. class="cmtt-8">&#x00A0;</span><span
  2657. class="cmsy-8">}</span><span
  2658. class="cmtt-8">&#x00A0;else</span><span
  2659. class="cmtt-8">&#x00A0;</span><span
  2660. class="cmsy-8">{</span>
  2661. <br class="fancyvrb" /><a
  2662. id="x1-51126r11"></a><span
  2663. class="cmr-6">11</span><span
  2664. class="cmtt-8">&#x00A0;</span><span
  2665. class="cmtt-8">&#x00A0;</span>
  2666. <br class="fancyvrb" /><a
  2667. id="x1-51128r12"></a><span
  2668. class="cmr-6">12</span><span
  2669. class="cmtt-8">&#x00A0;</span><span
  2670. class="cmtt-8">&#x00A0;</span><span
  2671. class="cmtt-8">&#x00A0;</span><span
  2672. class="cmtt-8">&#x00A0;</span><span
  2673. class="cmtt-8">&#x00A0;</span><span
  2674. class="cmtt-8">&#x00A0;</span><span
  2675. class="cmtt-8">&#x00A0;6)</span><span
  2676. class="cmtt-8">&#x00A0;[codebook_lookup_values]</span><span
  2677. class="cmtt-8">&#x00A0;=</span><span
  2678. class="cmtt-8">&#x00A0;[codebook_entries]</span><span
  2679. class="cmtt-8">&#x00A0;*</span><span
  2680. class="cmtt-8">&#x00A0;[codebook_dimensions]</span>
  2681. <br class="fancyvrb" /><a
  2682. id="x1-51130r13"></a><span
  2683. class="cmr-6">13</span><span
  2684. class="cmtt-8">&#x00A0;</span><span
  2685. class="cmtt-8">&#x00A0;</span>
  2686. <br class="fancyvrb" /><a
  2687. id="x1-51132r14"></a><span
  2688. class="cmr-6">14</span><span
  2689. class="cmtt-8">&#x00A0;</span><span
  2690. class="cmtt-8">&#x00A0;</span><span
  2691. class="cmtt-8">&#x00A0;</span><span
  2692. class="cmtt-8">&#x00A0;</span><span
  2693. class="cmsy-8">}</span>
  2694. <br class="fancyvrb" /><a
  2695. id="x1-51134r15"></a><span
  2696. class="cmr-6">15</span><span
  2697. class="cmtt-8">&#x00A0;</span><span
  2698. class="cmtt-8">&#x00A0;</span>
  2699. <br class="fancyvrb" /><a
  2700. id="x1-51136r16"></a><span
  2701. class="cmr-6">16</span><span
  2702. class="cmtt-8">&#x00A0;</span><span
  2703. class="cmtt-8">&#x00A0;</span><span
  2704. class="cmtt-8">&#x00A0;</span><span
  2705. class="cmtt-8">&#x00A0;7)</span><span
  2706. class="cmtt-8">&#x00A0;read</span><span
  2707. class="cmtt-8">&#x00A0;a</span><span
  2708. class="cmtt-8">&#x00A0;total</span><span
  2709. class="cmtt-8">&#x00A0;of</span><span
  2710. class="cmtt-8">&#x00A0;[codebook_lookup_values]</span><span
  2711. class="cmtt-8">&#x00A0;unsigned</span><span
  2712. class="cmtt-8">&#x00A0;integers</span><span
  2713. class="cmtt-8">&#x00A0;of</span><span
  2714. class="cmtt-8">&#x00A0;[codebook_value_bits]</span><span
  2715. class="cmtt-8">&#x00A0;each;</span>
  2716. <br class="fancyvrb" /><a
  2717. id="x1-51138r17"></a><span
  2718. class="cmr-6">17</span><span
  2719. class="cmtt-8">&#x00A0;</span><span
  2720. class="cmtt-8">&#x00A0;</span><span
  2721. class="cmtt-8">&#x00A0;</span><span
  2722. class="cmtt-8">&#x00A0;</span><span
  2723. class="cmtt-8">&#x00A0;</span><span
  2724. class="cmtt-8">&#x00A0;</span><span
  2725. class="cmtt-8">&#x00A0;store</span><span
  2726. class="cmtt-8">&#x00A0;these</span><span
  2727. class="cmtt-8">&#x00A0;in</span><span
  2728. class="cmtt-8">&#x00A0;order</span><span
  2729. class="cmtt-8">&#x00A0;in</span><span
  2730. class="cmtt-8">&#x00A0;the</span><span
  2731. class="cmtt-8">&#x00A0;array</span><span
  2732. class="cmtt-8">&#x00A0;[codebook_multiplicands]</span>
  2733. </div>
  2734. </li>
  2735. <li class="itemize">A <span
  2736. class="cmtt-12">[codebook_lookup_type] </span>of greater than two is reserved and indicates a stream that is
  2737. not decodable by the specification in this document.
  2738. </li></ul>
  2739. <!--l. 195--><p class="noindent" >An &#8217;end of packet&#8217; during any read operation in the above steps is considered an error condition
  2740. rendering the stream undecodable.
  2741. <!--l. 198--><p class="noindent" ><span class="paragraphHead"><a
  2742. id="x1-520003.2.1"></a><span
  2743. class="cmbx-12">Huffman decision tree representation</span></span>
  2744. The <span
  2745. class="cmtt-12">[codebook_codeword_lengths] </span>array and <span
  2746. class="cmtt-12">[codebook_entries] </span>value uniquely define the
  2747. Huffman decision tree used for entropy decoding.
  2748. <!--l. 204--><p class="noindent" >Briefly, each used codebook entry (recall that length-unordered codebooks support unused
  2749. codeword entries) is assigned, in order, the lowest valued unused binary Huffman codeword
  2750. possible. Assume the following codeword length list:
  2751. <!--l. 209--><p class="noindent" >
  2752. <div class="fancyvrb" id="fancyvrb15">
  2753. <a
  2754. id="x1-52002r1"></a><span
  2755. class="cmr-6">1</span><span
  2756. class="cmtt-8">&#x00A0;</span><span
  2757. class="cmtt-8">&#x00A0;entry</span><span
  2758. class="cmtt-8">&#x00A0;0:</span><span
  2759. class="cmtt-8">&#x00A0;length</span><span
  2760. class="cmtt-8">&#x00A0;2</span>
  2761. <br class="fancyvrb" /><a
  2762. id="x1-52004r2"></a><span
  2763. class="cmr-6">2</span><span
  2764. class="cmtt-8">&#x00A0;</span><span
  2765. class="cmtt-8">&#x00A0;entry</span><span
  2766. class="cmtt-8">&#x00A0;1:</span><span
  2767. class="cmtt-8">&#x00A0;length</span><span
  2768. class="cmtt-8">&#x00A0;4</span>
  2769. <br class="fancyvrb" /><a
  2770. id="x1-52006r3"></a><span
  2771. class="cmr-6">3</span><span
  2772. class="cmtt-8">&#x00A0;</span><span
  2773. class="cmtt-8">&#x00A0;entry</span><span
  2774. class="cmtt-8">&#x00A0;2:</span><span
  2775. class="cmtt-8">&#x00A0;length</span><span
  2776. class="cmtt-8">&#x00A0;4</span>
  2777. <br class="fancyvrb" /><a
  2778. id="x1-52008r4"></a><span
  2779. class="cmr-6">4</span><span
  2780. class="cmtt-8">&#x00A0;</span><span
  2781. class="cmtt-8">&#x00A0;entry</span><span
  2782. class="cmtt-8">&#x00A0;3:</span><span
  2783. class="cmtt-8">&#x00A0;length</span><span
  2784. class="cmtt-8">&#x00A0;4</span>
  2785. <br class="fancyvrb" /><a
  2786. id="x1-52010r5"></a><span
  2787. class="cmr-6">5</span><span
  2788. class="cmtt-8">&#x00A0;</span><span
  2789. class="cmtt-8">&#x00A0;entry</span><span
  2790. class="cmtt-8">&#x00A0;4:</span><span
  2791. class="cmtt-8">&#x00A0;length</span><span
  2792. class="cmtt-8">&#x00A0;4</span>
  2793. <br class="fancyvrb" /><a
  2794. id="x1-52012r6"></a><span
  2795. class="cmr-6">6</span><span
  2796. class="cmtt-8">&#x00A0;</span><span
  2797. class="cmtt-8">&#x00A0;entry</span><span
  2798. class="cmtt-8">&#x00A0;5:</span><span
  2799. class="cmtt-8">&#x00A0;length</span><span
  2800. class="cmtt-8">&#x00A0;2</span>
  2801. <br class="fancyvrb" /><a
  2802. id="x1-52014r7"></a><span
  2803. class="cmr-6">7</span><span
  2804. class="cmtt-8">&#x00A0;</span><span
  2805. class="cmtt-8">&#x00A0;entry</span><span
  2806. class="cmtt-8">&#x00A0;6:</span><span
  2807. class="cmtt-8">&#x00A0;length</span><span
  2808. class="cmtt-8">&#x00A0;3</span>
  2809. <br class="fancyvrb" /><a
  2810. id="x1-52016r8"></a><span
  2811. class="cmr-6">8</span><span
  2812. class="cmtt-8">&#x00A0;</span><span
  2813. class="cmtt-8">&#x00A0;entry</span><span
  2814. class="cmtt-8">&#x00A0;7:</span><span
  2815. class="cmtt-8">&#x00A0;length</span><span
  2816. class="cmtt-8">&#x00A0;3</span>
  2817. </div>
  2818. <!--l. 220--><p class="noindent" >Assigning codewords in order (lowest possible value of the appropriate length to highest) results
  2819. in the following codeword list:
  2820. <!--l. 223--><p class="noindent" >
  2821. <div class="fancyvrb" id="fancyvrb16">
  2822. <a
  2823. id="x1-52018r1"></a><span
  2824. class="cmr-6">1</span><span
  2825. class="cmtt-8">&#x00A0;</span><span
  2826. class="cmtt-8">&#x00A0;entry</span><span
  2827. class="cmtt-8">&#x00A0;0:</span><span
  2828. class="cmtt-8">&#x00A0;length</span><span
  2829. class="cmtt-8">&#x00A0;2</span><span
  2830. class="cmtt-8">&#x00A0;codeword</span><span
  2831. class="cmtt-8">&#x00A0;00</span>
  2832. <br class="fancyvrb" /><a
  2833. id="x1-52020r2"></a><span
  2834. class="cmr-6">2</span><span
  2835. class="cmtt-8">&#x00A0;</span><span
  2836. class="cmtt-8">&#x00A0;entry</span><span
  2837. class="cmtt-8">&#x00A0;1:</span><span
  2838. class="cmtt-8">&#x00A0;length</span><span
  2839. class="cmtt-8">&#x00A0;4</span><span
  2840. class="cmtt-8">&#x00A0;codeword</span><span
  2841. class="cmtt-8">&#x00A0;0100</span>
  2842. <br class="fancyvrb" /><a
  2843. id="x1-52022r3"></a><span
  2844. class="cmr-6">3</span><span
  2845. class="cmtt-8">&#x00A0;</span><span
  2846. class="cmtt-8">&#x00A0;entry</span><span
  2847. class="cmtt-8">&#x00A0;2:</span><span
  2848. class="cmtt-8">&#x00A0;length</span><span
  2849. class="cmtt-8">&#x00A0;4</span><span
  2850. class="cmtt-8">&#x00A0;codeword</span><span
  2851. class="cmtt-8">&#x00A0;0101</span>
  2852. <br class="fancyvrb" /><a
  2853. id="x1-52024r4"></a><span
  2854. class="cmr-6">4</span><span
  2855. class="cmtt-8">&#x00A0;</span><span
  2856. class="cmtt-8">&#x00A0;entry</span><span
  2857. class="cmtt-8">&#x00A0;3:</span><span
  2858. class="cmtt-8">&#x00A0;length</span><span
  2859. class="cmtt-8">&#x00A0;4</span><span
  2860. class="cmtt-8">&#x00A0;codeword</span><span
  2861. class="cmtt-8">&#x00A0;0110</span>
  2862. <br class="fancyvrb" /><a
  2863. id="x1-52026r5"></a><span
  2864. class="cmr-6">5</span><span
  2865. class="cmtt-8">&#x00A0;</span><span
  2866. class="cmtt-8">&#x00A0;entry</span><span
  2867. class="cmtt-8">&#x00A0;4:</span><span
  2868. class="cmtt-8">&#x00A0;length</span><span
  2869. class="cmtt-8">&#x00A0;4</span><span
  2870. class="cmtt-8">&#x00A0;codeword</span><span
  2871. class="cmtt-8">&#x00A0;0111</span>
  2872. <br class="fancyvrb" /><a
  2873. id="x1-52028r6"></a><span
  2874. class="cmr-6">6</span><span
  2875. class="cmtt-8">&#x00A0;</span><span
  2876. class="cmtt-8">&#x00A0;entry</span><span
  2877. class="cmtt-8">&#x00A0;5:</span><span
  2878. class="cmtt-8">&#x00A0;length</span><span
  2879. class="cmtt-8">&#x00A0;2</span><span
  2880. class="cmtt-8">&#x00A0;codeword</span><span
  2881. class="cmtt-8">&#x00A0;10</span>
  2882. <br class="fancyvrb" /><a
  2883. id="x1-52030r7"></a><span
  2884. class="cmr-6">7</span><span
  2885. class="cmtt-8">&#x00A0;</span><span
  2886. class="cmtt-8">&#x00A0;entry</span><span
  2887. class="cmtt-8">&#x00A0;6:</span><span
  2888. class="cmtt-8">&#x00A0;length</span><span
  2889. class="cmtt-8">&#x00A0;3</span><span
  2890. class="cmtt-8">&#x00A0;codeword</span><span
  2891. class="cmtt-8">&#x00A0;110</span>
  2892. <br class="fancyvrb" /><a
  2893. id="x1-52032r8"></a><span
  2894. class="cmr-6">8</span><span
  2895. class="cmtt-8">&#x00A0;</span><span
  2896. class="cmtt-8">&#x00A0;entry</span><span
  2897. class="cmtt-8">&#x00A0;7:</span><span
  2898. class="cmtt-8">&#x00A0;length</span><span
  2899. class="cmtt-8">&#x00A0;3</span><span
  2900. class="cmtt-8">&#x00A0;codeword</span><span
  2901. class="cmtt-8">&#x00A0;111</span>
  2902. </div>
  2903. <!--l. 235--><p class="noindent" ><span class="likesubparagraphHead"><a
  2904. id="x1-530003.2.1"></a><span
  2905. class="cmbx-12">Note:</span></span> Unlike most binary numerical values in this document, we intend the above codewords to
  2906. be read and used bit by bit from left to right, thus the codeword &#8217;001&#8217; is the bit string &#8217;zero, zero,
  2907. one&#8217;. When determining &#8217;lowest possible value&#8217; in the assignment definition above, the leftmost
  2908. bit is the MSb.
  2909. <!--l. 243--><p class="noindent" >It is clear that the codeword length list represents a Huffman decision tree with the entry
  2910. numbers equivalent to the leaves numbered left-to-right:
  2911. <div class="center"
  2912. >
  2913. <!--l. 247--><p class="noindent" >
  2914. <!--l. 248--><p class="noindent" ><img
  2915. src="hufftree.png" alt="PIC"
  2916. >
  2917. <br /> <table class="caption"
  2918. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;4: </td><td
  2919. class="content">huffman tree illustration</td></tr></table><!--tex4ht:label?: x1-530014 -->
  2920. </div>
  2921. <!--l. 253--><p class="noindent" >As we assign codewords in order, we see that each choice constructs a new leaf in the leftmost
  2922. possible position.
  2923. <!--l. 256--><p class="noindent" >Note that it&#8217;s possible to underspecify or overspecify a Huffman tree via the length list.
  2924. In the above example, if codeword seven were eliminated, it&#8217;s clear that the tree is
  2925. unfinished:
  2926. <div class="center"
  2927. >
  2928. <!--l. 260--><p class="noindent" >
  2929. <!--l. 261--><p class="noindent" ><img
  2930. src="hufftree-under.png" alt="PIC"
  2931. >
  2932. <br /> <table class="caption"
  2933. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;5: </td><td
  2934. class="content">underspecified huffman tree illustration</td></tr></table><!--tex4ht:label?: x1-530025 -->
  2935. </div>
  2936. <!--l. 266--><p class="noindent" >Similarly, in the original codebook, it&#8217;s clear that the tree is fully populated and a ninth
  2937. codeword is impossible. Both underspecified and overspecified trees are an error condition
  2938. rendering the stream undecodable. Take special care that a codebook with a single used
  2939. entry is handled properly; it consists of a single codework of zero bits and &#8217;reading&#8217;
  2940. a value out of such a codebook always returns the single used value and sinks zero
  2941. bits.
  2942. <!--l. 274--><p class="noindent" >Codebook entries marked &#8217;unused&#8217; are simply skipped in the assigning process. They have no
  2943. codeword and do not appear in the decision tree, thus it&#8217;s impossible for any bit pattern read
  2944. from the stream to decode to that entry number.
  2945. <!--l. 281--><p class="noindent" ><span class="paragraphHead"><a
  2946. id="x1-540003.2.1"></a><span
  2947. class="cmbx-12">VQ lookup table vector representation</span></span>
  2948. Unpacking the VQ lookup table vectors relies on the following values:
  2949. <div class="fancyvrb" id="fancyvrb17">
  2950. <a
  2951. id="x1-54002r1"></a><span
  2952. class="cmr-6">1</span><span
  2953. class="cmtt-8">&#x00A0;</span><span
  2954. class="cmtt-8">&#x00A0;the</span><span
  2955. class="cmtt-8">&#x00A0;[codebook_multiplicands]</span><span
  2956. class="cmtt-8">&#x00A0;array</span>
  2957. <br class="fancyvrb" /><a
  2958. id="x1-54004r2"></a><span
  2959. class="cmr-6">2</span><span
  2960. class="cmtt-8">&#x00A0;</span><span
  2961. class="cmtt-8">&#x00A0;[codebook_minimum_value]</span>
  2962. <br class="fancyvrb" /><a
  2963. id="x1-54006r3"></a><span
  2964. class="cmr-6">3</span><span
  2965. class="cmtt-8">&#x00A0;</span><span
  2966. class="cmtt-8">&#x00A0;[codebook_delta_value]</span>
  2967. <br class="fancyvrb" /><a
  2968. id="x1-54008r4"></a><span
  2969. class="cmr-6">4</span><span
  2970. class="cmtt-8">&#x00A0;</span><span
  2971. class="cmtt-8">&#x00A0;[codebook_sequence_p]</span>
  2972. <br class="fancyvrb" /><a
  2973. id="x1-54010r5"></a><span
  2974. class="cmr-6">5</span><span
  2975. class="cmtt-8">&#x00A0;</span><span
  2976. class="cmtt-8">&#x00A0;[codebook_lookup_type]</span>
  2977. <br class="fancyvrb" /><a
  2978. id="x1-54012r6"></a><span
  2979. class="cmr-6">6</span><span
  2980. class="cmtt-8">&#x00A0;</span><span
  2981. class="cmtt-8">&#x00A0;[codebook_entries]</span>
  2982. <br class="fancyvrb" /><a
  2983. id="x1-54014r7"></a><span
  2984. class="cmr-6">7</span><span
  2985. class="cmtt-8">&#x00A0;</span><span
  2986. class="cmtt-8">&#x00A0;[codebook_dimensions]</span>
  2987. <br class="fancyvrb" /><a
  2988. id="x1-54016r8"></a><span
  2989. class="cmr-6">8</span><span
  2990. class="cmtt-8">&#x00A0;</span><span
  2991. class="cmtt-8">&#x00A0;[codebook_lookup_values]</span>
  2992. </div>
  2993. <!--l. 297--><p class="noindent" >Decoding (unpacking) a specific vector in the vector lookup table proceeds according to
  2994. <span
  2995. class="cmtt-12">[codebook_lookup_type]</span>. The unpacked vector values are what a codebook would return
  2996. during audio packet decode in a VQ context.
  2997. <!--l. 302--><p class="noindent" ><span class="paragraphHead"><a
  2998. id="x1-550003.2.1"></a><span
  2999. class="cmbx-12">Vector value decode: Lookup type 1</span></span>
  3000. Lookup type one specifies a lattice VQ lookup table built algorithmically from a list of
  3001. scalar values. Calculate (unpack) the final values of a codebook entry vector from
  3002. the entries in <span
  3003. class="cmtt-12">[codebook_multiplicands] </span>as follows (<span
  3004. class="cmtt-12">[value_vector] </span>is the output
  3005. vector representing the vector of values for entry number <span
  3006. class="cmtt-12">[lookup_offset] </span>in this
  3007. codebook):
  3008. <!--l. 311--><p class="noindent" >
  3009. <div class="fancyvrb" id="fancyvrb18">
  3010. <a
  3011. id="x1-55002r1"></a><span
  3012. class="cmr-6">1</span><span
  3013. class="cmtt-8">&#x00A0;</span><span
  3014. class="cmtt-8">&#x00A0;</span><span
  3015. class="cmtt-8">&#x00A0;</span><span
  3016. class="cmtt-8">&#x00A0;1)</span><span
  3017. class="cmtt-8">&#x00A0;[last]</span><span
  3018. class="cmtt-8">&#x00A0;=</span><span
  3019. class="cmtt-8">&#x00A0;0;</span>
  3020. <br class="fancyvrb" /><a
  3021. id="x1-55004r2"></a><span
  3022. class="cmr-6">2</span><span
  3023. class="cmtt-8">&#x00A0;</span><span
  3024. class="cmtt-8">&#x00A0;</span><span
  3025. class="cmtt-8">&#x00A0;</span><span
  3026. class="cmtt-8">&#x00A0;2)</span><span
  3027. class="cmtt-8">&#x00A0;[index_divisor]</span><span
  3028. class="cmtt-8">&#x00A0;=</span><span
  3029. class="cmtt-8">&#x00A0;1;</span>
  3030. <br class="fancyvrb" /><a
  3031. id="x1-55006r3"></a><span
  3032. class="cmr-6">3</span><span
  3033. class="cmtt-8">&#x00A0;</span><span
  3034. class="cmtt-8">&#x00A0;</span><span
  3035. class="cmtt-8">&#x00A0;</span><span
  3036. class="cmtt-8">&#x00A0;3)</span><span
  3037. class="cmtt-8">&#x00A0;iterate</span><span
  3038. class="cmtt-8">&#x00A0;[i]</span><span
  3039. class="cmtt-8">&#x00A0;over</span><span
  3040. class="cmtt-8">&#x00A0;the</span><span
  3041. class="cmtt-8">&#x00A0;range</span><span
  3042. class="cmtt-8">&#x00A0;0</span><span
  3043. class="cmtt-8">&#x00A0;...</span><span
  3044. class="cmtt-8">&#x00A0;[codebook_dimensions]-1</span><span
  3045. class="cmtt-8">&#x00A0;(once</span><span
  3046. class="cmtt-8">&#x00A0;for</span><span
  3047. class="cmtt-8">&#x00A0;each</span><span
  3048. class="cmtt-8">&#x00A0;scalar</span><span
  3049. class="cmtt-8">&#x00A0;value</span><span
  3050. class="cmtt-8">&#x00A0;in</span><span
  3051. class="cmtt-8">&#x00A0;the</span><span
  3052. class="cmtt-8">&#x00A0;value</span><span
  3053. class="cmtt-8">&#x00A0;vector)</span><span
  3054. class="cmtt-8">&#x00A0;</span><span
  3055. class="cmsy-8">{</span>
  3056. <br class="fancyvrb" /><a
  3057. id="x1-55008r4"></a><span
  3058. class="cmr-6">4</span><span
  3059. class="cmtt-8">&#x00A0;</span><span
  3060. class="cmtt-8">&#x00A0;</span>
  3061. <br class="fancyvrb" /><a
  3062. id="x1-55010r5"></a><span
  3063. class="cmr-6">5</span><span
  3064. class="cmtt-8">&#x00A0;</span><span
  3065. class="cmtt-8">&#x00A0;</span><span
  3066. class="cmtt-8">&#x00A0;</span><span
  3067. class="cmtt-8">&#x00A0;</span><span
  3068. class="cmtt-8">&#x00A0;</span><span
  3069. class="cmtt-8">&#x00A0;</span><span
  3070. class="cmtt-8">&#x00A0;</span><span
  3071. class="cmtt-8">&#x00A0;</span><span
  3072. class="cmtt-8">&#x00A0;4)</span><span
  3073. class="cmtt-8">&#x00A0;[multiplicand_offset]</span><span
  3074. class="cmtt-8">&#x00A0;=</span><span
  3075. class="cmtt-8">&#x00A0;(</span><span
  3076. class="cmtt-8">&#x00A0;[lookup_offset]</span><span
  3077. class="cmtt-8">&#x00A0;divided</span><span
  3078. class="cmtt-8">&#x00A0;by</span><span
  3079. class="cmtt-8">&#x00A0;[index_divisor]</span><span
  3080. class="cmtt-8">&#x00A0;using</span><span
  3081. class="cmtt-8">&#x00A0;integer</span>
  3082. <br class="fancyvrb" /><a
  3083. id="x1-55012r6"></a><span
  3084. class="cmr-6">6</span><span
  3085. class="cmtt-8">&#x00A0;</span><span
  3086. class="cmtt-8">&#x00A0;</span><span
  3087. class="cmtt-8">&#x00A0;</span><span
  3088. class="cmtt-8">&#x00A0;</span><span
  3089. class="cmtt-8">&#x00A0;</span><span
  3090. class="cmtt-8">&#x00A0;</span><span
  3091. class="cmtt-8">&#x00A0;</span><span
  3092. class="cmtt-8">&#x00A0;</span><span
  3093. class="cmtt-8">&#x00A0;</span><span
  3094. class="cmtt-8">&#x00A0;</span><span
  3095. class="cmtt-8">&#x00A0;</span><span
  3096. class="cmtt-8">&#x00A0;division</span><span
  3097. class="cmtt-8">&#x00A0;)</span><span
  3098. class="cmtt-8">&#x00A0;integer</span><span
  3099. class="cmtt-8">&#x00A0;modulo</span><span
  3100. class="cmtt-8">&#x00A0;[codebook_lookup_values]</span>
  3101. <br class="fancyvrb" /><a
  3102. id="x1-55014r7"></a><span
  3103. class="cmr-6">7</span><span
  3104. class="cmtt-8">&#x00A0;</span><span
  3105. class="cmtt-8">&#x00A0;</span>
  3106. <br class="fancyvrb" /><a
  3107. id="x1-55016r8"></a><span
  3108. class="cmr-6">8</span><span
  3109. class="cmtt-8">&#x00A0;</span><span
  3110. class="cmtt-8">&#x00A0;</span><span
  3111. class="cmtt-8">&#x00A0;</span><span
  3112. class="cmtt-8">&#x00A0;</span><span
  3113. class="cmtt-8">&#x00A0;</span><span
  3114. class="cmtt-8">&#x00A0;</span><span
  3115. class="cmtt-8">&#x00A0;</span><span
  3116. class="cmtt-8">&#x00A0;</span><span
  3117. class="cmtt-8">&#x00A0;5)</span><span
  3118. class="cmtt-8">&#x00A0;vector</span><span
  3119. class="cmtt-8">&#x00A0;[value_vector]</span><span
  3120. class="cmtt-8">&#x00A0;element</span><span
  3121. class="cmtt-8">&#x00A0;[i]</span><span
  3122. class="cmtt-8">&#x00A0;=</span>
  3123. <br class="fancyvrb" /><a
  3124. id="x1-55018r9"></a><span
  3125. class="cmr-6">9</span><span
  3126. class="cmtt-8">&#x00A0;</span><span
  3127. class="cmtt-8">&#x00A0;</span><span
  3128. class="cmtt-8">&#x00A0;</span><span
  3129. class="cmtt-8">&#x00A0;</span><span
  3130. class="cmtt-8">&#x00A0;</span><span
  3131. class="cmtt-8">&#x00A0;</span><span
  3132. class="cmtt-8">&#x00A0;</span><span
  3133. class="cmtt-8">&#x00A0;</span><span
  3134. class="cmtt-8">&#x00A0;</span><span
  3135. class="cmtt-8">&#x00A0;</span><span
  3136. class="cmtt-8">&#x00A0;</span><span
  3137. class="cmtt-8">&#x00A0;</span><span
  3138. class="cmtt-8">&#x00A0;</span><span
  3139. class="cmtt-8">&#x00A0;(</span><span
  3140. class="cmtt-8">&#x00A0;[codebook_multiplicands]</span><span
  3141. class="cmtt-8">&#x00A0;array</span><span
  3142. class="cmtt-8">&#x00A0;element</span><span
  3143. class="cmtt-8">&#x00A0;number</span><span
  3144. class="cmtt-8">&#x00A0;[multiplicand_offset]</span><span
  3145. class="cmtt-8">&#x00A0;)</span><span
  3146. class="cmtt-8">&#x00A0;*</span>
  3147. <br class="fancyvrb" /><a
  3148. id="x1-55020r10"></a><span
  3149. class="cmr-6">10</span><span
  3150. class="cmtt-8">&#x00A0;</span><span
  3151. class="cmtt-8">&#x00A0;</span><span
  3152. class="cmtt-8">&#x00A0;</span><span
  3153. class="cmtt-8">&#x00A0;</span><span
  3154. class="cmtt-8">&#x00A0;</span><span
  3155. class="cmtt-8">&#x00A0;</span><span
  3156. class="cmtt-8">&#x00A0;</span><span
  3157. class="cmtt-8">&#x00A0;</span><span
  3158. class="cmtt-8">&#x00A0;</span><span
  3159. class="cmtt-8">&#x00A0;</span><span
  3160. class="cmtt-8">&#x00A0;</span><span
  3161. class="cmtt-8">&#x00A0;</span><span
  3162. class="cmtt-8">&#x00A0;</span><span
  3163. class="cmtt-8">&#x00A0;[codebook_delta_value]</span><span
  3164. class="cmtt-8">&#x00A0;+</span><span
  3165. class="cmtt-8">&#x00A0;[codebook_minimum_value]</span><span
  3166. class="cmtt-8">&#x00A0;+</span><span
  3167. class="cmtt-8">&#x00A0;[last];</span>
  3168. <br class="fancyvrb" /><a
  3169. id="x1-55022r11"></a><span
  3170. class="cmr-6">11</span><span
  3171. class="cmtt-8">&#x00A0;</span><span
  3172. class="cmtt-8">&#x00A0;</span>
  3173. <br class="fancyvrb" /><a
  3174. id="x1-55024r12"></a><span
  3175. class="cmr-6">12</span><span
  3176. class="cmtt-8">&#x00A0;</span><span
  3177. class="cmtt-8">&#x00A0;</span><span
  3178. class="cmtt-8">&#x00A0;</span><span
  3179. class="cmtt-8">&#x00A0;</span><span
  3180. class="cmtt-8">&#x00A0;</span><span
  3181. class="cmtt-8">&#x00A0;</span><span
  3182. class="cmtt-8">&#x00A0;</span><span
  3183. class="cmtt-8">&#x00A0;</span><span
  3184. class="cmtt-8">&#x00A0;6)</span><span
  3185. class="cmtt-8">&#x00A0;if</span><span
  3186. class="cmtt-8">&#x00A0;(</span><span
  3187. class="cmtt-8">&#x00A0;[codebook_sequence_p]</span><span
  3188. class="cmtt-8">&#x00A0;is</span><span
  3189. class="cmtt-8">&#x00A0;set</span><span
  3190. class="cmtt-8">&#x00A0;)</span><span
  3191. class="cmtt-8">&#x00A0;then</span><span
  3192. class="cmtt-8">&#x00A0;set</span><span
  3193. class="cmtt-8">&#x00A0;[last]</span><span
  3194. class="cmtt-8">&#x00A0;=</span><span
  3195. class="cmtt-8">&#x00A0;vector</span><span
  3196. class="cmtt-8">&#x00A0;[value_vector]</span><span
  3197. class="cmtt-8">&#x00A0;element</span><span
  3198. class="cmtt-8">&#x00A0;[i]</span>
  3199. <br class="fancyvrb" /><a
  3200. id="x1-55026r13"></a><span
  3201. class="cmr-6">13</span><span
  3202. class="cmtt-8">&#x00A0;</span><span
  3203. class="cmtt-8">&#x00A0;</span>
  3204. <br class="fancyvrb" /><a
  3205. id="x1-55028r14"></a><span
  3206. class="cmr-6">14</span><span
  3207. class="cmtt-8">&#x00A0;</span><span
  3208. class="cmtt-8">&#x00A0;</span><span
  3209. class="cmtt-8">&#x00A0;</span><span
  3210. class="cmtt-8">&#x00A0;</span><span
  3211. class="cmtt-8">&#x00A0;</span><span
  3212. class="cmtt-8">&#x00A0;</span><span
  3213. class="cmtt-8">&#x00A0;</span><span
  3214. class="cmtt-8">&#x00A0;</span><span
  3215. class="cmtt-8">&#x00A0;7)</span><span
  3216. class="cmtt-8">&#x00A0;[index_divisor]</span><span
  3217. class="cmtt-8">&#x00A0;=</span><span
  3218. class="cmtt-8">&#x00A0;[index_divisor]</span><span
  3219. class="cmtt-8">&#x00A0;*</span><span
  3220. class="cmtt-8">&#x00A0;[codebook_lookup_values]</span>
  3221. <br class="fancyvrb" /><a
  3222. id="x1-55030r15"></a><span
  3223. class="cmr-6">15</span><span
  3224. class="cmtt-8">&#x00A0;</span><span
  3225. class="cmtt-8">&#x00A0;</span>
  3226. <br class="fancyvrb" /><a
  3227. id="x1-55032r16"></a><span
  3228. class="cmr-6">16</span><span
  3229. class="cmtt-8">&#x00A0;</span><span
  3230. class="cmtt-8">&#x00A0;</span><span
  3231. class="cmtt-8">&#x00A0;</span><span
  3232. class="cmtt-8">&#x00A0;</span><span
  3233. class="cmtt-8">&#x00A0;</span><span
  3234. class="cmtt-8">&#x00A0;</span><span
  3235. class="cmtt-8">&#x00A0;</span><span
  3236. class="cmsy-8">}</span>
  3237. <br class="fancyvrb" /><a
  3238. id="x1-55034r17"></a><span
  3239. class="cmr-6">17</span><span
  3240. class="cmtt-8">&#x00A0;</span><span
  3241. class="cmtt-8">&#x00A0;</span>
  3242. <br class="fancyvrb" /><a
  3243. id="x1-55036r18"></a><span
  3244. class="cmr-6">18</span><span
  3245. class="cmtt-8">&#x00A0;</span><span
  3246. class="cmtt-8">&#x00A0;</span><span
  3247. class="cmtt-8">&#x00A0;</span><span
  3248. class="cmtt-8">&#x00A0;8)</span><span
  3249. class="cmtt-8">&#x00A0;vector</span><span
  3250. class="cmtt-8">&#x00A0;calculation</span><span
  3251. class="cmtt-8">&#x00A0;completed.</span>
  3252. </div>
  3253. <!--l. 334--><p class="noindent" ><span class="paragraphHead"><a
  3254. id="x1-560003.2.1"></a><span
  3255. class="cmbx-12">Vector value decode: Lookup type 2</span></span>
  3256. Lookup type two specifies a VQ lookup table in which each scalar in each vector is explicitly set
  3257. by the <span
  3258. class="cmtt-12">[codebook_multiplicands] </span>array in a one-to-one mapping. Calculate [unpack] the final
  3259. values of a codebook entry vector from the entries in <span
  3260. class="cmtt-12">[codebook_multiplicands] </span>as follows
  3261. (<span
  3262. class="cmtt-12">[value_vector] </span>is the output vector representing the vector of values for entry number
  3263. <span
  3264. class="cmtt-12">[lookup_offset] </span>in this codebook):
  3265. <!--l. 344--><p class="noindent" >
  3266. <div class="fancyvrb" id="fancyvrb19">
  3267. <a
  3268. id="x1-56002r1"></a><span
  3269. class="cmr-6">1</span><span
  3270. class="cmtt-8">&#x00A0;</span><span
  3271. class="cmtt-8">&#x00A0;</span><span
  3272. class="cmtt-8">&#x00A0;</span><span
  3273. class="cmtt-8">&#x00A0;1)</span><span
  3274. class="cmtt-8">&#x00A0;[last]</span><span
  3275. class="cmtt-8">&#x00A0;=</span><span
  3276. class="cmtt-8">&#x00A0;0;</span>
  3277. <br class="fancyvrb" /><a
  3278. id="x1-56004r2"></a><span
  3279. class="cmr-6">2</span><span
  3280. class="cmtt-8">&#x00A0;</span><span
  3281. class="cmtt-8">&#x00A0;</span><span
  3282. class="cmtt-8">&#x00A0;</span><span
  3283. class="cmtt-8">&#x00A0;2)</span><span
  3284. class="cmtt-8">&#x00A0;[multiplicand_offset]</span><span
  3285. class="cmtt-8">&#x00A0;=</span><span
  3286. class="cmtt-8">&#x00A0;[lookup_offset]</span><span
  3287. class="cmtt-8">&#x00A0;*</span><span
  3288. class="cmtt-8">&#x00A0;[codebook_dimensions]</span>
  3289. <br class="fancyvrb" /><a
  3290. id="x1-56006r3"></a><span
  3291. class="cmr-6">3</span><span
  3292. class="cmtt-8">&#x00A0;</span><span
  3293. class="cmtt-8">&#x00A0;</span><span
  3294. class="cmtt-8">&#x00A0;</span><span
  3295. class="cmtt-8">&#x00A0;3)</span><span
  3296. class="cmtt-8">&#x00A0;iterate</span><span
  3297. class="cmtt-8">&#x00A0;[i]</span><span
  3298. class="cmtt-8">&#x00A0;over</span><span
  3299. class="cmtt-8">&#x00A0;the</span><span
  3300. class="cmtt-8">&#x00A0;range</span><span
  3301. class="cmtt-8">&#x00A0;0</span><span
  3302. class="cmtt-8">&#x00A0;...</span><span
  3303. class="cmtt-8">&#x00A0;[codebook_dimensions]-1</span><span
  3304. class="cmtt-8">&#x00A0;(once</span><span
  3305. class="cmtt-8">&#x00A0;for</span><span
  3306. class="cmtt-8">&#x00A0;each</span><span
  3307. class="cmtt-8">&#x00A0;scalar</span><span
  3308. class="cmtt-8">&#x00A0;value</span><span
  3309. class="cmtt-8">&#x00A0;in</span><span
  3310. class="cmtt-8">&#x00A0;the</span><span
  3311. class="cmtt-8">&#x00A0;value</span><span
  3312. class="cmtt-8">&#x00A0;vector)</span><span
  3313. class="cmtt-8">&#x00A0;</span><span
  3314. class="cmsy-8">{</span>
  3315. <br class="fancyvrb" /><a
  3316. id="x1-56008r4"></a><span
  3317. class="cmr-6">4</span><span
  3318. class="cmtt-8">&#x00A0;</span><span
  3319. class="cmtt-8">&#x00A0;</span>
  3320. <br class="fancyvrb" /><a
  3321. id="x1-56010r5"></a><span
  3322. class="cmr-6">5</span><span
  3323. class="cmtt-8">&#x00A0;</span><span
  3324. class="cmtt-8">&#x00A0;</span><span
  3325. class="cmtt-8">&#x00A0;</span><span
  3326. class="cmtt-8">&#x00A0;</span><span
  3327. class="cmtt-8">&#x00A0;</span><span
  3328. class="cmtt-8">&#x00A0;</span><span
  3329. class="cmtt-8">&#x00A0;</span><span
  3330. class="cmtt-8">&#x00A0;</span><span
  3331. class="cmtt-8">&#x00A0;4)</span><span
  3332. class="cmtt-8">&#x00A0;vector</span><span
  3333. class="cmtt-8">&#x00A0;[value_vector]</span><span
  3334. class="cmtt-8">&#x00A0;element</span><span
  3335. class="cmtt-8">&#x00A0;[i]</span><span
  3336. class="cmtt-8">&#x00A0;=</span>
  3337. <br class="fancyvrb" /><a
  3338. id="x1-56012r6"></a><span
  3339. class="cmr-6">6</span><span
  3340. class="cmtt-8">&#x00A0;</span><span
  3341. class="cmtt-8">&#x00A0;</span><span
  3342. class="cmtt-8">&#x00A0;</span><span
  3343. class="cmtt-8">&#x00A0;</span><span
  3344. class="cmtt-8">&#x00A0;</span><span
  3345. class="cmtt-8">&#x00A0;</span><span
  3346. class="cmtt-8">&#x00A0;</span><span
  3347. class="cmtt-8">&#x00A0;</span><span
  3348. class="cmtt-8">&#x00A0;</span><span
  3349. class="cmtt-8">&#x00A0;</span><span
  3350. class="cmtt-8">&#x00A0;</span><span
  3351. class="cmtt-8">&#x00A0;</span><span
  3352. class="cmtt-8">&#x00A0;</span><span
  3353. class="cmtt-8">&#x00A0;(</span><span
  3354. class="cmtt-8">&#x00A0;[codebook_multiplicands]</span><span
  3355. class="cmtt-8">&#x00A0;array</span><span
  3356. class="cmtt-8">&#x00A0;element</span><span
  3357. class="cmtt-8">&#x00A0;number</span><span
  3358. class="cmtt-8">&#x00A0;[multiplicand_offset]</span><span
  3359. class="cmtt-8">&#x00A0;)</span><span
  3360. class="cmtt-8">&#x00A0;*</span>
  3361. <br class="fancyvrb" /><a
  3362. id="x1-56014r7"></a><span
  3363. class="cmr-6">7</span><span
  3364. class="cmtt-8">&#x00A0;</span><span
  3365. class="cmtt-8">&#x00A0;</span><span
  3366. class="cmtt-8">&#x00A0;</span><span
  3367. class="cmtt-8">&#x00A0;</span><span
  3368. class="cmtt-8">&#x00A0;</span><span
  3369. class="cmtt-8">&#x00A0;</span><span
  3370. class="cmtt-8">&#x00A0;</span><span
  3371. class="cmtt-8">&#x00A0;</span><span
  3372. class="cmtt-8">&#x00A0;</span><span
  3373. class="cmtt-8">&#x00A0;</span><span
  3374. class="cmtt-8">&#x00A0;</span><span
  3375. class="cmtt-8">&#x00A0;</span><span
  3376. class="cmtt-8">&#x00A0;</span><span
  3377. class="cmtt-8">&#x00A0;[codebook_delta_value]</span><span
  3378. class="cmtt-8">&#x00A0;+</span><span
  3379. class="cmtt-8">&#x00A0;[codebook_minimum_value]</span><span
  3380. class="cmtt-8">&#x00A0;+</span><span
  3381. class="cmtt-8">&#x00A0;[last];</span>
  3382. <br class="fancyvrb" /><a
  3383. id="x1-56016r8"></a><span
  3384. class="cmr-6">8</span><span
  3385. class="cmtt-8">&#x00A0;</span><span
  3386. class="cmtt-8">&#x00A0;</span>
  3387. <br class="fancyvrb" /><a
  3388. id="x1-56018r9"></a><span
  3389. class="cmr-6">9</span><span
  3390. class="cmtt-8">&#x00A0;</span><span
  3391. class="cmtt-8">&#x00A0;</span><span
  3392. class="cmtt-8">&#x00A0;</span><span
  3393. class="cmtt-8">&#x00A0;</span><span
  3394. class="cmtt-8">&#x00A0;</span><span
  3395. class="cmtt-8">&#x00A0;</span><span
  3396. class="cmtt-8">&#x00A0;</span><span
  3397. class="cmtt-8">&#x00A0;</span><span
  3398. class="cmtt-8">&#x00A0;5)</span><span
  3399. class="cmtt-8">&#x00A0;if</span><span
  3400. class="cmtt-8">&#x00A0;(</span><span
  3401. class="cmtt-8">&#x00A0;[codebook_sequence_p]</span><span
  3402. class="cmtt-8">&#x00A0;is</span><span
  3403. class="cmtt-8">&#x00A0;set</span><span
  3404. class="cmtt-8">&#x00A0;)</span><span
  3405. class="cmtt-8">&#x00A0;then</span><span
  3406. class="cmtt-8">&#x00A0;set</span><span
  3407. class="cmtt-8">&#x00A0;[last]</span><span
  3408. class="cmtt-8">&#x00A0;=</span><span
  3409. class="cmtt-8">&#x00A0;vector</span><span
  3410. class="cmtt-8">&#x00A0;[value_vector]</span><span
  3411. class="cmtt-8">&#x00A0;element</span><span
  3412. class="cmtt-8">&#x00A0;[i]</span>
  3413. <br class="fancyvrb" /><a
  3414. id="x1-56020r10"></a><span
  3415. class="cmr-6">10</span><span
  3416. class="cmtt-8">&#x00A0;</span><span
  3417. class="cmtt-8">&#x00A0;</span>
  3418. <br class="fancyvrb" /><a
  3419. id="x1-56022r11"></a><span
  3420. class="cmr-6">11</span><span
  3421. class="cmtt-8">&#x00A0;</span><span
  3422. class="cmtt-8">&#x00A0;</span><span
  3423. class="cmtt-8">&#x00A0;</span><span
  3424. class="cmtt-8">&#x00A0;</span><span
  3425. class="cmtt-8">&#x00A0;</span><span
  3426. class="cmtt-8">&#x00A0;</span><span
  3427. class="cmtt-8">&#x00A0;</span><span
  3428. class="cmtt-8">&#x00A0;</span><span
  3429. class="cmtt-8">&#x00A0;6)</span><span
  3430. class="cmtt-8">&#x00A0;increment</span><span
  3431. class="cmtt-8">&#x00A0;[multiplicand_offset]</span>
  3432. <br class="fancyvrb" /><a
  3433. id="x1-56024r12"></a><span
  3434. class="cmr-6">12</span><span
  3435. class="cmtt-8">&#x00A0;</span><span
  3436. class="cmtt-8">&#x00A0;</span>
  3437. <br class="fancyvrb" /><a
  3438. id="x1-56026r13"></a><span
  3439. class="cmr-6">13</span><span
  3440. class="cmtt-8">&#x00A0;</span><span
  3441. class="cmtt-8">&#x00A0;</span><span
  3442. class="cmtt-8">&#x00A0;</span><span
  3443. class="cmtt-8">&#x00A0;</span><span
  3444. class="cmtt-8">&#x00A0;</span><span
  3445. class="cmtt-8">&#x00A0;</span><span
  3446. class="cmtt-8">&#x00A0;</span><span
  3447. class="cmsy-8">}</span>
  3448. <br class="fancyvrb" /><a
  3449. id="x1-56028r14"></a><span
  3450. class="cmr-6">14</span><span
  3451. class="cmtt-8">&#x00A0;</span><span
  3452. class="cmtt-8">&#x00A0;</span>
  3453. <br class="fancyvrb" /><a
  3454. id="x1-56030r15"></a><span
  3455. class="cmr-6">15</span><span
  3456. class="cmtt-8">&#x00A0;</span><span
  3457. class="cmtt-8">&#x00A0;</span><span
  3458. class="cmtt-8">&#x00A0;</span><span
  3459. class="cmtt-8">&#x00A0;7)</span><span
  3460. class="cmtt-8">&#x00A0;vector</span><span
  3461. class="cmtt-8">&#x00A0;calculation</span><span
  3462. class="cmtt-8">&#x00A0;completed.</span>
  3463. </div>
  3464. <!--l. 370--><p class="noindent" >
  3465. <h4 class="subsectionHead"><span class="titlemark">3.3 </span> <a
  3466. id="x1-570003.3"></a>Use of the codebook abstraction</h4>
  3467. <!--l. 372--><p class="noindent" >The decoder uses the codebook abstraction much as it does the bit-unpacking convention; a
  3468. specific codebook reads a codeword from the bitstream, decoding it into an entry number, and
  3469. then returns that entry number to the decoder (when used in a scalar entropy coding context), or
  3470. uses that entry number as an offset into the VQ lookup table, returning a vector of values (when
  3471. used in a context desiring a VQ value). Scalar or VQ context is always explicit; any
  3472. call to the codebook mechanism requests either a scalar entry number or a lookup
  3473. vector.
  3474. <!--l. 382--><p class="noindent" >Note that VQ lookup type zero indicates that there is no lookup table; requesting
  3475. decode using a codebook of lookup type 0 in any context expecting a vector return
  3476. value (even in a case where a vector of dimension one) is forbidden. If decoder setup
  3477. or decode requests such an action, that is an error condition rendering the packet
  3478. undecodable.
  3479. <!--l. 389--><p class="noindent" >Using a codebook to read from the packet bitstream consists first of reading and decoding the
  3480. next codeword in the bitstream. The decoder reads bits until the accumulated bits match a
  3481. codeword in the codebook. This process can be though of as logically walking the
  3482. Huffman decode tree by reading one bit at a time from the bitstream, and using the
  3483. bit as a decision boolean to take the 0 branch (left in the above examples) or the 1
  3484. branch (right in the above examples). Walking the tree finishes when the decode process
  3485. hits a leaf in the decision tree; the result is the entry number corresponding to that
  3486. leaf. Reading past the end of a packet propagates the &#8217;end-of-stream&#8217; condition to the
  3487. decoder.
  3488. <!--l. 401--><p class="noindent" >When used in a scalar context, the resulting codeword entry is the desired return
  3489. value.
  3490. <!--l. 404--><p class="noindent" >When used in a VQ context, the codeword entry number is used as an offset into the VQ lookup
  3491. table. The value returned to the decoder is the vector of scalars corresponding to this
  3492. offset.
  3493. <h3 class="sectionHead"><span class="titlemark">4 </span> <a
  3494. id="x1-580004"></a>Codec Setup and Packet Decode</h3>
  3495. <!--l. 6--><p class="noindent" >
  3496. <h4 class="subsectionHead"><span class="titlemark">4.1 </span> <a
  3497. id="x1-590004.1"></a>Overview</h4>
  3498. <!--l. 8--><p class="noindent" >This document serves as the top-level reference document for the bit-by-bit decode specification
  3499. of Vorbis I. This document assumes a high-level understanding of the Vorbis decode
  3500. process, which is provided in <a
  3501. href="#x1-20001">Section&#x00A0;1<!--tex4ht:ref: vorbis:spec:intro --></a>, &#8220;<a
  3502. href="#x1-20001">Introduction and Description<!--tex4ht:ref: vorbis:spec:intro --></a>&#8221;. <a
  3503. href="#x1-360002">Section&#x00A0;2<!--tex4ht:ref: vorbis:spec:bitpacking --></a>,
  3504. &#8220;<a
  3505. href="#x1-360002">Bitpacking Convention<!--tex4ht:ref: vorbis:spec:bitpacking --></a>&#8221; covers reading and writing bit fields from and to bitstream
  3506. packets.
  3507. <!--l. 16--><p class="noindent" >
  3508. <h4 class="subsectionHead"><span class="titlemark">4.2 </span> <a
  3509. id="x1-600004.2"></a>Header decode and decode setup</h4>
  3510. <!--l. 18--><p class="noindent" >A Vorbis bitstream begins with three header packets. The header packets are, in order, the
  3511. identification header, the comments header, and the setup header. All are required for decode
  3512. compliance. An end-of-packet condition during decoding the first or third header packet renders
  3513. the stream undecodable. End-of-packet decoding the comment header is a non-fatal error
  3514. condition.
  3515. <!--l. 25--><p class="noindent" >
  3516. <h5 class="subsubsectionHead"><span class="titlemark">4.2.1 </span> <a
  3517. id="x1-610004.2.1"></a>Common header decode</h5>
  3518. <!--l. 27--><p class="noindent" >Each header packet begins with the same header fields.
  3519. <!--l. 30--><p class="noindent" >
  3520. <div class="fancyvrb" id="fancyvrb20">
  3521. <a
  3522. id="x1-61002r1"></a><span
  3523. class="cmr-6">1</span><span
  3524. class="cmtt-8">&#x00A0;</span><span
  3525. class="cmtt-8">&#x00A0;</span><span
  3526. class="cmtt-8">&#x00A0;</span><span
  3527. class="cmtt-8">&#x00A0;1)</span><span
  3528. class="cmtt-8">&#x00A0;[packet_type]</span><span
  3529. class="cmtt-8">&#x00A0;:</span><span
  3530. class="cmtt-8">&#x00A0;8</span><span
  3531. class="cmtt-8">&#x00A0;bit</span><span
  3532. class="cmtt-8">&#x00A0;value</span>
  3533. <br class="fancyvrb" /><a
  3534. id="x1-61004r2"></a><span
  3535. class="cmr-6">2</span><span
  3536. class="cmtt-8">&#x00A0;</span><span
  3537. class="cmtt-8">&#x00A0;</span><span
  3538. class="cmtt-8">&#x00A0;</span><span
  3539. class="cmtt-8">&#x00A0;2)</span><span
  3540. class="cmtt-8">&#x00A0;0x76,</span><span
  3541. class="cmtt-8">&#x00A0;0x6f,</span><span
  3542. class="cmtt-8">&#x00A0;0x72,</span><span
  3543. class="cmtt-8">&#x00A0;0x62,</span><span
  3544. class="cmtt-8">&#x00A0;0x69,</span><span
  3545. class="cmtt-8">&#x00A0;0x73:</span><span
  3546. class="cmtt-8">&#x00A0;the</span><span
  3547. class="cmtt-8">&#x00A0;characters</span><span
  3548. class="cmtt-8">&#x00A0;&#8217;v&#8217;,&#8217;o&#8217;,&#8217;r&#8217;,&#8217;b&#8217;,&#8217;i&#8217;,&#8217;s&#8217;</span><span
  3549. class="cmtt-8">&#x00A0;as</span><span
  3550. class="cmtt-8">&#x00A0;six</span><span
  3551. class="cmtt-8">&#x00A0;octets</span>
  3552. </div>
  3553. <!--l. 35--><p class="noindent" >Decode continues according to packet type; the identification header is type 1, the comment
  3554. header type 3 and the setup header type 5 (these types are all odd as a packet with a leading
  3555. single bit of &#8217;0&#8217; is an audio packet). The packets must occur in the order of identification,
  3556. comment, setup.
  3557. <!--l. 43--><p class="noindent" >
  3558. <h5 class="subsubsectionHead"><span class="titlemark">4.2.2 </span> <a
  3559. id="x1-620004.2.2"></a>Identification header</h5>
  3560. <!--l. 45--><p class="noindent" >The identification header is a short header of only a few fields used to declare the stream
  3561. definitively as Vorbis, and provide a few externally relevant pieces of information about the audio
  3562. stream. The identification header is coded as follows:
  3563. <!--l. 50--><p class="noindent" >
  3564. <div class="fancyvrb" id="fancyvrb21">
  3565. <a
  3566. id="x1-62002r1"></a><span
  3567. class="cmr-6">1</span><span
  3568. class="cmtt-8">&#x00A0;</span><span
  3569. class="cmtt-8">&#x00A0;</span><span
  3570. class="cmtt-8">&#x00A0;1)</span><span
  3571. class="cmtt-8">&#x00A0;[vorbis_version]</span><span
  3572. class="cmtt-8">&#x00A0;=</span><span
  3573. class="cmtt-8">&#x00A0;read</span><span
  3574. class="cmtt-8">&#x00A0;32</span><span
  3575. class="cmtt-8">&#x00A0;bits</span><span
  3576. class="cmtt-8">&#x00A0;as</span><span
  3577. class="cmtt-8">&#x00A0;unsigned</span><span
  3578. class="cmtt-8">&#x00A0;integer</span>
  3579. <br class="fancyvrb" /><a
  3580. id="x1-62004r2"></a><span
  3581. class="cmr-6">2</span><span
  3582. class="cmtt-8">&#x00A0;</span><span
  3583. class="cmtt-8">&#x00A0;</span><span
  3584. class="cmtt-8">&#x00A0;2)</span><span
  3585. class="cmtt-8">&#x00A0;[audio_channels]</span><span
  3586. class="cmtt-8">&#x00A0;=</span><span
  3587. class="cmtt-8">&#x00A0;read</span><span
  3588. class="cmtt-8">&#x00A0;8</span><span
  3589. class="cmtt-8">&#x00A0;bit</span><span
  3590. class="cmtt-8">&#x00A0;integer</span><span
  3591. class="cmtt-8">&#x00A0;as</span><span
  3592. class="cmtt-8">&#x00A0;unsigned</span>
  3593. <br class="fancyvrb" /><a
  3594. id="x1-62006r3"></a><span
  3595. class="cmr-6">3</span><span
  3596. class="cmtt-8">&#x00A0;</span><span
  3597. class="cmtt-8">&#x00A0;</span><span
  3598. class="cmtt-8">&#x00A0;3)</span><span
  3599. class="cmtt-8">&#x00A0;[audio_sample_rate]</span><span
  3600. class="cmtt-8">&#x00A0;=</span><span
  3601. class="cmtt-8">&#x00A0;read</span><span
  3602. class="cmtt-8">&#x00A0;32</span><span
  3603. class="cmtt-8">&#x00A0;bits</span><span
  3604. class="cmtt-8">&#x00A0;as</span><span
  3605. class="cmtt-8">&#x00A0;unsigned</span><span
  3606. class="cmtt-8">&#x00A0;integer</span>
  3607. <br class="fancyvrb" /><a
  3608. id="x1-62008r4"></a><span
  3609. class="cmr-6">4</span><span
  3610. class="cmtt-8">&#x00A0;</span><span
  3611. class="cmtt-8">&#x00A0;</span><span
  3612. class="cmtt-8">&#x00A0;4)</span><span
  3613. class="cmtt-8">&#x00A0;[bitrate_maximum]</span><span
  3614. class="cmtt-8">&#x00A0;=</span><span
  3615. class="cmtt-8">&#x00A0;read</span><span
  3616. class="cmtt-8">&#x00A0;32</span><span
  3617. class="cmtt-8">&#x00A0;bits</span><span
  3618. class="cmtt-8">&#x00A0;as</span><span
  3619. class="cmtt-8">&#x00A0;signed</span><span
  3620. class="cmtt-8">&#x00A0;integer</span>
  3621. <br class="fancyvrb" /><a
  3622. id="x1-62010r5"></a><span
  3623. class="cmr-6">5</span><span
  3624. class="cmtt-8">&#x00A0;</span><span
  3625. class="cmtt-8">&#x00A0;</span><span
  3626. class="cmtt-8">&#x00A0;5)</span><span
  3627. class="cmtt-8">&#x00A0;[bitrate_nominal]</span><span
  3628. class="cmtt-8">&#x00A0;=</span><span
  3629. class="cmtt-8">&#x00A0;read</span><span
  3630. class="cmtt-8">&#x00A0;32</span><span
  3631. class="cmtt-8">&#x00A0;bits</span><span
  3632. class="cmtt-8">&#x00A0;as</span><span
  3633. class="cmtt-8">&#x00A0;signed</span><span
  3634. class="cmtt-8">&#x00A0;integer</span>
  3635. <br class="fancyvrb" /><a
  3636. id="x1-62012r6"></a><span
  3637. class="cmr-6">6</span><span
  3638. class="cmtt-8">&#x00A0;</span><span
  3639. class="cmtt-8">&#x00A0;</span><span
  3640. class="cmtt-8">&#x00A0;6)</span><span
  3641. class="cmtt-8">&#x00A0;[bitrate_minimum]</span><span
  3642. class="cmtt-8">&#x00A0;=</span><span
  3643. class="cmtt-8">&#x00A0;read</span><span
  3644. class="cmtt-8">&#x00A0;32</span><span
  3645. class="cmtt-8">&#x00A0;bits</span><span
  3646. class="cmtt-8">&#x00A0;as</span><span
  3647. class="cmtt-8">&#x00A0;signed</span><span
  3648. class="cmtt-8">&#x00A0;integer</span>
  3649. <br class="fancyvrb" /><a
  3650. id="x1-62014r7"></a><span
  3651. class="cmr-6">7</span><span
  3652. class="cmtt-8">&#x00A0;</span><span
  3653. class="cmtt-8">&#x00A0;</span><span
  3654. class="cmtt-8">&#x00A0;7)</span><span
  3655. class="cmtt-8">&#x00A0;[blocksize_0]</span><span
  3656. class="cmtt-8">&#x00A0;=</span><span
  3657. class="cmtt-8">&#x00A0;2</span><span
  3658. class="cmtt-8">&#x00A0;exponent</span><span
  3659. class="cmtt-8">&#x00A0;(read</span><span
  3660. class="cmtt-8">&#x00A0;4</span><span
  3661. class="cmtt-8">&#x00A0;bits</span><span
  3662. class="cmtt-8">&#x00A0;as</span><span
  3663. class="cmtt-8">&#x00A0;unsigned</span><span
  3664. class="cmtt-8">&#x00A0;integer)</span>
  3665. <br class="fancyvrb" /><a
  3666. id="x1-62016r8"></a><span
  3667. class="cmr-6">8</span><span
  3668. class="cmtt-8">&#x00A0;</span><span
  3669. class="cmtt-8">&#x00A0;</span><span
  3670. class="cmtt-8">&#x00A0;8)</span><span
  3671. class="cmtt-8">&#x00A0;[blocksize_1]</span><span
  3672. class="cmtt-8">&#x00A0;=</span><span
  3673. class="cmtt-8">&#x00A0;2</span><span
  3674. class="cmtt-8">&#x00A0;exponent</span><span
  3675. class="cmtt-8">&#x00A0;(read</span><span
  3676. class="cmtt-8">&#x00A0;4</span><span
  3677. class="cmtt-8">&#x00A0;bits</span><span
  3678. class="cmtt-8">&#x00A0;as</span><span
  3679. class="cmtt-8">&#x00A0;unsigned</span><span
  3680. class="cmtt-8">&#x00A0;integer)</span>
  3681. <br class="fancyvrb" /><a
  3682. id="x1-62018r9"></a><span
  3683. class="cmr-6">9</span><span
  3684. class="cmtt-8">&#x00A0;</span><span
  3685. class="cmtt-8">&#x00A0;</span><span
  3686. class="cmtt-8">&#x00A0;9)</span><span
  3687. class="cmtt-8">&#x00A0;[framing_flag]</span><span
  3688. class="cmtt-8">&#x00A0;=</span><span
  3689. class="cmtt-8">&#x00A0;read</span><span
  3690. class="cmtt-8">&#x00A0;one</span><span
  3691. class="cmtt-8">&#x00A0;bit</span>
  3692. </div>
  3693. <!--l. 62--><p class="noindent" ><span
  3694. class="cmtt-12">[vorbis_version] </span>is to read &#8217;0&#8217; in order to be compatible with this document. Both
  3695. <span
  3696. class="cmtt-12">[audio_channels] </span>and <span
  3697. class="cmtt-12">[audio_sample_rate] </span>must read greater than zero. Allowed final
  3698. blocksize values are 64, 128, 256, 512, 1024, 2048, 4096 and 8192 in Vorbis I. <span
  3699. class="cmtt-12">[blocksize_0]</span>
  3700. must be less than or equal to <span
  3701. class="cmtt-12">[blocksize_1]</span>. The framing bit must be nonzero. Failure to meet
  3702. any of these conditions renders a stream undecodable.
  3703. <!--l. 70--><p class="noindent" >The bitrate fields above are used only as hints. The nominal bitrate field especially may be
  3704. considerably off in purely VBR streams. The fields are meaningful only when greater than
  3705. zero.
  3706. <ul class="itemize1">
  3707. <li class="itemize">All three fields set to the same value implies a fixed rate, or tightly bounded, nearly
  3708. fixed-rate bitstream
  3709. </li>
  3710. <li class="itemize">Only nominal set implies a VBR or ABR stream that averages the nominal bitrate
  3711. </li>
  3712. <li class="itemize">Maximum and or minimum set implies a VBR bitstream that obeys the bitrate limits
  3713. </li>
  3714. <li class="itemize">None set indicates the encoder does not care to speculate.</li></ul>
  3715. <!--l. 84--><p class="noindent" >
  3716. <h5 class="subsubsectionHead"><span class="titlemark">4.2.3 </span> <a
  3717. id="x1-630004.2.3"></a>Comment header</h5>
  3718. <!--l. 85--><p class="noindent" >Comment header decode and data specification is covered in <a
  3719. href="#x1-810005">Section&#x00A0;5<!--tex4ht:ref: vorbis:spec:comment --></a>, &#8220;<a
  3720. href="#x1-810005">comment field and
  3721. header specification<!--tex4ht:ref: vorbis:spec:comment --></a>&#8221;.
  3722. <!--l. 89--><p class="noindent" >
  3723. <h5 class="subsubsectionHead"><span class="titlemark">4.2.4 </span> <a
  3724. id="x1-640004.2.4"></a>Setup header</h5>
  3725. <!--l. 91--><p class="noindent" >Vorbis codec setup is configurable to an extreme degree:
  3726. <div class="center"
  3727. >
  3728. <!--l. 93--><p class="noindent" >
  3729. <!--l. 94--><p class="noindent" ><img
  3730. src="components.png" alt="PIC"
  3731. >
  3732. <br /> <table class="caption"
  3733. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;6: </td><td
  3734. class="content">decoder pipeline configuration</td></tr></table><!--tex4ht:label?: x1-640016 -->
  3735. </div>
  3736. <!--l. 99--><p class="noindent" >The setup header contains the bulk of the codec setup information needed for decode. The setup
  3737. header contains, in order, the lists of codebook configurations, time-domain transform
  3738. configurations (placeholders in Vorbis I), floor configurations, residue configurations, channel
  3739. mapping configurations and mode configurations. It finishes with a framing bit of &#8217;1&#8217;. Header
  3740. decode proceeds in the following order:
  3741. <!--l. 107--><p class="noindent" ><span class="paragraphHead"><a
  3742. id="x1-650004.2.4"></a><span
  3743. class="cmbx-12">Codebooks</span></span>
  3744. <ol class="enumerate1" >
  3745. <li
  3746. class="enumerate" id="x1-65002x1"><span
  3747. class="cmtt-12">[vorbis_codebook_count] </span>= read eight bits as unsigned integer and add one
  3748. </li>
  3749. <li
  3750. class="enumerate" id="x1-65004x2">Decode <span
  3751. class="cmtt-12">[vorbis_codebook_count] </span>codebooks in order as defined in <a
  3752. href="#x1-470003">Section&#x00A0;3<!--tex4ht:ref: vorbis:spec:codebook --></a>,
  3753. &#8220;<a
  3754. href="#x1-470003">Probability Model and Codebooks<!--tex4ht:ref: vorbis:spec:codebook --></a>&#8221;. Save each configuration, in order, in an array
  3755. of codebook configurations <span
  3756. class="cmtt-12">[vorbis_codebook_configurations]</span>.</li></ol>
  3757. <!--l. 119--><p class="noindent" ><span class="paragraphHead"><a
  3758. id="x1-660004.2.4"></a><span
  3759. class="cmbx-12">Time domain transforms</span></span>
  3760. These hooks are placeholders in Vorbis I. Nevertheless, the configuration placeholder values must
  3761. be read to maintain bitstream sync.
  3762. <!--l. 125--><p class="noindent" >
  3763. <ol class="enumerate1" >
  3764. <li
  3765. class="enumerate" id="x1-66002x1"><span
  3766. class="cmtt-12">[vorbis_time_count] </span>= read 6 bits as unsigned integer and add one
  3767. </li>
  3768. <li
  3769. class="enumerate" id="x1-66004x2">read <span
  3770. class="cmtt-12">[vorbis_time_count] </span>16 bit values; each value should be zero. If any value is
  3771. nonzero, this is an error condition and the stream is undecodable.</li></ol>
  3772. <!--l. 132--><p class="noindent" ><span class="paragraphHead"><a
  3773. id="x1-670004.2.4"></a><span
  3774. class="cmbx-12">Floors</span></span>
  3775. Vorbis uses two floor types; header decode is handed to the decode abstraction of the appropriate
  3776. type.
  3777. <!--l. 137--><p class="noindent" >
  3778. <ol class="enumerate1" >
  3779. <li
  3780. class="enumerate" id="x1-67002x1"><span
  3781. class="cmtt-12">[vorbis_floor_count] </span>= read 6 bits as unsigned integer and add one
  3782. </li>
  3783. <li
  3784. class="enumerate" id="x1-67004x2">For each <span
  3785. class="cmtt-12">[i] </span>of <span
  3786. class="cmtt-12">[vorbis_floor_count] </span>floor numbers:
  3787. <ol class="enumerate2" >
  3788. <li
  3789. class="enumerate" id="x1-67006x1">read the floor type: vector <span
  3790. class="cmtt-12">[vorbis_floor_types] </span>element <span
  3791. class="cmtt-12">[i] </span>= read 16 bits
  3792. as unsigned integer
  3793. </li>
  3794. <li
  3795. class="enumerate" id="x1-67008x2">If the floor type is zero, decode the floor configuration as defined in <a
  3796. href="#x1-890006">Section&#x00A0;6<!--tex4ht:ref: vorbis:spec:floor0 --></a>,
  3797. &#8220;<a
  3798. href="#x1-890006">Floor type 0 setup and decode<!--tex4ht:ref: vorbis:spec:floor0 --></a>&#8221;; save this configuration in slot <span
  3799. class="cmtt-12">[i] </span>of the floor
  3800. configuration array <span
  3801. class="cmtt-12">[vorbis_floor_configurations]</span>.
  3802. </li>
  3803. <li
  3804. class="enumerate" id="x1-67010x3">If the floor type is one, decode the floor configuration as defined in <a
  3805. href="#x1-950007">Section&#x00A0;7<!--tex4ht:ref: vorbis:spec:floor1 --></a>,
  3806. &#8220;<a
  3807. href="#x1-950007">Floor type 1 setup and decode<!--tex4ht:ref: vorbis:spec:floor1 --></a>&#8221;; save this configuration in slot <span
  3808. class="cmtt-12">[i] </span>of the floor
  3809. configuration array <span
  3810. class="cmtt-12">[vorbis_floor_configurations]</span>.
  3811. </li>
  3812. <li
  3813. class="enumerate" id="x1-67012x4">If the the floor type is greater than one, this stream is undecodable; ERROR
  3814. CONDITION</li></ol>
  3815. </li></ol>
  3816. <!--l. 156--><p class="noindent" ><span class="paragraphHead"><a
  3817. id="x1-680004.2.4"></a><span
  3818. class="cmbx-12">Residues</span></span>
  3819. Vorbis uses three residue types; header decode of each type is identical.
  3820. <!--l. 161--><p class="noindent" >
  3821. <ol class="enumerate1" >
  3822. <li
  3823. class="enumerate" id="x1-68002x1"><span
  3824. class="cmtt-12">[vorbis_residue_count] </span>= read 6 bits as unsigned integer and add one
  3825. </li>
  3826. <li
  3827. class="enumerate" id="x1-68004x2">For each of <span
  3828. class="cmtt-12">[vorbis_residue_count] </span>residue numbers:
  3829. <ol class="enumerate2" >
  3830. <li
  3831. class="enumerate" id="x1-68006x1">read the residue type; vector <span
  3832. class="cmtt-12">[vorbis_residue_types] </span>element <span
  3833. class="cmtt-12">[i] </span>= read 16
  3834. bits as unsigned integer
  3835. </li>
  3836. <li
  3837. class="enumerate" id="x1-68008x2">If the residue type is zero, one or two, decode the residue configuration as defined
  3838. in <a
  3839. href="#x1-1020008">Section&#x00A0;8<!--tex4ht:ref: vorbis:spec:residue --></a>, &#8220;<a
  3840. href="#x1-1020008">Residue setup and decode<!--tex4ht:ref: vorbis:spec:residue --></a>&#8221;; save this configuration in slot <span
  3841. class="cmtt-12">[i] </span>of
  3842. the residue configuration array <span
  3843. class="cmtt-12">[vorbis_residue_configurations]</span>.
  3844. </li>
  3845. <li
  3846. class="enumerate" id="x1-68010x3">If the the residue type is greater than two, this stream is undecodable; ERROR
  3847. CONDITION</li></ol>
  3848. </li></ol>
  3849. <!--l. 176--><p class="noindent" ><span class="paragraphHead"><a
  3850. id="x1-690004.2.4"></a><span
  3851. class="cmbx-12">Mappings</span></span>
  3852. Mappings are used to set up specific pipelines for encoding multichannel audio with varying
  3853. channel mapping applications. Vorbis I uses a single mapping type (0), with implicit PCM
  3854. channel mappings.
  3855. <!--l. 186--><p class="noindent" >
  3856. <ol class="enumerate1" >
  3857. <li
  3858. class="enumerate" id="x1-69002x1"><span
  3859. class="cmtt-12">[vorbis_mapping_count] </span>= read 6 bits as unsigned integer and add one
  3860. </li>
  3861. <li
  3862. class="enumerate" id="x1-69004x2">For each <span
  3863. class="cmtt-12">[i] </span>of <span
  3864. class="cmtt-12">[vorbis_mapping_count] </span>mapping numbers:
  3865. <ol class="enumerate2" >
  3866. <li
  3867. class="enumerate" id="x1-69006x1">read the mapping type: 16 bits as unsigned integer. There&#8217;s no reason to save
  3868. the mapping type in Vorbis I.
  3869. </li>
  3870. <li
  3871. class="enumerate" id="x1-69008x2">If the mapping type is nonzero, the stream is undecodable
  3872. </li>
  3873. <li
  3874. class="enumerate" id="x1-69010x3">If the mapping type is zero:
  3875. <ol class="enumerate3" >
  3876. <li
  3877. class="enumerate" id="x1-69012x1">read 1 bit as a boolean flag
  3878. <ol class="enumerate4" >
  3879. <li
  3880. class="enumerate" id="x1-69014x1">if set, <span
  3881. class="cmtt-12">[vorbis_mapping_submaps] </span>= read 4 bits as unsigned integer
  3882. and add one
  3883. </li>
  3884. <li
  3885. class="enumerate" id="x1-69016x2">if unset, <span
  3886. class="cmtt-12">[vorbis_mapping_submaps] </span>= 1</li></ol>
  3887. </li>
  3888. <li
  3889. class="enumerate" id="x1-69018x2">read 1 bit as a boolean flag
  3890. <ol class="enumerate4" >
  3891. <li
  3892. class="enumerate" id="x1-69020x1">if set, square polar channel mapping is in use:
  3893. <ul class="itemize1">
  3894. <li class="itemize"><span
  3895. class="cmtt-12">[vorbis_mapping_coupling_steps] </span>= read 8 bits as unsigned
  3896. integer and add one
  3897. </li>
  3898. <li class="itemize">for <span
  3899. class="cmtt-12">[j] </span>each of <span
  3900. class="cmtt-12">[vorbis_mapping_coupling_steps] </span>steps:
  3901. <ul class="itemize2">
  3902. <li class="itemize">vector <span
  3903. class="cmtt-12">[vorbis_mapping_magnitude] </span>element <span
  3904. class="cmtt-12">[j]</span>= read
  3905. <a
  3906. href="#x1-1170009.2.1">ilog</a>(<span
  3907. class="cmtt-12">[audio_channels] </span>- 1) bits as unsigned integer
  3908. </li>
  3909. <li class="itemize">vector <span
  3910. class="cmtt-12">[vorbis_mapping_angle] </span>element <span
  3911. class="cmtt-12">[j]</span>= read
  3912. <a
  3913. href="#x1-1170009.2.1">ilog</a>(<span
  3914. class="cmtt-12">[audio_channels] </span>- 1) bits as unsigned integer
  3915. </li>
  3916. <li class="itemize">the numbers read in the above two steps are channel numbers
  3917. representing the channel to treat as magnitude and the channel
  3918. to treat as angle, respectively. If for any coupling step the
  3919. angle channel number equals the magnitude channel number, the
  3920. magnitude channel number is greater than <span
  3921. class="cmtt-12">[audio_channels]</span>-1, or
  3922. the angle channel is greater than <span
  3923. class="cmtt-12">[audio_channels]</span>-1, the stream
  3924. is undecodable.</li></ul>
  3925. </li></ul>
  3926. </li>
  3927. <li
  3928. class="enumerate" id="x1-69022x2">if unset, <span
  3929. class="cmtt-12">[vorbis_mapping_coupling_steps] </span>= 0</li></ol>
  3930. </li>
  3931. <li
  3932. class="enumerate" id="x1-69024x3">read 2 bits (reserved field); if the value is nonzero, the stream is undecodable
  3933. </li>
  3934. <li
  3935. class="enumerate" id="x1-69026x4">if <span
  3936. class="cmtt-12">[vorbis_mapping_submaps] </span>is greater than one, we read channel multiplex
  3937. settings. For each <span
  3938. class="cmtt-12">[j] </span>of <span
  3939. class="cmtt-12">[audio_channels] </span>channels:
  3940. <ol class="enumerate4" >
  3941. <li
  3942. class="enumerate" id="x1-69028x1">vector <span
  3943. class="cmtt-12">[vorbis_mapping_mux] </span>element <span
  3944. class="cmtt-12">[j] </span>= read 4 bits as unsigned
  3945. integer
  3946. </li>
  3947. <li
  3948. class="enumerate" id="x1-69030x2">if the value is greater than the highest numbered submap
  3949. (<span
  3950. class="cmtt-12">[vorbis_mapping_submaps] </span>- 1), this in an error condition rendering
  3951. the stream undecodable</li></ol>
  3952. </li>
  3953. <li
  3954. class="enumerate" id="x1-69032x5">for each submap <span
  3955. class="cmtt-12">[j] </span>of <span
  3956. class="cmtt-12">[vorbis_mapping_submaps] </span>submaps, read the floor and
  3957. residue numbers for use in decoding that submap:
  3958. <ol class="enumerate4" >
  3959. <li
  3960. class="enumerate" id="x1-69034x1">read and discard 8 bits (the unused time configuration placeholder)
  3961. </li>
  3962. <li
  3963. class="enumerate" id="x1-69036x2">read 8 bits as unsigned integer for the floor number; save in vector
  3964. <span
  3965. class="cmtt-12">[vorbis_mapping_submap_floor] </span>element <span
  3966. class="cmtt-12">[j]</span>
  3967. </li>
  3968. <li
  3969. class="enumerate" id="x1-69038x3">verify the floor number is not greater than the highest number floor
  3970. configured for the bitstream. If it is, the bitstream is undecodable
  3971. </li>
  3972. <li
  3973. class="enumerate" id="x1-69040x4">read 8 bits as unsigned integer for the residue number; save in vector
  3974. <span
  3975. class="cmtt-12">[vorbis_mapping_submap_residue] </span>element <span
  3976. class="cmtt-12">[j]</span>
  3977. </li>
  3978. <li
  3979. class="enumerate" id="x1-69042x5">verify the residue number is not greater than the highest number residue
  3980. configured for the bitstream. If it is, the bitstream is undecodable</li></ol>
  3981. </li>
  3982. <li
  3983. class="enumerate" id="x1-69044x6">save this mapping configuration in slot <span
  3984. class="cmtt-12">[i] </span>of the mapping configuration array
  3985. <span
  3986. class="cmtt-12">[vorbis_mapping_configurations]</span>.</li></ol>
  3987. </li></ol>
  3988. </li></ol>
  3989. <!--l. 246--><p class="noindent" ><span class="paragraphHead"><a
  3990. id="x1-700004.2.4"></a><span
  3991. class="cmbx-12">Modes</span></span>
  3992. <ol class="enumerate1" >
  3993. <li
  3994. class="enumerate" id="x1-70002x1"><span
  3995. class="cmtt-12">[vorbis_mode_count] </span>= read 6 bits as unsigned integer and add one
  3996. </li>
  3997. <li
  3998. class="enumerate" id="x1-70004x2">For each of <span
  3999. class="cmtt-12">[vorbis_mode_count] </span>mode numbers:
  4000. <ol class="enumerate2" >
  4001. <li
  4002. class="enumerate" id="x1-70006x1"><span
  4003. class="cmtt-12">[vorbis_mode_blockflag] </span>= read 1 bit
  4004. </li>
  4005. <li
  4006. class="enumerate" id="x1-70008x2"><span
  4007. class="cmtt-12">[vorbis_mode_windowtype] </span>= read 16 bits as unsigned integer
  4008. </li>
  4009. <li
  4010. class="enumerate" id="x1-70010x3"><span
  4011. class="cmtt-12">[vorbis_mode_transformtype] </span>= read 16 bits as unsigned integer
  4012. </li>
  4013. <li
  4014. class="enumerate" id="x1-70012x4"><span
  4015. class="cmtt-12">[vorbis_mode_mapping] </span>= read 8 bits as unsigned integer
  4016. </li>
  4017. <li
  4018. class="enumerate" id="x1-70014x5">verify ranges; zero is the only legal value in
  4019. Vorbis I for <span
  4020. class="cmtt-12">[vorbis_mode_windowtype] </span>and <span
  4021. class="cmtt-12">[vorbis_mode_transformtype]</span>.
  4022. <span
  4023. class="cmtt-12">[vorbis_mode_mapping] </span>must not be greater than the highest number mapping
  4024. in use. Any illegal values render the stream undecodable.
  4025. </li>
  4026. <li
  4027. class="enumerate" id="x1-70016x6">save this mode configuration in slot <span
  4028. class="cmtt-12">[i] </span>of the mode configuration array
  4029. <span
  4030. class="cmtt-12">[vorbis_mode_configurations]</span>.</li></ol>
  4031. </li>
  4032. <li
  4033. class="enumerate" id="x1-70018x3">read 1 bit as a framing flag. If unset, a framing error occurred and the stream is not
  4034. decodable.</li></ol>
  4035. <!--l. 267--><p class="noindent" >After reading mode descriptions, setup header decode is complete.
  4036. <!--l. 276--><p class="noindent" >
  4037. <h4 class="subsectionHead"><span class="titlemark">4.3 </span> <a
  4038. id="x1-710004.3"></a>Audio packet decode and synthesis</h4>
  4039. <!--l. 278--><p class="noindent" >Following the three header packets, all packets in a Vorbis I stream are audio. The first step of
  4040. audio packet decode is to read and verify the packet type. <span
  4041. class="cmti-12">A non-audio packet when audio is</span>
  4042. <span
  4043. class="cmti-12">expected indicates stream corruption or a non-compliant stream. The decoder must ignore the</span>
  4044. <span
  4045. class="cmti-12">packet and not attempt decoding it to audio</span>.
  4046. <!--l. 285--><p class="noindent" >
  4047. <h5 class="subsubsectionHead"><span class="titlemark">4.3.1 </span> <a
  4048. id="x1-720004.3.1"></a>packet type, mode and window decode</h5>
  4049. <!--l. 287--><p class="noindent" >
  4050. <ol class="enumerate1" >
  4051. <li
  4052. class="enumerate" id="x1-72002x1">read 1 bit <span
  4053. class="cmtt-12">[packet_type]</span>; check that packet type is 0 (audio)
  4054. </li>
  4055. <li
  4056. class="enumerate" id="x1-72004x2">read <a
  4057. href="#x1-1170009.2.1">ilog</a>([vorbis&#x02D9;mode&#x02D9;count]-1) bits <span
  4058. class="cmtt-12">[mode_number]</span>
  4059. </li>
  4060. <li
  4061. class="enumerate" id="x1-72006x3">decode blocksize <span
  4062. class="cmtt-12">[n] </span>is equal to <span
  4063. class="cmtt-12">[blocksize_0] </span>if <span
  4064. class="cmtt-12">[vorbis_mode_blockflag] </span>is 0,
  4065. else <span
  4066. class="cmtt-12">[n] </span>is equal to <span
  4067. class="cmtt-12">[blocksize_1]</span>.
  4068. </li>
  4069. <li
  4070. class="enumerate" id="x1-72008x4">perform window selection and setup; this window is used later by the inverse
  4071. MDCT:
  4072. <ol class="enumerate2" >
  4073. <li
  4074. class="enumerate" id="x1-72010x1">if this is a long window (the <span
  4075. class="cmtt-12">[vorbis_mode_blockflag] </span>flag of this mode is
  4076. set):
  4077. <ol class="enumerate3" >
  4078. <li
  4079. class="enumerate" id="x1-72012x1">read 1 bit for <span
  4080. class="cmtt-12">[previous_window_flag]</span>
  4081. </li>
  4082. <li
  4083. class="enumerate" id="x1-72014x2">read 1 bit for <span
  4084. class="cmtt-12">[next_window_flag]</span>
  4085. </li>
  4086. <li
  4087. class="enumerate" id="x1-72016x3">if <span
  4088. class="cmtt-12">[previous_window_flag] </span>is not set, the left half of the window will
  4089. be a hybrid window for lapping with a short block. See <a
  4090. href="#x1-260001.3.2">paragraph&#x00A0;1.3.2<!--tex4ht:ref: vorbis:spec:window --></a>,
  4091. &#8220;<a
  4092. href="#x1-260001.3.2">Window shape decode (long windows only)<!--tex4ht:ref: vorbis:spec:window --></a>&#8221; for an illustration of
  4093. overlapping dissimilar windows. Else, the left half window will have normal
  4094. long shape.
  4095. </li>
  4096. <li
  4097. class="enumerate" id="x1-72018x4">if <span
  4098. class="cmtt-12">[next_window_flag] </span>is not set, the right half of the window will be
  4099. a hybrid window for lapping with a short block. See <a
  4100. href="#x1-260001.3.2">paragraph&#x00A0;1.3.2<!--tex4ht:ref: vorbis:spec:window --></a>,
  4101. &#8220;<a
  4102. href="#x1-260001.3.2">Window shape decode (long windows only)<!--tex4ht:ref: vorbis:spec:window --></a>&#8221; for an illustration of
  4103. overlapping dissimilar windows. Else, the left right window will have normal
  4104. long shape.</li></ol>
  4105. </li>
  4106. <li
  4107. class="enumerate" id="x1-72020x2">if this is a short window, the window is always the same short-window
  4108. shape.</li></ol>
  4109. </li></ol>
  4110. <!--l. 320--><p class="noindent" >Vorbis windows all use the slope function <span
  4111. class="cmmi-12">y </span>= sin(<img
  4112. src="Vorbis_I_spec1x.png" alt="&#x03C0;2" class="frac" align="middle"> <span
  4113. class="cmsy-10x-x-120">*</span> sin <sup><span
  4114. class="cmr-8">2</span></sup>((<span
  4115. class="cmmi-12">x </span>+ 0<span
  4116. class="cmmi-12">.</span>5)<span
  4117. class="cmmi-12">&#x2215;n </span><span
  4118. class="cmsy-10x-x-120">* </span><span
  4119. class="cmmi-12">&#x03C0;</span>)), where <span
  4120. class="cmmi-12">n </span>is window
  4121. size and <span
  4122. class="cmmi-12">x </span>ranges 0<span
  4123. class="cmmi-12">&#x2026;</span><span
  4124. class="cmmi-12">n</span><span
  4125. class="cmsy-10x-x-120">- </span>1, but dissimilar lapping requirements can affect overall shape. Window
  4126. generation proceeds as follows:
  4127. <!--l. 325--><p class="noindent" >
  4128. <ol class="enumerate1" >
  4129. <li
  4130. class="enumerate" id="x1-72022x1"><span
  4131. class="cmtt-12">[window_center] </span>= <span
  4132. class="cmtt-12">[n] </span>/ 2
  4133. </li>
  4134. <li
  4135. class="enumerate" id="x1-72024x2">if (<span
  4136. class="cmtt-12">[vorbis_mode_blockflag] </span>is set and <span
  4137. class="cmtt-12">[previous_window_flag] </span>is not set)
  4138. then
  4139. <ol class="enumerate2" >
  4140. <li
  4141. class="enumerate" id="x1-72026x1"><span
  4142. class="cmtt-12">[left_window_start] </span>= <span
  4143. class="cmtt-12">[n]</span>/4 - <span
  4144. class="cmtt-12">[blocksize_0]</span>/4
  4145. </li>
  4146. <li
  4147. class="enumerate" id="x1-72028x2"><span
  4148. class="cmtt-12">[left_window_end] </span>= <span
  4149. class="cmtt-12">[n]</span>/4 + <span
  4150. class="cmtt-12">[blocksize_0]</span>/4
  4151. </li>
  4152. <li
  4153. class="enumerate" id="x1-72030x3"><span
  4154. class="cmtt-12">[left_n] </span>= <span
  4155. class="cmtt-12">[blocksize_0]</span>/2</li></ol>
  4156. <!--l. 335--><p class="noindent" >else
  4157. <ol class="enumerate2" >
  4158. <li
  4159. class="enumerate" id="x1-72032x1"><span
  4160. class="cmtt-12">[left_window_start] </span>= 0
  4161. </li>
  4162. <li
  4163. class="enumerate" id="x1-72034x2"><span
  4164. class="cmtt-12">[left_window_end] </span>= <span
  4165. class="cmtt-12">[window_center]</span>
  4166. </li>
  4167. <li
  4168. class="enumerate" id="x1-72036x3"><span
  4169. class="cmtt-12">[left_n] </span>= <span
  4170. class="cmtt-12">[n]</span>/2</li></ol>
  4171. </li>
  4172. <li
  4173. class="enumerate" id="x1-72038x3">if (<span
  4174. class="cmtt-12">[vorbis_mode_blockflag] </span>is set and <span
  4175. class="cmtt-12">[next_window_flag] </span>is not set) then
  4176. <ol class="enumerate2" >
  4177. <li
  4178. class="enumerate" id="x1-72040x1"><span
  4179. class="cmtt-12">[right_window_start] </span>= <span
  4180. class="cmtt-12">[n]*3</span>/4 - <span
  4181. class="cmtt-12">[blocksize_0]</span>/4
  4182. </li>
  4183. <li
  4184. class="enumerate" id="x1-72042x2"><span
  4185. class="cmtt-12">[right_window_end] </span>= <span
  4186. class="cmtt-12">[n]*3</span>/4 + <span
  4187. class="cmtt-12">[blocksize_0]</span>/4
  4188. </li>
  4189. <li
  4190. class="enumerate" id="x1-72044x3"><span
  4191. class="cmtt-12">[right_n] </span>= <span
  4192. class="cmtt-12">[blocksize_0]</span>/2</li></ol>
  4193. <!--l. 351--><p class="noindent" >else
  4194. <ol class="enumerate2" >
  4195. <li
  4196. class="enumerate" id="x1-72046x1"><span
  4197. class="cmtt-12">[right_window_start] </span>= <span
  4198. class="cmtt-12">[window_center]</span>
  4199. </li>
  4200. <li
  4201. class="enumerate" id="x1-72048x2"><span
  4202. class="cmtt-12">[right_window_end] </span>= <span
  4203. class="cmtt-12">[n]</span>
  4204. </li>
  4205. <li
  4206. class="enumerate" id="x1-72050x3"><span
  4207. class="cmtt-12">[right_n] </span>= <span
  4208. class="cmtt-12">[n]</span>/2</li></ol>
  4209. </li>
  4210. <li
  4211. class="enumerate" id="x1-72052x4">window from range 0 ... <span
  4212. class="cmtt-12">[left_window_start]</span>-1 inclusive is zero
  4213. </li>
  4214. <li
  4215. class="enumerate" id="x1-72054x5">for <span
  4216. class="cmtt-12">[i] </span>in range <span
  4217. class="cmtt-12">[left_window_start] </span>... <span
  4218. class="cmtt-12">[left_window_end]</span>-1, window(<span
  4219. class="cmtt-12">[i]</span>) =
  4220. sin(<img
  4221. src="Vorbis_I_spec2x.png" alt="&#x03C0;
  4222. 2" class="frac" align="middle"> <span
  4223. class="cmsy-10x-x-120">*</span> sin <sup><span
  4224. class="cmr-8">2</span></sup>( (<span
  4225. class="cmtt-12">[i]</span>-<span
  4226. class="cmtt-12">[left_window_start]</span>+0.5) / <span
  4227. class="cmtt-12">[left_n] </span><span
  4228. class="cmsy-10x-x-120">*</span><img
  4229. src="Vorbis_I_spec3x.png" alt="&#x03C0;
  4230. 2" class="frac" align="middle">) )
  4231. </li>
  4232. <li
  4233. class="enumerate" id="x1-72056x6">window from range <span
  4234. class="cmtt-12">[left_window_end] </span>... <span
  4235. class="cmtt-12">[right_window_start]</span>-1 inclusive is
  4236. one
  4237. </li>
  4238. <li
  4239. class="enumerate" id="x1-72058x7">for <span
  4240. class="cmtt-12">[i] </span>in range <span
  4241. class="cmtt-12">[right_window_start] </span>... <span
  4242. class="cmtt-12">[right_window_end]</span>-1, window(<span
  4243. class="cmtt-12">[i]</span>) =
  4244. sin(<img
  4245. src="Vorbis_I_spec4x.png" alt="&#x03C0;
  4246. 2" class="frac" align="middle"> <span
  4247. class="cmsy-10x-x-120">*</span> sin <sup><span
  4248. class="cmr-8">2</span></sup>( (<span
  4249. class="cmtt-12">[i]</span>-<span
  4250. class="cmtt-12">[right_window_start]</span>+0.5) / <span
  4251. class="cmtt-12">[right_n] </span><span
  4252. class="cmsy-10x-x-120">*</span><img
  4253. src="Vorbis_I_spec5x.png" alt="&#x03C0;
  4254. 2" class="frac" align="middle"> + <img
  4255. src="Vorbis_I_spec6x.png" alt="&#x03C0;
  4256. 2" class="frac" align="middle">) )
  4257. </li>
  4258. <li
  4259. class="enumerate" id="x1-72060x8">window from range <span
  4260. class="cmtt-12">[right_window_start] </span>... <span
  4261. class="cmtt-12">[n]</span>-1 is zero</li></ol>
  4262. <!--l. 367--><p class="noindent" >An end-of-packet condition up to this point should be considered an error that discards this
  4263. packet from the stream. An end of packet condition past this point is to be considered a possible
  4264. nominal occurrence.
  4265. <!--l. 374--><p class="noindent" >
  4266. <h5 class="subsubsectionHead"><span class="titlemark">4.3.2 </span> <a
  4267. id="x1-730004.3.2"></a>floor curve decode</h5>
  4268. <!--l. 376--><p class="noindent" >From this point on, we assume out decode context is using mode number <span
  4269. class="cmtt-12">[mode_number]</span>
  4270. from configuration array <span
  4271. class="cmtt-12">[vorbis_mode_configurations] </span>and the map number
  4272. <span
  4273. class="cmtt-12">[vorbis_mode_mapping] </span>(specified by the current mode) taken from the mapping configuration
  4274. array <span
  4275. class="cmtt-12">[vorbis_mapping_configurations]</span>.
  4276. <!--l. 383--><p class="noindent" >Floor curves are decoded one-by-one in channel order.
  4277. <!--l. 385--><p class="noindent" >For each floor <span
  4278. class="cmtt-12">[i] </span>of <span
  4279. class="cmtt-12">[audio_channels]</span>
  4280. <ol class="enumerate1" >
  4281. <li
  4282. class="enumerate" id="x1-73002x1"><span
  4283. class="cmtt-12">[submap_number] </span>= element <span
  4284. class="cmtt-12">[i] </span>of vector [vorbis&#x02D9;mapping&#x02D9;mux]
  4285. </li>
  4286. <li
  4287. class="enumerate" id="x1-73004x2"><span
  4288. class="cmtt-12">[floor_number] </span>= element <span
  4289. class="cmtt-12">[submap_number] </span>of vector [vorbis&#x02D9;submap&#x02D9;floor]
  4290. </li>
  4291. <li
  4292. class="enumerate" id="x1-73006x3">if the floor type of this floor (vector
  4293. <span
  4294. class="cmtt-12">[vorbis_floor_types] </span>element <span
  4295. class="cmtt-12">[floor_number]</span>) is zero then decode the floor for
  4296. channel <span
  4297. class="cmtt-12">[i] </span>according to the <a
  4298. href="#x1-930006.2.2">subsubsection&#x00A0;6.2.2<!--tex4ht:ref: vorbis:spec:floor0-decode --></a>, &#8220;<a
  4299. href="#x1-930006.2.2">packet decode<!--tex4ht:ref: vorbis:spec:floor0-decode --></a>&#8221;
  4300. </li>
  4301. <li
  4302. class="enumerate" id="x1-73008x4">if the type of this floor is one then decode the floor for channel <span
  4303. class="cmtt-12">[i] </span>according to the
  4304. <a
  4305. href="#x1-1000007.2.2">paragraph&#x00A0;7.2.2<!--tex4ht:ref: vorbis:spec:floor1-decode --></a>, &#8220;<a
  4306. href="#x1-1000007.2.2">packet decode<!--tex4ht:ref: vorbis:spec:floor1-decode --></a>&#8221;
  4307. </li>
  4308. <li
  4309. class="enumerate" id="x1-73010x5">save the needed decoded floor information for channel for later synthesis
  4310. </li>
  4311. <li
  4312. class="enumerate" id="x1-73012x6">if the decoded floor returned &#8217;unused&#8217;, set vector <span
  4313. class="cmtt-12">[no_residue] </span>element <span
  4314. class="cmtt-12">[i] </span>to true,
  4315. else set vector <span
  4316. class="cmtt-12">[no_residue] </span>element <span
  4317. class="cmtt-12">[i] </span>to false</li></ol>
  4318. <!--l. 405--><p class="noindent" >An end-of-packet condition during floor decode shall result in packet decode zeroing all channel
  4319. output vectors and skipping to the add/overlap output stage.
  4320. <!--l. 411--><p class="noindent" >
  4321. <h5 class="subsubsectionHead"><span class="titlemark">4.3.3 </span> <a
  4322. id="x1-740004.3.3"></a>nonzero vector propagate</h5>
  4323. <!--l. 413--><p class="noindent" >A possible result of floor decode is that a specific vector is marked &#8217;unused&#8217; which indicates that
  4324. that final output vector is all-zero values (and the floor is zero). The residue for that vector is not
  4325. coded in the stream, save for one complication. If some vectors are used and some are not,
  4326. channel coupling could result in mixing a zeroed and nonzeroed vector to produce two nonzeroed
  4327. vectors.
  4328. <!--l. 420--><p class="noindent" >for each <span
  4329. class="cmtt-12">[i] </span>from 0 ... <span
  4330. class="cmtt-12">[vorbis_mapping_coupling_steps]</span>-1
  4331. <!--l. 422--><p class="noindent" >
  4332. <ol class="enumerate1" >
  4333. <li
  4334. class="enumerate" id="x1-74002x1">if either <span
  4335. class="cmtt-12">[no_residue] </span>entry for channel (<span
  4336. class="cmtt-12">[vorbis_mapping_magnitude] </span>element
  4337. <span
  4338. class="cmtt-12">[i]</span>) or channel (<span
  4339. class="cmtt-12">[vorbis_mapping_angle] </span>element <span
  4340. class="cmtt-12">[i]</span>) are set to false, then both
  4341. must be set to false. Note that an &#8217;unused&#8217; floor has no decoded floor information; it
  4342. is important that this is remembered at floor curve synthesis time.</li></ol>
  4343. <!--l. 435--><p class="noindent" >
  4344. <h5 class="subsubsectionHead"><span class="titlemark">4.3.4 </span> <a
  4345. id="x1-750004.3.4"></a>residue decode</h5>
  4346. <!--l. 437--><p class="noindent" >Unlike floors, which are decoded in channel order, the residue vectors are decoded in submap
  4347. order.
  4348. <!--l. 440--><p class="noindent" >for each submap <span
  4349. class="cmtt-12">[i] </span>in order from 0 ... <span
  4350. class="cmtt-12">[vorbis_mapping_submaps]</span>-1
  4351. <!--l. 442--><p class="noindent" >
  4352. <ol class="enumerate1" >
  4353. <li
  4354. class="enumerate" id="x1-75002x1"><span
  4355. class="cmtt-12">[ch] </span>= 0
  4356. </li>
  4357. <li
  4358. class="enumerate" id="x1-75004x2">for each channel <span
  4359. class="cmtt-12">[j] </span>in order from 0 ... <span
  4360. class="cmtt-12">[audio_channels] </span>- 1
  4361. <ol class="enumerate2" >
  4362. <li
  4363. class="enumerate" id="x1-75006x1">if channel <span
  4364. class="cmtt-12">[j] </span>in submap <span
  4365. class="cmtt-12">[i] </span>(vector <span
  4366. class="cmtt-12">[vorbis_mapping_mux] </span>element <span
  4367. class="cmtt-12">[j] </span>is equal to
  4368. <span
  4369. class="cmtt-12">[i]</span>)
  4370. <ol class="enumerate3" >
  4371. <li
  4372. class="enumerate" id="x1-75008x1">if vector <span
  4373. class="cmtt-12">[no_residue] </span>element <span
  4374. class="cmtt-12">[j] </span>is true
  4375. <ol class="enumerate4" >
  4376. <li
  4377. class="enumerate" id="x1-75010x1">vector <span
  4378. class="cmtt-12">[do_not_decode_flag] </span>element <span
  4379. class="cmtt-12">[ch] </span>is set</li></ol>
  4380. <!--l. 452--><p class="noindent" >else
  4381. <ol class="enumerate4" >
  4382. <li
  4383. class="enumerate" id="x1-75012x1">vector <span
  4384. class="cmtt-12">[do_not_decode_flag] </span>element <span
  4385. class="cmtt-12">[ch] </span>is unset</li></ol>
  4386. </li>
  4387. <li
  4388. class="enumerate" id="x1-75014x2">increment <span
  4389. class="cmtt-12">[ch]</span></li></ol>
  4390. </li></ol>
  4391. </li>
  4392. <li
  4393. class="enumerate" id="x1-75016x3"><span
  4394. class="cmtt-12">[residue_number] </span>= vector <span
  4395. class="cmtt-12">[vorbis_mapping_submap_residue] </span>element <span
  4396. class="cmtt-12">[i]</span>
  4397. </li>
  4398. <li
  4399. class="enumerate" id="x1-75018x4"><span
  4400. class="cmtt-12">[residue_type] </span>= vector <span
  4401. class="cmtt-12">[vorbis_residue_types] </span>element <span
  4402. class="cmtt-12">[residue_number]</span>
  4403. </li>
  4404. <li
  4405. class="enumerate" id="x1-75020x5">decode <span
  4406. class="cmtt-12">[ch] </span>vectors using residue <span
  4407. class="cmtt-12">[residue_number]</span>, according to type <span
  4408. class="cmtt-12">[residue_type]</span>,
  4409. also passing vector <span
  4410. class="cmtt-12">[do_not_decode_flag] </span>to indicate which vectors in the bundle should
  4411. not be decoded. Correct per-vector decode length is <span
  4412. class="cmtt-12">[n]</span>/2.
  4413. </li>
  4414. <li
  4415. class="enumerate" id="x1-75022x6"><span
  4416. class="cmtt-12">[ch] </span>= 0
  4417. </li>
  4418. <li
  4419. class="enumerate" id="x1-75024x7">for each channel <span
  4420. class="cmtt-12">[j] </span>in order from 0 ... <span
  4421. class="cmtt-12">[audio_channels]</span>
  4422. <ol class="enumerate2" >
  4423. <li
  4424. class="enumerate" id="x1-75026x1">if channel <span
  4425. class="cmtt-12">[j] </span>is in submap <span
  4426. class="cmtt-12">[i] </span>(vector <span
  4427. class="cmtt-12">[vorbis_mapping_mux] </span>element <span
  4428. class="cmtt-12">[j] </span>is equal
  4429. to <span
  4430. class="cmtt-12">[i]</span>)
  4431. <ol class="enumerate3" >
  4432. <li
  4433. class="enumerate" id="x1-75028x1">residue vector for channel <span
  4434. class="cmtt-12">[j] </span>is set to decoded residue vector <span
  4435. class="cmtt-12">[ch]</span>
  4436. </li>
  4437. <li
  4438. class="enumerate" id="x1-75030x2">increment <span
  4439. class="cmtt-12">[ch]</span></li></ol>
  4440. </li></ol>
  4441. </li></ol>
  4442. <!--l. 479--><p class="noindent" >
  4443. <h5 class="subsubsectionHead"><span class="titlemark">4.3.5 </span> <a
  4444. id="x1-760004.3.5"></a>inverse coupling</h5>
  4445. <!--l. 481--><p class="noindent" >for each <span
  4446. class="cmtt-12">[i] </span>from <span
  4447. class="cmtt-12">[vorbis_mapping_coupling_steps]</span>-1 descending to 0
  4448. <!--l. 483--><p class="noindent" >
  4449. <ol class="enumerate1" >
  4450. <li
  4451. class="enumerate" id="x1-76002x1"><span
  4452. class="cmtt-12">[magnitude_vector] </span>= the residue vector for channel (vector
  4453. <span
  4454. class="cmtt-12">[vorbis_mapping_magnitude] </span>element <span
  4455. class="cmtt-12">[i]</span>)
  4456. </li>
  4457. <li
  4458. class="enumerate" id="x1-76004x2"><span
  4459. class="cmtt-12">[angle_vector] </span>= the residue vector for channel (vector <span
  4460. class="cmtt-12">[vorbis_mapping_angle]</span>
  4461. element <span
  4462. class="cmtt-12">[i]</span>)
  4463. </li>
  4464. <li
  4465. class="enumerate" id="x1-76006x3">for each scalar value <span
  4466. class="cmtt-12">[M] </span>in vector <span
  4467. class="cmtt-12">[magnitude_vector] </span>and the corresponding scalar value
  4468. <span
  4469. class="cmtt-12">[A] </span>in vector <span
  4470. class="cmtt-12">[angle_vector]</span>:
  4471. <ol class="enumerate2" >
  4472. <li
  4473. class="enumerate" id="x1-76008x1">if (<span
  4474. class="cmtt-12">[M] </span>is greater than zero)
  4475. <ol class="enumerate3" >
  4476. <li
  4477. class="enumerate" id="x1-76010x1">if (<span
  4478. class="cmtt-12">[A] </span>is greater than zero)
  4479. <ol class="enumerate4" >
  4480. <li
  4481. class="enumerate" id="x1-76012x1"><span
  4482. class="cmtt-12">[new_M] </span>= <span
  4483. class="cmtt-12">[M]</span>
  4484. </li>
  4485. <li
  4486. class="enumerate" id="x1-76014x2"><span
  4487. class="cmtt-12">[new_A] </span>= <span
  4488. class="cmtt-12">[M]</span>-<span
  4489. class="cmtt-12">[A]</span></li></ol>
  4490. <!--l. 497--><p class="noindent" >else
  4491. <ol class="enumerate4" >
  4492. <li
  4493. class="enumerate" id="x1-76016x1"><span
  4494. class="cmtt-12">[new_A] </span>= <span
  4495. class="cmtt-12">[M]</span>
  4496. </li>
  4497. <li
  4498. class="enumerate" id="x1-76018x2"><span
  4499. class="cmtt-12">[new_M] </span>= <span
  4500. class="cmtt-12">[M]</span>+<span
  4501. class="cmtt-12">[A]</span></li></ol>
  4502. </li></ol>
  4503. <!--l. 504--><p class="noindent" >else
  4504. <ol class="enumerate3" >
  4505. <li
  4506. class="enumerate" id="x1-76020x1">if (<span
  4507. class="cmtt-12">[A] </span>is greater than zero)
  4508. <ol class="enumerate4" >
  4509. <li
  4510. class="enumerate" id="x1-76022x1"><span
  4511. class="cmtt-12">[new_M] </span>= <span
  4512. class="cmtt-12">[M]</span>
  4513. </li>
  4514. <li
  4515. class="enumerate" id="x1-76024x2"><span
  4516. class="cmtt-12">[new_A] </span>= <span
  4517. class="cmtt-12">[M]</span>+<span
  4518. class="cmtt-12">[A]</span></li></ol>
  4519. <!--l. 511--><p class="noindent" >else
  4520. <ol class="enumerate4" >
  4521. <li
  4522. class="enumerate" id="x1-76026x1"><span
  4523. class="cmtt-12">[new_A] </span>= <span
  4524. class="cmtt-12">[M]</span>
  4525. </li>
  4526. <li
  4527. class="enumerate" id="x1-76028x2"><span
  4528. class="cmtt-12">[new_M] </span>= <span
  4529. class="cmtt-12">[M]</span>-<span
  4530. class="cmtt-12">[A]</span></li></ol>
  4531. </li></ol>
  4532. </li>
  4533. <li
  4534. class="enumerate" id="x1-76030x2">set scalar value <span
  4535. class="cmtt-12">[M] </span>in vector <span
  4536. class="cmtt-12">[magnitude_vector] </span>to <span
  4537. class="cmtt-12">[new_M]</span>
  4538. </li>
  4539. <li
  4540. class="enumerate" id="x1-76032x3">set scalar value <span
  4541. class="cmtt-12">[A] </span>in vector <span
  4542. class="cmtt-12">[angle_vector] </span>to <span
  4543. class="cmtt-12">[new_A]</span></li></ol>
  4544. </li></ol>
  4545. <!--l. 528--><p class="noindent" >
  4546. <h5 class="subsubsectionHead"><span class="titlemark">4.3.6 </span> <a
  4547. id="x1-770004.3.6"></a>dot product</h5>
  4548. <!--l. 530--><p class="noindent" >For each channel, synthesize the floor curve from the decoded floor information, according to
  4549. packet type. Note that the vector synthesis length for floor computation is <span
  4550. class="cmtt-12">[n]</span>/2.
  4551. <!--l. 534--><p class="noindent" >For each channel, multiply each element of the floor curve by each element of that
  4552. channel&#8217;s residue vector. The result is the dot product of the floor and residue vectors for
  4553. each channel; the produced vectors are the length <span
  4554. class="cmtt-12">[n]</span>/2 audio spectrum for each
  4555. channel.
  4556. <!--l. 542--><p class="noindent" >One point is worth mentioning about this dot product; a common mistake in a fixed point
  4557. implementation might be to assume that a 32 bit fixed-point representation for floor and
  4558. residue and direct multiplication of the vectors is sufficient for acceptable spectral depth
  4559. in all cases because it happens to mostly work with the current Xiph.Org reference
  4560. encoder.
  4561. <!--l. 549--><p class="noindent" >However, floor vector values can span <span
  4562. class="cmsy-10x-x-120">~</span>140dB (<span
  4563. class="cmsy-10x-x-120">~</span>24 bits unsigned), and the audio spectrum
  4564. vector should represent a minimum of 120dB (<span
  4565. class="cmsy-10x-x-120">~</span>21 bits with sign), even when output is to a 16
  4566. bit PCM device. For the residue vector to represent full scale if the floor is nailed
  4567. to <span
  4568. class="cmsy-10x-x-120">-</span>140dB, it must be able to span 0 to +140dB. For the residue vector to reach
  4569. full scale if the floor is nailed at 0dB, it must be able to represent <span
  4570. class="cmsy-10x-x-120">-</span>140dB to +0dB.
  4571. Thus, in order to handle full range dynamics, a residue vector may span <span
  4572. class="cmsy-10x-x-120">-</span>140dB to
  4573. +140dB entirely within spec. A 280dB range is approximately 48 bits with sign; thus the
  4574. residue vector must be able to represent a 48 bit range and the dot product must
  4575. be able to handle an effective 48 bit times 24 bit multiplication. This range may be
  4576. achieved using large (64 bit or larger) integers, or implementing a movable binary point
  4577. representation.
  4578. <!--l. 566--><p class="noindent" >
  4579. <h5 class="subsubsectionHead"><span class="titlemark">4.3.7 </span> <a
  4580. id="x1-780004.3.7"></a>inverse MDCT</h5>
  4581. <!--l. 568--><p class="noindent" >Convert the audio spectrum vector of each channel back into time domain PCM audio via an
  4582. inverse Modified Discrete Cosine Transform (MDCT). A detailed description of the MDCT is
  4583. available in <span class="cite">[<a
  4584. href="#XSporer/Brandenburg/Edler">1</a>]</span>. The window function used for the MDCT is the function described
  4585. earlier.
  4586. <!--l. 575--><p class="noindent" >
  4587. <h5 class="subsubsectionHead"><span class="titlemark">4.3.8 </span> <a
  4588. id="x1-790004.3.8"></a>overlap&#x02D9;add</h5>
  4589. <!--l. 577--><p class="noindent" >Windowed MDCT output is overlapped and added with the right hand data of the previous
  4590. window such that the 3/4 point of the previous window is aligned with the 1/4 point of the
  4591. current window (as illustrated in <a
  4592. href="#x1-260001.3.2">paragraph&#x00A0;1.3.2<!--tex4ht:ref: vorbis:spec:window --></a>, &#8220;<a
  4593. href="#x1-260001.3.2">Window shape decode (long windows
  4594. only)<!--tex4ht:ref: vorbis:spec:window --></a>&#8221;). The overlapped portion produced from overlapping the previous and current frame data
  4595. is finished data to be returned by the decoder. This data spans from the center of
  4596. the previous window to the center of the current window. In the case of same-sized
  4597. windows, the amount of data to return is one-half block consisting of and only of the
  4598. overlapped portions. When overlapping a short and long window, much of the returned
  4599. range does not actually overlap. This does not damage transform orthogonality. Pay
  4600. attention however to returning the correct data range; the amount of data to be returned
  4601. is:
  4602. <!--l. 591--><p class="noindent" >
  4603. <div class="fancyvrb" id="fancyvrb22">
  4604. <a
  4605. id="x1-79002r1"></a><span
  4606. class="cmr-6">1</span><span
  4607. class="cmtt-8">&#x00A0;</span><span
  4608. class="cmtt-8">&#x00A0;window_blocksize(previous_window)/4+window_blocksize(current_window)/4</span>
  4609. </div>
  4610. <!--l. 595--><p class="noindent" >from the center (element windowsize/2) of the previous window to the center (element
  4611. windowsize/2-1, inclusive) of the current window.
  4612. <!--l. 598--><p class="noindent" >Data is not returned from the first frame; it must be used to &#8217;prime&#8217; the decode engine. The
  4613. encoder accounts for this priming when calculating PCM offsets; after the first frame, the proper
  4614. PCM output offset is &#8217;0&#8217; (as no data has been returned yet).
  4615. <!--l. 605--><p class="noindent" >
  4616. <h5 class="subsubsectionHead"><span class="titlemark">4.3.9 </span> <a
  4617. id="x1-800004.3.9"></a>output channel order</h5>
  4618. <!--l. 607--><p class="noindent" >Vorbis I specifies only a channel mapping type 0. In mapping type 0, channel mapping is
  4619. implicitly defined as follows for standard audio applications:
  4620. <!--l. 611--><p class="noindent" >
  4621. <dl class="description"><dt class="description">
  4622. <span
  4623. class="cmssbx-10x-x-120">three channels</span> </dt><dd
  4624. class="description">the stream is monophonic
  4625. </dd><dt class="description">
  4626. <span
  4627. class="cmssbx-10x-x-120">two channels</span> </dt><dd
  4628. class="description">the stream is stereo. channel order: left, right
  4629. </dd><dt class="description">
  4630. <span
  4631. class="cmssbx-10x-x-120">three channels</span> </dt><dd
  4632. class="description">the stream is a 1d-surround encoding. channel order: left, center, right
  4633. </dd><dt class="description">
  4634. <span
  4635. class="cmssbx-10x-x-120">four channels</span> </dt><dd
  4636. class="description">the stream is quadraphonic surround. channel order: front left, front right,
  4637. rear left, rear right
  4638. </dd><dt class="description">
  4639. <span
  4640. class="cmssbx-10x-x-120">five channels</span> </dt><dd
  4641. class="description">the stream is five-channel surround. channel order: front left, front center,
  4642. front right, rear left, rear right
  4643. </dd><dt class="description">
  4644. <span
  4645. class="cmssbx-10x-x-120">six channels</span> </dt><dd
  4646. class="description">the stream is 5.1 surround. channel order: front left, front center, front right,
  4647. rear left, rear right, LFE
  4648. </dd><dt class="description">
  4649. <span
  4650. class="cmssbx-10x-x-120">greater than six channels</span> </dt><dd
  4651. class="description">channel use and order is defined by the application
  4652. </dd></dl>
  4653. <!--l. 639--><p class="noindent" >Applications using Vorbis for dedicated purposes may define channel mapping as seen fit. Future
  4654. channel mappings (such as three and four channel <a
  4655. href="http://www.ambisonic.net/" >Ambisonics</a>) will make use of channel
  4656. mappings other than mapping 0.
  4657. <h3 class="sectionHead"><span class="titlemark">5 </span> <a
  4658. id="x1-810005"></a>comment field and header specification</h3>
  4659. <!--l. 6--><p class="noindent" >
  4660. <h4 class="subsectionHead"><span class="titlemark">5.1 </span> <a
  4661. id="x1-820005.1"></a>Overview</h4>
  4662. <!--l. 8--><p class="noindent" >The Vorbis text comment header is the second (of three) header packets that begin a Vorbis
  4663. bitstream. It is meant for short text comments, not arbitrary metadata; arbitrary metadata
  4664. belongs in a separate logical bitstream (usually an XML stream type) that provides greater
  4665. structure and machine parseability.
  4666. <!--l. 14--><p class="noindent" >The comment field is meant to be used much like someone jotting a quick note on the bottom of
  4667. a CDR. It should be a little information to remember the disc by and explain it to others; a
  4668. short, to-the-point text note that need not only be a couple words, but isn&#8217;t going to be more
  4669. than a short paragraph. The essentials, in other words, whatever they turn out to be,
  4670. eg:
  4671. <!--l. 21--><p class="noindent" >
  4672. <div class="quote">
  4673. <!--l. 22--><p class="noindent" >Honest Bob and the Factory-to-Dealer-Incentives, <span
  4674. class="cmti-12">&#8220;I&#8217;m Still Around&#8221;</span>, opening
  4675. for Moxy Früvous, 1997.</div>
  4676. <!--l. 29--><p class="noindent" >
  4677. <h4 class="subsectionHead"><span class="titlemark">5.2 </span> <a
  4678. id="x1-830005.2"></a>Comment encoding</h4>
  4679. <!--l. 31--><p class="noindent" >
  4680. <h5 class="subsubsectionHead"><span class="titlemark">5.2.1 </span> <a
  4681. id="x1-840005.2.1"></a>Structure</h5>
  4682. <!--l. 33--><p class="noindent" >The comment header is logically a list of eight-bit-clean vectors; the number of vectors is
  4683. bounded to 2<sup><span
  4684. class="cmr-8">32</span></sup> <span
  4685. class="cmsy-10x-x-120">- </span>1 and the length of each vector is limited to 2<sup><span
  4686. class="cmr-8">32</span></sup> <span
  4687. class="cmsy-10x-x-120">- </span>1 bytes. The vector length is
  4688. encoded; the vector contents themselves are not null terminated. In addition to the vector list,
  4689. there is a single vector for vendor name (also 8 bit clean, length encoded in 32 bits). For
  4690. example, the 1.0 release of libvorbis set the vendor string to &#8220;Xiph.Org libVorbis I
  4691. 20020717&#8221;.
  4692. <!--l. 41--><p class="noindent" >The vector lengths and number of vectors are stored lsb first, according to the bit
  4693. packing conventions of the vorbis codec. However, since data in the comment header
  4694. is octet-aligned, they can simply be read as unaligned 32 bit little endian unsigned
  4695. integers.
  4696. <!--l. 46--><p class="noindent" >The comment header is decoded as follows:
  4697. <!--l. 48--><p class="noindent" >
  4698. <div class="fancyvrb" id="fancyvrb23">
  4699. <a
  4700. id="x1-84002r1"></a><span
  4701. class="cmr-6">1</span><span
  4702. class="cmtt-8">&#x00A0;</span><span
  4703. class="cmtt-8">&#x00A0;</span><span
  4704. class="cmtt-8">&#x00A0;</span><span
  4705. class="cmtt-8">&#x00A0;1)</span><span
  4706. class="cmtt-8">&#x00A0;[vendor_length]</span><span
  4707. class="cmtt-8">&#x00A0;=</span><span
  4708. class="cmtt-8">&#x00A0;read</span><span
  4709. class="cmtt-8">&#x00A0;an</span><span
  4710. class="cmtt-8">&#x00A0;unsigned</span><span
  4711. class="cmtt-8">&#x00A0;integer</span><span
  4712. class="cmtt-8">&#x00A0;of</span><span
  4713. class="cmtt-8">&#x00A0;32</span><span
  4714. class="cmtt-8">&#x00A0;bits</span>
  4715. <br class="fancyvrb" /><a
  4716. id="x1-84004r2"></a><span
  4717. class="cmr-6">2</span><span
  4718. class="cmtt-8">&#x00A0;</span><span
  4719. class="cmtt-8">&#x00A0;</span><span
  4720. class="cmtt-8">&#x00A0;</span><span
  4721. class="cmtt-8">&#x00A0;2)</span><span
  4722. class="cmtt-8">&#x00A0;[vendor_string]</span><span
  4723. class="cmtt-8">&#x00A0;=</span><span
  4724. class="cmtt-8">&#x00A0;read</span><span
  4725. class="cmtt-8">&#x00A0;a</span><span
  4726. class="cmtt-8">&#x00A0;UTF-8</span><span
  4727. class="cmtt-8">&#x00A0;vector</span><span
  4728. class="cmtt-8">&#x00A0;as</span><span
  4729. class="cmtt-8">&#x00A0;[vendor_length]</span><span
  4730. class="cmtt-8">&#x00A0;octets</span>
  4731. <br class="fancyvrb" /><a
  4732. id="x1-84006r3"></a><span
  4733. class="cmr-6">3</span><span
  4734. class="cmtt-8">&#x00A0;</span><span
  4735. class="cmtt-8">&#x00A0;</span><span
  4736. class="cmtt-8">&#x00A0;</span><span
  4737. class="cmtt-8">&#x00A0;3)</span><span
  4738. class="cmtt-8">&#x00A0;[user_comment_list_length]</span><span
  4739. class="cmtt-8">&#x00A0;=</span><span
  4740. class="cmtt-8">&#x00A0;read</span><span
  4741. class="cmtt-8">&#x00A0;an</span><span
  4742. class="cmtt-8">&#x00A0;unsigned</span><span
  4743. class="cmtt-8">&#x00A0;integer</span><span
  4744. class="cmtt-8">&#x00A0;of</span><span
  4745. class="cmtt-8">&#x00A0;32</span><span
  4746. class="cmtt-8">&#x00A0;bits</span>
  4747. <br class="fancyvrb" /><a
  4748. id="x1-84008r4"></a><span
  4749. class="cmr-6">4</span><span
  4750. class="cmtt-8">&#x00A0;</span><span
  4751. class="cmtt-8">&#x00A0;</span><span
  4752. class="cmtt-8">&#x00A0;</span><span
  4753. class="cmtt-8">&#x00A0;4)</span><span
  4754. class="cmtt-8">&#x00A0;iterate</span><span
  4755. class="cmtt-8">&#x00A0;[user_comment_list_length]</span><span
  4756. class="cmtt-8">&#x00A0;times</span><span
  4757. class="cmtt-8">&#x00A0;{</span>
  4758. <br class="fancyvrb" /><a
  4759. id="x1-84010r5"></a><span
  4760. class="cmr-6">5</span><span
  4761. class="cmtt-8">&#x00A0;</span><span
  4762. class="cmtt-8">&#x00A0;</span><span
  4763. class="cmtt-8">&#x00A0;</span><span
  4764. class="cmtt-8">&#x00A0;</span><span
  4765. class="cmtt-8">&#x00A0;</span><span
  4766. class="cmtt-8">&#x00A0;</span><span
  4767. class="cmtt-8">&#x00A0;</span><span
  4768. class="cmtt-8">&#x00A0;</span><span
  4769. class="cmtt-8">&#x00A0;5)</span><span
  4770. class="cmtt-8">&#x00A0;[length]</span><span
  4771. class="cmtt-8">&#x00A0;=</span><span
  4772. class="cmtt-8">&#x00A0;read</span><span
  4773. class="cmtt-8">&#x00A0;an</span><span
  4774. class="cmtt-8">&#x00A0;unsigned</span><span
  4775. class="cmtt-8">&#x00A0;integer</span><span
  4776. class="cmtt-8">&#x00A0;of</span><span
  4777. class="cmtt-8">&#x00A0;32</span><span
  4778. class="cmtt-8">&#x00A0;bits</span>
  4779. <br class="fancyvrb" /><a
  4780. id="x1-84012r6"></a><span
  4781. class="cmr-6">6</span><span
  4782. class="cmtt-8">&#x00A0;</span><span
  4783. class="cmtt-8">&#x00A0;</span><span
  4784. class="cmtt-8">&#x00A0;</span><span
  4785. class="cmtt-8">&#x00A0;</span><span
  4786. class="cmtt-8">&#x00A0;</span><span
  4787. class="cmtt-8">&#x00A0;</span><span
  4788. class="cmtt-8">&#x00A0;</span><span
  4789. class="cmtt-8">&#x00A0;</span><span
  4790. class="cmtt-8">&#x00A0;6)</span><span
  4791. class="cmtt-8">&#x00A0;this</span><span
  4792. class="cmtt-8">&#x00A0;iteration&#8217;s</span><span
  4793. class="cmtt-8">&#x00A0;user</span><span
  4794. class="cmtt-8">&#x00A0;comment</span><span
  4795. class="cmtt-8">&#x00A0;=</span><span
  4796. class="cmtt-8">&#x00A0;read</span><span
  4797. class="cmtt-8">&#x00A0;a</span><span
  4798. class="cmtt-8">&#x00A0;UTF-8</span><span
  4799. class="cmtt-8">&#x00A0;vector</span><span
  4800. class="cmtt-8">&#x00A0;as</span><span
  4801. class="cmtt-8">&#x00A0;[length]</span><span
  4802. class="cmtt-8">&#x00A0;octets</span>
  4803. <br class="fancyvrb" /><a
  4804. id="x1-84014r7"></a><span
  4805. class="cmr-6">7</span><span
  4806. class="cmtt-8">&#x00A0;</span><span
  4807. class="cmtt-8">&#x00A0;</span><span
  4808. class="cmtt-8">&#x00A0;</span><span
  4809. class="cmtt-8">&#x00A0;</span><span
  4810. class="cmtt-8">&#x00A0;</span><span
  4811. class="cmtt-8">&#x00A0;</span><span
  4812. class="cmtt-8">&#x00A0;}</span>
  4813. <br class="fancyvrb" /><a
  4814. id="x1-84016r8"></a><span
  4815. class="cmr-6">8</span><span
  4816. class="cmtt-8">&#x00A0;</span><span
  4817. class="cmtt-8">&#x00A0;</span><span
  4818. class="cmtt-8">&#x00A0;</span><span
  4819. class="cmtt-8">&#x00A0;7)</span><span
  4820. class="cmtt-8">&#x00A0;[framing_bit]</span><span
  4821. class="cmtt-8">&#x00A0;=</span><span
  4822. class="cmtt-8">&#x00A0;read</span><span
  4823. class="cmtt-8">&#x00A0;a</span><span
  4824. class="cmtt-8">&#x00A0;single</span><span
  4825. class="cmtt-8">&#x00A0;bit</span><span
  4826. class="cmtt-8">&#x00A0;as</span><span
  4827. class="cmtt-8">&#x00A0;boolean</span>
  4828. <br class="fancyvrb" /><a
  4829. id="x1-84018r9"></a><span
  4830. class="cmr-6">9</span><span
  4831. class="cmtt-8">&#x00A0;</span><span
  4832. class="cmtt-8">&#x00A0;</span><span
  4833. class="cmtt-8">&#x00A0;</span><span
  4834. class="cmtt-8">&#x00A0;8)</span><span
  4835. class="cmtt-8">&#x00A0;if</span><span
  4836. class="cmtt-8">&#x00A0;(</span><span
  4837. class="cmtt-8">&#x00A0;[framing_bit]</span><span
  4838. class="cmtt-8">&#x00A0;unset</span><span
  4839. class="cmtt-8">&#x00A0;or</span><span
  4840. class="cmtt-8">&#x00A0;end-of-packet</span><span
  4841. class="cmtt-8">&#x00A0;)</span><span
  4842. class="cmtt-8">&#x00A0;then</span><span
  4843. class="cmtt-8">&#x00A0;ERROR</span>
  4844. <br class="fancyvrb" /><a
  4845. id="x1-84020r10"></a><span
  4846. class="cmr-6">10</span><span
  4847. class="cmtt-8">&#x00A0;</span><span
  4848. class="cmtt-8">&#x00A0;</span><span
  4849. class="cmtt-8">&#x00A0;</span><span
  4850. class="cmtt-8">&#x00A0;9)</span><span
  4851. class="cmtt-8">&#x00A0;done.</span>
  4852. </div>
  4853. <!--l. 64--><p class="noindent" >
  4854. <h5 class="subsubsectionHead"><span class="titlemark">5.2.2 </span> <a
  4855. id="x1-850005.2.2"></a>Content vector format</h5>
  4856. <!--l. 66--><p class="noindent" >The comment vectors are structured similarly to a UNIX environment variable. That is,
  4857. comment fields consist of a field name and a corresponding value and look like:
  4858. <!--l. 70--><p class="noindent" >
  4859. <div class="quote">
  4860. <!--l. 71--><p class="noindent" >
  4861. <div class="fancyvrb" id="fancyvrb24">
  4862. <a
  4863. id="x1-85002r1"></a><span
  4864. class="cmr-6">1</span><span
  4865. class="cmtt-8">&#x00A0;</span><span
  4866. class="cmtt-8">&#x00A0;comment[0]="ARTIST=me";</span>
  4867. <br class="fancyvrb" /><a
  4868. id="x1-85004r2"></a><span
  4869. class="cmr-6">2</span><span
  4870. class="cmtt-8">&#x00A0;</span><span
  4871. class="cmtt-8">&#x00A0;comment[1]="TITLE=the</span><span
  4872. class="cmtt-8">&#x00A0;sound</span><span
  4873. class="cmtt-8">&#x00A0;of</span><span
  4874. class="cmtt-8">&#x00A0;Vorbis";</span>
  4875. </div>
  4876. </div>
  4877. <!--l. 77--><p class="noindent" >The field name is case-insensitive and may consist of ASCII 0x20 through 0x7D, 0x3D (&#8217;=&#8217;)
  4878. excluded. ASCII 0x41 through 0x5A inclusive (characters A-Z) is to be considered equivalent to
  4879. ASCII 0x61 through 0x7A inclusive (characters a-z).
  4880. <!--l. 83--><p class="noindent" >The field name is immediately followed by ASCII 0x3D (&#8217;=&#8217;); this equals sign is used to
  4881. terminate the field name.
  4882. <!--l. 87--><p class="noindent" >0x3D is followed by 8 bit clean UTF-8 encoded value of the field contents to the end of the
  4883. field.
  4884. <!--l. 91--><p class="noindent" ><span class="paragraphHead"><a
  4885. id="x1-860005.2.2"></a><span
  4886. class="cmbx-12">Field names</span></span>
  4887. Below is a proposed, minimal list of standard field names with a description of intended use. No
  4888. single or group of field names is mandatory; a comment header may contain one, all or none of
  4889. the names in this list.
  4890. <!--l. 98--><p class="noindent" >
  4891. <dl class="description"><dt class="description">
  4892. <span
  4893. class="cmssbx-10x-x-120">TITLE</span> </dt><dd
  4894. class="description">Track/Work name
  4895. </dd><dt class="description">
  4896. <span
  4897. class="cmssbx-10x-x-120">VERSION</span> </dt><dd
  4898. class="description">The version field may be used to differentiate multiple versions of the same
  4899. track title in a single collection. (e.g. remix info)
  4900. </dd><dt class="description">
  4901. <span
  4902. class="cmssbx-10x-x-120">ALBUM</span> </dt><dd
  4903. class="description">The collection name to which this track belongs
  4904. </dd><dt class="description">
  4905. <span
  4906. class="cmssbx-10x-x-120">TRACKNUMBER</span> </dt><dd
  4907. class="description">The track number of this piece if part of a specific larger collection or
  4908. album
  4909. </dd><dt class="description">
  4910. <span
  4911. class="cmssbx-10x-x-120">ARTIST</span> </dt><dd
  4912. class="description">The artist generally considered responsible for the work. In popular music this is
  4913. usually the performing band or singer. For classical music it would be the composer.
  4914. For an audio book it would be the author of the original text.
  4915. </dd><dt class="description">
  4916. <span
  4917. class="cmssbx-10x-x-120">PERFORMER</span> </dt><dd
  4918. class="description">The artist(s) who performed the work. In classical music this would be the
  4919. conductor, orchestra, soloists. In an audio book it would be the actor who did the
  4920. reading. In popular music this is typically the same as the ARTIST and is omitted.
  4921. </dd><dt class="description">
  4922. <span
  4923. class="cmssbx-10x-x-120">COPYRIGHT</span> </dt><dd
  4924. class="description">Copyright attribution, e.g., &#8217;2001 Nobody&#8217;s Band&#8217; or &#8217;1999 Jack Moffitt&#8217;
  4925. </dd><dt class="description">
  4926. <span
  4927. class="cmssbx-10x-x-120">LICENSE</span> </dt><dd
  4928. class="description">License information, eg, &#8217;All Rights Reserved&#8217;, &#8217;Any Use Permitted&#8217;, a URL to
  4929. a license such as a Creative
  4930. Commons license (&#8221;www.creativecommons.org/blahblah/license.html&#8221;) or the EFF
  4931. Open Audio License (&#8217;distributed under the terms of the Open Audio License. see
  4932. http://www.eff.org/IP/Open&#x02D9;licenses/eff&#x02D9;oal.html for details&#8217;), etc.
  4933. </dd><dt class="description">
  4934. <span
  4935. class="cmssbx-10x-x-120">ORGANIZATION</span> </dt><dd
  4936. class="description">Name of the organization producing the track (i.e. the &#8217;record label&#8217;)
  4937. </dd><dt class="description">
  4938. <span
  4939. class="cmssbx-10x-x-120">DESCRIPTION</span> </dt><dd
  4940. class="description">A short text description of the contents
  4941. </dd><dt class="description">
  4942. <span
  4943. class="cmssbx-10x-x-120">GENRE</span> </dt><dd
  4944. class="description">A short text indication of music genre
  4945. </dd><dt class="description">
  4946. <span
  4947. class="cmssbx-10x-x-120">DATE</span> </dt><dd
  4948. class="description">Date the track was recorded
  4949. </dd><dt class="description">
  4950. <span
  4951. class="cmssbx-10x-x-120">LOCATION</span> </dt><dd
  4952. class="description">Location where track was recorded
  4953. </dd><dt class="description">
  4954. <span
  4955. class="cmssbx-10x-x-120">CONTACT</span> </dt><dd
  4956. class="description">Contact information for the creators or distributors of the track. This could
  4957. be a URL, an email address, the physical address of the producing label.
  4958. </dd><dt class="description">
  4959. <span
  4960. class="cmssbx-10x-x-120">ISRC</span> </dt><dd
  4961. class="description">International Standard Recording Code for the track; see <a
  4962. href="http://www.ifpi.org/isrc/" >the ISRC intro page</a> for
  4963. more information on ISRC numbers.
  4964. </dd></dl>
  4965. <!--l. 158--><p class="noindent" ><span class="paragraphHead"><a
  4966. id="x1-870005.2.2"></a><span
  4967. class="cmbx-12">Implications</span></span>
  4968. Field names should not be &#8217;internationalized&#8217;; this is a concession to simplicity not
  4969. an attempt to exclude the majority of the world that doesn&#8217;t speak English. Field
  4970. <span
  4971. class="cmti-12">contents</span>, however, use the UTF-8 character encoding to allow easy representation of any
  4972. language.
  4973. <!--l. 166--><p class="noindent" >We have the length of the entirety of the field and restrictions on the field name so that
  4974. the field name is bounded in a known way. Thus we also have the length of the field
  4975. contents.
  4976. <!--l. 170--><p class="noindent" >Individual &#8217;vendors&#8217; may use non-standard field names within reason. The proper
  4977. use of comment fields should be clear through context at this point. Abuse will be
  4978. discouraged.
  4979. <!--l. 174--><p class="noindent" >There is no vendor-specific prefix to &#8217;nonstandard&#8217; field names. Vendors should make some effort
  4980. to avoid arbitrarily polluting the common namespace. We will generally collect the more useful
  4981. tags here to help with standardization.
  4982. <!--l. 179--><p class="noindent" >Field names are not required to be unique (occur once) within a comment header. As an
  4983. example, assume a track was recorded by three well know artists; the following is permissible,
  4984. and encouraged:
  4985. <!--l. 183--><p class="noindent" >
  4986. <div class="quote">
  4987. <!--l. 184--><p class="noindent" >
  4988. <div class="fancyvrb" id="fancyvrb25">
  4989. <a
  4990. id="x1-87002r1"></a><span
  4991. class="cmr-6">1</span><span
  4992. class="cmtt-8">&#x00A0;</span><span
  4993. class="cmtt-8">&#x00A0;ARTIST=Dizzy</span><span
  4994. class="cmtt-8">&#x00A0;Gillespie</span>
  4995. <br class="fancyvrb" /><a
  4996. id="x1-87004r2"></a><span
  4997. class="cmr-6">2</span><span
  4998. class="cmtt-8">&#x00A0;</span><span
  4999. class="cmtt-8">&#x00A0;ARTIST=Sonny</span><span
  5000. class="cmtt-8">&#x00A0;Rollins</span>
  5001. <br class="fancyvrb" /><a
  5002. id="x1-87006r3"></a><span
  5003. class="cmr-6">3</span><span
  5004. class="cmtt-8">&#x00A0;</span><span
  5005. class="cmtt-8">&#x00A0;ARTIST=Sonny</span><span
  5006. class="cmtt-8">&#x00A0;Stitt</span>
  5007. </div>
  5008. </div>
  5009. <!--l. 197--><p class="noindent" >
  5010. <h5 class="subsubsectionHead"><span class="titlemark">5.2.3 </span> <a
  5011. id="x1-880005.2.3"></a>Encoding</h5>
  5012. <!--l. 199--><p class="noindent" >The comment header comprises the entirety of the second bitstream header packet. Unlike the
  5013. first bitstream header packet, it is not generally the only packet on the second page and may not
  5014. be restricted to within the second bitstream page. The length of the comment header packet is
  5015. (practically) unbounded. The comment header packet is not optional; it must be present in the
  5016. bitstream even if it is effectively empty.
  5017. <!--l. 207--><p class="noindent" >The comment header is encoded as follows (as per Ogg&#8217;s standard bitstream mapping which
  5018. renders least-significant-bit of the word to be coded into the least significant available bit of the
  5019. current bitstream octet first):
  5020. <!--l. 212--><p class="noindent" >
  5021. <ol class="enumerate1" >
  5022. <li
  5023. class="enumerate" id="x1-88002x1">Vendor string length (32 bit unsigned quantity specifying number of octets)
  5024. </li>
  5025. <li
  5026. class="enumerate" id="x1-88004x2">Vendor string ([vendor string length] octets coded from beginning of string to end of
  5027. string, not null terminated)
  5028. </li>
  5029. <li
  5030. class="enumerate" id="x1-88006x3">Number of comment fields (32 bit unsigned quantity specifying number of fields)
  5031. </li>
  5032. <li
  5033. class="enumerate" id="x1-88008x4">Comment field 0 length (if [Number of comment fields] <span
  5034. class="cmmi-12">&#x003E; </span>0; 32 bit unsigned quantity
  5035. specifying number of octets)
  5036. </li>
  5037. <li
  5038. class="enumerate" id="x1-88010x5">Comment field 0 ([Comment field 0 length] octets coded from beginning of string to
  5039. end of string, not null terminated)
  5040. </li>
  5041. <li
  5042. class="enumerate" id="x1-88012x6">Comment field 1 length (if [Number of comment fields] <span
  5043. class="cmmi-12">&#x003E; </span>1...)...
  5044. </li></ol>
  5045. <!--l. 234--><p class="noindent" >This is actually somewhat easier to describe in code; implementation of the above can be found
  5046. in <span
  5047. class="cmtt-12">vorbis/lib/info.c</span>, <span
  5048. class="cmtt-12">_vorbis_pack_comment() </span>and <span
  5049. class="cmtt-12">_vorbis_unpack_comment()</span>.
  5050. <h3 class="sectionHead"><span class="titlemark">6 </span> <a
  5051. id="x1-890006"></a>Floor type 0 setup and decode</h3>
  5052. <!--l. 6--><p class="noindent" >
  5053. <h4 class="subsectionHead"><span class="titlemark">6.1 </span> <a
  5054. id="x1-900006.1"></a>Overview</h4>
  5055. <!--l. 8--><p class="noindent" >Vorbis floor type zero uses Line Spectral Pair (LSP, also alternately known as Line Spectral
  5056. Frequency or LSF) representation to encode a smooth spectral envelope curve as the frequency
  5057. response of the LSP filter. This representation is equivalent to a traditional all-pole infinite
  5058. impulse response filter as would be used in linear predictive coding; LSP representation may be
  5059. converted to LPC representation and vice-versa.
  5060. <!--l. 18--><p class="noindent" >
  5061. <h4 class="subsectionHead"><span class="titlemark">6.2 </span> <a
  5062. id="x1-910006.2"></a>Floor 0 format</h4>
  5063. <!--l. 20--><p class="noindent" >Floor zero configuration consists of six integer fields and a list of VQ codebooks for use in
  5064. coding/decoding the LSP filter coefficient values used by each frame.
  5065. <!--l. 24--><p class="noindent" >
  5066. <h5 class="subsubsectionHead"><span class="titlemark">6.2.1 </span> <a
  5067. id="x1-920006.2.1"></a>header decode</h5>
  5068. <!--l. 26--><p class="noindent" >Configuration information for instances of floor zero decodes from the codec setup header (third
  5069. packet). configuration decode proceeds as follows:
  5070. <!--l. 30--><p class="noindent" >
  5071. <div class="fancyvrb" id="fancyvrb26">
  5072. <a
  5073. id="x1-92002r1"></a><span
  5074. class="cmr-6">1</span><span
  5075. class="cmtt-8">&#x00A0;</span><span
  5076. class="cmtt-8">&#x00A0;</span><span
  5077. class="cmtt-8">&#x00A0;</span><span
  5078. class="cmtt-8">&#x00A0;1)</span><span
  5079. class="cmtt-8">&#x00A0;[floor0_order]</span><span
  5080. class="cmtt-8">&#x00A0;=</span><span
  5081. class="cmtt-8">&#x00A0;read</span><span
  5082. class="cmtt-8">&#x00A0;an</span><span
  5083. class="cmtt-8">&#x00A0;unsigned</span><span
  5084. class="cmtt-8">&#x00A0;integer</span><span
  5085. class="cmtt-8">&#x00A0;of</span><span
  5086. class="cmtt-8">&#x00A0;8</span><span
  5087. class="cmtt-8">&#x00A0;bits</span>
  5088. <br class="fancyvrb" /><a
  5089. id="x1-92004r2"></a><span
  5090. class="cmr-6">2</span><span
  5091. class="cmtt-8">&#x00A0;</span><span
  5092. class="cmtt-8">&#x00A0;</span><span
  5093. class="cmtt-8">&#x00A0;</span><span
  5094. class="cmtt-8">&#x00A0;2)</span><span
  5095. class="cmtt-8">&#x00A0;[floor0_rate]</span><span
  5096. class="cmtt-8">&#x00A0;=</span><span
  5097. class="cmtt-8">&#x00A0;read</span><span
  5098. class="cmtt-8">&#x00A0;an</span><span
  5099. class="cmtt-8">&#x00A0;unsigned</span><span
  5100. class="cmtt-8">&#x00A0;integer</span><span
  5101. class="cmtt-8">&#x00A0;of</span><span
  5102. class="cmtt-8">&#x00A0;16</span><span
  5103. class="cmtt-8">&#x00A0;bits</span>
  5104. <br class="fancyvrb" /><a
  5105. id="x1-92006r3"></a><span
  5106. class="cmr-6">3</span><span
  5107. class="cmtt-8">&#x00A0;</span><span
  5108. class="cmtt-8">&#x00A0;</span><span
  5109. class="cmtt-8">&#x00A0;</span><span
  5110. class="cmtt-8">&#x00A0;3)</span><span
  5111. class="cmtt-8">&#x00A0;[floor0_bark_map_size]</span><span
  5112. class="cmtt-8">&#x00A0;=</span><span
  5113. class="cmtt-8">&#x00A0;read</span><span
  5114. class="cmtt-8">&#x00A0;an</span><span
  5115. class="cmtt-8">&#x00A0;unsigned</span><span
  5116. class="cmtt-8">&#x00A0;integer</span><span
  5117. class="cmtt-8">&#x00A0;of</span><span
  5118. class="cmtt-8">&#x00A0;16</span><span
  5119. class="cmtt-8">&#x00A0;bits</span>
  5120. <br class="fancyvrb" /><a
  5121. id="x1-92008r4"></a><span
  5122. class="cmr-6">4</span><span
  5123. class="cmtt-8">&#x00A0;</span><span
  5124. class="cmtt-8">&#x00A0;</span><span
  5125. class="cmtt-8">&#x00A0;</span><span
  5126. class="cmtt-8">&#x00A0;4)</span><span
  5127. class="cmtt-8">&#x00A0;[floor0_amplitude_bits]</span><span
  5128. class="cmtt-8">&#x00A0;=</span><span
  5129. class="cmtt-8">&#x00A0;read</span><span
  5130. class="cmtt-8">&#x00A0;an</span><span
  5131. class="cmtt-8">&#x00A0;unsigned</span><span
  5132. class="cmtt-8">&#x00A0;integer</span><span
  5133. class="cmtt-8">&#x00A0;of</span><span
  5134. class="cmtt-8">&#x00A0;six</span><span
  5135. class="cmtt-8">&#x00A0;bits</span>
  5136. <br class="fancyvrb" /><a
  5137. id="x1-92010r5"></a><span
  5138. class="cmr-6">5</span><span
  5139. class="cmtt-8">&#x00A0;</span><span
  5140. class="cmtt-8">&#x00A0;</span><span
  5141. class="cmtt-8">&#x00A0;</span><span
  5142. class="cmtt-8">&#x00A0;5)</span><span
  5143. class="cmtt-8">&#x00A0;[floor0_amplitude_offset]</span><span
  5144. class="cmtt-8">&#x00A0;=</span><span
  5145. class="cmtt-8">&#x00A0;read</span><span
  5146. class="cmtt-8">&#x00A0;an</span><span
  5147. class="cmtt-8">&#x00A0;unsigned</span><span
  5148. class="cmtt-8">&#x00A0;integer</span><span
  5149. class="cmtt-8">&#x00A0;of</span><span
  5150. class="cmtt-8">&#x00A0;eight</span><span
  5151. class="cmtt-8">&#x00A0;bits</span>
  5152. <br class="fancyvrb" /><a
  5153. id="x1-92012r6"></a><span
  5154. class="cmr-6">6</span><span
  5155. class="cmtt-8">&#x00A0;</span><span
  5156. class="cmtt-8">&#x00A0;</span><span
  5157. class="cmtt-8">&#x00A0;</span><span
  5158. class="cmtt-8">&#x00A0;6)</span><span
  5159. class="cmtt-8">&#x00A0;[floor0_number_of_books]</span><span
  5160. class="cmtt-8">&#x00A0;=</span><span
  5161. class="cmtt-8">&#x00A0;read</span><span
  5162. class="cmtt-8">&#x00A0;an</span><span
  5163. class="cmtt-8">&#x00A0;unsigned</span><span
  5164. class="cmtt-8">&#x00A0;integer</span><span
  5165. class="cmtt-8">&#x00A0;of</span><span
  5166. class="cmtt-8">&#x00A0;four</span><span
  5167. class="cmtt-8">&#x00A0;bits</span><span
  5168. class="cmtt-8">&#x00A0;and</span><span
  5169. class="cmtt-8">&#x00A0;add</span><span
  5170. class="cmtt-8">&#x00A0;1</span>
  5171. <br class="fancyvrb" /><a
  5172. id="x1-92014r7"></a><span
  5173. class="cmr-6">7</span><span
  5174. class="cmtt-8">&#x00A0;</span><span
  5175. class="cmtt-8">&#x00A0;</span><span
  5176. class="cmtt-8">&#x00A0;</span><span
  5177. class="cmtt-8">&#x00A0;7)</span><span
  5178. class="cmtt-8">&#x00A0;array</span><span
  5179. class="cmtt-8">&#x00A0;[floor0_book_list]</span><span
  5180. class="cmtt-8">&#x00A0;=</span><span
  5181. class="cmtt-8">&#x00A0;read</span><span
  5182. class="cmtt-8">&#x00A0;a</span><span
  5183. class="cmtt-8">&#x00A0;list</span><span
  5184. class="cmtt-8">&#x00A0;of</span><span
  5185. class="cmtt-8">&#x00A0;[floor0_number_of_books]</span><span
  5186. class="cmtt-8">&#x00A0;unsigned</span><span
  5187. class="cmtt-8">&#x00A0;integers</span><span
  5188. class="cmtt-8">&#x00A0;of</span><span
  5189. class="cmtt-8">&#x00A0;eight</span><span
  5190. class="cmtt-8">&#x00A0;bits</span><span
  5191. class="cmtt-8">&#x00A0;each;</span>
  5192. </div>
  5193. <!--l. 40--><p class="noindent" >An end-of-packet condition during any of these bitstream reads renders this stream undecodable.
  5194. In addition, any element of the array <span
  5195. class="cmtt-12">[floor0_book_list] </span>that is greater than the maximum
  5196. codebook number for this bitstream is an error condition that also renders the stream
  5197. undecodable.
  5198. <!--l. 48--><p class="noindent" >
  5199. <h5 class="subsubsectionHead"><span class="titlemark">6.2.2 </span> <a
  5200. id="x1-930006.2.2"></a>packet decode</h5>
  5201. <!--l. 50--><p class="noindent" >Extracting a floor0 curve from an audio packet consists of first decoding the curve
  5202. amplitude and <span
  5203. class="cmtt-12">[floor0_order] </span>LSP coefficient values from the bitstream, and then
  5204. computing the floor curve, which is defined as the frequency response of the decoded LSP
  5205. filter.
  5206. <!--l. 56--><p class="noindent" >Packet decode proceeds as follows:
  5207. <div class="fancyvrb" id="fancyvrb27">
  5208. <a
  5209. id="x1-93002r1"></a><span
  5210. class="cmr-6">1</span><span
  5211. class="cmtt-8">&#x00A0;</span><span
  5212. class="cmtt-8">&#x00A0;</span><span
  5213. class="cmtt-8">&#x00A0;</span><span
  5214. class="cmtt-8">&#x00A0;1)</span><span
  5215. class="cmtt-8">&#x00A0;[amplitude]</span><span
  5216. class="cmtt-8">&#x00A0;=</span><span
  5217. class="cmtt-8">&#x00A0;read</span><span
  5218. class="cmtt-8">&#x00A0;an</span><span
  5219. class="cmtt-8">&#x00A0;unsigned</span><span
  5220. class="cmtt-8">&#x00A0;integer</span><span
  5221. class="cmtt-8">&#x00A0;of</span><span
  5222. class="cmtt-8">&#x00A0;[floor0_amplitude_bits]</span><span
  5223. class="cmtt-8">&#x00A0;bits</span>
  5224. <br class="fancyvrb" /><a
  5225. id="x1-93004r2"></a><span
  5226. class="cmr-6">2</span><span
  5227. class="cmtt-8">&#x00A0;</span><span
  5228. class="cmtt-8">&#x00A0;</span><span
  5229. class="cmtt-8">&#x00A0;</span><span
  5230. class="cmtt-8">&#x00A0;2)</span><span
  5231. class="cmtt-8">&#x00A0;if</span><span
  5232. class="cmtt-8">&#x00A0;(</span><span
  5233. class="cmtt-8">&#x00A0;[amplitude]</span><span
  5234. class="cmtt-8">&#x00A0;is</span><span
  5235. class="cmtt-8">&#x00A0;greater</span><span
  5236. class="cmtt-8">&#x00A0;than</span><span
  5237. class="cmtt-8">&#x00A0;zero</span><span
  5238. class="cmtt-8">&#x00A0;)</span><span
  5239. class="cmtt-8">&#x00A0;</span><span
  5240. class="cmsy-8">{</span>
  5241. <br class="fancyvrb" /><a
  5242. id="x1-93006r3"></a><span
  5243. class="cmr-6">3</span><span
  5244. class="cmtt-8">&#x00A0;</span><span
  5245. class="cmtt-8">&#x00A0;</span><span
  5246. class="cmtt-8">&#x00A0;</span><span
  5247. class="cmtt-8">&#x00A0;</span><span
  5248. class="cmtt-8">&#x00A0;</span><span
  5249. class="cmtt-8">&#x00A0;</span><span
  5250. class="cmtt-8">&#x00A0;</span><span
  5251. class="cmtt-8">&#x00A0;</span><span
  5252. class="cmtt-8">&#x00A0;3)</span><span
  5253. class="cmtt-8">&#x00A0;[coefficients]</span><span
  5254. class="cmtt-8">&#x00A0;is</span><span
  5255. class="cmtt-8">&#x00A0;an</span><span
  5256. class="cmtt-8">&#x00A0;empty,</span><span
  5257. class="cmtt-8">&#x00A0;zero</span><span
  5258. class="cmtt-8">&#x00A0;length</span><span
  5259. class="cmtt-8">&#x00A0;vector</span>
  5260. <br class="fancyvrb" /><a
  5261. id="x1-93008r4"></a><span
  5262. class="cmr-6">4</span><span
  5263. class="cmtt-8">&#x00A0;</span><span
  5264. class="cmtt-8">&#x00A0;</span><span
  5265. class="cmtt-8">&#x00A0;</span><span
  5266. class="cmtt-8">&#x00A0;</span><span
  5267. class="cmtt-8">&#x00A0;</span><span
  5268. class="cmtt-8">&#x00A0;</span><span
  5269. class="cmtt-8">&#x00A0;</span><span
  5270. class="cmtt-8">&#x00A0;</span><span
  5271. class="cmtt-8">&#x00A0;4)</span><span
  5272. class="cmtt-8">&#x00A0;[booknumber]</span><span
  5273. class="cmtt-8">&#x00A0;=</span><span
  5274. class="cmtt-8">&#x00A0;read</span><span
  5275. class="cmtt-8">&#x00A0;an</span><span
  5276. class="cmtt-8">&#x00A0;unsigned</span><span
  5277. class="cmtt-8">&#x00A0;integer</span><span
  5278. class="cmtt-8">&#x00A0;of</span><span
  5279. class="cmtt-8">&#x00A0;</span><a
  5280. href="#x1-1170009.2.1"><span
  5281. class="cmtt-8">ilog</span></a><span
  5282. class="cmtt-8">(</span><span
  5283. class="cmtt-8">&#x00A0;[floor0_number_of_books]</span><span
  5284. class="cmtt-8">&#x00A0;)</span><span
  5285. class="cmtt-8">&#x00A0;bits</span>
  5286. <br class="fancyvrb" /><a
  5287. id="x1-93010r5"></a><span
  5288. class="cmr-6">5</span><span
  5289. class="cmtt-8">&#x00A0;</span><span
  5290. class="cmtt-8">&#x00A0;</span><span
  5291. class="cmtt-8">&#x00A0;</span><span
  5292. class="cmtt-8">&#x00A0;</span><span
  5293. class="cmtt-8">&#x00A0;</span><span
  5294. class="cmtt-8">&#x00A0;</span><span
  5295. class="cmtt-8">&#x00A0;</span><span
  5296. class="cmtt-8">&#x00A0;</span><span
  5297. class="cmtt-8">&#x00A0;5)</span><span
  5298. class="cmtt-8">&#x00A0;if</span><span
  5299. class="cmtt-8">&#x00A0;(</span><span
  5300. class="cmtt-8">&#x00A0;[booknumber]</span><span
  5301. class="cmtt-8">&#x00A0;is</span><span
  5302. class="cmtt-8">&#x00A0;greater</span><span
  5303. class="cmtt-8">&#x00A0;than</span><span
  5304. class="cmtt-8">&#x00A0;the</span><span
  5305. class="cmtt-8">&#x00A0;highest</span><span
  5306. class="cmtt-8">&#x00A0;number</span><span
  5307. class="cmtt-8">&#x00A0;decode</span><span
  5308. class="cmtt-8">&#x00A0;codebook</span><span
  5309. class="cmtt-8">&#x00A0;)</span><span
  5310. class="cmtt-8">&#x00A0;then</span><span
  5311. class="cmtt-8">&#x00A0;packet</span><span
  5312. class="cmtt-8">&#x00A0;is</span><span
  5313. class="cmtt-8">&#x00A0;undecodable</span>
  5314. <br class="fancyvrb" /><a
  5315. id="x1-93012r6"></a><span
  5316. class="cmr-6">6</span><span
  5317. class="cmtt-8">&#x00A0;</span><span
  5318. class="cmtt-8">&#x00A0;</span><span
  5319. class="cmtt-8">&#x00A0;</span><span
  5320. class="cmtt-8">&#x00A0;</span><span
  5321. class="cmtt-8">&#x00A0;</span><span
  5322. class="cmtt-8">&#x00A0;</span><span
  5323. class="cmtt-8">&#x00A0;</span><span
  5324. class="cmtt-8">&#x00A0;</span><span
  5325. class="cmtt-8">&#x00A0;6)</span><span
  5326. class="cmtt-8">&#x00A0;[last]</span><span
  5327. class="cmtt-8">&#x00A0;=</span><span
  5328. class="cmtt-8">&#x00A0;zero;</span>
  5329. <br class="fancyvrb" /><a
  5330. id="x1-93014r7"></a><span
  5331. class="cmr-6">7</span><span
  5332. class="cmtt-8">&#x00A0;</span><span
  5333. class="cmtt-8">&#x00A0;</span><span
  5334. class="cmtt-8">&#x00A0;</span><span
  5335. class="cmtt-8">&#x00A0;</span><span
  5336. class="cmtt-8">&#x00A0;</span><span
  5337. class="cmtt-8">&#x00A0;</span><span
  5338. class="cmtt-8">&#x00A0;</span><span
  5339. class="cmtt-8">&#x00A0;</span><span
  5340. class="cmtt-8">&#x00A0;7)</span><span
  5341. class="cmtt-8">&#x00A0;vector</span><span
  5342. class="cmtt-8">&#x00A0;[temp_vector]</span><span
  5343. class="cmtt-8">&#x00A0;=</span><span
  5344. class="cmtt-8">&#x00A0;read</span><span
  5345. class="cmtt-8">&#x00A0;vector</span><span
  5346. class="cmtt-8">&#x00A0;from</span><span
  5347. class="cmtt-8">&#x00A0;bitstream</span><span
  5348. class="cmtt-8">&#x00A0;using</span><span
  5349. class="cmtt-8">&#x00A0;codebook</span><span
  5350. class="cmtt-8">&#x00A0;number</span><span
  5351. class="cmtt-8">&#x00A0;[floor0_book_list]</span><span
  5352. class="cmtt-8">&#x00A0;element</span><span
  5353. class="cmtt-8">&#x00A0;[booknumber]</span><span
  5354. class="cmtt-8">&#x00A0;in</span><span
  5355. class="cmtt-8">&#x00A0;VQ</span><span
  5356. class="cmtt-8">&#x00A0;context.</span>
  5357. <br class="fancyvrb" /><a
  5358. id="x1-93016r8"></a><span
  5359. class="cmr-6">8</span><span
  5360. class="cmtt-8">&#x00A0;</span><span
  5361. class="cmtt-8">&#x00A0;</span><span
  5362. class="cmtt-8">&#x00A0;</span><span
  5363. class="cmtt-8">&#x00A0;</span><span
  5364. class="cmtt-8">&#x00A0;</span><span
  5365. class="cmtt-8">&#x00A0;</span><span
  5366. class="cmtt-8">&#x00A0;</span><span
  5367. class="cmtt-8">&#x00A0;</span><span
  5368. class="cmtt-8">&#x00A0;8)</span><span
  5369. class="cmtt-8">&#x00A0;add</span><span
  5370. class="cmtt-8">&#x00A0;the</span><span
  5371. class="cmtt-8">&#x00A0;scalar</span><span
  5372. class="cmtt-8">&#x00A0;value</span><span
  5373. class="cmtt-8">&#x00A0;[last]</span><span
  5374. class="cmtt-8">&#x00A0;to</span><span
  5375. class="cmtt-8">&#x00A0;each</span><span
  5376. class="cmtt-8">&#x00A0;scalar</span><span
  5377. class="cmtt-8">&#x00A0;in</span><span
  5378. class="cmtt-8">&#x00A0;vector</span><span
  5379. class="cmtt-8">&#x00A0;[temp_vector]</span>
  5380. <br class="fancyvrb" /><a
  5381. id="x1-93018r9"></a><span
  5382. class="cmr-6">9</span><span
  5383. class="cmtt-8">&#x00A0;</span><span
  5384. class="cmtt-8">&#x00A0;</span><span
  5385. class="cmtt-8">&#x00A0;</span><span
  5386. class="cmtt-8">&#x00A0;</span><span
  5387. class="cmtt-8">&#x00A0;</span><span
  5388. class="cmtt-8">&#x00A0;</span><span
  5389. class="cmtt-8">&#x00A0;</span><span
  5390. class="cmtt-8">&#x00A0;</span><span
  5391. class="cmtt-8">&#x00A0;9)</span><span
  5392. class="cmtt-8">&#x00A0;[last]</span><span
  5393. class="cmtt-8">&#x00A0;=</span><span
  5394. class="cmtt-8">&#x00A0;the</span><span
  5395. class="cmtt-8">&#x00A0;value</span><span
  5396. class="cmtt-8">&#x00A0;of</span><span
  5397. class="cmtt-8">&#x00A0;the</span><span
  5398. class="cmtt-8">&#x00A0;last</span><span
  5399. class="cmtt-8">&#x00A0;scalar</span><span
  5400. class="cmtt-8">&#x00A0;in</span><span
  5401. class="cmtt-8">&#x00A0;vector</span><span
  5402. class="cmtt-8">&#x00A0;[temp_vector]</span>
  5403. <br class="fancyvrb" /><a
  5404. id="x1-93020r10"></a><span
  5405. class="cmr-6">10</span><span
  5406. class="cmtt-8">&#x00A0;</span><span
  5407. class="cmtt-8">&#x00A0;</span><span
  5408. class="cmtt-8">&#x00A0;</span><span
  5409. class="cmtt-8">&#x00A0;</span><span
  5410. class="cmtt-8">&#x00A0;</span><span
  5411. class="cmtt-8">&#x00A0;</span><span
  5412. class="cmtt-8">&#x00A0;</span><span
  5413. class="cmtt-8">&#x00A0;10)</span><span
  5414. class="cmtt-8">&#x00A0;concatenate</span><span
  5415. class="cmtt-8">&#x00A0;[temp_vector]</span><span
  5416. class="cmtt-8">&#x00A0;onto</span><span
  5417. class="cmtt-8">&#x00A0;the</span><span
  5418. class="cmtt-8">&#x00A0;end</span><span
  5419. class="cmtt-8">&#x00A0;of</span><span
  5420. class="cmtt-8">&#x00A0;the</span><span
  5421. class="cmtt-8">&#x00A0;[coefficients]</span><span
  5422. class="cmtt-8">&#x00A0;vector</span>
  5423. <br class="fancyvrb" /><a
  5424. id="x1-93022r11"></a><span
  5425. class="cmr-6">11</span><span
  5426. class="cmtt-8">&#x00A0;</span><span
  5427. class="cmtt-8">&#x00A0;</span><span
  5428. class="cmtt-8">&#x00A0;</span><span
  5429. class="cmtt-8">&#x00A0;</span><span
  5430. class="cmtt-8">&#x00A0;</span><span
  5431. class="cmtt-8">&#x00A0;</span><span
  5432. class="cmtt-8">&#x00A0;</span><span
  5433. class="cmtt-8">&#x00A0;11)</span><span
  5434. class="cmtt-8">&#x00A0;if</span><span
  5435. class="cmtt-8">&#x00A0;(length</span><span
  5436. class="cmtt-8">&#x00A0;of</span><span
  5437. class="cmtt-8">&#x00A0;vector</span><span
  5438. class="cmtt-8">&#x00A0;[coefficients]</span><span
  5439. class="cmtt-8">&#x00A0;is</span><span
  5440. class="cmtt-8">&#x00A0;less</span><span
  5441. class="cmtt-8">&#x00A0;than</span><span
  5442. class="cmtt-8">&#x00A0;[floor0_order],</span><span
  5443. class="cmtt-8">&#x00A0;continue</span><span
  5444. class="cmtt-8">&#x00A0;at</span><span
  5445. class="cmtt-8">&#x00A0;step</span><span
  5446. class="cmtt-8">&#x00A0;6</span>
  5447. <br class="fancyvrb" /><a
  5448. id="x1-93024r12"></a><span
  5449. class="cmr-6">12</span><span
  5450. class="cmtt-8">&#x00A0;</span><span
  5451. class="cmtt-8">&#x00A0;</span>
  5452. <br class="fancyvrb" /><a
  5453. id="x1-93026r13"></a><span
  5454. class="cmr-6">13</span><span
  5455. class="cmtt-8">&#x00A0;</span><span
  5456. class="cmtt-8">&#x00A0;</span><span
  5457. class="cmtt-8">&#x00A0;</span><span
  5458. class="cmtt-8">&#x00A0;</span><span
  5459. class="cmtt-8">&#x00A0;</span><span
  5460. class="cmtt-8">&#x00A0;</span><span
  5461. class="cmtt-8">&#x00A0;</span><span
  5462. class="cmsy-8">}</span>
  5463. <br class="fancyvrb" /><a
  5464. id="x1-93028r14"></a><span
  5465. class="cmr-6">14</span><span
  5466. class="cmtt-8">&#x00A0;</span><span
  5467. class="cmtt-8">&#x00A0;</span>
  5468. <br class="fancyvrb" /><a
  5469. id="x1-93030r15"></a><span
  5470. class="cmr-6">15</span><span
  5471. class="cmtt-8">&#x00A0;</span><span
  5472. class="cmtt-8">&#x00A0;</span><span
  5473. class="cmtt-8">&#x00A0;12)</span><span
  5474. class="cmtt-8">&#x00A0;done.</span>
  5475. <br class="fancyvrb" /><a
  5476. id="x1-93032r16"></a><span
  5477. class="cmr-6">16</span><span
  5478. class="cmtt-8">&#x00A0;</span><span
  5479. class="cmtt-8">&#x00A0;</span>
  5480. </div>
  5481. <!--l. 76--><p class="noindent" >Take note of the following properties of decode:
  5482. <ul class="itemize1">
  5483. <li class="itemize">An <span
  5484. class="cmtt-12">[amplitude] </span>value of zero must result in a return code that indicates this channel
  5485. is unused in this frame (the output of the channel will be all-zeroes in synthesis).
  5486. Several later stages of decode don&#8217;t occur for an unused channel.
  5487. </li>
  5488. <li class="itemize">An end-of-packet condition during decode should be considered a nominal occruence;
  5489. if end-of-packet is reached during any read operation above, floor decode is to return
  5490. &#8217;unused&#8217; status as if the <span
  5491. class="cmtt-12">[amplitude] </span>value had read zero at the beginning of decode.
  5492. </li>
  5493. <li class="itemize">The book number used for decode can, in fact, be stored in the bitstream in <a
  5494. href="#x1-1170009.2.1">ilog</a>(
  5495. <span
  5496. class="cmtt-12">[floor0_number_of_books] </span>- 1 ) bits. Nevertheless, the above specification is correct
  5497. and values greater than the maximum possible book value are reserved.
  5498. </li>
  5499. <li class="itemize">The number of scalars read into the vector <span
  5500. class="cmtt-12">[coefficients] </span>may be greater
  5501. than <span
  5502. class="cmtt-12">[floor0_order]</span>, the number actually required for curve computation. For
  5503. example, if the VQ codebook used for the floor currently being decoded has a
  5504. <span
  5505. class="cmtt-12">[codebook_dimensions] </span>value of three and <span
  5506. class="cmtt-12">[floor0_order] </span>is ten, the only way to
  5507. fill all the needed scalars in <span
  5508. class="cmtt-12">[coefficients] </span>is to to read a total of twelve scalars
  5509. as four vectors of three scalars each. This is not an error condition, and care must
  5510. be taken not to allow a buffer overflow in decode. The extra values are not used and
  5511. may be ignored or discarded.</li></ul>
  5512. <!--l. 104--><p class="noindent" >
  5513. <h5 class="subsubsectionHead"><span class="titlemark">6.2.3 </span> <a
  5514. id="x1-940006.2.3"></a>curve computation</h5>
  5515. <!--l. 106--><p class="noindent" >Given an <span
  5516. class="cmtt-12">[amplitude] </span>integer and <span
  5517. class="cmtt-12">[coefficients] </span>vector from packet decode as well
  5518. as the [floor0&#x02D9;order], [floor0&#x02D9;rate], [floor0&#x02D9;bark&#x02D9;map&#x02D9;size], [floor0&#x02D9;amplitude&#x02D9;bits] and
  5519. [floor0&#x02D9;amplitude&#x02D9;offset] values from floor setup, and an output vector size <span
  5520. class="cmtt-12">[n] </span>specified by the
  5521. decode process, we compute a floor output vector.
  5522. <!--l. 113--><p class="noindent" >If the value <span
  5523. class="cmtt-12">[amplitude] </span>is zero, the return value is a length <span
  5524. class="cmtt-12">[n] </span>vector with all-zero
  5525. scalars. Otherwise, begin by assuming the following definitions for the given vector to be
  5526. synthesized:
  5527. <center class="par-math-display" >
  5528. <img
  5529. src="Vorbis_I_spec7x.png" alt=" {
  5530. min (floor0xbarkxmapxsize - 1,f oobar) for i &#x2208; [0, n - 1]
  5531. mapi = - 1 for i = n
  5532. " class="par-math-display" ></center>
  5533. <!--l. 128--><p class="nopar" >
  5534. <!--l. 130--><p class="noindent" >where
  5535. <center class="par-math-display" >
  5536. <img
  5537. src="Vorbis_I_spec8x.png" alt=" &#x230A; &#x230B;
  5538. (floor0xrate &#x22C5; i) floor0xbarkxmapxsize
  5539. foobar = bark -------2n------- &#x22C5;-bark(.5 &#x22C5;-floor0xrate-)
  5540. " class="par-math-display" ></center>
  5541. <!--l. 137--><p class="nopar" >
  5542. <!--l. 139--><p class="noindent" >and
  5543. <center class="par-math-display" >
  5544. <img
  5545. src="Vorbis_I_spec9x.png" alt=" 2
  5546. bark(x) = 13.1arctan (.00074x ) + 2.24 arctan(.0000000185x + .0001x )
  5547. " class="par-math-display" ></center>
  5548. <!--l. 143--><p class="nopar" >
  5549. <!--l. 145--><p class="noindent" >The above is used to synthesize the LSP curve on a Bark-scale frequency axis, then map the
  5550. result to a linear-scale frequency axis. Similarly, the below calculation synthesizes the output
  5551. LSP curve <span
  5552. class="cmtt-12">[output] </span>on a log (dB) amplitude scale, mapping it to linear amplitude in the last
  5553. step:
  5554. <!--l. 150--><p class="noindent" >
  5555. <ol class="enumerate1" >
  5556. <li
  5557. class="enumerate" id="x1-94002x1"><span
  5558. class="cmtt-12">[i] </span>= 0
  5559. </li>
  5560. <li
  5561. class="enumerate" id="x1-94004x2"><span
  5562. class="cmtt-12">[</span><span
  5563. class="cmmi-12">&#x03C9;</span><span
  5564. class="cmtt-12">] </span>= <span
  5565. class="cmmi-12">&#x03C0; </span>* map element <span
  5566. class="cmtt-12">[i] </span>/ <span
  5567. class="cmtt-12">[floor0_bark_map_size]</span>
  5568. </li>
  5569. <li
  5570. class="enumerate" id="x1-94006x3">if ( <span
  5571. class="cmtt-12">[floor0_order] </span>is odd )
  5572. <ol class="enumerate2" >
  5573. <li
  5574. class="enumerate" id="x1-94008x1">calculate <span
  5575. class="cmtt-12">[p] </span>and <span
  5576. class="cmtt-12">[q] </span>according to: <div class="eqnarray">
  5577. <center class="math-display" >
  5578. <img
  5579. src="Vorbis_I_spec10x.png" alt=" floor0xorder-3
  5580. 2 &#x220F;2 2
  5581. p = (1 - cos &#x03C9;) 4(cos([coefficients ]2j+1) - cos&#x03C9; )
  5582. j=0
  5583. floor0x&#x220F;or2der-1
  5584. q = 1- 4(cos([coefficients ]2j) - cos&#x03C9; )2
  5585. 4 j=0
  5586. " class="math-display" ></center>
  5587. </div>
  5588. </li></ol>
  5589. <!--l. 162--><p class="noindent" >else <span
  5590. class="cmtt-12">[floor0_order] </span>is even
  5591. <ol class="enumerate2" >
  5592. <li
  5593. class="enumerate" id="x1-94011x1">calculate <span
  5594. class="cmtt-12">[p] </span>and <span
  5595. class="cmtt-12">[q] </span>according to: <div class="eqnarray">
  5596. <center class="math-display" >
  5597. <img
  5598. src="Vorbis_I_spec11x.png" alt=" floor0xorder-2
  5599. (1 - cos2&#x03C9;) &#x220F;2 2
  5600. p = -----2------ 4(cos([coefficients ]2j+1) - cos&#x03C9; )
  5601. j=0
  5602. 2 floor0xor2der-2
  5603. q = (1 +-cos-&#x03C9;)- &#x220F; 4(cos([coefficients ] ) - cos&#x03C9; )2
  5604. 2 j=0 2j
  5605. " class="math-display" ></center>
  5606. </div>
  5607. </li></ol>
  5608. </li>
  5609. <li
  5610. class="enumerate" id="x1-94014x4">calculate <span
  5611. class="cmtt-12">[linear_floor_value] </span>according to:
  5612. <center class="math-display" >
  5613. <img
  5614. src="Vorbis_I_spec12x.png" alt=" ( ( ))
  5615. amplitude---&#x22C5; floor0xamplitutexoffset---
  5616. exp .11512925 (2floor0xamplitudexbits - 1)&#x221A; p + q - floor0xamplitudexoffset
  5617. " class="math-display" ></center>
  5618. <!--l. 177--><p class="nopar" >
  5619. </li>
  5620. <li
  5621. class="enumerate" id="x1-94016x5"><span
  5622. class="cmtt-12">[iteration_condition] </span>= map element <span
  5623. class="cmtt-12">[i]</span>
  5624. </li>
  5625. <li
  5626. class="enumerate" id="x1-94018x6"><span
  5627. class="cmtt-12">[output] </span>element <span
  5628. class="cmtt-12">[i] </span>= <span
  5629. class="cmtt-12">[linear_floor_value]</span>
  5630. </li>
  5631. <li
  5632. class="enumerate" id="x1-94020x7">increment <span
  5633. class="cmtt-12">[i]</span>
  5634. </li>
  5635. <li
  5636. class="enumerate" id="x1-94022x8">if ( map element <span
  5637. class="cmtt-12">[i] </span>is equal to <span
  5638. class="cmtt-12">[iteration_condition] </span>) continue at step
  5639. 5
  5640. </li>
  5641. <li
  5642. class="enumerate" id="x1-94024x9">if ( <span
  5643. class="cmtt-12">[i] </span>is less than <span
  5644. class="cmtt-12">[n] </span>) continue at step 2
  5645. </li>
  5646. <li
  5647. class="enumerate" id="x1-94026x10">done</li></ol>
  5648. <h3 class="sectionHead"><span class="titlemark">7 </span> <a
  5649. id="x1-950007"></a>Floor type 1 setup and decode</h3>
  5650. <!--l. 6--><p class="noindent" >
  5651. <h4 class="subsectionHead"><span class="titlemark">7.1 </span> <a
  5652. id="x1-960007.1"></a>Overview</h4>
  5653. <!--l. 8--><p class="noindent" >Vorbis floor type one uses a piecewise straight-line representation to encode a spectral envelope
  5654. curve. The representation plots this curve mechanically on a linear frequency axis and a
  5655. logarithmic (dB) amplitude axis. The integer plotting algorithm used is similar to Bresenham&#8217;s
  5656. algorithm.
  5657. <!--l. 16--><p class="noindent" >
  5658. <h4 class="subsectionHead"><span class="titlemark">7.2 </span> <a
  5659. id="x1-970007.2"></a>Floor 1 format</h4>
  5660. <!--l. 18--><p class="noindent" >
  5661. <h5 class="subsubsectionHead"><span class="titlemark">7.2.1 </span> <a
  5662. id="x1-980007.2.1"></a>model</h5>
  5663. <!--l. 20--><p class="noindent" >Floor type one represents a spectral curve as a series of line segments. Synthesis constructs a
  5664. floor curve using iterative prediction in a process roughly equivalent to the following simplified
  5665. description:
  5666. <ul class="itemize1">
  5667. <li class="itemize">the first line segment (base case) is a logical line spanning from x&#x02D9;0,y&#x02D9;0 to x&#x02D9;1,y&#x02D9;1
  5668. where in the base case x&#x02D9;0=0 and x&#x02D9;1=[n], the full range of the spectral floor to be
  5669. computed.
  5670. </li>
  5671. <li class="itemize">the induction step chooses a point x&#x02D9;new within an existing logical line segment and
  5672. produces a y&#x02D9;new value at that point computed from the existing line&#8217;s y value at
  5673. x&#x02D9;new (as plotted by the line) and a difference value decoded from the bitstream
  5674. packet.
  5675. </li>
  5676. <li class="itemize">floor computation produces two new line segments, one running from x&#x02D9;0,y&#x02D9;0 to
  5677. x&#x02D9;new,y&#x02D9;new and from x&#x02D9;new,y&#x02D9;new to x&#x02D9;1,y&#x02D9;1. This step is performed logically even if
  5678. y&#x02D9;new represents no change to the amplitude value at x&#x02D9;new so that later refinement
  5679. is additionally bounded at x&#x02D9;new.
  5680. </li>
  5681. <li class="itemize">the induction step repeats, using a list of x values specified in the codec setup header
  5682. at floor 1 initialization time. Computation is completed at the end of the x value list.
  5683. </li></ul>
  5684. <!--l. 48--><p class="noindent" >Consider the following example, with values chosen for ease of understanding rather than
  5685. representing typical configuration:
  5686. <!--l. 51--><p class="noindent" >For the below example, we assume a floor setup with an [n] of 128. The list of selected X values
  5687. in increasing order is 0,16,32,48,64,80,96,112 and 128. In list order, the values interleave as 0,
  5688. 128, 64, 32, 96, 16, 48, 80 and 112. The corresponding list-order Y values as decoded from an
  5689. example packet are 110, 20, -5, -45, 0, -25, -10, 30 and -10. We compute the floor in the following
  5690. way, beginning with the first line:
  5691. <div class="center"
  5692. >
  5693. <!--l. 59--><p class="noindent" >
  5694. <!--l. 60--><p class="noindent" ><img
  5695. src="floor1-1.png" alt="PIC"
  5696. >
  5697. <br /> <table class="caption"
  5698. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;7: </td><td
  5699. class="content">graph of example floor</td></tr></table><!--tex4ht:label?: x1-980017 -->
  5700. </div>
  5701. <!--l. 64--><p class="noindent" >We now draw new logical lines to reflect the correction to new&#x02D9;Y, and iterate for X positions 32
  5702. and 96:
  5703. <div class="center"
  5704. >
  5705. <!--l. 67--><p class="noindent" >
  5706. <!--l. 68--><p class="noindent" ><img
  5707. src="floor1-2.png" alt="PIC"
  5708. >
  5709. <br /> <table class="caption"
  5710. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;8: </td><td
  5711. class="content">graph of example floor</td></tr></table><!--tex4ht:label?: x1-980028 -->
  5712. </div>
  5713. <!--l. 72--><p class="noindent" >Although the new Y value at X position 96 is unchanged, it is still used later as an endpoint for
  5714. further refinement. From here on, the pattern should be clear; we complete the floor computation
  5715. as follows:
  5716. <div class="center"
  5717. >
  5718. <!--l. 76--><p class="noindent" >
  5719. <!--l. 77--><p class="noindent" ><img
  5720. src="floor1-3.png" alt="PIC"
  5721. >
  5722. <br /> <table class="caption"
  5723. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;9: </td><td
  5724. class="content">graph of example floor</td></tr></table><!--tex4ht:label?: x1-980039 -->
  5725. </div>
  5726. <div class="center"
  5727. >
  5728. <!--l. 81--><p class="noindent" >
  5729. <!--l. 82--><p class="noindent" ><img
  5730. src="floor1-4.png" alt="PIC"
  5731. >
  5732. <br /> <table class="caption"
  5733. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;10: </td><td
  5734. class="content">graph of example floor</td></tr></table><!--tex4ht:label?: x1-9800410 -->
  5735. </div>
  5736. <!--l. 86--><p class="noindent" >A more efficient algorithm with carefully defined integer rounding behavior is used for actual
  5737. decode, as described later. The actual algorithm splits Y value computation and line plotting
  5738. into two steps with modifications to the above algorithm to eliminate noise accumulation
  5739. through integer roundoff/truncation.
  5740. <!--l. 94--><p class="noindent" >
  5741. <h5 class="subsubsectionHead"><span class="titlemark">7.2.2 </span> <a
  5742. id="x1-990007.2.2"></a>header decode</h5>
  5743. <!--l. 96--><p class="noindent" >A list of floor X values is stored in the packet header in interleaved format (used in list order
  5744. during packet decode and synthesis). This list is split into partitions, and each partition is
  5745. assigned to a partition class. X positions 0 and [n] are implicit and do not belong to an explicit
  5746. partition or partition class.
  5747. <!--l. 102--><p class="noindent" >A partition class consists of a representation vector width (the number of Y values which
  5748. the partition class encodes at once), a &#8217;subclass&#8217; value representing the number of
  5749. alternate entropy books the partition class may use in representing Y values, the list of
  5750. [subclass] books and a master book used to encode which alternate books were chosen
  5751. for representation in a given packet. The master/subclass mechanism is meant to be
  5752. used as a flexible representation cascade while still using codebooks only in a scalar
  5753. context.
  5754. <!--l. 112--><p class="noindent" >
  5755. <div class="fancyvrb" id="fancyvrb28">
  5756. <a
  5757. id="x1-99002r1"></a><span
  5758. class="cmr-6">1</span><span
  5759. class="cmtt-8">&#x00A0;</span><span
  5760. class="cmtt-8">&#x00A0;</span>
  5761. <br class="fancyvrb" /><a
  5762. id="x1-99004r2"></a><span
  5763. class="cmr-6">2</span><span
  5764. class="cmtt-8">&#x00A0;</span><span
  5765. class="cmtt-8">&#x00A0;</span><span
  5766. class="cmtt-8">&#x00A0;</span><span
  5767. class="cmtt-8">&#x00A0;1)</span><span
  5768. class="cmtt-8">&#x00A0;[floor1_partitions]</span><span
  5769. class="cmtt-8">&#x00A0;=</span><span
  5770. class="cmtt-8">&#x00A0;read</span><span
  5771. class="cmtt-8">&#x00A0;5</span><span
  5772. class="cmtt-8">&#x00A0;bits</span><span
  5773. class="cmtt-8">&#x00A0;as</span><span
  5774. class="cmtt-8">&#x00A0;unsigned</span><span
  5775. class="cmtt-8">&#x00A0;integer</span>
  5776. <br class="fancyvrb" /><a
  5777. id="x1-99006r3"></a><span
  5778. class="cmr-6">3</span><span
  5779. class="cmtt-8">&#x00A0;</span><span
  5780. class="cmtt-8">&#x00A0;</span><span
  5781. class="cmtt-8">&#x00A0;</span><span
  5782. class="cmtt-8">&#x00A0;2)</span><span
  5783. class="cmtt-8">&#x00A0;[maximum_class]</span><span
  5784. class="cmtt-8">&#x00A0;=</span><span
  5785. class="cmtt-8">&#x00A0;-1</span>
  5786. <br class="fancyvrb" /><a
  5787. id="x1-99008r4"></a><span
  5788. class="cmr-6">4</span><span
  5789. class="cmtt-8">&#x00A0;</span><span
  5790. class="cmtt-8">&#x00A0;</span><span
  5791. class="cmtt-8">&#x00A0;</span><span
  5792. class="cmtt-8">&#x00A0;3)</span><span
  5793. class="cmtt-8">&#x00A0;iterate</span><span
  5794. class="cmtt-8">&#x00A0;[i]</span><span
  5795. class="cmtt-8">&#x00A0;over</span><span
  5796. class="cmtt-8">&#x00A0;the</span><span
  5797. class="cmtt-8">&#x00A0;range</span><span
  5798. class="cmtt-8">&#x00A0;0</span><span
  5799. class="cmtt-8">&#x00A0;...</span><span
  5800. class="cmtt-8">&#x00A0;[floor1_partitions]-1</span><span
  5801. class="cmtt-8">&#x00A0;</span><span
  5802. class="cmsy-8">{</span>
  5803. <br class="fancyvrb" /><a
  5804. id="x1-99010r5"></a><span
  5805. class="cmr-6">5</span><span
  5806. class="cmtt-8">&#x00A0;</span><span
  5807. class="cmtt-8">&#x00A0;</span>
  5808. <br class="fancyvrb" /><a
  5809. id="x1-99012r6"></a><span
  5810. class="cmr-6">6</span><span
  5811. class="cmtt-8">&#x00A0;</span><span
  5812. class="cmtt-8">&#x00A0;</span><span
  5813. class="cmtt-8">&#x00A0;</span><span
  5814. class="cmtt-8">&#x00A0;</span><span
  5815. class="cmtt-8">&#x00A0;</span><span
  5816. class="cmtt-8">&#x00A0;</span><span
  5817. class="cmtt-8">&#x00A0;</span><span
  5818. class="cmtt-8">&#x00A0;</span><span
  5819. class="cmtt-8">&#x00A0;</span><span
  5820. class="cmtt-8">&#x00A0;4)</span><span
  5821. class="cmtt-8">&#x00A0;vector</span><span
  5822. class="cmtt-8">&#x00A0;[floor1_partition_class_list]</span><span
  5823. class="cmtt-8">&#x00A0;element</span><span
  5824. class="cmtt-8">&#x00A0;[i]</span><span
  5825. class="cmtt-8">&#x00A0;=</span><span
  5826. class="cmtt-8">&#x00A0;read</span><span
  5827. class="cmtt-8">&#x00A0;4</span><span
  5828. class="cmtt-8">&#x00A0;bits</span><span
  5829. class="cmtt-8">&#x00A0;as</span><span
  5830. class="cmtt-8">&#x00A0;unsigned</span><span
  5831. class="cmtt-8">&#x00A0;integer</span>
  5832. <br class="fancyvrb" /><a
  5833. id="x1-99014r7"></a><span
  5834. class="cmr-6">7</span><span
  5835. class="cmtt-8">&#x00A0;</span><span
  5836. class="cmtt-8">&#x00A0;</span>
  5837. <br class="fancyvrb" /><a
  5838. id="x1-99016r8"></a><span
  5839. class="cmr-6">8</span><span
  5840. class="cmtt-8">&#x00A0;</span><span
  5841. class="cmtt-8">&#x00A0;</span><span
  5842. class="cmtt-8">&#x00A0;</span><span
  5843. class="cmtt-8">&#x00A0;</span><span
  5844. class="cmtt-8">&#x00A0;</span><span
  5845. class="cmtt-8">&#x00A0;</span><span
  5846. class="cmtt-8">&#x00A0;</span><span
  5847. class="cmsy-8">}</span>
  5848. <br class="fancyvrb" /><a
  5849. id="x1-99018r9"></a><span
  5850. class="cmr-6">9</span><span
  5851. class="cmtt-8">&#x00A0;</span><span
  5852. class="cmtt-8">&#x00A0;</span>
  5853. <br class="fancyvrb" /><a
  5854. id="x1-99020r10"></a><span
  5855. class="cmr-6">10</span><span
  5856. class="cmtt-8">&#x00A0;</span><span
  5857. class="cmtt-8">&#x00A0;</span><span
  5858. class="cmtt-8">&#x00A0;</span><span
  5859. class="cmtt-8">&#x00A0;5)</span><span
  5860. class="cmtt-8">&#x00A0;[maximum_class]</span><span
  5861. class="cmtt-8">&#x00A0;=</span><span
  5862. class="cmtt-8">&#x00A0;largest</span><span
  5863. class="cmtt-8">&#x00A0;integer</span><span
  5864. class="cmtt-8">&#x00A0;scalar</span><span
  5865. class="cmtt-8">&#x00A0;value</span><span
  5866. class="cmtt-8">&#x00A0;in</span><span
  5867. class="cmtt-8">&#x00A0;vector</span><span
  5868. class="cmtt-8">&#x00A0;[floor1_partition_class_list]</span>
  5869. <br class="fancyvrb" /><a
  5870. id="x1-99022r11"></a><span
  5871. class="cmr-6">11</span><span
  5872. class="cmtt-8">&#x00A0;</span><span
  5873. class="cmtt-8">&#x00A0;</span><span
  5874. class="cmtt-8">&#x00A0;</span><span
  5875. class="cmtt-8">&#x00A0;6)</span><span
  5876. class="cmtt-8">&#x00A0;iterate</span><span
  5877. class="cmtt-8">&#x00A0;[i]</span><span
  5878. class="cmtt-8">&#x00A0;over</span><span
  5879. class="cmtt-8">&#x00A0;the</span><span
  5880. class="cmtt-8">&#x00A0;range</span><span
  5881. class="cmtt-8">&#x00A0;0</span><span
  5882. class="cmtt-8">&#x00A0;...</span><span
  5883. class="cmtt-8">&#x00A0;[maximum_class]</span><span
  5884. class="cmtt-8">&#x00A0;</span><span
  5885. class="cmsy-8">{</span>
  5886. <br class="fancyvrb" /><a
  5887. id="x1-99024r12"></a><span
  5888. class="cmr-6">12</span><span
  5889. class="cmtt-8">&#x00A0;</span><span
  5890. class="cmtt-8">&#x00A0;</span>
  5891. <br class="fancyvrb" /><a
  5892. id="x1-99026r13"></a><span
  5893. class="cmr-6">13</span><span
  5894. class="cmtt-8">&#x00A0;</span><span
  5895. class="cmtt-8">&#x00A0;</span><span
  5896. class="cmtt-8">&#x00A0;</span><span
  5897. class="cmtt-8">&#x00A0;</span><span
  5898. class="cmtt-8">&#x00A0;</span><span
  5899. class="cmtt-8">&#x00A0;</span><span
  5900. class="cmtt-8">&#x00A0;</span><span
  5901. class="cmtt-8">&#x00A0;</span><span
  5902. class="cmtt-8">&#x00A0;</span><span
  5903. class="cmtt-8">&#x00A0;7)</span><span
  5904. class="cmtt-8">&#x00A0;vector</span><span
  5905. class="cmtt-8">&#x00A0;[floor1_class_dimensions]</span><span
  5906. class="cmtt-8">&#x00A0;element</span><span
  5907. class="cmtt-8">&#x00A0;[i]</span><span
  5908. class="cmtt-8">&#x00A0;=</span><span
  5909. class="cmtt-8">&#x00A0;read</span><span
  5910. class="cmtt-8">&#x00A0;3</span><span
  5911. class="cmtt-8">&#x00A0;bits</span><span
  5912. class="cmtt-8">&#x00A0;as</span><span
  5913. class="cmtt-8">&#x00A0;unsigned</span><span
  5914. class="cmtt-8">&#x00A0;integer</span><span
  5915. class="cmtt-8">&#x00A0;and</span><span
  5916. class="cmtt-8">&#x00A0;add</span><span
  5917. class="cmtt-8">&#x00A0;1</span>
  5918. <br class="fancyvrb" /><a
  5919. id="x1-99028r14"></a><span
  5920. class="cmr-6">14</span><span
  5921. class="cmtt-8">&#x00A0;</span><span
  5922. class="cmtt-8">&#x00A0; 8)</span><span
  5923. class="cmtt-8">&#x00A0;vector</span><span
  5924. class="cmtt-8">&#x00A0;[floor1_class_subclasses]</span><span
  5925. class="cmtt-8">&#x00A0;element</span><span
  5926. class="cmtt-8">&#x00A0;[i]</span><span
  5927. class="cmtt-8">&#x00A0;=</span><span
  5928. class="cmtt-8">&#x00A0;read</span><span
  5929. class="cmtt-8">&#x00A0;2</span><span
  5930. class="cmtt-8">&#x00A0;bits</span><span
  5931. class="cmtt-8">&#x00A0;as</span><span
  5932. class="cmtt-8">&#x00A0;unsigned</span><span
  5933. class="cmtt-8">&#x00A0;integer</span>
  5934. <br class="fancyvrb" /><a
  5935. id="x1-99030r15"></a><span
  5936. class="cmr-6">15</span><span
  5937. class="cmtt-8">&#x00A0;</span><span
  5938. class="cmtt-8">&#x00A0;</span><span
  5939. class="cmtt-8">&#x00A0;</span><span
  5940. class="cmtt-8">&#x00A0;</span><span
  5941. class="cmtt-8">&#x00A0;</span><span
  5942. class="cmtt-8">&#x00A0;</span><span
  5943. class="cmtt-8">&#x00A0;</span><span
  5944. class="cmtt-8">&#x00A0;</span><span
  5945. class="cmtt-8">&#x00A0;</span><span
  5946. class="cmtt-8">&#x00A0;9)</span><span
  5947. class="cmtt-8">&#x00A0;if</span><span
  5948. class="cmtt-8">&#x00A0;(</span><span
  5949. class="cmtt-8">&#x00A0;vector</span><span
  5950. class="cmtt-8">&#x00A0;[floor1_class_subclasses]</span><span
  5951. class="cmtt-8">&#x00A0;element</span><span
  5952. class="cmtt-8">&#x00A0;[i]</span><span
  5953. class="cmtt-8">&#x00A0;is</span><span
  5954. class="cmtt-8">&#x00A0;nonzero</span><span
  5955. class="cmtt-8">&#x00A0;)</span><span
  5956. class="cmtt-8">&#x00A0;</span><span
  5957. class="cmsy-8">{</span>
  5958. <br class="fancyvrb" /><a
  5959. id="x1-99032r16"></a><span
  5960. class="cmr-6">16</span><span
  5961. class="cmtt-8">&#x00A0;</span><span
  5962. class="cmtt-8">&#x00A0;</span>
  5963. <br class="fancyvrb" /><a
  5964. id="x1-99034r17"></a><span
  5965. class="cmr-6">17</span><span
  5966. class="cmtt-8">&#x00A0;</span><span
  5967. class="cmtt-8">&#x00A0;</span><span
  5968. class="cmtt-8">&#x00A0;</span><span
  5969. class="cmtt-8">&#x00A0;</span><span
  5970. class="cmtt-8">&#x00A0;</span><span
  5971. class="cmtt-8">&#x00A0;</span><span
  5972. class="cmtt-8">&#x00A0;</span><span
  5973. class="cmtt-8">&#x00A0;</span><span
  5974. class="cmtt-8">&#x00A0;</span><span
  5975. class="cmtt-8">&#x00A0;</span><span
  5976. class="cmtt-8">&#x00A0;</span><span
  5977. class="cmtt-8">&#x00A0;</span><span
  5978. class="cmtt-8">&#x00A0;</span><span
  5979. class="cmtt-8">&#x00A0;</span><span
  5980. class="cmtt-8">&#x00A0;10)</span><span
  5981. class="cmtt-8">&#x00A0;vector</span><span
  5982. class="cmtt-8">&#x00A0;[floor1_class_masterbooks]</span><span
  5983. class="cmtt-8">&#x00A0;element</span><span
  5984. class="cmtt-8">&#x00A0;[i]</span><span
  5985. class="cmtt-8">&#x00A0;=</span><span
  5986. class="cmtt-8">&#x00A0;read</span><span
  5987. class="cmtt-8">&#x00A0;8</span><span
  5988. class="cmtt-8">&#x00A0;bits</span><span
  5989. class="cmtt-8">&#x00A0;as</span><span
  5990. class="cmtt-8">&#x00A0;unsigned</span><span
  5991. class="cmtt-8">&#x00A0;integer</span>
  5992. <br class="fancyvrb" /><a
  5993. id="x1-99036r18"></a><span
  5994. class="cmr-6">18</span><span
  5995. class="cmtt-8">&#x00A0;</span><span
  5996. class="cmtt-8">&#x00A0;</span>
  5997. <br class="fancyvrb" /><a
  5998. id="x1-99038r19"></a><span
  5999. class="cmr-6">19</span><span
  6000. class="cmtt-8">&#x00A0;</span><span
  6001. class="cmtt-8">&#x00A0;</span><span
  6002. class="cmtt-8">&#x00A0;</span><span
  6003. class="cmtt-8">&#x00A0;</span><span
  6004. class="cmtt-8">&#x00A0;</span><span
  6005. class="cmtt-8">&#x00A0;</span><span
  6006. class="cmtt-8">&#x00A0;</span><span
  6007. class="cmtt-8">&#x00A0;</span><span
  6008. class="cmtt-8">&#x00A0;</span><span
  6009. class="cmtt-8">&#x00A0;</span><span
  6010. class="cmtt-8">&#x00A0;</span><span
  6011. class="cmtt-8">&#x00A0;</span><span
  6012. class="cmtt-8">&#x00A0;</span><span
  6013. class="cmsy-8">}</span>
  6014. <br class="fancyvrb" /><a
  6015. id="x1-99040r20"></a><span
  6016. class="cmr-6">20</span><span
  6017. class="cmtt-8">&#x00A0;</span><span
  6018. class="cmtt-8">&#x00A0;</span>
  6019. <br class="fancyvrb" /><a
  6020. id="x1-99042r21"></a><span
  6021. class="cmr-6">21</span><span
  6022. class="cmtt-8">&#x00A0;</span><span
  6023. class="cmtt-8">&#x00A0;</span><span
  6024. class="cmtt-8">&#x00A0;</span><span
  6025. class="cmtt-8">&#x00A0;</span><span
  6026. class="cmtt-8">&#x00A0;</span><span
  6027. class="cmtt-8">&#x00A0;</span><span
  6028. class="cmtt-8">&#x00A0;</span><span
  6029. class="cmtt-8">&#x00A0;</span><span
  6030. class="cmtt-8">&#x00A0;11)</span><span
  6031. class="cmtt-8">&#x00A0;iterate</span><span
  6032. class="cmtt-8">&#x00A0;[j]</span><span
  6033. class="cmtt-8">&#x00A0;over</span><span
  6034. class="cmtt-8">&#x00A0;the</span><span
  6035. class="cmtt-8">&#x00A0;range</span><span
  6036. class="cmtt-8">&#x00A0;0</span><span
  6037. class="cmtt-8">&#x00A0;...</span><span
  6038. class="cmtt-8">&#x00A0;(2</span><span
  6039. class="cmtt-8">&#x00A0;exponent</span><span
  6040. class="cmtt-8">&#x00A0;[floor1_class_subclasses]</span><span
  6041. class="cmtt-8">&#x00A0;element</span><span
  6042. class="cmtt-8">&#x00A0;[i])</span><span
  6043. class="cmtt-8">&#x00A0;-</span><span
  6044. class="cmtt-8">&#x00A0;1</span><span
  6045. class="cmtt-8">&#x00A0;</span><span
  6046. class="cmsy-8">{</span>
  6047. <br class="fancyvrb" /><a
  6048. id="x1-99044r22"></a><span
  6049. class="cmr-6">22</span><span
  6050. class="cmtt-8">&#x00A0;</span><span
  6051. class="cmtt-8">&#x00A0;</span>
  6052. <br class="fancyvrb" /><a
  6053. id="x1-99046r23"></a><span
  6054. class="cmr-6">23</span><span
  6055. class="cmtt-8">&#x00A0;</span><span
  6056. class="cmtt-8">&#x00A0;</span><span
  6057. class="cmtt-8">&#x00A0;</span><span
  6058. class="cmtt-8">&#x00A0;</span><span
  6059. class="cmtt-8">&#x00A0;</span><span
  6060. class="cmtt-8">&#x00A0;</span><span
  6061. class="cmtt-8">&#x00A0;</span><span
  6062. class="cmtt-8">&#x00A0;</span><span
  6063. class="cmtt-8">&#x00A0;</span><span
  6064. class="cmtt-8">&#x00A0;</span><span
  6065. class="cmtt-8">&#x00A0;</span><span
  6066. class="cmtt-8">&#x00A0;</span><span
  6067. class="cmtt-8">&#x00A0;</span><span
  6068. class="cmtt-8">&#x00A0;</span><span
  6069. class="cmtt-8">&#x00A0;12)</span><span
  6070. class="cmtt-8">&#x00A0;array</span><span
  6071. class="cmtt-8">&#x00A0;[floor1_subclass_books]</span><span
  6072. class="cmtt-8">&#x00A0;element</span><span
  6073. class="cmtt-8">&#x00A0;[i],[j]</span><span
  6074. class="cmtt-8">&#x00A0;=</span>
  6075. <br class="fancyvrb" /><a
  6076. id="x1-99048r24"></a><span
  6077. class="cmr-6">24</span><span
  6078. class="cmtt-8">&#x00A0;</span><span
  6079. class="cmtt-8">&#x00A0;</span><span
  6080. class="cmtt-8">&#x00A0;</span><span
  6081. class="cmtt-8">&#x00A0;</span><span
  6082. class="cmtt-8">&#x00A0;</span><span
  6083. class="cmtt-8">&#x00A0;</span><span
  6084. class="cmtt-8">&#x00A0;</span><span
  6085. class="cmtt-8">&#x00A0;</span><span
  6086. class="cmtt-8">&#x00A0;</span><span
  6087. class="cmtt-8">&#x00A0;</span><span
  6088. class="cmtt-8">&#x00A0;</span><span
  6089. class="cmtt-8">&#x00A0;</span><span
  6090. class="cmtt-8">&#x00A0;</span><span
  6091. class="cmtt-8">&#x00A0;</span><span
  6092. class="cmtt-8">&#x00A0;</span><span
  6093. class="cmtt-8">&#x00A0;</span><span
  6094. class="cmtt-8">&#x00A0;</span><span
  6095. class="cmtt-8">&#x00A0;</span><span
  6096. class="cmtt-8">&#x00A0;read</span><span
  6097. class="cmtt-8">&#x00A0;8</span><span
  6098. class="cmtt-8">&#x00A0;bits</span><span
  6099. class="cmtt-8">&#x00A0;as</span><span
  6100. class="cmtt-8">&#x00A0;unsigned</span><span
  6101. class="cmtt-8">&#x00A0;integer</span><span
  6102. class="cmtt-8">&#x00A0;and</span><span
  6103. class="cmtt-8">&#x00A0;subtract</span><span
  6104. class="cmtt-8">&#x00A0;one</span>
  6105. <br class="fancyvrb" /><a
  6106. id="x1-99050r25"></a><span
  6107. class="cmr-6">25</span><span
  6108. class="cmtt-8">&#x00A0;</span><span
  6109. class="cmtt-8">&#x00A0;</span><span
  6110. class="cmtt-8">&#x00A0;</span><span
  6111. class="cmtt-8">&#x00A0;</span><span
  6112. class="cmtt-8">&#x00A0;</span><span
  6113. class="cmtt-8">&#x00A0;</span><span
  6114. class="cmtt-8">&#x00A0;</span><span
  6115. class="cmtt-8">&#x00A0;</span><span
  6116. class="cmtt-8">&#x00A0;</span><span
  6117. class="cmtt-8">&#x00A0;</span><span
  6118. class="cmtt-8">&#x00A0;</span><span
  6119. class="cmtt-8">&#x00A0;</span><span
  6120. class="cmtt-8">&#x00A0;</span><span
  6121. class="cmsy-8">}</span>
  6122. <br class="fancyvrb" /><a
  6123. id="x1-99052r26"></a><span
  6124. class="cmr-6">26</span><span
  6125. class="cmtt-8">&#x00A0;</span><span
  6126. class="cmtt-8">&#x00A0;</span><span
  6127. class="cmtt-8">&#x00A0;</span><span
  6128. class="cmtt-8">&#x00A0;</span><span
  6129. class="cmtt-8">&#x00A0;</span><span
  6130. class="cmtt-8">&#x00A0;</span><span
  6131. class="cmtt-8">&#x00A0;</span><span
  6132. class="cmtt-8">&#x00A0;</span><span
  6133. class="cmsy-8">}</span>
  6134. <br class="fancyvrb" /><a
  6135. id="x1-99054r27"></a><span
  6136. class="cmr-6">27</span><span
  6137. class="cmtt-8">&#x00A0;</span><span
  6138. class="cmtt-8">&#x00A0;</span>
  6139. <br class="fancyvrb" /><a
  6140. id="x1-99056r28"></a><span
  6141. class="cmr-6">28</span><span
  6142. class="cmtt-8">&#x00A0;</span><span
  6143. class="cmtt-8">&#x00A0;</span><span
  6144. class="cmtt-8">&#x00A0;13)</span><span
  6145. class="cmtt-8">&#x00A0;[floor1_multiplier]</span><span
  6146. class="cmtt-8">&#x00A0;=</span><span
  6147. class="cmtt-8">&#x00A0;read</span><span
  6148. class="cmtt-8">&#x00A0;2</span><span
  6149. class="cmtt-8">&#x00A0;bits</span><span
  6150. class="cmtt-8">&#x00A0;as</span><span
  6151. class="cmtt-8">&#x00A0;unsigned</span><span
  6152. class="cmtt-8">&#x00A0;integer</span><span
  6153. class="cmtt-8">&#x00A0;and</span><span
  6154. class="cmtt-8">&#x00A0;add</span><span
  6155. class="cmtt-8">&#x00A0;one</span>
  6156. <br class="fancyvrb" /><a
  6157. id="x1-99058r29"></a><span
  6158. class="cmr-6">29</span><span
  6159. class="cmtt-8">&#x00A0;</span><span
  6160. class="cmtt-8">&#x00A0;</span><span
  6161. class="cmtt-8">&#x00A0;14)</span><span
  6162. class="cmtt-8">&#x00A0;[rangebits]</span><span
  6163. class="cmtt-8">&#x00A0;=</span><span
  6164. class="cmtt-8">&#x00A0;read</span><span
  6165. class="cmtt-8">&#x00A0;4</span><span
  6166. class="cmtt-8">&#x00A0;bits</span><span
  6167. class="cmtt-8">&#x00A0;as</span><span
  6168. class="cmtt-8">&#x00A0;unsigned</span><span
  6169. class="cmtt-8">&#x00A0;integer</span>
  6170. <br class="fancyvrb" /><a
  6171. id="x1-99060r30"></a><span
  6172. class="cmr-6">30</span><span
  6173. class="cmtt-8">&#x00A0;</span><span
  6174. class="cmtt-8">&#x00A0;</span><span
  6175. class="cmtt-8">&#x00A0;15)</span><span
  6176. class="cmtt-8">&#x00A0;vector</span><span
  6177. class="cmtt-8">&#x00A0;[floor1_X_list]</span><span
  6178. class="cmtt-8">&#x00A0;element</span><span
  6179. class="cmtt-8">&#x00A0;[0]</span><span
  6180. class="cmtt-8">&#x00A0;=</span><span
  6181. class="cmtt-8">&#x00A0;0</span>
  6182. <br class="fancyvrb" /><a
  6183. id="x1-99062r31"></a><span
  6184. class="cmr-6">31</span><span
  6185. class="cmtt-8">&#x00A0;</span><span
  6186. class="cmtt-8">&#x00A0;</span><span
  6187. class="cmtt-8">&#x00A0;16)</span><span
  6188. class="cmtt-8">&#x00A0;vector</span><span
  6189. class="cmtt-8">&#x00A0;[floor1_X_list]</span><span
  6190. class="cmtt-8">&#x00A0;element</span><span
  6191. class="cmtt-8">&#x00A0;[1]</span><span
  6192. class="cmtt-8">&#x00A0;=</span><span
  6193. class="cmtt-8">&#x00A0;2</span><span
  6194. class="cmtt-8">&#x00A0;exponent</span><span
  6195. class="cmtt-8">&#x00A0;[rangebits];</span>
  6196. <br class="fancyvrb" /><a
  6197. id="x1-99064r32"></a><span
  6198. class="cmr-6">32</span><span
  6199. class="cmtt-8">&#x00A0;</span><span
  6200. class="cmtt-8">&#x00A0;</span><span
  6201. class="cmtt-8">&#x00A0;17)</span><span
  6202. class="cmtt-8">&#x00A0;[floor1_values]</span><span
  6203. class="cmtt-8">&#x00A0;=</span><span
  6204. class="cmtt-8">&#x00A0;2</span>
  6205. <br class="fancyvrb" /><a
  6206. id="x1-99066r33"></a><span
  6207. class="cmr-6">33</span><span
  6208. class="cmtt-8">&#x00A0;</span><span
  6209. class="cmtt-8">&#x00A0;</span><span
  6210. class="cmtt-8">&#x00A0;18)</span><span
  6211. class="cmtt-8">&#x00A0;iterate</span><span
  6212. class="cmtt-8">&#x00A0;[i]</span><span
  6213. class="cmtt-8">&#x00A0;over</span><span
  6214. class="cmtt-8">&#x00A0;the</span><span
  6215. class="cmtt-8">&#x00A0;range</span><span
  6216. class="cmtt-8">&#x00A0;0</span><span
  6217. class="cmtt-8">&#x00A0;...</span><span
  6218. class="cmtt-8">&#x00A0;[floor1_partitions]-1</span><span
  6219. class="cmtt-8">&#x00A0;</span><span
  6220. class="cmsy-8">{</span>
  6221. <br class="fancyvrb" /><a
  6222. id="x1-99068r34"></a><span
  6223. class="cmr-6">34</span><span
  6224. class="cmtt-8">&#x00A0;</span><span
  6225. class="cmtt-8">&#x00A0;</span>
  6226. <br class="fancyvrb" /><a
  6227. id="x1-99070r35"></a><span
  6228. class="cmr-6">35</span><span
  6229. class="cmtt-8">&#x00A0;</span><span
  6230. class="cmtt-8">&#x00A0;</span><span
  6231. class="cmtt-8">&#x00A0;</span><span
  6232. class="cmtt-8">&#x00A0;</span><span
  6233. class="cmtt-8">&#x00A0;</span><span
  6234. class="cmtt-8">&#x00A0;</span><span
  6235. class="cmtt-8">&#x00A0;</span><span
  6236. class="cmtt-8">&#x00A0;</span><span
  6237. class="cmtt-8">&#x00A0;19)</span><span
  6238. class="cmtt-8">&#x00A0;[current_class_number]</span><span
  6239. class="cmtt-8">&#x00A0;=</span><span
  6240. class="cmtt-8">&#x00A0;vector</span><span
  6241. class="cmtt-8">&#x00A0;[floor1_partition_class_list]</span><span
  6242. class="cmtt-8">&#x00A0;element</span><span
  6243. class="cmtt-8">&#x00A0;[i]</span>
  6244. <br class="fancyvrb" /><a
  6245. id="x1-99072r36"></a><span
  6246. class="cmr-6">36</span><span
  6247. class="cmtt-8">&#x00A0;</span><span
  6248. class="cmtt-8">&#x00A0;</span><span
  6249. class="cmtt-8">&#x00A0;</span><span
  6250. class="cmtt-8">&#x00A0;</span><span
  6251. class="cmtt-8">&#x00A0;</span><span
  6252. class="cmtt-8">&#x00A0;</span><span
  6253. class="cmtt-8">&#x00A0;</span><span
  6254. class="cmtt-8">&#x00A0;</span><span
  6255. class="cmtt-8">&#x00A0;20)</span><span
  6256. class="cmtt-8">&#x00A0;iterate</span><span
  6257. class="cmtt-8">&#x00A0;[j]</span><span
  6258. class="cmtt-8">&#x00A0;over</span><span
  6259. class="cmtt-8">&#x00A0;the</span><span
  6260. class="cmtt-8">&#x00A0;range</span><span
  6261. class="cmtt-8">&#x00A0;0</span><span
  6262. class="cmtt-8">&#x00A0;...</span><span
  6263. class="cmtt-8">&#x00A0;([floor1_class_dimensions]</span><span
  6264. class="cmtt-8">&#x00A0;element</span><span
  6265. class="cmtt-8">&#x00A0;[current_class_number])-1</span><span
  6266. class="cmtt-8">&#x00A0;</span><span
  6267. class="cmsy-8">{</span>
  6268. <br class="fancyvrb" /><a
  6269. id="x1-99074r37"></a><span
  6270. class="cmr-6">37</span><span
  6271. class="cmtt-8">&#x00A0;</span><span
  6272. class="cmtt-8">&#x00A0;</span><span
  6273. class="cmtt-8">&#x00A0;</span><span
  6274. class="cmtt-8">&#x00A0;</span><span
  6275. class="cmtt-8">&#x00A0;</span><span
  6276. class="cmtt-8">&#x00A0;</span><span
  6277. class="cmtt-8">&#x00A0;</span><span
  6278. class="cmtt-8">&#x00A0;</span><span
  6279. class="cmtt-8">&#x00A0;</span><span
  6280. class="cmtt-8">&#x00A0;</span><span
  6281. class="cmtt-8">&#x00A0;</span><span
  6282. class="cmtt-8">&#x00A0;</span><span
  6283. class="cmtt-8">&#x00A0;</span><span
  6284. class="cmtt-8">&#x00A0;</span><span
  6285. class="cmtt-8">&#x00A0;21)</span><span
  6286. class="cmtt-8">&#x00A0;vector</span><span
  6287. class="cmtt-8">&#x00A0;[floor1_X_list]</span><span
  6288. class="cmtt-8">&#x00A0;element</span><span
  6289. class="cmtt-8">&#x00A0;([floor1_values])</span><span
  6290. class="cmtt-8">&#x00A0;=</span>
  6291. <br class="fancyvrb" /><a
  6292. id="x1-99076r38"></a><span
  6293. class="cmr-6">38</span><span
  6294. class="cmtt-8">&#x00A0;</span><span
  6295. class="cmtt-8">&#x00A0;</span><span
  6296. class="cmtt-8">&#x00A0;</span><span
  6297. class="cmtt-8">&#x00A0;</span><span
  6298. class="cmtt-8">&#x00A0;</span><span
  6299. class="cmtt-8">&#x00A0;</span><span
  6300. class="cmtt-8">&#x00A0;</span><span
  6301. class="cmtt-8">&#x00A0;</span><span
  6302. class="cmtt-8">&#x00A0;</span><span
  6303. class="cmtt-8">&#x00A0;</span><span
  6304. class="cmtt-8">&#x00A0;</span><span
  6305. class="cmtt-8">&#x00A0;</span><span
  6306. class="cmtt-8">&#x00A0;</span><span
  6307. class="cmtt-8">&#x00A0;</span><span
  6308. class="cmtt-8">&#x00A0;</span><span
  6309. class="cmtt-8">&#x00A0;</span><span
  6310. class="cmtt-8">&#x00A0;</span><span
  6311. class="cmtt-8">&#x00A0;</span><span
  6312. class="cmtt-8">&#x00A0;read</span><span
  6313. class="cmtt-8">&#x00A0;[rangebits]</span><span
  6314. class="cmtt-8">&#x00A0;bits</span><span
  6315. class="cmtt-8">&#x00A0;as</span><span
  6316. class="cmtt-8">&#x00A0;unsigned</span><span
  6317. class="cmtt-8">&#x00A0;integer</span>
  6318. <br class="fancyvrb" /><a
  6319. id="x1-99078r39"></a><span
  6320. class="cmr-6">39</span><span
  6321. class="cmtt-8">&#x00A0;</span><span
  6322. class="cmtt-8">&#x00A0;</span><span
  6323. class="cmtt-8">&#x00A0;</span><span
  6324. class="cmtt-8">&#x00A0;</span><span
  6325. class="cmtt-8">&#x00A0;</span><span
  6326. class="cmtt-8">&#x00A0;</span><span
  6327. class="cmtt-8">&#x00A0;</span><span
  6328. class="cmtt-8">&#x00A0;</span><span
  6329. class="cmtt-8">&#x00A0;</span><span
  6330. class="cmtt-8">&#x00A0;</span><span
  6331. class="cmtt-8">&#x00A0;</span><span
  6332. class="cmtt-8">&#x00A0;</span><span
  6333. class="cmtt-8">&#x00A0;</span><span
  6334. class="cmtt-8">&#x00A0;</span><span
  6335. class="cmtt-8">&#x00A0;22)</span><span
  6336. class="cmtt-8">&#x00A0;increment</span><span
  6337. class="cmtt-8">&#x00A0;[floor1_values]</span><span
  6338. class="cmtt-8">&#x00A0;by</span><span
  6339. class="cmtt-8">&#x00A0;one</span>
  6340. <br class="fancyvrb" /><a
  6341. id="x1-99080r40"></a><span
  6342. class="cmr-6">40</span><span
  6343. class="cmtt-8">&#x00A0;</span><span
  6344. class="cmtt-8">&#x00A0;</span><span
  6345. class="cmtt-8">&#x00A0;</span><span
  6346. class="cmtt-8">&#x00A0;</span><span
  6347. class="cmtt-8">&#x00A0;</span><span
  6348. class="cmtt-8">&#x00A0;</span><span
  6349. class="cmtt-8">&#x00A0;</span><span
  6350. class="cmtt-8">&#x00A0;</span><span
  6351. class="cmtt-8">&#x00A0;</span><span
  6352. class="cmtt-8">&#x00A0;</span><span
  6353. class="cmtt-8">&#x00A0;</span><span
  6354. class="cmtt-8">&#x00A0;</span><span
  6355. class="cmtt-8">&#x00A0;</span><span
  6356. class="cmsy-8">}</span>
  6357. <br class="fancyvrb" /><a
  6358. id="x1-99082r41"></a><span
  6359. class="cmr-6">41</span><span
  6360. class="cmtt-8">&#x00A0;</span><span
  6361. class="cmtt-8">&#x00A0;</span><span
  6362. class="cmtt-8">&#x00A0;</span><span
  6363. class="cmtt-8">&#x00A0;</span><span
  6364. class="cmtt-8">&#x00A0;</span><span
  6365. class="cmtt-8">&#x00A0;</span><span
  6366. class="cmtt-8">&#x00A0;</span><span
  6367. class="cmsy-8">}</span>
  6368. <br class="fancyvrb" /><a
  6369. id="x1-99084r42"></a><span
  6370. class="cmr-6">42</span><span
  6371. class="cmtt-8">&#x00A0;</span><span
  6372. class="cmtt-8">&#x00A0;</span>
  6373. <br class="fancyvrb" /><a
  6374. id="x1-99086r43"></a><span
  6375. class="cmr-6">43</span><span
  6376. class="cmtt-8">&#x00A0;</span><span
  6377. class="cmtt-8">&#x00A0;</span><span
  6378. class="cmtt-8">&#x00A0;23)</span><span
  6379. class="cmtt-8">&#x00A0;done</span>
  6380. </div>
  6381. <!--l. 158--><p class="noindent" >An end-of-packet condition while reading any aspect of a floor 1 configuration during
  6382. setup renders a stream undecodable. In addition, a <span
  6383. class="cmtt-12">[floor1_class_masterbooks] </span>or
  6384. <span
  6385. class="cmtt-12">[floor1_subclass_books] </span>scalar element greater than the highest numbered codebook
  6386. configured in this stream is an error condition that renders the stream undecodable.
  6387. <!--l. 165--><p class="noindent" ><span class="paragraphHead"><a
  6388. id="x1-1000007.2.2"></a><span
  6389. class="cmbx-12">packet decode</span></span>
  6390. Packet decode begins by checking the <span
  6391. class="cmtt-12">[nonzero] </span>flag:
  6392. <!--l. 169--><p class="noindent" >
  6393. <div class="fancyvrb" id="fancyvrb29">
  6394. <a
  6395. id="x1-100002r1"></a><span
  6396. class="cmr-6">1</span><span
  6397. class="cmtt-8">&#x00A0;</span><span
  6398. class="cmtt-8">&#x00A0;</span><span
  6399. class="cmtt-8">&#x00A0;</span><span
  6400. class="cmtt-8">&#x00A0;1)</span><span
  6401. class="cmtt-8">&#x00A0;[nonzero]</span><span
  6402. class="cmtt-8">&#x00A0;=</span><span
  6403. class="cmtt-8">&#x00A0;read</span><span
  6404. class="cmtt-8">&#x00A0;1</span><span
  6405. class="cmtt-8">&#x00A0;bit</span><span
  6406. class="cmtt-8">&#x00A0;as</span><span
  6407. class="cmtt-8">&#x00A0;boolean</span>
  6408. </div>
  6409. <!--l. 173--><p class="noindent" >If <span
  6410. class="cmtt-12">[nonzero] </span>is unset, that indicates this channel contained no audio energy in this frame.
  6411. Decode immediately returns a status indicating this floor curve (and thus this channel) is unused
  6412. this frame. (A return status of &#8217;unused&#8217; is different from decoding a floor that has all
  6413. points set to minimum representation amplitude, which happens to be approximately
  6414. -140dB).
  6415. <!--l. 181--><p class="noindent" >Assuming <span
  6416. class="cmtt-12">[nonzero] </span>is set, decode proceeds as follows:
  6417. <!--l. 183--><p class="noindent" >
  6418. <div class="fancyvrb" id="fancyvrb30">
  6419. <a
  6420. id="x1-100004r1"></a><span
  6421. class="cmr-6">1</span><span
  6422. class="cmtt-8">&#x00A0;</span><span
  6423. class="cmtt-8">&#x00A0;</span><span
  6424. class="cmtt-8">&#x00A0;</span><span
  6425. class="cmtt-8">&#x00A0;1)</span><span
  6426. class="cmtt-8">&#x00A0;[range]</span><span
  6427. class="cmtt-8">&#x00A0;=</span><span
  6428. class="cmtt-8">&#x00A0;vector</span><span
  6429. class="cmtt-8">&#x00A0;</span><span
  6430. class="cmsy-8">{</span><span
  6431. class="cmtt-8">&#x00A0;256,</span><span
  6432. class="cmtt-8">&#x00A0;128,</span><span
  6433. class="cmtt-8">&#x00A0;86,</span><span
  6434. class="cmtt-8">&#x00A0;64</span><span
  6435. class="cmtt-8">&#x00A0;</span><span
  6436. class="cmsy-8">}</span><span
  6437. class="cmtt-8">&#x00A0;element</span><span
  6438. class="cmtt-8">&#x00A0;([floor1_multiplier]-1)</span>
  6439. <br class="fancyvrb" /><a
  6440. id="x1-100006r2"></a><span
  6441. class="cmr-6">2</span><span
  6442. class="cmtt-8">&#x00A0;</span><span
  6443. class="cmtt-8">&#x00A0;</span><span
  6444. class="cmtt-8">&#x00A0;</span><span
  6445. class="cmtt-8">&#x00A0;2)</span><span
  6446. class="cmtt-8">&#x00A0;vector</span><span
  6447. class="cmtt-8">&#x00A0;[floor1_Y]</span><span
  6448. class="cmtt-8">&#x00A0;element</span><span
  6449. class="cmtt-8">&#x00A0;[0]</span><span
  6450. class="cmtt-8">&#x00A0;=</span><span
  6451. class="cmtt-8">&#x00A0;read</span><span
  6452. class="cmtt-8">&#x00A0;</span><a
  6453. href="#x1-1170009.2.1"><span
  6454. class="cmtt-8">ilog</span></a><span
  6455. class="cmtt-8">([range]-1)</span><span
  6456. class="cmtt-8">&#x00A0;bits</span><span
  6457. class="cmtt-8">&#x00A0;as</span><span
  6458. class="cmtt-8">&#x00A0;unsigned</span><span
  6459. class="cmtt-8">&#x00A0;integer</span>
  6460. <br class="fancyvrb" /><a
  6461. id="x1-100008r3"></a><span
  6462. class="cmr-6">3</span><span
  6463. class="cmtt-8">&#x00A0;</span><span
  6464. class="cmtt-8">&#x00A0;</span><span
  6465. class="cmtt-8">&#x00A0;</span><span
  6466. class="cmtt-8">&#x00A0;3)</span><span
  6467. class="cmtt-8">&#x00A0;vector</span><span
  6468. class="cmtt-8">&#x00A0;[floor1_Y]</span><span
  6469. class="cmtt-8">&#x00A0;element</span><span
  6470. class="cmtt-8">&#x00A0;[1]</span><span
  6471. class="cmtt-8">&#x00A0;=</span><span
  6472. class="cmtt-8">&#x00A0;read</span><span
  6473. class="cmtt-8">&#x00A0;</span><a
  6474. href="#x1-1170009.2.1"><span
  6475. class="cmtt-8">ilog</span></a><span
  6476. class="cmtt-8">([range]-1)</span><span
  6477. class="cmtt-8">&#x00A0;bits</span><span
  6478. class="cmtt-8">&#x00A0;as</span><span
  6479. class="cmtt-8">&#x00A0;unsigned</span><span
  6480. class="cmtt-8">&#x00A0;integer</span>
  6481. <br class="fancyvrb" /><a
  6482. id="x1-100010r4"></a><span
  6483. class="cmr-6">4</span><span
  6484. class="cmtt-8">&#x00A0;</span><span
  6485. class="cmtt-8">&#x00A0;</span><span
  6486. class="cmtt-8">&#x00A0;</span><span
  6487. class="cmtt-8">&#x00A0;4)</span><span
  6488. class="cmtt-8">&#x00A0;[offset]</span><span
  6489. class="cmtt-8">&#x00A0;=</span><span
  6490. class="cmtt-8">&#x00A0;2;</span>
  6491. <br class="fancyvrb" /><a
  6492. id="x1-100012r5"></a><span
  6493. class="cmr-6">5</span><span
  6494. class="cmtt-8">&#x00A0;</span><span
  6495. class="cmtt-8">&#x00A0;</span><span
  6496. class="cmtt-8">&#x00A0;</span><span
  6497. class="cmtt-8">&#x00A0;5)</span><span
  6498. class="cmtt-8">&#x00A0;iterate</span><span
  6499. class="cmtt-8">&#x00A0;[i]</span><span
  6500. class="cmtt-8">&#x00A0;over</span><span
  6501. class="cmtt-8">&#x00A0;the</span><span
  6502. class="cmtt-8">&#x00A0;range</span><span
  6503. class="cmtt-8">&#x00A0;0</span><span
  6504. class="cmtt-8">&#x00A0;...</span><span
  6505. class="cmtt-8">&#x00A0;[floor1_partitions]-1</span><span
  6506. class="cmtt-8">&#x00A0;</span><span
  6507. class="cmsy-8">{</span>
  6508. <br class="fancyvrb" /><a
  6509. id="x1-100014r6"></a><span
  6510. class="cmr-6">6</span><span
  6511. class="cmtt-8">&#x00A0;</span><span
  6512. class="cmtt-8">&#x00A0;</span>
  6513. <br class="fancyvrb" /><a
  6514. id="x1-100016r7"></a><span
  6515. class="cmr-6">7</span><span
  6516. class="cmtt-8">&#x00A0;</span><span
  6517. class="cmtt-8">&#x00A0;</span><span
  6518. class="cmtt-8">&#x00A0;</span><span
  6519. class="cmtt-8">&#x00A0;</span><span
  6520. class="cmtt-8">&#x00A0;</span><span
  6521. class="cmtt-8">&#x00A0;</span><span
  6522. class="cmtt-8">&#x00A0;</span><span
  6523. class="cmtt-8">&#x00A0;</span><span
  6524. class="cmtt-8">&#x00A0;6)</span><span
  6525. class="cmtt-8">&#x00A0;[class]</span><span
  6526. class="cmtt-8">&#x00A0;=</span><span
  6527. class="cmtt-8">&#x00A0;vector</span><span
  6528. class="cmtt-8">&#x00A0;[floor1_partition_class]</span><span
  6529. class="cmtt-8">&#x00A0;</span><span
  6530. class="cmtt-8">&#x00A0;element</span><span
  6531. class="cmtt-8">&#x00A0;[i]</span>
  6532. <br class="fancyvrb" /><a
  6533. id="x1-100018r8"></a><span
  6534. class="cmr-6">8</span><span
  6535. class="cmtt-8">&#x00A0;</span><span
  6536. class="cmtt-8">&#x00A0;</span><span
  6537. class="cmtt-8">&#x00A0;</span><span
  6538. class="cmtt-8">&#x00A0;</span><span
  6539. class="cmtt-8">&#x00A0;</span><span
  6540. class="cmtt-8">&#x00A0;</span><span
  6541. class="cmtt-8">&#x00A0;</span><span
  6542. class="cmtt-8">&#x00A0;</span><span
  6543. class="cmtt-8">&#x00A0;7)</span><span
  6544. class="cmtt-8">&#x00A0;[cdim]</span><span
  6545. class="cmtt-8">&#x00A0;</span><span
  6546. class="cmtt-8">&#x00A0;=</span><span
  6547. class="cmtt-8">&#x00A0;vector</span><span
  6548. class="cmtt-8">&#x00A0;[floor1_class_dimensions]</span><span
  6549. class="cmtt-8">&#x00A0;element</span><span
  6550. class="cmtt-8">&#x00A0;[class]</span>
  6551. <br class="fancyvrb" /><a
  6552. id="x1-100020r9"></a><span
  6553. class="cmr-6">9</span><span
  6554. class="cmtt-8">&#x00A0;</span><span
  6555. class="cmtt-8">&#x00A0;</span><span
  6556. class="cmtt-8">&#x00A0;</span><span
  6557. class="cmtt-8">&#x00A0;</span><span
  6558. class="cmtt-8">&#x00A0;</span><span
  6559. class="cmtt-8">&#x00A0;</span><span
  6560. class="cmtt-8">&#x00A0;</span><span
  6561. class="cmtt-8">&#x00A0;</span><span
  6562. class="cmtt-8">&#x00A0;8)</span><span
  6563. class="cmtt-8">&#x00A0;[cbits]</span><span
  6564. class="cmtt-8">&#x00A0;=</span><span
  6565. class="cmtt-8">&#x00A0;vector</span><span
  6566. class="cmtt-8">&#x00A0;[floor1_class_subclasses]</span><span
  6567. class="cmtt-8">&#x00A0;element</span><span
  6568. class="cmtt-8">&#x00A0;[class]</span>
  6569. <br class="fancyvrb" /><a
  6570. id="x1-100022r10"></a><span
  6571. class="cmr-6">10</span><span
  6572. class="cmtt-8">&#x00A0;</span><span
  6573. class="cmtt-8">&#x00A0;</span><span
  6574. class="cmtt-8">&#x00A0;</span><span
  6575. class="cmtt-8">&#x00A0;</span><span
  6576. class="cmtt-8">&#x00A0;</span><span
  6577. class="cmtt-8">&#x00A0;</span><span
  6578. class="cmtt-8">&#x00A0;</span><span
  6579. class="cmtt-8">&#x00A0;</span><span
  6580. class="cmtt-8">&#x00A0;9)</span><span
  6581. class="cmtt-8">&#x00A0;[csub]</span><span
  6582. class="cmtt-8">&#x00A0;</span><span
  6583. class="cmtt-8">&#x00A0;=</span><span
  6584. class="cmtt-8">&#x00A0;(2</span><span
  6585. class="cmtt-8">&#x00A0;exponent</span><span
  6586. class="cmtt-8">&#x00A0;[cbits])-1</span>
  6587. <br class="fancyvrb" /><a
  6588. id="x1-100024r11"></a><span
  6589. class="cmr-6">11</span><span
  6590. class="cmtt-8">&#x00A0;</span><span
  6591. class="cmtt-8">&#x00A0;</span><span
  6592. class="cmtt-8">&#x00A0;</span><span
  6593. class="cmtt-8">&#x00A0;</span><span
  6594. class="cmtt-8">&#x00A0;</span><span
  6595. class="cmtt-8">&#x00A0;</span><span
  6596. class="cmtt-8">&#x00A0;</span><span
  6597. class="cmtt-8">&#x00A0;10)</span><span
  6598. class="cmtt-8">&#x00A0;[cval]</span><span
  6599. class="cmtt-8">&#x00A0;</span><span
  6600. class="cmtt-8">&#x00A0;=</span><span
  6601. class="cmtt-8">&#x00A0;0</span>
  6602. <br class="fancyvrb" /><a
  6603. id="x1-100026r12"></a><span
  6604. class="cmr-6">12</span><span
  6605. class="cmtt-8">&#x00A0;</span><span
  6606. class="cmtt-8">&#x00A0;</span><span
  6607. class="cmtt-8">&#x00A0;</span><span
  6608. class="cmtt-8">&#x00A0;</span><span
  6609. class="cmtt-8">&#x00A0;</span><span
  6610. class="cmtt-8">&#x00A0;</span><span
  6611. class="cmtt-8">&#x00A0;</span><span
  6612. class="cmtt-8">&#x00A0;11)</span><span
  6613. class="cmtt-8">&#x00A0;if</span><span
  6614. class="cmtt-8">&#x00A0;(</span><span
  6615. class="cmtt-8">&#x00A0;[cbits]</span><span
  6616. class="cmtt-8">&#x00A0;is</span><span
  6617. class="cmtt-8">&#x00A0;greater</span><span
  6618. class="cmtt-8">&#x00A0;than</span><span
  6619. class="cmtt-8">&#x00A0;zero</span><span
  6620. class="cmtt-8">&#x00A0;)</span><span
  6621. class="cmtt-8">&#x00A0;</span><span
  6622. class="cmsy-8">{</span>
  6623. <br class="fancyvrb" /><a
  6624. id="x1-100028r13"></a><span
  6625. class="cmr-6">13</span><span
  6626. class="cmtt-8">&#x00A0;</span><span
  6627. class="cmtt-8">&#x00A0;</span>
  6628. <br class="fancyvrb" /><a
  6629. id="x1-100030r14"></a><span
  6630. class="cmr-6">14</span><span
  6631. class="cmtt-8">&#x00A0;</span><span
  6632. class="cmtt-8">&#x00A0;</span><span
  6633. class="cmtt-8">&#x00A0;</span><span
  6634. class="cmtt-8">&#x00A0;</span><span
  6635. class="cmtt-8">&#x00A0;</span><span
  6636. class="cmtt-8">&#x00A0;</span><span
  6637. class="cmtt-8">&#x00A0;</span><span
  6638. class="cmtt-8">&#x00A0;</span><span
  6639. class="cmtt-8">&#x00A0;</span><span
  6640. class="cmtt-8">&#x00A0;</span><span
  6641. class="cmtt-8">&#x00A0;</span><span
  6642. class="cmtt-8">&#x00A0;</span><span
  6643. class="cmtt-8">&#x00A0;</span><span
  6644. class="cmtt-8">&#x00A0;</span><span
  6645. class="cmtt-8">&#x00A0;12)</span><span
  6646. class="cmtt-8">&#x00A0;[cval]</span><span
  6647. class="cmtt-8">&#x00A0;=</span><span
  6648. class="cmtt-8">&#x00A0;read</span><span
  6649. class="cmtt-8">&#x00A0;from</span><span
  6650. class="cmtt-8">&#x00A0;packet</span><span
  6651. class="cmtt-8">&#x00A0;using</span><span
  6652. class="cmtt-8">&#x00A0;codebook</span><span
  6653. class="cmtt-8">&#x00A0;number</span>
  6654. <br class="fancyvrb" /><a
  6655. id="x1-100032r15"></a><span
  6656. class="cmr-6">15</span><span
  6657. class="cmtt-8">&#x00A0;</span><span
  6658. class="cmtt-8">&#x00A0;</span><span
  6659. class="cmtt-8">&#x00A0;</span><span
  6660. class="cmtt-8">&#x00A0;</span><span
  6661. class="cmtt-8">&#x00A0;</span><span
  6662. class="cmtt-8">&#x00A0;</span><span
  6663. class="cmtt-8">&#x00A0;</span><span
  6664. class="cmtt-8">&#x00A0;</span><span
  6665. class="cmtt-8">&#x00A0;</span><span
  6666. class="cmtt-8">&#x00A0;</span><span
  6667. class="cmtt-8">&#x00A0;</span><span
  6668. class="cmtt-8">&#x00A0;</span><span
  6669. class="cmtt-8">&#x00A0;</span><span
  6670. class="cmtt-8">&#x00A0;</span><span
  6671. class="cmtt-8">&#x00A0;</span><span
  6672. class="cmtt-8">&#x00A0;</span><span
  6673. class="cmtt-8">&#x00A0;</span><span
  6674. class="cmtt-8">&#x00A0;</span><span
  6675. class="cmtt-8">&#x00A0;(vector</span><span
  6676. class="cmtt-8">&#x00A0;[floor1_class_masterbooks]</span><span
  6677. class="cmtt-8">&#x00A0;element</span><span
  6678. class="cmtt-8">&#x00A0;[class])</span><span
  6679. class="cmtt-8">&#x00A0;in</span><span
  6680. class="cmtt-8">&#x00A0;scalar</span><span
  6681. class="cmtt-8">&#x00A0;context</span>
  6682. <br class="fancyvrb" /><a
  6683. id="x1-100034r16"></a><span
  6684. class="cmr-6">16</span><span
  6685. class="cmtt-8">&#x00A0;</span><span
  6686. class="cmtt-8">&#x00A0;</span><span
  6687. class="cmtt-8">&#x00A0;</span><span
  6688. class="cmtt-8">&#x00A0;</span><span
  6689. class="cmtt-8">&#x00A0;</span><span
  6690. class="cmtt-8">&#x00A0;</span><span
  6691. class="cmtt-8">&#x00A0;</span><span
  6692. class="cmtt-8">&#x00A0;</span><span
  6693. class="cmtt-8">&#x00A0;</span><span
  6694. class="cmtt-8">&#x00A0;</span><span
  6695. class="cmtt-8">&#x00A0;</span><span
  6696. class="cmtt-8">&#x00A0;</span><span
  6697. class="cmsy-8">}</span>
  6698. <br class="fancyvrb" /><a
  6699. id="x1-100036r17"></a><span
  6700. class="cmr-6">17</span><span
  6701. class="cmtt-8">&#x00A0;</span><span
  6702. class="cmtt-8">&#x00A0;</span>
  6703. <br class="fancyvrb" /><a
  6704. id="x1-100038r18"></a><span
  6705. class="cmr-6">18</span><span
  6706. class="cmtt-8">&#x00A0;</span><span
  6707. class="cmtt-8">&#x00A0;</span><span
  6708. class="cmtt-8">&#x00A0;</span><span
  6709. class="cmtt-8">&#x00A0;</span><span
  6710. class="cmtt-8">&#x00A0;</span><span
  6711. class="cmtt-8">&#x00A0;</span><span
  6712. class="cmtt-8">&#x00A0;</span><span
  6713. class="cmtt-8">&#x00A0;13)</span><span
  6714. class="cmtt-8">&#x00A0;iterate</span><span
  6715. class="cmtt-8">&#x00A0;[j]</span><span
  6716. class="cmtt-8">&#x00A0;over</span><span
  6717. class="cmtt-8">&#x00A0;the</span><span
  6718. class="cmtt-8">&#x00A0;range</span><span
  6719. class="cmtt-8">&#x00A0;0</span><span
  6720. class="cmtt-8">&#x00A0;...</span><span
  6721. class="cmtt-8">&#x00A0;[cdim]-1</span><span
  6722. class="cmtt-8">&#x00A0;</span><span
  6723. class="cmsy-8">{</span>
  6724. <br class="fancyvrb" /><a
  6725. id="x1-100040r19"></a><span
  6726. class="cmr-6">19</span><span
  6727. class="cmtt-8">&#x00A0;</span><span
  6728. class="cmtt-8">&#x00A0;</span>
  6729. <br class="fancyvrb" /><a
  6730. id="x1-100042r20"></a><span
  6731. class="cmr-6">20</span><span
  6732. class="cmtt-8">&#x00A0;</span><span
  6733. class="cmtt-8">&#x00A0;</span><span
  6734. class="cmtt-8">&#x00A0;</span><span
  6735. class="cmtt-8">&#x00A0;</span><span
  6736. class="cmtt-8">&#x00A0;</span><span
  6737. class="cmtt-8">&#x00A0;</span><span
  6738. class="cmtt-8">&#x00A0;</span><span
  6739. class="cmtt-8">&#x00A0;</span><span
  6740. class="cmtt-8">&#x00A0;</span><span
  6741. class="cmtt-8">&#x00A0;</span><span
  6742. class="cmtt-8">&#x00A0;</span><span
  6743. class="cmtt-8">&#x00A0;</span><span
  6744. class="cmtt-8">&#x00A0;</span><span
  6745. class="cmtt-8">&#x00A0;</span><span
  6746. class="cmtt-8">&#x00A0;14)</span><span
  6747. class="cmtt-8">&#x00A0;[book]</span><span
  6748. class="cmtt-8">&#x00A0;=</span><span
  6749. class="cmtt-8">&#x00A0;array</span><span
  6750. class="cmtt-8">&#x00A0;[floor1_subclass_books]</span><span
  6751. class="cmtt-8">&#x00A0;element</span><span
  6752. class="cmtt-8">&#x00A0;[class],([cval]</span><span
  6753. class="cmtt-8">&#x00A0;bitwise</span><span
  6754. class="cmtt-8">&#x00A0;AND</span><span
  6755. class="cmtt-8">&#x00A0;[csub])</span>
  6756. <br class="fancyvrb" /><a
  6757. id="x1-100044r21"></a><span
  6758. class="cmr-6">21</span><span
  6759. class="cmtt-8">&#x00A0;</span><span
  6760. class="cmtt-8">&#x00A0;</span><span
  6761. class="cmtt-8">&#x00A0;</span><span
  6762. class="cmtt-8">&#x00A0;</span><span
  6763. class="cmtt-8">&#x00A0;</span><span
  6764. class="cmtt-8">&#x00A0;</span><span
  6765. class="cmtt-8">&#x00A0;</span><span
  6766. class="cmtt-8">&#x00A0;</span><span
  6767. class="cmtt-8">&#x00A0;</span><span
  6768. class="cmtt-8">&#x00A0;</span><span
  6769. class="cmtt-8">&#x00A0;</span><span
  6770. class="cmtt-8">&#x00A0;</span><span
  6771. class="cmtt-8">&#x00A0;</span><span
  6772. class="cmtt-8">&#x00A0;</span><span
  6773. class="cmtt-8">&#x00A0;15)</span><span
  6774. class="cmtt-8">&#x00A0;[cval]</span><span
  6775. class="cmtt-8">&#x00A0;=</span><span
  6776. class="cmtt-8">&#x00A0;[cval]</span><span
  6777. class="cmtt-8">&#x00A0;right</span><span
  6778. class="cmtt-8">&#x00A0;shifted</span><span
  6779. class="cmtt-8">&#x00A0;[cbits]</span><span
  6780. class="cmtt-8">&#x00A0;bits</span>
  6781. <br class="fancyvrb" /><a
  6782. id="x1-100046r22"></a><span
  6783. class="cmr-6">22</span><span
  6784. class="cmtt-8">&#x00A0;</span><span
  6785. class="cmtt-8">&#x00A0; </span><span
  6786. class="cmtt-8">&#x00A0;</span><span
  6787. class="cmtt-8">&#x00A0;</span><span
  6788. class="cmtt-8">&#x00A0;</span><span
  6789. class="cmtt-8">&#x00A0;</span><span
  6790. class="cmtt-8">&#x00A0;16)</span><span
  6791. class="cmtt-8">&#x00A0;if</span><span
  6792. class="cmtt-8">&#x00A0;(</span><span
  6793. class="cmtt-8">&#x00A0;[book]</span><span
  6794. class="cmtt-8">&#x00A0;is</span><span
  6795. class="cmtt-8">&#x00A0;not</span><span
  6796. class="cmtt-8">&#x00A0;less</span><span
  6797. class="cmtt-8">&#x00A0;than</span><span
  6798. class="cmtt-8">&#x00A0;zero</span><span
  6799. class="cmtt-8">&#x00A0;)</span><span
  6800. class="cmtt-8">&#x00A0;</span><span
  6801. class="cmsy-8">{</span>
  6802. <br class="fancyvrb" /><a
  6803. id="x1-100048r23"></a><span
  6804. class="cmr-6">23</span><span
  6805. class="cmtt-8">&#x00A0;</span><span
  6806. class="cmtt-8">&#x00A0;</span>
  6807. <br class="fancyvrb" /><a
  6808. id="x1-100050r24"></a><span
  6809. class="cmr-6">24</span><span
  6810. class="cmtt-8">&#x00A0;</span><span
  6811. class="cmtt-8">&#x00A0; </span><span
  6812. class="cmtt-8">&#x00A0;</span><span
  6813. class="cmtt-8">&#x00A0;</span><span
  6814. class="cmtt-8">&#x00A0;</span><span
  6815. class="cmtt-8">&#x00A0;</span><span
  6816. class="cmtt-8">&#x00A0;</span><span
  6817. class="cmtt-8">&#x00A0;</span><span
  6818. class="cmtt-8">&#x00A0;</span><span
  6819. class="cmtt-8">&#x00A0;</span><span
  6820. class="cmtt-8">&#x00A0;</span><span
  6821. class="cmtt-8">&#x00A0;</span><span
  6822. class="cmtt-8">&#x00A0;17)</span><span
  6823. class="cmtt-8">&#x00A0;vector</span><span
  6824. class="cmtt-8">&#x00A0;[floor1_Y]</span><span
  6825. class="cmtt-8">&#x00A0;element</span><span
  6826. class="cmtt-8">&#x00A0;([j]+[offset])</span><span
  6827. class="cmtt-8">&#x00A0;=</span><span
  6828. class="cmtt-8">&#x00A0;read</span><span
  6829. class="cmtt-8">&#x00A0;from</span><span
  6830. class="cmtt-8">&#x00A0;packet</span><span
  6831. class="cmtt-8">&#x00A0;using</span><span
  6832. class="cmtt-8">&#x00A0;codebook</span>
  6833. <br class="fancyvrb" /><a
  6834. id="x1-100052r25"></a><span
  6835. class="cmr-6">25</span><span
  6836. class="cmtt-8">&#x00A0;</span><span
  6837. class="cmtt-8">&#x00A0;</span><span
  6838. class="cmtt-8">&#x00A0;</span><span
  6839. class="cmtt-8">&#x00A0;</span><span
  6840. class="cmtt-8">&#x00A0;</span><span
  6841. class="cmtt-8">&#x00A0;</span><span
  6842. class="cmtt-8">&#x00A0;</span><span
  6843. class="cmtt-8">&#x00A0;</span><span
  6844. class="cmtt-8">&#x00A0;</span><span
  6845. class="cmtt-8">&#x00A0;</span><span
  6846. class="cmtt-8">&#x00A0;</span><span
  6847. class="cmtt-8">&#x00A0;</span><span
  6848. class="cmtt-8">&#x00A0;</span><span
  6849. class="cmtt-8">&#x00A0;</span><span
  6850. class="cmtt-8">&#x00A0;</span><span
  6851. class="cmtt-8">&#x00A0;</span><span
  6852. class="cmtt-8">&#x00A0;</span><span
  6853. class="cmtt-8">&#x00A0;</span><span
  6854. class="cmtt-8">&#x00A0;</span><span
  6855. class="cmtt-8">&#x00A0;</span><span
  6856. class="cmtt-8">&#x00A0;</span><span
  6857. class="cmtt-8">&#x00A0;</span><span
  6858. class="cmtt-8">&#x00A0;</span><span
  6859. class="cmtt-8">&#x00A0;</span><span
  6860. class="cmtt-8">&#x00A0;[book]</span><span
  6861. class="cmtt-8">&#x00A0;in</span><span
  6862. class="cmtt-8">&#x00A0;scalar</span><span
  6863. class="cmtt-8">&#x00A0;context</span>
  6864. <br class="fancyvrb" /><a
  6865. id="x1-100054r26"></a><span
  6866. class="cmr-6">26</span><span
  6867. class="cmtt-8">&#x00A0;</span><span
  6868. class="cmtt-8">&#x00A0;</span>
  6869. <br class="fancyvrb" /><a
  6870. id="x1-100056r27"></a><span
  6871. class="cmr-6">27</span><span
  6872. class="cmtt-8">&#x00A0;</span><span
  6873. class="cmtt-8">&#x00A0;</span><span
  6874. class="cmtt-8">&#x00A0;</span><span
  6875. class="cmtt-8">&#x00A0;</span><span
  6876. class="cmtt-8">&#x00A0;</span><span
  6877. class="cmtt-8">&#x00A0;</span><span
  6878. class="cmtt-8">&#x00A0;</span><span
  6879. class="cmtt-8">&#x00A0;</span><span
  6880. class="cmtt-8">&#x00A0;</span><span
  6881. class="cmtt-8">&#x00A0;</span><span
  6882. class="cmtt-8">&#x00A0;</span><span
  6883. class="cmtt-8">&#x00A0;</span><span
  6884. class="cmtt-8">&#x00A0;</span><span
  6885. class="cmtt-8">&#x00A0;</span><span
  6886. class="cmtt-8">&#x00A0;</span><span
  6887. class="cmtt-8">&#x00A0;</span><span
  6888. class="cmtt-8">&#x00A0;</span><span
  6889. class="cmtt-8">&#x00A0;</span><span
  6890. class="cmtt-8">&#x00A0;</span><span
  6891. class="cmsy-8">}</span><span
  6892. class="cmtt-8">&#x00A0;else</span><span
  6893. class="cmtt-8">&#x00A0;[book]</span><span
  6894. class="cmtt-8">&#x00A0;is</span><span
  6895. class="cmtt-8">&#x00A0;less</span><span
  6896. class="cmtt-8">&#x00A0;than</span><span
  6897. class="cmtt-8">&#x00A0;zero</span><span
  6898. class="cmtt-8">&#x00A0;</span><span
  6899. class="cmsy-8">{</span>
  6900. <br class="fancyvrb" /><a
  6901. id="x1-100058r28"></a><span
  6902. class="cmr-6">28</span><span
  6903. class="cmtt-8">&#x00A0;</span><span
  6904. class="cmtt-8">&#x00A0;</span>
  6905. <br class="fancyvrb" /><a
  6906. id="x1-100060r29"></a><span
  6907. class="cmr-6">29</span><span
  6908. class="cmtt-8">&#x00A0;</span><span
  6909. class="cmtt-8">&#x00A0; </span><span
  6910. class="cmtt-8">&#x00A0;</span><span
  6911. class="cmtt-8">&#x00A0;</span><span
  6912. class="cmtt-8">&#x00A0;</span><span
  6913. class="cmtt-8">&#x00A0;</span><span
  6914. class="cmtt-8">&#x00A0;</span><span
  6915. class="cmtt-8">&#x00A0;</span><span
  6916. class="cmtt-8">&#x00A0;</span><span
  6917. class="cmtt-8">&#x00A0;</span><span
  6918. class="cmtt-8">&#x00A0;</span><span
  6919. class="cmtt-8">&#x00A0;</span><span
  6920. class="cmtt-8">&#x00A0;18)</span><span
  6921. class="cmtt-8">&#x00A0;vector</span><span
  6922. class="cmtt-8">&#x00A0;[floor1_Y]</span><span
  6923. class="cmtt-8">&#x00A0;element</span><span
  6924. class="cmtt-8">&#x00A0;([j]+[offset])</span><span
  6925. class="cmtt-8">&#x00A0;=</span><span
  6926. class="cmtt-8">&#x00A0;0</span>
  6927. <br class="fancyvrb" /><a
  6928. id="x1-100062r30"></a><span
  6929. class="cmr-6">30</span><span
  6930. class="cmtt-8">&#x00A0;</span><span
  6931. class="cmtt-8">&#x00A0;</span>
  6932. <br class="fancyvrb" /><a
  6933. id="x1-100064r31"></a><span
  6934. class="cmr-6">31</span><span
  6935. class="cmtt-8">&#x00A0;</span><span
  6936. class="cmtt-8">&#x00A0;</span><span
  6937. class="cmtt-8">&#x00A0;</span><span
  6938. class="cmtt-8">&#x00A0;</span><span
  6939. class="cmtt-8">&#x00A0;</span><span
  6940. class="cmtt-8">&#x00A0;</span><span
  6941. class="cmtt-8">&#x00A0;</span><span
  6942. class="cmtt-8">&#x00A0;</span><span
  6943. class="cmtt-8">&#x00A0;</span><span
  6944. class="cmtt-8">&#x00A0;</span><span
  6945. class="cmtt-8">&#x00A0;</span><span
  6946. class="cmtt-8">&#x00A0;</span><span
  6947. class="cmtt-8">&#x00A0;</span><span
  6948. class="cmtt-8">&#x00A0;</span><span
  6949. class="cmtt-8">&#x00A0;</span><span
  6950. class="cmtt-8">&#x00A0;</span><span
  6951. class="cmtt-8">&#x00A0;</span><span
  6952. class="cmtt-8">&#x00A0;</span><span
  6953. class="cmtt-8">&#x00A0;</span><span
  6954. class="cmsy-8">}</span>
  6955. <br class="fancyvrb" /><a
  6956. id="x1-100066r32"></a><span
  6957. class="cmr-6">32</span><span
  6958. class="cmtt-8">&#x00A0;</span><span
  6959. class="cmtt-8">&#x00A0;</span><span
  6960. class="cmtt-8">&#x00A0;</span><span
  6961. class="cmtt-8">&#x00A0;</span><span
  6962. class="cmtt-8">&#x00A0;</span><span
  6963. class="cmtt-8">&#x00A0;</span><span
  6964. class="cmtt-8">&#x00A0;</span><span
  6965. class="cmtt-8">&#x00A0;</span><span
  6966. class="cmtt-8">&#x00A0;</span><span
  6967. class="cmtt-8">&#x00A0;</span><span
  6968. class="cmtt-8">&#x00A0;</span><span
  6969. class="cmtt-8">&#x00A0;</span><span
  6970. class="cmsy-8">}</span>
  6971. <br class="fancyvrb" /><a
  6972. id="x1-100068r33"></a><span
  6973. class="cmr-6">33</span><span
  6974. class="cmtt-8">&#x00A0;</span><span
  6975. class="cmtt-8">&#x00A0;</span>
  6976. <br class="fancyvrb" /><a
  6977. id="x1-100070r34"></a><span
  6978. class="cmr-6">34</span><span
  6979. class="cmtt-8">&#x00A0;</span><span
  6980. class="cmtt-8">&#x00A0;</span><span
  6981. class="cmtt-8">&#x00A0;</span><span
  6982. class="cmtt-8">&#x00A0;</span><span
  6983. class="cmtt-8">&#x00A0;</span><span
  6984. class="cmtt-8">&#x00A0;</span><span
  6985. class="cmtt-8">&#x00A0;</span><span
  6986. class="cmtt-8">&#x00A0;19)</span><span
  6987. class="cmtt-8">&#x00A0;[offset]</span><span
  6988. class="cmtt-8">&#x00A0;=</span><span
  6989. class="cmtt-8">&#x00A0;[offset]</span><span
  6990. class="cmtt-8">&#x00A0;+</span><span
  6991. class="cmtt-8">&#x00A0;[cdim]</span>
  6992. <br class="fancyvrb" /><a
  6993. id="x1-100072r35"></a><span
  6994. class="cmr-6">35</span><span
  6995. class="cmtt-8">&#x00A0;</span><span
  6996. class="cmtt-8">&#x00A0;</span>
  6997. <br class="fancyvrb" /><a
  6998. id="x1-100074r36"></a><span
  6999. class="cmr-6">36</span><span
  7000. class="cmtt-8">&#x00A0;</span><span
  7001. class="cmtt-8">&#x00A0;</span><span
  7002. class="cmtt-8">&#x00A0;</span><span
  7003. class="cmtt-8">&#x00A0;</span><span
  7004. class="cmtt-8">&#x00A0;</span><span
  7005. class="cmtt-8">&#x00A0;</span><span
  7006. class="cmtt-8">&#x00A0;</span><span
  7007. class="cmsy-8">}</span>
  7008. <br class="fancyvrb" /><a
  7009. id="x1-100076r37"></a><span
  7010. class="cmr-6">37</span><span
  7011. class="cmtt-8">&#x00A0;</span><span
  7012. class="cmtt-8">&#x00A0;</span>
  7013. <br class="fancyvrb" /><a
  7014. id="x1-100078r38"></a><span
  7015. class="cmr-6">38</span><span
  7016. class="cmtt-8">&#x00A0;</span><span
  7017. class="cmtt-8">&#x00A0;</span><span
  7018. class="cmtt-8">&#x00A0;20)</span><span
  7019. class="cmtt-8">&#x00A0;done</span>
  7020. </div>
  7021. <!--l. 224--><p class="noindent" >An end-of-packet condition during curve decode should be considered a nominal occurrence; if
  7022. end-of-packet is reached during any read operation above, floor decode is to return &#8217;unused&#8217;
  7023. status as if the <span
  7024. class="cmtt-12">[nonzero] </span>flag had been unset at the beginning of decode.
  7025. <!--l. 230--><p class="noindent" >Vector <span
  7026. class="cmtt-12">[floor1_Y] </span>contains the values from packet decode needed for floor 1 synthesis.
  7027. <!--l. 235--><p class="noindent" ><span class="paragraphHead"><a
  7028. id="x1-1010007.2.2"></a><span
  7029. class="cmbx-12">curve computation</span></span>
  7030. Curve computation is split into two logical steps; the first step derives final Y amplitude values
  7031. from the encoded, wrapped difference values taken from the bitstream. The second step
  7032. plots the curve lines. Also, although zero-difference values are used in the iterative
  7033. prediction to find final Y values, these points are conditionally skipped during final
  7034. line computation in step two. Skipping zero-difference values allows a smoother line
  7035. fit.
  7036. <!--l. 245--><p class="noindent" >Although some aspects of the below algorithm look like inconsequential optimizations,
  7037. implementors are warned to follow the details closely. Deviation from implementing a strictly
  7038. equivalent algorithm can result in serious decoding errors.
  7039. <!--l. 250--><p class="noindent" >
  7040. <dl class="description"><dt class="description">
  7041. <span
  7042. class="cmssbx-10x-x-120">step 1: amplitude value synthesis</span> </dt><dd
  7043. class="description">
  7044. <!--l. 253--><p class="noindent" >Unwrap the always-positive-or-zero values read from the packet into +/- difference
  7045. values, then apply to line prediction.
  7046. <!--l. 256--><p class="noindent" >
  7047. <div class="fancyvrb" id="fancyvrb31">
  7048. <a
  7049. id="x1-101002r1"></a><span
  7050. class="cmr-6">1</span><span
  7051. class="cmtt-8">&#x00A0;</span><span
  7052. class="cmtt-8">&#x00A0;</span><span
  7053. class="cmtt-8">&#x00A0;</span><span
  7054. class="cmtt-8">&#x00A0;1)</span><span
  7055. class="cmtt-8">&#x00A0;[range]</span><span
  7056. class="cmtt-8">&#x00A0;=</span><span
  7057. class="cmtt-8">&#x00A0;vector</span><span
  7058. class="cmtt-8">&#x00A0;</span><span
  7059. class="cmsy-8">{</span><span
  7060. class="cmtt-8">&#x00A0;256,</span><span
  7061. class="cmtt-8">&#x00A0;128,</span><span
  7062. class="cmtt-8">&#x00A0;86,</span><span
  7063. class="cmtt-8">&#x00A0;64</span><span
  7064. class="cmtt-8">&#x00A0;</span><span
  7065. class="cmsy-8">}</span><span
  7066. class="cmtt-8">&#x00A0;element</span><span
  7067. class="cmtt-8">&#x00A0;([floor1_multiplier]-1)</span>
  7068. <br class="fancyvrb" /><a
  7069. id="x1-101004r2"></a><span
  7070. class="cmr-6">2</span><span
  7071. class="cmtt-8">&#x00A0;</span><span
  7072. class="cmtt-8">&#x00A0;</span><span
  7073. class="cmtt-8">&#x00A0;</span><span
  7074. class="cmtt-8">&#x00A0;2)</span><span
  7075. class="cmtt-8">&#x00A0;vector</span><span
  7076. class="cmtt-8">&#x00A0;[floor1_step2_flag]</span><span
  7077. class="cmtt-8">&#x00A0;element</span><span
  7078. class="cmtt-8">&#x00A0;[0]</span><span
  7079. class="cmtt-8">&#x00A0;=</span><span
  7080. class="cmtt-8">&#x00A0;set</span>
  7081. <br class="fancyvrb" /><a
  7082. id="x1-101006r3"></a><span
  7083. class="cmr-6">3</span><span
  7084. class="cmtt-8">&#x00A0;</span><span
  7085. class="cmtt-8">&#x00A0;</span><span
  7086. class="cmtt-8">&#x00A0;</span><span
  7087. class="cmtt-8">&#x00A0;3)</span><span
  7088. class="cmtt-8">&#x00A0;vector</span><span
  7089. class="cmtt-8">&#x00A0;[floor1_step2_flag]</span><span
  7090. class="cmtt-8">&#x00A0;element</span><span
  7091. class="cmtt-8">&#x00A0;[1]</span><span
  7092. class="cmtt-8">&#x00A0;=</span><span
  7093. class="cmtt-8">&#x00A0;set</span>
  7094. <br class="fancyvrb" /><a
  7095. id="x1-101008r4"></a><span
  7096. class="cmr-6">4</span><span
  7097. class="cmtt-8">&#x00A0;</span><span
  7098. class="cmtt-8">&#x00A0;</span><span
  7099. class="cmtt-8">&#x00A0;</span><span
  7100. class="cmtt-8">&#x00A0;4)</span><span
  7101. class="cmtt-8">&#x00A0;vector</span><span
  7102. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  7103. class="cmtt-8">&#x00A0;element</span><span
  7104. class="cmtt-8">&#x00A0;[0]</span><span
  7105. class="cmtt-8">&#x00A0;=</span><span
  7106. class="cmtt-8">&#x00A0;vector</span><span
  7107. class="cmtt-8">&#x00A0;[floor1_Y]</span><span
  7108. class="cmtt-8">&#x00A0;element</span><span
  7109. class="cmtt-8">&#x00A0;[0]</span>
  7110. <br class="fancyvrb" /><a
  7111. id="x1-101010r5"></a><span
  7112. class="cmr-6">5</span><span
  7113. class="cmtt-8">&#x00A0;</span><span
  7114. class="cmtt-8">&#x00A0;</span><span
  7115. class="cmtt-8">&#x00A0;</span><span
  7116. class="cmtt-8">&#x00A0;5)</span><span
  7117. class="cmtt-8">&#x00A0;vector</span><span
  7118. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  7119. class="cmtt-8">&#x00A0;element</span><span
  7120. class="cmtt-8">&#x00A0;[1]</span><span
  7121. class="cmtt-8">&#x00A0;=</span><span
  7122. class="cmtt-8">&#x00A0;vector</span><span
  7123. class="cmtt-8">&#x00A0;[floor1_Y]</span><span
  7124. class="cmtt-8">&#x00A0;element</span><span
  7125. class="cmtt-8">&#x00A0;[1]</span>
  7126. <br class="fancyvrb" /><a
  7127. id="x1-101012r6"></a><span
  7128. class="cmr-6">6</span><span
  7129. class="cmtt-8">&#x00A0;</span><span
  7130. class="cmtt-8">&#x00A0;</span><span
  7131. class="cmtt-8">&#x00A0;</span><span
  7132. class="cmtt-8">&#x00A0;6)</span><span
  7133. class="cmtt-8">&#x00A0;iterate</span><span
  7134. class="cmtt-8">&#x00A0;[i]</span><span
  7135. class="cmtt-8">&#x00A0;over</span><span
  7136. class="cmtt-8">&#x00A0;the</span><span
  7137. class="cmtt-8">&#x00A0;range</span><span
  7138. class="cmtt-8">&#x00A0;2</span><span
  7139. class="cmtt-8">&#x00A0;...</span><span
  7140. class="cmtt-8">&#x00A0;[floor1_values]-1</span><span
  7141. class="cmtt-8">&#x00A0;</span><span
  7142. class="cmsy-8">{</span>
  7143. <br class="fancyvrb" /><a
  7144. id="x1-101014r7"></a><span
  7145. class="cmr-6">7</span><span
  7146. class="cmtt-8">&#x00A0;</span><span
  7147. class="cmtt-8">&#x00A0;</span>
  7148. <br class="fancyvrb" /><a
  7149. id="x1-101016r8"></a><span
  7150. class="cmr-6">8</span><span
  7151. class="cmtt-8">&#x00A0;</span><span
  7152. class="cmtt-8">&#x00A0;</span><span
  7153. class="cmtt-8">&#x00A0;</span><span
  7154. class="cmtt-8">&#x00A0;</span><span
  7155. class="cmtt-8">&#x00A0;</span><span
  7156. class="cmtt-8">&#x00A0;</span><span
  7157. class="cmtt-8">&#x00A0;</span><span
  7158. class="cmtt-8">&#x00A0;</span><span
  7159. class="cmtt-8">&#x00A0;7)</span><span
  7160. class="cmtt-8">&#x00A0;[low_neighbor_offset]</span><span
  7161. class="cmtt-8">&#x00A0;=</span><span
  7162. class="cmtt-8">&#x00A0;</span><a
  7163. href="#x1-1200009.2.4"><span
  7164. class="cmtt-8">low_neighbor</span></a><span
  7165. class="cmtt-8">([floor1_X_list],[i])</span>
  7166. <br class="fancyvrb" /><a
  7167. id="x1-101018r9"></a><span
  7168. class="cmr-6">9</span><span
  7169. class="cmtt-8">&#x00A0;</span><span
  7170. class="cmtt-8">&#x00A0;</span><span
  7171. class="cmtt-8">&#x00A0;</span><span
  7172. class="cmtt-8">&#x00A0;</span><span
  7173. class="cmtt-8">&#x00A0;</span><span
  7174. class="cmtt-8">&#x00A0;</span><span
  7175. class="cmtt-8">&#x00A0;</span><span
  7176. class="cmtt-8">&#x00A0;</span><span
  7177. class="cmtt-8">&#x00A0;8)</span><span
  7178. class="cmtt-8">&#x00A0;[high_neighbor_offset]</span><span
  7179. class="cmtt-8">&#x00A0;=</span><span
  7180. class="cmtt-8">&#x00A0;</span><a
  7181. href="#x1-1210009.2.5"><span
  7182. class="cmtt-8">high_neighbor</span></a><span
  7183. class="cmtt-8">([floor1_X_list],[i])</span>
  7184. <br class="fancyvrb" /><a
  7185. id="x1-101020r10"></a><span
  7186. class="cmr-6">10</span><span
  7187. class="cmtt-8">&#x00A0;</span><span
  7188. class="cmtt-8">&#x00A0;</span>
  7189. <br class="fancyvrb" /><a
  7190. id="x1-101022r11"></a><span
  7191. class="cmr-6">11</span><span
  7192. class="cmtt-8">&#x00A0;</span><span
  7193. class="cmtt-8">&#x00A0;</span><span
  7194. class="cmtt-8">&#x00A0;</span><span
  7195. class="cmtt-8">&#x00A0;</span><span
  7196. class="cmtt-8">&#x00A0;</span><span
  7197. class="cmtt-8">&#x00A0;</span><span
  7198. class="cmtt-8">&#x00A0;</span><span
  7199. class="cmtt-8">&#x00A0;</span><span
  7200. class="cmtt-8">&#x00A0;9)</span><span
  7201. class="cmtt-8">&#x00A0;[predicted]</span><span
  7202. class="cmtt-8">&#x00A0;=</span><span
  7203. class="cmtt-8">&#x00A0;</span><a
  7204. href="#x1-1220009.2.6"><span
  7205. class="cmtt-8">render_point</span></a><span
  7206. class="cmtt-8">(</span><span
  7207. class="cmtt-8">&#x00A0;vector</span><span
  7208. class="cmtt-8">&#x00A0;[floor1_X_list]</span><span
  7209. class="cmtt-8">&#x00A0;element</span><span
  7210. class="cmtt-8">&#x00A0;[low_neighbor_offset],</span>
  7211. <br class="fancyvrb" /><a
  7212. id="x1-101024r12"></a><span
  7213. class="cmr-6">12</span><span
  7214. class="cmtt-8">&#x00A0;</span><span
  7215. class="cmtt-8">&#x00A0; </span><span
  7216. class="cmtt-8">&#x00A0;</span><span
  7217. class="cmtt-8">&#x00A0;</span><span
  7218. class="cmtt-8">&#x00A0;</span><span
  7219. class="cmtt-8">&#x00A0;</span><span
  7220. class="cmtt-8">&#x00A0;</span><span
  7221. class="cmtt-8">&#x00A0;vector</span><span
  7222. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  7223. class="cmtt-8">&#x00A0;element</span><span
  7224. class="cmtt-8">&#x00A0;[low_neighbor_offset],</span>
  7225. <br class="fancyvrb" /><a
  7226. id="x1-101026r13"></a><span
  7227. class="cmr-6">13</span><span
  7228. class="cmtt-8">&#x00A0;</span><span
  7229. class="cmtt-8">&#x00A0;</span><span
  7230. class="cmtt-8">&#x00A0;</span><span
  7231. class="cmtt-8">&#x00A0;</span><span
  7232. class="cmtt-8">&#x00A0;</span><span
  7233. class="cmtt-8">&#x00A0;</span><span
  7234. class="cmtt-8">&#x00A0;</span><span
  7235. class="cmtt-8">&#x00A0;</span><span
  7236. class="cmtt-8">&#x00A0;</span><span
  7237. class="cmtt-8">&#x00A0;</span><span
  7238. class="cmtt-8">&#x00A0;</span><span
  7239. class="cmtt-8">&#x00A0;</span><span
  7240. class="cmtt-8">&#x00A0;</span><span
  7241. class="cmtt-8">&#x00A0;</span><span
  7242. class="cmtt-8">&#x00A0;</span><span
  7243. class="cmtt-8">&#x00A0;</span><span
  7244. class="cmtt-8">&#x00A0;</span><span
  7245. class="cmtt-8">&#x00A0;</span><span
  7246. class="cmtt-8">&#x00A0;</span><span
  7247. class="cmtt-8">&#x00A0;</span><span
  7248. class="cmtt-8">&#x00A0;</span><span
  7249. class="cmtt-8">&#x00A0;</span><span
  7250. class="cmtt-8">&#x00A0;</span><span
  7251. class="cmtt-8">&#x00A0;</span><span
  7252. class="cmtt-8">&#x00A0;</span><span
  7253. class="cmtt-8">&#x00A0;</span><span
  7254. class="cmtt-8">&#x00A0;</span><span
  7255. class="cmtt-8">&#x00A0;</span><span
  7256. class="cmtt-8">&#x00A0;</span><span
  7257. class="cmtt-8">&#x00A0;</span><span
  7258. class="cmtt-8">&#x00A0;</span><span
  7259. class="cmtt-8">&#x00A0;</span><span
  7260. class="cmtt-8">&#x00A0;</span><span
  7261. class="cmtt-8">&#x00A0;</span><span
  7262. class="cmtt-8">&#x00A0;</span><span
  7263. class="cmtt-8">&#x00A0;</span><span
  7264. class="cmtt-8">&#x00A0;</span><span
  7265. class="cmtt-8">&#x00A0;</span><span
  7266. class="cmtt-8">&#x00A0;</span><span
  7267. class="cmtt-8">&#x00A0;vector</span><span
  7268. class="cmtt-8">&#x00A0;[floor1_X_list]</span><span
  7269. class="cmtt-8">&#x00A0;element</span><span
  7270. class="cmtt-8">&#x00A0;[high_neighbor_offset],</span>
  7271. <br class="fancyvrb" /><a
  7272. id="x1-101028r14"></a><span
  7273. class="cmr-6">14</span><span
  7274. class="cmtt-8">&#x00A0;</span><span
  7275. class="cmtt-8">&#x00A0; </span><span
  7276. class="cmtt-8">&#x00A0;</span><span
  7277. class="cmtt-8">&#x00A0;</span><span
  7278. class="cmtt-8">&#x00A0;</span><span
  7279. class="cmtt-8">&#x00A0;</span><span
  7280. class="cmtt-8">&#x00A0;</span><span
  7281. class="cmtt-8">&#x00A0;vector</span><span
  7282. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  7283. class="cmtt-8">&#x00A0;element</span><span
  7284. class="cmtt-8">&#x00A0;[high_neighbor_offset],</span>
  7285. <br class="fancyvrb" /><a
  7286. id="x1-101030r15"></a><span
  7287. class="cmr-6">15</span><span
  7288. class="cmtt-8">&#x00A0;</span><span
  7289. class="cmtt-8">&#x00A0;</span><span
  7290. class="cmtt-8">&#x00A0;</span><span
  7291. class="cmtt-8">&#x00A0;</span><span
  7292. class="cmtt-8">&#x00A0;</span><span
  7293. class="cmtt-8">&#x00A0;</span><span
  7294. class="cmtt-8">&#x00A0;</span><span
  7295. class="cmtt-8">&#x00A0;</span><span
  7296. class="cmtt-8">&#x00A0;</span><span
  7297. class="cmtt-8">&#x00A0;</span><span
  7298. class="cmtt-8">&#x00A0;</span><span
  7299. class="cmtt-8">&#x00A0;</span><span
  7300. class="cmtt-8">&#x00A0;</span><span
  7301. class="cmtt-8">&#x00A0;</span><span
  7302. class="cmtt-8">&#x00A0;</span><span
  7303. class="cmtt-8">&#x00A0;</span><span
  7304. class="cmtt-8">&#x00A0;</span><span
  7305. class="cmtt-8">&#x00A0;</span><span
  7306. class="cmtt-8">&#x00A0;</span><span
  7307. class="cmtt-8">&#x00A0;</span><span
  7308. class="cmtt-8">&#x00A0;</span><span
  7309. class="cmtt-8">&#x00A0;</span><span
  7310. class="cmtt-8">&#x00A0;</span><span
  7311. class="cmtt-8">&#x00A0;</span><span
  7312. class="cmtt-8">&#x00A0;</span><span
  7313. class="cmtt-8">&#x00A0;</span><span
  7314. class="cmtt-8">&#x00A0;</span><span
  7315. class="cmtt-8">&#x00A0;</span><span
  7316. class="cmtt-8">&#x00A0;</span><span
  7317. class="cmtt-8">&#x00A0;</span><span
  7318. class="cmtt-8">&#x00A0;</span><span
  7319. class="cmtt-8">&#x00A0;</span><span
  7320. class="cmtt-8">&#x00A0;</span><span
  7321. class="cmtt-8">&#x00A0;</span><span
  7322. class="cmtt-8">&#x00A0;</span><span
  7323. class="cmtt-8">&#x00A0;</span><span
  7324. class="cmtt-8">&#x00A0;</span><span
  7325. class="cmtt-8">&#x00A0;</span><span
  7326. class="cmtt-8">&#x00A0;</span><span
  7327. class="cmtt-8">&#x00A0;vector</span><span
  7328. class="cmtt-8">&#x00A0;[floor1_X_list]</span><span
  7329. class="cmtt-8">&#x00A0;element</span><span
  7330. class="cmtt-8">&#x00A0;[i]</span><span
  7331. class="cmtt-8">&#x00A0;)</span>
  7332. <br class="fancyvrb" /><a
  7333. id="x1-101032r16"></a><span
  7334. class="cmr-6">16</span><span
  7335. class="cmtt-8">&#x00A0;</span><span
  7336. class="cmtt-8">&#x00A0;</span>
  7337. <br class="fancyvrb" /><a
  7338. id="x1-101034r17"></a><span
  7339. class="cmr-6">17</span><span
  7340. class="cmtt-8">&#x00A0;</span><span
  7341. class="cmtt-8">&#x00A0;</span><span
  7342. class="cmtt-8">&#x00A0;</span><span
  7343. class="cmtt-8">&#x00A0;</span><span
  7344. class="cmtt-8">&#x00A0;</span><span
  7345. class="cmtt-8">&#x00A0;</span><span
  7346. class="cmtt-8">&#x00A0;</span><span
  7347. class="cmtt-8">&#x00A0;10)</span><span
  7348. class="cmtt-8">&#x00A0;[val]</span><span
  7349. class="cmtt-8">&#x00A0;=</span><span
  7350. class="cmtt-8">&#x00A0;vector</span><span
  7351. class="cmtt-8">&#x00A0;[floor1_Y]</span><span
  7352. class="cmtt-8">&#x00A0;element</span><span
  7353. class="cmtt-8">&#x00A0;[i]</span>
  7354. <br class="fancyvrb" /><a
  7355. id="x1-101036r18"></a><span
  7356. class="cmr-6">18</span><span
  7357. class="cmtt-8">&#x00A0;</span><span
  7358. class="cmtt-8">&#x00A0;</span><span
  7359. class="cmtt-8">&#x00A0;</span><span
  7360. class="cmtt-8">&#x00A0;</span><span
  7361. class="cmtt-8">&#x00A0;</span><span
  7362. class="cmtt-8">&#x00A0;</span><span
  7363. class="cmtt-8">&#x00A0;</span><span
  7364. class="cmtt-8">&#x00A0;11)</span><span
  7365. class="cmtt-8">&#x00A0;[highroom]</span><span
  7366. class="cmtt-8">&#x00A0;=</span><span
  7367. class="cmtt-8">&#x00A0;[range]</span><span
  7368. class="cmtt-8">&#x00A0;-</span><span
  7369. class="cmtt-8">&#x00A0;[predicted]</span>
  7370. <br class="fancyvrb" /><a
  7371. id="x1-101038r19"></a><span
  7372. class="cmr-6">19</span><span
  7373. class="cmtt-8">&#x00A0;</span><span
  7374. class="cmtt-8">&#x00A0;</span><span
  7375. class="cmtt-8">&#x00A0;</span><span
  7376. class="cmtt-8">&#x00A0;</span><span
  7377. class="cmtt-8">&#x00A0;</span><span
  7378. class="cmtt-8">&#x00A0;</span><span
  7379. class="cmtt-8">&#x00A0;</span><span
  7380. class="cmtt-8">&#x00A0;12)</span><span
  7381. class="cmtt-8">&#x00A0;[lowroom]</span><span
  7382. class="cmtt-8">&#x00A0;</span><span
  7383. class="cmtt-8">&#x00A0;=</span><span
  7384. class="cmtt-8">&#x00A0;[predicted]</span>
  7385. <br class="fancyvrb" /><a
  7386. id="x1-101040r20"></a><span
  7387. class="cmr-6">20</span><span
  7388. class="cmtt-8">&#x00A0;</span><span
  7389. class="cmtt-8">&#x00A0;</span><span
  7390. class="cmtt-8">&#x00A0;</span><span
  7391. class="cmtt-8">&#x00A0;</span><span
  7392. class="cmtt-8">&#x00A0;</span><span
  7393. class="cmtt-8">&#x00A0;</span><span
  7394. class="cmtt-8">&#x00A0;</span><span
  7395. class="cmtt-8">&#x00A0;13)</span><span
  7396. class="cmtt-8">&#x00A0;if</span><span
  7397. class="cmtt-8">&#x00A0;(</span><span
  7398. class="cmtt-8">&#x00A0;[highroom]</span><span
  7399. class="cmtt-8">&#x00A0;is</span><span
  7400. class="cmtt-8">&#x00A0;less</span><span
  7401. class="cmtt-8">&#x00A0;than</span><span
  7402. class="cmtt-8">&#x00A0;[lowroom]</span><span
  7403. class="cmtt-8">&#x00A0;)</span><span
  7404. class="cmtt-8">&#x00A0;</span><span
  7405. class="cmsy-8">{</span>
  7406. <br class="fancyvrb" /><a
  7407. id="x1-101042r21"></a><span
  7408. class="cmr-6">21</span><span
  7409. class="cmtt-8">&#x00A0;</span><span
  7410. class="cmtt-8">&#x00A0;</span>
  7411. <br class="fancyvrb" /><a
  7412. id="x1-101044r22"></a><span
  7413. class="cmr-6">22</span><span
  7414. class="cmtt-8">&#x00A0;</span><span
  7415. class="cmtt-8">&#x00A0;</span><span
  7416. class="cmtt-8">&#x00A0;</span><span
  7417. class="cmtt-8">&#x00A0;</span><span
  7418. class="cmtt-8">&#x00A0;</span><span
  7419. class="cmtt-8">&#x00A0;</span><span
  7420. class="cmtt-8">&#x00A0;</span><span
  7421. class="cmtt-8">&#x00A0;</span><span
  7422. class="cmtt-8">&#x00A0;</span><span
  7423. class="cmtt-8">&#x00A0;</span><span
  7424. class="cmtt-8">&#x00A0;</span><span
  7425. class="cmtt-8">&#x00A0;</span><span
  7426. class="cmtt-8">&#x00A0;</span><span
  7427. class="cmtt-8">&#x00A0;14)</span><span
  7428. class="cmtt-8">&#x00A0;[room]</span><span
  7429. class="cmtt-8">&#x00A0;=</span><span
  7430. class="cmtt-8">&#x00A0;[highroom]</span><span
  7431. class="cmtt-8">&#x00A0;*</span><span
  7432. class="cmtt-8">&#x00A0;2</span>
  7433. <br class="fancyvrb" /><a
  7434. id="x1-101046r23"></a><span
  7435. class="cmr-6">23</span><span
  7436. class="cmtt-8">&#x00A0;</span><span
  7437. class="cmtt-8">&#x00A0;</span>
  7438. <br class="fancyvrb" /><a
  7439. id="x1-101048r24"></a><span
  7440. class="cmr-6">24</span><span
  7441. class="cmtt-8">&#x00A0;</span><span
  7442. class="cmtt-8">&#x00A0;</span><span
  7443. class="cmtt-8">&#x00A0;</span><span
  7444. class="cmtt-8">&#x00A0;</span><span
  7445. class="cmtt-8">&#x00A0;</span><span
  7446. class="cmtt-8">&#x00A0;</span><span
  7447. class="cmtt-8">&#x00A0;</span><span
  7448. class="cmtt-8">&#x00A0;</span><span
  7449. class="cmtt-8">&#x00A0;</span><span
  7450. class="cmtt-8">&#x00A0;</span><span
  7451. class="cmtt-8">&#x00A0;</span><span
  7452. class="cmtt-8">&#x00A0;</span><span
  7453. class="cmsy-8">}</span><span
  7454. class="cmtt-8">&#x00A0;else</span><span
  7455. class="cmtt-8">&#x00A0;[highroom]</span><span
  7456. class="cmtt-8">&#x00A0;is</span><span
  7457. class="cmtt-8">&#x00A0;not</span><span
  7458. class="cmtt-8">&#x00A0;less</span><span
  7459. class="cmtt-8">&#x00A0;than</span><span
  7460. class="cmtt-8">&#x00A0;[lowroom]</span><span
  7461. class="cmtt-8">&#x00A0;</span><span
  7462. class="cmsy-8">{</span>
  7463. <br class="fancyvrb" /><a
  7464. id="x1-101050r25"></a><span
  7465. class="cmr-6">25</span><span
  7466. class="cmtt-8">&#x00A0;</span><span
  7467. class="cmtt-8">&#x00A0;</span>
  7468. <br class="fancyvrb" /><a
  7469. id="x1-101052r26"></a><span
  7470. class="cmr-6">26</span><span
  7471. class="cmtt-8">&#x00A0;</span><span
  7472. class="cmtt-8">&#x00A0;</span><span
  7473. class="cmtt-8">&#x00A0;</span><span
  7474. class="cmtt-8">&#x00A0;</span><span
  7475. class="cmtt-8">&#x00A0;</span><span
  7476. class="cmtt-8">&#x00A0;</span><span
  7477. class="cmtt-8">&#x00A0;</span><span
  7478. class="cmtt-8">&#x00A0;</span><span
  7479. class="cmtt-8">&#x00A0;</span><span
  7480. class="cmtt-8">&#x00A0;</span><span
  7481. class="cmtt-8">&#x00A0;</span><span
  7482. class="cmtt-8">&#x00A0;</span><span
  7483. class="cmtt-8">&#x00A0;</span><span
  7484. class="cmtt-8">&#x00A0;15)</span><span
  7485. class="cmtt-8">&#x00A0;[room]</span><span
  7486. class="cmtt-8">&#x00A0;=</span><span
  7487. class="cmtt-8">&#x00A0;[lowroom]</span><span
  7488. class="cmtt-8">&#x00A0;*</span><span
  7489. class="cmtt-8">&#x00A0;2</span>
  7490. <br class="fancyvrb" /><a
  7491. id="x1-101054r27"></a><span
  7492. class="cmr-6">27</span><span
  7493. class="cmtt-8">&#x00A0;</span><span
  7494. class="cmtt-8">&#x00A0;</span>
  7495. <br class="fancyvrb" /><a
  7496. id="x1-101056r28"></a><span
  7497. class="cmr-6">28</span><span
  7498. class="cmtt-8">&#x00A0;</span><span
  7499. class="cmtt-8">&#x00A0;</span><span
  7500. class="cmtt-8">&#x00A0;</span><span
  7501. class="cmtt-8">&#x00A0;</span><span
  7502. class="cmtt-8">&#x00A0;</span><span
  7503. class="cmtt-8">&#x00A0;</span><span
  7504. class="cmtt-8">&#x00A0;</span><span
  7505. class="cmtt-8">&#x00A0;</span><span
  7506. class="cmtt-8">&#x00A0;</span><span
  7507. class="cmtt-8">&#x00A0;</span><span
  7508. class="cmtt-8">&#x00A0;</span><span
  7509. class="cmtt-8">&#x00A0;</span><span
  7510. class="cmsy-8">}</span>
  7511. <br class="fancyvrb" /><a
  7512. id="x1-101058r29"></a><span
  7513. class="cmr-6">29</span><span
  7514. class="cmtt-8">&#x00A0;</span><span
  7515. class="cmtt-8">&#x00A0;</span>
  7516. <br class="fancyvrb" /><a
  7517. id="x1-101060r30"></a><span
  7518. class="cmr-6">30</span><span
  7519. class="cmtt-8">&#x00A0;</span><span
  7520. class="cmtt-8">&#x00A0;</span><span
  7521. class="cmtt-8">&#x00A0;</span><span
  7522. class="cmtt-8">&#x00A0;</span><span
  7523. class="cmtt-8">&#x00A0;</span><span
  7524. class="cmtt-8">&#x00A0;</span><span
  7525. class="cmtt-8">&#x00A0;</span><span
  7526. class="cmtt-8">&#x00A0;16)</span><span
  7527. class="cmtt-8">&#x00A0;if</span><span
  7528. class="cmtt-8">&#x00A0;(</span><span
  7529. class="cmtt-8">&#x00A0;[val]</span><span
  7530. class="cmtt-8">&#x00A0;is</span><span
  7531. class="cmtt-8">&#x00A0;nonzero</span><span
  7532. class="cmtt-8">&#x00A0;)</span><span
  7533. class="cmtt-8">&#x00A0;</span><span
  7534. class="cmsy-8">{</span>
  7535. <br class="fancyvrb" /><a
  7536. id="x1-101062r31"></a><span
  7537. class="cmr-6">31</span><span
  7538. class="cmtt-8">&#x00A0;</span><span
  7539. class="cmtt-8">&#x00A0;</span>
  7540. <br class="fancyvrb" /><a
  7541. id="x1-101064r32"></a><span
  7542. class="cmr-6">32</span><span
  7543. class="cmtt-8">&#x00A0;</span><span
  7544. class="cmtt-8">&#x00A0;</span><span
  7545. class="cmtt-8">&#x00A0;</span><span
  7546. class="cmtt-8">&#x00A0;</span><span
  7547. class="cmtt-8">&#x00A0;</span><span
  7548. class="cmtt-8">&#x00A0;</span><span
  7549. class="cmtt-8">&#x00A0;</span><span
  7550. class="cmtt-8">&#x00A0;</span><span
  7551. class="cmtt-8">&#x00A0;</span><span
  7552. class="cmtt-8">&#x00A0;</span><span
  7553. class="cmtt-8">&#x00A0;</span><span
  7554. class="cmtt-8">&#x00A0;</span><span
  7555. class="cmtt-8">&#x00A0;</span><span
  7556. class="cmtt-8">&#x00A0;17)</span><span
  7557. class="cmtt-8">&#x00A0;vector</span><span
  7558. class="cmtt-8">&#x00A0;[floor1_step2_flag]</span><span
  7559. class="cmtt-8">&#x00A0;element</span><span
  7560. class="cmtt-8">&#x00A0;[low_neighbor_offset]</span><span
  7561. class="cmtt-8">&#x00A0;=</span><span
  7562. class="cmtt-8">&#x00A0;set</span>
  7563. <br class="fancyvrb" /><a
  7564. id="x1-101066r33"></a><span
  7565. class="cmr-6">33</span><span
  7566. class="cmtt-8">&#x00A0;</span><span
  7567. class="cmtt-8">&#x00A0;</span><span
  7568. class="cmtt-8">&#x00A0;</span><span
  7569. class="cmtt-8">&#x00A0;</span><span
  7570. class="cmtt-8">&#x00A0;</span><span
  7571. class="cmtt-8">&#x00A0;</span><span
  7572. class="cmtt-8">&#x00A0;</span><span
  7573. class="cmtt-8">&#x00A0;</span><span
  7574. class="cmtt-8">&#x00A0;</span><span
  7575. class="cmtt-8">&#x00A0;</span><span
  7576. class="cmtt-8">&#x00A0;</span><span
  7577. class="cmtt-8">&#x00A0;</span><span
  7578. class="cmtt-8">&#x00A0;</span><span
  7579. class="cmtt-8">&#x00A0;18)</span><span
  7580. class="cmtt-8">&#x00A0;vector</span><span
  7581. class="cmtt-8">&#x00A0;[floor1_step2_flag]</span><span
  7582. class="cmtt-8">&#x00A0;element</span><span
  7583. class="cmtt-8">&#x00A0;[high_neighbor_offset]</span><span
  7584. class="cmtt-8">&#x00A0;=</span><span
  7585. class="cmtt-8">&#x00A0;set</span>
  7586. <br class="fancyvrb" /><a
  7587. id="x1-101068r34"></a><span
  7588. class="cmr-6">34</span><span
  7589. class="cmtt-8">&#x00A0;</span><span
  7590. class="cmtt-8">&#x00A0;</span><span
  7591. class="cmtt-8">&#x00A0;</span><span
  7592. class="cmtt-8">&#x00A0;</span><span
  7593. class="cmtt-8">&#x00A0;</span><span
  7594. class="cmtt-8">&#x00A0;</span><span
  7595. class="cmtt-8">&#x00A0;</span><span
  7596. class="cmtt-8">&#x00A0;</span><span
  7597. class="cmtt-8">&#x00A0;</span><span
  7598. class="cmtt-8">&#x00A0;</span><span
  7599. class="cmtt-8">&#x00A0;</span><span
  7600. class="cmtt-8">&#x00A0;</span><span
  7601. class="cmtt-8">&#x00A0;</span><span
  7602. class="cmtt-8">&#x00A0;19)</span><span
  7603. class="cmtt-8">&#x00A0;vector</span><span
  7604. class="cmtt-8">&#x00A0;[floor1_step2_flag]</span><span
  7605. class="cmtt-8">&#x00A0;element</span><span
  7606. class="cmtt-8">&#x00A0;[i]</span><span
  7607. class="cmtt-8">&#x00A0;=</span><span
  7608. class="cmtt-8">&#x00A0;set</span>
  7609. <br class="fancyvrb" /><a
  7610. id="x1-101070r35"></a><span
  7611. class="cmr-6">35</span><span
  7612. class="cmtt-8">&#x00A0;</span><span
  7613. class="cmtt-8">&#x00A0;</span><span
  7614. class="cmtt-8">&#x00A0;</span><span
  7615. class="cmtt-8">&#x00A0;</span><span
  7616. class="cmtt-8">&#x00A0;</span><span
  7617. class="cmtt-8">&#x00A0;</span><span
  7618. class="cmtt-8">&#x00A0;</span><span
  7619. class="cmtt-8">&#x00A0;</span><span
  7620. class="cmtt-8">&#x00A0;</span><span
  7621. class="cmtt-8">&#x00A0;</span><span
  7622. class="cmtt-8">&#x00A0;</span><span
  7623. class="cmtt-8">&#x00A0;</span><span
  7624. class="cmtt-8">&#x00A0;</span><span
  7625. class="cmtt-8">&#x00A0;20)</span><span
  7626. class="cmtt-8">&#x00A0;if</span><span
  7627. class="cmtt-8">&#x00A0;(</span><span
  7628. class="cmtt-8">&#x00A0;[val]</span><span
  7629. class="cmtt-8">&#x00A0;is</span><span
  7630. class="cmtt-8">&#x00A0;greater</span><span
  7631. class="cmtt-8">&#x00A0;than</span><span
  7632. class="cmtt-8">&#x00A0;or</span><span
  7633. class="cmtt-8">&#x00A0;equal</span><span
  7634. class="cmtt-8">&#x00A0;to</span><span
  7635. class="cmtt-8">&#x00A0;[room]</span><span
  7636. class="cmtt-8">&#x00A0;)</span><span
  7637. class="cmtt-8">&#x00A0;</span><span
  7638. class="cmsy-8">{</span>
  7639. <br class="fancyvrb" /><a
  7640. id="x1-101072r36"></a><span
  7641. class="cmr-6">36</span><span
  7642. class="cmtt-8">&#x00A0;</span><span
  7643. class="cmtt-8">&#x00A0;</span>
  7644. <br class="fancyvrb" /><a
  7645. id="x1-101074r37"></a><span
  7646. class="cmr-6">37</span><span
  7647. class="cmtt-8">&#x00A0;</span><span
  7648. class="cmtt-8">&#x00A0;</span><span
  7649. class="cmtt-8">&#x00A0;</span><span
  7650. class="cmtt-8">&#x00A0;</span><span
  7651. class="cmtt-8">&#x00A0;</span><span
  7652. class="cmtt-8">&#x00A0;</span><span
  7653. class="cmtt-8">&#x00A0;</span><span
  7654. class="cmtt-8">&#x00A0;</span><span
  7655. class="cmtt-8">&#x00A0;</span><span
  7656. class="cmtt-8">&#x00A0;</span><span
  7657. class="cmtt-8">&#x00A0;</span><span
  7658. class="cmtt-8">&#x00A0;</span><span
  7659. class="cmtt-8">&#x00A0;</span><span
  7660. class="cmtt-8">&#x00A0;</span><span
  7661. class="cmtt-8">&#x00A0;</span><span
  7662. class="cmtt-8">&#x00A0;</span><span
  7663. class="cmtt-8">&#x00A0;</span><span
  7664. class="cmtt-8">&#x00A0;</span><span
  7665. class="cmtt-8">&#x00A0;</span><span
  7666. class="cmtt-8">&#x00A0;21)</span><span
  7667. class="cmtt-8">&#x00A0;if</span><span
  7668. class="cmtt-8">&#x00A0;(</span><span
  7669. class="cmtt-8">&#x00A0;[highroom]</span><span
  7670. class="cmtt-8">&#x00A0;is</span><span
  7671. class="cmtt-8">&#x00A0;greater</span><span
  7672. class="cmtt-8">&#x00A0;than</span><span
  7673. class="cmtt-8">&#x00A0;[lowroom]</span><span
  7674. class="cmtt-8">&#x00A0;)</span><span
  7675. class="cmtt-8">&#x00A0;</span><span
  7676. class="cmsy-8">{</span>
  7677. <br class="fancyvrb" /><a
  7678. id="x1-101076r38"></a><span
  7679. class="cmr-6">38</span><span
  7680. class="cmtt-8">&#x00A0;</span><span
  7681. class="cmtt-8">&#x00A0;</span>
  7682. <br class="fancyvrb" /><a
  7683. id="x1-101078r39"></a><span
  7684. class="cmr-6">39</span><span
  7685. class="cmtt-8">&#x00A0;</span><span
  7686. class="cmtt-8">&#x00A0;</span><span
  7687. class="cmtt-8">&#x00A0;</span><span
  7688. class="cmtt-8">&#x00A0;</span><span
  7689. class="cmtt-8">&#x00A0;</span><span
  7690. class="cmtt-8">&#x00A0;</span><span
  7691. class="cmtt-8">&#x00A0;</span><span
  7692. class="cmtt-8">&#x00A0;</span><span
  7693. class="cmtt-8">&#x00A0;</span><span
  7694. class="cmtt-8">&#x00A0;</span><span
  7695. class="cmtt-8">&#x00A0;</span><span
  7696. class="cmtt-8">&#x00A0;</span><span
  7697. class="cmtt-8">&#x00A0;</span><span
  7698. class="cmtt-8">&#x00A0;</span><span
  7699. class="cmtt-8">&#x00A0;</span><span
  7700. class="cmtt-8">&#x00A0;</span><span
  7701. class="cmtt-8">&#x00A0;</span><span
  7702. class="cmtt-8">&#x00A0;</span><span
  7703. class="cmtt-8">&#x00A0;</span><span
  7704. class="cmtt-8">&#x00A0;</span><span
  7705. class="cmtt-8">&#x00A0;</span><span
  7706. class="cmtt-8">&#x00A0;</span><span
  7707. class="cmtt-8">&#x00A0;</span><span
  7708. class="cmtt-8">&#x00A0;</span><span
  7709. class="cmtt-8">&#x00A0;</span><span
  7710. class="cmtt-8">&#x00A0;22)</span><span
  7711. class="cmtt-8">&#x00A0;vector</span><span
  7712. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  7713. class="cmtt-8">&#x00A0;element</span><span
  7714. class="cmtt-8">&#x00A0;[i]</span><span
  7715. class="cmtt-8">&#x00A0;=</span><span
  7716. class="cmtt-8">&#x00A0;[val]</span><span
  7717. class="cmtt-8">&#x00A0;-</span><span
  7718. class="cmtt-8">&#x00A0;[lowroom]</span><span
  7719. class="cmtt-8">&#x00A0;+</span><span
  7720. class="cmtt-8">&#x00A0;[predicted]</span>
  7721. <br class="fancyvrb" /><a
  7722. id="x1-101080r40"></a><span
  7723. class="cmr-6">40</span><span
  7724. class="cmtt-8">&#x00A0;</span><span
  7725. class="cmtt-8">&#x00A0;</span>
  7726. <br class="fancyvrb" /><a
  7727. id="x1-101082r41"></a><span
  7728. class="cmr-6">41</span><span
  7729. class="cmtt-8">&#x00A0;</span><span
  7730. class="cmtt-8">&#x00A0; </span><span
  7731. class="cmtt-8">&#x00A0;</span><span
  7732. class="cmtt-8">&#x00A0;</span><span
  7733. class="cmtt-8">&#x00A0;</span><span
  7734. class="cmtt-8">&#x00A0;</span><span
  7735. class="cmtt-8">&#x00A0;</span><span
  7736. class="cmtt-8">&#x00A0;</span><span
  7737. class="cmsy-8">}</span><span
  7738. class="cmtt-8">&#x00A0;else</span><span
  7739. class="cmtt-8">&#x00A0;[highroom]</span><span
  7740. class="cmtt-8">&#x00A0;is</span><span
  7741. class="cmtt-8">&#x00A0;not</span><span
  7742. class="cmtt-8">&#x00A0;greater</span><span
  7743. class="cmtt-8">&#x00A0;than</span><span
  7744. class="cmtt-8">&#x00A0;[lowroom]</span><span
  7745. class="cmtt-8">&#x00A0;</span><span
  7746. class="cmsy-8">{</span>
  7747. <br class="fancyvrb" /><a
  7748. id="x1-101084r42"></a><span
  7749. class="cmr-6">42</span><span
  7750. class="cmtt-8">&#x00A0;</span><span
  7751. class="cmtt-8">&#x00A0;</span>
  7752. <br class="fancyvrb" /><a
  7753. id="x1-101086r43"></a><span
  7754. class="cmr-6">43</span><span
  7755. class="cmtt-8">&#x00A0;</span><span
  7756. class="cmtt-8">&#x00A0;</span><span
  7757. class="cmtt-8">&#x00A0;</span><span
  7758. class="cmtt-8">&#x00A0;</span><span
  7759. class="cmtt-8">&#x00A0;</span><span
  7760. class="cmtt-8">&#x00A0;</span><span
  7761. class="cmtt-8">&#x00A0;</span><span
  7762. class="cmtt-8">&#x00A0;</span><span
  7763. class="cmtt-8">&#x00A0;</span><span
  7764. class="cmtt-8">&#x00A0;</span><span
  7765. class="cmtt-8">&#x00A0;</span><span
  7766. class="cmtt-8">&#x00A0;</span><span
  7767. class="cmtt-8">&#x00A0;</span><span
  7768. class="cmtt-8">&#x00A0;</span><span
  7769. class="cmtt-8">&#x00A0;</span><span
  7770. class="cmtt-8">&#x00A0;</span><span
  7771. class="cmtt-8">&#x00A0;</span><span
  7772. class="cmtt-8">&#x00A0;</span><span
  7773. class="cmtt-8">&#x00A0;</span><span
  7774. class="cmtt-8">&#x00A0;</span><span
  7775. class="cmtt-8">&#x00A0;</span><span
  7776. class="cmtt-8">&#x00A0;</span><span
  7777. class="cmtt-8">&#x00A0;</span><span
  7778. class="cmtt-8">&#x00A0;</span><span
  7779. class="cmtt-8">&#x00A0;</span><span
  7780. class="cmtt-8">&#x00A0;23)</span><span
  7781. class="cmtt-8">&#x00A0;vector</span><span
  7782. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  7783. class="cmtt-8">&#x00A0;element</span><span
  7784. class="cmtt-8">&#x00A0;[i]</span><span
  7785. class="cmtt-8">&#x00A0;=</span><span
  7786. class="cmtt-8">&#x00A0;[predicted]</span><span
  7787. class="cmtt-8">&#x00A0;-</span><span
  7788. class="cmtt-8">&#x00A0;[val]</span><span
  7789. class="cmtt-8">&#x00A0;+</span><span
  7790. class="cmtt-8">&#x00A0;[highroom]</span><span
  7791. class="cmtt-8">&#x00A0;-</span><span
  7792. class="cmtt-8">&#x00A0;1</span>
  7793. <br class="fancyvrb" /><a
  7794. id="x1-101088r44"></a><span
  7795. class="cmr-6">44</span><span
  7796. class="cmtt-8">&#x00A0;</span><span
  7797. class="cmtt-8">&#x00A0;</span>
  7798. <br class="fancyvrb" /><a
  7799. id="x1-101090r45"></a><span
  7800. class="cmr-6">45</span><span
  7801. class="cmtt-8">&#x00A0;</span><span
  7802. class="cmtt-8">&#x00A0;</span><span
  7803. class="cmtt-8">&#x00A0;</span><span
  7804. class="cmtt-8">&#x00A0;</span><span
  7805. class="cmtt-8">&#x00A0;</span><span
  7806. class="cmtt-8">&#x00A0;</span><span
  7807. class="cmtt-8">&#x00A0;</span><span
  7808. class="cmtt-8">&#x00A0;</span><span
  7809. class="cmtt-8">&#x00A0;</span><span
  7810. class="cmtt-8">&#x00A0;</span><span
  7811. class="cmtt-8">&#x00A0;</span><span
  7812. class="cmtt-8">&#x00A0;</span><span
  7813. class="cmtt-8">&#x00A0;</span><span
  7814. class="cmtt-8">&#x00A0;</span><span
  7815. class="cmtt-8">&#x00A0;</span><span
  7816. class="cmtt-8">&#x00A0;</span><span
  7817. class="cmtt-8">&#x00A0;</span><span
  7818. class="cmtt-8">&#x00A0;</span><span
  7819. class="cmtt-8">&#x00A0;</span><span
  7820. class="cmtt-8">&#x00A0;</span><span
  7821. class="cmtt-8">&#x00A0;</span><span
  7822. class="cmtt-8">&#x00A0;</span><span
  7823. class="cmtt-8">&#x00A0;</span><span
  7824. class="cmtt-8">&#x00A0;</span><span
  7825. class="cmsy-8">}</span>
  7826. <br class="fancyvrb" /><a
  7827. id="x1-101092r46"></a><span
  7828. class="cmr-6">46</span><span
  7829. class="cmtt-8">&#x00A0;</span><span
  7830. class="cmtt-8">&#x00A0;</span>
  7831. <br class="fancyvrb" /><a
  7832. id="x1-101094r47"></a><span
  7833. class="cmr-6">47</span><span
  7834. class="cmtt-8">&#x00A0;</span><span
  7835. class="cmtt-8">&#x00A0;</span><span
  7836. class="cmtt-8">&#x00A0;</span><span
  7837. class="cmtt-8">&#x00A0;</span><span
  7838. class="cmtt-8">&#x00A0;</span><span
  7839. class="cmtt-8">&#x00A0;</span><span
  7840. class="cmtt-8">&#x00A0;</span><span
  7841. class="cmtt-8">&#x00A0;</span><span
  7842. class="cmtt-8">&#x00A0;</span><span
  7843. class="cmtt-8">&#x00A0;</span><span
  7844. class="cmtt-8">&#x00A0;</span><span
  7845. class="cmtt-8">&#x00A0;</span><span
  7846. class="cmtt-8">&#x00A0;</span><span
  7847. class="cmtt-8">&#x00A0;</span><span
  7848. class="cmtt-8">&#x00A0;</span><span
  7849. class="cmtt-8">&#x00A0;</span><span
  7850. class="cmtt-8">&#x00A0;</span><span
  7851. class="cmtt-8">&#x00A0;</span><span
  7852. class="cmsy-8">}</span><span
  7853. class="cmtt-8">&#x00A0;else</span><span
  7854. class="cmtt-8">&#x00A0;[val]</span><span
  7855. class="cmtt-8">&#x00A0;is</span><span
  7856. class="cmtt-8">&#x00A0;less</span><span
  7857. class="cmtt-8">&#x00A0;than</span><span
  7858. class="cmtt-8">&#x00A0;[room]</span><span
  7859. class="cmtt-8">&#x00A0;</span><span
  7860. class="cmsy-8">{</span>
  7861. <br class="fancyvrb" /><a
  7862. id="x1-101096r48"></a><span
  7863. class="cmr-6">48</span><span
  7864. class="cmtt-8">&#x00A0;</span><span
  7865. class="cmtt-8">&#x00A0;</span>
  7866. <br class="fancyvrb" /><a
  7867. id="x1-101098r49"></a><span
  7868. class="cmr-6">49</span><span
  7869. class="cmtt-8">&#x00A0;</span><span
  7870. class="cmtt-8">&#x00A0; </span><span
  7871. class="cmtt-8">&#x00A0;</span><span
  7872. class="cmtt-8">&#x00A0;24)</span><span
  7873. class="cmtt-8">&#x00A0;if</span><span
  7874. class="cmtt-8">&#x00A0;([val]</span><span
  7875. class="cmtt-8">&#x00A0;is</span><span
  7876. class="cmtt-8">&#x00A0;odd)</span><span
  7877. class="cmtt-8">&#x00A0;</span><span
  7878. class="cmsy-8">{</span>
  7879. <br class="fancyvrb" /><a
  7880. id="x1-101100r50"></a><span
  7881. class="cmr-6">50</span><span
  7882. class="cmtt-8">&#x00A0;</span><span
  7883. class="cmtt-8">&#x00A0;</span>
  7884. <br class="fancyvrb" /><a
  7885. id="x1-101102r51"></a><span
  7886. class="cmr-6">51</span><span
  7887. class="cmtt-8">&#x00A0;</span><span
  7888. class="cmtt-8">&#x00A0;</span><span
  7889. class="cmtt-8">&#x00A0;</span><span
  7890. class="cmtt-8">&#x00A0;</span><span
  7891. class="cmtt-8">&#x00A0;</span><span
  7892. class="cmtt-8">&#x00A0;</span><span
  7893. class="cmtt-8">&#x00A0;</span><span
  7894. class="cmtt-8">&#x00A0;</span><span
  7895. class="cmtt-8">&#x00A0;</span><span
  7896. class="cmtt-8">&#x00A0;</span><span
  7897. class="cmtt-8">&#x00A0;</span><span
  7898. class="cmtt-8">&#x00A0;</span><span
  7899. class="cmtt-8">&#x00A0;</span><span
  7900. class="cmtt-8">&#x00A0;</span><span
  7901. class="cmtt-8">&#x00A0;</span><span
  7902. class="cmtt-8">&#x00A0;</span><span
  7903. class="cmtt-8">&#x00A0;</span><span
  7904. class="cmtt-8">&#x00A0;</span><span
  7905. class="cmtt-8">&#x00A0;</span><span
  7906. class="cmtt-8">&#x00A0;</span><span
  7907. class="cmtt-8">&#x00A0;</span><span
  7908. class="cmtt-8">&#x00A0;</span><span
  7909. class="cmtt-8">&#x00A0;</span><span
  7910. class="cmtt-8">&#x00A0;</span><span
  7911. class="cmtt-8">&#x00A0;</span><span
  7912. class="cmtt-8">&#x00A0;25)</span><span
  7913. class="cmtt-8">&#x00A0;vector</span><span
  7914. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  7915. class="cmtt-8">&#x00A0;element</span><span
  7916. class="cmtt-8">&#x00A0;[i]</span><span
  7917. class="cmtt-8">&#x00A0;=</span>
  7918. <br class="fancyvrb" /><a
  7919. id="x1-101104r52"></a><span
  7920. class="cmr-6">52</span><span
  7921. class="cmtt-8">&#x00A0;</span><span
  7922. class="cmtt-8">&#x00A0;</span><span
  7923. class="cmtt-8">&#x00A0;</span><span
  7924. class="cmtt-8">&#x00A0;</span><span
  7925. class="cmtt-8">&#x00A0;</span><span
  7926. class="cmtt-8">&#x00A0;</span><span
  7927. class="cmtt-8">&#x00A0;</span><span
  7928. class="cmtt-8">&#x00A0;</span><span
  7929. class="cmtt-8">&#x00A0;</span><span
  7930. class="cmtt-8">&#x00A0;</span><span
  7931. class="cmtt-8">&#x00A0;</span><span
  7932. class="cmtt-8">&#x00A0;</span><span
  7933. class="cmtt-8">&#x00A0;</span><span
  7934. class="cmtt-8">&#x00A0;</span><span
  7935. class="cmtt-8">&#x00A0;</span><span
  7936. class="cmtt-8">&#x00A0;</span><span
  7937. class="cmtt-8">&#x00A0;</span><span
  7938. class="cmtt-8">&#x00A0;</span><span
  7939. class="cmtt-8">&#x00A0;</span><span
  7940. class="cmtt-8">&#x00A0;</span><span
  7941. class="cmtt-8">&#x00A0;</span><span
  7942. class="cmtt-8">&#x00A0;</span><span
  7943. class="cmtt-8">&#x00A0;</span><span
  7944. class="cmtt-8">&#x00A0;</span><span
  7945. class="cmtt-8">&#x00A0;</span><span
  7946. class="cmtt-8">&#x00A0;</span><span
  7947. class="cmtt-8">&#x00A0;</span><span
  7948. class="cmtt-8">&#x00A0;</span><span
  7949. class="cmtt-8">&#x00A0;</span><span
  7950. class="cmtt-8">&#x00A0;[predicted]</span><span
  7951. class="cmtt-8">&#x00A0;-</span><span
  7952. class="cmtt-8">&#x00A0;(([val]</span><span
  7953. class="cmtt-8">&#x00A0;+</span><span
  7954. class="cmtt-8">&#x00A0;1)</span><span
  7955. class="cmtt-8">&#x00A0;divided</span><span
  7956. class="cmtt-8">&#x00A0;by</span><span
  7957. class="cmtt-8">&#x00A0;</span><span
  7958. class="cmtt-8">&#x00A0;2</span><span
  7959. class="cmtt-8">&#x00A0;using</span><span
  7960. class="cmtt-8">&#x00A0;integer</span><span
  7961. class="cmtt-8">&#x00A0;division)</span>
  7962. <br class="fancyvrb" /><a
  7963. id="x1-101106r53"></a><span
  7964. class="cmr-6">53</span><span
  7965. class="cmtt-8">&#x00A0;</span><span
  7966. class="cmtt-8">&#x00A0;</span>
  7967. <br class="fancyvrb" /><a
  7968. id="x1-101108r54"></a><span
  7969. class="cmr-6">54</span><span
  7970. class="cmtt-8">&#x00A0;</span><span
  7971. class="cmtt-8">&#x00A0;</span><span
  7972. class="cmtt-8">&#x00A0;</span><span
  7973. class="cmtt-8">&#x00A0;</span><span
  7974. class="cmtt-8">&#x00A0;</span><span
  7975. class="cmtt-8">&#x00A0;</span><span
  7976. class="cmtt-8">&#x00A0;</span><span
  7977. class="cmtt-8">&#x00A0;</span><span
  7978. class="cmtt-8">&#x00A0;</span><span
  7979. class="cmtt-8">&#x00A0;</span><span
  7980. class="cmtt-8">&#x00A0;</span><span
  7981. class="cmtt-8">&#x00A0;</span><span
  7982. class="cmtt-8">&#x00A0;</span><span
  7983. class="cmtt-8">&#x00A0;</span><span
  7984. class="cmtt-8">&#x00A0;</span><span
  7985. class="cmtt-8">&#x00A0;</span><span
  7986. class="cmtt-8">&#x00A0;</span><span
  7987. class="cmtt-8">&#x00A0;</span><span
  7988. class="cmtt-8">&#x00A0;</span><span
  7989. class="cmtt-8">&#x00A0;</span><span
  7990. class="cmtt-8">&#x00A0;</span><span
  7991. class="cmtt-8">&#x00A0;</span><span
  7992. class="cmtt-8">&#x00A0;</span><span
  7993. class="cmtt-8">&#x00A0;</span><span
  7994. class="cmsy-8">}</span><span
  7995. class="cmtt-8">&#x00A0;else</span><span
  7996. class="cmtt-8">&#x00A0;[val]</span><span
  7997. class="cmtt-8">&#x00A0;is</span><span
  7998. class="cmtt-8">&#x00A0;even</span><span
  7999. class="cmtt-8">&#x00A0;</span><span
  8000. class="cmsy-8">{</span>
  8001. <br class="fancyvrb" /><a
  8002. id="x1-101110r55"></a><span
  8003. class="cmr-6">55</span><span
  8004. class="cmtt-8">&#x00A0;</span><span
  8005. class="cmtt-8">&#x00A0;</span>
  8006. <br class="fancyvrb" /><a
  8007. id="x1-101112r56"></a><span
  8008. class="cmr-6">56</span><span
  8009. class="cmtt-8">&#x00A0;</span><span
  8010. class="cmtt-8">&#x00A0;</span><span
  8011. class="cmtt-8">&#x00A0;</span><span
  8012. class="cmtt-8">&#x00A0;</span><span
  8013. class="cmtt-8">&#x00A0;</span><span
  8014. class="cmtt-8">&#x00A0;</span><span
  8015. class="cmtt-8">&#x00A0;</span><span
  8016. class="cmtt-8">&#x00A0;</span><span
  8017. class="cmtt-8">&#x00A0;</span><span
  8018. class="cmtt-8">&#x00A0;</span><span
  8019. class="cmtt-8">&#x00A0;</span><span
  8020. class="cmtt-8">&#x00A0;</span><span
  8021. class="cmtt-8">&#x00A0;</span><span
  8022. class="cmtt-8">&#x00A0;</span><span
  8023. class="cmtt-8">&#x00A0;</span><span
  8024. class="cmtt-8">&#x00A0;</span><span
  8025. class="cmtt-8">&#x00A0;</span><span
  8026. class="cmtt-8">&#x00A0;</span><span
  8027. class="cmtt-8">&#x00A0;</span><span
  8028. class="cmtt-8">&#x00A0;</span><span
  8029. class="cmtt-8">&#x00A0;</span><span
  8030. class="cmtt-8">&#x00A0;</span><span
  8031. class="cmtt-8">&#x00A0;</span><span
  8032. class="cmtt-8">&#x00A0;</span><span
  8033. class="cmtt-8">&#x00A0;</span><span
  8034. class="cmtt-8">&#x00A0;26)</span><span
  8035. class="cmtt-8">&#x00A0;vector</span><span
  8036. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  8037. class="cmtt-8">&#x00A0;element</span><span
  8038. class="cmtt-8">&#x00A0;[i]</span><span
  8039. class="cmtt-8">&#x00A0;=</span>
  8040. <br class="fancyvrb" /><a
  8041. id="x1-101114r57"></a><span
  8042. class="cmr-6">57</span><span
  8043. class="cmtt-8">&#x00A0;</span><span
  8044. class="cmtt-8">&#x00A0;</span><span
  8045. class="cmtt-8">&#x00A0;</span><span
  8046. class="cmtt-8">&#x00A0;</span><span
  8047. class="cmtt-8">&#x00A0;</span><span
  8048. class="cmtt-8">&#x00A0;</span><span
  8049. class="cmtt-8">&#x00A0;</span><span
  8050. class="cmtt-8">&#x00A0;</span><span
  8051. class="cmtt-8">&#x00A0;</span><span
  8052. class="cmtt-8">&#x00A0;</span><span
  8053. class="cmtt-8">&#x00A0;</span><span
  8054. class="cmtt-8">&#x00A0;</span><span
  8055. class="cmtt-8">&#x00A0;</span><span
  8056. class="cmtt-8">&#x00A0;</span><span
  8057. class="cmtt-8">&#x00A0;</span><span
  8058. class="cmtt-8">&#x00A0;</span><span
  8059. class="cmtt-8">&#x00A0;</span><span
  8060. class="cmtt-8">&#x00A0;</span><span
  8061. class="cmtt-8">&#x00A0;</span><span
  8062. class="cmtt-8">&#x00A0;</span><span
  8063. class="cmtt-8">&#x00A0;</span><span
  8064. class="cmtt-8">&#x00A0;</span><span
  8065. class="cmtt-8">&#x00A0;</span><span
  8066. class="cmtt-8">&#x00A0;</span><span
  8067. class="cmtt-8">&#x00A0;</span><span
  8068. class="cmtt-8">&#x00A0;</span><span
  8069. class="cmtt-8">&#x00A0;</span><span
  8070. class="cmtt-8">&#x00A0;</span><span
  8071. class="cmtt-8">&#x00A0;</span><span
  8072. class="cmtt-8">&#x00A0;[predicted]</span><span
  8073. class="cmtt-8">&#x00A0;+</span><span
  8074. class="cmtt-8">&#x00A0;([val]</span><span
  8075. class="cmtt-8">&#x00A0;/</span><span
  8076. class="cmtt-8">&#x00A0;2</span><span
  8077. class="cmtt-8">&#x00A0;using</span><span
  8078. class="cmtt-8">&#x00A0;integer</span><span
  8079. class="cmtt-8">&#x00A0;division)</span>
  8080. <br class="fancyvrb" /><a
  8081. id="x1-101116r58"></a><span
  8082. class="cmr-6">58</span><span
  8083. class="cmtt-8">&#x00A0;</span><span
  8084. class="cmtt-8">&#x00A0;</span>
  8085. <br class="fancyvrb" /><a
  8086. id="x1-101118r59"></a><span
  8087. class="cmr-6">59</span><span
  8088. class="cmtt-8">&#x00A0;</span><span
  8089. class="cmtt-8">&#x00A0;</span><span
  8090. class="cmtt-8">&#x00A0;</span><span
  8091. class="cmtt-8">&#x00A0;</span><span
  8092. class="cmtt-8">&#x00A0;</span><span
  8093. class="cmtt-8">&#x00A0;</span><span
  8094. class="cmtt-8">&#x00A0;</span><span
  8095. class="cmtt-8">&#x00A0;</span><span
  8096. class="cmtt-8">&#x00A0;</span><span
  8097. class="cmtt-8">&#x00A0;</span><span
  8098. class="cmtt-8">&#x00A0;</span><span
  8099. class="cmtt-8">&#x00A0;</span><span
  8100. class="cmtt-8">&#x00A0;</span><span
  8101. class="cmtt-8">&#x00A0;</span><span
  8102. class="cmtt-8">&#x00A0;</span><span
  8103. class="cmtt-8">&#x00A0;</span><span
  8104. class="cmtt-8">&#x00A0;</span><span
  8105. class="cmtt-8">&#x00A0;</span><span
  8106. class="cmtt-8">&#x00A0;</span><span
  8107. class="cmtt-8">&#x00A0;</span><span
  8108. class="cmtt-8">&#x00A0;</span><span
  8109. class="cmtt-8">&#x00A0;</span><span
  8110. class="cmtt-8">&#x00A0;</span><span
  8111. class="cmtt-8">&#x00A0;</span><span
  8112. class="cmsy-8">}</span>
  8113. <br class="fancyvrb" /><a
  8114. id="x1-101120r60"></a><span
  8115. class="cmr-6">60</span><span
  8116. class="cmtt-8">&#x00A0;</span><span
  8117. class="cmtt-8">&#x00A0;</span>
  8118. <br class="fancyvrb" /><a
  8119. id="x1-101122r61"></a><span
  8120. class="cmr-6">61</span><span
  8121. class="cmtt-8">&#x00A0;</span><span
  8122. class="cmtt-8">&#x00A0;</span><span
  8123. class="cmtt-8">&#x00A0;</span><span
  8124. class="cmtt-8">&#x00A0;</span><span
  8125. class="cmtt-8">&#x00A0;</span><span
  8126. class="cmtt-8">&#x00A0;</span><span
  8127. class="cmtt-8">&#x00A0;</span><span
  8128. class="cmtt-8">&#x00A0;</span><span
  8129. class="cmtt-8">&#x00A0;</span><span
  8130. class="cmtt-8">&#x00A0;</span><span
  8131. class="cmtt-8">&#x00A0;</span><span
  8132. class="cmtt-8">&#x00A0;</span><span
  8133. class="cmtt-8">&#x00A0;</span><span
  8134. class="cmtt-8">&#x00A0;</span><span
  8135. class="cmtt-8">&#x00A0;</span><span
  8136. class="cmtt-8">&#x00A0;</span><span
  8137. class="cmtt-8">&#x00A0;</span><span
  8138. class="cmtt-8">&#x00A0;</span><span
  8139. class="cmsy-8">}</span>
  8140. <br class="fancyvrb" /><a
  8141. id="x1-101124r62"></a><span
  8142. class="cmr-6">62</span><span
  8143. class="cmtt-8">&#x00A0;</span><span
  8144. class="cmtt-8">&#x00A0;</span>
  8145. <br class="fancyvrb" /><a
  8146. id="x1-101126r63"></a><span
  8147. class="cmr-6">63</span><span
  8148. class="cmtt-8">&#x00A0;</span><span
  8149. class="cmtt-8">&#x00A0;</span><span
  8150. class="cmtt-8">&#x00A0;</span><span
  8151. class="cmtt-8">&#x00A0;</span><span
  8152. class="cmtt-8">&#x00A0;</span><span
  8153. class="cmtt-8">&#x00A0;</span><span
  8154. class="cmtt-8">&#x00A0;</span><span
  8155. class="cmtt-8">&#x00A0;</span><span
  8156. class="cmtt-8">&#x00A0;</span><span
  8157. class="cmtt-8">&#x00A0;</span><span
  8158. class="cmtt-8">&#x00A0;</span><span
  8159. class="cmtt-8">&#x00A0;</span><span
  8160. class="cmsy-8">}</span><span
  8161. class="cmtt-8">&#x00A0;else</span><span
  8162. class="cmtt-8">&#x00A0;[val]</span><span
  8163. class="cmtt-8">&#x00A0;is</span><span
  8164. class="cmtt-8">&#x00A0;zero</span><span
  8165. class="cmtt-8">&#x00A0;</span><span
  8166. class="cmsy-8">{</span>
  8167. <br class="fancyvrb" /><a
  8168. id="x1-101128r64"></a><span
  8169. class="cmr-6">64</span><span
  8170. class="cmtt-8">&#x00A0;</span><span
  8171. class="cmtt-8">&#x00A0;</span>
  8172. <br class="fancyvrb" /><a
  8173. id="x1-101130r65"></a><span
  8174. class="cmr-6">65</span><span
  8175. class="cmtt-8">&#x00A0;</span><span
  8176. class="cmtt-8">&#x00A0;</span><span
  8177. class="cmtt-8">&#x00A0;</span><span
  8178. class="cmtt-8">&#x00A0;</span><span
  8179. class="cmtt-8">&#x00A0;</span><span
  8180. class="cmtt-8">&#x00A0;</span><span
  8181. class="cmtt-8">&#x00A0;</span><span
  8182. class="cmtt-8">&#x00A0;</span><span
  8183. class="cmtt-8">&#x00A0;</span><span
  8184. class="cmtt-8">&#x00A0;</span><span
  8185. class="cmtt-8">&#x00A0;</span><span
  8186. class="cmtt-8">&#x00A0;</span><span
  8187. class="cmtt-8">&#x00A0;</span><span
  8188. class="cmtt-8">&#x00A0;27)</span><span
  8189. class="cmtt-8">&#x00A0;vector</span><span
  8190. class="cmtt-8">&#x00A0;[floor1_step2_flag]</span><span
  8191. class="cmtt-8">&#x00A0;element</span><span
  8192. class="cmtt-8">&#x00A0;[i]</span><span
  8193. class="cmtt-8">&#x00A0;=</span><span
  8194. class="cmtt-8">&#x00A0;unset</span>
  8195. <br class="fancyvrb" /><a
  8196. id="x1-101132r66"></a><span
  8197. class="cmr-6">66</span><span
  8198. class="cmtt-8">&#x00A0;</span><span
  8199. class="cmtt-8">&#x00A0;</span><span
  8200. class="cmtt-8">&#x00A0;</span><span
  8201. class="cmtt-8">&#x00A0;</span><span
  8202. class="cmtt-8">&#x00A0;</span><span
  8203. class="cmtt-8">&#x00A0;</span><span
  8204. class="cmtt-8">&#x00A0;</span><span
  8205. class="cmtt-8">&#x00A0;</span><span
  8206. class="cmtt-8">&#x00A0;</span><span
  8207. class="cmtt-8">&#x00A0;</span><span
  8208. class="cmtt-8">&#x00A0;</span><span
  8209. class="cmtt-8">&#x00A0;</span><span
  8210. class="cmtt-8">&#x00A0;</span><span
  8211. class="cmtt-8">&#x00A0;28)</span><span
  8212. class="cmtt-8">&#x00A0;vector</span><span
  8213. class="cmtt-8">&#x00A0;[floor1_final_Y]</span><span
  8214. class="cmtt-8">&#x00A0;element</span><span
  8215. class="cmtt-8">&#x00A0;[i]</span><span
  8216. class="cmtt-8">&#x00A0;=</span><span
  8217. class="cmtt-8">&#x00A0;[predicted]</span>
  8218. <br class="fancyvrb" /><a
  8219. id="x1-101134r67"></a><span
  8220. class="cmr-6">67</span><span
  8221. class="cmtt-8">&#x00A0;</span><span
  8222. class="cmtt-8">&#x00A0;</span>
  8223. <br class="fancyvrb" /><a
  8224. id="x1-101136r68"></a><span
  8225. class="cmr-6">68</span><span
  8226. class="cmtt-8">&#x00A0;</span><span
  8227. class="cmtt-8">&#x00A0;</span><span
  8228. class="cmtt-8">&#x00A0;</span><span
  8229. class="cmtt-8">&#x00A0;</span><span
  8230. class="cmtt-8">&#x00A0;</span><span
  8231. class="cmtt-8">&#x00A0;</span><span
  8232. class="cmtt-8">&#x00A0;</span><span
  8233. class="cmtt-8">&#x00A0;</span><span
  8234. class="cmtt-8">&#x00A0;</span><span
  8235. class="cmtt-8">&#x00A0;</span><span
  8236. class="cmtt-8">&#x00A0;</span><span
  8237. class="cmtt-8">&#x00A0;</span><span
  8238. class="cmsy-8">}</span>
  8239. <br class="fancyvrb" /><a
  8240. id="x1-101138r69"></a><span
  8241. class="cmr-6">69</span><span
  8242. class="cmtt-8">&#x00A0;</span><span
  8243. class="cmtt-8">&#x00A0;</span>
  8244. <br class="fancyvrb" /><a
  8245. id="x1-101140r70"></a><span
  8246. class="cmr-6">70</span><span
  8247. class="cmtt-8">&#x00A0;</span><span
  8248. class="cmtt-8">&#x00A0;</span><span
  8249. class="cmtt-8">&#x00A0;</span><span
  8250. class="cmtt-8">&#x00A0;</span><span
  8251. class="cmtt-8">&#x00A0;</span><span
  8252. class="cmtt-8">&#x00A0;</span><span
  8253. class="cmtt-8">&#x00A0;</span><span
  8254. class="cmsy-8">}</span>
  8255. <br class="fancyvrb" /><a
  8256. id="x1-101142r71"></a><span
  8257. class="cmr-6">71</span><span
  8258. class="cmtt-8">&#x00A0;</span><span
  8259. class="cmtt-8">&#x00A0;</span>
  8260. <br class="fancyvrb" /><a
  8261. id="x1-101144r72"></a><span
  8262. class="cmr-6">72</span><span
  8263. class="cmtt-8">&#x00A0;</span><span
  8264. class="cmtt-8">&#x00A0;</span><span
  8265. class="cmtt-8">&#x00A0;29)</span><span
  8266. class="cmtt-8">&#x00A0;done</span>
  8267. <br class="fancyvrb" /><a
  8268. id="x1-101146r73"></a><span
  8269. class="cmr-6">73</span><span
  8270. class="cmtt-8">&#x00A0;</span><span
  8271. class="cmtt-8">&#x00A0;</span>
  8272. </div>
  8273. </dd><dt class="description">
  8274. <span
  8275. class="cmssbx-10x-x-120">step 2: curve synthesis</span> </dt><dd
  8276. class="description">
  8277. <!--l. 336--><p class="noindent" >Curve synthesis generates a return vector <span
  8278. class="cmtt-12">[floor] </span>of length <span
  8279. class="cmtt-12">[n] </span>(where <span
  8280. class="cmtt-12">[n] </span>is provided by
  8281. the decode process calling to floor decode). Floor 1 curve synthesis makes use of the
  8282. <span
  8283. class="cmtt-12">[floor1_X_list]</span>, <span
  8284. class="cmtt-12">[floor1_final_Y] </span>and <span
  8285. class="cmtt-12">[floor1_step2_flag] </span>vectors, as well as
  8286. [floor1&#x02D9;multiplier] and [floor1&#x02D9;values] values.
  8287. <!--l. 343--><p class="noindent" >Decode begins by sorting the scalars from vectors <span
  8288. class="cmtt-12">[floor1_X_list]</span>, <span
  8289. class="cmtt-12">[floor1_final_Y] </span>and
  8290. <span
  8291. class="cmtt-12">[floor1_step2_flag] </span>together into new vectors <span
  8292. class="cmtt-12">[floor1_X_list]&#8217;</span>, <span
  8293. class="cmtt-12">[floor1_final_Y]&#8217;</span>
  8294. and <span
  8295. class="cmtt-12">[floor1_step2_flag]&#8217; </span>according to ascending sort order of the values in
  8296. <span
  8297. class="cmtt-12">[floor1_X_list]</span>. That is, sort the values of <span
  8298. class="cmtt-12">[floor1_X_list] </span>and then apply the same
  8299. permutation to elements of the other two vectors so that the X, Y and step2&#x02D9;flag values still
  8300. match.
  8301. <!--l. 353--><p class="noindent" >Then compute the final curve in one pass:
  8302. <!--l. 355--><p class="noindent" >
  8303. <div class="fancyvrb" id="fancyvrb32">
  8304. <a
  8305. id="x1-101148r1"></a><span
  8306. class="cmr-6">1</span><span
  8307. class="cmtt-8">&#x00A0;</span><span
  8308. class="cmtt-8">&#x00A0;</span><span
  8309. class="cmtt-8">&#x00A0;</span><span
  8310. class="cmtt-8">&#x00A0;1)</span><span
  8311. class="cmtt-8">&#x00A0;[hx]</span><span
  8312. class="cmtt-8">&#x00A0;=</span><span
  8313. class="cmtt-8">&#x00A0;0</span>
  8314. <br class="fancyvrb" /><a
  8315. id="x1-101150r2"></a><span
  8316. class="cmr-6">2</span><span
  8317. class="cmtt-8">&#x00A0;</span><span
  8318. class="cmtt-8">&#x00A0;</span><span
  8319. class="cmtt-8">&#x00A0;</span><span
  8320. class="cmtt-8">&#x00A0;2)</span><span
  8321. class="cmtt-8">&#x00A0;[lx]</span><span
  8322. class="cmtt-8">&#x00A0;=</span><span
  8323. class="cmtt-8">&#x00A0;0</span>
  8324. <br class="fancyvrb" /><a
  8325. id="x1-101152r3"></a><span
  8326. class="cmr-6">3</span><span
  8327. class="cmtt-8">&#x00A0;</span><span
  8328. class="cmtt-8">&#x00A0;</span><span
  8329. class="cmtt-8">&#x00A0;</span><span
  8330. class="cmtt-8">&#x00A0;3)</span><span
  8331. class="cmtt-8">&#x00A0;[ly]</span><span
  8332. class="cmtt-8">&#x00A0;=</span><span
  8333. class="cmtt-8">&#x00A0;vector</span><span
  8334. class="cmtt-8">&#x00A0;[floor1_final_Y]&#8217;</span><span
  8335. class="cmtt-8">&#x00A0;element</span><span
  8336. class="cmtt-8">&#x00A0;[0]</span><span
  8337. class="cmtt-8">&#x00A0;*</span><span
  8338. class="cmtt-8">&#x00A0;[floor1_multiplier]</span>
  8339. <br class="fancyvrb" /><a
  8340. id="x1-101154r4"></a><span
  8341. class="cmr-6">4</span><span
  8342. class="cmtt-8">&#x00A0;</span><span
  8343. class="cmtt-8">&#x00A0;</span><span
  8344. class="cmtt-8">&#x00A0;</span><span
  8345. class="cmtt-8">&#x00A0;4)</span><span
  8346. class="cmtt-8">&#x00A0;iterate</span><span
  8347. class="cmtt-8">&#x00A0;[i]</span><span
  8348. class="cmtt-8">&#x00A0;over</span><span
  8349. class="cmtt-8">&#x00A0;the</span><span
  8350. class="cmtt-8">&#x00A0;range</span><span
  8351. class="cmtt-8">&#x00A0;1</span><span
  8352. class="cmtt-8">&#x00A0;...</span><span
  8353. class="cmtt-8">&#x00A0;[floor1_values]-1</span><span
  8354. class="cmtt-8">&#x00A0;</span><span
  8355. class="cmsy-8">{</span>
  8356. <br class="fancyvrb" /><a
  8357. id="x1-101156r5"></a><span
  8358. class="cmr-6">5</span><span
  8359. class="cmtt-8">&#x00A0;</span><span
  8360. class="cmtt-8">&#x00A0;</span>
  8361. <br class="fancyvrb" /><a
  8362. id="x1-101158r6"></a><span
  8363. class="cmr-6">6</span><span
  8364. class="cmtt-8">&#x00A0;</span><span
  8365. class="cmtt-8">&#x00A0;</span><span
  8366. class="cmtt-8">&#x00A0;</span><span
  8367. class="cmtt-8">&#x00A0;</span><span
  8368. class="cmtt-8">&#x00A0;</span><span
  8369. class="cmtt-8">&#x00A0;</span><span
  8370. class="cmtt-8">&#x00A0;</span><span
  8371. class="cmtt-8">&#x00A0;</span><span
  8372. class="cmtt-8">&#x00A0;5)</span><span
  8373. class="cmtt-8">&#x00A0;if</span><span
  8374. class="cmtt-8">&#x00A0;(</span><span
  8375. class="cmtt-8">&#x00A0;[floor1_step2_flag]&#8217;</span><span
  8376. class="cmtt-8">&#x00A0;element</span><span
  8377. class="cmtt-8">&#x00A0;[i]</span><span
  8378. class="cmtt-8">&#x00A0;is</span><span
  8379. class="cmtt-8">&#x00A0;set</span><span
  8380. class="cmtt-8">&#x00A0;)</span><span
  8381. class="cmtt-8">&#x00A0;</span><span
  8382. class="cmsy-8">{</span>
  8383. <br class="fancyvrb" /><a
  8384. id="x1-101160r7"></a><span
  8385. class="cmr-6">7</span><span
  8386. class="cmtt-8">&#x00A0;</span><span
  8387. class="cmtt-8">&#x00A0;</span>
  8388. <br class="fancyvrb" /><a
  8389. id="x1-101162r8"></a><span
  8390. class="cmr-6">8</span><span
  8391. class="cmtt-8">&#x00A0;</span><span
  8392. class="cmtt-8">&#x00A0;</span><span
  8393. class="cmtt-8">&#x00A0;</span><span
  8394. class="cmtt-8">&#x00A0;</span><span
  8395. class="cmtt-8">&#x00A0;</span><span
  8396. class="cmtt-8">&#x00A0;</span><span
  8397. class="cmtt-8">&#x00A0;</span><span
  8398. class="cmtt-8">&#x00A0;</span><span
  8399. class="cmtt-8">&#x00A0;</span><span
  8400. class="cmtt-8">&#x00A0;</span><span
  8401. class="cmtt-8">&#x00A0;</span><span
  8402. class="cmtt-8">&#x00A0;</span><span
  8403. class="cmtt-8">&#x00A0;</span><span
  8404. class="cmtt-8">&#x00A0;</span><span
  8405. class="cmtt-8">&#x00A0;6)</span><span
  8406. class="cmtt-8">&#x00A0;[hy]</span><span
  8407. class="cmtt-8">&#x00A0;=</span><span
  8408. class="cmtt-8">&#x00A0;[floor1_final_Y]&#8217;</span><span
  8409. class="cmtt-8">&#x00A0;element</span><span
  8410. class="cmtt-8">&#x00A0;[i]</span><span
  8411. class="cmtt-8">&#x00A0;*</span><span
  8412. class="cmtt-8">&#x00A0;[floor1_multiplier]</span>
  8413. <br class="fancyvrb" /><a
  8414. id="x1-101164r9"></a><span
  8415. class="cmr-6">9</span><span
  8416. class="cmtt-8">&#x00A0;</span><span
  8417. class="cmtt-8">&#x00A0;</span><span
  8418. class="cmtt-8">&#x00A0; </span><span
  8419. class="cmtt-8">&#x00A0;</span><span
  8420. class="cmtt-8">&#x00A0;</span><span
  8421. class="cmtt-8">&#x00A0;</span><span
  8422. class="cmtt-8">&#x00A0;</span><span
  8423. class="cmtt-8">&#x00A0;7)</span><span
  8424. class="cmtt-8">&#x00A0;[hx]</span><span
  8425. class="cmtt-8">&#x00A0;=</span><span
  8426. class="cmtt-8">&#x00A0;[floor1_X_list]&#8217;</span><span
  8427. class="cmtt-8">&#x00A0;element</span><span
  8428. class="cmtt-8">&#x00A0;[i]</span>
  8429. <br class="fancyvrb" /><a
  8430. id="x1-101166r10"></a><span
  8431. class="cmr-6">10</span><span
  8432. class="cmtt-8">&#x00A0;</span><span
  8433. class="cmtt-8">&#x00A0;</span><span
  8434. class="cmtt-8">&#x00A0;</span><span
  8435. class="cmtt-8">&#x00A0;</span><span
  8436. class="cmtt-8">&#x00A0;</span><span
  8437. class="cmtt-8">&#x00A0;</span><span
  8438. class="cmtt-8">&#x00A0;</span><span
  8439. class="cmtt-8">&#x00A0;</span><span
  8440. class="cmtt-8">&#x00A0;</span><span
  8441. class="cmtt-8">&#x00A0;</span><span
  8442. class="cmtt-8">&#x00A0;</span><span
  8443. class="cmtt-8">&#x00A0;</span><span
  8444. class="cmtt-8">&#x00A0;</span><span
  8445. class="cmtt-8">&#x00A0;</span><span
  8446. class="cmtt-8">&#x00A0;8)</span><span
  8447. class="cmtt-8">&#x00A0;</span><a
  8448. href="#x1-1230009.2.7"><span
  8449. class="cmtt-8">render_line</span></a><span
  8450. class="cmtt-8">(</span><span
  8451. class="cmtt-8">&#x00A0;[lx],</span><span
  8452. class="cmtt-8">&#x00A0;[ly],</span><span
  8453. class="cmtt-8">&#x00A0;[hx],</span><span
  8454. class="cmtt-8">&#x00A0;[hy],</span><span
  8455. class="cmtt-8">&#x00A0;[floor]</span><span
  8456. class="cmtt-8">&#x00A0;)</span>
  8457. <br class="fancyvrb" /><a
  8458. id="x1-101168r11"></a><span
  8459. class="cmr-6">11</span><span
  8460. class="cmtt-8">&#x00A0;</span><span
  8461. class="cmtt-8">&#x00A0;</span><span
  8462. class="cmtt-8">&#x00A0;</span><span
  8463. class="cmtt-8">&#x00A0;</span><span
  8464. class="cmtt-8">&#x00A0;</span><span
  8465. class="cmtt-8">&#x00A0;</span><span
  8466. class="cmtt-8">&#x00A0;</span><span
  8467. class="cmtt-8">&#x00A0;</span><span
  8468. class="cmtt-8">&#x00A0;</span><span
  8469. class="cmtt-8">&#x00A0;</span><span
  8470. class="cmtt-8">&#x00A0;</span><span
  8471. class="cmtt-8">&#x00A0;</span><span
  8472. class="cmtt-8">&#x00A0;</span><span
  8473. class="cmtt-8">&#x00A0;</span><span
  8474. class="cmtt-8">&#x00A0;9)</span><span
  8475. class="cmtt-8">&#x00A0;[lx]</span><span
  8476. class="cmtt-8">&#x00A0;=</span><span
  8477. class="cmtt-8">&#x00A0;[hx]</span>
  8478. <br class="fancyvrb" /><a
  8479. id="x1-101170r12"></a><span
  8480. class="cmr-6">12</span><span
  8481. class="cmtt-8">&#x00A0;</span><span
  8482. class="cmtt-8">&#x00A0; </span><span
  8483. class="cmtt-8">&#x00A0;</span><span
  8484. class="cmtt-8">&#x00A0;</span><span
  8485. class="cmtt-8">&#x00A0;</span><span
  8486. class="cmtt-8">&#x00A0;10)</span><span
  8487. class="cmtt-8">&#x00A0;[ly]</span><span
  8488. class="cmtt-8">&#x00A0;=</span><span
  8489. class="cmtt-8">&#x00A0;[hy]</span>
  8490. <br class="fancyvrb" /><a
  8491. id="x1-101172r13"></a><span
  8492. class="cmr-6">13</span><span
  8493. class="cmtt-8">&#x00A0;</span><span
  8494. class="cmtt-8">&#x00A0;</span><span
  8495. class="cmtt-8">&#x00A0;</span><span
  8496. class="cmtt-8">&#x00A0;</span><span
  8497. class="cmtt-8">&#x00A0;</span><span
  8498. class="cmtt-8">&#x00A0;</span><span
  8499. class="cmtt-8">&#x00A0;</span><span
  8500. class="cmtt-8">&#x00A0;</span><span
  8501. class="cmtt-8">&#x00A0;</span><span
  8502. class="cmtt-8">&#x00A0;</span><span
  8503. class="cmtt-8">&#x00A0;</span><span
  8504. class="cmtt-8">&#x00A0;</span><span
  8505. class="cmsy-8">}</span>
  8506. <br class="fancyvrb" /><a
  8507. id="x1-101174r14"></a><span
  8508. class="cmr-6">14</span><span
  8509. class="cmtt-8">&#x00A0;</span><span
  8510. class="cmtt-8">&#x00A0;</span><span
  8511. class="cmtt-8">&#x00A0;</span><span
  8512. class="cmtt-8">&#x00A0;</span><span
  8513. class="cmtt-8">&#x00A0;</span><span
  8514. class="cmtt-8">&#x00A0;</span><span
  8515. class="cmtt-8">&#x00A0;</span><span
  8516. class="cmsy-8">}</span>
  8517. <br class="fancyvrb" /><a
  8518. id="x1-101176r15"></a><span
  8519. class="cmr-6">15</span><span
  8520. class="cmtt-8">&#x00A0;</span><span
  8521. class="cmtt-8">&#x00A0;</span>
  8522. <br class="fancyvrb" /><a
  8523. id="x1-101178r16"></a><span
  8524. class="cmr-6">16</span><span
  8525. class="cmtt-8">&#x00A0;</span><span
  8526. class="cmtt-8">&#x00A0;</span><span
  8527. class="cmtt-8">&#x00A0;11)</span><span
  8528. class="cmtt-8">&#x00A0;if</span><span
  8529. class="cmtt-8">&#x00A0;(</span><span
  8530. class="cmtt-8">&#x00A0;[hx]</span><span
  8531. class="cmtt-8">&#x00A0;is</span><span
  8532. class="cmtt-8">&#x00A0;less</span><span
  8533. class="cmtt-8">&#x00A0;than</span><span
  8534. class="cmtt-8">&#x00A0;[n]</span><span
  8535. class="cmtt-8">&#x00A0;)</span><span
  8536. class="cmtt-8">&#x00A0;</span><span
  8537. class="cmsy-8">{</span>
  8538. <br class="fancyvrb" /><a
  8539. id="x1-101180r17"></a><span
  8540. class="cmr-6">17</span><span
  8541. class="cmtt-8">&#x00A0;</span><span
  8542. class="cmtt-8">&#x00A0;</span>
  8543. <br class="fancyvrb" /><a
  8544. id="x1-101182r18"></a><span
  8545. class="cmr-6">18</span><span
  8546. class="cmtt-8">&#x00A0;</span><span
  8547. class="cmtt-8">&#x00A0;</span><span
  8548. class="cmtt-8">&#x00A0;</span><span
  8549. class="cmtt-8">&#x00A0;</span><span
  8550. class="cmtt-8">&#x00A0;</span><span
  8551. class="cmtt-8">&#x00A0;</span><span
  8552. class="cmtt-8">&#x00A0;</span><span
  8553. class="cmtt-8">&#x00A0;</span><span
  8554. class="cmtt-8">&#x00A0;</span><span
  8555. class="cmtt-8">&#x00A0;12)</span><span
  8556. class="cmtt-8">&#x00A0;</span><a
  8557. href="#x1-1230009.2.7"><span
  8558. class="cmtt-8">render_line</span></a><span
  8559. class="cmtt-8">(</span><span
  8560. class="cmtt-8">&#x00A0;[hx],</span><span
  8561. class="cmtt-8">&#x00A0;[hy],</span><span
  8562. class="cmtt-8">&#x00A0;[n],</span><span
  8563. class="cmtt-8">&#x00A0;[hy],</span><span
  8564. class="cmtt-8">&#x00A0;[floor]</span><span
  8565. class="cmtt-8">&#x00A0;)</span>
  8566. <br class="fancyvrb" /><a
  8567. id="x1-101184r19"></a><span
  8568. class="cmr-6">19</span><span
  8569. class="cmtt-8">&#x00A0;</span><span
  8570. class="cmtt-8">&#x00A0;</span>
  8571. <br class="fancyvrb" /><a
  8572. id="x1-101186r20"></a><span
  8573. class="cmr-6">20</span><span
  8574. class="cmtt-8">&#x00A0;</span><span
  8575. class="cmtt-8">&#x00A0;</span><span
  8576. class="cmtt-8">&#x00A0;</span><span
  8577. class="cmtt-8">&#x00A0;</span><span
  8578. class="cmtt-8">&#x00A0;</span><span
  8579. class="cmtt-8">&#x00A0;</span><span
  8580. class="cmtt-8">&#x00A0;</span><span
  8581. class="cmsy-8">}</span>
  8582. <br class="fancyvrb" /><a
  8583. id="x1-101188r21"></a><span
  8584. class="cmr-6">21</span><span
  8585. class="cmtt-8">&#x00A0;</span><span
  8586. class="cmtt-8">&#x00A0;</span>
  8587. <br class="fancyvrb" /><a
  8588. id="x1-101190r22"></a><span
  8589. class="cmr-6">22</span><span
  8590. class="cmtt-8">&#x00A0;</span><span
  8591. class="cmtt-8">&#x00A0;</span><span
  8592. class="cmtt-8">&#x00A0;13)</span><span
  8593. class="cmtt-8">&#x00A0;if</span><span
  8594. class="cmtt-8">&#x00A0;(</span><span
  8595. class="cmtt-8">&#x00A0;[hx]</span><span
  8596. class="cmtt-8">&#x00A0;is</span><span
  8597. class="cmtt-8">&#x00A0;greater</span><span
  8598. class="cmtt-8">&#x00A0;than</span><span
  8599. class="cmtt-8">&#x00A0;[n]</span><span
  8600. class="cmtt-8">&#x00A0;)</span><span
  8601. class="cmtt-8">&#x00A0;</span><span
  8602. class="cmsy-8">{</span>
  8603. <br class="fancyvrb" /><a
  8604. id="x1-101192r23"></a><span
  8605. class="cmr-6">23</span><span
  8606. class="cmtt-8">&#x00A0;</span><span
  8607. class="cmtt-8">&#x00A0;</span>
  8608. <br class="fancyvrb" /><a
  8609. id="x1-101194r24"></a><span
  8610. class="cmr-6">24</span><span
  8611. class="cmtt-8">&#x00A0;</span><span
  8612. class="cmtt-8">&#x00A0;</span><span
  8613. class="cmtt-8">&#x00A0;</span><span
  8614. class="cmtt-8">&#x00A0;</span><span
  8615. class="cmtt-8">&#x00A0;</span><span
  8616. class="cmtt-8">&#x00A0;</span><span
  8617. class="cmtt-8">&#x00A0;</span><span
  8618. class="cmtt-8">&#x00A0;</span><span
  8619. class="cmtt-8">&#x00A0;</span><span
  8620. class="cmtt-8">&#x00A0;</span><span
  8621. class="cmtt-8">&#x00A0;</span><span
  8622. class="cmtt-8">&#x00A0;</span><span
  8623. class="cmtt-8">&#x00A0;</span><span
  8624. class="cmtt-8">&#x00A0;14)</span><span
  8625. class="cmtt-8">&#x00A0;truncate</span><span
  8626. class="cmtt-8">&#x00A0;vector</span><span
  8627. class="cmtt-8">&#x00A0;[floor]</span><span
  8628. class="cmtt-8">&#x00A0;to</span><span
  8629. class="cmtt-8">&#x00A0;[n]</span><span
  8630. class="cmtt-8">&#x00A0;elements</span>
  8631. <br class="fancyvrb" /><a
  8632. id="x1-101196r25"></a><span
  8633. class="cmr-6">25</span><span
  8634. class="cmtt-8">&#x00A0;</span><span
  8635. class="cmtt-8">&#x00A0;</span>
  8636. <br class="fancyvrb" /><a
  8637. id="x1-101198r26"></a><span
  8638. class="cmr-6">26</span><span
  8639. class="cmtt-8">&#x00A0;</span><span
  8640. class="cmtt-8">&#x00A0;</span><span
  8641. class="cmtt-8">&#x00A0;</span><span
  8642. class="cmtt-8">&#x00A0;</span><span
  8643. class="cmtt-8">&#x00A0;</span><span
  8644. class="cmtt-8">&#x00A0;</span><span
  8645. class="cmtt-8">&#x00A0;</span><span
  8646. class="cmsy-8">}</span>
  8647. <br class="fancyvrb" /><a
  8648. id="x1-101200r27"></a><span
  8649. class="cmr-6">27</span><span
  8650. class="cmtt-8">&#x00A0;</span><span
  8651. class="cmtt-8">&#x00A0;</span>
  8652. <br class="fancyvrb" /><a
  8653. id="x1-101202r28"></a><span
  8654. class="cmr-6">28</span><span
  8655. class="cmtt-8">&#x00A0;</span><span
  8656. class="cmtt-8">&#x00A0;</span><span
  8657. class="cmtt-8">&#x00A0;15)</span><span
  8658. class="cmtt-8">&#x00A0;for</span><span
  8659. class="cmtt-8">&#x00A0;each</span><span
  8660. class="cmtt-8">&#x00A0;scalar</span><span
  8661. class="cmtt-8">&#x00A0;in</span><span
  8662. class="cmtt-8">&#x00A0;vector</span><span
  8663. class="cmtt-8">&#x00A0;[floor],</span><span
  8664. class="cmtt-8">&#x00A0;perform</span><span
  8665. class="cmtt-8">&#x00A0;a</span><span
  8666. class="cmtt-8">&#x00A0;lookup</span><span
  8667. class="cmtt-8">&#x00A0;substitution</span><span
  8668. class="cmtt-8">&#x00A0;using</span>
  8669. <br class="fancyvrb" /><a
  8670. id="x1-101204r29"></a><span
  8671. class="cmr-6">29</span><span
  8672. class="cmtt-8">&#x00A0;</span><span
  8673. class="cmtt-8">&#x00A0;</span><span
  8674. class="cmtt-8">&#x00A0;</span><span
  8675. class="cmtt-8">&#x00A0;</span><span
  8676. class="cmtt-8">&#x00A0;</span><span
  8677. class="cmtt-8">&#x00A0;</span><span
  8678. class="cmtt-8">&#x00A0;the</span><span
  8679. class="cmtt-8">&#x00A0;scalar</span><span
  8680. class="cmtt-8">&#x00A0;value</span><span
  8681. class="cmtt-8">&#x00A0;from</span><span
  8682. class="cmtt-8">&#x00A0;[floor]</span><span
  8683. class="cmtt-8">&#x00A0;as</span><span
  8684. class="cmtt-8">&#x00A0;an</span><span
  8685. class="cmtt-8">&#x00A0;offset</span><span
  8686. class="cmtt-8">&#x00A0;into</span><span
  8687. class="cmtt-8">&#x00A0;the</span><span
  8688. class="cmtt-8">&#x00A0;vector</span><span
  8689. class="cmtt-8">&#x00A0;</span><a
  8690. href="#x1-12500010.1"><span
  8691. class="cmtt-8">[floor1_inverse_dB_static_table]</span></a>
  8692. <br class="fancyvrb" /><a
  8693. id="x1-101206r30"></a><span
  8694. class="cmr-6">30</span><span
  8695. class="cmtt-8">&#x00A0;</span><span
  8696. class="cmtt-8">&#x00A0;</span>
  8697. <br class="fancyvrb" /><a
  8698. id="x1-101208r31"></a><span
  8699. class="cmr-6">31</span><span
  8700. class="cmtt-8">&#x00A0;</span><span
  8701. class="cmtt-8">&#x00A0;</span><span
  8702. class="cmtt-8">&#x00A0;16)</span><span
  8703. class="cmtt-8">&#x00A0;done</span>
  8704. <br class="fancyvrb" /><a
  8705. id="x1-101210r32"></a><span
  8706. class="cmr-6">32</span><span
  8707. class="cmtt-8">&#x00A0;</span><span
  8708. class="cmtt-8">&#x00A0;</span>
  8709. </div>
  8710. </dd></dl>
  8711. <h3 class="sectionHead"><span class="titlemark">8 </span> <a
  8712. id="x1-1020008"></a>Residue setup and decode</h3>
  8713. <!--l. 6--><p class="noindent" >
  8714. <h4 class="subsectionHead"><span class="titlemark">8.1 </span> <a
  8715. id="x1-1030008.1"></a>Overview</h4>
  8716. <!--l. 8--><p class="noindent" >A residue vector represents the fine detail of the audio spectrum of one channel in an audio frame
  8717. after the encoder subtracts the floor curve and performs any channel coupling. A residue vector
  8718. may represent spectral lines, spectral magnitude, spectral phase or hybrids as mixed by channel
  8719. coupling. The exact semantic content of the vector does not matter to the residue
  8720. abstraction.
  8721. <!--l. 15--><p class="noindent" >Whatever the exact qualities, the Vorbis residue abstraction codes the residue vectors into the
  8722. bitstream packet, and then reconstructs the vectors during decode. Vorbis makes use of three
  8723. different encoding variants (numbered 0, 1 and 2) of the same basic vector encoding
  8724. abstraction.
  8725. <!--l. 23--><p class="noindent" >
  8726. <h4 class="subsectionHead"><span class="titlemark">8.2 </span> <a
  8727. id="x1-1040008.2"></a>Residue format</h4>
  8728. <!--l. 25--><p class="noindent" >Residue format partitions each vector in the vector bundle into chunks, classifies each
  8729. chunk, encodes the chunk classifications and finally encodes the chunks themselves
  8730. using the the specific VQ arrangement defined for each selected classification. The
  8731. exact interleaving and partitioning vary by residue encoding number, however the
  8732. high-level process used to classify and encode the residue vector is the same in all three
  8733. variants.
  8734. <!--l. 33--><p class="noindent" >A set of coded residue vectors are all of the same length. High level coding structure, ignoring for
  8735. the moment exactly how a partition is encoded and simply trusting that it is, is as
  8736. follows:
  8737. <ul class="itemize1">
  8738. <li class="itemize">Each vector is partitioned into multiple equal sized chunks according to configuration
  8739. specified. If we have a vector size of <span
  8740. class="cmti-12">n</span>, a partition size <span
  8741. class="cmti-12">residue&#x02d9;partition&#x02d9;size</span>, and
  8742. a total of <span
  8743. class="cmti-12">ch </span>residue vectors, the total number of partitioned chunks coded is
  8744. <span
  8745. class="cmti-12">n</span>/<span
  8746. class="cmti-12">residue&#x02d9;partition&#x02d9;size</span>*<span
  8747. class="cmti-12">ch</span>. It is important to note that the integer division truncates.
  8748. In the below example, we assume an example <span
  8749. class="cmti-12">residue&#x02d9;partition&#x02d9;size </span>of 8.
  8750. </li>
  8751. <li class="itemize">Each partition in each vector has a classification number that specifies which of
  8752. multiple configured VQ codebook setups are used to decode that partition. The
  8753. classification numbers of each partition can be thought of as forming a vector in
  8754. their own right, as in the illustration below. Just as the residue vectors are coded
  8755. in grouped partitions to increase encoding efficiency, the classification vector is also
  8756. partitioned into chunks. The integer elements of each scalar in a classification chunk
  8757. are built into a single scalar that represents the classification numbers in that chunk.
  8758. In the below example, the classification codeword encodes two classification numbers.
  8759. </li>
  8760. <li class="itemize">The values in a residue vector may be encoded monolithically in a single pass through
  8761. the residue vector, but more often efficient codebook design dictates that each vector
  8762. is encoded as the additive sum of several passes through the residue vector using
  8763. more than one VQ codebook. Thus, each residue value potentially accumulates values
  8764. from multiple decode passes. The classification value associated with a partition is
  8765. the same in each pass, thus the classification codeword is coded only in the first pass.
  8766. </li></ul>
  8767. <div class="center"
  8768. >
  8769. <!--l. 70--><p class="noindent" >
  8770. <!--l. 71--><p class="noindent" ><img
  8771. src="residue-pack.png" alt="PIC"
  8772. >
  8773. <br /> <table class="caption"
  8774. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;11: </td><td
  8775. class="content">illustration of residue vector format</td></tr></table><!--tex4ht:label?: x1-10400111 -->
  8776. </div>
  8777. <!--l. 77--><p class="noindent" >
  8778. <h4 class="subsectionHead"><span class="titlemark">8.3 </span> <a
  8779. id="x1-1050008.3"></a>residue 0</h4>
  8780. <!--l. 79--><p class="noindent" >Residue 0 and 1 differ only in the way the values within a residue partition are interleaved during
  8781. partition encoding (visually treated as a black box&#8211;or cyan box or brown box&#8211;in the above
  8782. figure).
  8783. <!--l. 83--><p class="noindent" >Residue encoding 0 interleaves VQ encoding according to the dimension of the codebook used to
  8784. encode a partition in a specific pass. The dimension of the codebook need not be the same in
  8785. multiple passes, however the partition size must be an even multiple of the codebook
  8786. dimension.
  8787. <!--l. 89--><p class="noindent" >As an example, assume a partition vector of size eight, to be encoded by residue 0 using
  8788. codebook sizes of 8, 4, 2 and 1:
  8789. <!--l. 92--><p class="noindent" >
  8790. <div class="fancyvrb" id="fancyvrb33">
  8791. <a
  8792. id="x1-105002r1"></a><span
  8793. class="cmr-6">1</span><span
  8794. class="cmtt-8">&#x00A0;</span><span
  8795. class="cmtt-8">&#x00A0;</span>
  8796. <br class="fancyvrb" /><a
  8797. id="x1-105004r2"></a><span
  8798. class="cmr-6">2</span><span
  8799. class="cmtt-8">&#x00A0;</span><span
  8800. class="cmtt-8">&#x00A0;</span><span
  8801. class="cmtt-8">&#x00A0;</span><span
  8802. class="cmtt-8">&#x00A0;</span><span
  8803. class="cmtt-8">&#x00A0;</span><span
  8804. class="cmtt-8">&#x00A0;</span><span
  8805. class="cmtt-8">&#x00A0;</span><span
  8806. class="cmtt-8">&#x00A0;</span><span
  8807. class="cmtt-8">&#x00A0;</span><span
  8808. class="cmtt-8">&#x00A0;</span><span
  8809. class="cmtt-8">&#x00A0;</span><span
  8810. class="cmtt-8">&#x00A0;</span><span
  8811. class="cmtt-8">&#x00A0;</span><span
  8812. class="cmtt-8">&#x00A0;original</span><span
  8813. class="cmtt-8">&#x00A0;residue</span><span
  8814. class="cmtt-8">&#x00A0;vector:</span><span
  8815. class="cmtt-8">&#x00A0;[</span><span
  8816. class="cmtt-8">&#x00A0;0</span><span
  8817. class="cmtt-8">&#x00A0;1</span><span
  8818. class="cmtt-8">&#x00A0;2</span><span
  8819. class="cmtt-8">&#x00A0;3</span><span
  8820. class="cmtt-8">&#x00A0;4</span><span
  8821. class="cmtt-8">&#x00A0;5</span><span
  8822. class="cmtt-8">&#x00A0;6</span><span
  8823. class="cmtt-8">&#x00A0;7</span><span
  8824. class="cmtt-8">&#x00A0;]</span>
  8825. <br class="fancyvrb" /><a
  8826. id="x1-105006r3"></a><span
  8827. class="cmr-6">3</span><span
  8828. class="cmtt-8">&#x00A0;</span><span
  8829. class="cmtt-8">&#x00A0;</span>
  8830. <br class="fancyvrb" /><a
  8831. id="x1-105008r4"></a><span
  8832. class="cmr-6">4</span><span
  8833. class="cmtt-8">&#x00A0;</span><span
  8834. class="cmtt-8">&#x00A0;codebook</span><span
  8835. class="cmtt-8">&#x00A0;dimensions</span><span
  8836. class="cmtt-8">&#x00A0;=</span><span
  8837. class="cmtt-8">&#x00A0;8</span><span
  8838. class="cmtt-8">&#x00A0;</span><span
  8839. class="cmtt-8">&#x00A0;encoded</span><span
  8840. class="cmtt-8">&#x00A0;as:</span><span
  8841. class="cmtt-8">&#x00A0;[</span><span
  8842. class="cmtt-8">&#x00A0;0</span><span
  8843. class="cmtt-8">&#x00A0;1</span><span
  8844. class="cmtt-8">&#x00A0;2</span><span
  8845. class="cmtt-8">&#x00A0;3</span><span
  8846. class="cmtt-8">&#x00A0;4</span><span
  8847. class="cmtt-8">&#x00A0;5</span><span
  8848. class="cmtt-8">&#x00A0;6</span><span
  8849. class="cmtt-8">&#x00A0;7</span><span
  8850. class="cmtt-8">&#x00A0;]</span>
  8851. <br class="fancyvrb" /><a
  8852. id="x1-105010r5"></a><span
  8853. class="cmr-6">5</span><span
  8854. class="cmtt-8">&#x00A0;</span><span
  8855. class="cmtt-8">&#x00A0;</span>
  8856. <br class="fancyvrb" /><a
  8857. id="x1-105012r6"></a><span
  8858. class="cmr-6">6</span><span
  8859. class="cmtt-8">&#x00A0;</span><span
  8860. class="cmtt-8">&#x00A0;codebook</span><span
  8861. class="cmtt-8">&#x00A0;dimensions</span><span
  8862. class="cmtt-8">&#x00A0;=</span><span
  8863. class="cmtt-8">&#x00A0;4</span><span
  8864. class="cmtt-8">&#x00A0;</span><span
  8865. class="cmtt-8">&#x00A0;encoded</span><span
  8866. class="cmtt-8">&#x00A0;as:</span><span
  8867. class="cmtt-8">&#x00A0;[</span><span
  8868. class="cmtt-8">&#x00A0;0</span><span
  8869. class="cmtt-8">&#x00A0;2</span><span
  8870. class="cmtt-8">&#x00A0;4</span><span
  8871. class="cmtt-8">&#x00A0;6</span><span
  8872. class="cmtt-8">&#x00A0;],</span><span
  8873. class="cmtt-8">&#x00A0;[</span><span
  8874. class="cmtt-8">&#x00A0;1</span><span
  8875. class="cmtt-8">&#x00A0;3</span><span
  8876. class="cmtt-8">&#x00A0;5</span><span
  8877. class="cmtt-8">&#x00A0;7</span><span
  8878. class="cmtt-8">&#x00A0;]</span>
  8879. <br class="fancyvrb" /><a
  8880. id="x1-105014r7"></a><span
  8881. class="cmr-6">7</span><span
  8882. class="cmtt-8">&#x00A0;</span><span
  8883. class="cmtt-8">&#x00A0;</span>
  8884. <br class="fancyvrb" /><a
  8885. id="x1-105016r8"></a><span
  8886. class="cmr-6">8</span><span
  8887. class="cmtt-8">&#x00A0;</span><span
  8888. class="cmtt-8">&#x00A0;codebook</span><span
  8889. class="cmtt-8">&#x00A0;dimensions</span><span
  8890. class="cmtt-8">&#x00A0;=</span><span
  8891. class="cmtt-8">&#x00A0;2</span><span
  8892. class="cmtt-8">&#x00A0;</span><span
  8893. class="cmtt-8">&#x00A0;encoded</span><span
  8894. class="cmtt-8">&#x00A0;as:</span><span
  8895. class="cmtt-8">&#x00A0;[</span><span
  8896. class="cmtt-8">&#x00A0;0</span><span
  8897. class="cmtt-8">&#x00A0;4</span><span
  8898. class="cmtt-8">&#x00A0;],</span><span
  8899. class="cmtt-8">&#x00A0;[</span><span
  8900. class="cmtt-8">&#x00A0;1</span><span
  8901. class="cmtt-8">&#x00A0;5</span><span
  8902. class="cmtt-8">&#x00A0;],</span><span
  8903. class="cmtt-8">&#x00A0;[</span><span
  8904. class="cmtt-8">&#x00A0;2</span><span
  8905. class="cmtt-8">&#x00A0;6</span><span
  8906. class="cmtt-8">&#x00A0;],</span><span
  8907. class="cmtt-8">&#x00A0;[</span><span
  8908. class="cmtt-8">&#x00A0;3</span><span
  8909. class="cmtt-8">&#x00A0;7</span><span
  8910. class="cmtt-8">&#x00A0;]</span>
  8911. <br class="fancyvrb" /><a
  8912. id="x1-105018r9"></a><span
  8913. class="cmr-6">9</span><span
  8914. class="cmtt-8">&#x00A0;</span><span
  8915. class="cmtt-8">&#x00A0;</span>
  8916. <br class="fancyvrb" /><a
  8917. id="x1-105020r10"></a><span
  8918. class="cmr-6">10</span><span
  8919. class="cmtt-8">&#x00A0;</span><span
  8920. class="cmtt-8">&#x00A0;codebook</span><span
  8921. class="cmtt-8">&#x00A0;dimensions</span><span
  8922. class="cmtt-8">&#x00A0;=</span><span
  8923. class="cmtt-8">&#x00A0;1</span><span
  8924. class="cmtt-8">&#x00A0;</span><span
  8925. class="cmtt-8">&#x00A0;encoded</span><span
  8926. class="cmtt-8">&#x00A0;as:</span><span
  8927. class="cmtt-8">&#x00A0;[</span><span
  8928. class="cmtt-8">&#x00A0;0</span><span
  8929. class="cmtt-8">&#x00A0;],</span><span
  8930. class="cmtt-8">&#x00A0;[</span><span
  8931. class="cmtt-8">&#x00A0;1</span><span
  8932. class="cmtt-8">&#x00A0;],</span><span
  8933. class="cmtt-8">&#x00A0;[</span><span
  8934. class="cmtt-8">&#x00A0;2</span><span
  8935. class="cmtt-8">&#x00A0;],</span><span
  8936. class="cmtt-8">&#x00A0;[</span><span
  8937. class="cmtt-8">&#x00A0;3</span><span
  8938. class="cmtt-8">&#x00A0;],</span><span
  8939. class="cmtt-8">&#x00A0;[</span><span
  8940. class="cmtt-8">&#x00A0;4</span><span
  8941. class="cmtt-8">&#x00A0;],</span><span
  8942. class="cmtt-8">&#x00A0;[</span><span
  8943. class="cmtt-8">&#x00A0;5</span><span
  8944. class="cmtt-8">&#x00A0;],</span><span
  8945. class="cmtt-8">&#x00A0;[</span><span
  8946. class="cmtt-8">&#x00A0;6</span><span
  8947. class="cmtt-8">&#x00A0;],</span><span
  8948. class="cmtt-8">&#x00A0;[</span><span
  8949. class="cmtt-8">&#x00A0;7</span><span
  8950. class="cmtt-8">&#x00A0;]</span>
  8951. <br class="fancyvrb" /><a
  8952. id="x1-105022r11"></a><span
  8953. class="cmr-6">11</span><span
  8954. class="cmtt-8">&#x00A0;</span><span
  8955. class="cmtt-8">&#x00A0;</span>
  8956. </div>
  8957. <!--l. 106--><p class="noindent" >It is worth mentioning at this point that no configurable value in the residue coding setup is
  8958. restricted to a power of two.
  8959. <!--l. 111--><p class="noindent" >
  8960. <h4 class="subsectionHead"><span class="titlemark">8.4 </span> <a
  8961. id="x1-1060008.4"></a>residue 1</h4>
  8962. <!--l. 113--><p class="noindent" >Residue 1 does not interleave VQ encoding. It represents partition vector scalars in order. As
  8963. with residue 0, however, partition length must be an integer multiple of the codebook dimension,
  8964. although dimension may vary from pass to pass.
  8965. <!--l. 118--><p class="noindent" >As an example, assume a partition vector of size eight, to be encoded by residue 0 using
  8966. codebook sizes of 8, 4, 2 and 1:
  8967. <!--l. 121--><p class="noindent" >
  8968. <div class="fancyvrb" id="fancyvrb34">
  8969. <a
  8970. id="x1-106002r1"></a><span
  8971. class="cmr-6">1</span><span
  8972. class="cmtt-8">&#x00A0;</span><span
  8973. class="cmtt-8">&#x00A0;</span>
  8974. <br class="fancyvrb" /><a
  8975. id="x1-106004r2"></a><span
  8976. class="cmr-6">2</span><span
  8977. class="cmtt-8">&#x00A0;</span><span
  8978. class="cmtt-8">&#x00A0;</span><span
  8979. class="cmtt-8">&#x00A0;</span><span
  8980. class="cmtt-8">&#x00A0;</span><span
  8981. class="cmtt-8">&#x00A0;</span><span
  8982. class="cmtt-8">&#x00A0;</span><span
  8983. class="cmtt-8">&#x00A0;</span><span
  8984. class="cmtt-8">&#x00A0;</span><span
  8985. class="cmtt-8">&#x00A0;</span><span
  8986. class="cmtt-8">&#x00A0;</span><span
  8987. class="cmtt-8">&#x00A0;</span><span
  8988. class="cmtt-8">&#x00A0;</span><span
  8989. class="cmtt-8">&#x00A0;</span><span
  8990. class="cmtt-8">&#x00A0;original</span><span
  8991. class="cmtt-8">&#x00A0;residue</span><span
  8992. class="cmtt-8">&#x00A0;vector:</span><span
  8993. class="cmtt-8">&#x00A0;[</span><span
  8994. class="cmtt-8">&#x00A0;0</span><span
  8995. class="cmtt-8">&#x00A0;1</span><span
  8996. class="cmtt-8">&#x00A0;2</span><span
  8997. class="cmtt-8">&#x00A0;3</span><span
  8998. class="cmtt-8">&#x00A0;4</span><span
  8999. class="cmtt-8">&#x00A0;5</span><span
  9000. class="cmtt-8">&#x00A0;6</span><span
  9001. class="cmtt-8">&#x00A0;7</span><span
  9002. class="cmtt-8">&#x00A0;]</span>
  9003. <br class="fancyvrb" /><a
  9004. id="x1-106006r3"></a><span
  9005. class="cmr-6">3</span><span
  9006. class="cmtt-8">&#x00A0;</span><span
  9007. class="cmtt-8">&#x00A0;</span>
  9008. <br class="fancyvrb" /><a
  9009. id="x1-106008r4"></a><span
  9010. class="cmr-6">4</span><span
  9011. class="cmtt-8">&#x00A0;</span><span
  9012. class="cmtt-8">&#x00A0;codebook</span><span
  9013. class="cmtt-8">&#x00A0;dimensions</span><span
  9014. class="cmtt-8">&#x00A0;=</span><span
  9015. class="cmtt-8">&#x00A0;8</span><span
  9016. class="cmtt-8">&#x00A0;</span><span
  9017. class="cmtt-8">&#x00A0;encoded</span><span
  9018. class="cmtt-8">&#x00A0;as:</span><span
  9019. class="cmtt-8">&#x00A0;[</span><span
  9020. class="cmtt-8">&#x00A0;0</span><span
  9021. class="cmtt-8">&#x00A0;1</span><span
  9022. class="cmtt-8">&#x00A0;2</span><span
  9023. class="cmtt-8">&#x00A0;3</span><span
  9024. class="cmtt-8">&#x00A0;4</span><span
  9025. class="cmtt-8">&#x00A0;5</span><span
  9026. class="cmtt-8">&#x00A0;6</span><span
  9027. class="cmtt-8">&#x00A0;7</span><span
  9028. class="cmtt-8">&#x00A0;]</span>
  9029. <br class="fancyvrb" /><a
  9030. id="x1-106010r5"></a><span
  9031. class="cmr-6">5</span><span
  9032. class="cmtt-8">&#x00A0;</span><span
  9033. class="cmtt-8">&#x00A0;</span>
  9034. <br class="fancyvrb" /><a
  9035. id="x1-106012r6"></a><span
  9036. class="cmr-6">6</span><span
  9037. class="cmtt-8">&#x00A0;</span><span
  9038. class="cmtt-8">&#x00A0;codebook</span><span
  9039. class="cmtt-8">&#x00A0;dimensions</span><span
  9040. class="cmtt-8">&#x00A0;=</span><span
  9041. class="cmtt-8">&#x00A0;4</span><span
  9042. class="cmtt-8">&#x00A0;</span><span
  9043. class="cmtt-8">&#x00A0;encoded</span><span
  9044. class="cmtt-8">&#x00A0;as:</span><span
  9045. class="cmtt-8">&#x00A0;[</span><span
  9046. class="cmtt-8">&#x00A0;0</span><span
  9047. class="cmtt-8">&#x00A0;1</span><span
  9048. class="cmtt-8">&#x00A0;2</span><span
  9049. class="cmtt-8">&#x00A0;3</span><span
  9050. class="cmtt-8">&#x00A0;],</span><span
  9051. class="cmtt-8">&#x00A0;[</span><span
  9052. class="cmtt-8">&#x00A0;4</span><span
  9053. class="cmtt-8">&#x00A0;5</span><span
  9054. class="cmtt-8">&#x00A0;6</span><span
  9055. class="cmtt-8">&#x00A0;7</span><span
  9056. class="cmtt-8">&#x00A0;]</span>
  9057. <br class="fancyvrb" /><a
  9058. id="x1-106014r7"></a><span
  9059. class="cmr-6">7</span><span
  9060. class="cmtt-8">&#x00A0;</span><span
  9061. class="cmtt-8">&#x00A0;</span>
  9062. <br class="fancyvrb" /><a
  9063. id="x1-106016r8"></a><span
  9064. class="cmr-6">8</span><span
  9065. class="cmtt-8">&#x00A0;</span><span
  9066. class="cmtt-8">&#x00A0;codebook</span><span
  9067. class="cmtt-8">&#x00A0;dimensions</span><span
  9068. class="cmtt-8">&#x00A0;=</span><span
  9069. class="cmtt-8">&#x00A0;2</span><span
  9070. class="cmtt-8">&#x00A0;</span><span
  9071. class="cmtt-8">&#x00A0;encoded</span><span
  9072. class="cmtt-8">&#x00A0;as:</span><span
  9073. class="cmtt-8">&#x00A0;[</span><span
  9074. class="cmtt-8">&#x00A0;0</span><span
  9075. class="cmtt-8">&#x00A0;1</span><span
  9076. class="cmtt-8">&#x00A0;],</span><span
  9077. class="cmtt-8">&#x00A0;[</span><span
  9078. class="cmtt-8">&#x00A0;2</span><span
  9079. class="cmtt-8">&#x00A0;3</span><span
  9080. class="cmtt-8">&#x00A0;],</span><span
  9081. class="cmtt-8">&#x00A0;[</span><span
  9082. class="cmtt-8">&#x00A0;4</span><span
  9083. class="cmtt-8">&#x00A0;5</span><span
  9084. class="cmtt-8">&#x00A0;],</span><span
  9085. class="cmtt-8">&#x00A0;[</span><span
  9086. class="cmtt-8">&#x00A0;6</span><span
  9087. class="cmtt-8">&#x00A0;7</span><span
  9088. class="cmtt-8">&#x00A0;]</span>
  9089. <br class="fancyvrb" /><a
  9090. id="x1-106018r9"></a><span
  9091. class="cmr-6">9</span><span
  9092. class="cmtt-8">&#x00A0;</span><span
  9093. class="cmtt-8">&#x00A0;</span>
  9094. <br class="fancyvrb" /><a
  9095. id="x1-106020r10"></a><span
  9096. class="cmr-6">10</span><span
  9097. class="cmtt-8">&#x00A0;</span><span
  9098. class="cmtt-8">&#x00A0;codebook</span><span
  9099. class="cmtt-8">&#x00A0;dimensions</span><span
  9100. class="cmtt-8">&#x00A0;=</span><span
  9101. class="cmtt-8">&#x00A0;1</span><span
  9102. class="cmtt-8">&#x00A0;</span><span
  9103. class="cmtt-8">&#x00A0;encoded</span><span
  9104. class="cmtt-8">&#x00A0;as:</span><span
  9105. class="cmtt-8">&#x00A0;[</span><span
  9106. class="cmtt-8">&#x00A0;0</span><span
  9107. class="cmtt-8">&#x00A0;],</span><span
  9108. class="cmtt-8">&#x00A0;[</span><span
  9109. class="cmtt-8">&#x00A0;1</span><span
  9110. class="cmtt-8">&#x00A0;],</span><span
  9111. class="cmtt-8">&#x00A0;[</span><span
  9112. class="cmtt-8">&#x00A0;2</span><span
  9113. class="cmtt-8">&#x00A0;],</span><span
  9114. class="cmtt-8">&#x00A0;[</span><span
  9115. class="cmtt-8">&#x00A0;3</span><span
  9116. class="cmtt-8">&#x00A0;],</span><span
  9117. class="cmtt-8">&#x00A0;[</span><span
  9118. class="cmtt-8">&#x00A0;4</span><span
  9119. class="cmtt-8">&#x00A0;],</span><span
  9120. class="cmtt-8">&#x00A0;[</span><span
  9121. class="cmtt-8">&#x00A0;5</span><span
  9122. class="cmtt-8">&#x00A0;],</span><span
  9123. class="cmtt-8">&#x00A0;[</span><span
  9124. class="cmtt-8">&#x00A0;6</span><span
  9125. class="cmtt-8">&#x00A0;],</span><span
  9126. class="cmtt-8">&#x00A0;[</span><span
  9127. class="cmtt-8">&#x00A0;7</span><span
  9128. class="cmtt-8">&#x00A0;]</span>
  9129. <br class="fancyvrb" /><a
  9130. id="x1-106022r11"></a><span
  9131. class="cmr-6">11</span><span
  9132. class="cmtt-8">&#x00A0;</span><span
  9133. class="cmtt-8">&#x00A0;</span>
  9134. </div>
  9135. <!--l. 137--><p class="noindent" >
  9136. <h4 class="subsectionHead"><span class="titlemark">8.5 </span> <a
  9137. id="x1-1070008.5"></a>residue 2</h4>
  9138. <!--l. 139--><p class="noindent" >Residue type two can be thought of as a variant of residue type 1. Rather than encoding multiple
  9139. passed-in vectors as in residue type 1, the <span
  9140. class="cmti-12">ch </span>passed in vectors of length <span
  9141. class="cmti-12">n </span>are first interleaved
  9142. and flattened into a single vector of length <span
  9143. class="cmti-12">ch</span>*<span
  9144. class="cmti-12">n</span>. Encoding then proceeds as in type 1. Decoding
  9145. is as in type 1 with decode interleave reversed. If operating on a single vector to begin with,
  9146. residue type 1 and type 2 are equivalent.
  9147. <div class="center"
  9148. >
  9149. <!--l. 147--><p class="noindent" >
  9150. <!--l. 148--><p class="noindent" ><img
  9151. src="residue2.png" alt="PIC"
  9152. >
  9153. <br /> <table class="caption"
  9154. ><tr style="vertical-align:baseline;" class="caption"><td class="id">Figure&#x00A0;12: </td><td
  9155. class="content">illustration of residue type 2</td></tr></table><!--tex4ht:label?: x1-10700112 -->
  9156. </div>
  9157. <!--l. 153--><p class="noindent" >
  9158. <h4 class="subsectionHead"><span class="titlemark">8.6 </span> <a
  9159. id="x1-1080008.6"></a>Residue decode</h4>
  9160. <!--l. 155--><p class="noindent" >
  9161. <h5 class="subsubsectionHead"><span class="titlemark">8.6.1 </span> <a
  9162. id="x1-1090008.6.1"></a>header decode</h5>
  9163. <!--l. 157--><p class="noindent" >Header decode for all three residue types is identical.
  9164. <div class="fancyvrb" id="fancyvrb35">
  9165. <a
  9166. id="x1-109002r1"></a><span
  9167. class="cmr-6">1</span><span
  9168. class="cmtt-8">&#x00A0;</span><span
  9169. class="cmtt-8">&#x00A0;</span><span
  9170. class="cmtt-8">&#x00A0;</span><span
  9171. class="cmtt-8">&#x00A0;1)</span><span
  9172. class="cmtt-8">&#x00A0;[residue_begin]</span><span
  9173. class="cmtt-8">&#x00A0;=</span><span
  9174. class="cmtt-8">&#x00A0;read</span><span
  9175. class="cmtt-8">&#x00A0;24</span><span
  9176. class="cmtt-8">&#x00A0;bits</span><span
  9177. class="cmtt-8">&#x00A0;as</span><span
  9178. class="cmtt-8">&#x00A0;unsigned</span><span
  9179. class="cmtt-8">&#x00A0;integer</span>
  9180. <br class="fancyvrb" /><a
  9181. id="x1-109004r2"></a><span
  9182. class="cmr-6">2</span><span
  9183. class="cmtt-8">&#x00A0;</span><span
  9184. class="cmtt-8">&#x00A0;</span><span
  9185. class="cmtt-8">&#x00A0;</span><span
  9186. class="cmtt-8">&#x00A0;2)</span><span
  9187. class="cmtt-8">&#x00A0;[residue_end]</span><span
  9188. class="cmtt-8">&#x00A0;=</span><span
  9189. class="cmtt-8">&#x00A0;read</span><span
  9190. class="cmtt-8">&#x00A0;24</span><span
  9191. class="cmtt-8">&#x00A0;bits</span><span
  9192. class="cmtt-8">&#x00A0;as</span><span
  9193. class="cmtt-8">&#x00A0;unsigned</span><span
  9194. class="cmtt-8">&#x00A0;integer</span>
  9195. <br class="fancyvrb" /><a
  9196. id="x1-109006r3"></a><span
  9197. class="cmr-6">3</span><span
  9198. class="cmtt-8">&#x00A0;</span><span
  9199. class="cmtt-8">&#x00A0;</span><span
  9200. class="cmtt-8">&#x00A0;</span><span
  9201. class="cmtt-8">&#x00A0;3)</span><span
  9202. class="cmtt-8">&#x00A0;[residue_partition_size]</span><span
  9203. class="cmtt-8">&#x00A0;=</span><span
  9204. class="cmtt-8">&#x00A0;read</span><span
  9205. class="cmtt-8">&#x00A0;24</span><span
  9206. class="cmtt-8">&#x00A0;bits</span><span
  9207. class="cmtt-8">&#x00A0;as</span><span
  9208. class="cmtt-8">&#x00A0;unsigned</span><span
  9209. class="cmtt-8">&#x00A0;integer</span><span
  9210. class="cmtt-8">&#x00A0;and</span><span
  9211. class="cmtt-8">&#x00A0;add</span><span
  9212. class="cmtt-8">&#x00A0;one</span>
  9213. <br class="fancyvrb" /><a
  9214. id="x1-109008r4"></a><span
  9215. class="cmr-6">4</span><span
  9216. class="cmtt-8">&#x00A0;</span><span
  9217. class="cmtt-8">&#x00A0;</span><span
  9218. class="cmtt-8">&#x00A0;</span><span
  9219. class="cmtt-8">&#x00A0;4)</span><span
  9220. class="cmtt-8">&#x00A0;[residue_classifications]</span><span
  9221. class="cmtt-8">&#x00A0;=</span><span
  9222. class="cmtt-8">&#x00A0;read</span><span
  9223. class="cmtt-8">&#x00A0;6</span><span
  9224. class="cmtt-8">&#x00A0;bits</span><span
  9225. class="cmtt-8">&#x00A0;as</span><span
  9226. class="cmtt-8">&#x00A0;unsigned</span><span
  9227. class="cmtt-8">&#x00A0;integer</span><span
  9228. class="cmtt-8">&#x00A0;and</span><span
  9229. class="cmtt-8">&#x00A0;add</span><span
  9230. class="cmtt-8">&#x00A0;one</span>
  9231. <br class="fancyvrb" /><a
  9232. id="x1-109010r5"></a><span
  9233. class="cmr-6">5</span><span
  9234. class="cmtt-8">&#x00A0;</span><span
  9235. class="cmtt-8">&#x00A0;</span><span
  9236. class="cmtt-8">&#x00A0;</span><span
  9237. class="cmtt-8">&#x00A0;5)</span><span
  9238. class="cmtt-8">&#x00A0;[residue_classbook]</span><span
  9239. class="cmtt-8">&#x00A0;=</span><span
  9240. class="cmtt-8">&#x00A0;read</span><span
  9241. class="cmtt-8">&#x00A0;8</span><span
  9242. class="cmtt-8">&#x00A0;bits</span><span
  9243. class="cmtt-8">&#x00A0;as</span><span
  9244. class="cmtt-8">&#x00A0;unsigned</span><span
  9245. class="cmtt-8">&#x00A0;integer</span>
  9246. </div>
  9247. <!--l. 166--><p class="noindent" ><span
  9248. class="cmtt-12">[residue_begin] </span>and <span
  9249. class="cmtt-12">[residue_end] </span>select the specific sub-portion of each vector that is
  9250. actually coded; it implements akin to a bandpass where, for coding purposes, the vector
  9251. effectively begins at element <span
  9252. class="cmtt-12">[residue_begin] </span>and ends at <span
  9253. class="cmtt-12">[residue_end]</span>. Preceding and
  9254. following values in the unpacked vectors are zeroed. Note that for residue type 2, these
  9255. values as well as <span
  9256. class="cmtt-12">[residue_partition_size]</span>apply to the interleaved vector, not the
  9257. individual vectors before interleave. <span
  9258. class="cmtt-12">[residue_partition_size] </span>is as explained above,
  9259. <span
  9260. class="cmtt-12">[residue_classifications] </span>is the number of possible classification to which a partition can
  9261. belong and <span
  9262. class="cmtt-12">[residue_classbook] </span>is the codebook number used to code classification
  9263. codewords. The number of dimensions in book <span
  9264. class="cmtt-12">[residue_classbook] </span>determines how
  9265. many classification values are grouped into a single classification codeword. Note that
  9266. the number of entries and dimensions in book <span
  9267. class="cmtt-12">[residue_classbook]</span>, along with
  9268. <span
  9269. class="cmtt-12">[residue_classifications]</span>, overdetermines to possible number of classification
  9270. codewords. If <span
  9271. class="cmtt-12">[residue_classifications]</span>&#x02C6;<span
  9272. class="cmtt-12">[residue_classbook]</span>.dimensions exceeds
  9273. <span
  9274. class="cmtt-12">[residue_classbook]</span>.entries, the bitstream should be regarded to be undecodable.
  9275. <!--l. 190--><p class="noindent" >Next we read a bitmap pattern that specifies which partition classes code values in which
  9276. passes.
  9277. <!--l. 193--><p class="noindent" >
  9278. <div class="fancyvrb" id="fancyvrb36">
  9279. <a
  9280. id="x1-109012r1"></a><span
  9281. class="cmr-6">1</span><span
  9282. class="cmtt-8">&#x00A0;</span><span
  9283. class="cmtt-8">&#x00A0;</span><span
  9284. class="cmtt-8">&#x00A0;</span><span
  9285. class="cmtt-8">&#x00A0;1)</span><span
  9286. class="cmtt-8">&#x00A0;iterate</span><span
  9287. class="cmtt-8">&#x00A0;[i]</span><span
  9288. class="cmtt-8">&#x00A0;over</span><span
  9289. class="cmtt-8">&#x00A0;the</span><span
  9290. class="cmtt-8">&#x00A0;range</span><span
  9291. class="cmtt-8">&#x00A0;0</span><span
  9292. class="cmtt-8">&#x00A0;...</span><span
  9293. class="cmtt-8">&#x00A0;[residue_classifications]-1</span><span
  9294. class="cmtt-8">&#x00A0;{</span>
  9295. <br class="fancyvrb" /><a
  9296. id="x1-109014r2"></a><span
  9297. class="cmr-6">2</span><span
  9298. class="cmtt-8">&#x00A0;</span><span
  9299. class="cmtt-8">&#x00A0;</span>
  9300. <br class="fancyvrb" /><a
  9301. id="x1-109016r3"></a><span
  9302. class="cmr-6">3</span><span
  9303. class="cmtt-8">&#x00A0;</span><span
  9304. class="cmtt-8">&#x00A0;</span><span
  9305. class="cmtt-8">&#x00A0;</span><span
  9306. class="cmtt-8">&#x00A0;</span><span
  9307. class="cmtt-8">&#x00A0;</span><span
  9308. class="cmtt-8">&#x00A0;</span><span
  9309. class="cmtt-8">&#x00A0;</span><span
  9310. class="cmtt-8">&#x00A0;</span><span
  9311. class="cmtt-8">&#x00A0;2)</span><span
  9312. class="cmtt-8">&#x00A0;[high_bits]</span><span
  9313. class="cmtt-8">&#x00A0;=</span><span
  9314. class="cmtt-8">&#x00A0;0</span>
  9315. <br class="fancyvrb" /><a
  9316. id="x1-109018r4"></a><span
  9317. class="cmr-6">4</span><span
  9318. class="cmtt-8">&#x00A0;</span><span
  9319. class="cmtt-8">&#x00A0;</span><span
  9320. class="cmtt-8">&#x00A0;</span><span
  9321. class="cmtt-8">&#x00A0;</span><span
  9322. class="cmtt-8">&#x00A0;</span><span
  9323. class="cmtt-8">&#x00A0;</span><span
  9324. class="cmtt-8">&#x00A0;</span><span
  9325. class="cmtt-8">&#x00A0;</span><span
  9326. class="cmtt-8">&#x00A0;3)</span><span
  9327. class="cmtt-8">&#x00A0;[low_bits]</span><span
  9328. class="cmtt-8">&#x00A0;=</span><span
  9329. class="cmtt-8">&#x00A0;read</span><span
  9330. class="cmtt-8">&#x00A0;3</span><span
  9331. class="cmtt-8">&#x00A0;bits</span><span
  9332. class="cmtt-8">&#x00A0;as</span><span
  9333. class="cmtt-8">&#x00A0;unsigned</span><span
  9334. class="cmtt-8">&#x00A0;integer</span>
  9335. <br class="fancyvrb" /><a
  9336. id="x1-109020r5"></a><span
  9337. class="cmr-6">5</span><span
  9338. class="cmtt-8">&#x00A0;</span><span
  9339. class="cmtt-8">&#x00A0;</span><span
  9340. class="cmtt-8">&#x00A0;</span><span
  9341. class="cmtt-8">&#x00A0;</span><span
  9342. class="cmtt-8">&#x00A0;</span><span
  9343. class="cmtt-8">&#x00A0;</span><span
  9344. class="cmtt-8">&#x00A0;</span><span
  9345. class="cmtt-8">&#x00A0;</span><span
  9346. class="cmtt-8">&#x00A0;4)</span><span
  9347. class="cmtt-8">&#x00A0;[bitflag]</span><span
  9348. class="cmtt-8">&#x00A0;=</span><span
  9349. class="cmtt-8">&#x00A0;read</span><span
  9350. class="cmtt-8">&#x00A0;one</span><span
  9351. class="cmtt-8">&#x00A0;bit</span><span
  9352. class="cmtt-8">&#x00A0;as</span><span
  9353. class="cmtt-8">&#x00A0;boolean</span>
  9354. <br class="fancyvrb" /><a
  9355. id="x1-109022r6"></a><span
  9356. class="cmr-6">6</span><span
  9357. class="cmtt-8">&#x00A0;</span><span
  9358. class="cmtt-8">&#x00A0;</span><span
  9359. class="cmtt-8">&#x00A0;</span><span
  9360. class="cmtt-8">&#x00A0;</span><span
  9361. class="cmtt-8">&#x00A0;</span><span
  9362. class="cmtt-8">&#x00A0;</span><span
  9363. class="cmtt-8">&#x00A0;</span><span
  9364. class="cmtt-8">&#x00A0;</span><span
  9365. class="cmtt-8">&#x00A0;5)</span><span
  9366. class="cmtt-8">&#x00A0;if</span><span
  9367. class="cmtt-8">&#x00A0;(</span><span
  9368. class="cmtt-8">&#x00A0;[bitflag]</span><span
  9369. class="cmtt-8">&#x00A0;is</span><span
  9370. class="cmtt-8">&#x00A0;set</span><span
  9371. class="cmtt-8">&#x00A0;)</span><span
  9372. class="cmtt-8">&#x00A0;then</span><span
  9373. class="cmtt-8">&#x00A0;[high_bits]</span><span
  9374. class="cmtt-8">&#x00A0;=</span><span
  9375. class="cmtt-8">&#x00A0;read</span><span
  9376. class="cmtt-8">&#x00A0;five</span><span
  9377. class="cmtt-8">&#x00A0;bits</span><span
  9378. class="cmtt-8">&#x00A0;as</span><span
  9379. class="cmtt-8">&#x00A0;unsigned</span><span
  9380. class="cmtt-8">&#x00A0;integer</span>
  9381. <br class="fancyvrb" /><a
  9382. id="x1-109024r7"></a><span
  9383. class="cmr-6">7</span><span
  9384. class="cmtt-8">&#x00A0;</span><span
  9385. class="cmtt-8">&#x00A0;</span><span
  9386. class="cmtt-8">&#x00A0;</span><span
  9387. class="cmtt-8">&#x00A0;</span><span
  9388. class="cmtt-8">&#x00A0;</span><span
  9389. class="cmtt-8">&#x00A0;</span><span
  9390. class="cmtt-8">&#x00A0;</span><span
  9391. class="cmtt-8">&#x00A0;</span><span
  9392. class="cmtt-8">&#x00A0;6)</span><span
  9393. class="cmtt-8">&#x00A0;vector</span><span
  9394. class="cmtt-8">&#x00A0;[residue_cascade]</span><span
  9395. class="cmtt-8">&#x00A0;element</span><span
  9396. class="cmtt-8">&#x00A0;[i]</span><span
  9397. class="cmtt-8">&#x00A0;=</span><span
  9398. class="cmtt-8">&#x00A0;[high_bits]</span><span
  9399. class="cmtt-8">&#x00A0;*</span><span
  9400. class="cmtt-8">&#x00A0;8</span><span
  9401. class="cmtt-8">&#x00A0;+</span><span
  9402. class="cmtt-8">&#x00A0;[low_bits]</span>
  9403. <br class="fancyvrb" /><a
  9404. id="x1-109026r8"></a><span
  9405. class="cmr-6">8</span><span
  9406. class="cmtt-8">&#x00A0;</span><span
  9407. class="cmtt-8">&#x00A0;</span><span
  9408. class="cmtt-8">&#x00A0;</span><span
  9409. class="cmtt-8">&#x00A0;</span><span
  9410. class="cmtt-8">&#x00A0;</span><span
  9411. class="cmtt-8">&#x00A0;</span><span
  9412. class="cmtt-8">&#x00A0;}</span>
  9413. <br class="fancyvrb" /><a
  9414. id="x1-109028r9"></a><span
  9415. class="cmr-6">9</span><span
  9416. class="cmtt-8">&#x00A0;</span><span
  9417. class="cmtt-8">&#x00A0;</span><span
  9418. class="cmtt-8">&#x00A0;</span><span
  9419. class="cmtt-8">&#x00A0;7)</span><span
  9420. class="cmtt-8">&#x00A0;done</span>
  9421. </div>
  9422. <!--l. 205--><p class="noindent" >Finally, we read in a list of book numbers, each corresponding to specific bit set in the cascade
  9423. bitmap. We loop over the possible codebook classifications and the maximum possible number of
  9424. encoding stages (8 in Vorbis I, as constrained by the elements of the cascade bitmap being eight
  9425. bits):
  9426. <!--l. 211--><p class="noindent" >
  9427. <div class="fancyvrb" id="fancyvrb37">
  9428. <a
  9429. id="x1-109030r1"></a><span
  9430. class="cmr-6">1</span><span
  9431. class="cmtt-8">&#x00A0;</span><span
  9432. class="cmtt-8">&#x00A0;</span><span
  9433. class="cmtt-8">&#x00A0;</span><span
  9434. class="cmtt-8">&#x00A0;1)</span><span
  9435. class="cmtt-8">&#x00A0;iterate</span><span
  9436. class="cmtt-8">&#x00A0;[i]</span><span
  9437. class="cmtt-8">&#x00A0;over</span><span
  9438. class="cmtt-8">&#x00A0;the</span><span
  9439. class="cmtt-8">&#x00A0;range</span><span
  9440. class="cmtt-8">&#x00A0;0</span><span
  9441. class="cmtt-8">&#x00A0;...</span><span
  9442. class="cmtt-8">&#x00A0;[residue_classifications]-1</span><span
  9443. class="cmtt-8">&#x00A0;{</span>
  9444. <br class="fancyvrb" /><a
  9445. id="x1-109032r2"></a><span
  9446. class="cmr-6">2</span><span
  9447. class="cmtt-8">&#x00A0;</span><span
  9448. class="cmtt-8">&#x00A0;</span>
  9449. <br class="fancyvrb" /><a
  9450. id="x1-109034r3"></a><span
  9451. class="cmr-6">3</span><span
  9452. class="cmtt-8">&#x00A0;</span><span
  9453. class="cmtt-8">&#x00A0;</span><span
  9454. class="cmtt-8">&#x00A0;</span><span
  9455. class="cmtt-8">&#x00A0;</span><span
  9456. class="cmtt-8">&#x00A0;</span><span
  9457. class="cmtt-8">&#x00A0;</span><span
  9458. class="cmtt-8">&#x00A0;</span><span
  9459. class="cmtt-8">&#x00A0;</span><span
  9460. class="cmtt-8">&#x00A0;2)</span><span
  9461. class="cmtt-8">&#x00A0;iterate</span><span
  9462. class="cmtt-8">&#x00A0;[j]</span><span
  9463. class="cmtt-8">&#x00A0;over</span><span
  9464. class="cmtt-8">&#x00A0;the</span><span
  9465. class="cmtt-8">&#x00A0;range</span><span
  9466. class="cmtt-8">&#x00A0;0</span><span
  9467. class="cmtt-8">&#x00A0;...</span><span
  9468. class="cmtt-8">&#x00A0;7</span><span
  9469. class="cmtt-8">&#x00A0;{</span>
  9470. <br class="fancyvrb" /><a
  9471. id="x1-109036r4"></a><span
  9472. class="cmr-6">4</span><span
  9473. class="cmtt-8">&#x00A0;</span><span
  9474. class="cmtt-8">&#x00A0;</span>
  9475. <br class="fancyvrb" /><a
  9476. id="x1-109038r5"></a><span
  9477. class="cmr-6">5</span><span
  9478. class="cmtt-8">&#x00A0;</span><span
  9479. class="cmtt-8">&#x00A0;</span><span
  9480. class="cmtt-8">&#x00A0;</span><span
  9481. class="cmtt-8">&#x00A0;</span><span
  9482. class="cmtt-8">&#x00A0;</span><span
  9483. class="cmtt-8">&#x00A0;</span><span
  9484. class="cmtt-8">&#x00A0;</span><span
  9485. class="cmtt-8">&#x00A0;</span><span
  9486. class="cmtt-8">&#x00A0;</span><span
  9487. class="cmtt-8">&#x00A0;</span><span
  9488. class="cmtt-8">&#x00A0;</span><span
  9489. class="cmtt-8">&#x00A0;</span><span
  9490. class="cmtt-8">&#x00A0;</span><span
  9491. class="cmtt-8">&#x00A0;3)</span><span
  9492. class="cmtt-8">&#x00A0;if</span><span
  9493. class="cmtt-8">&#x00A0;(</span><span
  9494. class="cmtt-8">&#x00A0;vector</span><span
  9495. class="cmtt-8">&#x00A0;[residue_cascade]</span><span
  9496. class="cmtt-8">&#x00A0;element</span><span
  9497. class="cmtt-8">&#x00A0;[i]</span><span
  9498. class="cmtt-8">&#x00A0;bit</span><span
  9499. class="cmtt-8">&#x00A0;[j]</span><span
  9500. class="cmtt-8">&#x00A0;is</span><span
  9501. class="cmtt-8">&#x00A0;set</span><span
  9502. class="cmtt-8">&#x00A0;)</span><span
  9503. class="cmtt-8">&#x00A0;{</span>
  9504. <br class="fancyvrb" /><a
  9505. id="x1-109040r6"></a><span
  9506. class="cmr-6">6</span><span
  9507. class="cmtt-8">&#x00A0;</span><span
  9508. class="cmtt-8">&#x00A0;</span>
  9509. <br class="fancyvrb" /><a
  9510. id="x1-109042r7"></a><span
  9511. class="cmr-6">7</span><span
  9512. class="cmtt-8">&#x00A0;</span><span
  9513. class="cmtt-8">&#x00A0;</span><span
  9514. class="cmtt-8">&#x00A0;</span><span
  9515. class="cmtt-8">&#x00A0;</span><span
  9516. class="cmtt-8">&#x00A0;</span><span
  9517. class="cmtt-8">&#x00A0;</span><span
  9518. class="cmtt-8">&#x00A0;</span><span
  9519. class="cmtt-8">&#x00A0;</span><span
  9520. class="cmtt-8">&#x00A0;</span><span
  9521. class="cmtt-8">&#x00A0;</span><span
  9522. class="cmtt-8">&#x00A0;</span><span
  9523. class="cmtt-8">&#x00A0;</span><span
  9524. class="cmtt-8">&#x00A0;</span><span
  9525. class="cmtt-8">&#x00A0;</span><span
  9526. class="cmtt-8">&#x00A0;</span><span
  9527. class="cmtt-8">&#x00A0;</span><span
  9528. class="cmtt-8">&#x00A0;</span><span
  9529. class="cmtt-8">&#x00A0;</span><span
  9530. class="cmtt-8">&#x00A0;4)</span><span
  9531. class="cmtt-8">&#x00A0;array</span><span
  9532. class="cmtt-8">&#x00A0;[residue_books]</span><span
  9533. class="cmtt-8">&#x00A0;element</span><span
  9534. class="cmtt-8">&#x00A0;[i][j]</span><span
  9535. class="cmtt-8">&#x00A0;=</span><span
  9536. class="cmtt-8">&#x00A0;read</span><span
  9537. class="cmtt-8">&#x00A0;8</span><span
  9538. class="cmtt-8">&#x00A0;bits</span><span
  9539. class="cmtt-8">&#x00A0;as</span><span
  9540. class="cmtt-8">&#x00A0;unsigned</span><span
  9541. class="cmtt-8">&#x00A0;integer</span>
  9542. <br class="fancyvrb" /><a
  9543. id="x1-109044r8"></a><span
  9544. class="cmr-6">8</span><span
  9545. class="cmtt-8">&#x00A0;</span><span
  9546. class="cmtt-8">&#x00A0;</span>
  9547. <br class="fancyvrb" /><a
  9548. id="x1-109046r9"></a><span
  9549. class="cmr-6">9</span><span
  9550. class="cmtt-8">&#x00A0;</span><span
  9551. class="cmtt-8">&#x00A0;</span><span
  9552. class="cmtt-8">&#x00A0;</span><span
  9553. class="cmtt-8">&#x00A0;</span><span
  9554. class="cmtt-8">&#x00A0;</span><span
  9555. class="cmtt-8">&#x00A0;</span><span
  9556. class="cmtt-8">&#x00A0;</span><span
  9557. class="cmtt-8">&#x00A0;</span><span
  9558. class="cmtt-8">&#x00A0;</span><span
  9559. class="cmtt-8">&#x00A0;</span><span
  9560. class="cmtt-8">&#x00A0;</span><span
  9561. class="cmtt-8">&#x00A0;</span><span
  9562. class="cmtt-8">&#x00A0;</span><span
  9563. class="cmtt-8">&#x00A0;</span><span
  9564. class="cmtt-8">&#x00A0;</span><span
  9565. class="cmtt-8">&#x00A0;</span><span
  9566. class="cmtt-8">&#x00A0;}</span><span
  9567. class="cmtt-8">&#x00A0;else</span><span
  9568. class="cmtt-8">&#x00A0;{</span>
  9569. <br class="fancyvrb" /><a
  9570. id="x1-109048r10"></a><span
  9571. class="cmr-6">10</span><span
  9572. class="cmtt-8">&#x00A0;</span><span
  9573. class="cmtt-8">&#x00A0;</span>
  9574. <br class="fancyvrb" /><a
  9575. id="x1-109050r11"></a><span
  9576. class="cmr-6">11</span><span
  9577. class="cmtt-8">&#x00A0;</span><span
  9578. class="cmtt-8">&#x00A0;</span><span
  9579. class="cmtt-8">&#x00A0;</span><span
  9580. class="cmtt-8">&#x00A0;</span><span
  9581. class="cmtt-8">&#x00A0;</span><span
  9582. class="cmtt-8">&#x00A0;</span><span
  9583. class="cmtt-8">&#x00A0;</span><span
  9584. class="cmtt-8">&#x00A0;</span><span
  9585. class="cmtt-8">&#x00A0;</span><span
  9586. class="cmtt-8">&#x00A0;</span><span
  9587. class="cmtt-8">&#x00A0;</span><span
  9588. class="cmtt-8">&#x00A0;</span><span
  9589. class="cmtt-8">&#x00A0;</span><span
  9590. class="cmtt-8">&#x00A0;</span><span
  9591. class="cmtt-8">&#x00A0;</span><span
  9592. class="cmtt-8">&#x00A0;</span><span
  9593. class="cmtt-8">&#x00A0;</span><span
  9594. class="cmtt-8">&#x00A0;</span><span
  9595. class="cmtt-8">&#x00A0;5)</span><span
  9596. class="cmtt-8">&#x00A0;array</span><span
  9597. class="cmtt-8">&#x00A0;[residue_books]</span><span
  9598. class="cmtt-8">&#x00A0;element</span><span
  9599. class="cmtt-8">&#x00A0;[i][j]</span><span
  9600. class="cmtt-8">&#x00A0;=</span><span
  9601. class="cmtt-8">&#x00A0;unused</span>
  9602. <br class="fancyvrb" /><a
  9603. id="x1-109052r12"></a><span
  9604. class="cmr-6">12</span><span
  9605. class="cmtt-8">&#x00A0;</span><span
  9606. class="cmtt-8">&#x00A0;</span>
  9607. <br class="fancyvrb" /><a
  9608. id="x1-109054r13"></a><span
  9609. class="cmr-6">13</span><span
  9610. class="cmtt-8">&#x00A0;</span><span
  9611. class="cmtt-8">&#x00A0;</span><span
  9612. class="cmtt-8">&#x00A0;</span><span
  9613. class="cmtt-8">&#x00A0;</span><span
  9614. class="cmtt-8">&#x00A0;</span><span
  9615. class="cmtt-8">&#x00A0;</span><span
  9616. class="cmtt-8">&#x00A0;</span><span
  9617. class="cmtt-8">&#x00A0;</span><span
  9618. class="cmtt-8">&#x00A0;</span><span
  9619. class="cmtt-8">&#x00A0;</span><span
  9620. class="cmtt-8">&#x00A0;</span><span
  9621. class="cmtt-8">&#x00A0;</span><span
  9622. class="cmtt-8">&#x00A0;</span><span
  9623. class="cmtt-8">&#x00A0;</span><span
  9624. class="cmtt-8">&#x00A0;</span><span
  9625. class="cmtt-8">&#x00A0;</span><span
  9626. class="cmtt-8">&#x00A0;}</span>
  9627. <br class="fancyvrb" /><a
  9628. id="x1-109056r14"></a><span
  9629. class="cmr-6">14</span><span
  9630. class="cmtt-8">&#x00A0;</span><span
  9631. class="cmtt-8">&#x00A0;</span><span
  9632. class="cmtt-8">&#x00A0;</span><span
  9633. class="cmtt-8">&#x00A0;</span><span
  9634. class="cmtt-8">&#x00A0;</span><span
  9635. class="cmtt-8">&#x00A0;</span><span
  9636. class="cmtt-8">&#x00A0;</span><span
  9637. class="cmtt-8">&#x00A0;</span><span
  9638. class="cmtt-8">&#x00A0;</span><span
  9639. class="cmtt-8">&#x00A0;</span><span
  9640. class="cmtt-8">&#x00A0;</span><span
  9641. class="cmtt-8">&#x00A0;}</span>
  9642. <br class="fancyvrb" /><a
  9643. id="x1-109058r15"></a><span
  9644. class="cmr-6">15</span><span
  9645. class="cmtt-8">&#x00A0;</span><span
  9646. class="cmtt-8">&#x00A0;</span><span
  9647. class="cmtt-8">&#x00A0;</span><span
  9648. class="cmtt-8">&#x00A0;</span><span
  9649. class="cmtt-8">&#x00A0;</span><span
  9650. class="cmtt-8">&#x00A0;</span><span
  9651. class="cmtt-8">&#x00A0;</span><span
  9652. class="cmtt-8">&#x00A0;}</span>
  9653. <br class="fancyvrb" /><a
  9654. id="x1-109060r16"></a><span
  9655. class="cmr-6">16</span><span
  9656. class="cmtt-8">&#x00A0;</span><span
  9657. class="cmtt-8">&#x00A0;</span>
  9658. <br class="fancyvrb" /><a
  9659. id="x1-109062r17"></a><span
  9660. class="cmr-6">17</span><span
  9661. class="cmtt-8">&#x00A0;</span><span
  9662. class="cmtt-8">&#x00A0;</span><span
  9663. class="cmtt-8">&#x00A0;</span><span
  9664. class="cmtt-8">&#x00A0;6)</span><span
  9665. class="cmtt-8">&#x00A0;done</span>
  9666. </div>
  9667. <!--l. 231--><p class="noindent" >An end-of-packet condition at any point in header decode renders the stream undecodable. In
  9668. addition, any codebook number greater than the maximum numbered codebook set up in this
  9669. stream also renders the stream undecodable.
  9670. <!--l. 238--><p class="noindent" >
  9671. <h5 class="subsubsectionHead"><span class="titlemark">8.6.2 </span> <a
  9672. id="x1-1100008.6.2"></a>packet decode</h5>
  9673. <!--l. 240--><p class="noindent" >Format 0 and 1 packet decode is identical except for specific partition interleave. Format 2 packet
  9674. decode can be built out of the format 1 decode process. Thus we describe first the decode
  9675. infrastructure identical to all three formats.
  9676. <!--l. 245--><p class="noindent" >In addition to configuration information, the residue decode process is passed the number of
  9677. vectors in the submap bundle and a vector of flags indicating if any of the vectors are not to be
  9678. decoded. If the passed in number of vectors is 3 and vector number 1 is marked &#8217;do not decode&#8217;,
  9679. decode skips vector 1 during the decode loop. However, even &#8217;do not decode&#8217; vectors are
  9680. allocated and zeroed.
  9681. <!--l. 252--><p class="noindent" >Depending on the values of <span
  9682. class="cmtt-12">[residue_begin] </span>and <span
  9683. class="cmtt-12">[residue_end]</span>, it is obvious that the
  9684. encoded portion of a residue vector may be the entire possible residue vector or some other strict
  9685. subset of the actual residue vector size with zero padding at either uncoded end. However, it is
  9686. also possible to set <span
  9687. class="cmtt-12">[residue_begin] </span>and <span
  9688. class="cmtt-12">[residue_end] </span>to specify a range partially or wholly
  9689. beyond the maximum vector size. Before beginning residue decode, limit <span
  9690. class="cmtt-12">[residue_begin]</span>
  9691. and <span
  9692. class="cmtt-12">[residue_end] </span>to the maximum possible vector size as follows. We assume that
  9693. the number of vectors being encoded, <span
  9694. class="cmtt-12">[ch] </span>is provided by the higher level decoding
  9695. process.
  9696. <!--l. 266--><p class="noindent" >
  9697. <div class="fancyvrb" id="fancyvrb38">
  9698. <a
  9699. id="x1-110002r1"></a><span
  9700. class="cmr-6">1</span><span
  9701. class="cmtt-8">&#x00A0;</span><span
  9702. class="cmtt-8">&#x00A0;</span><span
  9703. class="cmtt-8">&#x00A0;</span><span
  9704. class="cmtt-8">&#x00A0;1)</span><span
  9705. class="cmtt-8">&#x00A0;[actual_size]</span><span
  9706. class="cmtt-8">&#x00A0;=</span><span
  9707. class="cmtt-8">&#x00A0;current</span><span
  9708. class="cmtt-8">&#x00A0;blocksize/2;</span>
  9709. <br class="fancyvrb" /><a
  9710. id="x1-110004r2"></a><span
  9711. class="cmr-6">2</span><span
  9712. class="cmtt-8">&#x00A0;</span><span
  9713. class="cmtt-8">&#x00A0;</span><span
  9714. class="cmtt-8">&#x00A0;</span><span
  9715. class="cmtt-8">&#x00A0;2)</span><span
  9716. class="cmtt-8">&#x00A0;if</span><span
  9717. class="cmtt-8">&#x00A0;residue</span><span
  9718. class="cmtt-8">&#x00A0;encoding</span><span
  9719. class="cmtt-8">&#x00A0;is</span><span
  9720. class="cmtt-8">&#x00A0;format</span><span
  9721. class="cmtt-8">&#x00A0;2</span>
  9722. <br class="fancyvrb" /><a
  9723. id="x1-110006r3"></a><span
  9724. class="cmr-6">3</span><span
  9725. class="cmtt-8">&#x00A0;</span><span
  9726. class="cmtt-8">&#x00A0;</span><span
  9727. class="cmtt-8">&#x00A0;</span><span
  9728. class="cmtt-8">&#x00A0;</span><span
  9729. class="cmtt-8">&#x00A0;</span><span
  9730. class="cmtt-8">&#x00A0;</span><span
  9731. class="cmtt-8">&#x00A0;</span><span
  9732. class="cmtt-8">&#x00A0;</span><span
  9733. class="cmtt-8">&#x00A0;3)</span><span
  9734. class="cmtt-8">&#x00A0;[actual_size]</span><span
  9735. class="cmtt-8">&#x00A0;=</span><span
  9736. class="cmtt-8">&#x00A0;[actual_size]</span><span
  9737. class="cmtt-8">&#x00A0;*</span><span
  9738. class="cmtt-8">&#x00A0;[ch];</span>
  9739. <br class="fancyvrb" /><a
  9740. id="x1-110008r4"></a><span
  9741. class="cmr-6">4</span><span
  9742. class="cmtt-8">&#x00A0;</span><span
  9743. class="cmtt-8">&#x00A0;</span><span
  9744. class="cmtt-8">&#x00A0;</span><span
  9745. class="cmtt-8">&#x00A0;4)</span><span
  9746. class="cmtt-8">&#x00A0;[limit_residue_begin]</span><span
  9747. class="cmtt-8">&#x00A0;=</span><span
  9748. class="cmtt-8">&#x00A0;maximum</span><span
  9749. class="cmtt-8">&#x00A0;of</span><span
  9750. class="cmtt-8">&#x00A0;([residue_begin],[actual_size]);</span>
  9751. <br class="fancyvrb" /><a
  9752. id="x1-110010r5"></a><span
  9753. class="cmr-6">5</span><span
  9754. class="cmtt-8">&#x00A0;</span><span
  9755. class="cmtt-8">&#x00A0;</span><span
  9756. class="cmtt-8">&#x00A0;</span><span
  9757. class="cmtt-8">&#x00A0;5)</span><span
  9758. class="cmtt-8">&#x00A0;[limit_residue_end]</span><span
  9759. class="cmtt-8">&#x00A0;=</span><span
  9760. class="cmtt-8">&#x00A0;maximum</span><span
  9761. class="cmtt-8">&#x00A0;of</span><span
  9762. class="cmtt-8">&#x00A0;([residue_end],[actual_size]);</span>
  9763. </div>
  9764. <!--l. 274--><p class="noindent" >The following convenience values are conceptually useful to clarifying the decode process:
  9765. <!--l. 277--><p class="noindent" >
  9766. <div class="fancyvrb" id="fancyvrb39">
  9767. <a
  9768. id="x1-110012r1"></a><span
  9769. class="cmr-6">1</span><span
  9770. class="cmtt-8">&#x00A0;</span><span
  9771. class="cmtt-8">&#x00A0;</span><span
  9772. class="cmtt-8">&#x00A0;</span><span
  9773. class="cmtt-8">&#x00A0;1)</span><span
  9774. class="cmtt-8">&#x00A0;[classwords_per_codeword]</span><span
  9775. class="cmtt-8">&#x00A0;=</span><span
  9776. class="cmtt-8">&#x00A0;[codebook_dimensions]</span><span
  9777. class="cmtt-8">&#x00A0;value</span><span
  9778. class="cmtt-8">&#x00A0;of</span><span
  9779. class="cmtt-8">&#x00A0;codebook</span><span
  9780. class="cmtt-8">&#x00A0;[residue_classbook]</span>
  9781. <br class="fancyvrb" /><a
  9782. id="x1-110014r2"></a><span
  9783. class="cmr-6">2</span><span
  9784. class="cmtt-8">&#x00A0;</span><span
  9785. class="cmtt-8">&#x00A0;</span><span
  9786. class="cmtt-8">&#x00A0;</span><span
  9787. class="cmtt-8">&#x00A0;2)</span><span
  9788. class="cmtt-8">&#x00A0;[n_to_read]</span><span
  9789. class="cmtt-8">&#x00A0;=</span><span
  9790. class="cmtt-8">&#x00A0;[limit_residue_end]</span><span
  9791. class="cmtt-8">&#x00A0;-</span><span
  9792. class="cmtt-8">&#x00A0;[limit_residue_begin]</span>
  9793. <br class="fancyvrb" /><a
  9794. id="x1-110016r3"></a><span
  9795. class="cmr-6">3</span><span
  9796. class="cmtt-8">&#x00A0;</span><span
  9797. class="cmtt-8">&#x00A0;</span><span
  9798. class="cmtt-8">&#x00A0;</span><span
  9799. class="cmtt-8">&#x00A0;3)</span><span
  9800. class="cmtt-8">&#x00A0;[partitions_to_read]</span><span
  9801. class="cmtt-8">&#x00A0;=</span><span
  9802. class="cmtt-8">&#x00A0;[n_to_read]</span><span
  9803. class="cmtt-8">&#x00A0;/</span><span
  9804. class="cmtt-8">&#x00A0;[residue_partition_size]</span>
  9805. </div>
  9806. <!--l. 283--><p class="noindent" >Packet decode proceeds as follows, matching the description offered earlier in the document.
  9807. <div class="fancyvrb" id="fancyvrb40">
  9808. <a
  9809. id="x1-110018r1"></a><span
  9810. class="cmr-6">1</span><span
  9811. class="cmtt-8">&#x00A0;</span><span
  9812. class="cmtt-8">&#x00A0;</span><span
  9813. class="cmtt-8">&#x00A0;</span><span
  9814. class="cmtt-8">&#x00A0;1)</span><span
  9815. class="cmtt-8">&#x00A0;allocate</span><span
  9816. class="cmtt-8">&#x00A0;and</span><span
  9817. class="cmtt-8">&#x00A0;zero</span><span
  9818. class="cmtt-8">&#x00A0;all</span><span
  9819. class="cmtt-8">&#x00A0;vectors</span><span
  9820. class="cmtt-8">&#x00A0;that</span><span
  9821. class="cmtt-8">&#x00A0;will</span><span
  9822. class="cmtt-8">&#x00A0;be</span><span
  9823. class="cmtt-8">&#x00A0;returned.</span>
  9824. <br class="fancyvrb" /><a
  9825. id="x1-110020r2"></a><span
  9826. class="cmr-6">2</span><span
  9827. class="cmtt-8">&#x00A0;</span><span
  9828. class="cmtt-8">&#x00A0;</span><span
  9829. class="cmtt-8">&#x00A0;</span><span
  9830. class="cmtt-8">&#x00A0;2)</span><span
  9831. class="cmtt-8">&#x00A0;if</span><span
  9832. class="cmtt-8">&#x00A0;([n_to_read]</span><span
  9833. class="cmtt-8">&#x00A0;is</span><span
  9834. class="cmtt-8">&#x00A0;zero),</span><span
  9835. class="cmtt-8">&#x00A0;stop;</span><span
  9836. class="cmtt-8">&#x00A0;there</span><span
  9837. class="cmtt-8">&#x00A0;is</span><span
  9838. class="cmtt-8">&#x00A0;no</span><span
  9839. class="cmtt-8">&#x00A0;residue</span><span
  9840. class="cmtt-8">&#x00A0;to</span><span
  9841. class="cmtt-8">&#x00A0;decode.</span>
  9842. <br class="fancyvrb" /><a
  9843. id="x1-110022r3"></a><span
  9844. class="cmr-6">3</span><span
  9845. class="cmtt-8">&#x00A0;</span><span
  9846. class="cmtt-8">&#x00A0;</span><span
  9847. class="cmtt-8">&#x00A0;</span><span
  9848. class="cmtt-8">&#x00A0;3)</span><span
  9849. class="cmtt-8">&#x00A0;iterate</span><span
  9850. class="cmtt-8">&#x00A0;[pass]</span><span
  9851. class="cmtt-8">&#x00A0;over</span><span
  9852. class="cmtt-8">&#x00A0;the</span><span
  9853. class="cmtt-8">&#x00A0;range</span><span
  9854. class="cmtt-8">&#x00A0;0</span><span
  9855. class="cmtt-8">&#x00A0;...</span><span
  9856. class="cmtt-8">&#x00A0;7</span><span
  9857. class="cmtt-8">&#x00A0;{</span>
  9858. <br class="fancyvrb" /><a
  9859. id="x1-110024r4"></a><span
  9860. class="cmr-6">4</span><span
  9861. class="cmtt-8">&#x00A0;</span><span
  9862. class="cmtt-8">&#x00A0;</span>
  9863. <br class="fancyvrb" /><a
  9864. id="x1-110026r5"></a><span
  9865. class="cmr-6">5</span><span
  9866. class="cmtt-8">&#x00A0;</span><span
  9867. class="cmtt-8">&#x00A0;</span><span
  9868. class="cmtt-8">&#x00A0;</span><span
  9869. class="cmtt-8">&#x00A0;</span><span
  9870. class="cmtt-8">&#x00A0;</span><span
  9871. class="cmtt-8">&#x00A0;</span><span
  9872. class="cmtt-8">&#x00A0;</span><span
  9873. class="cmtt-8">&#x00A0;</span><span
  9874. class="cmtt-8">&#x00A0;4)</span><span
  9875. class="cmtt-8">&#x00A0;[partition_count]</span><span
  9876. class="cmtt-8">&#x00A0;=</span><span
  9877. class="cmtt-8">&#x00A0;0</span>
  9878. <br class="fancyvrb" /><a
  9879. id="x1-110028r6"></a><span
  9880. class="cmr-6">6</span><span
  9881. class="cmtt-8">&#x00A0;</span><span
  9882. class="cmtt-8">&#x00A0;</span>
  9883. <br class="fancyvrb" /><a
  9884. id="x1-110030r7"></a><span
  9885. class="cmr-6">7</span><span
  9886. class="cmtt-8">&#x00A0;</span><span
  9887. class="cmtt-8">&#x00A0;</span><span
  9888. class="cmtt-8">&#x00A0;</span><span
  9889. class="cmtt-8">&#x00A0;</span><span
  9890. class="cmtt-8">&#x00A0;</span><span
  9891. class="cmtt-8">&#x00A0;</span><span
  9892. class="cmtt-8">&#x00A0;</span><span
  9893. class="cmtt-8">&#x00A0;</span><span
  9894. class="cmtt-8">&#x00A0;5)</span><span
  9895. class="cmtt-8">&#x00A0;while</span><span
  9896. class="cmtt-8">&#x00A0;[partition_count]</span><span
  9897. class="cmtt-8">&#x00A0;is</span><span
  9898. class="cmtt-8">&#x00A0;less</span><span
  9899. class="cmtt-8">&#x00A0;than</span><span
  9900. class="cmtt-8">&#x00A0;[partitions_to_read]</span>
  9901. <br class="fancyvrb" /><a
  9902. id="x1-110032r8"></a><span
  9903. class="cmr-6">8</span><span
  9904. class="cmtt-8">&#x00A0;</span><span
  9905. class="cmtt-8">&#x00A0;</span>
  9906. <br class="fancyvrb" /><a
  9907. id="x1-110034r9"></a><span
  9908. class="cmr-6">9</span><span
  9909. class="cmtt-8">&#x00A0;</span><span
  9910. class="cmtt-8">&#x00A0;</span><span
  9911. class="cmtt-8">&#x00A0;</span><span
  9912. class="cmtt-8">&#x00A0;</span><span
  9913. class="cmtt-8">&#x00A0;</span><span
  9914. class="cmtt-8">&#x00A0;</span><span
  9915. class="cmtt-8">&#x00A0;</span><span
  9916. class="cmtt-8">&#x00A0;</span><span
  9917. class="cmtt-8">&#x00A0;</span><span
  9918. class="cmtt-8">&#x00A0;</span><span
  9919. class="cmtt-8">&#x00A0;</span><span
  9920. class="cmtt-8">&#x00A0;</span><span
  9921. class="cmtt-8">&#x00A0;</span><span
  9922. class="cmtt-8">&#x00A0;6)</span><span
  9923. class="cmtt-8">&#x00A0;if</span><span
  9924. class="cmtt-8">&#x00A0;([pass]</span><span
  9925. class="cmtt-8">&#x00A0;is</span><span
  9926. class="cmtt-8">&#x00A0;zero)</span><span
  9927. class="cmtt-8">&#x00A0;{</span>
  9928. <br class="fancyvrb" /><a
  9929. id="x1-110036r10"></a><span
  9930. class="cmr-6">10</span><span
  9931. class="cmtt-8">&#x00A0;</span><span
  9932. class="cmtt-8">&#x00A0;</span>
  9933. <br class="fancyvrb" /><a
  9934. id="x1-110038r11"></a><span
  9935. class="cmr-6">11</span><span
  9936. class="cmtt-8">&#x00A0;</span><span
  9937. class="cmtt-8">&#x00A0;</span><span
  9938. class="cmtt-8">&#x00A0;</span><span
  9939. class="cmtt-8">&#x00A0;</span><span
  9940. class="cmtt-8">&#x00A0;</span><span
  9941. class="cmtt-8">&#x00A0;</span><span
  9942. class="cmtt-8">&#x00A0;</span><span
  9943. class="cmtt-8">&#x00A0;</span><span
  9944. class="cmtt-8">&#x00A0;</span><span
  9945. class="cmtt-8">&#x00A0;</span><span
  9946. class="cmtt-8">&#x00A0;</span><span
  9947. class="cmtt-8">&#x00A0;</span><span
  9948. class="cmtt-8">&#x00A0;</span><span
  9949. class="cmtt-8">&#x00A0;</span><span
  9950. class="cmtt-8">&#x00A0;</span><span
  9951. class="cmtt-8">&#x00A0;</span><span
  9952. class="cmtt-8">&#x00A0;</span><span
  9953. class="cmtt-8">&#x00A0;</span><span
  9954. class="cmtt-8">&#x00A0;7)</span><span
  9955. class="cmtt-8">&#x00A0;iterate</span><span
  9956. class="cmtt-8">&#x00A0;[j]</span><span
  9957. class="cmtt-8">&#x00A0;over</span><span
  9958. class="cmtt-8">&#x00A0;the</span><span
  9959. class="cmtt-8">&#x00A0;range</span><span
  9960. class="cmtt-8">&#x00A0;0</span><span
  9961. class="cmtt-8">&#x00A0;..</span><span
  9962. class="cmtt-8">&#x00A0;[ch]-1</span><span
  9963. class="cmtt-8">&#x00A0;{</span>
  9964. <br class="fancyvrb" /><a
  9965. id="x1-110040r12"></a><span
  9966. class="cmr-6">12</span><span
  9967. class="cmtt-8">&#x00A0;</span><span
  9968. class="cmtt-8">&#x00A0;</span>
  9969. <br class="fancyvrb" /><a
  9970. id="x1-110042r13"></a><span
  9971. class="cmr-6">13</span><span
  9972. class="cmtt-8">&#x00A0;</span><span
  9973. class="cmtt-8">&#x00A0;</span><span
  9974. class="cmtt-8">&#x00A0;</span><span
  9975. class="cmtt-8">&#x00A0;</span><span
  9976. class="cmtt-8">&#x00A0;</span><span
  9977. class="cmtt-8">&#x00A0;</span><span
  9978. class="cmtt-8">&#x00A0;</span><span
  9979. class="cmtt-8">&#x00A0;</span><span
  9980. class="cmtt-8">&#x00A0;</span><span
  9981. class="cmtt-8">&#x00A0;</span><span
  9982. class="cmtt-8">&#x00A0;</span><span
  9983. class="cmtt-8">&#x00A0;</span><span
  9984. class="cmtt-8">&#x00A0;</span><span
  9985. class="cmtt-8">&#x00A0;</span><span
  9986. class="cmtt-8">&#x00A0;</span><span
  9987. class="cmtt-8">&#x00A0;</span><span
  9988. class="cmtt-8">&#x00A0;</span><span
  9989. class="cmtt-8">&#x00A0;</span><span
  9990. class="cmtt-8">&#x00A0;</span><span
  9991. class="cmtt-8">&#x00A0;</span><span
  9992. class="cmtt-8">&#x00A0;</span><span
  9993. class="cmtt-8">&#x00A0;</span><span
  9994. class="cmtt-8">&#x00A0;</span><span
  9995. class="cmtt-8">&#x00A0;8)</span><span
  9996. class="cmtt-8">&#x00A0;if</span><span
  9997. class="cmtt-8">&#x00A0;vector</span><span
  9998. class="cmtt-8">&#x00A0;[j]</span><span
  9999. class="cmtt-8">&#x00A0;is</span><span
  10000. class="cmtt-8">&#x00A0;not</span><span
  10001. class="cmtt-8">&#x00A0;marked</span><span
  10002. class="cmtt-8">&#x00A0;&#8217;do</span><span
  10003. class="cmtt-8">&#x00A0;not</span><span
  10004. class="cmtt-8">&#x00A0;decode&#8217;</span><span
  10005. class="cmtt-8">&#x00A0;{</span>
  10006. <br class="fancyvrb" /><a
  10007. id="x1-110044r14"></a><span
  10008. class="cmr-6">14</span><span
  10009. class="cmtt-8">&#x00A0;</span><span
  10010. class="cmtt-8">&#x00A0;</span>
  10011. <br class="fancyvrb" /><a
  10012. id="x1-110046r15"></a><span
  10013. class="cmr-6">15</span><span
  10014. class="cmtt-8">&#x00A0;</span><span
  10015. class="cmtt-8">&#x00A0;</span><span
  10016. class="cmtt-8">&#x00A0;</span><span
  10017. class="cmtt-8">&#x00A0;</span><span
  10018. class="cmtt-8">&#x00A0;</span><span
  10019. class="cmtt-8">&#x00A0;</span><span
  10020. class="cmtt-8">&#x00A0;</span><span
  10021. class="cmtt-8">&#x00A0;</span><span
  10022. class="cmtt-8">&#x00A0;</span><span
  10023. class="cmtt-8">&#x00A0;</span><span
  10024. class="cmtt-8">&#x00A0;</span><span
  10025. class="cmtt-8">&#x00A0;</span><span
  10026. class="cmtt-8">&#x00A0;</span><span
  10027. class="cmtt-8">&#x00A0;</span><span
  10028. class="cmtt-8">&#x00A0;</span><span
  10029. class="cmtt-8">&#x00A0;</span><span
  10030. class="cmtt-8">&#x00A0;</span><span
  10031. class="cmtt-8">&#x00A0;</span><span
  10032. class="cmtt-8">&#x00A0;</span><span
  10033. class="cmtt-8">&#x00A0;</span><span
  10034. class="cmtt-8">&#x00A0;</span><span
  10035. class="cmtt-8">&#x00A0;</span><span
  10036. class="cmtt-8">&#x00A0;</span><span
  10037. class="cmtt-8">&#x00A0;</span><span
  10038. class="cmtt-8">&#x00A0;</span><span
  10039. class="cmtt-8">&#x00A0;</span><span
  10040. class="cmtt-8">&#x00A0;</span><span
  10041. class="cmtt-8">&#x00A0;</span><span
  10042. class="cmtt-8">&#x00A0;9)</span><span
  10043. class="cmtt-8">&#x00A0;[temp]</span><span
  10044. class="cmtt-8">&#x00A0;=</span><span
  10045. class="cmtt-8">&#x00A0;read</span><span
  10046. class="cmtt-8">&#x00A0;from</span><span
  10047. class="cmtt-8">&#x00A0;packet</span><span
  10048. class="cmtt-8">&#x00A0;using</span><span
  10049. class="cmtt-8">&#x00A0;codebook</span><span
  10050. class="cmtt-8">&#x00A0;[residue_classbook]</span><span
  10051. class="cmtt-8">&#x00A0;in</span><span
  10052. class="cmtt-8">&#x00A0;scalar</span><span
  10053. class="cmtt-8">&#x00A0;context</span>
  10054. <br class="fancyvrb" /><a
  10055. id="x1-110048r16"></a><span
  10056. class="cmr-6">16</span><span
  10057. class="cmtt-8">&#x00A0;</span><span
  10058. class="cmtt-8">&#x00A0;</span><span
  10059. class="cmtt-8">&#x00A0;</span><span
  10060. class="cmtt-8">&#x00A0;</span><span
  10061. class="cmtt-8">&#x00A0;</span><span
  10062. class="cmtt-8">&#x00A0;</span><span
  10063. class="cmtt-8">&#x00A0;</span><span
  10064. class="cmtt-8">&#x00A0;</span><span
  10065. class="cmtt-8">&#x00A0;</span><span
  10066. class="cmtt-8">&#x00A0;</span><span
  10067. class="cmtt-8">&#x00A0;</span><span
  10068. class="cmtt-8">&#x00A0;</span><span
  10069. class="cmtt-8">&#x00A0;</span><span
  10070. class="cmtt-8">&#x00A0;</span><span
  10071. class="cmtt-8">&#x00A0;</span><span
  10072. class="cmtt-8">&#x00A0;</span><span
  10073. class="cmtt-8">&#x00A0;</span><span
  10074. class="cmtt-8">&#x00A0;</span><span
  10075. class="cmtt-8">&#x00A0;</span><span
  10076. class="cmtt-8">&#x00A0;</span><span
  10077. class="cmtt-8">&#x00A0;</span><span
  10078. class="cmtt-8">&#x00A0;</span><span
  10079. class="cmtt-8">&#x00A0;</span><span
  10080. class="cmtt-8">&#x00A0;</span><span
  10081. class="cmtt-8">&#x00A0;</span><span
  10082. class="cmtt-8">&#x00A0;</span><span
  10083. class="cmtt-8">&#x00A0;</span><span
  10084. class="cmtt-8">&#x00A0;10)</span><span
  10085. class="cmtt-8">&#x00A0;iterate</span><span
  10086. class="cmtt-8">&#x00A0;[i]</span><span
  10087. class="cmtt-8">&#x00A0;descending</span><span
  10088. class="cmtt-8">&#x00A0;over</span><span
  10089. class="cmtt-8">&#x00A0;the</span><span
  10090. class="cmtt-8">&#x00A0;range</span><span
  10091. class="cmtt-8">&#x00A0;[classwords_per_codeword]-1</span><span
  10092. class="cmtt-8">&#x00A0;...</span><span
  10093. class="cmtt-8">&#x00A0;0</span><span
  10094. class="cmtt-8">&#x00A0;{</span>
  10095. <br class="fancyvrb" /><a
  10096. id="x1-110050r17"></a><span
  10097. class="cmr-6">17</span><span
  10098. class="cmtt-8">&#x00A0;</span><span
  10099. class="cmtt-8">&#x00A0;</span>
  10100. <br class="fancyvrb" /><a
  10101. id="x1-110052r18"></a><span
  10102. class="cmr-6">18</span><span
  10103. class="cmtt-8">&#x00A0;</span><span
  10104. class="cmtt-8">&#x00A0;</span><span
  10105. class="cmtt-8">&#x00A0;</span><span
  10106. class="cmtt-8">&#x00A0;</span><span
  10107. class="cmtt-8">&#x00A0;</span><span
  10108. class="cmtt-8">&#x00A0;</span><span
  10109. class="cmtt-8">&#x00A0;</span><span
  10110. class="cmtt-8">&#x00A0;</span><span
  10111. class="cmtt-8">&#x00A0;</span><span
  10112. class="cmtt-8">&#x00A0;</span><span
  10113. class="cmtt-8">&#x00A0;</span><span
  10114. class="cmtt-8">&#x00A0;</span><span
  10115. class="cmtt-8">&#x00A0;</span><span
  10116. class="cmtt-8">&#x00A0;</span><span
  10117. class="cmtt-8">&#x00A0;</span><span
  10118. class="cmtt-8">&#x00A0;</span><span
  10119. class="cmtt-8">&#x00A0;</span><span
  10120. class="cmtt-8">&#x00A0;</span><span
  10121. class="cmtt-8">&#x00A0;</span><span
  10122. class="cmtt-8">&#x00A0;</span><span
  10123. class="cmtt-8">&#x00A0;</span><span
  10124. class="cmtt-8">&#x00A0;</span><span
  10125. class="cmtt-8">&#x00A0;</span><span
  10126. class="cmtt-8">&#x00A0;</span><span
  10127. class="cmtt-8">&#x00A0;</span><span
  10128. class="cmtt-8">&#x00A0;</span><span
  10129. class="cmtt-8">&#x00A0;</span><span
  10130. class="cmtt-8">&#x00A0;</span><span
  10131. class="cmtt-8">&#x00A0;</span><span
  10132. class="cmtt-8">&#x00A0;</span><span
  10133. class="cmtt-8">&#x00A0;</span><span
  10134. class="cmtt-8">&#x00A0;</span><span
  10135. class="cmtt-8">&#x00A0;11)</span><span
  10136. class="cmtt-8">&#x00A0;array</span><span
  10137. class="cmtt-8">&#x00A0;[classifications]</span><span
  10138. class="cmtt-8">&#x00A0;element</span><span
  10139. class="cmtt-8">&#x00A0;[j],([i]+[partition_count])</span><span
  10140. class="cmtt-8">&#x00A0;=</span>
  10141. <br class="fancyvrb" /><a
  10142. id="x1-110054r19"></a><span
  10143. class="cmr-6">19</span><span
  10144. class="cmtt-8">&#x00A0;</span><span
  10145. class="cmtt-8">&#x00A0;</span><span
  10146. class="cmtt-8">&#x00A0;</span><span
  10147. class="cmtt-8">&#x00A0;</span><span
  10148. class="cmtt-8">&#x00A0;</span><span
  10149. class="cmtt-8">&#x00A0;</span><span
  10150. class="cmtt-8">&#x00A0;</span><span
  10151. class="cmtt-8">&#x00A0;</span><span
  10152. class="cmtt-8">&#x00A0;</span><span
  10153. class="cmtt-8">&#x00A0;</span><span
  10154. class="cmtt-8">&#x00A0;</span><span
  10155. class="cmtt-8">&#x00A0;</span><span
  10156. class="cmtt-8">&#x00A0;</span><span
  10157. class="cmtt-8">&#x00A0;</span><span
  10158. class="cmtt-8">&#x00A0;</span><span
  10159. class="cmtt-8">&#x00A0;</span><span
  10160. class="cmtt-8">&#x00A0;</span><span
  10161. class="cmtt-8">&#x00A0;</span><span
  10162. class="cmtt-8">&#x00A0;</span><span
  10163. class="cmtt-8">&#x00A0;</span><span
  10164. class="cmtt-8">&#x00A0;</span><span
  10165. class="cmtt-8">&#x00A0;</span><span
  10166. class="cmtt-8">&#x00A0;</span><span
  10167. class="cmtt-8">&#x00A0;</span><span
  10168. class="cmtt-8">&#x00A0;</span><span
  10169. class="cmtt-8">&#x00A0;</span><span
  10170. class="cmtt-8">&#x00A0;</span><span
  10171. class="cmtt-8">&#x00A0;</span><span
  10172. class="cmtt-8">&#x00A0;</span><span
  10173. class="cmtt-8">&#x00A0;</span><span
  10174. class="cmtt-8">&#x00A0;</span><span
  10175. class="cmtt-8">&#x00A0;</span><span
  10176. class="cmtt-8">&#x00A0;</span><span
  10177. class="cmtt-8">&#x00A0;</span><span
  10178. class="cmtt-8">&#x00A0;</span><span
  10179. class="cmtt-8">&#x00A0;</span><span
  10180. class="cmtt-8">&#x00A0;[temp]</span><span
  10181. class="cmtt-8">&#x00A0;integer</span><span
  10182. class="cmtt-8">&#x00A0;modulo</span><span
  10183. class="cmtt-8">&#x00A0;[residue_classifications]</span>
  10184. <br class="fancyvrb" /><a
  10185. id="x1-110056r20"></a><span
  10186. class="cmr-6">20</span><span
  10187. class="cmtt-8">&#x00A0;</span><span
  10188. class="cmtt-8">&#x00A0;</span><span
  10189. class="cmtt-8">&#x00A0;</span><span
  10190. class="cmtt-8">&#x00A0;</span><span
  10191. class="cmtt-8">&#x00A0;</span><span
  10192. class="cmtt-8">&#x00A0;</span><span
  10193. class="cmtt-8">&#x00A0;</span><span
  10194. class="cmtt-8">&#x00A0;</span><span
  10195. class="cmtt-8">&#x00A0;</span><span
  10196. class="cmtt-8">&#x00A0;</span><span
  10197. class="cmtt-8">&#x00A0;</span><span
  10198. class="cmtt-8">&#x00A0;</span><span
  10199. class="cmtt-8">&#x00A0;</span><span
  10200. class="cmtt-8">&#x00A0;</span><span
  10201. class="cmtt-8">&#x00A0;</span><span
  10202. class="cmtt-8">&#x00A0;</span><span
  10203. class="cmtt-8">&#x00A0;</span><span
  10204. class="cmtt-8">&#x00A0;</span><span
  10205. class="cmtt-8">&#x00A0;</span><span
  10206. class="cmtt-8">&#x00A0;</span><span
  10207. class="cmtt-8">&#x00A0;</span><span
  10208. class="cmtt-8">&#x00A0;</span><span
  10209. class="cmtt-8">&#x00A0;</span><span
  10210. class="cmtt-8">&#x00A0;</span><span
  10211. class="cmtt-8">&#x00A0;</span><span
  10212. class="cmtt-8">&#x00A0;</span><span
  10213. class="cmtt-8">&#x00A0;</span><span
  10214. class="cmtt-8">&#x00A0;</span><span
  10215. class="cmtt-8">&#x00A0;</span><span
  10216. class="cmtt-8">&#x00A0;</span><span
  10217. class="cmtt-8">&#x00A0;</span><span
  10218. class="cmtt-8">&#x00A0;</span><span
  10219. class="cmtt-8">&#x00A0;12)</span><span
  10220. class="cmtt-8">&#x00A0;[temp]</span><span
  10221. class="cmtt-8">&#x00A0;=</span><span
  10222. class="cmtt-8">&#x00A0;[temp]</span><span
  10223. class="cmtt-8">&#x00A0;/</span><span
  10224. class="cmtt-8">&#x00A0;[residue_classifications]</span><span
  10225. class="cmtt-8">&#x00A0;using</span><span
  10226. class="cmtt-8">&#x00A0;integer</span><span
  10227. class="cmtt-8">&#x00A0;division</span>
  10228. <br class="fancyvrb" /><a
  10229. id="x1-110058r21"></a><span
  10230. class="cmr-6">21</span><span
  10231. class="cmtt-8">&#x00A0;</span><span
  10232. class="cmtt-8">&#x00A0;</span>
  10233. <br class="fancyvrb" /><a
  10234. id="x1-110060r22"></a><span
  10235. class="cmr-6">22</span><span
  10236. class="cmtt-8">&#x00A0;</span><span
  10237. class="cmtt-8">&#x00A0;</span><span
  10238. class="cmtt-8">&#x00A0;</span><span
  10239. class="cmtt-8">&#x00A0;</span><span
  10240. class="cmtt-8">&#x00A0;</span><span
  10241. class="cmtt-8">&#x00A0;</span><span
  10242. class="cmtt-8">&#x00A0;</span><span
  10243. class="cmtt-8">&#x00A0;</span><span
  10244. class="cmtt-8">&#x00A0;</span><span
  10245. class="cmtt-8">&#x00A0;</span><span
  10246. class="cmtt-8">&#x00A0;</span><span
  10247. class="cmtt-8">&#x00A0;</span><span
  10248. class="cmtt-8">&#x00A0;</span><span
  10249. class="cmtt-8">&#x00A0;</span><span
  10250. class="cmtt-8">&#x00A0;</span><span
  10251. class="cmtt-8">&#x00A0;</span><span
  10252. class="cmtt-8">&#x00A0;</span><span
  10253. class="cmtt-8">&#x00A0;</span><span
  10254. class="cmtt-8">&#x00A0;</span><span
  10255. class="cmtt-8">&#x00A0;</span><span
  10256. class="cmtt-8">&#x00A0;</span><span
  10257. class="cmtt-8">&#x00A0;</span><span
  10258. class="cmtt-8">&#x00A0;</span><span
  10259. class="cmtt-8">&#x00A0;</span><span
  10260. class="cmtt-8">&#x00A0;</span><span
  10261. class="cmtt-8">&#x00A0;</span><span
  10262. class="cmtt-8">&#x00A0;</span><span
  10263. class="cmtt-8">&#x00A0;</span><span
  10264. class="cmtt-8">&#x00A0;</span><span
  10265. class="cmtt-8">&#x00A0;</span><span
  10266. class="cmtt-8">&#x00A0;</span><span
  10267. class="cmtt-8">&#x00A0;}</span>
  10268. <br class="fancyvrb" /><a
  10269. id="x1-110062r23"></a><span
  10270. class="cmr-6">23</span><span
  10271. class="cmtt-8">&#x00A0;</span><span
  10272. class="cmtt-8">&#x00A0;</span>
  10273. <br class="fancyvrb" /><a
  10274. id="x1-110064r24"></a><span
  10275. class="cmr-6">24</span><span
  10276. class="cmtt-8">&#x00A0;</span><span
  10277. class="cmtt-8">&#x00A0;</span><span
  10278. class="cmtt-8">&#x00A0;</span><span
  10279. class="cmtt-8">&#x00A0;</span><span
  10280. class="cmtt-8">&#x00A0;</span><span
  10281. class="cmtt-8">&#x00A0;</span><span
  10282. class="cmtt-8">&#x00A0;</span><span
  10283. class="cmtt-8">&#x00A0;</span><span
  10284. class="cmtt-8">&#x00A0;</span><span
  10285. class="cmtt-8">&#x00A0;</span><span
  10286. class="cmtt-8">&#x00A0;</span><span
  10287. class="cmtt-8">&#x00A0;</span><span
  10288. class="cmtt-8">&#x00A0;</span><span
  10289. class="cmtt-8">&#x00A0;</span><span
  10290. class="cmtt-8">&#x00A0;</span><span
  10291. class="cmtt-8">&#x00A0;</span><span
  10292. class="cmtt-8">&#x00A0;</span><span
  10293. class="cmtt-8">&#x00A0;</span><span
  10294. class="cmtt-8">&#x00A0;</span><span
  10295. class="cmtt-8">&#x00A0;</span><span
  10296. class="cmtt-8">&#x00A0;</span><span
  10297. class="cmtt-8">&#x00A0;</span><span
  10298. class="cmtt-8">&#x00A0;</span><span
  10299. class="cmtt-8">&#x00A0;</span><span
  10300. class="cmtt-8">&#x00A0;</span><span
  10301. class="cmtt-8">&#x00A0;</span><span
  10302. class="cmtt-8">&#x00A0;}</span>
  10303. <br class="fancyvrb" /><a
  10304. id="x1-110066r25"></a><span
  10305. class="cmr-6">25</span><span
  10306. class="cmtt-8">&#x00A0;</span><span
  10307. class="cmtt-8">&#x00A0;</span>
  10308. <br class="fancyvrb" /><a
  10309. id="x1-110068r26"></a><span
  10310. class="cmr-6">26</span><span
  10311. class="cmtt-8">&#x00A0;</span><span
  10312. class="cmtt-8">&#x00A0;</span><span
  10313. class="cmtt-8">&#x00A0;</span><span
  10314. class="cmtt-8">&#x00A0;</span><span
  10315. class="cmtt-8">&#x00A0;</span><span
  10316. class="cmtt-8">&#x00A0;</span><span
  10317. class="cmtt-8">&#x00A0;</span><span
  10318. class="cmtt-8">&#x00A0;</span><span
  10319. class="cmtt-8">&#x00A0;</span><span
  10320. class="cmtt-8">&#x00A0;</span><span
  10321. class="cmtt-8">&#x00A0;</span><span
  10322. class="cmtt-8">&#x00A0;</span><span
  10323. class="cmtt-8">&#x00A0;</span><span
  10324. class="cmtt-8">&#x00A0;</span><span
  10325. class="cmtt-8">&#x00A0;</span><span
  10326. class="cmtt-8">&#x00A0;</span><span
  10327. class="cmtt-8">&#x00A0;</span><span
  10328. class="cmtt-8">&#x00A0;</span><span
  10329. class="cmtt-8">&#x00A0;</span><span
  10330. class="cmtt-8">&#x00A0;</span><span
  10331. class="cmtt-8">&#x00A0;</span><span
  10332. class="cmtt-8">&#x00A0;}</span>
  10333. <br class="fancyvrb" /><a
  10334. id="x1-110070r27"></a><span
  10335. class="cmr-6">27</span><span
  10336. class="cmtt-8">&#x00A0;</span><span
  10337. class="cmtt-8">&#x00A0;</span>
  10338. <br class="fancyvrb" /><a
  10339. id="x1-110072r28"></a><span
  10340. class="cmr-6">28</span><span
  10341. class="cmtt-8">&#x00A0;</span><span
  10342. class="cmtt-8">&#x00A0;</span><span
  10343. class="cmtt-8">&#x00A0;</span><span
  10344. class="cmtt-8">&#x00A0;</span><span
  10345. class="cmtt-8">&#x00A0;</span><span
  10346. class="cmtt-8">&#x00A0;</span><span
  10347. class="cmtt-8">&#x00A0;</span><span
  10348. class="cmtt-8">&#x00A0;</span><span
  10349. class="cmtt-8">&#x00A0;</span><span
  10350. class="cmtt-8">&#x00A0;</span><span
  10351. class="cmtt-8">&#x00A0;</span><span
  10352. class="cmtt-8">&#x00A0;</span><span
  10353. class="cmtt-8">&#x00A0;</span><span
  10354. class="cmtt-8">&#x00A0;</span><span
  10355. class="cmtt-8">&#x00A0;</span><span
  10356. class="cmtt-8">&#x00A0;</span><span
  10357. class="cmtt-8">&#x00A0;}</span>
  10358. <br class="fancyvrb" /><a
  10359. id="x1-110074r29"></a><span
  10360. class="cmr-6">29</span><span
  10361. class="cmtt-8">&#x00A0;</span><span
  10362. class="cmtt-8">&#x00A0;</span>
  10363. <br class="fancyvrb" /><a
  10364. id="x1-110076r30"></a><span
  10365. class="cmr-6">30</span><span
  10366. class="cmtt-8">&#x00A0;</span><span
  10367. class="cmtt-8">&#x00A0;</span><span
  10368. class="cmtt-8">&#x00A0;</span><span
  10369. class="cmtt-8">&#x00A0;</span><span
  10370. class="cmtt-8">&#x00A0;</span><span
  10371. class="cmtt-8">&#x00A0;</span><span
  10372. class="cmtt-8">&#x00A0;</span><span
  10373. class="cmtt-8">&#x00A0;</span><span
  10374. class="cmtt-8">&#x00A0;</span><span
  10375. class="cmtt-8">&#x00A0;</span><span
  10376. class="cmtt-8">&#x00A0;</span><span
  10377. class="cmtt-8">&#x00A0;</span><span
  10378. class="cmtt-8">&#x00A0;13)</span><span
  10379. class="cmtt-8">&#x00A0;iterate</span><span
  10380. class="cmtt-8">&#x00A0;[i]</span><span
  10381. class="cmtt-8">&#x00A0;over</span><span
  10382. class="cmtt-8">&#x00A0;the</span><span
  10383. class="cmtt-8">&#x00A0;range</span><span
  10384. class="cmtt-8">&#x00A0;0</span><span
  10385. class="cmtt-8">&#x00A0;..</span><span
  10386. class="cmtt-8">&#x00A0;([classwords_per_codeword]</span><span
  10387. class="cmtt-8">&#x00A0;-</span><span
  10388. class="cmtt-8">&#x00A0;1)</span><span
  10389. class="cmtt-8">&#x00A0;while</span><span
  10390. class="cmtt-8">&#x00A0;[partition_count]</span>
  10391. <br class="fancyvrb" /><a
  10392. id="x1-110078r31"></a><span
  10393. class="cmr-6">31</span><span
  10394. class="cmtt-8">&#x00A0;</span><span
  10395. class="cmtt-8">&#x00A0;</span><span
  10396. class="cmtt-8">&#x00A0;</span><span
  10397. class="cmtt-8">&#x00A0;</span><span
  10398. class="cmtt-8">&#x00A0;</span><span
  10399. class="cmtt-8">&#x00A0;</span><span
  10400. class="cmtt-8">&#x00A0;</span><span
  10401. class="cmtt-8">&#x00A0;</span><span
  10402. class="cmtt-8">&#x00A0;</span><span
  10403. class="cmtt-8">&#x00A0;</span><span
  10404. class="cmtt-8">&#x00A0;</span><span
  10405. class="cmtt-8">&#x00A0;</span><span
  10406. class="cmtt-8">&#x00A0;</span><span
  10407. class="cmtt-8">&#x00A0;</span><span
  10408. class="cmtt-8">&#x00A0;</span><span
  10409. class="cmtt-8">&#x00A0;</span><span
  10410. class="cmtt-8">&#x00A0;is</span><span
  10411. class="cmtt-8">&#x00A0;also</span><span
  10412. class="cmtt-8">&#x00A0;less</span><span
  10413. class="cmtt-8">&#x00A0;than</span><span
  10414. class="cmtt-8">&#x00A0;[partitions_to_read]</span><span
  10415. class="cmtt-8">&#x00A0;{</span>
  10416. <br class="fancyvrb" /><a
  10417. id="x1-110080r32"></a><span
  10418. class="cmr-6">32</span><span
  10419. class="cmtt-8">&#x00A0;</span><span
  10420. class="cmtt-8">&#x00A0;</span>
  10421. <br class="fancyvrb" /><a
  10422. id="x1-110082r33"></a><span
  10423. class="cmr-6">33</span><span
  10424. class="cmtt-8">&#x00A0;</span><span
  10425. class="cmtt-8">&#x00A0;</span><span
  10426. class="cmtt-8">&#x00A0;</span><span
  10427. class="cmtt-8">&#x00A0;</span><span
  10428. class="cmtt-8">&#x00A0;</span><span
  10429. class="cmtt-8">&#x00A0;</span><span
  10430. class="cmtt-8">&#x00A0;</span><span
  10431. class="cmtt-8">&#x00A0;</span><span
  10432. class="cmtt-8">&#x00A0;</span><span
  10433. class="cmtt-8">&#x00A0;</span><span
  10434. class="cmtt-8">&#x00A0;</span><span
  10435. class="cmtt-8">&#x00A0;</span><span
  10436. class="cmtt-8">&#x00A0;</span><span
  10437. class="cmtt-8">&#x00A0;</span><span
  10438. class="cmtt-8">&#x00A0;</span><span
  10439. class="cmtt-8">&#x00A0;</span><span
  10440. class="cmtt-8">&#x00A0;</span><span
  10441. class="cmtt-8">&#x00A0;</span><span
  10442. class="cmtt-8">&#x00A0;14)</span><span
  10443. class="cmtt-8">&#x00A0;iterate</span><span
  10444. class="cmtt-8">&#x00A0;[j]</span><span
  10445. class="cmtt-8">&#x00A0;over</span><span
  10446. class="cmtt-8">&#x00A0;the</span><span
  10447. class="cmtt-8">&#x00A0;range</span><span
  10448. class="cmtt-8">&#x00A0;0</span><span
  10449. class="cmtt-8">&#x00A0;..</span><span
  10450. class="cmtt-8">&#x00A0;[ch]-1</span><span
  10451. class="cmtt-8">&#x00A0;{</span>
  10452. <br class="fancyvrb" /><a
  10453. id="x1-110084r34"></a><span
  10454. class="cmr-6">34</span><span
  10455. class="cmtt-8">&#x00A0;</span><span
  10456. class="cmtt-8">&#x00A0;</span>
  10457. <br class="fancyvrb" /><a
  10458. id="x1-110086r35"></a><span
  10459. class="cmr-6">35</span><span
  10460. class="cmtt-8">&#x00A0;</span><span
  10461. class="cmtt-8">&#x00A0;</span><span
  10462. class="cmtt-8">&#x00A0;</span><span
  10463. class="cmtt-8">&#x00A0;</span><span
  10464. class="cmtt-8">&#x00A0;</span><span
  10465. class="cmtt-8">&#x00A0;</span><span
  10466. class="cmtt-8">&#x00A0;</span><span
  10467. class="cmtt-8">&#x00A0;</span><span
  10468. class="cmtt-8">&#x00A0;</span><span
  10469. class="cmtt-8">&#x00A0;</span><span
  10470. class="cmtt-8">&#x00A0;</span><span
  10471. class="cmtt-8">&#x00A0;</span><span
  10472. class="cmtt-8">&#x00A0;</span><span
  10473. class="cmtt-8">&#x00A0;</span><span
  10474. class="cmtt-8">&#x00A0;</span><span
  10475. class="cmtt-8">&#x00A0;</span><span
  10476. class="cmtt-8">&#x00A0;</span><span
  10477. class="cmtt-8">&#x00A0;</span><span
  10478. class="cmtt-8">&#x00A0;</span><span
  10479. class="cmtt-8">&#x00A0;</span><span
  10480. class="cmtt-8">&#x00A0;</span><span
  10481. class="cmtt-8">&#x00A0;</span><span
  10482. class="cmtt-8">&#x00A0;</span><span
  10483. class="cmtt-8">&#x00A0;15)</span><span
  10484. class="cmtt-8">&#x00A0;if</span><span
  10485. class="cmtt-8">&#x00A0;vector</span><span
  10486. class="cmtt-8">&#x00A0;[j]</span><span
  10487. class="cmtt-8">&#x00A0;is</span><span
  10488. class="cmtt-8">&#x00A0;not</span><span
  10489. class="cmtt-8">&#x00A0;marked</span><span
  10490. class="cmtt-8">&#x00A0;&#8217;do</span><span
  10491. class="cmtt-8">&#x00A0;not</span><span
  10492. class="cmtt-8">&#x00A0;decode&#8217;</span><span
  10493. class="cmtt-8">&#x00A0;{</span>
  10494. <br class="fancyvrb" /><a
  10495. id="x1-110088r36"></a><span
  10496. class="cmr-6">36</span><span
  10497. class="cmtt-8">&#x00A0;</span><span
  10498. class="cmtt-8">&#x00A0;</span>
  10499. <br class="fancyvrb" /><a
  10500. id="x1-110090r37"></a><span
  10501. class="cmr-6">37</span><span
  10502. class="cmtt-8">&#x00A0;</span><span
  10503. class="cmtt-8">&#x00A0;</span><span
  10504. class="cmtt-8">&#x00A0;</span><span
  10505. class="cmtt-8">&#x00A0;</span><span
  10506. class="cmtt-8">&#x00A0;</span><span
  10507. class="cmtt-8">&#x00A0;</span><span
  10508. class="cmtt-8">&#x00A0;</span><span
  10509. class="cmtt-8">&#x00A0;</span><span
  10510. class="cmtt-8">&#x00A0;</span><span
  10511. class="cmtt-8">&#x00A0;</span><span
  10512. class="cmtt-8">&#x00A0;</span><span
  10513. class="cmtt-8">&#x00A0;</span><span
  10514. class="cmtt-8">&#x00A0;</span><span
  10515. class="cmtt-8">&#x00A0;</span><span
  10516. class="cmtt-8">&#x00A0;</span><span
  10517. class="cmtt-8">&#x00A0;</span><span
  10518. class="cmtt-8">&#x00A0;</span><span
  10519. class="cmtt-8">&#x00A0;</span><span
  10520. class="cmtt-8">&#x00A0;</span><span
  10521. class="cmtt-8">&#x00A0;</span><span
  10522. class="cmtt-8">&#x00A0;</span><span
  10523. class="cmtt-8">&#x00A0;</span><span
  10524. class="cmtt-8">&#x00A0;</span><span
  10525. class="cmtt-8">&#x00A0;</span><span
  10526. class="cmtt-8">&#x00A0;</span><span
  10527. class="cmtt-8">&#x00A0;</span><span
  10528. class="cmtt-8">&#x00A0;</span><span
  10529. class="cmtt-8">&#x00A0;</span><span
  10530. class="cmtt-8">&#x00A0;16)</span><span
  10531. class="cmtt-8">&#x00A0;[vqclass]</span><span
  10532. class="cmtt-8">&#x00A0;=</span><span
  10533. class="cmtt-8">&#x00A0;array</span><span
  10534. class="cmtt-8">&#x00A0;[classifications]</span><span
  10535. class="cmtt-8">&#x00A0;element</span><span
  10536. class="cmtt-8">&#x00A0;[j],[partition_count]</span>
  10537. <br class="fancyvrb" /><a
  10538. id="x1-110092r38"></a><span
  10539. class="cmr-6">38</span><span
  10540. class="cmtt-8">&#x00A0;</span><span
  10541. class="cmtt-8">&#x00A0;</span><span
  10542. class="cmtt-8">&#x00A0;</span><span
  10543. class="cmtt-8">&#x00A0;</span><span
  10544. class="cmtt-8">&#x00A0;</span><span
  10545. class="cmtt-8">&#x00A0;</span><span
  10546. class="cmtt-8">&#x00A0;</span><span
  10547. class="cmtt-8">&#x00A0;</span><span
  10548. class="cmtt-8">&#x00A0;</span><span
  10549. class="cmtt-8">&#x00A0;</span><span
  10550. class="cmtt-8">&#x00A0;</span><span
  10551. class="cmtt-8">&#x00A0;</span><span
  10552. class="cmtt-8">&#x00A0;</span><span
  10553. class="cmtt-8">&#x00A0;</span><span
  10554. class="cmtt-8">&#x00A0;</span><span
  10555. class="cmtt-8">&#x00A0;</span><span
  10556. class="cmtt-8">&#x00A0;</span><span
  10557. class="cmtt-8">&#x00A0;</span><span
  10558. class="cmtt-8">&#x00A0;</span><span
  10559. class="cmtt-8">&#x00A0;</span><span
  10560. class="cmtt-8">&#x00A0;</span><span
  10561. class="cmtt-8">&#x00A0;</span><span
  10562. class="cmtt-8">&#x00A0;</span><span
  10563. class="cmtt-8">&#x00A0;</span><span
  10564. class="cmtt-8">&#x00A0;</span><span
  10565. class="cmtt-8">&#x00A0;</span><span
  10566. class="cmtt-8">&#x00A0;</span><span
  10567. class="cmtt-8">&#x00A0;</span><span
  10568. class="cmtt-8">&#x00A0;17)</span><span
  10569. class="cmtt-8">&#x00A0;[vqbook]</span><span
  10570. class="cmtt-8">&#x00A0;=</span><span
  10571. class="cmtt-8">&#x00A0;array</span><span
  10572. class="cmtt-8">&#x00A0;[residue_books]</span><span
  10573. class="cmtt-8">&#x00A0;element</span><span
  10574. class="cmtt-8">&#x00A0;[vqclass],[pass]</span>
  10575. <br class="fancyvrb" /><a
  10576. id="x1-110094r39"></a><span
  10577. class="cmr-6">39</span><span
  10578. class="cmtt-8">&#x00A0;</span><span
  10579. class="cmtt-8">&#x00A0;</span><span
  10580. class="cmtt-8">&#x00A0;</span><span
  10581. class="cmtt-8">&#x00A0;</span><span
  10582. class="cmtt-8">&#x00A0;</span><span
  10583. class="cmtt-8">&#x00A0;</span><span
  10584. class="cmtt-8">&#x00A0;</span><span
  10585. class="cmtt-8">&#x00A0;</span><span
  10586. class="cmtt-8">&#x00A0;</span><span
  10587. class="cmtt-8">&#x00A0;</span><span
  10588. class="cmtt-8">&#x00A0;</span><span
  10589. class="cmtt-8">&#x00A0;</span><span
  10590. class="cmtt-8">&#x00A0;</span><span
  10591. class="cmtt-8">&#x00A0;</span><span
  10592. class="cmtt-8">&#x00A0;</span><span
  10593. class="cmtt-8">&#x00A0;</span><span
  10594. class="cmtt-8">&#x00A0;</span><span
  10595. class="cmtt-8">&#x00A0;</span><span
  10596. class="cmtt-8">&#x00A0;</span><span
  10597. class="cmtt-8">&#x00A0;</span><span
  10598. class="cmtt-8">&#x00A0;</span><span
  10599. class="cmtt-8">&#x00A0;</span><span
  10600. class="cmtt-8">&#x00A0;</span><span
  10601. class="cmtt-8">&#x00A0;</span><span
  10602. class="cmtt-8">&#x00A0;</span><span
  10603. class="cmtt-8">&#x00A0;</span><span
  10604. class="cmtt-8">&#x00A0;</span><span
  10605. class="cmtt-8">&#x00A0;</span><span
  10606. class="cmtt-8">&#x00A0;18)</span><span
  10607. class="cmtt-8">&#x00A0;if</span><span
  10608. class="cmtt-8">&#x00A0;([vqbook]</span><span
  10609. class="cmtt-8">&#x00A0;is</span><span
  10610. class="cmtt-8">&#x00A0;not</span><span
  10611. class="cmtt-8">&#x00A0;&#8217;unused&#8217;)</span><span
  10612. class="cmtt-8">&#x00A0;{</span>
  10613. <br class="fancyvrb" /><a
  10614. id="x1-110096r40"></a><span
  10615. class="cmr-6">40</span><span
  10616. class="cmtt-8">&#x00A0;</span><span
  10617. class="cmtt-8">&#x00A0;</span>
  10618. <br class="fancyvrb" /><a
  10619. id="x1-110098r41"></a><span
  10620. class="cmr-6">41</span><span
  10621. class="cmtt-8">&#x00A0;</span><span
  10622. class="cmtt-8">&#x00A0;</span><span
  10623. class="cmtt-8">&#x00A0;</span><span
  10624. class="cmtt-8">&#x00A0;</span><span
  10625. class="cmtt-8">&#x00A0;</span><span
  10626. class="cmtt-8">&#x00A0;</span><span
  10627. class="cmtt-8">&#x00A0;</span><span
  10628. class="cmtt-8">&#x00A0;</span><span
  10629. class="cmtt-8">&#x00A0;</span><span
  10630. class="cmtt-8">&#x00A0;</span><span
  10631. class="cmtt-8">&#x00A0;</span><span
  10632. class="cmtt-8">&#x00A0;</span><span
  10633. class="cmtt-8">&#x00A0;</span><span
  10634. class="cmtt-8">&#x00A0;</span><span
  10635. class="cmtt-8">&#x00A0;</span><span
  10636. class="cmtt-8">&#x00A0;</span><span
  10637. class="cmtt-8">&#x00A0;</span><span
  10638. class="cmtt-8">&#x00A0;</span><span
  10639. class="cmtt-8">&#x00A0;</span><span
  10640. class="cmtt-8">&#x00A0;</span><span
  10641. class="cmtt-8">&#x00A0;</span><span
  10642. class="cmtt-8">&#x00A0;</span><span
  10643. class="cmtt-8">&#x00A0;</span><span
  10644. class="cmtt-8">&#x00A0;</span><span
  10645. class="cmtt-8">&#x00A0;</span><span
  10646. class="cmtt-8">&#x00A0;</span><span
  10647. class="cmtt-8">&#x00A0;</span><span
  10648. class="cmtt-8">&#x00A0;</span><span
  10649. class="cmtt-8">&#x00A0;</span><span
  10650. class="cmtt-8">&#x00A0;</span><span
  10651. class="cmtt-8">&#x00A0;</span><span
  10652. class="cmtt-8">&#x00A0;</span><span
  10653. class="cmtt-8">&#x00A0;</span><span
  10654. class="cmtt-8">&#x00A0;19)</span><span
  10655. class="cmtt-8">&#x00A0;decode</span><span
  10656. class="cmtt-8">&#x00A0;partition</span><span
  10657. class="cmtt-8">&#x00A0;into</span><span
  10658. class="cmtt-8">&#x00A0;output</span><span
  10659. class="cmtt-8">&#x00A0;vector</span><span
  10660. class="cmtt-8">&#x00A0;number</span><span
  10661. class="cmtt-8">&#x00A0;[j],</span><span
  10662. class="cmtt-8">&#x00A0;starting</span><span
  10663. class="cmtt-8">&#x00A0;at</span><span
  10664. class="cmtt-8">&#x00A0;scalar</span>
  10665. <br class="fancyvrb" /><a
  10666. id="x1-110100r42"></a><span
  10667. class="cmr-6">42</span><span
  10668. class="cmtt-8">&#x00A0;</span><span
  10669. class="cmtt-8">&#x00A0;</span><span
  10670. class="cmtt-8">&#x00A0;</span><span
  10671. class="cmtt-8">&#x00A0;</span><span
  10672. class="cmtt-8">&#x00A0;</span><span
  10673. class="cmtt-8">&#x00A0;</span><span
  10674. class="cmtt-8">&#x00A0;</span><span
  10675. class="cmtt-8">&#x00A0;</span><span
  10676. class="cmtt-8">&#x00A0;</span><span
  10677. class="cmtt-8">&#x00A0;</span><span
  10678. class="cmtt-8">&#x00A0;</span><span
  10679. class="cmtt-8">&#x00A0;</span><span
  10680. class="cmtt-8">&#x00A0;</span><span
  10681. class="cmtt-8">&#x00A0;</span><span
  10682. class="cmtt-8">&#x00A0;</span><span
  10683. class="cmtt-8">&#x00A0;</span><span
  10684. class="cmtt-8">&#x00A0;</span><span
  10685. class="cmtt-8">&#x00A0;</span><span
  10686. class="cmtt-8">&#x00A0;</span><span
  10687. class="cmtt-8">&#x00A0;</span><span
  10688. class="cmtt-8">&#x00A0;</span><span
  10689. class="cmtt-8">&#x00A0;</span><span
  10690. class="cmtt-8">&#x00A0;</span><span
  10691. class="cmtt-8">&#x00A0;</span><span
  10692. class="cmtt-8">&#x00A0;</span><span
  10693. class="cmtt-8">&#x00A0;</span><span
  10694. class="cmtt-8">&#x00A0;</span><span
  10695. class="cmtt-8">&#x00A0;</span><span
  10696. class="cmtt-8">&#x00A0;</span><span
  10697. class="cmtt-8">&#x00A0;</span><span
  10698. class="cmtt-8">&#x00A0;</span><span
  10699. class="cmtt-8">&#x00A0;</span><span
  10700. class="cmtt-8">&#x00A0;</span><span
  10701. class="cmtt-8">&#x00A0;</span><span
  10702. class="cmtt-8">&#x00A0;</span><span
  10703. class="cmtt-8">&#x00A0;</span><span
  10704. class="cmtt-8">&#x00A0;</span><span
  10705. class="cmtt-8">&#x00A0;offset</span><span
  10706. class="cmtt-8">&#x00A0;[limit_residue_begin]+[partition_count]*[residue_partition_size]</span><span
  10707. class="cmtt-8">&#x00A0;using</span>
  10708. <br class="fancyvrb" /><a
  10709. id="x1-110102r43"></a><span
  10710. class="cmr-6">43</span><span
  10711. class="cmtt-8">&#x00A0;</span><span
  10712. class="cmtt-8">&#x00A0;</span><span
  10713. class="cmtt-8">&#x00A0;</span><span
  10714. class="cmtt-8">&#x00A0;</span><span
  10715. class="cmtt-8">&#x00A0;</span><span
  10716. class="cmtt-8">&#x00A0;</span><span
  10717. class="cmtt-8">&#x00A0;</span><span
  10718. class="cmtt-8">&#x00A0;</span><span
  10719. class="cmtt-8">&#x00A0;</span><span
  10720. class="cmtt-8">&#x00A0;</span><span
  10721. class="cmtt-8">&#x00A0;</span><span
  10722. class="cmtt-8">&#x00A0;</span><span
  10723. class="cmtt-8">&#x00A0;</span><span
  10724. class="cmtt-8">&#x00A0;</span><span
  10725. class="cmtt-8">&#x00A0;</span><span
  10726. class="cmtt-8">&#x00A0;</span><span
  10727. class="cmtt-8">&#x00A0;</span><span
  10728. class="cmtt-8">&#x00A0;</span><span
  10729. class="cmtt-8">&#x00A0;</span><span
  10730. class="cmtt-8">&#x00A0;</span><span
  10731. class="cmtt-8">&#x00A0;</span><span
  10732. class="cmtt-8">&#x00A0;</span><span
  10733. class="cmtt-8">&#x00A0;</span><span
  10734. class="cmtt-8">&#x00A0;</span><span
  10735. class="cmtt-8">&#x00A0;</span><span
  10736. class="cmtt-8">&#x00A0;</span><span
  10737. class="cmtt-8">&#x00A0;</span><span
  10738. class="cmtt-8">&#x00A0;</span><span
  10739. class="cmtt-8">&#x00A0;</span><span
  10740. class="cmtt-8">&#x00A0;</span><span
  10741. class="cmtt-8">&#x00A0;</span><span
  10742. class="cmtt-8">&#x00A0;</span><span
  10743. class="cmtt-8">&#x00A0;</span><span
  10744. class="cmtt-8">&#x00A0;</span><span
  10745. class="cmtt-8">&#x00A0;</span><span
  10746. class="cmtt-8">&#x00A0;</span><span
  10747. class="cmtt-8">&#x00A0;</span><span
  10748. class="cmtt-8">&#x00A0;codebook</span><span
  10749. class="cmtt-8">&#x00A0;number</span><span
  10750. class="cmtt-8">&#x00A0;[vqbook]</span><span
  10751. class="cmtt-8">&#x00A0;in</span><span
  10752. class="cmtt-8">&#x00A0;VQ</span><span
  10753. class="cmtt-8">&#x00A0;context</span>
  10754. <br class="fancyvrb" /><a
  10755. id="x1-110104r44"></a><span
  10756. class="cmr-6">44</span><span
  10757. class="cmtt-8">&#x00A0;</span><span
  10758. class="cmtt-8">&#x00A0;</span><span
  10759. class="cmtt-8">&#x00A0;</span><span
  10760. class="cmtt-8">&#x00A0;</span><span
  10761. class="cmtt-8">&#x00A0;</span><span
  10762. class="cmtt-8">&#x00A0;</span><span
  10763. class="cmtt-8">&#x00A0;</span><span
  10764. class="cmtt-8">&#x00A0;</span><span
  10765. class="cmtt-8">&#x00A0;</span><span
  10766. class="cmtt-8">&#x00A0;</span><span
  10767. class="cmtt-8">&#x00A0;</span><span
  10768. class="cmtt-8">&#x00A0;</span><span
  10769. class="cmtt-8">&#x00A0;</span><span
  10770. class="cmtt-8">&#x00A0;</span><span
  10771. class="cmtt-8">&#x00A0;</span><span
  10772. class="cmtt-8">&#x00A0;</span><span
  10773. class="cmtt-8">&#x00A0;</span><span
  10774. class="cmtt-8">&#x00A0;</span><span
  10775. class="cmtt-8">&#x00A0;</span><span
  10776. class="cmtt-8">&#x00A0;</span><span
  10777. class="cmtt-8">&#x00A0;</span><span
  10778. class="cmtt-8">&#x00A0;</span><span
  10779. class="cmtt-8">&#x00A0;</span><span
  10780. class="cmtt-8">&#x00A0;</span><span
  10781. class="cmtt-8">&#x00A0;</span><span
  10782. class="cmtt-8">&#x00A0;</span><span
  10783. class="cmtt-8">&#x00A0;</span><span
  10784. class="cmtt-8">&#x00A0;}</span>
  10785. <br class="fancyvrb" /><a
  10786. id="x1-110106r45"></a><span
  10787. class="cmr-6">45</span><span
  10788. class="cmtt-8">&#x00A0;</span><span
  10789. class="cmtt-8">&#x00A0;</span><span
  10790. class="cmtt-8">&#x00A0;</span><span
  10791. class="cmtt-8">&#x00A0;</span><span
  10792. class="cmtt-8">&#x00A0;</span><span
  10793. class="cmtt-8">&#x00A0;</span><span
  10794. class="cmtt-8">&#x00A0;</span><span
  10795. class="cmtt-8">&#x00A0;</span><span
  10796. class="cmtt-8">&#x00A0;</span><span
  10797. class="cmtt-8">&#x00A0;</span><span
  10798. class="cmtt-8">&#x00A0;</span><span
  10799. class="cmtt-8">&#x00A0;</span><span
  10800. class="cmtt-8">&#x00A0;</span><span
  10801. class="cmtt-8">&#x00A0;</span><span
  10802. class="cmtt-8">&#x00A0;</span><span
  10803. class="cmtt-8">&#x00A0;</span><span
  10804. class="cmtt-8">&#x00A0;</span><span
  10805. class="cmtt-8">&#x00A0;</span><span
  10806. class="cmtt-8">&#x00A0;</span><span
  10807. class="cmtt-8">&#x00A0;</span><span
  10808. class="cmtt-8">&#x00A0;</span><span
  10809. class="cmtt-8">&#x00A0;</span><span
  10810. class="cmtt-8">&#x00A0;}</span>
  10811. <br class="fancyvrb" /><a
  10812. id="x1-110108r46"></a><span
  10813. class="cmr-6">46</span><span
  10814. class="cmtt-8">&#x00A0;</span><span
  10815. class="cmtt-8">&#x00A0;</span>
  10816. <br class="fancyvrb" /><a
  10817. id="x1-110110r47"></a><span
  10818. class="cmr-6">47</span><span
  10819. class="cmtt-8">&#x00A0;</span><span
  10820. class="cmtt-8">&#x00A0;</span><span
  10821. class="cmtt-8">&#x00A0;</span><span
  10822. class="cmtt-8">&#x00A0;</span><span
  10823. class="cmtt-8">&#x00A0;</span><span
  10824. class="cmtt-8">&#x00A0;</span><span
  10825. class="cmtt-8">&#x00A0;</span><span
  10826. class="cmtt-8">&#x00A0;</span><span
  10827. class="cmtt-8">&#x00A0;</span><span
  10828. class="cmtt-8">&#x00A0;</span><span
  10829. class="cmtt-8">&#x00A0;</span><span
  10830. class="cmtt-8">&#x00A0;</span><span
  10831. class="cmtt-8">&#x00A0;</span><span
  10832. class="cmtt-8">&#x00A0;</span><span
  10833. class="cmtt-8">&#x00A0;</span><span
  10834. class="cmtt-8">&#x00A0;</span><span
  10835. class="cmtt-8">&#x00A0;</span><span
  10836. class="cmtt-8">&#x00A0;</span><span
  10837. class="cmtt-8">&#x00A0;20)</span><span
  10838. class="cmtt-8">&#x00A0;increment</span><span
  10839. class="cmtt-8">&#x00A0;[partition_count]</span><span
  10840. class="cmtt-8">&#x00A0;by</span><span
  10841. class="cmtt-8">&#x00A0;one</span>
  10842. <br class="fancyvrb" /><a
  10843. id="x1-110112r48"></a><span
  10844. class="cmr-6">48</span><span
  10845. class="cmtt-8">&#x00A0;</span><span
  10846. class="cmtt-8">&#x00A0;</span>
  10847. <br class="fancyvrb" /><a
  10848. id="x1-110114r49"></a><span
  10849. class="cmr-6">49</span><span
  10850. class="cmtt-8">&#x00A0;</span><span
  10851. class="cmtt-8">&#x00A0;</span><span
  10852. class="cmtt-8">&#x00A0;</span><span
  10853. class="cmtt-8">&#x00A0;</span><span
  10854. class="cmtt-8">&#x00A0;</span><span
  10855. class="cmtt-8">&#x00A0;</span><span
  10856. class="cmtt-8">&#x00A0;</span><span
  10857. class="cmtt-8">&#x00A0;</span><span
  10858. class="cmtt-8">&#x00A0;</span><span
  10859. class="cmtt-8">&#x00A0;</span><span
  10860. class="cmtt-8">&#x00A0;</span><span
  10861. class="cmtt-8">&#x00A0;</span><span
  10862. class="cmtt-8">&#x00A0;</span><span
  10863. class="cmtt-8">&#x00A0;</span><span
  10864. class="cmtt-8">&#x00A0;</span><span
  10865. class="cmtt-8">&#x00A0;</span><span
  10866. class="cmtt-8">&#x00A0;}</span>
  10867. <br class="fancyvrb" /><a
  10868. id="x1-110116r50"></a><span
  10869. class="cmr-6">50</span><span
  10870. class="cmtt-8">&#x00A0;</span><span
  10871. class="cmtt-8">&#x00A0;</span><span
  10872. class="cmtt-8">&#x00A0;</span><span
  10873. class="cmtt-8">&#x00A0;</span><span
  10874. class="cmtt-8">&#x00A0;</span><span
  10875. class="cmtt-8">&#x00A0;</span><span
  10876. class="cmtt-8">&#x00A0;</span><span
  10877. class="cmtt-8">&#x00A0;</span><span
  10878. class="cmtt-8">&#x00A0;</span><span
  10879. class="cmtt-8">&#x00A0;</span><span
  10880. class="cmtt-8">&#x00A0;</span><span
  10881. class="cmtt-8">&#x00A0;}</span>
  10882. <br class="fancyvrb" /><a
  10883. id="x1-110118r51"></a><span
  10884. class="cmr-6">51</span><span
  10885. class="cmtt-8">&#x00A0;</span><span
  10886. class="cmtt-8">&#x00A0;</span><span
  10887. class="cmtt-8">&#x00A0;</span><span
  10888. class="cmtt-8">&#x00A0;</span><span
  10889. class="cmtt-8">&#x00A0;</span><span
  10890. class="cmtt-8">&#x00A0;</span><span
  10891. class="cmtt-8">&#x00A0;}</span>
  10892. <br class="fancyvrb" /><a
  10893. id="x1-110120r52"></a><span
  10894. class="cmr-6">52</span><span
  10895. class="cmtt-8">&#x00A0;</span><span
  10896. class="cmtt-8">&#x00A0;</span>
  10897. <br class="fancyvrb" /><a
  10898. id="x1-110122r53"></a><span
  10899. class="cmr-6">53</span><span
  10900. class="cmtt-8">&#x00A0;</span><span
  10901. class="cmtt-8">&#x00A0;</span><span
  10902. class="cmtt-8">&#x00A0;21)</span><span
  10903. class="cmtt-8">&#x00A0;done</span>
  10904. <br class="fancyvrb" /><a
  10905. id="x1-110124r54"></a><span
  10906. class="cmr-6">54</span><span
  10907. class="cmtt-8">&#x00A0;</span><span
  10908. class="cmtt-8">&#x00A0;</span>
  10909. </div>
  10910. <!--l. 341--><p class="noindent" >An end-of-packet condition during packet decode is to be considered a nominal occurrence.
  10911. Decode returns the result of vector decode up to that point.
  10912. <!--l. 347--><p class="noindent" >
  10913. <h5 class="subsubsectionHead"><span class="titlemark">8.6.3 </span> <a
  10914. id="x1-1110008.6.3"></a>format 0 specifics</h5>
  10915. <!--l. 349--><p class="noindent" >Format zero decodes partitions exactly as described earlier in the &#8217;Residue Format: residue 0&#8217;
  10916. section. The following pseudocode presents the same algorithm. Assume:
  10917. <ul class="itemize1">
  10918. <li class="itemize"><span
  10919. class="cmtt-12">[n] </span>is the value in <span
  10920. class="cmtt-12">[residue_partition_size]</span>
  10921. </li>
  10922. <li class="itemize"><span
  10923. class="cmtt-12">[v] </span>is the residue vector
  10924. </li>
  10925. <li class="itemize"><span
  10926. class="cmtt-12">[offset] </span>is the beginning read offset in [v]</li></ul>
  10927. <!--l. 360--><p class="noindent" >
  10928. <div class="fancyvrb" id="fancyvrb41">
  10929. <a
  10930. id="x1-111002r1"></a><span
  10931. class="cmr-6">1</span><span
  10932. class="cmtt-8">&#x00A0;</span><span
  10933. class="cmtt-8">&#x00A0;</span><span
  10934. class="cmtt-8">&#x00A0;1)</span><span
  10935. class="cmtt-8">&#x00A0;[step]</span><span
  10936. class="cmtt-8">&#x00A0;=</span><span
  10937. class="cmtt-8">&#x00A0;[n]</span><span
  10938. class="cmtt-8">&#x00A0;/</span><span
  10939. class="cmtt-8">&#x00A0;[codebook_dimensions]</span>
  10940. <br class="fancyvrb" /><a
  10941. id="x1-111004r2"></a><span
  10942. class="cmr-6">2</span><span
  10943. class="cmtt-8">&#x00A0;</span><span
  10944. class="cmtt-8">&#x00A0;</span><span
  10945. class="cmtt-8">&#x00A0;2)</span><span
  10946. class="cmtt-8">&#x00A0;iterate</span><span
  10947. class="cmtt-8">&#x00A0;[i]</span><span
  10948. class="cmtt-8">&#x00A0;over</span><span
  10949. class="cmtt-8">&#x00A0;the</span><span
  10950. class="cmtt-8">&#x00A0;range</span><span
  10951. class="cmtt-8">&#x00A0;0</span><span
  10952. class="cmtt-8">&#x00A0;...</span><span
  10953. class="cmtt-8">&#x00A0;[step]-1</span><span
  10954. class="cmtt-8">&#x00A0;{</span>
  10955. <br class="fancyvrb" /><a
  10956. id="x1-111006r3"></a><span
  10957. class="cmr-6">3</span><span
  10958. class="cmtt-8">&#x00A0;</span><span
  10959. class="cmtt-8">&#x00A0;</span>
  10960. <br class="fancyvrb" /><a
  10961. id="x1-111008r4"></a><span
  10962. class="cmr-6">4</span><span
  10963. class="cmtt-8">&#x00A0;</span><span
  10964. class="cmtt-8">&#x00A0;</span><span
  10965. class="cmtt-8">&#x00A0;</span><span
  10966. class="cmtt-8">&#x00A0;</span><span
  10967. class="cmtt-8">&#x00A0;</span><span
  10968. class="cmtt-8">&#x00A0;</span><span
  10969. class="cmtt-8">&#x00A0;</span><span
  10970. class="cmtt-8">&#x00A0;3)</span><span
  10971. class="cmtt-8">&#x00A0;vector</span><span
  10972. class="cmtt-8">&#x00A0;[entry_temp]</span><span
  10973. class="cmtt-8">&#x00A0;=</span><span
  10974. class="cmtt-8">&#x00A0;read</span><span
  10975. class="cmtt-8">&#x00A0;vector</span><span
  10976. class="cmtt-8">&#x00A0;from</span><span
  10977. class="cmtt-8">&#x00A0;packet</span><span
  10978. class="cmtt-8">&#x00A0;using</span><span
  10979. class="cmtt-8">&#x00A0;current</span><span
  10980. class="cmtt-8">&#x00A0;codebook</span><span
  10981. class="cmtt-8">&#x00A0;in</span><span
  10982. class="cmtt-8">&#x00A0;VQ</span><span
  10983. class="cmtt-8">&#x00A0;context</span>
  10984. <br class="fancyvrb" /><a
  10985. id="x1-111010r5"></a><span
  10986. class="cmr-6">5</span><span
  10987. class="cmtt-8">&#x00A0;</span><span
  10988. class="cmtt-8">&#x00A0;</span><span
  10989. class="cmtt-8">&#x00A0;</span><span
  10990. class="cmtt-8">&#x00A0;</span><span
  10991. class="cmtt-8">&#x00A0;</span><span
  10992. class="cmtt-8">&#x00A0;</span><span
  10993. class="cmtt-8">&#x00A0;</span><span
  10994. class="cmtt-8">&#x00A0;4)</span><span
  10995. class="cmtt-8">&#x00A0;iterate</span><span
  10996. class="cmtt-8">&#x00A0;[j]</span><span
  10997. class="cmtt-8">&#x00A0;over</span><span
  10998. class="cmtt-8">&#x00A0;the</span><span
  10999. class="cmtt-8">&#x00A0;range</span><span
  11000. class="cmtt-8">&#x00A0;0</span><span
  11001. class="cmtt-8">&#x00A0;...</span><span
  11002. class="cmtt-8">&#x00A0;[codebook_dimensions]-1</span><span
  11003. class="cmtt-8">&#x00A0;{</span>
  11004. <br class="fancyvrb" /><a
  11005. id="x1-111012r6"></a><span
  11006. class="cmr-6">6</span><span
  11007. class="cmtt-8">&#x00A0;</span><span
  11008. class="cmtt-8">&#x00A0;</span>
  11009. <br class="fancyvrb" /><a
  11010. id="x1-111014r7"></a><span
  11011. class="cmr-6">7</span><span
  11012. class="cmtt-8">&#x00A0;</span><span
  11013. class="cmtt-8">&#x00A0;</span><span
  11014. class="cmtt-8">&#x00A0;</span><span
  11015. class="cmtt-8">&#x00A0;</span><span
  11016. class="cmtt-8">&#x00A0;</span><span
  11017. class="cmtt-8">&#x00A0;</span><span
  11018. class="cmtt-8">&#x00A0;</span><span
  11019. class="cmtt-8">&#x00A0;</span><span
  11020. class="cmtt-8">&#x00A0;</span><span
  11021. class="cmtt-8">&#x00A0;</span><span
  11022. class="cmtt-8">&#x00A0;</span><span
  11023. class="cmtt-8">&#x00A0;</span><span
  11024. class="cmtt-8">&#x00A0;5)</span><span
  11025. class="cmtt-8">&#x00A0;vector</span><span
  11026. class="cmtt-8">&#x00A0;[v]</span><span
  11027. class="cmtt-8">&#x00A0;element</span><span
  11028. class="cmtt-8">&#x00A0;([offset]+[i]+[j]*[step])</span><span
  11029. class="cmtt-8">&#x00A0;=</span>
  11030. <br class="fancyvrb" /><a
  11031. id="x1-111016r8"></a><span
  11032. class="cmr-6">8</span><span
  11033. class="cmtt-8">&#x00A0;</span><span
  11034. class="cmtt-8">&#x00A0; </span><span
  11035. class="cmtt-8">&#x00A0;</span><span
  11036. class="cmtt-8">&#x00A0;</span><span
  11037. class="cmtt-8">&#x00A0;</span><span
  11038. class="cmtt-8">&#x00A0;</span><span
  11039. class="cmtt-8">&#x00A0;</span><span
  11040. class="cmtt-8">&#x00A0;</span><span
  11041. class="cmtt-8">&#x00A0;</span><span
  11042. class="cmtt-8">&#x00A0;vector</span><span
  11043. class="cmtt-8">&#x00A0;[v]</span><span
  11044. class="cmtt-8">&#x00A0;element</span><span
  11045. class="cmtt-8">&#x00A0;([offset]+[i]+[j]*[step])</span><span
  11046. class="cmtt-8">&#x00A0;+</span>
  11047. <br class="fancyvrb" /><a
  11048. id="x1-111018r9"></a><span
  11049. class="cmr-6">9</span><span
  11050. class="cmtt-8">&#x00A0;</span><span
  11051. class="cmtt-8">&#x00A0;</span><span
  11052. class="cmtt-8">&#x00A0;</span><span
  11053. class="cmtt-8">&#x00A0;</span><span
  11054. class="cmtt-8">&#x00A0;</span><span
  11055. class="cmtt-8">&#x00A0;</span><span
  11056. class="cmtt-8">&#x00A0;</span><span
  11057. class="cmtt-8">&#x00A0;</span><span
  11058. class="cmtt-8">&#x00A0;</span><span
  11059. class="cmtt-8">&#x00A0;</span><span
  11060. class="cmtt-8">&#x00A0;</span><span
  11061. class="cmtt-8">&#x00A0;</span><span
  11062. class="cmtt-8">&#x00A0;</span><span
  11063. class="cmtt-8">&#x00A0;</span><span
  11064. class="cmtt-8">&#x00A0;</span><span
  11065. class="cmtt-8">&#x00A0;</span><span
  11066. class="cmtt-8">&#x00A0;</span><span
  11067. class="cmtt-8">&#x00A0;vector</span><span
  11068. class="cmtt-8">&#x00A0;[entry_temp]</span><span
  11069. class="cmtt-8">&#x00A0;element</span><span
  11070. class="cmtt-8">&#x00A0;[j]</span>
  11071. <br class="fancyvrb" /><a
  11072. id="x1-111020r10"></a><span
  11073. class="cmr-6">10</span><span
  11074. class="cmtt-8">&#x00A0;</span><span
  11075. class="cmtt-8">&#x00A0;</span>
  11076. <br class="fancyvrb" /><a
  11077. id="x1-111022r11"></a><span
  11078. class="cmr-6">11</span><span
  11079. class="cmtt-8">&#x00A0;</span><span
  11080. class="cmtt-8">&#x00A0;</span><span
  11081. class="cmtt-8">&#x00A0;</span><span
  11082. class="cmtt-8">&#x00A0;</span><span
  11083. class="cmtt-8">&#x00A0;</span><span
  11084. class="cmtt-8">&#x00A0;</span><span
  11085. class="cmtt-8">&#x00A0;</span><span
  11086. class="cmtt-8">&#x00A0;</span><span
  11087. class="cmtt-8">&#x00A0;</span><span
  11088. class="cmtt-8">&#x00A0;</span><span
  11089. class="cmtt-8">&#x00A0;}</span>
  11090. <br class="fancyvrb" /><a
  11091. id="x1-111024r12"></a><span
  11092. class="cmr-6">12</span><span
  11093. class="cmtt-8">&#x00A0;</span><span
  11094. class="cmtt-8">&#x00A0;</span>
  11095. <br class="fancyvrb" /><a
  11096. id="x1-111026r13"></a><span
  11097. class="cmr-6">13</span><span
  11098. class="cmtt-8">&#x00A0;</span><span
  11099. class="cmtt-8">&#x00A0;</span><span
  11100. class="cmtt-8">&#x00A0;</span><span
  11101. class="cmtt-8">&#x00A0;</span><span
  11102. class="cmtt-8">&#x00A0;</span><span
  11103. class="cmtt-8">&#x00A0;}</span>
  11104. <br class="fancyvrb" /><a
  11105. id="x1-111028r14"></a><span
  11106. class="cmr-6">14</span><span
  11107. class="cmtt-8">&#x00A0;</span><span
  11108. class="cmtt-8">&#x00A0;</span>
  11109. <br class="fancyvrb" /><a
  11110. id="x1-111030r15"></a><span
  11111. class="cmr-6">15</span><span
  11112. class="cmtt-8">&#x00A0;</span><span
  11113. class="cmtt-8">&#x00A0;</span><span
  11114. class="cmtt-8">&#x00A0;</span><span
  11115. class="cmtt-8">&#x00A0;6)</span><span
  11116. class="cmtt-8">&#x00A0;done</span>
  11117. <br class="fancyvrb" /><a
  11118. id="x1-111032r16"></a><span
  11119. class="cmr-6">16</span><span
  11120. class="cmtt-8">&#x00A0;</span><span
  11121. class="cmtt-8">&#x00A0;</span>
  11122. </div>
  11123. <!--l. 381--><p class="noindent" >
  11124. <h5 class="subsubsectionHead"><span class="titlemark">8.6.4 </span> <a
  11125. id="x1-1120008.6.4"></a>format 1 specifics</h5>
  11126. <!--l. 383--><p class="noindent" >Format 1 decodes partitions exactly as described earlier in the &#8217;Residue Format: residue 1&#8217;
  11127. section. The following pseudocode presents the same algorithm. Assume:
  11128. <ul class="itemize1">
  11129. <li class="itemize"><span
  11130. class="cmtt-12">[n] </span>is the value in <span
  11131. class="cmtt-12">[residue_partition_size]</span>
  11132. </li>
  11133. <li class="itemize"><span
  11134. class="cmtt-12">[v] </span>is the residue vector
  11135. </li>
  11136. <li class="itemize"><span
  11137. class="cmtt-12">[offset] </span>is the beginning read offset in [v]</li></ul>
  11138. <!--l. 395--><p class="noindent" >
  11139. <div class="fancyvrb" id="fancyvrb42">
  11140. <a
  11141. id="x1-112002r1"></a><span
  11142. class="cmr-6">1</span><span
  11143. class="cmtt-8">&#x00A0;</span><span
  11144. class="cmtt-8">&#x00A0;</span><span
  11145. class="cmtt-8">&#x00A0;1)</span><span
  11146. class="cmtt-8">&#x00A0;[i]</span><span
  11147. class="cmtt-8">&#x00A0;=</span><span
  11148. class="cmtt-8">&#x00A0;0</span>
  11149. <br class="fancyvrb" /><a
  11150. id="x1-112004r2"></a><span
  11151. class="cmr-6">2</span><span
  11152. class="cmtt-8">&#x00A0;</span><span
  11153. class="cmtt-8">&#x00A0;</span><span
  11154. class="cmtt-8">&#x00A0;2)</span><span
  11155. class="cmtt-8">&#x00A0;vector</span><span
  11156. class="cmtt-8">&#x00A0;[entry_temp]</span><span
  11157. class="cmtt-8">&#x00A0;=</span><span
  11158. class="cmtt-8">&#x00A0;read</span><span
  11159. class="cmtt-8">&#x00A0;vector</span><span
  11160. class="cmtt-8">&#x00A0;from</span><span
  11161. class="cmtt-8">&#x00A0;packet</span><span
  11162. class="cmtt-8">&#x00A0;using</span><span
  11163. class="cmtt-8">&#x00A0;current</span><span
  11164. class="cmtt-8">&#x00A0;codebook</span><span
  11165. class="cmtt-8">&#x00A0;in</span><span
  11166. class="cmtt-8">&#x00A0;VQ</span><span
  11167. class="cmtt-8">&#x00A0;context</span>
  11168. <br class="fancyvrb" /><a
  11169. id="x1-112006r3"></a><span
  11170. class="cmr-6">3</span><span
  11171. class="cmtt-8">&#x00A0;</span><span
  11172. class="cmtt-8">&#x00A0;</span><span
  11173. class="cmtt-8">&#x00A0;3)</span><span
  11174. class="cmtt-8">&#x00A0;iterate</span><span
  11175. class="cmtt-8">&#x00A0;[j]</span><span
  11176. class="cmtt-8">&#x00A0;over</span><span
  11177. class="cmtt-8">&#x00A0;the</span><span
  11178. class="cmtt-8">&#x00A0;range</span><span
  11179. class="cmtt-8">&#x00A0;0</span><span
  11180. class="cmtt-8">&#x00A0;...</span><span
  11181. class="cmtt-8">&#x00A0;[codebook_dimensions]-1</span><span
  11182. class="cmtt-8">&#x00A0;{</span>
  11183. <br class="fancyvrb" /><a
  11184. id="x1-112008r4"></a><span
  11185. class="cmr-6">4</span><span
  11186. class="cmtt-8">&#x00A0;</span><span
  11187. class="cmtt-8">&#x00A0;</span>
  11188. <br class="fancyvrb" /><a
  11189. id="x1-112010r5"></a><span
  11190. class="cmr-6">5</span><span
  11191. class="cmtt-8">&#x00A0;</span><span
  11192. class="cmtt-8">&#x00A0;</span><span
  11193. class="cmtt-8">&#x00A0;</span><span
  11194. class="cmtt-8">&#x00A0;</span><span
  11195. class="cmtt-8">&#x00A0;</span><span
  11196. class="cmtt-8">&#x00A0;</span><span
  11197. class="cmtt-8">&#x00A0;</span><span
  11198. class="cmtt-8">&#x00A0;4)</span><span
  11199. class="cmtt-8">&#x00A0;vector</span><span
  11200. class="cmtt-8">&#x00A0;[v]</span><span
  11201. class="cmtt-8">&#x00A0;element</span><span
  11202. class="cmtt-8">&#x00A0;([offset]+[i])</span><span
  11203. class="cmtt-8">&#x00A0;=</span>
  11204. <br class="fancyvrb" /><a
  11205. id="x1-112012r6"></a><span
  11206. class="cmr-6">6</span><span
  11207. class="cmtt-8">&#x00A0;</span><span
  11208. class="cmtt-8">&#x00A0; </span><span
  11209. class="cmtt-8">&#x00A0;</span><span
  11210. class="cmtt-8">&#x00A0;vector</span><span
  11211. class="cmtt-8">&#x00A0;[v]</span><span
  11212. class="cmtt-8">&#x00A0;element</span><span
  11213. class="cmtt-8">&#x00A0;([offset]+[i])</span><span
  11214. class="cmtt-8">&#x00A0;+</span>
  11215. <br class="fancyvrb" /><a
  11216. id="x1-112014r7"></a><span
  11217. class="cmr-6">7</span><span
  11218. class="cmtt-8">&#x00A0;</span><span
  11219. class="cmtt-8">&#x00A0;</span><span
  11220. class="cmtt-8">&#x00A0;</span><span
  11221. class="cmtt-8">&#x00A0;</span><span
  11222. class="cmtt-8">&#x00A0;</span><span
  11223. class="cmtt-8">&#x00A0;</span><span
  11224. class="cmtt-8">&#x00A0;</span><span
  11225. class="cmtt-8">&#x00A0;</span><span
  11226. class="cmtt-8">&#x00A0;</span><span
  11227. class="cmtt-8">&#x00A0;</span><span
  11228. class="cmtt-8">&#x00A0;</span><span
  11229. class="cmtt-8">&#x00A0;vector</span><span
  11230. class="cmtt-8">&#x00A0;[entry_temp]</span><span
  11231. class="cmtt-8">&#x00A0;element</span><span
  11232. class="cmtt-8">&#x00A0;[j]</span>
  11233. <br class="fancyvrb" /><a
  11234. id="x1-112016r8"></a><span
  11235. class="cmr-6">8</span><span
  11236. class="cmtt-8">&#x00A0;</span><span
  11237. class="cmtt-8">&#x00A0;</span><span
  11238. class="cmtt-8">&#x00A0;</span><span
  11239. class="cmtt-8">&#x00A0;</span><span
  11240. class="cmtt-8">&#x00A0;</span><span
  11241. class="cmtt-8">&#x00A0;</span><span
  11242. class="cmtt-8">&#x00A0;</span><span
  11243. class="cmtt-8">&#x00A0;5)</span><span
  11244. class="cmtt-8">&#x00A0;increment</span><span
  11245. class="cmtt-8">&#x00A0;[i]</span>
  11246. <br class="fancyvrb" /><a
  11247. id="x1-112018r9"></a><span
  11248. class="cmr-6">9</span><span
  11249. class="cmtt-8">&#x00A0;</span><span
  11250. class="cmtt-8">&#x00A0;</span>
  11251. <br class="fancyvrb" /><a
  11252. id="x1-112020r10"></a><span
  11253. class="cmr-6">10</span><span
  11254. class="cmtt-8">&#x00A0;</span><span
  11255. class="cmtt-8">&#x00A0;</span><span
  11256. class="cmtt-8">&#x00A0;</span><span
  11257. class="cmtt-8">&#x00A0;</span><span
  11258. class="cmtt-8">&#x00A0;</span><span
  11259. class="cmtt-8">&#x00A0;}</span>
  11260. <br class="fancyvrb" /><a
  11261. id="x1-112022r11"></a><span
  11262. class="cmr-6">11</span><span
  11263. class="cmtt-8">&#x00A0;</span><span
  11264. class="cmtt-8">&#x00A0;</span>
  11265. <br class="fancyvrb" /><a
  11266. id="x1-112024r12"></a><span
  11267. class="cmr-6">12</span><span
  11268. class="cmtt-8">&#x00A0;</span><span
  11269. class="cmtt-8">&#x00A0;</span><span
  11270. class="cmtt-8">&#x00A0;</span><span
  11271. class="cmtt-8">&#x00A0;6)</span><span
  11272. class="cmtt-8">&#x00A0;if</span><span
  11273. class="cmtt-8">&#x00A0;(</span><span
  11274. class="cmtt-8">&#x00A0;[i]</span><span
  11275. class="cmtt-8">&#x00A0;is</span><span
  11276. class="cmtt-8">&#x00A0;less</span><span
  11277. class="cmtt-8">&#x00A0;than</span><span
  11278. class="cmtt-8">&#x00A0;[n]</span><span
  11279. class="cmtt-8">&#x00A0;)</span><span
  11280. class="cmtt-8">&#x00A0;continue</span><span
  11281. class="cmtt-8">&#x00A0;at</span><span
  11282. class="cmtt-8">&#x00A0;step</span><span
  11283. class="cmtt-8">&#x00A0;2</span>
  11284. <br class="fancyvrb" /><a
  11285. id="x1-112026r13"></a><span
  11286. class="cmr-6">13</span><span
  11287. class="cmtt-8">&#x00A0;</span><span
  11288. class="cmtt-8">&#x00A0;</span><span
  11289. class="cmtt-8">&#x00A0;</span><span
  11290. class="cmtt-8">&#x00A0;7)</span><span
  11291. class="cmtt-8">&#x00A0;done</span>
  11292. </div>
  11293. <!--l. 413--><p class="noindent" >
  11294. <h5 class="subsubsectionHead"><span class="titlemark">8.6.5 </span> <a
  11295. id="x1-1130008.6.5"></a>format 2 specifics</h5>
  11296. <!--l. 415--><p class="noindent" >Format 2 is reducible to format 1. It may be implemented as an additional step prior to and an
  11297. additional post-decode step after a normal format 1 decode.
  11298. <!--l. 418--><p class="noindent" >Format 2 handles &#8217;do not decode&#8217; vectors differently than residue 0 or 1; if all vectors are marked
  11299. &#8217;do not decode&#8217;, no decode occurrs. However, if at least one vector is to be decoded, all
  11300. the vectors are decoded. We then request normal format 1 to decode a single vector
  11301. representing all output channels, rather than a vector for each channel. After decode,
  11302. deinterleave the vector into independent vectors, one for each output channel. That
  11303. is:
  11304. <!--l. 425--><p class="noindent" >
  11305. <ol class="enumerate1" >
  11306. <li
  11307. class="enumerate" id="x1-113002x1">If all vectors 0 through <span
  11308. class="cmti-12">ch</span>-1 are marked &#8217;do not decode&#8217;, allocate and clear a single
  11309. vector <span
  11310. class="cmtt-12">[v]</span>of length <span
  11311. class="cmti-12">ch*n </span>and skip step 2 below; proceed directly to the post-decode
  11312. step.
  11313. </li>
  11314. <li
  11315. class="enumerate" id="x1-113004x2">Rather than performing format 1 decode to produce <span
  11316. class="cmti-12">ch </span>vectors of length <span
  11317. class="cmti-12">n </span>each, call
  11318. format 1 decode to produce a single vector <span
  11319. class="cmtt-12">[v] </span>of length <span
  11320. class="cmti-12">ch*n</span>.
  11321. </li>
  11322. <li
  11323. class="enumerate" id="x1-113006x3">Post decode: Deinterleave the single vector <span
  11324. class="cmtt-12">[v] </span>returned by format 1 decode as
  11325. described above into <span
  11326. class="cmti-12">ch </span>independent vectors, one for each outputchannel, according
  11327. to:
  11328. <div class="fancyvrb" id="fancyvrb43">
  11329. <a
  11330. id="x1-113008r1"></a><span
  11331. class="cmr-6">1</span><span
  11332. class="cmtt-8">&#x00A0;</span><span
  11333. class="cmtt-8">&#x00A0;</span><span
  11334. class="cmtt-8">&#x00A0;</span><span
  11335. class="cmtt-8">&#x00A0;1)</span><span
  11336. class="cmtt-8">&#x00A0;iterate</span><span
  11337. class="cmtt-8">&#x00A0;[i]</span><span
  11338. class="cmtt-8">&#x00A0;over</span><span
  11339. class="cmtt-8">&#x00A0;the</span><span
  11340. class="cmtt-8">&#x00A0;range</span><span
  11341. class="cmtt-8">&#x00A0;0</span><span
  11342. class="cmtt-8">&#x00A0;...</span><span
  11343. class="cmtt-8">&#x00A0;[n]-1</span><span
  11344. class="cmtt-8">&#x00A0;{</span>
  11345. <br class="fancyvrb" /><a
  11346. id="x1-113010r2"></a><span
  11347. class="cmr-6">2</span><span
  11348. class="cmtt-8">&#x00A0;</span><span
  11349. class="cmtt-8">&#x00A0;</span>
  11350. <br class="fancyvrb" /><a
  11351. id="x1-113012r3"></a><span
  11352. class="cmr-6">3</span><span
  11353. class="cmtt-8">&#x00A0;</span><span
  11354. class="cmtt-8">&#x00A0;</span><span
  11355. class="cmtt-8">&#x00A0;</span><span
  11356. class="cmtt-8">&#x00A0;</span><span
  11357. class="cmtt-8">&#x00A0;</span><span
  11358. class="cmtt-8">&#x00A0;</span><span
  11359. class="cmtt-8">&#x00A0;</span><span
  11360. class="cmtt-8">&#x00A0;</span><span
  11361. class="cmtt-8">&#x00A0;2)</span><span
  11362. class="cmtt-8">&#x00A0;iterate</span><span
  11363. class="cmtt-8">&#x00A0;[j]</span><span
  11364. class="cmtt-8">&#x00A0;over</span><span
  11365. class="cmtt-8">&#x00A0;the</span><span
  11366. class="cmtt-8">&#x00A0;range</span><span
  11367. class="cmtt-8">&#x00A0;0</span><span
  11368. class="cmtt-8">&#x00A0;...</span><span
  11369. class="cmtt-8">&#x00A0;[ch]-1</span><span
  11370. class="cmtt-8">&#x00A0;{</span>
  11371. <br class="fancyvrb" /><a
  11372. id="x1-113014r4"></a><span
  11373. class="cmr-6">4</span><span
  11374. class="cmtt-8">&#x00A0;</span><span
  11375. class="cmtt-8">&#x00A0;</span>
  11376. <br class="fancyvrb" /><a
  11377. id="x1-113016r5"></a><span
  11378. class="cmr-6">5</span><span
  11379. class="cmtt-8">&#x00A0;</span><span
  11380. class="cmtt-8">&#x00A0;</span><span
  11381. class="cmtt-8">&#x00A0;</span><span
  11382. class="cmtt-8">&#x00A0;</span><span
  11383. class="cmtt-8">&#x00A0;</span><span
  11384. class="cmtt-8">&#x00A0;</span><span
  11385. class="cmtt-8">&#x00A0;</span><span
  11386. class="cmtt-8">&#x00A0;</span><span
  11387. class="cmtt-8">&#x00A0;</span><span
  11388. class="cmtt-8">&#x00A0;</span><span
  11389. class="cmtt-8">&#x00A0;</span><span
  11390. class="cmtt-8">&#x00A0;</span><span
  11391. class="cmtt-8">&#x00A0;</span><span
  11392. class="cmtt-8">&#x00A0;3)</span><span
  11393. class="cmtt-8">&#x00A0;output</span><span
  11394. class="cmtt-8">&#x00A0;vector</span><span
  11395. class="cmtt-8">&#x00A0;number</span><span
  11396. class="cmtt-8">&#x00A0;[j]</span><span
  11397. class="cmtt-8">&#x00A0;element</span><span
  11398. class="cmtt-8">&#x00A0;[i]</span><span
  11399. class="cmtt-8">&#x00A0;=</span><span
  11400. class="cmtt-8">&#x00A0;vector</span><span
  11401. class="cmtt-8">&#x00A0;[v]</span><span
  11402. class="cmtt-8">&#x00A0;element</span><span
  11403. class="cmtt-8">&#x00A0;([i]</span><span
  11404. class="cmtt-8">&#x00A0;*</span><span
  11405. class="cmtt-8">&#x00A0;[ch]</span><span
  11406. class="cmtt-8">&#x00A0;+</span><span
  11407. class="cmtt-8">&#x00A0;[j])</span>
  11408. <br class="fancyvrb" /><a
  11409. id="x1-113018r6"></a><span
  11410. class="cmr-6">6</span><span
  11411. class="cmtt-8">&#x00A0;</span><span
  11412. class="cmtt-8">&#x00A0;</span>
  11413. <br class="fancyvrb" /><a
  11414. id="x1-113020r7"></a><span
  11415. class="cmr-6">7</span><span
  11416. class="cmtt-8">&#x00A0;</span><span
  11417. class="cmtt-8">&#x00A0;</span><span
  11418. class="cmtt-8">&#x00A0;</span><span
  11419. class="cmtt-8">&#x00A0;</span><span
  11420. class="cmtt-8">&#x00A0;</span><span
  11421. class="cmtt-8">&#x00A0;</span><span
  11422. class="cmtt-8">&#x00A0;</span><span
  11423. class="cmtt-8">&#x00A0;</span><span
  11424. class="cmtt-8">&#x00A0;</span><span
  11425. class="cmtt-8">&#x00A0;</span><span
  11426. class="cmtt-8">&#x00A0;</span><span
  11427. class="cmtt-8">&#x00A0;}</span>
  11428. <br class="fancyvrb" /><a
  11429. id="x1-113022r8"></a><span
  11430. class="cmr-6">8</span><span
  11431. class="cmtt-8">&#x00A0;</span><span
  11432. class="cmtt-8">&#x00A0;</span><span
  11433. class="cmtt-8">&#x00A0;</span><span
  11434. class="cmtt-8">&#x00A0;</span><span
  11435. class="cmtt-8">&#x00A0;</span><span
  11436. class="cmtt-8">&#x00A0;</span><span
  11437. class="cmtt-8">&#x00A0;}</span>
  11438. <br class="fancyvrb" /><a
  11439. id="x1-113024r9"></a><span
  11440. class="cmr-6">9</span><span
  11441. class="cmtt-8">&#x00A0;</span><span
  11442. class="cmtt-8">&#x00A0;</span>
  11443. <br class="fancyvrb" /><a
  11444. id="x1-113026r10"></a><span
  11445. class="cmr-6">10</span><span
  11446. class="cmtt-8">&#x00A0;</span><span
  11447. class="cmtt-8">&#x00A0;</span><span
  11448. class="cmtt-8">&#x00A0;</span><span
  11449. class="cmtt-8">&#x00A0;4)</span><span
  11450. class="cmtt-8">&#x00A0;done</span>
  11451. </div>
  11452. </li></ol>
  11453. <h3 class="sectionHead"><span class="titlemark">9 </span> <a
  11454. id="x1-1140009"></a>Helper equations</h3>
  11455. <!--l. 6--><p class="noindent" >
  11456. <h4 class="subsectionHead"><span class="titlemark">9.1 </span> <a
  11457. id="x1-1150009.1"></a>Overview</h4>
  11458. <!--l. 8--><p class="noindent" >The equations below are used in multiple places by the Vorbis codec specification. Rather than
  11459. cluttering up the main specification documents, they are defined here and referenced where
  11460. appropriate.
  11461. <!--l. 13--><p class="noindent" >
  11462. <h4 class="subsectionHead"><span class="titlemark">9.2 </span> <a
  11463. id="x1-1160009.2"></a>Functions</h4>
  11464. <!--l. 15--><p class="noindent" >
  11465. <h5 class="subsubsectionHead"><span class="titlemark">9.2.1 </span> <a
  11466. id="x1-1170009.2.1"></a>ilog</h5>
  11467. <!--l. 17--><p class="noindent" >The &#8221;ilog(x)&#8221; function returns the position number (1 through n) of the highest set bit in the
  11468. two&#8217;s complement integer value <span
  11469. class="cmtt-12">[x]</span>. Values of <span
  11470. class="cmtt-12">[x] </span>less than zero are defined to return
  11471. zero.
  11472. <!--l. 20--><p class="noindent" >
  11473. <div class="fancyvrb" id="fancyvrb44">
  11474. <a
  11475. id="x1-117002r1"></a><span
  11476. class="cmr-6">1</span><span
  11477. class="cmtt-8">&#x00A0;</span><span
  11478. class="cmtt-8">&#x00A0;</span><span
  11479. class="cmtt-8">&#x00A0;</span><span
  11480. class="cmtt-8">&#x00A0;1)</span><span
  11481. class="cmtt-8">&#x00A0;[return_value]</span><span
  11482. class="cmtt-8">&#x00A0;=</span><span
  11483. class="cmtt-8">&#x00A0;0;</span>
  11484. <br class="fancyvrb" /><a
  11485. id="x1-117004r2"></a><span
  11486. class="cmr-6">2</span><span
  11487. class="cmtt-8">&#x00A0;</span><span
  11488. class="cmtt-8">&#x00A0;</span><span
  11489. class="cmtt-8">&#x00A0;</span><span
  11490. class="cmtt-8">&#x00A0;2)</span><span
  11491. class="cmtt-8">&#x00A0;if</span><span
  11492. class="cmtt-8">&#x00A0;(</span><span
  11493. class="cmtt-8">&#x00A0;[x]</span><span
  11494. class="cmtt-8">&#x00A0;is</span><span
  11495. class="cmtt-8">&#x00A0;greater</span><span
  11496. class="cmtt-8">&#x00A0;than</span><span
  11497. class="cmtt-8">&#x00A0;zero</span><span
  11498. class="cmtt-8">&#x00A0;)</span><span
  11499. class="cmtt-8">&#x00A0;{</span>
  11500. <br class="fancyvrb" /><a
  11501. id="x1-117006r3"></a><span
  11502. class="cmr-6">3</span><span
  11503. class="cmtt-8">&#x00A0;</span><span
  11504. class="cmtt-8">&#x00A0;</span>
  11505. <br class="fancyvrb" /><a
  11506. id="x1-117008r4"></a><span
  11507. class="cmr-6">4</span><span
  11508. class="cmtt-8">&#x00A0;</span><span
  11509. class="cmtt-8">&#x00A0;</span><span
  11510. class="cmtt-8">&#x00A0;</span><span
  11511. class="cmtt-8">&#x00A0;</span><span
  11512. class="cmtt-8">&#x00A0;</span><span
  11513. class="cmtt-8">&#x00A0;</span><span
  11514. class="cmtt-8">&#x00A0;</span><span
  11515. class="cmtt-8">&#x00A0;</span><span
  11516. class="cmtt-8">&#x00A0;3)</span><span
  11517. class="cmtt-8">&#x00A0;increment</span><span
  11518. class="cmtt-8">&#x00A0;[return_value];</span>
  11519. <br class="fancyvrb" /><a
  11520. id="x1-117010r5"></a><span
  11521. class="cmr-6">5</span><span
  11522. class="cmtt-8">&#x00A0;</span><span
  11523. class="cmtt-8">&#x00A0;</span><span
  11524. class="cmtt-8">&#x00A0;</span><span
  11525. class="cmtt-8">&#x00A0;</span><span
  11526. class="cmtt-8">&#x00A0;</span><span
  11527. class="cmtt-8">&#x00A0;</span><span
  11528. class="cmtt-8">&#x00A0;</span><span
  11529. class="cmtt-8">&#x00A0;</span><span
  11530. class="cmtt-8">&#x00A0;4)</span><span
  11531. class="cmtt-8">&#x00A0;logical</span><span
  11532. class="cmtt-8">&#x00A0;shift</span><span
  11533. class="cmtt-8">&#x00A0;[x]</span><span
  11534. class="cmtt-8">&#x00A0;one</span><span
  11535. class="cmtt-8">&#x00A0;bit</span><span
  11536. class="cmtt-8">&#x00A0;to</span><span
  11537. class="cmtt-8">&#x00A0;the</span><span
  11538. class="cmtt-8">&#x00A0;right,</span><span
  11539. class="cmtt-8">&#x00A0;padding</span><span
  11540. class="cmtt-8">&#x00A0;the</span><span
  11541. class="cmtt-8">&#x00A0;MSb</span><span
  11542. class="cmtt-8">&#x00A0;with</span><span
  11543. class="cmtt-8">&#x00A0;zero</span>
  11544. <br class="fancyvrb" /><a
  11545. id="x1-117012r6"></a><span
  11546. class="cmr-6">6</span><span
  11547. class="cmtt-8">&#x00A0;</span><span
  11548. class="cmtt-8">&#x00A0;</span><span
  11549. class="cmtt-8">&#x00A0;</span><span
  11550. class="cmtt-8">&#x00A0;</span><span
  11551. class="cmtt-8">&#x00A0;</span><span
  11552. class="cmtt-8">&#x00A0;</span><span
  11553. class="cmtt-8">&#x00A0;</span><span
  11554. class="cmtt-8">&#x00A0;</span><span
  11555. class="cmtt-8">&#x00A0;5)</span><span
  11556. class="cmtt-8">&#x00A0;repeat</span><span
  11557. class="cmtt-8">&#x00A0;at</span><span
  11558. class="cmtt-8">&#x00A0;step</span><span
  11559. class="cmtt-8">&#x00A0;2)</span>
  11560. <br class="fancyvrb" /><a
  11561. id="x1-117014r7"></a><span
  11562. class="cmr-6">7</span><span
  11563. class="cmtt-8">&#x00A0;</span><span
  11564. class="cmtt-8">&#x00A0;</span>
  11565. <br class="fancyvrb" /><a
  11566. id="x1-117016r8"></a><span
  11567. class="cmr-6">8</span><span
  11568. class="cmtt-8">&#x00A0;</span><span
  11569. class="cmtt-8">&#x00A0;</span><span
  11570. class="cmtt-8">&#x00A0;</span><span
  11571. class="cmtt-8">&#x00A0;</span><span
  11572. class="cmtt-8">&#x00A0;</span><span
  11573. class="cmtt-8">&#x00A0;</span><span
  11574. class="cmtt-8">&#x00A0;}</span>
  11575. <br class="fancyvrb" /><a
  11576. id="x1-117018r9"></a><span
  11577. class="cmr-6">9</span><span
  11578. class="cmtt-8">&#x00A0;</span><span
  11579. class="cmtt-8">&#x00A0;</span>
  11580. <br class="fancyvrb" /><a
  11581. id="x1-117020r10"></a><span
  11582. class="cmr-6">10</span><span
  11583. class="cmtt-8">&#x00A0;</span><span
  11584. class="cmtt-8">&#x00A0;</span><span
  11585. class="cmtt-8">&#x00A0;</span><span
  11586. class="cmtt-8">&#x00A0;</span><span
  11587. class="cmtt-8">&#x00A0;6)</span><span
  11588. class="cmtt-8">&#x00A0;done</span>
  11589. </div>
  11590. <!--l. 33--><p class="noindent" >Examples:
  11591. <ul class="itemize1">
  11592. <li class="itemize">ilog(0) = 0;
  11593. </li>
  11594. <li class="itemize">ilog(1) = 1;
  11595. </li>
  11596. <li class="itemize">ilog(2) = 2;
  11597. </li>
  11598. <li class="itemize">ilog(3) = 2;
  11599. </li>
  11600. <li class="itemize">ilog(4) = 3;
  11601. </li>
  11602. <li class="itemize">ilog(7) = 3;
  11603. </li>
  11604. <li class="itemize">ilog(negative number) = 0;</li></ul>
  11605. <!--l. 48--><p class="noindent" >
  11606. <h5 class="subsubsectionHead"><span class="titlemark">9.2.2 </span> <a
  11607. id="x1-1180009.2.2"></a>float32&#x02D9;unpack</h5>
  11608. <!--l. 50--><p class="noindent" >&#8221;float32&#x02D9;unpack(x)&#8221; is intended to translate the packed binary representation of a Vorbis
  11609. codebook float value into the representation used by the decoder for floating point numbers. For
  11610. purposes of this example, we will unpack a Vorbis float32 into a host-native floating point
  11611. number.
  11612. <!--l. 56--><p class="noindent" >
  11613. <div class="fancyvrb" id="fancyvrb45">
  11614. <a
  11615. id="x1-118002r1"></a><span
  11616. class="cmr-6">1</span><span
  11617. class="cmtt-8">&#x00A0;</span><span
  11618. class="cmtt-8">&#x00A0;</span><span
  11619. class="cmtt-8">&#x00A0;</span><span
  11620. class="cmtt-8">&#x00A0;1)</span><span
  11621. class="cmtt-8">&#x00A0;[mantissa]</span><span
  11622. class="cmtt-8">&#x00A0;=</span><span
  11623. class="cmtt-8">&#x00A0;[x]</span><span
  11624. class="cmtt-8">&#x00A0;bitwise</span><span
  11625. class="cmtt-8">&#x00A0;AND</span><span
  11626. class="cmtt-8">&#x00A0;0x1fffff</span><span
  11627. class="cmtt-8">&#x00A0;(unsigned</span><span
  11628. class="cmtt-8">&#x00A0;result)</span>
  11629. <br class="fancyvrb" /><a
  11630. id="x1-118004r2"></a><span
  11631. class="cmr-6">2</span><span
  11632. class="cmtt-8">&#x00A0;</span><span
  11633. class="cmtt-8">&#x00A0;</span><span
  11634. class="cmtt-8">&#x00A0;</span><span
  11635. class="cmtt-8">&#x00A0;2)</span><span
  11636. class="cmtt-8">&#x00A0;[sign]</span><span
  11637. class="cmtt-8">&#x00A0;=</span><span
  11638. class="cmtt-8">&#x00A0;[x]</span><span
  11639. class="cmtt-8">&#x00A0;bitwise</span><span
  11640. class="cmtt-8">&#x00A0;AND</span><span
  11641. class="cmtt-8">&#x00A0;0x80000000</span><span
  11642. class="cmtt-8">&#x00A0;(unsigned</span><span
  11643. class="cmtt-8">&#x00A0;result)</span>
  11644. <br class="fancyvrb" /><a
  11645. id="x1-118006r3"></a><span
  11646. class="cmr-6">3</span><span
  11647. class="cmtt-8">&#x00A0;</span><span
  11648. class="cmtt-8">&#x00A0;</span><span
  11649. class="cmtt-8">&#x00A0;</span><span
  11650. class="cmtt-8">&#x00A0;3)</span><span
  11651. class="cmtt-8">&#x00A0;[exponent]</span><span
  11652. class="cmtt-8">&#x00A0;=</span><span
  11653. class="cmtt-8">&#x00A0;(</span><span
  11654. class="cmtt-8">&#x00A0;[x]</span><span
  11655. class="cmtt-8">&#x00A0;bitwise</span><span
  11656. class="cmtt-8">&#x00A0;AND</span><span
  11657. class="cmtt-8">&#x00A0;0x7fe00000)</span><span
  11658. class="cmtt-8">&#x00A0;shifted</span><span
  11659. class="cmtt-8">&#x00A0;right</span><span
  11660. class="cmtt-8">&#x00A0;21</span><span
  11661. class="cmtt-8">&#x00A0;bits</span><span
  11662. class="cmtt-8">&#x00A0;(unsigned</span><span
  11663. class="cmtt-8">&#x00A0;result)</span>
  11664. <br class="fancyvrb" /><a
  11665. id="x1-118008r4"></a><span
  11666. class="cmr-6">4</span><span
  11667. class="cmtt-8">&#x00A0;</span><span
  11668. class="cmtt-8">&#x00A0;</span><span
  11669. class="cmtt-8">&#x00A0;</span><span
  11670. class="cmtt-8">&#x00A0;4)</span><span
  11671. class="cmtt-8">&#x00A0;if</span><span
  11672. class="cmtt-8">&#x00A0;(</span><span
  11673. class="cmtt-8">&#x00A0;[sign]</span><span
  11674. class="cmtt-8">&#x00A0;is</span><span
  11675. class="cmtt-8">&#x00A0;nonzero</span><span
  11676. class="cmtt-8">&#x00A0;)</span><span
  11677. class="cmtt-8">&#x00A0;then</span><span
  11678. class="cmtt-8">&#x00A0;negate</span><span
  11679. class="cmtt-8">&#x00A0;[mantissa]</span>
  11680. <br class="fancyvrb" /><a
  11681. id="x1-118010r5"></a><span
  11682. class="cmr-6">5</span><span
  11683. class="cmtt-8">&#x00A0;</span><span
  11684. class="cmtt-8">&#x00A0;</span><span
  11685. class="cmtt-8">&#x00A0;</span><span
  11686. class="cmtt-8">&#x00A0;5)</span><span
  11687. class="cmtt-8">&#x00A0;return</span><span
  11688. class="cmtt-8">&#x00A0;[mantissa]</span><span
  11689. class="cmtt-8">&#x00A0;*</span><span
  11690. class="cmtt-8">&#x00A0;(</span><span
  11691. class="cmtt-8">&#x00A0;2</span><span
  11692. class="cmtt-8">&#x00A0;^</span><span
  11693. class="cmtt-8">&#x00A0;(</span><span
  11694. class="cmtt-8">&#x00A0;[exponent]</span><span
  11695. class="cmtt-8">&#x00A0;-</span><span
  11696. class="cmtt-8">&#x00A0;788</span><span
  11697. class="cmtt-8">&#x00A0;)</span><span
  11698. class="cmtt-8">&#x00A0;)</span>
  11699. </div>
  11700. <!--l. 66--><p class="noindent" >
  11701. <h5 class="subsubsectionHead"><span class="titlemark">9.2.3 </span> <a
  11702. id="x1-1190009.2.3"></a>lookup1&#x02D9;values</h5>
  11703. <!--l. 68--><p class="noindent" >&#8221;lookup1&#x02D9;values(codebook&#x02D9;entries,codebook&#x02D9;dimensions)&#8221; is used to compute the correct length of
  11704. the value index for a codebook VQ lookup table of lookup type 1. The values on this list are
  11705. permuted to construct the VQ vector lookup table of size <span
  11706. class="cmtt-12">[codebook_entries]</span>.
  11707. <!--l. 74--><p class="noindent" >The return value for this function is defined to be &#8217;the greatest integer value for which
  11708. <span
  11709. class="cmtt-12">[return_value] </span>to the power of <span
  11710. class="cmtt-12">[codebook_dimensions] </span>is less than or equal to
  11711. <span
  11712. class="cmtt-12">[codebook_entries]</span>&#8217;.
  11713. <!--l. 81--><p class="noindent" >
  11714. <h5 class="subsubsectionHead"><span class="titlemark">9.2.4 </span> <a
  11715. id="x1-1200009.2.4"></a>low&#x02D9;neighbor</h5>
  11716. <!--l. 83--><p class="noindent" >&#8221;low&#x02D9;neighbor(v,x)&#8221; finds the position <span
  11717. class="cmtt-12">n </span>in vector <span
  11718. class="cmtt-12">[v] </span>of the greatest value scalar element for
  11719. which <span
  11720. class="cmtt-12">n </span>is less than <span
  11721. class="cmtt-12">[x] </span>and vector <span
  11722. class="cmtt-12">[v] </span>element <span
  11723. class="cmtt-12">n </span>is less than vector <span
  11724. class="cmtt-12">[v] </span>element
  11725. <span
  11726. class="cmtt-12">[x]</span>.
  11727. <!--l. 88--><p class="noindent" >
  11728. <h5 class="subsubsectionHead"><span class="titlemark">9.2.5 </span> <a
  11729. id="x1-1210009.2.5"></a>high&#x02D9;neighbor</h5>
  11730. <!--l. 90--><p class="noindent" >&#8221;high&#x02D9;neighbor(v,x)&#8221; finds the position <span
  11731. class="cmtt-12">n </span>in vector [v] of the lowest value scalar element for
  11732. which <span
  11733. class="cmtt-12">n </span>is less than <span
  11734. class="cmtt-12">[x] </span>and vector <span
  11735. class="cmtt-12">[v] </span>element <span
  11736. class="cmtt-12">n </span>is greater than vector <span
  11737. class="cmtt-12">[v] </span>element
  11738. <span
  11739. class="cmtt-12">[x]</span>.
  11740. <!--l. 97--><p class="noindent" >
  11741. <h5 class="subsubsectionHead"><span class="titlemark">9.2.6 </span> <a
  11742. id="x1-1220009.2.6"></a>render&#x02D9;point</h5>
  11743. <!--l. 99--><p class="noindent" >&#8221;render&#x02D9;point(x0,y0,x1,y1,X)&#8221; is used to find the Y value at point X along the line specified by
  11744. x0, x1, y0 and y1. This function uses an integer algorithm to solve for the point directly without
  11745. calculating intervening values along the line.
  11746. <!--l. 104--><p class="noindent" >
  11747. <div class="fancyvrb" id="fancyvrb46">
  11748. <a
  11749. id="x1-122002r1"></a><span
  11750. class="cmr-6">1</span><span
  11751. class="cmtt-8">&#x00A0;</span><span
  11752. class="cmtt-8">&#x00A0;</span><span
  11753. class="cmtt-8">&#x00A0;</span><span
  11754. class="cmtt-8">&#x00A0;1)</span><span
  11755. class="cmtt-8">&#x00A0;</span><span
  11756. class="cmtt-8">&#x00A0;[dy]</span><span
  11757. class="cmtt-8">&#x00A0;=</span><span
  11758. class="cmtt-8">&#x00A0;[y1]</span><span
  11759. class="cmtt-8">&#x00A0;-</span><span
  11760. class="cmtt-8">&#x00A0;[y0]</span>
  11761. <br class="fancyvrb" /><a
  11762. id="x1-122004r2"></a><span
  11763. class="cmr-6">2</span><span
  11764. class="cmtt-8">&#x00A0;</span><span
  11765. class="cmtt-8">&#x00A0;</span><span
  11766. class="cmtt-8">&#x00A0;</span><span
  11767. class="cmtt-8">&#x00A0;2)</span><span
  11768. class="cmtt-8">&#x00A0;[adx]</span><span
  11769. class="cmtt-8">&#x00A0;=</span><span
  11770. class="cmtt-8">&#x00A0;[x1]</span><span
  11771. class="cmtt-8">&#x00A0;-</span><span
  11772. class="cmtt-8">&#x00A0;[x0]</span>
  11773. <br class="fancyvrb" /><a
  11774. id="x1-122006r3"></a><span
  11775. class="cmr-6">3</span><span
  11776. class="cmtt-8">&#x00A0;</span><span
  11777. class="cmtt-8">&#x00A0;</span><span
  11778. class="cmtt-8">&#x00A0;</span><span
  11779. class="cmtt-8">&#x00A0;3)</span><span
  11780. class="cmtt-8">&#x00A0;[ady]</span><span
  11781. class="cmtt-8">&#x00A0;=</span><span
  11782. class="cmtt-8">&#x00A0;absolute</span><span
  11783. class="cmtt-8">&#x00A0;value</span><span
  11784. class="cmtt-8">&#x00A0;of</span><span
  11785. class="cmtt-8">&#x00A0;[dy]</span>
  11786. <br class="fancyvrb" /><a
  11787. id="x1-122008r4"></a><span
  11788. class="cmr-6">4</span><span
  11789. class="cmtt-8">&#x00A0;</span><span
  11790. class="cmtt-8">&#x00A0;</span><span
  11791. class="cmtt-8">&#x00A0;</span><span
  11792. class="cmtt-8">&#x00A0;4)</span><span
  11793. class="cmtt-8">&#x00A0;[err]</span><span
  11794. class="cmtt-8">&#x00A0;=</span><span
  11795. class="cmtt-8">&#x00A0;[ady]</span><span
  11796. class="cmtt-8">&#x00A0;*</span><span
  11797. class="cmtt-8">&#x00A0;([X]</span><span
  11798. class="cmtt-8">&#x00A0;-</span><span
  11799. class="cmtt-8">&#x00A0;[x0])</span>
  11800. <br class="fancyvrb" /><a
  11801. id="x1-122010r5"></a><span
  11802. class="cmr-6">5</span><span
  11803. class="cmtt-8">&#x00A0;</span><span
  11804. class="cmtt-8">&#x00A0;</span><span
  11805. class="cmtt-8">&#x00A0;</span><span
  11806. class="cmtt-8">&#x00A0;5)</span><span
  11807. class="cmtt-8">&#x00A0;[off]</span><span
  11808. class="cmtt-8">&#x00A0;=</span><span
  11809. class="cmtt-8">&#x00A0;[err]</span><span
  11810. class="cmtt-8">&#x00A0;/</span><span
  11811. class="cmtt-8">&#x00A0;[adx]</span><span
  11812. class="cmtt-8">&#x00A0;using</span><span
  11813. class="cmtt-8">&#x00A0;integer</span><span
  11814. class="cmtt-8">&#x00A0;division</span>
  11815. <br class="fancyvrb" /><a
  11816. id="x1-122012r6"></a><span
  11817. class="cmr-6">6</span><span
  11818. class="cmtt-8">&#x00A0;</span><span
  11819. class="cmtt-8">&#x00A0;</span><span
  11820. class="cmtt-8">&#x00A0;</span><span
  11821. class="cmtt-8">&#x00A0;6)</span><span
  11822. class="cmtt-8">&#x00A0;if</span><span
  11823. class="cmtt-8">&#x00A0;(</span><span
  11824. class="cmtt-8">&#x00A0;[dy]</span><span
  11825. class="cmtt-8">&#x00A0;is</span><span
  11826. class="cmtt-8">&#x00A0;less</span><span
  11827. class="cmtt-8">&#x00A0;than</span><span
  11828. class="cmtt-8">&#x00A0;zero</span><span
  11829. class="cmtt-8">&#x00A0;)</span><span
  11830. class="cmtt-8">&#x00A0;{</span>
  11831. <br class="fancyvrb" /><a
  11832. id="x1-122014r7"></a><span
  11833. class="cmr-6">7</span><span
  11834. class="cmtt-8">&#x00A0;</span><span
  11835. class="cmtt-8">&#x00A0;</span>
  11836. <br class="fancyvrb" /><a
  11837. id="x1-122016r8"></a><span
  11838. class="cmr-6">8</span><span
  11839. class="cmtt-8">&#x00A0;</span><span
  11840. class="cmtt-8">&#x00A0;</span><span
  11841. class="cmtt-8">&#x00A0;</span><span
  11842. class="cmtt-8">&#x00A0;</span><span
  11843. class="cmtt-8">&#x00A0;</span><span
  11844. class="cmtt-8">&#x00A0;</span><span
  11845. class="cmtt-8">&#x00A0;</span><span
  11846. class="cmtt-8">&#x00A0;</span><span
  11847. class="cmtt-8">&#x00A0;7)</span><span
  11848. class="cmtt-8">&#x00A0;[Y]</span><span
  11849. class="cmtt-8">&#x00A0;=</span><span
  11850. class="cmtt-8">&#x00A0;[y0]</span><span
  11851. class="cmtt-8">&#x00A0;-</span><span
  11852. class="cmtt-8">&#x00A0;[off]</span>
  11853. <br class="fancyvrb" /><a
  11854. id="x1-122018r9"></a><span
  11855. class="cmr-6">9</span><span
  11856. class="cmtt-8">&#x00A0;</span><span
  11857. class="cmtt-8">&#x00A0;</span>
  11858. <br class="fancyvrb" /><a
  11859. id="x1-122020r10"></a><span
  11860. class="cmr-6">10</span><span
  11861. class="cmtt-8">&#x00A0;</span><span
  11862. class="cmtt-8">&#x00A0;</span><span
  11863. class="cmtt-8">&#x00A0;</span><span
  11864. class="cmtt-8">&#x00A0;</span><span
  11865. class="cmtt-8">&#x00A0;</span><span
  11866. class="cmtt-8">&#x00A0;</span><span
  11867. class="cmtt-8">&#x00A0;}</span><span
  11868. class="cmtt-8">&#x00A0;else</span><span
  11869. class="cmtt-8">&#x00A0;{</span>
  11870. <br class="fancyvrb" /><a
  11871. id="x1-122022r11"></a><span
  11872. class="cmr-6">11</span><span
  11873. class="cmtt-8">&#x00A0;</span><span
  11874. class="cmtt-8">&#x00A0;</span>
  11875. <br class="fancyvrb" /><a
  11876. id="x1-122024r12"></a><span
  11877. class="cmr-6">12</span><span
  11878. class="cmtt-8">&#x00A0;</span><span
  11879. class="cmtt-8">&#x00A0;</span><span
  11880. class="cmtt-8">&#x00A0;</span><span
  11881. class="cmtt-8">&#x00A0;</span><span
  11882. class="cmtt-8">&#x00A0;</span><span
  11883. class="cmtt-8">&#x00A0;</span><span
  11884. class="cmtt-8">&#x00A0;</span><span
  11885. class="cmtt-8">&#x00A0;</span><span
  11886. class="cmtt-8">&#x00A0;8)</span><span
  11887. class="cmtt-8">&#x00A0;[Y]</span><span
  11888. class="cmtt-8">&#x00A0;=</span><span
  11889. class="cmtt-8">&#x00A0;[y0]</span><span
  11890. class="cmtt-8">&#x00A0;+</span><span
  11891. class="cmtt-8">&#x00A0;[off]</span>
  11892. <br class="fancyvrb" /><a
  11893. id="x1-122026r13"></a><span
  11894. class="cmr-6">13</span><span
  11895. class="cmtt-8">&#x00A0;</span><span
  11896. class="cmtt-8">&#x00A0;</span>
  11897. <br class="fancyvrb" /><a
  11898. id="x1-122028r14"></a><span
  11899. class="cmr-6">14</span><span
  11900. class="cmtt-8">&#x00A0;</span><span
  11901. class="cmtt-8">&#x00A0;</span><span
  11902. class="cmtt-8">&#x00A0;</span><span
  11903. class="cmtt-8">&#x00A0;</span><span
  11904. class="cmtt-8">&#x00A0;</span><span
  11905. class="cmtt-8">&#x00A0;</span><span
  11906. class="cmtt-8">&#x00A0;}</span>
  11907. <br class="fancyvrb" /><a
  11908. id="x1-122030r15"></a><span
  11909. class="cmr-6">15</span><span
  11910. class="cmtt-8">&#x00A0;</span><span
  11911. class="cmtt-8">&#x00A0;</span>
  11912. <br class="fancyvrb" /><a
  11913. id="x1-122032r16"></a><span
  11914. class="cmr-6">16</span><span
  11915. class="cmtt-8">&#x00A0;</span><span
  11916. class="cmtt-8">&#x00A0;</span><span
  11917. class="cmtt-8">&#x00A0;</span><span
  11918. class="cmtt-8">&#x00A0;9)</span><span
  11919. class="cmtt-8">&#x00A0;done</span>
  11920. </div>
  11921. <!--l. 125--><p class="noindent" >
  11922. <h5 class="subsubsectionHead"><span class="titlemark">9.2.7 </span> <a
  11923. id="x1-1230009.2.7"></a>render&#x02D9;line</h5>
  11924. <!--l. 127--><p class="noindent" >Floor decode type one uses the integer line drawing algorithm of &#8221;render&#x02D9;line(x0, y0, x1, y1, v)&#8221;
  11925. to construct an integer floor curve for contiguous piecewise line segments. Note that it has not
  11926. been relevant elsewhere, but here we must define integer division as rounding division of both
  11927. positive and negative numbers toward zero.
  11928. <!--l. 134--><p class="noindent" >
  11929. <div class="fancyvrb" id="fancyvrb47">
  11930. <a
  11931. id="x1-123002r1"></a><span
  11932. class="cmr-6">1</span><span
  11933. class="cmtt-8">&#x00A0;</span><span
  11934. class="cmtt-8">&#x00A0;</span><span
  11935. class="cmtt-8">&#x00A0;</span><span
  11936. class="cmtt-8">&#x00A0;1)</span><span
  11937. class="cmtt-8">&#x00A0;</span><span
  11938. class="cmtt-8">&#x00A0;</span><span
  11939. class="cmtt-8">&#x00A0;[dy]</span><span
  11940. class="cmtt-8">&#x00A0;=</span><span
  11941. class="cmtt-8">&#x00A0;[y1]</span><span
  11942. class="cmtt-8">&#x00A0;-</span><span
  11943. class="cmtt-8">&#x00A0;[y0]</span>
  11944. <br class="fancyvrb" /><a
  11945. id="x1-123004r2"></a><span
  11946. class="cmr-6">2</span><span
  11947. class="cmtt-8">&#x00A0;</span><span
  11948. class="cmtt-8">&#x00A0;</span><span
  11949. class="cmtt-8">&#x00A0;</span><span
  11950. class="cmtt-8">&#x00A0;2)</span><span
  11951. class="cmtt-8">&#x00A0;</span><span
  11952. class="cmtt-8">&#x00A0;[adx]</span><span
  11953. class="cmtt-8">&#x00A0;=</span><span
  11954. class="cmtt-8">&#x00A0;[x1]</span><span
  11955. class="cmtt-8">&#x00A0;-</span><span
  11956. class="cmtt-8">&#x00A0;[x0]</span>
  11957. <br class="fancyvrb" /><a
  11958. id="x1-123006r3"></a><span
  11959. class="cmr-6">3</span><span
  11960. class="cmtt-8">&#x00A0;</span><span
  11961. class="cmtt-8">&#x00A0;</span><span
  11962. class="cmtt-8">&#x00A0;</span><span
  11963. class="cmtt-8">&#x00A0;3)</span><span
  11964. class="cmtt-8">&#x00A0;</span><span
  11965. class="cmtt-8">&#x00A0;[ady]</span><span
  11966. class="cmtt-8">&#x00A0;=</span><span
  11967. class="cmtt-8">&#x00A0;absolute</span><span
  11968. class="cmtt-8">&#x00A0;value</span><span
  11969. class="cmtt-8">&#x00A0;of</span><span
  11970. class="cmtt-8">&#x00A0;[dy]</span>
  11971. <br class="fancyvrb" /><a
  11972. id="x1-123008r4"></a><span
  11973. class="cmr-6">4</span><span
  11974. class="cmtt-8">&#x00A0;</span><span
  11975. class="cmtt-8">&#x00A0;</span><span
  11976. class="cmtt-8">&#x00A0;</span><span
  11977. class="cmtt-8">&#x00A0;4)</span><span
  11978. class="cmtt-8">&#x00A0;[base]</span><span
  11979. class="cmtt-8">&#x00A0;=</span><span
  11980. class="cmtt-8">&#x00A0;[dy]</span><span
  11981. class="cmtt-8">&#x00A0;/</span><span
  11982. class="cmtt-8">&#x00A0;[adx]</span><span
  11983. class="cmtt-8">&#x00A0;using</span><span
  11984. class="cmtt-8">&#x00A0;integer</span><span
  11985. class="cmtt-8">&#x00A0;division</span>
  11986. <br class="fancyvrb" /><a
  11987. id="x1-123010r5"></a><span
  11988. class="cmr-6">5</span><span
  11989. class="cmtt-8">&#x00A0;</span><span
  11990. class="cmtt-8">&#x00A0;</span><span
  11991. class="cmtt-8">&#x00A0;</span><span
  11992. class="cmtt-8">&#x00A0;5)</span><span
  11993. class="cmtt-8">&#x00A0;</span><span
  11994. class="cmtt-8">&#x00A0;</span><span
  11995. class="cmtt-8">&#x00A0;</span><span
  11996. class="cmtt-8">&#x00A0;[x]</span><span
  11997. class="cmtt-8">&#x00A0;=</span><span
  11998. class="cmtt-8">&#x00A0;[x0]</span>
  11999. <br class="fancyvrb" /><a
  12000. id="x1-123012r6"></a><span
  12001. class="cmr-6">6</span><span
  12002. class="cmtt-8">&#x00A0;</span><span
  12003. class="cmtt-8">&#x00A0;</span><span
  12004. class="cmtt-8">&#x00A0;</span><span
  12005. class="cmtt-8">&#x00A0;6)</span><span
  12006. class="cmtt-8">&#x00A0;</span><span
  12007. class="cmtt-8">&#x00A0;</span><span
  12008. class="cmtt-8">&#x00A0;</span><span
  12009. class="cmtt-8">&#x00A0;[y]</span><span
  12010. class="cmtt-8">&#x00A0;=</span><span
  12011. class="cmtt-8">&#x00A0;[y0]</span>
  12012. <br class="fancyvrb" /><a
  12013. id="x1-123014r7"></a><span
  12014. class="cmr-6">7</span><span
  12015. class="cmtt-8">&#x00A0;</span><span
  12016. class="cmtt-8">&#x00A0;</span><span
  12017. class="cmtt-8">&#x00A0;</span><span
  12018. class="cmtt-8">&#x00A0;7)</span><span
  12019. class="cmtt-8">&#x00A0;</span><span
  12020. class="cmtt-8">&#x00A0;[err]</span><span
  12021. class="cmtt-8">&#x00A0;=</span><span
  12022. class="cmtt-8">&#x00A0;0</span>
  12023. <br class="fancyvrb" /><a
  12024. id="x1-123016r8"></a><span
  12025. class="cmr-6">8</span><span
  12026. class="cmtt-8">&#x00A0;</span><span
  12027. class="cmtt-8">&#x00A0;</span>
  12028. <br class="fancyvrb" /><a
  12029. id="x1-123018r9"></a><span
  12030. class="cmr-6">9</span><span
  12031. class="cmtt-8">&#x00A0;</span><span
  12032. class="cmtt-8">&#x00A0;</span><span
  12033. class="cmtt-8">&#x00A0;</span><span
  12034. class="cmtt-8">&#x00A0;8)</span><span
  12035. class="cmtt-8">&#x00A0;if</span><span
  12036. class="cmtt-8">&#x00A0;(</span><span
  12037. class="cmtt-8">&#x00A0;[dy]</span><span
  12038. class="cmtt-8">&#x00A0;is</span><span
  12039. class="cmtt-8">&#x00A0;less</span><span
  12040. class="cmtt-8">&#x00A0;than</span><span
  12041. class="cmtt-8">&#x00A0;0</span><span
  12042. class="cmtt-8">&#x00A0;)</span><span
  12043. class="cmtt-8">&#x00A0;{</span>
  12044. <br class="fancyvrb" /><a
  12045. id="x1-123020r10"></a><span
  12046. class="cmr-6">10</span><span
  12047. class="cmtt-8">&#x00A0;</span><span
  12048. class="cmtt-8">&#x00A0;</span>
  12049. <br class="fancyvrb" /><a
  12050. id="x1-123022r11"></a><span
  12051. class="cmr-6">11</span><span
  12052. class="cmtt-8">&#x00A0;</span><span
  12053. class="cmtt-8">&#x00A0;</span><span
  12054. class="cmtt-8">&#x00A0;</span><span
  12055. class="cmtt-8">&#x00A0;</span><span
  12056. class="cmtt-8">&#x00A0;</span><span
  12057. class="cmtt-8">&#x00A0;</span><span
  12058. class="cmtt-8">&#x00A0;</span><span
  12059. class="cmtt-8">&#x00A0;</span><span
  12060. class="cmtt-8">&#x00A0;</span><span
  12061. class="cmtt-8">&#x00A0;9)</span><span
  12062. class="cmtt-8">&#x00A0;[sy]</span><span
  12063. class="cmtt-8">&#x00A0;=</span><span
  12064. class="cmtt-8">&#x00A0;[base]</span><span
  12065. class="cmtt-8">&#x00A0;-</span><span
  12066. class="cmtt-8">&#x00A0;1</span>
  12067. <br class="fancyvrb" /><a
  12068. id="x1-123024r12"></a><span
  12069. class="cmr-6">12</span><span
  12070. class="cmtt-8">&#x00A0;</span><span
  12071. class="cmtt-8">&#x00A0;</span>
  12072. <br class="fancyvrb" /><a
  12073. id="x1-123026r13"></a><span
  12074. class="cmr-6">13</span><span
  12075. class="cmtt-8">&#x00A0;</span><span
  12076. class="cmtt-8">&#x00A0;</span><span
  12077. class="cmtt-8">&#x00A0;</span><span
  12078. class="cmtt-8">&#x00A0;</span><span
  12079. class="cmtt-8">&#x00A0;</span><span
  12080. class="cmtt-8">&#x00A0;</span><span
  12081. class="cmtt-8">&#x00A0;}</span><span
  12082. class="cmtt-8">&#x00A0;else</span><span
  12083. class="cmtt-8">&#x00A0;{</span>
  12084. <br class="fancyvrb" /><a
  12085. id="x1-123028r14"></a><span
  12086. class="cmr-6">14</span><span
  12087. class="cmtt-8">&#x00A0;</span><span
  12088. class="cmtt-8">&#x00A0;</span>
  12089. <br class="fancyvrb" /><a
  12090. id="x1-123030r15"></a><span
  12091. class="cmr-6">15</span><span
  12092. class="cmtt-8">&#x00A0;</span><span
  12093. class="cmtt-8">&#x00A0;</span><span
  12094. class="cmtt-8">&#x00A0;</span><span
  12095. class="cmtt-8">&#x00A0;</span><span
  12096. class="cmtt-8">&#x00A0;</span><span
  12097. class="cmtt-8">&#x00A0;</span><span
  12098. class="cmtt-8">&#x00A0;</span><span
  12099. class="cmtt-8">&#x00A0;</span><span
  12100. class="cmtt-8">&#x00A0;10)</span><span
  12101. class="cmtt-8">&#x00A0;[sy]</span><span
  12102. class="cmtt-8">&#x00A0;=</span><span
  12103. class="cmtt-8">&#x00A0;[base]</span><span
  12104. class="cmtt-8">&#x00A0;+</span><span
  12105. class="cmtt-8">&#x00A0;1</span>
  12106. <br class="fancyvrb" /><a
  12107. id="x1-123032r16"></a><span
  12108. class="cmr-6">16</span><span
  12109. class="cmtt-8">&#x00A0;</span><span
  12110. class="cmtt-8">&#x00A0;</span>
  12111. <br class="fancyvrb" /><a
  12112. id="x1-123034r17"></a><span
  12113. class="cmr-6">17</span><span
  12114. class="cmtt-8">&#x00A0;</span><span
  12115. class="cmtt-8">&#x00A0;</span><span
  12116. class="cmtt-8">&#x00A0;</span><span
  12117. class="cmtt-8">&#x00A0;</span><span
  12118. class="cmtt-8">&#x00A0;</span><span
  12119. class="cmtt-8">&#x00A0;</span><span
  12120. class="cmtt-8">&#x00A0;}</span>
  12121. <br class="fancyvrb" /><a
  12122. id="x1-123036r18"></a><span
  12123. class="cmr-6">18</span><span
  12124. class="cmtt-8">&#x00A0;</span><span
  12125. class="cmtt-8">&#x00A0;</span>
  12126. <br class="fancyvrb" /><a
  12127. id="x1-123038r19"></a><span
  12128. class="cmr-6">19</span><span
  12129. class="cmtt-8">&#x00A0;</span><span
  12130. class="cmtt-8">&#x00A0;</span><span
  12131. class="cmtt-8">&#x00A0;11)</span><span
  12132. class="cmtt-8">&#x00A0;[ady]</span><span
  12133. class="cmtt-8">&#x00A0;=</span><span
  12134. class="cmtt-8">&#x00A0;[ady]</span><span
  12135. class="cmtt-8">&#x00A0;-</span><span
  12136. class="cmtt-8">&#x00A0;(absolute</span><span
  12137. class="cmtt-8">&#x00A0;value</span><span
  12138. class="cmtt-8">&#x00A0;of</span><span
  12139. class="cmtt-8">&#x00A0;[base])</span><span
  12140. class="cmtt-8">&#x00A0;*</span><span
  12141. class="cmtt-8">&#x00A0;[adx]</span>
  12142. <br class="fancyvrb" /><a
  12143. id="x1-123040r20"></a><span
  12144. class="cmr-6">20</span><span
  12145. class="cmtt-8">&#x00A0;</span><span
  12146. class="cmtt-8">&#x00A0;</span><span
  12147. class="cmtt-8">&#x00A0;12)</span><span
  12148. class="cmtt-8">&#x00A0;vector</span><span
  12149. class="cmtt-8">&#x00A0;[v]</span><span
  12150. class="cmtt-8">&#x00A0;element</span><span
  12151. class="cmtt-8">&#x00A0;[x]</span><span
  12152. class="cmtt-8">&#x00A0;=</span><span
  12153. class="cmtt-8">&#x00A0;[y]</span>
  12154. <br class="fancyvrb" /><a
  12155. id="x1-123042r21"></a><span
  12156. class="cmr-6">21</span><span
  12157. class="cmtt-8">&#x00A0;</span><span
  12158. class="cmtt-8">&#x00A0;</span>
  12159. <br class="fancyvrb" /><a
  12160. id="x1-123044r22"></a><span
  12161. class="cmr-6">22</span><span
  12162. class="cmtt-8">&#x00A0;</span><span
  12163. class="cmtt-8">&#x00A0;</span><span
  12164. class="cmtt-8">&#x00A0;13)</span><span
  12165. class="cmtt-8">&#x00A0;iterate</span><span
  12166. class="cmtt-8">&#x00A0;[x]</span><span
  12167. class="cmtt-8">&#x00A0;over</span><span
  12168. class="cmtt-8">&#x00A0;the</span><span
  12169. class="cmtt-8">&#x00A0;range</span><span
  12170. class="cmtt-8">&#x00A0;[x0]+1</span><span
  12171. class="cmtt-8">&#x00A0;...</span><span
  12172. class="cmtt-8">&#x00A0;[x1]-1</span><span
  12173. class="cmtt-8">&#x00A0;{</span>
  12174. <br class="fancyvrb" /><a
  12175. id="x1-123046r23"></a><span
  12176. class="cmr-6">23</span><span
  12177. class="cmtt-8">&#x00A0;</span><span
  12178. class="cmtt-8">&#x00A0;</span>
  12179. <br class="fancyvrb" /><a
  12180. id="x1-123048r24"></a><span
  12181. class="cmr-6">24</span><span
  12182. class="cmtt-8">&#x00A0;</span><span
  12183. class="cmtt-8">&#x00A0;</span><span
  12184. class="cmtt-8">&#x00A0;</span><span
  12185. class="cmtt-8">&#x00A0;</span><span
  12186. class="cmtt-8">&#x00A0;</span><span
  12187. class="cmtt-8">&#x00A0;</span><span
  12188. class="cmtt-8">&#x00A0;</span><span
  12189. class="cmtt-8">&#x00A0;</span><span
  12190. class="cmtt-8">&#x00A0;14)</span><span
  12191. class="cmtt-8">&#x00A0;[err]</span><span
  12192. class="cmtt-8">&#x00A0;=</span><span
  12193. class="cmtt-8">&#x00A0;[err]</span><span
  12194. class="cmtt-8">&#x00A0;+</span><span
  12195. class="cmtt-8">&#x00A0;[ady];</span>
  12196. <br class="fancyvrb" /><a
  12197. id="x1-123050r25"></a><span
  12198. class="cmr-6">25</span><span
  12199. class="cmtt-8">&#x00A0;</span><span
  12200. class="cmtt-8">&#x00A0;</span><span
  12201. class="cmtt-8">&#x00A0;</span><span
  12202. class="cmtt-8">&#x00A0;</span><span
  12203. class="cmtt-8">&#x00A0;</span><span
  12204. class="cmtt-8">&#x00A0;</span><span
  12205. class="cmtt-8">&#x00A0;</span><span
  12206. class="cmtt-8">&#x00A0;</span><span
  12207. class="cmtt-8">&#x00A0;15)</span><span
  12208. class="cmtt-8">&#x00A0;if</span><span
  12209. class="cmtt-8">&#x00A0;(</span><span
  12210. class="cmtt-8">&#x00A0;[err]</span><span
  12211. class="cmtt-8">&#x00A0;&#x003E;=</span><span
  12212. class="cmtt-8">&#x00A0;[adx]</span><span
  12213. class="cmtt-8">&#x00A0;)</span><span
  12214. class="cmtt-8">&#x00A0;{</span>
  12215. <br class="fancyvrb" /><a
  12216. id="x1-123052r26"></a><span
  12217. class="cmr-6">26</span><span
  12218. class="cmtt-8">&#x00A0;</span><span
  12219. class="cmtt-8">&#x00A0;</span>
  12220. <br class="fancyvrb" /><a
  12221. id="x1-123054r27"></a><span
  12222. class="cmr-6">27</span><span
  12223. class="cmtt-8">&#x00A0;</span><span
  12224. class="cmtt-8">&#x00A0;</span><span
  12225. class="cmtt-8">&#x00A0;</span><span
  12226. class="cmtt-8">&#x00A0;</span><span
  12227. class="cmtt-8">&#x00A0;</span><span
  12228. class="cmtt-8">&#x00A0;</span><span
  12229. class="cmtt-8">&#x00A0;</span><span
  12230. class="cmtt-8">&#x00A0;</span><span
  12231. class="cmtt-8">&#x00A0;</span><span
  12232. class="cmtt-8">&#x00A0;</span><span
  12233. class="cmtt-8">&#x00A0;</span><span
  12234. class="cmtt-8">&#x00A0;</span><span
  12235. class="cmtt-8">&#x00A0;</span><span
  12236. class="cmtt-8">&#x00A0;</span><span
  12237. class="cmtt-8">&#x00A0;16)</span><span
  12238. class="cmtt-8">&#x00A0;[err]</span><span
  12239. class="cmtt-8">&#x00A0;=</span><span
  12240. class="cmtt-8">&#x00A0;[err]</span><span
  12241. class="cmtt-8">&#x00A0;-</span><span
  12242. class="cmtt-8">&#x00A0;[adx]</span>
  12243. <br class="fancyvrb" /><a
  12244. id="x1-123056r28"></a><span
  12245. class="cmr-6">28</span><span
  12246. class="cmtt-8">&#x00A0;</span><span
  12247. class="cmtt-8">&#x00A0;</span><span
  12248. class="cmtt-8">&#x00A0;</span><span
  12249. class="cmtt-8">&#x00A0;</span><span
  12250. class="cmtt-8">&#x00A0;</span><span
  12251. class="cmtt-8">&#x00A0;</span><span
  12252. class="cmtt-8">&#x00A0;</span><span
  12253. class="cmtt-8">&#x00A0;</span><span
  12254. class="cmtt-8">&#x00A0;</span><span
  12255. class="cmtt-8">&#x00A0;</span><span
  12256. class="cmtt-8">&#x00A0;</span><span
  12257. class="cmtt-8">&#x00A0;</span><span
  12258. class="cmtt-8">&#x00A0;</span><span
  12259. class="cmtt-8">&#x00A0;</span><span
  12260. class="cmtt-8">&#x00A0;17)</span><span
  12261. class="cmtt-8">&#x00A0;</span><span
  12262. class="cmtt-8">&#x00A0;</span><span
  12263. class="cmtt-8">&#x00A0;[y]</span><span
  12264. class="cmtt-8">&#x00A0;=</span><span
  12265. class="cmtt-8">&#x00A0;[y]</span><span
  12266. class="cmtt-8">&#x00A0;+</span><span
  12267. class="cmtt-8">&#x00A0;[sy]</span>
  12268. <br class="fancyvrb" /><a
  12269. id="x1-123058r29"></a><span
  12270. class="cmr-6">29</span><span
  12271. class="cmtt-8">&#x00A0;</span><span
  12272. class="cmtt-8">&#x00A0;</span>
  12273. <br class="fancyvrb" /><a
  12274. id="x1-123060r30"></a><span
  12275. class="cmr-6">30</span><span
  12276. class="cmtt-8">&#x00A0;</span><span
  12277. class="cmtt-8">&#x00A0;</span><span
  12278. class="cmtt-8">&#x00A0;</span><span
  12279. class="cmtt-8">&#x00A0;</span><span
  12280. class="cmtt-8">&#x00A0;</span><span
  12281. class="cmtt-8">&#x00A0;</span><span
  12282. class="cmtt-8">&#x00A0;</span><span
  12283. class="cmtt-8">&#x00A0;</span><span
  12284. class="cmtt-8">&#x00A0;</span><span
  12285. class="cmtt-8">&#x00A0;</span><span
  12286. class="cmtt-8">&#x00A0;</span><span
  12287. class="cmtt-8">&#x00A0;</span><span
  12288. class="cmtt-8">&#x00A0;}</span><span
  12289. class="cmtt-8">&#x00A0;else</span><span
  12290. class="cmtt-8">&#x00A0;{</span>
  12291. <br class="fancyvrb" /><a
  12292. id="x1-123062r31"></a><span
  12293. class="cmr-6">31</span><span
  12294. class="cmtt-8">&#x00A0;</span><span
  12295. class="cmtt-8">&#x00A0;</span>
  12296. <br class="fancyvrb" /><a
  12297. id="x1-123064r32"></a><span
  12298. class="cmr-6">32</span><span
  12299. class="cmtt-8">&#x00A0;</span><span
  12300. class="cmtt-8">&#x00A0;</span><span
  12301. class="cmtt-8">&#x00A0;</span><span
  12302. class="cmtt-8">&#x00A0;</span><span
  12303. class="cmtt-8">&#x00A0;</span><span
  12304. class="cmtt-8">&#x00A0;</span><span
  12305. class="cmtt-8">&#x00A0;</span><span
  12306. class="cmtt-8">&#x00A0;</span><span
  12307. class="cmtt-8">&#x00A0;</span><span
  12308. class="cmtt-8">&#x00A0;</span><span
  12309. class="cmtt-8">&#x00A0;</span><span
  12310. class="cmtt-8">&#x00A0;</span><span
  12311. class="cmtt-8">&#x00A0;</span><span
  12312. class="cmtt-8">&#x00A0;</span><span
  12313. class="cmtt-8">&#x00A0;18)</span><span
  12314. class="cmtt-8">&#x00A0;[y]</span><span
  12315. class="cmtt-8">&#x00A0;=</span><span
  12316. class="cmtt-8">&#x00A0;[y]</span><span
  12317. class="cmtt-8">&#x00A0;+</span><span
  12318. class="cmtt-8">&#x00A0;[base]</span>
  12319. <br class="fancyvrb" /><a
  12320. id="x1-123066r33"></a><span
  12321. class="cmr-6">33</span><span
  12322. class="cmtt-8">&#x00A0;</span><span
  12323. class="cmtt-8">&#x00A0;</span>
  12324. <br class="fancyvrb" /><a
  12325. id="x1-123068r34"></a><span
  12326. class="cmr-6">34</span><span
  12327. class="cmtt-8">&#x00A0;</span><span
  12328. class="cmtt-8">&#x00A0;</span><span
  12329. class="cmtt-8">&#x00A0;</span><span
  12330. class="cmtt-8">&#x00A0;</span><span
  12331. class="cmtt-8">&#x00A0;</span><span
  12332. class="cmtt-8">&#x00A0;</span><span
  12333. class="cmtt-8">&#x00A0;</span><span
  12334. class="cmtt-8">&#x00A0;</span><span
  12335. class="cmtt-8">&#x00A0;</span><span
  12336. class="cmtt-8">&#x00A0;</span><span
  12337. class="cmtt-8">&#x00A0;</span><span
  12338. class="cmtt-8">&#x00A0;</span><span
  12339. class="cmtt-8">&#x00A0;}</span>
  12340. <br class="fancyvrb" /><a
  12341. id="x1-123070r35"></a><span
  12342. class="cmr-6">35</span><span
  12343. class="cmtt-8">&#x00A0;</span><span
  12344. class="cmtt-8">&#x00A0;</span>
  12345. <br class="fancyvrb" /><a
  12346. id="x1-123072r36"></a><span
  12347. class="cmr-6">36</span><span
  12348. class="cmtt-8">&#x00A0;</span><span
  12349. class="cmtt-8">&#x00A0;</span><span
  12350. class="cmtt-8">&#x00A0;</span><span
  12351. class="cmtt-8">&#x00A0;</span><span
  12352. class="cmtt-8">&#x00A0;</span><span
  12353. class="cmtt-8">&#x00A0;</span><span
  12354. class="cmtt-8">&#x00A0;</span><span
  12355. class="cmtt-8">&#x00A0;</span><span
  12356. class="cmtt-8">&#x00A0;19)</span><span
  12357. class="cmtt-8">&#x00A0;vector</span><span
  12358. class="cmtt-8">&#x00A0;[v]</span><span
  12359. class="cmtt-8">&#x00A0;element</span><span
  12360. class="cmtt-8">&#x00A0;[x]</span><span
  12361. class="cmtt-8">&#x00A0;=</span><span
  12362. class="cmtt-8">&#x00A0;[y]</span>
  12363. <br class="fancyvrb" /><a
  12364. id="x1-123074r37"></a><span
  12365. class="cmr-6">37</span><span
  12366. class="cmtt-8">&#x00A0;</span><span
  12367. class="cmtt-8">&#x00A0;</span>
  12368. <br class="fancyvrb" /><a
  12369. id="x1-123076r38"></a><span
  12370. class="cmr-6">38</span><span
  12371. class="cmtt-8">&#x00A0;</span><span
  12372. class="cmtt-8">&#x00A0;</span><span
  12373. class="cmtt-8">&#x00A0;</span><span
  12374. class="cmtt-8">&#x00A0;</span><span
  12375. class="cmtt-8">&#x00A0;</span><span
  12376. class="cmtt-8">&#x00A0;</span><span
  12377. class="cmtt-8">&#x00A0;}</span>
  12378. </div>
  12379. <h3 class="sectionHead"><span class="titlemark">10 </span> <a
  12380. id="x1-12400010"></a>Tables</h3>
  12381. <!--l. 6--><p class="noindent" >
  12382. <h4 class="subsectionHead"><span class="titlemark">10.1 </span> <a
  12383. id="x1-12500010.1"></a>floor1_inverse_dB_table</h4>
  12384. <!--l. 8--><p class="noindent" >The vector <span
  12385. class="cmtt-12">[floor1_inverse_dB_table] </span>is a 256 element static lookup table consiting of the
  12386. following values (read left to right then top to bottom):
  12387. <!--l. 12--><p class="noindent" >
  12388. <div class="fancyvrb" id="fancyvrb48">
  12389. <a
  12390. id="x1-125002r1"></a><span
  12391. class="cmr-6">1</span><span
  12392. class="cmtt-8">&#x00A0;</span><span
  12393. class="cmtt-8">&#x00A0;</span><span
  12394. class="cmtt-8">&#x00A0;</span><span
  12395. class="cmtt-8">&#x00A0;1.0649863e-07,</span><span
  12396. class="cmtt-8">&#x00A0;1.1341951e-07,</span><span
  12397. class="cmtt-8">&#x00A0;1.2079015e-07,</span><span
  12398. class="cmtt-8">&#x00A0;1.2863978e-07,</span>
  12399. <br class="fancyvrb" /><a
  12400. id="x1-125004r2"></a><span
  12401. class="cmr-6">2</span><span
  12402. class="cmtt-8">&#x00A0;</span><span
  12403. class="cmtt-8">&#x00A0;</span><span
  12404. class="cmtt-8">&#x00A0;</span><span
  12405. class="cmtt-8">&#x00A0;1.3699951e-07,</span><span
  12406. class="cmtt-8">&#x00A0;1.4590251e-07,</span><span
  12407. class="cmtt-8">&#x00A0;1.5538408e-07,</span><span
  12408. class="cmtt-8">&#x00A0;1.6548181e-07,</span>
  12409. <br class="fancyvrb" /><a
  12410. id="x1-125006r3"></a><span
  12411. class="cmr-6">3</span><span
  12412. class="cmtt-8">&#x00A0;</span><span
  12413. class="cmtt-8">&#x00A0;</span><span
  12414. class="cmtt-8">&#x00A0;</span><span
  12415. class="cmtt-8">&#x00A0;1.7623575e-07,</span><span
  12416. class="cmtt-8">&#x00A0;1.8768855e-07,</span><span
  12417. class="cmtt-8">&#x00A0;1.9988561e-07,</span><span
  12418. class="cmtt-8">&#x00A0;2.1287530e-07,</span>
  12419. <br class="fancyvrb" /><a
  12420. id="x1-125008r4"></a><span
  12421. class="cmr-6">4</span><span
  12422. class="cmtt-8">&#x00A0;</span><span
  12423. class="cmtt-8">&#x00A0;</span><span
  12424. class="cmtt-8">&#x00A0;</span><span
  12425. class="cmtt-8">&#x00A0;2.2670913e-07,</span><span
  12426. class="cmtt-8">&#x00A0;2.4144197e-07,</span><span
  12427. class="cmtt-8">&#x00A0;2.5713223e-07,</span><span
  12428. class="cmtt-8">&#x00A0;2.7384213e-07,</span>
  12429. <br class="fancyvrb" /><a
  12430. id="x1-125010r5"></a><span
  12431. class="cmr-6">5</span><span
  12432. class="cmtt-8">&#x00A0;</span><span
  12433. class="cmtt-8">&#x00A0;</span><span
  12434. class="cmtt-8">&#x00A0;</span><span
  12435. class="cmtt-8">&#x00A0;2.9163793e-07,</span><span
  12436. class="cmtt-8">&#x00A0;3.1059021e-07,</span><span
  12437. class="cmtt-8">&#x00A0;3.3077411e-07,</span><span
  12438. class="cmtt-8">&#x00A0;3.5226968e-07,</span>
  12439. <br class="fancyvrb" /><a
  12440. id="x1-125012r6"></a><span
  12441. class="cmr-6">6</span><span
  12442. class="cmtt-8">&#x00A0;</span><span
  12443. class="cmtt-8">&#x00A0;</span><span
  12444. class="cmtt-8">&#x00A0;</span><span
  12445. class="cmtt-8">&#x00A0;3.7516214e-07,</span><span
  12446. class="cmtt-8">&#x00A0;3.9954229e-07,</span><span
  12447. class="cmtt-8">&#x00A0;4.2550680e-07,</span><span
  12448. class="cmtt-8">&#x00A0;4.5315863e-07,</span>
  12449. <br class="fancyvrb" /><a
  12450. id="x1-125014r7"></a><span
  12451. class="cmr-6">7</span><span
  12452. class="cmtt-8">&#x00A0;</span><span
  12453. class="cmtt-8">&#x00A0;</span><span
  12454. class="cmtt-8">&#x00A0;</span><span
  12455. class="cmtt-8">&#x00A0;4.8260743e-07,</span><span
  12456. class="cmtt-8">&#x00A0;5.1396998e-07,</span><span
  12457. class="cmtt-8">&#x00A0;5.4737065e-07,</span><span
  12458. class="cmtt-8">&#x00A0;5.8294187e-07,</span>
  12459. <br class="fancyvrb" /><a
  12460. id="x1-125016r8"></a><span
  12461. class="cmr-6">8</span><span
  12462. class="cmtt-8">&#x00A0;</span><span
  12463. class="cmtt-8">&#x00A0;</span><span
  12464. class="cmtt-8">&#x00A0;</span><span
  12465. class="cmtt-8">&#x00A0;6.2082472e-07,</span><span
  12466. class="cmtt-8">&#x00A0;6.6116941e-07,</span><span
  12467. class="cmtt-8">&#x00A0;7.0413592e-07,</span><span
  12468. class="cmtt-8">&#x00A0;7.4989464e-07,</span>
  12469. <br class="fancyvrb" /><a
  12470. id="x1-125018r9"></a><span
  12471. class="cmr-6">9</span><span
  12472. class="cmtt-8">&#x00A0;</span><span
  12473. class="cmtt-8">&#x00A0;</span><span
  12474. class="cmtt-8">&#x00A0;</span><span
  12475. class="cmtt-8">&#x00A0;7.9862701e-07,</span><span
  12476. class="cmtt-8">&#x00A0;8.5052630e-07,</span><span
  12477. class="cmtt-8">&#x00A0;9.0579828e-07,</span><span
  12478. class="cmtt-8">&#x00A0;9.6466216e-07,</span>
  12479. <br class="fancyvrb" /><a
  12480. id="x1-125020r10"></a><span
  12481. class="cmr-6">10</span><span
  12482. class="cmtt-8">&#x00A0;</span><span
  12483. class="cmtt-8">&#x00A0;</span><span
  12484. class="cmtt-8">&#x00A0;</span><span
  12485. class="cmtt-8">&#x00A0;1.0273513e-06,</span><span
  12486. class="cmtt-8">&#x00A0;1.0941144e-06,</span><span
  12487. class="cmtt-8">&#x00A0;1.1652161e-06,</span><span
  12488. class="cmtt-8">&#x00A0;1.2409384e-06,</span>
  12489. <br class="fancyvrb" /><a
  12490. id="x1-125022r11"></a><span
  12491. class="cmr-6">11</span><span
  12492. class="cmtt-8">&#x00A0;</span><span
  12493. class="cmtt-8">&#x00A0;</span><span
  12494. class="cmtt-8">&#x00A0;</span><span
  12495. class="cmtt-8">&#x00A0;1.3215816e-06,</span><span
  12496. class="cmtt-8">&#x00A0;1.4074654e-06,</span><span
  12497. class="cmtt-8">&#x00A0;1.4989305e-06,</span><span
  12498. class="cmtt-8">&#x00A0;1.5963394e-06,</span>
  12499. <br class="fancyvrb" /><a
  12500. id="x1-125024r12"></a><span
  12501. class="cmr-6">12</span><span
  12502. class="cmtt-8">&#x00A0;</span><span
  12503. class="cmtt-8">&#x00A0;</span><span
  12504. class="cmtt-8">&#x00A0;</span><span
  12505. class="cmtt-8">&#x00A0;1.7000785e-06,</span><span
  12506. class="cmtt-8">&#x00A0;1.8105592e-06,</span><span
  12507. class="cmtt-8">&#x00A0;1.9282195e-06,</span><span
  12508. class="cmtt-8">&#x00A0;2.0535261e-06,</span>
  12509. <br class="fancyvrb" /><a
  12510. id="x1-125026r13"></a><span
  12511. class="cmr-6">13</span><span
  12512. class="cmtt-8">&#x00A0;</span><span
  12513. class="cmtt-8">&#x00A0;</span><span
  12514. class="cmtt-8">&#x00A0;</span><span
  12515. class="cmtt-8">&#x00A0;2.1869758e-06,</span><span
  12516. class="cmtt-8">&#x00A0;2.3290978e-06,</span><span
  12517. class="cmtt-8">&#x00A0;2.4804557e-06,</span><span
  12518. class="cmtt-8">&#x00A0;2.6416497e-06,</span>
  12519. <br class="fancyvrb" /><a
  12520. id="x1-125028r14"></a><span
  12521. class="cmr-6">14</span><span
  12522. class="cmtt-8">&#x00A0;</span><span
  12523. class="cmtt-8">&#x00A0;</span><span
  12524. class="cmtt-8">&#x00A0;</span><span
  12525. class="cmtt-8">&#x00A0;2.8133190e-06,</span><span
  12526. class="cmtt-8">&#x00A0;2.9961443e-06,</span><span
  12527. class="cmtt-8">&#x00A0;3.1908506e-06,</span><span
  12528. class="cmtt-8">&#x00A0;3.3982101e-06,</span>
  12529. <br class="fancyvrb" /><a
  12530. id="x1-125030r15"></a><span
  12531. class="cmr-6">15</span><span
  12532. class="cmtt-8">&#x00A0;</span><span
  12533. class="cmtt-8">&#x00A0;</span><span
  12534. class="cmtt-8">&#x00A0;</span><span
  12535. class="cmtt-8">&#x00A0;3.6190449e-06,</span><span
  12536. class="cmtt-8">&#x00A0;3.8542308e-06,</span><span
  12537. class="cmtt-8">&#x00A0;4.1047004e-06,</span><span
  12538. class="cmtt-8">&#x00A0;4.3714470e-06,</span>
  12539. <br class="fancyvrb" /><a
  12540. id="x1-125032r16"></a><span
  12541. class="cmr-6">16</span><span
  12542. class="cmtt-8">&#x00A0;</span><span
  12543. class="cmtt-8">&#x00A0;</span><span
  12544. class="cmtt-8">&#x00A0;</span><span
  12545. class="cmtt-8">&#x00A0;4.6555282e-06,</span><span
  12546. class="cmtt-8">&#x00A0;4.9580707e-06,</span><span
  12547. class="cmtt-8">&#x00A0;5.2802740e-06,</span><span
  12548. class="cmtt-8">&#x00A0;5.6234160e-06,</span>
  12549. <br class="fancyvrb" /><a
  12550. id="x1-125034r17"></a><span
  12551. class="cmr-6">17</span><span
  12552. class="cmtt-8">&#x00A0;</span><span
  12553. class="cmtt-8">&#x00A0;</span><span
  12554. class="cmtt-8">&#x00A0;</span><span
  12555. class="cmtt-8">&#x00A0;5.9888572e-06,</span><span
  12556. class="cmtt-8">&#x00A0;6.3780469e-06,</span><span
  12557. class="cmtt-8">&#x00A0;6.7925283e-06,</span><span
  12558. class="cmtt-8">&#x00A0;7.2339451e-06,</span>
  12559. <br class="fancyvrb" /><a
  12560. id="x1-125036r18"></a><span
  12561. class="cmr-6">18</span><span
  12562. class="cmtt-8">&#x00A0;</span><span
  12563. class="cmtt-8">&#x00A0;</span><span
  12564. class="cmtt-8">&#x00A0;</span><span
  12565. class="cmtt-8">&#x00A0;7.7040476e-06,</span><span
  12566. class="cmtt-8">&#x00A0;8.2047000e-06,</span><span
  12567. class="cmtt-8">&#x00A0;8.7378876e-06,</span><span
  12568. class="cmtt-8">&#x00A0;9.3057248e-06,</span>
  12569. <br class="fancyvrb" /><a
  12570. id="x1-125038r19"></a><span
  12571. class="cmr-6">19</span><span
  12572. class="cmtt-8">&#x00A0;</span><span
  12573. class="cmtt-8">&#x00A0;</span><span
  12574. class="cmtt-8">&#x00A0;</span><span
  12575. class="cmtt-8">&#x00A0;9.9104632e-06,</span><span
  12576. class="cmtt-8">&#x00A0;1.0554501e-05,</span><span
  12577. class="cmtt-8">&#x00A0;1.1240392e-05,</span><span
  12578. class="cmtt-8">&#x00A0;1.1970856e-05,</span>
  12579. <br class="fancyvrb" /><a
  12580. id="x1-125040r20"></a><span
  12581. class="cmr-6">20</span><span
  12582. class="cmtt-8">&#x00A0;</span><span
  12583. class="cmtt-8">&#x00A0;</span><span
  12584. class="cmtt-8">&#x00A0;</span><span
  12585. class="cmtt-8">&#x00A0;1.2748789e-05,</span><span
  12586. class="cmtt-8">&#x00A0;1.3577278e-05,</span><span
  12587. class="cmtt-8">&#x00A0;1.4459606e-05,</span><span
  12588. class="cmtt-8">&#x00A0;1.5399272e-05,</span>
  12589. <br class="fancyvrb" /><a
  12590. id="x1-125042r21"></a><span
  12591. class="cmr-6">21</span><span
  12592. class="cmtt-8">&#x00A0;</span><span
  12593. class="cmtt-8">&#x00A0;</span><span
  12594. class="cmtt-8">&#x00A0;</span><span
  12595. class="cmtt-8">&#x00A0;1.6400004e-05,</span><span
  12596. class="cmtt-8">&#x00A0;1.7465768e-05,</span><span
  12597. class="cmtt-8">&#x00A0;1.8600792e-05,</span><span
  12598. class="cmtt-8">&#x00A0;1.9809576e-05,</span>
  12599. <br class="fancyvrb" /><a
  12600. id="x1-125044r22"></a><span
  12601. class="cmr-6">22</span><span
  12602. class="cmtt-8">&#x00A0;</span><span
  12603. class="cmtt-8">&#x00A0;</span><span
  12604. class="cmtt-8">&#x00A0;</span><span
  12605. class="cmtt-8">&#x00A0;2.1096914e-05,</span><span
  12606. class="cmtt-8">&#x00A0;2.2467911e-05,</span><span
  12607. class="cmtt-8">&#x00A0;2.3928002e-05,</span><span
  12608. class="cmtt-8">&#x00A0;2.5482978e-05,</span>
  12609. <br class="fancyvrb" /><a
  12610. id="x1-125046r23"></a><span
  12611. class="cmr-6">23</span><span
  12612. class="cmtt-8">&#x00A0;</span><span
  12613. class="cmtt-8">&#x00A0;</span><span
  12614. class="cmtt-8">&#x00A0;</span><span
  12615. class="cmtt-8">&#x00A0;2.7139006e-05,</span><span
  12616. class="cmtt-8">&#x00A0;2.8902651e-05,</span><span
  12617. class="cmtt-8">&#x00A0;3.0780908e-05,</span><span
  12618. class="cmtt-8">&#x00A0;3.2781225e-05,</span>
  12619. <br class="fancyvrb" /><a
  12620. id="x1-125048r24"></a><span
  12621. class="cmr-6">24</span><span
  12622. class="cmtt-8">&#x00A0;</span><span
  12623. class="cmtt-8">&#x00A0;</span><span
  12624. class="cmtt-8">&#x00A0;</span><span
  12625. class="cmtt-8">&#x00A0;3.4911534e-05,</span><span
  12626. class="cmtt-8">&#x00A0;3.7180282e-05,</span><span
  12627. class="cmtt-8">&#x00A0;3.9596466e-05,</span><span
  12628. class="cmtt-8">&#x00A0;4.2169667e-05,</span>
  12629. <br class="fancyvrb" /><a
  12630. id="x1-125050r25"></a><span
  12631. class="cmr-6">25</span><span
  12632. class="cmtt-8">&#x00A0;</span><span
  12633. class="cmtt-8">&#x00A0;</span><span
  12634. class="cmtt-8">&#x00A0;</span><span
  12635. class="cmtt-8">&#x00A0;4.4910090e-05,</span><span
  12636. class="cmtt-8">&#x00A0;4.7828601e-05,</span><span
  12637. class="cmtt-8">&#x00A0;5.0936773e-05,</span><span
  12638. class="cmtt-8">&#x00A0;5.4246931e-05,</span>
  12639. <br class="fancyvrb" /><a
  12640. id="x1-125052r26"></a><span
  12641. class="cmr-6">26</span><span
  12642. class="cmtt-8">&#x00A0;</span><span
  12643. class="cmtt-8">&#x00A0;</span><span
  12644. class="cmtt-8">&#x00A0;</span><span
  12645. class="cmtt-8">&#x00A0;5.7772202e-05,</span><span
  12646. class="cmtt-8">&#x00A0;6.1526565e-05,</span><span
  12647. class="cmtt-8">&#x00A0;6.5524908e-05,</span><span
  12648. class="cmtt-8">&#x00A0;6.9783085e-05,</span>
  12649. <br class="fancyvrb" /><a
  12650. id="x1-125054r27"></a><span
  12651. class="cmr-6">27</span><span
  12652. class="cmtt-8">&#x00A0;</span><span
  12653. class="cmtt-8">&#x00A0;</span><span
  12654. class="cmtt-8">&#x00A0;</span><span
  12655. class="cmtt-8">&#x00A0;7.4317983e-05,</span><span
  12656. class="cmtt-8">&#x00A0;7.9147585e-05,</span><span
  12657. class="cmtt-8">&#x00A0;8.4291040e-05,</span><span
  12658. class="cmtt-8">&#x00A0;8.9768747e-05,</span>
  12659. <br class="fancyvrb" /><a
  12660. id="x1-125056r28"></a><span
  12661. class="cmr-6">28</span><span
  12662. class="cmtt-8">&#x00A0;</span><span
  12663. class="cmtt-8">&#x00A0;</span><span
  12664. class="cmtt-8">&#x00A0;</span><span
  12665. class="cmtt-8">&#x00A0;9.5602426e-05,</span><span
  12666. class="cmtt-8">&#x00A0;0.00010181521,</span><span
  12667. class="cmtt-8">&#x00A0;0.00010843174,</span><span
  12668. class="cmtt-8">&#x00A0;0.00011547824,</span>
  12669. <br class="fancyvrb" /><a
  12670. id="x1-125058r29"></a><span
  12671. class="cmr-6">29</span><span
  12672. class="cmtt-8">&#x00A0;</span><span
  12673. class="cmtt-8">&#x00A0;</span><span
  12674. class="cmtt-8">&#x00A0;</span><span
  12675. class="cmtt-8">&#x00A0;0.00012298267,</span><span
  12676. class="cmtt-8">&#x00A0;0.00013097477,</span><span
  12677. class="cmtt-8">&#x00A0;0.00013948625,</span><span
  12678. class="cmtt-8">&#x00A0;0.00014855085,</span>
  12679. <br class="fancyvrb" /><a
  12680. id="x1-125060r30"></a><span
  12681. class="cmr-6">30</span><span
  12682. class="cmtt-8">&#x00A0;</span><span
  12683. class="cmtt-8">&#x00A0;</span><span
  12684. class="cmtt-8">&#x00A0;</span><span
  12685. class="cmtt-8">&#x00A0;0.00015820453,</span><span
  12686. class="cmtt-8">&#x00A0;0.00016848555,</span><span
  12687. class="cmtt-8">&#x00A0;0.00017943469,</span><span
  12688. class="cmtt-8">&#x00A0;0.00019109536,</span>
  12689. <br class="fancyvrb" /><a
  12690. id="x1-125062r31"></a><span
  12691. class="cmr-6">31</span><span
  12692. class="cmtt-8">&#x00A0;</span><span
  12693. class="cmtt-8">&#x00A0;</span><span
  12694. class="cmtt-8">&#x00A0;</span><span
  12695. class="cmtt-8">&#x00A0;0.00020351382,</span><span
  12696. class="cmtt-8">&#x00A0;0.00021673929,</span><span
  12697. class="cmtt-8">&#x00A0;0.00023082423,</span><span
  12698. class="cmtt-8">&#x00A0;0.00024582449,</span>
  12699. <br class="fancyvrb" /><a
  12700. id="x1-125064r32"></a><span
  12701. class="cmr-6">32</span><span
  12702. class="cmtt-8">&#x00A0;</span><span
  12703. class="cmtt-8">&#x00A0;</span><span
  12704. class="cmtt-8">&#x00A0;</span><span
  12705. class="cmtt-8">&#x00A0;0.00026179955,</span><span
  12706. class="cmtt-8">&#x00A0;0.00027881276,</span><span
  12707. class="cmtt-8">&#x00A0;0.00029693158,</span><span
  12708. class="cmtt-8">&#x00A0;0.00031622787,</span>
  12709. <br class="fancyvrb" /><a
  12710. id="x1-125066r33"></a><span
  12711. class="cmr-6">33</span><span
  12712. class="cmtt-8">&#x00A0;</span><span
  12713. class="cmtt-8">&#x00A0;</span><span
  12714. class="cmtt-8">&#x00A0;</span><span
  12715. class="cmtt-8">&#x00A0;0.00033677814,</span><span
  12716. class="cmtt-8">&#x00A0;0.00035866388,</span><span
  12717. class="cmtt-8">&#x00A0;0.00038197188,</span><span
  12718. class="cmtt-8">&#x00A0;0.00040679456,</span>
  12719. <br class="fancyvrb" /><a
  12720. id="x1-125068r34"></a><span
  12721. class="cmr-6">34</span><span
  12722. class="cmtt-8">&#x00A0;</span><span
  12723. class="cmtt-8">&#x00A0;</span><span
  12724. class="cmtt-8">&#x00A0;</span><span
  12725. class="cmtt-8">&#x00A0;0.00043323036,</span><span
  12726. class="cmtt-8">&#x00A0;0.00046138411,</span><span
  12727. class="cmtt-8">&#x00A0;0.00049136745,</span><span
  12728. class="cmtt-8">&#x00A0;0.00052329927,</span>
  12729. <br class="fancyvrb" /><a
  12730. id="x1-125070r35"></a><span
  12731. class="cmr-6">35</span><span
  12732. class="cmtt-8">&#x00A0;</span><span
  12733. class="cmtt-8">&#x00A0;</span><span
  12734. class="cmtt-8">&#x00A0;</span><span
  12735. class="cmtt-8">&#x00A0;0.00055730621,</span><span
  12736. class="cmtt-8">&#x00A0;0.00059352311,</span><span
  12737. class="cmtt-8">&#x00A0;0.00063209358,</span><span
  12738. class="cmtt-8">&#x00A0;0.00067317058,</span>
  12739. <br class="fancyvrb" /><a
  12740. id="x1-125072r36"></a><span
  12741. class="cmr-6">36</span><span
  12742. class="cmtt-8">&#x00A0;</span><span
  12743. class="cmtt-8">&#x00A0;</span><span
  12744. class="cmtt-8">&#x00A0;</span><span
  12745. class="cmtt-8">&#x00A0;0.00071691700,</span><span
  12746. class="cmtt-8">&#x00A0;0.00076350630,</span><span
  12747. class="cmtt-8">&#x00A0;0.00081312324,</span><span
  12748. class="cmtt-8">&#x00A0;0.00086596457,</span>
  12749. <br class="fancyvrb" /><a
  12750. id="x1-125074r37"></a><span
  12751. class="cmr-6">37</span><span
  12752. class="cmtt-8">&#x00A0;</span><span
  12753. class="cmtt-8">&#x00A0;</span><span
  12754. class="cmtt-8">&#x00A0;</span><span
  12755. class="cmtt-8">&#x00A0;0.00092223983,</span><span
  12756. class="cmtt-8">&#x00A0;0.00098217216,</span><span
  12757. class="cmtt-8">&#x00A0;0.0010459992,</span><span
  12758. class="cmtt-8">&#x00A0;</span><span
  12759. class="cmtt-8">&#x00A0;0.0011139742,</span>
  12760. <br class="fancyvrb" /><a
  12761. id="x1-125076r38"></a><span
  12762. class="cmr-6">38</span><span
  12763. class="cmtt-8">&#x00A0;</span><span
  12764. class="cmtt-8">&#x00A0;</span><span
  12765. class="cmtt-8">&#x00A0;</span><span
  12766. class="cmtt-8">&#x00A0;0.0011863665,</span><span
  12767. class="cmtt-8">&#x00A0;</span><span
  12768. class="cmtt-8">&#x00A0;0.0012634633,</span><span
  12769. class="cmtt-8">&#x00A0;</span><span
  12770. class="cmtt-8">&#x00A0;0.0013455702,</span><span
  12771. class="cmtt-8">&#x00A0;</span><span
  12772. class="cmtt-8">&#x00A0;0.0014330129,</span>
  12773. <br class="fancyvrb" /><a
  12774. id="x1-125078r39"></a><span
  12775. class="cmr-6">39</span><span
  12776. class="cmtt-8">&#x00A0;</span><span
  12777. class="cmtt-8">&#x00A0;</span><span
  12778. class="cmtt-8">&#x00A0;</span><span
  12779. class="cmtt-8">&#x00A0;0.0015261382,</span><span
  12780. class="cmtt-8">&#x00A0;</span><span
  12781. class="cmtt-8">&#x00A0;0.0016253153,</span><span
  12782. class="cmtt-8">&#x00A0;</span><span
  12783. class="cmtt-8">&#x00A0;0.0017309374,</span><span
  12784. class="cmtt-8">&#x00A0;</span><span
  12785. class="cmtt-8">&#x00A0;0.0018434235,</span>
  12786. <br class="fancyvrb" /><a
  12787. id="x1-125080r40"></a><span
  12788. class="cmr-6">40</span><span
  12789. class="cmtt-8">&#x00A0;</span><span
  12790. class="cmtt-8">&#x00A0;</span><span
  12791. class="cmtt-8">&#x00A0;</span><span
  12792. class="cmtt-8">&#x00A0;0.0019632195,</span><span
  12793. class="cmtt-8">&#x00A0;</span><span
  12794. class="cmtt-8">&#x00A0;0.0020908006,</span><span
  12795. class="cmtt-8">&#x00A0;</span><span
  12796. class="cmtt-8">&#x00A0;0.0022266726,</span><span
  12797. class="cmtt-8">&#x00A0;</span><span
  12798. class="cmtt-8">&#x00A0;0.0023713743,</span>
  12799. <br class="fancyvrb" /><a
  12800. id="x1-125082r41"></a><span
  12801. class="cmr-6">41</span><span
  12802. class="cmtt-8">&#x00A0;</span><span
  12803. class="cmtt-8">&#x00A0;</span><span
  12804. class="cmtt-8">&#x00A0;</span><span
  12805. class="cmtt-8">&#x00A0;0.0025254795,</span><span
  12806. class="cmtt-8">&#x00A0;</span><span
  12807. class="cmtt-8">&#x00A0;0.0026895994,</span><span
  12808. class="cmtt-8">&#x00A0;</span><span
  12809. class="cmtt-8">&#x00A0;0.0028643847,</span><span
  12810. class="cmtt-8">&#x00A0;</span><span
  12811. class="cmtt-8">&#x00A0;0.0030505286,</span>
  12812. <br class="fancyvrb" /><a
  12813. id="x1-125084r42"></a><span
  12814. class="cmr-6">42</span><span
  12815. class="cmtt-8">&#x00A0;</span><span
  12816. class="cmtt-8">&#x00A0;</span><span
  12817. class="cmtt-8">&#x00A0;</span><span
  12818. class="cmtt-8">&#x00A0;0.0032487691,</span><span
  12819. class="cmtt-8">&#x00A0;</span><span
  12820. class="cmtt-8">&#x00A0;0.0034598925,</span><span
  12821. class="cmtt-8">&#x00A0;</span><span
  12822. class="cmtt-8">&#x00A0;0.0036847358,</span><span
  12823. class="cmtt-8">&#x00A0;</span><span
  12824. class="cmtt-8">&#x00A0;0.0039241906,</span>
  12825. <br class="fancyvrb" /><a
  12826. id="x1-125086r43"></a><span
  12827. class="cmr-6">43</span><span
  12828. class="cmtt-8">&#x00A0;</span><span
  12829. class="cmtt-8">&#x00A0;</span><span
  12830. class="cmtt-8">&#x00A0;</span><span
  12831. class="cmtt-8">&#x00A0;0.0041792066,</span><span
  12832. class="cmtt-8">&#x00A0;</span><span
  12833. class="cmtt-8">&#x00A0;0.0044507950,</span><span
  12834. class="cmtt-8">&#x00A0;</span><span
  12835. class="cmtt-8">&#x00A0;0.0047400328,</span><span
  12836. class="cmtt-8">&#x00A0;</span><span
  12837. class="cmtt-8">&#x00A0;0.0050480668,</span>
  12838. <br class="fancyvrb" /><a
  12839. id="x1-125088r44"></a><span
  12840. class="cmr-6">44</span><span
  12841. class="cmtt-8">&#x00A0;</span><span
  12842. class="cmtt-8">&#x00A0;</span><span
  12843. class="cmtt-8">&#x00A0;</span><span
  12844. class="cmtt-8">&#x00A0;0.0053761186,</span><span
  12845. class="cmtt-8">&#x00A0;</span><span
  12846. class="cmtt-8">&#x00A0;0.0057254891,</span><span
  12847. class="cmtt-8">&#x00A0;</span><span
  12848. class="cmtt-8">&#x00A0;0.0060975636,</span><span
  12849. class="cmtt-8">&#x00A0;</span><span
  12850. class="cmtt-8">&#x00A0;0.0064938176,</span>
  12851. <br class="fancyvrb" /><a
  12852. id="x1-125090r45"></a><span
  12853. class="cmr-6">45</span><span
  12854. class="cmtt-8">&#x00A0;</span><span
  12855. class="cmtt-8">&#x00A0;</span><span
  12856. class="cmtt-8">&#x00A0;</span><span
  12857. class="cmtt-8">&#x00A0;0.0069158225,</span><span
  12858. class="cmtt-8">&#x00A0;</span><span
  12859. class="cmtt-8">&#x00A0;0.0073652516,</span><span
  12860. class="cmtt-8">&#x00A0;</span><span
  12861. class="cmtt-8">&#x00A0;0.0078438871,</span><span
  12862. class="cmtt-8">&#x00A0;</span><span
  12863. class="cmtt-8">&#x00A0;0.0083536271,</span>
  12864. <br class="fancyvrb" /><a
  12865. id="x1-125092r46"></a><span
  12866. class="cmr-6">46</span><span
  12867. class="cmtt-8">&#x00A0;</span><span
  12868. class="cmtt-8">&#x00A0;</span><span
  12869. class="cmtt-8">&#x00A0;</span><span
  12870. class="cmtt-8">&#x00A0;0.0088964928,</span><span
  12871. class="cmtt-8">&#x00A0;</span><span
  12872. class="cmtt-8">&#x00A0;0.009474637,</span><span
  12873. class="cmtt-8">&#x00A0;</span><span
  12874. class="cmtt-8">&#x00A0;</span><span
  12875. class="cmtt-8">&#x00A0;0.010090352,</span><span
  12876. class="cmtt-8">&#x00A0;</span><span
  12877. class="cmtt-8">&#x00A0;</span><span
  12878. class="cmtt-8">&#x00A0;0.010746080,</span>
  12879. <br class="fancyvrb" /><a
  12880. id="x1-125094r47"></a><span
  12881. class="cmr-6">47</span><span
  12882. class="cmtt-8">&#x00A0;</span><span
  12883. class="cmtt-8">&#x00A0;</span><span
  12884. class="cmtt-8">&#x00A0;</span><span
  12885. class="cmtt-8">&#x00A0;0.011444421,</span><span
  12886. class="cmtt-8">&#x00A0;</span><span
  12887. class="cmtt-8">&#x00A0;</span><span
  12888. class="cmtt-8">&#x00A0;0.012188144,</span><span
  12889. class="cmtt-8">&#x00A0;</span><span
  12890. class="cmtt-8">&#x00A0;</span><span
  12891. class="cmtt-8">&#x00A0;0.012980198,</span><span
  12892. class="cmtt-8">&#x00A0;</span><span
  12893. class="cmtt-8">&#x00A0;</span><span
  12894. class="cmtt-8">&#x00A0;0.013823725,</span>
  12895. <br class="fancyvrb" /><a
  12896. id="x1-125096r48"></a><span
  12897. class="cmr-6">48</span><span
  12898. class="cmtt-8">&#x00A0;</span><span
  12899. class="cmtt-8">&#x00A0;</span><span
  12900. class="cmtt-8">&#x00A0;</span><span
  12901. class="cmtt-8">&#x00A0;0.014722068,</span><span
  12902. class="cmtt-8">&#x00A0;</span><span
  12903. class="cmtt-8">&#x00A0;</span><span
  12904. class="cmtt-8">&#x00A0;0.015678791,</span><span
  12905. class="cmtt-8">&#x00A0;</span><span
  12906. class="cmtt-8">&#x00A0;</span><span
  12907. class="cmtt-8">&#x00A0;0.016697687,</span><span
  12908. class="cmtt-8">&#x00A0;</span><span
  12909. class="cmtt-8">&#x00A0;</span><span
  12910. class="cmtt-8">&#x00A0;0.017782797,</span>
  12911. <br class="fancyvrb" /><a
  12912. id="x1-125098r49"></a><span
  12913. class="cmr-6">49</span><span
  12914. class="cmtt-8">&#x00A0;</span><span
  12915. class="cmtt-8">&#x00A0;</span><span
  12916. class="cmtt-8">&#x00A0;</span><span
  12917. class="cmtt-8">&#x00A0;0.018938423,</span><span
  12918. class="cmtt-8">&#x00A0;</span><span
  12919. class="cmtt-8">&#x00A0;</span><span
  12920. class="cmtt-8">&#x00A0;0.020169149,</span><span
  12921. class="cmtt-8">&#x00A0;</span><span
  12922. class="cmtt-8">&#x00A0;</span><span
  12923. class="cmtt-8">&#x00A0;0.021479854,</span><span
  12924. class="cmtt-8">&#x00A0;</span><span
  12925. class="cmtt-8">&#x00A0;</span><span
  12926. class="cmtt-8">&#x00A0;0.022875735,</span>
  12927. <br class="fancyvrb" /><a
  12928. id="x1-125100r50"></a><span
  12929. class="cmr-6">50</span><span
  12930. class="cmtt-8">&#x00A0;</span><span
  12931. class="cmtt-8">&#x00A0;</span><span
  12932. class="cmtt-8">&#x00A0;</span><span
  12933. class="cmtt-8">&#x00A0;0.024362330,</span><span
  12934. class="cmtt-8">&#x00A0;</span><span
  12935. class="cmtt-8">&#x00A0;</span><span
  12936. class="cmtt-8">&#x00A0;0.025945531,</span><span
  12937. class="cmtt-8">&#x00A0;</span><span
  12938. class="cmtt-8">&#x00A0;</span><span
  12939. class="cmtt-8">&#x00A0;0.027631618,</span><span
  12940. class="cmtt-8">&#x00A0;</span><span
  12941. class="cmtt-8">&#x00A0;</span><span
  12942. class="cmtt-8">&#x00A0;0.029427276,</span>
  12943. <br class="fancyvrb" /><a
  12944. id="x1-125102r51"></a><span
  12945. class="cmr-6">51</span><span
  12946. class="cmtt-8">&#x00A0;</span><span
  12947. class="cmtt-8">&#x00A0;</span><span
  12948. class="cmtt-8">&#x00A0;</span><span
  12949. class="cmtt-8">&#x00A0;0.031339626,</span><span
  12950. class="cmtt-8">&#x00A0;</span><span
  12951. class="cmtt-8">&#x00A0;</span><span
  12952. class="cmtt-8">&#x00A0;0.033376252,</span><span
  12953. class="cmtt-8">&#x00A0;</span><span
  12954. class="cmtt-8">&#x00A0;</span><span
  12955. class="cmtt-8">&#x00A0;0.035545228,</span><span
  12956. class="cmtt-8">&#x00A0;</span><span
  12957. class="cmtt-8">&#x00A0;</span><span
  12958. class="cmtt-8">&#x00A0;0.037855157,</span>
  12959. <br class="fancyvrb" /><a
  12960. id="x1-125104r52"></a><span
  12961. class="cmr-6">52</span><span
  12962. class="cmtt-8">&#x00A0;</span><span
  12963. class="cmtt-8">&#x00A0;</span><span
  12964. class="cmtt-8">&#x00A0;</span><span
  12965. class="cmtt-8">&#x00A0;0.040315199,</span><span
  12966. class="cmtt-8">&#x00A0;</span><span
  12967. class="cmtt-8">&#x00A0;</span><span
  12968. class="cmtt-8">&#x00A0;0.042935108,</span><span
  12969. class="cmtt-8">&#x00A0;</span><span
  12970. class="cmtt-8">&#x00A0;</span><span
  12971. class="cmtt-8">&#x00A0;0.045725273,</span><span
  12972. class="cmtt-8">&#x00A0;</span><span
  12973. class="cmtt-8">&#x00A0;</span><span
  12974. class="cmtt-8">&#x00A0;0.048696758,</span>
  12975. <br class="fancyvrb" /><a
  12976. id="x1-125106r53"></a><span
  12977. class="cmr-6">53</span><span
  12978. class="cmtt-8">&#x00A0;</span><span
  12979. class="cmtt-8">&#x00A0;</span><span
  12980. class="cmtt-8">&#x00A0;</span><span
  12981. class="cmtt-8">&#x00A0;0.051861348,</span><span
  12982. class="cmtt-8">&#x00A0;</span><span
  12983. class="cmtt-8">&#x00A0;</span><span
  12984. class="cmtt-8">&#x00A0;0.055231591,</span><span
  12985. class="cmtt-8">&#x00A0;</span><span
  12986. class="cmtt-8">&#x00A0;</span><span
  12987. class="cmtt-8">&#x00A0;0.058820850,</span><span
  12988. class="cmtt-8">&#x00A0;</span><span
  12989. class="cmtt-8">&#x00A0;</span><span
  12990. class="cmtt-8">&#x00A0;0.062643361,</span>
  12991. <br class="fancyvrb" /><a
  12992. id="x1-125108r54"></a><span
  12993. class="cmr-6">54</span><span
  12994. class="cmtt-8">&#x00A0;</span><span
  12995. class="cmtt-8">&#x00A0;</span><span
  12996. class="cmtt-8">&#x00A0;</span><span
  12997. class="cmtt-8">&#x00A0;0.066714279,</span><span
  12998. class="cmtt-8">&#x00A0;</span><span
  12999. class="cmtt-8">&#x00A0;</span><span
  13000. class="cmtt-8">&#x00A0;0.071049749,</span><span
  13001. class="cmtt-8">&#x00A0;</span><span
  13002. class="cmtt-8">&#x00A0;</span><span
  13003. class="cmtt-8">&#x00A0;0.075666962,</span><span
  13004. class="cmtt-8">&#x00A0;</span><span
  13005. class="cmtt-8">&#x00A0;</span><span
  13006. class="cmtt-8">&#x00A0;0.080584227,</span>
  13007. <br class="fancyvrb" /><a
  13008. id="x1-125110r55"></a><span
  13009. class="cmr-6">55</span><span
  13010. class="cmtt-8">&#x00A0;</span><span
  13011. class="cmtt-8">&#x00A0;</span><span
  13012. class="cmtt-8">&#x00A0;</span><span
  13013. class="cmtt-8">&#x00A0;0.085821044,</span><span
  13014. class="cmtt-8">&#x00A0;</span><span
  13015. class="cmtt-8">&#x00A0;</span><span
  13016. class="cmtt-8">&#x00A0;0.091398179,</span><span
  13017. class="cmtt-8">&#x00A0;</span><span
  13018. class="cmtt-8">&#x00A0;</span><span
  13019. class="cmtt-8">&#x00A0;0.097337747,</span><span
  13020. class="cmtt-8">&#x00A0;</span><span
  13021. class="cmtt-8">&#x00A0;</span><span
  13022. class="cmtt-8">&#x00A0;0.10366330,</span>
  13023. <br class="fancyvrb" /><a
  13024. id="x1-125112r56"></a><span
  13025. class="cmr-6">56</span><span
  13026. class="cmtt-8">&#x00A0;</span><span
  13027. class="cmtt-8">&#x00A0;</span><span
  13028. class="cmtt-8">&#x00A0;</span><span
  13029. class="cmtt-8">&#x00A0;0.11039993,</span><span
  13030. class="cmtt-8">&#x00A0;</span><span
  13031. class="cmtt-8">&#x00A0;</span><span
  13032. class="cmtt-8">&#x00A0;</span><span
  13033. class="cmtt-8">&#x00A0;0.11757434,</span><span
  13034. class="cmtt-8">&#x00A0;</span><span
  13035. class="cmtt-8">&#x00A0;</span><span
  13036. class="cmtt-8">&#x00A0;</span><span
  13037. class="cmtt-8">&#x00A0;0.12521498,</span><span
  13038. class="cmtt-8">&#x00A0;</span><span
  13039. class="cmtt-8">&#x00A0;</span><span
  13040. class="cmtt-8">&#x00A0;</span><span
  13041. class="cmtt-8">&#x00A0;0.13335215,</span>
  13042. <br class="fancyvrb" /><a
  13043. id="x1-125114r57"></a><span
  13044. class="cmr-6">57</span><span
  13045. class="cmtt-8">&#x00A0;</span><span
  13046. class="cmtt-8">&#x00A0;</span><span
  13047. class="cmtt-8">&#x00A0;</span><span
  13048. class="cmtt-8">&#x00A0;0.14201813,</span><span
  13049. class="cmtt-8">&#x00A0;</span><span
  13050. class="cmtt-8">&#x00A0;</span><span
  13051. class="cmtt-8">&#x00A0;</span><span
  13052. class="cmtt-8">&#x00A0;0.15124727,</span><span
  13053. class="cmtt-8">&#x00A0;</span><span
  13054. class="cmtt-8">&#x00A0;</span><span
  13055. class="cmtt-8">&#x00A0;</span><span
  13056. class="cmtt-8">&#x00A0;0.16107617,</span><span
  13057. class="cmtt-8">&#x00A0;</span><span
  13058. class="cmtt-8">&#x00A0;</span><span
  13059. class="cmtt-8">&#x00A0;</span><span
  13060. class="cmtt-8">&#x00A0;0.17154380,</span>
  13061. <br class="fancyvrb" /><a
  13062. id="x1-125116r58"></a><span
  13063. class="cmr-6">58</span><span
  13064. class="cmtt-8">&#x00A0;</span><span
  13065. class="cmtt-8">&#x00A0;</span><span
  13066. class="cmtt-8">&#x00A0;</span><span
  13067. class="cmtt-8">&#x00A0;0.18269168,</span><span
  13068. class="cmtt-8">&#x00A0;</span><span
  13069. class="cmtt-8">&#x00A0;</span><span
  13070. class="cmtt-8">&#x00A0;</span><span
  13071. class="cmtt-8">&#x00A0;0.19456402,</span><span
  13072. class="cmtt-8">&#x00A0;</span><span
  13073. class="cmtt-8">&#x00A0;</span><span
  13074. class="cmtt-8">&#x00A0;</span><span
  13075. class="cmtt-8">&#x00A0;0.20720788,</span><span
  13076. class="cmtt-8">&#x00A0;</span><span
  13077. class="cmtt-8">&#x00A0;</span><span
  13078. class="cmtt-8">&#x00A0;</span><span
  13079. class="cmtt-8">&#x00A0;0.22067342,</span>
  13080. <br class="fancyvrb" /><a
  13081. id="x1-125118r59"></a><span
  13082. class="cmr-6">59</span><span
  13083. class="cmtt-8">&#x00A0;</span><span
  13084. class="cmtt-8">&#x00A0;</span><span
  13085. class="cmtt-8">&#x00A0;</span><span
  13086. class="cmtt-8">&#x00A0;0.23501402,</span><span
  13087. class="cmtt-8">&#x00A0;</span><span
  13088. class="cmtt-8">&#x00A0;</span><span
  13089. class="cmtt-8">&#x00A0;</span><span
  13090. class="cmtt-8">&#x00A0;0.25028656,</span><span
  13091. class="cmtt-8">&#x00A0;</span><span
  13092. class="cmtt-8">&#x00A0;</span><span
  13093. class="cmtt-8">&#x00A0;</span><span
  13094. class="cmtt-8">&#x00A0;0.26655159,</span><span
  13095. class="cmtt-8">&#x00A0;</span><span
  13096. class="cmtt-8">&#x00A0;</span><span
  13097. class="cmtt-8">&#x00A0;</span><span
  13098. class="cmtt-8">&#x00A0;0.28387361,</span>
  13099. <br class="fancyvrb" /><a
  13100. id="x1-125120r60"></a><span
  13101. class="cmr-6">60</span><span
  13102. class="cmtt-8">&#x00A0;</span><span
  13103. class="cmtt-8">&#x00A0;</span><span
  13104. class="cmtt-8">&#x00A0;</span><span
  13105. class="cmtt-8">&#x00A0;0.30232132,</span><span
  13106. class="cmtt-8">&#x00A0;</span><span
  13107. class="cmtt-8">&#x00A0;</span><span
  13108. class="cmtt-8">&#x00A0;</span><span
  13109. class="cmtt-8">&#x00A0;0.32196786,</span><span
  13110. class="cmtt-8">&#x00A0;</span><span
  13111. class="cmtt-8">&#x00A0;</span><span
  13112. class="cmtt-8">&#x00A0;</span><span
  13113. class="cmtt-8">&#x00A0;0.34289114,</span><span
  13114. class="cmtt-8">&#x00A0;</span><span
  13115. class="cmtt-8">&#x00A0;</span><span
  13116. class="cmtt-8">&#x00A0;</span><span
  13117. class="cmtt-8">&#x00A0;0.36517414,</span>
  13118. <br class="fancyvrb" /><a
  13119. id="x1-125122r61"></a><span
  13120. class="cmr-6">61</span><span
  13121. class="cmtt-8">&#x00A0;</span><span
  13122. class="cmtt-8">&#x00A0;</span><span
  13123. class="cmtt-8">&#x00A0;</span><span
  13124. class="cmtt-8">&#x00A0;0.38890521,</span><span
  13125. class="cmtt-8">&#x00A0;</span><span
  13126. class="cmtt-8">&#x00A0;</span><span
  13127. class="cmtt-8">&#x00A0;</span><span
  13128. class="cmtt-8">&#x00A0;0.41417847,</span><span
  13129. class="cmtt-8">&#x00A0;</span><span
  13130. class="cmtt-8">&#x00A0;</span><span
  13131. class="cmtt-8">&#x00A0;</span><span
  13132. class="cmtt-8">&#x00A0;0.44109412,</span><span
  13133. class="cmtt-8">&#x00A0;</span><span
  13134. class="cmtt-8">&#x00A0;</span><span
  13135. class="cmtt-8">&#x00A0;</span><span
  13136. class="cmtt-8">&#x00A0;0.46975890,</span>
  13137. <br class="fancyvrb" /><a
  13138. id="x1-125124r62"></a><span
  13139. class="cmr-6">62</span><span
  13140. class="cmtt-8">&#x00A0;</span><span
  13141. class="cmtt-8">&#x00A0;</span><span
  13142. class="cmtt-8">&#x00A0;</span><span
  13143. class="cmtt-8">&#x00A0;0.50028648,</span><span
  13144. class="cmtt-8">&#x00A0;</span><span
  13145. class="cmtt-8">&#x00A0;</span><span
  13146. class="cmtt-8">&#x00A0;</span><span
  13147. class="cmtt-8">&#x00A0;0.53279791,</span><span
  13148. class="cmtt-8">&#x00A0;</span><span
  13149. class="cmtt-8">&#x00A0;</span><span
  13150. class="cmtt-8">&#x00A0;</span><span
  13151. class="cmtt-8">&#x00A0;0.56742212,</span><span
  13152. class="cmtt-8">&#x00A0;</span><span
  13153. class="cmtt-8">&#x00A0;</span><span
  13154. class="cmtt-8">&#x00A0;</span><span
  13155. class="cmtt-8">&#x00A0;0.60429640,</span>
  13156. <br class="fancyvrb" /><a
  13157. id="x1-125126r63"></a><span
  13158. class="cmr-6">63</span><span
  13159. class="cmtt-8">&#x00A0;</span><span
  13160. class="cmtt-8">&#x00A0;</span><span
  13161. class="cmtt-8">&#x00A0;</span><span
  13162. class="cmtt-8">&#x00A0;0.64356699,</span><span
  13163. class="cmtt-8">&#x00A0;</span><span
  13164. class="cmtt-8">&#x00A0;</span><span
  13165. class="cmtt-8">&#x00A0;</span><span
  13166. class="cmtt-8">&#x00A0;0.68538959,</span><span
  13167. class="cmtt-8">&#x00A0;</span><span
  13168. class="cmtt-8">&#x00A0;</span><span
  13169. class="cmtt-8">&#x00A0;</span><span
  13170. class="cmtt-8">&#x00A0;0.72993007,</span><span
  13171. class="cmtt-8">&#x00A0;</span><span
  13172. class="cmtt-8">&#x00A0;</span><span
  13173. class="cmtt-8">&#x00A0;</span><span
  13174. class="cmtt-8">&#x00A0;0.77736504,</span>
  13175. <br class="fancyvrb" /><a
  13176. id="x1-125128r64"></a><span
  13177. class="cmr-6">64</span><span
  13178. class="cmtt-8">&#x00A0;</span><span
  13179. class="cmtt-8">&#x00A0;</span><span
  13180. class="cmtt-8">&#x00A0;</span><span
  13181. class="cmtt-8">&#x00A0;0.82788260,</span><span
  13182. class="cmtt-8">&#x00A0;</span><span
  13183. class="cmtt-8">&#x00A0;</span><span
  13184. class="cmtt-8">&#x00A0;</span><span
  13185. class="cmtt-8">&#x00A0;0.88168307,</span><span
  13186. class="cmtt-8">&#x00A0;</span><span
  13187. class="cmtt-8">&#x00A0;</span><span
  13188. class="cmtt-8">&#x00A0;</span><span
  13189. class="cmtt-8">&#x00A0;0.9389798,</span><span
  13190. class="cmtt-8">&#x00A0;</span><span
  13191. class="cmtt-8">&#x00A0;</span><span
  13192. class="cmtt-8">&#x00A0;</span><span
  13193. class="cmtt-8">&#x00A0;</span><span
  13194. class="cmtt-8">&#x00A0;1.</span>
  13195. </div>
  13196. <h3 class="sectionHead"><span class="titlemark">A </span> <a
  13197. id="x1-126000A"></a>Embedding Vorbis into an Ogg stream</h3>
  13198. <!--l. 6--><p class="noindent" >
  13199. <h4 class="subsectionHead"><span class="titlemark">A.1 </span> <a
  13200. id="x1-127000A.1"></a>Overview</h4>
  13201. <!--l. 8--><p class="noindent" >This document describes using Ogg logical and physical transport streams to encapsulate Vorbis
  13202. compressed audio packet data into file form.
  13203. <!--l. 12--><p class="noindent" >The <a
  13204. href="#x1-20001">Section&#x00A0;1<!--tex4ht:ref: vorbis:spec:intro --></a>, &#8220;<a
  13205. href="#x1-20001">Introduction and Description<!--tex4ht:ref: vorbis:spec:intro --></a>&#8221; provides an overview of the construction of
  13206. Vorbis audio packets.
  13207. <!--l. 15--><p class="noindent" >The <a
  13208. href="oggstream.html" >Ogg bitstream overview</a> and <a
  13209. href="framing.html" >Ogg logical bitstream and framing spec</a> provide detailed
  13210. descriptions of Ogg transport streams. This specification document assumes a working
  13211. knowledge of the concepts covered in these named backround documents. Please read them
  13212. first.
  13213. <!--l. 22--><p class="noindent" >
  13214. <h5 class="subsubsectionHead"><span class="titlemark">A.1.1 </span> <a
  13215. id="x1-128000A.1.1"></a>Restrictions</h5>
  13216. <!--l. 24--><p class="noindent" >The Ogg/Vorbis I specification currently dictates that Ogg/Vorbis streams use Ogg transport
  13217. streams in degenerate, unmultiplexed form only. That is:
  13218. <ul class="itemize1">
  13219. <li class="itemize">A meta-headerless Ogg file encapsulates the Vorbis I packets
  13220. </li>
  13221. <li class="itemize">The Ogg stream may be chained, i.e., contain multiple, contigous logical streams
  13222. (links).
  13223. </li>
  13224. <li class="itemize">The Ogg stream must be unmultiplexed (only one stream, a Vorbis audio stream,
  13225. per link)
  13226. </li></ul>
  13227. <!--l. 41--><p class="noindent" >This is not to say that it is not currently possible to multiplex Vorbis with other media
  13228. types into a multi-stream Ogg file. At the time this document was written, Ogg was
  13229. becoming a popular container for low-bitrate movies consisting of DivX video and Vorbis
  13230. audio. However, a &#8217;Vorbis I audio file&#8217; is taken to imply Vorbis audio existing alone
  13231. within a degenerate Ogg stream. A compliant &#8217;Vorbis audio player&#8217; is not required to
  13232. implement Ogg support beyond the specific support of Vorbis within a degenrate Ogg
  13233. stream (naturally, application authors are encouraged to support full multiplexed Ogg
  13234. handling).
  13235. <!--l. 55--><p class="noindent" >
  13236. <h5 class="subsubsectionHead"><span class="titlemark">A.1.2 </span> <a
  13237. id="x1-129000A.1.2"></a>MIME type</h5>
  13238. <!--l. 57--><p class="noindent" >The MIME type of Ogg files depend on the context. Specifically, complex multimedia and
  13239. applications should use <span
  13240. class="cmtt-12">application/ogg</span>, while visual media should use <span
  13241. class="cmtt-12">video/ogg</span>, and audio
  13242. <span
  13243. class="cmtt-12">audio/ogg</span>. Vorbis data encapsulated in Ogg may appear in any of those types. RTP
  13244. encapsulated Vorbis should use <span
  13245. class="cmtt-12">audio/vorbis </span>+ <span
  13246. class="cmtt-12">audio/vorbis-config</span>.
  13247. <!--l. 65--><p class="noindent" >
  13248. <h4 class="subsectionHead"><span class="titlemark">A.2 </span> <a
  13249. id="x1-130000A.2"></a>Encapsulation</h4>
  13250. <!--l. 67--><p class="noindent" >Ogg encapsulation of a Vorbis packet stream is straightforward.
  13251. <ul class="itemize1">
  13252. <li class="itemize">The first Vorbis packet (the identification header), which uniquely identifies a stream
  13253. as Vorbis audio, is placed alone in the first page of the logical Ogg stream. This
  13254. results in a first Ogg page of exactly 58 bytes at the very beginning of the logical
  13255. stream.
  13256. </li>
  13257. <li class="itemize">This first page is marked &#8217;beginning of stream&#8217; in the page flags.
  13258. </li>
  13259. <li class="itemize">The second and third vorbis packets (comment and setup headers) may span one or
  13260. more pages beginning on the second page of the logical stream. However many pages
  13261. they span, the third header packet finishes the page on which it ends. The next (first
  13262. audio) packet must begin on a fresh page.
  13263. </li>
  13264. <li class="itemize">The granule position of these first pages containing only headers is zero.
  13265. </li>
  13266. <li class="itemize">The first audio packet of the logical stream begins a fresh Ogg page.
  13267. </li>
  13268. <li class="itemize">Packets are placed into ogg pages in order until the end of stream.
  13269. </li>
  13270. <li class="itemize">The last page is marked &#8217;end of stream&#8217; in the page flags.
  13271. </li>
  13272. <li class="itemize">Vorbis packets may span page boundaries.
  13273. </li>
  13274. <li class="itemize">The granule position of pages containing Vorbis audio is in units of PCM audio
  13275. samples (per channel; a stereo stream&#8217;s granule position does not increment at twice
  13276. the speed of a mono stream).
  13277. </li>
  13278. <li class="itemize">The granule position of a page represents the end PCM sample position of the last
  13279. packet <span
  13280. class="cmti-12">completed </span>on that page. The &#8217;last PCM sample&#8217; is the last complete sample
  13281. returned by decode, not an internal sample awaiting lapping with a subsequent block.
  13282. A page that is entirely spanned by a single packet (that completes on a subsequent
  13283. page) has no granule position, and the granule position is set to &#8217;-1&#8217;.
  13284. <!--l. 126--><p class="noindent" >Note that the last decoded (fully lapped) PCM sample from a packet is not
  13285. necessarily the middle sample from that block. If, eg, the current Vorbis packet
  13286. encodes a &#8221;long block&#8221; and the next Vorbis packet encodes a &#8221;short block&#8221;, the last
  13287. decodable sample from the current packet be at position (3*long_block_length/4) -
  13288. (short_block_length/4).
  13289. </li>
  13290. <li class="itemize">The granule (PCM) position of the first page need not indicate that the stream
  13291. started at position zero. Although the granule position belongs to the last completed
  13292. packet on the page and a valid granule position must be positive, by inference it may
  13293. indicate that the PCM position of the beginning of audio is positive or negative.
  13294. <ul class="itemize2">
  13295. <li class="itemize">A positive starting value simply indicates that this stream begins at some
  13296. positive time offset, potentially within a larger program. This is a common case
  13297. when connecting to the middle of broadcast stream.
  13298. </li>
  13299. <li class="itemize">A negative value indicates that output samples preceeding time zero should be
  13300. discarded during decoding; this technique is used to allow sample-granularity
  13301. editing of the stream start time of already-encoded Vorbis streams. The number
  13302. of samples to be discarded must not exceed the overlap-add span of the first two
  13303. audio packets.
  13304. </li></ul>
  13305. <!--l. 161--><p class="noindent" >In both of these cases in which the initial audio PCM starting offset is nonzero, the
  13306. second finished audio packet must flush the page on which it appears and the
  13307. third packet begin a fresh page. This allows the decoder to always be able to
  13308. perform PCM position adjustments before needing to return any PCM data from
  13309. synthesis, resulting in correct positioning information without any aditional seeking
  13310. logic.
  13311. <!--l. 170--><p class="noindent" ><span class="likesubparagraphHead"><a
  13312. id="x1-131000A.2"></a><span
  13313. class="cmbx-12">Note:</span></span> Failure to do so should, at worst, cause a decoder implementation to return
  13314. incorrect positioning information for seeking operations at the very beginning of the
  13315. stream.
  13316. </li>
  13317. <li class="itemize">A granule position on the final page in a stream that indicates less audio data than the
  13318. final packet would normally return is used to end the stream on other than even frame
  13319. boundaries. The difference between the actual available data returned and the
  13320. declared amount indicates how many trailing samples to discard from the decoding
  13321. process.
  13322. </li></ul>
  13323. <h3 class="sectionHead"><span class="titlemark">B </span> <a
  13324. id="x1-132000B"></a>Vorbis encapsulation in RTP</h3>
  13325. <!--l. 8--><p class="noindent" >Please consult RFC 5215 <span
  13326. class="cmti-12">&#8220;RTP Payload Format for Vorbis Encoded Audio&#8221; </span>for description of
  13327. how to embed Vorbis audio in an RTP stream.
  13328. <h3 class="likesectionHead"><a
  13329. id="x1-133000B"></a>Colophon</h3>
  13330. <!--l. 6--><p class="noindent" ><img
  13331. src="Vorbis_I_spec13x.png" alt="PIC" class="graphics"><!--tex4ht:graphics
  13332. name="Vorbis_I_spec13x.png" src="xifish.pdf"
  13333. -->
  13334. <!--l. 10--><p class="noindent" >Ogg is a <a
  13335. href="http://www.xiph.org/" >Xiph.org Foundation</a> effort to protect essential tenets of Internet multimedia from
  13336. corporate hostage-taking; Open Source is the net&#8217;s greatest tool to keep everyone honest. See
  13337. <a
  13338. href="http://www.xiph.org/about.html" >About the Xiph.org Foundation</a> for details.
  13339. <!--l. 17--><p class="noindent" >Ogg Vorbis is the first Ogg audio CODEC. Anyone may freely use and distribute the Ogg and
  13340. Vorbis specification, whether in a private, public or corporate capacity. However, the Xiph.org
  13341. Foundation and the Ogg project (xiph.org) reserve the right to set the Ogg Vorbis specification
  13342. and certify specification compliance.
  13343. <!--l. 23--><p class="noindent" >Xiph.org&#8217;s Vorbis software CODEC implementation is distributed under a BSD-like license. This
  13344. does not restrict third parties from distributing independent implementations of Vorbis software
  13345. under other licenses.
  13346. <!--l. 28--><p class="noindent" >Ogg, Vorbis, Xiph.org Foundation and their logos are trademarks (tm) of the <a
  13347. href="http://www.xiph.org/" >Xiph.org
  13348. Foundation</a>. These pages are copyright (C) 1994-2007 Xiph.org Foundation. All rights
  13349. reserved.
  13350. <!--l. 33--><p class="noindent" >This document is set using <span class="LATEX">L<span class="A">A</span><span class="TEX">T<span
  13351. class="E">E</span>X</span></span>.
  13352. <h3 class="likesectionHead"><a
  13353. id="x1-134000B"></a>References</h3>
  13354. <!--l. 123--><p class="noindent" >
  13355. <div class="thebibliography">
  13356. <p class="bibitem" ><span class="biblabel">
  13357. [1]<span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span><a
  13358. id="XSporer/Brandenburg/Edler"></a>T.&#x00A0;Sporer, K.&#x00A0;Brandenburg and
  13359. B.&#x00A0;Edler, The use of multirate filter banks for coding of high quality digital audio,
  13360. <a
  13361. href="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps" class="url" ><span
  13362. class="cmtt-12">http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps</span></a>.
  13363. </p>
  13364. </div>
  13365. </body></html>