aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-01-14 18:13:32 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-14 18:13:32 -0800
commit0a35620a16b368356888d15771392fb00cbb777d (patch)
treebf980c58cedc65b67416099188d9763c68e7ec4f
parentc55f699e8b01644b49dddfc21bfb538f1a5ed06a (diff)
Add optimize_coding setting for JPEG encoding.
Produces smaller encoded output at the expense of encoding time. No visual differences. sample image 1 (RGB gradients): default (80): 2.5x slower, 34% smaller quality 0: 1.7x slower, 52% smaller quality 20: 2.1x slower, 55% smaller quality 40: 2.3x slower, 37% smaller quality 60: 2.5x slower, 36% smaller quality 100: 3.9x slower, 22% smaller sample image 2 (photo): default (80): 2x slower, 8% smaller quality 0: 1.5x slower, 49% smaller quality 20: 1.7x slower, 22% smaller quality 40: 1.9x slower, 15% smaller quality 60: 1.9x slower, 11% smaller quality 100: 2x slower, 9% smaller BUG=skia:3460 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1589593002 Review URL: https://codereview.chromium.org/1589593002
-rw-r--r--src/images/SkImageDecoder_libjpeg.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index 0d02a658f2..6a032fdb96 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -958,6 +958,7 @@ protected:
cinfo.input_gamma = 1;
jpeg_set_defaults(&cinfo);
+ cinfo.optimize_coding = TRUE;
jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);
#ifdef DCT_IFAST_SUPPORTED
cinfo.dct_method = JDCT_IFAST;