Convert JBOOLEAN_USE_MOZ_DEFAULTS into an integer "compression profile" parameter

This eliminates JBOOLEAN_USE_MOZ_DEFAULTS and replaces it with
JINT_COMPRESS_PROFILE, a more flexible and descriptive parameter.  Currently,
this new parameter works in much the same way as the old-- it changes the
behavior of jpeg_set_defaults().  It currently supports only two values
(max. compression, i.e. mozjpeg defaults, and fastest, i.e. libjpeg-turbo
defaults), but it can be extended in the future with additional profiles that
balance compression ratio with performance.
This commit is contained in:
DRC
2014-12-14 01:56:26 -06:00
parent f8dd3830eb
commit 3e2cf6909c
10 changed files with 64 additions and 46 deletions

View File

@@ -240,7 +240,7 @@ static int setCompDefaults(struct jpeg_compress_struct *cinfo,
else jpeg_set_colorspace(cinfo, JCS_YCbCr);
/* Set scan pattern again as colorspace might have changed */
if (cinfo->master->use_moz_defaults)
if(cinfo->master->compress_profile == JCP_MAX_COMPRESSION)
jpeg_simple_progression(cinfo);
cinfo->comp_info[0].h_samp_factor=tjMCUWidth[subsamp]/8;