mirror of https://bitbucket.org/ausocean/av.git
codec/mjpeg/jpeg.go: simplified some more indexing
This commit is contained in:
parent
0b848cb01b
commit
52f18cdc58
|
@ -326,12 +326,11 @@ func writeHeader(p []byte, _type, width, height, nbqTab int, dri uint16, qtable
|
|||
|
||||
// Define quantization tables.
|
||||
binary.BigEndian.PutUint16(p[idx:], 0xff00|codeDQT)
|
||||
idx += 2
|
||||
|
||||
// Calculate table size and create slice for table.
|
||||
ts := 2 + nbqTab*(1+64)
|
||||
binary.BigEndian.PutUint16(p[idx:], uint16(ts))
|
||||
idx += 2
|
||||
binary.BigEndian.PutUint16(p[idx+2:], uint16(ts))
|
||||
idx += 4
|
||||
|
||||
for i := 0; i < nbqTab; i++ {
|
||||
p[idx] = byte(i)
|
||||
|
|
Loading…
Reference in New Issue