Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Vinay_G_
Beginner
121 Views

Intel IPP 2017 release - PNG compressions

Hi,

We are working on evaluating the performance and compression of PNG files on intel IPP 2017 released version. 

The numbers with various compression levels seem to have beaten the competitions(cloud flare and zlib-ng) but the newly introduced flag for fastest compression (-2) seems to get us in an infinite loop after we are done with patching and updating zlib 1.2.8. The code changes are only expected to go in zlib library and the integration to libPNG remains unaffected. The patched code seems to be incomplete in this case.

local block_state deflate_common(deflate_state* s, int flush){

...

while ( (s->lookahead > 0) || (s->strm->avail_in > 0) ) {

...

lz77_encode_window( s, flush );

 

Lookahead remains at the same value.

Please share any numbers for the PNG compression and details on how to enable the fastest compression.

Regards,

Vinay

 

0 Kudos
4 Replies
Ying_H_Intel
Employee
121 Views

Hi Vinay, 

​I move your post from other forum  to the IPP forum. We will  investigate it and contact you later. 

Best Regards,

Ying

Shaojuan_Z_Intel
Employee
121 Views

Hi Vinay,

We found the fix in lz77_encode_call function in deflate.c as follow:

if(s->deflate_table == Z_NULL)
        {
            /* deflate table is absent, look if statistics is collected */
            if(s->deflate_stat)
                custDeflateUpdateTable(s, *src, *src_len);
//// DBG
#if 0
            status = ippsDeflateLZ77Fastest_8u( (const Ipp8u**)src, src_len, &s->match_start,
                                                s->window + s->strstart, s->w_size,
                                                (int*)s->head, s->hash_size,
                                                &s->bi_buf, (Ipp32u*)&s->bi_valid,
                                                s->strm->next_out, s->strm->avail_out, (Ipp32u*)&dst_indx,
                                                NULL, NULL, ( flush == Z_NO_FLUSH ) ? IppLZ77NoFlush : IppLZ77FullFlush );
#else
            status = ippsDeflateLZ77Fastest_8u((const Ipp8u**)src, src_len, &s->match_start,
                                                s->window + s->strstart, s->w_size,
                                               (int*)s->head, s->hash_size,
                                               &s->bi_buf, (Ipp32u*)&s->bi_valid,
                                               s->pending_out, s->pending_buf_size - s->pending, (Ipp32u*)&s->pending,
                                               NULL, NULL, (flush == Z_NO_FLUSH) ? IppLZ77NoFlush : IppLZ77FullFlush);
            flush_pending(s->strm);
#endif
            s->strm->next_out += dst_indx;
            s->strm->avail_out -= dst_indx;
            s->strm->total_out += dst_indx;
        }

Could you try the above code and let us know how it works? Thanks!

Eugene_K_1
Beginner
121 Views

Hi,

I had the same issue with the latest IPP (2020.0.166), zlib 1.2.11 and libpng 1.6.37.

This fix does the trick, I think you should include it into official distribution.

Best regards,
Eugene

Gennady_F_Intel
Moderator
121 Views

Ok, thanks for the reminder. We will check the implementation once again and update this thread accordingly.