Use backticks not vertical bars to denote variables in comments for /modules/audio_processing
Bug: webrtc:12338 Change-Id: I85bff694dd2ead83c939c4d1945eff82e1296001 No-Presubmit: True Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227161 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34690}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
dc6801c618
commit
0b489303d2
@ -24,13 +24,13 @@ class Agc {
|
||||
Agc();
|
||||
virtual ~Agc();
|
||||
|
||||
// |audio| must be mono; in a multi-channel stream, provide the first (usually
|
||||
// `audio` must be mono; in a multi-channel stream, provide the first (usually
|
||||
// left) channel.
|
||||
virtual void Process(const int16_t* audio, size_t length, int sample_rate_hz);
|
||||
|
||||
// Retrieves the difference between the target RMS level and the current
|
||||
// signal RMS level in dB. Returns true if an update is available and false
|
||||
// otherwise, in which case |error| should be ignored and no action taken.
|
||||
// otherwise, in which case `error` should be ignored and no action taken.
|
||||
virtual bool GetRmsErrorDb(int* error);
|
||||
virtual void Reset();
|
||||
|
||||
|
||||
@ -280,7 +280,7 @@ void MonoAgc::SetLevel(int new_level) {
|
||||
void MonoAgc::SetMaxLevel(int level) {
|
||||
RTC_DCHECK_GE(level, clipped_level_min_);
|
||||
max_level_ = level;
|
||||
// Scale the |kSurplusCompressionGain| linearly across the restricted
|
||||
// Scale the `kSurplusCompressionGain` linearly across the restricted
|
||||
// level range.
|
||||
max_compression_gain_ =
|
||||
kMaxCompressionGain + std::floor((1.f * kMaxMicLevel - max_level_) /
|
||||
@ -307,7 +307,7 @@ int MonoAgc::CheckVolumeAndReset() {
|
||||
int level = stream_analog_level_;
|
||||
// Reasons for taking action at startup:
|
||||
// 1) A person starting a call is expected to be heard.
|
||||
// 2) Independent of interpretation of |level| == 0 we should raise it so the
|
||||
// 2) Independent of interpretation of `level` == 0 we should raise it so the
|
||||
// AGC can do its job properly.
|
||||
if (level == 0 && !startup_) {
|
||||
RTC_DLOG(LS_INFO)
|
||||
|
||||
@ -112,7 +112,7 @@ class AgcManagerDirect final {
|
||||
FRIEND_TEST_ALL_PREFIXES(AgcManagerDirectStandaloneTest,
|
||||
EnableClippingPredictorLowersVolume);
|
||||
|
||||
// Dependency injection for testing. Don't delete |agc| as the memory is owned
|
||||
// Dependency injection for testing. Don't delete `agc` as the memory is owned
|
||||
// by the manager.
|
||||
AgcManagerDirect(
|
||||
Agc* agc,
|
||||
@ -196,7 +196,7 @@ class MonoAgc {
|
||||
|
||||
// Set the maximum level the AGC is allowed to apply. Also updates the
|
||||
// maximum compression gain to compensate. The level must be at least
|
||||
// |kClippedLevelMin|.
|
||||
// `kClippedLevelMin`.
|
||||
void SetMaxLevel(int level);
|
||||
|
||||
int CheckVolumeAndReset();
|
||||
|
||||
@ -20,12 +20,12 @@ namespace webrtc {
|
||||
// Recommended to be enabled on the client-side.
|
||||
class GainControl {
|
||||
public:
|
||||
// When an analog mode is set, this must be called prior to |ProcessStream()|
|
||||
// When an analog mode is set, this must be called prior to `ProcessStream()`
|
||||
// to pass the current analog level from the audio HAL. Must be within the
|
||||
// range provided to |set_analog_level_limits()|.
|
||||
// range provided to `set_analog_level_limits()`.
|
||||
virtual int set_stream_analog_level(int level) = 0;
|
||||
|
||||
// When an analog mode is set, this should be called after |ProcessStream()|
|
||||
// When an analog mode is set, this should be called after `ProcessStream()`
|
||||
// to obtain the recommended new analog level for the audio HAL. It is the
|
||||
// users responsibility to apply this level.
|
||||
virtual int stream_analog_level() const = 0;
|
||||
@ -33,7 +33,7 @@ class GainControl {
|
||||
enum Mode {
|
||||
// Adaptive mode intended for use if an analog volume control is available
|
||||
// on the capture device. It will require the user to provide coupling
|
||||
// between the OS mixer controls and AGC through the |stream_analog_level()|
|
||||
// between the OS mixer controls and AGC through the `stream_analog_level()`
|
||||
// functions.
|
||||
//
|
||||
// It consists of an analog gain prescription for the audio device and a
|
||||
@ -61,7 +61,7 @@ class GainControl {
|
||||
virtual int set_mode(Mode mode) = 0;
|
||||
virtual Mode mode() const = 0;
|
||||
|
||||
// Sets the target peak |level| (or envelope) of the AGC in dBFs (decibels
|
||||
// Sets the target peak `level` (or envelope) of the AGC in dBFs (decibels
|
||||
// from digital full-scale). The convention is to use positive values. For
|
||||
// instance, passing in a value of 3 corresponds to -3 dBFs, or a target
|
||||
// level 3 dB below full-scale. Limited to [0, 31].
|
||||
@ -71,7 +71,7 @@ class GainControl {
|
||||
virtual int set_target_level_dbfs(int level) = 0;
|
||||
virtual int target_level_dbfs() const = 0;
|
||||
|
||||
// Sets the maximum |gain| the digital compression stage may apply, in dB. A
|
||||
// Sets the maximum `gain` the digital compression stage may apply, in dB. A
|
||||
// higher number corresponds to greater compression, while a value of 0 will
|
||||
// leave the signal uncompressed. Limited to [0, 90].
|
||||
virtual int set_compression_gain_db(int gain) = 0;
|
||||
@ -83,7 +83,7 @@ class GainControl {
|
||||
virtual int enable_limiter(bool enable) = 0;
|
||||
virtual bool is_limiter_enabled() const = 0;
|
||||
|
||||
// Sets the |minimum| and |maximum| analog levels of the audio capture device.
|
||||
// Sets the `minimum` and `maximum` analog levels of the audio capture device.
|
||||
// Must be set if and only if an analog mode is used. Limited to [0, 65535].
|
||||
virtual int set_analog_level_limits(int minimum, int maximum) = 0;
|
||||
virtual int analog_level_minimum() const = 0;
|
||||
|
||||
@ -160,7 +160,7 @@ int WebRtcAgc_AddMic(void* state,
|
||||
|
||||
/* apply slowly varying digital gain */
|
||||
if (stt->micVol > stt->maxAnalog) {
|
||||
/* |maxLevel| is strictly >= |micVol|, so this condition should be
|
||||
/* `maxLevel` is strictly >= `micVol`, so this condition should be
|
||||
* satisfied here, ensuring there is no divide-by-zero. */
|
||||
RTC_DCHECK_GT(stt->maxLevel, stt->maxAnalog);
|
||||
|
||||
|
||||
@ -184,9 +184,9 @@ int32_t WebRtcAgc_CalculateGainTable(int32_t* gainTable, // Q16
|
||||
numFIX -= (int32_t)logApprox * diffGain; // Q14
|
||||
|
||||
// Calculate ratio
|
||||
// Shift |numFIX| as much as possible.
|
||||
// Ensure we avoid wrap-around in |den| as well.
|
||||
if (numFIX > (den >> 8) || -numFIX > (den >> 8)) { // |den| is Q8.
|
||||
// Shift `numFIX` as much as possible.
|
||||
// Ensure we avoid wrap-around in `den` as well.
|
||||
if (numFIX > (den >> 8) || -numFIX > (den >> 8)) { // `den` is Q8.
|
||||
zeros = WebRtcSpl_NormW32(numFIX);
|
||||
} else {
|
||||
zeros = WebRtcSpl_NormW32(den) + 8;
|
||||
|
||||
@ -114,7 +114,7 @@ void LoudnessHistogram::RemoveOldestEntryAndUpdate() {
|
||||
|
||||
void LoudnessHistogram::RemoveTransient() {
|
||||
// Don't expect to be here if high-activity region is longer than
|
||||
// |kTransientWidthThreshold| or there has not been any transient.
|
||||
// `kTransientWidthThreshold` or there has not been any transient.
|
||||
RTC_DCHECK_LE(len_high_activity_, kTransientWidthThreshold);
|
||||
int index =
|
||||
(buffer_index_ > 0) ? (buffer_index_ - 1) : len_circular_buffer_ - 1;
|
||||
|
||||
@ -25,7 +25,7 @@ class LoudnessHistogram {
|
||||
static LoudnessHistogram* Create();
|
||||
|
||||
// Create a sliding LoudnessHistogram, i.e. the histogram represents the last
|
||||
// |window_size| samples.
|
||||
// `window_size` samples.
|
||||
static LoudnessHistogram* Create(int window_size);
|
||||
~LoudnessHistogram();
|
||||
|
||||
@ -49,7 +49,7 @@ class LoudnessHistogram {
|
||||
LoudnessHistogram();
|
||||
explicit LoudnessHistogram(int window);
|
||||
|
||||
// Find the histogram bin associated with the given |rms|.
|
||||
// Find the histogram bin associated with the given `rms`.
|
||||
int GetBinIndex(double rms);
|
||||
|
||||
void RemoveOldestEntryAndUpdate();
|
||||
@ -63,10 +63,10 @@ class LoudnessHistogram {
|
||||
// Number of times the histogram is updated
|
||||
int num_updates_;
|
||||
// Audio content, this should be equal to the sum of the components of
|
||||
// |bin_count_q10_|.
|
||||
// `bin_count_q10_`.
|
||||
int64_t audio_content_q10_;
|
||||
|
||||
// LoudnessHistogram of input RMS in Q10 with |kHistSize_| bins. In each
|
||||
// LoudnessHistogram of input RMS in Q10 with `kHistSize_` bins. In each
|
||||
// 'Update(),' we increment the associated histogram-bin with the given
|
||||
// probability. The increment is implemented in Q10 to avoid rounding errors.
|
||||
int64_t bin_count_q10_[kHistSize];
|
||||
|
||||
Reference in New Issue
Block a user