summaryrefslogtreecommitdiff
path: root/tests/tiny_psnr.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-02-01 20:32:47 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-02-01 20:32:47 +0000
commitba96e97fdd2ba52d3e699b83ac5e831fed8b4fd5 (patch)
tree60c43e9176a7bfb3dee7fa13e55012dac695ef0e /tests/tiny_psnr.c
parentc342499df20213e2aa880ad86c11267eff9f783a (diff)
support comparing files with some posiion offset relative to each other
Originally committed as revision 3921 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests/tiny_psnr.c')
-rw-r--r--tests/tiny_psnr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c
index 2f35670979..05f3d4f267 100644
--- a/tests/tiny_psnr.c
+++ b/tests/tiny_psnr.c
@@ -18,6 +18,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <inttypes.h>
#include <assert.h>
@@ -102,16 +103,18 @@ int main(int argc,char* argv[]){
FILE *f[2];
uint8_t buf[2][SIZE];
uint64_t psnr;
- int len= argc<4 ? 1 : 2;
+ int len= argc<4 ? 1 : atoi(argv[3]);
int64_t max= (1<<(8*len))-1;
+ int shift= argc<5 ? 0 : atoi(argv[4]);
if(argc<3){
- printf("tiny_psnr <file1> <file2>\n");
+ printf("tiny_psnr <file1> <file2> [<elem size> [<shift>]]\n");
return -1;
}
f[0]= fopen(argv[1], "rb");
f[1]= fopen(argv[2], "rb");
+ fseek(f[shift<0], shift < 0 ? -shift : shift, SEEK_SET);
for(i=0;;){
if( fread(buf[0], SIZE, 1, f[0]) != 1) break;