From 0dcdbf61b05b33829031e3174e2bfb2026d08997 Mon Sep 17 00:00:00 2001 From: krakow10 Date: Fri, 4 Sep 2020 05:17:55 -0700 Subject: [PATCH 1/3] use log to improve linearity This transformation of vmaf values maps more linearly to cq values, which should improve the search accuracy. --- Av1an/VMAF/target_vmaf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Av1an/VMAF/target_vmaf.py b/Av1an/VMAF/target_vmaf.py index d0eb4cf..fadda7d 100644 --- a/Av1an/VMAF/target_vmaf.py +++ b/Av1an/VMAF/target_vmaf.py @@ -210,8 +210,8 @@ def weighted_search(num1, vmaf1, num2, vmaf2, target): :return: Q for new probe """ - dif1 = abs(target - vmaf2) - dif2 = abs(target - vmaf1) + dif1 = abs(-math.log(1-target/100) - (-math.log(1-vmaf2/100)) + dif2 = abs(-math.log(1-target/100) - (-math.log(1-vmaf1/100)) tot = dif1 + dif2 From 2dd73f9fadbe2511570e717f1b65dd474f52e93f Mon Sep 17 00:00:00 2001 From: krakow10 Date: Fri, 4 Sep 2020 05:21:53 -0700 Subject: [PATCH 2/3] ) --- Av1an/VMAF/target_vmaf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Av1an/VMAF/target_vmaf.py b/Av1an/VMAF/target_vmaf.py index fadda7d..4739e78 100644 --- a/Av1an/VMAF/target_vmaf.py +++ b/Av1an/VMAF/target_vmaf.py @@ -210,8 +210,8 @@ def weighted_search(num1, vmaf1, num2, vmaf2, target): :return: Q for new probe """ - dif1 = abs(-math.log(1-target/100) - (-math.log(1-vmaf2/100)) - dif2 = abs(-math.log(1-target/100) - (-math.log(1-vmaf1/100)) + dif1 = abs(-math.log(1-target/100) - (-math.log(1-vmaf2/100))) + dif2 = abs(-math.log(1-target/100) - (-math.log(1-vmaf1/100))) tot = dif1 + dif2 From a57c9147188d4d712a0c1414acfcf1fc2ef11def Mon Sep 17 00:00:00 2001 From: krakow10 Date: Fri, 4 Sep 2020 05:52:54 -0700 Subject: [PATCH 3/3] from math import log as ln --- Av1an/VMAF/target_vmaf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Av1an/VMAF/target_vmaf.py b/Av1an/VMAF/target_vmaf.py index 4739e78..42f727f 100644 --- a/Av1an/VMAF/target_vmaf.py +++ b/Av1an/VMAF/target_vmaf.py @@ -1,6 +1,7 @@ #!/bin/env python from math import isnan +from math import log as ln import subprocess from subprocess import STDOUT, PIPE @@ -210,8 +211,8 @@ def weighted_search(num1, vmaf1, num2, vmaf2, target): :return: Q for new probe """ - dif1 = abs(-math.log(1-target/100) - (-math.log(1-vmaf2/100))) - dif2 = abs(-math.log(1-target/100) - (-math.log(1-vmaf1/100))) + dif1 = abs(-ln(1-target/100) - (-ln(1-vmaf2/100))) + dif2 = abs(-ln(1-target/100) - (-ln(1-vmaf1/100))) tot = dif1 + dif2