X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=vpxstats.c;h=172d8937cdc3aabedc440b17f8e42715e36d07a1;hb=1794624c18a5642c62e0e5f586a87e5af06ecd1f;hp=70cea3ee7fd4bf8553308ea7590478c90d3dd464;hpb=3a2ea76469c30968c35d305c66482e690659f942;p=libvpx diff --git a/vpxstats.c b/vpxstats.c index 70cea3ee7..172d8937c 100644 --- a/vpxstats.c +++ b/vpxstats.c @@ -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; -}