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

Side by Side 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
Left:
Right:
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 unified diff | Download patch
« tools/rd_collect.sh ('K') | « tools/rd_collect.sh ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 set -e 2 set -e
3 3
4 if [ -z $RD_COLLECT_SUB ]; then 4 if [ -z $RD_COLLECT_SUB ]; then
5 echo "Please use: $(dirname $0)/rd_collect.sh av1 *.y4m" 5 echo "Please use: $(dirname $0)/rd_collect.sh av1 *.y4m"
6 exit 1 6 exit 1
7 fi 7 fi
8 8
9 FILE=$1 9 FILE=$1
10 x=$2
10 11
11 BASENAME=$(basename $FILE)-$CODEC 12 BASENAME=$(basename $FILE)-$CODEC
12 rm $BASENAME.out 2> /dev/null || true 13 #rm $BASENAME.out 2> /dev/null || true
13 echo $BASENAME 14 echo $x $BASENAME
14 15
15 WIDTH=$(head -1 $FILE | cut -d\ -f 2 | tr -d 'W') 16 WIDTH=$(head -1 $FILE | cut -d\ -f 2 | tr -d 'W')
16 HEIGHT=$(head -1 $FILE | cut -d\ -f 3 | tr -d 'H') 17 HEIGHT=$(head -1 $FILE | cut -d\ -f 3 | tr -d 'H')
17 18
18 RANGE="20 32 43 55 63"
19 case $CODEC in 19 case $CODEC in
20 av1) 20 av1)
21 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" 21 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"
22 ;; 22 ;;
23 av1-rt) 23 av1-rt)
24 QSTR="--ivf --frame-parallel=0 --tile-columns=0 --cpu-used=0 --passes=1 --thre ads=1 --kf-min-dist=1000 --kf-max-dist=1000 --lag-in-frames=0 --end-usage=q --cq -level=\$x" 24 QSTR="--ivf --frame-parallel=0 --tile-columns=0 --cpu-used=0 --passes=1 --thre ads=1 --kf-min-dist=1000 --kf-max-dist=1000 --lag-in-frames=0 --end-usage=q --cq -level=\$x"
25 CODEC="av1" 25 CODEC="av1"
26 ;; 26 ;;
27 esac 27 esac
28 28
29 for x in $RANGE; do 29 $AOMENC --codec=$CODEC $(echo $QSTR | sed 's/\$x/'$x'/g') -o $BASENAME-$x.ivf $F ILE 2> $BASENAME-$x-enc.out
30 $AOMENC --codec=$CODEC $(echo $QSTR | sed 's/\$x/'$x'/g') -o $BASENAME.ivf $FI LE 2> $BASENAME-$x-enc.out 30 $AOMDEC --codec=$CODEC -o $BASENAME-$x.y4m $BASENAME-$x.ivf
31 $AOMDEC --codec=$CODEC -o $BASENAME.y4m $BASENAME.ivf 31 SIZE=$(wc -c $BASENAME-$x.ivf | awk '{ print $1 }')
32 SIZE=$(wc -c $BASENAME.ivf | awk '{ print $1 }') 32 $DUMP_PSNR $FILE $BASENAME-$x.y4m > $BASENAME-$x-psnr.out 2> /dev/null
33 $DUMP_PSNR $FILE $BASENAME.y4m > $BASENAME-$x-psnr.out 2> /dev/null 33 FRAMES=$(cat $BASENAME-$x-psnr.out | grep ^0 | wc -l)
34 FRAMES=$(cat $BASENAME-$x-psnr.out | grep ^0 | wc -l) 34 PIXELS=$(($WIDTH*$HEIGHT*$FRAMES))
35 PIXELS=$(($WIDTH*$HEIGHT*$FRAMES)) 35 PSNR=$(cat $BASENAME-$x-psnr.out | grep Total | tr -s ' ' | cut -d\ -f $((4+$PL ANE*2)))
36 PSNR=$(cat $BASENAME-$x-psnr.out | grep Total | tr -s ' ' | cut -d\ -f $((4+$ PLANE*2))) 36 PSNRHVS=$($DUMP_PSNRHVS $FILE $BASENAME-$x.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
37 PSNRHVS=$($DUMP_PSNRHVS $FILE $BASENAME.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2))) 37 SSIM=$($DUMP_SSIM $FILE $BASENAME-$x.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
38 SSIM=$($DUMP_SSIM $FILE $BASENAME.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2))) 38 FASTSSIM=$($DUMP_FASTSSIM -c $FILE $BASENAME-$x.y4m 2> /dev/null | grep Total | tr -s ' ' | cut -d\ -f $((4+$PLANE*2)))
39 FASTSSIM=$($DUMP_FASTSSIM -c $FILE $BASENAME.y4m 2> /dev/null | grep Total | t r -s ' ' | cut -d\ -f $((4+$PLANE*2))) 39 rm $BASENAME-$x.ivf $BASENAME-$x.y4m $BASENAME-$x-enc.out $BASENAME-$x-psnr.out
40 rm $BASENAME.ivf $BASENAME.y4m $BASENAME-$x-enc.out $BASENAME-$x-psnr.out 40 echo $x $PIXELS $SIZE $PSNR $PSNRHVS $SSIM $FASTSSIM >> $BASENAME.out
41 echo $x $PIXELS $SIZE $PSNR $PSNRHVS $SSIM $FASTSSIM >> $BASENAME.out
42 #tail -1 $BASENAME.out
43 done
OLDNEW
« 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