• Nigel Tao's avatar
    image/jpeg: move the level-shift and clip out of the idct function, · 0b9fe6d2
    Nigel Tao authored
    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
    0b9fe6d2
dct_test.go 8.47 KB