mirror of https://github.com/golang/go.git
image/jpeg: move the huffman bit decoder state higher up in the
decoder struct, inside the unmappedzero limit, to eliminate some TESTB instructions in the inner decoding loop. benchmark old ns/op new ns/op delta BenchmarkDecode 2943204 2746360 -6.69% R=r, dave CC=golang-dev https://golang.org/cl/6625058
This commit is contained in:
parent
9224b4c873
commit
d7b7957db1
|
|
@ -92,6 +92,7 @@ type Reader interface {
|
|||
|
||||
type decoder struct {
|
||||
r Reader
|
||||
b bits
|
||||
width, height int
|
||||
img1 *image.Gray
|
||||
img3 *image.YCbCr
|
||||
|
|
@ -100,7 +101,6 @@ type decoder struct {
|
|||
comp [nColorComponent]component
|
||||
huff [maxTc + 1][maxTh + 1]huffman
|
||||
quant [maxTq + 1]block // Quantization tables, in zig-zag order.
|
||||
b bits
|
||||
tmp [1024]byte
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue