csky_vdsp2_math.h 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291
  1. /******************************************************************************
  2. * @file csky_vdsp2_math.h
  3. * @brief Public header file for CSI DSP Library.
  4. * @version V1.0
  5. * @date 20. Dec 2016
  6. ******************************************************************************/
  7. /* ---------------------------------------------------------------------------
  8. * Copyright (C) 2016 CSKY Limited. All rights reserved.
  9. *
  10. * Redistribution and use of this software in source and binary forms,
  11. * with or without modification, are permitted provided that the following
  12. * conditions are met:
  13. * * Redistributions of source code must retain the above copyright notice,
  14. * this list of conditions and the following disclaimer.
  15. * * Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. * * Neither the name of CSKY Ltd. nor the names of CSKY's contributors may
  19. * be used to endorse or promote products derived from this software without
  20. * specific prior written permission of CSKY Ltd.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  24. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  25. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  26. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
  27. * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. * THE POSSIBILITY OF SUCH DAMAGE.
  33. * -------------------------------------------------------------------------- */
  34. #ifndef _CSKY_VDSP2_MATH_H
  35. #define _CSKY_VDSP2_MATH_H
  36. #include "csky_math.h"
  37. #ifdef __cplusplus
  38. extern "C"
  39. {
  40. #endif
  41. /**
  42. * @brief Error status returned by some functions in the library.
  43. */
  44. typedef enum
  45. {
  46. CSKY_VDSP2_MATH_SUCCESS = 0, /**< No error */
  47. CSKY_VDSP2_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */
  48. CSKY_VDSP2_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */
  49. CSKY_VDSP2_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */
  50. CSKY_VDSP2_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */
  51. CSKY_VDSP2_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */
  52. CSKY_VDSP2_MATH_TEST_FAILURE = -6 /**< Test Failed */
  53. } csky_vdsp2_status;
  54. /**
  55. * @brief Instance structure for the Q7 FIR filter.
  56. */
  57. typedef struct
  58. {
  59. uint16_t numTaps; /**< number of filter coefficients in the filter. */
  60. q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  61. q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  62. } csky_vdsp2_fir_instance_q7;
  63. /**
  64. * @brief Instance structure for the Q15 FIR filter.
  65. */
  66. typedef struct
  67. {
  68. uint16_t numTaps; /**< number of filter coefficients in the filter. */
  69. q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  70. q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  71. } csky_vdsp2_fir_instance_q15;
  72. /**
  73. * @brief Instance structure for the Q31 FIR filter.
  74. */
  75. typedef struct
  76. {
  77. uint16_t numTaps; /**< number of filter coefficients in the filter. */
  78. q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  79. q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  80. } csky_vdsp2_fir_instance_q31;
  81. /**
  82. * @brief Instance structure for the floating-point FIR filter.
  83. */
  84. typedef struct
  85. {
  86. uint16_t numTaps; /**< number of filter coefficients in the filter. */
  87. float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  88. float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  89. } csky_vdsp2_fir_instance_f32;
  90. void csky_vdsp2_fir_q7(
  91. const csky_vdsp2_fir_instance_q7 * S,
  92. q7_t * pSrc,
  93. q7_t * pDst,
  94. uint32_t blockSize);
  95. void csky_vdsp2_fir_init_q7(
  96. csky_vdsp2_fir_instance_q7 * S,
  97. uint16_t numTaps,
  98. q7_t * pCoeffs,
  99. q7_t * pState,
  100. uint32_t blockSize);
  101. void csky_vdsp2_fir_q15(
  102. const csky_vdsp2_fir_instance_q15 * S,
  103. q15_t * pSrc,
  104. q15_t * pDst,
  105. uint32_t blockSize);
  106. void csky_vdsp2_fir_fast_q15(
  107. const csky_vdsp2_fir_instance_q15 * S,
  108. q15_t * pSrc,
  109. q15_t * pDst,
  110. uint32_t blockSize);
  111. csky_vdsp2_status csky_vdsp2_fir_init_q15(
  112. csky_vdsp2_fir_instance_q15 * S,
  113. uint16_t numTaps,
  114. q15_t * pCoeffs,
  115. q15_t * pState,
  116. uint32_t blockSize);
  117. void csky_vdsp2_fir_q31(
  118. const csky_vdsp2_fir_instance_q31 * S,
  119. q31_t * pSrc,
  120. q31_t * pDst,
  121. uint32_t blockSize);
  122. void csky_vdsp2_fir_fast_q31(
  123. const csky_vdsp2_fir_instance_q31 * S,
  124. q31_t * pSrc,
  125. q31_t * pDst,
  126. uint32_t blockSize);
  127. void csky_vdsp2_fir_init_q31(
  128. csky_vdsp2_fir_instance_q31 * S,
  129. uint16_t numTaps,
  130. q31_t * pCoeffs,
  131. q31_t * pState,
  132. uint32_t blockSize);
  133. void csky_vdsp2_fir_f32(
  134. const csky_vdsp2_fir_instance_f32 * S,
  135. float32_t * pSrc,
  136. float32_t * pDst,
  137. uint32_t blockSize);
  138. void csky_vdsp2_fir_init_f32(
  139. csky_vdsp2_fir_instance_f32 * S,
  140. uint16_t numTaps,
  141. float32_t * pCoeffs,
  142. float32_t * pState,
  143. uint32_t blockSize);
  144. /**
  145. * @brief Instance structure for the Q15 Biquad cascade filter.
  146. */
  147. typedef struct
  148. {
  149. int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
  150. q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
  151. q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
  152. int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
  153. } csky_vdsp2_biquad_casd_df1_inst_q15;
  154. /**
  155. * @brief Instance structure for the Q31 Biquad cascade filter.
  156. */
  157. typedef struct
  158. {
  159. uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
  160. q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
  161. q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
  162. uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */
  163. } csky_vdsp2_biquad_casd_df1_inst_q31;
  164. /**
  165. * @brief Instance structure for the Q31 Biquad cascade filter.
  166. */
  167. /**
  168. * @brief Instance structure for the floating-point Biquad cascade filter.
  169. */
  170. typedef struct
  171. {
  172. uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
  173. float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */
  174. float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */
  175. } csky_vdsp2_biquad_casd_df1_inst_f32;
  176. void csky_vdsp2_biquad_cascade_df1_q15(
  177. const csky_vdsp2_biquad_casd_df1_inst_q15 * S,
  178. q15_t * pSrc,
  179. q15_t * pDst,
  180. uint32_t blockSize);
  181. void csky_vdsp2_biquad_cascade_df1_init_q15(
  182. csky_vdsp2_biquad_casd_df1_inst_q15 * S,
  183. uint8_t numStages,
  184. q15_t * pCoeffs,
  185. q15_t * pState,
  186. int8_t postShift);
  187. void csky_vdsp2_biquad_cascade_df1_fast_q15(
  188. const csky_vdsp2_biquad_casd_df1_inst_q15 * S,
  189. q15_t * pSrc,
  190. q15_t * pDst,
  191. uint32_t blockSize);
  192. void csky_vdsp2_biquad_cascade_df1_q31(
  193. const csky_vdsp2_biquad_casd_df1_inst_q31 * S,
  194. q31_t * pSrc,
  195. q31_t * pDst,
  196. uint32_t blockSize);
  197. void csky_vdsp2_biquad_cascade_df1_fast_q31(
  198. const csky_vdsp2_biquad_casd_df1_inst_q31 * S,
  199. q31_t * pSrc,
  200. q31_t * pDst,
  201. uint32_t blockSize);
  202. void csky_vdsp2_biquad_cascade_df1_init_q31(
  203. csky_vdsp2_biquad_casd_df1_inst_q31 * S,
  204. uint8_t numStages,
  205. q31_t * pCoeffs,
  206. q31_t * pState,
  207. int8_t postShift);
  208. void csky_vdsp2_biquad_cascade_df1_f32(
  209. const csky_vdsp2_biquad_casd_df1_inst_f32 * S,
  210. float32_t * pSrc,
  211. float32_t * pDst,
  212. uint32_t blockSize);
  213. void csky_vdsp2_biquad_cascade_df1_init_f32(
  214. csky_vdsp2_biquad_casd_df1_inst_f32 * S,
  215. uint8_t numStages,
  216. float32_t * pCoeffs,
  217. float32_t * pState);
  218. /**
  219. * @brief Instance structure for the floating-point matrix structure.
  220. */
  221. typedef struct
  222. {
  223. uint16_t numRows; /**< number of rows of the matrix. */
  224. uint16_t numCols; /**< number of columns of the matrix. */
  225. float32_t *pData; /**< points to the data of the matrix. */
  226. } csky_vdsp2_matrix_instance_f32;
  227. /**
  228. * @brief Instance structure for the floating-point matrix structure.
  229. */
  230. typedef struct
  231. {
  232. uint16_t numRows; /**< number of rows of the matrix. */
  233. uint16_t numCols; /**< number of columns of the matrix. */
  234. float64_t *pData; /**< points to the data of the matrix. */
  235. } csky_vdsp2_matrix_instance_f64;
  236. /**
  237. * @brief Instance structure for the Q15 matrix structure.
  238. */
  239. typedef struct
  240. {
  241. uint16_t numRows; /**< number of rows of the matrix. */
  242. uint16_t numCols; /**< number of columns of the matrix. */
  243. q15_t *pData; /**< points to the data of the matrix. */
  244. } csky_vdsp2_matrix_instance_q15;
  245. /**
  246. * @brief Instance structure for the Q31 matrix structure.
  247. */
  248. typedef struct
  249. {
  250. uint16_t numRows; /**< number of rows of the matrix. */
  251. uint16_t numCols; /**< number of columns of the matrix. */
  252. q31_t *pData; /**< points to the data of the matrix. */
  253. } csky_vdsp2_matrix_instance_q31;
  254. csky_vdsp2_status csky_vdsp2_mat_add_f32(
  255. const csky_vdsp2_matrix_instance_f32 * pSrcA,
  256. const csky_vdsp2_matrix_instance_f32 * pSrcB,
  257. csky_vdsp2_matrix_instance_f32 * pDst);
  258. csky_vdsp2_status csky_vdsp2_mat_add_q15(
  259. const csky_vdsp2_matrix_instance_q15 * pSrcA,
  260. const csky_vdsp2_matrix_instance_q15 * pSrcB,
  261. csky_vdsp2_matrix_instance_q15 * pDst);
  262. csky_vdsp2_status csky_vdsp2_mat_add_q31(
  263. const csky_vdsp2_matrix_instance_q31 * pSrcA,
  264. const csky_vdsp2_matrix_instance_q31 * pSrcB,
  265. csky_vdsp2_matrix_instance_q31 * pDst);
  266. csky_vdsp2_status csky_vdsp2_mat_cmplx_mult_f32(
  267. const csky_vdsp2_matrix_instance_f32 * pSrcA,
  268. const csky_vdsp2_matrix_instance_f32 * pSrcB,
  269. csky_vdsp2_matrix_instance_f32 * pDst);
  270. csky_vdsp2_status csky_vdsp2_mat_cmplx_mult_q15(
  271. const csky_vdsp2_matrix_instance_q15 * pSrcA,
  272. const csky_vdsp2_matrix_instance_q15 * pSrcB,
  273. csky_vdsp2_matrix_instance_q15 * pDst,
  274. q15_t * pScratch);
  275. csky_vdsp2_status csky_vdsp2_mat_cmplx_mult_q31(
  276. const csky_vdsp2_matrix_instance_q31 * pSrcA,
  277. const csky_vdsp2_matrix_instance_q31 * pSrcB,
  278. csky_vdsp2_matrix_instance_q31 * pDst);
  279. csky_vdsp2_status csky_vdsp2_mat_trans_f32(
  280. const csky_vdsp2_matrix_instance_f32 * pSrc,
  281. csky_vdsp2_matrix_instance_f32 * pDst);
  282. csky_vdsp2_status csky_vdsp2_mat_trans_q15(
  283. const csky_vdsp2_matrix_instance_q15 * pSrc,
  284. csky_vdsp2_matrix_instance_q15 * pDst);
  285. csky_vdsp2_status csky_vdsp2_mat_trans_q31(
  286. const csky_vdsp2_matrix_instance_q31 * pSrc,
  287. csky_vdsp2_matrix_instance_q31 * pDst);
  288. csky_vdsp2_status csky_vdsp2_mat_mult_f32(
  289. const csky_vdsp2_matrix_instance_f32 * pSrcA,
  290. const csky_vdsp2_matrix_instance_f32 * pSrcB,
  291. csky_vdsp2_matrix_instance_f32 * pDst);
  292. csky_vdsp2_status csky_vdsp2_mat_mult_q15(
  293. const csky_vdsp2_matrix_instance_q15 * pSrcA,
  294. const csky_vdsp2_matrix_instance_q15 * pSrcB,
  295. csky_vdsp2_matrix_instance_q15 * pDst,
  296. q15_t * pState);
  297. csky_vdsp2_status csky_vdsp2_mat_mult_trans_q15(
  298. const csky_vdsp2_matrix_instance_q15 * pSrcA,
  299. const csky_vdsp2_matrix_instance_q15 * pSrcB,
  300. csky_vdsp2_matrix_instance_q15 * pDst,
  301. q15_t * pState);
  302. csky_vdsp2_status csky_vdsp2_mat_mult_fast_q15(
  303. const csky_vdsp2_matrix_instance_q15 * pSrcA,
  304. const csky_vdsp2_matrix_instance_q15 * pSrcB,
  305. csky_vdsp2_matrix_instance_q15 * pDst,
  306. q15_t * pState);
  307. csky_vdsp2_status csky_vdsp2_mat_mult_q31(
  308. const csky_vdsp2_matrix_instance_q31 * pSrcA,
  309. const csky_vdsp2_matrix_instance_q31 * pSrcB,
  310. csky_vdsp2_matrix_instance_q31 * pDst);
  311. csky_vdsp2_status csky_vdsp2_mat_mult_trans_q31(
  312. const csky_vdsp2_matrix_instance_q31 * pSrcA,
  313. const csky_vdsp2_matrix_instance_q31 * pSrcB,
  314. csky_vdsp2_matrix_instance_q31 * pDst);
  315. csky_vdsp2_status csky_vdsp2_mat_mult_fast_q31(
  316. const csky_vdsp2_matrix_instance_q31 * pSrcA,
  317. const csky_vdsp2_matrix_instance_q31 * pSrcB,
  318. csky_vdsp2_matrix_instance_q31 * pDst);
  319. csky_vdsp2_status csky_vdsp2_mat_sub_f32(
  320. const csky_vdsp2_matrix_instance_f32 * pSrcA,
  321. const csky_vdsp2_matrix_instance_f32 * pSrcB,
  322. csky_vdsp2_matrix_instance_f32 * pDst);
  323. csky_vdsp2_status csky_vdsp2_mat_sub_q15(
  324. const csky_vdsp2_matrix_instance_q15 * pSrcA,
  325. const csky_vdsp2_matrix_instance_q15 * pSrcB,
  326. csky_vdsp2_matrix_instance_q15 * pDst);
  327. csky_vdsp2_status csky_vdsp2_mat_sub_q31(
  328. const csky_vdsp2_matrix_instance_q31 * pSrcA,
  329. const csky_vdsp2_matrix_instance_q31 * pSrcB,
  330. csky_vdsp2_matrix_instance_q31 * pDst);
  331. csky_vdsp2_status csky_vdsp2_mat_scale_f32(
  332. const csky_vdsp2_matrix_instance_f32 * pSrc,
  333. float32_t scale,
  334. csky_vdsp2_matrix_instance_f32 * pDst);
  335. csky_vdsp2_status csky_vdsp2_mat_scale_q15(
  336. const csky_vdsp2_matrix_instance_q15 * pSrc,
  337. q15_t scaleFract,
  338. int32_t shift,
  339. csky_vdsp2_matrix_instance_q15 * pDst);
  340. csky_vdsp2_status csky_vdsp2_mat_scale_q31(
  341. const csky_vdsp2_matrix_instance_q31 * pSrc,
  342. q31_t scaleFract,
  343. int32_t shift,
  344. csky_vdsp2_matrix_instance_q31 * pDst);
  345. void csky_vdsp2_mat_init_q31(
  346. csky_vdsp2_matrix_instance_q31 * S,
  347. uint16_t nRows,
  348. uint16_t nColumns,
  349. q31_t * pData);
  350. void csky_vdsp2_mat_init_q15(
  351. csky_vdsp2_matrix_instance_q15 * S,
  352. uint16_t nRows,
  353. uint16_t nColumns,
  354. q15_t * pData);
  355. void csky_vdsp2_mat_init_f32(
  356. csky_vdsp2_matrix_instance_f32 * S,
  357. uint16_t nRows,
  358. uint16_t nColumns,
  359. float32_t * pData);
  360. void csky_vdsp2_mult_q7(
  361. q7_t * pSrcA,
  362. q7_t * pSrcB,
  363. q7_t * pDst,
  364. uint32_t blockSize);
  365. void csky_vdsp2_mult_q15(
  366. q15_t * pSrcA,
  367. q15_t * pSrcB,
  368. q15_t * pDst,
  369. uint32_t blockSize);
  370. void csky_vdsp2_mult_rnd_q15(
  371. q15_t * pSrcA,
  372. q15_t * pSrcB,
  373. q15_t * pDst,
  374. uint32_t blockSize);
  375. void csky_vdsp2_mult_q31(
  376. q31_t * pSrcA,
  377. q31_t * pSrcB,
  378. q31_t * pDst,
  379. uint32_t blockSize);
  380. void csky_vdsp2_mult_f32(
  381. float32_t * pSrcA,
  382. float32_t * pSrcB,
  383. float32_t * pDst,
  384. uint32_t blockSize);
  385. /**
  386. * @brief Instance structure for the Q15 CFFT/CIFFT function.
  387. */
  388. typedef struct
  389. {
  390. uint16_t fftLen; /**< length of the FFT. */
  391. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  392. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  393. q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */
  394. uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  395. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  396. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  397. } csky_vdsp2_cfft_radix2_instance_q15;
  398. /**
  399. * @brief Instance structure for the Q15 CFFT/CIFFT function.
  400. */
  401. typedef struct
  402. {
  403. uint16_t fftLen; /**< length of the FFT. */
  404. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  405. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  406. q15_t *pTwiddle; /**< points to the twiddle factor table. */
  407. uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  408. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  409. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  410. } csky_vdsp2_cfft_radix4_instance_q15;
  411. /**
  412. * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function.
  413. */
  414. typedef struct
  415. {
  416. uint16_t fftLen; /**< length of the FFT. */
  417. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  418. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  419. q31_t *pTwiddle; /**< points to the Twiddle factor table. */
  420. uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  421. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  422. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  423. } csky_vdsp2_cfft_radix2_instance_q31;
  424. /**
  425. * @brief Instance structure for the Q31 CFFT/CIFFT function.
  426. */
  427. typedef struct
  428. {
  429. uint16_t fftLen; /**< length of the FFT. */
  430. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  431. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  432. q31_t *pTwiddle; /**< points to the twiddle factor table. */
  433. uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  434. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  435. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  436. } csky_vdsp2_cfft_radix4_instance_q31;
  437. /**
  438. * @brief Instance structure for the floating-point CFFT/CIFFT function.
  439. */
  440. typedef struct
  441. {
  442. uint16_t fftLen; /**< length of the FFT. */
  443. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  444. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  445. float32_t *pTwiddle; /**< points to the Twiddle factor table. */
  446. uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  447. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  448. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  449. float32_t onebyfftLen; /**< value of 1/fftLen. */
  450. } csky_vdsp2_cfft_radix2_instance_f32;
  451. /**
  452. * @brief Instance structure for the floating-point CFFT/CIFFT function.
  453. */
  454. typedef struct
  455. {
  456. uint16_t fftLen; /**< length of the FFT. */
  457. uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */
  458. uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */
  459. float32_t *pTwiddle; /**< points to the Twiddle factor table. */
  460. uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  461. uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  462. uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */
  463. float32_t onebyfftLen; /**< value of 1/fftLen. */
  464. } csky_vdsp2_cfft_radix4_instance_f32;
  465. /**
  466. * @brief Instance structure for the fixed-point CFFT/CIFFT function.
  467. */
  468. typedef struct
  469. {
  470. uint16_t fftLen; /**< length of the FFT. */
  471. const q15_t *pTwiddle; /**< points to the Twiddle factor table. */
  472. const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  473. uint16_t bitRevLength; /**< bit reversal table length. */
  474. } csky_vdsp2_cfft_instance_q15;
  475. void csky_vdsp2_cfft_q15(
  476. const csky_vdsp2_cfft_instance_q15 * S,
  477. q15_t * p1,
  478. uint8_t ifftFlag,
  479. uint8_t bitReverseFlag);
  480. /**
  481. * @brief Instance structure for the fixed-point CFFT/CIFFT function.
  482. */
  483. typedef struct
  484. {
  485. uint16_t fftLen; /**< length of the FFT. */
  486. const q31_t *pTwiddle; /**< points to the Twiddle factor table. */
  487. const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  488. uint16_t bitRevLength; /**< bit reversal table length. */
  489. } csky_vdsp2_cfft_instance_q31;
  490. void csky_vdsp2_cfft_q31(
  491. const csky_vdsp2_cfft_instance_q31 * S,
  492. q31_t * p1,
  493. uint8_t ifftFlag,
  494. uint8_t bitReverseFlag);
  495. /**
  496. * @brief Instance structure for the floating-point CFFT/CIFFT function.
  497. */
  498. typedef struct
  499. {
  500. uint16_t fftLen; /**< length of the FFT. */
  501. const float32_t *pTwiddle; /**< points to the Twiddle factor table. */
  502. const uint16_t *pBitRevTable; /**< points to the bit reversal table. */
  503. uint16_t bitRevLength; /**< bit reversal table length. */
  504. } csky_vdsp2_cfft_instance_f32;
  505. void csky_vdsp2_cfft_f32(
  506. const csky_vdsp2_cfft_instance_f32 * S,
  507. float32_t * p1,
  508. uint8_t ifftFlag,
  509. uint8_t bitReverseFlag);
  510. /**
  511. * @brief Instance structure for the Q15 RFFT/RIFFT function.
  512. */
  513. typedef struct
  514. {
  515. uint32_t fftLenReal; /**< length of the real FFT. */
  516. uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
  517. uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
  518. uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  519. q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
  520. const csky_vdsp2_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */
  521. } csky_vdsp2_rfft_instance_q15;
  522. csky_vdsp2_status csky_vdsp2_rfft_init_q15(
  523. csky_vdsp2_rfft_instance_q15 * S,
  524. uint32_t fftLenReal,
  525. uint32_t ifftFlagR,
  526. uint32_t bitReverseFlag);
  527. void csky_vdsp2_rfft_q15(
  528. const csky_vdsp2_rfft_instance_q15 * S,
  529. q15_t * pSrc,
  530. q15_t * pDst);
  531. /**
  532. * @brief Instance structure for the Q31 RFFT/RIFFT function.
  533. */
  534. typedef struct
  535. {
  536. uint32_t fftLenReal; /**< length of the real FFT. */
  537. uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
  538. uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
  539. uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  540. q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
  541. const csky_vdsp2_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */
  542. } csky_vdsp2_rfft_instance_q31;
  543. csky_vdsp2_status csky_vdsp2_rfft_init_q31(
  544. csky_vdsp2_rfft_instance_q31 * S,
  545. uint32_t fftLenReal,
  546. uint32_t ifftFlagR,
  547. uint32_t bitReverseFlag);
  548. void csky_vdsp2_rfft_q31(
  549. const csky_vdsp2_rfft_instance_q31 * S,
  550. q31_t * pSrc,
  551. q31_t * pDst);
  552. /**
  553. * @brief Instance structure for the floating-point RFFT/RIFFT function.
  554. */
  555. typedef struct
  556. {
  557. uint32_t fftLenReal; /**< length of the real FFT. */
  558. uint16_t fftLenBy2; /**< length of the complex FFT. */
  559. uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */
  560. uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */
  561. uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */
  562. float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */
  563. float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */
  564. csky_vdsp2_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
  565. } csky_vdsp2_rfft_instance_f32;
  566. csky_vdsp2_status csky_vdsp2_rfft_init_f32(
  567. csky_vdsp2_rfft_instance_f32 * S,
  568. csky_vdsp2_cfft_radix4_instance_f32 * S_CFFT,
  569. uint32_t fftLenReal,
  570. uint32_t ifftFlagR,
  571. uint32_t bitReverseFlag);
  572. void csky_vdsp2_rfft_f32(
  573. const csky_vdsp2_rfft_instance_f32 * S,
  574. float32_t * pSrc,
  575. float32_t * pDst);
  576. /**
  577. * @brief Instance structure for the floating-point RFFT/RIFFT function.
  578. */
  579. typedef struct
  580. {
  581. csky_vdsp2_cfft_instance_f32 Sint; /**< Internal CFFT structure. */
  582. uint16_t fftLenRFFT; /**< length of the real sequence */
  583. float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */
  584. } csky_vdsp2_rfft_fast_instance_f32 ;
  585. csky_vdsp2_status csky_vdsp2_rfft_fast_init_f32 (
  586. csky_vdsp2_rfft_fast_instance_f32 * S,
  587. uint16_t fftLen);
  588. void csky_vdsp2_rfft_fast_f32(
  589. csky_vdsp2_rfft_fast_instance_f32 * S,
  590. float32_t * p, float32_t * pOut,
  591. uint8_t ifftFlag);
  592. /**
  593. * @brief Instance structure for the floating-point DCT4/IDCT4 function.
  594. */
  595. typedef struct
  596. {
  597. uint16_t N; /**< length of the DCT4. */
  598. uint16_t Nby2; /**< half of the length of the DCT4. */
  599. float32_t normalize; /**< normalizing factor. */
  600. float32_t *pTwiddle; /**< points to the twiddle factor table. */
  601. float32_t *pCosFactor; /**< points to the cosFactor table. */
  602. csky_vdsp2_rfft_fast_instance_f32 *pRfft; /**< points to the real FFT fast instance. */
  603. csky_vdsp2_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */
  604. } csky_vdsp2_dct4_instance_f32;
  605. csky_vdsp2_status csky_vdsp2_dct4_init_f32(
  606. csky_vdsp2_dct4_instance_f32 * S,
  607. csky_vdsp2_rfft_fast_instance_f32 * S_RFFT,
  608. csky_vdsp2_cfft_radix4_instance_f32 * S_CFFT,
  609. uint16_t N,
  610. uint16_t Nby2,
  611. float32_t normalize);
  612. void csky_vdsp2_dct4_f32(
  613. const csky_vdsp2_dct4_instance_f32 * S,
  614. float32_t * pState,
  615. float32_t * pInlineBuffer);
  616. /**
  617. * @brief Instance structure for the Q31 DCT4/IDCT4 function.
  618. */
  619. typedef struct
  620. {
  621. uint16_t N; /**< length of the DCT4. */
  622. uint16_t Nby2; /**< half of the length of the DCT4. */
  623. q31_t normalize; /**< normalizing factor. */
  624. q31_t *pTwiddle; /**< points to the twiddle factor table. */
  625. q31_t *pCosFactor; /**< points to the cosFactor table. */
  626. csky_vdsp2_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */
  627. csky_vdsp2_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */
  628. } csky_vdsp2_dct4_instance_q31;
  629. csky_vdsp2_status csky_vdsp2_dct4_init_q31(
  630. csky_vdsp2_dct4_instance_q31 * S,
  631. csky_vdsp2_rfft_instance_q31 * S_RFFT,
  632. csky_vdsp2_cfft_radix4_instance_q31 * S_CFFT,
  633. uint16_t N,
  634. uint16_t Nby2,
  635. q31_t normalize);
  636. void csky_vdsp2_dct4_q31(
  637. const csky_vdsp2_dct4_instance_q31 * S,
  638. q31_t * pState,
  639. q31_t * pInlineBuffer);
  640. /**
  641. * @brief Instance structure for the Q15 DCT4/IDCT4 function.
  642. */
  643. typedef struct
  644. {
  645. uint16_t N; /**< length of the DCT4. */
  646. uint16_t Nby2; /**< half of the length of the DCT4. */
  647. q15_t normalize; /**< normalizing factor. */
  648. q15_t *pTwiddle; /**< points to the twiddle factor table. */
  649. q15_t *pCosFactor; /**< points to the cosFactor table. */
  650. csky_vdsp2_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */
  651. csky_vdsp2_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */
  652. } csky_vdsp2_dct4_instance_q15;
  653. csky_vdsp2_status csky_vdsp2_dct4_init_q15(
  654. csky_vdsp2_dct4_instance_q15 * S,
  655. csky_vdsp2_rfft_instance_q15 * S_RFFT,
  656. csky_vdsp2_cfft_radix4_instance_q15 * S_CFFT,
  657. uint16_t N,
  658. uint16_t Nby2,
  659. q15_t normalize);
  660. void csky_vdsp2_dct4_q15(
  661. const csky_vdsp2_dct4_instance_q15 * S,
  662. q15_t * pState,
  663. q15_t * pInlineBuffer);
  664. void csky_vdsp2_add_f32(
  665. float32_t * pSrcA,
  666. float32_t * pSrcB,
  667. float32_t * pDst,
  668. uint32_t blockSize);
  669. void csky_vdsp2_add_q7(
  670. q7_t * pSrcA,
  671. q7_t * pSrcB,
  672. q7_t * pDst,
  673. uint32_t blockSize);
  674. void csky_vdsp2_add_q15(
  675. q15_t * pSrcA,
  676. q15_t * pSrcB,
  677. q15_t * pDst,
  678. uint32_t blockSize);
  679. void csky_vdsp2_add_q31(
  680. q31_t * pSrcA,
  681. q31_t * pSrcB,
  682. q31_t * pDst,
  683. uint32_t blockSize);
  684. void csky_vdsp2_sub_f32(
  685. float32_t * pSrcA,
  686. float32_t * pSrcB,
  687. float32_t * pDst,
  688. uint32_t blockSize);
  689. void csky_vdsp2_sub_q7(
  690. q7_t * pSrcA,
  691. q7_t * pSrcB,
  692. q7_t * pDst,
  693. uint32_t blockSize);
  694. void csky_vdsp2_sub_q15(
  695. q15_t * pSrcA,
  696. q15_t * pSrcB,
  697. q15_t * pDst,
  698. uint32_t blockSize);
  699. void csky_vdsp2_sub_q31(
  700. q31_t * pSrcA,
  701. q31_t * pSrcB,
  702. q31_t * pDst,
  703. uint32_t blockSize);
  704. void csky_vdsp2_scale_f32(
  705. float32_t * pSrc,
  706. float32_t scale,
  707. float32_t * pDst,
  708. uint32_t blockSize);
  709. void csky_vdsp2_scale_q7(
  710. q7_t * pSrc,
  711. q7_t scaleFract,
  712. int8_t shift,
  713. q7_t * pDst,
  714. uint32_t blockSize);
  715. void csky_vdsp2_scale_q15(
  716. q15_t * pSrc,
  717. q15_t scaleFract,
  718. int8_t shift,
  719. q15_t * pDst,
  720. uint32_t blockSize);
  721. void csky_vdsp2_scale_q31(
  722. q31_t * pSrc,
  723. q31_t scaleFract,
  724. int8_t shift,
  725. q31_t * pDst,
  726. uint32_t blockSize);
  727. void csky_vdsp2_abs_q7(
  728. q7_t * pSrc,
  729. q7_t * pDst,
  730. uint32_t blockSize);
  731. void csky_vdsp2_abs_f32(
  732. float32_t * pSrc,
  733. float32_t * pDst,
  734. uint32_t blockSize);
  735. void csky_vdsp2_abs_q15(
  736. q15_t * pSrc,
  737. q15_t * pDst,
  738. uint32_t blockSize);
  739. void csky_vdsp2_abs_q31(
  740. q31_t * pSrc,
  741. q31_t * pDst,
  742. uint32_t blockSize);
  743. void csky_vdsp2_abs_max_q15(
  744. q15_t * pSrc,
  745. q15_t * pDst,
  746. uint32_t blockSize);
  747. void csky_vdsp2_abs_max_q31(
  748. q31_t * pSrc,
  749. q31_t * pDst,
  750. uint32_t blockSize);
  751. void csky_vdsp2_dot_prod_f32(
  752. float32_t * pSrcA,
  753. float32_t * pSrcB,
  754. uint32_t blockSize,
  755. float32_t * result);
  756. void csky_vdsp2_dot_prod_q7(
  757. q7_t * pSrcA,
  758. q7_t * pSrcB,
  759. uint32_t blockSize,
  760. q31_t * result);
  761. void csky_vdsp2_dot_prod_q15(
  762. q15_t * pSrcA,
  763. q15_t * pSrcB,
  764. uint32_t blockSize,
  765. q63_t * result);
  766. void csky_vdsp2_dot_prod_q31(
  767. q31_t * pSrcA,
  768. q31_t * pSrcB,
  769. uint32_t blockSize,
  770. q63_t * result);
  771. void csky_vdsp2_shift_q7(
  772. q7_t * pSrc,
  773. int8_t shiftBits,
  774. q7_t * pDst,
  775. uint32_t blockSize);
  776. void csky_vdsp2_shift_q15(
  777. q15_t * pSrc,
  778. int8_t shiftBits,
  779. q15_t * pDst,
  780. uint32_t blockSize);
  781. void csky_vdsp2_shift_q31(
  782. q31_t * pSrc,
  783. int8_t shiftBits,
  784. q31_t * pDst,
  785. uint32_t blockSize);
  786. void csky_vdsp2_offset_f32(
  787. float32_t * pSrc,
  788. float32_t offset,
  789. float32_t * pDst,
  790. uint32_t blockSize);
  791. void csky_vdsp2_offset_q7(
  792. q7_t * pSrc,
  793. q7_t offset,
  794. q7_t * pDst,
  795. uint32_t blockSize);
  796. void csky_vdsp2_offset_q15(
  797. q15_t * pSrc,
  798. q15_t offset,
  799. q15_t * pDst,
  800. uint32_t blockSize);
  801. void csky_vdsp2_offset_q31(
  802. q31_t * pSrc,
  803. q31_t offset,
  804. q31_t * pDst,
  805. uint32_t blockSize);
  806. void csky_vdsp2_negate_f32(
  807. float32_t * pSrc,
  808. float32_t * pDst,
  809. uint32_t blockSize);
  810. void csky_vdsp2_negate_q7(
  811. q7_t * pSrc,
  812. q7_t * pDst,
  813. uint32_t blockSize);
  814. void csky_vdsp2_negate_q15(
  815. q15_t * pSrc,
  816. q15_t * pDst,
  817. uint32_t blockSize);
  818. void csky_vdsp2_negate_q31(
  819. q31_t * pSrc,
  820. q31_t * pDst,
  821. uint32_t blockSize);
  822. void csky_vdsp2_copy_f32(
  823. float32_t * pSrc,
  824. float32_t * pDst,
  825. uint32_t blockSize);
  826. void csky_vdsp2_copy_q7(
  827. q7_t * pSrc,
  828. q7_t * pDst,
  829. uint32_t blockSize);
  830. void csky_vdsp2_copy_q15(
  831. q15_t * pSrc,
  832. q15_t * pDst,
  833. uint32_t blockSize);
  834. void csky_vdsp2_copy_q31(
  835. q31_t * pSrc,
  836. q31_t * pDst,
  837. uint32_t blockSize);
  838. void csky_vdsp2_fill_f32(
  839. float32_t value,
  840. float32_t * pDst,
  841. uint32_t blockSize);
  842. void csky_vdsp2_fill_q7(
  843. q7_t value,
  844. q7_t * pDst,
  845. uint32_t blockSize);
  846. void csky_vdsp2_fill_q15(
  847. q15_t value,
  848. q15_t * pDst,
  849. uint32_t blockSize);
  850. void csky_vdsp2_fill_q31(
  851. q31_t value,
  852. q31_t * pDst,
  853. uint32_t blockSize);
  854. void csky_vdsp2_conv_f32(
  855. float32_t * pSrcA,
  856. uint32_t srcALen,
  857. float32_t * pSrcB,
  858. uint32_t srcBLen,
  859. float32_t * pDst);
  860. void csky_vdsp2_conv_opt_q15(
  861. q15_t * pSrcA,
  862. uint32_t srcALen,
  863. q15_t * pSrcB,
  864. uint32_t srcBLen,
  865. q15_t * pDst,
  866. q15_t * pScratch1,
  867. q15_t * pScratch2);
  868. void csky_vdsp2_conv_q15(
  869. q15_t * pSrcA,
  870. uint32_t srcALen,
  871. q15_t * pSrcB,
  872. uint32_t srcBLen,
  873. q15_t * pDst);
  874. void csky_vdsp2_conv_fast_q15(
  875. q15_t * pSrcA,
  876. uint32_t srcALen,
  877. q15_t * pSrcB,
  878. uint32_t srcBLen,
  879. q15_t * pDst);
  880. void csky_vdsp2_conv_fast_opt_q15(
  881. q15_t * pSrcA,
  882. uint32_t srcALen,
  883. q15_t * pSrcB,
  884. uint32_t srcBLen,
  885. q15_t * pDst,
  886. q15_t * pScratch1,
  887. q15_t * pScratch2);
  888. void csky_vdsp2_conv_q31(
  889. q31_t * pSrcA,
  890. uint32_t srcALen,
  891. q31_t * pSrcB,
  892. uint32_t srcBLen,
  893. q31_t * pDst);
  894. void csky_vdsp2_conv_fast_q31(
  895. q31_t * pSrcA,
  896. uint32_t srcALen,
  897. q31_t * pSrcB,
  898. uint32_t srcBLen,
  899. q31_t * pDst);
  900. void csky_vdsp2_conv_opt_q7(
  901. q7_t * pSrcA,
  902. uint32_t srcALen,
  903. q7_t * pSrcB,
  904. uint32_t srcBLen,
  905. q7_t * pDst,
  906. q15_t * pScratch1,
  907. q15_t * pScratch2);
  908. void csky_vdsp2_conv_q7(
  909. q7_t * pSrcA,
  910. uint32_t srcALen,
  911. q7_t * pSrcB,
  912. uint32_t srcBLen,
  913. q7_t * pDst);
  914. csky_vdsp2_status csky_vdsp2_conv_partial_f32(
  915. float32_t * pSrcA,
  916. uint32_t srcALen,
  917. float32_t * pSrcB,
  918. uint32_t srcBLen,
  919. float32_t * pDst,
  920. uint32_t firstIndex,
  921. uint32_t numPoints);
  922. csky_vdsp2_status csky_vdsp2_conv_partial_opt_q15(
  923. q15_t * pSrcA,
  924. uint32_t srcALen,
  925. q15_t * pSrcB,
  926. uint32_t srcBLen,
  927. q15_t * pDst,
  928. uint32_t firstIndex,
  929. uint32_t numPoints,
  930. q15_t * pScratch1,
  931. q15_t * pScratch2);
  932. csky_vdsp2_status csky_vdsp2_conv_partial_q15(
  933. q15_t * pSrcA,
  934. uint32_t srcALen,
  935. q15_t * pSrcB,
  936. uint32_t srcBLen,
  937. q15_t * pDst,
  938. uint32_t firstIndex,
  939. uint32_t numPoints);
  940. csky_vdsp2_status csky_vdsp2_conv_partial_fast_q15(
  941. q15_t * pSrcA,
  942. uint32_t srcALen,
  943. q15_t * pSrcB,
  944. uint32_t srcBLen,
  945. q15_t * pDst,
  946. uint32_t firstIndex,
  947. uint32_t numPoints);
  948. csky_vdsp2_status csky_vdsp2_conv_partial_fast_opt_q15(
  949. q15_t * pSrcA,
  950. uint32_t srcALen,
  951. q15_t * pSrcB,
  952. uint32_t srcBLen,
  953. q15_t * pDst,
  954. uint32_t firstIndex,
  955. uint32_t numPoints,
  956. q15_t * pScratch1,
  957. q15_t * pScratch2);
  958. csky_vdsp2_status csky_vdsp2_conv_partial_q31(
  959. q31_t * pSrcA,
  960. uint32_t srcALen,
  961. q31_t * pSrcB,
  962. uint32_t srcBLen,
  963. q31_t * pDst,
  964. uint32_t firstIndex,
  965. uint32_t numPoints);
  966. csky_vdsp2_status csky_vdsp2_conv_partial_fast_q31(
  967. q31_t * pSrcA,
  968. uint32_t srcALen,
  969. q31_t * pSrcB,
  970. uint32_t srcBLen,
  971. q31_t * pDst,
  972. uint32_t firstIndex,
  973. uint32_t numPoints);
  974. csky_vdsp2_status csky_vdsp2_conv_partial_opt_q7(
  975. q7_t * pSrcA,
  976. uint32_t srcALen,
  977. q7_t * pSrcB,
  978. uint32_t srcBLen,
  979. q7_t * pDst,
  980. uint32_t firstIndex,
  981. uint32_t numPoints,
  982. q15_t * pScratch1,
  983. q15_t * pScratch2);
  984. csky_vdsp2_status csky_vdsp2_conv_partial_q7(
  985. q7_t * pSrcA,
  986. uint32_t srcALen,
  987. q7_t * pSrcB,
  988. uint32_t srcBLen,
  989. q7_t * pDst,
  990. uint32_t firstIndex,
  991. uint32_t numPoints);
  992. /**
  993. * @brief Instance structure for the Q15 FIR decimator.
  994. */
  995. typedef struct
  996. {
  997. uint8_t M; /**< decimation factor. */
  998. uint16_t numTaps; /**< number of coefficients in the filter. */
  999. q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  1000. q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1001. } csky_vdsp2_fir_decimate_instance_q15;
  1002. /**
  1003. * @brief Instance structure for the Q31 FIR decimator.
  1004. */
  1005. typedef struct
  1006. {
  1007. uint8_t M; /**< decimation factor. */
  1008. uint16_t numTaps; /**< number of coefficients in the filter. */
  1009. q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  1010. q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1011. } csky_vdsp2_fir_decimate_instance_q31;
  1012. /**
  1013. * @brief Instance structure for the floating-point FIR decimator.
  1014. */
  1015. typedef struct
  1016. {
  1017. uint8_t M; /**< decimation factor. */
  1018. uint16_t numTaps; /**< number of coefficients in the filter. */
  1019. float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  1020. float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1021. } csky_vdsp2_fir_decimate_instance_f32;
  1022. void csky_vdsp2_fir_decimate_f32(
  1023. const csky_vdsp2_fir_decimate_instance_f32 * S,
  1024. float32_t * pSrc,
  1025. float32_t * pDst,
  1026. uint32_t blockSize);
  1027. csky_vdsp2_status csky_vdsp2_fir_decimate_init_f32(
  1028. csky_vdsp2_fir_decimate_instance_f32 * S,
  1029. uint16_t numTaps,
  1030. uint8_t M,
  1031. float32_t * pCoeffs,
  1032. float32_t * pState,
  1033. uint32_t blockSize);
  1034. void csky_vdsp2_fir_decimate_q15(
  1035. const csky_vdsp2_fir_decimate_instance_q15 * S,
  1036. q15_t * pSrc,
  1037. q15_t * pDst,
  1038. uint32_t blockSize);
  1039. void csky_vdsp2_fir_decimate_fast_q15(
  1040. const csky_vdsp2_fir_decimate_instance_q15 * S,
  1041. q15_t * pSrc,
  1042. q15_t * pDst,
  1043. uint32_t blockSize);
  1044. csky_vdsp2_status csky_vdsp2_fir_decimate_init_q15(
  1045. csky_vdsp2_fir_decimate_instance_q15 * S,
  1046. uint16_t numTaps,
  1047. uint8_t M,
  1048. q15_t * pCoeffs,
  1049. q15_t * pState,
  1050. uint32_t blockSize);
  1051. void csky_vdsp2_fir_decimate_q31(
  1052. const csky_vdsp2_fir_decimate_instance_q31 * S,
  1053. q31_t * pSrc,
  1054. q31_t * pDst,
  1055. uint32_t blockSize);
  1056. void csky_vdsp2_fir_decimate_fast_q31(
  1057. csky_vdsp2_fir_decimate_instance_q31 * S,
  1058. q31_t * pSrc,
  1059. q31_t * pDst,
  1060. uint32_t blockSize);
  1061. csky_vdsp2_status csky_vdsp2_fir_decimate_init_q31(
  1062. csky_vdsp2_fir_decimate_instance_q31 * S,
  1063. uint16_t numTaps,
  1064. uint8_t M,
  1065. q31_t * pCoeffs,
  1066. q31_t * pState,
  1067. uint32_t blockSize);
  1068. /**
  1069. * @brief Instance structure for the Q15 FIR interpolator.
  1070. */
  1071. typedef struct
  1072. {
  1073. uint8_t L; /**< upsample factor. */
  1074. uint16_t phaseLength; /**< length of each polyphase filter component. */
  1075. q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
  1076. q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
  1077. } csky_vdsp2_fir_interpolate_instance_q15;
  1078. /**
  1079. * @brief Instance structure for the Q31 FIR interpolator.
  1080. */
  1081. typedef struct
  1082. {
  1083. uint8_t L; /**< upsample factor. */
  1084. uint16_t phaseLength; /**< length of each polyphase filter component. */
  1085. q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
  1086. q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */
  1087. } csky_vdsp2_fir_interpolate_instance_q31;
  1088. /**
  1089. * @brief Instance structure for the floating-point FIR interpolator.
  1090. */
  1091. typedef struct
  1092. {
  1093. uint8_t L; /**< upsample factor. */
  1094. uint16_t phaseLength; /**< length of each polyphase filter component. */
  1095. float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */
  1096. float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */
  1097. } csky_vdsp2_fir_interpolate_instance_f32;
  1098. void csky_vdsp2_fir_interpolate_q15(
  1099. const csky_vdsp2_fir_interpolate_instance_q15 * S,
  1100. q15_t * pSrc,
  1101. q15_t * pDst,
  1102. uint32_t blockSize);
  1103. csky_vdsp2_status csky_vdsp2_fir_interpolate_init_q15(
  1104. csky_vdsp2_fir_interpolate_instance_q15 * S,
  1105. uint8_t L,
  1106. uint16_t numTaps,
  1107. q15_t * pCoeffs,
  1108. q15_t * pState,
  1109. uint32_t blockSize);
  1110. void csky_vdsp2_fir_interpolate_q31(
  1111. const csky_vdsp2_fir_interpolate_instance_q31 * S,
  1112. q31_t * pSrc,
  1113. q31_t * pDst,
  1114. uint32_t blockSize);
  1115. csky_vdsp2_status csky_vdsp2_fir_interpolate_init_q31(
  1116. csky_vdsp2_fir_interpolate_instance_q31 * S,
  1117. uint8_t L,
  1118. uint16_t numTaps,
  1119. q31_t * pCoeffs,
  1120. q31_t * pState,
  1121. uint32_t blockSize);
  1122. void csky_vdsp2_fir_interpolate_f32(
  1123. const csky_vdsp2_fir_interpolate_instance_f32 * S,
  1124. float32_t * pSrc,
  1125. float32_t * pDst,
  1126. uint32_t blockSize);
  1127. csky_vdsp2_status csky_vdsp2_fir_interpolate_init_f32(
  1128. csky_vdsp2_fir_interpolate_instance_f32 * S,
  1129. uint8_t L,
  1130. uint16_t numTaps,
  1131. float32_t * pCoeffs,
  1132. float32_t * pState,
  1133. uint32_t blockSize);
  1134. /**
  1135. * @brief Instance structure for the high precision Q31 Biquad cascade filter.
  1136. */
  1137. typedef struct
  1138. {
  1139. uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
  1140. q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
  1141. q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
  1142. uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */
  1143. } csky_vdsp2_biquad_cas_df1_32x64_ins_q31;
  1144. void csky_vdsp2_biquad_cas_df1_32x64_q31(
  1145. const csky_vdsp2_biquad_cas_df1_32x64_ins_q31 * S,
  1146. q31_t * pSrc,
  1147. q31_t * pDst,
  1148. uint32_t blockSize);
  1149. void csky_vdsp2_biquad_cas_df1_32x64_init_q31(
  1150. csky_vdsp2_biquad_cas_df1_32x64_ins_q31 * S,
  1151. uint8_t numStages,
  1152. q31_t * pCoeffs,
  1153. q63_t * pState,
  1154. uint8_t postShift);
  1155. /**
  1156. * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
  1157. */
  1158. typedef struct
  1159. {
  1160. uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
  1161. float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
  1162. float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
  1163. } csky_vdsp2_biquad_cascade_df2T_instance_f32;
  1164. /**
  1165. * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
  1166. */
  1167. typedef struct
  1168. {
  1169. uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
  1170. float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */
  1171. float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
  1172. } csky_vdsp2_biquad_cascade_stereo_df2T_instance_f32;
  1173. /**
  1174. * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter.
  1175. */
  1176. typedef struct
  1177. {
  1178. uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */
  1179. float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */
  1180. float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */
  1181. } csky_vdsp2_biquad_cascade_df2T_instance_f64;
  1182. void csky_vdsp2_biquad_cascade_df2T_f32(
  1183. const csky_vdsp2_biquad_cascade_df2T_instance_f32 * S,
  1184. float32_t * pSrc,
  1185. float32_t * pDst,
  1186. uint32_t blockSize);
  1187. void csky_vdsp2_biquad_cascade_stereo_df2T_f32(
  1188. const csky_vdsp2_biquad_cascade_stereo_df2T_instance_f32 * S,
  1189. float32_t * pSrc,
  1190. float32_t * pDst,
  1191. uint32_t blockSize);
  1192. void csky_vdsp2_biquad_cascade_df2T_f64(
  1193. const csky_vdsp2_biquad_cascade_df2T_instance_f64 * S,
  1194. float64_t * pSrc,
  1195. float64_t * pDst,
  1196. uint32_t blockSize);
  1197. void csky_vdsp2_biquad_cascade_df2T_init_f32(
  1198. csky_vdsp2_biquad_cascade_df2T_instance_f32 * S,
  1199. uint8_t numStages,
  1200. float32_t * pCoeffs,
  1201. float32_t * pState);
  1202. void csky_vdsp2_biquad_cascade_stereo_df2T_init_f32(
  1203. csky_vdsp2_biquad_cascade_stereo_df2T_instance_f32 * S,
  1204. uint8_t numStages,
  1205. float32_t * pCoeffs,
  1206. float32_t * pState);
  1207. void csky_vdsp2_biquad_cascade_df2T_init_f64(
  1208. csky_vdsp2_biquad_cascade_df2T_instance_f64 * S,
  1209. uint8_t numStages,
  1210. float64_t * pCoeffs,
  1211. float64_t * pState);
  1212. /**
  1213. * @brief Instance structure for the Q15 FIR lattice filter.
  1214. */
  1215. typedef struct
  1216. {
  1217. uint16_t numStages; /**< number of filter stages. */
  1218. q15_t *pState; /**< points to the state variable array. The array is of length numStages. */
  1219. q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
  1220. } csky_vdsp2_fir_lattice_instance_q15;
  1221. /**
  1222. * @brief Instance structure for the Q31 FIR lattice filter.
  1223. */
  1224. typedef struct
  1225. {
  1226. uint16_t numStages; /**< number of filter stages. */
  1227. q31_t *pState; /**< points to the state variable array. The array is of length numStages. */
  1228. q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
  1229. } csky_vdsp2_fir_lattice_instance_q31;
  1230. /**
  1231. * @brief Instance structure for the floating-point FIR lattice filter.
  1232. */
  1233. typedef struct
  1234. {
  1235. uint16_t numStages; /**< number of filter stages. */
  1236. float32_t *pState; /**< points to the state variable array. The array is of length numStages. */
  1237. float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */
  1238. } csky_vdsp2_fir_lattice_instance_f32;
  1239. void csky_vdsp2_fir_lattice_init_q15(
  1240. csky_vdsp2_fir_lattice_instance_q15 * S,
  1241. uint16_t numStages,
  1242. q15_t * pCoeffs,
  1243. q15_t * pState);
  1244. void csky_vdsp2_fir_lattice_q15(
  1245. const csky_vdsp2_fir_lattice_instance_q15 * S,
  1246. q15_t * pSrc,
  1247. q15_t * pDst,
  1248. uint32_t blockSize);
  1249. void csky_vdsp2_fir_lattice_init_q31(
  1250. csky_vdsp2_fir_lattice_instance_q31 * S,
  1251. uint16_t numStages,
  1252. q31_t * pCoeffs,
  1253. q31_t * pState);
  1254. void csky_vdsp2_fir_lattice_q31(
  1255. const csky_vdsp2_fir_lattice_instance_q31 * S,
  1256. q31_t * pSrc,
  1257. q31_t * pDst,
  1258. uint32_t blockSize);
  1259. void csky_vdsp2_fir_lattice_init_f32(
  1260. csky_vdsp2_fir_lattice_instance_f32 * S,
  1261. uint16_t numStages,
  1262. float32_t * pCoeffs,
  1263. float32_t * pState);
  1264. void csky_vdsp2_fir_lattice_f32(
  1265. const csky_vdsp2_fir_lattice_instance_f32 * S,
  1266. float32_t * pSrc,
  1267. float32_t * pDst,
  1268. uint32_t blockSize);
  1269. /**
  1270. * @brief Instance structure for the Q15 IIR lattice filter.
  1271. */
  1272. typedef struct
  1273. {
  1274. uint16_t numStages; /**< number of stages in the filter. */
  1275. q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
  1276. q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
  1277. q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
  1278. } csky_vdsp2_iir_lattice_instance_q15;
  1279. /**
  1280. * @brief Instance structure for the Q31 IIR lattice filter.
  1281. */
  1282. typedef struct
  1283. {
  1284. uint16_t numStages; /**< number of stages in the filter. */
  1285. q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
  1286. q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
  1287. q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
  1288. } csky_vdsp2_iir_lattice_instance_q31;
  1289. /**
  1290. * @brief Instance structure for the floating-point IIR lattice filter.
  1291. */
  1292. typedef struct
  1293. {
  1294. uint16_t numStages; /**< number of stages in the filter. */
  1295. float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */
  1296. float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */
  1297. float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */
  1298. } csky_vdsp2_iir_lattice_instance_f32;
  1299. void csky_vdsp2_iir_lattice_f32(
  1300. const csky_vdsp2_iir_lattice_instance_f32 * S,
  1301. float32_t * pSrc,
  1302. float32_t * pDst,
  1303. uint32_t blockSize);
  1304. void csky_vdsp2_iir_lattice_init_f32(
  1305. csky_vdsp2_iir_lattice_instance_f32 * S,
  1306. uint16_t numStages,
  1307. float32_t * pkCoeffs,
  1308. float32_t * pvCoeffs,
  1309. float32_t * pState,
  1310. uint32_t blockSize);
  1311. void csky_vdsp2_iir_lattice_q31(
  1312. const csky_vdsp2_iir_lattice_instance_q31 * S,
  1313. q31_t * pSrc,
  1314. q31_t * pDst,
  1315. uint32_t blockSize);
  1316. void csky_vdsp2_iir_lattice_init_q31(
  1317. csky_vdsp2_iir_lattice_instance_q31 * S,
  1318. uint16_t numStages,
  1319. q31_t * pkCoeffs,
  1320. q31_t * pvCoeffs,
  1321. q31_t * pState,
  1322. uint32_t blockSize);
  1323. void csky_vdsp2_iir_lattice_q15(
  1324. const csky_vdsp2_iir_lattice_instance_q15 * S,
  1325. q15_t * pSrc,
  1326. q15_t * pDst,
  1327. uint32_t blockSize);
  1328. void csky_vdsp2_iir_lattice_init_q15(
  1329. csky_vdsp2_iir_lattice_instance_q15 * S,
  1330. uint16_t numStages,
  1331. q15_t * pkCoeffs,
  1332. q15_t * pvCoeffs,
  1333. q15_t * pState,
  1334. uint32_t blockSize);
  1335. /**
  1336. * @brief Instance structure for the floating-point LMS filter.
  1337. */
  1338. typedef struct
  1339. {
  1340. uint16_t numTaps; /**< number of coefficients in the filter. */
  1341. float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1342. float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  1343. float32_t mu; /**< step size that controls filter coefficient updates. */
  1344. } csky_vdsp2_lms_instance_f32;
  1345. void csky_vdsp2_lms_f32(
  1346. const csky_vdsp2_lms_instance_f32 * S,
  1347. float32_t * pSrc,
  1348. float32_t * pRef,
  1349. float32_t * pOut,
  1350. float32_t * pErr,
  1351. uint32_t blockSize);
  1352. void csky_vdsp2_lms_init_f32(
  1353. csky_vdsp2_lms_instance_f32 * S,
  1354. uint16_t numTaps,
  1355. float32_t * pCoeffs,
  1356. float32_t * pState,
  1357. float32_t mu,
  1358. uint32_t blockSize);
  1359. /**
  1360. * @brief Instance structure for the Q15 LMS filter.
  1361. */
  1362. typedef struct
  1363. {
  1364. uint16_t numTaps; /**< number of coefficients in the filter. */
  1365. q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1366. q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  1367. q15_t mu; /**< step size that controls filter coefficient updates. */
  1368. uint32_t postShift; /**< bit shift applied to coefficients. */
  1369. } csky_vdsp2_lms_instance_q15;
  1370. void csky_vdsp2_lms_init_q15(
  1371. csky_vdsp2_lms_instance_q15 * S,
  1372. uint16_t numTaps,
  1373. q15_t * pCoeffs,
  1374. q15_t * pState,
  1375. q15_t mu,
  1376. uint32_t blockSize,
  1377. uint32_t postShift);
  1378. void csky_vdsp2_lms_q15(
  1379. const csky_vdsp2_lms_instance_q15 * S,
  1380. q15_t * pSrc,
  1381. q15_t * pRef,
  1382. q15_t * pOut,
  1383. q15_t * pErr,
  1384. uint32_t blockSize);
  1385. /**
  1386. * @brief Instance structure for the Q31 LMS filter.
  1387. */
  1388. typedef struct
  1389. {
  1390. uint16_t numTaps; /**< number of coefficients in the filter. */
  1391. q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1392. q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  1393. q31_t mu; /**< step size that controls filter coefficient updates. */
  1394. uint32_t postShift; /**< bit shift applied to coefficients. */
  1395. } csky_vdsp2_lms_instance_q31;
  1396. void csky_vdsp2_lms_q31(
  1397. const csky_vdsp2_lms_instance_q31 * S,
  1398. q31_t * pSrc,
  1399. q31_t * pRef,
  1400. q31_t * pOut,
  1401. q31_t * pErr,
  1402. uint32_t blockSize);
  1403. void csky_vdsp2_lms_init_q31(
  1404. csky_vdsp2_lms_instance_q31 * S,
  1405. uint16_t numTaps,
  1406. q31_t * pCoeffs,
  1407. q31_t * pState,
  1408. q31_t mu,
  1409. uint32_t blockSize,
  1410. uint32_t postShift);
  1411. /**
  1412. * @brief Instance structure for the floating-point normalized LMS filter.
  1413. */
  1414. typedef struct
  1415. {
  1416. uint16_t numTaps; /**< number of coefficients in the filter. */
  1417. float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1418. float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  1419. float32_t mu; /**< step size that control filter coefficient updates. */
  1420. float32_t energy; /**< saves previous frame energy. */
  1421. float32_t x0; /**< saves previous input sample. */
  1422. } csky_vdsp2_lms_norm_instance_f32;
  1423. void csky_vdsp2_lms_norm_f32(
  1424. csky_vdsp2_lms_norm_instance_f32 * S,
  1425. float32_t * pSrc,
  1426. float32_t * pRef,
  1427. float32_t * pOut,
  1428. float32_t * pErr,
  1429. uint32_t blockSize);
  1430. void csky_vdsp2_lms_norm_init_f32(
  1431. csky_vdsp2_lms_norm_instance_f32 * S,
  1432. uint16_t numTaps,
  1433. float32_t * pCoeffs,
  1434. float32_t * pState,
  1435. float32_t mu,
  1436. uint32_t blockSize);
  1437. /**
  1438. * @brief Instance structure for the Q31 normalized LMS filter.
  1439. */
  1440. typedef struct
  1441. {
  1442. uint16_t numTaps; /**< number of coefficients in the filter. */
  1443. q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1444. q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  1445. q31_t mu; /**< step size that controls filter coefficient updates. */
  1446. uint8_t postShift; /**< bit shift applied to coefficients. */
  1447. q31_t *recipTable; /**< points to the reciprocal initial value table. */
  1448. q31_t energy; /**< saves previous frame energy. */
  1449. q31_t x0; /**< saves previous input sample. */
  1450. } csky_vdsp2_lms_norm_instance_q31;
  1451. void csky_vdsp2_lms_norm_q31(
  1452. csky_vdsp2_lms_norm_instance_q31 * S,
  1453. q31_t * pSrc,
  1454. q31_t * pRef,
  1455. q31_t * pOut,
  1456. q31_t * pErr,
  1457. uint32_t blockSize);
  1458. void csky_vdsp2_lms_norm_init_q31(
  1459. csky_vdsp2_lms_norm_instance_q31 * S,
  1460. uint16_t numTaps,
  1461. q31_t * pCoeffs,
  1462. q31_t * pState,
  1463. q31_t mu,
  1464. uint32_t blockSize,
  1465. uint8_t postShift);
  1466. /**
  1467. * @brief Instance structure for the Q15 normalized LMS filter.
  1468. */
  1469. typedef struct
  1470. {
  1471. uint16_t numTaps; /**< Number of coefficients in the filter. */
  1472. q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */
  1473. q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */
  1474. q15_t mu; /**< step size that controls filter coefficient updates. */
  1475. uint8_t postShift; /**< bit shift applied to coefficients. */
  1476. q15_t *recipTable; /**< Points to the reciprocal initial value table. */
  1477. q15_t energy; /**< saves previous frame energy. */
  1478. q15_t x0; /**< saves previous input sample. */
  1479. } csky_vdsp2_lms_norm_instance_q15;
  1480. void csky_vdsp2_lms_norm_q15(
  1481. csky_vdsp2_lms_norm_instance_q15 * S,
  1482. q15_t * pSrc,
  1483. q15_t * pRef,
  1484. q15_t * pOut,
  1485. q15_t * pErr,
  1486. uint32_t blockSize);
  1487. void csky_vdsp2_lms_norm_init_q15(
  1488. csky_vdsp2_lms_norm_instance_q15 * S,
  1489. uint16_t numTaps,
  1490. q15_t * pCoeffs,
  1491. q15_t * pState,
  1492. q15_t mu,
  1493. uint32_t blockSize,
  1494. uint8_t postShift);
  1495. void csky_vdsp2_correlate_f32(
  1496. float32_t * pSrcA,
  1497. uint32_t srcALen,
  1498. float32_t * pSrcB,
  1499. uint32_t srcBLen,
  1500. float32_t * pDst);
  1501. void csky_vdsp2_correlate_opt_q15(
  1502. q15_t * pSrcA,
  1503. uint32_t srcALen,
  1504. q15_t * pSrcB,
  1505. uint32_t srcBLen,
  1506. q15_t * pDst,
  1507. q15_t * pScratch);
  1508. void csky_vdsp2_correlate_q15(
  1509. q15_t * pSrcA,
  1510. uint32_t srcALen,
  1511. q15_t * pSrcB,
  1512. uint32_t srcBLen,
  1513. q15_t * pDst);
  1514. void csky_vdsp2_correlate_fast_q15(
  1515. q15_t * pSrcA,
  1516. uint32_t srcALen,
  1517. q15_t * pSrcB,
  1518. uint32_t srcBLen,
  1519. q15_t * pDst);
  1520. void csky_vdsp2_correlate_fast_opt_q15(
  1521. q15_t * pSrcA,
  1522. uint32_t srcALen,
  1523. q15_t * pSrcB,
  1524. uint32_t srcBLen,
  1525. q15_t * pDst,
  1526. q15_t * pScratch);
  1527. void csky_vdsp2_correlate_q31(
  1528. q31_t * pSrcA,
  1529. uint32_t srcALen,
  1530. q31_t * pSrcB,
  1531. uint32_t srcBLen,
  1532. q31_t * pDst);
  1533. void csky_vdsp2_correlate_fast_q31(
  1534. q31_t * pSrcA,
  1535. uint32_t srcALen,
  1536. q31_t * pSrcB,
  1537. uint32_t srcBLen,
  1538. q31_t * pDst);
  1539. void csky_vdsp2_correlate_opt_q7(
  1540. q7_t * pSrcA,
  1541. uint32_t srcALen,
  1542. q7_t * pSrcB,
  1543. uint32_t srcBLen,
  1544. q7_t * pDst,
  1545. q15_t * pScratch1,
  1546. q15_t * pScratch2);
  1547. void csky_vdsp2_correlate_q7(
  1548. q7_t * pSrcA,
  1549. uint32_t srcALen,
  1550. q7_t * pSrcB,
  1551. uint32_t srcBLen,
  1552. q7_t * pDst);
  1553. /**
  1554. * @brief Instance structure for the floating-point sparse FIR filter.
  1555. */
  1556. typedef struct
  1557. {
  1558. uint16_t numTaps; /**< number of coefficients in the filter. */
  1559. uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
  1560. float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
  1561. float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  1562. uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
  1563. int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
  1564. } csky_vdsp2_fir_sparse_instance_f32;
  1565. /**
  1566. * @brief Instance structure for the Q31 sparse FIR filter.
  1567. */
  1568. typedef struct
  1569. {
  1570. uint16_t numTaps; /**< number of coefficients in the filter. */
  1571. uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
  1572. q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
  1573. q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  1574. uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
  1575. int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
  1576. } csky_vdsp2_fir_sparse_instance_q31;
  1577. /**
  1578. * @brief Instance structure for the Q15 sparse FIR filter.
  1579. */
  1580. typedef struct
  1581. {
  1582. uint16_t numTaps; /**< number of coefficients in the filter. */
  1583. uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
  1584. q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
  1585. q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  1586. uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
  1587. int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
  1588. } csky_vdsp2_fir_sparse_instance_q15;
  1589. /**
  1590. * @brief Instance structure for the Q7 sparse FIR filter.
  1591. */
  1592. typedef struct
  1593. {
  1594. uint16_t numTaps; /**< number of coefficients in the filter. */
  1595. uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */
  1596. q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */
  1597. q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/
  1598. uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */
  1599. int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */
  1600. } csky_vdsp2_fir_sparse_instance_q7;
  1601. void csky_vdsp2_fir_sparse_f32(
  1602. csky_vdsp2_fir_sparse_instance_f32 * S,
  1603. float32_t * pSrc,
  1604. float32_t * pDst,
  1605. float32_t * pScratchIn,
  1606. uint32_t blockSize);
  1607. void csky_vdsp2_fir_sparse_init_f32(
  1608. csky_vdsp2_fir_sparse_instance_f32 * S,
  1609. uint16_t numTaps,
  1610. float32_t * pCoeffs,
  1611. float32_t * pState,
  1612. int32_t * pTapDelay,
  1613. uint16_t maxDelay,
  1614. uint32_t blockSize);
  1615. void csky_vdsp2_fir_sparse_q31(
  1616. csky_vdsp2_fir_sparse_instance_q31 * S,
  1617. q31_t * pSrc,
  1618. q31_t * pDst,
  1619. q31_t * pScratchIn,
  1620. uint32_t blockSize);
  1621. void csky_vdsp2_fir_sparse_init_q31(
  1622. csky_vdsp2_fir_sparse_instance_q31 * S,
  1623. uint16_t numTaps,
  1624. q31_t * pCoeffs,
  1625. q31_t * pState,
  1626. int32_t * pTapDelay,
  1627. uint16_t maxDelay,
  1628. uint32_t blockSize);
  1629. void csky_vdsp2_fir_sparse_q15(
  1630. csky_vdsp2_fir_sparse_instance_q15 * S,
  1631. q15_t * pSrc,
  1632. q15_t * pDst,
  1633. q15_t * pScratchIn,
  1634. q31_t * pScratchOut,
  1635. uint32_t blockSize);
  1636. void csky_vdsp2_fir_sparse_init_q15(
  1637. csky_vdsp2_fir_sparse_instance_q15 * S,
  1638. uint16_t numTaps,
  1639. q15_t * pCoeffs,
  1640. q15_t * pState,
  1641. int32_t * pTapDelay,
  1642. uint16_t maxDelay,
  1643. uint32_t blockSize);
  1644. void csky_vdsp2_fir_sparse_q7(
  1645. csky_vdsp2_fir_sparse_instance_q7 * S,
  1646. q7_t * pSrc,
  1647. q7_t * pDst,
  1648. q7_t * pScratchIn,
  1649. q31_t * pScratchOut,
  1650. uint32_t blockSize);
  1651. void csky_vdsp2_fir_sparse_init_q7(
  1652. csky_vdsp2_fir_sparse_instance_q7 * S,
  1653. uint16_t numTaps,
  1654. q7_t * pCoeffs,
  1655. q7_t * pState,
  1656. int32_t * pTapDelay,
  1657. uint16_t maxDelay,
  1658. uint32_t blockSize);
  1659. void csky_vdsp2_sin_cos_f32(
  1660. float32_t theta,
  1661. float32_t * pSinVal,
  1662. float32_t * pCosVal);
  1663. void csky_vdsp2_sin_cos_q31(
  1664. q31_t theta,
  1665. q31_t * pSinVal,
  1666. q31_t * pCosVal);
  1667. void csky_vdsp2_cmplx_conj_f32(
  1668. float32_t * pSrc,
  1669. float32_t * pDst,
  1670. uint32_t numSamples);
  1671. void csky_vdsp2_cmplx_conj_q31(
  1672. q31_t * pSrc,
  1673. q31_t * pDst,
  1674. uint32_t numSamples);
  1675. void csky_vdsp2_cmplx_conj_q15(
  1676. q15_t * pSrc,
  1677. q15_t * pDst,
  1678. uint32_t numSamples);
  1679. void csky_vdsp2_cmplx_mag_squared_f32(
  1680. float32_t * pSrc,
  1681. float32_t * pDst,
  1682. uint32_t numSamples);
  1683. void csky_vdsp2_cmplx_mag_squared_q31(
  1684. q31_t * pSrc,
  1685. q31_t * pDst,
  1686. uint32_t numSamples);
  1687. void csky_vdsp2_cmplx_mag_squared_q15(
  1688. q15_t * pSrc,
  1689. q15_t * pDst,
  1690. uint32_t numSamples);
  1691. void csky_vdsp2_vsqrt_q31(
  1692. q31_t * pSrc,
  1693. q31_t * pDst,
  1694. uint32_t numSamples);
  1695. void csky_vdsp2_vsqrt_q15(
  1696. q15_t * pSrc,
  1697. q15_t * pDst,
  1698. uint32_t numSamples);
  1699. void csky_vdsp2_vsqrt_q7(
  1700. q7_t * pSrc,
  1701. q7_t * pDst,
  1702. uint32_t numSamples);
  1703. void csky_vdsp2_q7_to_q31(
  1704. q7_t * pSrc,
  1705. q31_t * pDst,
  1706. uint32_t blockSize);
  1707. void csky_vdsp2_q7_to_q15(
  1708. q7_t * pSrc,
  1709. q15_t * pDst,
  1710. uint32_t blockSize);
  1711. void csky_vdsp2_q7_to_float(
  1712. q7_t * pSrc,
  1713. float32_t * pDst,
  1714. uint32_t blockSize);
  1715. void csky_vdsp2_q31_to_float(
  1716. q31_t * pSrc,
  1717. float32_t * pDst,
  1718. uint32_t blockSize);
  1719. csky_vdsp2_status csky_vdsp2_sqrt_f32(
  1720. float32_t in,
  1721. float32_t * pOut);
  1722. csky_vdsp2_status csky_vdsp2_sqrt_q31(
  1723. q31_t in,
  1724. q31_t * pOut);
  1725. csky_vdsp2_status csky_vdsp2_sqrt_q15(
  1726. q15_t in,
  1727. q15_t * pOut);
  1728. void csky_vdsp2_power_q31(
  1729. q31_t * pSrc,
  1730. uint32_t blockSize,
  1731. q63_t * pResult);
  1732. void csky_vdsp2_power_int32(
  1733. int32_t * pSrc,
  1734. uint32_t blockSize,
  1735. q63_t * pResult);
  1736. void csky_vdsp2_power_int32(
  1737. int32_t * pSrc,
  1738. uint32_t blockSize,
  1739. q63_t * pResult);
  1740. void csky_vdsp2_power_f32(
  1741. float32_t * pSrc,
  1742. uint32_t blockSize,
  1743. float32_t * pResult);
  1744. void csky_vdsp2_power_q15(
  1745. q15_t * pSrc,
  1746. uint32_t blockSize,
  1747. q63_t * pResult);
  1748. void csky_vdsp2_power_q7(
  1749. q7_t * pSrc,
  1750. uint32_t blockSize,
  1751. q31_t * pResult);
  1752. void csky_vdsp2_mean_q7(
  1753. q7_t * pSrc,
  1754. uint32_t blockSize,
  1755. q7_t * pResult);
  1756. void csky_vdsp2_mean_q15(
  1757. q15_t * pSrc,
  1758. uint32_t blockSize,
  1759. q15_t * pResult);
  1760. void csky_vdsp2_mean_q31(
  1761. q31_t * pSrc,
  1762. uint32_t blockSize,
  1763. q31_t * pResult);
  1764. void csky_vdsp2_mean_f32(
  1765. float32_t * pSrc,
  1766. uint32_t blockSize,
  1767. float32_t * pResult);
  1768. void csky_vdsp2_var_f32(
  1769. float32_t * pSrc,
  1770. uint32_t blockSize,
  1771. float32_t * pResult);
  1772. void csky_vdsp2_var_q31(
  1773. q31_t * pSrc,
  1774. uint32_t blockSize,
  1775. q31_t * pResult);
  1776. void csky_vdsp2_var_q15(
  1777. q15_t * pSrc,
  1778. uint32_t blockSize,
  1779. q15_t * pResult);
  1780. void csky_vdsp2_rms_f32(
  1781. float32_t * pSrc,
  1782. uint32_t blockSize,
  1783. float32_t * pResult);
  1784. void csky_vdsp2_rms_q31(
  1785. q31_t * pSrc,
  1786. uint32_t blockSize,
  1787. q31_t * pResult);
  1788. void csky_vdsp2_rms_q15(
  1789. q15_t * pSrc,
  1790. uint32_t blockSize,
  1791. q15_t * pResult);
  1792. void csky_vdsp2_std_f32(
  1793. float32_t * pSrc,
  1794. uint32_t blockSize,
  1795. float32_t * pResult);
  1796. void csky_vdsp2_std_q31(
  1797. q31_t * pSrc,
  1798. uint32_t blockSize,
  1799. q31_t * pResult);
  1800. void csky_vdsp2_std_q15(
  1801. q15_t * pSrc,
  1802. uint32_t blockSize,
  1803. q15_t * pResult);
  1804. void csky_vdsp2_cmplx_mag_f32(
  1805. float32_t * pSrc,
  1806. float32_t * pDst,
  1807. uint32_t numSamples);
  1808. void csky_vdsp2_cmplx_mag_q31(
  1809. q31_t * pSrc,
  1810. q31_t * pDst,
  1811. uint32_t numSamples);
  1812. void csky_vdsp2_cmplx_mag_q15(
  1813. q15_t * pSrc,
  1814. q15_t * pDst,
  1815. uint32_t numSamples);
  1816. void csky_vdsp2_cmplx_dot_prod_q15(
  1817. q15_t * pSrcA,
  1818. q15_t * pSrcB,
  1819. uint32_t numSamples,
  1820. q31_t * realResult,
  1821. q31_t * imagResult);
  1822. void csky_vdsp2_cmplx_dot_prod_q31(
  1823. q31_t * pSrcA,
  1824. q31_t * pSrcB,
  1825. uint32_t numSamples,
  1826. q63_t * realResult,
  1827. q63_t * imagResult);
  1828. void csky_vdsp2_cmplx_dot_prod_f32(
  1829. float32_t * pSrcA,
  1830. float32_t * pSrcB,
  1831. uint32_t numSamples,
  1832. float32_t * realResult,
  1833. float32_t * imagResult);
  1834. void csky_vdsp2_cmplx_mult_real_q15(
  1835. q15_t * pSrcCmplx,
  1836. q15_t * pSrcReal,
  1837. q15_t * pCmplxDst,
  1838. uint32_t numSamples);
  1839. void csky_vdsp2_cmplx_mult_real_q31(
  1840. q31_t * pSrcCmplx,
  1841. q31_t * pSrcReal,
  1842. q31_t * pCmplxDst,
  1843. uint32_t numSamples);
  1844. void csky_vdsp2_cmplx_mult_real_f32(
  1845. float32_t * pSrcCmplx,
  1846. float32_t * pSrcReal,
  1847. float32_t * pCmplxDst,
  1848. uint32_t numSamples);
  1849. void csky_vdsp2_min_q7(
  1850. q7_t * pSrc,
  1851. uint32_t blockSize,
  1852. q7_t * result,
  1853. uint32_t * index);
  1854. void csky_vdsp2_min_q15(
  1855. q15_t * pSrc,
  1856. uint32_t blockSize,
  1857. q15_t * pResult,
  1858. uint32_t * pIndex);
  1859. void csky_vdsp2_min_q31(
  1860. q31_t * pSrc,
  1861. uint32_t blockSize,
  1862. q31_t * pResult,
  1863. uint32_t * pIndex);
  1864. void csky_vdsp2_min_f32(
  1865. float32_t * pSrc,
  1866. uint32_t blockSize,
  1867. float32_t * pResult,
  1868. uint32_t * pIndex);
  1869. void csky_vdsp2_max_q7(
  1870. q7_t * pSrc,
  1871. uint32_t blockSize,
  1872. q7_t * pResult,
  1873. uint32_t * pIndex);
  1874. void csky_vdsp2_max_q15(
  1875. q15_t * pSrc,
  1876. uint32_t blockSize,
  1877. q15_t * pResult,
  1878. uint32_t * pIndex);
  1879. void csky_vdsp2_max_q31(
  1880. q31_t * pSrc,
  1881. uint32_t blockSize,
  1882. q31_t * pResult,
  1883. uint32_t * pIndex);
  1884. void csky_vdsp2_max_f32(
  1885. float32_t * pSrc,
  1886. uint32_t blockSize,
  1887. float32_t * pResult,
  1888. uint32_t * pIndex);
  1889. void csky_vdsp2_cmplx_mult_cmplx_q15(
  1890. q15_t * pSrcA,
  1891. q15_t * pSrcB,
  1892. q15_t * pDst,
  1893. uint32_t numSamples);
  1894. void csky_vdsp2_cmplx_mult_cmplx_q31(
  1895. q31_t * pSrcA,
  1896. q31_t * pSrcB,
  1897. q31_t * pDst,
  1898. uint32_t numSamples);
  1899. void csky_vdsp2_cmplx_mult_cmplx_f32(
  1900. float32_t * pSrcA,
  1901. float32_t * pSrcB,
  1902. float32_t * pDst,
  1903. uint32_t numSamples);
  1904. void csky_vdsp2_cmplx_mult_cmplx_re_q15(
  1905. q15_t * pSrcA,
  1906. q15_t * pSrcB,
  1907. q15_t * pDst,
  1908. uint32_t numSamples);
  1909. void csky_vdsp2_cmplx_mult_cmplx_re_q31(
  1910. q31_t * pSrcA,
  1911. q31_t * pSrcB,
  1912. q31_t * pDst,
  1913. uint32_t numSamples);
  1914. void csky_vdsp2_cmplx_mult_cmplx_re_f32(
  1915. float32_t * pSrcA,
  1916. float32_t * pSrcB,
  1917. float32_t * pDst,
  1918. uint32_t numSamples);
  1919. void csky_vdsp2_float_to_q31(
  1920. float32_t * pSrc,
  1921. q31_t * pDst,
  1922. uint32_t blockSize);
  1923. void csky_vdsp2_float_to_q15(
  1924. float32_t * pSrc,
  1925. q15_t * pDst,
  1926. uint32_t blockSize);
  1927. void csky_vdsp2_float_to_q7(
  1928. float32_t * pSrc,
  1929. q7_t * pDst,
  1930. uint32_t blockSize);
  1931. void csky_vdsp2_q31_to_q15(
  1932. q31_t * pSrc,
  1933. q15_t * pDst,
  1934. uint32_t blockSize);
  1935. void csky_vdsp2_q31_to_q7(
  1936. q31_t * pSrc,
  1937. q7_t * pDst,
  1938. uint32_t blockSize);
  1939. void csky_vdsp2_q15_to_float(
  1940. q15_t * pSrc,
  1941. float32_t * pDst,
  1942. uint32_t blockSize);
  1943. void csky_vdsp2_q15_to_q31(
  1944. q15_t * pSrc,
  1945. q31_t * pDst,
  1946. uint32_t blockSize);
  1947. void csky_vdsp2_q15_to_q7(
  1948. q15_t * pSrc,
  1949. q7_t * pDst,
  1950. uint32_t blockSize);
  1951. #endif /* _CSKY_VDSP2_MATH_H */
  1952. /**
  1953. *
  1954. * End of file.
  1955. */