<?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 ResizeGetBufSize in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847858#M6260</link>
    <description>&lt;SPAN class="sectionBody"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Can someone tell me how to call a function that uses a buffer, for example&lt;/SPAN&gt;&lt;SPAN class="sectionBody"&gt;&lt;P&gt;ResizeGetBufSize.&lt;BR /&gt;&lt;BR /&gt;I am using Visual Basic 2008 and mycode is:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="sectionBodyText"&gt;&lt;SPAN style="font-size: x-small;"&gt;Dim buffsize &lt;/SPAN&gt;&lt;SPAN style="font-size: x-small; color: #0000ff;"&gt;&lt;SPAN style="font-size: x-small; color: #0000ff;"&gt;As&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: x-small;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="sectionBodyText"&gt;Integer&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;P&gt;nChannel = 1&lt;BR /&gt;&lt;BR /&gt;myStatus = ip.ippiResizeGetBufSize(srcRect, dstRect, nChannel, Interpolation.IPPI_INTER_NN, buffsize)&lt;BR /&gt;&lt;BR /&gt;This produces the error:&lt;BR /&gt;&lt;SPAN style="font-size: xx-small;"&gt;&lt;BR /&gt;ippStsNullPtrErr {-8}&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;</description>
    <pubDate>Tue, 13 Apr 2010 19:03:33 GMT</pubDate>
    <dc:creator>tposhea</dc:creator>
    <dc:date>2010-04-13T19:03:33Z</dc:date>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847858#M6260</link>
      <description>&lt;SPAN class="sectionBody"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Can someone tell me how to call a function that uses a buffer, for example&lt;/SPAN&gt;&lt;SPAN class="sectionBody"&gt;&lt;P&gt;ResizeGetBufSize.&lt;BR /&gt;&lt;BR /&gt;I am using Visual Basic 2008 and mycode is:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="sectionBodyText"&gt;&lt;SPAN style="font-size: x-small;"&gt;Dim buffsize &lt;/SPAN&gt;&lt;SPAN style="font-size: x-small; color: #0000ff;"&gt;&lt;SPAN style="font-size: x-small; color: #0000ff;"&gt;As&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: x-small;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="sectionBodyText"&gt;Integer&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;P&gt;nChannel = 1&lt;BR /&gt;&lt;BR /&gt;myStatus = ip.ippiResizeGetBufSize(srcRect, dstRect, nChannel, Interpolation.IPPI_INTER_NN, buffsize)&lt;BR /&gt;&lt;BR /&gt;This produces the error:&lt;BR /&gt;&lt;SPAN style="font-size: xx-small;"&gt;&lt;BR /&gt;ippStsNullPtrErr {-8}&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;</description>
      <pubDate>Tue, 13 Apr 2010 19:03:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847858#M6260</guid>
      <dc:creator>tposhea</dc:creator>
      <dc:date>2010-04-13T19:03:33Z</dc:date>
    </item>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847859#M6261</link>
      <description>&lt;P&gt;I should state that my objective is to create an app that reads a JPG, resizes it, compresses it, and then saves the new JPG as a different file. Speed is of the utmost importance in this app.&lt;BR /&gt;&lt;BR /&gt;Terry&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2010 20:03:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847859#M6261</guid>
      <dc:creator>tposhea</dc:creator>
      <dc:date>2010-04-13T20:03:40Z</dc:date>
    </item>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847860#M6262</link>
      <description>Well i don't know in visual basic, but in visual c++ it's:&lt;BR /&gt;&lt;BR /&gt;IppiRect srcRoi={0,0,img_srg_width,img_srg_height};&lt;BR /&gt;IppiRect dstRoi={0,0,img_dst_width,img_dst_height};&lt;BR /&gt;&lt;BR /&gt;// calculation of work buffer size&lt;BR /&gt;int bufsize=0;&lt;BR /&gt;ippiResizeGetBufSize( srcRoi, dstRoi, 3, IPPI_INTER_LANCZOS , &amp;amp;bufsize );</description>
      <pubDate>Wed, 14 Apr 2010 08:45:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847860#M6262</guid>
      <dc:creator>Andreoli__Carlo</dc:creator>
      <dc:date>2010-04-14T08:45:26Z</dc:date>
    </item>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847861#M6263</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;From what I can see, I'd say the last parameter (buffsize) is passed by value and not by reference.&lt;BR /&gt;Since I never use IPP in VB/C# directly, I don't know where you find the wrapper (provided by intel or done by yourself).&lt;BR /&gt;buffsize being unitilialized, its value is 0 leading to that error when passed by value. You would get a crash or memory corruption if buffsize was initialized to any other value.&lt;BR /&gt;&lt;BR /&gt;Please check the wrapper to ensure how the last parameter is passed to IPP.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Matthieu</description>
      <pubDate>Wed, 14 Apr 2010 09:33:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847861#M6263</guid>
      <dc:creator>matthieu_darbois</dc:creator>
      <dc:date>2010-04-14T09:33:11Z</dc:date>
    </item>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847862#M6264</link>
      <description>I have been over and over the docs but this eludes me. There are a number of examples provided with the VB.Net demo app, but inforunately none show how to use any method that uses a buffer. I was hoping to usethisforum to get some guidance.&lt;BR /&gt;&lt;BR /&gt;I would like to re-iterate that the purpose of my app is to read a JPG, resize it, and save it with a quality factor of 75. This seems like an easy task but I am not very well versed in the IPP.&lt;BR /&gt;&lt;BR /&gt;I can use this code no problem:&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;myStatus = ip.ippiResize_8u_C3R(bmpsrcdata.Scan0, srcROI, bmpsrcdata.Stride, srcRect, bmpdstdata.Scan0, bmpdstdata.Stride, dstROI, xFactor, yFactor, Interpolation.IPPI_INTER_NN)&lt;BR /&gt;&lt;BR /&gt;This works, however, when I save the destination image, the imageshows my reduced image on top of my full image. Also, the file size is about 3.5 MB. The original image size is only 223 KB so no compression (quality) is applied. Also, the code shown below produces an error:&lt;BR /&gt;&lt;BR /&gt;Dim stt As IppStatus = ip.ippiQualityIndex_8u32f_C3R(bmpsrcdata.Scan0, bmpsrcdata.Stride, bmpdstdata.Scan0, bmpdstdata.Stride, dstROI, 75)&lt;BR /&gt;&lt;BR /&gt;Here is my VB.Net code:&lt;/P&gt;&lt;P&gt; Dim xFactor As Double&lt;BR /&gt; Dim yFactor As Double&lt;BR /&gt; Dim nChannel As Integer&lt;BR /&gt; Dim buffsize As Integer&lt;/P&gt;&lt;P&gt; Dim myStatus As IppStatus = IppStatus.ippStsNoErr&lt;/P&gt;&lt;P&gt; Dim bmpsrcdata As BitmapData = getBmpData(bmpsrc)&lt;/P&gt;&lt;P&gt; bmpdst = New Bitmap(bmpsrc)&lt;/P&gt;&lt;P&gt; Dim bmpdstdata As BitmapData = getBmpData(bmpdst)&lt;/P&gt;&lt;P&gt; Dim srcROI As IppiSize = New IppiSize(bmpsrc.Width, bmpsrc.Height)&lt;BR /&gt; Dim dstROI As IppiSize = New IppiSize(bmpdst.Width, bmpdst.Height)&lt;/P&gt;&lt;P&gt; '*******************************&lt;BR /&gt; ' Set Image Scaling Factors.&lt;BR /&gt; '*******************************&lt;/P&gt;&lt;P&gt; If doHalf = True Then&lt;/P&gt;&lt;P&gt; xFactor = 0.5&lt;/P&gt;&lt;P&gt; yFactor = 0.5&lt;/P&gt;&lt;P&gt; Else&lt;/P&gt;&lt;P&gt; xFactor = dstWidth / dstROI.width&lt;/P&gt;&lt;P&gt; yFactor = dstHeight / dstROI.height&lt;/P&gt;&lt;P&gt; End If&lt;/P&gt;&lt;P&gt; Dim srcRect As IppiRect = New IppiRect(0, 0, bmpsrcdata.Width, bmpsrcdata.Height)&lt;/P&gt;&lt;P&gt; Dim dstRect As IppiRect = New IppiRect(0, 0, bmpdstdata.Width, bmpdstdata.Height)&lt;/P&gt;&lt;P&gt; nChannel = 1&lt;/P&gt;&lt;P&gt; buffsize = 0&lt;/P&gt;&lt;P&gt; GoTo here&lt;/P&gt;&lt;P&gt; myStatus = IppStatus.ippStsNoErr&lt;/P&gt;&lt;P&gt; m_start = ipp.core.ippGetCpuClocks()&lt;/P&gt;&lt;P&gt; myStatus = ip.ippiResize_8u_C3R(bmpsrcdata.Scan0, srcROI, bmpsrcdata.Stride, srcRect, bmpdstdata.Scan0, bmpdstdata.Stride, dstROI, xFactor, yFactor, Interpolation.IPPI_INTER_NN)&lt;/P&gt;&lt;P&gt; m_stop = ipp.core.ippGetCpuClocks()&lt;/P&gt;&lt;P&gt; If (myStatus &amp;lt;&amp;gt; IppStatus.ippStsNoErr) Then&lt;/P&gt;&lt;P&gt; msg("Resize", myStatus)&lt;/P&gt;&lt;P&gt; End If&lt;/P&gt;&lt;P&gt; bmpsrc.UnlockBits(bmpsrcdata)&lt;/P&gt;&lt;P&gt; bmpdst.UnlockBits(bmpdstdata)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; '***************************************&lt;BR /&gt; ' Adjust JPG Quality (Compression).&lt;BR /&gt; '***************************************&lt;/P&gt;&lt;P&gt; bmpsrcdata = getBmpData(bmpsrc)&lt;/P&gt;&lt;P&gt; bmpdstdata = getBmpData(bmpdst)&lt;/P&gt;&lt;P&gt; dstROI = New IppiSize(bmpdst.Width, bmpdst.Height)&lt;/P&gt;&lt;P&gt; Try&lt;/P&gt;&lt;P&gt; Dim stt As IppStatus = ip.ippiQualityIndex_8u32f_C3R(bmpsrcdata.Scan0, bmpsrcdata.Stride, bmpdstdata.Scan0, bmpdstdata.Stride, dstROI, 75)&lt;/P&gt;&lt;P&gt; Catch ex As Exception&lt;/P&gt;&lt;P&gt; Dim a As Integer&lt;/P&gt;&lt;P&gt; End Try&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; bmpsrc.UnlockBits(bmpsrcdata)&lt;/P&gt;&lt;P&gt; bmpdst.UnlockBits(bmpdstdata)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; bmpsrc.Save("C:\Test_SRC.jpg")&lt;/P&gt;&lt;P&gt; bmpdst.Save("C:\Test_DST.jpg")&lt;/P&gt;&lt;P&gt; Invalidate()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help would be greatly appreciated. I think I am very close but just have difficulties finishing up.&lt;BR /&gt;&lt;BR /&gt;Terry&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2010 16:18:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847862#M6264</guid>
      <dc:creator>tposhea</dc:creator>
      <dc:date>2010-04-14T16:18:49Z</dc:date>
    </item>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847863#M6265</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;First thing, you declare your destination image as a copy of the source image : bmpdst = New Bitmap(bmpsrc) this is why you see the reduced image on top of the source image. You have to create a new Bitmap using another form of the constructor (if I recall correctly : width, Height and imageFormat) where width and height are the destination width and height and imageFormat something like BGR24bits. Then you'll only get the reduced image.&lt;BR /&gt;&lt;BR /&gt;Second thing, ippiQualityIndex_8u32f_C3R is not designed to &lt;B&gt;save&lt;/B&gt; a file with a quality of xx%. It computes the quality index of an image given the original image (or so I think, I don't use this function).&lt;BR /&gt;&lt;BR /&gt;If you want to save a JPEG file with a given quality in .NET, you have to use another form of the Save function. Here's what I found with a google search on microsoft web site&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="code"&gt;private static ImageCodecInfo GetEncoderInfo(String mimeType)&lt;BR /&gt;{&lt;BR /&gt;    int j;&lt;BR /&gt;    ImageCodecInfo[] encoders;&lt;BR /&gt;    encoders = ImageCodecInfo.GetImageEncoders();&lt;BR /&gt;    for(j = 0; j &amp;lt; encoders.Length; ++j)&lt;BR /&gt;    {&lt;BR /&gt;        if(encoders&lt;J&gt;.MimeType == mimeType)&lt;BR /&gt;            return encoders&lt;J&gt;;&lt;BR /&gt;    }&lt;BR /&gt;    return null;&lt;BR /&gt;}&lt;BR /&gt;private void SaveJPGWithCompressionSetting( Image image, string szFileName, long lCompression )&lt;BR /&gt;{&lt;BR /&gt;    EncoderParameters eps = new EncoderParameters(1);&lt;BR /&gt;    eps.Param[0] = new EncoderParameter( Encoder.Quality, lCompression );&lt;BR /&gt;    ImageCodecInfo ici = GetEncoderInfo("image/jpeg");&lt;BR /&gt;    image.Save( szFileName, ici, eps );&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="sectionBody"&gt;That is C#, &lt;/SPAN&gt;but the 3rd result was the VB translation : &lt;A target="_blank" title="Link" href="http://lmgtfy.com/?q=.NEt+Save+JPEG+quality"&gt;link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to save JPEG images with IPP you'll have to go through the samples.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Matthieu &lt;BR /&gt;&lt;/J&gt;&lt;/J&gt;&lt;/PRE&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Apr 2010 16:54:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847863#M6265</guid>
      <dc:creator>matthieu_darbois</dc:creator>
      <dc:date>2010-04-14T16:54:58Z</dc:date>
    </item>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847864#M6266</link>
      <description>Thanks guys. I originally used that method but, with 1.5 million images to resize, it was was too slow. My thoughts were that that IPP would reduce this time. So from my understanding, the IPP is not designed to handle this type of processing?</description>
      <pubDate>Wed, 14 Apr 2010 20:53:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847864#M6266</guid>
      <dc:creator>tposhea</dc:creator>
      <dc:date>2010-04-14T20:53:11Z</dc:date>
    </item>
    <item>
      <title>ResizeGetBufSize</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847865#M6267</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;IPP resize function speed up resize operation itself. It will not reduce time you spent reading 1.5 millions of images from hard drive and write them back.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Wed, 14 Apr 2010 20:57:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ResizeGetBufSize/m-p/847865#M6267</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-04-14T20:57:20Z</dc:date>
    </item>
  </channel>
</rss>

