package flate
type fastEncL6 struct {
fastGen
table [tableSize]tableEntry
bTable [tableSize]tableEntryPrev
}
func ( *fastEncL6) ( *tokens, []byte) {
const (
= 12 - 1
= 1 + 1 +
= 4
)
for .cur >= bufferReset {
if len(.hist) == 0 {
clear(.table[:])
clear(.bTable[:])
.cur = maxMatchOffset
break
}
:= .cur + int32(len(.hist)) - maxMatchOffset
for := range .table[:] {
:= .table[].offset
if <= {
= 0
} else {
= - .cur + maxMatchOffset
}
.table[].offset =
}
for := range .bTable[:] {
:= .bTable[]
if .cur.offset <= {
.cur.offset = 0
.prev.offset = 0
} else {
.cur.offset = .cur.offset - .cur + maxMatchOffset
if .prev.offset <= {
.prev.offset = 0
} else {
.prev.offset = .prev.offset - .cur + maxMatchOffset
}
}
.bTable[] =
}
.cur = maxMatchOffset
}
:= .addBlock()
if len() < {
.n = uint16(len())
return
}
= .hist
:=
:= int32(len() - )
:= loadLE64(, )
:= int32(1)
for {
const = 7
const = 1
:=
var int32
var int32
for {
:= hashLen(, tableBits, )
:= hashLen(, tableBits, hashLongBytes)
=
= + + (-)>>
if > {
goto
}
:= .table[]
:= .bTable[]
:= loadLE64(, )
:= tableEntry{offset: + .cur}
.table[] =
:= &.bTable[]
.cur, .prev = , .cur
= hashLen(, tableBits, )
= hashLen(, tableBits, hashLongBytes)
= .cur.offset - .cur
if - < maxMatchOffset {
if uint32() == loadLE32(, ) {
.table[] = tableEntry{offset: + .cur}
:= &.bTable[]
.cur, .prev = tableEntry{offset: + .cur}, .cur
:= .prev.offset - .cur
if - < maxMatchOffset && uint32() == loadLE32(, ) {
= .matchLenLimited(int(+4), int(+4), ) + 4
:= .matchLenLimited(int(+4), int(+4), ) + 4
if > {
=
=
break
}
}
break
}
= .prev.offset - .cur
if - < maxMatchOffset && uint32() == loadLE32(, ) {
.table[] = tableEntry{offset: + .cur}
:= &.bTable[]
.cur, .prev = tableEntry{offset: + .cur}, .cur
break
}
}
= .offset - .cur
if - < maxMatchOffset && uint32() == loadLE32(, ) {
= .matchLenLimited(int(+4), int(+4), ) + 4
= .bTable[]
.table[] = tableEntry{offset: + .cur}
:= &.bTable[]
.cur, .prev = tableEntry{offset: + .cur}, .cur
const = 1
:= - +
if loadLE32(, ) == uint32(>>(8*)) {
:= .matchLenLimited(int(+4+), int(+4), ) + 4
if > {
=
=
+=
break
}
}
= .cur.offset - .cur
if - < maxMatchOffset {
if loadLE32(, ) == uint32() {
:= .matchLenLimited(int(+4), int(+4), ) + 4
if > {
=
=
=
}
}
= .prev.offset - .cur
if - < maxMatchOffset && loadLE32(, ) == uint32() {
:= .matchLenLimited(int(+4), int(+4), ) + 4
if > {
=
=
=
break
}
}
}
break
}
=
}
if == 0 {
= .matchLenLong(int(+4), int(+4), ) + 4
} else if == maxMatchLength {
+= .matchLenLong(int(+), int(+), )
}
if := + ; < {
const = 2
:= &.bTable[hashLen(loadLE64(, ), tableBits, hashLongBytes)]
:= .cur.offset - .cur - +
:= +
:= -
if < maxMatchOffset {
if > 0 && >= 0 {
if := .matchLenLong(int(), int(), ); > {
=
=
=
}
}
= .prev.offset - .cur - +
:= -
if > 0 && < maxMatchOffset && >= 0 {
if := .matchLenLong(int(), int(), ); > {
=
=
=
}
}
}
}
for > 0 && > && [-1] == [-1] {
--
--
++
}
if < {
for , := range [:] {
.tokens[.n] = token()
.litHist[]++
.n++
}
}
.AddMatchLong(, uint32(--baseMatchOffset))
= -
+=
=
if >= {
= + 1
}
if >= {
for := + 1; < int32(len())-8; += 2 {
:= loadLE64(, )
.table[hashLen(, tableBits, )] = tableEntry{offset: + .cur}
:= &.bTable[hashLen(, tableBits, hashLongBytes)]
.cur, .prev = tableEntry{offset: + .cur}, .cur
}
goto
}
for := + 1; < -1; += 2 {
:= loadLE64(, )
:= tableEntry{offset: + .cur}
:= tableEntry{offset: .offset + 1}
:= &.bTable[hashLen(, tableBits, hashLongBytes)]
:= &.bTable[hashLen(>>8, tableBits, hashLongBytes)]
.table[hashLen(, tableBits, )] =
.cur, .prev = , .cur
.cur, .prev = , .cur
}
= loadLE64(, )
}
:
if int() < len() {
if .n == 0 {
return
}
emitLiterals(, [:])
}
}