<?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 Hello again Sergey, in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939310#M17535</link>
    <description>Hello again Sergey,
Thank you for your example code.  

I'm having problems with the decompression.  [cpp]ippsDecodeLZSS_8u( &amp;amp;pSrc, &amp;amp;srcLen, &amp;amp;pDst, &amp;amp;dstLen, pLZSSState);[/cpp] the dstLen is not returning any value other then zero and the srcLen is a very large negative number.  The status value returned it [cpp] ippStsSizeErr[/cpp]
My code is as follows:
[cpp]
  FILE            *inFile;
  FILE            *outFile;

  char            * pInFileName
  char            * pOutFileName
  
  Ipp8u           *pSrc = NULL;
  Ipp8u           *pDst = NULL;
  Ipp8u           *startpSrc;
  Ipp8u           *startpDst;
  Ipp8u           *buffer ;

  int                srcLen;
  int                dstLen = 0;
  int                pLZSSSize;

  IppStatus       status;
  IppLZSSState_8u *pLZSSState; 

 
  startpSrc = ippsMalloc_8u( OUTBLOCKSIZE * sizeof(Ipp8u) );
  startpDst = ippsMalloc_8u( INBLOCKSIZE * sizeof(Ipp8u) );
  
  status = ippsLZSSGetSize_8u(&amp;amp;pLZSSSize);
 
  buffer  = ippsMalloc_8u(pLZSSSize);
  pLZSSState = (IppLZSSState_8u*)buffer;
 
  status = ippsDecodeLZSSInit_8u(pLZSSState);

   errno_t junk = fopen_s( &amp;amp;inFile, pInFileName,"rb" ) ;
   junk = fopen_s( &amp;amp;outFile, pOutFileName,"wb" ) ;
 
  srcLen = fread( startpSrc, sizeof(Ipp8u), OUTBLOCKSIZE, inFile );
  
  pSrc = startpSrc;
  pDst = startpDst;
for( ; ; )
  {
    status = ippsDecodeLZSS_8u( &amp;amp;pSrc, &amp;amp;srcLen, &amp;amp;pDst, &amp;amp;dstLen, pLZSSState);
    if( status == ippStsNoErr )
    {
      fwrite(startpDst, sizeof(Ipp8u), (INBLOCKSIZE - dstLen), outFile);
      pDst = startpDst;
      dstLen = INBLOCKSIZE;
      srcLen = fread( startpSrc, sizeof(Ipp8u), OUTBLOCKSIZE, inFile );
      pSrc = startpSrc;
      if(srcLen == 0)
        break;
    }
    else if( status == ippStsDstSizeLessExpected )
    {
      fwrite(startpDst, sizeof(Ipp8u), (INBLOCKSIZE - dstLen), outFile);
      pDst = startpDst;
      dstLen = INBLOCKSIZE;
    }
    else if(status == ippStsNullPtrErr)
    {
      printf("null pointer\n");
      break;
    }
    else if( status == ippStsSizeErr)
    {
      printf("size error\n");
      break;
    }
  } /* for */
  ippsFree(buffer);
  ippsFree( startpSrc );
  ippsFree( startpDst );
  fclose(outFile);
  fclose(inFile);
[/cpp]

