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

Side by Side Diff: webrtc/modules/audio_processing/aecm/aecm_core.cc

Issue 1955413003: Remove runtime NEON detection (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: gyp syntax 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 { 358 {
359 aecm->channelAdapt32[i] = (int32_t)aecm->channelStored[i] << 16; 359 aecm->channelAdapt32[i] = (int32_t)aecm->channelStored[i] << 16;
360 aecm->channelAdapt32[i + 1] = (int32_t)aecm->channelStored[i + 1] << 16; 360 aecm->channelAdapt32[i + 1] = (int32_t)aecm->channelStored[i + 1] << 16;
361 aecm->channelAdapt32[i + 2] = (int32_t)aecm->channelStored[i + 2] << 16; 361 aecm->channelAdapt32[i + 2] = (int32_t)aecm->channelStored[i + 2] << 16;
362 aecm->channelAdapt32[i + 3] = (int32_t)aecm->channelStored[i + 3] << 16; 362 aecm->channelAdapt32[i + 3] = (int32_t)aecm->channelStored[i + 3] << 16;
363 } 363 }
364 aecm->channelAdapt32[i] = (int32_t)aecm->channelStored[i] << 16; 364 aecm->channelAdapt32[i] = (int32_t)aecm->channelStored[i] << 16;
365 } 365 }
366 366
367 // Initialize function pointers for ARM Neon platform. 367 // Initialize function pointers for ARM Neon platform.
368 #if (defined WEBRTC_DETECT_NEON || defined WEBRTC_HAS_NEON) 368 #if defined(WEBRTC_HAS_NEON)
369 static void WebRtcAecm_InitNeon(void) 369 static void WebRtcAecm_InitNeon(void)
370 { 370 {
371 WebRtcAecm_StoreAdaptiveChannel = WebRtcAecm_StoreAdaptiveChannelNeon; 371 WebRtcAecm_StoreAdaptiveChannel = WebRtcAecm_StoreAdaptiveChannelNeon;
372 WebRtcAecm_ResetAdaptiveChannel = WebRtcAecm_ResetAdaptiveChannelNeon; 372 WebRtcAecm_ResetAdaptiveChannel = WebRtcAecm_ResetAdaptiveChannelNeon;
373 WebRtcAecm_CalcLinearEnergies = WebRtcAecm_CalcLinearEnergiesNeon; 373 WebRtcAecm_CalcLinearEnergies = WebRtcAecm_CalcLinearEnergiesNeon;
374 } 374 }
375 #endif 375 #endif
376 376
377 // Initialize function pointers for MIPS platform. 377 // Initialize function pointers for MIPS platform.
378 #if defined(MIPS32_LE) 378 #if defined(MIPS32_LE)
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 // Assert a preprocessor definition at compile-time. It's an assumption 506 // Assert a preprocessor definition at compile-time. It's an assumption
507 // used in assembly code, so check the assembly files before any change. 507 // used in assembly code, so check the assembly files before any change.
508 static_assert(PART_LEN % 16 == 0, "PART_LEN is not a multiple of 16"); 508 static_assert(PART_LEN % 16 == 0, "PART_LEN is not a multiple of 16");
509 509
510 // Initialize function pointers. 510 // Initialize function pointers.
511 WebRtcAecm_CalcLinearEnergies = CalcLinearEnergiesC; 511 WebRtcAecm_CalcLinearEnergies = CalcLinearEnergiesC;
512 WebRtcAecm_StoreAdaptiveChannel = StoreAdaptiveChannelC; 512 WebRtcAecm_StoreAdaptiveChannel = StoreAdaptiveChannelC;
513 WebRtcAecm_ResetAdaptiveChannel = ResetAdaptiveChannelC; 513 WebRtcAecm_ResetAdaptiveChannel = ResetAdaptiveChannelC;
514 514
515 #ifdef WEBRTC_DETECT_NEON 515 #if defined(WEBRTC_HAS_NEON)
516 uint64_t features = WebRtc_GetCPUFeaturesARM();
517 if ((features & kCPUFeatureNEON) != 0)
518 {
519 WebRtcAecm_InitNeon();
520 }
521 #elif defined(WEBRTC_HAS_NEON)
522 WebRtcAecm_InitNeon(); 516 WebRtcAecm_InitNeon();
523 #endif 517 #endif
524 518
525 #if defined(MIPS32_LE) 519 #if defined(MIPS32_LE)
526 WebRtcAecm_InitMips(); 520 WebRtcAecm_InitMips();
527 #endif 521 #endif
528 return 0; 522 return 0;
529 } 523 }
530 524
531 // TODO(bjornv): This function is currently not used. Add support for these 525 // TODO(bjornv): This function is currently not used. Add support for these
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 memcpy(farend + readPos, aecm->farBuf + aecm->farBufReadPos, 1222 memcpy(farend + readPos, aecm->farBuf + aecm->farBufReadPos,
1229 sizeof(int16_t) * readLen); 1223 sizeof(int16_t) * readLen);
1230 aecm->farBufReadPos = 0; 1224 aecm->farBufReadPos = 0;
1231 readPos = readLen; 1225 readPos = readLen;
1232 readLen = farLen - readLen; 1226 readLen = farLen - readLen;
1233 } 1227 }
1234 memcpy(farend + readPos, aecm->farBuf + aecm->farBufReadPos, 1228 memcpy(farend + readPos, aecm->farBuf + aecm->farBufReadPos,
1235 sizeof(int16_t) * readLen); 1229 sizeof(int16_t) * readLen);
1236 aecm->farBufReadPos += readLen; 1230 aecm->farBufReadPos += readLen;
1237 } 1231 }
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aecm/aecm_core.h ('k') | webrtc/modules/audio_processing/ns/nsx_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698