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

86 lines
3.1 KiB
C
Raw Permalink 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 <stddef.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 "api/audio/echo_canceller3_config.h"
#include "api/audio/echo_control.h"
#include "api/environment/environment.h"
#include "modules/audio_processing/aec3/block.h"
#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:
static std::unique_ptr<BlockProcessor> Create(
const Environment& env,
const EchoCanceller3Config& config,
int sample_rate_hz,
size_t num_render_channels,
size_t num_capture_channels);
// Only used for testing purposes.
static std::unique_ptr<BlockProcessor> Create(
const Environment& env,
const EchoCanceller3Config& config,
int sample_rate_hz,
Reland "Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."" This is a reland of a66395e72f9fc86873bf443579ec73c3d78af240 Original change's description: > Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3." > > This is a reland of f3a197e55323aee974a932c52dd19fa88e5d4e38 > > Original change's description: > > Add core multi-channel pipeline in AEC3 > > This CL adds basic the basic pipeline to support multi-channel > > processing in AEC3. > > > > Apart from that, it removes the 8 kHz processing support in several > > places of the AEC3 code. > > > > Bug: webrtc:10913 > > Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332 > > Commit-Queue: Per Åhgren <peah@webrtc.org> > > Reviewed-by: Sam Zackrisson <saza@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#29017} > > Bug: webrtc:10913 > Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124 > Reviewed-by: Sam Zackrisson <saza@webrtc.org> > Commit-Queue: Per Åhgren <peah@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#29034} Bug: webrtc:10913 Change-Id: Id8da5666df8c86f290c73ad5dc9958199f1a7ebe Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151127 Commit-Queue: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Sam Zackrisson <saza@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29042}
2019-09-02 17:01:19 +02:00
size_t num_render_channels,
size_t num_capture_channels,
std::unique_ptr<RenderDelayBuffer> render_buffer);
static std::unique_ptr<BlockProcessor> Create(
const EchoCanceller3Config& config,
int sample_rate_hz,
Reland "Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3."" This is a reland of a66395e72f9fc86873bf443579ec73c3d78af240 Original change's description: > Reland "Add core multi-channel pipeline in AEC3 This CL adds basic the basic pipeline to support multi-channel processing in AEC3." > > This is a reland of f3a197e55323aee974a932c52dd19fa88e5d4e38 > > Original change's description: > > Add core multi-channel pipeline in AEC3 > > This CL adds basic the basic pipeline to support multi-channel > > processing in AEC3. > > > > Apart from that, it removes the 8 kHz processing support in several > > places of the AEC3 code. > > > > Bug: webrtc:10913 > > Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332 > > Commit-Queue: Per Åhgren <peah@webrtc.org> > > Reviewed-by: Sam Zackrisson <saza@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#29017} > > Bug: webrtc:10913 > Change-Id: Ifc4b13bd994cfd22dca8f8755fa5700617cc379d > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151124 > Reviewed-by: Sam Zackrisson <saza@webrtc.org> > Commit-Queue: Per Åhgren <peah@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#29034} Bug: webrtc:10913 Change-Id: Id8da5666df8c86f290c73ad5dc9958199f1a7ebe Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151127 Commit-Queue: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Sam Zackrisson <saza@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29042}
2019-09-02 17:01:19 +02:00
size_t num_render_channels,
size_t num_capture_channels,
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(int 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,
Block* linear_output,
Block* capture_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
// Buffers a block of render data supplied by a FrameBlocker object.
virtual void BufferRender(const Block& 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;
// Specifies whether the capture output will be used. The purpose of this is
// to allow the block processor to deactivate some of the processing when the
// resulting output is anyway not used, for instance when the endpoint is
// muted.
virtual void SetCaptureOutputUsage(bool capture_output_used) = 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_