Thank you for you help. Yolanda</description>
    <pubDate>Mon, 05 Nov 2012 14:33:15 GMT</pubDate>
    <dc:creator>Yolanda_Maxwell</dc:creator>
    <dc:date>2012-11-05T14:33:15Z</dc:date>
    <item>
      <title>Using LZSS Compression Functions</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939303#M17528</link>
      <description>&lt;P&gt;I'm using the example code from&amp;nbsp;Intel® Integrated Performance Primitives Reference Manual, Volume 1: Signal Processing on&amp;nbsp;LZSS&amp;nbsp;Compression. This document indicates that some of the functions have been Deprecated. &amp;nbsp;Two of the function used in the example are part of these deprecated function. &amp;nbsp;The first one is [cpp]IppStatus&amp;nbsp;ippsEncodeLZSSInitAlloc_8u (IppLZSSState_8u**&amp;nbsp;ppLZSSState);[/cpp] and the second one is &amp;nbsp;[cpp]void&amp;nbsp;ippsLZSSFree_8u (IppLZSSState_8u*&amp;nbsp;pLZSSState);[/cpp] &amp;nbsp;The warning when I use&amp;nbsp;ippsEncodeLZSSInitAlloc() indicates that I should use the&amp;nbsp;GetSize&amp;nbsp;and&amp;nbsp;Init&amp;nbsp;pair to replace this functionality. &amp;nbsp;But there is no corresponding functions indicated in place of&amp;nbsp;LZSSFree. &amp;nbsp;My research indicate the reason for these function being&amp;nbsp;deprecated&amp;nbsp;is that&amp;nbsp;Internal memory allocation will not be supported at some point. This indicates to me that I will need to do the memory allocation, but I don't understand how to do this. The above document indicates that function&amp;nbsp;ippsEncodeLZSSInit_8u(), &amp;nbsp;initializes the&amp;nbsp;LZSS&amp;nbsp;state structure&amp;nbsp;pLZSSState&amp;nbsp;in the external buffer. But I don't see were or how the external buffer is allocated. But when I call&amp;nbsp;ippsLZSSGetSize() it returns a size indicating that the buffer has been allocated. &amp;nbsp;If it has been allocated, how do I&amp;nbsp;de-allocate it? Or is that being done automatically? &amp;nbsp;Is there some way to change the size of this buffer?&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2012 22:20:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939303#M17528</guid>
      <dc:creator>Yolanda_Maxwell</dc:creator>
      <dc:date>2012-10-31T22:20:08Z</dc:date>
    </item>
    <item>
      <title>One more thing, when I try to</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939304#M17529</link>
      <description>One more thing, when I try to use [cpp]IppStatus ippsEncodeLZSSInit_8u (IppLZSSState_8u* pLZSSState);[/cpp] using variable [cpp] IppLZSSState_8u *pLZSSState;[/cpp]  I get the following error: Run-Time Check Failure #3 - The variable 'pLZSSState' is being used without being initialized.  How do I initialize pLZSSState?</description>
      <pubDate>Wed, 31 Oct 2012 22:45:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939304#M17529</guid>
      <dc:creator>Yolanda_Maxwell</dc:creator>
      <dc:date>2012-10-31T22:45:17Z</dc:date>
    </item>
    <item>
      <title>Hi Yolanda,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939305#M17530</link>
      <description>Hi Yolanda,

Regarding your first topic, you are right, IPP is deprecating internal memory allocation. Internal mallocs are not effective, often contradict with application's usage models and so on. So, you need to allocate and free dynamic memory by yourself. If majority of cases, the usage model is the following:
1) call ipp&lt;METHOD&gt;GetSise(&amp;amp;size) function to determine the minimum amount of memory IPP functions will need
2) allocate the requested memory using any of OS functions for dynamic memory (malloc, VirtualAlloc, whatever), assigning the obtained address to ipp&lt;ANY method=""&gt;State pointer
3) use other ipp&lt;METHOD&gt; functions providing the above pointer
4) free dynamic memory using proper OS function (free, VirtualFree and so on).

Regarding your second topic, did you assign any obtained dynamic address to pLZSSState variable?
 
Regards,
Sergey&lt;/METHOD&gt;&lt;/ANY&gt;&lt;/METHOD&gt;</description>
      <pubDate>Thu, 01 Nov 2012 05:30:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939305#M17530</guid>
      <dc:creator>Sergey_K_Intel</dc:creator>
      <dc:date>2012-11-01T05:30:04Z</dc:date>
    </item>
    <item>
      <title>Hello Sergey,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939306#M17531</link>
      <description>Hello Sergey,
