[x265] [PATCH] input/y4m: support all bit depths from 'mono9' to 'mono16' in y4m

Pradeep Ramachandran pradeep at multicorewareinc.com
Thu Oct 26 09:39:22 CEST 2017


On Fri, Oct 13, 2017 at 4:09 PM, Ma0 <mateuszb at poczta.onet.pl> wrote:

> # HG changeset patch
> # User Ma0 <mateuszb at poczta.onet.pl>
> # Date 1507448003 -7200
> #      Sun Oct 08 09:33:23 2017 +0200
> # Node ID daef862c9d0a5d2b2a1e1e8da7ec56facfa08272
> # Parent  0e168bdeb48b3d57d896d3823e2efb2bf69d4b26
> input/y4m: support all bit depths from 'mono9' to 'mono16' in y4m
>

Pushed to default branch. Thanks!


>
> diff -r 0e168bdeb48b -r daef862c9d0a source/input/y4m.cpp
> --- a/source/input/y4m.cpp      Mon Oct 09 12:34:25 2017 +0530
> +++ b/source/input/y4m.cpp      Sun Oct 08 09:33:23 2017 +0200
> @@ -307,23 +307,26 @@
>                          break;
>                  }
>
> -                switch (csp)
> +                if (csp / 100 == ('m'-'0')*1000 + ('o'-'0')*100 +
> ('n'-'0')*10 + ('o'-'0'))
>                  {
> -                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'):
> +                    d = csp % 100;
> +                }
> +                else if (csp / 10 == ('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;
> +                    d = csp % 10;
> +                }
> +                else if (csp == ('m'-'0')*1000 + ('o'-'0')*100 +
> ('n'-'0')*10 + ('o'-'0'))
> +                {
> +                    colorSpace = X265_CSP_I400;
> +                    d = 8;
> +                }
> +                else
>                      colorSpace = (csp == 444) ? X265_CSP_I444 : (csp ==
> 422) ? X265_CSP_I422 : X265_CSP_I420;
> -                }
> +
> +                if (d >= 8 && d <= 16)
> +                    depth = d;
>                  break;
>
>              default:
> _______________________________________________
> 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/20171026/6a60de0a/attachment.html>


More information about the x265-devel mailing list