On-fly calculation of quality metrics.
Calculation of quality metrics required writing of decoded video to file. There were two drawbacks with that approach. First, frame drops significantly affected metrics because comparison was done against the last decoded frame. Second, simulcast/SVC required writing of multiple files. This might be too much data to dump. On-fly metrics calculation is done in frame decoded callback. Calculation time is excluded from encoding/decoding time. If CPU usage measurement is enabled metrics calculation is disabled since it affects CPU usage. The results are reported in Stats::PrintSummary. Bug: webrtc:8524 Change-Id: Id54fb21f2f95deeb93757afaf46bde7d7ae18dac Reviewed-on: https://webrtc-review.googlesource.com/22560 Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20798}
This commit is contained in:
committed by
Commit Bot
parent
c5975bf25d
commit
64eaa99cfc
@ -12,6 +12,7 @@
|
||||
#define MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTEST_H_
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -159,6 +160,14 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
float key_framesize_kbits;
|
||||
};
|
||||
|
||||
struct QualityMetrics {
|
||||
int num_decoded_frames = 0;
|
||||
double total_psnr = 0.0;
|
||||
double total_ssim = 0.0;
|
||||
double min_psnr = std::numeric_limits<double>::max();
|
||||
double min_ssim = std::numeric_limits<double>::max();
|
||||
};
|
||||
|
||||
void CreateEncoderAndDecoder();
|
||||
void DestroyEncoderAndDecoder();
|
||||
void SetUpAndInitObjects(rtc::TaskQueue* task_queue,
|
||||
@ -185,6 +194,9 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
void VerifyBitstream(int frame_number,
|
||||
const BitstreamThresholds& bs_thresholds);
|
||||
|
||||
void UpdateQualityMetrics(int frame_number);
|
||||
void VerifyQualityMetrics(const QualityThresholds& quality_thresholds);
|
||||
|
||||
void PrintSettings() const;
|
||||
|
||||
// Codecs.
|
||||
@ -207,6 +219,8 @@ class VideoProcessorIntegrationTest : public testing::Test {
|
||||
|
||||
// Rates set for every encoder rate update.
|
||||
TargetRates target_;
|
||||
|
||||
QualityMetrics quality_;
|
||||
};
|
||||
|
||||
} // namespace test
|
||||
|
||||
Reference in New Issue
Block a user