Thank you for your response.  Just to clarify, I can use any dynamic memory allocation method (ie new) or does it need to be one specific to Intel?
In regards to the second question, no. 
Thank you for your help.
Yolanda</description>
      <pubDate>Thu, 01 Nov 2012 13:28:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939306#M17531</guid>
      <dc:creator>Yolanda_Maxwell</dc:creator>
      <dc:date>2012-11-01T13:28:12Z</dc:date>
    </item>
    <item>
      <title>Hello again Sergey,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939307#M17532</link>
      <description>Hello again Sergey,

Next question, on the buffer. What is the data type? Char or Ipp8u or ?? Do you have any examples using and external buffer?  It would really help I had some simple examples that didn't use the deprecated functions. Not just for LZSS Compression, but also for the other methods of data compression supported.

Yolanda</description>
      <pubDate>Thu, 01 Nov 2012 14:11:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939307#M17532</guid>
      <dc:creator>Yolanda_Maxwell</dc:creator>
      <dc:date>2012-11-01T14:11:07Z</dc:date>
    </item>
    <item>
      <title>Quote:Yolanda Maxwell wrote:</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939308#M17533</link>
      <description>&lt;BLOCKQUOTE&gt;Yolanda Maxwell wrote:&lt;BR /&gt;&lt;P&gt;I can use any dynamic memory allocation method (ie new) or does it need to be one specific to Intel?&lt;BR /&gt;
&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
Hi Yolanda,
 
You can use any method. There is no Intel-specific memory allocation procedures, only recommendations to use aligned addresses, which come from Intel architecture specifics. IPP's memory management functions are just wrappers around OS' functions (with 32-byte address alignment for better performance). "new" and "delete" operators are also ok.
 
Regards,
Sergey</description>
      <pubDate>Fri, 02 Nov 2012 06:40:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939308#M17533</guid>
      <dc:creator>Sergey_K_Intel</dc:creator>
      <dc:date>2012-11-02T06:40:06Z</dc:date>
    </item>
    <item>
      <title>Quote:Yolanda Maxwell wrote:</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939309#M17534</link>
      <description>&lt;BLOCKQUOTE&gt;Yolanda Maxwell wrote:&lt;BR /&gt;
&lt;P&gt;What is the data type? Char or Ipp8u or ?? Do you have any examples using and external buffer?  It would really help I had some simple examples that didn't use the deprecated functions. Not just for LZSS Compression, but also for the other methods of data compression supported.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

Ipp8u is typedef for "unsigned char". So, they are interchangeable.
 
Regarding deprecated functions, we are working on cleaning the sample source files from deprecated functions for new release. 
 
Below is an example of how to initialize LZSS structure for encoding (decoding is the same) without extra status checking and failure returns for simplicity. I am not sure how it will look in this new forum engine, though ))
[cpp]
    IppLZSSState_8u * pLZSSState = NULL;
    int iLZSSStateSize;

    st = ippsLZSSGetSize_8u(&amp;amp;iLZSSStateSize);
    pLZSSState = (IppLZSSState_8u*)ippsMalloc_8u(iLZSSStateSize);
    st = ippsEncodeLZSSInit_8u(pLZSSState);
/* LZSS Encoding, buffer flushing ... */
    ippsFree(pLZSSState);
[/cpp]

On C++ it will be like
[cpp]
         pLZSSState = (IppLZSSState_8u*) new Ipp8u[iLZSSStateSize];
[/cpp]
and
[cpp]
        delete [] (Ipp8u*)pLZSSState;
[/cpp]

Regards,
Sergey</description>
      <pubDate>Fri, 02 Nov 2012 07:24:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939309#M17534</guid>
      <dc:creator>Sergey_K_Intel</dc:creator>
      <dc:date>2012-11-02T07:24:25Z</dc:date>
    </item>
    <item>
      <title>Hello again Sergey,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939310#M17535</link>
      <description>Hello again Sergey,
Thank you for your example code.  

