Does IppLZOState_8u structure need to be initialized before every compression?
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.
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.