From ad83e7078733c578bb7a44c155ac05382bb46873 Mon Sep 17 00:00:00 2001 From: krakow10 Date: Fri, 4 Sep 2020 13:29:55 -0700 Subject: [PATCH 1/2] define and use transform_vmaf function --- Av1an/VMAF/target_vmaf.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Av1an/VMAF/target_vmaf.py b/Av1an/VMAF/target_vmaf.py index 42f727f..961177a 100644 --- a/Av1an/VMAF/target_vmaf.py +++ b/Av1an/VMAF/target_vmaf.py @@ -198,6 +198,12 @@ def get_closest(q_list, q, positive=True): return min(q_list, key=lambda x: abs(x - q)) +def transform_vmaf(vmaf): + if vmaf<99.99: + return -ln(1-vmaf/100) + else + #return -ln(1-99.99/100) + return 9.210340371976184 def weighted_search(num1, vmaf1, num2, vmaf2, target): """ @@ -211,8 +217,8 @@ def weighted_search(num1, vmaf1, num2, vmaf2, target): :return: Q for new probe """ - dif1 = abs(-ln(1-target/100) - (-ln(1-vmaf2/100))) - dif2 = abs(-ln(1-target/100) - (-ln(1-vmaf1/100))) + dif1 = abs(transform_vmaf(target) - transform_vmaf(vmaf2)) + dif2 = abs(transform_vmaf(target) - transform_vmaf(vmaf1)) tot = dif1 + dif2 From 8952b460d3ecc64569874a00183c48ef12218038 Mon Sep 17 00:00:00 2001 From: krakow10 Date: Fri, 4 Sep 2020 13:35:53 -0700 Subject: [PATCH 2/2] : --- Av1an/VMAF/target_vmaf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Av1an/VMAF/target_vmaf.py b/Av1an/VMAF/target_vmaf.py index 961177a..c36fc84 100644 --- a/Av1an/VMAF/target_vmaf.py +++ b/Av1an/VMAF/target_vmaf.py @@ -201,7 +201,7 @@ def get_closest(q_list, q, positive=True): def transform_vmaf(vmaf): if vmaf<99.99: return -ln(1-vmaf/100) - else + else: #return -ln(1-99.99/100) return 9.210340371976184