[x265] [PATCH x265] Min value and max value issue of luma.

Chunli Zhang chunli at multicorewareinc.com
Thu Jun 28 08:25:27 CEST 2018


# HG changeset patch
# User Chunli Zhang
# Date 1528964852 -28800
#      Thu Jun 14 16:27:32 2018 +0800
# Node ID 8b8334561e990554226ac439e03cf4b8ab3c6008
# Parent  a8a5ccf5aaf7e04e439a216e5c396991c6b76999
Support luma values automatically changed by the commandline parameter
"--min-luma" and "--max-luma".

diff -r a8a5ccf5aaf7 -r 8b8334561e99 source/common/param.cpp
--- a/source/common/param.cpp Wed Jun 13 09:54:27 2018 +0530
+++ b/source/common/param.cpp Thu Jun 14 16:27:32 2018 +0800
@@ -1405,6 +1405,8 @@
         "Invalid refine-intra value, refine-intra levels 0 to 3
supported");
     CHECK(param->maxAUSizeFactor < 0.5 || param->maxAUSizeFactor > 1.0,
         "Supported factor for controlling max AU size is from 0.5 to 1");
+    CHECK(param->minLuma < 0 || param->maxLuma > PIXEL_MAX,
+        "Supported minLuma or maxLuma is from 0 to ((1 << X265_DEPTH) -
1)");
 #if !X86_64
     CHECK(param->searchMethod == X265_SEA && (param->sourceWidth > 840 ||
param->sourceHeight > 480),
         "SEA motion search does not support resolutions greater than 480p
in 32 bit build");
diff -r a8a5ccf5aaf7 -r 8b8334561e99 source/common/picyuv.cpp
--- a/source/common/picyuv.cpp Wed Jun 13 09:54:27 2018 +0530
+++ b/source/common/picyuv.cpp Thu Jun 14 16:27:32 2018 +0800
@@ -358,6 +358,19 @@
     pixel *uPic = m_picOrg[1];
     pixel *vPic = m_picOrg[2];

+    if(param.minLuma != 0 || param.maxLuma != PIXEL_MAX)
+    {
+        for (int r = 0; r < height; r++)
+        {
+            for (int c = 0; c < width; c++)
+            {
+                yPic[c] = X265_MIN(yPic[c], (pixel)param.maxLuma);
+                yPic[c] = X265_MAX(yPic[c], (pixel)param.minLuma);
+            }
+            yPic += m_stride;
+        }
+    }
+    yPic = m_picOrg[0];
     if (param.csvLogLevel >= 2 || param.maxCLL || param.maxFALL)
     {
         for (int r = 0; r < height; r++)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180628/d5a806d5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: min_max_value_issue_of_luma.patch
Type: application/octet-stream
Size: 1889 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180628/d5a806d5/attachment.obj>


More information about the x265-devel mailing list