#!/bin/sh

TESTCASE_DIR=/app/sample/S83_Sample/S83E04_Module/codec_sample/bin

if [ "$1" = "h264enc_nv12_640x480" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 0 -w 640 -h 480 -p 1 -i /cicdtest/res/video/input_640x480_nv12.yuv -o /map/640x480.h264
elif [ "$1" = "h264enc_nv12_1280x720" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 0 -w 1280 -h 720 -p 1 -i /cicdtest/res/video/input_1280x720_nv12.yuv -o /map/1280x720.h264
elif [ "$1" = "h264enc_nv12_1920x1080" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 0 -w 1920 -h 1080 -p 1 -i /cicdtest/res/video/input_1920x1080_nv12.yuv -o /map/1920x1080.h264
elif [ "$1" = "h264enc_nv12_3840x2160" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 0 -w 3840 -h 2160 -p 1 -i /cicdtest/res/video/input_3840x2160_nv12.yuv -o /map/3840x2160.h264

elif [ "$1" = "h265enc_nv12_640x480" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 1 -w 640 -h 480 -p 1 -i /cicdtest/res/video/input_640x480_nv12.yuv -o /map/640x480.h265
elif [ "$1" = "h265enc_nv12_1280x720" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 1 -w 1280 -h 720 -p 1 -i /cicdtest/res/video/input_1280x720_nv12.yuv -o /map/1280x720.h265
elif [ "$1" = "h265enc_nv12_1920x1080" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 1 -w 1920 -h 1080 -p 1 -i /cicdtest/res/video/input_1920x1080_nv12.yuv -o /map/1920x1080.h265
elif [ "$1" = "h265enc_nv12_3840x2160" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 1 -w 3840 -h 2160 -p 1 -i /cicdtest/res/video/input_3840x2160_nv12.yuv -o /map/3840x2160.h265

elif [ "$1" = "jpgenc_nv12_1920x1088" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 3 -w 1920 -h 1088 -p 1 -i /cicdtest/res/jpeg/input_1920x1088_nv12.yuv -o /map/1920x1088.jpg

elif [ "$1" = "h264dec_nv12" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 0 -w 640 -h 480 -p 1 -i /cicdtest/res/video/input_640x480_normal.h264 -o /map/h264_nv12.yuv
elif [ "$1" = "h265dec_nv12" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 0 -w 640 -h 480 -p 1 -i /cicdtest/res/video/input_640x480_normal.h265 -o /map/h265_nv12.yuv
elif [ "$1" = "jpgdec_nv12" ];then
	echo "Run $1"
	${TESTCASE_DIR}/codec_sample -m 0 -c 0 -w 1920 -h 1088 -p 1 -i /cicdtest/res/jpeg/input_1920x1088_nv12.jpg -o /map/jpg_nv12.yuv

else
	echo "you can run like this:"
	echo "sh codec_sample.sh h264enc_nv12_640x480"
	echo "sh codec_sample.sh h264enc_nv12_1280x720"
	echo "sh codec_sample.sh h264enc_nv12_1920x1080"
	echo "sh codec_sample.sh h264enc_nv12_3840x2160"

	echo "sh codec_sample.sh h265enc_nv12_640x480"
	echo "sh codec_sample.sh h265enc_nv12_1280x720"
	echo "sh codec_sample.sh h265enc_nv12_1920x1080"
	echo "sh codec_sample.sh h265enc_nv12_3840x2160"

	echo "sh codec_sample.sh jpgenc_nv12_1920x1088"

	echo "sh codec_sample.sh h264dec_nv12"
	echo "sh codec_sample.sh h265dec_nv12"
	echo "sh codec_sample.sh jpgdec_nv12"

fi