<?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 How I to use Intel IPP JPEG Viewer Sample for Windows* ? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-I-to-use-Intel-IPP-JPEG-Viewer-Sample-for-Windows/m-p/819642#M4585</link>
    <description>Oh, I have solve the problem, it is I have convert no-exist format (JC_BGR to JC_RGB)&lt;BR /&gt;&lt;BR /&gt;and I do not turn on the warrning message in jegbase or proprecessor define flag ENABLE_ERROR_LOGGING.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
    <pubDate>Fri, 14 May 2010 11:32:16 GMT</pubDate>
    <dc:creator>Gaiger_Chen</dc:creator>
    <dc:date>2010-05-14T11:32:16Z</dc:date>
    <item>
      <title>How I to use Intel IPP JPEG Viewer Sample for Windows* ?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-I-to-use-Intel-IPP-JPEG-Viewer-Sample-for-Windows/m-p/819641#M4584</link>
      <description>The website &lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-jpeg-sample-and-performance-faqs/" target="_blank"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-jpeg-sample-and-performance-faqs/&lt;/A&gt; said: &lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;Which Intel IPP JPEG encoder/decoder is faster than the IJL?&lt;/B&gt;&lt;BR /&gt;The
 Intel IPP JPEG codec from the JPEGView sample is implemented for 
maximum performance and is faster than IJL v1.51 and the IJL-IPP sample.&lt;BR /&gt;&lt;BR /&gt;So I have download the JPEGView sample.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Badly, The JPEGView sample is without sample example. and there is only a brief d ocumentation within it :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For encode :&lt;BR /&gt;&lt;BR /&gt;&lt;H2&gt;Overview   
&lt;/H2&gt;
This sample demonstrates how to use the Intel IPP functions to create a
 JPEG encoder/decoder. The sample contains JPEG encoder/decoder which 
resides in the   
&lt;SPAN style="font-family: Courier; font-size: xx-small;"&gt;
jpegcodec   
&lt;/SPAN&gt;
folder and MFC application that allows opening, viewing and creating 
JPEG files. The JPEG encoder/decoder takes advantage of the 
Hyper-Threading Technology (HT Technology) found in the latest Intel 
Pentium 4 processors. The JPEG encoder/decoder is based on the 
international standard ISO/IEC 10918-1. The IPP JPEG codec provides the
 following public methods:   
&lt;P&gt;
encoder (see jpegcodec/jpegenc.h file for details)   
&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;
SetSource(Ipp8u* pSrc, int srcStep, IppiSize srcSize, int srcChannels, 
JCOLOR srcColor, JSS srcSampling, int srcPrecision)   
&lt;/LI&gt;&lt;LI&gt;
SetSource(Ipp16s* pSrc, int srcStep, IppiSize srcSize, int srcChannels, 
JCOLOR srcColor, JSS srcSampling, int srcPrecision)   
&lt;BR /&gt;
Use these methods to set up source image to compress with IPP JPEG codec
   
&lt;/LI&gt;&lt;LI&gt;
SetDestination(CBaseStreamOutput* pStreamOut)   
&lt;BR /&gt;
Use this method to set up where to output resulting JPEG bitstream. You 
can use memory buffer or byte stream, see CStdFileOutput or 
CMemBuffOutput classes for example   
&lt;/LI&gt;&lt;LI&gt;
SetParams(JMODE mode, JCOLOR color, JSS sampling, int restart_interval, 
int huff_opt, int quality)   
&lt;/LI&gt;&lt;LI&gt;
SetParams(JMODE mode, JCOLOR color, JSS sampling, int restart_interval, 
int huff_opt, int point_transform, int predictor)   
&lt;BR /&gt;
Use these methods to set up encoder control parameters. Use the first 
method for JPEG_BASELINE and JPEG_PROGRESSIVE modes, use the second 
method for JPEG_LOSSLESS mode. See ./jpegcodec/jpegbase.h file for 
definitions of JMODE, JCOLOR, JSS   
&lt;/LI&gt;&lt;LI&gt;
InitHuffmanTable(int tbl_id, HTBL_CLASS tbl_class, Ipp8u bits[16], Ipp8u
 vals[256])   
