You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

505 lines
16 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. /*
  11. * This file contains the resampling functions for 22 kHz.
  12. * The description header can be found in signal_processing_library.h
  13. *
  14. */
  15. #include "common_audio/signal_processing/include/signal_processing_library.h"
  16. #include "common_audio/signal_processing/resample_by_2_internal.h"
  17. // Declaration of internally used functions
  18. static void WebRtcSpl_32khzTo22khzIntToShort(const int32_t *In, int16_t *Out,
  19. int32_t K);
  20. void WebRtcSpl_32khzTo22khzIntToInt(const int32_t *In, int32_t *Out,
  21. int32_t K);
  22. // interpolation coefficients
  23. static const int16_t kCoefficients32To22[5][9] = {
  24. {127, -712, 2359, -6333, 23456, 16775, -3695, 945, -154},
  25. {-39, 230, -830, 2785, 32366, -2324, 760, -218, 38},
  26. {117, -663, 2222, -6133, 26634, 13070, -3174, 831, -137},
  27. {-77, 457, -1677, 5958, 31175, -4136, 1405, -408, 71},
  28. { 98, -560, 1900, -5406, 29240, 9423, -2480, 663, -110}
  29. };
  30. //////////////////////
  31. // 22 kHz -> 16 kHz //
  32. //////////////////////
  33. // number of subblocks; options: 1, 2, 4, 5, 10
  34. #define SUB_BLOCKS_22_16 5
  35. // 22 -> 16 resampler
  36. void WebRtcSpl_Resample22khzTo16khz(const int16_t* in, int16_t* out,
  37. WebRtcSpl_State22khzTo16khz* state, int32_t* tmpmem)
  38. {
  39. int k;
  40. // process two blocks of 10/SUB_BLOCKS_22_16 ms (to reduce temp buffer size)
  41. for (k = 0; k < SUB_BLOCKS_22_16; k++)
  42. {
  43. ///// 22 --> 44 /////
  44. // int16_t in[220/SUB_BLOCKS_22_16]
  45. // int32_t out[440/SUB_BLOCKS_22_16]
  46. /////
  47. WebRtcSpl_UpBy2ShortToInt(in, 220 / SUB_BLOCKS_22_16, tmpmem + 16, state->S_22_44);
  48. ///// 44 --> 32 /////
  49. // int32_t in[440/SUB_BLOCKS_22_16]
  50. // int32_t out[320/SUB_BLOCKS_22_16]
  51. /////
  52. // copy state to and from input array
  53. tmpmem[8] = state->S_44_32[0];
  54. tmpmem[9] = state->S_44_32[1];
  55. tmpmem[10] = state->S_44_32[2];
  56. tmpmem[11] = state->S_44_32[3];
  57. tmpmem[12] = state->S_44_32[4];
  58. tmpmem[13] = state->S_44_32[5];
  59. tmpmem[14] = state->S_44_32[6];
  60. tmpmem[15] = state->S_44_32[7];
  61. state->S_44_32[0] = tmpmem[440 / SUB_BLOCKS_22_16 + 8];
  62. state->S_44_32[1] = tmpmem[440 / SUB_BLOCKS_22_16 + 9];
  63. state->S_44_32[2] = tmpmem[440 / SUB_BLOCKS_22_16 + 10];
  64. state->S_44_32[3] = tmpmem[440 / SUB_BLOCKS_22_16 + 11];
  65. state->S_44_32[4] = tmpmem[440 / SUB_BLOCKS_22_16 + 12];
  66. state->S_44_32[5] = tmpmem[440 / SUB_BLOCKS_22_16 + 13];
  67. state->S_44_32[6] = tmpmem[440 / SUB_BLOCKS_22_16 + 14];
  68. state->S_44_32[7] = tmpmem[440 / SUB_BLOCKS_22_16 + 15];
  69. WebRtcSpl_Resample44khzTo32khz(tmpmem + 8, tmpmem, 40 / SUB_BLOCKS_22_16);
  70. ///// 32 --> 16 /////
  71. // int32_t in[320/SUB_BLOCKS_22_16]
  72. // int32_t out[160/SUB_BLOCKS_22_16]
  73. /////
  74. WebRtcSpl_DownBy2IntToShort(tmpmem, 320 / SUB_BLOCKS_22_16, out, state->S_32_16);
  75. // move input/output pointers 10/SUB_BLOCKS_22_16 ms seconds ahead
  76. in += 220 / SUB_BLOCKS_22_16;
  77. out += 160 / SUB_BLOCKS_22_16;
  78. }
  79. }
  80. // initialize state of 22 -> 16 resampler
  81. void WebRtcSpl_ResetResample22khzTo16khz(WebRtcSpl_State22khzTo16khz* state)
  82. {
  83. int k;
  84. for (k = 0; k < 8; k++)
  85. {
  86. state->S_22_44[k] = 0;
  87. state->S_44_32[k] = 0;
  88. state->S_32_16[k] = 0;
  89. }
  90. }
  91. //////////////////////
  92. // 16 kHz -> 22 kHz //
  93. //////////////////////
  94. // number of subblocks; options: 1, 2, 4, 5, 10
  95. #define SUB_BLOCKS_16_22 4
  96. // 16 -> 22 resampler
  97. void WebRtcSpl_Resample16khzTo22khz(const int16_t* in, int16_t* out,
  98. WebRtcSpl_State16khzTo22khz* state, int32_t* tmpmem)
  99. {
  100. int k;
  101. // process two blocks of 10/SUB_BLOCKS_16_22 ms (to reduce temp buffer size)
  102. for (k = 0; k < SUB_BLOCKS_16_22; k++)
  103. {
  104. ///// 16 --> 32 /////
  105. // int16_t in[160/SUB_BLOCKS_16_22]
  106. // int32_t out[320/SUB_BLOCKS_16_22]
  107. /////
  108. WebRtcSpl_UpBy2ShortToInt(in, 160 / SUB_BLOCKS_16_22, tmpmem + 8, state->S_16_32);
  109. ///// 32 --> 22 /////
  110. // int32_t in[320/SUB_BLOCKS_16_22]
  111. // int32_t out[220/SUB_BLOCKS_16_22]
  112. /////
  113. // copy state to and from input array
  114. tmpmem[0] = state->S_32_22[0];
  115. tmpmem[1] = state->S_32_22[1];
  116. tmpmem[2] = state->S_32_22[2];
  117. tmpmem[3] = state->S_32_22[3];
  118. tmpmem[4] = state->S_32_22[4];
  119. tmpmem[5] = state->S_32_22[5];
  120. tmpmem[6] = state->S_32_22[6];
  121. tmpmem[7] = state->S_32_22[7];
  122. state->S_32_22[0] = tmpmem[320 / SUB_BLOCKS_16_22];
  123. state->S_32_22[1] = tmpmem[320 / SUB_BLOCKS_16_22 + 1];
  124. state->S_32_22[2] = tmpmem[320 / SUB_BLOCKS_16_22 + 2];
  125. state->S_32_22[3] = tmpmem[320 / SUB_BLOCKS_16_22 + 3];
  126. state->S_32_22[4] = tmpmem[320 / SUB_BLOCKS_16_22 + 4];
  127. state->S_32_22[5] = tmpmem[320 / SUB_BLOCKS_16_22 + 5];
  128. state->S_32_22[6] = tmpmem[320 / SUB_BLOCKS_16_22 + 6];
  129. state->S_32_22[7] = tmpmem[320 / SUB_BLOCKS_16_22 + 7];
  130. WebRtcSpl_32khzTo22khzIntToShort(tmpmem, out, 20 / SUB_BLOCKS_16_22);
  131. // move input/output pointers 10/SUB_BLOCKS_16_22 ms seconds ahead
  132. in += 160 / SUB_BLOCKS_16_22;
  133. out += 220 / SUB_BLOCKS_16_22;
  134. }
  135. }
  136. // initialize state of 16 -> 22 resampler
  137. void WebRtcSpl_ResetResample16khzTo22khz(WebRtcSpl_State16khzTo22khz* state)
  138. {
  139. int k;
  140. for (k = 0; k < 8; k++)
  141. {
  142. state->S_16_32[k] = 0;
  143. state->S_32_22[k] = 0;
  144. }
  145. }
  146. //////////////////////
  147. // 22 kHz -> 8 kHz //
  148. //////////////////////
  149. // number of subblocks; options: 1, 2, 5, 10
  150. #define SUB_BLOCKS_22_8 2
  151. // 22 -> 8 resampler
  152. void WebRtcSpl_Resample22khzTo8khz(const int16_t* in, int16_t* out,
  153. WebRtcSpl_State22khzTo8khz* state, int32_t* tmpmem)
  154. {
  155. int k;
  156. // process two blocks of 10/SUB_BLOCKS_22_8 ms (to reduce temp buffer size)
  157. for (k = 0; k < SUB_BLOCKS_22_8; k++)
  158. {
  159. ///// 22 --> 22 lowpass /////
  160. // int16_t in[220/SUB_BLOCKS_22_8]
  161. // int32_t out[220/SUB_BLOCKS_22_8]
  162. /////
  163. WebRtcSpl_LPBy2ShortToInt(in, 220 / SUB_BLOCKS_22_8, tmpmem + 16, state->S_22_22);
  164. ///// 22 --> 16 /////
  165. // int32_t in[220/SUB_BLOCKS_22_8]
  166. // int32_t out[160/SUB_BLOCKS_22_8]
  167. /////
  168. // copy state to and from input array
  169. tmpmem[8] = state->S_22_16[0];
  170. tmpmem[9] = state->S_22_16[1];
  171. tmpmem[10] = state->S_22_16[2];
  172. tmpmem[11] = state->S_22_16[3];
  173. tmpmem[12] = state->S_22_16[4];
  174. tmpmem[13] = state->S_22_16[5];
  175. tmpmem[14] = state->S_22_16[6];
  176. tmpmem[15] = state->S_22_16[7];
  177. state->S_22_16[0] = tmpmem[220 / SUB_BLOCKS_22_8 + 8];
  178. state->S_22_16[1] = tmpmem[220 / SUB_BLOCKS_22_8 + 9];
  179. state->S_22_16[2] = tmpmem[220 / SUB_BLOCKS_22_8 + 10];
  180. state->S_22_16[3] = tmpmem[220 / SUB_BLOCKS_22_8 + 11];
  181. state->S_22_16[4] = tmpmem[220 / SUB_BLOCKS_22_8 + 12];
  182. state->S_22_16[5] = tmpmem[220 / SUB_BLOCKS_22_8 + 13];
  183. state->S_22_16[6] = tmpmem[220 / SUB_BLOCKS_22_8 + 14];
  184. state->S_22_16[7] = tmpmem[220 / SUB_BLOCKS_22_8 + 15];
  185. WebRtcSpl_Resample44khzTo32khz(tmpmem + 8, tmpmem, 20 / SUB_BLOCKS_22_8);
  186. ///// 16 --> 8 /////
  187. // int32_t in[160/SUB_BLOCKS_22_8]
  188. // int32_t out[80/SUB_BLOCKS_22_8]
  189. /////
  190. WebRtcSpl_DownBy2IntToShort(tmpmem, 160 / SUB_BLOCKS_22_8, out, state->S_16_8);
  191. // move input/output pointers 10/SUB_BLOCKS_22_8 ms seconds ahead
  192. in += 220 / SUB_BLOCKS_22_8;
  193. out += 80 / SUB_BLOCKS_22_8;
  194. }
  195. }
  196. // initialize state of 22 -> 8 resampler
  197. void WebRtcSpl_ResetResample22khzTo8khz(WebRtcSpl_State22khzTo8khz* state)
  198. {
  199. int k;
  200. for (k = 0; k < 8; k++)
  201. {
  202. state->S_22_22[k] = 0;
  203. state->S_22_22[k + 8] = 0;
  204. state->S_22_16[k] = 0;
  205. state->S_16_8[k] = 0;
  206. }
  207. }
  208. //////////////////////
  209. // 8 kHz -> 22 kHz //
  210. //////////////////////
  211. // number of subblocks; options: 1, 2, 5, 10
  212. #define SUB_BLOCKS_8_22 2
  213. // 8 -> 22 resampler
  214. void WebRtcSpl_Resample8khzTo22khz(const int16_t* in, int16_t* out,
  215. WebRtcSpl_State8khzTo22khz* state, int32_t* tmpmem)
  216. {
  217. int k;
  218. // process two blocks of 10/SUB_BLOCKS_8_22 ms (to reduce temp buffer size)
  219. for (k = 0; k < SUB_BLOCKS_8_22; k++)
  220. {
  221. ///// 8 --> 16 /////
  222. // int16_t in[80/SUB_BLOCKS_8_22]
  223. // int32_t out[160/SUB_BLOCKS_8_22]
  224. /////
  225. WebRtcSpl_UpBy2ShortToInt(in, 80 / SUB_BLOCKS_8_22, tmpmem + 18, state->S_8_16);
  226. ///// 16 --> 11 /////
  227. // int32_t in[160/SUB_BLOCKS_8_22]
  228. // int32_t out[110/SUB_BLOCKS_8_22]
  229. /////
  230. // copy state to and from input array
  231. tmpmem[10] = state->S_16_11[0];
  232. tmpmem[11] = state->S_16_11[1];
  233. tmpmem[12] = state->S_16_11[2];
  234. tmpmem[13] = state->S_16_11[3];
  235. tmpmem[14] = state->S_16_11[4];
  236. tmpmem[15] = state->S_16_11[5];
  237. tmpmem[16] = state->S_16_11[6];
  238. tmpmem[17] = state->S_16_11[7];
  239. state->S_16_11[0] = tmpmem[160 / SUB_BLOCKS_8_22 + 10];
  240. state->S_16_11[1] = tmpmem[160 / SUB_BLOCKS_8_22 + 11];
  241. state->S_16_11[2] = tmpmem[160 / SUB_BLOCKS_8_22 + 12];
  242. state->S_16_11[3] = tmpmem[160 / SUB_BLOCKS_8_22 + 13];
  243. state->S_16_11[4] = tmpmem[160 / SUB_BLOCKS_8_22 + 14];
  244. state->S_16_11[5] = tmpmem[160 / SUB_BLOCKS_8_22 + 15];
  245. state->S_16_11[6] = tmpmem[160 / SUB_BLOCKS_8_22 + 16];
  246. state->S_16_11[7] = tmpmem[160 / SUB_BLOCKS_8_22 + 17];
  247. WebRtcSpl_32khzTo22khzIntToInt(tmpmem + 10, tmpmem, 10 / SUB_BLOCKS_8_22);
  248. ///// 11 --> 22 /////
  249. // int32_t in[110/SUB_BLOCKS_8_22]
  250. // int16_t out[220/SUB_BLOCKS_8_22]
  251. /////
  252. WebRtcSpl_UpBy2IntToShort(tmpmem, 110 / SUB_BLOCKS_8_22, out, state->S_11_22);
  253. // move input/output pointers 10/SUB_BLOCKS_8_22 ms seconds ahead
  254. in += 80 / SUB_BLOCKS_8_22;
  255. out += 220 / SUB_BLOCKS_8_22;
  256. }
  257. }
  258. // initialize state of 8 -> 22 resampler
  259. void WebRtcSpl_ResetResample8khzTo22khz(WebRtcSpl_State8khzTo22khz* state)
  260. {
  261. int k;
  262. for (k = 0; k < 8; k++)
  263. {
  264. state->S_8_16[k] = 0;
  265. state->S_16_11[k] = 0;
  266. state->S_11_22[k] = 0;
  267. }
  268. }
  269. // compute two inner-products and store them to output array
  270. static void WebRtcSpl_DotProdIntToInt(const int32_t* in1, const int32_t* in2,
  271. const int16_t* coef_ptr, int32_t* out1,
  272. int32_t* out2)
  273. {
  274. int32_t tmp1 = 16384;
  275. int32_t tmp2 = 16384;
  276. int16_t coef;
  277. coef = coef_ptr[0];
  278. tmp1 += coef * in1[0];
  279. tmp2 += coef * in2[-0];
  280. coef = coef_ptr[1];
  281. tmp1 += coef * in1[1];
  282. tmp2 += coef * in2[-1];
  283. coef = coef_ptr[2];
  284. tmp1 += coef * in1[2];
  285. tmp2 += coef * in2[-2];
  286. coef = coef_ptr[3];
  287. tmp1 += coef * in1[3];
  288. tmp2 += coef * in2[-3];
  289. coef = coef_ptr[4];
  290. tmp1 += coef * in1[4];
  291. tmp2 += coef * in2[-4];
  292. coef = coef_ptr[5];
  293. tmp1 += coef * in1[5];
  294. tmp2 += coef * in2[-5];
  295. coef = coef_ptr[6];
  296. tmp1 += coef * in1[6];
  297. tmp2 += coef * in2[-6];
  298. coef = coef_ptr[7];
  299. tmp1 += coef * in1[7];
  300. tmp2 += coef * in2[-7];
  301. coef = coef_ptr[8];
  302. *out1 = tmp1 + coef * in1[8];
  303. *out2 = tmp2 + coef * in2[-8];
  304. }
  305. // compute two inner-products and store them to output array
  306. static void WebRtcSpl_DotProdIntToShort(const int32_t* in1, const int32_t* in2,
  307. const int16_t* coef_ptr, int16_t* out1,
  308. int16_t* out2)
  309. {
  310. int32_t tmp1 = 16384;
  311. int32_t tmp2 = 16384;
  312. int16_t coef;
  313. coef = coef_ptr[0];
  314. tmp1 += coef * in1[0];
  315. tmp2 += coef * in2[-0];
  316. coef = coef_ptr[1];
  317. tmp1 += coef * in1[1];
  318. tmp2 += coef * in2[-1];
  319. coef = coef_ptr[2];
  320. tmp1 += coef * in1[2];
  321. tmp2 += coef * in2[-2];
  322. coef = coef_ptr[3];
  323. tmp1 += coef * in1[3];
  324. tmp2 += coef * in2[-3];
  325. coef = coef_ptr[4];
  326. tmp1 += coef * in1[4];
  327. tmp2 += coef * in2[-4];
  328. coef = coef_ptr[5];
  329. tmp1 += coef * in1[5];
  330. tmp2 += coef * in2[-5];
  331. coef = coef_ptr[6];
  332. tmp1 += coef * in1[6];
  333. tmp2 += coef * in2[-6];
  334. coef = coef_ptr[7];
  335. tmp1 += coef * in1[7];
  336. tmp2 += coef * in2[-7];
  337. coef = coef_ptr[8];
  338. tmp1 += coef * in1[8];
  339. tmp2 += coef * in2[-8];
  340. // scale down, round and saturate
  341. tmp1 >>= 15;
  342. if (tmp1 > (int32_t)0x00007FFF)
  343. tmp1 = 0x00007FFF;
  344. if (tmp1 < (int32_t)0xFFFF8000)
  345. tmp1 = 0xFFFF8000;
  346. tmp2 >>= 15;
  347. if (tmp2 > (int32_t)0x00007FFF)
  348. tmp2 = 0x00007FFF;
  349. if (tmp2 < (int32_t)0xFFFF8000)
  350. tmp2 = 0xFFFF8000;
  351. *out1 = (int16_t)tmp1;
  352. *out2 = (int16_t)tmp2;
  353. }
  354. // Resampling ratio: 11/16
  355. // input: int32_t (normalized, not saturated) :: size 16 * K
  356. // output: int32_t (shifted 15 positions to the left, + offset 16384) :: size 11 * K
  357. // K: Number of blocks
  358. void WebRtcSpl_32khzTo22khzIntToInt(const int32_t* In,
  359. int32_t* Out,
  360. int32_t K)
  361. {
  362. /////////////////////////////////////////////////////////////
  363. // Filter operation:
  364. //
  365. // Perform resampling (16 input samples -> 11 output samples);
  366. // process in sub blocks of size 16 samples.
  367. int32_t m;
  368. for (m = 0; m < K; m++)
  369. {
  370. // first output sample
  371. Out[0] = ((int32_t)In[3] << 15) + (1 << 14);
  372. // sum and accumulate filter coefficients and input samples
  373. WebRtcSpl_DotProdIntToInt(&In[0], &In[22], kCoefficients32To22[0], &Out[1], &Out[10]);
  374. // sum and accumulate filter coefficients and input samples
  375. WebRtcSpl_DotProdIntToInt(&In[2], &In[20], kCoefficients32To22[1], &Out[2], &Out[9]);
  376. // sum and accumulate filter coefficients and input samples
  377. WebRtcSpl_DotProdIntToInt(&In[3], &In[19], kCoefficients32To22[2], &Out[3], &Out[8]);
  378. // sum and accumulate filter coefficients and input samples
  379. WebRtcSpl_DotProdIntToInt(&In[5], &In[17], kCoefficients32To22[3], &Out[4], &Out[7]);
  380. // sum and accumulate filter coefficients and input samples
  381. WebRtcSpl_DotProdIntToInt(&In[6], &In[16], kCoefficients32To22[4], &Out[5], &Out[6]);
  382. // update pointers
  383. In += 16;
  384. Out += 11;
  385. }
  386. }
  387. // Resampling ratio: 11/16
  388. // input: int32_t (normalized, not saturated) :: size 16 * K
  389. // output: int16_t (saturated) :: size 11 * K
  390. // K: Number of blocks
  391. void WebRtcSpl_32khzTo22khzIntToShort(const int32_t *In,
  392. int16_t *Out,
  393. int32_t K)
  394. {
  395. /////////////////////////////////////////////////////////////
  396. // Filter operation:
  397. //
  398. // Perform resampling (16 input samples -> 11 output samples);
  399. // process in sub blocks of size 16 samples.
  400. int32_t tmp;
  401. int32_t m;
  402. for (m = 0; m < K; m++)
  403. {
  404. // first output sample
  405. tmp = In[3];
  406. if (tmp > (int32_t)0x00007FFF)
  407. tmp = 0x00007FFF;
  408. if (tmp < (int32_t)0xFFFF8000)
  409. tmp = 0xFFFF8000;
  410. Out[0] = (int16_t)tmp;
  411. // sum and accumulate filter coefficients and input samples
  412. WebRtcSpl_DotProdIntToShort(&In[0], &In[22], kCoefficients32To22[0], &Out[1], &Out[10]);
  413. // sum and accumulate filter coefficients and input samples
  414. WebRtcSpl_DotProdIntToShort(&In[2], &In[20], kCoefficients32To22[1], &Out[2], &Out[9]);
  415. // sum and accumulate filter coefficients and input samples
  416. WebRtcSpl_DotProdIntToShort(&In[3], &In[19], kCoefficients32To22[2], &Out[3], &Out[8]);
  417. // sum and accumulate filter coefficients and input samples
  418. WebRtcSpl_DotProdIntToShort(&In[5], &In[17], kCoefficients32To22[3], &Out[4], &Out[7]);
  419. // sum and accumulate filter coefficients and input samples
  420. WebRtcSpl_DotProdIntToShort(&In[6], &In[16], kCoefficients32To22[4], &Out[5], &Out[6]);
  421. // update pointers
  422. In += 16;
  423. Out += 11;
  424. }
  425. }