<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2020-09-10 2:07 p.m., Vitaly Prosyak
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:536023f7-e5c1-d1fa-fd4f-e2378f1077e2@amd.com">
      
      <p><br>
      </p>
      <div class="moz-cite-prefix">On 2020-09-10 1:51 p.m., Laurent
        Pinchart wrote:<br>
      </div>
      <blockquote type="cite" cite="mid:20200910175113.GG3940@pendragon.ideasonboard.com">
        <pre class="moz-quote-pre" wrap="">Hi Vitaly,

On Thu, Sep 10, 2020 at 01:09:03PM -0400, Vitaly Prosyak wrote:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">On 2020-09-10 6:56 a.m., Laurent Pinchart wrote:
</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">On Thu, Sep 10, 2020 at 01:28:03PM +0300, Pekka Paalanen wrote:
</pre>
            <blockquote type="cite">
              <pre class="moz-quote-pre" wrap="">On Thu, 10 Sep 2020 12:30:09 +0300 Laurentiu Palcu wrote:
</pre>
              <blockquote type="cite">
                <pre class="moz-quote-pre" wrap="">On Thu, Sep 10, 2020 at 11:50:26AM +0300, Pekka Paalanen wrote:
</pre>
                <blockquote type="cite">
                  <pre class="moz-quote-pre" wrap="">On Thu, 10 Sep 2020 09:52:26 +0200 Daniel Vetter wrote:
</pre>
                  <blockquote type="cite">
                    <pre class="moz-quote-pre" wrap="">On Thu, Sep 10, 2020 at 10:25:43AM +0300, Pekka Paalanen wrote:
</pre>
                    <blockquote type="cite">
                      <pre class="moz-quote-pre" wrap="">On Wed, 9 Sep 2020 13:57:28 +0300 Laurentiu Palcu wrote:
     
</pre>
                      <blockquote type="cite">
                        <pre class="moz-quote-pre" wrap="">Hi all,

I was wondering whether you could give me an advise on how to proceed further
with the following issue as I'm preparing to upstream the next set of patches
for the iMX8MQ display controller(DCSS). The display controller has 3 planes,
each with 2 CSCs and one degamma LUT. The CSCs are in front and after the LUT
respectively. Then the output from those 3 pipes is blended together and then
gamma correction is applied using a linear-to-nonlinear LUT and another CSC, if
needed.
</pre>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                  <pre class="moz-quote-pre" wrap="">Hi,

hmm, so FB -> CSC -> LUT -> CSC -> blending?

Is it then
        blending -> LUT -> CSC -> encoder
or
        blending -> CSC -> LUT -> encoder?
</pre>
                </blockquote>
                <pre class="moz-quote-pre" wrap="">The DCSS pipeline topology is this:

FB1->CSC_A->LUT->CSC_B-\
FB2->CSC_A->LUT->CSC_B-|-blender->LUT->CSC_O->encoder
FB3->CSC_A->LUT->CSC_B-/

Basically, CSC_A is used to convert to a common colorspace if needed
(YUV->RGB) as well as to perform pixel range conversions: limited->full.
CSC_B is for gamut conversions(like 709->2020). The CSC_O is used to
convert to the colorspace used by the output (like RGB->YUV).
</pre>
              </blockquote>
              <pre class="moz-quote-pre" wrap="">I didn't realize that it would be correct to do RGB-YUV conversion in
non-linear space, but yeah, that's what most software do too I guess.

</pre>
              <blockquote type="cite">
                <blockquote type="cite">
                  <pre class="moz-quote-pre" wrap="">Are all these LUTs per-channel 1D LUTs or something else?
</pre>
                </blockquote>
                <pre class="moz-quote-pre" wrap="">LUTs are 3D, per pixel component.
</pre>
              </blockquote>
              <pre class="moz-quote-pre" wrap="">Sorry, which one?

An example of a 3D LUT is 32x32x32 entries with each entry being a
triplet, while a 1D LUT could be 1024 entries with each entry being a
scalar. 1D LUTs are used per-channel so you need three of them, 3D LUTs
you need just one for the color value triplet mapping.

A 3D LUT can express much more than a 4x4 CTM. A 1D LUT cannot do the
channel mixing that a CTM can.

So if you truly have 3D LUTs everywhere, I wonder why the CSC matrix
blocks exist...
</pre>
            </blockquote>
            <pre class="moz-quote-pre" wrap="">Possibly because the 3D LUT uses interpolation (it's a 17x17x17 LUT in
R-Car), having a separate CSC can give more precision (as well as
allowing the two problems to be decoupled, at a relatively low hardware
cost).
</pre>
          </blockquote>
          <pre class="moz-quote-pre" wrap="">If you put nonlinear signal to 3DLUT then your
precision would be improved.
How many bits each color value has in 3DLUT ?
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">The whole display pipeline uses 8 bits per component.
</pre>
      </blockquote>
      <pre>It is pretty low , please, use always nonlinear signal in the pipe and it allows you to compress and 'win' about 2 bits.</pre>
    </blockquote>
    <pre>Do you have alpha and de-alpha blocks in your pipeline?
You can do CSC and blending in nonlinear mode, it is less accurate than in linear, but it is viable way.
Also alpha should be removed (if it is applied) before CSC.
</pre>
    <br>
  </body>
</html>