<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 16, 2016 at 11:17 PM, Mateusz <span dir="ltr"><<a href="mailto:mateusz@msystem.waw.pl" target="_blank">mateusz@msystem.waw.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This patch fixes issue #282.<br>
<br>
# HG changeset patch<br>
# User Ma0 <<a href="mailto:mateuszb@poczta.onet.pl">mateuszb@poczta.onet.pl</a>><br>
# Date 1476639059 -7200<br>
# Sun Oct 16 19:30:59 2016 +0200<br>
# Node ID f49487ee92a296a36938dfb92b7b51<wbr>c9fb7f2ff9<br>
# Parent c97805dad9148ad3cddba10a67ed55<wbr>96508e8f86<br>
CLI: allow 'mono' & 'mono16' color space for y4m input<br>
<br>
diff -r c97805dad914 -r f49487ee92a2 source/input/y4m.cpp<br>
--- a/source/input/y4m.cpp Thu Oct 13 17:53:48 2016 +0800<br>
+++ b/source/input/y4m.cpp Sun Oct 16 19:30:59 2016 +0200<br>
@@ -280,7 +280,7 @@<br>
{<br>
c = ifs->get();<br>
<br>
- if (c <= '9' && c >= '0')<br>
+ if (c <= 'o' && c >= '0')<br>
csp = csp * 10 + (c - '0');<br>
else if (c == 'p')<br>
{<br>
@@ -300,9 +300,23 @@<br>
break;<br>
}<br>
<br>
- if (d >= 8 && d <= 16)<br>
- depth = d;<br>
- colorSpace = (csp == 444) ? X265_CSP_I444 : (csp == 422) ? X265_CSP_I422 : X265_CSP_I420;<br>
+ switch (csp)<br>
+ {<br>
+ case ('m'-'0')*100000 + ('o'-'0')*10000 + ('n'-'0')*1000 + ('o'-'0')*100 + 16:<br>
+ colorSpace = X265_CSP_I400;<br>
+ depth = 16;<br>
+ break;<br>
+<br>
+ case ('m'-'0')*1000 + ('o'-'0')*100 + ('n'-'0')*10 + ('o'-'0'):<br>
+ colorSpace = X265_CSP_I400;<br>
+ depth = 8;<br>
+ break;<br>
+<br>
+ default:<br>
+ if (d >= 8 && d <= 16)<br>
+ depth = d;<br>
+ colorSpace = (csp == 444) ? X265_CSP_I444 : (csp == 422) ? X265_CSP_I422 : X265_CSP_I420;<br>
+ }<br></blockquote><div><br></div><div>Do you have a pointer to the definition of the Y4M headers? From the description on wikipedia (<a href="https://wiki.multimedia.cx/index.php?title=YUV4MPEG2">https://wiki.multimedia.cx/index.php?title=YUV4MPEG2</a>), I don't see the mono or mono16 string additions for the csp.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
break;<br>
<br>
default:<br>
@@ -324,7 +338,7 @@<br>
if (width < MIN_FRAME_WIDTH || width > MAX_FRAME_WIDTH ||<br>
height < MIN_FRAME_HEIGHT || height > MAX_FRAME_HEIGHT ||<br>
(rateNum / rateDenom) < 1 || (rateNum / rateDenom) > MAX_FRAME_RATE ||<br>
- colorSpace <= X265_CSP_I400 || colorSpace >= X265_CSP_COUNT)<br>
+ colorSpace < X265_CSP_I400 || colorSpace >= X265_CSP_COUNT)<br>
return false;<br>
<br>
return true;<br>
<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>