Use backticks not vertical bars to denote variables in comments for /modules/video_coding

Bug: webrtc:12338
Change-Id: Ia8a9adea291d594e4f59a6a1203a7bfb0758adac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227165
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34684}
This commit is contained in:
Artem Titov
2021-08-09 13:02:57 +02:00
committed by WebRTC LUCI CQ
parent 7f854bce1f
commit dcd7fc7ea8
83 changed files with 268 additions and 268 deletions

View File

@ -310,7 +310,7 @@ void DefaultTemporalLayers::OnRatesUpdated(
RTC_DCHECK_LT(stream_index, StreamCount());
RTC_DCHECK_GT(bitrates_bps.size(), 0);
RTC_DCHECK_LE(bitrates_bps.size(), num_layers_);
// |bitrates_bps| uses individual rate per layer, but Vp8EncoderConfig wants
// `bitrates_bps` uses individual rate per layer, but Vp8EncoderConfig wants
// the accumulated rate, so sum them up.
new_bitrates_bps_ = bitrates_bps;
new_bitrates_bps_->resize(num_layers_);
@ -419,11 +419,11 @@ Vp8FrameConfig DefaultTemporalLayers::NextFrameConfig(size_t stream_index,
// base-layer references).
tl_config.layer_sync = IsSyncFrame(tl_config);
// Increment frame age, this needs to be in sync with |pattern_idx_|,
// Increment frame age, this needs to be in sync with `pattern_idx_`,
// so must update it here. Resetting age to 0 must be done when encoding is
// complete though, and so in the case of pipelining encoder it might lag.
// To prevent this data spill over into the next iteration,
// the |pedning_frames_| map is reset in loops. If delay is constant,
// the `pedning_frames_` map is reset in loops. If delay is constant,
// the relative age should still be OK for the search order.
for (size_t& n : frames_since_buffer_refresh_) {
++n;
@ -444,7 +444,7 @@ Vp8FrameConfig DefaultTemporalLayers::NextFrameConfig(size_t stream_index,
void DefaultTemporalLayers::ValidateReferences(BufferFlags* flags,
Vp8BufferReference ref) const {
// Check if the buffer specified by |ref| is actually referenced, and if so
// Check if the buffer specified by `ref` is actually referenced, and if so
// if it also a dynamically updating one (buffers always just containing
// keyframes are always safe to reference).
if ((*flags & BufferFlags::kReference) &&
@ -552,7 +552,7 @@ void DefaultTemporalLayers::OnEncodeDone(size_t stream_index,
for (Vp8BufferReference buffer : kAllBuffers) {
if (is_static_buffer_[BufferToIndex(buffer)]) {
// Update frame count of all kf-only buffers, regardless of state of
// |pending_frames_|.
// `pending_frames_`.
ResetNumFramesSinceBufferRefresh(buffer);
} else {
// Key-frames update all buffers, this should be reflected when

View File

@ -653,8 +653,8 @@ TEST_F(TemporalLayersTest, KeyFrame) {
uint32_t timestamp = 0;
for (int i = 0; i < 7; ++i) {
// Temporal pattern starts from 0 after key frame. Let the first |i| - 1
// frames be delta frames, and the |i|th one key frame.
// Temporal pattern starts from 0 after key frame. Let the first `i` - 1
// frames be delta frames, and the `i`th one key frame.
for (int j = 1; j <= i; ++j) {
// Since last frame was always a keyframe and thus index 0 in the pattern,
// this loop starts at index 1.
@ -780,7 +780,7 @@ TEST_P(TemporalLayersReferenceTest, ValidFrameConfigs) {
// of the buffer state; which buffers references which temporal layers (if
// (any). If a given buffer is never updated, it is legal to reference it
// even for sync frames. In order to be general, don't assume TL0 always
// updates |last|.
// updates `last`.
std::vector<Vp8FrameConfig> tl_configs(kMaxPatternLength);
for (int i = 0; i < kMaxPatternLength; ++i) {
Vp8FrameConfig tl_config = tl.NextFrameConfig(0, timestamp_);

View File

@ -46,7 +46,7 @@ class LibvpxVp8Decoder : public VideoDecoder {
DeblockParams(int max_level, int degrade_qp, int min_qp)
: max_level(max_level), degrade_qp(degrade_qp), min_qp(min_qp) {}
int max_level; // Deblocking strength: [0, 16].
int degrade_qp; // If QP value is below, start lowering |max_level|.
int degrade_qp; // If QP value is below, start lowering `max_level`.
int min_qp; // If QP value is below, turn off deblocking.
};

View File

@ -107,10 +107,10 @@ bool MaybeSetNewValue(const absl::optional<T>& new_value,
}
}
// Adds configuration from |new_config| to |base_config|. Both configs consist
// of optionals, and only optionals which are set in |new_config| can have
// an effect. (That is, set values in |base_config| cannot be unset.)
// Returns |true| iff any changes were made to |base_config|.
// Adds configuration from `new_config` to `base_config`. Both configs consist
// of optionals, and only optionals which are set in `new_config` can have
// an effect. (That is, set values in `base_config` cannot be unset.)
// Returns `true` iff any changes were made to `base_config`.
bool MaybeExtendVp8EncoderConfig(const Vp8EncoderConfig& new_config,
Vp8EncoderConfig* base_config) {
bool changes_made = false;
@ -711,7 +711,7 @@ int LibvpxVp8Encoder::GetCpuSpeed(int width, int height) {
#else
// For non-ARM, increase encoding complexity (i.e., use lower speed setting)
// if resolution is below CIF. Otherwise, keep the default/user setting
// (|cpu_speed_default_|) set on InitEncode via VP8().complexity.
// (`cpu_speed_default_`) set on InitEncode via VP8().complexity.
if (width * height < 352 * 288)
return (cpu_speed_default_ < -4) ? -4 : cpu_speed_default_;
else
@ -976,8 +976,8 @@ int LibvpxVp8Encoder::Encode(const VideoFrame& frame,
flags[i] = send_key_frame ? VPX_EFLAG_FORCE_KF : EncodeFlags(tl_configs[i]);
}
// Scale and map buffers and set |raw_images_| to hold pointers to the result.
// Because |raw_images_| are set to hold pointers to the prepared buffers, we
// Scale and map buffers and set `raw_images_` to hold pointers to the result.
// Because `raw_images_` are set to hold pointers to the prepared buffers, we
// need to keep these buffers alive through reference counting until after
// encoding is complete.
std::vector<rtc::scoped_refptr<VideoFrameBuffer>> prepared_buffers =
@ -1017,7 +1017,7 @@ int LibvpxVp8Encoder::Encode(const VideoFrame& frame,
// Set the encoder frame flags and temporal layer_id for each spatial stream.
// Note that streams are defined starting from lowest resolution at
// position 0 to highest resolution at position |encoders_.size() - 1|,
// whereas |encoder_| is from highest to lowest resolution.
// whereas `encoder_` is from highest to lowest resolution.
for (size_t i = 0; i < encoders_.size(); ++i) {
const size_t stream_idx = encoders_.size() - 1 - i;
@ -1048,7 +1048,7 @@ int LibvpxVp8Encoder::Encode(const VideoFrame& frame,
(num_tries == 1 &&
error == WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT)) {
++num_tries;
// Note we must pass 0 for |flags| field in encode call below since they are
// Note we must pass 0 for `flags` field in encode call below since they are
// set above in |libvpx_interface_->vpx_codec_control_| function for each
// encoder/spatial layer.
error = libvpx_->codec_encode(&encoders_[0], &raw_images_[0], timestamp_,
@ -1237,8 +1237,8 @@ VideoEncoder::EncoderInfo LibvpxVp8Encoder::GetEncoderInfo() const {
VideoFrameBuffer::Type::kNV12};
if (inited_) {
// |encoder_idx| is libvpx index where 0 is highest resolution.
// |si| is simulcast index, where 0 is lowest resolution.
// `encoder_idx` is libvpx index where 0 is highest resolution.
// `si` is simulcast index, where 0 is lowest resolution.
for (size_t si = 0, encoder_idx = encoders_.size() - 1;
si < encoders_.size(); ++si, --encoder_idx) {
info.fps_allocation[si].clear();
@ -1308,7 +1308,7 @@ LibvpxVp8Encoder::PrepareBuffers(rtc::scoped_refptr<VideoFrameBuffer> buffer) {
rtc::scoped_refptr<VideoFrameBuffer> mapped_buffer;
if (buffer->type() != VideoFrameBuffer::Type::kNative) {
// |buffer| is already mapped.
// `buffer` is already mapped.
mapped_buffer = buffer;
} else {
// Attempt to map to one of the supported formats.
@ -1330,7 +1330,7 @@ LibvpxVp8Encoder::PrepareBuffers(rtc::scoped_refptr<VideoFrameBuffer> buffer) {
RTC_CHECK(converted_buffer->type() == VideoFrameBuffer::Type::kI420 ||
converted_buffer->type() == VideoFrameBuffer::Type::kI420A);
// Because |buffer| had to be converted, use |converted_buffer| instead...
// Because `buffer` had to be converted, use `converted_buffer` instead...
buffer = mapped_buffer = converted_buffer;
}
@ -1349,15 +1349,15 @@ LibvpxVp8Encoder::PrepareBuffers(rtc::scoped_refptr<VideoFrameBuffer> buffer) {
RTC_NOTREACHED();
}
// Prepare |raw_images_| from |mapped_buffer| and, if simulcast, scaled
// versions of |buffer|.
// Prepare `raw_images_` from `mapped_buffer` and, if simulcast, scaled
// versions of `buffer`.
std::vector<rtc::scoped_refptr<VideoFrameBuffer>> prepared_buffers;
SetRawImagePlanes(&raw_images_[0], mapped_buffer);
prepared_buffers.push_back(mapped_buffer);
for (size_t i = 1; i < encoders_.size(); ++i) {
// Native buffers should implement optimized scaling and is the preferred
// buffer to scale. But if the buffer isn't native, it should be cheaper to
// scale from the previously prepared buffer which is smaller than |buffer|.
// scale from the previously prepared buffer which is smaller than `buffer`.
VideoFrameBuffer* buffer_to_scale =
buffer->type() == VideoFrameBuffer::Type::kNative
? buffer.get()

View File

@ -83,7 +83,7 @@ class LibvpxVp8Encoder : public VideoEncoder {
int GetEncodedPartitions(const VideoFrame& input_image,
bool retransmission_allowed);
// Set the stream state for stream |stream_idx|.
// Set the stream state for stream `stream_idx`.
void SetStreamState(bool send_stream, int stream_idx);
uint32_t MaxIntraTarget(uint32_t optimal_buffer_size);
@ -95,8 +95,8 @@ class LibvpxVp8Encoder : public VideoEncoder {
bool UpdateVpxConfiguration(size_t stream_index);
void MaybeUpdatePixelFormat(vpx_img_fmt fmt);
// Prepares |raw_image_| to reference image data of |buffer|, or of mapped or
// scaled versions of |buffer|. Returns a list of buffers that got referenced
// Prepares `raw_image_` to reference image data of `buffer`, or of mapped or
// scaled versions of `buffer`. Returns a list of buffers that got referenced
// as a result, allowing the caller to keep references to them until after
// encoding has finished. On failure to convert the buffer, an empty list is
// returned.

View File

@ -255,7 +255,7 @@ void ScreenshareLayers::OnRatesUpdated(
RTC_DCHECK_GE(bitrates_bps.size(), 1);
RTC_DCHECK_LE(bitrates_bps.size(), 2);
// |bitrates_bps| uses individual rates per layer, but we want to use the
// `bitrates_bps` uses individual rates per layer, but we want to use the
// accumulated rate here.
uint32_t tl0_kbps = bitrates_bps[0] / 1000;
uint32_t tl1_kbps = tl0_kbps;
@ -354,7 +354,7 @@ void ScreenshareLayers::OnEncodeDone(size_t stream_index,
RTC_DCHECK_EQ(vp8_info.referencedBuffersCount, 0u);
RTC_DCHECK_EQ(vp8_info.updatedBuffersCount, 0u);
// Note that |frame_config| is not derefernced if |is_keyframe|,
// Note that `frame_config` is not derefernced if `is_keyframe`,
// meaning it's never dereferenced if the optional may be unset.
for (int i = 0; i < static_cast<int>(Vp8FrameConfig::Buffer::kCount); ++i) {
bool references = false;