Commit ea1f4775 authored by Derek Buitenhuis's avatar Derek Buitenhuis

Merge commit '7a00653b'

* commit '7a00653b':
  tiny_psnr: Support large files
Merged-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parents ddc9a587 7a00653b
...@@ -132,13 +132,13 @@ static double get_f64l(uint8_t *p) ...@@ -132,13 +132,13 @@ static double get_f64l(uint8_t *p)
static int run_psnr(FILE *f[2], int len, int shift, int skip_bytes) static int run_psnr(FILE *f[2], int len, int shift, int skip_bytes)
{ {
int i, j; uint64_t i, j;
uint64_t sse = 0; uint64_t sse = 0;
double sse_d = 0.0; double sse_d = 0.0;
uint8_t buf[2][SIZE]; uint8_t buf[2][SIZE];
int64_t max = (1LL << (8 * len)) - 1; int64_t max = (1LL << (8 * len)) - 1;
int size0 = 0; uint64_t size0 = 0;
int size1 = 0; uint64_t size1 = 0;
uint64_t maxdist = 0; uint64_t maxdist = 0;
double maxdist_d = 0.0; double maxdist_d = 0.0;
int noseek; int noseek;
...@@ -233,7 +233,7 @@ static int run_psnr(FILE *f[2], int len, int shift, int skip_bytes) ...@@ -233,7 +233,7 @@ static int run_psnr(FILE *f[2], int len, int shift, int skip_bytes)
else else
psnr = 1000 * F - 1; // floating point free infinity :) psnr = 1000 * F - 1; // floating point free infinity :)
printf("stddev:%5d.%02d PSNR:%3d.%02d MAXDIFF:%5"PRIu64" bytes:%9d/%9d\n", printf("stddev:%5d.%02d PSNR:%3d.%02d MAXDIFF:%5"PRIu64" bytes:%9"PRIu64"/%9"PRIu64"\n",
(int)(dev / F), (int)(dev % F), (int)(dev / F), (int)(dev % F),
(int)(psnr / F), (int)(psnr % F), (int)(psnr / F), (int)(psnr % F),
maxdist, size0, size1); maxdist, size0, size1);
...@@ -254,7 +254,7 @@ static int run_psnr(FILE *f[2], int len, int shift, int skip_bytes) ...@@ -254,7 +254,7 @@ static int run_psnr(FILE *f[2], int len, int shift, int skip_bytes)
maxdist = maxdist_d * scale; maxdist = maxdist_d * scale;
printf("stddev:%10.2f PSNR:%s MAXDIFF:%10"PRIu64" bytes:%9d/%9d\n", printf("stddev:%10.2f PSNR:%s MAXDIFF:%10"PRIu64" bytes:%9"PRIu64"/%9"PRIu64"\n",
dev * scale, psnr_str, maxdist, size0, size1); dev * scale, psnr_str, maxdist, size0, size1);
return psnr; return psnr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment