summaryrefslogtreecommitdiff
path: root/tests/tiny_psnr.c
diff options
context:
space:
mode:
authorBenjamin Larsson <banan@ludd.ltu.se>2006-07-18 21:41:49 +0000
committerBenjamin Larsson <banan@ludd.ltu.se>2006-07-18 21:41:49 +0000
commitb8889ea51f763c71a7cfadb5ec11e6e200ce8de5 (patch)
tree705a20cd75333a808a62aa613e1140af6f9fd2b6 /tests/tiny_psnr.c
parent7028259a0da450fcff4059df9bc4d4eb542e0f60 (diff)
Possibility to skip bytes in the beginning of a file.
Originally committed as revision 5783 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests/tiny_psnr.c')
-rw-r--r--tests/tiny_psnr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c
index b017eacc72..d8bce2b7bb 100644
--- a/tests/tiny_psnr.c
+++ b/tests/tiny_psnr.c
@@ -106,9 +106,12 @@ int main(int argc,char* argv[]){
int len= argc<4 ? 1 : atoi(argv[3]);
int64_t max= (1<<(8*len))-1;
int shift= argc<5 ? 0 : atoi(argv[4]);
+ int skip_bytes = argc<6 ? 0 : atoi(argv[5]);
if(argc<3){
- printf("tiny_psnr <file1> <file2> [<elem size> [<shift>]]\n");
+ printf("tiny_psnr <file1> <file2> [<elem size> [<shift> [<skip bytes>]]]\n");
+ printf("for wav files use the following:\n");
+ printf("./tiny_psnr file1.wav file2.wav 2 0 44 to skip the header.\n");
return -1;
}
@@ -116,6 +119,9 @@ int main(int argc,char* argv[]){
f[1]= fopen(argv[2], "rb");
fseek(f[shift<0], shift < 0 ? -shift : shift, SEEK_SET);
+ fseek(f[0],skip_bytes,SEEK_CUR);
+ fseek(f[1],skip_bytes,SEEK_CUR);
+
for(i=0;;){
if( fread(buf[0], SIZE, 1, f[0]) != 1) break;
if( fread(buf[1], SIZE, 1, f[1]) != 1) break;