I'm having problems with the decompression.  [cpp]ippsDecodeLZSS_8u( &amp;amp;pSrc, &amp;amp;srcLen, &amp;amp;pDst, &amp;amp;dstLen, pLZSSState);[/cpp] the dstLen is not returning any value other then zero and the srcLen is a very large negative number.  The status value returned it [cpp] ippStsSizeErr[/cpp]
My code is as follows:
[cpp]
  FILE            *inFile;
  FILE            *outFile;

  char            * pInFileName
  char            * pOutFileName
  
  Ipp8u           *pSrc = NULL;
  Ipp8u           *pDst = NULL;
  Ipp8u           *startpSrc;
  Ipp8u           *startpDst;
  Ipp8u           *buffer ;

  int                srcLen;
  int                dstLen = 0;
  int                pLZSSSize;

  IppStatus       status;
  IppLZSSState_8u *pLZSSState; 

 
  startpSrc = ippsMalloc_8u( OUTBLOCKSIZE * sizeof(Ipp8u) );
  startpDst = ippsMalloc_8u( INBLOCKSIZE * sizeof(Ipp8u) );
  
  status = ippsLZSSGetSize_8u(&amp;amp;pLZSSSize);
 
  buffer  = ippsMalloc_8u(pLZSSSize);
  pLZSSState = (IppLZSSState_8u*)buffer;
 
  status = ippsDecodeLZSSInit_8u(pLZSSState);

   errno_t junk = fopen_s( &amp;amp;inFile, pInFileName,"rb" ) ;
   junk = fopen_s( &amp;amp;outFile, pOutFileName,"wb" ) ;
 
  srcLen = fread( startpSrc, sizeof(Ipp8u), OUTBLOCKSIZE, inFile );
  
  pSrc = startpSrc;
  pDst = startpDst;
for( ; ; )
  {
    status = ippsDecodeLZSS_8u( &amp;amp;pSrc, &amp;amp;srcLen, &amp;amp;pDst, &amp;amp;dstLen, pLZSSState);
    if( status == ippStsNoErr )
    {
      fwrite(startpDst, sizeof(Ipp8u), (INBLOCKSIZE - dstLen), outFile);
      pDst = startpDst;
      dstLen = INBLOCKSIZE;
      srcLen = fread( startpSrc, sizeof(Ipp8u), OUTBLOCKSIZE, inFile );
      pSrc = startpSrc;
      if(srcLen == 0)
        break;
    }
    else if( status == ippStsDstSizeLessExpected )
    {
      fwrite(startpDst, sizeof(Ipp8u), (INBLOCKSIZE - dstLen), outFile);
      pDst = startpDst;
      dstLen = INBLOCKSIZE;
    }
    else if(status == ippStsNullPtrErr)
    {
      printf("null pointer\n");
      break;
    }
    else if( status == ippStsSizeErr)
    {
      printf("size error\n");
      break;
    }
  } /* for */
  ippsFree(buffer);
  ippsFree( startpSrc );
  ippsFree( startpDst );
  fclose(outFile);
  fclose(inFile);
[/cpp]

Thank you for you help. Yolanda</description>
      <pubDate>Mon, 05 Nov 2012 14:33:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939310#M17535</guid>
      <dc:creator>Yolanda_Maxwell</dc:creator>
      <dc:date>2012-11-05T14:33:15Z</dc:date>
    </item>
    <item>
      <title>Yolanda,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939311#M17536</link>
      <description>Yolanda,
 
Your code must be ok if between lines 38 and 40 you will set "dstLen=INBLOCKSIZE;". This length variable must be initially set up. Or, set it at line 18: int dstLen = INBLOCKSIZE;
 
Regards,
Sergey</description>
      <pubDate>Tue, 06 Nov 2012 07:08:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939311#M17536</guid>
      <dc:creator>Sergey_K_Intel</dc:creator>
      <dc:date>2012-11-06T07:08:55Z</dc:date>
    </item>
    <item>
      <title>Thank you Sergey.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939312#M17537</link>
      <description>Thank you Sergey.</description>
      <pubDate>Tue, 06 Nov 2012 14:14:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Using-LZSS-Compression-Functions/m-p/939312#M17537</guid>
      <dc:creator>Yolanda_Maxwell</dc:creator>
      <dc:date>2012-11-06T14:14:16Z</dc:date>
    </item>
  </channel>
</rss>

