// dct8 computes the 8th-order discrete cosine transform.
498773
func dct8(data *[8]float32) {
	var even, odd [4]float32
	for i := 0; i < 4; i++ {
		even[i] = data[i] + data[7-i]
		odd[i] = (data[i] - data[7-i]) * dct8c[i]
	}

	dct4(&even)
	dct4(&odd)

	for i := 0; i < 3; i++ {
		odd[i] += odd[i+1]
	}

	for i := 0; i < 4; i++ {
		data[2*i] = even[i]
		data[2*i+1] = odd[i]
	}
}
1099051
func (v qrCodeVersion) numDataBits() int {
	numDataBits := 0
	for _, b := range v.block {
		numDataBits += 8 * b.numBlocks * b.numDataCodewords // 8 bits in a byte
	}

	return numDataBits
}
119955
func (b *byteReader) Uint8() uint8 {
	v := b.b[b.off]
	return v
}
945834
func TimeForDt8(dt8 int32) (time.Time, error) {
	return time.Parse(DT8, strconv.FormatInt(int64(dt8), 10))
}
938810
func (e *Event) Uint8(key string, i uint8) *Event {
	if e == nil {
		return e
	}
	e.buf = enc.AppendUint8(enc.AppendKey(e.buf, key), i)
	return e
}
328265
func (Encoder) AppendInts8(dst []byte, vals []int8) []byte {
	if len(vals) == 0 {
		return append(dst, '[', ']')
	}
	dst = append(dst, '[')
	dst = strconv.AppendInt(dst, int64(vals[0]), 10)
	if len(vals) > 1 {
		for _, val := range vals[1:] {
			dst = strconv.AppendInt(append(dst, ','), int64(val), 10)
		}
	}
	dst = append(dst, ']')
	return dst
}
1270698
func imdct4(in *[2]float32, out *[4]float32) {
	tmp0 := in[0]*imdct4c0 + in[1]*imdct4c1
	tmp1 := in[0]*imdct4c1 - in[1]*imdct4c0

	out[0] = tmp0
	out[1] = -tmp0
	out[2] = tmp1
	out[3] = tmp1
}
1069471
func Aes128CBCDecrypt(key [16]byte, ciphertext []byte) (plaintext []byte, err error) {
	return aesCBCDec(key[:], ciphertext)
}
875873
func Uint8Bytes(v uint8) []byte {
	b := make([]byte, 1)
	PutUint8(b, v)
	return b
}
540724
func pack8(src []uint64) uint64 {
	return 8<<60 |
		src[0] |
		src[1]<<7 |
		src[2]<<14 |
		src[3]<<21 |
		src[4]<<28 |
		src[5]<<35 |
		src[6]<<42 |
		src[7]<<49
}
1284489
func nextDecomposed(i *Iter) (next []byte) {
	outp := 0
	inCopyStart, outCopyStart := i.p, 0
	ss := mkStreamSafe(i.info)
	for {
		if sz := int(i.info.size); sz <= 1 {
			p := i.p
			i.p++ // ASCII or illegal byte.  Either way, advance by 1.
			if i.p >= i.rb.nsrc {
				i.setDone()
				return i.returnSlice(p, i.p)
			} else if i.rb.src._byte(i.p) < utf8.RuneSelf {
				i.next = i.asciiF
				return i.returnSlice(p, i.p)
			}
			outp++
		} else if d := i.info.Decomposition(); d != nil {
			// Note: If leading CCC != 0, then len(d) == 2 and last is also non-zero.
			// Case 1: there is a leftover to copy.  In this case the decomposition
			// must begin with a modifier and should always be appended.
			// Case 2: no leftover. Simply return d if followed by a ccc == 0 value.
			p := outp + len(d)
			if outp > 0 {
				i.rb.src.copySlice(i.buf[outCopyStart:], inCopyStart, i.p)
				if p > len(i.buf) {
					return i.buf[:outp]
				}
			} else if i.info.multiSegment() {
				// outp must be 0 as multi-segment decompositions always
				// start a new segment.
				if i.multiSeg == nil {
					i.multiSeg = d
					i.next = nextMulti
					return nextMulti(i)
				}
				// We are in the last segment.  Treat as normal decomposition.
				d = i.multiSeg
				i.multiSeg = nil
				p = len(d)
			}
			prevCC := i.info.tccc
			if i.p += sz; i.p >= i.rb.nsrc {
				i.setDone()
				i.info = Properties{} // Force BoundaryBefore to succeed.
			} else {
				i.info = i.rb.f.info(i.rb.src, i.p)
			}
			switch ss.next(i.info) {
			case ssOverflow:
				i.next = nextCGJDecompose
				fallthrough
			case ssStarter:
				if outp > 0 {
					copy(i.buf[outp:], d)
					return i.buf[:p]
				}
				return d
			}
			copy(i.buf[outp:], d)
			outp = p
			inCopyStart, outCopyStart = i.p, outp
			if i.info.ccc < prevCC {
				goto doNorm
			}
			continue
		} else if r := i.rb.src.hangul(i.p); r != 0 {
			outp = decomposeHangul(i.buf[:], r)
			i.p += hangulUTF8Size
			inCopyStart, outCopyStart = i.p, outp
			if i.p >= i.rb.nsrc {
				i.setDone()
				break
			} else if i.rb.src.hangul(i.p) != 0 {
				i.next = nextHangul
				return i.buf[:outp]
			}
		} else {
			p := outp + sz
			if p > len(i.buf) {
				break
			}
			outp = p
			i.p += sz
		}
		if i.p >= i.rb.nsrc {
			i.setDone()
			break
		}
		prevCC := i.info.tccc
		i.info = i.rb.f.info(i.rb.src, i.p)
		if v := ss.next(i.info); v == ssStarter {
			break
		} else if v == ssOverflow {
			i.next = nextCGJDecompose
			break
		}
		if i.info.ccc < prevCC {
			goto doNorm
		}
	}
	if outCopyStart == 0 {
		return i.returnSlice(inCopyStart, i.p)
	} else if inCopyStart < i.p {
		i.rb.src.copySlice(i.buf[outCopyStart:], inCopyStart, i.p)
	}
	return i.buf[:outp]
doNorm:
	// Insert what we have decomposed so far in the reorderBuffer.
	// As we will only reorder, there will always be enough room.
	i.rb.src.copySlice(i.buf[outCopyStart:], inCopyStart, i.p)
	i.rb.insertDecomposed(i.buf[0:outp])
	return doNormDecomposed(i)
}
165823
func SubI16x8(x, y I16x8) I16x8 {
	val := I16x8{}
	for i := 0; i < 8; i++ {
		val[i] = x[i] - y[i]
	}
	return val
}
515955
func (b *PCMBuffer) AsI8() (out []int8) {
	if b == nil {
		return nil
	}
	switch b.DataType {
	case DataTypeI8:
		return b.I8
	case DataTypeI16:
		out = make([]int8, len(b.I16))
		for i := 0; i < len(b.I16); i++ {
			out[i] = int8(b.I16[i])
		}
	case DataTypeI32:
		out = make([]int8, len(b.I32))
		for i := 0; i < len(b.I32); i++ {
			out[i] = int8(b.I32[i])
		}
	case DataTypeF32:
		out = make([]int8, len(b.F32))
		for i := 0; i < len(b.F32); i++ {
			out[i] = int8(b.F32[i])
		}
	case DataTypeF64:
		out = make([]int8, len(b.F64))
		for i := 0; i < len(b.F64); i++ {
			out[i] = int8(b.F64[i])
		}
	}
	return out
}
1295549
func dct2(data *[2]float32) {
	even := data[0] + data[1]
	odd := (data[0] - data[1]) * dct2c

	data[0] = even
	data[1] = odd
}
302260
func (e Encoder) AppendUints8(dst []byte, vals []uint8) []byte {
	major := majorTypeArray
	l := len(vals)
	if l == 0 {
		return e.AppendArrayEnd(e.AppendArrayStart(dst))
	}
	if l <= additionalMax {
		lb := byte(l)
		dst = append(dst, byte(major|lb))
	} else {
		dst = appendCborTypePrefix(dst, major, uint64(l))
	}
	for _, v := range vals {
		dst = e.AppendUint8(dst, v)
	}
	return dst
}
1013853
func imdct(t *imdctLookup, in, out []float32) {
	n := len(in) * 2

	n2, n4, n8 := n/2, n/4, n/8
	n3_4 := n - n4

	// more of these steps could be done in place, but we need two arrays anyway
	for j := 0; j < n8; j++ {
		a0 := t.A[n2-2*j-1]
		a1 := t.A[n2-2*j-2]
		a2 := t.A[n4-2*j-1]
		a3 := t.A[n4-2*j-2]
		a4 := t.A[n2-4-4*j]
		a5 := t.A[n2-3-4*j]
		v0 := (-in[4*j+3])*a0 + (-in[4*j+1])*a1
		v1 := (-in[4*j+3])*a1 - (-in[4*j+1])*a0
		v2 := (in[n2-4*j-4])*a2 + (in[n2-4*j-2])*a3
		v3 := (in[n2-4*j-4])*a3 - (in[n2-4*j-2])*a2
		out[n4+2*j+1] = v3 + v1
		out[n4+2*j] = v2 + v0
		out[2*j+1] = (v3-v1)*a4 - (v2-v0)*a5
		out[2*j] = (v2-v0)*a4 + (v3-v1)*a5
	}
	ld := int(ilog(n) - 1)
	for l := 0; l < ld-3; l++ {
		k0 := n >> uint(l+3)
		k1 := 1 << uint(l+3)
		rlim := n >> uint(l+4)
		s2lim := 1 << uint(l+2)
		for r := 0; r < rlim; r++ {
			a0 := t.A[r*k1]
			a1 := t.A[r*k1+1]
			i0 := n2 - 1 - 2*r
			i1 := n2 - 2 - 2*r
			i2 := n2 - 1 - k0 - 2*r
			i3 := n2 - 2 - k0 - 2*r
			for s2 := 0; s2 < s2lim; s2 += 2 {
				v0, v1 := out[i0], out[i1]
				v2, v3 := out[i2], out[i3]
				out[i0] = v0 + v2
				out[i1] = v1 + v3
				out[i2] = (v0-v2)*a0 - (v1-v3)*a1
				out[i3] = (v1-v3)*a0 + (v0-v2)*a1
				i0 -= 2 * k0
				i1 -= 2 * k0
				i2 -= 2 * k0
				i3 -= 2 * k0
			}
		}
	}
	for i := 0; i < n8; i++ {
		j := int(bitReverse(uint32(i)) >> uint(32-ld+3))
		if i < j {
			out[4*j], out[4*i] = out[4*i], out[4*j]
			out[4*j+1], out[4*i+1] = out[4*i+1], out[4*j+1]
			out[4*j+2], out[4*i+2] = out[4*i+2], out[4*j+2]
			out[4*j+3], out[4*i+3] = out[4*i+3], out[4*j+3]
		}
	}
	for k := 0; k < n8; k++ {
		in[n2-1-2*k] = out[4*k]
		in[n2-2-2*k] = out[4*k+1]
		in[n4-1-2*k] = out[4*k+2]
		in[n4-2-2*k] = out[4*k+3]
	}
	i0 := 0
	i1 := 1
	i2 := n2 - 2
	i3 := n2 - 1
	for k := 0; k < n8; k++ {
		v0, v1 := in[i0], in[i1]
		v2, v3 := in[i2], in[i3]
		c0 := t.C[i0]
		c1 := t.C[i1]
		out[i0] = (v0 + v2 + c1*(v0-v2) + c0*(v1+v3)) / 2
		out[i2] = (v0 + v2 - c1*(v0-v2) - c0*(v1+v3)) / 2
		out[i1] = (v1 - v3 + c1*(v1+v3) - c0*(v0-v2)) / 2
		out[i3] = (-v1 + v3 + c1*(v1+v3) - c0*(v0-v2)) / 2
		i0 += 2
		i1 += 2
		i2 -= 2
		i3 -= 2
	}
	for k := 0; k < n4; k++ {
		b0 := t.B[2*k]
		b1 := t.B[2*k+1]
		v0 := out[2*k]
		v1 := out[2*k+1]
		in[k] = v0*b0 + v1*b1
		in[n2-1-k] = v0*b1 - v1*b0
	}
	for i := 0; i < n4; i++ {
		out[i] = in[i+n4]
		out[n-i-1] = -in[n-i-n3_4-1]
	}
	for i := n4; i < n3_4; i++ {
		out[i] = -in[n3_4-i-1]
	}
}
1032870
func (s *Session) Uint8(key string) uint8 {
	s.RLock()
	defer s.RUnlock()

	v, ok := s.data[key]
	if !ok {
		return 0
	}

	value, ok := v.(uint8)
	if !ok {
		return 0
	}
	return value
}