test.sh
author viric@mandarina
Mon, 15 Dec 2008 20:31:35 +0000
changeset 254 aa2f8de82091
parent 3 192fd737c4fc
permissions -rwxr-xr-x
Arreglant errors tipogrĂ fics.

#!/bin/sh

if [ $# -ne 2 ]; then
	echo "usage: $0 <quality> <basefilename>"
	exit 1
fi

BASE=$2
QUALITY=$1

set -o xtrace on
# Program for getting the error of grads-c
make $BASE.pgm

if [ ! -f $BASE.pgm ]; then
	echo "Wrong basefilename..."
	exit 1
fi


cjpeg -quality $QUALITY $BASE.pgm >$BASE-jpg.jpg
#jpegtopnm $BASE-jpg.jpg | ppmtopgm >$BASE-jpg.pgm
djpeg -pnm $BASE-jpg.jpg | ppmtopgm >$BASE-jpg.pgm

tools/pgm2errormat $BASE.pgm $BASE-jpg.pgm >error.mat
tools/mat2pgm <error.mat >error.pgm