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

Unified Diff: webrtc/modules/video_coding/codecs/test/stats.cc

Issue 2709613005: Add QP statistics to VideoProcessorIntegrationTest. (Closed)
Patch Set: Created 3 years, 10 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/modules/video_coding/codecs/test/stats.cc
diff --git a/webrtc/modules/video_coding/codecs/test/stats.cc b/webrtc/modules/video_coding/codecs/test/stats.cc
index 478b2f490154917e4cf3fa6959488de2feed9086..e64317e9b69c8338c01b4cdc46aa34dd0b7b2e35 100644
--- a/webrtc/modules/video_coding/codecs/test/stats.cc
+++ b/webrtc/modules/video_coding/codecs/test/stats.cc
@@ -27,6 +27,7 @@ FrameStatistic::FrameStatistic()
decode_return_code(0),
encode_time_in_us(0),
decode_time_in_us(0),
+ qp(-1),
frame_number(0),
packets_dropped(0),
total_packets(0),
@@ -72,6 +73,8 @@ void Stats::PrintSummary() {
// Calculate min, max, average and total encoding time
int total_encoding_time_in_us = 0;
int total_decoding_time_in_us = 0;
+ int total_qp = 0;
+ int total_qp_count = 0;
size_t total_encoded_frames_lengths = 0;
size_t total_encoded_key_frames_lengths = 0;
size_t total_encoded_nonkey_frames_lengths = 0;
@@ -89,6 +92,10 @@ void Stats::PrintSummary() {
total_encoded_nonkey_frames_lengths += it->encoded_frame_length_in_bytes;
nbr_nonkeyframes++;
}
+ if (it->qp != -1) {
sprang_webrtc 2017/02/22 16:59:01 maybe even >= 0 just to be sure
åsapersson 2017/02/22 17:10:37 Done.
+ total_qp += it->qp;
+ ++total_qp_count;
+ }
}
FrameStatisticsIterator frame;
@@ -170,6 +177,9 @@ void Stats::PrintSummary() {
printf(" Max bit rate: %7d kbps (frame %d)\n", frame->bit_rate_in_kbps,
frame->frame_number);
+ int avg_qp = (total_qp_count > 0) ? (total_qp / total_qp_count) : -1;
+ printf("Average QP: %d\n", avg_qp);
+
printf("\n");
printf("Total encoding time : %7d ms.\n", total_encoding_time_in_us / 1000);
printf("Total decoding time : %7d ms.\n", total_decoding_time_in_us / 1000);
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/stats.h ('k') | webrtc/modules/video_coding/codecs/test/videoprocessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698