Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14)

Issue 4523052: code review 4523052: jpeg: speed up decoding by inlining the clip function a... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by nigeltao
Modified:
14 years ago
Reviewers:
CC:
r, golang-dev
Visibility:
Public.

Description

image/jpeg: speed up decoding by inlining the clip function and writing the idct result directly to the image buffer instead of storing it in an intermediate d.blocks field. Writing to d.blocks was necessary when decoding to an image.RGBA image, but now that we decode to a ycbcr.YCbCr we can write each component directly to the image buffer. Crude "time ./6.out" scores to decode a specific 2592x1944 JPEG 20 times show a 16% speed-up: BEFORE user 0m10.410s user 0m10.400s user 0m10.480s user 0m10.480s user 0m10.460s AFTER user 0m9.050s user 0m9.050s user 0m9.050s user 0m9.070s user 0m9.020s

Patch Set 1 #

Patch Set 2 : diff -r f32c6f103820 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r f32c6f103820 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r ae920b31c0d9 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -102 lines) Patch
M src/pkg/image/jpeg/idct.go View 1 6 chunks +69 lines, -55 lines 0 comments Download
M src/pkg/image/jpeg/reader.go View 1 2 3 6 chunks +20 lines, -47 lines 0 comments Download

Messages

Total messages: 3
nigeltao
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-05-10 00:05:53 UTC) #1
r
LGTM
14 years ago (2011-05-10 00:19:45 UTC) #2
nigeltao
14 years ago (2011-05-10 00:25:36 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=f39664db2e15 ***

image/jpeg: speed up decoding by inlining the clip function and
writing the idct result directly to the image buffer instead of
storing it in an intermediate d.blocks field.

Writing to d.blocks was necessary when decoding to an image.RGBA image,
but now that we decode to a ycbcr.YCbCr we can write each component
directly to the image buffer.

Crude "time ./6.out" scores to decode a specific 2592x1944 JPEG 20
times show a 16% speed-up:

BEFORE

user	0m10.410s
user	0m10.400s
user	0m10.480s
user	0m10.480s
user	0m10.460s

AFTER

user	0m9.050s
user	0m9.050s
user	0m9.050s
user	0m9.070s
user	0m9.020s

R=r
CC=golang-dev
http://codereview.appspot.com/4523052
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b