]> granicus.if.org Git - libvpx/blobdiff - vpxstats.c
Merge changes I2fe52bfb,I5e5084eb
[libvpx] / vpxstats.c
index 70cea3ee7fd4bf8553308ea7590478c90d3dd464..172d8937cdc3aabedc440b17f8e42715e36d07a1 100644 (file)
@@ -41,6 +41,9 @@ int stats_open_file(stats_io_t *stats, const char *fpf, int pass) {
 
     stats->file = fopen(fpf, "rb");
 
+    if (stats->file == NULL)
+      fatal("First-pass stats file does not exist!");
+
     if (fseek(stats->file, 0, SEEK_END))
       fatal("First-pass stats file must be seekable!");
 
@@ -120,16 +123,3 @@ void stats_write(stats_io_t *stats, const void *pkt, size_t len) {
 vpx_fixed_buf_t stats_get(stats_io_t *stats) {
   return stats->buf;
 }
-
-double vp8_mse2psnr(double samples, double peak, double mse) {
-  const int kMaxPSNR = 100;
-  double psnr = kMaxPSNR;
-
-  if (mse > 0.0)
-    psnr = 10.0 * log10(peak * peak * samples / mse);
-
-  if (psnr > kMaxPSNR)
-    psnr = kMaxPSNR;
-
-  return psnr;
-}