<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: RAW10  sizeimage, bytesperline, bpp, data_alignment in iMX8M Mini</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1189585#M165572</link>
    <description>&lt;P&gt;you can refer to the another topic&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Confirmed-support-for-RAW12-through-4-lane-CSI-2-sensor-on-i/m-p/933945" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/Confirmed-support-for-RAW12-through-4-lane-CSI-2-sensor-on-i/m-p/933945&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;so should be extend to the 16bits&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2020 08:56:59 GMT</pubDate>
    <dc:creator>joanxie</dc:creator>
    <dc:date>2020-11-26T08:56:59Z</dc:date>
    <item>
      <title>RAW10  sizeimage, bytesperline, bpp, data_alignment in iMX8M Mini</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1188674#M165466</link>
      <description>&lt;P&gt;Dear MIPI CSI sensor experts,&lt;/P&gt;&lt;P&gt;I'm currently porting the driver of Sony IMX296 to iMX8M Mini platform using the BSP-5.4.24_2.2.0. The sensor spec and its RAW output is described in the attached file.&lt;/P&gt;&lt;P&gt;As for the recommended recording area which is 1440x1080, I assume that the&amp;nbsp; &lt;STRONG&gt;sizeimage&lt;/STRONG&gt; would be : 1440x1080x10/8 =&amp;nbsp;1944000 bytes, and the &lt;STRONG&gt;bytesperline&lt;/STRONG&gt; would be 1440x10/8 = 1800 bytes.&lt;/P&gt;&lt;P&gt;However,&amp;nbsp; in &lt;STRONG&gt;&lt;EM&gt;mx6s_capture.c&lt;/EM&gt;&lt;/STRONG&gt;,&amp;nbsp; the calculation of image size and bytesperline are as following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;static int mx6s_vidioc_try_fmt_vid_cap(struct file *file, void *priv,
				      struct v4l2_format *f)
{
	...
	pix-&amp;gt;sizeimage = fmt-&amp;gt;bpp * pix-&amp;gt;height * pix-&amp;gt;width;
	pix-&amp;gt;bytesperline = fmt-&amp;gt;bpp * pix-&amp;gt;width;

	return ret;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the above code snippet :&lt;/P&gt;&lt;P&gt;pix-&amp;gt;sizeimage = 2 x 1080 x 1440 =&amp;nbsp; 3110400 bytes (instead of 1944000)&lt;/P&gt;&lt;P&gt;pix-&amp;gt;bytesperline = 2 x 1440 = 2880 bytes (instead of 1800)&lt;/P&gt;&lt;P&gt;Note : bpp = 2 in case of RAW10.&lt;/P&gt;&lt;P&gt;In &lt;STRONG&gt;&lt;EM&gt;mxc_mipi_csi.c&lt;/EM&gt;&lt;/STRONG&gt;, there's also data_alignment attribute in the following table :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;static const struct csis_pix_format mipi_csis_formats[] = {
	{
		...
	}, {
		.code = MEDIA_BUS_FMT_SBGGR10_1X10,
		.fmt_reg = MIPI_CSIS_ISPCFG_FMT_RAW10,
		.data_alignment = 10,
	}
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hesitating to use 10 or 16 but finally I see that the only reference to this attribute is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;static void mipi_csis_set_params(struct csi_state *state)
{
	...

	val = mipi_csis_read(state, MIPI_CSIS_ISPCONFIG_CH0);
	if (state-&amp;gt;csis_fmt-&amp;gt;data_alignment == 32)
		val |= MIPI_CSIS_ISPCFG_ALIGN_32BIT;
	else /* Normal output */
		val &amp;amp;= ~MIPI_CSIS_ISPCFG_ALIGN_32BIT;
	mipi_csis_write(state, MIPI_CSIS_ISPCONFIG_CH0, val);

	...
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So &lt;EM&gt;&lt;STRONG&gt;data_alignment&lt;/STRONG&gt;&lt;/EM&gt; does not participating in the calculation of the either &lt;STRONG&gt;sizeimage&lt;/STRONG&gt; or &lt;STRONG&gt;bytesperline&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;My question is that will the data in the recording buffer be the same order as the output of the sensor (RAW10 : P0, P1, P2, P3 P0+1+2+3 LSB, P4, P5, P6, ... ) or will they be extended to 16-bit ?&lt;/P&gt;&lt;P&gt;Thanks in advance and best regard,&lt;/P&gt;&lt;P&gt;K.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 07:01:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1188674#M165466</guid>
      <dc:creator>khang_letruong</dc:creator>
      <dc:date>2020-11-25T07:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: RAW10  sizeimage, bytesperline, bpp, data_alignment in iMX8M Mini</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1189585#M165572</link>
      <description>&lt;P&gt;you can refer to the another topic&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Confirmed-support-for-RAW12-through-4-lane-CSI-2-sensor-on-i/m-p/933945" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/Confirmed-support-for-RAW12-through-4-lane-CSI-2-sensor-on-i/m-p/933945&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;so should be extend to the 16bits&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 08:56:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1189585#M165572</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2020-11-26T08:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: RAW10  sizeimage, bytesperline, bpp, data_alignment in iMX8M Mini</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1189670#M165584</link>
      <description>&lt;P&gt;Dear &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/39586"&gt;@joanxie&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;By reading the RAW file captured from our sensor on IMX8M Mini, my understanding is as below :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RAW10-extended.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/131099i4189787230F95550/image-size/large?v=v2&amp;amp;px=999" role="button" title="RAW10-extended.png" alt="RAW10-extended.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If the above info is TRUE, then the bytesperline and imagesize are correct according to the current calculation within mx6s_vidioc_try_fmt_vid_cap().&lt;/P&gt;&lt;P&gt;Can you confirm my understanding about RAW10 extended to 16 bit on iMX8M Mini, please ?&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;K.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 10:45:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1189670#M165584</guid>
      <dc:creator>khang_letruong</dc:creator>
      <dc:date>2020-11-26T10:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: RAW10  sizeimage, bytesperline, bpp, data_alignment in iMX8M Mini</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1232500#M169640</link>
      <description>&lt;P&gt;yes, raw10 extend to 16bits&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 03:12:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RAW10-sizeimage-bytesperline-bpp-data-alignment-in-iMX8M-Mini/m-p/1232500#M169640</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2021-02-18T03:12:34Z</dc:date>
    </item>
  </channel>
</rss>

