Skip to content

Commit

Permalink
Add VMAF support.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdaede committed Nov 30, 2016
1 parent c5be67a commit 92594e2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions metrics_gather.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ if [ -z "$DUMP_CIEDE" ]; then
export DUMP_CIEDE="$DAALATOOL_ROOT/tools/dump_ciede2000.py"
fi

if [ -z "$VMAF_ROOT" ]; then
export VMAF_ROOT="$DAALATOOL_ROOT/../vmaf"
fi

if [ -z "$VMAFOSSEXEC" ]; then
export VMAFOSSEXEC="$VMAF_ROOT/wrapper/vmafossexec"
fi

if [ -z "$YUV2YUV4MPEG" ]; then
export YUV2YUV4MPEG="$DAALATOOL_ROOT/tools/yuv2yuv4mpeg"
fi
Expand Down Expand Up @@ -238,6 +246,27 @@ fi

echo "$ENCTIME"

rm -f ref dis
mkfifo ref
mkfifo dis
FORMAT=yuv420p
case $CHROMA in
420p10)
FORMAT=yuv444p10le
;;
444p10)
FORMAT=yuv444p10le
;;
444)
FORMAT=yuv444p
;;
esac
"$DAALATOOL_ROOT/tools/y4m2yuv" "$FILE" -o ref &
"$DAALATOOL_ROOT/tools/y4m2yuv" "$BASENAME.y4m" -o dis &
VMAF=$("$VMAFOSSEXEC" $FORMAT $WIDTH $HEIGHT ref dis "$VMAF_ROOT/resource/model/nflxall_vmafv4.pkl" | tail -n 1)

echo "$VMAF"

if [ ! "$NO_DELETE" ]; then
rm -f "$BASENAME.y4m" "$BASENAME.yuv" "$BASENAME.ogv" "$BASENAME.x264" "$BASENAME.x265" "$BASENAME.vpx" "$BASENAME.ivf" "$TIMEROUT" "$BASENAME-enc.out" "$BASENAME-psnr.out" "$BASENAME.thor" 2> /dev/null
fi
Expand Down
2 changes: 2 additions & 0 deletions work.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def reduce(self):
f.write(str(work.metric['apsnr'][2])+' ')
f.write(str(work.metric['msssim'][0])+' ')
f.write(str(work.metric['encodetime'])+' ')
f.write(str(work.metric['vmaf'])+' ')
f.write('\n')
f.close()
else:
Expand Down Expand Up @@ -138,6 +139,7 @@ def parse(self, stdout, stderr):
self.metric['msssim'][1] = split[50]
self.metric['msssim'][2] = split[52]
self.metric['encodetime'] = split[53]
self.metric['vmaf'] = split[57]
self.failed = False
except IndexError:
rd_print(self.log,'Decoding result for '+self.filename+' at quality '+str(self.quality)+' failed!')
Expand Down

0 comments on commit 92594e2

Please sign in to comment.