#!/bin/bash

if [ $# -ne 9 ]; then
    echo "Illegal number of parameters"
	echo "S4-AV1-02.sh <num_frame> <fps_norm> <fps_denom> <width> <height> <cq-level> <intra_period> <input> <output>"
	exit 2
fi

# encode
aomenc --verbose --codec=av1 -v --psnr --obu --frame-parallel=0 --cpu-used=0 --limit=$1 --passes=1 --end-usage=q --i420 --enable-tpl-model=0 --disable-kf --enable-keyframe-filtering=1 --fps=$2/$3 --input-bit-depth=10 --bit-depth=10 -w $4 -h $5 --cq-level=$6 --tile-columns=0 --threads=1 --max-reference-frames=4 --min-gf-interval=32 --max-gf-interval=32 --gf-min-pyr-height=5 --gf-max-pyr-height=5 --kf-min-dist=$7 --kf-max-dist=$7 --lag-in-frames=0  --min-q=$6 --max-q=$6 --disable-warning-prompt --deltaq-mode=0 -o $9 $8
