<?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>topic Re: How can I efficiently pass captured data to memory allocated by VPU_EncGetMem? in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1682508#M5669</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Dear&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299" target="_blank"&gt;@Dhruvit&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It takes about 30ms to copy Full HD YUYV data using memcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to achieve 2-channel recording at Full HD and 30fps, but the processing speed is a problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any good solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2023 01:16:15 GMT</pubDate>
    <dc:creator>kuri</dc:creator>
    <dc:date>2023-07-06T01:16:15Z</dc:date>
    <item>
      <title>How can I efficiently pass captured data to memory allocated by VPU_EncGetMem?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1680052#M5665</link>
      <description>&lt;P&gt;I would like to inquire about a method to efficiently pass captured data to the memory allocated by VPU_EncGetMem.&lt;/P&gt;&lt;P&gt;Is it possible to achieve this without using address assignment?&lt;/P&gt;&lt;P&gt;I am using v4l and V4L2_MEMORY_MMAP for capturing.&lt;/P&gt;&lt;P&gt;The memory for encoding is allocated using VPU_EncGetMem.&lt;/P&gt;&lt;P&gt;When I use memcpy to copy the data to the memory allocated by VPU_EncGetMem, encoding works fine. However, if I assign the memory address of the memory allocated by VPU_EncGetMem directly to input_buf, the encoded video appears green.&lt;/P&gt;&lt;P&gt;OK:&lt;/P&gt;&lt;P&gt;memcpy(pInputVirt, input_buf, input_size);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NG: Encoded video appears green.&lt;/P&gt;&lt;P&gt;pInputVirt = input_buf;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pInputVirt: Memory allocated by VPU_EncGetMem for encoding.&lt;BR /&gt;input_buf: Memory allocated by mmap for capturing.&lt;/P&gt;&lt;P&gt;CPU: i.MX8MPlus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 02:30:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1680052#M5665</guid>
      <dc:creator>kuri</dc:creator>
      <dc:date>2023-07-03T02:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I efficiently pass captured data to memory allocated by VPU_EncGetMem?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1682039#M5667</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/218541"&gt;@kuri&lt;/a&gt;,&lt;/P&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;To avoid memory-related issues we would recommend&amp;nbsp;using the memcpy rather than the address assignment. Because the function&amp;nbsp;VPU_EncGetMem uses the constant pointers for the address.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Jul 2023 13:07:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1682039#M5667</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-07-05T13:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I efficiently pass captured data to memory allocated by VPU_EncGetMem?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1682508#M5669</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299" target="_blank"&gt;@Dhruvit&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It takes about 30ms to copy Full HD YUYV data using memcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to achieve 2-channel recording at Full HD and 30fps, but the processing speed is a problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any good solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 01:16:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1682508#M5669</guid>
      <dc:creator>kuri</dc:creator>
      <dc:date>2023-07-06T01:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I efficiently pass captured data to memory allocated by VPU_EncGetMem?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1684483#M5674</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After researching, the following findings have been made:&lt;/P&gt;&lt;P&gt;(1) Copy from the address allocated by mmap to a global variable (414720 bytes) → Takes approximately 30ms for the copy operation.&lt;/P&gt;&lt;P&gt;(2) Copy within the global variable (414720 bytes) → Completes the copy in approximately 2ms.&lt;/P&gt;&lt;P&gt;The slow copying from the capture buffer allocated by mmap is identified as the issue.&lt;/P&gt;&lt;P&gt;The mmap is allocated with the following options:&lt;/P&gt;&lt;P&gt;addr = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;Questions&amp;gt; - Do you have any insights into the reasons for the slow copying from the mmap address? - Could you provide any methods to speed up the copying from the mmap address?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 05:15:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1684483#M5674</guid>
      <dc:creator>kuri</dc:creator>
      <dc:date>2023-07-10T05:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I efficiently pass captured data to memory allocated by VPU_EncGetMem?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1684726#M5676</link>
      <description>&lt;DIV&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/218541"&gt;@kuri&lt;/a&gt;,&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;I hope you are doing well&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;To improve the speed, one can use a DMA channel for data transfer. For more information to enable the DMA, kindly refer to the file&amp;nbsp;&lt;STRONG&gt;&lt;U&gt;devicetree/bindings/dma/&lt;WBR /&gt;dma.txt&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;from the kernel source.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 09:26:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/How-can-I-efficiently-pass-captured-data-to-memory-allocated-by/m-p/1684726#M5676</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-07-10T09:26:21Z</dc:date>
    </item>
  </channel>
</rss>

