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

Delta Between Two Patch Sets: tools/ab_compare_encode.sh

Issue 1393: Deduplicate code in ab_compare.sh.
Left Patch Set: Deduplicate code in ab_compare.sh. Created 2 years, 3 months ago
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « tools/ab_compare_daala.sh ('k') | tools/ab_compare_jpeg.sh » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/bin/bash 1 #!/bin/bash
2 set -e 2 set -e
3 3
4 export X264="$X264_ROOT/x264" 4 export X264="$X264_ROOT/x264"
5 export X265="$X265_ROOT/build/linux/x265" 5 export X265="$X265_ROOT/build/linux/x265"
6 export VPXENC="$LIBVPX_ROOT/$CODEC/ivfenc" 6 export VPXENC="$LIBVPX_ROOT/$CODEC/vpxenc"
7 export VPXDEC="$LIBVPX_ROOT/ivfdec" 7 export VPXDEC="$LIBVPX_ROOT/vpxdec"
8 export AOMENC="$LIBAOM_ROOT/aomenc" 8 export AOMENC="$LIBAOM_ROOT/aomenc"
9 export AOMDEC="$LIBAOM_ROOT/aomdec" 9 export AOMDEC="$LIBAOM_ROOT/aomdec"
10 if [ -z "$THORENC" ]; then 10 if [ -z "$THORENC" ]; then
11 export THORENC="$WORK_ROOT/$CODEC/build/Thorenc" 11 export THORENC="$WORK_ROOT/$CODEC/build/Thorenc"
12 fi 12 fi
13 if [ -z "$THORDIR" ]; then 13 if [ -z "$THORDIR" ]; then
14 export THORDIR="$(dirname $THORENC)/../" 14 export THORDIR="$(dirname $THORENC)/../"
15 fi 15 fi
16 if [ -z "$THORDEC" ]; then 16 if [ -z "$THORDEC" ]; then
17 export THORDEC="$(dirname $THORENC)/Thordec" 17 export THORDEC="$(dirname $THORENC)/Thordec"
18 fi 18 fi
19 if [ -z "$ENCODER_EXAMPLE" ]; then 19 if [ -z "$ENCODER_EXAMPLE" ]; then
20 export ENCODER_EXAMPLE="$DAALA_ROOT/examples/encoder_example" 20 export ENCODER_EXAMPLE="$DAALA_ROOT/examples/encoder_example"
21 fi 21 fi
22 if [ -z "$YUV2YUV4MPEG" ]; then 22 if [ -z "$YUV2YUV4MPEG" ]; then
23 YUV2YUV4MPEG=$DAALA_ROOT/tools/yuv2yuv4mpeg 23 YUV2YUV4MPEG=$DAALA_ROOT/tools/yuv2yuv4mpeg
24 fi 24 fi
25 if [ -z "$YUVJPEG" ]; then 25 if [ -z "$YUVJPEG" ]; then
26 export YUVJPEG=yuvjpeg 26 export YUVJPEG=yuvjpeg
27 fi 27 fi
28 if [ -z "$JPEGYUV" ]; then 28 if [ -z "$JPEGYUV" ]; then
29 export JPEGYUV=jpegyuv 29 export JPEGYUV=jpegyuv
30 fi 30 fi
31 31
32 KFINT=999 32 KFINT=999
33 33
34 case $CODEC in 34 case $CODEC in
35 daala) 35 daala)
36 if [ ! -x "$ENCODER_EXAMPLE" ]; then
37 echo "Example encoder not found at '$ENCODER_EXAMPLE.'"
38 exit 1
39 fi
36 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" 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"
37 if [ ! -f "$BASENAME.ogv" ] 41 if [ ! -f "$BASENAME.ogv" ]
38 then 42 then
39 echo Failed to produce "$BASENAME.ogv" 43 echo Failed to produce "$BASENAME.ogv"
40 cat "$BASENAME-enc.out" 44 cat "$BASENAME-enc.out"
41 exit 1 45 exit 1
42 fi 46 fi
43 SIZE=$(stat -c %s "$BASENAME.ogv") 47 SIZE=$(stat -c %s "$BASENAME.ogv")
44 mv "00000000out-$BASENAME.y4m" "$BASENAME.y4m" 48 mv "00000000out-$BASENAME.y4m" "$BASENAME.y4m"
45 ;; 49 ;;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 HEIGHT=$(head -1 $FILE | cut -d\ -f 3 | tr -d 'H') 111 HEIGHT=$(head -1 $FILE | cut -d\ -f 3 | tr -d 'H')
108 tail -n+3 $FILE > $BASENAME-in.yuv 112 tail -n+3 $FILE > $BASENAME-in.yuv
109 $YUVJPEG $((100-$x)) "$WIDTH"x$HEIGHT $BASENAME-in.yuv $BASENAME.jpeg 113 $YUVJPEG $((100-$x)) "$WIDTH"x$HEIGHT $BASENAME-in.yuv $BASENAME.jpeg
110 $JPEGYUV $BASENAME.jpeg $BASENAME.yuv 114 $JPEGYUV $BASENAME.jpeg $BASENAME.yuv
111 $YUV2YUV4MPEG $BASENAME -w$WIDTH -h$HEIGHT -an0 -ad0 -c420mpeg2 115 $YUV2YUV4MPEG $BASENAME -w$WIDTH -h$HEIGHT -an0 -ad0 -c420mpeg2
112 rm $BASENAME-in.yuv $BASENAME.yuv 116 rm $BASENAME-in.yuv $BASENAME.yuv
113 SIZE=$(stat -c %s $BASENAME.jpeg) 117 SIZE=$(stat -c %s $BASENAME.jpeg)
114 esac 118 esac
115 119
116 echo $SIZE 120 echo $SIZE
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld