Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6734 Discussions

Does IppLZOState_8u structure need to be initialized before every compression?

rusty0412
Beginner
352 Views
Hi,

I am going to be compressing varying length blobs with LZO and I would like to make it as fast as possible yet single threaded. I am thinking of caching my IppLZOState_8u structure and keep reusing it until ippsEncodeLZOGetSize returns a bigger structure size. However, I am wondering whether I have to call ippsEncodeLZOInit before every call to ippsEncodeLZO_8u or just when I allocate the structure? Optimally, I would like to call ippsEncodeLZOInit only after allocating the structure.

Thanks!
0 Kudos
1 Reply
Sergey_K_Intel
Employee
352 Views
Hello,

The structure needs to be allocated/initialized only once. In single-threaded mode the LZOGetSize function always returns the same size of about 64K for the structure, so despite the input data sizemay bedifferent, the structure is the same.
When it comes to multi-threaded mode, in GetSize call it'snecessary to specify the maximum length of input data buffer. And the structure size, returned by this call, greatly depends on that maximum length.

Regards,
Sergey
0 Kudos
Reply