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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user