Enable mozjpeg defaults in sample apps and turbojpeg
This commit is contained in:
@@ -126,6 +126,8 @@ write_JPEG_file (char * filename, int quality)
|
||||
cinfo.image_height = image_height;
|
||||
cinfo.input_components = 3; /* # of color components per pixel */
|
||||
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
|
||||
cinfo.use_moz_defaults = TRUE; /* use Mozilla defaults for improved compression */
|
||||
|
||||
/* Now use the library's routine to set default compression parameters.
|
||||
* (You must set at least cinfo.in_color_space before calling this,
|
||||
* since the defaults depend on the source color space.)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -85,6 +87,7 @@ int main(void)
|
||||
|
||||
jpeg_create_compress(&cinfo);
|
||||
cinfo.input_components = 3;
|
||||
cinfo.use_moz_defaults = TRUE;
|
||||
jpeg_set_defaults(&cinfo);
|
||||
cinfo.in_color_space = JCS_EXT_RGB;
|
||||
jpeg_default_colorspace(&cinfo);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright (C)2009-2013 D. R. Commander. All Rights Reserved.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -192,6 +194,7 @@ static int setCompDefaults(struct jpeg_compress_struct *cinfo,
|
||||
}
|
||||
|
||||
cinfo->input_components=tjPixelSize[pixelFormat];
|
||||
cinfo->use_moz_defaults = TRUE;
|
||||
jpeg_set_defaults(cinfo);
|
||||
if(jpegQual>=0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user