webrtc_m130/modules/audio_mixer/frame_combiner.h

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

46 lines
1.5 KiB
C
Raw Normal View History

/*
* Copyright (c) 2017 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_MIXER_FRAME_COMBINER_H_
#define MODULES_AUDIO_MIXER_FRAME_COMBINER_H_
#include <memory>
#include <vector>
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/include/module_common_types.h"
namespace webrtc {
class FrameCombiner {
public:
Revert "Choose between APM-AGC-Limiter and Apm-AGC2-fixed-gain_controller." This reverts commit bd7b461f16b53363e2c510893d8d3aade5737f3a. Reason for revert: Broke the internal project. The issue maybe related to the apm_debug_dump configuration. Original change's description: > Choose between APM-AGC-Limiter and Apm-AGC2-fixed-gain_controller. > > The webrtc::AudioMixer uses a limiter component. This CL changes the > APM-AGC limiter to the APM-AGC2 limiter though a Chrome field trial. > > The new limiter has a float interface. Since we're moving to it, we > now mix in floats as well. After this CL the mixer will support two > limiters. The limiters have different interfaces and need different > processing steps. Because of that, we make (rather big) changes to the > control flow in FrameCombiner. For a short while, we will mix in > deinterleaved floats when using any limiter. > > NOTRY=true > > Bug: webrtc:8925 > Change-Id: Ie296c2b0d94f3f0078811a2a58f6fbf0f3e6e4a8 > Reviewed-on: https://webrtc-review.googlesource.com/56141 > Commit-Queue: Alex Loiko <aleloi@webrtc.org> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22185} TBR=gustaf@webrtc.org,aleloi@webrtc.org Change-Id: I3dd1a2b1fca32c4dd046e6fc325744079e3ac5ca No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8925 Reviewed-on: https://webrtc-review.googlesource.com/57940 Reviewed-by: Zhi Huang <zhihuang@webrtc.org> Commit-Queue: Zhi Huang <zhihuang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22189}
2018-02-26 21:03:38 +00:00
explicit FrameCombiner(bool use_apm_limiter);
~FrameCombiner();
// Combine several frames into one. Assumes sample_rate,
// samples_per_channel of the input frames match the parameters. The
// parameters 'number_of_channels' and 'sample_rate' are needed
// because 'mix_list' can be empty. The parameter
// 'number_of_streams' is used for determining whether to pass the
// data through a limiter.
void Combine(const std::vector<AudioFrame*>& mix_list,
size_t number_of_channels,
int sample_rate,
size_t number_of_streams,
Revert "Choose between APM-AGC-Limiter and Apm-AGC2-fixed-gain_controller." This reverts commit bd7b461f16b53363e2c510893d8d3aade5737f3a. Reason for revert: Broke the internal project. The issue maybe related to the apm_debug_dump configuration. Original change's description: > Choose between APM-AGC-Limiter and Apm-AGC2-fixed-gain_controller. > > The webrtc::AudioMixer uses a limiter component. This CL changes the > APM-AGC limiter to the APM-AGC2 limiter though a Chrome field trial. > > The new limiter has a float interface. Since we're moving to it, we > now mix in floats as well. After this CL the mixer will support two > limiters. The limiters have different interfaces and need different > processing steps. Because of that, we make (rather big) changes to the > control flow in FrameCombiner. For a short while, we will mix in > deinterleaved floats when using any limiter. > > NOTRY=true > > Bug: webrtc:8925 > Change-Id: Ie296c2b0d94f3f0078811a2a58f6fbf0f3e6e4a8 > Reviewed-on: https://webrtc-review.googlesource.com/56141 > Commit-Queue: Alex Loiko <aleloi@webrtc.org> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22185} TBR=gustaf@webrtc.org,aleloi@webrtc.org Change-Id: I3dd1a2b1fca32c4dd046e6fc325744079e3ac5ca No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8925 Reviewed-on: https://webrtc-review.googlesource.com/57940 Reviewed-by: Zhi Huang <zhihuang@webrtc.org> Commit-Queue: Zhi Huang <zhihuang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22189}
2018-02-26 21:03:38 +00:00
AudioFrame* audio_frame_for_mixing) const;
private:
Revert "Choose between APM-AGC-Limiter and Apm-AGC2-fixed-gain_controller." This reverts commit bd7b461f16b53363e2c510893d8d3aade5737f3a. Reason for revert: Broke the internal project. The issue maybe related to the apm_debug_dump configuration. Original change's description: > Choose between APM-AGC-Limiter and Apm-AGC2-fixed-gain_controller. > > The webrtc::AudioMixer uses a limiter component. This CL changes the > APM-AGC limiter to the APM-AGC2 limiter though a Chrome field trial. > > The new limiter has a float interface. Since we're moving to it, we > now mix in floats as well. After this CL the mixer will support two > limiters. The limiters have different interfaces and need different > processing steps. Because of that, we make (rather big) changes to the > control flow in FrameCombiner. For a short while, we will mix in > deinterleaved floats when using any limiter. > > NOTRY=true > > Bug: webrtc:8925 > Change-Id: Ie296c2b0d94f3f0078811a2a58f6fbf0f3e6e4a8 > Reviewed-on: https://webrtc-review.googlesource.com/56141 > Commit-Queue: Alex Loiko <aleloi@webrtc.org> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22185} TBR=gustaf@webrtc.org,aleloi@webrtc.org Change-Id: I3dd1a2b1fca32c4dd046e6fc325744079e3ac5ca No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8925 Reviewed-on: https://webrtc-review.googlesource.com/57940 Reviewed-by: Zhi Huang <zhihuang@webrtc.org> Commit-Queue: Zhi Huang <zhihuang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22189}
2018-02-26 21:03:38 +00:00
const bool use_apm_limiter_;
std::unique_ptr<AudioProcessing> limiter_;
};
} // namespace webrtc
#endif // MODULES_AUDIO_MIXER_FRAME_COMBINER_H_