From acaffe5b44df34e6328af0224d26759357198f59 Mon Sep 17 00:00:00 2001 From: Yi Luo Date: Thu, 4 Jan 2018 17:30:58 -0800 Subject: [PATCH] AV1 Encoder Nightly Report Change-Id: I687b3ee90969d17803bce009e4bd286f3c57bae5 --- scripts/BasketballDrill_480p.sh | 8 +++ scripts/aom_conf_build.sh | 20 ++++++ scripts/aom_nightly_config.sh | 23 +++++++ scripts/aom_nightly_speed.sh | 116 ++++++++++++++++++++++++++++++++ scripts/aomenc_nightly_speed.sh | 42 ++++++++++++ scripts/into_tree.sh | 8 +++ 6 files changed, 217 insertions(+) create mode 100644 scripts/BasketballDrill_480p.sh create mode 100755 scripts/aom_conf_build.sh create mode 100755 scripts/aom_nightly_config.sh create mode 100755 scripts/aom_nightly_speed.sh create mode 100755 scripts/aomenc_nightly_speed.sh create mode 100644 scripts/into_tree.sh diff --git a/scripts/BasketballDrill_480p.sh b/scripts/BasketballDrill_480p.sh new file mode 100644 index 000000000..7212aaf41 --- /dev/null +++ b/scripts/BasketballDrill_480p.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +video=~/Dev/samples/videos/midres/BasketballDrill_832x480_50.y4m +wide= +high= +frames=60 +bitrate=800 +fps="50/1" diff --git a/scripts/aom_conf_build.sh b/scripts/aom_conf_build.sh new file mode 100755 index 000000000..7241f81a6 --- /dev/null +++ b/scripts/aom_conf_build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +root_dir=$1 +build_dir=$root_dir/release +script_dir=~/Dev/sandbox/libvpx/scripts +exp_tool= + +cd $build_dir +make clean > /dev/null +$script_dir/aom_nightly_config.sh +make -j > /dev/null +if [ $? -ne 0 ]; then + echo "AV1 build failed!" + exit 1 +fi + +test_dir=~/Dev/nightly + +cp -f ./aomenc $test_dir/. +cp -f ./aomdec $test_dir/. diff --git a/scripts/aom_nightly_config.sh b/scripts/aom_nightly_config.sh new file mode 100755 index 000000000..6f0635354 --- /dev/null +++ b/scripts/aom_nightly_config.sh @@ -0,0 +1,23 @@ +#!/bin/sh +#set -x + +platform=x86_64-linux-gcc +codec=--enable-av1 +libsrc=aom +test_dir=~/Dev/nightly +script_dir=~/Dev/sandbox/libvpx/scripts +tool= + +common="--disable-unit-tests --disable-docs" +debug= + +#. $script_dir/disabled_list.sh +disabled= + +echo ../$libsrc/configure $common $debug $disabled $tool + +../$libsrc/configure $common $debug $disabled $tool > /dev/null +if [ $? -ne 0 ]; then + echo "Error: configure fails!" > $test_dir/aom_error_config.txt + exit 1 +fi diff --git a/scripts/aom_nightly_speed.sh b/scripts/aom_nightly_speed.sh new file mode 100755 index 000000000..1783b3d17 --- /dev/null +++ b/scripts/aom_nightly_speed.sh @@ -0,0 +1,116 @@ +#!/bin/sh +# File: +# nightly_speed.sh +# Decription: +# Configure, build, and run AV1 encoder/decoder for each experimental tool. +# Display the encoder/decode run time +# Preassumption: +# 1) Assume all script files are in ~/Dev/sandbox/libvpx/scripts +# Note: +# See encoder config output if set, +# verbose=-v +#set -x + +if [ "$#" -ne 4 ]; then + root_dir=~/Dev/av1d + pdfps=1 + petime=1 + html_log_file=log.html +else + root_dir=$1 + pdfps=$2 + petime=$3 + html_log_file=$4 +fi +log_path=~/Dev/log + +if [ "$profile" == "2" ]; then + bitdepth="--bit-depth=10" +fi + +if [ "$profile" == "0" ]; then + bitdepth= +fi + +code_dir=$root_dir/aom +build_dir=$root_dir/release +test_dir=~/Dev/nightly +script_dir=~/Dev/sandbox/libvpx/scripts + +. $script_dir/BasketballDrill_480p.sh + +# General options +codec="--codec=av1" +verbose= +core_id=1 +exp_tool=experimental + +cd $root_dir/aom +commit=`git log --pretty=%h -1` + +cd $test_dir + +elog=av1enc_log_p_$profile.txt +dlog=av1dec_log_p_$profile.txt +bstream=av1_p_$profile.$commit.webm + +profile=0 +tune_content= +col_num=0 +laginframes=19 +speed=0 + +taskset -c $core_id ./aomenc $verbose -o /dev/shm/"$bstream" $video $codec --limit=$frames --profile=$profile $bitdepth --fps=$fps $tune_content --target-bitrate=$bitrate --skip=0 -p 2 --good --cpu-used=$speed --lag-in-frames=$laginframes --min-q=0 --max-q=63 --auto-alt-ref=1 --kf-max-dist=150 --kf-min-dist=0 --drop-frame=0 --static-thresh=0 --bias-pct=50 --minsection-pct=0 --maxsection-pct=2000 --arnr-maxframes=7 --arnr-strength=5 --sharpness=0 --undershoot-pct=100 --overshoot-pct=100 --frame-parallel=0 --tile-columns=$col_num --test-decode=warn --psnr &>> $elog + +# Note: $2 is the time unit, ms or us +etime=`cat $elog | awk 'NR==2 {NF-=3; print $NF}'` +# efps=`cat $elog | grep 'Pass 2/2' | grep 'fps)' | sed -e 's/^.*b\/s//' | awk '{print $3}'` +# efps=`echo $efps | sed 's/(//'` + +psnr=`cat $elog | grep 'PSNR' | awk '{print $5, $6, $7, $8, $9}'` +tmp=`cat $elog | grep mismatch` +if [ "$?" -ne 0 ]; then + eflag=e_ok +else + eflag=mismatch +fi + +echo "AV1: $(basename $video), profile=$profile bitrate=$bitrate frames=$frames speed=$speed" + +taskset -c $core_id ./aomdec /dev/shm/"$bstream" $codec --i420 --noblit --summary 2>&1 &>> $dlog +if [ "$?" -ne 0 ]; then + dflag=fault +else + dflag=d_ok +fi + +# Note: $8 is the time unit ms or us +dfps=`awk '{print $9}' < $dlog` +dfps=`echo $dfps | sed 's/(//'` + +dpercent=`echo "($dfps - $pdfps) / $pdfps * 100" | bc -l` +dpercent=${dpercent:0:5} + +epercent=`echo "($petime - $etime) / $petime * 100" | bc -l` +epercent=${epercent:0:5} + +echo -e '\t'"Enc fps Dec fps PSNR"'\t\t\t\t'"Enc status Dec status dup(%) eup(%)" +echo -e '\t'$etime" "$dfps" "$psnr'\t'$eflag" "$dflag" "$dpercent" "$epercent +printf "\n" + +# Output a html log file for email +echo "

