forked from enlightenment/efl
ok - longstanding issue. quality of jpeg encode and decode dropped
quickly when uf your-encoded anything due to using IFAST decoder (and encoder). this does drop speed for decode and encode (except encoding < 60% quality where it now uses IFAST), but we don't see progressively worse artifacts. SVN revision: 65293
This commit is contained in:
parent
aeed35b2ea
commit
16d5eb14bb
|
@ -499,3 +499,8 @@
|
||||||
2011-11-02 Nicolas Aguirre
|
2011-11-02 Nicolas Aguirre
|
||||||
* Add gl_cocoa engine
|
* Add gl_cocoa engine
|
||||||
|
|
||||||
|
2011-11-16 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* JPEG encode and decode in eet now uses ISLOW (not IFAST) due to
|
||||||
|
noticable quality losses in the chase for speed. It will use
|
||||||
|
IFAST for quality less than 60 when encoding
|
||||||
|
|
|
@ -102,6 +102,7 @@ Improvements:
|
||||||
* text to display missing unicode char instead of missing glyphs
|
* text to display missing unicode char instead of missing glyphs
|
||||||
* internal file code to use eina_file more
|
* internal file code to use eina_file more
|
||||||
* jpeg loader to use eina_file
|
* jpeg loader to use eina_file
|
||||||
|
* jpeg encode and decode quality improved at expense of speed
|
||||||
|
|
||||||
Removals:
|
Removals:
|
||||||
|
|
||||||
|
|
|
@ -284,7 +284,7 @@ evas_image_load_file_head_jpeg_internal(Image_Entry *ie,
|
||||||
jpeg_read_header(&cinfo, TRUE);
|
jpeg_read_header(&cinfo, TRUE);
|
||||||
cinfo.do_fancy_upsampling = FALSE;
|
cinfo.do_fancy_upsampling = FALSE;
|
||||||
cinfo.do_block_smoothing = FALSE;
|
cinfo.do_block_smoothing = FALSE;
|
||||||
cinfo.dct_method = JDCT_IFAST;
|
cinfo.dct_method = JDCT_ISLOW; // JDCT_FLOAT JDCT_IFAST(quality loss)
|
||||||
cinfo.dither_mode = JDITHER_ORDERED;
|
cinfo.dither_mode = JDITHER_ORDERED;
|
||||||
jpeg_start_decompress(&cinfo);
|
jpeg_start_decompress(&cinfo);
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ evas_image_load_file_data_jpeg_internal(Image_Entry *ie,
|
||||||
jpeg_read_header(&cinfo, TRUE);
|
jpeg_read_header(&cinfo, TRUE);
|
||||||
cinfo.do_fancy_upsampling = FALSE;
|
cinfo.do_fancy_upsampling = FALSE;
|
||||||
cinfo.do_block_smoothing = FALSE;
|
cinfo.do_block_smoothing = FALSE;
|
||||||
cinfo.dct_method = JDCT_IFAST;
|
cinfo.dct_method = JDCT_ISLOW; // JDCT_FLOAT JDCT_IFAST(quality loss)
|
||||||
cinfo.dither_mode = JDITHER_ORDERED;
|
cinfo.dither_mode = JDITHER_ORDERED;
|
||||||
|
|
||||||
if (ie->scale > 1)
|
if (ie->scale > 1)
|
||||||
|
|
|
@ -84,8 +84,20 @@ save_image_jpeg(RGBA_Image *im, const char *file, int quality)
|
||||||
cinfo.image_height = im->cache_entry.h;
|
cinfo.image_height = im->cache_entry.h;
|
||||||
cinfo.input_components = 3;
|
cinfo.input_components = 3;
|
||||||
cinfo.in_color_space = JCS_RGB;
|
cinfo.in_color_space = JCS_RGB;
|
||||||
|
cinfo.optimize_coding = FALSE;
|
||||||
|
cinfo.dct_method = JDCT_ISLOW; // JDCT_FLOAT JDCT_IFAST(quality loss)
|
||||||
|
if (quality < 60) cinfo.dct_method = JDCT_IFAST;
|
||||||
jpeg_set_defaults(&cinfo);
|
jpeg_set_defaults(&cinfo);
|
||||||
jpeg_set_quality(&cinfo, quality, TRUE);
|
jpeg_set_quality(&cinfo, quality, TRUE);
|
||||||
|
if (quality >= 90)
|
||||||
|
{
|
||||||
|
cinfo.comp_info[0].h_samp_factor = 1;
|
||||||
|
cinfo.comp_info[0].v_samp_factor = 1;
|
||||||
|
cinfo.comp_info[1].h_samp_factor = 1;
|
||||||
|
cinfo.comp_info[1].v_samp_factor = 1;
|
||||||
|
cinfo.comp_info[2].h_samp_factor = 1;
|
||||||
|
cinfo.comp_info[2].v_samp_factor = 1;
|
||||||
|
}
|
||||||
jpeg_start_compress(&cinfo, TRUE);
|
jpeg_start_compress(&cinfo, TRUE);
|
||||||
ptr = im->image.data;
|
ptr = im->image.data;
|
||||||
while (cinfo.next_scanline < cinfo.image_height)
|
while (cinfo.next_scanline < cinfo.image_height)
|
||||||
|
|
Loading…
Reference in New Issue