[x265] CLI: allow 'mono' & 'mono16' color space for y4m input

Pradeep Ramachandran pradeep at multicorewareinc.com
Tue Oct 25 06:18:26 CEST 2016


On Sun, Oct 16, 2016 at 11:17 PM, Mateusz <mateusz at msystem.waw.pl> wrote:

> This patch fixes issue #282.
>
> # HG changeset patch
> # User Ma0 <mateuszb at poczta.onet.pl>
> # Date 1476639059 -7200
> #      Sun Oct 16 19:30:59 2016 +0200
> # Node ID f49487ee92a296a36938dfb92b7b51c9fb7f2ff9
> # Parent  c97805dad9148ad3cddba10a67ed5596508e8f86
> CLI: allow 'mono' & 'mono16' color space for y4m input
>
> diff -r c97805dad914 -r f49487ee92a2 source/input/y4m.cpp
> --- a/source/input/y4m.cpp    Thu Oct 13 17:53:48 2016 +0800
> +++ b/source/input/y4m.cpp    Sun Oct 16 19:30:59 2016 +0200
> @@ -280,7 +280,7 @@
>                  {
>                      c = ifs->get();
>
> -                    if (c <= '9' && c >= '0')
> +                    if (c <= 'o' && c >= '0')
>                          csp = csp * 10 + (c - '0');
>                      else if (c == 'p')
>                      {
> @@ -300,9 +300,23 @@
>                          break;
>                  }
>
> -                if (d >= 8 && d <= 16)
> -                    depth = d;
> -                colorSpace = (csp == 444) ? X265_CSP_I444 : (csp == 422)
> ? X265_CSP_I422 : X265_CSP_I420;
> +                switch (csp)
> +                {
> +                case ('m'-'0')*100000 + ('o'-'0')*10000 + ('n'-'0')*1000
> + ('o'-'0')*100 + 16:
> +                    colorSpace = X265_CSP_I400;
> +                    depth = 16;
> +                    break;
> +
> +                case ('m'-'0')*1000 + ('o'-'0')*100 + ('n'-'0')*10 +
> ('o'-'0'):
> +                    colorSpace = X265_CSP_I400;
> +                    depth = 8;
> +                    break;
> +
> +                default:
> +                    if (d >= 8 && d <= 16)
> +                        depth = d;
> +                    colorSpace = (csp == 444) ? X265_CSP_I444 : (csp ==
> 422) ? X265_CSP_I422 : X265_CSP_I420;
> +                }
>

Do you have a pointer to the definition of the Y4M headers? From the
description on wikipedia (
https://wiki.multimedia.cx/index.php?title=YUV4MPEG2), I don't see the mono
or mono16 string additions for the csp.


>                  break;
>
>              default:
> @@ -324,7 +338,7 @@
>      if (width < MIN_FRAME_WIDTH || width > MAX_FRAME_WIDTH ||
>          height < MIN_FRAME_HEIGHT || height > MAX_FRAME_HEIGHT ||
>          (rateNum / rateDenom) < 1 || (rateNum / rateDenom) >
> MAX_FRAME_RATE ||
> -        colorSpace <= X265_CSP_I400 || colorSpace >= X265_CSP_COUNT)
> +        colorSpace < X265_CSP_I400 || colorSpace >= X265_CSP_COUNT)
>          return false;
>
>      return true;
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20161025/0abd666c/attachment.html>


More information about the x265-devel mailing list