&lt;BR /&gt;
This method allows you to replace default huffman table. Use it 
carefully, huffman table must match encoded data. Do not use this 
methods if you are not familiar with JPEG details.   
&lt;/LI&gt;&lt;LI&gt;
AttachHuffmanTable(int tbl_id, int comp_no)   
&lt;BR /&gt;
This method allows you to change default connection of huffman tables 
and JPEG color components. The IPP JPEG codec by default connects 
huffman table with id = 0 to the first component in scan and uses table 
with id = 1 for other components.   
&lt;/LI&gt;&lt;LI&gt;
InitQuantTable(int tbl_id, Ipp8u qnt[64], int quality)   
&lt;/LI&gt;&lt;LI&gt;
InitQuantTable(int tbl_id, Ipp16u qnt[64], int quality)   
&lt;BR /&gt;
These methods allow you to replace default quantization tables, for both
 8-bit and 16-bit precision. Note, that you need to set quality 
parameter to zero to avoid re-scaling table's values.   
&lt;/LI&gt;&lt;LI&gt;
AttachQuantTable(int tbl_id, int comp_no)   
&lt;BR /&gt;
This method allow you to change default connection of quantization 
tables with JPEG color components.   
&lt;/LI&gt;&lt;LI&gt;
WriteHeader()   
&lt;BR /&gt;
Use this method to generate JPEG header, which include SOI, APP1, DQT, 
SOF, DHT segments. Separate calls of WriteHeader and WriteData methods 
allow you to write abbreviated JPEG files. Note, that DHT segment is not
 applied in WriteHeader for JPEG_PROGRESSIVE mode.   
