What was done was

-changed filenames to *.cc
-fixed issues with implicit casts causing build errors.

All other CL warnings were ignored as the original
code is not changed, merely moved.

BUG=webrtc:5724
NOPRESUBMIT=true

Review URL: https://codereview.webrtc.org/1857153002

Cr-Commit-Position: refs/heads/master@{#12307}
This commit is contained in:
peah
2016-04-10 22:38:14 -07:00
committed by Commit bot
parent 59cbc4f3f3
commit 2704512f7b
8 changed files with 35 additions and 45 deletions

View File

@ -14,12 +14,13 @@
#include <stddef.h>
#include <stdlib.h>
extern "C" {
#include "webrtc/common_audio/ring_buffer.h"
#include "webrtc/common_audio/signal_processing/include/real_fft.h"
#include "webrtc/modules/audio_processing/aecm/echo_control_mobile.h"
#include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h"
#include "webrtc/system_wrappers/include/compile_assert_c.h"
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
}
#include "webrtc/typedefs.h"
#ifdef AEC_DEBUG
@ -208,7 +209,7 @@ StoreAdaptiveChannel WebRtcAecm_StoreAdaptiveChannel;
ResetAdaptiveChannel WebRtcAecm_ResetAdaptiveChannel;
AecmCore* WebRtcAecm_CreateCore() {
AecmCore* aecm = malloc(sizeof(AecmCore));
AecmCore* aecm = static_cast<AecmCore*>(malloc(sizeof(AecmCore)));
aecm->farFrameBuf = WebRtc_CreateBuffer(FRAME_LEN + PART_LEN,
sizeof(int16_t));
@ -501,7 +502,7 @@ int WebRtcAecm_InitCore(AecmCore* const aecm, int samplingFreq) {
// Assert a preprocessor definition at compile-time. It's an assumption
// used in assembly code, so check the assembly files before any change.
COMPILE_ASSERT(PART_LEN % 16 == 0);
static_assert(PART_LEN % 16 == 0, "PART_LEN is not a multiple of 16");
// Initialize function pointers.
WebRtcAecm_CalcLinearEnergies = CalcLinearEnergiesC;

View File

@ -13,8 +13,10 @@
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AECM_AECM_CORE_H_
#define WEBRTC_MODULES_AUDIO_PROCESSING_AECM_AECM_CORE_H_
extern "C" {
#include "webrtc/common_audio/ring_buffer.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
}
#include "webrtc/modules/audio_processing/aecm/aecm_defines.h"
#include "webrtc/typedefs.h"

View File

@ -14,19 +14,18 @@
#include <stddef.h>
#include <stdlib.h>
extern "C" {
#include "webrtc/common_audio/ring_buffer.h"
#include "webrtc/common_audio/signal_processing/include/real_fft.h"
}
#include "webrtc/modules/audio_processing/aecm/echo_control_mobile.h"
extern "C" {
#include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h"
#include "webrtc/system_wrappers/include/compile_assert_c.h"
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
}
#include "webrtc/typedefs.h"
// Square root of Hanning window in Q14.
#if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON)
// Table is defined in an ARM assembly file.
extern const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END;
#else
static const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = {
0, 399, 798, 1196, 1594, 1990, 2386, 2780, 3172,
3562, 3951, 4337, 4720, 5101, 5478, 5853, 6224,
@ -37,7 +36,6 @@ static const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = {
15231, 15373, 15506, 15631, 15746, 15851, 15947, 16034,
16111, 16179, 16237, 16286, 16325, 16354, 16373, 16384
};
#endif
#ifdef AECM_WITH_ABS_APPROX
//Q15 alpha = 0.99439986968132 const Factor for magnitude approximation
@ -768,4 +766,3 @@ static void ComfortNoise(AecmCore* aecm,
out[i].imag = WebRtcSpl_AddSatW16(out[i].imag, uImag[i]);
}
}

View File

@ -13,7 +13,9 @@
#include <assert.h>
#include "webrtc/modules/audio_processing/aecm/echo_control_mobile.h"
extern "C" {
#include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h"
}
static const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = {
0, 399, 798, 1196, 1594, 1990, 2386, 2780, 3172,
@ -1563,4 +1565,3 @@ static void ComfortNoise(AecmCore* aecm,
sgn = ((int)tt) >> 31;
out[PART_LEN].imag = sgn == (int16_t)(tt >> 15) ? (int16_t)tt : (16384 ^ sgn);
}

View File

@ -18,19 +18,6 @@
// TODO(kma): Re-write the corresponding assembly file, the offset
// generating script and makefile, to replace these C functions.
// Square root of Hanning window in Q14.
const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = {
0,
399, 798, 1196, 1594, 1990, 2386, 2780, 3172,
3562, 3951, 4337, 4720, 5101, 5478, 5853, 6224,
6591, 6954, 7313, 7668, 8019, 8364, 8705, 9040,
9370, 9695, 10013, 10326, 10633, 10933, 11227, 11514,
11795, 12068, 12335, 12594, 12845, 13089, 13325, 13553,
13773, 13985, 14189, 14384, 14571, 14749, 14918, 15079,
15231, 15373, 15506, 15631, 15746, 15851, 15947, 16034,
16111, 16179, 16237, 16286, 16325, 16354, 16373, 16384
};
static inline void AddLanes(uint32_t* ptr, uint32x4_t v) {
#if defined(WEBRTC_ARCH_ARM64)
*(ptr) = vaddvq_u32(v);

View File

@ -15,8 +15,10 @@
#endif
#include <stdlib.h>
extern "C" {
#include "webrtc/common_audio/ring_buffer.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
}
#include "webrtc/modules/audio_processing/aecm/aecm_core.h"
#define BUF_SIZE_FRAMES 50 // buffer size (frames)
@ -79,7 +81,7 @@ static int WebRtcAecm_EstBufDelay(AecMobile* aecmInst, short msInSndCardBuf);
static int WebRtcAecm_DelayComp(AecMobile* aecmInst);
void* WebRtcAecm_Create() {
AecMobile* aecm = malloc(sizeof(AecMobile));
AecMobile* aecm = static_cast<AecMobile*>(malloc(sizeof(AecMobile)));
WebRtcSpl_Init();
@ -114,7 +116,7 @@ void* WebRtcAecm_Create() {
}
void WebRtcAecm_Free(void* aecmInst) {
AecMobile* aecm = aecmInst;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
if (aecm == NULL) {
return;
@ -138,7 +140,7 @@ void WebRtcAecm_Free(void* aecmInst) {
int32_t WebRtcAecm_Init(void *aecmInst, int32_t sampFreq)
{
AecMobile* aecm = aecmInst;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
AecmConfig aecConfig;
if (aecm == NULL)
@ -196,7 +198,7 @@ int32_t WebRtcAecm_Init(void *aecmInst, int32_t sampFreq)
// farend signal.
int32_t WebRtcAecm_GetBufferFarendError(void *aecmInst, const int16_t *farend,
size_t nrOfSamples) {
AecMobile* aecm = aecmInst;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
if (aecm == NULL)
return -1;
@ -216,7 +218,7 @@ int32_t WebRtcAecm_GetBufferFarendError(void *aecmInst, const int16_t *farend,
int32_t WebRtcAecm_BufferFarend(void *aecmInst, const int16_t *farend,
size_t nrOfSamples) {
AecMobile* aecm = aecmInst;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
const int32_t err =
WebRtcAecm_GetBufferFarendError(aecmInst, farend, nrOfSamples);
@ -239,7 +241,7 @@ int32_t WebRtcAecm_Process(void *aecmInst, const int16_t *nearendNoisy,
const int16_t *nearendClean, int16_t *out,
size_t nrOfSamples, int16_t msInSndCardBuf)
{
AecMobile* aecm = aecmInst;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
int32_t retVal = 0;
size_t i;
short nmbrOfFilledBuffers;
@ -435,7 +437,7 @@ int32_t WebRtcAecm_Process(void *aecmInst, const int16_t *nearendNoisy,
int32_t WebRtcAecm_set_config(void *aecmInst, AecmConfig config)
{
AecMobile* aecm = aecmInst;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
if (aecm == NULL)
{
@ -516,8 +518,8 @@ int32_t WebRtcAecm_InitEchoPath(void* aecmInst,
const void* echo_path,
size_t size_bytes)
{
AecMobile* aecm = aecmInst;
const int16_t* echo_path_ptr = echo_path;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
const int16_t* echo_path_ptr = static_cast<const int16_t*>(echo_path);
if (aecmInst == NULL) {
return -1;
@ -544,8 +546,8 @@ int32_t WebRtcAecm_GetEchoPath(void* aecmInst,
void* echo_path,
size_t size_bytes)
{
AecMobile* aecm = aecmInst;
int16_t* echo_path_ptr = echo_path;
AecMobile* aecm = static_cast<AecMobile*>(aecmInst);
int16_t* echo_path_ptr = static_cast<int16_t*>(echo_path);
if (aecmInst == NULL) {
return -1;