Javadoc
This function tries to parse the Quantizations tables and adds them to JpegImageData
object. If segmentData has more bytes after parsing first QT, that means DQT segment has
multiple quantization tables. We allow multiple quant tables to have same tableIndex,
and the latter one overrides the previous one. we currently parse upto 2 quantization
tables.
The structure of the DQT (Define Quantization Table) segment.
- QT information (1 byte): (bit 0 = LSB and bit 7 = MSB)
bit 3..0: index of QT (3..0, otherwise error)
bit 7..4: precision of QT, 0 means 8 bit, 1 means 16 bit, otherwise bad input
- n bytes QT values, n = 64*(precision+1)