首页 > 解决方案 > What is the "n" parameter in the JPEG spec's DQT segment?

问题描述

I'm in the process of writing a JPEG file decoder to learn about the workings of JPEG files. In working through ITU-T81, which specifies JPEG, I ran into the following regarding the DQT segment for quantization tables:

DQT syntax

In many of JPEG's segments, there is an n parameter which you read from the segment, which then indicates how many iterations of the following item there are. However, in the DQT case, it just says "multiple", and its not defined how many multiples there are. One can possibly infer from Lq, but the way this multiple is defined is a bit of an anomaly compared to the other segments.

For anyone who is familiar with this specification, what is the right way to determine how many multiples, or n, of (Pq, Tq, Q0..Q63) there should be?

标签: jpegquantization

解决方案


取长度字段(LQ),减去 Pq/Tq 字段的长度(如果我记得是一个字节),即为 N。


推荐阅读