Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
3.0 KiB
C
Raw Normal View History

Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
/*
* Copyright (c) 2016 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.
*/
#ifndef MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_
#define MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_
Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
#include <memory>
#include <vector>
#include "modules/audio_processing/aec3/echo_remover.h"
#include "modules/audio_processing/aec3/render_delay_buffer.h"
#include "modules/audio_processing/aec3/render_delay_controller.h"
Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
namespace webrtc {
// Class for performing echo cancellation on 64 sample blocks of audio data.
class BlockProcessor {
public:
// Create a block processor with the legacy render buffering.
static BlockProcessor* Create(const EchoCanceller3Config& config,
int sample_rate_hz);
// Create a block processor with the new render buffering.
static BlockProcessor* Create2(const EchoCanceller3Config& config,
int sample_rate_hz);
// Only used for testing purposes.
static BlockProcessor* Create(
const EchoCanceller3Config& config,
int sample_rate_hz,
std::unique_ptr<RenderDelayBuffer> render_buffer);
static BlockProcessor* Create2(
const EchoCanceller3Config& config,
int sample_rate_hz,
std::unique_ptr<RenderDelayBuffer> render_buffer);
static BlockProcessor* Create(
const EchoCanceller3Config& config,
int sample_rate_hz,
std::unique_ptr<RenderDelayBuffer> render_buffer,
std::unique_ptr<RenderDelayController> delay_controller,
std::unique_ptr<EchoRemover> echo_remover);
static BlockProcessor* Create2(
const EchoCanceller3Config& config,
int sample_rate_hz,
std::unique_ptr<RenderDelayBuffer> render_buffer,
std::unique_ptr<RenderDelayController> delay_controller,
std::unique_ptr<EchoRemover> echo_remover);
Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
virtual ~BlockProcessor() = default;
// Get current metrics.
virtual void GetMetrics(EchoControl::Metrics* metrics) const = 0;
// Provides an optional external estimate of the audio buffer delay.
virtual void SetAudioBufferDelay(size_t delay_ms) = 0;
Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
// Processes a block of capture data.
virtual void ProcessCapture(
bool echo_path_gain_change,
bool capture_signal_saturation,
Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
std::vector<std::vector<float>>* capture_block) = 0;
// Buffers a block of render data supplied by a FrameBlocker object.
virtual void BufferRender(
const std::vector<std::vector<float>>& render_block) = 0;
Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
// Reports whether echo leakage has been detected in the echo canceller
// output.
virtual void UpdateEchoLeakageStatus(bool leakage_detected) = 0;
Reland of Added first layer of the echo canceller 3 functionality. Reason for reland: Added disabling of the BlockProcessor DEATH tests due to false alarms on the trybots. These errors cannot be reproduced locally and they occur only in the DEATH test code, which means that the memory leaks do not occur under normal conditions. Original issue's description: > Reason for revert: > Memcheck buildbot detected memory leaks in the death tests. The code looks fine > to me, but please investigate what causes the error and reland. > > Original issue's description: > > Added first layer of the echo canceller 3 functionality. > > > > This CL adds the first layer of the echo canceller 3. > > All of the code is as it should, apart from > > block_processor.* which only contains placeholder > > functionality. (Upcoming CLs will add proper > > functionality into those files.) > > > > > > > > BUG=webrtc:6018 > > > > Review-Url: https://codereview.webrtc.org/2584493002 > > Cr-Commit-Position: refs/heads/master@{#15861} > > Committed: > https://chromium.googlesource.com/external/webrtc/+/38fd1758e90bcdc7690a552e7ef0ec0d143d2f30 > > TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org,peah@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6018 BUG=webrtc:6018 TBR=ivoc@webrtc.org,aleloi@webrtc.org,henrik.lundin@webrtc.org Review-Url: https://codereview.webrtc.org/2608233002 Cr-Commit-Position: refs/heads/master@{#15884}
2017-01-03 04:20:34 -08:00
};
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_AEC3_BLOCK_PROCESSOR_H_