<div dir="ltr"><div># HG changeset patch</div><div># User Deepthi Nandakumar <<a href="mailto:deepthi@multicorewareinc.com">deepthi@multicorewareinc.com</a>></div><div># Date 1456649560 -19800</div><div>#      Sun Feb 28 14:22:40 2016 +0530</div><div># Node ID 107d56fa9b06ae9d240b0608d38d403ccc974b7a</div><div># Parent  7ede72109f16d0df227d44f1ab1aef368628bab0</div><div>picyuv: luma max/min only for HDR-relevant encodes, fix param initialisations</div><div><br></div><div>diff -r 7ede72109f16 -r 107d56fa9b06 source/common/param.cpp</div><div>--- a/source/common/param.cpp<span class="" style="white-space:pre">       </span>Tue Feb 23 22:27:52 2016 +0530</div><div>+++ b/source/common/param.cpp<span class="" style="white-space:pre">        </span>Sun Feb 28 14:22:40 2016 +0530</div><div>@@ -246,7 +246,7 @@</div><div>     param->maxCLL = 0;</div><div>     param->maxFALL = 0;</div><div>     param->minLuma = 0;</div><div>-    param->maxLuma = (1 << X265_DEPTH) - 1;</div><div>+    param->maxLuma = 0;</div><div> }</div><div> </div><div> int x265_param_default_preset(x265_param* param, const char* preset, const char* tune)</div><div>diff -r 7ede72109f16 -r 107d56fa9b06 source/common/picyuv.cpp</div><div>--- a/source/common/picyuv.cpp<span class="" style="white-space:pre">       </span>Tue Feb 23 22:27:52 2016 +0530</div><div>+++ b/source/common/picyuv.cpp<span class="" style="white-space:pre">       </span>Sun Feb 28 14:22:40 2016 +0530</div><div>@@ -279,12 +279,19 @@</div><div>         }</div><div>     }</div><div> </div><div>+    pixel *Y = m_picOrg[0];</div><div>+    pixel *U = m_picOrg[1];</div><div>+    pixel *V = m_picOrg[2];</div><div>+</div><div>+    /* Apply min/max luma bounds and calculate max and avg luma levels for HDR SEI messages */</div><div>+    if (!!param.maxLuma || !!param.minLuma || !!param.maxCLL)</div><div>+    {</div><div>+        uint64_t sumLuma;</div><div>+        m_maxLumaLevel = primitives.planeClipAndMax(Y, m_stride, width, height, &sumLuma, (pixel)param.minLuma, (pixel)param.maxLuma);</div><div>+        m_avgLumaLevel = (double)(sumLuma) / (m_picHeight * m_picWidth);</div><div>+    }</div><div>+</div><div>     /* extend the right edge if width was not multiple of the minimum CU size */</div><div>-    uint64_t sumLuma;</div><div>-    pixel *Y = m_picOrg[0];</div><div>-    m_maxLumaLevel = primitives.planeClipAndMax(Y, m_stride, width, height, &sumLuma, (pixel)param.minLuma, (pixel)param.maxLuma);</div><div>-    m_avgLumaLevel = (double)(sumLuma) / (m_picHeight * m_picWidth);</div><div>-</div><div>     for (int r = 0; r < height; r++)</div><div>     {</div><div>         for (int x = 0; x < padx; x++)</div><div>@@ -299,9 +306,6 @@</div><div> </div><div>     if (pic.colorSpace != X265_CSP_I400)</div><div>     {</div><div>-        pixel *U = m_picOrg[1];</div><div>-        pixel *V = m_picOrg[2];</div><div>-</div><div>         for (int r = 0; r < height >> m_vChromaShift; r++)</div><div>         {</div><div>             for (int x = 0; x < padx >> m_hChromaShift; x++)</div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Deepthi Nandakumar<br></div>Engineering Manager, x265<br></div>Multicoreware, Inc<br></div></div>
</div>