AV1: $(basename $video), bitrate=$bitrate profile=$profile frames=$frames speed=$speed

" >> $log_path/$html_log_file +echo "" >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo " " >> $log_path/$html_log_file +echo "
Enc Time (ms)Enc Speedup(%)Dec FPSDec Speedup(%)
$etime$epercent$dfps$dpercent
" >> $log_path/$html_log_file diff --git a/scripts/aomenc_nightly_speed.sh b/scripts/aomenc_nightly_speed.sh new file mode 100755 index 000000000..30af8d5bc --- /dev/null +++ b/scripts/aomenc_nightly_speed.sh @@ -0,0 +1,42 @@ +#!/bin/sh +#set -x + +script_path=~/Dev/sandbox/libvpx/scripts + +av1_code=~/Dev/av1d +log_path=~/Dev/log + +date_str=`date -d tomorrow +%b_%d_%Y` + +log_file=aomenc_$date_str.txt +html_log_file=aomenc_$date_str.html + +prev_date_str=`date +%b_%d_%Y` +prev_log_file=aomenc_$prev_date_str.txt + +test_dir=~/Dev/nightly +rm $test_dir/* + +$script_path/gen_html_header.sh > $log_path/$html_log_file + +echo "

" >> $log_path/$html_log_file +$script_path/sync_codebase.sh $av1_code/aom >> $log_path/$html_log_file 2>&1 +echo "

" >> $log_path/$html_log_file + +echo "

" >> $log_path/$html_log_file +$script_path/aom_conf_build.sh $av1_code >> $log_path/$html_log_file 2>&1 +echo "

" >> $log_path/$html_log_file + +pdfps=`cat $log_path/$prev_log_file | grep e_ok | awk '{print $2}' | awk 'NR==1 {print $1}'` +petime=`cat $log_path/$prev_log_file | grep e_ok | awk '{print $1}' | awk 'NR==1 {print $1}'` +$script_path/aom_nightly_speed.sh $av1_code $pdfps $petime $html_log_file >> $log_path/$log_file 2>&1 + +# Send an email to coworkers +users=luoyi +host_name=`hostname` +sender=luoyi +cc_list="--cc=yunqingwang,vpx-eng" + +$script_path/gen_html_footer.sh >> $log_path/$html_log_file + +sendgmr --to=$users $cc_list --subject="AV1 Encoder Nightly Report" --from=$sender --reply_to=$sender --html_file=/usr/local/google/home/luoyi/Dev/log/$html_log_file --body_file=/usr/local/google/home/luoyi/Dev/log/$html_log_file diff --git a/scripts/into_tree.sh b/scripts/into_tree.sh new file mode 100644 index 000000000..afb00b632 --- /dev/null +++ b/scripts/into_tree.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +video=~/Dev/samples/videos/midres/into_tree_480p.y4m +wide= +high= +frames=2 +bitrate=600 +fps="50/1" -- 2.49.0