[x265] picyuv: luma max/min only for HDR-relevant encodes, fix param initialisations
Deepthi Nandakumar
deepthi at multicorewareinc.com
Tue Mar 1 04:52:45 CET 2016
# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1456649560 -19800
# Sun Feb 28 14:22:40 2016 +0530
# Node ID 107d56fa9b06ae9d240b0608d38d403ccc974b7a
# Parent 7ede72109f16d0df227d44f1ab1aef368628bab0
picyuv: luma max/min only for HDR-relevant encodes, fix param
initialisations
diff -r 7ede72109f16 -r 107d56fa9b06 source/common/param.cpp
--- a/source/common/param.cpp Tue Feb 23 22:27:52 2016 +0530
+++ b/source/common/param.cpp Sun Feb 28 14:22:40 2016 +0530
@@ -246,7 +246,7 @@
param->maxCLL = 0;
param->maxFALL = 0;
param->minLuma = 0;
- param->maxLuma = (1 << X265_DEPTH) - 1;
+ param->maxLuma = 0;
}
int x265_param_default_preset(x265_param* param, const char* preset, const
char* tune)
diff -r 7ede72109f16 -r 107d56fa9b06 source/common/picyuv.cpp
--- a/source/common/picyuv.cpp Tue Feb 23 22:27:52 2016 +0530
+++ b/source/common/picyuv.cpp Sun Feb 28 14:22:40 2016 +0530
@@ -279,12 +279,19 @@
}
}
+ pixel *Y = m_picOrg[0];
+ pixel *U = m_picOrg[1];
+ pixel *V = m_picOrg[2];
+
+ /* Apply min/max luma bounds and calculate max and avg luma levels for
HDR SEI messages */
+ if (!!param.maxLuma || !!param.minLuma || !!param.maxCLL)
+ {
+ uint64_t sumLuma;
+ m_maxLumaLevel = primitives.planeClipAndMax(Y, m_stride, width,
height, &sumLuma, (pixel)param.minLuma, (pixel)param.maxLuma);
+ m_avgLumaLevel = (double)(sumLuma) / (m_picHeight * m_picWidth);
+ }
+
/* extend the right edge if width was not multiple of the minimum CU
size */
- uint64_t sumLuma;
- pixel *Y = m_picOrg[0];
- m_maxLumaLevel = primitives.planeClipAndMax(Y, m_stride, width,
height, &sumLuma, (pixel)param.minLuma, (pixel)param.maxLuma);
- m_avgLumaLevel = (double)(sumLuma) / (m_picHeight * m_picWidth);
-
for (int r = 0; r < height; r++)
{
for (int x = 0; x < padx; x++)
@@ -299,9 +306,6 @@
if (pic.colorSpace != X265_CSP_I400)
{
- pixel *U = m_picOrg[1];
- pixel *V = m_picOrg[2];
-
for (int r = 0; r < height >> m_vChromaShift; r++)
{
for (int x = 0; x < padx >> m_hChromaShift; x++)
--
Deepthi Nandakumar
Engineering Manager, x265
Multicoreware, Inc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160301/b4714aa3/attachment.html>
More information about the x265-devel
mailing list