2011-10-06 06:44:54 +00:00
|
|
|
/*
|
2012-03-05 19:53:24 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-10-06 06:44:54 +00:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2011-12-08 07:42:18 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/video_coding/codecs/test/stats.h"
|
|
|
|
|
#include "rtc_base/checks.h"
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
|
2011-10-06 06:44:54 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
2017-09-06 01:53:22 -07:00
|
|
|
|
2018-01-17 15:11:44 +01:00
|
|
|
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();
|
2017-11-17 14:47:32 +01:00
|
|
|
}
|
|
|
|
|
|
2017-09-06 01:53:22 -07:00
|
|
|
FrameStatistic* Stats::AddFrame() {
|
2018-01-17 15:11:44 +01:00
|
|
|
stats_.emplace_back(stats_.size());
|
2017-09-06 01:53:22 -07:00
|
|
|
return &stats_.back();
|
|
|
|
|
}
|
2017-06-04 23:43:41 -07:00
|
|
|
|
2018-01-17 15:11:44 +01:00
|
|
|
FrameStatistic* Stats::GetFrame(size_t frame_number) {
|
2017-09-06 01:53:22 -07:00
|
|
|
RTC_CHECK_LT(frame_number, stats_.size());
|
|
|
|
|
return &stats_[frame_number];
|
|
|
|
|
}
|
2011-10-06 06:44:54 +00:00
|
|
|
|
2017-09-06 01:53:22 -07:00
|
|
|
size_t Stats::size() const {
|
|
|
|
|
return stats_.size();
|
2011-10-06 06:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|