<?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 JPEG codec in jpegview usage problem in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/JPEG-codec-in-jpegview-usage-problem/m-p/902676#M12979</link>
    <description>&lt;P&gt;I'm using the JPEG codec in jpegview sample as recommended. I'm making a network camera using TCPIP upon Windows, which will send Jpeg header once and data frame as client asked. I'm migrating from ijg to this codec but find little document and user'guide. The code does not work. Here is my demo code:&lt;/P&gt;&lt;PRE&gt; const int imgSize = 768 * 576 * 3;&lt;BR /&gt; BYTE* buf = new BYTE[imgSize];&lt;BR /&gt; BYTE* img = new BYTE[imgSize];&lt;/PRE&gt;&lt;PRE&gt;&lt;PRE&gt; // Grab original image into img &lt;/PRE&gt;&lt;PRE&gt; // ...&lt;/PRE&gt;&lt;/PRE&gt;&lt;PRE&gt;IppiSize size = {768, 576};&lt;BR /&gt;&lt;BR /&gt;CJPEGEncoder encoder;&lt;BR /&gt;encoder.SetSource((Ipp8u*)img, 768 * 3, size, 3, JC_BGR);&lt;BR /&gt;encoder.SetParams(JPEG_BASELINE,JC_YCBCR, JS_444, 0, 0, 95);&lt;BR /&gt;&lt;BR /&gt;CMemBuffOutput jpegDest;&lt;BR /&gt;jpegDest.Open(buf, imgSize);&lt;BR /&gt;encoder.SetDestination(&amp;amp;jpegDest);&lt;BR /&gt;&lt;BR /&gt;CJPEGDecoder decoder;&lt;BR /&gt;decoder.SetDestination((Ipp8u*)img, 768 * 3, size, 3, JC_BGR);&lt;BR /&gt;&lt;BR /&gt;CMemBuffInput jpegSrc;&lt;BR /&gt;jpegSrc.Open(buf, imgSize);&lt;BR /&gt;decoder.SetSource(&amp;amp;jpegSrc);&lt;BR /&gt;&lt;BR /&gt;int width, height, nchannels;&lt;BR /&gt; JCOLOR color;&lt;BR /&gt;JSS sampling;&lt;BR /&gt; int precision;&lt;BR /&gt;encoder.WriteHeader();&lt;BR /&gt; // The next ReadHeader() will get error -4, why?&lt;BR /&gt; decoder.ReadHeader(&amp;amp;width, &amp;amp;height, &amp;amp;nchannels, &amp;amp;color, &amp;amp;sampling, &amp;amp;precision);&lt;/PRE&gt;&lt;PRE&gt;for(int i = 0; i &amp;lt; 10; i++)&lt;BR /&gt;{&lt;BR /&gt;   // Reset source and destination&lt;BR /&gt; jpegDest.Open(buf, imgSize);&lt;BR /&gt;encoder.SetDestination(&amp;amp;jpegDest);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  jpegSrc.Open(buf, imgSize);&lt;BR /&gt;   decoder.SetSource(&amp;amp;jpegSrc);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;   encoder.WriteData();&lt;BR /&gt;//int num = encoder.NumOfBytes();&lt;BR /&gt;decoder.ReadData();&lt;BR /&gt;}&lt;BR /&gt;  &lt;BR /&gt; delete[] img; delete[] buf;&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="Times New Roman"&gt;So I use memoy to memory compress and decompress to show the whole system. The first loop will generate good result. But the next loop will be wrong. Is my code correct? Help!&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Aug 2008 04:58:25 GMT</pubDate>
    <dc:creator>enjoysoft</dc:creator>
    <dc:date>2008-08-18T04:58:25Z</dc:date>
    <item>
      <title>JPEG codec in jpegview usage problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/JPEG-codec-in-jpegview-usage-problem/m-p/902676#M12979</link>
      <description>&lt;P&gt;I'm using the JPEG codec in jpegview sample as recommended. I'm making a network camera using TCPIP upon Windows, which will send Jpeg header once and data frame as client asked. I'm migrating from ijg to this codec but find little document and user'guide. The code does not work. Here is my demo code:&lt;/P&gt;&lt;PRE&gt; const int imgSize = 768 * 576 * 3;&lt;BR /&gt; BYTE* buf = new BYTE[imgSize];&lt;BR /&gt; BYTE* img = new BYTE[imgSize];&lt;/PRE&gt;&lt;PRE&gt;&lt;PRE&gt; // Grab original image into img &lt;/PRE&gt;&lt;PRE&gt; // ...&lt;/PRE&gt;&lt;/PRE&gt;&lt;PRE&gt;IppiSize size = {768, 576};&lt;BR /&gt;&lt;BR /&gt;CJPEGEncoder encoder;&lt;BR /&gt;encoder.SetSource((Ipp8u*)img, 768 * 3, size, 3, JC_BGR);&lt;BR /&gt;encoder.SetParams(JPEG_BASELINE,JC_YCBCR, JS_444, 0, 0, 95);&lt;BR /&gt;&lt;BR /&gt;CMemBuffOutput jpegDest;&lt;BR /&gt;jpegDest.Open(buf, imgSize);&lt;BR /&gt;encoder.SetDestination(&amp;amp;jpegDest);&lt;BR /&gt;&lt;BR /&gt;CJPEGDecoder decoder;&lt;BR /&gt;decoder.SetDestination((Ipp8u*)img, 768 * 3, size, 3, JC_BGR);&lt;BR /&gt;&lt;BR /&gt;CMemBuffInput jpegSrc;&lt;BR /&gt;jpegSrc.Open(buf, imgSize);&lt;BR /&gt;decoder.SetSource(&amp;amp;jpegSrc);&lt;BR /&gt;&lt;BR /&gt;int width, height, nchannels;&lt;BR /&gt; JCOLOR color;&lt;BR /&gt;JSS sampling;&lt;BR /&gt; int precision;&lt;BR /&gt;encoder.WriteHeader();&lt;BR /&gt; // The next ReadHeader() will get error -4, why?&lt;BR /&gt; decoder.ReadHeader(&amp;amp;width, &amp;amp;height, &amp;amp;nchannels, &amp;amp;color, &amp;amp;sampling, &amp;amp;precision);&lt;/PRE&gt;&lt;PRE&gt;for(int i = 0; i &amp;lt; 10; i++)&lt;BR /&gt;{&lt;BR /&gt;   // Reset source and destination&lt;BR /&gt; jpegDest.Open(buf, imgSize);&lt;BR /&gt;encoder.SetDestination(&amp;amp;jpegDest);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  jpegSrc.Open(buf, imgSize);&lt;BR /&gt;   decoder.SetSource(&amp;amp;jpegSrc);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;   encoder.WriteData();&lt;BR /&gt;//int num = encoder.NumOfBytes();&lt;BR /&gt;decoder.ReadData();&lt;BR /&gt;}&lt;BR /&gt;  &lt;BR /&gt; delete[] img; delete[] buf;&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="Times New Roman"&gt;So I use memoy to memory compress and decompress to show the whole system. The first loop will generate good result. But the next loop will be wrong. Is my code correct? Help!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2008 04:58:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/JPEG-codec-in-jpegview-usage-problem/m-p/902676#M12979</guid>
      <dc:creator>enjoysoft</dc:creator>
      <dc:date>2008-08-18T04:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: JPEG codec in jpegview usage problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/JPEG-codec-in-jpegview-usage-problem/m-p/902677#M12980</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I think the reason is that you mix encoder and decoder calls and get situation where you lost JPEG header information (which is needed for decoder ReadHeader call) after you call encoder's WriteData. If you are trying to simulate network connection between encoder and decoder it might be better to separate encoder's output buffer from decoder's input buffer. Then operation Copy will simulate transmittion of data through network.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2008 18:55:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/JPEG-codec-in-jpegview-usage-problem/m-p/902677#M12980</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2008-08-19T18:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: JPEG codec in jpegview usage problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/JPEG-codec-in-jpegview-usage-problem/m-p/902678#M12981</link>
      <description>Then how to export a jpeg file with only one head and several images?How to read it using decoder? Is there any example?</description>
      <pubDate>Wed, 20 Aug 2008 05:34:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/JPEG-codec-in-jpegview-usage-problem/m-p/902678#M12981</guid>
      <dc:creator>enjoysoft</dc:creator>
      <dc:date>2008-08-20T05:34:46Z</dc:date>
    </item>
  </channel>
</rss>

