#! /bin/csh -f

set cnt=0

foreach f (`ls -lart film0*rgb | cut -c55-80`)

    /usr/sbin/togif $f current.gif.$cnt
    set cnt=`expr $cnt + 1`

end
set cnt=`expr $cnt - 1`

cat <<EOF > param
# parameter file with good default values
#
# use this as a guideline for any parameters you don't really understand
# or don't care about
#

PATTERN         IPPPPPPPPP
#IBBPBBPBBPBB
OUTPUT          output.mpg

BASE_FILE_FORMAT        PPM
GOP_SIZE        2
SLICES_PER_FRAME        1

PIXEL           FULL
RANGE           20
PSEARCH_ALG     SUBSAMPLE
BSEARCH_ALG     CROSS2
#EXHAUSTIVE
IQSCALE         8
PQSCALE         8
BQSCALE         10

REFERENCE_FRAME DECODED

#
# you really need to understand the following
#
YUV_SIZE        363x271
INPUT_CONVERT   /usr/local/bin/giftoppm *

INPUT_DIR       .

INPUT
#current.gif.* [0-$cnt+2]
current.gif.* [0-$cnt]
END_INPUT
EOF

#/bin/ls -lart *gif | cut -c 56-80 >> param


#echo END_INPUT >> param

/usr/local/bin/mpeg_encode param
