- Run analysis after all frames are processed. Before part of it was done at bitrate change points; - Analysis is done for whole stream as well as for each rate update interval; - Changed units from number of frames to time units for some metrics and thresholds. E.g. 'num frames to hit tagret bitrate' is changed to 'time to reach target bitrate, sec'; - Changed data type of FrameStatistic::max_nalu_length (renamed to max_nalu_size_bytes) from rtc::Optional to size_t. There it no need to use such advanced data type in such low level data structure. Bug: webrtc:8524 Change-Id: Ic9f6eab5b15ee12a80324b1f9c101de1bf3c702f Reviewed-on: https://webrtc-review.googlesource.com/31901 Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21653}
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "modules/video_coding/codecs/test/stats.h"
|
|
#include "rtc_base/checks.h"
|
|
|
|
namespace webrtc {
|
|
namespace test {
|
|
|
|
std::string FrameStatistic::ToString() const {
|
|
std::stringstream ss;
|
|
ss << "frame " << frame_number;
|
|
ss << " " << decoded_width << "x" << decoded_height;
|
|
ss << " sl " << simulcast_svc_idx;
|
|
ss << " tl " << temporal_layer_idx;
|
|
ss << " type " << frame_type;
|
|
ss << " length " << encoded_frame_size_bytes;
|
|
ss << " qp " << qp;
|
|
ss << " psnr " << psnr;
|
|
ss << " ssim " << ssim;
|
|
ss << " enc_time_us " << encode_time_us;
|
|
ss << " dec_time_us " << decode_time_us;
|
|
ss << " rtp_ts " << rtp_timestamp;
|
|
ss << " bitrate_kbps " << target_bitrate_kbps;
|
|
return ss.str();
|
|
}
|
|
|
|
FrameStatistic* Stats::AddFrame() {
|
|
stats_.emplace_back(stats_.size());
|
|
return &stats_.back();
|
|
}
|
|
|
|
FrameStatistic* Stats::GetFrame(size_t frame_number) {
|
|
RTC_CHECK_LT(frame_number, stats_.size());
|
|
return &stats_[frame_number];
|
|
}
|
|
|
|
size_t Stats::size() const {
|
|
return stats_.size();
|
|
}
|
|
|
|
} // namespace test
|
|
} // namespace webrtc
|