<?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 I solved the problem, I in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-RGBToYUV420-function-is-getting-IppStsSizeErr-result/m-p/1133934#M25860</link>
    <description>&lt;P&gt;I solved the problem, I forgot to set DLL calling convention as stdcall, but&amp;nbsp;I would like to use ippiBGRToYUV420_8u_AC4P3R instead of ippiRGBToYUV420_8u_C3P3R Because my real bitmap format is BGR. I do not want to use the ippiSwapChannels_8u_C3IR function for performance reasons. All parameters of two functions have the same kind of type and name, b&lt;SPAN style="font-size: 1em;"&gt;ut I'm getting the error message below.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Access violation at address 0454FCCF in module 'ippccs8.dll'. Read of address 0B3EF008.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;There is no error when I am using ippiRGBToYUV420_8u_C3P3R function, but if I use the ippiBGRToYUV420 function, an error occurs.&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;function ippiRGBToYUV420_8u_C3P3R(const pSrc: PIpp8u; srcStep: Integer; pDst: PPIpp8u; dstStep: PInteger; roiSize: IppiSize): TIppStatus; stdcall;

function ippiBGRToYUV420_8u_AC4P3R(const pSrc: PIpp8u; srcStep: Integer; pDst: PPIpp8u; dstStep: PInteger; roiSize: IppiSize): TIppStatus; stdcall;&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;I think this is a bug?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2018 02:07:00 GMT</pubDate>
    <dc:creator>Yeşilçimen__Ahmet</dc:creator>
    <dc:date>2018-02-06T02:07:00Z</dc:date>
    <item>
      <title>Intel IPP RGBToYUV420 function is getting IppStsSizeErr result code</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-RGBToYUV420-function-is-getting-IppStsSizeErr-result/m-p/1133933#M25859</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I am using IPP 2017.0.3(r55431) and Delphi 10.2, i am trying convert RGB to YUV420P but i am getting IppStsSizeErr result code.&lt;/P&gt;

&lt;P&gt;I have m_dst_picture, m_src_picture: AVPicture structure created by FFMPEG.&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt; { allocate the encoded raw picture }

  ret := avpicture_alloc(@m_dst_picture, AV_PIX_FMT_YUV420P, c^.width, c^.height);

  if (ret &amp;lt; 0) then

    Exit(False);

  { allocate BGR frame that we can pass to the YUV frame }
  ret := avpicture_alloc(@m_src_picture, AV_PIX_FMT_BGR24, c^.width, c^.height);
  if (ret &amp;lt; 0) then
    Exit(False);

  { convert BGR frame (m_src_picture) to and YUV frame (m_dst_picture) }
  sws_scale(sws_ctx, @m_src_picture.data[0], @m_src_picture.linesize, 0, c^.height, @m_dst_picture.data[0], @m_dst_picture.linesize);//It works fine.&lt;/PRE&gt;

&lt;P&gt;I want to convert the RGB buffer directly to YUV420P.The original code first loads RGB into the AVPicture then convert RGB to YUV420P with sws_scale and it causes slowness.&lt;/P&gt;

&lt;P&gt;Here I copy the BGR buffer to m_src_picture of FFMPEG. But this leads to performance loss, so I want to convert it directly to YUV420P using Intel IPP.&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;procedure WriteFrameBGR24(frame: PByte);
var
  y: Integer;
begin
  for y := 0 to m_c^.height - 1 do
    Move(PByte(frame - (y * dstStep))^, PByte(m_src_picture.data[0] + (y * m_src_picture.linesize[0]))^, dstStep);
end;&lt;/PRE&gt;

&lt;P&gt;In the code below I am trying to convert using Intel IPP.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;{ Converting RGB to YUV420P. }&lt;/P&gt;

&lt;P&gt;**roiSize is 1920 and 1080&lt;/P&gt;

&lt;P&gt;**The values created by FFMPEG for YUV420P in&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;m_dst_picture.linesize&lt;/SPAN&gt; are [0]=1920,[1]=960,[2]=960 respectively.&lt;/P&gt;

&lt;P&gt;Do I need to convert the values of the linesize to another value?&lt;/P&gt;

&lt;P&gt;**The reason why the srcStep parameter is a minus sign is the Bottom-Up Bitmap and the frame pointer indicates the Bmp.ScanLine[0] address, which indicates the highest pointer address.&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;srcStep := (((width * (3 * 8)) + 31) and not 31) div 8; //for 24 bitmap

 { Swap of BGR channels to RGB. }

  st := ippiSwapChannels_8u_C3IR(frame, -srcStep, roiSize, @BGRToRGBArray[0]); //It works fine

 { Convert RGB to YUV420P. }

  st := ippiRGBToYUV420_8u_C3P3R(frame, -srcStep, @m_dst_picture.data[0], @m_dst_picture.linesize[0], roiSize); //IppStsSizeErr &lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;How do I solve this problem ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 18:34:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-RGBToYUV420-function-is-getting-IppStsSizeErr-result/m-p/1133933#M25859</guid>
      <dc:creator>Yeşilçimen__Ahmet</dc:creator>
      <dc:date>2018-02-05T18:34:43Z</dc:date>
    </item>
    <item>
      <title>I solved the problem, I</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-RGBToYUV420-function-is-getting-IppStsSizeErr-result/m-p/1133934#M25860</link>
      <description>&lt;P&gt;I solved the problem, I forgot to set DLL calling convention as stdcall, but&amp;nbsp;I would like to use ippiBGRToYUV420_8u_AC4P3R instead of ippiRGBToYUV420_8u_C3P3R Because my real bitmap format is BGR. I do not want to use the ippiSwapChannels_8u_C3IR function for performance reasons. All parameters of two functions have the same kind of type and name, b&lt;SPAN style="font-size: 1em;"&gt;ut I'm getting the error message below.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Access violation at address 0454FCCF in module 'ippccs8.dll'. Read of address 0B3EF008.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;There is no error when I am using ippiRGBToYUV420_8u_C3P3R function, but if I use the ippiBGRToYUV420 function, an error occurs.&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;function ippiRGBToYUV420_8u_C3P3R(const pSrc: PIpp8u; srcStep: Integer; pDst: PPIpp8u; dstStep: PInteger; roiSize: IppiSize): TIppStatus; stdcall;

function ippiBGRToYUV420_8u_AC4P3R(const pSrc: PIpp8u; srcStep: Integer; pDst: PPIpp8u; dstStep: PInteger; roiSize: IppiSize): TIppStatus; stdcall;&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;I think this is a bug?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 02:07:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Intel-IPP-RGBToYUV420-function-is-getting-IppStsSizeErr-result/m-p/1133934#M25860</guid>
      <dc:creator>Yeşilçimen__Ahmet</dc:creator>
      <dc:date>2018-02-06T02:07:00Z</dc:date>
    </item>
  </channel>
</rss>

