Skip to content

Commit e48d584

Browse files
author
Eric Laurent
committed
Added webrtc audio processing library
Only the modules necessary for audio processing have been imported: src/common_audio/ src/modules/audio_processing/ src/modules/interface/ src/system_wrappers/ src/typedefs.h src/common_types.h Android.mk android-webrtc.mk Android.mk and android-webrtc.mk have been modified to build only the audio processing modules. Files for Windows compatibility have been removed from system_wrappers. fft_ARM9E directory has been removed from src/common_audio/signal_processing_library/main/source/ Fixed x86 build. SVN checkout at working revision 180. Change-Id: If650f61d96557be8247b17eb4f4d32b7a6ba025d
1 parent 81fb7e2 commit e48d584

File tree

261 files changed

+55487
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+55487
-0
lines changed

Android.mk

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
2+
#
3+
# Use of this source code is governed by a BSD-style license
4+
# that can be found in the LICENSE file in the root of the source
5+
# tree. An additional intellectual property rights grant can be found
6+
# in the file PATENTS. All contributing project authors may
7+
# be found in the AUTHORS file in the root of the source tree.
8+
9+
MY_WEBRTC_ROOT_PATH := $(call my-dir)
10+
11+
12+
include $(MY_WEBRTC_ROOT_PATH)/src/system_wrappers/source/Android.mk
13+
14+
# audio processing
15+
include $(MY_WEBRTC_ROOT_PATH)/src/common_audio/resampler/main/source/Android.mk
16+
include $(MY_WEBRTC_ROOT_PATH)/src/common_audio/signal_processing_library/main/source/Android.mk
17+
include $(MY_WEBRTC_ROOT_PATH)/src/common_audio/vad/main/source/Android.mk
18+
include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/aec/main/source/Android.mk
19+
include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/aecm/main/source/Android.mk
20+
include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/agc/main/source/Android.mk
21+
include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/main/source/Android.mk
22+
include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/ns/main/source/Android.mk
23+
include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/utility/Android.mk
24+
25+
26+
# build .so
27+
include $(MY_WEBRTC_ROOT_PATH)/android-webrtc.mk
28+
29+
# build test apps
30+
include $(MY_WEBRTC_ROOT_PATH)/src/modules/audio_processing/main/test/process_test/Android.mk

MODULE_LICENSE_BSD

Whitespace-only changes.

NOTICE

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
===============================================================================
2+
3+
/*
4+
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
5+
*
6+
* Use of this source code is governed by a BSD-style license
7+
* that can be found in the LICENSE file in the root of the source
8+
* tree. An additional intellectual property rights grant can be found
9+
* in the file PATENTS. All contributing project authors may
10+
* be found in the AUTHORS file in the root of the source tree.
11+
*/
12+
13+
===============================================================================
14+
15+
/*
16+
* Copyright (C) 2010 The Android Open Source Project
17+
*
18+
* Licensed under the Apache License, Version 2.0 (the "License");
19+
* you may not use this file except in compliance with the License.
20+
* You may obtain a copy of the License at
21+
*
22+
* http://www.apache.org/licenses/LICENSE-2.0
23+
*
24+
* Unless required by applicable law or agreed to in writing, software
25+
* distributed under the License is distributed on an "AS IS" BASIS,
26+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27+
* See the License for the specific language governing permissions and
28+
* limitations under the License.
29+
*
30+
*/
31+
32+
===============================================================================
33+
34+
/*
35+
* http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
36+
* Copyright Takuya OOURA, 1996-2001
37+
*
38+
* You may use, copy, modify and distribute this code for any purpose (include
39+
* commercial use) and without fee. Please refer to this package when you modify
40+
* this code.
41+
*
42+
* Changes by the WebRTC authors:
43+
* - Trivial type modifications.
44+
* - Minimal code subset to do rdft of length 128.
45+
* - Optimizations because of known length.
46+
*
47+
* All changes are covered by the WebRTC license and IP grant:
48+
* Use of this source code is governed by a BSD-style license
49+
* that can be found in the LICENSE file in the root of the source
50+
* tree. An additional intellectual property rights grant can be found
51+
* in the file PATENTS. All contributing project authors may
52+
* be found in the AUTHORS file in the root of the source tree.
53+
*/
54+
55+
===============================================================================
56+
57+
/*
58+
* http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
59+
* Copyright Takuya OOURA, 1996-2001
60+
*
61+
* You may use, copy, modify and distribute this code for any purpose (include
62+
* commercial use) and without fee. Please refer to this package when you modify
63+
* this code.
64+
*
65+
* Changes:
66+
* Trivial type modifications by the WebRTC authors.
67+
*/
68+
69+
===============================================================================
70+
71+
/*Boost Software License - Version 1.0 - August 17th, 2003
72+
73+
Permission is hereby granted, free of charge, to any person or organization
74+
obtaining a copy of the software and accompanying documentation covered by
75+
this license (the "Software") to use, reproduce, display, distribute,
76+
execute, and transmit the Software, and to prepare derivative works of the
77+
Software, and to permit third-parties to whom the Software is furnished to
78+
do so, all subject to the following:
79+
80+
The copyright notices in the Software and this entire statement, including
81+
the above license grant, this restriction and the following disclaimer,
82+
must be included in all copies of the Software, in whole or in part, and
83+
all derivative works of the Software, unless such copies or derivative
84+
works are solely in the form of machine-executable object code generated by
85+
a source language processor.
86+
87+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89+
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
90+
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
91+
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
92+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93+
DEALINGS IN THE SOFTWARE.*/
94+
95+
===============================================================================
96+
97+
// Copyright Steven J. Ross 2001 - 2009.
98+
// Distributed under the Boost Software License, Version 1.0.
99+
// (See accompanying file LICENSE_1_0.txt or copy at
100+
// http://www.boost.org/LICENSE_1_0.txt)
101+
102+
// See http://www.boost.org/ for updates, documentation, and revision history.
103+
104+
/*
105+
Some improvements suggested by:
106+
Phil Endecott and Frank Gennari
107+
Cygwin fix provided by:
108+
Scott McMurray
109+
*/
110+
111+

