Add QP statistics to VideoProcessorIntegrationTest.

The average QP of encoded frames is printed in Stats::PrintSummary.

plot_webrtc_test_logs.py: Add QP to plots.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2709613005
Cr-Commit-Position: refs/heads/master@{#16790}
This commit is contained in:
asapersson
2017-02-23 01:33:04 -08:00
committed by Commit bot
parent 61a2b1bd6c
commit abc0080df8
4 changed files with 14 additions and 0 deletions

View File

@ -34,6 +34,7 @@ CORES = ('#CPU cores used', 'CPU cores used')
DENOISING = ('Denoising', 'denoising')
RESILIENCE = ('Resilience', 'resilience')
ERROR_CONCEALMENT = ('Error concealment', 'error concealment')
QP = ('Average QP', 'avg QP')
PSNR = ('PSNR avg', 'PSNR (dB)')
SSIM = ('SSIM avg', 'SSIM')
ENC_BITRATE = ('Encoding bitrate', 'encoded bitrate (kbps)')
@ -88,6 +89,7 @@ RESULTS = [
NUM_FRAMES_TO_TARGET,
ENCODE_TIME_AVG,
DECODE_TIME_AVG,
QP,
AVG_KEY_FRAME_SIZE,
AVG_NON_KEY_FRAME_SIZE,
]

View File

@ -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 >= 0) {
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);

View File

@ -28,6 +28,7 @@ struct FrameStatistic {
int decode_return_code;
int encode_time_in_us;
int decode_time_in_us;
int qp;
int frame_number;
// How many packets were discarded of the encoded frame data (if any).
int packets_dropped;

View File

@ -314,6 +314,7 @@ void VideoProcessorImpl::FrameEncoded(
stat.encoded_frame_length_in_bytes = encoded_image._length;
stat.frame_number = frame_number;
stat.frame_type = encoded_image._frameType;
stat.qp = encoded_image.qp_;
stat.bit_rate_in_kbps = encoded_image._length * bit_rate_factor_;
stat.total_packets =
encoded_image._length / config_.networking_config.packet_size_in_bytes +