From 35c65b806a2e69c1af9976f4544a38bced884c13 Mon Sep 17 00:00:00 2001
From: Frank Bossen <fbossen@gmail.com>
Date: Tue, 6 Aug 2019 16:34:23 -0400
Subject: [PATCH] Update chroma QP tables for use in CTC

This should implement the following from the meeting notes:

For CTC, it was initially agreed to use the new syntax to achieve
the chroma QP settings proposed in O0186 for SDR, N0221 for PQ,
O0433 for HLG. For the joint table, use the average of the Cb and Cr
tables. Below QP = 16, chroma and luma QP should be equal for CEs
using low QP.

Decision (CTC): This was further discussed in the closing plenary
on Friday. It was suggested to keep the anchor QP settings for PQ
and HLG as in CTC of prior meeting cycle. For SDR, see above.
Below QP = 16, chroma and luma QP should be equal for CEs using low
QP.
---
 cfg/encoder_intra_vtm.cfg        | 7 +++++--
 cfg/encoder_lowdelay_P_vtm.cfg   | 8 +++++---
 cfg/encoder_lowdelay_vtm.cfg     | 8 +++++---
 cfg/encoder_randomaccess_vtm.cfg | 8 +++++---
 cfg/per-class/classH1.cfg        | 6 ++++++
 cfg/per-class/classH2.cfg        | 6 ++++++
 6 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/cfg/encoder_intra_vtm.cfg b/cfg/encoder_intra_vtm.cfg
index 1a07b246f7..fb8fdd7d15 100644
--- a/cfg/encoder_intra_vtm.cfg
+++ b/cfg/encoder_intra_vtm.cfg
@@ -75,8 +75,11 @@ CUTransquantBypassFlagForce: 0                         # Force transquant bypass
 #============ VTM settings ======================
 LoopFilterTcOffset_div2             : 0
 SEIDecodedPictureHash               : 0
-CbQpOffset                          : 1
-CrQpOffset                          : 1
+CbQpOffset                          : 0
+CrQpOffset                          : 0
+SameCQPTablesForAllChroma           : 1
+QpInValCb                           : 2 31 43
+QpOutValCb                          : 2 32 41
 TemporalSubsampleRatio              : 8
 
 ReWriteParamSets                    : 1
diff --git a/cfg/encoder_lowdelay_P_vtm.cfg b/cfg/encoder_lowdelay_P_vtm.cfg
index 73175d5e95..3fb15fda80 100644
--- a/cfg/encoder_lowdelay_P_vtm.cfg
+++ b/cfg/encoder_lowdelay_P_vtm.cfg
@@ -92,9 +92,11 @@ RCForceIntraQP                      : 0                # Rate control: force int
 #============ VTM settings ======================
 LoopFilterTcOffset_div2             : 0
 SEIDecodedPictureHash               : 0
-CbQpOffset                          : 1
-CrQpOffset                          : 1
-
+CbQpOffset                          : 0
+CrQpOffset                          : 0
+SameCQPTablesForAllChroma           : 1
+QpInValCb                           : 32 44
+QpOutValCb                          : 32 41
 ReWriteParamSets                    : 1
 #============ NEXT ====================
 
diff --git a/cfg/encoder_lowdelay_vtm.cfg b/cfg/encoder_lowdelay_vtm.cfg
index 08ac2388ca..518d2506f1 100644
--- a/cfg/encoder_lowdelay_vtm.cfg
+++ b/cfg/encoder_lowdelay_vtm.cfg
@@ -92,9 +92,11 @@ RCForceIntraQP                      : 0                # Rate control: force int
 #============ VTM settings ======================
 LoopFilterTcOffset_div2             : 0
 SEIDecodedPictureHash               : 0
-CbQpOffset                          : 1
-CrQpOffset                          : 1
-
+CbQpOffset                          : 0
+CrQpOffset                          : 0
+SameCQPTablesForAllChroma           : 1
+QpInValCb                           : 32 44
+QpOutValCb                          : 32 41
 ReWriteParamSets                    : 1
 #============ NEXT ====================
 
diff --git a/cfg/encoder_randomaccess_vtm.cfg b/cfg/encoder_randomaccess_vtm.cfg
index 15dd5ee617..f651f78b32 100644
--- a/cfg/encoder_randomaccess_vtm.cfg
+++ b/cfg/encoder_randomaccess_vtm.cfg
@@ -106,9 +106,11 @@ RCForceIntraQP                      : 0                # Rate control: force int
 #============ VTM settings ======================
 LoopFilterTcOffset_div2             : 0
 SEIDecodedPictureHash               : 0
-CbQpOffset                          : 1
-CrQpOffset                          : 1
-
+CbQpOffset                          : 0
+CrQpOffset                          : 0
+SameCQPTablesForAllChroma           : 1
+QpInValCb                           : 32 44
+QpOutValCb                          : 32 41
 ReWriteParamSets                    : 1
 #============ NEXT ====================
 
diff --git a/cfg/per-class/classH1.cfg b/cfg/per-class/classH1.cfg
index 4505d2c226..469f05808f 100644
--- a/cfg/per-class/classH1.cfg
+++ b/cfg/per-class/classH1.cfg
@@ -12,3 +12,9 @@ WCGPPSChromaQpScale           : -0.46       # Linear chroma QP offset mapping (s
 WCGPPSChromaQpOffset          : 9.26        # Linear chroma QP offset mapping (offset) based on QP
 WCGPPSCbQpScale               : 1.14        # Scale factor depending on capture and representation color space
 WCGPPSCrQpScale               : 1.79        # Scale factor depending on capture and representation color space 
+
+CbQpOffset                          : 0
+CrQpOffset                          : 0
+SameCQPTablesForAllChroma           : 1
+QpInValCb                           : 10 23 32 42
+QpOutValCb                          : 10 24 32 37
diff --git a/cfg/per-class/classH2.cfg b/cfg/per-class/classH2.cfg
index 1b26c7f093..d1ce1ab091 100644
--- a/cfg/per-class/classH2.cfg
+++ b/cfg/per-class/classH2.cfg
@@ -7,3 +7,9 @@ LMCSSignalType                : 2           # Input signal type: 0:SDR, 1:HDR-PQ
 
 #======== Chroma QP scale ============
 WCGPPSEnable                  : 0           # enable WCG Chroma scale
+
+CbQpOffset                          : 0
+CrQpOffset                          : 0
+SameCQPTablesForAllChroma           : 1
+QpInValCb                           : 10 23 32 42
+QpOutValCb                          : 10 24 32 37
-- 
GitLab