]> Cypherpunks repositories - gostls13.git/commit
image/jpeg: move the level-shift and clip out of the idct function,
authorNigel Tao <nigeltao@golang.org>
Sun, 7 Oct 2012 00:32:02 +0000 (11:32 +1100)
committerNigel Tao <nigeltao@golang.org>
Sun, 7 Oct 2012 00:32:02 +0000 (11:32 +1100)
commit0b9fe6d24e50aaa0e3910566d938bd6ad0bf86d7
tree4c8f256b9e037a95e7f7200bb1da411bd47fdcb8
parentf2444f0bc18d9b3d61d115ac29479d7ff3c4f829
image/jpeg: move the level-shift and clip out of the idct function,
to be consistent with the fdct function, and to ease any future
idct rewrites in assembly.

The BenchmarkIDCT delta is obviously just an accounting change and not
a real saving, but it does give an indication of what proportion of
time was spent in the actual IDCT and what proportion was in shift and
clip. The idct time taken is now comparable to fdct.

The BenchmarkFDCT delta is an estimate of benchmark noise.

benchmark                   old ns/op    new ns/op    delta
BenchmarkFDCT                    3842         3837   -0.13%
BenchmarkIDCT                    5611         3478  -38.01%
BenchmarkDecodeRGBOpaque      2932785      2929751   -0.10%

R=r
CC=golang-dev
https://golang.org/cl/6625057
src/pkg/image/jpeg/dct_test.go
src/pkg/image/jpeg/idct.go
src/pkg/image/jpeg/reader.go