Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: webrtc/video/send_statistics_proxy_unittest.cc

Issue 1523293002: Add histogram stats for average QP per frame for VP8 (for sent video streams): (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/video/send_statistics_proxy_unittest.cc
diff --git a/webrtc/video/send_statistics_proxy_unittest.cc b/webrtc/video/send_statistics_proxy_unittest.cc
index a98505f84d1e01f3837a05d588826377853096b6..5c04b4bb6c2ba9dec905125fe173b7687c03b14f 100644
--- a/webrtc/video/send_statistics_proxy_unittest.cc
+++ b/webrtc/video/send_statistics_proxy_unittest.cc
@@ -327,6 +327,29 @@ TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.InputWidthInPixels"));
}
+TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats) {
+ test::ClearHistograms();
+ const int kMinRequiredSamples = 200;
+ const int kQpIdx0 = 21;
+ const int kQpIdx1 = 39;
+ EncodedImage encoded_image;
+
+ RTPVideoHeader rtp_video_header;
+ rtp_video_header.codec = kRtpVideoVp8;
+
+ for (int i = 0; i < kMinRequiredSamples; ++i) {
+ rtp_video_header.simulcastIdx = 0;
+ encoded_image.qp_ = kQpIdx0;
+ statistics_proxy_->OnSendEncodedImage(encoded_image, &rtp_video_header);
+ rtp_video_header.simulcastIdx = 1;
+ encoded_image.qp_ = kQpIdx1;
+ statistics_proxy_->OnSendEncodedImage(encoded_image, &rtp_video_header);
+ }
+ statistics_proxy_.reset();
+ EXPECT_EQ(2, test::NumHistogramSamples("WebRTC.Video.Encoded.Qp.Vp8"));
+ EXPECT_EQ(kQpIdx1, test::LastHistogramSample("WebRTC.Video.Encoded.Qp.Vp8"));
stefan-webrtc 2016/03/22 15:12:46 Shouldn't this be the average of 21 and 39?
åsapersson 2016/03/22 15:29:46 QP is stored per ssrc e.g. two qp samples should b
+}
+
TEST_F(SendStatisticsProxyTest, NoSubstreams) {
uint32_t excluded_ssrc =
std::max(
« webrtc/video/send_statistics_proxy.cc ('K') | « webrtc/video/send_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698