diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2010-07-09 04:40:37 +0400 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-07-09 04:40:37 +0400 |
commit | cb0067ec258d2ef4c2441eb54aafcec88eb9d400 (patch) | |
tree | 440c1eea519965960f9f314a52b4185c425a2f22 /tests/tiny_psnr.c | |
parent | 9eb42c272b122f8da02e361fc45c1f6f63c15c8a (diff) |
tiny_psnr: print max absolute difference between files
Regression test reference updates are due to the extra output
from tiny_psnr.
Patch by Vitor Sessak
Originally committed as revision 24132 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests/tiny_psnr.c')
-rw-r--r-- | tests/tiny_psnr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c index f8d1b7bfa5..66b6747af3 100644 --- a/tests/tiny_psnr.c +++ b/tests/tiny_psnr.c @@ -113,6 +113,7 @@ int main(int argc,char* argv[]){ int skip_bytes = argc<6 ? 0 : atoi(argv[5]); int size0=0; int size1=0; + int maxdist = 0; if(argc<3){ printf("tiny_psnr <file1> <file2> [<elem size> [<shift> [<skip bytes>]]]\n"); @@ -139,11 +140,14 @@ int main(int argc,char* argv[]){ for(j=0; j<FFMIN(s0,s1); j++){ int64_t a= buf[0][j]; int64_t b= buf[1][j]; + int dist; if(len==2){ a= (int16_t)(a | (buf[0][++j]<<8)); b= (int16_t)(b | (buf[1][ j]<<8)); } sse += (a-b) * (a-b); + dist = abs(a-b); + if (dist > maxdist) maxdist = dist; } size0 += s0; size1 += s1; @@ -159,9 +163,10 @@ int main(int argc,char* argv[]){ else psnr= 1000*F-1; //floating point free infinity :) - printf("stddev:%5d.%02d PSNR:%3d.%02d bytes:%9d/%9d\n", + printf("stddev:%5d.%02d PSNR:%3d.%02d MAXDIFF:%5d bytes:%9d/%9d\n", (int)(dev/F), (int)(dev%F), (int)(psnr/F), (int)(psnr%F), + maxdist, size0, size1); return 0; } |