jpeg - 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:
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?
解决方案
取长度字段(LQ),减去 Pq/Tq 字段的长度(如果我记得是一个字节),即为 N。
推荐阅读
- javascript - Nightwatch 'For' 循环不执行命令
- java - 如何让 Eclipse 2018.09 默认使用 JUnit 4 测试运行器?
- python - Python - 切片列表以获取列表中的第一项(列表切片列表)
- javascript - 使用 ID / 或类更改值,但针对其中一个字段
- mongodb - $geowithin:$polygon 不使用 2dsphere 索引
- swift - 在 Swift 中将 JSONEncoder 用于 Equatable 方法
- css - 自定义一个以组件为内容的 ng-boostrap 模态
- python - 如何在 Seaborn 中仅针对正值创建箱线图?
- database - 从数据库填充 Wix 日历
- rx-swift - RxSwift 变量到另一个变量的链式传播