<div style="font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);"><span style="line-height: 1.6;">My original post at <u><a href="https://forum.doom9.org/showthread.php?p=2014481#post2014481" style="text-decoration: underline;">https://forum.doom9.org/showthread.php?p=2014481#post2014481</a></u></span></div><div style="font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);"><br  /></div><div style="color: rgb(0, 0, 0);"><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;">When using more than 1 slices, x265 creates intra blocks in prediction frames out of nowhere.</span><span style="font-family: -apple-system, system-ui; font-size: 14px; line-height: 1.6;"><br  /></span><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;">Let's do a simple test:</span></div><div style="background-color: rgb(238, 238, 238); margin: 5px 20px 20px;"><div style="text-align: left; text-indent: 0px; line-height: normal; margin-bottom: 2px; font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 11px; color: rgb(0, 0, 0);"><span style="line-height: 1.6;">Code:</span></div><pre style="background-color: rgb(218, 218, 218); margin: 0px; padding: 6px; border-width: 1px; border-style: inset; border-color: initial; width: auto; height: 34px;"><div style="direction: ltr; text-align: left; text-indent: 0px; font-size: 13.3333px; color: rgb(0, 0, 0);"><span style="line-height: 1.6;">ffmpeg -lavfi color=gray:s=hd1080:d=10,noise=allf=u:alls=50 -x265-params slices=2 2sli.265</span></div></pre></div><div style="color: rgb(0, 0, 0);"><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;">With the given command line, x265 is allowed to encode a completely static video, static noise is applied to add variance to the image, <b>it does not has to be noise, nor does it has to be completely static</b>, you just need some "adequately" high frequency information, a flat color image does not trigger the bug.</span><span style="font-family: -apple-system, system-ui; font-size: 14px; line-height: 1.6;"><br  /></span><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;">The result file is absurdly larger than single slice result.</span><span style="font-family: -apple-system, system-ui; font-size: 14px; line-height: 1.6;"><br  /></span><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;">Viewing the result file with YUView reveals that the encode has a lot of intra blocks near slice borders.</span><span style="font-family: -apple-system, system-ui; font-size: 14px; line-height: 1.6;"><br  /></span><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;"><img src="https://images2.imgbox.com/d2/ab/taiMdVlu_o.jpg" style="vertical-align: bottom;max-width: 1407px; vertical-align: bottom;"  /></span><span style="font-family: -apple-system, system-ui; font-size: 14px; line-height: 1.6;"><br  /><br  /></span><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;">Setting frame-threads=1 seems to mitigate this issue.</span><span style="font-family: -apple-system, system-ui; font-size: 14px; line-height: 1.6;"><br  /><br  /></span><span style="font-family: verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.3333px; background-color: rgb(238, 238, 238); line-height: 1.6;">The false intra mode in otherwise inter-predictable blocks will make compression ratio a lot worse, if you are planning or forced to use more slices (e.g. UHD Bluray compatible encoding), make sure to use frame-threads=1, slices will provide parallelism silimar to frame-threads.</span></div><div style="font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);"><br  /></div><div><br  /></div>