Skip to content

Commit

Permalink
Moving LappedTransform, Blocker and AudioRingBuffer.
Browse files Browse the repository at this point in the history
LappedTransform is only used in BandwidthAdaptationTest and therefore it
should not be anymore a visible target under common_audio.
This CL moves LappedTransform and other two classes it depends on (and which
are not used elsewhere) to modules/audio_coding/codecs/opus/test.

Bug: webrtc:9577, webrtc:5298
Change-Id: I1aa8052c2df2b2b150c279c0c9b1001474aed47a
Reviewed-on: https://webrtc-review.googlesource.com/96440
Commit-Queue: Alessio Bazzica <[email protected]>
Reviewed-by: Alex Loiko <[email protected]>
Reviewed-by: Henrik Lundin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#24509}
  • Loading branch information
alebzk authored and Commit Bot committed Aug 31, 2018
1 parent 8a3c166 commit d4161a3
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 27 deletions.
9 changes: 0 additions & 9 deletions common_audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ rtc_static_library("common_audio") {
sources = [
"audio_converter.cc",
"audio_converter.h",
"audio_ring_buffer.cc",
"audio_ring_buffer.h",
"audio_util.cc",
"blocker.cc",
"blocker.h",
"channel_buffer.cc",
"channel_buffer.h",
"include/audio_util.h",
"lapped_transform.cc",
"lapped_transform.h",
"real_fourier.cc",
"real_fourier.h",
"real_fourier_ooura.cc",
Expand Down Expand Up @@ -349,12 +343,9 @@ if (rtc_include_tests) {

sources = [
"audio_converter_unittest.cc",
"audio_ring_buffer_unittest.cc",
"audio_util_unittest.cc",
"blocker_unittest.cc",
"channel_buffer_unittest.cc",
"fir_filter_unittest.cc",
"lapped_transform_unittest.cc",
"real_fourier_unittest.cc",
"resampler/push_resampler_unittest.cc",
"resampler/push_sinc_resampler_unittest.cc",
Expand Down
2 changes: 2 additions & 0 deletions common_audio/ring_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#ifndef COMMON_AUDIO_RING_BUFFER_H_
#define COMMON_AUDIO_RING_BUFFER_H_

// TODO(alessiob): Used by AEC, AECm and AudioRingBuffer. Remove when possible.

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 2 additions & 0 deletions modules/audio_coding/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2093,6 +2093,8 @@ if (rtc_include_tests) {
"../../test:rtp_test_utils",
"../../test:test_common",
"../../test:test_support",
"codecs/opus/test",
"codecs/opus/test:test_unittest",
"//testing/gtest",
"//third_party/abseil-cpp/absl/memory",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "api/audio_codecs/opus/audio_decoder_opus.h"
#include "api/audio_codecs/opus/audio_encoder_opus.h"
#include "common_audio/include/audio_util.h"
#include "common_audio/lapped_transform.h"
#include "common_audio/window_generator.h"
#include "modules/audio_coding/codecs/opus/test/lapped_transform.h"
#include "modules/audio_coding/neteq/tools/audio_loop.h"
#include "test/field_trial.h"
#include "test/gtest.h"
Expand Down
55 changes: 55 additions & 0 deletions modules/audio_coding/codecs/opus/test/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("../../../../../webrtc.gni")

visibility = [
":*",
"../../../:*",
]

if (rtc_include_tests) {
rtc_static_library("test") {
testonly = true

sources = [
"audio_ring_buffer.cc",
"audio_ring_buffer.h",
"blocker.cc",
"blocker.h",
"lapped_transform.cc",
"lapped_transform.h",
]

deps = [
"../../../../../common_audio:common_audio",
"../../../../../common_audio:common_audio_c",
"../../../../../rtc_base:checks",
"../../../../../rtc_base/memory:aligned_array",
]
}

rtc_source_set("test_unittest") {
testonly = true

sources = [
"audio_ring_buffer_unittest.cc",
"blocker_unittest.cc",
"lapped_transform_unittest.cc",
]

deps = [
":test",
"../../../../../common_audio:common_audio",
"../../../../../common_audio:common_audio_c",
"../../../../../rtc_base:rtc_base_approved",
"../../../../../test:test_support",
"//testing/gtest",
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/

#include "common_audio/audio_ring_buffer.h"
#include "modules/audio_coding/codecs/opus/test/audio_ring_buffer.h"

#include "common_audio/ring_buffer.h"
#include "rtc_base/checks.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef COMMON_AUDIO_AUDIO_RING_BUFFER_H_
#define COMMON_AUDIO_AUDIO_RING_BUFFER_H_
#ifndef MODULES_AUDIO_CODING_CODECS_OPUS_TEST_AUDIO_RING_BUFFER_H_
#define MODULES_AUDIO_CODING_CODECS_OPUS_TEST_AUDIO_RING_BUFFER_H_

#include <stddef.h>

Expand Down Expand Up @@ -54,4 +54,4 @@ class AudioRingBuffer final {

} // namespace webrtc

#endif // COMMON_AUDIO_AUDIO_RING_BUFFER_H_
#endif // MODULES_AUDIO_CODING_CODECS_OPUS_TEST_AUDIO_RING_BUFFER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <memory>

#include "common_audio/audio_ring_buffer.h"
#include "modules/audio_coding/codecs/opus/test/audio_ring_buffer.h"

#include "common_audio/channel_buffer.h"
#include "test/gtest.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/

#include "common_audio/blocker.h"
#include "modules/audio_coding/codecs/opus/test/blocker.h"

#include <string.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/

#ifndef COMMON_AUDIO_BLOCKER_H_
#define COMMON_AUDIO_BLOCKER_H_
#ifndef MODULES_AUDIO_CODING_CODECS_OPUS_TEST_BLOCKER_H_
#define MODULES_AUDIO_CODING_CODECS_OPUS_TEST_BLOCKER_H_

#include <memory>

#include "common_audio/audio_ring_buffer.h"
#include "common_audio/channel_buffer.h"
#include "modules/audio_coding/codecs/opus/test/audio_ring_buffer.h"

namespace webrtc {

Expand Down Expand Up @@ -124,4 +124,4 @@ class Blocker {

} // namespace webrtc

#endif // COMMON_AUDIO_BLOCKER_H_
#endif // MODULES_AUDIO_CODING_CODECS_OPUS_TEST_BLOCKER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <memory>

#include "common_audio/blocker.h"
#include "modules/audio_coding/codecs/opus/test/blocker.h"

#include "rtc_base/arraysize.h"
#include "test/gtest.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/

#include "common_audio/lapped_transform.h"
#include "modules/audio_coding/codecs/opus/test/lapped_transform.h"

#include <algorithm>
#include <cstdlib>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/

#ifndef COMMON_AUDIO_LAPPED_TRANSFORM_H_
#define COMMON_AUDIO_LAPPED_TRANSFORM_H_
#ifndef MODULES_AUDIO_CODING_CODECS_OPUS_TEST_LAPPED_TRANSFORM_H_
#define MODULES_AUDIO_CODING_CODECS_OPUS_TEST_LAPPED_TRANSFORM_H_

#include <complex>
#include <memory>

#include "common_audio/blocker.h"
#include "common_audio/real_fourier.h"
#include "modules/audio_coding/codecs/opus/test/blocker.h"
#include "rtc_base/memory/aligned_array.h"

namespace webrtc {
Expand Down Expand Up @@ -119,6 +119,7 @@ class LappedTransform {
Callback* const block_processor_;
Blocker blocker_;

// TODO(alessiob): Replace RealFourier with a different FFT library.
std::unique_ptr<RealFourier> fft_;
const size_t cplx_length_;
AlignedArray<float> real_buf_;
Expand All @@ -128,4 +129,4 @@ class LappedTransform {

} // namespace webrtc

#endif // COMMON_AUDIO_LAPPED_TRANSFORM_H_
#endif // MODULES_AUDIO_CODING_CODECS_OPUS_TEST_LAPPED_TRANSFORM_H_
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/

#include "common_audio/lapped_transform.h"
#include "modules/audio_coding/codecs/opus/test/lapped_transform.h"

#include <algorithm>
#include <cmath>
Expand Down

0 comments on commit d4161a3

Please sign in to comment.