Will now only require near-perfect PSNR and SSIM.
BUG= TEST=Ran test and checked we accept somewhat lower values. Committed: https://code.google.com/p/webrtc/source/detail?r=3269 Review URL: https://webrtc-codereview.appspot.com/964031 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3278 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
86464eacb6
commit
5b689efe8e
@ -44,7 +44,7 @@ enum VideoType {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// This is the max PSNR value our algorithms can return.
|
// This is the max PSNR value our algorithms can return.
|
||||||
const double kInfinitePSNR = 48.0f;
|
const double kPerfectPSNR = 48.0f;
|
||||||
|
|
||||||
// Conversion between the RawVideoType and the LibYuv videoType.
|
// Conversion between the RawVideoType and the LibYuv videoType.
|
||||||
// TODO(wu): Consolidate types into one type throughout WebRtc.
|
// TODO(wu): Consolidate types into one type throughout WebRtc.
|
||||||
|
@ -354,7 +354,7 @@ double I420PSNR(const I420VideoFrame* ref_frame,
|
|||||||
test_frame->width(), test_frame->height());
|
test_frame->width(), test_frame->height());
|
||||||
// LibYuv sets the max psnr value to 128, we restrict it here.
|
// LibYuv sets the max psnr value to 128, we restrict it here.
|
||||||
// In case of 0 mse in one frame, 128 can skew the results significantly.
|
// In case of 0 mse in one frame, 128 can skew the results significantly.
|
||||||
return (psnr > kInfinitePSNR) ? kInfinitePSNR : psnr;
|
return (psnr > kPerfectPSNR) ? kPerfectPSNR : psnr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute SSIM for an I420 frame (all planes)
|
// Compute SSIM for an I420 frame (all planes)
|
||||||
@ -409,7 +409,7 @@ double I420PSNR(const uint8_t* ref_frame,
|
|||||||
width, height);
|
width, height);
|
||||||
// LibYuv sets the max psnr value to 128, we restrict it here.
|
// LibYuv sets the max psnr value to 128, we restrict it here.
|
||||||
// In case of 0 mse in one frame, 128 can skew the results significantly.
|
// In case of 0 mse in one frame, 128 can skew the results significantly.
|
||||||
return (psnr > kInfinitePSNR) ? kInfinitePSNR : psnr;
|
return (psnr > kPerfectPSNR) ? kPerfectPSNR : psnr;
|
||||||
}
|
}
|
||||||
// Compute SSIM for an I420 frame (all planes)
|
// Compute SSIM for an I420 frame (all planes)
|
||||||
double I420SSIM(const uint8_t* ref_frame,
|
double I420SSIM(const uint8_t* ref_frame,
|
||||||
|
@ -21,7 +21,7 @@ namespace webrtc {
|
|||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
// Copy here so our callers won't need to include libyuv for this constant.
|
// Copy here so our callers won't need to include libyuv for this constant.
|
||||||
double kMetricsInfinitePSNR = kInfinitePSNR;
|
double kMetricsPerfectPSNR = kPerfectPSNR;
|
||||||
|
|
||||||
// Used for calculating min and max values.
|
// Used for calculating min and max values.
|
||||||
static bool LessForFrameResultValue (const FrameResult& s1,
|
static bool LessForFrameResultValue (const FrameResult& s1,
|
||||||
|
@ -18,7 +18,7 @@ namespace webrtc {
|
|||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
// The highest PSNR value our algorithms will return.
|
// The highest PSNR value our algorithms will return.
|
||||||
extern double kMetricsInfinitePSNR;
|
extern double kMetricsPerfectPSNR;
|
||||||
|
|
||||||
// Contains video quality metrics result for a single frame.
|
// Contains video quality metrics result for a single frame.
|
||||||
struct FrameResult {
|
struct FrameResult {
|
||||||
|
@ -160,6 +160,8 @@ TEST_F(ViEVideoVerificationTest, RunsBaseStandardTestWithoutErrors) {
|
|||||||
// However, it's hard to make 100% stringent requirements on the video engine
|
// However, it's hard to make 100% stringent requirements on the video engine
|
||||||
// since for instance the jitter buffer has non-deterministic elements. If it
|
// since for instance the jitter buffer has non-deterministic elements. If it
|
||||||
// breaks five times in a row though, you probably introduced a bug.
|
// breaks five times in a row though, you probably introduced a bug.
|
||||||
|
const double kReasonablePsnr = webrtc::test::kMetricsPerfectPSNR - 2.0f;
|
||||||
|
const double kReasonableSsim = 0.99f;
|
||||||
const int kNumAttempts = 5;
|
const int kNumAttempts = 5;
|
||||||
for (int attempt = 0; attempt < kNumAttempts; ++attempt) {
|
for (int attempt = 0; attempt < kNumAttempts; ++attempt) {
|
||||||
InitializeFileRenderers();
|
InitializeFileRenderers();
|
||||||
@ -176,8 +178,7 @@ TEST_F(ViEVideoVerificationTest, RunsBaseStandardTestWithoutErrors) {
|
|||||||
|
|
||||||
TearDownFileRenderers();
|
TearDownFileRenderers();
|
||||||
|
|
||||||
if (actual_psnr == webrtc::test::kMetricsInfinitePSNR &&
|
if (actual_psnr > kReasonablePsnr && actual_ssim > kReasonableSsim) {
|
||||||
actual_ssim == 1.0f) {
|
|
||||||
// Test successful.
|
// Test successful.
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -185,7 +186,7 @@ TEST_F(ViEVideoVerificationTest, RunsBaseStandardTestWithoutErrors) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FAIL() << "Failed to achieve perfect PSNR and SSIM results after " <<
|
FAIL() << "Failed to achieve near-perfect PSNR and SSIM results after " <<
|
||||||
kNumAttempts << " attempts.";
|
kNumAttempts << " attempts.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user