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:
Artem Titov
2021-07-28 20:50:03 +02:00
committed by WebRTC LUCI CQ
parent dc6801c618
commit 0b489303d2
102 changed files with 483 additions and 483 deletions

View File

@ -20,13 +20,13 @@ namespace webrtc {
// Where a 'mixture' is a Gaussian density.
struct GmmParameters {
// weight[n] = log(w[n]) - |dimension|/2 * log(2*pi) - 1/2 * log(det(cov[n]));
// weight[n] = log(w[n]) - `dimension`/2 * log(2*pi) - 1/2 * log(det(cov[n]));
// where cov[n] is the covariance matrix of mixture n;
const double* weight;
// pointer to the first element of a |num_mixtures|x|dimension| matrix
// pointer to the first element of a `num_mixtures`x`dimension` matrix
// where kth row is the mean of the kth mixture.
const double* mean;
// pointer to the first element of a |num_mixtures|x|dimension|x|dimension|
// pointer to the first element of a `num_mixtures`x`dimension`x`dimension`
// 3D-matrix, where the kth 2D-matrix is the inverse of the covariance
// matrix of the kth mixture.
const double* covar_inverse;
@ -36,8 +36,8 @@ struct GmmParameters {
int num_mixtures;
};
// Evaluate the given GMM, according to |gmm_parameters|, at the given point
// |x|. If the dimensionality of the given GMM is larger that the maximum
// Evaluate the given GMM, according to `gmm_parameters`, at the given point
// `x`. If the dimensionality of the given GMM is larger that the maximum
// acceptable dimension by the following function -1 is returned.
double EvaluateGmm(const double* x, const GmmParameters& gmm_parameters);

View File

@ -34,7 +34,7 @@ class PitchBasedVad {
// p_combined: an array which contains the combined activity probabilities
// computed prior to the call of this function. The method,
// then, computes the voicing probabilities and combine them
// with the given values. The result are returned in |p|.
// with the given values. The result are returned in `p`.
int VoicingProbability(const AudioFeatures& features, double* p_combined);
private:

View File

@ -14,7 +14,7 @@
namespace webrtc {
// TODO(turajs): Write a description of this function. Also be consistent with
// usage of |sampling_rate_hz| vs |kSamplingFreqHz|.
// usage of `sampling_rate_hz` vs `kSamplingFreqHz`.
void GetSubframesPitchParameters(int sampling_rate_hz,
double* gains,
double* lags,

View File

@ -26,12 +26,12 @@ class StandaloneVad {
// Outputs
// p: a buffer where probabilities are written to.
// length_p: number of elements of |p|.
// length_p: number of elements of `p`.
//
// return value:
// -1: if no audio is stored or VAD returns error.
// 0: in success.
// In case of error the content of |activity| is unchanged.
// In case of error the content of `activity` is unchanged.
//
// Note that due to a high false-positive (VAD decision is active while the
// processed audio is just background noise) rate, stand-alone VAD is used as

View File

@ -31,7 +31,7 @@ TEST(StandaloneVadTest, Api) {
for (size_t n = 0; n < kMaxNumFrames; n++)
EXPECT_EQ(0, vad->AddAudio(data, kLength10Ms));
// Pretend |p| is shorter that it should be.
// Pretend `p` is shorter that it should be.
EXPECT_EQ(-1, vad->GetActivity(p, kMaxNumFrames - 1));
EXPECT_EQ(0, vad->GetActivity(p, kMaxNumFrames));

View File

@ -132,7 +132,7 @@ void VadAudioProc::SubframeCorrelation(double* corr,
kNumSubframeSamples + kNumPastSignalSamples, kLpcOrder);
}
// Compute |kNum10msSubframes| sets of LPC coefficients, one per 10 ms input.
// Compute `kNum10msSubframes` sets of LPC coefficients, one per 10 ms input.
// The analysis window is 15 ms long and it is centered on the first half of
// each 10ms sub-frame. This is equivalent to computing LPC coefficients for the
// first half of each 10 ms subframe.
@ -169,7 +169,7 @@ static float QuadraticInterpolation(float prev_val,
return fractional_index;
}
// 1 / A(z), where A(z) is defined by |lpc| is a model of the spectral envelope
// 1 / A(z), where A(z) is defined by `lpc` is a model of the spectral envelope
// of the input signal. The local maximum of the spectral envelope corresponds
// with the local minimum of A(z). It saves complexity, as we save one
// inversion. Furthermore, we find the first local maximum of magnitude squared,

View File

@ -38,8 +38,8 @@ class VadCircularBuffer {
// The mean value of the elements in the buffer. The return value is zero if
// buffer is empty, i.e. no value is inserted.
double Mean();
// Remove transients. If the values exceed |val_threshold| for a period
// shorter then or equal to |width_threshold|, then that period is considered
// Remove transients. If the values exceed `val_threshold` for a period
// shorter then or equal to `width_threshold`, then that period is considered
// transient and set to zero.
int RemoveTransient(int width_threshold, double val_threshold);
@ -49,7 +49,7 @@ class VadCircularBuffer {
// insertion. |index = 1| is the one before the most recent insertion, and
// so on.
int Get(int index, double* value) const;
// Set a given position to |value|. |index| is interpreted as above.
// Set a given position to `value`. `index` is interpreted as above.
int Set(int index, double value);
// Return the number of valid elements in the buffer.
int BufferLevel();

View File

@ -32,7 +32,7 @@ VoiceActivityDetector::VoiceActivityDetector()
VoiceActivityDetector::~VoiceActivityDetector() = default;
// Because ISAC has a different chunk length, it updates
// |chunkwise_voice_probabilities_| and |chunkwise_rms_| when there is new data.
// `chunkwise_voice_probabilities_` and `chunkwise_rms_` when there is new data.
// Otherwise it clears them.
void VoiceActivityDetector::ProcessChunk(const int16_t* audio,
size_t length,
@ -49,7 +49,7 @@ void VoiceActivityDetector::ProcessChunk(const int16_t* audio,
}
RTC_DCHECK_EQ(length, kLength10Ms);
// Each chunk needs to be passed into |standalone_vad_|, because internally it
// Each chunk needs to be passed into `standalone_vad_`, because internally it
// buffers the audio and processes it all at once when GetActivity() is
// called.
RTC_CHECK_EQ(standalone_vad_->AddAudio(resampled_ptr, length), 0);

View File

@ -133,7 +133,7 @@ TEST(VoiceActivityDetectorTest, Noise16kHzHasLowVoiceProbabilities) {
vad.ProcessChunk(&data[0], data.size(), kSampleRateHz);
// Before the |vad has enough data to process an ISAC block it will return
// the default value, 1.f, which would ruin the |max_probability| value.
// the default value, 1.f, which would ruin the `max_probability` value.
if (i > kNumChunksPerIsacBlock) {
max_probability = std::max(max_probability, vad.last_voice_probability());
}
@ -156,7 +156,7 @@ TEST(VoiceActivityDetectorTest, Noise32kHzHasLowVoiceProbabilities) {
vad.ProcessChunk(&data[0], data.size(), 2 * kSampleRateHz);
// Before the |vad has enough data to process an ISAC block it will return
// the default value, 1.f, which would ruin the |max_probability| value.
// the default value, 1.f, which would ruin the `max_probability` value.
if (i > kNumChunksPerIsacBlock) {
max_probability = std::max(max_probability, vad.last_voice_probability());
}