<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 17, 2020 at 2:48 PM <<a href="mailto:srikanth.kurapati@multicorewareinc.com">srikanth.kurapati@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Srikanth Kurapati<br>
# Date 1584430274 -19800<br>
# Tue Mar 17 13:01:14 2020 +0530<br>
# Node ID b7a02a40bc5d97308d41b925f9c37df414ab6ecb<br>
# Parent b7b0de75112b8022789590640662f2fab956cfbe<br>
Fix: segmentation fault for hist-scenecut option<br>
<br>
fixes plane size calculation for chroma planes using source resolution and not<br>
padded resolution.<br></blockquote><div><br></div><div>Is this because you compute the luma histogram on pixel domain and chroma histogram on input depth?</div><div>If so, do you still need the additional memory and memcpy introduced in "Changeset: 12619 (96a10df63c0b) Fix: Segmentation fault for hist-scenecut option in 16bpp builds." ?</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
"<br>
diff -r b7b0de75112b -r b7a02a40bc5d source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Fri Feb 21 17:02:18 2020 +0530<br>
+++ b/source/encoder/encoder.cpp Tue Mar 17 13:01:14 2020 +0530<br>
@@ -218,10 +218,7 @@<br>
<br>
if (m_param->bHistBasedSceneCut)<br>
{<br>
- for (int i = 0; i < x265_cli_csps[m_param->internalCsp].planes; i++)<br>
- {<br>
- m_planeSizes[i] = (m_param->sourceWidth >> x265_cli_csps[p->internalCsp].width[i]) * (m_param->sourceHeight >> x265_cli_csps[m_param->internalCsp].height[i]);<br>
- }<br>
+ m_planeSizes[0] = (m_param->sourceWidth >> x265_cli_csps[p->internalCsp].width[0]) * (m_param->sourceHeight >> x265_cli_csps[m_param->internalCsp].height[0]);<br>
uint32_t pixelbytes = m_param->internalBitDepth > 8 ? 2 : 1;<br>
m_edgePic = X265_MALLOC(pixel, m_planeSizes[0] * pixelbytes);<br>
m_edgeHistThreshold = m_param->edgeTransitionThreshold;<br>
@@ -1605,6 +1602,14 @@<br>
if (m_param->bHistBasedSceneCut && pic_in)<br>
{<br>
x265_picture *pic = (x265_picture *) pic_in;<br>
+<br>
+ if (pic->poc == 0)<br>
+ {<br>
+ /* for entire encode compute the chroma plane sizes only once */<br>
+ for (int i = 1; i < x265_cli_csps[m_param->internalCsp].planes; i++)<br>
+ m_planeSizes[i] = (pic->width >> x265_cli_csps[m_param->internalCsp].width[i]) * (pic->height >> x265_cli_csps[m_param->internalCsp].height[i]);<br>
+ }<br>
+<br>
if (computeHistograms(pic))<br>
{<br>
double maxUVSad = 0.0, edgeSad = 0.0;<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="georgia, serif">Regards,</font><div><b><font face="georgia, serif">Aruna Matheswaran,</font></b></div><div><font face="georgia, serif">Video Codec Engineer,</font></div><div><font face="georgia, serif">Media & AI analytics BU,</font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" width="96" height="36" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><font face="georgia, serif"><br></font></div></div></div></div></div></div></div></div></div></div>