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

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
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bb404fb8bed65a29b2729a9c7055e24c8e0981c0 100644
--- a/webrtc/video/send_statistics_proxy_unittest.cc
+++ b/webrtc/video/send_statistics_proxy_unittest.cc
@@ -327,6 +327,57 @@ TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) {
EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.InputWidthInPixels"));
}
+TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_Vp8) {
+ 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(1, test::NumHistogramSamples("WebRTC.Video.Encoded.Qp.Vp8.S0"));
+ EXPECT_EQ(kQpIdx0,
+ test::LastHistogramSample("WebRTC.Video.Encoded.Qp.Vp8.S0"));
+ EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.Encoded.Qp.Vp8.S1"));
+ EXPECT_EQ(kQpIdx1,
+ test::LastHistogramSample("WebRTC.Video.Encoded.Qp.Vp8.S1"));
+}
+
+TEST_F(SendStatisticsProxyTest, VerifyQpHistogramStats_Vp8OneSsrc) {
+ VideoSendStream::Config config(nullptr);
+ config.rtp.ssrcs.push_back(kFirstSsrc);
+ statistics_proxy_.reset(new SendStatisticsProxy(
+ &fake_clock_, config, VideoEncoderConfig::ContentType::kRealtimeVideo));
+
+ test::ClearHistograms();
+ const int kMinRequiredSamples = 200;
+ const int kQpIdx0 = 21;
+ 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);
+ }
+ statistics_proxy_.reset();
+ EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.Encoded.Qp.Vp8"));
+ EXPECT_EQ(kQpIdx0, test::LastHistogramSample("WebRTC.Video.Encoded.Qp.Vp8"));
+}
+
TEST_F(SendStatisticsProxyTest, NoSubstreams) {
uint32_t excluded_ssrc =
std::max(
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698