mirror of https://bitbucket.org/ausocean/av.git
codec/mjpeg/jpeg.go: simplified some indexing
This commit is contained in:
parent
d0e356314d
commit
38c4972a76
|
@ -299,12 +299,11 @@ func writeHeader(p []byte, _type, width, height, nbqTab int, dri uint16, qtable
|
|||
// Indicate start of image.
|
||||
idx := 0
|
||||
binary.BigEndian.PutUint16(p[idx:], 0xff00|codeSOI)
|
||||
idx += 2
|
||||
|
||||
// Write JFIF header.
|
||||
binary.BigEndian.PutUint16(p[idx:], 0xff00|codeAPP0)
|
||||
binary.BigEndian.PutUint16(p[idx+2:], jfifHeadLen)
|
||||
idx += 4
|
||||
binary.BigEndian.PutUint16(p[idx+2:], 0xff00|codeAPP0)
|
||||
binary.BigEndian.PutUint16(p[idx+4:], jfifHeadLen)
|
||||
idx += 6
|
||||
|
||||
src := []byte(jfifLabel)
|
||||
copy(p[idx:], src)
|
||||
|
|
Loading…
Reference in New Issue