tests/fate-run: add transcode() as a simplified enc_dec()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 5 Sep 2016 16:46:16 +0000 (18:46 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 6 Sep 2016 16:04:49 +0000 (18:04 +0200)
Approved-by: ubitux
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tests/fate-run.sh

index 5841b0c..8c3938a 100755 (executable)
@@ -192,6 +192,21 @@ enc_dec(){
     tests/tiny_psnr $srcfile $decfile $cmp_unit $cmp_shift
 }
 
+transcode(){
+    src_fmt=$1
+    srcfile=$2
+    enc_fmt=$3
+    enc_opt=$4
+    encfile="${outdir}/${test}.${enc_fmt}"
+    test "$7" = -keep || cleanfiles="$cleanfiles $encfile"
+    tsrcfile=$(target_path $srcfile)
+    tencfile=$(target_path $encfile)
+    ffmpeg -f $src_fmt $DEC_OPTS -i $tsrcfile $ENC_OPTS $enc_opt $FLAGS \
+        -f $enc_fmt -y $tencfile || return
+    do_md5sum $encfile
+    echo $(wc -c $encfile)
+}
+
 lavffatetest(){
     t="${test#lavf-fate-}"
     ref=${base}/ref/lavf-fate/$t