android-webrtc.mk

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
2+
#
3+
# Use of this source code is governed by a BSD-style license
4+
# that can be found in the LICENSE file in the root of the source
5+
# tree. An additional intellectual property rights grant can be found
6+
# in the file PATENTS. All contributing project authors may
7+
# be found in the AUTHORS file in the root of the source tree.
8+
9+
MY_APM_WHOLE_STATIC_LIBRARIES := \
10+
libwebrtc_spl \
11+
libwebrtc_resampler \
12+
libwebrtc_apm \
13+
libwebrtc_apm_utility \
14+
libwebrtc_vad \
15+
libwebrtc_ns \
16+
libwebrtc_agc \
17+
libwebrtc_aec \
18+
libwebrtc_aecm
19+
20+
LOCAL_PATH := $(call my-dir)
21+
22+
include $(CLEAR_VARS)
23+
24+
LOCAL_ARM_MODE := arm
25+
LOCAL_MODULE := libwebrtc_audio_preprocessing
26+
LOCAL_MODULE_TAGS := optional
27+
LOCAL_LDFLAGS :=
28+
29+
LOCAL_WHOLE_STATIC_LIBRARIES := \
30+
$(MY_APM_WHOLE_STATIC_LIBRARIES) \
31+
libwebrtc_system_wrappers \
32+
33+
LOCAL_SHARED_LIBRARIES := \
34+
libcutils \
35+
libdl \
36+
libstlport
37+
38+
LOCAL_ADDITIONAL_DEPENDENCIES :=
39+
40+
include external/stlport/libstlport.mk
41+
include $(BUILD_SHARED_LIBRARY)
42+
43+
###
44+
45+
#LOCAL_PATH := $(call my-dir)
46+
#
47+
#include $(CLEAR_VARS)
48+
#
49+
#LOCAL_ARM_MODE := arm
50+
#LOCAL_MODULE := libwebrtc
51+
#LOCAL_MODULE_TAGS := optional
52+
#LOCAL_LDFLAGS :=
53+
#
54+
#LOCAL_WHOLE_STATIC_LIBRARIES := \
55+
# libwebrtc_system_wrappers \
56+
# libwebrtc_audio_device \
57+
# libwebrtc_pcm16b \
58+
# libwebrtc_cng \
59+
# libwebrtc_audio_coding \
60+
# libwebrtc_rtp_rtcp \
61+
# libwebrtc_media_file \
62+
# libwebrtc_udp_transport \
63+
# libwebrtc_utility \
64+
# libwebrtc_neteq \
65+
# libwebrtc_audio_conference_mixer \
66+
# libwebrtc_isac \
67+
# libwebrtc_ilbc \
68+
# libwebrtc_isacfix \
69+
# libwebrtc_g722 \
70+
# libwebrtc_g711 \
71+
# libwebrtc_voe_core \
72+
# libwebrtc_video_render \
73+
# libwebrtc_video_capture \
74+
# libwebrtc_i420 \
75+
# libwebrtc_video_coding \
76+
# libwebrtc_video_processing \
77+
# libwebrtc_vp8 \
78+
# libwebrtc_vie_core \
79+
# libwebrtc_vplib \
80+
# libwebrtc_jpeg \
81+
# libwebrtc_vpx
82+
#
83+
#LOCAL_STATIC_LIBRARIES :=
84+
#LOCAL_SHARED_LIBRARIES := \
85+
# libcutils \
86+
# libdl \
87+
# libstlport \
88+
# libjpeg \
89+
# libGLESv2 \
90+
# libOpenSLES \
91+
# libwebrtc_audio_preprocessing
92+
#
93+
#LOCAL_ADDITIONAL_DEPENDENCIES :=
94+
#
95+
#include external/stlport/libstlport.mk
96+
#include $(BUILD_SHARED_LIBRARY)

