Project: skia Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 11 users
Status: Fixed
Owner:
Closed: Jan 2016
Area: ----
Priority: Medium
Type: Defect



Sign in to add a comment
Investigate using "optimize_coding" when encoding to JPEG
Project Member Reported by scro...@google.com, Feb 23 2015 Back to list
See https://github.com/bither/bither-android-lib/blob/master/REASON.md

This project suggests that using "optimize_coding" when encoding to JPEG will result in a higher quality image with negligible performance/storage penalties. If that is true, we should allow using the feature.

Brought to the Skia team's attention in skia-discuss here: https://groups.google.com/forum/#!topic/skia-discuss/p0IcyBoU8P0
 
Project Member Comment 1 by benjamin...@google.com, Jan 13 2016
Owner: benjamin...@google.com
Project Member Comment 2 by benjamin...@google.com, Jan 15 2016
My testing more-or-less agrees with the last three comments on the skia-discuss thread -- the image quality is identical with and without optimize_coding (as far as I can tell) and the image size is 10-30% smaller (I found a bigger savings than 5-10% as stated in the thread). Ignoring memory and CPU cost, enabling this flag is a win (and given that my phone is now more powerful than my laptop, we probably can ignore memory and CPU cost). I did not measure memory, but optimize_coding seems to increase CPU time by 2-3x.

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

The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/0a35620a16b368356888d15771392fb00cbb777d

commit 0a35620a16b368356888d15771392fb00cbb777d
Author: benjaminwagner <benjaminwagner@google.com>
Date: Fri Jan 15 02:13:32 2016

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

[modify] http://crrev.com/0a35620a16b368356888d15771392fb00cbb777d/src/images/SkImageDecoder_libjpeg.cpp

Project Member Comment 4 by benjamin...@google.com, Jan 15 2016
Status: Fixed
Sign in to add a comment