codec/mjpeg: renamed putBuffer.putBuf to putBytes

This commit is contained in:
Saxon 2019-12-29 22:57:35 +10:30
parent 13e2571230
commit 5b8f71b7d8
2 changed files with 5 additions and 5 deletions

View File

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

View File

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