]> granicus.if.org Git - libvpx/commitdiff
Changed MAX_PSNR to be consistent with internal stats
authorYaowu Xu <yaowu@google.com>
Wed, 7 Mar 2012 17:05:26 +0000 (09:05 -0800)
committerYaowu Xu <yaowu@google.com>
Thu, 8 Mar 2012 00:14:54 +0000 (16:14 -0800)
The maximum psnr has a marginal impact on the overall output in high
quality encodings, the change will make sure the psnr output to be
consistent with encoder internal stats.

Change-Id: I35cf2f85008ec127a7d91c9eb69fa7811798ae32

vpxenc.c

index aa37990580b91b2f85baf388271152ec326d454b..efbbbc05de1e18ae9a1981cd23946376675cc644 100644 (file)
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -888,7 +888,7 @@ static unsigned int murmur ( const void * key, int len, unsigned int seed )
 }
 
 #include "math.h"
-
+#define MAX_PSNR 100
 static double vp8_mse2psnr(double Samples, double Peak, double Mse)
 {
     double psnr;
@@ -896,10 +896,10 @@ static double vp8_mse2psnr(double Samples, double Peak, double Mse)
     if ((double)Mse > 0.0)
         psnr = 10.0 * log10(Peak * Peak * Samples / Mse);
     else
-        psnr = 60;      // Limit to prevent / 0
+        psnr = MAX_PSNR;      // Limit to prevent / 0
 
-    if (psnr > 60)
-        psnr = 60;
+    if (psnr > MAX_PSNR)
+        psnr = MAX_PSNR;
 
     return psnr;
 }