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:
phoglund@webrtc.org 2012-12-13 10:15:06 +00:00
parent 86464eacb6
commit 5b689efe8e
5 changed files with 9 additions and 8 deletions

View File

@ -44,7 +44,7 @@ enum VideoType {
};
// 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.
// TODO(wu): Consolidate types into one type throughout WebRtc.

View File

@ -354,7 +354,7 @@ double I420PSNR(const I420VideoFrame* ref_frame,
test_frame->width(), test_frame->height());
// 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.
return (psnr > kInfinitePSNR) ? kInfinitePSNR : psnr;
return (psnr > kPerfectPSNR) ? kPerfectPSNR : psnr;
}
// Compute SSIM for an I420 frame (all planes)
@ -409,7 +409,7 @@ double I420PSNR(const uint8_t* ref_frame,
width, height);
// 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.
return (psnr > kInfinitePSNR) ? kInfinitePSNR : psnr;
return (psnr > kPerfectPSNR) ? kPerfectPSNR : psnr;
}
// Compute SSIM for an I420 frame (all planes)
double I420SSIM(const uint8_t* ref_frame,

View File

@ -21,7 +21,7 @@ namespace webrtc {
namespace test {
// 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.
static bool LessForFrameResultValue (const FrameResult& s1,

View File

@ -18,7 +18,7 @@ namespace webrtc {
namespace test {
// The highest PSNR value our algorithms will return.
extern double kMetricsInfinitePSNR;
extern double kMetricsPerfectPSNR;
// Contains video quality metrics result for a single frame.
struct FrameResult {

View File

@ -160,6 +160,8 @@ TEST_F(ViEVideoVerificationTest, RunsBaseStandardTestWithoutErrors) {
// 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
// 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;
for (int attempt = 0; attempt < kNumAttempts; ++attempt) {
InitializeFileRenderers();
@ -176,8 +178,7 @@ TEST_F(ViEVideoVerificationTest, RunsBaseStandardTestWithoutErrors) {
TearDownFileRenderers();
if (actual_psnr == webrtc::test::kMetricsInfinitePSNR &&
actual_ssim == 1.0f) {
if (actual_psnr > kReasonablePsnr && actual_ssim > kReasonableSsim) {
// Test successful.
return;
} 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.";
}