codec/mjpeg: renamed putBuffer.putBuf to putBytes

This commit is contained in:
Saxon 2019-12-29 22:57:35 +10:30
parent 4c04cc033a
commit 423a5c12c4
2 changed files with 5 additions and 5 deletions

View File

@ -263,7 +263,7 @@ func writeHeader(p *putBuffer, _type, width, height, nbqTab, dri int, qtable []b
mark(p, codeAPP0)
p.put16(16)
const jfifLabel = "JFIF\000"
p.putBuf([]byte(jfifLabel))
p.putBytes([]byte(jfifLabel))
p.put16(0x0201)
p.put8(0)
p.put16(1)
@ -287,7 +287,7 @@ func writeHeader(p *putBuffer, _type, width, height, nbqTab, dri int, qtable []b
for i := 0; i < nbqTab; i++ {
p.put8(uint8(i))
p.putBuf(qtable[64*i : (64*i)+64])
p.putBytes(qtable[64*i : (64*i)+64])
}
// Define huffman table.
@ -360,8 +360,8 @@ func writeHuffman(p *putBuffer, class, id int, bits, values []byte) {
n += int(bits[i])
}
p.putBuf(bits[1:17])
p.putBuf(values[0:n])
p.putBytes(bits[1:17])
p.putBytes(values[0:n])
}
// defaultQTable returns a default quantization table.

View File

@ -58,7 +58,7 @@ func (p *putBuffer) put8(v uint8) {
p.len++
}
func (p *putBuffer) putBuf(src []byte) {
func (p *putBuffer) putBytes(src []byte) {
copy(p.bytes[p.len:], src)
p.len += len(src)
}