src/common_audio/OWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/common_audio/resampler/OWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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+
12+
/*
13+
* A wrapper for resampling a numerous amount of sampling combinations.
14+
*/
15+
16+
#ifndef WEBRTC_RESAMPLER_RESAMPLER_H_
17+
#define WEBRTC_RESAMPLER_RESAMPLER_H_
18+
19+
#include "typedefs.h"
20+
21+
namespace webrtc
22+
{
23+
24+
enum ResamplerType
25+
{
26+
// 4 MSB = Number of channels
27+
// 4 LSB = Synchronous or asynchronous
28+
29+
kResamplerSynchronous = 0x10,
30+
kResamplerAsynchronous = 0x11,
31+
kResamplerSynchronousStereo = 0x20,
32+
kResamplerAsynchronousStereo = 0x21,
33+
kResamplerInvalid = 0xff
34+
};
35+
36+
enum ResamplerMode
37+
{
38+
kResamplerMode1To1,
39+
kResamplerMode1To2,
40+
kResamplerMode1To3,
41+
kResamplerMode1To4,
42+
kResamplerMode1To6,
43+
kResamplerMode2To3,
44+
kResamplerMode2To11,
45+
kResamplerMode4To11,
46+
kResamplerMode8To11,
47+
kResamplerMode11To16,
48+
kResamplerMode11To32,
49+
kResamplerMode2To1,
50+
kResamplerMode3To1,
51+
kResamplerMode4To1,
52+
kResamplerMode6To1,
53+
kResamplerMode3To2,
54+
kResamplerMode11To2,
55+
kResamplerMode11To4,
56+
kResamplerMode11To8
57+
};
58+
59+
class Resampler
60+
{
61+
62+
public:
63+
Resampler();
64+
Resampler(int inFreq, int outFreq, ResamplerType type);
65+
~Resampler();
66+
67+
// Reset all states
68+
int Reset(int inFreq, int outFreq, ResamplerType type);
69+
70+
// Reset all states if any parameter has changed
71+
int ResetIfNeeded(int inFreq, int outFreq, ResamplerType type);
72+
73+
// Synchronous resampling, all output samples are written to samplesOut
74+
int Push(const WebRtc_Word16* samplesIn, int lengthIn, WebRtc_Word16* samplesOut,
75+
int maxLen, int &outLen);
76+
77+
// Asynchronous resampling, input
78+
int Insert(WebRtc_Word16* samplesIn, int lengthIn);
79+
80+
// Asynchronous resampling output, remaining samples are buffered
81+
int Pull(WebRtc_Word16* samplesOut, int desiredLen, int &outLen);
82+
83+
private:
84+
// Generic pointers since we don't know what states we'll need
85+
void* state1_;
86+
void* state2_;
87+
void* state3_;
88+
89+
// Storage if needed
90+
WebRtc_Word16* in_buffer_;
91+
WebRtc_Word16* out_buffer_;
92+
int in_buffer_size_;
93+
int out_buffer_size_;
94+
int in_buffer_size_max_;
95+
int out_buffer_size_max_;
96+
97+
// State
98+
int my_in_frequency_khz_;
99+
int my_out_frequency_khz_;
100+
ResamplerMode my_mode_;
101+
ResamplerType my_type_;
102+
103+
// Extra instance for stereo
104+
Resampler* slave_left_;
105+
Resampler* slave_right_;
106+
};
107+
108+
} // namespace webrtc
109+
110+
#endif // WEBRTC_RESAMPLER_RESAMPLER_H_

0 commit comments

Comments
 (0)