Comments in FixedDigitalLevelEstimator.

Changes in response to comments. Comments were not addressed in
https://webrtc-review.googlesource.com/c/src/+/52381
NOTRY=TRUE
TBR=saza@webrtc.org

Bug: webrt:7949
Change-Id: Id1ae2097d24159a8046ff85ea41959540bc48c4b
Reviewed-on: https://webrtc-review.googlesource.com/54500
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22056}
This commit is contained in:
Alex Loiko 2018-02-16 13:58:45 +01:00 committed by Commit Bot
parent c9fcedbab7
commit a0262daed7
2 changed files with 10 additions and 5 deletions

View File

@ -26,13 +26,18 @@ class ApmDataDumper;
// filtering.
class FixedDigitalLevelEstimator {
public:
// Sample rates are allowed if the number of samples in a frame
// (sample_rate_hz * kFrameDurationMs / 1000) is divisible by
// kSubFramesInSample. For kFrameDurationMs=10 and
// kSubFramesInSample=20, this means that sample_rate_hz has to be
// divisible by 2000.
FixedDigitalLevelEstimator(size_t sample_rate_hz,
ApmDataDumper* apm_data_dumper);
// The input is assumed to be in FloatS16 format. Scaled input will
// produce similarly scaled output. A frame of
// length kFrameDurationMs=10 ms produces kSubFramesInFrame=20 level
// estimates in the same scale.
// produce similarly scaled output. A frame of with kFrameDurationMs
// ms of audio produces a level estimates in the same scale. The
// level estimate contains kSubFramesInFrame values.
std::array<float, kSubFramesInFrame> ComputeLevel(
const AudioFrameView<const float>& float_frame);
@ -43,7 +48,7 @@ class FixedDigitalLevelEstimator {
private:
void CheckParameterCombination();
ApmDataDumper* const apm_data_dumper_;
ApmDataDumper* const apm_data_dumper_ = nullptr;
float filter_state_level_ = 0.f;
size_t samples_in_frame_;
size_t samples_in_sub_frame_;

View File

@ -39,7 +39,7 @@ TEST(AudioFrameTest, ConstructFromAudioBuffer) {
AudioFrameView<const float> other_const_view = non_const_view;
static_cast<void>(other_const_view);
// But not the other way.
// But not the other way. The following will fail:
// non_const_view = other_const_view;
AudioFrameView<int16_t> non_const_int16_view(