ippsc.h 270 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458
  1. /* /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // INTEL CORPORATION PROPRIETARY INFORMATION
  4. // This software is supplied under the terms of a license agreement or
  5. // nondisclosure agreement with Intel Corporation and may not be copied
  6. // or disclosed except in accordance with the terms of that agreement.
  7. // Copyright (c) 2001-2009 Intel Corporation. All Rights Reserved.
  8. //
  9. // Intel(R) Integrated Performance Primitives
  10. // Speech Coding
  11. //
  12. */
  13. #if !defined( __IPPSC_H__ ) || defined( _OWN_BLDPCS )
  14. #define __IPPSC_H__
  15. #if defined (_WIN32_WCE) && defined (_M_IX86) && defined (__stdcall)
  16. #define _IPP_STDCALL_CDECL
  17. #undef __stdcall
  18. #endif
  19. #ifndef __IPPDEFS_H__
  20. #include "ippdefs.h"
  21. #endif
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #if !defined( _OWN_BLDPCS )
  26. /* /////////////////////////////////////////////////////////////////////////////
  27. // Speech compression bit rates structure
  28. ///////////////////////////////////////////////////////////////////////////// */
  29. typedef enum {
  30. IPP_SPCHBR_4750 = 0, /* 4.75 kbps GSMAMR */
  31. IPP_SPCHBR_5150, /* 5.15 kbps GSMAMR */
  32. IPP_SPCHBR_5300, /* 5.3 kbps G723.1 */
  33. IPP_SPCHBR_5900, /* 5.9 kbps GSMAMR */
  34. IPP_SPCHBR_6300, /* 6.3 kbps G723.1 */
  35. IPP_SPCHBR_6600, /* 6.60 kbps AMRWB */
  36. IPP_SPCHBR_6700, /* 6.7 kbps GSMAMR */
  37. IPP_SPCHBR_7400, /* 7.4 kbps GSMAMR */
  38. IPP_SPCHBR_7950, /* 7.95 kbps GSMAMR */
  39. IPP_SPCHBR_8850, /* 8.85 kbps AMRWB */
  40. IPP_SPCHBR_9600, /* 9.60 kbps G728 */
  41. IPP_SPCHBR_10200, /* 10.2 kbps GSMAMR */
  42. IPP_SPCHBR_12200, /* 12.2 kbps GSMAMR */
  43. IPP_SPCHBR_12650, /* 12.65 kbps AMRWB */
  44. IPP_SPCHBR_12800, /* 12.8 kbps G728 */
  45. IPP_SPCHBR_14250, /* 14.25 kbps AMRWB */
  46. IPP_SPCHBR_15850, /* 15.85 kbps AMRWB */
  47. IPP_SPCHBR_16000, /* 16 kbps G726, G728 */
  48. IPP_SPCHBR_18250, /* 18.25 kbps AMRWB */
  49. IPP_SPCHBR_19850, /* 19.85 kbps AMRWB */
  50. IPP_SPCHBR_23050, /* 23.05 kbps AMRWB */
  51. IPP_SPCHBR_23850, /* 23.85 kbps AMRWB */
  52. IPP_SPCHBR_24000, /* 24 kbps G726, AMRWBE */
  53. IPP_SPCHBR_32000, /* 32 kbps G726 */
  54. IPP_SPCHBR_40000, /* 40 kbps G726 */
  55. IPP_SPCHBR_DTX, /* Discontinuous TX mode for various codecs*/
  56. /* IPP_SPCHBR_6400, 6.4 kbps G729D
  57. // IPP_SPCHBR_8000, 8.0 kbps G729
  58. // IPP_SPCHBR_11800, 11.8 kbps G729E
  59. // IPP_SPCHBR_13000, 13.0 kbps GSMFR
  60. // IPP_SPCHBR_48000, 48 kbps G722
  61. // IPP_SPCHBR_56000, 56 kbps G722
  62. // IPP_SPCHBR_64000, 64 kbps G711, G722 */
  63. IPP_SPCHBR_10400, /* 10.4 kbps AMRWBE */
  64. IPP_SPCHBR_12000, /* 12.0 kbps AMRWBE */
  65. IPP_SPCHBR_13600, /* 13.6 kbps AMRWBE */
  66. IPP_SPCHBR_15200, /* 15.2 kbps AMRWBE, iLBC */
  67. IPP_SPCHBR_16800, /* 16.8 kbps AMRWBE */
  68. IPP_SPCHBR_19200, /* 19.2 kbps AMRWBE */
  69. IPP_SPCHBR_20800, /* 20.8 kbps AMRWBE */
  70. IPP_SPCHBR_13330 /* 13.33 kbps iLBC */
  71. /* new bitrates to be added to the end */
  72. } IppSpchBitRate;
  73. typedef enum {
  74. IPP_PCM_MULAW = 0, /* mu-Law */
  75. IPP_PCM_ALAW, /* A-Law */
  76. IPP_PCM_LINEAR /* uniform PCM */
  77. } IppPCMLaw;
  78. typedef enum {
  79. IPP_PCM_FREQ_8000 = 8000, /* 8 kHz */
  80. IPP_PCM_FREQ_16000 = 16000, /* 16 kHz */
  81. IPP_PCM_FREQ_22050 = 22050, /* 22.05 kHz */
  82. IPP_PCM_FREQ_32000 = 32000, /* 32 kHz */
  83. IPP_PCM_FREQ_11025 = 11025
  84. } IppPCMFrequency;
  85. typedef enum {
  86. ippsNrNone,
  87. ippsNrLow,
  88. ippsNrMedium,
  89. ippsNrNormal,
  90. ippsNrHigh,
  91. ippsNrAuto
  92. } IppsNRLevel;
  93. typedef enum {
  94. ippsNrNoUpdate=-1,
  95. ippsNrUpdate,
  96. ippsNrUpdateAll
  97. } IppsNrMode;
  98. typedef enum {
  99. ippsNrSmoothDynamic=-1,
  100. ippsNrSmoothStatic,
  101. ippsNrSmoothOff
  102. } IppsNrSmoothMode;
  103. typedef enum {
  104. IPP_G722_VOICED,
  105. IPP_G722_UNVOICED,
  106. IPP_G722_TRANSIENT,
  107. IPP_G722_WEAKLY_VOICED,
  108. IPP_G722_VUV_TRANSITION
  109. } IppG722SBClass;
  110. typedef struct {
  111. Ipp16s pPrevSignalSublevel[9]; /* signal sublevel vector */
  112. Ipp16s pPrevSignalLevel[9]; /* previous signal level vector */
  113. Ipp16s pPrevAverageLevel[9]; /* average signal level */
  114. Ipp16s pBkgNoiseEstimate[9]; /* background noise estimate vector */
  115. Ipp16s pFifthFltState[6]; /* 5th order filters history */
  116. Ipp16s pThirdFltState[5]; /* 3rd order filters history */
  117. Ipp16s burstCount; /* burst counter */
  118. Ipp16s hangCount; /* hangover counter */
  119. Ipp16s statCount; /* stationarity counter */
  120. Ipp16s vadReg; /* intermediate vad decision */
  121. Ipp16s complexHigh; /* high for complex signal decision */
  122. Ipp16s complexLow; /* low for ccomplex signal decision */
  123. Ipp16s complexHangTimer; /* complex hangover timer */
  124. Ipp16s complexHangCount; /* complex hangover counter */
  125. Ipp16s complexWarning; /* complex_warining flag */
  126. Ipp16s corrHp; /* High-pass filtered signal correlation */
  127. Ipp16s pitchFlag; /* pitch flag by pitch detection */
  128. } IppGSMAMRVad1State;
  129. typedef struct {
  130. Ipp32s pEngyEstimate[16]; /* channel energy estimate vector of */
  131. /* current half-frame */
  132. Ipp32s pNoiseEstimate[16]; /* channel noise estimate vector of */
  133. /* current half-frame */
  134. Ipp16s pLongTermEngyDb[16]; /* channel long-term log energy vector */
  135. /* of current half-frame */
  136. Ipp16s preEmphasisFactor; /* pre-emphasize factor */
  137. Ipp16s updateCount; /* update counter */
  138. Ipp16s lastUpdateCount; /* last update counter */
  139. Ipp16s hysterCount; /* hyster counter */
  140. Ipp16s prevNormShift; /* previous normalize shift bits */
  141. Ipp16s shiftState; /* previous half-frame shift state */
  142. Ipp16s forcedUpdateFlag; /* forced update flag */
  143. Ipp16s ltpSnr; /* long-term peak SNR */
  144. Ipp16s variabFactor; /* background noise variability factor */
  145. Ipp16s negSnrBias; /* negative SNR sensitivity Bias */
  146. Ipp16s burstCount; /* burst counter */
  147. Ipp16s hangOverCount; /* hangover counter */
  148. Ipp32s frameCount; /* frame counter */
  149. } IppGSMAMRVad2State;
  150. typedef struct Ipp32s_EC_Sfs_Def {
  151. Ipp32s val;
  152. Ipp32s sf;
  153. } Ipp32s_EC_Sfs;
  154. #endif /* _OWN_BLDPCS */
  155. /* /////////////////////////////////////////////////////////////////////////////
  156. ////////////////////////////////////////////////////////////////////////////////
  157. // Functions declarations
  158. ////////////////////////////////////////////////////////////////////////////////
  159. ///////////////////////////////////////////////////////////////////////////// */
  160. /* /////////////////////////////////////////////////////////////////////////////
  161. // Name: ippscGetLibVersion
  162. // Purpose: getting of the library version
  163. // Returns: the structure of information about version
  164. // of ippSC library
  165. // Parameters:
  166. //
  167. // Notes: not necessary to release the returned structure
  168. */
  169. IPPAPI( const IppLibraryVersion*, ippscGetLibVersion, (void) )
  170. /* /////////////////////////////////////////////////////////////////////////////
  171. // Name: ippsHighPassFilterSize
  172. // Purpose: Knowing of G729 high pass preprocessing filter size demand
  173. // Parameters:
  174. // pSize Pointer to the output value of the memory size needed for filtering
  175. // Returns:
  176. // ippStsNoErr, if no errors
  177. */
  178. IPPAPI( IppStatus, ippsHighPassFilterSize_G729, (int *pSize) )
  179. /* /////////////////////////////////////////////////////////////////////////////
  180. // Name: ippsHighPassFilterInit
  181. // Purpose: Initialization of the memory allocated for preprocessing filter
  182. // Parameters:
  183. // pMem pointer to the memory supplied for filtering
  184. // Returns: ippStsNoErr, if no errors
  185. //
  186. */
  187. IPPAPI( IppStatus, ippsHighPassFilterInit_G729, (const Ipp16s *pCoeff, char* pMem) )
  188. /* /////////////////////////////////////////////////////////////////////////////
  189. // Name: ippsHighPassFilter
  190. // Purpose: G729 input signal preprocessing, consists of two functions applied:
  191. // - scaling ( divide by a factor 2)
  192. // - high-pass filtering
  193. // Parameters:
  194. // pSrcDst pointer to the vector for inplace operation
  195. // pMem pointer to the memory supplied for filtering
  196. // Returns: ippStsNoErr, if no errors
  197. */
  198. IPPAPI( IppStatus, ippsHighPassFilter_G729_16s_ISfs, (Ipp16s* pSrcDst, int len, int scaleFactor,
  199. char* pMem) )
  200. IPPAPI( IppStatus, ippsHighPassFilter_G723_16s, (const Ipp16s* pSrc, Ipp16s* pDst, int* pMem) )
  201. /* /////////////////////////////////////////////////////////////////////////////
  202. // Name: ippsMul
  203. // Purpose: multiply operations upon every element of
  204. // the source vectors.
  205. // rounding to nearest:
  206. // const1 = 1<<(scaleFactor-1)
  207. // (a*b+const1)>>scaleFactor;
  208. // Parameters:
  209. // pSrc pointer to the input vector
  210. // pSrc1 pointer to the first source vector
  211. // pSrc2 pointer to the second source vector
  212. // pDst pointer to the output vector
  213. // pSrcDst pointer to the source/destination vector
  214. // len length of the vectors
  215. // scaleFactor scale factor value
  216. // Returns: ippStsNoErr, if no errors
  217. */
  218. IPPAPI( IppStatus, ippsMul_NR_16s_Sfs, (const Ipp16s* pSrc1, const Ipp16s* pSrc2,
  219. Ipp16s* pDst, int len, int scaleFactor) )
  220. IPPAPI( IppStatus, ippsMul_NR_16s_ISfs, (const Ipp16s* pSrc, Ipp16s* pSrcDst,
  221. int len, int scaleFactor) )
  222. IPPAPI( IppStatus, ippsMulC_NR_16s_ISfs, (Ipp16s val, Ipp16s* pSrcDst, int len, int scaleFactor) )
  223. IPPAPI( IppStatus, ippsMulC_NR_16s_Sfs, ( const Ipp16s* pSrc, Ipp16s val, Ipp16s* pDst,
  224. int len, int scaleFactor) )
  225. /* /////////////////////////////////////////////////////////////////////////////
  226. // Name: ippsMulPowerC
  227. // Purpose: power weighting of every element of the source vectors
  228. // dst[i] = pow(val, i)*src[i] ; i=0..len-1
  229. // with rounding to nearest:
  230. // const1 = 1<<(scaleFactor-1)
  231. // (a*b+const1)>>scaleFactor;
  232. // Parameters:
  233. // pSrc pointer to the input vector
  234. // pDst pointer to the output vector
  235. // len length of the vectors
  236. // scaleFactor scale factor value
  237. // Returns: ippStsNoErr, if no errors
  238. */
  239. IPPAPI( IppStatus, ippsMulPowerC_NR_16s_Sfs, (const Ipp16s* pSrc, Ipp16s val, Ipp16s* pDst,
  240. int len, int scaleFactor) )
  241. /* /////////////////////////////////////////////////////////////////////////////
  242. // Name: ippsInvSqrt
  243. // Purpose: Inverted square root with normalization
  244. // Parameters:
  245. // pSrcDst pointer to the input/output vector
  246. // len length of the input vector
  247. // Returns: ippStsNoErr, if no errors
  248. */
  249. IPPAPI( IppStatus, ippsInvSqrt_32s_I, (Ipp32s *pSrcDst, int len ) )
  250. /* /////////////////////////////////////////////////////////////////////////////
  251. // Name: ippsAutoScale
  252. // Purpose: Autoscaling: Find and normalize (shift left) the absolute
  253. // maximal element and then do the same shift for all other elements
  254. // Parameters:
  255. // pSrc pointer to the input vector
  256. // pDst pointer to the output vector
  257. // pSrcDst pointer to the input/output vector
  258. // len length of the input vector
  259. // pScale pointer to the output scaling factor
  260. // (number of bit the output vector has been shifted left)
  261. // Returns: ippStsNoErr, if no errors
  262. */
  263. IPPAPI( IppStatus, ippsAutoScale_16s, (const Ipp16s *pSrc, Ipp16s *pDst, int Len , int *pScale) )
  264. IPPAPI( IppStatus, ippsAutoScale_16s_I, ( Ipp16s *pSrcDst, int Len , int *pScale) )
  265. /* /////////////////////////////////////////////////////////////////////////////
  266. // Name: ippsAutoCorrLagMax
  267. // Purpose: Find the maximum of the correlation for the given lag range
  268. // r[lag]=SUM(n=0,...,len-1) src[n]*src[n-lag] - backward
  269. // r[lag]=SUM(n=0,...,len-1) src[n]*src[n+lag] - forward
  270. // within the range [lowerLag,upperLag] of the lags.
  271. // Parameters:
  272. // pSrc pointer to the input vector
  273. // len length of the input vector
  274. // lowerLag lower input lag value
  275. // upperLag upper input lag value
  276. // pMax pointer to the output maximum of the correlation
  277. // maxLag pointer to the output lag value that hold maximum
  278. // Returns: ippStsNoErr, if no errors
  279. */
  280. IPPAPI( IppStatus, ippsAutoCorrLagMax_Fwd_16s, (const Ipp16s *pSrc, int len, int lowerLag,
  281. int upperLag, Ipp32s *pMax, int *maxLag ) )
  282. IPPAPI( IppStatus, ippsAutoCorrLagMax_Inv_16s, (const Ipp16s *pSrc, int len, int lowerLag,
  283. int upperLag, Ipp32s *pMax, int *maxLag ) )
  284. IPPAPI( IppStatus, ippsAutoCorrLagMax_32f,(const Ipp32f *pSrc, int len, int lowerLag,
  285. int upperLag, Ipp32f *pMax, int *maxLag ))
  286. /* /////////////////////////////////////////////////////////////////////////////
  287. // Name: ippsAutoCorr_NormE
  288. // Purpose: Compute autocorrelation using formula:
  289. // r[n]=SUM(i=0,...,len-n-1) src[i]*src[i+n], n=0,...,lenDst-1
  290. // Norm in function name means multiplication of result by normalzation factor
  291. // of corr[0].
  292. // Parameters:
  293. // pSrc pointer to the input vector
  294. // len length of the input vector
  295. // step
  296. // pDst pointer to the output autocorrelation vector
  297. // lenDst length of the output vector
  298. // Returns: ippStsNoErr, if no errors
  299. // ippStsOverflow, if at least one result really was saturated
  300. */
  301. IPPAPI( IppStatus, ippsAutoCorr_16s32s,
  302. (const Ipp16s *pSrc, int srcLen, Ipp32s *pDst, int dstLen ))
  303. IPPAPI( IppStatus, ippsAutoCorr_NormE_16s32s, (const Ipp16s *pSrc, int len, Ipp32s *pDst,
  304. int lenDst, int *pNorm) )
  305. IPPAPI( IppStatus, ippsAutoCorr_NormE_NR_16s, (const Ipp16s *pSrc, int len, Ipp16s *pDst,
  306. int lenDst, int *pNorm) )
  307. IPPAPI( IppStatus, ippsAutoCorr_NormE_G723_16s, (const Ipp16s *pSrc, Ipp16s *pDst, int *pNorm) )
  308. /* /////////////////////////////////////////////////////////////////////////////
  309. // Name: ippsToeplizMatrix
  310. // Purpose: Compute of the autocorrelation matrix for the impulse response
  311. // Parameters:
  312. // pSrc pointer to the input vector (Impulse response)
  313. // pDst pointer to the output autocorrelation matrix
  314. // Returns: ippStsNoErr, if no errors
  315. */
  316. IPPAPI( IppStatus, ippsToeplizMatrix_G729_16s32s,(const Ipp16s *pSrcImpulseResponse, Ipp32s *pDstMatrix))
  317. IPPAPI( IppStatus, ippsToeplizMatrix_G729_16s, (const Ipp16s *pSrcImpulseResponse, Ipp16s *pDstMatrix))
  318. IPPAPI( IppStatus, ippsToeplizMatrix_G723_16s32s,(const Ipp16s *pSrcImpulseResponse, Ipp32s *pDstMatrix))
  319. IPPAPI( IppStatus, ippsToeplizMatrix_G723_16s, (const Ipp16s *pSrcImpulseResponse, Ipp16s *pDstMatrix))
  320. IPPAPI( IppStatus, ippsToeplizMatrix_G729_32f, (const Ipp32f *pSrcImpulseResponse, Ipp32f *pDstMatrix))
  321. IPPAPI( IppStatus, ippsToeplizMatrix_G729D_32f, (const Ipp32f *pSrcImpulseResponse, Ipp32f *pDstMatrix))
  322. /* /////////////////////////////////////////////////////////////////////////////
  323. // Name: ippsCrossCorr
  324. // Purpose: Compute crosscorrelation of two vectors using formula:
  325. // r[k]=SUM(i=k,...,len) src2[i]*src1[j-i] k=0,...,lenDst-1
  326. // result is scaled so that the crosscorrelation maximum is int 13 bit
  327. // Parameters:
  328. // pSrc1 pointer to the input vector
  329. // pSrc2 pointer to the input vector
  330. // len length of the correlation
  331. // pDst pointer to the output crosscorrelation vector
  332. // lenDst length of the output vector
  333. // scaleFactor Scale factor of the destination vector.
  334. // Returns: ippStsNoErr, if no errors
  335. */
  336. IPPAPI( IppStatus, ippsCrossCorr_NormM_16s, (const Ipp16s *pSrc1, const Ipp16s *pSrc2, int len,
  337. Ipp16s *pDst) )
  338. IPPAPI( IppStatus, ippsCrossCorr_16s32s_Sfs, (const Ipp16s *pSrc1, const Ipp16s *pSrc2, int len,
  339. Ipp32s *pDst, int scaleFactor) )
  340. IPPAPI(IppStatus, ippsCrossCorr_NR_16s, ( const Ipp16s* pSrc1, const Ipp16s* pSrc2, int len,
  341. Ipp16s* pDst, int lenDst))
  342. IPPAPI ( IppStatus, ippsCrossCorr_NR_16s_Sfs, (const Ipp16s* pSrc1, const Ipp16s* pSrc2, int len, Ipp16s* pDst, int lenDst, int scaleFactor))
  343. IPPAPI ( IppStatus, ippsCrossCorr_NR_16s32s, (const Ipp16s *pSrc1, const Ipp16s *pSrc2, Ipp32s len, Ipp32s *pDst, Ipp32s lenDst))
  344. /* /////////////////////////////////////////////////////////////////////////////
  345. // Name: ippsCrossCorrLagMax
  346. // Purpose: Find the maximum of the cross-correlation for the given lag range [0,lag]
  347. // r[lag]=SUM(n=0,...,len-1) src1[n]*src2[n+lag]
  348. // within the range [lowerLag,upperLag] of the lags.
  349. // Parameters:
  350. // pSrc pointer to the input vector
  351. // len length of the input vector
  352. // lag max lag value
  353. // pMax pointer to the output maximum of the correlation
  354. // pMaxLag pointer to the output lag value that hold maximum
  355. // Returns: ippStsNoErr, if no errors
  356. */
  357. IPPAPI(IppStatus, ippsCrossCorrLagMax_16s, (const Ipp16s *pSrc1, const Ipp16s *pSrc2, int len,
  358. int lag, Ipp32s *pMax, int *pMaxLag))
  359. IPPAPI(IppStatus, ippsCrossCorrLagMax_32f64f,(const Ipp32f *pSrc1, const Ipp32f *pSrc2, int len,
  360. int lag, Ipp64f *pMax, int *pMaxLag ))
  361. /* /////////////////////////////////////////////////////////////////////////////
  362. // Name: ippsOpenLoopPitchSearch
  363. // Purpose: Find the best codebook delay by open-loop pitch analysis
  364. // r[lag]=SUM(n=0,...,L_FRAME-1) src[n]*src[n-lag]
  365. // within the range [lowerLag,upperLag] of the lags.
  366. // Parameters:
  367. // pSrc pointer to the input vector of range [pSrc-upperLag,pSrc+L_FRAME-1]
  368. // bestLag pointer to the output best open-loop pitch lag
  369. // Returns: ippStsNoErr, if no errors
  370. */
  371. IPPAPI( IppStatus, ippsOpenLoopPitchSearch_G729_16s, (const Ipp16s *pSrc, Ipp16s* bestLag) )
  372. IPPAPI( IppStatus, ippsOpenLoopPitchSearch_G729A_16s,(const Ipp16s *pSrc, Ipp16s* bestLag) )
  373. IPPAPI( IppStatus, ippsOpenLoopPitchSearch_G729A_32f,(const Ipp32f *pSrc, Ipp32s* bestLag))
  374. IPPAPI( IppStatus, ippsOpenLoopPitchSearch_G723_16s, (const Ipp16s *pSrc, Ipp16s* bestLag ) )
  375. /* /////////////////////////////////////////////////////////////////////////////
  376. // Name: ippsDotProd
  377. // Purpose: Compute dot product of two input signals using formula:
  378. // energy=SUM(n=0,...,len-1) src1[n]*src2[n]
  379. // AutoScale function interchange downscaling by 1 of input vectors until
  380. // no overflow occured, returns total number of shifts right.
  381. // Parameters:
  382. // pSrc1 pointer to the first input vector
  383. // pSrc2 pointer to the second input vector
  384. // len length of each input vectors
  385. // pDp pointer to the output result value
  386. // pSfs pointer to the output total number of shifts right done to avoid overflow
  387. // Returns: ippStsNoErr, if no errors
  388. // ippStsOverflow, if at least one result really was saturated
  389. */
  390. IPPAPI( IppStatus, ippsDotProd_G729A_16s32s,
  391. (const Ipp16s* pSrc1, const Ipp16s* pSrc2, int len, Ipp32s* pDp) )
  392. IPPAPI( IppStatus, ippsDotProd_G729A_32f,
  393. (const Ipp32f* pSrc1, const Ipp32f* pSrc2, int len, Ipp32f* pDp) )
  394. IPPAPI( IppStatus, ippsDotProdAutoScale_16s32s_Sfs,
  395. (const Ipp16s* pSrc1, const Ipp16s* pSrc2, int len, Ipp32s* pDp, int *pSfs) )
  396. /* /////////////////////////////////////////////////////////////////////////////
  397. // Name: ippsLagWindow
  398. // Purpose: A 60 Hz bandwidth expansion is applied to input auto-correlation
  399. // r[0]=1.0001*r[0];
  400. // r[k]=wlag[k]*r[k];
  401. // 60 Hz bandwidth expansion coefficients
  402. // w_lag(k)=exp[-1/2*(2*pi*f0*k/fs)^2]
  403. // where : f0 = 60 Hz
  404. // fs = 8000 Hz
  405. // Parameters:
  406. // pSrcDst pointer to the autocorrelation vector
  407. // len length of the autocorrelation vector
  408. // Returns: ippStsNoErr, if no errors
  409. */
  410. IPPAPI( IppStatus, ippsLagWindow_G729_32s_I, (Ipp32s *pSrcDst, int len) )
  411. /* /////////////////////////////////////////////////////////////////////////////
  412. // Name: ippsLSPToLSF
  413. // pLSF[i] = arccos(pLSP[i]); i=0,...,10
  414. // pLSP pointer to the LSP input vector of values 15 bit scaled in range [-1:1]
  415. // pLSF pointer to the LSF output vector
  416. // ippsLSPToLSF_G729_16s: 13 bit scaled in range [0:pi]
  417. // ippsLSPToLSF_Norm_G729_16s: 15 bit scaled in range [0:0.5]
  418. // Parameters:
  419. // Returns: ippStsNoErr, if no errors
  420. */
  421. IPPAPI( IppStatus, ippsLSPToLSF_G729_16s, (const Ipp16s *pLSP, Ipp16s *pLSF) )
  422. IPPAPI( IppStatus, ippsLSPToLSF_Norm_G729_16s, (const Ipp16s *pLSP, Ipp16s *pLSF) )
  423. /* /////////////////////////////////////////////////////////////////////////////
  424. // Name: ippsLSFQuant
  425. // Purpose: Quantize of LSPs
  426. // Parameters:
  427. // pLSF pointer to the input vector of LSF representation of LSP
  428. // pQuantLSFTable pointer to the table of the previously quantized LSFs
  429. // prevLSF pointer to the input vector of previously quantized LSFs
  430. // pQuantLSF pointer to the output vector of quantized LSF
  431. // quantIndex pointer to the output combined codebook indices
  432. // G729 - MA,L0,L1,L2
  433. // Returns: ippStsNoErr, if no errors
  434. // ippStsLSFHigh, ippStsLSFLow or ippStsLSFLowAndHigh warnings
  435. */
  436. IPPAPI( IppStatus, ippsLSFQuant_G729_16s, (const Ipp16s *pLSF, Ipp16s *pQuantLSFTable,
  437. Ipp16s *pQuantLSF, Ipp16s *quantIndex) )
  438. IPPAPI( IppStatus, ippsLSFQuant_G729B_16s, (const Ipp16s *pLSF, Ipp16s *pQuantLSFTable,
  439. Ipp16s *pQuantLSF, Ipp16s *quantIndex) )
  440. IPPAPI ( IppStatus, ippsLSFQuant_G729B_32f,(const Ipp32f *pLSF, Ipp32f *pQuantLSFTable,
  441. Ipp32f *pQuantLSF, int *quantIndex) )
  442. /* /////////////////////////////////////////////////////////////////////////////
  443. // Name: ippsLSFDecode
  444. // Purpose: Construct LSFs by codebook indices
  445. // Parameters:
  446. // quantIndex pointer to the input vector of codebook indices ( L0,L1,L2 )
  447. // pQuantLSFTable pointer to the table of previously quantized LSFs
  448. // pPrevLSF pointer to the input vector of the previously quantized LSFs
  449. // pLSF pointer to the constructed LSF output vector
  450. // Returns: ippStsNoErr, if no errors
  451. // ippStsLSFHigh, ippStsLSFLow or ippStsLSFLowAndHigh warnings
  452. */
  453. IPPAPI( IppStatus, ippsLSFDecode_G729_16s, (const Ipp16s *quantIndex, Ipp16s *pQuantLSPTable,
  454. Ipp16s *pQuantLSF) )
  455. IPPAPI (IppStatus, ippsLSFDecode_G729_32f, (const int *quantIndex, Ipp32f *pQuantLSFTable,
  456. Ipp32f *pQuantLSF) )
  457. IPPAPI( IppStatus, ippsLSFDecodeErased_G729_16s, (Ipp16s maIndex, Ipp16s *pQuantLSFTable,
  458. const Ipp16s *pLSF) )
  459. IPPAPI ( IppStatus,ippsLSFDecodeErased_G729_32f, (int maIndex, Ipp32f *pQuantLSFTable,
  460. const Ipp32f *pSrcPrevLSF))
  461. IPPAPI( IppStatus, ippsLSFDecode_G729B_16s, (const Ipp16s *quantIndex, Ipp16s *pQuantLSFTable,
  462. Ipp16s *pLSF) )
  463. IPPAPI ( IppStatus, ippsLSFDecode_G729B_32f,(const int *quantIndex, Ipp32f *pQuantLSFTable, Ipp32f *pDstQLsp ))
  464. IPPAPI( IppStatus, ippsLSFDecode_G723_16s, ( const Ipp16s *quantIndex, const Ipp16s *pPrevLSF,
  465. int erase, Ipp16s *pLSF ) )
  466. /* /////////////////////////////////////////////////////////////////////////////
  467. // Name: ippsLSFToLSP
  468. // Purpose: LSF interpolation and conversion to LPC
  469. // Parameters:
  470. // pLSF pointer to the LSF input vector
  471. // pLPC pointer to the LPC output vector of values in range [-1,1] 15 bit scaled
  472. // Returns: ippStsNoErr, if no errors
  473. //
  474. */
  475. IPPAPI( IppStatus, ippsLSFToLSP_G729_16s, (const Ipp16s *pLSF, Ipp16s *pLSP) )
  476. IPPAPI( IppStatus, ippsLSFToLSP_GSMAMR_16s, (const Ipp16s *pLSF, Ipp16s *pLSP) )
  477. /* /////////////////////////////////////////////////////////////////////////////
  478. // Name: ippsInterpolation
  479. // Purpose: interpolation of two vector
  480. // ippsInterpolation_G729_16s: dst = ((src1+sign(src1) )>>1+((src2+sign(src2) )>>1
  481. // ippsInterpolationC_G729_16s_Sfs: dst = (val1*src1+val2*src2)>>scaleFactor
  482. // ippsInterpolation_GSMAMR_16s: dst = (src1>>2)+(src2-(src2>>2))
  483. // Parameters:
  484. // pSrc1 pointer to the input vector1
  485. // pSrc2 pointer to the input vector2
  486. // pDst pointer to the interpolated output vector
  487. // val1 interp. coeff. of first vector
  488. // val2 interp. coeff. of second vector
  489. // scaleFactor scaling factor to apply to the result
  490. // len length of the vectors
  491. / Returns: ippStsNoErr, if no errors
  492. */
  493. IPPAPI( IppStatus, ippsInterpolate_G729_16s, (const Ipp16s *pSrc1, const Ipp16s *pSrc2,
  494. Ipp16s *pDst, int len) )
  495. IPPAPI( IppStatus, ippsInterpolateC_G729_16s_Sfs, (const Ipp16s *pSrc1, Ipp16s val1,
  496. const Ipp16s *pSrc2, Ipp16s val2, Ipp16s *pDst, int len, int scaleFactor) )
  497. IPPAPI( IppStatus, ippsInterpolateC_NR_G729_16s_Sfs, (const Ipp16s *pSrc1, Ipp16s val1,
  498. const Ipp16s *pSrc2, Ipp16s val2, Ipp16s *pDst, int len, int scaleFactor) )
  499. IPPAPI( IppStatus, ippsInterpolateC_G729_32f,(const Ipp32f *pSrc1, Ipp32f val1,
  500. const Ipp32f *pSrc2, Ipp32f val2, Ipp32f *pDst, int len))
  501. IPPAPI ( IppStatus, ippsInterpolate_GSMAMR_16s,
  502. (const Ipp16s *pSrc1, const Ipp16s *pSrc2, Ipp16s *pDst, int len))
  503. /* ////////////////////////////////////////////////////////////////////////////////////////
  504. // Name: ippsLSPToLPC
  505. // Purpose: LSP conversion to LPC
  506. // Parameters:
  507. // pLSP pointer to the LSP input vector
  508. // pLPC pointer to the LPC output vector of values in range [-1,1] 15 bit scaled
  509. // pLSFLPC pointer to the input LSF/output LPC vector
  510. // Returns: ippStsNoErr, if no errors
  511. //
  512. */
  513. IPPAPI( IppStatus, ippsLSPToLPC_G729_16s, (const Ipp16s *pSrcLSP, Ipp16s *pDstLPC) )
  514. IPPAPI( IppStatus, ippsLSPToLPC_G729_32f, (const Ipp32f *pSrcLSP, Ipp32f *pDstLPC) )
  515. /* ///////////////////////////////////////////////////////////////////////////////////////
  516. // Name: ippsResidualFilter
  517. // Purpose: Compute the LPC residual by filtering the input speech through A(z)
  518. // Parameters:
  519. // pSrc pointer to the input vector[-order,..,-1,0,...,,len-1]
  520. // pSrcLPC pointer to the input LPC
  521. // pDst pointer to the output vector of length[len]
  522. // order LPC filer order
  523. // len length of output vector
  524. // With default order=10, len=40 for ippsResidualFilter_G729_16s
  525. // Returns: ippStsNoErr, if no errors
  526. //
  527. */
  528. IPPAPI( IppStatus, ippsResidualFilter_G729_16s, ( const Ipp16s * pSrc, const Ipp16s * pSrcLPC,
  529. Ipp16s * pDst) )
  530. IPPAPI( IppStatus, ippsResidualFilter_G729E_16s,(
  531. const Ipp16s *pSrcLPC, Ipp16s order, const Ipp16s *pSrc, Ipp16s *pDst, int len))
  532. /* ///////////////////////////////////////////////////////////////////////////////////////
  533. // Name: ippsSynthesisFilter
  534. // Purpose: Compute the speech signal by synthesis filtering of the input speech through
  535. // 1/A(z)
  536. // Parameters:
  537. // pSrc,pSrcSignal pointer to the input vector[len]
  538. // pLPC pointer to the input LPC[0,..,10]
  539. // pSrcLpc pointer to the input LPC[0,..,order]
  540. // pSrcDst pointer to the history input/filtered output
  541. // pDst,pSrcDstSignal pointer to the filtered output vector[len]
  542. // pMem Pointer to the memory[-10,...,-1] supplied for filtering
  543. // pSrcDstSynFltMemory Pointer to the memory[-order,..,-1] supplied for filtering
  544. // Returns: ippStsNoErr, if no errors
  545. // ippStsOverflow, if at least one result really was saturated
  546. */
  547. IPPAPI( IppStatus, ippsSynthesisFilter_NR_16s_Sfs, (const Ipp16s * pLPC, const Ipp16s * pSrc,
  548. Ipp16s * pDst, int len, int scaleFactor, const Ipp16s *pMem) )
  549. IPPAPI( IppStatus, ippsSynthesisFilterLow_NR_16s_ISfs, (const Ipp16s * pLPC, Ipp16s * pSrcDst,
  550. int len, int scaleFactor, const Ipp16s *pMem) )
  551. IPPAPI( IppStatus, ippsSynthesisFilter_NR_16s_ISfs, (const Ipp16s * pLPC, Ipp16s * pSrcDst,
  552. int len, int scaleFactor, const Ipp16s *pMem) )
  553. IPP_DEPRECATED("use ippsSynthesisFilter_NR_16s_Sfs function instead of this one")\
  554. IPPAPI( IppStatus, ippsSynthesisFilter_G729_16s,
  555. (const Ipp16s * pSrcResidual, const Ipp16s * pSrcLPC, Ipp16s * pSrcDstSpch))
  556. IPPAPI(IppStatus, ippsSynthesisFilterZeroStateResponse_NR_16s,
  557. (const Ipp16s * pSrcLPC, Ipp16s * pDstImp, int len, int scaleFactor))
  558. IPPAPI( IppStatus, ippsSynthesisFilter_G729E_16s,(
  559. const Ipp16s *pSrcLpc, Ipp16s order, const Ipp16s *pSrcSignal,
  560. Ipp16s *pDstFltSignal, int len, Ipp16s *pSrcDstSynFltMemory))
  561. IPPAPI( IppStatus, ippsSynthesisFilter_G729_32f,(
  562. const Ipp32f *pSrcLpc, Ipp32s order, const Ipp32f *pSrcSignal,
  563. Ipp32f *pDstFltSignal, int len, Ipp32f *pSrcDstSynFltMemory))
  564. IPPAPI( IppStatus, ippsSynthesisFilter_G729E_16s_I,(
  565. const Ipp16s *pSrcLpc, Ipp16s order, Ipp16s *pSrcDstSignal,
  566. int len, Ipp16s *pSrcDstSynFltMemory))
  567. /* /////////////////////////////////////////////////////////////////////////////
  568. // Name: ippsConvPartial
  569. // Purpose: Linear Convolution of 1D signals
  570. // dst[n] = sum(i=[0,n])(src1[i]*src2[n-i]), n=[0,len-1]
  571. // computation is the same as for
  572. // ippsConv_16s32s(pSrc1,len,pSrc2,len,pDst)
  573. // but only len results are computed and written to destination vector.
  574. // dst[n] = sum(i=[0,n])(src1[i]*src2[n-i]), n=[0,len-1]
  575. // NR: rounding to nearest:
  576. // const1 = 1<<(scaleFactor-1)
  577. // (a*b+const1)>>scaleFactor;
  578. // Parameters:
  579. // pSrc1 pointer to the first source vector
  580. // pSrc2 pointer to the second source vector
  581. // pDst pointer to the destination vector
  582. // len length of the destination vector
  583. // Returns: IppStatus
  584. // ippStsNoErr if no error
  585. */
  586. IPPAPI(IppStatus, ippsConvPartial_NR_Low_16s,(const Ipp16s *pSrc1,
  587. const Ipp16s *pSrc2, Ipp16s *pDst, int len))
  588. IPPAPI(IppStatus, ippsConvPartial_NR_16s,
  589. (const Ipp16s *pSrc1,const Ipp16s *pSrc2, Ipp16s *pDst, int len))
  590. IPPAPI(IppStatus, ippsConvPartial_16s_Sfs,
  591. ( const Ipp16s* pSrc1, const Ipp16s* pSrc2, Ipp16s* pDst, int len, int scaleFactor) )
  592. IPPAPI(IppStatus, ippsConvPartial_16s32s,
  593. ( const Ipp16s* pSrc1, const Ipp16s* pSrc2, Ipp32s* pDst, int len))
  594. /* /////////////////////////////////////////////////////////////////////////////
  595. // Name: ippsDecodeAdaptiveVector
  596. // Purpose: Compute adaptive-codebook vector by interpolatindg the past excitation signal
  597. // at the given integer delay and fraction
  598. // Parameters:
  599. // pSrcDstPrevExcitation pointer to the source/destination past excitation signal
  600. // pDstAdptVector pointer to the destination adaptive-codebook vector
  601. // pSrcDelay pointer to fractional pitch delay:
  602. // pSrcDelay[0] - pitch delay
  603. // pSrcDelay[1] - pitch fraction
  604. // Returns: IppStatus
  605. // ippStsNoErr if no error
  606. */
  607. IPPAPI( IppStatus, ippsDecodeAdaptiveVector_G729_16s_I,(const Ipp16s * pSrcDelay,
  608. Ipp16s * pSrcDstPrevExcitation))
  609. IPPAPI( IppStatus, ippsDecodeAdaptiveVector_G729_32f_I,(const Ipp32s * pSrcDelay,
  610. Ipp32f * pSrcDstPrevExcitation))
  611. IPPAPI( IppStatus, ippsDecodeAdaptiveVector_G729_16s,(const Ipp16s * pSrcDelay,
  612. Ipp16s * pSrcDstPrevExcitation, Ipp16s * pDstAdptVector))
  613. /* /////////////////////////////////////////////////////////////////////////////
  614. // Name: ippsAdaptiveCodebookContribution
  615. // Purpose: Update target vector for codebook search
  616. // by subtracting the adaptive codebook contribition:
  617. // pDstFltAdptVector[i] = pSrcAdptTarget[i]-gain*pDstFltAdptVector[i];
  618. // G.729 3.8.1
  619. // Parameters:
  620. // gain adaptive codebook gain
  621. // pFltAdptVector pointer to the filtered adaptive codebook vector y(n)
  622. // pSrcAdptTarget pointer to the target signal
  623. // pDstAdptTarget pointer to the output target signal
  624. (updated by subtracting the adaptive codebook contribition)
  625. // Returns: IppStatus
  626. // ippStsNoErr if no error
  627. */
  628. IPPAPI(IppStatus,ippsAdaptiveCodebookContribution_G729_16s, (Ipp16s gain,
  629. const Ipp16s *pFltAdptVector, const Ipp16s *pSrcAdptTarget, Ipp16s* pDstAdptTarget))
  630. IPPAPI(IppStatus, ippsAdaptiveCodebookContribution_G729_32f,(Ipp32f gain,
  631. const Ipp32f *pFltAdptVector, const Ipp32f *pSrcAdptTarget, Ipp32f* pDstAdptTarget))
  632. /* /////////////////////////////////////////////////////////////////////////////
  633. // Name: ippsFixedCodebookSearch
  634. // Purpose: Search in fixed codebook for four non zero pulses, which minimize MSE
  635. // between the weighted input speech and weighted teconstructed speech.
  636. // The target signal used in the close-loop pitch search is updated by
  637. // substracting of adaptive-codebook contribution by formulae:
  638. // x[n] = x[n] - g*y[n], n=0,...,39
  639. // where: g - adaptive-codebook gain
  640. // y - filtered adaptive-codebook vector
  641. // x - weighted input
  642. // Parameters:
  643. // pSrcFixedCorr pointer to the correlation vector of the impulse response and target
  644. // pSrcDstMatrix pointer to the correlation matrix of impulse response.
  645. // pDstFixedVector pointer to the output selected acodeword
  646. // pSearchTimes pointer to the input/output extra searching time
  647. // pDstFixedIndex pointer to the output codeword index
  648. // pSrc1 pointer to the correlation vector of the impulse response and target
  649. // pSrcDst pointer to the correlation matrix of impulse response.
  650. // pSrc2 Impulse response
  651. // pDst1 pointer to the output selected acodeword
  652. // pDst2 pointer to the output filteredcodeword
  653. // pSign pointer to the output sign of 4 pulses selected
  654. // subFrame input sub frame number (0,1)
  655. // extraTime pointer to the input/output extra searching time
  656. // pDstFixedIndex pointer to the output codeword index
  657. // valLpMode Backward / Forward LP mode indication
  658. // len length of the destination vectors
  659. // Returns: IppStatus
  660. // ippStsNoErr if no error
  661. */
  662. IPPAPI(IppStatus, ippsFixedCodebookSearch_G729_32s16s, (const Ipp16s *pSrcFixedCorr,
  663. Ipp32s *pSrcDstMatrix, Ipp16s *pDstFixedVector,
  664. Ipp16s *pDstFixedIndex, Ipp16s *pSearchTimes, Ipp16s subFrame))
  665. IPPAPI(IppStatus, ippsFixedCodebookSearch_G729_16s, (const Ipp16s *pSrcFixedCorr,
  666. Ipp16s *pSrcDstMatrix, Ipp16s *pDstFixedVector,
  667. Ipp16s *pDstFixedIndex, Ipp16s *pSearchTimes, Ipp16s subFrame))
  668. IPPAPI(IppStatus,ippsFixedCodebookSearch_G729A_32s16s,(const Ipp16s *pSrcFixedCorr,
  669. Ipp32s *pSrcDstMatrix, Ipp16s *pDstFixedVector, Ipp16s *pDstFixedIndex))
  670. IPPAPI(IppStatus,ippsFixedCodebookSearch_G729A_16s,(const Ipp16s *pSrcFixedCorr,
  671. Ipp16s *pSrcDstMatrix, Ipp16s *pDstFixedVector, Ipp16s *pDstFixedIndex))
  672. IPPAPI(IppStatus, ippsFixedCodebookSearch_G729E_16s,(
  673. Ipp16s valLpMode, const Ipp16s* pSrcFixedTarget, const Ipp16s* pSrcLtpResidual,
  674. const Ipp16s* pSrcImpulseResponse, Ipp16s* pDstFixedVector, Ipp16s* pDstFltFixedVector,
  675. Ipp16s* pDstFixedIndex))
  676. IPPAPI(IppStatus, ippsFixedCodebookSearch_G729D_16s,(const Ipp16s *pSrcFixedCorr,
  677. const Ipp16s *pSrcImpulseResponse, Ipp16s *pDstFixedVector, Ipp16s *pDstFltFixedVector,
  678. Ipp16s *pDstSign, Ipp16s *pDstFixedIndex))
  679. IPPAPI(IppStatus, ippsFixedCodebookSearch_G729_32f,(const Ipp32f *pSrcFixedCorr,
  680. Ipp32f *pSrcDstMatrix, Ipp32f *pDstFixedVector, Ipp32s *pDstFixedIndex,
  681. Ipp32s *pSearchTimes, Ipp32s subFrame))
  682. IPPAPI(IppStatus,ippsFixedCodebookSearch_G729A_32f,(const Ipp32f *pSrcFixedCorr,
  683. Ipp32f *pSrcDstMatrix, Ipp32f *pDstFixedVector, Ipp32s *pDstFixedIndex))
  684. IPPAPI(IppStatus,ippsFixedCodebookSearch_G729D_32f,(Ipp32f *pSrcDstFixedCorr,
  685. Ipp32f *pSrcDstMatrix, const Ipp32f *pSrcImpulseResponse,
  686. Ipp32f *pDstFixedVector, Ipp32f *pDstFltFixedVector, Ipp32s *pDstFixedIndex))
  687. IPPAPI(IppStatus,ippsFixedCodebookSearch_G729E_32f, (int mode,
  688. Ipp32f *pSrcDstFixedCorr, const Ipp32f *pSrcLtpResidual,
  689. const Ipp32f *pSrcImpulseResponse, Ipp32f *pDstFixedVector,
  690. Ipp32f *pDstFltFixedVector, Ipp32s *pDstFixedIndex))
  691. /* /////////////////////////////////////////////////////////////////////////////
  692. // Name: ippsHarmonicFilter
  693. // Purpose: Enchance harmonic component of signal by formulae:
  694. // y[n] = x[n] + val * x[n-T] - harmonic nose shaping: 1+val*z^(-T)
  695. // y[n] = y[n] + val * y[n-T] - adaptive pre-filter: 1/(1-val*z^(-T) )
  696. // Parameters:
  697. // val the input factor of filter
  698. // T the value of delay
  699. // pSrc pointer to the input vector
  700. // pDst pointer to the output vector
  701. // pSrcDst pointer to the input/output vector
  702. // len number of output results needed.
  703. // pSrc[-T,1] or pSrcDst[-T,-1] shell be done
  704. // pDst[0,len-1] or pSrcDst[0,len-1] will be computed.
  705. // Returns: IppStatus
  706. // ippStsNoErr if no error
  707. */
  708. IPPAPI( IppStatus, ippsHarmonicFilter_16s_I,(Ipp16s val, int T, Ipp16s *pSrcDst, int len) )
  709. IPPAPI( IppStatus, ippsHarmonicFilter_32f_I,(Ipp32f val, int T, Ipp32f *pSrcDst, int len) )
  710. IPPAPI( IppStatus, ippsHarmonicFilter_NR_16s, (Ipp16s val, int T, const Ipp16s *pSrc,
  711. Ipp16s *pDst, int len) )
  712. /* /////////////////////////////////////////////////////////////////////////////
  713. // Name: ippsGainQuant
  714. // Purpose: Quantization of the adaptive codebook gains
  715. // Parameters:
  716. // pSrcAdptTarget pointer to the input target vector x(n).
  717. // pSrcFltAdptVector pointer to the input filtered adaptive codebook vector y(n)
  718. // pSrcFixedVector pointer to the input pre-filtered codebook contribition c(n)
  719. // pSrcFltFixedVector pointer to the input filtered codebook vector z(n)
  720. // pSrcDstEnergyErr pointer to the input/output energy error vector
  721. // for 4 previous subframes
  722. // pDstQGain pointer to the output gains:
  723. // gain pitch = pDstQGainIndex[0]
  724. // gain code = pDstQGainIndex[1]
  725. // pDstQGainIndex pointer to the output codebook indexes found
  726. // tameProcess 1 - taming is needed
  727. //
  728. // Returns: IppStatus
  729. // ippStsNoErr if no error
  730. */
  731. IPPAPI(IppStatus, ippsGainQuant_G729_16s, (
  732. const Ipp16s *pSrcAdptTarget, const Ipp16s *pSrcFltAdptVector,
  733. const Ipp16s * pSrcFixedVector, const Ipp16s *pSrcFltFixedVector,
  734. Ipp16s *pSrcDstEnergyErr, Ipp16s *pDstQGain, Ipp16s *pDstQGainIndex, Ipp16s tameProcess))
  735. IPPAPI(IppStatus, ippsGainQuant_G729D_16s, (
  736. const Ipp16s *pSrcAdptTarget, const Ipp16s *pSrcFltAdptVector,
  737. const Ipp16s *pSrcFixedVector, const Ipp16s *pSrcFltFixedVector,
  738. Ipp16s *pSrcDstEnergyErr, Ipp16s *pDstQGain, Ipp16s *pDstQGainIndex, Ipp16s tameProcess))
  739. /* /////////////////////////////////////////////////////////////////////////////
  740. // Name: ippsGainCodebookSearch_G729
  741. // Purpose: Searching procedure used in adaptive codebook gains quantization
  742. // gain pitch = gcdbk1[pDstIdxs[0]][0] + gcdbk2[pDstIdxs[1]][0]
  743. // gain code = gcdbk1[pDstIdxs[0]][1] + gcdbk2[pDstIdxs[1]][1]
  744. // where gcdbk1 = gbk1_6k, gcdbk2 = gbk1_6k for D mode
  745. // gcdbk1 = gbk1, gcdbk2 = gbk1 for other then D modes
  746. // Parameters:
  747. // pSrcCorr Pointer to the correlations :
  748. // pSrcCorr[0] = y(n)*y(n)
  749. // pSrcCorr[1] = -2.x(n)*y(n)
  750. // pSrcCorr[2] = z(n)*z(n)
  751. // pSrcCorr[3] = -2.x(n)*z(n)
  752. // pSrcCorr[4] = -2.y(n)*z(n)
  753. // x - target, y - filtered target, z - innovative vectors
  754. // valPredictedGain Input predicted codebook gain.
  755. // pCand pointer to the input pre-searched candidates indexes vector[2].
  756. // pCand[0] from [0,4]
  757. // pCand[1] from [0,8]
  758. //
  759. // pIdxs Pointer to the output indexes vector[2].
  760. // tameProcess Taming process indicator.
  761. // Returns: IppStatus
  762. // ippStsNoErr if no error
  763. */
  764. IPPAPI(IppStatus, ippsGainCodebookSearch_G729_32f,(const Ipp32f *pSrcCorr,
  765. Ipp32f valPredictedGain, const int *pCand, int *pIdxs, int tameProcess))
  766. IPPAPI(IppStatus, ippsGainCodebookSearch_G729D_32f,(const Ipp32f *pSrcCorr,
  767. Ipp32f valPredictedGain, const int *pCand, int *pIdxs, int tameProcess))
  768. /* /////////////////////////////////////////////////////////////////////////////
  769. // Name: ippsGainQuant
  770. // Purpose: Construct of the excitation for the high rate coder by
  771. // MultiPulse Maximum Likelihood Quantization (MP-MLQ) of the residual
  772. // signal
  773. // pImp pointer to the input impulse response of combined filter
  774. // pSrc pointer to the input target vector.
  775. // pDstLoc pointer to the output pulse location
  776. // pDstAmp pointer to the output pulse amplitudes
  777. // pMaxErr pointer to the output maximal error
  778. // pGrid output grid (even = 0, odd = 1)
  779. // pAmp output index of max codebook amplitude
  780. // Np input number of pulses
  781. // isBest shows whether best gain found (1) or not (0)
  782. // Returns: IppStatus
  783. // ippStsNoErr if no error
  784. */
  785. IPPAPI( IppStatus, ippsGainQuant_G723_16s, (const Ipp16s *pImp, const Ipp16s *pSrc,
  786. Ipp16s *pDstLoc, Ipp16s *pDstAmp, Ipp32s *pMaxErr, Ipp16s *pGrid, Ipp16s *pAmp,
  787. int Np, int* isBest) )
  788. /* /////////////////////////////////////////////////////////////////////////////
  789. // Name: ippsDecodeGain
  790. // Purpose: Decode adaptive and fixed-codebook gains
  791. // energy energy of code vector in Q32
  792. // pPastEnergy past quantized energies
  793. // quaIndex pointer to the gain quantization indexes transmitted:
  794. // quaIndex[0] - GA, quaIndex[1] - GB.
  795. // NULL for bad frame
  796. // pGain Pointer to the vector of decoded gains:
  797. // pGain[0] - adaptive and pGain[1] - fixed codebook gains.
  798. // For active frame: output vector.
  799. // For bad (erased) frame - input/output vector.
  800. // Input of gains decoded for previous frame.
  801. // See subclause G.729 3.9.1
  802. // valGainAttenuation
  803. // Attenuation factor for gains. See subclause G.729 E.4.4.3
  804. // Returns: IppStatus
  805. // ippStsNoErr if no error
  806. */
  807. IPPAPI( IppStatus, ippsDecodeGain_G729_16s, (Ipp32s energy, Ipp16s *pPastEnergy,
  808. const Ipp16s *quaIndex, Ipp16s *pGain) )
  809. IPPAPI(IppStatus, ippsDecodeGain_G729I_16s, (Ipp32s energy, Ipp16s valGainAttenuation, Ipp16s *pPastEnergy,
  810. const Ipp16s *quaIndex, Ipp16s *pGain))
  811. /* /////////////////////////////////////////////////////////////////////////////
  812. // Name: ippsTiltCompensation
  813. // Purpose: Tilt compensation filter
  814. // G729: transfer function 1/(1-|mu|) * (1 + mu * 1/z)
  815. // G723: transfer function 1 + 0.25*k1*(1/z)
  816. // pSrc pointer to the input vector
  817. // val gain coefficient
  818. // pDst pointer to the output filtered vector
  819. // pSrcImpulseResponse Pointer to the impulse response hf(n) in the length of 20, in Q12.
  820. // pSrcDstSpch Pointer to the speech x(n), in Q15
  821. // Returns: IppStatus
  822. // ippStsNoErr if no error
  823. */
  824. IPPAPI( IppStatus, ippsTiltCompensation_G729E_16s, (Ipp16s val, const Ipp16s *pSrc,
  825. Ipp16s *pDst) )
  826. IPPAPI( IppStatus, ippsTiltCompensation_G723_32s16s, (Ipp16s val, const Ipp32s *pSrc,
  827. Ipp16s *pDst) )
  828. IPPAPI (IppStatus, ippsTiltCompensation_G729_16s,(const Ipp16s * pSrcImpulseResponse,
  829. Ipp16s * pSrcDstSpch))
  830. IPPAPI (IppStatus, ippsTiltCompensation_G729A_16s,
  831. (const Ipp16s * pSrcLPC,Ipp16s * pSrcDstFltResidual))
  832. /* /////////////////////////////////////////////////////////////////////////////
  833. // Name: ippsLongTermPostFilter
  834. // Purpose: Long-term post G729 filtering
  835. // valDelay pitch delay
  836. // gammaFactor the LTP weighting factor
  837. // pSrcSpch Pointer to the resconstructed speech s[n]
  838. // pSrcLPC Pointer to weighted LP coff a'[i]
  839. // pSrcDstResidual Pointer to LP residual signal.
  840. // pDstFltResidual Pointer to output filtered residual signal.
  841. // pResultVoice Pointer to the voice information.
  842. // frameType The type of the frame (1 - active, 2 - SID, 0 - untransmitted).
  843. // Returns: IppStatus
  844. // ippStsNoErr if no error
  845. */
  846. IPPAPI(IppStatus, ippsLongTermPostFilter_G729_16s,(Ipp16s gammaFactor, int valDelay,
  847. const Ipp16s *pSrcDstResidual, Ipp16s *pDstFltResidual, Ipp16s *pResultVoice ))
  848. IPPAPI(IppStatus, ippsLongTermPostFilter_G729A_16s,(Ipp16s valDelay, const Ipp16s * pSrcSpch,
  849. const Ipp16s * pSrcLPC, Ipp16s * pSrcDstResidual, Ipp16s * pDstFltResidual))
  850. IPPAPI(IppStatus, ippsLongTermPostFilter_G729B_16s,(Ipp16s valDelay, const Ipp16s * pSrcSpch,
  851. const Ipp16s * pSrcLPC, Ipp16s * pSrcDstResidual, Ipp16s * pDstFltResidual,
  852. Ipp16s * pResultVoice, Ipp16s frameType))
  853. /* /////////////////////////////////////////////////////////////////////////////
  854. // Name: ippsShortTermPostFilter
  855. // Purpose: Short-term post G729 filtering
  856. // pSrcDstSpch Pointer to the short-term filtered speech y(n), in Q15
  857. // pSrcLPC Pointer to the quantized LP coefficients in the length of 11, in Q12
  858. // pDstFltResidual Pointer to the residual signal x(n) in the length of 40, in Q15.
  859. // pDstImpulseResponse Pointer to the generated impulse response hf(n)
  860. // in the length of 20, in Q12..
  861. // Returns: IppStatus
  862. // ippStsNoErr if no error
  863. */
  864. IPPAPI( IppStatus, ippsShortTermPostFilter_G729_16s, (const Ipp16s * pSrcLPC,
  865. const Ipp16s * pSrcFltResidual, Ipp16s * pSrcDstSpch, Ipp16s * pDstImpulseResponse))
  866. IPP_DEPRECATED("use ippsSynthesisFilter_NR_16s_Sfs function instead of this one")\
  867. IPPAPI( IppStatus, ippsShortTermPostFilter_G729A_16s,(const Ipp16s * pSrcLPC,
  868. const Ipp16s * pSrcFltResidual,Ipp16s * pSrcDstSpch))
  869. /* /////////////////////////////////////////////////////////////////////////////
  870. // Name: ippsPreemphasize
  871. // Purpose: Preemphasis post filter
  872. // H(z) = 1 - gamma z^-1 (G.729/A)
  873. // H(z) = 1 + gamma z^-1 (GSMAMR)
  874. // pSrcDst pointer to the input/output vector
  875. // gamma filter coeeficient
  876. // pMem pointer to the filter memory of length 1
  877. // Returns: IppStatus
  878. // ippStsNoErr if no error
  879. */
  880. IPPAPI( IppStatus, ippsPreemphasize_G729A_16s_I, (Ipp16s gamma, Ipp16s *pSrcDst, int len,
  881. Ipp16s* pMem) )
  882. IPPAPI( IppStatus, ippsPreemphasize_32f_I,(Ipp32f gamma, Ipp32f *pSrcDst, int len,
  883. Ipp32f *pMem))
  884. IPPAPI( IppStatus, ippsPreemphasize_G729A_16s, (Ipp16s gamma, const Ipp16s *pSrc, Ipp16s *pDst,
  885. int len, Ipp16s* pMem) )
  886. IPPAPI( IppStatus, ippsPreemphasize_GSMAMR_16s, (Ipp16s gamma, const Ipp16s *pSrc, Ipp16s *pDst,
  887. int len, Ipp16s* pMem) )
  888. /* /////////////////////////////////////////////////////////////////////////////
  889. // Name: ippsGainControl
  890. // Purpose: Adaptive gain control
  891. // Compensate for the gain difference between reconstructed speech signal given
  892. // pSrc (sr) and the postfiltered signal given by pSrcDst (spf)
  893. // dst[i] = g[i] * dst[i]
  894. // pSrc pointer to the input vector
  895. // pSrcDst Pointer to the input post-filtered and output gain compensated signal vector.
  896. // pSrcDstGain the gain for the previous subframe
  897. // pGain the gain for the previous subframe
  898. // Returns: IppStatus
  899. // ippStsNoErr if no error
  900. */
  901. IPPAPI( IppStatus, ippsGainControl_G729_16s_I, (const Ipp16s *pSrc1, Ipp16s *pSrcDst,
  902. Ipp16s *pGain) )
  903. IPPAPI( IppStatus, ippsGainControl_G729A_16s_I, (const Ipp16s *pSrc1, Ipp16s *pSrcDst,
  904. Ipp16s *pGain) )
  905. IPPAPI( IppStatus, ippsGainControl_G723_16s_I, (Ipp32s energy, Ipp16s *pSrcDst, Ipp16s *pGain) )
  906. IPPAPI( IppStatus, ippsGainControl_G729_32f_I,(Ipp32f gainScalingVal,
  907. Ipp32f gainFactor, Ipp32f *pSrcDst, Ipp32f *pGain))
  908. /* /////////////////////////////////////////////////////////////////////////////
  909. // Name: ippsRandomNoiseExcitation
  910. // Purpose: Generation of random noise excitation
  911. // gain target sample gain
  912. // pSrcDst pointer to the input/output excitation vector
  913. // pSeed pointer to the input/output seed for the random generator
  914. // Returns: IppStatus
  915. // ippStsNoErr if no error
  916. */
  917. IPPAPI( IppStatus, ippsRandomNoiseExcitation_G729B_16s, (Ipp16s *pSeed, Ipp16s *pExc, int len) )
  918. IPPAPI( IppStatus, ippsRandomNoiseExcitation_G729B_16s32f,(Ipp16s *pSeed, Ipp32f *pExc, int len))
  919. /* /////////////////////////////////////////////////////////////////////////////
  920. // Name: ippsLPCLevinsonDurbin
  921. // Purpose: Obtaining of the LPC
  922. // G.729: filter 1/1-A(z), LPC in Q12, by solving the set of equation
  923. // SUM(i=1,order)a(i)*r(|i-k|) = -r(k) k=1,..,order
  924. // Parameters:
  925. // pSrcAutoCorr pointer to the autocorrelation vector [order+1]
  926. // order LP order
  927. // pDstLPC pointer to the LPC output vector [order+1]
  928. // pDstRC pointer to the RC output vector
  929. // [2] - ippsLevinsonDurbin_G729B
  930. // [order+1] - ippsLevinsonDurbin_G729
  931. // pResultResidualEnergy pointer to output residual energy in Q15
  932. //
  933. */
  934. IPPAPI(IppStatus,ippsLevinsonDurbin_G729_32s16s,( const Ipp32s * pSrcAutoCorr,
  935. int order, Ipp16s * pDstLPC, Ipp16s * pDstRc, Ipp16s * pResultResidualEnergy))
  936. IPPAPI(IppStatus, ippsLevinsonDurbin_G729_32f,(const Ipp32f * pSrcAutoCorr,
  937. int order, Ipp32f * pDstLpc, Ipp32f * pDstRc, Ipp32f * pResultResidualEnergy))
  938. IPPAPI(IppStatus,ippsLevinsonDurbin_G729B,(const Ipp32s * pSrcAutoCorr,
  939. Ipp16s * pDstLPC, Ipp16s * pDstRc, Ipp16s * pResultResidualEnergy))
  940. IPPAPI(IppStatus, ippsLevinsonDurbin_G723_16s,
  941. (const Ipp16s * pSrcAutoCorr, Ipp16s * pValResultSineDtct,
  942. Ipp16s * pResultResidualEnergy, Ipp16s * pDstLPC))
  943. /* /////////////////////////////////////////////////////////////////////////////
  944. // Name: ippsIIR16s
  945. //
  946. // Purpose: IIR filter
  947. // 1-A(1/z)/1-B(1/z)
  948. // pCoeffs pointer to the input filter coefficients
  949. // pSrc pointer to the input speech vector
  950. // pDst pointer to the output perceptually weighted speech vector
  951. // pMem pointer to the filter memory
  952. // Returns: IppStatus
  953. // ippStsNoErr if no error
  954. */
  955. IPPAPI (IppStatus, ippsIIR16sLow_G729_16s,
  956. (const Ipp16s *pCoeffs, const Ipp16s *pSrc, Ipp16s *pDst, Ipp16s *pMem))
  957. IPPAPI (IppStatus, ippsIIR16s_G729_16s,
  958. (const Ipp16s *pCoeffs, const Ipp16s *pSrc, Ipp16s *pDst, Ipp16s *pMem))
  959. IPPAPI( IppStatus, ippsIIR16s_G723_16s32s, (const Ipp16s *pCoeffs, const Ipp16s *pSrc,
  960. Ipp32s *pDst, Ipp16s *pMem ) )
  961. IPPAPI( IppStatus, ippsIIR16s_G723_16s_I, (const Ipp16s *pCoeffs, Ipp16s *pSrcDst,
  962. Ipp16s *pMem ) )
  963. IPPAPI( IppStatus, ippsIIR16s_G723_32s16s_Sfs, (const Ipp16s *pCoeffs, const Ipp32s *pSrc,
  964. int sFs, Ipp16s *pDst, Ipp16s *pMem ) )
  965. /* /////////////////////////////////////////////////////////////////////////////
  966. // Name: ippsHarmonicNoiseSubtract_G723_16s_I
  967. //
  968. // Purpose: Do harmonic noise filtering and subtract the result
  969. // from harmonic noise weighted vector
  970. // val the input filter coefficient
  971. // T the input filter lag
  972. // pSrc pointer to the input vector to filter
  973. // pSrcDst pointer to the input/output harmonic noise weighted vector
  974. // Returns: IppStatus
  975. // ippStsNoErr if no error
  976. */
  977. IPPAPI( IppStatus, ippsHarmonicNoiseSubtract_G723_16s_I, (Ipp16s val, int T, const Ipp16s *pSrc,
  978. Ipp16s *pSrcDst) )
  979. /* /////////////////////////////////////////////////////////////////////////////
  980. // Name: PhaseDispersion
  981. // Purpose: The filter alters (mainly the phase of) the innovation signal such
  982. // that a new innovation is created which has the energy more spread over
  983. // the subframe. The filtering is performed by circular convolution
  984. // using one of the three stored "semi-random" impulse responses,
  985. // correspond to different amounts of spreading.
  986. // Parameters:
  987. // valPitchGain pitch gain Q14
  988. // valCodebookGain codebook gain Q1
  989. // pSrcExcSignal input signal
  990. // pDstFltExcSignal output signal
  991. // pSrcDstInnovation input/output innovation vector
  992. */
  993. #if !defined( _OWN_BLDPCS )
  994. typedef struct _PhaseDispersion_State_G729D IppsPhaseDispersion_State_G729D;
  995. #endif
  996. IPPAPI(IppStatus, ippsPhaseDispersionGetStateSize_G729D_16s,(int *pSize))
  997. IPPAPI(IppStatus, ippsPhaseDispersionInit_G729D_16s,(IppsPhaseDispersion_State_G729D *pPhDMem))
  998. IPPAPI(IppStatus, ippsPhaseDispersionUpdate_G729D_16s,(
  999. Ipp16s valPitchGain,
  1000. Ipp16s valCodebookGain,
  1001. IppsPhaseDispersion_State_G729D *pPhDMem
  1002. ))
  1003. IPPAPI(IppStatus, ippsPhaseDispersion_G729D_16s,(
  1004. const Ipp16s *pSrcExcSignal,
  1005. Ipp16s *pDstFltExcSignal,
  1006. Ipp16s valCodebookGain,
  1007. Ipp16s valPitchGain,
  1008. Ipp16s *pSrcDstInnovation,
  1009. IppsPhaseDispersion_State_G729D *pPhDMem
  1010. ))
  1011. /* ///////////////////////////////////////////////////////////////////////////////////////
  1012. // Name: ippsWinHybrid_G729E
  1013. // Purpose: Hybrid window auto-correlation for backward-adaptive analysis.
  1014. // Window is as follows:
  1015. // s(M-N),s(M-N+1),...,s(M-1),s(M),s(M+1),...,s(M+L-1)
  1016. // M LPC order for backward adaptation
  1017. // L number of signal samples in backward adaptation
  1018. // N number of non-recursive samples in the hybrid window
  1019. // where pSrcSfs[i] is the scale factor of pSrc[i*DIM],...,pSrc[i*DIM+DIM-1]
  1020. //
  1021. // pSrcSynthSpeech input signal for backward-adaptive analysis (35 samples)
  1022. //
  1023. */
  1024. #if !defined( _OWN_BLDPCS )
  1025. typedef struct _WinHybridState_G729E_16s IppsWinHybridState_G729E_16s;
  1026. typedef struct _WinHybridState_G729E_32f IppsWinHybridState_G729E_32f;
  1027. #endif
  1028. IPPAPI(IppStatus, ippsWinHybridGetStateSize_G729E_16s,(int *pSize))
  1029. IPPAPI(IppStatus, ippsWinHybridGetStateSize_G729E_32f,(int *pSize))
  1030. IPPAPI(IppStatus, ippsWinHybridInit_G729E_16s,(IppsWinHybridState_G729E_16s *pMem))
  1031. IPPAPI(IppStatus, ippsWinHybridInit_G729E_32f,(IppsWinHybridState_G729E_32f *pMem))
  1032. IPPAPI(IppStatus, ippsWinHybrid_G729E_16s32s,(const Ipp16s *pSrcSynthSpeech,
  1033. Ipp32s *pDstInvAutoCorr, IppsWinHybridState_G729E_16s *pMem))
  1034. IPPAPI(IppStatus, ippsWinHybrid_G729E_32f,(const Ipp32f *pSrcSynthSpeech,
  1035. Ipp32f *pDstInvAutoCorr, IppsWinHybridState_G729E_32f *pMem))
  1036. /* /////////////////////////////////////////////////////////////////////////////
  1037. // Name : ippsAutoCorr_G729B
  1038. // Purpose: Apply window and then compute autocorelation of input speech
  1039. // Equivalent to:
  1040. // ippsMul_NR_16s_Sfs
  1041. // ippsAutoCorr_NormE_16s32s
  1042. */
  1043. IPPAPI(IppStatus,ippsAutoCorr_G729B,
  1044. (const Ipp16s* pSrcSpch, Ipp16s* pResultAutoCorrExp, Ipp32s* pDstAutoCorr))
  1045. /* /////////////////////////////////////////////////////////////////////////////
  1046. // Name : ippsLPCToLSP_G729, ippsLPCToLSP_G729A
  1047. // Purpose: LP to LSP coefficients conversion
  1048. */
  1049. IPPAPI( IppStatus, ippsLPCToLSP_G729_16s,
  1050. (const Ipp16s* pSrcLPC, const Ipp16s* pSrcPrevLsp, Ipp16s* pDstLSP) )
  1051. IPPAPI( IppStatus, ippsLPCToLSP_G729A_16s,
  1052. (const Ipp16s* pSrcLPC, const Ipp16s* pSrcPrevLsp, Ipp16s* pDstLSP) )
  1053. IPPAPI( IppStatus, ippsLPCToLSP_G729_32f,
  1054. (const Ipp32f* pSrcLPC, const Ipp32f* pSrcPrevLsp, Ipp32f* pDstLSP))
  1055. IPPAPI( IppStatus, ippsLPCToLSP_G729A_32f,
  1056. (const Ipp32f* pSrcLPC, const Ipp32f* pSrcPrevLsp, Ipp32f* pDstLSP))
  1057. /* /////////////////////////////////////////////////////////////////////////////
  1058. // Name : ippsAdaptiveCodebookSearch_G729_16s
  1059. // Purpose: Determination of optimal integer and fractional pitch delay
  1060. // and generation of adaptive codebook vector
  1061. // Parameters:
  1062. // valOpenDelay Open-loop delay, in the range [18,145].
  1063. // pSrcAdptTarget Pointer to the target signal for adaptive-codebook
  1064. // search vector [40].
  1065. // pSrcImpulseResponse Pointer to the impulse response of weighted synthesis filter
  1066. // vector [40]
  1067. // pSrcDstPrevExcitation Pointer to the previous and updated excitation vector [194].
  1068. // pDstDelay Pointer to the integer delay and fraction delay vector [2].
  1069. // pDstAdptVector Pointer to the adaptive vector [40].
  1070. // subFrame Subframe number, either 0 or 1.*/
  1071. IPPAPI( IppStatus, ippsAdaptiveCodebookSearch_G729_16s, (Ipp16s valOpenDelay,
  1072. const Ipp16s * pSrcAdptTarget, const Ipp16s * pSrcImpulseResponse,
  1073. Ipp16s * pSrcDstPrevExcitation, Ipp16s * pDstDelay,
  1074. Ipp16s * pDstAdptVector, Ipp16s subFrame))
  1075. IPPAPI( IppStatus, ippsAdaptiveCodebookSearch_G729A_16s, (Ipp16s valOpenDelay,
  1076. const Ipp16s * pSrcAdptTarget, const Ipp16s * pSrcImpulseResponse,
  1077. Ipp16s * pSrcDstPrevExcitation, Ipp16s * pDstDelay,
  1078. Ipp16s * pDstAdptVector, Ipp16s subFrame))
  1079. IPPAPI( IppStatus, ippsAdaptiveCodebookSearch_G729D_16s, (Ipp16s valOpenDelay,
  1080. const Ipp16s * pSrcAdptTarget, const Ipp16s * pSrcImpulseResponse,
  1081. Ipp16s * pSrcDstPrevExcitation, Ipp16s subFrame, Ipp16s * pDstDelay ))
  1082. /* /////////////////////////////////////////////////////////////////////////////
  1083. // Name: ippsFilteredExcitation_G729
  1084. // Purpose: computes filtered excitation
  1085. // Arguments:
  1086. // pSrcImpulseResponse Pointer to the impulse response of weighted synthesis filter
  1087. // vector
  1088. // pSrcDstPrevExcitation Pointer to the previous and updated excitation vector [194].
  1089. // valExc Excitation value delayed by pitch lag ( u(-k) )
  1090. // len Length of input/output vectors
  1091. */
  1092. IPPAPI(IppStatus, ippsFilteredExcitation_G729_32f,
  1093. ( const Ipp32f* pSrcImpulseResponse, Ipp32f *pSrcDstPrevExcitation, int len, Ipp32f valExc))
  1094. /* /////////////////////////////////////////////////////////////////////////////
  1095. // Name : ippsLSPQuant_G729_16s
  1096. // Purpose: LSP quantization
  1097. // Is equivalent to:
  1098. // ippsLSPToLSF_G729_16s
  1099. // ippsLSFQuant_G729_16s
  1100. // ippsLSFToLSP_G729_16s
  1101. */
  1102. IPPAPI( IppStatus, ippsLSPQuant_G729_16s, (const Ipp16s * pSrcLsp, Ipp16s * pSrcDstPrevFreq,
  1103. Ipp16s * pDstQLsp, Ipp16s * pDstQLspIndex))
  1104. IPPAPI (IppStatus, ippsLSPQuant_G729E_16s, (const Ipp16s * pSrcLsp, const Ipp16s * pSrcPrevFreq,
  1105. Ipp16s * pDstQLsf, Ipp16s * pDstQLsp, Ipp16s * pDstQLspIndex))
  1106. IPPAPI (IppStatus, ippsLSPQuant_G729E_32f, (const Ipp32f *pSrcLsp, Ipp32f* pSrcDstPrevFreq, Ipp32f *pDstQLsf,
  1107. Ipp32f *pDstQLsp, int *pDstQLspIndex) )
  1108. /* /////////////////////////////////////////////////////////////////////////////
  1109. // Name : ippsAdaptiveCodebookGain_G729_16s
  1110. // Purpose: Compute the adaptive codebook gain
  1111. //
  1112. // pSrcImpulseResponse: Pointer to the impulse response
  1113. // of the perceptual weighting filter in the length of 40, in Q12.
  1114. // pSrcAdptVector: Pointer to the adaptive-codebook vector in the length of 40.
  1115. // pSrcLPC: Pointer to the LPC coefficients of the synthesis filter
  1116. // in the length of 11, in Q12.
  1117. // pDstFltAdptVector: Pointer to the output filtered adaptive-codebook vector
  1118. // pSrcFltAdptVector: Pointer to the input filtered adaptive-codebook vector
  1119. // in the length of 40.
  1120. // pResultAdptGain: Pointer to the adaptive-codebook gain in the length of 1, in Q14.
  1121. // pResultAdptGainCoeffs Pointer to the output vector in the length 4 represents
  1122. // the adaptive-codebook gain as a fraction:
  1123. // xy * 2^exp_xy
  1124. // gain = ------------- in Q14
  1125. // yy * 2^exp_yy
  1126. // where yy = pResultAdptGainCoeffs[0]
  1127. // exp_yy = pResultAdptGainCoeffs[1]
  1128. // exp_xy = pResultAdptGainCoeffs[2]
  1129. // exp_xy = pResultAdptGainCoeffs[3]
  1130. // If xy < 4 then gain = 0;
  1131. */
  1132. IPPAPI( IppStatus, ippsAdaptiveCodebookGain_G729_16s, (const Ipp16s * pSrcAdptTarget,
  1133. const Ipp16s * pSrcImpulseResponse, const Ipp16s * pSrcAdptVector,
  1134. Ipp16s * pDstFltAdptVector, Ipp16s * pResultAdptGain))
  1135. IPPAPI( IppStatus, ippsAdaptiveCodebookGain_G729A_16s, (const Ipp16s * pSrcAdptTarget,
  1136. const Ipp16s * pSrcLPC, const Ipp16s * pSrcAdptVector, Ipp16s * pDstFltAdptVector,
  1137. Ipp16s * pResultAdptGain))
  1138. IPPAPI( IppStatus, ippsAdaptiveCodebookGain_GSMAMR_16s,(const Ipp16s * pSrcAdptTarget,
  1139. const Ipp16s * pSrcFltAdptVector, Ipp16s * pResultAdptGain))
  1140. IPPAPI( IppStatus, ippsAdaptiveCodebookGainCoeffs_GSMAMR_16s,(const Ipp16s * pSrcAdptTarget,
  1141. const Ipp16s * pSrcFltAdptVector, Ipp16s * pResultAdptGain,
  1142. Ipp16s * pResultAdptGainCoeffs))
  1143. /* /////////////////////////////////////////////////////////////////////////////
  1144. // Name : ippsFFTFwd_RToPerm_GSMAMR_16s
  1145. // Purpose: This is an implementation of decimation-in-time FFT algorithm for
  1146. // real sequences.
  1147. // pSrcDst pointer to the input signal/output frequencies vector in Perm format
  1148. */
  1149. IPPAPI( IppStatus, ippsFFTFwd_RToPerm_GSMAMR_16s_I, (Ipp16s *pSrcDst))
  1150. /* /////////////////////////////////////////////////////////////////////////////
  1151. // Name : ippsAutoCorr_G723_16s
  1152. // Purpose: Apply window and then compute autocorelation of input speech
  1153. // Equivalent to:
  1154. // ippsAutoScale_16s
  1155. // ippsMul_NR_16s_ISfs
  1156. // ippsAutoCorr_NormE_G723_16s
  1157. */
  1158. IPPAPI(IppStatus, ippsAutoCorr_G723_16s,(const Ipp16s * pSrcSpch,
  1159. Ipp16s * pResultAutoCorrExp, Ipp16s * pDstAutoCorr))
  1160. /* /////////////////////////////////////////////////////////////////////////////
  1161. // Name: ippsLPCToLSF_G723_16s
  1162. // Purpose: LSP to LSF conversion normalized
  1163. // pLSF[i] = arccos(pLSP[i]); i=0,...,10
  1164. // pSrcLPC pointer to the LPC input vector
  1165. // pSrcPrevLSF pointer to previous normalized LSF coefficients
  1166. // pDstLSF pointer to the LSF output vector of values 15 bit scaled in range [0:0.5]
  1167. // Parameters:
  1168. // Returns: ippStsNoErr, if no errors
  1169. */
  1170. IPPAPI(IppStatus, ippsLPCToLSF_G723_16s,(const Ipp16s * pSrcLPC,
  1171. const Ipp16s * pSrcPrevLSF, Ipp16s * pDstLSF))
  1172. /* /////////////////////////////////////////////////////////////////////////////
  1173. // Name: ippsHarmonicSearch_G723_16s
  1174. // Purpose: This function searches the harmonic delay and harmonic gain for the harmonic noise shaping filter
  1175. // from the weighted speech and open loop pitch.
  1176. // valOpenDelay Open loop pitch
  1177. // pSrcWgtSpch Pointer to the weighted speech in the length of 205. The pointer points to the
  1178. // location of 146
  1179. // pResultHarmonicDelay Pointer to the harmonic delay
  1180. // pResultHarmonicGain Pointer to the harmonic gain
  1181. // Parameters:
  1182. // Returns: ippStsNoErr, if no errors
  1183. */
  1184. IPPAPI(IppStatus, ippsHarmonicSearch_G723_16s,(Ipp16s valOpenDelay, const Ipp16s * pSrcWgtSpch,
  1185. Ipp16s * pResultHarmonicDelay, Ipp16s * pResultHarmonicGain))
  1186. /* /////////////////////////////////////////////////////////////////////////////
  1187. // Name: ippsAdaptiveCodebookSearch_G723
  1188. // Purpose: This function searches for the close loop pitch and adaptive gain index.
  1189. // valBaseDelay Base delay
  1190. // pSrcAdptTarget Pointer to the adaptive target signal in the length of 60.
  1191. // pSrcImpulseResponse Pointer to the impulse response in the length of 60.
  1192. // pSrcPrevExcitation Pointer to the previous excitation in the length of 145.
  1193. // pSrcPrevError Pointer to the previous error in the length of 5, in 32-bit format.
  1194. // pResultCloseLag Pointer to the lag of close pitch
  1195. // pResultAdptGainIndex Pointer to the index of adaptive gain
  1196. // subFrame Subframe number
  1197. // sineDtct Sine circumstance.
  1198. // bitRate Transmit bit rate
  1199. // Parameters:
  1200. // Returns: ippStsNoErr, if no errors
  1201. */
  1202. IPPAPI (IppStatus, ippsAdaptiveCodebookSearch_G723,(
  1203. Ipp16s valBaseDelay,
  1204. const Ipp16s * pSrcAdptTarget,
  1205. const Ipp16s * pSrcImpulseResponse,
  1206. const Ipp16s * pSrcPrevExcitation,
  1207. const Ipp32s * pSrcPrevError,
  1208. Ipp16s * pResultCloseLag,
  1209. Ipp16s * pResultAdptGainIndex,
  1210. Ipp16s subFrame,
  1211. Ipp16s sineDtct,
  1212. IppSpchBitRate bitRate))
  1213. /* /////////////////////////////////////////////////////////////////////////////
  1214. // Name: ippsDecodeAdaptiveVector_G723_16s
  1215. // Purpose: This function decodes the adaptive vector from excitation,
  1216. // close loop pitch, adaptive gain index and bit rate.
  1217. */
  1218. IPPAPI (IppStatus, ippsDecodeAdaptiveVector_G723_16s,(
  1219. Ipp16s valBaseDelay,
  1220. Ipp16s valCloseLag,
  1221. Ipp16s valAdptGainIndex,
  1222. const Ipp16s * pSrcPrevExcitation,
  1223. Ipp16s * pDstAdptVector,
  1224. IppSpchBitRate bitRate))
  1225. /* /////////////////////////////////////////////////////////////////////////////
  1226. // Name: ippsLSFToLPC_G723_16s
  1227. // Purpose: This function converts a set of 10-order LSF coefficients to LPC coefficients.
  1228. // Equivalent to:
  1229. // ippsLSFToLPC_G723_16s_I
  1230. */
  1231. IPPAPI (IppStatus, ippsLSFToLPC_G723_16s,(const Ipp16s * pSrcLSF, Ipp16s * pDstLPC))
  1232. IPPAPI( IppStatus, ippsLSFToLPC_G723_16s_I, (Ipp16s *pLSFLPC) )
  1233. /* /////////////////////////////////////////////////////////////////////////////
  1234. // Name: ippsLSFQuant_G723_16s32s
  1235. // Purpose: This function searches for the close loop pitch and adaptive gain index.
  1236. // pSrcLSF Pointer to LSF coefficients
  1237. // pSrcPrevLSF Pointer to previous LSF coefficients
  1238. // pResultQLSFIndex Pointer to combined index of quantized LSF coefficients.
  1239. // Parameters:
  1240. // Returns: ippStsNoErr, if no errors
  1241. */
  1242. IPPAPI(IppStatus, ippsLSFQuant_G723_16s32s,(const Ipp16s * pSrcLSF, const Ipp16s *pSrcPrevLSF,
  1243. Ipp32s * pResultQLSFIndex))
  1244. /* /////////////////////////////////////////////////////////////////////////////
  1245. // Name: ippsACELPFixedCodebookSearch_G723_16s
  1246. // Purpose: TThis function searches for the ACELP fixed codebook for the excitation for 5.3 Kbps bit rate.
  1247. // Equivalent to:
  1248. // ippsFixedCodebookSearch_G723_16s
  1249. */
  1250. IPPAPI (IppStatus, ippsACELPFixedCodebookSearch_G723_16s,(
  1251. const Ipp16s * pSrcFixedCorr,
  1252. const Ipp16s * pSrcMatrix,
  1253. Ipp16s * pDstFixedSign,
  1254. Ipp16s * pDstFixedPosition,
  1255. Ipp16s * pResultGrid,
  1256. Ipp16s * pDstFixedVector,
  1257. Ipp16s * pSearchTimes))
  1258. IPPAPI( IppStatus, ippsACELPFixedCodebookSearch_G723_32s16s,(
  1259. const Ipp16s * pSrcFixedCorr,
  1260. Ipp32s * pSrcDstMatrix,
  1261. Ipp16s * pDstFixedSign,
  1262. Ipp16s * pDstFixedPosition,
  1263. Ipp16s * pResultGrid,
  1264. Ipp16s * pDstFixedVector,
  1265. Ipp16s * pSearchTimes))
  1266. /* /////////////////////////////////////////////////////////////////////////////
  1267. // Name: ippsMPMLQFixedCodebookSearch_G723
  1268. //
  1269. // Purpose: This function searches for the MP-MLQ fixed-codebook for the excitation for 6.3Kbps bit rate.
  1270. // valBaseDelay - Base delay, in Q0.
  1271. // pSrcImpulseResponse - Pointer to the impulse response in the length of 60.
  1272. // pSrcResidualTarget - Pointer to the residue target signal in the length of 60.
  1273. // pDstFixedVector - Pointer to the fixed codebook vector in the length of 60.
  1274. // pResultGrid - Pointer to the begin grid location, in Q0, 0 or 1.
  1275. // pResultTrainDirac - Pointer to the flag if train Dirac function used, 0: unused, 1: used.
  1276. // pResultAmpIndex - Pointer to the index of quantized amplitude, in Q0.
  1277. // pResultAmplitude - Pointer to the amplitude of the fixed codebook vector.
  1278. // pResultPosition - Pointer to the position of fixed codebook vector, which amplitude is not equal
  1279. // to 0, in Q0.
  1280. // subFrame - Subframe number, in Q0, from 0 to 3.
  1281. // Returns: IppStatus
  1282. // ippStsNoErr if no error
  1283. */
  1284. IPPAPI (IppStatus, ippsMPMLQFixedCodebookSearch_G723,(
  1285. Ipp16s valBaseDelay,
  1286. const Ipp16s * pSrcImpulseResponse,
  1287. const Ipp16s * pSrcResidualTarget,
  1288. Ipp16s * pDstFixedVector,
  1289. Ipp16s * pResultGrid,
  1290. Ipp16s * pResultTrainDirac,
  1291. Ipp16s * pResultAmpIndex,
  1292. Ipp16s * pResultAmplitude,
  1293. Ipp32s * pResultPosition,
  1294. Ipp16s subFrame))
  1295. /* /////////////////////////////////////////////////////////////////////////////
  1296. // Name: ippsSynthesisFilter_G723_16s
  1297. //
  1298. // Purpose: function implements the LPC synthesis filter.
  1299. // pSrcLPC - Pointer to the LPC coefficients in the length of 10, in Q13.
  1300. // pSrcResidual - Pointer to the residual signal in the length of 60.
  1301. // pSrcDstIIRState - Pointer to the history of synthesized speech signal in the
  1302. // length of 10.
  1303. // pDstSpch - Pointer to the output speech signal in the length of 60.
  1304. // pMem pointer to the filter memory
  1305. // Returns: IppStatus
  1306. // ippStsNoErr if no error
  1307. */
  1308. IPPAPI( IppStatus, ippsSynthesisFilter_G723_16s32s, (const Ipp16s *pQntLPC, const Ipp16s *pSrc,
  1309. Ipp32s *pDst, Ipp16s *pMem ) )
  1310. IPPAPI(IppStatus, ippsSynthesisFilter_G723_16s, (const Ipp16s *pSrcLPC, const Ipp16s *pSrcResidual,
  1311. Ipp16s *pSrcDstIIRState, Ipp16s *pDstSpch))
  1312. /* /////////////////////////////////////////////////////////////////////////////
  1313. // Name: ippsPitchPostFilter_G723_16s
  1314. //
  1315. // Purpose: function calculates the coefficients of the pitch post filter..
  1316. // valBaseDelay - Base delay, in Q0.
  1317. // pSrcResidual - Pointer to the residual signal in the length of 365.
  1318. // The pointer points to the location of 146.
  1319. // subFrame - Subframe number, in Q0, from 0 to 3.
  1320. // bitRate - Transmit bit rate, IPP_SPCHBR_6300 stands for 6.3 Kbps
  1321. // and IPP_SPCHBR_5300 stands for 5.3 Kbps.
  1322. // pResultDelay - Point to the delay of the pitch post filter, in Q0.
  1323. // pResultPitchGain - Point to the gain of the pitch post filter, in Q15.
  1324. // pResultScalingGain - Point to the scaling gain of the pitch post filter, in Q15.
  1325. // Returns: IppStatus
  1326. // ippStsNoErr if no error
  1327. */
  1328. IPPAPI(IppStatus, ippsPitchPostFilter_G723_16s, (Ipp16s valBaseDelay, const Ipp16s *pSrcResidual,
  1329. Ipp16s *pResultDelay, Ipp16s *pResultPitchGain, Ipp16s *pResultScalingGain,
  1330. Ipp16s subFrame, IppSpchBitRate bitRate))
  1331. /* /////////////////////////////////////////////////////////////////////////////
  1332. // Name: ippsAutoCorr_GSMAMR_16s32s
  1333. //
  1334. // Purpose: Compute autocorrelations of signal with windowing and
  1335. // Lag windowing
  1336. // pSrcSpch - Pointer to the input speech vector (240 samples),
  1337. // represented using Q15.0.
  1338. // mode - Bit rate specifier. Values between IPP_SPCHBR_4750 and
  1339. // IPP_SPCHBR_12200 are valid.
  1340. // pDstAutoCorr - Pointer to the autocorrelation coefficients, of length 22.
  1341. // For 12.2 kbps mode, elements 0 ~ 10 contain the first
  1342. // set of autocorrelation lags, and elements 11 ~ 21
  1343. // contain the second set of autocorrelation lags.
  1344. // For all other modes there is only one set of autocorrelation
  1345. // lags contained in vector elements 0 ~ 10.
  1346. // Returns: IppStatus
  1347. // ippStsNoErr if no error
  1348. */
  1349. IPPAPI(IppStatus, ippsAutoCorr_GSMAMR_16s32s,
  1350. (const Ipp16s *pSrcSpch, Ipp32s *pDstAutoCorr,IppSpchBitRate mode))
  1351. /* /////////////////////////////////////////////////////////////////////////////
  1352. // Name: ippsLevinsonDurbin_GSMAMR_32s16s
  1353. //
  1354. // Purpose: Calculates the 10th-order LP coefficients from the autocorrelation lags using the Levinson-Durbin
  1355. // algorithm.
  1356. // pSrcAutoCorr - Pointer to the autocorrelation coefficients, a vector of length of 11.
  1357. // pSrcDstLPC - Pointer to the LP coefficients associated with
  1358. // the previous frame, a vector of length 11, represented using Q3.12.
  1359. // Returns: IppStatus
  1360. // ippStsNoErr if no error
  1361. */
  1362. IPPAPI(IppStatus, ippsLevinsonDurbin_GSMAMR_32s16s,
  1363. (const Ipp32s *pSrcAutoCorr, Ipp16s *pSrcDstLPC))
  1364. #define ippsLevinsonDurbin_GSMAMR ippsLevinsonDurbin_GSMAMR_32s16s
  1365. /* /////////////////////////////////////////////////////////////////////////////
  1366. // Name: ippsLPCToLSP_GSMAMR_16s
  1367. //
  1368. // Purpose: Converts a set of 10th-order LP coefficients to
  1369. // an equivalent set of line spectrum pairs (LSPs).
  1370. // pSrcLPC - Pointer to 11-element LP coefficient vector, represented using Q3.12.
  1371. // pSrcPrevLsp - Pointer to the 10-element LSP coefficient vector associated
  1372. // with the previous frame, represented using Q0.15.
  1373. // pDstLsp - Pointer to the 10-element LSP coefficient vector, represented using Q0.15.
  1374. // Returns: IppStatus
  1375. // ippStsNoErr if no error
  1376. */
  1377. IPPAPI(IppStatus, ippsLPCToLSP_GSMAMR_16s,
  1378. (const Ipp16s * pSrcLPC, const Ipp16s * pSrcPrevLsp, Ipp16s * pDstLsp))
  1379. /* /////////////////////////////////////////////////////////////////////////////
  1380. // Name: ippsLSPToLPC_GSMAMR_16s
  1381. //
  1382. // Purpose: Converts a set of 10th-order LSPs to LP coefficients.
  1383. // pSrcLsp - Pointer to the 10-element LSP coefficient vector, represented using Q0.15.
  1384. // pDstLPC - Pointer to the 11-element LP coefficient vector, represented using Q3.12.
  1385. // Returns: IppStatus
  1386. // ippStsNoErr if no error
  1387. */
  1388. IPPAPI(IppStatus, ippsLSPToLPC_GSMAMR_16s, (const Ipp16s *pSrcLsp, Ipp16s *pDstLPC))
  1389. /* /////////////////////////////////////////////////////////////////////////////
  1390. // Name: ippsLSPQuant_GSMAMR_16s
  1391. //
  1392. // Purpose: Quantizes the LSP coefficient vector, then obtains quantized LSP codebook indices.
  1393. // pSrcLsp - Pointer to the unquantized 20-element LSP vector, represented using Q0.15. For
  1394. // 12.2 kbps frames, the first LSP set is contained in vector elements 0 ~ 9, and the second LSP
  1395. // set is contained in vector elements 10 ~ 19. For all other bit rates, only elements 0 ~ 9 are valid
  1396. // and used for the quantization.
  1397. // pSrcDstPrevQLSFResidual - Pointer to the 10-element quantized LSF residual from the previous
  1398. // frame, represented using Q0.15.
  1399. // pDstQLsp - Pointer to the 20-element quantized LSP vector, represented using Q0.15. For 12.2
  1400. // kbps frames, elements 0 to 9 contain the first quantized LSP set, and elements 10 to 19 contain
  1401. // the second quantized LSP set. For all other bit rates there is only one LSP set contained in
  1402. // elements 0 to 9.
  1403. // pDstQLspIndex - Pointer to the 5-element vector of quantized LSP indices. For 12.2Kbps
  1404. // frames, all five elements contain valid data; for all other bit rates, only the first three elements
  1405. // contain valid indices.
  1406. // mode - Bit rate specifier. The enumerated values of IPP_SPCHBR_4750 to
  1407. // IPP_SPCHBR_12200 are valid.
  1408. // Returns: IppStatus
  1409. // ippStsNoErr if no error
  1410. */
  1411. IPPAPI(IppStatus, ippsLSPQuant_GSMAMR_16s, (const Ipp16s *pSrcLsp,
  1412. Ipp16s *pSrcDstPrevQLSFResidual, Ipp16s *pDstQLsp,
  1413. Ipp16s *pDstQLspIndex, IppSpchBitRate mode))
  1414. /* /////////////////////////////////////////////////////////////////////////////
  1415. // Name: ippsEncDTXSID_GSMAMR_16s
  1416. //
  1417. // Purpose: This function is called only when the current frame is a DTX frame. It extracts the needed
  1418. // parameters for the SID frame: LSF quantization parameter and the energy index parameter. If the
  1419. // SID flag is off, no operation is needed, and all the parameters are copied from last frame.
  1420. // pSrcLspBuffer - Pointer to the LSP coefficients of eight consecutive frames marked with
  1421. // VAD = 0, in the length of 80, in Q15.
  1422. // pSrcLogEnergyBuffer - Pointer to the log energy coefficients of eight consecutive frames
  1423. // marked with unvoiced, in the length of 8, in Q10.
  1424. // pValResultLogEnergyIndex - Pointer log energy index of last frame, in Q2.
  1425. // pValResultDtxLSFRefIndex - Pointer to the LSF quantization reference index of last frame.
  1426. // pSrcDstDtxQLSFIndex - Pointer to the LSF residual quantization indices of last frame, in the
  1427. // length of 3.
  1428. // pSrcDstPredQErr - Pointer to the fixed gain prediction error of four previous subframes for
  1429. // non-12.2 Kbps modes, in the length of 4, in Q10.
  1430. // pSrcDstPredQErrMR122 - Pointer to the fixed gain prediction error of four previous
  1431. // subframes for 12.2 Kbps, in the length of 4, in Q10.
  1432. // sidFLag - The SID flag of the current frame. If it is set to 1, the current frame is a SID frame,
  1433. // and the function will extract the LSF and energy parameters. If it is set to 0, the LSF and
  1434. // energy parameters will copy from previous frame.
  1435. // Returns: IppStatus
  1436. // ippStsNoErr if no error
  1437. */
  1438. IPPAPI(IppStatus, ippsEncDTXSID_GSMAMR_16s, (const Ipp16s *pSrcLspBuffer,
  1439. const Ipp16s *pSrcLogEnergyBuffer, Ipp16s *pValResultLogEnergyIndex,
  1440. Ipp16s *pValResultDtxLSFRefIndex, Ipp16s *pSrcDstDtxQLSFIndex,
  1441. Ipp16s *pSrcDstPredQErr, Ipp16s *pSrcDstPredQErrMR122,
  1442. Ipp16s sidFlag))
  1443. /* /////////////////////////////////////////////////////////////////////////////
  1444. // Name: ippsQuantLSPDecode_GSMAMR_16s
  1445. //
  1446. // Purpose: Decodes quantized LSPs from the received codebook index if the
  1447. // errors are not detected on the received frame. Otherwise, the
  1448. // function recovers the quantized LSPs from previous quantized
  1449. // LSPs using linear interpolation.
  1450. // pSrcQLspIndex - Pointer to the five-element vector containing codebook indices
  1451. // of the quantized LSPs.
  1452. // pSrcDstPrevQLSFResidual - Pointer to the 10-element quantized LSF residual from
  1453. // the previous frame, represented using Q0.15.
  1454. // pSrcDstPrevQLSF - Pointer to the 10-element quantized LSF vector from the previous
  1455. // frame, represented using Q0.15.
  1456. // pSrcDstPrevQLsp - Pointer to the 10-element quantized LSP vector from the previous
  1457. // frame, represented using Q0.15.
  1458. // pDstQLsp - Pointer to a 40-element vector containing four subframe LSP sets.
  1459. // bfi - Bad frame indicator; "0" signifies a good frame; all other values
  1460. // signify a bad frame.
  1461. // mode - Bit rate specifier.
  1462. // Returns: IppStatus
  1463. // ippStsNoErr if no error
  1464. */
  1465. IPPAPI(IppStatus, ippsQuantLSPDecode_GSMAMR_16s, (const Ipp16s *pSrcQLspIndex,
  1466. Ipp16s *pSrcDstPrevQLSFResidual, Ipp16s *pSrcDstPrevQLSF,
  1467. Ipp16s *pSrcDstPrevQLsp, Ipp16s *pDstQLsp, Ipp16s bfi,
  1468. IppSpchBitRate mode))
  1469. /* /////////////////////////////////////////////////////////////////////////////
  1470. // Name: ippsEncDTXHandler_GSMAMR_16s
  1471. //
  1472. // Purpose: Function determines the SID flag of current frame, and it determines
  1473. // whether the current frame should use DTX encoding.
  1474. // pValResultHangOverCount - Pointer to the DTX hangover count. When initialized or reset,
  1475. // it is set to 0.
  1476. // pValResultDtxElaspCount - Pointer to elapsed frame count since last non-DTX frame.
  1477. // When initialized or reset, it is set 0.
  1478. // pValResultUsedMode - Pointer to the transmission mode.
  1479. // pResultSidFlag - Pointer to the output SID flag, "1" indicates a SID frame, and "0"
  1480. // indicates a non-SID frame.
  1481. // vadFlag - This is the VAD flag of the current frame, if it is set 1, the current
  1482. // frame is marked with voiced, and if it is set to 0, it is marked with
  1483. // unvoiced.
  1484. // Returns: IppStatus
  1485. // ippStsNoErr if no error
  1486. */
  1487. IPPAPI(IppStatus, ippsEncDTXHandler_GSMAMR_16s, (Ipp16s *pValResultHangOverCount,
  1488. Ipp16s *pValResultDtxElapseCount, Ipp16s *pValResultUsedMode,
  1489. Ipp16s *pResultSidFlag, Ipp16s vadFlag))
  1490. /* /////////////////////////////////////////////////////////////////////////////
  1491. // Name: ippsEncDTXBuffer_GSMAMR_16s
  1492. //
  1493. // Purpose: Function buffer the LSP coefficients and previous log energy coefficients.
  1494. // pSrcSpch - Pointer to the input speech signal, in the length of 160, in Q15.0.
  1495. // pSrcLsp - Pointer to the LSP for this frame, in the length of 10, in Q0.15.
  1496. // pValResultUpdateIndex - Pointer to the previous memory update index. It is a value
  1497. // circularly increased between 0 and 7.
  1498. // pSrcDstLspBuffer - Pointer to the LSP coefficients of eight previous frames, in the
  1499. // length of 80, in Q0.15.
  1500. // pSrcDstLogEnergyBuffer - Pointer to the logarithm energy coefficients of eight previous
  1501. // frames,inthelength of 8,in Q5.10.
  1502. // Returns: IppStatus
  1503. // ippStsNoErr if no error
  1504. */
  1505. IPPAPI(IppStatus, ippsEncDTXBuffer_GSMAMR_16s, (const Ipp16s * pSrcSpch,
  1506. const Ipp16s *pSrcLsp, Ipp16s *pValResultUpdateIndex,
  1507. Ipp16s *pSrcDstLspBuffer, Ipp16s *pSrcDstLogEnergyBuffer))
  1508. /* /////////////////////////////////////////////////////////////////////////////
  1509. // Name: ippsDecDTXBuffer_GSMAMR_16s
  1510. //
  1511. // Purpose: Function buffer the LSF coefficients and previous log energy coefficients.
  1512. // pSrcSpch - Pointer to the input speech signal, in the length of 160, in Q15.0.
  1513. // pSrcLSF - Pointer to the LSF for this frame, in the length of 10, in Q0.15.
  1514. // pValResultUpdateIndex - Pointer to the previous memory update index. It is a value
  1515. // circularly increased between 0 and 7.
  1516. // pSrcDstLSFBuffer - Pointer to the LSF coefficients of eight previous frames, in the
  1517. // length of 80, in Q0.15.
  1518. // pSrcDstLogEnergyBuffer - Pointer to the logarithm energy coefficients of eight previous
  1519. // frames,inthelength of 8,in Q5.10.
  1520. // Returns: IppStatus
  1521. // ippStsNoErr if no error
  1522. */
  1523. IPPAPI(IppStatus, ippsDecDTXBuffer_GSMAMR_16s, (const Ipp16s *pSrcSpch,
  1524. const Ipp16s *pSrcLSF, Ipp16s *pValResultUpdateIndex,
  1525. Ipp16s *pSrcDstLSFBuffer, Ipp16s *pSrcDstLogEnergyBuffer))
  1526. /* /////////////////////////////////////////////////////////////////////////////
  1527. // Name: ippsAlgebraicCodebookSearch_GSMAMR_16s
  1528. //
  1529. // Purpose: Fixed (algebraic) codebook search functions
  1530. // valIntPitchLag pitch lag
  1531. // valBoundQAdptGain pitch gain
  1532. // pSrcFixedTarget target vector
  1533. // pSrcLtpResidual long term prediction residual
  1534. // pSrcDstImpulseResponse impulse response of weighted synthesis
  1535. // filter h[-L_subfr..-1] must be set to zero
  1536. // pDstFixedVector innovative codebook
  1537. // pDstFltFixedVector filtered fixed codebook excitation
  1538. // pDstEncPosSign signs of the pulses
  1539. // subFrame subframe number
  1540. // mode coder mode
  1541. // pBuffer pointer to the internal memory buffer
  1542. // Returns: IppStatus
  1543. // ippStsNoErr if no error
  1544. */
  1545. IPPAPI( IppStatus, ippsAlgebraicCodebookSearch_GSMAMR_16s, (Ipp16s valIntPitchLag, Ipp16s valBoundQAdptGain,
  1546. const Ipp16s *pSrcFixedTarget, const Ipp16s *pSrcLtpResidual, Ipp16s *pSrcDstImpulseResponse,
  1547. Ipp16s *pDstFixedVector, Ipp16s *pDstFltFixedVector, Ipp16s *pDstEncPosSign,
  1548. Ipp16s subFrame, IppSpchBitRate mode) )
  1549. IPPAPI(IppStatus, ippsAlgebraicCodebookSearchEX_GSMAMR_16s,
  1550. (Ipp16s valIntPitchLag, Ipp16s valBoundQAdptGain,
  1551. const Ipp16s * pSrcFixedTarget, const Ipp16s * pSrcLtpResidual,
  1552. Ipp16s * pSrcDstImpulseResponse, Ipp16s * pDstFixedVector,
  1553. Ipp16s * pDstFltFixedVector, Ipp16s * pDstEncPosSign,
  1554. Ipp16s subFrame, IppSpchBitRate mode, Ipp32s * pBuffer))
  1555. /* /////////////////////////////////////////////////////////////////////////////
  1556. // Name: ippsFixedCodebookDecode_GSMAMR_16s
  1557. //
  1558. // Purpose: Fixed codebook vector decode functions
  1559. // pSrcFixedIndex pointer to the fixed codebook index vector
  1560. // pDstFixedVector pointer to the 40-element fixed codebook vector
  1561. // subFrame subframe number
  1562. // mode coder mode
  1563. // Returns: IppStatus
  1564. // ippStsNoErr if no error
  1565. */
  1566. IPPAPI (IppStatus, ippsFixedCodebookDecode_GSMAMR_16s,
  1567. (const Ipp16s *pSrcFixedIndex,
  1568. Ipp16s *pDstFixedVector,
  1569. Ipp16s subFrame,
  1570. IppSpchBitRate mode) )
  1571. /* /////////////////////////////////////////////////////////////////////////////
  1572. // Name: ippsOpenLoopPitchSearchNonDTX_GSMAMR_16s
  1573. //
  1574. // Purpose: Computes the open-loop pitch lag (as well as optimal pitch gain for 10.2 kbps frames only) when
  1575. // both DTX and VAD are disabled.
  1576. // pSrcWgtLPC1 Pointer to the 44-element vector of weighted LP coefficients
  1577. // pSrcWgtLPC2 Pointer to the 44-element vector of weighted LP coefficients
  1578. // pSrcSpch Pointer to the 170-sample input speech vector
  1579. // pValResultPrevMidPitchLag Pointer to the median filtered pitch lag of the 5 previous voiced
  1580. // speech half-frames
  1581. // pValResultVvalue Pointer to the adaptive parameter v
  1582. // pSrcDstPrevPitchLag Pointer to the five-element vector that contains the pitch lags associated
  1583. // with the five most recent voiced speech half-frames
  1584. // pSrcDstPrevWgtSpch Pointer to a 143-element vector containing perceptually weighted
  1585. // speech from the previous frame
  1586. // pDstOpenLoopLag Pointer to a two-element vector of open-loop pitch lags.
  1587. // pDstOpenLoopGain Pointer to a 2-element vector containing optimal open-loop pitch gains.
  1588. // mode coder mode
  1589. // Returns: IppStatus
  1590. // ippStsNoErr if no error
  1591. */
  1592. IPPAPI (IppStatus, ippsOpenLoopPitchSearchNonDTX_GSMAMR_16s,(
  1593. const Ipp16s * pSrcWgtLPC1,
  1594. const Ipp16s * pSrcWgtLPC2,
  1595. const Ipp16s * pSrcSpch,
  1596. Ipp16s * pValResultPrevMidPitchLag,
  1597. Ipp16s * pValResultVvalue,
  1598. Ipp16s * pSrcDstPrevPitchLag,
  1599. Ipp16s * pSrcDstPrevWgtSpch,
  1600. Ipp16s * pDstOpenLoopLag,
  1601. Ipp16s * pDstOpenLoopGain,
  1602. IppSpchBitRate mode))
  1603. /* /////////////////////////////////////////////////////////////////////////////
  1604. // Name: ippsOpenLoopPitchSearchDTXVAD1_GSMAMR_16s
  1605. //
  1606. // Purpose: Extracts an open-loop pitch lag estimate from the weighted input speech when the VAD 1 scheme
  1607. // is enabled
  1608. // pSrcWgtLPC1 Pointer to the 44-element vector of weighted LP coefficients
  1609. // pSrcWgtLPC2 Pointer to the 44-element vector of weighted LP coefficients
  1610. // pSrcSpch Pointer to the 170-sample input speech vector
  1611. // pValResultToneFlag Pointer to the tone flag for the VAD module.
  1612. // pValResultPrevMidPitchLag Pointer to the median filtered pitch lag of the 5 previous voiced
  1613. // speech half-frames
  1614. // pValResultVvalue Pointer to the adaptive parameter v
  1615. // pSrcDstPrevPitchLag Pointer to the five-element vector that contains the pitch lags associated
  1616. // with the five most recent voiced speech half-frames
  1617. // pSrcDstPrevWgtSpch Pointer to a 143-element vector containing perceptually weighted
  1618. // speech from the previous frame
  1619. // pResultMaxHpCorr Pointer to the correlation maximum.
  1620. // pDstOpenLoopLag Pointer to a two-element vector of open-loop pitch lags.
  1621. // pDstOpenLoopGain Pointer to a 2-element vector containing optimal open-loop pitch gains.
  1622. // mode coder mode
  1623. // Returns: IppStatus
  1624. // ippStsNoErr if no error
  1625. */
  1626. IPPAPI (IppStatus, ippsOpenLoopPitchSearchDTXVAD1_GSMAMR_16s,(
  1627. const Ipp16s * pSrcWgtLPC1,
  1628. const Ipp16s * pSrcWgtLPC2,
  1629. const Ipp16s * pSrcSpch,
  1630. Ipp16s * pValResultToneFlag,
  1631. Ipp16s * pValResultPrevMidPitchLag,
  1632. Ipp16s * pValResultVvalue,
  1633. Ipp16s * pSrcDstPrevPitchLag,
  1634. Ipp16s * pSrcDstPrevWgtSpch,
  1635. Ipp16s * pResultMaxHpCorr,
  1636. Ipp16s * pDstOpenLoopLag,
  1637. Ipp16s * pDstOpenLoopGain,
  1638. IppSpchBitRate mode))
  1639. /* /////////////////////////////////////////////////////////////////////////////
  1640. // Name: ippsOpenLoopPitchSearchDTXVAD2_GSMAMR_16s32s
  1641. //
  1642. // Purpose: Extracts an open-loop pitch lag estimate from the weighted input speech when the VAD 2 scheme
  1643. // is enabled
  1644. // pSrcWgtLPC1 Pointer to the 44-element vector of weighted LP coefficients
  1645. // pSrcWgtLPC2 Pointer to the 44-element vector of weighted LP coefficients
  1646. // pSrcSpch Pointer to the 170-sample input speech vector
  1647. // pValResultPrevMidPitchLag Pointer to the median filtered pitch lag of the 5 previous voiced
  1648. // speech half-frames
  1649. // pValResultVvalue Pointer to the adaptive parameter v
  1650. // pSrcDstPrevPitchLag Pointer to the five-element vector that contains the pitch lags associated
  1651. // with the five most recent voiced speech half-frames
  1652. // pSrcDstPrevWgtSpch Pointer to a 143-element vector containing perceptually weighted
  1653. // speech from the previous frame
  1654. // pResultMaxCorr Pointer to the correlation maximum..
  1655. // pResultWgtEnergy Pointer to the pitch delayed energy of the weighted speech signal.
  1656. // pDstOpenLoopLag Pointer to a two-element vector of open-loop pitch lags.
  1657. // pDstOpenLoopGain Pointer to a 2-element vector containing optimal open-loop pitch gains.
  1658. // mode coder mode
  1659. // Returns: IppStatus
  1660. // ippStsNoErr if no error
  1661. */
  1662. IPPAPI (IppStatus, ippsOpenLoopPitchSearchDTXVAD2_GSMAMR_16s32s,(
  1663. const Ipp16s * pSrcWgtLPC1,
  1664. const Ipp16s * pSrcWgtLPC2,
  1665. const Ipp16s * pSrcSpch,
  1666. Ipp16s * pValResultPrevMidPitchLag,
  1667. Ipp16s * pValResultVvalue,
  1668. Ipp16s * pSrcDstPrevPitchLag,
  1669. Ipp16s * pSrcDstPrevWgtSpch,
  1670. Ipp32s * pResultMaxCorr,
  1671. Ipp32s * pResultWgtEnergy,
  1672. Ipp16s * pDstOpenLoopLag,
  1673. Ipp16s * pDstOpenLoopGain,
  1674. IppSpchBitRate mode))
  1675. #define ippsOpenLoopPitchSearchDTXVAD2_GSMAMR ippsOpenLoopPitchSearchDTXVAD2_GSMAMR_16s32s
  1676. /* /////////////////////////////////////////////////////////////////////////////
  1677. // Name: ippsImpulseResponseTarget_GSMAMR_16s
  1678. //
  1679. // Purpose: Computes the impulse response and target signal required for the adaptive codebook search.
  1680. // pSrcSpch Pointer to the 50-element input speech vector, where elements 0 - 9 are from the
  1681. // previous subframe, and elements 10 - 49 are from the current subframe.
  1682. // pSrcWgtLPC1 Pointer to an 11-element vector of weighted LP coefficients
  1683. // pSrcWgtLPC2 Pointer to an 11-element vector of weighted LP coefficients
  1684. // pSrcQLPC Pointer to an 11-element vector of quantized LP coefficients
  1685. // pSrcSynFltState Pointer to the 10-element vector that contains the state of the synthesis
  1686. // filter
  1687. // pSrcWgtFltState Pointer to the 10-element vector that contains the state of the weighting
  1688. // filter.
  1689. // pDstImpulseResponse Pointer to the 40-element vector that contains the impulse response.
  1690. // pDstLpResidual Pointer to the 40-element vector that contains the LP residual.
  1691. // pDstAdptTarget Pointer to the 40-element vector that contains the adaptive codebook search
  1692. // target signal.
  1693. // Returns: IppStatus
  1694. // ippStsNoErr if no error
  1695. */
  1696. IPPAPI (IppStatus, ippsImpulseResponseTarget_GSMAMR_16s,(
  1697. const Ipp16s * pSrcSpch,
  1698. const Ipp16s * pSrcWgtLPC1,
  1699. const Ipp16s * pSrcWgtLPC2,
  1700. const Ipp16s * pSrcQLPC,
  1701. const Ipp16s * pSrcSynFltState,
  1702. const Ipp16s * pSrcWgtFltState,
  1703. Ipp16s * pDstImpulseResponse,
  1704. Ipp16s * pDstLpResidual,
  1705. Ipp16s * pDstAdptTarget))
  1706. /* /////////////////////////////////////////////////////////////////////////////
  1707. // Name: ippsAdaptiveCodebookSearch_GSMAMR_16s
  1708. //
  1709. // Purpose: Performs the adaptive codebook search.
  1710. // pSrcAdptTarget Pointer to the 40-element adaptive target signal vector,
  1711. // pSrcImpulseResponse Pointer to the 40-element impulse response of the weighted synthesis
  1712. // filter.
  1713. // pSrcOpenLoopLag Pointer to a two-element vector of open-loop pitch lags.
  1714. // pValResultPrevIntPitchLag Pointer to the previous integral pitch lag.
  1715. // pSrcDstExcitation Pointer to the 194-element excitation vector.
  1716. // pResultFracPitchLag Pointer to the fractional pitch lag obtained during the adaptive codebook
  1717. // search.
  1718. // pResultAdptIndex Pointer to the coded closed-loop pitch index.
  1719. // pDstAdptVector Pointer to the 40-sample adaptive codebook vector.
  1720. // subFrame subframe number
  1721. // mode coder mode
  1722. // Returns: IppStatus
  1723. // ippStsNoErr if no error
  1724. */
  1725. IPPAPI (IppStatus, ippsAdaptiveCodebookSearch_GSMAMR_16s,(
  1726. const Ipp16s * pSrcAdptTarget,
  1727. const Ipp16s * pSrcImpulseResponse,
  1728. Ipp16s * pSrcOpenLoopLag,
  1729. Ipp16s * pValResultPrevIntPitchLag,
  1730. Ipp16s * pSrcDstExcitation,
  1731. Ipp16s * pResultFracPitchLag,
  1732. Ipp16s * pResultAdptIndex,
  1733. Ipp16s * pDstAdptVector,
  1734. Ipp16s subFrame,
  1735. IppSpchBitRate mode))
  1736. /* /////////////////////////////////////////////////////////////////////////////
  1737. // Name: ippsAdaptiveCodebookDecode_GSMAMR_16s
  1738. //
  1739. // Purpose: This function decodes the adaptive codebook parameters transmitted by the encoder, and then
  1740. // applies them to interpolate an adaptive codebook vector.
  1741. // valAdptIndex Adaptive codebook index.
  1742. // pValResultPrevIntPitchLag Pointer to the previous integer pitch lag.
  1743. // pValResultLtpLag Pointer to the LTP-Lag value.
  1744. // pSrcDstExcitation Pointer to the 194-element excitation vector.
  1745. // pResultIntPitchLag Pointer to the 194-element excitation vector.
  1746. // pDstAdptVector Pointer to the fractional pitch lag obtained during the adaptive codebook
  1747. // subFrame subframe number
  1748. // bfi Bad frame indicator. "0" signifies a good frame; any other value signifies a bad frame.
  1749. // inBackgroundNoise Flag set when the previous frame is considered to contain background
  1750. // noise and only shows minor energy level changes.
  1751. // voicedHangover Counter used to monitor the time since a frame was presumably voiced.
  1752. // mode coder mode
  1753. // Returns: IppStatus
  1754. // ippStsNoErr if no error
  1755. */
  1756. IPPAPI (IppStatus ,ippsAdaptiveCodebookDecode_GSMAMR_16s,(
  1757. Ipp16s valAdptIndex,
  1758. Ipp16s * pValResultPrevIntPitchLag,
  1759. Ipp16s * pValResultLtpLag,
  1760. Ipp16s * pSrcDstExcitation,
  1761. Ipp16s * pResultIntPitchLag,
  1762. Ipp16s * pDstAdptVector,
  1763. Ipp16s subFrame,
  1764. Ipp16s bfi,
  1765. Ipp16s inBackgroundNoise,
  1766. Ipp16s voicedHangover,
  1767. IppSpchBitRate mode))
  1768. /* /////////////////////////////////////////////////////////////////////////////
  1769. // Name: ippsPostFilter_GSMAMR_16s
  1770. //
  1771. // Purpose: This function decodes the adaptive codebook parameters transmitted by the encoder, and then
  1772. // applies them to interpolate an adaptive codebook vector.
  1773. // pSrcQLPC Pointer to the reconstructed LP coefficients, in the length of 44.
  1774. // pSrcSpch Pointer to the start position of the input speech signal for current frame.
  1775. // pValResultPrevResidual Pointer to the last output of the FIR filter of the formant filter for
  1776. // previous subframe.
  1777. // pValResultPrevScalingGain Pointer to the scaling factor b of the last signal for the previous
  1778. // subframe.
  1779. // pSrcDstFormantFIRState Pointer to the state of the FIR part of the formant filter, in the
  1780. // length of 10.
  1781. // pSrcDstFormantIIRState Pointer to the state of the IIR part of the formant filter, in the length
  1782. // of 10.
  1783. // pDstFltSpch Pointer to the filtered speech, in the length of 160.
  1784. // mode coder mode
  1785. // Returns: IppStatus
  1786. // ippStsNoErr if no error
  1787. */
  1788. IPPAPI (IppStatus, ippsPostFilter_GSMAMR_16s,(
  1789. const Ipp16s * pSrcQLPC,
  1790. const Ipp16s * pSrcSpch,
  1791. Ipp16s * pValResultPrevResidual,
  1792. Ipp16s * pValResultPrevScalingGain,
  1793. Ipp16s * pSrcDstFormantFIRState,
  1794. Ipp16s * pSrcDstFormantIIRState,
  1795. Ipp16s * pDstFltSpch,
  1796. IppSpchBitRate mode))
  1797. /* /////////////////////////////////////////////////////////////////////////////
  1798. // Name: ippsVAD1_GSMAMR_16s
  1799. //
  1800. // Purpose: Voice Activity Detection (VAD) for AMR (option 1) functions
  1801. // pSrcSpch pointer to the input speech signal, in the length of 160
  1802. // pSrcDstVad1State pointer to the VAD Option 1 history variables
  1803. // pResultVadFlag pointer to the VAD flag of this frame
  1804. // maxHpCorr best_corr_hp value of previous frame
  1805. // toneFlag tone flag
  1806. // Returns: IppStatus
  1807. // ippStsNoErr if no error
  1808. */
  1809. IPPAPI (IppStatus, ippsVAD1_GSMAMR_16s,
  1810. (const Ipp16s *pSrcSpch,
  1811. IppGSMAMRVad1State *pSrcDstVad1State,
  1812. Ipp16s *pResultVadFlag,
  1813. Ipp16s maxHpCorr,
  1814. Ipp16s toneFlag) )
  1815. /* /////////////////////////////////////////////////////////////////////////////
  1816. // Name: ippsVAD2_GSMAMR_16s
  1817. //
  1818. // Purpose: Voice Activity Detection (VAD) for AMR (option 2) functions
  1819. // pSrcSpch pointer to the input speech signal, in the length of 160
  1820. // pSrcDstVad2State pointer to the VAD Option 2 history variables
  1821. // pResultVadFlag pointer to the VAD flag of this frame
  1822. // ltpFlag LTP_flag value, which is generated by the comparison
  1823. // of the long-term prediction to a constant threshold LTP_THLD.
  1824. // Returns: IppStatus
  1825. // ippStsNoErr if no error
  1826. */
  1827. IPPAPI (IppStatus, ippsVAD2_GSMAMR_16s,
  1828. (const Ipp16s * pSrcSpch,
  1829. IppGSMAMRVad2State *pSrcDstVad2State,
  1830. Ipp16s *pResultVadFlag,
  1831. Ipp16s ltpFlag) )
  1832. /* /////////////////////////////////////////////////////////////////////////////
  1833. // G.722.1 related functions
  1834. ///////////////////////////////////////////////////////////////////////////// */
  1835. /* /////////////////////////////////////////////////////////////////////////////
  1836. // Name: ippsDCTFwd_G722, ippsDCTInv_G722
  1837. // Purpose: Computes the forward or inverse discrete cosine transform (DCT)
  1838. // of a signal.
  1839. // Parameters:
  1840. // pSrc Pointer to the source vector.
  1841. // pDst Pointer to the destination vector.
  1842. // len Length of the source and destination vectors either 320
  1843. // for G722 by default or 640 for G7221 functions respectively.
  1844. // Returns:
  1845. // ippStsNoErr Indicates no error.
  1846. // ippStsNullPtrErr Indicates an error when one of the specified pointer is NULL.
  1847. // IppStsSizeErr Indicates an error when len has an illegal value.
  1848. */
  1849. IPPAPI( IppStatus, ippsDCTFwd_G722_16s, (const Ipp16s *pSrc, Ipp16s *pDst))
  1850. IPPAPI( IppStatus, ippsDCTFwd_G7221_16s, (const Ipp16s *pSrc, Ipp16s *pDst, int len))
  1851. IPPAPI( IppStatus, ippsDCTInv_G722_16s, (const Ipp16s *pSrc, Ipp16s *pDst))
  1852. IPPAPI( IppStatus, ippsDCTInv_G7221_16s, (const Ipp16s *pSrcMLT, Ipp16s *pDstSmpl, int len))
  1853. /* /////////////////////////////////////////////////////////////////////////////
  1854. // Name: ippsDecomposeMLTToDCT_G722
  1855. // Purpose: Decompose MLT transform input signal to form of the DCT transform
  1856. // input signal.
  1857. // Parameters:
  1858. // pSrcSpch Pointer to the source speech vector .
  1859. // pSrcSpchOld Pointer to the source/destination vector of
  1860. // the previous speech frame.
  1861. // pDstSpchDecomposed Pointer to the destination decomposed speech vector.
  1862. // len Length of the source and destination vectors either 320
  1863. // for G722 by default or 640 for G7221 functions respectively.
  1864. // Returns:
  1865. // ippStsNoErr Indicates no error.
  1866. // ippStsNullPtrErr Indicates an error when one of the specified pointer is NULL.
  1867. // IppStsSizeErr Indicates an error when len has an illegal value.
  1868. */
  1869. IPPAPI( IppStatus, ippsDecomposeMLTToDCT_G722_16s, (const Ipp16s *pSrcSpch,
  1870. Ipp16s *pSrcDstSpchOld, Ipp16s *pDstSpchDecomposed))
  1871. IPPAPI( IppStatus, ippsDecomposeMLTToDCT_G7221_16s, (const Ipp16s *pSrcSpch,
  1872. Ipp16s *pSrcDstSpchOld, Ipp16s *pDstSpchDecomposed, int len))
  1873. /* /////////////////////////////////////////////////////////////////////////////
  1874. // Name: ippsDecomposeDCTToMLT_G722_16s
  1875. // Purpose: Decompose IDCT output signal to form of the MLT transform output signal.
  1876. // Parameters:
  1877. // pSrcSpchDecomposed Pointer to the source windowed speech vector[len].
  1878. // pSrcSpchDecomposedOld Pointer to the source/destination
  1879. // windowed speech vector[len/2] of previous frame.
  1880. // pDstSpch Pointer to the destination speech vector[len].
  1881. // len Length of destination vectors either 320 for G722
  1882. // by default or 640 for G7221 functions respectively.
  1883. // Returns:
  1884. // ippStsNoErr Indicates no error.
  1885. // ippStsNullPtrErr Indicates an error when one of the specified pointer is NULL.
  1886. // IppStsSizeErr Indicates an error when len has an illegal value.
  1887. */
  1888. IPPAPI( IppStatus, ippsDecomposeDCTToMLT_G722_16s, (const Ipp16s *pSrcSpchDecomposed,
  1889. Ipp16s *pSrcDstSpchDecomposedOld, Ipp16s *pDstSpch))
  1890. IPPAPI( IppStatus, ippsDecomposeDCTToMLT_G7221_16s, (const Ipp16s *pSrcSpchDecomposed,
  1891. Ipp16s *pSrcDstSpchDecomposedOld, Ipp16s *pDstSpch, int len))
  1892. /* /////////////////////////////////////////////////////////////////////////////
  1893. // Name: ippsHuffmanEncode_G722
  1894. // Purpose: Performs Huffman encoding of the quantized amplitude envelope indexes.
  1895. // Parameters:
  1896. // category The category of MLT region in range of [0-7]
  1897. // qntAmpEnvIndex The quantized amplitude envelope index in range of [0-63]
  1898. // pSrcMLTCoeffs Pointer to the source vector[20] of raw MLT coefficients.
  1899. // pDstCode Pointer to the output Huffman code.
  1900. // pCodeLength Pointer to output Huffman code length in bit.
  1901. // Returns:
  1902. // ippStsNoErr Indicates no error.
  1903. // IppStsNullPtrErr Indicates an error when the pSrcMLTCoeffs or pDstCode
  1904. // or pCodeLength pointer is null
  1905. // IppStsScaleRangeErr Indicates an error when category or qntAmpEnvIndex is out of
  1906. // proper range.
  1907. */
  1908. IPPAPI( IppStatus, ippsHuffmanEncode_G722_16s32u, (int category, int qntAmpEnvIndex,
  1909. const Ipp16s *pSrcMLTCoeffs, Ipp32u *pDstCode, int *pCodeLength))
  1910. /* /////////////////////////////////////////////////////////////////////////////
  1911. // G.722.1 end
  1912. ///////////////////////////////////////////////////////////////////////////// */
  1913. /* /////////////////////////////////////////////////////////////////////////////
  1914. // G.726 related functions
  1915. ///////////////////////////////////////////////////////////////////////////// */
  1916. #if !defined( _OWN_BLDPCS )
  1917. typedef struct _EncoderState_G726_16s IppsEncoderState_G726_16s;
  1918. typedef struct _DecoderState_G726_16s IppsDecoderState_G726_16s;
  1919. #endif
  1920. /* /////////////////////////////////////////////////////////////////////////////
  1921. // Name: ippsEncodeGetStateSize_G726
  1922. // Purpose: Query of G726 encoder memory size
  1923. // Parameters:
  1924. // pEncSize Pointer to the output value of the G726 encoder memory size in bytes
  1925. // Returns: ippStsNoErr, if no errors
  1926. */
  1927. IPPAPI(IppStatus, ippsEncodeGetStateSize_G726_16s8u,(unsigned int* pEncSize))
  1928. /* /////////////////////////////////////////////////////////////////////////////
  1929. // Name: ippsEncodeInit_G726
  1930. // Purpose: Initializes the memory for the ADPCM encode
  1931. // Parameters:
  1932. // pEncMem Pointer to the input memory buffer of appropriate size applicable to
  1933. // store a state of the encoder
  1934. // rate Encode bit rate of the G.726 encoder: IPP_SPCHBR_16000,
  1935. // IPP_SPCHBR_24000, IPP_SPCHBR_32000, IPP_SPCHBR_40000.
  1936. // Returns:
  1937. // ippStsBadArgErr Indicates an error when the rate is not equal to one of the
  1938. // allowable encoding bit rates: IPP_SPCHBR_16000, IPP_SPCHBR_24000 or
  1939. // IPP_SPCHBR_32000, IPP_SPCHBR_40000.
  1940. // IppStsNullPtrErr Indicates an error when the memory pointer is null
  1941. */
  1942. IPPAPI(IppStatus, ippsEncodeInit_G726_16s8u,
  1943. (IppsEncoderState_G726_16s* pEncMem, IppSpchBitRate rate))
  1944. /* /////////////////////////////////////////////////////////////////////////////
  1945. // Name: ippsEncode_G726
  1946. // Purpose: ADPCM encoding of input speech signal
  1947. // Parameters:
  1948. // pEncMem Pointer to the encoder state memory
  1949. // pSrc Pointer to the uniform PCM input speech vector.
  1950. // pDst Pointer to the ADPCM bit-stream output vector.
  1951. // len The length of input/output vectors.
  1952. // Returns:
  1953. // ippStsNoErr, if no errors
  1954. // ippStsBadArgErr Indicates an error when the len is less or equal to 0.
  1955. // IppStsNullPtrErr Indicates an error when the pEncMem , pSrc, pDst pointer is null
  1956. */
  1957. IPPAPI(IppStatus, ippsEncode_G726_16s8u,
  1958. (IppsEncoderState_G726_16s* pEncMem, const Ipp16s *pSrc, Ipp8u *pDst, unsigned int len))
  1959. /* /////////////////////////////////////////////////////////////////////////////
  1960. // Name: ippsEncodeGetStateSize_G726
  1961. // Purpose: Query of G726 decoder memory size
  1962. // Parameters:
  1963. // pDecSize Pointer to the output value of the G726 decoder memory size in bytes
  1964. // Returns: ippStsNoErr, if no errors
  1965. */
  1966. IPPAPI(IppStatus, ippsDecodeGetStateSize_G726_8u16s,(unsigned int* pDecSize))
  1967. /* /////////////////////////////////////////////////////////////////////////////
  1968. // Name: ippsEncodeInit_G726
  1969. // Purpose: Initializes the memory for the ADPCM encode
  1970. // Parameters:
  1971. // pDecMem Pointer to the input memory buffer of appropriate size applicable to
  1972. // store a state of the decoder
  1973. // rate input bit rate of the G.726 decoder: IPP_SPCHBR_16000,
  1974. // IPP_SPCHBR_24000, IPP_SPCHBR_32000, IPP_SPCHBR_40000.
  1975. // law Output speech PCM law : IPP_PCM_MULAW, IPP_PCM_ALAW, IPP_PCM_LINEAR
  1976. // Returns:
  1977. // ippStsBadArgErr Indicates an error when the rate is not equal to one of the
  1978. // allowable decoding bit rates: IPP_SPCHBR_16000, IPP_SPCHBR_24000 or
  1979. // IPP_SPCHBR_32000,
  1980. // IPP_SPCHBR_40000 or the law is not equal to one othe allowable output PCM:
  1981. // IPP_PCM_MULAW, IPP_PCM_ALAW, IPP_PCM_LINEAR.
  1982. // IppStsNullPtrErr Indicates an error when the obj pointer is null
  1983. */
  1984. IPPAPI(IppStatus, ippsDecodeInit_G726_8u16s,
  1985. (IppsDecoderState_G726_16s* pDecMem, IppSpchBitRate rate, IppPCMLaw law))
  1986. /* /////////////////////////////////////////////////////////////////////////////
  1987. // Name: ippsDecode_G726
  1988. // Purpose: Initializes the memory for the ADPCM encode
  1989. // Parameters:
  1990. // pDecMem Pointer to the decoder state memory
  1991. // pSrc Pointer to the input ADPCM code vector contains two, three,
  1992. // four or five bits of the ADPCM codes per byte respectively for
  1993. // 16, 24, 32 or 40 Kbit/s bit rates.
  1994. // pDst Pointer to the 16bit linear PCM speech output vector.
  1995. // len The length of input/output vectors.
  1996. // Returns:
  1997. // ippStsNoErr, if no errors
  1998. // ippStsBadArgErr Indicates an error when the len is less or equal to 0.
  1999. // IppStsNullPtrErr Indicates an error when the pDecMem , pSrc, pDst pointer is null
  2000. */
  2001. IPPAPI(IppStatus, ippsDecode_G726_8u16s,
  2002. (IppsDecoderState_G726_16s* pDecMem, const Ipp8u *pSrc, Ipp16s *pDst, unsigned int len))
  2003. /* /////////////////////////////////////////////////////////////////////////////
  2004. // G.726 end
  2005. ///////////////////////////////////////////////////////////////////////////// */
  2006. /* /////////////////////////////////////////////////////////////////////////////
  2007. // G.728 related functions
  2008. ///////////////////////////////////////////////////////////////////////////// */
  2009. /*
  2010. // Name: ippsIIR16s_G728
  2011. // Purpose: IIR filter
  2012. // 1+B(1/z)/1+A(1/z)
  2013. // pCoeffs pointer to the input filter coefficients B[11], A[11] in Q14
  2014. // pSrcQntSpeech pointer to the input quantized speech vector
  2015. // pDstWgtSpeech pointer to the output perceptually weighted speech vector
  2016. // pMem pointer to the filter memory
  2017. */
  2018. #if !defined( _OWN_BLDPCS )
  2019. typedef struct _IIRState_G728_16s IppsIIRState_G728_16s;
  2020. #endif
  2021. IPPAPI(IppStatus, ippsIIR16sGetStateSize_G728_16s, (int *pSize))
  2022. IPPAPI(IppStatus, ippsIIR16sInit_G728_16s, (IppsIIRState_G728_16s *pMem ))
  2023. IPPAPI(IppStatus, ippsIIR16s_G728_16s, (const Ipp16s *pCoeffs, const Ipp16s *pSrcQntSpeech,
  2024. Ipp16s *pDstWgtSpeech, int len, IppsIIRState_G728_16s *pMem ))
  2025. /* /////////////////////////////////////////////////////////////////////////////
  2026. // Name: ippSynthesisFilter_G728
  2027. // Purpose: Synthesis filter of size LPC (50)
  2028. // 1/1+A(1/z)
  2029. // pCoeffs pointer to the input LPC filter coefficients vector[51]
  2030. // pSrcDstExc pointer to the input/output gain-scaled excitation vector[5] (ET)
  2031. // excSfs input scale of the previous gain-scaled excitation vector (NLSET)
  2032. // pDstSpeech pointer to the output quantized speech vector[5] (ST)
  2033. // pSpeechSfs output scale of the quantized speech vector (NLSST)
  2034. // pMem pointer to the filter memory
  2035. */
  2036. #if !defined( _OWN_BLDPCS )
  2037. typedef struct _SynthesisFilterState_G728_16s IppsSynthesisFilterState_G728_16s;
  2038. #endif
  2039. IPPAPI(IppStatus, ippsSynthesisFilterGetStateSize_G728_16s,(int* pSize))
  2040. IPPAPI(IppStatus, ippsSynthesisFilterInit_G728_16s,(IppsSynthesisFilterState_G728_16s *pMem))
  2041. IPPAPI(IppStatus, ippsSyntesisFilterZeroInput_G728_16s,(const Ipp16s* pCoeffs,
  2042. Ipp16s *pSrcDstExc, Ipp16s excSfs,Ipp16s *pDstSpeech, Ipp16s *pSpeechSfs,
  2043. IppsSynthesisFilterState_G728_16s *pMem))
  2044. /* /////////////////////////////////////////////////////////////////////////////
  2045. // Name: ippsCombinedFilter_G728
  2046. // Purpose: Combined filter
  2047. // Synthesis filter of size LPC (50) + Perceptual weighted filter (IIR)
  2048. // 1/1+A(1/z) * 1+B(1/z)/1+A(1/z)
  2049. // pSyntCoeffs pointer to the input LPC coefficient vector[51]: 1, a0,...,a50
  2050. // pWgtCoeffs pointer to the input WGT filter coefficients B[11] 1,b0,...,b10,
  2051. and A[11] 1,a0,...,a10 in Q14
  2052. // pDstWgtZIR pointer to the output synthesized speech vector
  2053. // pSrcDstExc pointer to the input/output gain-scaled excitation vector[5] (ET)
  2054. // excSfs input scale of the previous gain-scaled excitation vector (NLSET)
  2055. // pDstSpeech pointer to the output quantized speech vector[5] (ST)
  2056. // pSpeechSfs output scale of the quantized speech vector (NLSST)
  2057. // pMem pointer to the filter memory
  2058. */
  2059. #if !defined( _OWN_BLDPCS )
  2060. typedef struct _CombinedFilterState_G728_16s IppsCombinedFilterState_G728_16s;
  2061. #endif
  2062. IPPAPI(IppStatus, ippsCombinedFilterGetStateSize_G728_16s,(int* pSize))
  2063. IPPAPI(IppStatus, ippsCombinedFilterInit_G728_16s,(IppsCombinedFilterState_G728_16s* pMem))
  2064. IPPAPI(IppStatus, ippsCombinedFilterZeroInput_G728_16s,(const Ipp16s* pSyntCoeff,
  2065. const Ipp16s* pWgtCoeff, Ipp16s* pDstWgtZIR, IppsCombinedFilterState_G728_16s* pMem))
  2066. IPPAPI(IppStatus, ippsCombinedFilterZeroState_G728_16s,(const Ipp16s* pSyntCoeff,
  2067. const Ipp16s* pWgtCoeff, Ipp16s* pSrcDstExc, Ipp16s excSfs,
  2068. Ipp16s* pDstSpeech, Ipp16s* pSpeechSfs, IppsCombinedFilterState_G728_16s* pMem))
  2069. /* /////////////////////////////////////////////////////////////////////////////
  2070. // Name: ippsPostFilter_G728
  2071. // Purpose: Post filter
  2072. // gl*(1+glb*1/z^kp)* 1-B(1/z)/1-A(1/z) * (1+kp*1/z)
  2073. // gl LTP scaling factor
  2074. // glb LTP product term
  2075. // kp LTP lag, pitch period of current frame
  2076. // tiltz STP tilt-compensation coefficient
  2077. // pCoeffs pointer to the input LPC filter coefficients B(10), A(10)
  2078. // pSrc pointer to the input quantized speech vector SST [-kp,IDIM-1]
  2079. // pDst pointer to the output postfiltered speech vector
  2080. // pSTPmem pointer to the filter memory (61 short integers)
  2081. */
  2082. #if !defined( _OWN_BLDPCS )
  2083. typedef struct _PostFilterState_G728_16s IppsPostFilterState_G728_16s;
  2084. #endif
  2085. IPPAPI(IppStatus, ippsPostFilterGetStateSize_G728_16s,(int *pSize))
  2086. IPPAPI(IppStatus, ippsPostFilterInit_G728_16s,(IppsPostFilterState_G728_16s *pMem))
  2087. IPPAPI(IppStatus, ippsPostFilter_G728_16s,(Ipp16s gl, Ipp16s glb, Ipp16s kp, Ipp16s tiltz,
  2088. const Ipp16s *pCoeffs, const Ipp16s *pSrc, Ipp16s *pDst,
  2089. IppsPostFilterState_G728_16s *pMem))
  2090. /* /////////////////////////////////////////////////////////////////////////////
  2091. // Name: ippsWinHybrid_G728
  2092. // Purpose: Hybrid window auto-correlation for backward-adaptive analysis
  2093. // in LD-CELP window:
  2094. // s(M-N),s(M-N+1),...,s(M-1),s(M),s(M+1),...,s(M+L-1)
  2095. // M LPC order for backward adaptation
  2096. // L number of signal samples in backward adaptation
  2097. // N number of non-recursive samples in the hybrid window
  2098. // DIM block size, shall be defined for block scaled operation by
  2099. // the function _ippsWinHybridBlock_G728_16s,
  2100. // where pSrcSfs[i] is the scale factor of pSrc[i*DIM],...,pSrc[i*DIM+DIM-1]
  2101. // If 0, then default scale factor 14 is always used.
  2102. // pSrc input signal for backward-adaptive analysis
  2103. //
  2104. // ippsWinHybridGetStateSize_G728_16s: return the size of HWM memory
  2105. // ippsWinHybridInit_G728_16s: initialized the HWM memory given
  2106. // ippsWinHybridBlock_G728_16s : block operation
  2107. // ippsWinHybrid_G728_16s : non-block operation
  2108. */
  2109. #if !defined( _OWN_BLDPCS )
  2110. typedef struct _WinHybridState_G728_16s IppsWinHybridState_G728_16s;
  2111. #endif
  2112. IPPAPI(IppStatus, ippsWinHybridGetStateSize_G728_16s,(int M, int L, int N, int DIM, int *pMemSize))
  2113. IPPAPI(IppStatus, ippsWinHybridInit_G728_16s,(const Ipp16s *pWinTab,int M, int L, int N,
  2114. int DIM, Ipp16s a2L, IppsWinHybridState_G728_16s *pMem))
  2115. IPPAPI(IppStatus, ippsWinHybridBlock_G728_16s,(Ipp16s bfi, const Ipp16s *pSrc, const Ipp16s *pSrcSfs, Ipp16s *pDst,
  2116. IppsWinHybridState_G728_16s *pMem))
  2117. IPPAPI(IppStatus, ippsWinHybrid_G728_16s,(Ipp16s bfi, const Ipp16s *pSrc, Ipp16s *pDst,
  2118. IppsWinHybridState_G728_16s *pMem))
  2119. /* /////////////////////////////////////////////////////////////////////////////
  2120. // Name: ippsLevinsonDurbin_G728
  2121. // Purpose: Calculates LPC by Levinson-Durbin recursion
  2122. // pSrcAutoCorr pointer to the autocorrelation vector
  2123. // numSrcLPC number of precalculated LPC
  2124. // order LP order
  2125. // pDstLPC pointer to the LPC output vector
  2126. // pSrcDstLPC pointer to the input/output LPC vector
  2127. // pDstRC1 pointer to the output first RC
  2128. // pDstResidualEnergy pointer to output residual energy
  2129. // pDstScaleFactor pointer to the output scale factor of LPC
  2130. // pSrcDstScaleFactor pointer to the input/output scale factor of LPC
  2131. */
  2132. IPPAPI(IppStatus, ippsLevinsonDurbin_G728_16s_Sfs,(const Ipp16s *pSrcAutoCorr,
  2133. int order,
  2134. Ipp16s *pDstLPC,
  2135. Ipp16s *pDstRC1,
  2136. Ipp16s *pDstResidualEnergy,
  2137. Ipp16s *pDstScaleFactor))
  2138. IPPAPI(IppStatus, ippsLevinsonDurbin_G728_16s_ISfs,(const Ipp16s *pSrcAutoCorr,
  2139. int numSrcLPC,
  2140. int order,
  2141. Ipp16s *pSrcDstLPC,
  2142. Ipp16s *pSrcDstResidualEnergy,
  2143. Ipp16s *pSrcDstScaleFactor))
  2144. /* /////////////////////////////////////////////////////////////////////////////
  2145. // Name: ippsCodebookSearch_G728
  2146. // Purpose: Search for the best codebook vector
  2147. // pSrcCorr pointer to the input correlation vector
  2148. // pSrcEnergy pointer to the input energy of convolved shape codevector
  2149. // pDstShapeIdx pointer to the output best 7-bit shape codebook index
  2150. // pDstGainIdx pointer to the output best 3-bit gain codebook index
  2151. // rate input coding bit rate :
  2152. // IPP_SPCHBR_16000, IPP_SPCHBR_12800 or IPP_SPCHBR_9600
  2153. */
  2154. IPPAPI(IppStatus, ippsCodebookSearch_G728_16s,(
  2155. const Ipp16s* pSrcCorr, const Ipp16s* pSrcEnergy,
  2156. int* pDstShapeIdx, int* pDstGainIdx, Ipp16s* pDstCodebookIdx, IppSpchBitRate rate))
  2157. /* /////////////////////////////////////////////////////////////////////////////
  2158. // Name: ippsImpulseResponseEnergy_G728
  2159. // Purpose: Shape codevector convolution and energy calculation
  2160. // pSrcImpResp - pointer to the input impulse response vector of F(z)W(z)
  2161. // pDstEnergy - pointer to the output energy of convolved shape codevector Y2[1,NCWD]
  2162. */
  2163. IPPAPI(IppStatus, ippsImpulseResponseEnergy_G728_16s,(const Ipp16s *pSrcImpResp, Ipp16s *pDstEnergy))
  2164. /* Postfilter adapter block */
  2165. #if !defined( _OWN_BLDPCS )
  2166. typedef struct _PostFilterAdapterState_G728 IppsPostFilterAdapterState_G728;
  2167. #endif
  2168. /* /////////////////////////////////////////////////////////////////////////////
  2169. // Name: ippsPostFilterAdapterGetStateSize_G728
  2170. // Purpose: return the size of postfilter adapter memory.
  2171. */
  2172. IPPAPI(IppStatus, ippsPostFilterAdapterGetStateSize_G728, (int *pSize))
  2173. /* /////////////////////////////////////////////////////////////////////////////
  2174. // Name: ippsPostFilterAdapterStateInit_G728
  2175. // Purpose: initializes the memory for postfilter adapter.
  2176. */
  2177. IPPAPI(IppStatus, ippsPostFilterAdapterStateInit_G728, (IppsPostFilterAdapterState_G728 *pMem))
  2178. /* /////////////////////////////////////////////////////////////////////////////
  2179. // Name: ippsLPCInverseFilter_G728_16s
  2180. //
  2181. // Purpose: compute the LPC prediction residual for the current decoded speech vector. (block 81)
  2182. // Parameters:
  2183. // pSrcSpeech pointer to quantized speech buffer. (sst)
  2184. // pCoeffs pointer to 10th-order LPC filter coefficients. (apf)
  2185. // pDstResidual pointer to LPC prediction residual memory. (d)
  2186. // pMem pointer to postfilter adapter memory. (LPC inverse filter memory - "stlpci")
  2187. // Returns: IppStatus
  2188. // ippStsNoErr Ok
  2189. // ippStsNullPtrErr At least one of the specified pointers is NULL
  2190. // Notes:
  2191. */
  2192. IPPAPI(IppStatus, ippsLPCInverseFilter_G728_16s, (const Ipp16s* pSrcSpeech, const Ipp16s* pCoeffs,
  2193. Ipp16s* pDstResidual, IppsPostFilterAdapterState_G728* pMem))
  2194. /* /////////////////////////////////////////////////////////////////////////////
  2195. // Name: ippsPitchPeriodExtraction_G728_16s
  2196. //
  2197. // Purpose: extract the pitch period from the LPC prediction residual. (block 82)
  2198. // Parameters:
  2199. // pSrcResidual pointer to LPC prediction residual memory. (d)
  2200. // pPitchPeriod pointer to the pitch period of the frame. (kp1)
  2201. // pMem pointer to postfilter adapter memory. (lpfiir, lpfiir, dec)
  2202. // Returns: IppStatus
  2203. // ippStsNoErr Ok
  2204. // ippStsNullPtrErr At least one of the specified pointers is NULL
  2205. // Notes:
  2206. */
  2207. IPPAPI(IppStatus, ippsPitchPeriodExtraction_G728_16s, (const Ipp16s* pSrcResidual,
  2208. int* pPitchPeriod, IppsPostFilterAdapterState_G728* pMem))
  2209. /* /////////////////////////////////////////////////////////////////////////////
  2210. // G.728 end
  2211. ///////////////////////////////////////////////////////////////////////////// */
  2212. /* /////////////////////////////////////////////////////////////////////////////
  2213. // GSMFR related functions
  2214. ///////////////////////////////////////////////////////////////////////////// */
  2215. /* /////////////////////////////////////////////////////////////////////////////
  2216. // Name: ippsRPEQuantDecode_GSMFR_16s
  2217. // Purpose: APCM inverse quantization: decoding the RPE sequence of coded xMc
  2218. // pSrc pointer to the input RPE pulses vector[13] (xMc)
  2219. // pDst pointer to the output reconstructed long-term residual vector[13] (xMp)
  2220. // ampl block amplitude (xmaxc)
  2221. // amplSfs block amplitude scale factor
  2222. */
  2223. IPPAPI(IppStatus, ippsRPEQuantDecode_GSMFR_16s,
  2224. (const Ipp16s *pSrc, Ipp16s ampl, Ipp16s amplSfs, Ipp16s *pDst))
  2225. /* /////////////////////////////////////////////////////////////////////////////
  2226. // Name: ippsDeemphasize_GSMFR_16s_I
  2227. // Purpose: De-emphasis filtering (GSM 06.10 5.3.5)
  2228. // pSrcDst pointer to the input ST-synthesized signal (sr)
  2229. // and output post-processed speech (sr0)
  2230. // pMem pointer to the filter memory element
  2231. // len length of input/output vector
  2232. */
  2233. IPPAPI(IppStatus, ippsDeemphasize_GSMFR_16s_I,(Ipp16s *pSrcDst,int len,Ipp16s *pMem))
  2234. /* /////////////////////////////////////////////////////////////////////////////
  2235. // Name: ippsShortTermSynthesisFilter_GSMFR_16s
  2236. // Purpose: Short-term synthesis filtering (GSM 06.10 5.3.2)
  2237. // 1/A(z)
  2238. // pRC pointer to the input reflection coefficients vector[8]
  2239. // pSrc pointer to the input reconstructed short term residual vector[len]
  2240. // pDstSpch pointer to the output speech vector[len]
  2241. // len length of input residual and output speech vectors
  2242. // pMem pointer to the filter memory vector[9]
  2243. */
  2244. IPPAPI(IppStatus, ippsShortTermSynthesisFilter_GSMFR_16s,
  2245. (const Ipp16s *pRC, const Ipp16s *pSrcResidual, Ipp16s *pDstSpch, int len, Ipp16s *pMem))
  2246. /* /////////////////////////////////////////////////////////////////////////////
  2247. // Name: ippsShortTermAnalysisFilter_GSMFR_16s_I
  2248. // Purpose: Short-term analysis filtering (GSM 06.10 5.2.10)
  2249. // 1/A(z)
  2250. // pRC pointer to the input reflection coefficients vector[8]
  2251. // pSrcDstSpch pointer to the input preprocessed signal and output
  2252. // short term residual vector[len]
  2253. // len length of input residual and output speech vectors
  2254. // pMem pointer to the filter memory vector[9]
  2255. */
  2256. IPPAPI(IppStatus, ippsShortTermAnalysisFilter_GSMFR_16s_I,
  2257. (const Ipp16s *pRC, Ipp16s *pSrcDstSpch, int len, Ipp16s *pMem))
  2258. /* /////////////////////////////////////////////////////////////////////////////
  2259. // Name: ippsHighPassFilter_GSMFR
  2260. // Purpose: Offset compensation of the input signal, GSM 06.10 5.2.2
  2261. // Parameters:
  2262. // pSrc pointer to the input speech vector
  2263. // pDst pointer to the output filtered vector
  2264. // len length of input and output vectors
  2265. // pMem pointer to the filter memory vector[2]
  2266. // Returns: ippStsNoErr, if no errors
  2267. */
  2268. IPPAPI(IppStatus, ippsHighPassFilter_GSMFR_16s,
  2269. (const Ipp16s *pSrc, Ipp16s *pDst,int len,int *pMem))
  2270. /*/////////////////////////////////////////////////////////////////////////////
  2271. // Name: ippsSchur_GSMFR
  2272. // Purpose: Calculates reflection coefficients using Schur algorithm. GSM 06.10 5.2.5.
  2273. //
  2274. // Arguments:
  2275. // pSrc - Pointer to the input autocorrelations vector
  2276. // pDst - Pointer to the output reflection coefficients vector
  2277. // dstLen - vector destination length
  2278. // Returns: ippStsNoErr, if no errors
  2279. */
  2280. IPPAPI(IppStatus, ippsSchur_GSMFR_32s16s,(const Ipp32s *pSrc,Ipp16s *pDst,int dstLen))
  2281. /* /////////////////////////////////////////////////////////////////////////////
  2282. // Name: ippsWeightingFilter_GSMFR
  2283. // Purpose: weighting filtering. GSM 06.10 5.2.13
  2284. // Arguments:
  2285. // pSrc - pointer to the source vector
  2286. // pDst - pointer to the destination vector
  2287. // dstLen - source/destination length
  2288. // Returns: ippStsNoErr, if no errors
  2289. */
  2290. IPPAPI(IppStatus, ippsWeightingFilter_GSMFR_16s,(const Ipp16s *pSrc, Ipp16s *pDst,int dstLen))
  2291. /* /////////////////////////////////////////////////////////////////////////////
  2292. // Name: ippsPreemphasize_GSMFR
  2293. // Purpose: preemphasize offset compensated signal. GSM 06.10 5.2.3
  2294. // Arguments:
  2295. // pSrc - pointer to the source vector
  2296. // pDst - pointer to the destination vector
  2297. // pMem - pointer to the filter memory value
  2298. // len - source/destination length
  2299. // Returns: ippStsNoErr, if no errors
  2300. */
  2301. IPPAPI(IppStatus, ippsPreemphasize_GSMFR_16s,
  2302. (const Ipp16s *pSrc, Ipp16s *pDst, int len, Ipp16s *pMem))
  2303. /* /////////////////////////////////////////////////////////////////////////////
  2304. // GSMFR end
  2305. ///////////////////////////////////////////////////////////////////////////// */
  2306. /* /////////////////////////////////////////////////////////////////////////////
  2307. // AMRWB related functions
  2308. ///////////////////////////////////////////////////////////////////////////// */
  2309. /* /////////////////////////////////////////////////////////////////////////////
  2310. // Name: ippsResidualFilter_AMRWB_16s_Sfs
  2311. // Purpose: Compute the LPC residual by filtering the input speech through A(z).
  2312. // rounding to nearest:
  2313. // const1 = 1<<(scaleFactor-1)
  2314. // (a*b+const1)>>scaleFactor;
  2315. // Parameters:
  2316. // pSrcLpc pointer to the input LPC
  2317. // valLPCOrder length of the LPC vector
  2318. // pSrcSpeech pointer to the input vector[-valLPCOrder,..,-1,0,...,,len-1]
  2319. // pDstResidualSignal pointer to the output vector of length[len]
  2320. // len length of the vectors
  2321. // scaleFactor scale factor value
  2322. // Returns: ippStsNoErr, if no errors
  2323. */
  2324. IPPAPI( IppStatus, ippsResidualFilter_AMRWB_16s_Sfs,(
  2325. const Ipp16s *pSrcLpc,
  2326. Ipp16s valLPCOrder,
  2327. const Ipp16s *pSrcSpeech,
  2328. Ipp16s *pDstResidualSignal,
  2329. Ipp32s len,
  2330. Ipp32s scaleFactor
  2331. ))
  2332. /* /////////////////////////////////////////////////////////////////////////////
  2333. // Name: ippsResidualFilter_Low_16s_Sfs
  2334. // Purpose: Compute the LPC residual by filtering the input speech through A(z).
  2335. // rounding to nearest:
  2336. // const1 = 1<<(scaleFactor-1)
  2337. // (a*b+const1)>>scaleFactor;
  2338. // Parameters:
  2339. // pSrcLpc pointer to the input LPC
  2340. // valLPCOrder length of the LPC vector
  2341. // pSrcSpeech pointer to the input vector[-valLPCOrder,..,-1,0,...,,len-1]
  2342. // pDstResidualSignal pointer to the output vector of length[len]
  2343. // len length of the vectors
  2344. // scaleFactor scale factor value
  2345. // Returns: ippStsNoErr, if no errors
  2346. */
  2347. IPPAPI( IppStatus, ippsResidualFilter_Low_16s_Sfs,(
  2348. const Ipp16s *pSrcLpc,
  2349. Ipp16s valLPCOrder,
  2350. const Ipp16s *pSrcSpeech,
  2351. Ipp16s *pDstResidualSignal,
  2352. Ipp32s len,
  2353. Ipp32s scaleFactor
  2354. ))
  2355. /* /////////////////////////////////////////////////////////////////////////////
  2356. // Name : ippsLPCToISP_AMRWB_16s
  2357. // Purpose: LP to ISP coefficients conversion
  2358. // Parameters:
  2359. // pSrcLpc pointer to the input predictor coefficients
  2360. // pDstIsp pointer to the output immittance spectral pairs
  2361. // pSrcPrevIsp pointer to the input previous immittance spectral pairs.
  2362. // Returns: IppStatus
  2363. // ippStsNoErr if no error
  2364. */
  2365. IPPAPI( IppStatus, ippsLPCToISP_AMRWB_16s,(
  2366. const Ipp16s *pSrcLpc,
  2367. Ipp16s *pDstIsp,
  2368. const Ipp16s *pSrcPrevIsp
  2369. ))
  2370. /* /////////////////////////////////////////////////////////////////////////////
  2371. // Name : ippsISPToLPC_AMRWB_16s
  2372. // Purpose: ISP to LP coefficients conversion
  2373. // Parameters:
  2374. // pSrcIsp pointer to the input immittance spectral pairs
  2375. // pDstLpc pointer to the output predictor coefficients
  2376. // len length of the destination vector.
  2377. // Returns: IppStatus
  2378. // ippStsNoErr if no error
  2379. */
  2380. IPPAPI( IppStatus, ippsISPToLPC_AMRWB_16s,(
  2381. const Ipp16s *pSrcIsp,
  2382. Ipp16s *pDstLpc,
  2383. Ipp32s len
  2384. ))
  2385. /* /////////////////////////////////////////////////////////////////////////////
  2386. // Name: ippsISPToISF_Norm_AMRWB_16s
  2387. // Purpose:
  2388. // pDstIsf[i] = arccos(pSrcIsp[i]); i=0,...,lenLpc
  2389. // result is 15 bit scaled in range [0:0.5]
  2390. // Parameters:
  2391. // pSrcIsp pointer to the ISP input vector of values 15 bit scaled in range [-1:1]
  2392. // pDstIsf pointer to the ISF output vector
  2393. // len ISP order
  2394. // Returns: ippStsNoErr, if no errors
  2395. */
  2396. IPPAPI( IppStatus, ippsISPToISF_Norm_AMRWB_16s,(
  2397. const Ipp16s *pSrcIsp,
  2398. Ipp16s *pDstIsf,
  2399. Ipp32s len
  2400. ))
  2401. /* /////////////////////////////////////////////////////////////////////////////
  2402. // Name: ippsISFToISP_AMRWB_16s
  2403. // Purpose: ISF interpolation and conversion to LPC
  2404. // Parameters:
  2405. // pSrcIsf pointer to the ISF input vector of values 15 bit scaled in range [0:0.5]
  2406. // pDstIsp pointer to the LPC output vector of values 15 bit scaled in range [-1:1]
  2407. // len ISP order
  2408. // Returns: ippStsNoErr, if no errors
  2409. //
  2410. */
  2411. IPPAPI( IppStatus, ippsISFToISP_AMRWB_16s,(
  2412. const Ipp16s *pSrcIsf,
  2413. Ipp16s *pDstIsp,
  2414. Ipp32s len
  2415. ))
  2416. /* /////////////////////////////////////////////////////////////////////////////
  2417. // Name: ippsEncDTXBuffer_AMRWB_16s
  2418. //
  2419. // Purpose: Function buffer the ISP coefficients and previous log energy coefficients.
  2420. // Parameters:
  2421. // pSrcSpch - Pointer to the input speech signal, in the length of 320, in Q15.0.
  2422. // pSrcLsp - Pointer to the ISP for this frame, in the length of 16, in Q0.15.
  2423. // pUpdateIndex - Pointer to the previous memory update index. It is a value
  2424. // circularly increased between 0 and 7.
  2425. // pSrcDstLspBuffer - Pointer to the ISP coefficients of eight previous frames, in the
  2426. // length of 128, in Q0.15.
  2427. // pSrcDstLogEnergyBuffer - Pointer to the logarithm energy coefficients of eight previous
  2428. // frames,in the length of 8,in Q5.10.
  2429. // mode - coder mode
  2430. // Returns: IppStatus
  2431. // ippStsNoErr if no error
  2432. */
  2433. IPPAPI(IppStatus, ippsEncDTXBuffer_AMRWB_16s,(const Ipp16s * pSrcSpch,
  2434. const Ipp16s *pSrcIsp, Ipp16s *pUpdateIndex, Ipp16s *pSrcDstIspBuffer,
  2435. Ipp16s *pSrcDstLogEnergyBuffer, IppSpchBitRate mode))
  2436. /* /////////////////////////////////////////////////////////////////////////////
  2437. // Name: ippsDecDTXBuffer_AMRWB_16s
  2438. //
  2439. // Purpose: Function buffer the ISF coefficients and previous log energy coefficients.
  2440. // Parameters:
  2441. // pSrcSpch - Pointer to the input speech signal, in the length of 320, in Q15.0.
  2442. // pSrcIsf - Pointer to the ISF for this frame, in the length of 16, in Q0.15.
  2443. // pUpdateIndex - Pointer to the previous memory update index. It is a value
  2444. // circularly increased between 0 and 7.
  2445. // pSrcDstIsfBuffer - Pointer to the ISF coefficients of eight previous frames, in the
  2446. // length of 128, in Q0.15.
  2447. // pSrcDstLogEnergyBuffer - Pointer to the logarithm energy coefficients of eight previous
  2448. // frames,inthelength of 8,in Q5.10.
  2449. // Returns: IppStatus
  2450. // ippStsNoErr if no error
  2451. */
  2452. IPPAPI( IppStatus, ippsDecDTXBuffer_AMRWB_16s,(const Ipp16s *pSrcSpch,
  2453. const Ipp16s *pSrcIsf, Ipp16s *pUpdateIndex,
  2454. Ipp16s *pSrcDstIsfBuffer, Ipp16s *pSrcDstLogEnergyBuffer))
  2455. /* /////////////////////////////////////////////////////////////////////////////
  2456. // Name: ippsOpenLoopPitchSearch_AMRWB_16s
  2457. //
  2458. // Purpose: Extracts an open-loop pitch lag estimate from the weighted input speech
  2459. // Parameters:
  2460. // pSrcWgtSpch Pointer to a 320-element vector containing
  2461. // perceptually weighted speech.
  2462. // pSrcFltWgtSpch Pointer to a 320-element vector containing filtered
  2463. // perceptually weighted speech.
  2464. // pPrevMidPitchLag Pointer to the median filtered pitch lag
  2465. // of the 5 previous voiced
  2466. // speech half-frames
  2467. // pAdaptiveParam Pointer to the adaptive parameter.
  2468. // pDstOpenLoopLag Pointer to the open-loop pitch lag.
  2469. // pToneFlag Pointer to the tone flag for the VAD module.
  2470. // pDstOpenLoopGain Pointer to the optimal open-loop pitch gain.
  2471. // pSrcDstPrevPitchLag Pointer to the five-element vector that contains
  2472. // the pitch lags associated
  2473. // with the five most recent voiced speech half-frames
  2474. // pSrcDstLagSwitcher Switches lag weighting on and off
  2475. // len Length of the frame.
  2476. // Returns: IppStatus
  2477. // ippStsNoErr if no error
  2478. */
  2479. IPPAPI( IppStatus, ippsOpenLoopPitchSearch_AMRWB_16s,(const Ipp16s *pSrcWgtSpch,
  2480. const Ipp16s * pSrcFltWgtSpch, Ipp16s * pPrevMidPitchLag,
  2481. Ipp16s * pAdaptiveParam, Ipp16s * pDstOpenLoopLag,
  2482. Ipp16s * pToneFlag, Ipp16s * pDstOpenLoopGain,
  2483. Ipp16s * pSrcDstPrevPitchLag, Ipp16s * pSrcDstLagSwitcher, int len ))
  2484. #if !defined( _OWN_BLDPCS )
  2485. typedef struct _HighPassFilterState_AMRWB_16s IppsHighPassFilterState_AMRWB_16s;
  2486. #endif /* _OWN_BLDPCS */
  2487. /* /////////////////////////////////////////////////////////////////////////////
  2488. // Name: ippsHighPassFilterGetSize_AMRWB_16s
  2489. // Purpose: Query of AMRWB HP filter state memory size
  2490. // Parameters:
  2491. // pDstSize Pointer to the output value of the memory size needed for filtering
  2492. // order Order of filter/ Currently only 2 or 3 is supported
  2493. // Returns: ippStsNoErr, if no errors
  2494. */
  2495. IPPAPI(IppStatus, ippsHighPassFilterGetSize_AMRWB_16s,(int order, int *pDstSize))
  2496. /* /////////////////////////////////////////////////////////////////////////////
  2497. // Name: ippsHighPassFilterInit_AMRWB_16s
  2498. // Purpose: Initialization of the memory allocated for AMR WB high pass filter
  2499. // Parameters:
  2500. // pFilterCoeffA Pointer to a 4-element vector containing
  2501. // IIR part of the coefficiensts of the filter
  2502. // pFilterCoeffB Pointer to a 4-element vector containing
  2503. // FIR part of the coefficiensts of the filter
  2504. // pState pointer to the memory supplied for filtering
  2505. // Returns: ippStsNoErr, if no errors
  2506. //
  2507. */
  2508. IPPAPI(IppStatus, ippsHighPassFilterInit_AMRWB_16s,
  2509. (Ipp16s *pFilterCoeffA, Ipp16s *pFilterCoeffB, int order,
  2510. IppsHighPassFilterState_AMRWB_16s *pState))
  2511. /* /////////////////////////////////////////////////////////////////////////////
  2512. // Name: ippsHighPassFilter_AMRWB
  2513. // Purpose: High-pass filtering
  2514. // Parameters:
  2515. // pSrc pointer to the input vector[len]
  2516. // pDst pointer to the vector [len].
  2517. // pSrcDst pointer to the input/output vector [len].
  2518. // len length of the input and output vectors.
  2519. // pState pointer to the memory supplied for filtering
  2520. // valBounds if valBounds = 0 then pSrc[-1] and pSrc[len] are equal to zero
  2521. // otherwise they must be given.
  2522. // scaleFactor Scale factor
  2523. // Returns: ippStsNoErr, if no errors
  2524. */
  2525. IPPAPI(IppStatus, ippsHighPassFilter_AMRWB_16s_Sfs,(
  2526. const Ipp16s *pSrc, Ipp16s *pDst, int len,
  2527. IppsHighPassFilterState_AMRWB_16s *pState, int scaleFactor))
  2528. IPPAPI(IppStatus, ippsHighPassFilter_AMRWB_16s_ISfs,(
  2529. Ipp16s *pSrcDst, int len,
  2530. IppsHighPassFilterState_AMRWB_16s *pState, int scaleFactor))
  2531. IPPAPI(IppStatus, ippsHighPassFilter_Direct_AMRWB_16s,(
  2532. const Ipp16s *pSrcCoeff, const Ipp16s *pSrc, Ipp16s *pDst, int len, int valBounds ))
  2533. /* /////////////////////////////////////////////////////////////////////////////
  2534. // Name: ippsHighPassFilterGetDlyLine_AMRWB_16s
  2535. // Purpose: Get the delay line of high-pass filter.
  2536. // Parameters:
  2537. // pState Pointer to the memory supplied for filtering.
  2538. // pDlyLine Pointer to the vector of size [6 or 9] containing the filter memory.
  2539. // order The order of high-pass filter; orders of 2 and 3 is currently supported.
  2540. // Returns: ippStsNoErr, if no errors
  2541. */
  2542. IPPAPI(IppStatus, ippsHighPassFilterGetDlyLine_AMRWB_16s,
  2543. (const IppsHighPassFilterState_AMRWB_16s* pState, Ipp16s* pDlyLine, Ipp32s order))
  2544. /* /////////////////////////////////////////////////////////////////////////////
  2545. // Name: ippsHighPassFilterSetDlyLine_AMRWB_16s
  2546. // Purpose: Set the delay line of high-pass filter.
  2547. // Parameters:
  2548. // pDlyLine Pointer to the vector of size [6 or 9] containing the filter memory.
  2549. // pState Pointer to the memory supplied for filtering.
  2550. // order The order of high-pass filter; orders of 2 and 3 is currently supported.
  2551. // Returns: ippStsNoErr, if no errors
  2552. */
  2553. IPPAPI(IppStatus, ippsHighPassFilterSetDlyLine_AMRWB_16s,
  2554. (const Ipp16s* pDlyLine, IppsHighPassFilterState_AMRWB_16s* pState, Ipp32s order))
  2555. /* /////////////////////////////////////////////////////////////////////////////
  2556. // AMRWB Voice Activity Detector functions
  2557. // /////////////////////////////////////////////////////////////////////////////
  2558. */
  2559. #if !defined( _OWN_BLDPCS )
  2560. typedef struct _VADState_AMRWB_16s IppsVADState_AMRWB_16s;
  2561. #endif /* _OWN_BLDPCS */
  2562. /* /////////////////////////////////////////////////////////////////////////////
  2563. // Name: ippsVADGetSize_AMRWB_16s
  2564. // Purpose: AMRWB VADetector size -
  2565. // computes the size,in bytes,
  2566. // of the state variable structure IppsVADState_AMRWB_16s.
  2567. // Parameters:
  2568. // pState pointer to the VAD history variables
  2569. // Returns: IppStatus
  2570. // ippStsNoErr if no error
  2571. */
  2572. IPPAPI( IppStatus, ippsVADGetSize_AMRWB_16s,(int *pDstSize ))
  2573. /* /////////////////////////////////////////////////////////////////////////////
  2574. // Name: ippsVADGetSize_AMRWB_16s
  2575. // Purpose: Initialize AMRWB VADetector -
  2576. // of the state variable structure IppsVADState_AMRWB_16s.
  2577. // Parameters:
  2578. // pState pointer to the VAD history variables
  2579. // Returns: IppStatus
  2580. // ippStsNoErr if no error
  2581. */
  2582. IPPAPI( IppStatus, ippsVADInit_AMRWB_16s,(
  2583. IppsVADState_AMRWB_16s *pState
  2584. ))
  2585. /* /////////////////////////////////////////////////////////////////////////////
  2586. // Name: ippsVADGetEnergyLevel_AMRWB_16s
  2587. // Purpose: return energy level vector
  2588. // Parameters:
  2589. // pState pointer to the VAD history variables
  2590. // pEnergyLevel pointer to the destination vector of enrgy level [12]
  2591. // Returns: IppStatus
  2592. // ippStsNoErr if no error
  2593. // ippStsNullPtrErr if at least one of the poiners is null.
  2594. */
  2595. IPPAPI (IppStatus, ippsVADGetEnergyLevel_AMRWB_16s,
  2596. (const IppsVADState_AMRWB_16s* pState, Ipp16s* pEnergyLevel))
  2597. /* /////////////////////////////////////////////////////////////////////////////
  2598. // Name: ippsVAD_AMRWB_16s
  2599. //
  2600. // Purpose: AMRWB VADetector -
  2601. // detect type of frame - active (voice) or inactive (unvoiced)
  2602. // Parameters:
  2603. // pSrcSpch pointer to the input speech signal, in the length of 320
  2604. // pState pointer to the VAD history variables
  2605. // pVadFlag pointer to the VAD type detected (1 - voice)
  2606. // pToneFlag pointer to tone detected
  2607. // Returns: IppStatus
  2608. // ippStsNoErr if no error
  2609. */
  2610. IPPAPI( IppStatus, ippsVAD_AMRWB_16s,(const Ipp16s *pSrcSpch,
  2611. IppsVADState_AMRWB_16s *pState,
  2612. Ipp16s *pToneFlag,
  2613. Ipp16s *pVadFlag))
  2614. /* /////////////////////////////////////////////////////////////////////////////
  2615. // Name: ippsAlgebraicCodebookSearch_AMRWB_16s
  2616. //
  2617. // Purpose: Fixed (algebraic) codebook search functions
  2618. // Parameters:
  2619. // pSrcFixedTarget target vector
  2620. // pSrcLtpResidual long term prediction residual
  2621. // pSrcDstImpulseResponse impulse response of weighted synthesis
  2622. // filter h[-L_subfr..-1] must be set to zero
  2623. // pDstFixedVector innovative codebook
  2624. // pDstFltFixedVector filtered fixed codebook excitation
  2625. // pDstIndex Indexes of the pulses
  2626. // mode coder mode
  2627. // Returns: IppStatus
  2628. // ippStsNoErr if no error
  2629. */
  2630. IPPAPI(IppStatus, ippsAlgebraicCodebookSearch_AMRWB_16s,(
  2631. const Ipp16s *pSrcFixedTarget,
  2632. const Ipp16s *pSrcLtpResidual,
  2633. Ipp16s *pSrcDstImpulseResponse,
  2634. Ipp16s *pDstFixedVector,
  2635. Ipp16s *pDstFltFixedVector,
  2636. IppSpchBitRate mode,
  2637. Ipp16s *pDstIndex
  2638. ))
  2639. /* /////////////////////////////////////////////////////////////////////////////
  2640. // Name: ippsAlgebraicCodebookDecode_AMRWB_16s
  2641. //
  2642. // Purpose: This function decodes the fixed (algebraic) codebook parameters transmitted by the encoder.
  2643. // Parameters:
  2644. // pSrcIdxs Algebraic codebook indexes.
  2645. // pDstFixedCode Pointer to the algebraic codevector, in the length of 64
  2646. // mode coder mode
  2647. // Returns: IppStatus
  2648. // ippStsNoErr if no error
  2649. */
  2650. IPPAPI(IppStatus, ippsAlgebraicCodebookDecode_AMRWB_16s,(
  2651. const Ipp16s *pSrcIdxs,
  2652. Ipp16s *pDstFixedCode,
  2653. IppSpchBitRate mode
  2654. ))
  2655. /* /////////////////////////////////////////////////////////////////////////////
  2656. // Name: ippsInterpolateC_NR_16s
  2657. // Purpose: interpolation of two vector
  2658. // dst = (src1*va1*2^scaleFactor1 + src2*val2*2^scaleFactor2)*2^-16
  2659. // Parameters:
  2660. // pSrc1 pointer to the input vector1
  2661. // val1 interpolation coeff. of first vector
  2662. // val1ScaleFactor val1 scaling factor
  2663. // pSrc2 pointer to the input vector2
  2664. // val2 interpolation coeff. of second vector
  2665. // val2scaleFactor val2 scaling factor
  2666. // pDst pointer to the interpolated output vector
  2667. // len length of the vectors
  2668. / Returns: ippStsNoErr, if no errors
  2669. */
  2670. IPPAPI(IppStatus, ippsInterpolateC_NR_16s,
  2671. (const Ipp16s *pSrc1, Ipp16s val1, int val1ScaleFactor, const Ipp16s *pSrc2,
  2672. Ipp16s val2, int val2ScaleFactor, Ipp16s *pDst, int len))
  2673. /* /////////////////////////////////////////////////////////////////////////////
  2674. // Name: ippsPreemphasize_AMRWB_16s_ISfs
  2675. // Purpose: Preemphasis filter
  2676. // H(z) = 1 - gamma z^-1
  2677. // Parameters:
  2678. // pSrcDst pointer to the input/output vector
  2679. // gamma filter coeeficient
  2680. // ScaleFactor scale factor for the result
  2681. // len length of the input/output vector
  2682. // pMem pointer to the filter memory of length 1
  2683. // Returns: IppStatus
  2684. // ippStsNoErr if no error
  2685. */
  2686. IPPAPI(IppStatus, ippsPreemphasize_AMRWB_16s_ISfs,(Ipp16s gamma, Ipp16s *pSrcDst,
  2687. int len, int ScaleFactor, Ipp16s* pMem))
  2688. /* /////////////////////////////////////////////////////////////////////////////
  2689. // Name : ippsAdaptiveCodebookGainCoeff_AMRWB_16s
  2690. // Purpose: Compute the adaptive codebook gain
  2691. //
  2692. // Parameters:
  2693. // pSrcAdptTarget: Pointer to the adaptive-codebook vector.
  2694. // pSrcFltAdptVector: Pointer to the input filtered adaptive-codebook vector.
  2695. // pResultAdptGain: Pointer to the adaptive-codebook gain in the length of 1.
  2696. // pResultAdptGainCoeffs Pointer to the output vector in the length 4 represents
  2697. // the adaptive-codebook gain as a fraction:
  2698. // xy * 2^exp_xy
  2699. // gain = -------------
  2700. // yy * 2^exp_yy
  2701. // where yy = pResultAdptGainCoeffs[0]
  2702. // exp_yy = pResultAdptGainCoeffs[1]
  2703. // xy = pResultAdptGainCoeffs[2]
  2704. // exp_xy = pResultAdptGainCoeffs[3]
  2705. // If xy < 0 then pResultAdptGain = 0;
  2706. // len length of vectors
  2707. // Returns: IppStatus
  2708. // ippStsNoErr if no error
  2709. */
  2710. IPPAPI( IppStatus, ippsAdaptiveCodebookGainCoeff_AMRWB_16s,(const Ipp16s * pSrcAdptTarget,
  2711. const Ipp16s * pSrcFltAdptVector, Ipp16s * pDstGainCoeff, Ipp16s * pResultAdptGain, int len))
  2712. /* /////////////////////////////////////////////////////////////////////////////
  2713. // Name: ippsISFQuant_AMRWB_16s
  2714. //
  2715. // Purpose: Quantizes the ISF coefficient vector, then obtains quantized ISF codebook indices.
  2716. // Parameters:
  2717. // pSrcIsf - Pointer to the unquantized 16-element ISF vector.
  2718. // pSrcDstResidual - Pointer to the 16-element quantized ISF residual from the previous
  2719. // frame.
  2720. // pDstQIsf - Pointer to the 16-element quantized ISF vector.
  2721. // pDstQIsfIndex - Pointer to the 7-element vector of quantized ISP indices. For 6.60 Kbps
  2722. // frames only the first five elements contain valid indices,
  2723. // for all other bit rates, all seven elements contain valid data
  2724. // mode - Bit rate specifier.
  2725. // Returns: IppStatus
  2726. // ippStsNoErr if no error
  2727. */
  2728. IPPAPI( IppStatus, ippsISFQuant_AMRWB_16s,(const Ipp16s *pSrcIsf,
  2729. Ipp16s *pSrcDstResidual, Ipp16s *pDstQIsf,
  2730. Ipp16s *pDstQIsfIndex, IppSpchBitRate mode))
  2731. /* /////////////////////////////////////////////////////////////////////////////
  2732. // Name: ippsISFQuantDecode_AMRWB_16s
  2733. //
  2734. // Purpose: Decodes quantized ISFs from the received codebook index if the
  2735. // errors are not detected on the received frame. Otherwise, the
  2736. // function recovers the quantized ISFs from previous quantized
  2737. // ISFs using linear interpolation.
  2738. // Parameters:
  2739. // pSrcIdxs - Pointer to the seven-element vector containing codebook indices
  2740. // of the quantized LSPs.
  2741. // pSrcDstResidual - Pointer to the 16-element quantized ISF residual from
  2742. // the previous frame.
  2743. // pSrcPrevQntIsf - Pointer to the 16-element quantized ISF vector from the previous
  2744. // frame.
  2745. // pSrcDstIsfMemory - Pointer to the 64-element vector containing four subframe ISF sets.
  2746. // pDstQntIsf - Pointer to a 16-element destination vector containing quantized ISF in frequency domain (0..0.5).
  2747. // bfi - Bad frame indicator; "0" signifies a good frame; all other values
  2748. // signify a bad frame.
  2749. // mode - Bit rate specifier.
  2750. // Returns: IppStatus
  2751. // ippStsNoErr if no error
  2752. */
  2753. IPPAPI( IppStatus, ippsISFQuantDecode_AMRWB_16s,(
  2754. const Ipp16s *pSrcIdxs,
  2755. Ipp16s *pDstQntIsf,
  2756. Ipp16s *pSrcDstResidual,
  2757. const Ipp16s *pSrcPrevQntIsf,
  2758. Ipp16s *pSrcDstIsfMemory,
  2759. int bfi,
  2760. IppSpchBitRate mode
  2761. ))
  2762. /* /////////////////////////////////////////////////////////////////////////////
  2763. // Name: ippsISFQuantDTX_AMRWB_16s
  2764. //
  2765. // Purpose: Quantizes the ISP coefficient vector, then obtains quantized ISP codebook indices in case of DTX mode.
  2766. // Parameters:
  2767. // pSrcIsf - Pointer to the unquantized 16-element ISF in the frequency domain (0..0.5) vector.
  2768. // pDstQntIsf - Pointer to the 16-element quantized ISF vector.
  2769. // pDstIdxs - Pointer to the 5-element vector quantization indices.
  2770. // Returns: IppStatus
  2771. // ippStsNoErr if no error
  2772. */
  2773. IPPAPI( IppStatus, ippsISFQuantDTX_AMRWB_16s,(
  2774. const Ipp16s *pSrcIsf,
  2775. Ipp16s *pDstQntIsf,
  2776. Ipp16s *pDstIdxs
  2777. ))
  2778. /* /////////////////////////////////////////////////////////////////////////////
  2779. // Name: ippsISFQuantDecodeDTX_AMRWB_16s
  2780. //
  2781. // Purpose: Decodes quantized ISFs from the received codebook index in case of DTX mode.
  2782. // Parameters:
  2783. // pSrcIdxs - Pointer to the 5-element vector quantization indices.
  2784. // pDstQntIsf - Pointer to the 16-element ISF in the frequency domain (0..0.5) vector.
  2785. // Returns: IppStatus
  2786. // ippStsNoErr if no error
  2787. */
  2788. IPPAPI( IppStatus, ippsISFQuantDecodeDTX_AMRWB_16s,(
  2789. const Ipp16s *pSrcIdxs,
  2790. Ipp16s *pDstQntIsf
  2791. ))
  2792. /* /////////////////////////////////////////////////////////////////////////////
  2793. // Name: ippsSynthesisFilter_AMRWB_16s32s_I
  2794. //
  2795. // Purpose:
  2796. // Parameters:
  2797. // pSrcLpc Pointer to the LP coefficients vector.
  2798. // order Order of LP filter.
  2799. // pSrcExc Pointer to the excitation vector.
  2800. // pSrcDst Pointer to the synthesized and updated speech.
  2801. // len
  2802. // Returns: IppStatus
  2803. // ippStsNoErr if no error
  2804. */
  2805. IPPAPI(IppStatus, ippsSynthesisFilter_AMRWB_16s32s_I,(
  2806. const Ipp16s *pSrcLpc, int order, const Ipp16s *pSrcExc, Ipp32s *pSrcDstSignal, int len))
  2807. /* /////////////////////////////////////////////////////////////////////////////
  2808. // Name: ippsDeemphasize_AMRWB
  2809. // Purpose: De-emphasis filtering.
  2810. // Parameters:
  2811. // gamma deemphasis factor.
  2812. // pSrc pointer to the input vector
  2813. // pDst pointer to the output vector
  2814. // pSrcDst pointer to the input/output vector
  2815. // pMem memory (pSrcDst[-1])
  2816. // len length of input/output vector
  2817. */
  2818. IPPAPI(IppStatus, ippsDeemphasize_AMRWB_32s16s,(
  2819. Ipp16s gamma, const Ipp32s *pSrc, Ipp16s *pDst, int len, Ipp16s *pMem))
  2820. IPPAPI(IppStatus, ippsDeemphasize_AMRWB_NR_16s_I,(
  2821. Ipp16s gamma, Ipp16s *pSrcDst, int len, Ipp16s *pMem))
  2822. /* /////////////////////////////////////////////////////////////////////////////
  2823. // Name: ippsAdaptiveCodebookSearch_AMRWB_16s
  2824. //
  2825. // Purpose: Performs the adaptive codebook search.
  2826. // Parameters:
  2827. // pSrcAdptTarget Pointer to the 64-element adaptive target signal vector,
  2828. // pSrcImpulseResponse Pointer to the 64-element impulse response of the weighted synthesis
  2829. // filter.
  2830. // pSrcOpenLoopLag Pointer to a two-element vector of open-loop pitch lags.
  2831. // pPitchLag Pointer to output the previous integral pitch lag.
  2832. // pPitchLagBounds Pointer to output the previous integral pitch lag bounds.
  2833. // pSrcDstExcitation Pointer to the 321-element excitation vector.
  2834. // pFracPitchLag Pointer to output the fractional pitch lag obtained during the adaptive codebook
  2835. // search.
  2836. // pAdptIndex Pointer to output the coded closed-loop pitch index.
  2837. // subFrame Subframe number
  2838. // mode Coder mode
  2839. // Returns: IppStatus
  2840. // ippStsNoErr if no error
  2841. */
  2842. IPPAPI(IppStatus, ippsAdaptiveCodebookSearch_AMRWB_16s,(
  2843. const Ipp16s * pSrcAdptTarget,
  2844. const Ipp16s * pSrcImpulseResponse,
  2845. const Ipp16s * pSrcOpenLoopLag,
  2846. Ipp16s * pPitchLag,
  2847. Ipp16s * pPitchLagBounds,
  2848. Ipp16s * pSrcDstExcitation,
  2849. Ipp16s * pFracPitchLag,
  2850. Ipp16s * pAdptIndex,
  2851. int subFrame,
  2852. IppSpchBitRate mode))
  2853. #if !defined( _OWN_BLDPCS )
  2854. typedef struct _AdaptiveCodebookDecodeState_AMRWB_16s IppsAdaptiveCodebookDecodeState_AMRWB_16s;
  2855. #endif /* _OWN_BLDPCS */
  2856. /* /////////////////////////////////////////////////////////////////////////////
  2857. // Name: ippsAdaptiveCodebookDecode
  2858. //
  2859. // Purpose: This function decodes the adaptive codebook parameters transmitted by the encoder, and then
  2860. // applies them to interpolate an adaptive codebook vector.
  2861. // valAdptIndex Adaptive codebook index.
  2862. // pFracPitchLag Pointer to the fractional pitch lag obtained during the adaptive codebook
  2863. // search.
  2864. // pResultPrevIntPitchLagBounds Pointer to the previous integral pitch lag bounds.
  2865. // pSrcDstExcitation Pointer to the 321-element excitation vector.
  2866. // pResultIntPitchLag Pointer to the integral pitch lag.
  2867. // subFrame Subframe number
  2868. // bfi Bad frame indicator. "0" signifies a good frame; any other value signifies a bad frame.
  2869. // unusableFrame
  2870. // mode Coder mode
  2871. // pState Pointer to the memory supplied for function.
  2872. // Returns: IppStatus
  2873. // ippStsNoErr if no error
  2874. */
  2875. IPPAPI(IppStatus, ippsAdaptiveCodebookDecodeGetSize_AMRWB_16s,(int *pDstSize))
  2876. IPPAPI(IppStatus, ippsAdaptiveCodebookDecodeInit_AMRWB_16s,(IppsAdaptiveCodebookDecodeState_AMRWB_16s *pState))
  2877. IPPAPI(IppStatus, ippsAdaptiveCodebookDecodeUpdate_AMRWB_16s,(int valPitchGain, int valIntPitchLag,
  2878. IppsAdaptiveCodebookDecodeState_AMRWB_16s *pState))
  2879. IPPAPI(IppStatus, ippsAdaptiveCodebookDecode_AMRWB_16s,(
  2880. int valAdptIndex,
  2881. Ipp16s * pFracPitchLag,
  2882. Ipp16s * pSrcDstExcitation,
  2883. Ipp16s * pResultIntPitchLag,
  2884. Ipp16s * pResultPrevIntPitchLagBounds,
  2885. int subFrame,
  2886. int bfi,
  2887. int unusableFrame,
  2888. IppSpchBitRate mode,
  2889. IppsAdaptiveCodebookDecodeState_AMRWB_16s *pState))
  2890. /* /////////////////////////////////////////////////////////////////////////////
  2891. // Name: ippsGainQuant_AMRWB_16s
  2892. // Purpose: Quantization of the adaptive codebook gains
  2893. // pSrcAdptTarget - pointer to the input target vector x(n).
  2894. // pSrcFltAdptVector - pointer to the input filtered adaptive codebook vector y(n)
  2895. // valFormat - format of the pSrcAdptTarget and pSrcFltAdptVector vectors.
  2896. // pSrcFixedVector - pointer to the input pre-filtered codebook contribition c(n)
  2897. // pSrcFltFixedVector - pointer to the input filtered codebook vector z(n)
  2898. // pSrcCorr - pointer to the vector of correlations between pSrcAdptTarget, pSrcFltAdptVector,
  2899. // pSrcFltFixedVector vectors.
  2900. // pSrcDstEnergyErr - pointer to the input/output energy error vector
  2901. // for 4 previous subframes
  2902. // pSrcDstPitchGain - Pointer to the input/output pitch gain.
  2903. // pDstCodeGain - Pointer to the output code gain.
  2904. // valClipFlag - if valClipFlag = 1 then limit gain pitch to 1.0.
  2905. // pDstQGainIndex - Pointer to the output codebook indexes found
  2906. // lenSrc - Length of the input vectors.
  2907. // mode - Coder mode.
  2908. // Returns: IppStatus
  2909. // ippStsNoErr if no error
  2910. */
  2911. IPPAPI( IppStatus, ippsGainQuant_AMRWB_16s,(
  2912. const Ipp16s *pSrcAdptTarget, const Ipp16s *pSrcFltAdptVector, int valFormat,
  2913. const Ipp16s * pSrcFixedVector, const Ipp16s *pSrcFltFixedVector, const Ipp16s *pSrcCorr,
  2914. Ipp16s *pSrcDstEnergyErr, Ipp16s *pSrcDstPitchGain, int *pDstCodeGain,
  2915. int valClipFlag, Ipp16s *pDstQGainIndex, int lenSrc, IppSpchBitRate mode))
  2916. /* /////////////////////////////////////////////////////////////////////////////
  2917. // Name: ippsDecodeGain_AMRWB_16s
  2918. // Purpose: Decode adaptive and fixed-codebook gains
  2919. // valQIndex - index of quantization.
  2920. // valEnergy - energy of code vector.
  2921. // pDstPitchGain - Pointer to decoded pitch gain.
  2922. // pDstCodeGain - Pointer to decoded code gain.
  2923. // bfi - Bad frame indicator.
  2924. // prevBfi - Bad frame indicator of the previous frame.
  2925. // pSrcDstPastEnergy - past quantized energies
  2926. // pPrevCodeGain - Past code gain.
  2927. // pSrcDstPastCodeGain - Past code gain for frame erasures.
  2928. // mode - Coder mode.
  2929. // Returns: IppStatus
  2930. // ippStsNoErr if no error
  2931. */
  2932. IPPAPI( IppStatus, ippsDecodeGain_AMRWB_16s,(
  2933. int valQIndex,
  2934. Ipp32s valEnergy,
  2935. Ipp16s *pDstPitchGain,
  2936. int *pDstCodeGain,
  2937. int bfi,
  2938. int prevBfi,
  2939. Ipp16s *pSrcDstPastEnergy,
  2940. Ipp16s *pPrevCodeGain,
  2941. Ipp16s *pSrcDstPastCodeGain,
  2942. IppSpchBitRate mode
  2943. ))
  2944. /* /////////////////////////////////////////////////////////////////////////////
  2945. // AMRWB end
  2946. ///////////////////////////////////////////////////////////////////////////// */
  2947. /* /////////////////////////////////////////////////////////////////////////////
  2948. // AMRWBE related functions
  2949. ///////////////////////////////////////////////////////////////////////////// */
  2950. /* /////////////////////////////////////////////////////////////////////////////
  2951. // Name: ippsAdaptiveCodebookSearch_AMRWBE_16s
  2952. //
  2953. // Purpose: Performs the adaptive codebook search.
  2954. // Parameters:
  2955. // pSrcAdptTarget Pointer to the 64-element adaptive target signal vector,
  2956. // pSrcImpulseResponse Pointer to the 64-element impulse response of the weighted synthesis
  2957. // filter.
  2958. // pSrcOpenLoopLag Pointer to a two-element vector of open-loop pitch lags.
  2959. // pPitchLag Pointer to output the previous integral pitch lag.
  2960. // pPitchLagBounds Pointer to output the previous integral pitch lag bounds.
  2961. // pSrcDstExcitation Pointer to the 321-element excitation vector.
  2962. // pFracPitchLag Pointer to output the fractional pitch lag obtained during the adaptive codebook
  2963. // search.
  2964. // pAdptIndex Pointer to output the coded closed-loop pitch index.
  2965. // subFrame Subframe number
  2966. // mode Coder mode
  2967. // pitchOffset Offset for pitch adjustment corresponding internal sampling frequency scale.
  2968. // Returns: IppStatus
  2969. // ippStsNoErr if no error
  2970. */
  2971. IPPAPI(IppStatus, ippsAdaptiveCodebookSearch_AMRWBE_16s,(
  2972. const Ipp16s * pSrcAdptTarget,
  2973. const Ipp16s * pSrcImpulseResponse,
  2974. const Ipp16s * pSrcOpenLoopLag,
  2975. Ipp16s * pPitchLag,
  2976. Ipp16s * pPitchLagBounds,
  2977. Ipp16s * pSrcDstExcitation,
  2978. Ipp16s * pFracPitchLag,
  2979. Ipp16s * pAdptIndex,
  2980. int subFrame,
  2981. IppSpchBitRate mode,
  2982. Ipp16s pitchOffset))
  2983. /* /////////////////////////////////////////////////////////////////////////////
  2984. // Name: ippsAdaptiveCodebookDecode_AMRWBE_16s
  2985. //
  2986. // Purpose: This function decodes the adaptive codebook parameters transmitted by the encoder, and then
  2987. // applies them to interpolate an adaptive codebook vector.
  2988. // Parameters:
  2989. // valAdptIndex Adaptive codebook index.
  2990. // pSrcDstExcitation Pointer to the 321-element excitation vector.
  2991. // pSrcDstPitchLag Pointer to the integral pitch lag.
  2992. // pSrcDstFracPitchLag Pointer to the fractional pitch lag obtained during the adaptive
  2993. // codebook search.
  2994. // pSrcDstPitchLagBounds Pointer to the integral pitch lag bounds.
  2995. // subFrame Subframe number
  2996. // bfi Bad frame indicator. "0" signifies a good frame; any other value signifies a bad frame.
  2997. // pitchOffset Offset for pitch adjustment corresponding internal sampling frequency scale.
  2998. // Returns: IppStatus
  2999. // ippStsNoErr if no error
  3000. */
  3001. IPPAPI(IppStatus, ippsAdaptiveCodebookDecode_AMRWBE_16s, (
  3002. int valAdptIndex,
  3003. Ipp16s* pSrcDstExcitation,
  3004. Ipp16s* pSrcDstPitchLag,
  3005. Ipp16s* pSrcDstFracPitchLag,
  3006. Ipp16s* pSrcDstPitchLagBounds,
  3007. int subFrame,
  3008. int bfi,
  3009. Ipp16s pitchOffset))
  3010. /* /////////////////////////////////////////////////////////////////////////////
  3011. // Name: ippsGainQuant_AMRWBE_16s
  3012. // Purpose: Quantization of the adaptive codebook gains
  3013. // Parameters:
  3014. // pSrcAdptTarget - pointer to the input target vector x(n).
  3015. // pSrcFltAdptVector - pointer to the input filtered adaptive codebook vector y(n)
  3016. // valFormat - format of the pSrcAdptTarget and pSrcFltAdptVector vectors.
  3017. // pSrcFixedVector - pointer to the input pre-filtered codebook contribition c(n)
  3018. // pSrcFltFixedVector - pointer to the input filtered codebook vector z(n)
  3019. // lenSrc - Length of the input vectors.
  3020. // pSrcCorr - pointer to the vector of correlations between pSrcAdptTarget, pSrcFltAdptVector,
  3021. // pSrcFltFixedVector vectors [4].
  3022. // meanEnergy - The average energy in the whole frame.
  3023. // pSrcDstPitchGain - Pointer to the input/output pitch gain.
  3024. // pDstCorrFactor - Pointer to the correction factor.
  3025. // pDstCodeGain - Pointer to the output code gain.
  3026. // pDstQGainIndex - Pointer to the output codebook indexes found
  3027. // Returns: IppStatus
  3028. // ippStsNoErr if no error
  3029. */
  3030. IPPAPI(IppStatus, ippsGainQuant_AMRWBE_16s,(
  3031. const Ipp16s *pSrcAdptTarget, const Ipp16s *pSrcFltAdptVector, int valFormat,
  3032. const Ipp16s *pSrcFixedVector, const Ipp16s *pSrcFltFixedVector, int lenSrc,
  3033. const Ipp16s *pSrcCorr, Ipp16s meanEnergy, Ipp16s *pSrcDstPitchGain,
  3034. Ipp16s* pDstCorrFactor, int *pDstCodeGain, Ipp16s *pDstQGainIndex))
  3035. /* /////////////////////////////////////////////////////////////////////////////
  3036. // Name: ippsSNR_AMRWBE_16s
  3037. // Purpose: Calculate the signal to noise ratio.
  3038. // Parameters:
  3039. // pSrcSignal Pointer to the input signal.
  3040. // pSrcEstimatedSiganl Pointer to the estimated signal.
  3041. // lenSrc Length of the signals.
  3042. // lenSeg Length of segments (subframes).
  3043. // pDstSNR Pointer to the output signal-to-noise ratio in dB.
  3044. // Returns: IppStatus
  3045. // ippStsNoErr if no error
  3046. */
  3047. IPPAPI(IppStatus, ippsSNR_AMRWBE_16s, (const Ipp16s* pSrcSignal,
  3048. const Ipp16s* pSrcEstimatedSignal, int lenSrc, int lenSeg, Ipp16s* pDstSNR))
  3049. /* /////////////////////////////////////////////////////////////////////////////
  3050. // Name: ippsGainQuantTCX_AMRWBE_16s
  3051. // Purpose: Gain optimization and quantization.
  3052. // Parameters:
  3053. // pSrcSignal Pointer to the original weighted signal.
  3054. // srcScale Format of input signal.
  3055. // pSrcQuantSiganl Pointer to the quantized weighted signal.
  3056. // len Length of the signals.
  3057. // quantFlag If quantFlag = 0, then compute and return optimal gain only,
  3058. // else calculate and return quantized gain and quant index.
  3059. // pGain Pointer to the output quantized (or optimal) gain.
  3060. // pQuantIdx Pointer to the output index of quantization.
  3061. // Returns: IppStatus
  3062. // ippStsNoErr if no error
  3063. */
  3064. IPPAPI(IppStatus, ippsGainQuantTCX_AMRWBE_16s, (const Ipp16s *pSrcSignal,
  3065. Ipp16s srcScale, const Ipp16s *pSrcQuantSignal, int len, Ipp32s quantFlag,
  3066. Ipp32s *pGain, Ipp16s *pQuantIdx))
  3067. /* /////////////////////////////////////////////////////////////////////////////
  3068. // Name: ippsGainDecodeTCX_AMRWBE_16s
  3069. // Purpose: Decode the global TCX gain.
  3070. // Parameters:
  3071. // pSrcQuantSignal Pointer to the quantized vector.
  3072. // lenSrc Length of the input signal.
  3073. // quantIdx Index of quantization.
  3074. // bfi Bad frame indicator: value "0" signifies a good frame,
  3075. // all other values signify a bad frame.
  3076. // pSrcDstRMSval Pointer to root mean square value.
  3077. // pGain Pointer to the output global TCX gain.
  3078. // Returns: IppStatus
  3079. // ippStsNoErr if no error
  3080. */
  3081. IPPAPI(IppStatus, ippsGainDecodeTCX_AMRWBE_16s, (const Ipp16s *pSrcQuantSignal,
  3082. int lenSrc, Ipp16s quantIdx, Ipp32s bfi, Ipp16s *pSrcDstRMSval, Ipp32s *pGain))
  3083. /* /////////////////////////////////////////////////////////////////////////////
  3084. // Name: ippsISFQuantDecode_AMRWBE_16s
  3085. //
  3086. // Purpose: Decodes quantized ISFs from the received codebook index if the
  3087. // errors are not detected on the received frame. Otherwise, the
  3088. // function recovers the quantized ISFs from previous quantized
  3089. // ISFs using linear interpolation.
  3090. // Parameters:
  3091. // pSrcIdxs - Pointer to the seven-element vector containing codebook indices
  3092. // of the quantized LSPs.
  3093. // pSrcDstResidual - Pointer to the 16-element quantized ISF residual from
  3094. // the previous frame.
  3095. // pSrcPrevQntIsf - Pointer to the 16-element quantized ISF vector from the previous
  3096. // frame.
  3097. // pSrcDstIsfMemory - Pointer to the 64-element vector containing four subframe ISF sets.
  3098. // pDstQntIsf - Pointer to a 16-element destination vector containing quantized
  3099. // ISF in frequency domain (0..0.5).
  3100. // bfi - Bad frame indicator; "0" signifies a good frame; all other values
  3101. // signify a bad frame.
  3102. // bfiNext - Bad frame indicator for the next frames.
  3103. // Returns: IppStatus
  3104. // ippStsNoErr if no error
  3105. */
  3106. IPPAPI( IppStatus, ippsISFQuantDecode_AMRWBE_16s,(
  3107. const Ipp16s *pSrcIdxs, Ipp16s *pDstQntIsf, Ipp16s *pSrcDstResidual,
  3108. const Ipp16s *pSrcPrevQntIsf, Ipp16s *pSrcDstIsfMemory, int bfi, int bfiNext))
  3109. /* /////////////////////////////////////////////////////////////////////////////
  3110. // Name: ippsOpenLoopPitchSearch_AMRWBE_16s
  3111. //
  3112. // Purpose: Extracts an open-loop pitch lag estimate from the weighted input speech
  3113. // Parameters:
  3114. // pSrcWgtSpch Pointer to input vector containing perceptually weighted speech.
  3115. // pSrcFltWgtSpch Pointer to input vector containing filtered through
  3116. // high-pass filter perceptually weighted speech.
  3117. // pPrevMedPitchLag Pointer to the median filtered pitch lag of
  3118. // the 5 previous voiced speech half-frames.
  3119. // pAdaptiveParam Pointer to the adaptive parameter.
  3120. // pDstOpenLoopLag Pointer to the open-loop pitch lag.
  3121. // pToneFlag Pointer to the tone flag for the VAD module.
  3122. // pDstOpenLoopGain Pointer to the optimal open-loop pitch gain.
  3123. // pSrcDstPrevPitchLag Pointer to the five-element vector that contains the pitch lags
  3124. // associated with the five most recent voiced speech half-frames.
  3125. // pSrcDstLagSwitcher Switches lag weighting on and off
  3126. // len Length of the frame.
  3127. // minPitchLag Minimum pitch lag.
  3128. // maxPitchLag Maximum pitch lag.
  3129. // Returns: IppStatus
  3130. // ippStsNoErr if no error
  3131. */
  3132. IPPAPI(IppStatus, ippsOpenLoopPitchSearch_AMRWBE_16s,
  3133. (const Ipp16s *pSrcWgtSpch, const Ipp16s * pSrcFltWgtSpch, Ipp16s * pPrevMedPitchLag,
  3134. Ipp16s * pAdaptiveParam, Ipp16s * pDstOpenLoopLag, Ipp16s * pToneFlag,
  3135. Ipp16s * pDstOpenLoopGain, Ipp16s * pSrcDstPrevPitchLag, Ipp16s * pSrcDstLagSwitcher,
  3136. int len, Ipp16s minPitchLag, Ipp16s maxPitchLag))
  3137. /* /////////////////////////////////////////////////////////////////////////////
  3138. // Name: ippsLPCToISP_AMRWBE_16s
  3139. // Purpose: Performs LP to ISP coefficients conversion.
  3140. // Parameters:
  3141. // pSrcLpc Pointer to the input predictor coefficients.
  3142. // pDstIsp Pointer to the output immittance spectral pairs.
  3143. // pSrcPrevIsp Pointer to the input previous immittance spectral pairs.
  3144. // lpOrder Order of convertion.
  3145. // Returns: IppStatus
  3146. // ippStsNoErr if no error
  3147. */
  3148. IPPAPI(IppStatus, ippsLPCToISP_AMRWBE_16s, (const Ipp16s *pSrcLpc,
  3149. const Ipp16s *pSrcPrevIsp, Ipp16s *pDstIsp, int lpOrder))
  3150. /* /////////////////////////////////////////////////////////////////////////////
  3151. // Name: ippsResamplePolyphase_AMRWBE_16s
  3152. // Purpose: Oversample or downsample input signal to/from upper frequency (44.1/48 khz).
  3153. // Parameters:
  3154. // pSrcSignal Pointer to the signal to resample.
  3155. // len Length of input signal.
  3156. // upFactor Upsampling factor.
  3157. // downFactor Downsampling factor.
  3158. // pIntrepFracMem Pointer to the memory of interpolation fraction.
  3159. // pMem Pointer to resampling memory. Length is 144 for decimating
  3160. // mode, or 44 for oversampling mode.
  3161. // pDstSignal Pointer to the resampled signal.
  3162. // lenDst Length of resampling signal.
  3163. // Returns: IppStatus
  3164. // ippStsNoErr if no error
  3165. */
  3166. IPPAPI(IppStatus, ippsResamplePolyphase_AMRWBE_16s, (const Ipp16s *pSrcSignal,
  3167. int lenSrc, Ipp16s upFactor, Ipp16s downFactor, Ipp16s *pInterpFracMem,
  3168. Ipp16s *pMem, Ipp16s *pDstSignal, int lenDst))
  3169. /* /////////////////////////////////////////////////////////////////////////////
  3170. // Name: ippsBandSplit_AMRWBE_16s
  3171. // Purpose: Split the signal to low and high frequency components.
  3172. // Parameters:
  3173. // pSrcSignal Poineter to src vector [len + 2*64].
  3174. // pSrcDstSig2k Poineter to srcdst low frequency vector [len*5/32 + 2*10].
  3175. // pDstSigHi Poineter to dst high frequency vector [len].
  3176. // len Length of the sample.
  3177. // Returns: IppStatus
  3178. // ippStsNoErr if no error
  3179. */
  3180. IPPAPI(IppStatus, ippsBandSplit_AMRWBE_16s, (const Ipp16s* pSrcSignal,
  3181. Ipp16s* pSrcDstSig2k, Ipp16s* pDstSigHi, int len))
  3182. /* /////////////////////////////////////////////////////////////////////////////
  3183. // Name: ippsBandJoin_AMRWBE_16s
  3184. // Purpose: Join low and high frequency signals.
  3185. // Parameters:
  3186. // pSrcSig2k Poineter to src low frequency vector [len*5/32 + 2*10].
  3187. // pSrcSigHi Poineter to src high frequency vector [len].
  3188. // pDstSignal Poineter to dst vector [len].
  3189. // len Length of the sample.
  3190. // Returns: IppStatus
  3191. // ippStsNoErr if no error
  3192. */
  3193. IPPAPI(IppStatus, ippsBandJoin_AMRWBE_16s, (const Ipp16s* pSrcSig2k,
  3194. const Ipp16s* pSrcSigHi, Ipp16s* pDstSignal, int len))
  3195. /* /////////////////////////////////////////////////////////////////////////////
  3196. // Name: ippsBandJoinUpsample_AMRWBE_16s
  3197. // Purpose: Join high and low frequency signals and upsample.
  3198. // Parameters:
  3199. // pSrcSigLF Pointer to LF signal.
  3200. // pSrcSigHF Pointer to HF signal.
  3201. // lenSrc Length of LF and HF vectors.
  3202. // pDstSig Pointer to upsampled signal.
  3203. // lenOut Length of output vector.
  3204. // pMem Resampling memory [72].
  3205. // pInterFracMem Interpolating fraction memory.
  3206. // pCountSamp Number of oversampled samples.
  3207. // upsampScale Upsampling frequency scale.
  3208. // Returns: IppStatus
  3209. // ippStsNoErr if no error
  3210. */
  3211. IPPAPI(IppStatus, ippsBandJoinUpsample_AMRWBE_16s, (const Ipp16s* pSrcSigLF,
  3212. const Ipp16s* pSrcSigHF, int lenSrc, Ipp16s* pDstSig, int lenDst,
  3213. Ipp16s* pMem, Ipp16s* pInterFracMem, Ipp32s* pCountSamp, Ipp16s upsampScale))
  3214. /* /////////////////////////////////////////////////////////////////////////////
  3215. // Name: ippsBandSplitDownsample_AMRWBE_16s
  3216. // Purpose: Decimate input signal and split to high and low frequency components.
  3217. // Parameters:
  3218. // pSrcSig Pointer to decimating signal.
  3219. // lenSrc Lenth of the input vector.
  3220. // pDstSigLF Pointer to LF decimated signal.
  3221. // pDstSigHF Pointer to HF decimated signal.
  3222. // lenDst Length of LF and HF vectors.
  3223. // pMem Decimating memory [1608].
  3224. // pInterFracMem Interpolating fraction memory.
  3225. // pCountSamp Number of decimated samples.
  3226. // upsampScale Upsampling frequency scale.
  3227. // Returns: IppStatus
  3228. // ippStsNoErr if no error
  3229. */
  3230. IPPAPI(IppStatus, ippsBandSplitDownsample_AMRWBE_16s, (const Ipp16s* pSrcSig, int lenSrc,
  3231. Ipp16s* pDstSigLF, Ipp16s* pDstSigHF, int lenDst, Ipp16s* pMem,
  3232. Ipp16s *pInterFracMem, Ipp32s* pCountSamp, Ipp16s upsampScale))
  3233. /* /////////////////////////////////////////////////////////////////////////////
  3234. // Name: ippsUpsample_AMRWBE_16s
  3235. // Purpose: Signal oversampling.
  3236. // Parameters:
  3237. // pSrcSignal Pointer to signal for oversampling.
  3238. // pSrcDstSignal Pointer to oversampled signal.
  3239. // lenDst Length of output vector.
  3240. // pMem Pointer to oversampling memory [24].
  3241. // bandIdx Index of interpolating band: 0 for 0..6.4k band, 1 for 6.4..10.8k.
  3242. // addFlag Flag for adding operation. 1 if result is added to output
  3243. // vector, 0 if not.
  3244. // Returns: IppStatus
  3245. // ippStsNoErr if no error
  3246. */
  3247. IPPAPI(IppStatus, ippsUpsample_AMRWBE_16s, (const Ipp16s* pSrcSignal,
  3248. Ipp16s* pSrcDstSignal, int lenDst, Ipp16s* pMem, Ipp32s bandIdx, Ipp32s addFlag))
  3249. /* /////////////////////////////////////////////////////////////////////////////
  3250. // Name: ippsDownsample_AMRWBE_16s
  3251. // Purpose: Signal decimating.
  3252. // Parameters:
  3253. // pSrcSignal Pointer to decimating signal.
  3254. // lenSrc Length of input vector
  3255. // pDstSignal Pointer to decimated signal [1024].
  3256. // pMem Pointer to decimating memory [46].
  3257. // bandIdx Index of interpolating band: 0 for 0..6.4k band, 1 for 6.4..10.8k.
  3258. // Returns: IppStatus
  3259. // ippStsNoErr if no error
  3260. */
  3261. IPPAPI(IppStatus, ippsDownsample_AMRWBE_16s, (const Ipp16s* pSrcSignal, int lenSrc,
  3262. Ipp16s*pDstSignal, Ipp16s* pMem, Ipp32s bandIdx))
  3263. /* /////////////////////////////////////////////////////////////////////////////
  3264. // Name: ippsISFQuantHighBand_AMRWBE_16s
  3265. // Purpose: ISF quantization of HF-band encoded signal.
  3266. // Parameters:
  3267. // pSrcISF Pointer to the vector of proceeding ISF [8].
  3268. // pSrcDstPastQISF Pointer to the past quantized ISF [8].
  3269. // pDstQISF Pointer to the output vector of quantized ISF [8].
  3270. // pQuantIdxs Pointer to the output quantization indices [2].
  3271. // pitchAdjust Pitch adjustment flag (if null, pitch adjustment is not
  3272. // implements, else any other).
  3273. // Returns: IppStatus
  3274. // ippStsNoErr if no error
  3275. */
  3276. IPPAPI(IppStatus, ippsISFQuantHighBand_AMRWBE_16s, (const Ipp16s *pSrcISF,
  3277. Ipp16s *pSrcDstPastQISF, Ipp16s *pDstQISF, Ipp16s *pQuantIdxs, Ipp32s pitchAdjust))
  3278. /* /////////////////////////////////////////////////////////////////////////////
  3279. // Name: ippsISFQuantDecodeHighBand_AMRWBE_16s
  3280. // Purpose: Decode quantized ISF of HF-band signal.
  3281. // Parameters:
  3282. // pQuantIdxs Pointer to the quantization indices [2].
  3283. // pSrcDstPastQISF Pointer to the past quantized ISF [8].
  3284. // pDstQISF Pointer to the output vector of decoded quantized ISF [8].
  3285. // bfi Bad frame indicator: value "0" signifies a good frame,
  3286. // all other values signify a bad frame.
  3287. // pitchAdjust Pitch adjustment flag (if null, pitch adjustment
  3288. // is not implements, else any other).
  3289. // Returns: IppStatus
  3290. // ippStsNoErr if no error
  3291. */
  3292. IPPAPI(IppStatus, ippsISFQuantDecodeHighBand_AMRWBE_16s, (const Ipp16s *pSrcQuantIdxs,
  3293. Ipp16s *pSrcDstPastQISF, Ipp16s *pDstQISF, Ipp32s bfi, Ipp32s pitchAdjust))
  3294. /* /////////////////////////////////////////////////////////////////////////////
  3295. // Name: ippsFFTFwd_RToPerm_AMRWBE_16s
  3296. // Purpose: Computes the forward fast Fourier transform (FFT) of a real signal.
  3297. // Parameters:
  3298. // pSrc Pointer to the real-valued sequence.
  3299. // pDst Pointer to the transform result.
  3300. // len Length of the sequence (48, 96, 192 for Radix-3 algorithm
  3301. // or 288, 576, 1152 for Radix-9 algorithm).
  3302. // Returns: IppStatus
  3303. // ippStsNoErr if no error
  3304. */
  3305. IPPAPI(IppStatus, ippsFFTFwd_RToPerm_AMRWBE_16s, (const Ipp16s* pSrc, Ipp16s* pDst, int len))
  3306. /* /////////////////////////////////////////////////////////////////////////////
  3307. // Name: ippsFFTInv_PermToR_AMRWBE_16s
  3308. // Purpose: Computes the inverse fast Fourier transform (FFT) of a real signal.
  3309. // Parameters:
  3310. // pSrc Pointer to the transform coefficients.
  3311. // pDst Pointer to the real-valued sequence.
  3312. // len Length of the sequence (48, 96, 192 for Radix-3 algorithm
  3313. // or 288, 576, 1152 for Radix-9 algorithm).
  3314. // Returns: IppStatus
  3315. // ippStsNoErr if no error
  3316. */
  3317. IPPAPI(IppStatus, ippsFFTInv_PermToR_AMRWBE_16s, (const Ipp16s* pSrc, Ipp16s* pDst, int len))
  3318. /* /////////////////////////////////////////////////////////////////////////////
  3319. // Name: ippsSynthesisFilter_AMRWBE_16s32s_I
  3320. //
  3321. // Purpose:
  3322. // Parameters:
  3323. // pSrcLpc Pointer to the LP coefficients vector.
  3324. // order Order of LP filter.
  3325. // pSrcExc Pointer to the excitation vector.
  3326. // pSrcDst Pointer to the synthesized and updated speech.
  3327. // len
  3328. // Returns: IppStatus
  3329. // ippStsNoErr if no error
  3330. */
  3331. IPPAPI(IppStatus, ippsSynthesisFilter_AMRWBE_16s32s_I,(
  3332. const Ipp16s *pSrcLpc, int order, const Ipp16s *pSrcExc, Ipp32s *pSrcDstSignal, int len))
  3333. /* /////////////////////////////////////////////////////////////////////////////
  3334. // Name: ippsDeemphasize_AMRWBE_NR_16s_I
  3335. // Purpose: Performs de-emphasis filtering.
  3336. // Parameters:
  3337. // gamma De-emphasis factor.
  3338. // gammaScale Scale factor for gamma.
  3339. // pSrcDst Pointer to the input/output vector.
  3340. // len Length of the input/output vector.
  3341. // pMem Pointer to the filter memory element.
  3342. // Returns: IppStatus
  3343. // ippStsNoErr if no error
  3344. */
  3345. IPPAPI(IppStatus, ippsDeemphasize_AMRWBE_NR_16s_I, (Ipp16s gamma,
  3346. Ipp32s gammaScale, Ipp16s *pSrcDstSignal, int len, Ipp16s *pMem))
  3347. /* /////////////////////////////////////////////////////////////////////////////
  3348. // Name: ippsFIRGenMidBand_AMRWBE_16s
  3349. // Purpose: Compute a shape-constrained FIR filter using the covariance method.
  3350. // Parameters:
  3351. // pSrcSignal Pointer to the signal [-8...(256+64)]
  3352. // pSrcSideSignal Pointer to the real side signal [256+64].
  3353. // pTaps Pointer to the FIR coefficients of length [9].
  3354. // Returns: IppStatus
  3355. // ippStsNoErr if no error
  3356. */
  3357. IPPAPI(IppStatus, ippsFIRGenMidBand_AMRWBE_16s, (const Ipp16s* pSrcSignal,
  3358. const Ipp16s* pSrcSideSignal, Ipp16s* pTaps))
  3359. /* /////////////////////////////////////////////////////////////////////////////
  3360. // Name: ippsPostFilterLowBand_AMRWBE_16s
  3361. // Purpose: Post-processing of low-band decoded signal.
  3362. // Parameters:
  3363. // pSrcOldPitchLag Pointer to the previous pitch periods for all subframes [16].
  3364. // pSrcOldPitchGain Pointer to the previous pitch gains for all subframes [16].
  3365. // pSrcDstSignal Pointer to the proceeding signal [1024].
  3366. // pOldSynth Pointer to the synthesis memory of post-filter [503].
  3367. // pOldNoise Pointer to the noise memory of post-filter [24].
  3368. // pFilterScale Pointer to the noise memory of post-filter scale factor.
  3369. // pitchAdjust Pitch adjustment flag (if null, pitch adjustment is not
  3370. // implements, else any other).
  3371. // Returns: IppStatus
  3372. // ippStsNoErr if no error
  3373. */
  3374. IPPAPI(IppStatus, ippsPostFilterLowBand_AMRWBE_16s, (const Ipp16s *pSrcOldPitchLag,
  3375. const Ipp16s *pSrcOldPitchGain, Ipp16s *pSrcDstSignal, Ipp16s *pOldSynth,
  3376. Ipp16s *pOldNoise, Ipp16s *pFilterScale, Ipp32s pitchAdjust))
  3377. /* /////////////////////////////////////////////////////////////////////////////
  3378. // Name: ippsQuantTCX_AMRWBE_16s
  3379. // Purpose: Quantize the pre-shaped spectrum in TCX mode.
  3380. // Parameters:
  3381. // pSrc Pointer to the signal to quatize [nSubvectors*8].
  3382. // pDst Pointer to quantized normalized vector [nSubvectors*8+nSubvectors].
  3383. // nSubvectors Number of subvectors.
  3384. // nBits Number of bits to use.
  3385. // pDstNoiseFactor Pointer to the comfort noise gain factor.
  3386. // Returns: IppStatus
  3387. // ippStsNoErr if no error
  3388. */
  3389. IPPAPI(IppStatus, ippsQuantTCX_AMRWBE_16s, (const Ipp16s *pSrc, Ipp16s *pDst,
  3390. int nSubvectors, int nBits, Ipp16s* pDstNoiseFactor))
  3391. /* /////////////////////////////////////////////////////////////////////////////
  3392. // Name: ippsEncodeMux_AMRWBE_16s
  3393. // Purpose: Encode and multiplex subvectors into several packets.
  3394. // Parameters:
  3395. // pSrc Pointer to rounded subvectors [nSubvectors*8+nSubvectors].
  3396. // nSubvectors Number of subvectors.
  3397. // pPacketSizes Pointer to vector of each packet size [nPackets].
  3398. // pDstParams Multiplexed parameters
  3399. // [(pPacketSizes[0]+3)/4+...+(pPacketSizes[nPackets]+3)/4].
  3400. // nPackets Number of packets.
  3401. // Returns: IppStatus
  3402. // ippStsNoErr if no error
  3403. */
  3404. IPPAPI(IppStatus, ippsEncodeMux_AMRWBE_16s, (const Ipp16s *pSrc, int nSubvectors,
  3405. const int *pPacketSizes, Ipp16s *pDstParams, int nPackets))
  3406. /* /////////////////////////////////////////////////////////////////////////////
  3407. // Name: ippsDecodeDemux_AMRWBE_16s
  3408. // Purpose: Demultiplex and decode subvectors from several packets.
  3409. // Parameters:
  3410. // pSrcParams Demultiplex parameters [(pPacketSizes[0]+3)/4+...+(pPacketSizes[nPackets]+3)/4].
  3411. // pPacketSizes Pointer to vector of each packet size [nPackets].
  3412. // pBFI Pointer to vector of bad frame indicators for each packet [nPackets].
  3413. // nPackets Number of packets.
  3414. // pDst Pointer to rounded subvectors [nSubvectors*8].
  3415. // nSubvectors Number of subvectors.
  3416. // Returns: IppStatus
  3417. // ippStsNoErr if no error
  3418. */
  3419. IPPAPI(IppStatus, ippsDecodeDemux_AMRWBE_16s, (const Ipp16s *pSrcParams,
  3420. const Ipp32s *pPacketSizes, const Ipp32s* pBFI, int nPackets,
  3421. Ipp16s *pDst, int nSubvectors))
  3422. /* /////////////////////////////////////////////////////////////////////////////
  3423. // AMRWBE end
  3424. ///////////////////////////////////////////////////////////////////////////// */
  3425. /* /////////////////////////////////////////////////////////////////////////////
  3426. // G722 SBADPCM related functions
  3427. ///////////////////////////////////////////////////////////////////////////// */
  3428. #if !defined( _OWN_BLDPCS )
  3429. struct EncoderState_G722_16s;
  3430. typedef struct EncoderState_G722_16s IppsEncoderState_G722_16s;
  3431. struct DecoderState_G722_16s;
  3432. typedef struct DecoderState_G722_16s IppsDecoderState_G722_16s;
  3433. #endif /* _OWN_BLDPCS */
  3434. /* /////////////////////////////////////////////////////////////////////////////
  3435. // Name: ippsSBADPCMEncodeStateSize_G722_16s
  3436. // Purpose: Returns the G722 SBADPCM encoder state memory size
  3437. // pEncMemSize - pointer to the output encoder state memory size in bytes.
  3438. // Returns: IppStatus
  3439. // ippStsNoErr if no error
  3440. */
  3441. IPPAPI (IppStatus, ippsSBADPCMEncodeStateSize_G722_16s, (int* pEncMemSize))
  3442. /* /////////////////////////////////////////////////////////////////////////////
  3443. // Name: ippsSBADPCMEncodeInit_G722_16s
  3444. // Purpose: This function initializes the memory buffer referenced by the pointer pEncMem.
  3445. // pEncMem - pointer to the input memory buffer of size required to properly initialize the encoder.
  3446. // Returns: IppStatus
  3447. // ippStsNoErr if no error
  3448. */
  3449. IPPAPI (IppStatus, ippsSBADPCMEncodeInit_G722_16s, (IppsEncoderState_G722_16s* pEncMem))
  3450. /* /////////////////////////////////////////////////////////////////////////////
  3451. // Name: ippsSBADPCMEncode_G722_16s
  3452. // Purpose: Encode lower and upper sub-band of incoming speech or music.
  3453. // pSrc - pointer to the input vector of synthesis QMF samples.
  3454. // pDst - pointer to the ADPCM bit-stream output vector.
  3455. // len - the length of input vector, must be a multiple of two.
  3456. // pEncMem - pointer to the state memory of the Sub-Band ADPCM encoder.
  3457. // Returns: IppStatus
  3458. // ippStsNoErr if no error
  3459. */
  3460. IPPAPI (IppStatus, ippsSBADPCMEncode_G722_16s, (const Ipp16s *pSrc, Ipp16s *pDst,
  3461. int len, IppsEncoderState_G722_16s* pEncMem))
  3462. /* /////////////////////////////////////////////////////////////////////////////
  3463. // Name: ippsQMFEncode_G722_16s
  3464. // Purpose: This function uses Quadrature Mirror Filtering (QMF) of the 14-bit
  3465. // uniform PCM speech input to compute the lower and higher sub-band signal
  3466. // components for the Sub-Band ADPCM encoder.
  3467. // pSrc - pointer to the uniform PCM input speech vector.
  3468. // pDst - pointer to the synthesis QMF samples output vector.
  3469. // len - the length of input/output vectors, must be a multiple of two.
  3470. // delay - pointer to the buffer of a delay line.
  3471. // Returns: IppStatus
  3472. // ippStsNoErr if no error
  3473. */
  3474. IPPAPI (IppStatus, ippsQMFEncode_G722_16s,
  3475. (const Ipp16s *pSrc, Ipp16s *pDst, int len, Ipp16s *delay))
  3476. /* /////////////////////////////////////////////////////////////////////////////
  3477. // Name: ippsSBADPCMDecodeStateSize_G722_16s
  3478. // Purpose: Returns the G722 SBADPCM decoder state memory size
  3479. // pDecMemSize - pointer to the output decoder state memory size in bytes.
  3480. // Returns: IppStatus
  3481. // ippStsNoErr if no error
  3482. */
  3483. IPPAPI (IppStatus, ippsSBADPCMDecodeStateSize_G722_16s, (int* pDecMemSize))
  3484. /* /////////////////////////////////////////////////////////////////////////////
  3485. // Name: ippsSBADPCMDecodeInit_G722_16s
  3486. // Purpose: Initializes the memory buffer referenced by the pointer pDecMem.
  3487. // pDecMem - Pointer to the input decoder state memory buffer
  3488. // of size required to properly initialize the decoder.
  3489. // Returns: IppStatus
  3490. // ippStsNoErr if no error
  3491. */
  3492. IPPAPI (IppStatus, ippsSBADPCMDecodeInit_G722_16s, (IppsDecoderState_G722_16s *pDecMem))
  3493. /* /////////////////////////////////////////////////////////////////////////////
  3494. // Name: ippsSBADPCMDecode_G722_16s
  3495. // Purpose: Decode lower sub-band of input audio signal.
  3496. // pSrc - pointer to the input vector that contains unpacked
  3497. // lower and high ADPCM 16bit samples given in pair.
  3498. // pDst - Pointer to the output vector that contains decoded low-
  3499. // and high- bands portions of the recovered audio samples.
  3500. // len - the length of the input vector, must be multiple of two.
  3501. // mode - decode bit rate of the G.722 decoder.
  3502. // pDecMem - pointer to the state memory of the Sub-Band ADPCM decoder.
  3503. // Returns: IppStatus
  3504. // ippStsNoErr if no error
  3505. */
  3506. IPPAPI (IppStatus, ippsSBADPCMDecode_G722_16s, (const Ipp16s *pSrc, Ipp16s *pDst,
  3507. int len, Ipp16s mode, IppsDecoderState_G722_16s * pDecMem))
  3508. /* /////////////////////////////////////////////////////////////////////////////
  3509. // Name: ippsQMFDecode_G722_16s
  3510. // Purpose: This function performs Quadrature Mirror Filter (QMF) synthesis
  3511. // of the low- and high- bands portions of the recovered samples
  3512. // to reconstruct the output signal.
  3513. // pSrc - pointer to the input vector that contains decoded low- and high- bands
  3514. // portions of the recovered samples.
  3515. // pDst - pointer to the output vector of 16bit linear PCM audio samples.
  3516. // len - the length of input/output vectors, must be a multiple of two.
  3517. // delay - pointer to the buffer of a delay line.
  3518. // Returns: IppStatus
  3519. // ippStsNoErr if no error
  3520. */
  3521. IPPAPI (IppStatus, ippsQMFDecode_G722_16s,
  3522. (const Ipp16s *pSrc, Ipp16s *pDst, int len, Ipp16s *delay))
  3523. /* /////////////////////////////////////////////////////////////////////////////
  3524. // Name: ippsSBADPCMDecodeStateUpdate_G722_16s
  3525. // Purpose: This function updates the state of the sub-band ADPCM decoder
  3526. // after extrapolating missing frames to help in recovery from frame erasures.
  3527. // pCoeffs - First-order pole zero filter coefficients array.
  3528. // gainFactor - Attenuation factor for gains.
  3529. // resetDelayFlag - If 0: no delays reset, otherwise reset delays.
  3530. // pDecMem - Pointer to the state memory of the Sub-Band ADPCM decoder.
  3531. // Returns: IppStatus
  3532. // ippStsNoErr if no error
  3533. */
  3534. IPPAPI (IppStatus, ippsSBADPCMDecodeStateUpdate_G722_16s, (const Ipp16s pCoeffs[2], Ipp16s gainFactor,
  3535. int resetDelayFlag, IppsDecoderState_G722_16s *pDecMem))
  3536. /* /////////////////////////////////////////////////////////////////////////////
  3537. // Name: ippsClassifyFrame_G722_16s_I
  3538. // Purpose: Classify the frame and modify the residual signal by the condition.
  3539. // pSrcDst - Pointer to the excitation vector [(valDelay*2)+2].
  3540. // valDelay - The pitch delay estimated by the LTP analysis.
  3541. // pClass - Pointer to the frame class.
  3542. // pDecMem - Pointer to the state memory of the Sub-Band ADPCM decoder.
  3543. // Returns: IppStatus
  3544. // ippStsNoErr if no error
  3545. */
  3546. IPPAPI (IppStatus, ippsClassifyFrame_G722_16s_I, (Ipp16s *pSrcDst, Ipp16s valDelay, IppG722SBClass *pSrcDstClass,
  3547. IppsDecoderState_G722_16s *pDecMem))
  3548. /* /////////////////////////////////////////////////////////////////////////////
  3549. // Name: ippsFilterHighband_G722_16s_I
  3550. // Purpose: This function filters higher band part of the input array pSrcDst
  3551. // through the first-order high-pass filter with memory pMem and stores
  3552. // the results in pSrcDst. The filter memory pMem is updated and shoud
  3553. // be used for filtering of the next frame.
  3554. // pSrcDst - Pointer to the source and destination vector [len].
  3555. // len - Number of elements in the source and destination vector.
  3556. // pMem - Pointer to the filter memory array
  3557. // Returns: IppStatus
  3558. // ippStsNoErr if no error
  3559. */
  3560. IPPAPI (IppStatus, ippsFilterHighband_G722_16s_I, (Ipp16s *pSrcDst, int len, Ipp16s pMem[2]))
  3561. /* /////////////////////////////////////////////////////////////////////////////
  3562. // Name: ippsDownsampleFilter_G722_16s
  3563. // Purpose: This function down-samples the input vector by a factor of 4,
  3564. // by using low-pass filter and decimating their values at the same time.
  3565. // pSrc - Pointer to the source vector [lenSrc].
  3566. // lenSrc - Length of the source vector.
  3567. // pDst - Pointer to the destination vector[lenSrc/4].
  3568. // Returns: IppStatus
  3569. // ippStsNoErr if no error
  3570. */
  3571. IPPAPI (IppStatus, ippsDownsampleFilter_G722_16s, (const Ipp16s *pSrc, int lenSrc, Ipp16s *pDst))
  3572. /* /////////////////////////////////////////////////////////////////////////////
  3573. // G722 SBADPCM end
  3574. ///////////////////////////////////////////////////////////////////////////// */
  3575. /* /////////////////////////////////////////////////////////////////////////////
  3576. // Echo Canceller related functions
  3577. ///////////////////////////////////////////////////////////////////////////// */
  3578. #if !defined( _OWN_BLDPCS )
  3579. struct _SubbandProcessState_32f;
  3580. typedef struct _SubbandProcessState_32f IppsSubbandProcessState_32f;
  3581. struct _SubbandControllerState_EC_32f;
  3582. typedef struct _SubbandControllerState_EC_32f IppsSubbandControllerState_EC_32f;
  3583. struct _FullbandControllerState_EC_32f;
  3584. typedef struct _FullbandControllerState_EC_32f IppsFullbandControllerState_EC_32f;
  3585. struct _ToneDetectState_EC_32f;
  3586. typedef struct _ToneDetectState_EC_32f IppsToneDetectState_EC_32f;
  3587. struct _SubbandProcessState_16s;
  3588. typedef struct _SubbandProcessState_16s IppsSubbandProcessState_16s;
  3589. struct _SubbandControllerState_EC_16s;
  3590. typedef struct _SubbandControllerState_EC_16s IppsSubbandControllerState_EC_16s;
  3591. struct _FullbandControllerState_EC_16s;
  3592. typedef struct _FullbandControllerState_EC_16s IppsFullbandControllerState_EC_16s;
  3593. struct _ToneDetectState_EC_16s;
  3594. typedef struct _ToneDetectState_EC_16s IppsToneDetectState_EC_16s;
  3595. struct _SubbandControllerDTState_EC_16s;
  3596. typedef struct _SubbandControllerDTState_EC_16s IppsSubbandControllerDTState_EC_16s;
  3597. #endif /* _OWN_BLDPCS */
  3598. /* ///////////////////////////////////////////////////////////////////////////
  3599. // Name:
  3600. // ippsSubbandProcessGetSize
  3601. //
  3602. // Purpose:
  3603. // Returns size of the state structure
  3604. //
  3605. // Parameters:
  3606. // order Number of subbands = (2 ^ (order - 1) + 1)
  3607. // windowLen Length of window
  3608. // pStateSize Pointer to the computed value of size of buffer
  3609. // for state structure.
  3610. // pInitBufSize Pointer to the computed size of buffer for use
  3611. // in initialization function
  3612. // pBufSize Pointer to the computed size of work buffer.
  3613. //
  3614. // Returns:
  3615. // ippStsNoErr Indicates no error.
  3616. // ippStsNullPtrErr Indicates an error when pSize is NULL.
  3617. // ippStsBadArgErr Indicates an error when order is less than or
  3618. // equal to 0 or windowLen is not divisibly by 2 ^
  3619. // order
  3620. */
  3621. IPPAPI(IppStatus, ippsSubbandProcessGetSize_32f, (int order, int windowLen,
  3622. int *pSize, int *pInitBufSize, int *pBufSize))
  3623. IPPAPI(IppStatus, ippsSubbandProcessGetSize_16s, (int order, int windowLen,
  3624. int *pSize, int *pInitBufSize, int *pBufSize))
  3625. /* ///////////////////////////////////////////////////////////////////////////
  3626. // Name:
  3627. // ippsSubbandProcessInit
  3628. //
  3629. // Purpose:
  3630. // Initializes the state structure
  3631. //
  3632. // Parameters:
  3633. // pState Pointer to the state structure to be created
  3634. // order Number of subbands = (2 ^ (order - 1) + 1)
  3635. // frameSize Size of frame. Should be in range [1, 2 ^order]
  3636. // windowLen Window length
  3637. // pWindow Pointer to window coefficients (may be NULL, if
  3638. // the order, frameSize and windowLen are equal to
  3639. // one of the predefined values: (5, 24, 128) or
  3640. // (6, 44, 256). In this case the predefined
  3641. // window is used.
  3642. // pInitBuf Pointer to the init buffer
  3643. //
  3644. // Returns:
  3645. // ippStsNoErr Indicates no error.
  3646. // ippStsNullPtrErr Indicates an error when buf or pState is NULL.
  3647. // ippStsBadArgErr Indicates an error when order is less or equal
  3648. // to 0 or windowLen is not divisibly by 2 ^ order
  3649. // or frameSize is less than or equal to 0 or (
  3650. // window is NULL and appropriate internal window
  3651. // doesn't exist).
  3652. */
  3653. IPPAPI(IppStatus, ippsSubbandProcessInit_32f, (
  3654. IppsSubbandProcessState_32f *state,
  3655. int order, int frameSize, int windowLen, const Ipp32f *pWindow,
  3656. Ipp8u *pInitBuf))
  3657. IPPAPI(IppStatus, ippsSubbandProcessInit_16s, (
  3658. IppsSubbandProcessState_16s *state,
  3659. int order, int frameSize, int windowLen, const Ipp16s *pWindow,
  3660. Ipp8u *pInitBuf))
  3661. /* ///////////////////////////////////////////////////////////////////////////
  3662. // Name:
  3663. // ippsSubbandAnalysis
  3664. //
  3665. // Purpose:
  3666. // Decomposes frame into complex subband representation
  3667. //
  3668. // Parameters:
  3669. // pSignal Pointer to the source vector of the length equal
  3670. // to the frame size which was used to initialize
  3671. // the subband process algorithm by
  3672. // ippsSubbandProcessInit function.
  3673. // pSubbands Pointer to the subband results vector of the
  3674. // length equal to number of subbands, calculated
  3675. // as (2 ^ (order - 1) + 1), where order is
  3676. // specified in ippsSubbandProcessInit.
  3677. // pState Pointer to the state structure
  3678. // pBuf Pointer to work buffer, user to allocate of size
  3679. // specified by the parameter pBufSise
  3680. // ippsSubbandProcessGetSize function.
  3681. // scalefactor scale factor value
  3682. //
  3683. // Returns:
  3684. // ippStsNoErr Indicates no error.
  3685. // ippStsNullPtrErr Indicates an error when one of the specified
  3686. // pointers is NULL.
  3687. */
  3688. IPPAPI(IppStatus, ippsSubbandAnalysis_32f32fc, (const Ipp32f *pSignal, Ipp32fc *pSubbands,
  3689. IppsSubbandProcessState_32f *pState, Ipp8u *pBuf))
  3690. IPPAPI(IppStatus, ippsSubbandAnalysis_16s32sc_Sfs, (const Ipp16s *pSignal, Ipp32sc *pSubbands,
  3691. IppsSubbandProcessState_16s *pState, int scalefactor, Ipp8u *pBuf))
  3692. /* ///////////////////////////////////////////////////////////////////////////
  3693. // Name:
  3694. // ippsSubbandSynthesis
  3695. //
  3696. // Purpose:
  3697. // Reconstructs frame from complex subband representation
  3698. //
  3699. // Parameters:
  3700. // pSubbands Pointer to the subband results vector of the
  3701. // length equal to number of subbands, calculated
  3702. // as (2 ^ (order - 1) + 1), where an order is
  3703. // specified in ippsSubbandProcessInit
  3704. // pSignal Pointer to the destination signal vector of the
  3705. // length equal to frame size which was used to
  3706. // initialize the subband process algorithm by
  3707. // ippsSubbandProcessInit function.
  3708. // pState Pointer to the state structure
  3709. // pBuf Pointer to the work buffer of size after the
  3710. // ippsSubbandProcessGetSize function call (to be
  3711. // returned via pBufSize parameter)
  3712. // scalefactor scale factor value
  3713. //
  3714. // Returns:
  3715. // ippStsNoErr Indicates no error.
  3716. // ippStsNullPtrErr Indicates an error when one of the specified
  3717. // pointers is NULL.
  3718. */
  3719. IPPAPI(IppStatus, ippsSubbandSynthesis_32fc32f, (const Ipp32fc *pSubbands, Ipp32f *pSignal,
  3720. IppsSubbandProcessState_32f *pState, Ipp8u *pBuf))
  3721. IPPAPI(IppStatus, ippsSubbandSynthesis_32sc16s_Sfs, (const Ipp32sc *pSubbands, Ipp16s *pSignal,
  3722. IppsSubbandProcessState_16s *pState, int scalefactor, Ipp8u *pBuf))
  3723. /* ///////////////////////////////////////////////////////////////////////////
  3724. // Name:
  3725. // ippsSubbandControllerGetSize_EC
  3726. //
  3727. // Purpose:
  3728. // Returns size of the state structure
  3729. //
  3730. // Parameters:
  3731. // numSubbands Number of subbands
  3732. // frameSize Size of frame
  3733. // numSegments Number of segments
  3734. // sampleFreq Sample frequency
  3735. // pSize Pointer to the computed buffer size value.
  3736. //
  3737. // Returns:
  3738. // ippStsNoErr Indicates no error.
  3739. // ippStsNullPtrErr Indicates an error when pSize NULL.
  3740. // ippStsRangeErr Indicates an error when sampleFreq is not a valid element
  3741. // of the enumerated type IppPCMFrequency.
  3742. // ippStsBadArgErr Indicates an error when numSubbands is less or
  3743. // equal to 0 or numSegment is less than or equal
  3744. // to 0 or frameSize is less than or equal to 0.
  3745. */
  3746. IPPAPI(IppStatus, ippsSubbandControllerGetSize_EC_32f, (int numSubbands, int frameSize,
  3747. int numSegments, IppPCMFrequency sampleFreq, int *pSize))
  3748. IPPAPI(IppStatus, ippsSubbandControllerGetSize_EC_16s, (int numSubbands, int frameSize,
  3749. int numSegments, IppPCMFrequency sampleFreq, int *pSize))
  3750. IPPAPI(IppStatus, ippsSubbandControllerDTGetSize_EC_16s, (int numSubbands, int frameSize,
  3751. int numSegments, IppPCMFrequency sampleFreq, int *pSize))
  3752. /* ///////////////////////////////////////////////////////////////////////////
  3753. // Name:
  3754. // ippsSubbandControllerInit_EC
  3755. //
  3756. // Purpose:
  3757. // Initializes the state structure
  3758. //
  3759. // Parameters:
  3760. // pState Pointer to the state structure to be created
  3761. // numSubbands Number of subbands
  3762. // frameSize Size of frame
  3763. // numSegments Number of segments
  3764. // sampleFreq Sample frequency.
  3765. //
  3766. // Returns:
  3767. // ippStsNoErr Indicates no error.
  3768. // ippStsNullPtrErr Indicates an error when one of the specified
  3769. // pointers is NULL.
  3770. // ippStsRangeErr Indicates an error when sampleFreq is not a valid element
  3771. // of the enumerated type IppPCMFrequency.
  3772. // ippStsBadArgErr Indicates an error when numSubbands is less or
  3773. // equal to 0 or numSegment is less than or equal
  3774. // to 0 or frameSize is less than or equal to 0.
  3775. */
  3776. IPPAPI(IppStatus, ippsSubbandControllerInit_EC_32f, (IppsSubbandControllerState_EC_32f *pState,
  3777. int numSubbands, int frameSize, int numSegments, IppPCMFrequency sampleFreq))
  3778. IPPAPI(IppStatus, ippsSubbandControllerInit_EC_16s, (IppsSubbandControllerState_EC_16s *pState,
  3779. int numSubbands, int frameSize, int numSegments, IppPCMFrequency sampleFreq))
  3780. IPPAPI(IppStatus, ippsSubbandControllerDTInit_EC_16s, (IppsSubbandControllerDTState_EC_16s *pState,
  3781. int numSubbands, int frameSize, int numSegments, IppPCMFrequency sampleFreq))
  3782. /* ///////////////////////////////////////////////////////////////////////////
  3783. // Name:
  3784. // ippsSubbandControllerUpdate_EC
  3785. //
  3786. // Purpose:
  3787. // Updates controller state. Returns step sizes.
  3788. //
  3789. // Parameters:
  3790. // pSrcRin Pointer to receive-in signal frame.
  3791. // pSrcSin Pointer to send-in signal frame. Frame size is
  3792. // specified in ippsSubbandControllerInit function
  3793. // ppSrcRinSubbandsHistory Pointer to an array of pointers to the most
  3794. // recent receive-in blocks. Size of array is equal
  3795. // to numSegments, specified in
  3796. // ippsSubbandControllerInit_EC function
  3797. // pSrcSinSubbands Pointer to subband representation of send-in
  3798. // signal frame (or NULL). Size of array =
  3799. // numSubbands, specified in
  3800. // ippsSubbandControllerInit_EC function
  3801. // pDstStepSize Pointer to step sizes. Length of vector =
  3802. // numSubbands, specified in
  3803. // ippsSubbandControllerInit_EC function
  3804. // learningRate Positive value 0-1, learning rate parameter.
  3805. //
  3806. // pState Pointer to structure
  3807. //
  3808. // Returns:
  3809. // ippStsNoErr Indicates no error.
  3810. // ippStsNullPtrErr Indicates an error when pState, pRin, pSin,
  3811. // pRinSubbands or pStepSize is NULL.
  3812. */
  3813. IPPAPI(IppStatus, ippsSubbandControllerUpdate_EC_16s, (const Ipp16s *pSrcRin, const Ipp16s *pSrcSin,
  3814. const Ipp32sc **ppSrcRinSubbandsHistory, const Ipp32sc *pSrcSinSubbands,
  3815. Ipp32s_EC_Sfs *pDstStepSize, IppsSubbandControllerState_EC_16s *pState))
  3816. IPPAPI(IppStatus, ippsSubbandAPControllerUpdate_EC_32f,(
  3817. const Ipp32fc **ppSrcRinSubbandsHistory, const Ipp32fc *pSrcSinSubbands,
  3818. double *pDstStepSize, Ipp32f learningRate, IppsSubbandControllerState_EC_32f *pState))
  3819. /* ///////////////////////////////////////////////////////////////////////////
  3820. // Name:
  3821. // ippsSubbandController_EC
  3822. //
  3823. // Purpose:
  3824. // Main controller function. Updates coefficients of filters. Returns
  3825. // output gain coefficients
  3826. //
  3827. // Parameters:
  3828. // pSrcAdaptiveFilterErr Pointer to the adaptive filter error vector of
  3829. // length equal to numSubbands, specified in
  3830. // ippsSubbandControllerInit_EC function
  3831. // pSrcFixedFilterErr Pointer to errors of fixed filter. Length is
  3832. // equal to numSubbands
  3833. // ppDstAdaptiveCoefs Pointer to an array of pointers to the filter
  3834. // Length of array coefficients vectors =
  3835. // numSegments, specified in
  3836. // ippsSubbandControllerInit_EC
  3837. // ppDstFixedCoefs Pointer to an array of pointers to the filter
  3838. // Length of array coefficients vectors =
  3839. // numSegments, specified in
  3840. // ippsSubbandControllerInit_EC
  3841. // pDstSGain Pointer to send gain coefficient
  3842. // pState Pointer to SubbandController_EC state structure.
  3843. //
  3844. // Returns:
  3845. // ippStsNoErr Indicates no error.
  3846. // ippStsNullPtrErr Indicates an error when one of the specified
  3847. // pointers is NULL.
  3848. */
  3849. IPPAPI(IppStatus, ippsSubbandControllerUpdate_EC_32f, (const Ipp32f *pSrcRin, const Ipp32f *pSrcSin,
  3850. const Ipp32fc **ppSrcRinSubbandsHistory, const Ipp32fc *pSrcSinSubbands,
  3851. double *pDstStepSize, IppsSubbandControllerState_EC_32f *pState))
  3852. IPPAPI(IppStatus, ippsSubbandController_EC_32f, (const Ipp32fc *pSrcAdaptiveFilterErr,
  3853. const Ipp32fc *pSrcFixedFilterErr,
  3854. Ipp32fc **ppDstAdaptiveCoefs, Ipp32fc **ppDstFixedCoefs,
  3855. Ipp32f *pDstSGain, IppsSubbandControllerState_EC_32f *pState))
  3856. IPPAPI(IppStatus, ippsSubbandController_EC_16s, (const Ipp32sc *pSrcAdaptiveFilterErr,
  3857. const Ipp32sc *pSrcFixedFilterErr,
  3858. Ipp32sc **ppDstAdaptiveCoefs, Ipp32sc **ppDstFixedCoefs,
  3859. Ipp16s *pDstSGain, IppsSubbandControllerState_EC_16s *pState))
  3860. /* ///////////////////////////////////////////////////////////////////////////
  3861. // Name:
  3862. // ippsSubbandControllerReset_EC
  3863. //
  3864. // Purpose:
  3865. // Resets controller state
  3866. //
  3867. // Parameters:
  3868. // pState Pointer to the structure.
  3869. //
  3870. // Returns:
  3871. // ippStsNoErr Indicates no error.
  3872. // ippStsNullPtrErr Indicates an error when one of the specified
  3873. // pointers is NULL.
  3874. */
  3875. IPPAPI(IppStatus, ippsSubbandControllerReset_EC_32f, (IppsSubbandControllerState_EC_32f *pState))
  3876. IPPAPI(IppStatus, ippsSubbandControllerReset_EC_16s, (IppsSubbandControllerState_EC_16s *pState))
  3877. IPPAPI(IppStatus, ippsSubbandControllerDTReset_EC_16s, (IppsSubbandControllerDTState_EC_16s *pState))
  3878. /* ///////////////////////////////////////////////////////////////////////////
  3879. // Name:
  3880. // ippsFullbandControllerGetSize_EC
  3881. //
  3882. // Purpose:
  3883. // Returns size of the state structure
  3884. //
  3885. // Parameters:
  3886. // frameSize Size of frame
  3887. // tapLen Number of tap values.
  3888. // sampleFreq Sample frequency
  3889. // pSize Pointer to the computed buffer size value.
  3890. //
  3891. // Returns:
  3892. // ippStsNoErr Indicates no error.
  3893. // ippStsNullPtrErr Indicates an error when pSize NULL.
  3894. // ippStsRangeErr Indicates an error when sampleFreq is not a valid element
  3895. // of the enumerated type IppPCMFrequency.
  3896. // ippStsBadArgErr Indicates an error when frameSize is less or
  3897. // equal to 0 or tapLen is less than or equal to 0.
  3898. */
  3899. IPPAPI(IppStatus, ippsFullbandControllerGetSize_EC_32f, (int frameSize,
  3900. int tapLen, IppPCMFrequency sampleFreq, int *pSize))
  3901. IPPAPI(IppStatus, ippsFullbandControllerGetSize_EC_16s, (int frameSize,
  3902. int tapLen, IppPCMFrequency sampleFreq, int *pSize))
  3903. /* ///////////////////////////////////////////////////////////////////////////
  3904. // Name:
  3905. // ippsFullbandControllerInit_EC
  3906. //
  3907. // Purpose:
  3908. // Initializes the state structure
  3909. //
  3910. // Parameters:
  3911. // pState Pointer to the memory buffer for the fullband
  3912. // controller state structure to be initialized.
  3913. // The size of the memory buffer to be acquired by
  3914. // ippsFullbandControllerGetSize_EC function via
  3915. // pSize parameter.
  3916. // frameSize Size of frame
  3917. // tapLen Number of tap values.
  3918. // sampleFreq Sample frequency.
  3919. //
  3920. // Returns:
  3921. // ippStsNoErr Indicates no error.
  3922. // ippStsNullPtrErr Indicates an error when one of the specified
  3923. // pointers is NULL.
  3924. // ippStsRangeErr Indicates an error when sampleFreq is not a valid element
  3925. // of the enumerated type IppPCMFrequency.
  3926. // ippStsBadArgErr Indicates an error when frameSize is less or
  3927. // equal to 0 or tapLen is less than or equal to 0.
  3928. */
  3929. IPPAPI(IppStatus, ippsFullbandControllerInit_EC_32f, (IppsFullbandControllerState_EC_32f *pState,
  3930. int frameSize, int tapLen, IppPCMFrequency sampleFreq))
  3931. IPPAPI(IppStatus, ippsFullbandControllerInit_EC_16s, (IppsFullbandControllerState_EC_16s *pState,
  3932. int frameSize, int tapLen, IppPCMFrequency sampleFreq))
  3933. /* ///////////////////////////////////////////////////////////////////////////
  3934. // Name:
  3935. // ippsFullbandControllerUpdate_EC
  3936. //
  3937. // Purpose:
  3938. // Updates controller state. Returns step sizes
  3939. //
  3940. // Parameters:
  3941. // pSrcRin Pointer to receive-in signal history,length =
  3942. // tapLen + frameSize, tapLen and frameSize is
  3943. // specified in ippsFullbandControllerInit
  3944. // pSrcSin Pointer to send-in signal frame, frame size is
  3945. // specified in ippsFullbandControllerInit_EC
  3946. // pDstStepSize Pointer to step sizes, length = frame_size,
  3947. // specified in ippsFullbandControllerInit_EC
  3948. // pState Pointer to structure
  3949. //
  3950. // Returns:
  3951. // ippStsNoErr Indicates no error.
  3952. // ippStsNullPtrErr Indicates an error when pState, pRin, pSin, or
  3953. // pStepSize is NULL.
  3954. */
  3955. IPPAPI(IppStatus, ippsFullbandControllerUpdate_EC_32f, (const Ipp32f *pSrcRin,
  3956. const Ipp32f *pSrcSin, Ipp32f *pDstStepSize,
  3957. IppsFullbandControllerState_EC_32f *pState))
  3958. IPPAPI(IppStatus, ippsFullbandControllerUpdate_EC_16s, (const Ipp16s *pSrcRin,
  3959. const Ipp16s *pSrcSin, Ipp32s *pDstStepSize,
  3960. IppsFullbandControllerState_EC_16s *pState))
  3961. /* ///////////////////////////////////////////////////////////////////////////
  3962. // Name:
  3963. // ippsFullbandController_EC
  3964. //
  3965. // Purpose:
  3966. // Main controller function. Updates coefficients of filter . Returns
  3967. // output gain coefficients
  3968. //
  3969. // Parameters:
  3970. // pState Pointer to structure.
  3971. // pAdaptiveFilterErr Pointer to output of path with adaptive filter,
  3972. // length = frame size , specified in
  3973. // ippsFullbandControllerInit_EC
  3974. // pFixedFilterErr Pointer to output of path with fixed filter.
  3975. // length = frame size, specified in
  3976. // ippsFullbandControllerInit_EC
  3977. // pAdaptiveCoefs Pointer to the filter coefficients vectors.
  3978. // length = tapLength, specified in
  3979. // ippsFullbandControllerInit_EC
  3980. // pFixedCoefs Pointer to the filter coefficients vectors.
  3981. // length = tapLength, specified in
  3982. // ippsFullbandControllerInit_EC
  3983. // pSGain Pointer to send gain coefficient
  3984. //
  3985. // Returns:
  3986. // ippStsNoErr Indicates no error.
  3987. // ippStsNullPtrErr Indicates an error when one of the specified
  3988. // pointers is NULL.
  3989. */
  3990. IPPAPI(IppStatus, ippsFullbandController_EC_32f, (const Ipp32f *pAdaptiveFilterErr,
  3991. const Ipp32f *pFixedFilterErr,
  3992. Ipp32f *pAdaptiveCoefs, Ipp32f *pFixedCoefs,
  3993. Ipp32f *pSGain,
  3994. IppsFullbandControllerState_EC_32f *pState))
  3995. IPPAPI(IppStatus, ippsFullbandController_EC_16s, (const Ipp16s *pAdaptiveFilterErr,
  3996. const Ipp16s *pFixedFilterErr,
  3997. Ipp16s *pAdaptiveCoefs, Ipp16s *pFixedCoefs,
  3998. Ipp16s *pSGain,
  3999. IppsFullbandControllerState_EC_16s *pState))
  4000. /* ///////////////////////////////////////////////////////////////////////////
  4001. // Name:
  4002. // ippsFullbandControllerReset_EC
  4003. //
  4004. // Purpose:
  4005. // Resets controller state
  4006. //
  4007. // Parameters:
  4008. // pState Pointer to the structure.
  4009. //
  4010. // Returns:
  4011. // ippStsNoErr Indicates no error.
  4012. // ippStsNullPtrErr Indicates an error when one of the specified
  4013. // pointers is NULL.
  4014. */
  4015. IPPAPI(IppStatus, ippsFullbandControllerReset_EC_32f, (IppsFullbandControllerState_EC_32f *pState))
  4016. IPPAPI(IppStatus, ippsFullbandControllerReset_EC_16s, (IppsFullbandControllerState_EC_16s *pState))
  4017. /* ///////////////////////////////////////////////////////////////////////////
  4018. // Name:
  4019. // ippsFIR_EC
  4020. //
  4021. // Purpose:
  4022. // Computes FIR filtering results.
  4023. //
  4024. // Parameters:
  4025. // pSrcSpchRef Pointer to the source original (receive-out)
  4026. // signal of (tapLength + len) length
  4027. // pSrcSpch Pointer to the signal with echo path (send-in)
  4028. // pDstSpch Pointer to the destination "echo-free" signal
  4029. // (send-out)
  4030. // len Length of source and destination signals
  4031. // pSrcTaps FIR filter taps vector
  4032. // tapsLen Number of taps of the FIR filter
  4033. //
  4034. // Returns:
  4035. // ippStsNoErr Indicates no error.
  4036. // ippStsNullPtrErr Indicates an error when one of the specified
  4037. // pointers is NULL.
  4038. */
  4039. IPPAPI(IppStatus, ippsFIR_EC_32f, (const Ipp32f *pSrcSpchRef,
  4040. const Ipp32f *pSrcSpch,
  4041. Ipp32f *pDstSpch,
  4042. int len,
  4043. Ipp32f *pSrcCoef,
  4044. int tapLength))
  4045. IPPAPI(IppStatus, ippsFIR_EC_16s, (const Ipp16s *pSrcSpchRef,
  4046. const Ipp16s *pSrcSpch,
  4047. Ipp16s *pDstSpch,
  4048. int len,
  4049. Ipp16s *pSrcCoef,
  4050. int tapLength))
  4051. /* ///////////////////////////////////////////////////////////////////////////
  4052. // Name:
  4053. // ippsNLMS_EC
  4054. //
  4055. // Purpose:
  4056. // Performs filtering with coefficients update.
  4057. //
  4058. // Parameters:
  4059. // pSrcSpchRef Pointer to the source original (receive-out)
  4060. // signal of (tapLength + len) length.
  4061. // pSrcSpch Pointer to the signal with echo path (send-in)
  4062. // pStepSize Pointer to step sizes vector of length equal to
  4063. // len
  4064. // pSrcDstErr Pointer to last error value
  4065. // pDstSpch Pointer to the destination "echo-free" signal
  4066. // (send-out)
  4067. // len Length of source and destination signals
  4068. // pSrcDstTaps FIR filter taps source and destination vector
  4069. // tapsLen Number of taps
  4070. //
  4071. // Returns:
  4072. // ippStsNoErr Indicates no error.
  4073. // ippStsNullPtrErr Indicates an error when one of the specified
  4074. // pointers is NULL.
  4075. */
  4076. IPPAPI(IppStatus, ippsNLMS_EC_32f, (const Ipp32f *pSrcSpchRef,
  4077. const Ipp32f *pSrcSpch,
  4078. const Ipp32f *pStepSize,
  4079. Ipp32f *pDstSpch,
  4080. int len,
  4081. Ipp32f *pSrcDstCoef,
  4082. int tapLength,
  4083. Ipp32f *pErr))
  4084. IPPAPI(IppStatus, ippsNLMS_EC_16s, (const Ipp16s *pSrcSpchRef,
  4085. const Ipp16s *pSrcSpch,
  4086. const Ipp32s *pStepSize,
  4087. Ipp16s *pDstSpch,
  4088. int len,
  4089. Ipp16s *pSrcDstCoef,
  4090. int tapLength,
  4091. Ipp16s *pErr))
  4092. /* ///////////////////////////////////////////////////////////////////////////
  4093. // Name:
  4094. // ippsFIRSubband_EC
  4095. //
  4096. // Purpose:
  4097. // This function computes the filter output in AEC NLMS algorithm.
  4098. //
  4099. // Parameters:
  4100. // ppSrcSignalIn, ppSrcSignal Pointers to an two-dimensional vector of size
  4101. // [numSegments][len] containing the pointers to the most recent
  4102. // complex-valued FFT spectra an input audio signal.
  4103. // ppSrcCoefs, ppCoefs Pointers to an two-dimensional vector of size [numSegments][len]
  4104. // containing the pointers to the filter coefficients vector of size [len].
  4105. // pDstSignalOut, pDstSignal Pointers to the complex-valued filter output vector.
  4106. // numSegments Number of filter segments (0 < numSegments < 256).
  4107. // len, numSubbands Number of filter subbands (0 < len, numSubbands < 4097).
  4108. // startSubband Number of subbands to skip before filtering (0<= startSubband < numSubbands)
  4109. // scaleFactor Saturation fixed scale factor (-32 < scaleFactor < 32)
  4110. // for Low function 0 <= scaleFactor < 32)
  4111. //
  4112. // Returns:
  4113. // ippStsNoErr No Error.
  4114. // ippStsNullPtrErr ppSrcSignalIn, ppSrcCoefs or pDstSignalOut is null.
  4115. // ippStsLengthErr len is out of range.
  4116. // ippStsRangeErr numSegments or scaleFactor is out of range.
  4117. //
  4118. */
  4119. IPPAPI(IppStatus, ippsFIRSubband_EC_32fc, (
  4120. Ipp32fc **ppSrcSignalIn,
  4121. Ipp32fc **ppSrcCoefs,
  4122. Ipp32fc *pDstSignalOut,
  4123. int numSegments,
  4124. int len))
  4125. IPPAPI(IppStatus, ippsFIRSubband_EC_32sc_Sfs,(
  4126. Ipp32sc **ppSrcSignalIn,
  4127. Ipp32sc **ppSrcCoefs,
  4128. Ipp32sc *pDstSignalOut,
  4129. int numSegments,
  4130. int len,
  4131. int scaleFactor))
  4132. IPPAPI(IppStatus, ippsFIRSubbandLow_EC_32sc_Sfs,(
  4133. const Ipp32sc** ppSrcSignal,
  4134. const Ipp32sc** ppCoefs,
  4135. int numSegments,
  4136. Ipp32sc* pDstSignal,
  4137. int startSubband,
  4138. int numSubbands,
  4139. int scaleFactor))
  4140. /* ///////////////////////////////////////////////////////////////////////////
  4141. // Name:
  4142. // ippsFIRSubbandCoeffUpdate_EC
  4143. //
  4144. // Purpose:
  4145. // This function updates the coefficients of the AEC adaptive
  4146. // filter designed based on NLMS algorithm.
  4147. // Parameters:
  4148. // pSrcStepSize, pSrcAdaptStepSize Pointer to the adaptive filter step size
  4149. // vector of size [len] or [numSubbands]. For the integer
  4150. // functions step size vector elements are represented
  4151. // as a scaled integer values where variable x of type
  4152. // Ipp32s_EC_Sfs corresponds to the floating point value
  4153. // x.val * 2^x.sf.
  4154. // ppSrcStepSize Pointer to the array of pSrcStepSize. See above.
  4155. // apOrder affine projection order.
  4156. // ppSrcFilterInput Pointer to the array of pointers to the most recent
  4157. // input blocks (e.g., Xn, Xn-1,..., Xn-L+1) the complex-valued
  4158. // vectors that contain the FFT of the input signal.
  4159. // The dimension of ppSrcFilterInput is [numSegments][len]
  4160. // or [numSegments][numSubbands].
  4161. // ppSrcDstCoefsQ15, ppSrcDstCoefs Pointer to the array of pointers to the filter coefficient
  4162. // vectors. These are the complex-valued vectors containing
  4163. // the filter coefficients. The dimension of ppSrcDstCoefs
  4164. // is [numSegments][len] or [numSegments][numSubbands].
  4165. // pSrcError Pointer to the complex-valued vector containing the filter
  4166. // error. The dimension of pSrcError is [len] or [numSubbands].
  4167. // ppSrcError Pointer to the array of pSrcError. See above.
  4168. // numSegments Number of filter segments (0 < numSegments < 256).
  4169. // len, numSubbands Number of adaptive filter subbands and length of the input
  4170. // and output vectors.
  4171. // pDstProdStepErrQ Pointer to the output vector of filter error and step size product.
  4172. // scaleFactorCoef Fixed scale factor for filter coefficients (0 < scaleFactor < 32).
  4173. //
  4174. // Returns:
  4175. // ippStsNoErr No Error.
  4176. // ippStsNullPtrErr pSrcStepSize, ppSrcFilterInput, pSrcError or ppSrcDstCoefsQ15 is null.
  4177. // ippStsLengthErr len is out of range.
  4178. // ippStsRangeErr numSegments or scaleFactorCoef is out of range.
  4179. // ippStsSizeErr pSrcStepSize[indexVec].val is out of range.
  4180. //
  4181. */
  4182. IPPAPI(IppStatus, ippsFIRSubbandCoeffUpdate_EC_32fc_I, (
  4183. const double *pSrcStepSize,
  4184. const Ipp32fc **ppSrcFilterInput,
  4185. const Ipp32fc *pSrcError,
  4186. Ipp32fc **ppSrcDstCoefs,
  4187. int numSegments,
  4188. int len))
  4189. IPPAPI(IppStatus, ippsFIRSubbandAPCoeffUpdate_EC_32fc_I, (
  4190. const Ipp64f** ppSrcStepSize,
  4191. const Ipp32fc** ppSrcFilterInput,
  4192. const Ipp32fc** ppSrcError,
  4193. Ipp32fc** ppSrcDstCoefs,
  4194. Ipp32u numSegments,
  4195. Ipp32u len,
  4196. Ipp32u apOrder))
  4197. IPPAPI(IppStatus, ippsFIRSubbandCoeffUpdate_EC_32sc_I, (
  4198. const Ipp32s_EC_Sfs *pSrcStepSize,
  4199. const Ipp32sc **ppSrcFilterInput,
  4200. const Ipp32sc *pSrcError,
  4201. Ipp32sc **ppSrcDstCoefsQ15,
  4202. int numSegments,
  4203. int len,
  4204. int scaleFactorCoef))
  4205. IPPAPI(IppStatus, ippsFIRSubbandLowCoeffUpdate_EC_32sc_I, (
  4206. const Ipp32sc** ppSrcFilterInput,
  4207. const Ipp32sc* pSrcError,
  4208. Ipp32sc** ppSrcDstCoefsQ15,
  4209. int numSegments,
  4210. Ipp32sc* pDstProdStepErrQ,
  4211. const Ipp32s_EC_Sfs* pSrcAdaptStepSize,
  4212. int startSubband,
  4213. int numSubbands,
  4214. int scaleFactorCoef))
  4215. /* ///////////////////////////////////////////////////////////////////////////
  4216. // Name:
  4217. // ippsToneDetectGetStateSize_EC
  4218. //
  4219. // Purpose:
  4220. // Returns size of the state structure
  4221. //
  4222. // Parameters:
  4223. // sampleFreq Sample frequency.
  4224. // pSize Pointer to the computed buffer size value
  4225. //
  4226. // Returns:
  4227. // ippStsNoErr Indicates no error.
  4228. // ippStsNullPtrErr Indicates an error when one of the specified
  4229. // pointers is NULL.
  4230. // ippStsRangeErr Indicates an error when sampleFreq is not a valid element
  4231. // of the enumerated type IppPCMFrequency.
  4232. // ippStsRangeErr Indicates an error when sampleFreq is not a
  4233. // valid element of the enumerated type IppFrequency
  4234. //
  4235. */
  4236. IPPAPI(IppStatus, ippsToneDetectGetStateSize_EC_32f, (IppPCMFrequency sampleFreq, int *pSize))
  4237. IPPAPI(IppStatus, ippsToneDetectGetStateSize_EC_16s, (IppPCMFrequency sampleFreq, int *pSize))
  4238. /* ///////////////////////////////////////////////////////////////////////////
  4239. // Name:
  4240. // ippsToneDetectInit_EC
  4241. //
  4242. // Purpose:
  4243. // Initializes the state structure
  4244. //
  4245. // Parameters:
  4246. // pState Pointer to the memory buffer to be initialized
  4247. // as the tone detector state structure. The size
  4248. // of memory to be acquired by the
  4249. // ippsToneDetectGetStateSize_EC function via pSize
  4250. // parameter.
  4251. // sampleFreq Sample frequency
  4252. //
  4253. // Returns:
  4254. // ippStsNoErr Indicates no error.
  4255. // ippStsRangeErr Indicates an error when sampleFreq is not a valid element
  4256. // of the enumerated type IppPCMFrequency.
  4257. // ippStsRangeErr Indicates an error when sampleFreq is not a
  4258. // valid element of the enumerated type IppFrequency
  4259. */
  4260. IPPAPI(IppStatus, ippsToneDetectInit_EC_32f, (IppsToneDetectState_EC_32f *pState,
  4261. IppPCMFrequency sampleFreq))
  4262. IPPAPI(IppStatus, ippsToneDetectInit_EC_16s, (IppsToneDetectState_EC_16s *pState,
  4263. IppPCMFrequency sampleFreq))
  4264. /* ///////////////////////////////////////////////////////////////////////////
  4265. // Name:
  4266. // ippsToneDetect_EC
  4267. //
  4268. // Purpose:
  4269. // Detects signal 2100 Hz with every 450 ms phase reversal
  4270. //
  4271. // Parameters:
  4272. // pSignal Pointer to signal vector.
  4273. // len Number of samples in signal vector
  4274. // pResult Pointer to result value (not zero means tone was
  4275. // detected)
  4276. // pState Pointer to the tone detector state structure.
  4277. //
  4278. // Returns:
  4279. // ippStsNoErr Indicates no error.
  4280. */
  4281. IPPAPI(IppStatus, ippsToneDetect_EC_32f, (const Ipp32f *pSignal,
  4282. int len, int *pResult,
  4283. IppsToneDetectState_EC_32f *pState))
  4284. IPPAPI(IppStatus, ippsToneDetect_EC_16s, (const Ipp16s *pSignal,
  4285. int len, int *pResult,
  4286. IppsToneDetectState_EC_16s *pState))
  4287. /* ///////////////////////////////////////////////////////////////////////////
  4288. // Name:
  4289. // ippsSubbandControllerDT_EC_16s
  4290. //
  4291. // Purpose:
  4292. // Main controller function. Updates coefficients of filters. Returns
  4293. // output gain coefficients
  4294. //
  4295. // Parameters:
  4296. // pSrcAdaptiveFilterErr Pointer to the adaptive filter error vector of
  4297. // length equal to numSubbands, specified in
  4298. // ippsSubbandControllerInit_EC function
  4299. // pSrcFixedFilterErr Pointer to errors of fixed filter. Length is
  4300. // equal to numSubbands
  4301. // ppDstAdaptiveCoefs Pointer to an array of pointers to the filter
  4302. // Length of array coefficients vectors =
  4303. // numSegments, specified in
  4304. // ippsSubbandControllerInit_EC
  4305. // ppDstFixedCoefs Pointer to an array of pointers to the filter
  4306. // Length of array coefficients vectors =
  4307. // numSegments, specified in
  4308. // ippsSubbandControllerInit_EC
  4309. // pSrcDstFilterPwr Pointer to an input/output power of adaptive filter coefficient.
  4310. // pDstStsAdapt Pointer to output flag which shows controller state.
  4311. // *pDstStsAdapt = -1 - coefficients of adaptive filter have been copied to the fixed filter.
  4312. // *pDstStsAdapt = 0 - nothing happened.
  4313. // *pDstStsAdapt = 1 - coefficients of fixed filter have been copied to the adaptive filter.
  4314. // pwrDelta Adaptive filter coefficients power change value (adaptive filter coefficients power
  4315. // of the current frame minus adaptive filter coefficients power of the previous frame).
  4316. // filterUpdateEnabled Indicator which indicates possibility to change (update) adaptive filter
  4317. // coefficients in this frame.
  4318. // adaptationEnabled Indicator which indicates if adaptation is enabled or not.
  4319. // startSubband Number of subbands to skip before filtering (0? startSubband < numSubbands).
  4320. // pState Pointer to SubbandControllerDT_EC state structure.
  4321. //
  4322. // Returns:
  4323. // ippStsNoErr Indicates no error.
  4324. // ippStsNullPtrErr Indicates an error when one of the specified pointers is NULL.
  4325. // ippStsBadArgErr Indicates an error when startSubband is less 0 or startSubband is greater than or equal to numSubbands.
  4326. */
  4327. IPPAPI(IppStatus, ippsSubbandControllerDT_EC_16s, (const Ipp32sc* pSrcAdaptiveFilterErr, const Ipp32sc* pSrcFixedFilterErr,
  4328. Ipp32sc** ppDstAdaptiveCoefs, Ipp32sc** ppDstFixedCoefs, Ipp64s* pSrcDstFilterPwr, int* pDstStsAdapt, Ipp64s pwrDelta,
  4329. int filterUpdateEnabled, int adaptationEnabled, int startSubband, IppsSubbandControllerDTState_EC_16s* pState))
  4330. /* ///////////////////////////////////////////////////////////////////////////
  4331. // Name:
  4332. // ippsSubbandControllerDTUpdate_EC
  4333. //
  4334. // Purpose:
  4335. // Updates controller state. Returns step sizes.
  4336. //
  4337. // Parameters:
  4338. // ppSrcRinSubbandsHistory Pointer to an array of pointers to the most
  4339. // recent receive-in blocks. Size of array is equal
  4340. // to numSegments, specified in
  4341. // ippsSubbandControllerInit_EC function
  4342. // pSrcSinSubbands Pointer to subband representation of send-in
  4343. // signal frame (or NULL). Size of array =
  4344. // numSubbands, specified in
  4345. // ippsSubbandControllerInit_EC function
  4346. // pSrcFilterErr Pointer to the input filter error vector. Vector length is equal to numSubbands
  4347. // specified in ippsSubbandControllerInit_EC function.
  4348. // pDstStepSize Pointer to step sizes. Length of vector =
  4349. // numSubbands, specified in
  4350. // ippsSubbandControllerInit_EC function
  4351. // pIsDT Pointer to the indicator which indicate double-talk condition.
  4352. // pDisabledNLP Pointer to the indicator which indicate whether NLP is disable (1) or not (0).
  4353. // startSubband Number of subbands to skip before filtering (0? startSubband < numSubbands).
  4354. // pState Pointer to SubbandControllerDT_EC state structure.
  4355. //
  4356. // Returns:
  4357. // ippStsNoErr Indicates no error.
  4358. // ippStsNullPtrErr Indicates an error when pState, pRin, pSin,
  4359. // pRinSubbands or pStepSize is NULL.
  4360. // ippStsBadArgErr Indicates an error when startSubband is less 0 or startSubband is greater than or equal to numSubbands.
  4361. */
  4362. IPPAPI(IppStatus, ippsSubbandControllerDTUpdate_EC_16s, (const Ipp32sc** ppSrcRinSubbandsHistory,
  4363. const Ipp32sc* pSrcSinSubbands, const Ipp32sc* pSrcFilterErr, Ipp32s_EC_Sfs* pDstStepSize,
  4364. int* pIsDT, int* pDisabledNLP, int startSubband, IppsSubbandControllerDTState_EC_16s* pState))
  4365. /* /////////////////////////////////////////////////////////////////////////////
  4366. // Echo Canceller end
  4367. ///////////////////////////////////////////////////////////////////////////// */
  4368. /* /////////////////////////////////////////////////////////////////////////////
  4369. // MSRTA related functions
  4370. ///////////////////////////////////////////////////////////////////////////// */
  4371. #if !defined( _OWN_BLDPCS )
  4372. typedef struct _QMFState_MSRTA_32s IppsQMFState_MSRTA_32s;
  4373. typedef struct _QMFState_RTA_32f IppsQMFState_RTA_32f;
  4374. typedef struct _ShortTermPostFilterState_MSRTA_32s IppsShortTermPostFilterState_MSRTA_32s;
  4375. typedef struct _PostFilterState_RTA_32f IppsPostFilterState_RTA_32f;
  4376. #endif
  4377. /* /////////////////////////////////////////////////////////////////////////////
  4378. // Name: ippsLPCToLSP_RTA
  4379. //
  4380. // Purpose: Converts a set of 10th-order LP coefficients to
  4381. // an equivalent set of line spectrum pairs (LSPs).
  4382. // Parameters:
  4383. // pSrcLPC Pointer to LP coefficient vector [order].
  4384. // pDstLSP Pointer to the LSP coefficient vector [order].
  4385. // order LP coefficient filter order.
  4386. // Returns: IppStatus
  4387. // ippStsNoRootFoundErr if number of roots less than order
  4388. // ippStsNoErr if no error
  4389. */
  4390. IPPAPI(IppStatus, ippsLPCToLSP_RTA_32f,(const Ipp32f* pSrcLPC, Ipp32f* pDstLSP, int order))
  4391. /* /////////////////////////////////////////////////////////////////////////////
  4392. // Name: ippsLSPToLPC_RTA
  4393. //
  4394. // Purpose: Converts a set of order LSPs to LP coefficients.
  4395. // Parameters:
  4396. // pSrcLSP Pointer to the input LSFs [order].
  4397. // pDstLPC Pointer to the output predictive coefficients [order].
  4398. // order LP coefficient filter order.
  4399. // Returns: IppStatus
  4400. // ippStsNoErr if no error
  4401. */
  4402. IPPAPI(IppStatus, ippsLSPToLPC_RTA_32f,(const Ipp32f* pSrcLSP, Ipp32f* pDstLPC, int order))
  4403. /* /////////////////////////////////////////////////////////////////////////////
  4404. // Name: ippsLevinsonDurbin_RTA
  4405. // Purpose: Obtaining of the LPC using durbin algorithm
  4406. // Parameters:
  4407. // pSrcAutoCorr Pointer to the autocorrelation vector [order+1].
  4408. // pDstLPC Pointer to the LPC output vector [order+1].
  4409. // pDstRC Pointer to the RC output vector [order].
  4410. // order LP order.
  4411. //
  4412. */
  4413. IPPAPI(IppStatus, ippsLevinsonDurbin_RTA_32f, (const Ipp32f* pSrcAutoCorr, Ipp32f* pDstLPC, Ipp32f* pDstRC, int order))
  4414. /* /////////////////////////////////////////////////////////////////////////////
  4415. // Name: ippsQMFGetStateSize_RTA
  4416. // Purpose: Knowing of MSRTA QMF filter size demand
  4417. // Parameters:
  4418. // pSize pointer to the output value of the memory size needed for QMF filter
  4419. // Returns:
  4420. // ippStsNoErr, if no errors
  4421. */
  4422. IPPAPI(IppStatus, ippsQMFGetStateSize_RTA_32f, ( int* pSize ))
  4423. /* /////////////////////////////////////////////////////////////////////////////
  4424. // Name: ippsQMFInit_RTA
  4425. // Purpose: Initialization of the memory allocated for QMF filter
  4426. // Parameters:
  4427. // pQMFMem Pointer to the memory supplied for filtering.
  4428. // nTaps Number of taps: 24, 48.
  4429. // Returns: ippStsNoErr, if no errors
  4430. //
  4431. */
  4432. IPPAPI(IppStatus, ippsQMFInit_RTA_32f,( IppsQMFState_RTA_32f* pQMFMem, int nTaps ))
  4433. /* /////////////////////////////////////////////////////////////////////////////
  4434. // Name: ippsQMFDecode_RTA
  4435. // Purpose: QMF synthesis filter implementation
  4436. // Parameters:
  4437. // ptQmf QMF filter structure.
  4438. // pSrcLow Pointer to the input buffer low band (len).
  4439. // pSrcHigh Pointer to the input buffer high band (len).
  4440. // len Length of the input buffer size.
  4441. // pDst Pointer to the output buffer (2 * len).
  4442. // pQMFMem Pointer to the memory supplied for filtering.
  4443. // Returns: ippStsNoErr, if no errors
  4444. */
  4445. IPPAPI(IppStatus, ippsQMFDecode_RTA_32f,(const Ipp32f* pSrcLow, const Ipp32f* pSrcHigh,
  4446. int len, Ipp32f* pDst, IppsQMFState_RTA_32f* pQMFMem))
  4447. /* /////////////////////////////////////////////////////////////////////////////
  4448. // Name: ippsQMFEncode_RTA
  4449. // Purpose: QMF analysis filter implementation
  4450. // Parameters:
  4451. // pSrc Pointer to the input buffer (len).
  4452. // len Length of the input buffer size.
  4453. // pDstLow Pointer to the output buffer low band (len / 2).
  4454. // pDstHigh Pointer to the output buffer high band (len / 2).
  4455. // pQMFMem Pointer to the memory supplied for filtering.
  4456. // Returns: ippStsNoErr, if no errors
  4457. */
  4458. IPPAPI(IppStatus, ippsQMFEncode_RTA_32f,(const Ipp32f* pSrc, int len, Ipp32f* pDstLow,
  4459. Ipp32f* pDstHigh, IppsQMFState_RTA_32f* pQMFMem))
  4460. /* /////////////////////////////////////////////////////////////////////////////
  4461. // Name: ippsPostFilterGetStateSize_RTA
  4462. // Purpose: Knowing of MSRTA Short Term Post filter size demand
  4463. // Parameters:
  4464. // pSize pointer to the output value of the memory size needed for STP filter
  4465. // Returns:
  4466. // ippStsNoErr, if no errors
  4467. */
  4468. IPPAPI(IppStatus ,ippsPostFilterGetStateSize_RTA_32f,(int* pSize))
  4469. /* /////////////////////////////////////////////////////////////////////////////
  4470. // Name: ippsPostFilterInit_RTA
  4471. // Purpose: Initialization of the memory allocated for STP filter
  4472. // Parameters:
  4473. // pStateMem Pointer to the memory supplied for filtering.
  4474. // Returns: ippStsNoErr, if no errors
  4475. //
  4476. */
  4477. IPPAPI(IppStatus ,ippsPostFilterInit_RTA_32f,( IppsPostFilterState_RTA_32f *pStateMem))
  4478. /* /////////////////////////////////////////////////////////////////////////////
  4479. // Name: ippsPostFilter_RTA
  4480. // Purpose: Adaptive Short-term Post Filter (APF)
  4481. // pSrcLPC pointer to the LPC coefficients.
  4482. // order LPC Order.
  4483. // pSrcDstSpeech pointer to the input/output speech buffer.
  4484. // len Length of input speech.
  4485. // apfIdx Index for different parameter value.
  4486. // harmonic and full band coding: iApfIdx = 0
  4487. // subband coding: iApfIdx = 1,3,4 respectively
  4488. // streaming coding: iApfIdx = 2,5,6 respectively
  4489. // pMem Pointer to the apf memory [33].
  4490. // pStateMem Pointer to the apf state memory.
  4491. // Returns: IppStatus
  4492. // ippStsNoErr if no error
  4493. */
  4494. IPPAPI(IppStatus ,ippsPostFilter_RTA_32f_I,(const Ipp32f* pSrcLPC, int order, Ipp32f* pSrcDstSpeech,
  4495. int len, int pfType, Ipp32f* pMem,
  4496. IppsPostFilterState_RTA_32f* pStateMem))
  4497. /* /////////////////////////////////////////////////////////////////////////////
  4498. // Name: ippsAdaptiveCodebookSearch_RTA
  4499. // Purpose: Adaptive Codebook Search
  4500. // pSrcAdptTarget Pointer to the input target signal (subFrameSize).
  4501. // pSrcImpulseResponse Pointer to the input impulse response (subFrameSize).
  4502. // subFrameSize Subframe size.
  4503. // pSrcBoundary Pointer to the input acb search boundaries (4).
  4504. // pSrcDstExc Pointer to the input/output current excitation buffer.
  4505. // pSrcDstLag Pointer to the input / output the lag.
  4506. // pDstAdptIndex Pointer to the output acb index.
  4507. // pDstAdptContribution Pointer to the output acb contribution (subFrameSize).
  4508. // deltaSearchRange Delta search range value.
  4509. // searchFlag 0 - full search, 1 - search around open-loop pitch.
  4510. // Returns: IppStatus
  4511. // ippStsNoErr if no error
  4512. */
  4513. IPPAPI(IppStatus, ippsAdaptiveCodebookSearch_RTA_32f,(
  4514. const Ipp32f* pSrcAdptTarget, const Ipp32f* pSrcImpulseResponse, int subFrameSize, const Ipp32f* pSrcBoundary,
  4515. Ipp32f* pSrcDstExc, Ipp32f* pSrcDstLag, int* pDstAdptIndex,
  4516. Ipp32f* pDstAdptContribution, int deltaSearchRange, int searchFlag))
  4517. /* /////////////////////////////////////////////////////////////////////////////
  4518. // Name: ippsFixedCodebookSearch_RTA
  4519. // Name: ippsFixedCodebookSearchRandom_RTA
  4520. // Purpose: Two tracks Fixed Codebook Search
  4521. // pSrcFixedTarget Pointer to the input target signal.
  4522. // pSrcImpulseResponse Pointer to the input impluse response.
  4523. // pDstFixedVector Pointer to the output FCB vector.
  4524. // subFrameSize Subframe size.
  4525. // pDstFixedIndex Pointer to the output codeword index.
  4526. // pDstGain Pointer to the output optimal gain.
  4527. // numPulses Number of pulses.
  4528. // complexity Complexity control parameter.
  4529. // codebookSize Random codebook size (64, 160, 256).
  4530. // nStage Stage number (0, 1,2).
  4531. // gainLimit Gain constrain limit flag(1, 2, 3, 4).
  4532. // Returns: IppStatus
  4533. // ippStsNoErr if no error
  4534. */
  4535. IPPAPI(IppStatus, ippsFixedCodebookSearch_RTA_32f,(
  4536. const Ipp32f* pSrcFixedTarget, const Ipp32f* pSrcImpulseResponse, Ipp32f* pDstFixedVector,
  4537. int subFrameSize, int* pDstFixedIndex, Ipp32f* pDstGain, int numPulses, int complexity))
  4538. IPPAPI(IppStatus, ippsFixedCodebookSearchRandom_RTA_32f,(
  4539. const Ipp32f * pSrcResidualTarget, const Ipp32f * pSrcImpulseResponse, Ipp32f *pDstFixedVector,
  4540. int subFrameSize, int* pDstFixedIndex, Ipp32f *pDstGain, int codebookSize,
  4541. int nStage, int gainLimit))
  4542. /* /////////////////////////////////////////////////////////////////////////////
  4543. // Name: ippsLSPQuant_RTA
  4544. // Purpose: Quantize LSP parameters
  4545. // pSrcLSP Pointer to the input unquantized LSP vector.
  4546. // pSrcLPC Pointer to the input unquantized LPC vector.
  4547. // pDstLSP Pointer to the output quantized LSP vector.
  4548. // order LP coefficient filter order.
  4549. // pDstLSPIndex Pointer to the vector of quantized LSP indices.
  4550. // numMSVQStages Number stages MSVQ for LSP.
  4551. // frequency Sampling frequency.
  4552. // complexity Complexity control parameter.
  4553. // Returns: IppStatus
  4554. // ippStsNoErr if no error
  4555. */
  4556. IPPAPI(IppStatus, ippsLSPQuant_RTA_32f,(
  4557. const Ipp32f* pSrcLSP, const Ipp32f* pSrcLPC, Ipp32f* pDstLSP, int order,
  4558. int* pDstLSPIndex, IppPCMFrequency frequency, int complexity))
  4559. /* /////////////////////////////////////////////////////////////////////////////
  4560. // Name: ippsHighPassFilter_RTA_
  4561. // Purpose: High pass filtering with lattice structure
  4562. // pSrc Pointer to the input buffer.
  4563. // pDst Pointer to the output buffer.
  4564. // len Length of input /output buffers.
  4565. // hpfOrder Filter order 4 or 5.
  4566. // frequency Sampling frequency.
  4567. // pMem Pointer to the filter memory.
  4568. // Returns: IppStatus
  4569. // ippStsNoErr if no error
  4570. */
  4571. IPPAPI(IppStatus, ippsHighPassFilter_RTA_32f,(const Ipp32f* pSrc, Ipp32f* pDst, int len, int hpfOrder, IppPCMFrequency frequency, Ipp32f* pMem))
  4572. /* /////////////////////////////////////////////////////////////////////////////
  4573. // Name: ippsBandPassFilter_RTA
  4574. // Purpose: Performs band pass filter
  4575. // pSrcDst Pointer to the input/output speech vector [len].
  4576. // len Number of elements in the pSrcDst vector.
  4577. // pMem Pointer to the memory allocated for the frequency enhancement filter [len+2].
  4578. // Returns: IppStatus
  4579. // ippStsNoErr if no error
  4580. */
  4581. IPPAPI(IppStatus, ippsBandPassFilter_RTA_32f_I,(Ipp32f* pSrcDst, int len, Ipp32f *pMem))
  4582. /* /////////////////////////////////////////////////////////////////////////////
  4583. // MSRTA end
  4584. ///////////////////////////////////////////////////////////////////////////// */
  4585. /* /////////////////////////////////////////////////////////////////////////////
  4586. // G7291 related functions
  4587. ///////////////////////////////////////////////////////////////////////////// */
  4588. #if !defined( _OWN_BLDPCS )
  4589. typedef struct _FilterHighpassState_G7291_16s IppsFilterHighpassState_G7291_16s;
  4590. typedef struct _QMFState_G7291_16s IppsQMFState_G7291_16s;
  4591. typedef struct _GenerateExcitationState_G7291_16s IppsGenerateExcitationState_G7291_16s;
  4592. #endif
  4593. /* /////////////////////////////////////////////////////////////////////////////
  4594. // Name: ippsFilterHighpassGetStateSize_G7291_16s
  4595. // Purpose: Knowing of G7291 high-pass filter size demand
  4596. // Parameters:
  4597. // pSize Pointer to the output value of the memory size.
  4598. // Returns:
  4599. // ippStsNoErr, if no errors
  4600. */
  4601. IPPAPI (IppStatus, ippsFilterHighpassGetStateSize_G7291_16s, (int* pSize))
  4602. /* /////////////////////////////////////////////////////////////////////////////
  4603. // Name: ippsFilterHighpassInit_G7291_16s
  4604. // Purpose: Initialization of the memory allocated for preprocessing filter
  4605. // Parameters:
  4606. // pState Pointer to memory supplied for filtering.
  4607. // pCoeff Pointer to the source vector of the filter coefficients.
  4608. // Returns: ippStsNoErr, if no errors
  4609. //
  4610. */
  4611. IPPAPI (IppStatus, ippsFilterHighpassInit_G7291_16s, (IppsFilterHighpassState_G7291_16s* pState,
  4612. const Ipp16s* pCoeff))
  4613. /* /////////////////////////////////////////////////////////////////////////////
  4614. // Name: ippsFilterHighpass_G7291_16s_ISfs
  4615. // Purpose: The input sampled speech shall be high-pass filtered
  4616. // Parameters:
  4617. // pSrcDst Pointer to the source and destination vector (for in-place operation).
  4618. // len Length of the pSrcDst.
  4619. // pState Pointer to the memory supplied for filtering.
  4620. // scaleFactor Scaling factor to apply to the result.
  4621. // Returns: ippStsNoErr, if no errors
  4622. */
  4623. IPPAPI (IppStatus, ippsFilterHighpass_G7291_16s_ISfs, (Ipp16s* pSrcDst, int len,
  4624. IppsFilterHighpassState_G7291_16s* pState, int scaleFactor))
  4625. /* /////////////////////////////////////////////////////////////////////////////
  4626. // Name: ippsFilterLowpass_G7291_16s_I
  4627. // Purpose: The input sampled speech shall be low-pass filtered
  4628. // Parameters:
  4629. // pSrcDst Pointer to the source and destination vector (for in-place operation).
  4630. // len Length of the pSrcDst.
  4631. // pMem Pointer to the memory supplied for filtering.
  4632. // hint Code specific use hints.
  4633. // Returns: ippStsNoErr, if no errors
  4634. */
  4635. IPPAPI (IppStatus, ippsFilterLowpass_G7291_16s_I, (Ipp16s* pSrcDst, int len, Ipp16s* pMem,
  4636. IppHintAlgorithm hint))
  4637. /* /////////////////////////////////////////////////////////////////////////////
  4638. // Name: ippsQMFGetStateSize_G7291_16s
  4639. // Purpose: Knowing of G7291 QMF analysis filter size demand
  4640. // Parameters:
  4641. // pSize Pointer to the output value of the memory size.
  4642. // Returns:
  4643. // ippStsNoErr, if no errors
  4644. */
  4645. IPPAPI (IppStatus, ippsQMFGetStateSize_G7291_16s, (int* pSize))
  4646. /* /////////////////////////////////////////////////////////////////////////////
  4647. // Name: ippsQMFInit_G7291_16s
  4648. // Purpose: Initialization of the memory allocated for QMF filter
  4649. // Parameters:
  4650. // pState Pointer to the memory supplied for QMF encode.
  4651. // Returns: ippStsNoErr, if no errors
  4652. //
  4653. */
  4654. IPPAPI (IppStatus, ippsQMFInit_G7291_16s, (IppsQMFState_G7291_16s* pState))
  4655. /* /////////////////////////////////////////////////////////////////////////////
  4656. // Name: ippsQMFEncode_G7291_16s
  4657. // Purpose: Two-channel filter bank analysis.
  4658. // Parameters:
  4659. // pSrc Pointer to the input vector [len].
  4660. // len Number of samples.
  4661. // pDstLowBand Pointer to the output lower-band vector [[len/2].
  4662. // pDstHighBand Pointer to the output higher-band vector [len/2].
  4663. // pState Pointer to the memory supplied for QMF encode.
  4664. // Returns: ippStsNoErr, if no errors
  4665. */
  4666. IPPAPI (IppStatus, ippsQMFEncode_G7291_16s, (const Ipp16s* pSrc, int len,
  4667. Ipp16s* pDstLowBand, Ipp16s* pDstHighBand, IppsQMFState_G7291_16s* pState))
  4668. /* /////////////////////////////////////////////////////////////////////////////
  4669. // Name: ippsQMFDecode_G7291_16s
  4670. // Purpose: Two-channel filter bank synthesis.
  4671. // Parameters:
  4672. // pSrcLowBand Pointer to the input lower-band vector [len].
  4673. // pSrcHighBand Pointer to the input higher-band vector [len].
  4674. // valGainSwitching Gain attenuation factor.
  4675. // len Number of samples.
  4676. // pDst Pointer to the output vector [len*2].
  4677. // pState Pointer to the memory supplied for QMF decode.
  4678. // Returns: ippStsNoErr, if no errors
  4679. */
  4680. IPPAPI (IppStatus, ippsQMFDecode_G7291_16s, (const Ipp16s* pSrcLowBand, const Ipp16s* pSrcHighBand,
  4681. Ipp16s valGainSwitching, int len, Ipp16s* pDst, IppsQMFState_G7291_16s* pState))
  4682. /* /////////////////////////////////////////////////////////////////////////////
  4683. // Name: ippsLSFDecode_G7291_16s
  4684. // Purpose: Construct LSFs by codebook indices
  4685. // Parameters:
  4686. // pQuantIndex Pointer to the input vector of codebook indices.
  4687. // pSrcDstPrevLSF Pointer to the input/output table of 4 previously quantized LSFs vectors.
  4688. // pSrcDstLSF Pointer to the quantized LSF input/output vector.
  4689. // Returns: ippStsNoErr, if no errors
  4690. */
  4691. IPPAPI (IppStatus, ippsLSFDecode_G7291_16s, (const Ipp16s* pQuantIndex, Ipp16s* pSrcDstPrevLSF,
  4692. Ipp16s* pSrcDstLSF))
  4693. /* /////////////////////////////////////////////////////////////////////////////
  4694. // Name : ippsAdaptiveCodebookSearch_G7291_16s
  4695. // Purpose: Determination of optimal integer and fractional pitch delay
  4696. // and generation of adaptive codebook vector
  4697. // Parameters:
  4698. // pSrcAdptTarget Pointer to the target signal for adaptive-codebook search vector [40].
  4699. // pSrcImpulseResponse Pointer to the impulse response of weighted synthesis filter vector [40]
  4700. // pSrcPrevExcitation Pointer to the previous and updated excitation vector [154].
  4701. // pDstDelay Pointer to the integer delay and fraction delay vector [2].
  4702. // lagMin Minimum value in the searched range.
  4703. // lagMax Maximum value in the searched range.
  4704. // subFrame Subframe number, either 0 or 1.
  4705. */
  4706. IPPAPI (IppStatus, ippsAdaptiveCodebookSearch_G7291_16s, (const Ipp16s* pSrcAdptTarget,
  4707. const Ipp16s* pSrcImpulseResponse, const Ipp16s* pSrcPrevExcitation, Ipp16s* pDstDelay,
  4708. Ipp16s lagMin, Ipp16s lagMax, int subFrame))
  4709. /* /////////////////////////////////////////////////////////////////////////////
  4710. // Name : ippsAdaptiveCodebookGain_G7291_16s
  4711. // Purpose: Compute the adaptive codebook gain
  4712. //
  4713. // pSrcAdptTarget Pointer to the adaptive target signal vector [40].
  4714. // pSrcImpulseResponse Pointer to the impulse response of the perceptual weighting filter vector [40].
  4715. // pSrcAdptVector Pointer to the adaptive-codebook vector [40].
  4716. // pDstFltAdptVector Pointer to the output filtered adaptive-codebook vector [40].
  4717. // pResultAdptGain Pointer to the adaptive-codebook gain in the length of 1, in Q14.
  4718. */
  4719. IPPAPI (IppStatus, ippsAdaptiveCodebookGain_G7291_16s, (const Ipp16s* pSrcAdptTarget,
  4720. const Ipp16s* pSrcImpulseResponse, const Ipp16s* pSrcAdptVector, Ipp16s* pDstFltAdptVector,
  4721. Ipp16s* pResultAdptGain))
  4722. /* /////////////////////////////////////////////////////////////////////////////
  4723. // Name: ippsAlgebraicCodebookSearch
  4724. // Purpose: Fixed (algebraic) codebook search function (1st Layer)
  4725. // Parameters:
  4726. // pSrcFixedTarget Pointer to the input updated target speech vector [40].
  4727. // pSrcLtpResidual Pointer to the input residual after long term prediction vector [40].
  4728. // pSrcDstFltAdptVector Pointer to the output filtered adaptive fixed-codebook vector [40].
  4729. // pSrcDstImpulseResponse Pointer to the output LP synthesis filter [40].
  4730. // pitchLag Pitch lag value.
  4731. // pitchGain Last quantized pitch gain value.
  4732. // pDstFixedVector Pointer to the fixed-codebook vector [40].
  4733. // pDstFltFixedVector Pointer to the output filtered fixed-codebook vector [40].
  4734. // pDstCodebookIdx Pointer to the fixed-codebook index [2].
  4735. // voiceFactor Voicing factor value.
  4736. // Returns: IppStatus
  4737. // ippStsNoErr if no error
  4738. */
  4739. IPPAPI (IppStatus, ippsAlgebraicCodebookSearchL1_G7291_16s, (const Ipp16s* pSrcFixedTarget,
  4740. const Ipp16s* pSrcLtpResidual, Ipp16s* pSrcDstFltAdptVector, Ipp16s* pSrcDstImpulseResponse,
  4741. Ipp16s pitchLag, Ipp16s pitchGain, Ipp16s* pDstFixedVector, Ipp16s* pDstFltFixedVector,
  4742. Ipp16s* pDstCodebookIdx))
  4743. IPPAPI (IppStatus, ippsAlgebraicCodebookSearchL2_G7291_16s, (const Ipp16s* pSrcFixedTarget,
  4744. const Ipp16s* pSrcLtpResidual, const Ipp16s* pSrcImpulseResponse, Ipp16s voiceFactor,
  4745. Ipp16s* pDstFixedVector, Ipp16s* pDstFltFixedVector, Ipp16s* pDstCodebookIdx))
  4746. /* /////////////////////////////////////////////////////////////////////////////
  4747. // Name: ippsGainQuant_G7291_16s
  4748. // Purpose: Quantization of the adaptive codebook gains of 2nd stage
  4749. // Parameters:
  4750. // pSrcFixedTarget Pointer to the target signal for adaptive codebook search vector [40].
  4751. // pSrcFltFixedVector Pointer to the filtered fixed codebook vector [40].
  4752. // valSrcQGain Quantized gain of 1st stage.
  4753. // pDstQGainIndex Pointer to the output gain codebook index.
  4754. // pDstQGain Pointer to the output quantized gain.
  4755. // subFrame Subframe number in range [0,3].
  4756. //
  4757. // Returns: IppStatus
  4758. // ippStsNoErr if no error
  4759. */
  4760. IPPAPI (IppStatus, ippsGainQuant_G7291_16s, (const Ipp16s* pSrcFixedTarget, const Ipp16s* pSrcFltFixedVector,
  4761. Ipp16s valSrcQGain, Ipp16s* pDstQGainIndex, Ipp16s* pDstQGain, int subFrame))
  4762. /* /////////////////////////////////////////////////////////////////////////////
  4763. // Name: ippsEnvelopTime_G7291_16s
  4764. // Purpose: TDBWE time envelope (segment energy) computation
  4765. // Parameters:
  4766. // pSrc Pointer to the original highband input signal [10*subFrame].
  4767. // nls Normalization of the input signal.
  4768. // pDstEnvelopTime Pointer to the output time envelope parameters [subFrame].
  4769. // subFrame Number of consecutive subframes in pSrc.
  4770. //
  4771. // Returns: IppStatus
  4772. // ippStsNoErr if no error
  4773. */
  4774. IPPAPI (IppStatus, ippsEnvelopTime_G7291_16s, (const Ipp16s* pSrc, Ipp16s nls,
  4775. Ipp16s* pDstEnvelopTime, int subFrame))
  4776. /* /////////////////////////////////////////////////////////////////////////////
  4777. // Name: ippsEnvelopFrequency_G7291_16s
  4778. // Purpose: TDBWE frequency envelope (sub-band energy) computation
  4779. // Parameters:
  4780. // pSrc Pointer to the original highband input signal [64].
  4781. // pDstEnvelopFreq Pointer to the output frequency envelope parameters [12].
  4782. //
  4783. // Returns: IppStatus
  4784. // ippStsNoErr if no error
  4785. */
  4786. IPPAPI (IppStatus, ippsEnvelopFrequency_G7291_16s, (const Ipp16s* pSrc, Ipp16s* pDstEnvelopFreq))
  4787. /* /////////////////////////////////////////////////////////////////////////////
  4788. // Name: ippsGenerateExcitationGetStateSize_G7291_16s
  4789. // Purpose: Knowing of TDBWE generate excitation size demand
  4790. // Parameters:
  4791. // pSize Pointer to the output value of the memory size.
  4792. // Returns:
  4793. // ippStsNoErr, if no errors
  4794. */
  4795. IPPAPI (IppStatus, ippsGenerateExcitationGetStateSize_G7291_16s, (int* pSize))
  4796. /* /////////////////////////////////////////////////////////////////////////////
  4797. // Name: ippsGenerateExcitationInit_G7291_16s
  4798. // Purpose: Initialization of the memory allocated for generate excitation
  4799. // Parameters:
  4800. // pState Pointer to the memory supplied for generation of the excitation signal.
  4801. // Returns: ippStsNoErr, if no errors
  4802. */
  4803. IPPAPI (IppStatus, ippsGenerateExcitationInit_G7291_16s, (IppsGenerateExcitationState_G7291_16s* pState))
  4804. /* /////////////////////////////////////////////////////////////////////////////
  4805. // Name: ippsGenerateExcitation_G7291_16s
  4806. // Purpose: TDBWE excitation generator: produce pitch-synchronous excitation
  4807. // signal based on G.729 parameters
  4808. // Parameters:
  4809. // pIntPitchLag Pointer to the integer part of pitch lag.
  4810. // pFracPitchLag Pointer to the fractional part of pitch lag.
  4811. // pLtpPower Pointer to the ltp power ratio.
  4812. // pFixPower Pointer to the fix power ratio.
  4813. // pState Pointer to the memory supplied for generate excitation.
  4814. // Returns: ippStsNoErr, if no errors
  4815. //
  4816. */
  4817. IPPAPI (IppStatus, ippsGenerateExcitation_G7291_16s, (const Ipp16s* pIntPitchLag,
  4818. const Ipp16s* pFracPitchLag, const Ipp32s* pLtpPower, const Ipp32s* pFixPower,
  4819. Ipp16s* pDst, IppsGenerateExcitationState_G7291_16s* pState))
  4820. /* /////////////////////////////////////////////////////////////////////////////
  4821. // Name: ippsShapeEnvelopTime_G7291_16s
  4822. // Purpose: TDBWE time envelope shaping module,
  4823. // shape time envelope of pSrc according to pSrcTimeEnvelope
  4824. // Parameters:
  4825. // pSrc Pointer to the excitation input signal [80].
  4826. // pSrcEnvelopTime Pointer to the desired time envelope [8].
  4827. // pSrcDstGain Pointer to the gain of the time envelope shaping.
  4828. // pSrcDstNorm Pointer to the norm of the time envelope shaping.
  4829. // pDst Pointer to the shaped output signal [208].
  4830. // Returns: ippStsNoErr, if no errors
  4831. //
  4832. */
  4833. IPPAPI (IppStatus, ippsShapeEnvelopTime_G7291_16s, (const Ipp16s* pSrc,
  4834. const Ipp16s* pSrcEnvelopTime, Ipp16s* pSrcDstGain, Ipp16s* pSrcDstNorm,
  4835. Ipp16s* pDst))
  4836. /* /////////////////////////////////////////////////////////////////////////////
  4837. // Name: ippsShapeEnvelopFrequency_G7291_16s
  4838. // Purpose: TDBWE frequency envelope shaping module
  4839. // shape frequency envelope of pSrc according to pSrcFreqEnvelope
  4840. // Parameters:
  4841. // pSrc Pointer to the input signal [208].
  4842. // pSrcEnvelopFreq Pointer to the desired frequency envelope [12].
  4843. // pDst Pointer to the shaped output signal [80].
  4844. // pDstFilterCoeffs Pointer to the filtering coefficients for frequency envelope shaping [33].
  4845. // pMem Pointer to the memory supplied for frequency envelope shaping [32].
  4846. // Returns: ippStsNoErr, if no errors
  4847. //
  4848. */
  4849. IPPAPI (IppStatus, ippsShapeEnvelopFrequency_G7291_16s, (const Ipp16s* pSrc,
  4850. const Ipp16s* pSrcEnvelopFreq, Ipp16s* pDst, Ipp16s* pDstFilterCoeffs, Ipp16s* pMem))
  4851. /* /////////////////////////////////////////////////////////////////////////////
  4852. // Name: ippsCompressEnvelopTime_G7291_16s
  4853. // Purpose: Postprocessing of the TDBWE output by adaptive amplitude compression
  4854. // Parameters:
  4855. // pSrcEnvelopTime Pointer to the desired time envelope [28].
  4856. // pSrcDst Pointer to the shaped input/output signal [160].
  4857. // pMem Pointer to the memory for 2 past time envelope parameters.
  4858. // Returns: ippStsNoErr, if no errors
  4859. //
  4860. */
  4861. IPPAPI (IppStatus, ippsCompressEnvelopTime_G7291_16s, (const Ipp16s* pSrcEnvelopTime,
  4862. Ipp16s* pSrcDst, Ipp16s* pMem))
  4863. /* /////////////////////////////////////////////////////////////////////////////
  4864. // Name: ippsMDCTFwd_G7291_16s
  4865. // Purpose: Compute MDCT
  4866. // Parameters:
  4867. // pSrc Pointer to the input signal [160].
  4868. // pSrcDst Pointer to the previous input signal [160].
  4869. // pDstNorm Pointer to the output normalization factor.
  4870. // pDstMDCTCoeffs Pointer to the output MDCT coefficients [160].
  4871. // hint Suggests using specific code.
  4872. // Returns: ippStsNoErr, if no errors
  4873. //
  4874. */
  4875. IPPAPI(IppStatus, ippsMDCTFwd_G7291_16s, (const Ipp16s* pSrc, const Ipp16s* pSrcPrev,
  4876. int* pDstNorm, Ipp16s* pDstMDCTCoeffs, IppHintAlgorithm hint ))
  4877. /* /////////////////////////////////////////////////////////////////////////////
  4878. // Name: ippsMDCTInv_G7291_16s
  4879. // Purpose: Compute inverse MDCT
  4880. // Parameters:
  4881. // pMDCTCoeffs Pointer to the MDCT coefficients [160].
  4882. // pSrcDstMDCTPrevCoeffs Pointer to the old input/output MDCT memory [160].
  4883. // pDst Pointer to the output signal [160].
  4884. // scaleFactor Scale factor for the normalization MDCT coefficients.
  4885. // Returns: ippStsNoErr, if no errors
  4886. //
  4887. */
  4888. IPPAPI (IppStatus, ippsMDCTInv_G7291_16s, (const Ipp16s* pMDCTCoeffs,
  4889. Ipp16s* pSrcDstMDCTPrevCoeffs, Ipp16s* pDst, int scaleFactor))
  4890. /* /////////////////////////////////////////////////////////////////////////////
  4891. // Name: ippsMDCTQuantFwd_G7291_16s32u
  4892. // Purpose: Split spherical vector quantization.
  4893. // Parameters:
  4894. // pMDCTCoeffs Pointer to the input MDCT coefficients [320].
  4895. // pBitsNumber Pointer to the input number of bits allocated per subbands [18].
  4896. // pDst Pointer to the output vector quantization [18].
  4897. // Returns: ippStsNoErr, if no errors
  4898. //
  4899. */
  4900. IPPAPI (IppStatus, ippsMDCTQuantFwd_G7291_16s32u,
  4901. (const Ipp16s* pMDCTCoeffs, const Ipp16s* pBitsNumber, Ipp32u* pDst))
  4902. /* /////////////////////////////////////////////////////////////////////////////
  4903. // Name: ippsMDCTQuantDecode_G7291_32u16s
  4904. // Purpose: Inverse split spherical vector quantization.
  4905. // Parameters:
  4906. // pSrc Pointer to the input vector quantization indices [18].
  4907. // pBitsNumber Pointer to the input number of bits allocated per subbands [18].
  4908. // pQuantSpecEnv Pointer to the input quantized spectrum envelope [18].
  4909. // pMDCTCoeffs Pointer to the output MDCT coefficients [320].
  4910. // Returns: ippStsNoErr, if no errors
  4911. //
  4912. */
  4913. IPPAPI (IppStatus, ippsMDCTQuantInv_G7291_32u16s,
  4914. (const Ipp32u* pSrc, const Ipp16s* pBitsNumber,
  4915. const Ipp16s* pQuantSpecEnv, Ipp16s* pDstMDCTCoeffs))
  4916. /* /////////////////////////////////////////////////////////////////////////////
  4917. // Name: ippsMDCTPostProcess_G7291_16s
  4918. // Purpose: Post-processing of higher-band MDCT coefficients.
  4919. // Parameters:
  4920. // pSrcDstMDCTCoeffs Pointer to the input/output MDCT coefficients [160].
  4921. // numBits Number of bits to decode in TDAC.
  4922. // Returns: ippStsNoErr, if no errors
  4923. //
  4924. */
  4925. IPPAPI (IppStatus, ippsMDCTPostProcess_G7291_16s, (Ipp16s* pSrcDstMDCTCoeffs,
  4926. int numBits))
  4927. /* /////////////////////////////////////////////////////////////////////////////
  4928. // Name: ippsGainControl_G7291_16s_I
  4929. // Purpose: Adaptive gain control
  4930. // Compensate for the gain difference between reconstructed speech signal given
  4931. // pSrc (sr) and the postfiltered signal given by pSrcDst (spf)
  4932. // dst[i] = g[i] * dst[i]
  4933. // pSrc Pointer to the source reconstructed speech vector [40].
  4934. // pSrcDst Pointer to the input post-filtered signal and output
  4935. // gain-compensated signal vector [40].
  4936. // pSrcDstGain Pointer to the gain for the previous subframe.
  4937. // gain First reflection coefficient.
  4938. // valGainSwitching Gain attenuation factor.
  4939. // pSrcDstSmoothLevel Pointer to the input/output smooth level.
  4940. // Returns: IppStatus
  4941. // ippStsNoErr if no error
  4942. */
  4943. IPPAPI (IppStatus, ippsGainControl_G7291_16s_I, (const Ipp16s* pSrc, Ipp16s *pSrcDst,
  4944. Ipp16s* pSrcDstGain, Ipp16s gain, Ipp16s valGainSwitching,
  4945. Ipp32s* pSrcDstSmoothLevel))
  4946. /* /////////////////////////////////////////////////////////////////////////////
  4947. // Name: ippsTiltCompensation_G7291_16s
  4948. // Purpose: Tilt compensation filter
  4949. // transfer function 1/(1-|mu|) * (1 + mu * 1/z)
  4950. // pSrc Pointer to the gamma weighted LP coefficients input vector [40].
  4951. // pDst Pointer to the present and tilt-compensated output speech [40].
  4952. // gain Gain coefficient.
  4953. // Returns: IppStatus
  4954. // ippStsNoErr if no error
  4955. */
  4956. IPPAPI (IppStatus, ippsTiltCompensation_G7291_16s, (const Ipp16s* pSrc, Ipp16s* pDst,
  4957. Ipp16s gain))
  4958. /* /////////////////////////////////////////////////////////////////////////////
  4959. // Name: ippsQuantParam_G7291_16s
  4960. // Purpose: Quantization of the TDBWE parameter set by "mean removed VQ"
  4961. //
  4962. // Parameters:
  4963. // pSrcDst Pointer to the source/destination unquantized parameter set [28].
  4964. // pCdbkIndices Pointer to the codebook indices [4].
  4965. // Returns: IppStatus
  4966. // ippStsNoErr if no error
  4967. */
  4968. IPPAPI (IppStatus, ippsQuantParam_G7291_16s, (Ipp16s *pSrcDst, Ipp16s *pCdbkIndices))
  4969. /* /////////////////////////////////////////////////////////////////////////////
  4970. // G7291 end
  4971. ///////////////////////////////////////////////////////////////////////////// */
  4972. /* /////////////////////////////////////////////////////////////////////////////
  4973. // Noise filters functions
  4974. ///////////////////////////////////////////////////////////////////////////// */
  4975. #if !defined( _OWN_BLDPCS )
  4976. typedef struct _FilterNoiseState_RTA_32f IppsFilterNoiseState_RTA_32f;
  4977. typedef struct _FilterNoiseState_EC_32f IppsFilterNoiseState_EC_32f;
  4978. #endif
  4979. /* /////////////////////////////////////////////////////////////////////////////
  4980. // Name: ippsFilterNoiseGetStateSize_*
  4981. // Purpose: Knowing of RTA Noise Suppression size demand
  4982. // Parameters:
  4983. // pcmFreq Sampling frequency.
  4984. // pSize Pointer to the output value of the memory size.
  4985. // Returns:
  4986. // ippStsNoErr, if no errors
  4987. //
  4988. */
  4989. IPPAPI(IppStatus, ippsFilterNoiseGetStateSize_RTA_32f, (IppPCMFrequency pcmFreq, int* pSize ))
  4990. IPPAPI(IppStatus, ippsFilterNoiseGetStateSize_EC_32f, (IppPCMFrequency pcmFreq,int *size))
  4991. /* /////////////////////////////////////////////////////////////////////////////
  4992. // Name: ippsFilterNoiseInit_*
  4993. // Purpose: Initialization of the memory allocated for Noise Suppression Main Algorithm
  4994. // Parameters:
  4995. // pcmFreq Sampling frequency.
  4996. // pNRStateMem Pointer to the memory supplied for filter state.
  4997. // Returns: ippStsNoErr, if no errors
  4998. //
  4999. */
  5000. IPPAPI(IppStatus, ippsFilterNoiseInit_RTA_32f, (IppPCMFrequency pcmFreq, IppsFilterNoiseState_RTA_32f* pNRStateMem))
  5001. IPPAPI(IppStatus, ippsFilterNoiseInit_EC_32f, (IppPCMFrequency pcmFreq, IppsFilterNoiseState_EC_32f* pNRStateMem))
  5002. /* /////////////////////////////////////////////////////////////////////////////
  5003. // Name: ippsFilterNoiseLevel_*
  5004. // Purpose: Set the level of noise attenuation
  5005. // Parameters:
  5006. // level The enumerated value which defines the degree of noise attenuation.
  5007. // pNRStateMem Pointer to the memory supplied for Noise Suppression.
  5008. // Returns: ippStsNoErr, if no errors
  5009. //
  5010. */
  5011. IPPAPI(IppStatus, ippsFilterNoiseLevel_RTA_32f, (IppsNRLevel level, IppsFilterNoiseState_RTA_32f* pNRStateMem))
  5012. IPPAPI(IppStatus, ippsFilterNoiseLevel_EC_32f, (IppsNRLevel level, IppsFilterNoiseState_EC_32f* pNRStateMem))
  5013. /* /////////////////////////////////////////////////////////////////////////////
  5014. // Name: ippsFilterNoiseSetMode_EC_32f
  5015. // Purpose: Set the type of smoothing algorithm applied
  5016. // Parameters:
  5017. // mode The enumerated value which defines the smoothing mode
  5018. // pNRStateMem Pointer to the memory supplied for Noise Suppression.
  5019. // Returns: ippStsNoErr, if no errors
  5020. //
  5021. */
  5022. IPPAPI(IppStatus, ippsFilterNoiseSetMode_EC_32f, (IppsNrSmoothMode mode, IppsFilterNoiseState_EC_32f* pNRStateMem))
  5023. /* /////////////////////////////////////////////////////////////////////////////
  5024. // Name: _ippsFilterNoiseDetect_EC_32f64f
  5025. // Purpose: Performs Noise Suppression Main Algorithm
  5026. // Parameters:
  5027. // pSrc1 Pointer to the "sin" input vector.
  5028. // pSrc2 Pointer to the "rin" input vector.
  5029. // pNoisePwr Pointer to the noise detected power.
  5030. // pMean Weighted mean of the noise.
  5031. // pDstFlag 1-noise detected, 0-not detected
  5032. // pNRStateMem Pointer to the memory supplied for Noise Suppression.
  5033. // Returns: ippStsNoErr, if no errors
  5034. //
  5035. */
  5036. IPPAPI(IppStatus, ippsFilterNoiseDetect_EC_32f64f, (const Ipp32f pSrc1[16],Ipp64f *pNoisePwr,
  5037. Ipp32f *pMean,int *pDstFlag,IppsFilterNoiseState_EC_32f *pNRStateMem))
  5038. IPPAPI(IppStatus, ippsFilterNoiseDetectModerate_EC_32f64f, (const Ipp32f pSrc1[16],const Ipp32f pSrc2[16],Ipp64f *pNoisePwr,
  5039. Ipp32f *pMean,int *pDstFlag,IppsFilterNoiseState_EC_32f *pNRStateMem))
  5040. /* /////////////////////////////////////////////////////////////////////////////
  5041. // Name: ippsFilterNoise_*
  5042. // Purpose: Performs Noise Suppression Main Algorithm
  5043. // Parameters:
  5044. // pSrc Pointer to the input vector.
  5045. // pDst Pointer to the output vector.
  5046. // pSrcDst Pointer to the input/output vector.
  5047. // noiseFlag Enumerated value defines filter state update.
  5048. // pNRStateMem Pointer to the memory supplied for Noise Suppression.
  5049. // Returns: ippStsNoErr, if no errors
  5050. //
  5051. */
  5052. IPPAPI(IppStatus, ippsFilterNoise_RTA_32f, (const Ipp32f pSrc[160], Ipp32f pDst[160], IppsFilterNoiseState_RTA_32f* pNRStateMem ))
  5053. IPPAPI(IppStatus, ippsFilterNoise_RTA_32f_I, (Ipp32f pSrcDst[160], IppsFilterNoiseState_RTA_32f* pNRStateMem ))
  5054. IPPAPI(IppStatus, ippsFilterNoise_EC_32f, (const Ipp32f pSrc[16],Ipp32f pDst[16],IppsNrMode noiseFlag,
  5055. IppsFilterNoiseState_EC_32f *pNRStateMem))
  5056. IPPAPI(IppStatus, ippsFilterNoise_EC_32f_I, (Ipp32f pSrcDst[16],IppsNrMode noiseFlag,IppsFilterNoiseState_EC_32f *pNRStateMem))
  5057. /* /////////////////////////////////////////////////////////////////////////////
  5058. // Noise filters end
  5059. ///////////////////////////////////////////////////////////////////////////// */
  5060. /* /////////////////////////////////////////////////////////////////////////////
  5061. // ALC functions
  5062. ///////////////////////////////////////////////////////////////////////////// */
  5063. #if !defined( _OWN_BLDPCS )
  5064. typedef struct _ALCState_G169_16s IppsALCState_G169_16s;
  5065. #endif
  5066. /* /////////////////////////////////////////////////////////////////////////////
  5067. // Name: ippsALCGetStateSize_G169_16s
  5068. // Purpose: Knowing of Speech level control size demand
  5069. // Parameters:
  5070. // pSize Pointer to the output value of the memory size needed for Speech Level Control
  5071. // Returns:
  5072. // ippStsNoErr, if no errors
  5073. //
  5074. */
  5075. IPPAPI(IppStatus, ippsALCGetStateSize_G169_16s,(int* pSize ))
  5076. /* /////////////////////////////////////////////////////////////////////////////
  5077. // Name: ippsALCInit_G169_16s
  5078. // Purpose: Initialization of the memory allocated for Speech Level Control Algorithm
  5079. // Parameters:
  5080. // pALCMem Pointer to the memory supplied for Speech Level Control.
  5081. // Returns: ippStsNoErr, if no errors
  5082. //
  5083. */
  5084. IPPAPI(IppStatus, ippsALCInit_G169_16s,(IppsALCState_G169_16s* pALCMem))
  5085. /* /////////////////////////////////////////////////////////////////////////////
  5086. // Name: ippsALCSetLevel_G169_16s
  5087. // Purpose: Set clip limit for the Speech Level Control
  5088. // Parameters:
  5089. // targetLevel Target level in dB.
  5090. // clipLevel Clip limit in dB.
  5091. // pALCMem Pointer to the memory supplied for Speech Level Control.
  5092. // Returns: ippStsNoErr, if no errors
  5093. //
  5094. */
  5095. IPPAPI(IppStatus, ippsALCSetLevel_G169_16s,(Ipp32f targetLevel, Ipp32f clipLevel, IppsALCState_G169_16s* pALCMem))
  5096. /* /////////////////////////////////////////////////////////////////////////////
  5097. // Name: ippsALCSetGain_G169_16s
  5098. // Purpose: Set max gain limit for the Speech Level Control
  5099. // Parameters:
  5100. // targetLevel Max gain in dB.
  5101. // pALCMem Pointer to the memory supplied for Speech Level Control.
  5102. // Returns: ippStsNoErr, if no errors
  5103. //
  5104. */
  5105. IPPAPI(IppStatus, ippsALCSetGain_G169_16s,(Ipp32f maxGain, IppsALCState_G169_16s* pALCMem))
  5106. /* /////////////////////////////////////////////////////////////////////////////
  5107. // Name: ippsALC_G169_16s
  5108. // Purpose: Speech Level Control
  5109. // Parameters:
  5110. // pSrc Pointer to the input vector.
  5111. // pDst Pointer to the output vector.
  5112. // pALCMem Pointer to the memory supplied for Speech Level Control.
  5113. // Returns: ippStsNoErr, if no errors
  5114. //
  5115. */
  5116. IPPAPI(IppStatus, ippsALC_G169_16s,(const Ipp16s *pSrc, Ipp16s *pDst, int len, IppsALCState_G169_16s* pALCMem))
  5117. /* /////////////////////////////////////////////////////////////////////////////
  5118. // ALC functions end
  5119. ///////////////////////////////////////////////////////////////////////////// */
  5120. /* /////////////////////////////////////////////////////////////////////////////
  5121. // G.728J related functions
  5122. ///////////////////////////////////////////////////////////////////////////// */
  5123. /* ///////////////////////////////////////////////////////////////////////////
  5124. // Name: ippsCodebookSearchTCQ_G728_16s8u
  5125. //
  5126. // Purpose: This function performs codebook search by Trellis-Coded Quantization
  5127. // algorthm described in ITU G728 Annex J claus J.4.1.1 and stores trellis
  5128. // survivor path index in pBestNode and best path indices in pDst
  5129. //
  5130. // Parameters:
  5131. // pSrc Pointer to the input speech vector
  5132. // pSrcLPC Pointer to the LPC coefficients vector
  5133. // pDst Pointers to the output best path indices
  5134. // pSrcDstWindow Pointer to the synthesis filter hybrid window memory
  5135. // pSrcDstResidual Pointer to the input/outpu quantized residual vector
  5136. // pSrcDstBestNode Pointer to input/output survivor node value in Viterbi search
  5137. // invGain Inverted gain scaled value structure
  5138. // excGain Linear excitation gain scaled value structure
  5139. //
  5140. //
  5141. // Returns:
  5142. // ippStsNoErr Indicates no error.
  5143. // ippStsNullPtrErr Indicates an error when the pSrc, pSrcLPC, pSrcWindow,
  5144. // pSrcDstResidual, pSrcDstBestNode or pDst pointer is NULL.
  5145. //
  5146. */
  5147. IPPAPI(IppStatus, ippsCodebookSearchTCQ_G728_16s8u,(const Ipp16s *pSrc, const Ipp16s *pSrcLPC,Ipp8u *pDst,
  5148. Ipp16s *pSrcDstWindow, Ipp16s *pSrcDstResidual, Ipp32s *pSrcDstBestNode,
  5149. Ipp32s_EC_Sfs invGain, Ipp32s_EC_Sfs excGain ))
  5150. /* /////////////////////////////////////////////////////////////////////////////
  5151. // G.728J end
  5152. ///////////////////////////////////////////////////////////////////////////// */
  5153. #ifdef __cplusplus
  5154. }
  5155. #endif
  5156. #if defined (_IPP_STDCALL_CDECL)
  5157. #undef _IPP_STDCALL_CDECL
  5158. #define __stdcall __cdecl
  5159. #endif
  5160. #endif /* __IPPSC_H__ */
  5161. /* ////////////////////////////// End of file /////////////////////////////// */