&lt;/LI&gt;&lt;LI&gt;
WriteData()   
&lt;BR /&gt;
Use this method to actually encode the data   
&lt;/LI&gt;&lt;LI&gt;
NumOfBytes()   
&lt;BR /&gt;
This method provides the size of generated JPEG bitstream after call of 
WriteData. It is useful when encoding to memory buffer is used.   
&lt;/LI&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;B&gt;THAT IS ALL.&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;The parameter is hard to unstand what it is, and the JPEGView is heavy on OOP (&lt;B&gt;TRUE C++&lt;/B&gt; code) with inherit , they relation is not easy to understand .&lt;BR /&gt;&lt;BR /&gt;so, where I could get a simple example?&lt;BR /&gt;&lt;BR /&gt;I post my example code :&lt;BR /&gt;&lt;BR /&gt;/*load bmp file by OpenCV, trans data in the pSrcBuf, nBitcount = 3 for RGB format */&lt;BR /&gt;&lt;BR /&gt;#define PIXELSIZE3 3&lt;BR /&gt;#define TENMB 1073741824 /*for maxima buffer*/&lt;BR /&gt;&lt;BR /&gt;JPEGVIEWERENCODE_EXPORTS_API int JpegViewer_Encode(void *pDstBuf, unsigned int &amp;amp;JpegSize, int width, int height, void *pSrcBuf, int nBitcount, int quality)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt; CJPEGEncoder encoder;&lt;BR /&gt;&lt;BR /&gt; unsigned char *src;&lt;BR /&gt; src =(unsigned char*) pSrcBuf;&lt;BR /&gt; //dst = (unsigned char*)pDstBuf;&lt;BR /&gt; IppiSize srcSize;&lt;BR /&gt; srcSize.width = width;&lt;BR /&gt; srcSize.height = height;&lt;BR /&gt; int srcStep = 1;&lt;BR /&gt; int srcChannels = PIXELSIZE3;&lt;BR /&gt; JCOLOR srcColor = JC_BGR;&lt;BR /&gt; JSS srcSampling = JS_444;&lt;BR /&gt; int srcPrecision = 8;&lt;BR /&gt;&lt;BR /&gt; /*my data is by &lt;B&gt;pixel array&lt;/B&gt; format: R[0]G[0]B[0] R[1]G[1]B[1] R[2]G[2]B[2].......I do not know &lt;BR /&gt; what is srcSampling and srcStep meaning here.*/&lt;BR /&gt;&lt;BR /&gt; encoder.SetSource( src, srcStep , srcSize, srcChannels, srcColor, srcSampling, srcPrecision);&lt;BR /&gt;&lt;BR /&gt; CMemBuffOutput dst;&lt;BR /&gt; dst.Open((unsigned char*) pDstBuf, TENMB);&lt;BR /&gt;  &lt;BR /&gt;/*I do not know what the parameters mean: &lt;BR /&gt;restart_interval, 
int huff_opt in SetParams(JMODE mode, JCOLOR color, JSS sampling, int restart_interval,
 
int huff_opt, int quality)&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt; encoder.SetParams(JPEG_BASELINE, srcColor, srcSampling, 512*512, 1, quality) ;&lt;BR /&gt; encoder.SetDestination(&amp;amp;dst);&lt;BR /&gt; encoder.WriteHeader(); &lt;BR /&gt; encoder.WriteData();&lt;BR /&gt; JpegSize = encoder.NumOfBytes();&lt;BR /&gt;&lt;BR /&gt; return 1;&lt;BR /&gt;}/*JpegViewerEncode*/&lt;BR /&gt;&lt;BR /&gt;The output is just pink when I input lena 512*512~....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;May someone could help ? thank you lots...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 May 2010 07:25:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-I-to-use-Intel-IPP-JPEG-Viewer-Sample-for-Windows/m-p/819641#M4584</guid>
      <dc:creator>Gaiger_Chen</dc:creator>
      <dc:date>2010-05-14T07:25:50Z</dc:date>
    </item>
    <item>
      <title>How I to use Intel IPP JPEG Viewer Sample for Windows* ?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-I-to-use-Intel-IPP-JPEG-Viewer-Sample-for-Windows/m-p/819642#M4585</link>
      <description>Oh, I have solve the problem, it is I have convert no-exist format (JC_BGR to JC_RGB)&lt;BR /&gt;&lt;BR /&gt;and I do not turn on the warrning message in jegbase or proprecessor define flag ENABLE_ERROR_LOGGING.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 14 May 2010 11:32:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-I-to-use-Intel-IPP-JPEG-Viewer-Sample-for-Windows/m-p/819642#M4585</guid>
      <dc:creator>Gaiger_Chen</dc:creator>
      <dc:date>2010-05-14T11:32:16Z</dc:date>
    </item>
    <item>
      <title>How I to use Intel IPP JPEG Viewer Sample for Windows* ?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-I-to-use-Intel-IPP-JPEG-Viewer-Sample-for-Windows/m-p/819643#M4586</link>
      <description>Hi Chen,&lt;BR /&gt;&lt;BR /&gt;JPEGView sample demonstrate previous generation of JPEG codec. Since that time we have developed Unified Image Codec framework, which is C++ base interface for image codecs and inherited implementation of JPEG, JPEG2000, PNG codecs. It take the best from JPEGView design and add unification, I would recommend you to take a look at it. It is image codec interface we committed to extend in future. For example, in IPP 7.0 beta (which is coming soon) we plan to add new JPEG-XR codec support and base support for TIFF format (uncompressed at this time).&lt;BR /&gt;&lt;BR /&gt;You may find UIC sample in image-codecs\uic folder of your IPP sample package. There are also two sample applications which show how to use UIC codecs in application.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Fri, 14 May 2010 15:09:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-I-to-use-Intel-IPP-JPEG-Viewer-Sample-for-Windows/m-p/819643#M4586</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-05-14T15:09:34Z</dc:date>
    </item>
  </channel>
</rss>

