[x265] fix chroma lambda weighting

Satoshi Nakagawa nakagawa424 at oki.com
Wed Mar 26 05:16:38 CET 2014


 

lambda for RDO is proportional to pow(2.0, qp / 3.0).

so, the qp offset here also needs to be devided by 3.0.

 

 

From: x265-devel [mailto:x265-devel-bounces at videolan.org] On Behalf Of
Deepthi Nandakumar
Sent: Tuesday, March 25, 2014 7:55 PM
To: Development for x265
Subject: Re: [x265] fix chroma lambda weighting

 

Thanks, very interesting fix. Can you give us some background here? Where
did we the divide by 3.0 come from?

 

On Tue, Mar 25, 2014 at 9:01 AM, Satoshi Nakagawa <nakagawa424 at oki.com>
wrote:

# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1395672158 -32400
#      Mon Mar 24 23:42:38 2014 +0900
# Node ID 08584b5913bce6a5f9d2f0d408fcdace6aa83a65
# Parent  fdd7c6168cf42a11240ff1c7fc7b401605524db2
fix chroma lambda weighting

diff -r fdd7c6168cf4 -r 08584b5913bc source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp   Fri Mar 21 14:44:35 2014 -0500
+++ b/source/encoder/frameencoder.cpp   Mon Mar 24 23:42:38 2014 +0900
@@ -335,11 +335,10 @@
     // instead we weight the distortion of chroma.
     int chromaQPOffset = slice->getPPS()->getChromaCbQpOffset() +
slice->getSliceQpDeltaCb();
     int qpc = Clip3(0, MAX_MAX_QP, qp + chromaQPOffset);
-    double cbWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc])); // takes
into account of the chroma qp mapping and chroma qp Offset
-
+    double cbWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc]) / 3.0); //
takes into account of the chroma qp mapping and chroma qp Offset
     chromaQPOffset = slice->getPPS()->getChromaCrQpOffset() +
slice->getSliceQpDeltaCr();
     qpc = Clip3(0, MAX_MAX_QP, qp + chromaQPOffset);
-    double crWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc])); // takes
into account of the chroma qp mapping and chroma qp Offset
+    double crWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc]) / 3.0); //
takes into account of the chroma qp mapping and chroma qp Offset
     double chromaLambda = lambda / crWeight;

     m_rows[row].m_search.setQPLambda(qp, lambda, chromaLambda);
@@ -376,10 +375,10 @@
     int qpc;
     int chromaQPOffset = slice->getPPS()->getChromaCbQpOffset() +
slice->getSliceQpDeltaCb();
     qpc = Clip3(0, MAX_MAX_QP, qp + chromaQPOffset);
-    double cbWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc])); // takes
into account of the chroma qp mapping and chroma qp Offset
+    double cbWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc]) / 3.0); //
takes into account of the chroma qp mapping and chroma qp Offset
     chromaQPOffset = slice->getPPS()->getChromaCrQpOffset() +
slice->getSliceQpDeltaCr();
     qpc = Clip3(0, MAX_MAX_QP, qp + chromaQPOffset);
-    double crWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc])); // takes
into account of the chroma qp mapping and chroma qp Offset
+    double crWeight = pow(2.0, (qp - g_chromaScale[chFmt][qpc]) / 3.0); //
takes into account of the chroma qp mapping and chroma qp Offset
     double chromaLambda = lambda / crWeight;

     // NOTE: set SAO lambda every Frame
_______________________________________________
x265-devel mailing list
x265-devel at videolan.org
https://mailman.videolan.org/listinfo/x265-devel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140326/f12af212/attachment.html>


More information about the x265-devel mailing list