Add qp counter for H264 in SendStatisticsProxy.
BUG=webrtc:6578 Review-Url: https://codereview.webrtc.org/2437323002 Cr-Commit-Position: refs/heads/master@{#14895}
This commit is contained in:
@ -250,6 +250,13 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
<< spatial_idx;
|
<< spatial_idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int qp_h264 = it.second.h264.Avg(kMinRequiredMetricsSamples);
|
||||||
|
if (qp_h264 != -1) {
|
||||||
|
int spatial_idx = it.first;
|
||||||
|
RTC_DCHECK_EQ(-1, spatial_idx);
|
||||||
|
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "Encoded.Qp.H264",
|
||||||
|
qp_h264);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first_rtcp_stats_time_ms_ != -1) {
|
if (first_rtcp_stats_time_ms_ != -1) {
|
||||||
@ -520,6 +527,9 @@ void SendStatisticsProxy::OnSendEncodedImage(
|
|||||||
? -1
|
? -1
|
||||||
: codec_info->codecSpecific.VP9.spatial_idx;
|
: codec_info->codecSpecific.VP9.spatial_idx;
|
||||||
uma_container_->qp_counters_[spatial_idx].vp9.Add(encoded_image.qp_);
|
uma_container_->qp_counters_[spatial_idx].vp9.Add(encoded_image.qp_);
|
||||||
|
} else if (codec_info->codecType == kVideoCodecH264) {
|
||||||
|
int spatial_idx = -1;
|
||||||
|
uma_container_->qp_counters_[spatial_idx].h264.Add(encoded_image.qp_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,8 +138,9 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver,
|
|||||||
int64_t bitrate_update_ms;
|
int64_t bitrate_update_ms;
|
||||||
};
|
};
|
||||||
struct QpCounters {
|
struct QpCounters {
|
||||||
SampleCounter vp8; // QP range: 0-127
|
SampleCounter vp8; // QP range: 0-127
|
||||||
SampleCounter vp9; // QP range: 0-255
|
SampleCounter vp9; // QP range: 0-255
|
||||||
|
SampleCounter h264; // QP range: 0-51
|
||||||
};
|
};
|
||||||
void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_);
|
||||||
VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc)
|
VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc)
|
||||||
|
|||||||
@ -467,6 +467,20 @@ TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_Vp9OneSpatialLayer) {
|
|||||||
EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.Encoded.Qp.Vp9", kQpIdx0));
|
EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.Encoded.Qp.Vp9", kQpIdx0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_H264) {
|
||||||
|
EncodedImage encoded_image;
|
||||||
|
CodecSpecificInfo codec_info;
|
||||||
|
codec_info.codecType = kVideoCodecH264;
|
||||||
|
|
||||||
|
for (int i = 0; i < SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) {
|
||||||
|
encoded_image.qp_ = kQpIdx0;
|
||||||
|
statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info);
|
||||||
|
}
|
||||||
|
statistics_proxy_.reset();
|
||||||
|
EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.Encoded.Qp.H264"));
|
||||||
|
EXPECT_EQ(1, metrics::NumEvents("WebRTC.Video.Encoded.Qp.H264", kQpIdx0));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(SendStatisticsProxyTest,
|
TEST_F(SendStatisticsProxyTest,
|
||||||
BandwidthLimitedHistogramsNotUpdatedWhenDisabled) {
|
BandwidthLimitedHistogramsNotUpdatedWhenDisabled) {
|
||||||
EncodedImage encoded_image;
|
EncodedImage encoded_image;
|
||||||
|
|||||||
Reference in New Issue
Block a user