Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(480045)

Unified Diff: tools/rd_collect_aom.sh

Issue 1540: WIP fix for higher rd_collect.sh CPU utilization.
Patch Set: Created 1 year, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tools/rd_collect.sh ('K') | « tools/rd_collect.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/rd_collect_aom.sh
diff --git a/tools/rd_collect_aom.sh b/tools/rd_collect_aom.sh
index 8f82335e689946c89096f8eb0e3e334bc248be6f..9313dee3f2ea49c6b440e7ab72d18af0a0c0989a 100755
--- a/tools/rd_collect_aom.sh
+++ b/tools/rd_collect_aom.sh
@@ -7,15 +7,15 @@ if [ -z $RD_COLLECT_SUB ]; then
fi
FILE=$1
+x=$2
BASENAME=$(basename $FILE)-$CODEC
-rm $BASENAME.out 2> /dev/null || true
-echo $BASENAME
+#rm $BASENAME.out 2> /dev/null || true
+echo $x $BASENAME
WIDTH=$(head -1 $FILE | cut -d\ -f 2 | tr -d 'W')
HEIGHT=$(head -1 $FILE | cut -d\ -f 3 | tr -d 'H')
-RANGE="20 32 43 55 63"
case $CODEC in
av1)
QSTR="--ivf --frame-parallel=0 --tile-columns=0 --auto-alt-ref=2 --cpu-used=0 --passes=2 --threads=1 --kf-min-dist=1000 --kf-max-dist=1000 --lag-in-frames=25 --end-usage=q --cq-level=\$x"
@@ -26,18 +26,15 @@ av1-rt)
;;
esac
-for x in $RANGE; do
- $AOMENC --codec=$CODEC $(echo $QSTR | sed 's/\$x/'$x'/g') -o $BASENAME.ivf $FILE 2> $BASENAME-$x-enc.out
- $AOMDEC --codec=$CODEC -o $BASENAME.y4m $BASENAME.ivf
- SIZE=$(wc -c $BASENAME.ivf | awk '{ print $1 }')
- $DUMP_PSNR $FILE $BASENAME.y4m > $BASENAME-$x-psnr.out 2> /dev/null
- FRAMES=$(cat $BASENAME-$x-psnr.out | grep ^0 | wc -l)
- PIXELS=$(($WIDTH*$HEIGHT*$FRAMES))
- PSNR=$(cat $BASENAME-$x-psnr.out | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
- PSNRHVS=$($DUMP_PSNRHVS $FILE $BASENAME.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
- SSIM=$($DUMP_SSIM $FILE $BASENAME.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
- FASTSSIM=$($DUMP_FASTSSIM -c $FILE $BASENAME.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
- rm $BASENAME.ivf $BASENAME.y4m $BASENAME-$x-enc.out $BASENAME-$x-psnr.out
- echo $x $PIXELS $SIZE $PSNR $PSNRHVS $SSIM $FASTSSIM >> $BASENAME.out
- #tail -1 $BASENAME.out
-done
+$AOMENC --codec=$CODEC $(echo $QSTR | sed 's/\$x/'$x'/g') -o $BASENAME-$x.ivf $FILE 2> $BASENAME-$x-enc.out
+$AOMDEC --codec=$CODEC -o $BASENAME-$x.y4m $BASENAME-$x.ivf
+SIZE=$(wc -c $BASENAME-$x.ivf | awk '{ print $1 }')
+$DUMP_PSNR $FILE $BASENAME-$x.y4m > $BASENAME-$x-psnr.out 2> /dev/null
+FRAMES=$(cat $BASENAME-$x-psnr.out | grep ^0 | wc -l)
+PIXELS=$(($WIDTH*$HEIGHT*$FRAMES))
+PSNR=$(cat $BASENAME-$x-psnr.out | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
+PSNRHVS=$($DUMP_PSNRHVS $FILE $BASENAME-$x.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
+SSIM=$($DUMP_SSIM $FILE $BASENAME-$x.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
+FASTSSIM=$($DUMP_FASTSSIM -c $FILE $BASENAME-$x.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
+rm $BASENAME-$x.ivf $BASENAME-$x.y4m $BASENAME-$x-enc.out $BASENAME-$x-psnr.out
+echo $x $PIXELS $SIZE $PSNR $PSNRHVS $SSIM $FASTSSIM >> $BASENAME.out
« tools/rd_collect.sh ('K') | « tools/rd_collect.sh ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld