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

Side by Side Diff: tools/ab_compare_encode.sh

Issue 1393: Deduplicate code in ab_compare.sh.
Patch Set: Deduplicate code in ab_compare.sh. Created 2 years, 3 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
« no previous file with comments | « tools/ab_compare_daala.sh ('k') | tools/ab_compare_jpeg.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2 set -e
3
4 export X264="$X264_ROOT/x264"
5 export X265="$X265_ROOT/build/linux/x265"
6 export VPXENC="$LIBVPX_ROOT/$CODEC/vpxenc"
7 export VPXDEC="$LIBVPX_ROOT/vpxdec"
8 export AOMENC="$LIBAOM_ROOT/aomenc"
9 export AOMDEC="$LIBAOM_ROOT/aomdec"
10 if [ -z "$THORENC" ]; then
11 export THORENC="$WORK_ROOT/$CODEC/build/Thorenc"
12 fi
13 if [ -z "$THORDIR" ]; then
14 export THORDIR="$(dirname $THORENC)/../"
15 fi
16 if [ -z "$THORDEC" ]; then
17 export THORDEC="$(dirname $THORENC)/Thordec"
18 fi
19 if [ -z "$ENCODER_EXAMPLE" ]; then
20 export ENCODER_EXAMPLE="$DAALA_ROOT/examples/encoder_example"
21 fi
22 if [ -z "$YUV2YUV4MPEG" ]; then
23 YUV2YUV4MPEG=$DAALA_ROOT/tools/yuv2yuv4mpeg
24 fi
25 if [ -z "$YUVJPEG" ]; then
26 export YUVJPEG=yuvjpeg
27 fi
28 if [ -z "$JPEGYUV" ]; then
29 export JPEGYUV=jpegyuv
30 fi
31
32 KFINT=999
33
34 case $CODEC in
35 daala)
36 if [ ! -x "$ENCODER_EXAMPLE" ]; then
37 echo "Example encoder not found at '$ENCODER_EXAMPLE.'"
38 exit 1
39 fi
40 OD_LOG_MODULES='encoder:10' OD_DUMP_IMAGES_SUFFIX="$BASENAME" "$ENCODER_EXAMPL E" -k $KFINT -v "$x" $EXTRA_OPTIONS "$FILE" -o "$BASENAME.ogv" > /dev/null 2> "$ BASENAME-enc.out"
41 if [ ! -f "$BASENAME.ogv" ]
42 then
43 echo Failed to produce "$BASENAME.ogv"
44 cat "$BASENAME-enc.out"
45 exit 1
46 fi
47 SIZE=$(stat -c %s "$BASENAME.ogv")
48 mv "00000000out-$BASENAME.y4m" "$BASENAME.y4m"
49 ;;
50 x264)
51 $X264 --dump-yuv $BASENAME.yuv --preset placebo --min-keyint $KFINT --keyint $ KFINT --no-scenecut --crf=$x -o $BASENAME.x264 $EXTRA_OPTIONS $FILE 2> $BASENAME -enc.out > /dev/null
52 $YUV2YUV4MPEG $BASENAME -w$WIDTH -h$HEIGHT -an0 -ad0 -c420mpeg2
53 SIZE=$(stat -c %s $BASENAME.x264)
54 ;;
55 x265)
56 $X265 -r $BASENAME.y4m --preset slow --frame-threads 1 --min-keyint $KFINT --k eyint $KFINT --no-scenecut --crf=$x -o $BASENAME.x265 $EXTRA_OPTIONS $FILE 2> $B ASENAME-enc.out > /dev/null
57 SIZE=$(stat -c %s $BASENAME.x265)
58 ;;
59 x265-rt)
60 $X265 -r $BASENAME.y4m --preset slow --tune zerolatency --rc-lookahead 0 --bfr ames 0 --frame-threads 1 --min-keyint $KFINT --keyint $KFINT --no-scenecut --crf =$x --csv $BASENAME.csv -o $BASENAME.x265 $EXTRA_OPTIONS $FILE 2> $BASENAME-enc. out > /dev/null
61 SIZE=$(stat -c %s $BASENAME.x265)
62 ;;
63 vp8)
64 $VPXENC --codec=$CODEC --threads=1 --cpu-used=0 --kf-min-dist=$KFINT --kf-max- dist=$KFINT --end-usage=cq --target-bitrate=100000 --cq-level=$x -o $BASENAME.iv f $EXTRA_OPTIONS $FILE 2> $BASENAME-enc.out > /dev/null
65 $VPXDEC --codec=$CODEC -o $BASENAME.y4m $BASENAME.ivf
66 SIZE=$(stat -c %s $BASENAME.ivf)
67 ;;
68 vp9)
69 $VPXENC --codec=$CODEC --ivf --frame-parallel=0 --tile-columns=0 --auto-alt-re f=2 --cpu-used=0 --passes=2 --threads=1 --kf-min-dist=$KFINT --kf-max-dist=$KFIN T --lag-in-frames=25 --end-usage=q --cq-level=$x -o $BASENAME.ivf $EXTRA_OPTIONS $FILE 2> $BASENAME-enc.out > /dev/null
70 $VPXDEC --codec=$CODEC -o $BASENAME.y4m $BASENAME.ivf
71 SIZE=$(stat -c %s $BASENAME.ivf)
72 ;;
73 vp9-rt)
74 $VPXENC --codec=vp9 --frame-parallel=0 --tile-columns=0 -cpu-used=0 --threads= 1 --kf-min-dist=$KFINT --kf-max-dist=$KFINT -p 1 --lag-in-frames=0 --end-usage=q --cq-level=$x -o $BASENAME.ivf $EXTRA_OPTIONS $FILE 2> $BASENAME-enc.out > /dev /null
75 $VPXDEC --codec=vp9 -o $BASENAME.y4m $BASENAME.ivf
76 SIZE=$(stat -c %s $BASENAME.ivf)
77 ;;
78 vp10)
79 $VPXENC --codec=$CODEC --ivf --frame-parallel=0 --tile-columns=0 --auto-alt-re f=2 --cpu-used=0 --passes=2 --threads=1 --kf-min-dist=$KFINT --kf-max-dist=$KFIN T --lag-in-frames=25 --end-usage=q --cq-level=$x -o $BASENAME.ivf $EXTRA_OPTIONS $FILE 2> $BASENAME-enc.out > /dev/null
80 $VPXDEC --codec=$CODEC -o $BASENAME.y4m $BASENAME.ivf
81 SIZE=$(stat -c %s $BASENAME.ivf)
82 ;;
83 vp10-rt)
84 $VPXENC --codec=vp10 --ivf --frame-parallel=0 --tile-columns=0 --cpu-used=0 -- passes=1 --threads=1 --kf-min-dist=$KFINT --kf-max-dist=$KFINT --lag-in-frames=0 --end-usage=q --cq-level=$x -o $BASENAME.ivf $EXTRA_OPTIONS $FILE 2> $BASENAME- enc.out > /dev/null
85 $VPXDEC --codec=vp10 -o $BASENAME.y4m $BASENAME.ivf
86 SIZE=$(stat -c %s $BASENAME.ivf)
87 ;;
88 av1)
89 $AOMENC --codec=$CODEC --ivf --frame-parallel=0 --tile-columns=0 --auto-alt-re f=2 --cpu-used=0 --passes=2 --threads=1 --kf-min-dist=$KFINT --kf-max-dist=$KFIN T --lag-in-frames=25 --end-usage=q --cq-level=$x -o $BASENAME.ivf $EXTRA_OPTIONS $FILE 2> $BASENAME-enc.out > /dev/null
90 $AOMDEC --codec=$CODEC -o $BASENAME.y4m $BASENAME.ivf
91 SIZE=$(stat -c %s $BASENAME.ivf)
92 ;;
93 av1-rt)
94 $AOMENC --codec=vp10 --ivf --frame-parallel=0 --tile-columns=0 --cpu-used=0 -- passes=1 --threads=1 --kf-min-dist=$KFINT --kf-max-dist=$KFINT --lag-in-frames=0 --end-usage=q --cq-level=$x -o $BASENAME.ivf $EXTRA_OPTIONS $FILE 2> $BASENAME- enc.out > /dev/null
95 $AOMDEC --codec=vp10 -o $BASENAME.y4m $BASENAME.ivf
96 SIZE=$(stat -c %s $BASENAME.ivf)
97 ;;
98 thor)
99 $THORENC -qp $x -cf "$THORDIR/config_HDB16_high_efficiency.txt" -if $FILE -of $BASENAME.thor $EXTRA_OPTIONS > $BASENAME-enc.out
100 SIZE=$(stat -c %s $BASENAME.thor)
101 # using reconstruction is currently broken with HDB
102 $THORDEC $BASENAME.thor $BASENAME.yuv > /dev/null
103 $YUV2YUV4MPEG $BASENAME -w$WIDTH -h$HEIGHT
104 ;;
105 thor-rt)
106 $THORENC -qp $x -cf "$THORDIR/config_LDB_high_efficiency.txt" -if $FILE -of $B ASENAME.thor -rf $BASENAME.y4m $EXTRA_OPTIONS > $BASENAME-enc.out
107 SIZE=$(stat -c %s $BASENAME.thor)
108 ;;
109 jpeg)
110 WIDTH=$(head -1 $FILE | cut -d\ -f 2 | tr -d 'W')
111 HEIGHT=$(head -1 $FILE | cut -d\ -f 3 | tr -d 'H')
112 tail -n+3 $FILE > $BASENAME-in.yuv
113 $YUVJPEG $((100-$x)) "$WIDTH"x$HEIGHT $BASENAME-in.yuv $BASENAME.jpeg
114 $JPEGYUV $BASENAME.jpeg $BASENAME.yuv
115 $YUV2YUV4MPEG $BASENAME -w$WIDTH -h$HEIGHT -an0 -ad0 -c420mpeg2
116 rm $BASENAME-in.yuv $BASENAME.yuv
117 SIZE=$(stat -c %s $BASENAME.jpeg)
118 esac
119
120 echo $SIZE
OLDNEW
« no previous file with comments | « tools/ab_compare_daala.sh ('k') | tools/ab_compare_jpeg.sh » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld