-
Notifications
You must be signed in to change notification settings - Fork 422
/
Copy pathrd_collect.sh
executable file
·106 lines (83 loc) · 2.32 KB
/
rd_collect.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
set -e
if [ $# == 0 ]; then
echo "usage: DAALA_ROOT=<daala_root> MOZJPEG_ROOT=<mozjpeg_root> $0 *.y4m"
exit 1
fi
if [ -z $MOZJPEG_ROOT ]; then
MOZJPEG_ROOT=.
fi
if [ -z $DAALA_ROOT ]; then
echo "DAALA_ROOT not set."
exit 1
fi
if [ -z "$PLANE" ]; then
export PLANE=0
fi
if [ $PLANE != 0 ] && [ $PLANE != 1 ] && [ $PLANE != 2 ]; then
echo "Invalid plane $PLANE. Must be 0, 1 or 2."
exit 1
fi
if [ -z "$YUVJPEG" ]; then
export YUVJPEG=$MOZJPEG_ROOT/yuvjpeg
fi
if [ -z "$JPEGYUV" ]; then
export JPEGYUV=$MOZJPEG_ROOT/jpegyuv
fi
if [ ! -x "$YUVJPEG" ]; then
echo "Executable not found YUVJPEG=$YUVJPEG"
echo "Do you have the right MOZJPEG_ROOT=$MOZJPEG_ROOT"
exit 1
fi
if [ ! -x "$JPEGYUV" ]; then
echo "Executable not found JPEGYUV=$JPEGYUV"
echo "Do you have the right MOZJPEG_ROOT=$MOZJPEG_ROOT"
exit 1
fi
# TODO refactor these out of the daala project into a metrics project
if [ -z "$YUV2YUV4MPEG" ]; then
export YUV2YUV4MPEG=$DAALA_ROOT/tools/yuv2yuv4mpeg
fi
if [ -z "$DUMP_PSNR" ]; then
export DUMP_PSNR=$DAALA_ROOT/tools/dump_psnr
fi
if [ -z "$DUMP_PSNRHVS" ]; then
export DUMP_PSNRHVS=$DAALA_ROOT/tools/dump_psnrhvs
fi
if [ -z "$DUMP_SSIM" ]; then
export DUMP_SSIM=$DAALA_ROOT/tools/dump_ssim
fi
if [ -z "$DUMP_FASTSSIM" ]; then
export DUMP_FASTSSIM=$DAALA_ROOT/tools/dump_fastssim
fi
if [ ! -x "$YUV2YUV4MPEG" ]; then
echo "Executable not found YUV2YUV4MPEG=$YUV2YUV4MPEG"
echo "Do you have the right DAALA_ROOT=$DAALA_ROOT"
exit 1
fi
if [ ! -x "$DUMP_PSNR" ]; then
echo "Executable not found DUMP_PSNR=$DUMP_PSNR"
echo "Do you have the right DAALA_ROOT=$DAALA_ROOT"
exit 1
fi
if [ ! -x "$DUMP_PSNRHVS" ]; then
echo "Executable not found DUMP_PSNRHVS=$DUMP_PSNRHVS"
echo "Do you have the right DAALA_ROOT=$DAALA_ROOT"
exit 1
fi
if [ ! -x "$DUMP_SSIM" ]; then
echo "Executable not found DUMP_SSIM=$DUMP_SSIM"
echo "Do you have the right DAALA_ROOT=$DAALA_ROOT"
exit 1
fi
if [ ! -x "$DUMP_FASTSSIM" ]; then
echo "Executable not found DUMP_FASTSSIM=$DUMP_FASTSSIM"
echo "Do you have the right DAALA_ROOT=$DAALA_ROOT"
exit 1
fi
RD_COLLECT_SUB=$(dirname "$0")/rd_collect_sub.sh
if [ -z "$CORES" ]; then
CORES=`grep -i processor /proc/cpuinfo | wc -l`
#echo "CORES not set, using $CORES"
fi
find $@ -type f -name "*.y4m" -print0 | xargs -0 -n1 -P$CORES $RD_COLLECT_SUB