update CTC scripts

1. add the latest excel template
2. add the support in the script to output Overall PSNR and Overall APSNR
3. update the VBA macro for BDRATE calculation

Change-Id: I9489f5e8f3d78008227f1e51eb0576b031ba67f2
diff --git a/tools/convexhull_framework/bin/AV2Template_V9.xlsm b/tools/convexhull_framework/bin/AV2Template_V9.xlsm
deleted file mode 100644
index 84016e1..0000000
--- a/tools/convexhull_framework/bin/AV2Template_V9.xlsm
+++ /dev/null
Binary files differ
diff --git a/tools/convexhull_framework/bin/Research-v1.0.4-anchor.xlsm b/tools/convexhull_framework/bin/Research-v1.0.4-anchor.xlsm
new file mode 100644
index 0000000..b802599
--- /dev/null
+++ b/tools/convexhull_framework/bin/Research-v1.0.4-anchor.xlsm
Binary files differ
diff --git a/tools/convexhull_framework/bin/vbaProject-AV2.bin b/tools/convexhull_framework/bin/vbaProject-AV2.bin
index 5015c6f..2bc1f3b 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/src/CalcQtyWithVmafTool.py b/tools/convexhull_framework/src/CalcQtyWithVmafTool.py
index 23d2471..a6c4fce 100644
--- a/tools/convexhull_framework/src/CalcQtyWithVmafTool.py
+++ b/tools/convexhull_framework/src/CalcQtyWithVmafTool.py
@@ -13,7 +13,8 @@
 import os
 import re
 import logging
-from Config import BinPath, LoggerName, VMAF
+import math
+from Config import BinPath, LoggerName, VMAF, PSNRY_WEIGHT, PSNRU_WEIGHT, PSNRV_WEIGHT
 from Utils import GetShortContentName, ExecuteCmd
 
 subloggername = "CalcQtyMetrics_VMAFTool"
@@ -22,8 +23,8 @@
 
 Model_Pkg_File = os.path.join(BinPath, 'vmaf_v0.6.1.pkl')
 VMAFMetricsFullList = ['VMAF_Y','VMAF_Y-NEG','PSNR_Y','PSNR_U','PSNR_V','SSIM_Y(dB)',
-                       'MS-SSIM_Y(dB)','PSNR-HVS','CIEDE2000','APSNR_Y',
-                       'APSNR_U','APSNR_V']
+                       'MS-SSIM_Y(dB)','PSNR-HVS','CIEDE2000','APSNR_Y','APSNR_U','APSNR_V',
+                       'Overall_PSNR', 'Overall_APSNR']
 
 def ParseVMAFLogFile(vmaf_log):
     floats = len(VMAFMetricsFullList) * [0.0]
@@ -64,7 +65,17 @@
             floats[11] = m.group(3)
     flog.close()
     floats = [float(i) for i in floats]
-
+    floats[12] = (PSNRY_WEIGHT * floats[2] + PSNRU_WEIGHT * floats[3] + PSNRV_WEIGHT * floats[4]) / \
+                 (PSNRY_WEIGHT + PSNRU_WEIGHT + PSNRV_WEIGHT)
+    floats[12] = round(floats[12],6)
+    #Overall_APSNR =10 * LOG10(1.0 / ((PSNRY_WEIGHT / 10.0 ^ (APSNRY / 10.0) +
+    #                                  PSNRY_WEIGHT / 10.0 ^ (APSNRU / 10.0) +
+    #                                  PSNRV_WEIGHT / 10.0 ^ (APSNRV / 10.0)) / (PSNRY_WEIGHT + PSNRU_WEIGHT + PSNRV_WEIGHT)))
+    floats[13] = 10.0 * math.log10 ( 1.0 / ((PSNRY_WEIGHT / pow(10.0, floats[9]  / 10.0) +
+                                             PSNRU_WEIGHT / pow(10.0, floats[10] / 10.0) +
+                                             PSNRV_WEIGHT / pow(10.0, floats[11] / 10.0)) /
+                                            (PSNRY_WEIGHT + PSNRU_WEIGHT + PSNRV_WEIGHT)))
+    floats[13] = round(floats[13], 6)
     print_str = "VMAF quality metrics: "
     for metrics, idx in zip(VMAFMetricsFullList, range(len(VMAFMetricsFullList))):
         print_str += "%s = %2.5f, " % (metrics, floats[idx])
diff --git a/tools/convexhull_framework/src/Config.py b/tools/convexhull_framework/src/Config.py
index 46d026c..9bd71ab 100644
--- a/tools/convexhull_framework/src/Config.py
+++ b/tools/convexhull_framework/src/Config.py
@@ -64,11 +64,14 @@
 }
 
 ######################## quality evalution config #############################
-QualityList = ['PSNR_Y','PSNR_U','PSNR_V','SSIM_Y(dB)','MS-SSIM_Y(dB)','VMAF_Y',
-               'VMAF_Y-NEG','PSNR-HVS','CIEDE2000','APSNR_Y','APSNR_U','APSNR_V']
+QualityList = ['PSNR_Y','PSNR_U','PSNR_V','Overall_PSNR','SSIM_Y(dB)','MS-SSIM_Y(dB)','VMAF_Y',
+               'VMAF_Y-NEG','PSNR-HVS','CIEDE2000','APSNR_Y','APSNR_U','APSNR_V','Overall_APSNR']
 VMAF = os.path.join(BinPath, 'vmaf.exe')
 CalcBDRateInExcel = True
 EnablePreInterpolation = True
+PSNRY_WEIGHT = 6.0
+PSNRU_WEIGHT = 1.0
+PSNRV_WEIGHT = 1.0
 
 ######################## config for exporting data to excel  #################
 #https://xlsxwriter.readthedocs.io/working_with_colors.html#colors