update CTC test script

1. add feature to dump out md5 of downscaled clip for AS test
configuration
2. update to the latest excel template.

Change-Id: I9db544da61c0b6581d2e06b4a5cb425dd08f9972
diff --git a/tools/convexhull_framework/bin/AV2Template_V2.xlsm b/tools/convexhull_framework/bin/AV2Template_V2.xlsm
deleted file mode 100644
index 01a0f34..0000000
--- a/tools/convexhull_framework/bin/AV2Template_V2.xlsm
+++ /dev/null
Binary files differ
diff --git a/tools/convexhull_framework/bin/AV2Template_V7.xlsm b/tools/convexhull_framework/bin/AV2Template_V7.xlsm
new file mode 100644
index 0000000..68b92fb
--- /dev/null
+++ b/tools/convexhull_framework/bin/AV2Template_V7.xlsm
Binary files differ
diff --git a/tools/convexhull_framework/bin/vbaProject-AV2.bin b/tools/convexhull_framework/bin/vbaProject-AV2.bin
index a9df27b..989c4ac 100644
--- a/tools/convexhull_framework/bin/vbaProject-AV2.bin
+++ b/tools/convexhull_framework/bin/vbaProject-AV2.bin
Binary files differ
diff --git a/tools/convexhull_framework/bin/vbaProject_JVET-L0242.bin b/tools/convexhull_framework/bin/vbaProject_JVET-L0242.bin
deleted file mode 100644
index 0154878..0000000
--- a/tools/convexhull_framework/bin/vbaProject_JVET-L0242.bin
+++ /dev/null
Binary files differ
diff --git a/tools/convexhull_framework/src/Utils.py b/tools/convexhull_framework/src/Utils.py
index 222543b..e759612 100644
--- a/tools/convexhull_framework/src/Utils.py
+++ b/tools/convexhull_framework/src/Utils.py
@@ -16,6 +16,7 @@
 import subprocess
 import time
 import logging
+import hashlib
 from Config import LogLevels, ContentPath
 from AV2CTCVideo import Y4M_CLIPs, CTC_TEST_SET
 
@@ -259,3 +260,10 @@
             # if not valid, default set to 'INFO'
             levelname = logging.getLevelName('INFO')
         Logger.setLevel(levelname)
+
+def md5(fname):
+    hash_md5 = hashlib.md5()
+    with open(fname, "rb") as f:
+        for chunk in iter(lambda: f.read(4096), b""):
+            hash_md5.update(chunk)
+    return hash_md5.hexdigest()
diff --git a/tools/convexhull_framework/src/VideoScaler.py b/tools/convexhull_framework/src/VideoScaler.py
index 25af1b3..50ee5abd 100644
--- a/tools/convexhull_framework/src/VideoScaler.py
+++ b/tools/convexhull_framework/src/VideoScaler.py
@@ -16,7 +16,7 @@
 import fileinput
 from shutil import copyfile
 from Config import LoggerName, FFMPEG, HDRToolsConfigFileTemplate, HDRConvert
-from Utils import GetShortContentName, ExecuteCmd
+from Utils import GetShortContentName, ExecuteCmd, md5
 
 subloggername = "VideoScaler"
 loggername = LoggerName + '.' + '%s' % subloggername
@@ -110,18 +110,31 @@
     upscaledout = os.path.join(path, filename)
     return upscaledout
 
+def GetDownScaledMD5File(clip, dnw, dnh, path, algo):
+    contentBaseName = GetShortContentName(clip.file_name, False)
+    actual_algo = 'None' if clip.width == dnw and clip.height == dnh else algo
+    filename = contentBaseName + ('_Scaled_%s_%dx%d.md5' % (actual_algo, dnw,
+                                                              dnh))
+    dnscaledmd5 = os.path.join(path, filename)
+    return dnscaledmd5
+
 def DownScaling(clip, num, outw, outh, path, cfg_path, algo, LogCmdOnly = False):
-    dnScalOut = GetDownScaledOutFile(clip, outw, outh, path, algo)
+    dnScaledOut = GetDownScaledOutFile(clip, outw, outh, path, algo)
 
     Utils.CmdLogger.write("::Downscaling\n")
     if (clip.width == outw and clip.height == outh):
-        cmd = "copy %s %s" % (clip.file_path, dnScalOut)
+        cmd = "copy %s %s" % (clip.file_path, dnScaledOut)
         ExecuteCmd(cmd, LogCmdOnly)
     else:
         # call separate process to do the downscaling
-        VideoRescaling(clip, num, outw, outh, dnScalOut, algo, cfg_path,
+        VideoRescaling(clip, num, outw, outh, dnScaledOut, algo, cfg_path,
                        LogCmdOnly)
-    return dnScalOut
+    dnScaleMD5 = GetDownScaledMD5File(clip, outw, outh, path, algo)
+    f = open(dnScaleMD5, 'wt')
+    MD5 = md5(dnScaledOut)
+    f.write(MD5)
+    f.close()
+    return dnScaledOut
 
 def UpScaling(clip, num, outw, outh, path, cfg_path, algo, LogCmdOnly = False):
     upScaleOut = GetUpScaledOutFile(clip, outw, outh, algo, path)