test.sh
author viric@llimona
Mon, 22 Jan 2007 00:45:57 +0100
changeset 76 9cbf4c7e7986
parent 3 192fd737c4fc
permissions -rwxr-xr-x
First classes for the qjpeg project.

#!/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