<div dir="ltr"><div><br></div><div>Dear Henrik,</div><div><br></div><div>I have just cleaned up the patch squashing it, removing unnecessary things and, for filters/video/resize.c added quick paths for planar YUVs (9 CSPs) without the memcpy.</div><div><br></div><div>The patch is made against the last master patch: b00bcafe53a166b63a179a2f41470cd13b59f927 Cosmetics (2017-12-24 23:47:27 +0300)</div>
<div><br></div><div>Pull Request with single commit: <font color="#1155cc"><u><a href="https://github.com/eruffaldi/x264/pull/5">https://github.com/eruffaldi/x264/pull/5</a></u></font></div><div>Squashed Branch: <a href="https://github.com/eruffaldi/x264/tree/grayscale_squashed" target="_blank">https://github.com/<wbr>eruffaldi/x264/tree/grayscale_<wbr>squashed</a><br></div><div>Detailed Branch: <a href="https://github.com/eruffaldi/x264/tree/grayscale_squashed" target="_blank">https://github.com/<wbr>eruffaldi/x264/tree/grayscale</a><br></div><div><br></div><div>Testing is reported here: <a href="https://github.com/eruffaldi/x264/issues/1" target="_blank">https://github.com/<wbr>eruffaldi/x264/issues/1</a></div><div><br></div><div>Best Regards,</div><div>Emanuele </div><div class="gmail_extra"><br><div class="gmail_quote">2017-09-11 12:18 GMT+02:00 Emanuele Ruffaldi <span dir="ltr"><<a href="mailto:emanuele.ruffaldi@gmail.com" target="_blank">emanuele.ruffaldi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br clear="all"><div>Hi,</div><div><br></div><div><span style="font-size:12.8px">>> For a recording in a resource limited board with mono input I aimed at</span><br style="font-size:12.8px"><span style="font-size:12.8px">>> encoding directly the video without converting it to gray YUV (with UV as</span><br style="font-size:12.8px"><span style="font-size:12.8px">>> zero). This patch implements the changes in the library for supporting the</span><br style="font-size:12.8px"><span style="font-size:12.8px">>> mono input and the relative output CHROME_400.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">>Hi</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">>Seems reasonable to avoid a bunch of unnecessary memory copying of</span><br style="font-size:12.8px"><span style="font-size:12.8px">>empty chroma planes in some use cases I guess. Is there any</span><br style="font-size:12.8px"><span style="font-size:12.8px">>compression efficiency gains over 4:2:0 with chroma set to</span><br style="font-size:12.8px"><span style="font-size:12.8px">>1<<(bit_depth-1)? I'd guess it's basically zero.</span></div><div><br></div><div>I was not aware of this possibility, having time I could look into that but I don't know if the patch would be smaller.</div><div><br style="font-size:12.8px"><span style="font-size:12.8px">>The commits should be squashed into a single one.</span><br style="font-size:12.8px"><span style="font-size:12.8px">>False deltas (random unrelated changes) should be removed.</span></div><div><br></div><div>Good point</div><div><br><span style="font-size:12.8px">>The planar I420 to monochrome conversion should work for every other</span><br style="font-size:12.8px"><span style="font-size:12.8px">>YUV format with a standalone luma plane as well. Is the memcpy even</span><br style="font-size:12.8px"><span style="font-size:12.8px">>needed though?</span></div><div><br></div><div>Fine. In the command line tool x264 the filter resize is in charge of the color space conversion and I have to verify if it allows a solution without the memcpy, this depends on the memory ownership policy in the filter.</div><div><br></div><div>Best Regards,</div><div><br></div><div>Emanuele </div><div><br style="font-size:12.8px"><span style="font-size:12.8px">> Henrik</span><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><span style="font-size:12.8px"><br></span></div>-- <br><div class="m_109957823401320726gmail_signature"><div dir="ltr"><div>--------</div><div>Emanuele Ruffaldi, Ph.D. - Assistant Professor </div><div>PERCRO, TeCIP Institute - Scuola Superiore Sant'Anna</div><div>via Luigi Alamanni 13D, San Giuliano Terme 56010 (PI), Italy</div><div>mob.: +39 340 46 72 468 - tel.: +39 050 882 508</div><div>fax.: +39 050 882 564 - skype: pititaly</div><div><a href="http://www.percro.org" target="_blank">http://www.percro.org</a> - <a href="http://www.teslacore.it" target="_blank">http://www.teslacore.it</a></div><div><div>--------</div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--------</div><div>Emanuele Ruffaldi, Ph.D. - Assistant Professor </div><div>PERCRO, TeCIP Institute - Scuola Superiore Sant'Anna</div><div>via Luigi Alamanni 13D, San Giuliano Terme 56010 (PI), Italy</div><div>mob.: +39 340 46 72 468 - tel.: +39 050 882 508</div><div>fax.: +39 050 882 564 - skype: pititaly</div><div><a href="http://www.percro.org" target="_blank">http://www.percro.org</a> - <a href="http://www.teslacore.it" target="_blank">http://www.teslacore.it</a></div><div><div>--------</div></div></div></div>
</div></div>