AT_BANNER([[Checking encode and decode of sample data]]) AT_SETUP([samples]) AT_CHECK([(test $DIRAC_INPUT_DATA_DIR -a -d $DIRAC_INPUT_DATA_DIR) || exit 77], ignore) echo "HERE " for samp in `ls $DIRAC_INPUT_DATA_DIR/*.yuv`; do tsamp=`echo $samp | sed 's/\.yuv//g'`; encout="$tsamp"_"enc.drc"; encout=`basename $encout` decout="$tsamp"_"dec.yuv"; decout=`basename $decout` instrout="$tsamp"_"instr"; instrout=`basename $instrout` iframe_encout="$tsamp"_"iframe_enc.drc"; iframe_encout=`basename $iframe_encout` iframe_decout="$tsamp"_"iframe_dec.yuv"; iframe_decout=`basename $iframe_decout` width=0 height=0 chroma="unknown" preset="" # first tackle files name in the style nameFORMAT_CHROMA.yuv # e.g. waterfallCIF_411 or waterfall576p_444 etc case $tsamp in *576p*) width=720 height=576 chroma=`echo $tsamp | sed -e 's/.*576p_\(.*\)/\1/'` ;; *720p*) width=1280; height=720; chroma=`echo $tsamp | sed -e 's/.*720p_\(.*\)/\1/'` ;; *1080i*) width=1920 height=1080 chroma=`echo $tsamp | sed -e 's/.*1080i_\(.*\)/\1/'` ;; *CIF*) width=352; height=288; chroma=`echo $tsamp | sed -e 's/.*CIF_\(.*\)/\1/'` ;; *) #handle files with names like name-WIDTHxHEIGHTxNUMFRAMES_CHROMA.yuv #e.g. snowboard-jum-720x576x50_430.yuv width=`echo $tsamp | sed -e 's/.*[[^0-9]]\([[0-9]][[0-9]]*\)x\([[0-9]][[0-9]]*\)x[[0-9]][[0-9]]*_\(.*\)/\1/'` height=`echo $tsamp | sed -e 's/.*[[^0-9]]\([[0-9]][[0-9]]*\)x\([[0-9]][[0-9]]*\)x[[0-9]][[0-9]]*_\(.*\)/\2/'` chroma=`echo $tsamp | sed -e 's/.*[[^0-9]]\([[0-9]][[0-9]]*\)x\([[0-9]][[0-9]]*\)x[[0-9]][[0-9]]*_\(.*\)/\3/'` ;; esac if test $width = $tsamp || test $height = $tsamp || test $chroma = $tsamp; then echo "Filename not in expected format : $tsamp.yuv : Skipping this file..." continue; fi case $chroma in "444") chroma=0;; "422") chroma=1;; "420") chroma=2;; *) chroma="unknown";; esac #cannot proceed if with or height or chroma not set if test $width -eq 0 || test $height -eq 0 || test $chroma = "unknown"; then continue; fi if test $width -eq 720 || test $height -eq 576; then preset="-SD576"; #luma block parameters xblen=12; xbsep=8; yblen=12; ybsep=8; elif test $width -eq 1280 || test $height -eq 720; then preset="-HD720"; #luma block parameters xblen=16; xbsep=12; yblen=16 ybsep=12; elif test $width -eq 1920 || test $height -eq 1080; then preset="-HD1080"; #luma block parameters xblen=24; xbsep=16; yblen=24; ybsep=16; else #luma block parameters xblen=12; xbsep=8; yblen=12; ybsep=8; preset="-CIF"; fi #set Motion vector precision here. Possible values are 1, 1/2, 1/4 and # 1/8. Default value is 1/4 mv_prec=1/4 echo "$samp $preset $chroma $width $height $mv_prec" #iframe tests AT_CHECK([at_wrap dirac_encoder -local -num_L1 0 $preset -qf 7 -width $width -height $height -cformat $chroma -xblen $xblen -xbsep $xbsep -yblen $yblen -ybsep $ybsep $samp ../../$iframe_encout], 0, [ignore]) AT_CHECK([at_wrap dirac_decoder ../../$iframe_encout ../../$iframe_decout], 0, [ignore]) AT_CHECK([cmp ../../$iframe_encout.localdec.yuv ../../$iframe_decout]) AT_CHECK([at_wrap dirac_encoder -local $preset -qf 7 -width $width -height $height -cformat $chroma -xblen $xblen -xbsep $xbsep -yblen $yblen -ybsep $ybsep -mv_prec $mv_prec $samp ../../$encout], 0, [ignore]) AT_CHECK([at_wrap dirac_decoder ../../$encout ../../$decout], 0, [ignore]) AT_CHECK([cmp ../../$encout.localdec.yuv ../../$decout]) AT_CHECK([at_wrap dirac_instrumentation ../../$encout ../../"$instrout"_mc_instr.yuv -motion_colour -clip 50], 0) AT_CHECK([at_wrap dirac_instrumentation ../../$encout ../../"$instrout"_ma_instr.yuv -motion_arrows -clip 50], 0) AT_CHECK([at_wrap dirac_instrumentation ../../$encout ../../"$instrout"_mca_instr.yuv -motion_colour_arrows -clip 50], 0) AT_CHECK([at_wrap dirac_instrumentation ../../$encout ../../"$instrout"_spm_instr.yuv -split_mode -clip 50], 0) AT_CHECK([at_wrap dirac_instrumentation ../../$encout ../../"$instrout"_sad_instr.yuv -sad -clip 50], 0) AT_CHECK([at_wrap dirac_instrumentation ../../$encout ../../"$instrout"_pred_instr.yuv -pred_mode -clip 50], 0) done AT_CLEANUP