Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: webrtc/modules/audio_processing/aec/aec_core_mips.cc

Issue 1943753002: Separated the functionalities in the OverdriveAndSuppress method in the AEC into two methods (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@RefactorAec5_CL
Patch Set: Added const specifier to local pointer Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 ".set pop \n\t" 337 ".set pop \n\t"
338 : [f0] "=&f" (f0), [f1] "=&f" (f1), [f2] "=&f" (f2), 338 : [f0] "=&f" (f0), [f1] "=&f" (f1), [f2] "=&f" (f2),
339 [f3] "=&f" (f3), [f4] "=&f" (f4), [f5] "=&f" (f5), 339 [f3] "=&f" (f3), [f4] "=&f" (f4), [f5] "=&f" (f5),
340 [f6] "=&f" (f6), [f7] "=&f" (f7), [len] "=&r" (len), 340 [f6] "=&f" (f6), [f7] "=&f" (f7), [len] "=&r" (len),
341 [fft_tmp] "=&r" (fft_tmp), [aRe] "+r" (aRe), [aIm] "+r" (aIm) 341 [fft_tmp] "=&r" (fft_tmp), [aRe] "+r" (aRe), [aIm] "+r" (aIm)
342 : [fft] "r" (fft) 342 : [fft] "r" (fft)
343 : "memory"); 343 : "memory");
344 } 344 }
345 } 345 }
346 346
347 void WebRtcAec_OverdriveAndSuppress_mips(float overdrive_scaling, 347 void WebRtcAec_Overdrive_mips(float overdrive_scaling,
348 float hNl[PART_LEN1], 348 float hNlFb,
349 const float hNlFb, 349 float hNl[PART_LEN1]) {
350 float efw[2][PART_LEN1]) {
351 int i;
352 const float one = 1.0; 350 const float one = 1.0;
353 float* p_hNl; 351 float* p_hNl;
354 float* p_efw0;
355 float* p_efw1;
356 const float* p_WebRtcAec_wC; 352 const float* p_WebRtcAec_wC;
357 float temp1, temp2, temp3, temp4; 353 float temp1, temp2, temp3, temp4;
358 354
359 p_hNl = &hNl[0]; 355 p_hNl = &hNl[0];
360 p_efw0 = &efw[0][0];
361 p_efw1 = &efw[1][0];
362 p_WebRtcAec_wC = &WebRtcAec_weightCurve[0]; 356 p_WebRtcAec_wC = &WebRtcAec_weightCurve[0];
363 357
364 for (i = 0; i < PART_LEN1; i++) { 358 for (int i = 0; i < PART_LEN1; ++i) {
365 // Weight subbands 359 // Weight subbands
366 __asm __volatile( 360 __asm __volatile(
367 ".set push \n\t" 361 ".set push \n\t"
368 ".set noreorder \n\t" 362 ".set noreorder \n\t"
369 "lwc1 %[temp1], 0(%[p_hNl]) \n\t" 363 "lwc1 %[temp1], 0(%[p_hNl]) \n\t"
370 "lwc1 %[temp2], 0(%[p_wC]) \n\t" 364 "lwc1 %[temp2], 0(%[p_wC]) \n\t"
371 "c.lt.s %[hNlFb], %[temp1] \n\t" 365 "c.lt.s %[hNlFb], %[temp1] \n\t"
372 "bc1f 1f \n\t" 366 "bc1f 1f \n\t"
373 " mul.s %[temp3], %[temp2], %[hNlFb] \n\t" 367 " mul.s %[temp3], %[temp2], %[hNlFb] \n\t"
374 "sub.s %[temp4], %[one], %[temp2] \n\t" 368 "sub.s %[temp4], %[one], %[temp2] \n\t"
375 #if !defined(MIPS32_R2_LE) 369 #if !defined(MIPS32_R2_LE)
376 "mul.s %[temp1], %[temp1], %[temp4] \n\t" 370 "mul.s %[temp1], %[temp1], %[temp4] \n\t"
377 "add.s %[temp1], %[temp3], %[temp1] \n\t" 371 "add.s %[temp1], %[temp3], %[temp1] \n\t"
378 #else // #if !defined(MIPS32_R2_LE) 372 #else // #if !defined(MIPS32_R2_LE)
379 "madd.s %[temp1], %[temp3], %[temp1], %[temp4] \n\t" 373 "madd.s %[temp1], %[temp3], %[temp1], %[temp4] \n\t"
380 #endif // #if !defined(MIPS32_R2_LE) 374 #endif // #if !defined(MIPS32_R2_LE)
381 "swc1 %[temp1], 0(%[p_hNl]) \n\t" 375 "swc1 %[temp1], 0(%[p_hNl]) \n\t"
382 "1: \n\t" 376 "1: \n\t"
383 "addiu %[p_wC], %[p_wC], 4 \n\t" 377 "addiu %[p_wC], %[p_wC], 4 \n\t"
384 ".set pop \n\t" 378 ".set pop \n\t"
385 : [temp1] "=&f" (temp1), [temp2] "=&f" (temp2), [temp3] "=&f" (temp3), 379 : [temp1] "=&f" (temp1), [temp2] "=&f" (temp2), [temp3] "=&f" (temp3),
386 [temp4] "=&f" (temp4), [p_wC] "+r" (p_WebRtcAec_wC) 380 [temp4] "=&f" (temp4), [p_wC] "+r" (p_WebRtcAec_wC)
387 : [hNlFb] "f" (hNlFb), [one] "f" (one), [p_hNl] "r" (p_hNl) 381 : [hNlFb] "f" (hNlFb), [one] "f" (one), [p_hNl] "r" (p_hNl)
388 : "memory"); 382 : "memory");
389 383
390 hNl[i] = powf(hNl[i], overdrive_scaling * WebRtcAec_overDriveCurve[i]); 384 hNl[i] = powf(hNl[i], overdrive_scaling * WebRtcAec_overDriveCurve[i]);
385 }
386 }
391 387
388 void WebRtcAec_Suppress_mips(const float hNl[PART_LEN1],
389 float efw[2][PART_LEN1]) {
390 const float* p_hNl;
391 float* p_efw0;
392 float* p_efw1;
393 float temp1, temp2, temp3, temp4;
394
395 p_hNl = &hNl[0];
396 p_efw0 = &efw[0][0];
397 p_efw1 = &efw[1][0];
398
399 for (int i = 0; i < PART_LEN1; ++i) {
392 __asm __volatile( 400 __asm __volatile(
393 "lwc1 %[temp1], 0(%[p_hNl]) \n\t" 401 "lwc1 %[temp1], 0(%[p_hNl]) \n\t"
394 "lwc1 %[temp3], 0(%[p_efw1]) \n\t" 402 "lwc1 %[temp3], 0(%[p_efw1]) \n\t"
395 "lwc1 %[temp2], 0(%[p_efw0]) \n\t" 403 "lwc1 %[temp2], 0(%[p_efw0]) \n\t"
396 "addiu %[p_hNl], %[p_hNl], 4 \n\t" 404 "addiu %[p_hNl], %[p_hNl], 4 \n\t"
397 "mul.s %[temp3], %[temp3], %[temp1] \n\t" 405 "mul.s %[temp3], %[temp3], %[temp1] \n\t"
398 "mul.s %[temp2], %[temp2], %[temp1] \n\t" 406 "mul.s %[temp2], %[temp2], %[temp1] \n\t"
399 "addiu %[p_efw0], %[p_efw0], 4 \n\t" 407 "addiu %[p_efw0], %[p_efw0], 4 \n\t"
400 "addiu %[p_efw1], %[p_efw1], 4 \n\t" 408 "addiu %[p_efw1], %[p_efw1], 4 \n\t"
401 "neg.s %[temp4], %[temp3] \n\t" 409 "neg.s %[temp4], %[temp3] \n\t"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 [len] "+r" (len) 476 [len] "+r" (len)
469 : [fac1] "f" (fac1), [err_th2] "f" (err_th2), [mu] "f" (mu), 477 : [fac1] "f" (fac1), [err_th2] "f" (err_th2), [mu] "f" (mu),
470 [err_th] "f" (error_threshold) 478 [err_th] "f" (error_threshold)
471 : "memory"); 479 : "memory");
472 } 480 }
473 481
474 void WebRtcAec_InitAec_mips(void) { 482 void WebRtcAec_InitAec_mips(void) {
475 WebRtcAec_FilterFar = WebRtcAec_FilterFar_mips; 483 WebRtcAec_FilterFar = WebRtcAec_FilterFar_mips;
476 WebRtcAec_FilterAdaptation = WebRtcAec_FilterAdaptation_mips; 484 WebRtcAec_FilterAdaptation = WebRtcAec_FilterAdaptation_mips;
477 WebRtcAec_ScaleErrorSignal = WebRtcAec_ScaleErrorSignal_mips; 485 WebRtcAec_ScaleErrorSignal = WebRtcAec_ScaleErrorSignal_mips;
478 WebRtcAec_OverdriveAndSuppress = WebRtcAec_OverdriveAndSuppress_mips; 486 WebRtcAec_Overdrive = WebRtcAec_Overdrive_mips;
487 WebRtcAec_Suppress = WebRtcAec_Suppress_mips;
479 } 488 }
480 } // namespace webrtc 489 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aec/aec_core_internal.h ('k') | webrtc/modules/audio_processing/aec/aec_core_neon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698