- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I noticed this code in the IPP ZLIB sample when comparing with the public zlib 1.2.5 source. Can anyone explain the significance of "avoiding" level 6? Thanks.
[cpp]#ifdef IPP_DEFAULT_COMPRESSION if ((level == Z_DEFAULT_COMPRESSION) || (level == 6)) level = 5; #else [/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ryan Wong,
To match with Zlib library, IPP Zlib compression levels are changed since form IPP 7.0.
Now level 6 is default as in the Zlib, as Sergey said, to make it faster with a less degree ofcompression enforcing to level 5.
If you want to match as in the previous releases of IPP, just change configuration_table structure.
/* 6 */ {8, 16, 128, 128, deflate_slow},
/* 5 */ {8, 16, 32, 32, deflate_slow},
#ifdef IPP_DEFAULT_COMPRESSION
if ((level == Z_DEFAULT_COMPRESSION) || (level == 6)) level = 5;
#else
if (level == Z_DEFAULT_COMPRESSION) level = 6;
#endif
New compression levels are described in the article.
http://software.intel.com/en-us/articles/ipp_zlib-change-the-default-compression-level-1/
Thanks,
Naveen Gv
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I noticed this code in the IPP ZLIB sample when comparing with the public zlib 1.2.5 source. Can anyone explain the significance of "avoiding" level 6?
...
Hi Rayn,
Here are some pieces to the "puzzle" I found in 'zlib.h':
...
#define Z_NO_COMPRESSION 0
#define Z_BEST_SPEED 1
#define Z_BEST_COMPRESSION 9
#define Z_DEFAULT_COMPRESSION (-1)
/* compression levels */
...
and
...
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
1 gives best speed, 9 gives best compression, 0 gives no compression at
all (the input data is simply copied a block at a time).
Z_DEFAULT_COMPRESSION requests a default compromise between speed and
compression ( currently equivalent to level 6 ).
... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By enforcing a value'5' a datacompression will be done a little bit faster with a less degree ofcompression.
It looks like a developer simply didn't want to allowa default compression level( -1 or 6 )at all.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ryan Wong,
To match with Zlib library, IPP Zlib compression levels are changed since form IPP 7.0.
Now level 6 is default as in the Zlib, as Sergey said, to make it faster with a less degree ofcompression enforcing to level 5.
If you want to match as in the previous releases of IPP, just change configuration_table structure.
/* 6 */ {8, 16, 128, 128, deflate_slow},
/* 5 */ {8, 16, 32, 32, deflate_slow},
#ifdef IPP_DEFAULT_COMPRESSION
if ((level == Z_DEFAULT_COMPRESSION) || (level == 6)) level = 5;
#else
if (level == Z_DEFAULT_COMPRESSION) level = 6;
#endif
New compression levels are described in the article.
http://software.intel.com/en-us/articles/ipp_zlib-change-the-default-compression-level-1/
Thanks,
Naveen Gv
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page