summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-11-16 11:52:47 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-11-16 11:52:47 +0000
commit84f49dc2fef8311279676cdac8bf1f0d7f584821 (patch)
treea24405516ca534f833d7adc82fbbe2488f9c26a6
parent511d5292fa0c5d6e4b97403f0f0467eced62e8d9 (diff)
downloadeet-84f49dc2fef8311279676cdac8bf1f0d7f584821.tar.gz
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: 65294
-rw-r--r--ChangeLog6
-rw-r--r--NEWS1
-rw-r--r--src/lib/eet_image.c11
3 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fcafa79..0b3c5fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -540,3 +540,9 @@
* Added a new macro for adding arrays of basic types.
EET_DATA_DESCRIPTOR_ADD_BASIC_ARRAY
+
+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
diff --git a/NEWS b/NEWS
index 80e5965..43118b0 100644
--- a/NEWS
+++ b/NEWS
@@ -25,3 +25,4 @@ Improvements:
* use stringshare for mmaped file names
* use eina locking wrappers
* use eina_file for file IO
+ * jpeg encode and decode quality improved at expense of speed
diff --git a/src/lib/eet_image.c b/src/lib/eet_image.c
index 06816b1..79f6f90 100644
--- a/src/lib/eet_image.c
+++ b/src/lib/eet_image.c
@@ -447,7 +447,7 @@ eet_data_image_jpeg_rgb_decode(const void *data,
}
jpeg_read_header(&cinfo, TRUE);
- cinfo.dct_method = JDCT_FASTEST;
+ cinfo.dct_method = JDCT_ISLOW; // JDCT_FLOAT JDCT_IFAST(quality loss)
cinfo.do_fancy_upsampling = FALSE;
cinfo.do_block_smoothing = FALSE;
jpeg_start_decompress(&cinfo);
@@ -595,7 +595,7 @@ eet_data_image_jpeg_alpha_decode(const void *data,
}
jpeg_read_header(&cinfo, TRUE);
- cinfo.dct_method = JDCT_FASTEST;
+ cinfo.dct_method = JDCT_ISLOW; // JDCT_FLOAT JDCT_IFAST(quality loss)
cinfo.do_fancy_upsampling = FALSE;
cinfo.do_block_smoothing = FALSE;
jpeg_start_decompress(&cinfo);
@@ -832,8 +832,12 @@ eet_data_image_jpeg_convert(int *size,
cinfo.image_height = h;
cinfo.input_components = 3;
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_quality(&cinfo, quality, TRUE);
+
if (quality >= 90)
{
cinfo.comp_info[0].h_samp_factor = 1;
@@ -925,6 +929,9 @@ eet_data_image_jpeg_alpha_convert(int *size,
cinfo.image_height = h;
cinfo.input_components = 3;
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_quality(&cinfo, quality, TRUE);
if (quality >= 90)