GIF数据存储规范问题
在 GIF 规范中,此处:
http://www.w3.org/Graphics/ GIF/spec-gif89a.txt
我无法理解它的两个部分:
它指定“LZW 最小代码大小”:
该字节确定图像数据中用于 LZW 代码的初始位数,如附录 F 中所述。
- “用于 LZW 代码的初始位数”是什么意思?
- LZW 代码如何在 GIF 上下文中工作? (我理解它指的是 Lempel-Ziv-Welch)。
- 它所指的难以捉摸的“附录F”在哪里? (它不在体内)。
它还指定在“LZW最小代码大小”的单字节之后,有一个称为“图像数据”的块,其实际大小未指定,仅称为“数据子块”。
- “数据子块”是什么意思?
- 如何计算数据子块的大小?
- 这与 LZW 代码有关吗?如果是这样,我该如何解释?
抱歉提出所有问题。感谢您抽出时间。
作为旁注:即使是部分答案或对任何问题的答案也将不胜感激。
In the GIF specification, here:
http://www.w3.org/Graphics/GIF/spec-gif89a.txt
I am having trouble understanding two parts of it:
It specifies for 'LZW minimum code size' that:
This byte determines the initial number of bits used for LZW codes in the image data, as described in Appendix F.
- What does it mean 'initial number of bits used for LZW codes'?
- How do LZW codes work in the context of GIFs? (I understand it refers to Lempel-Ziv-Welch).
- Where is the elusive 'appexdix F' it refers to? (It isn't in the body).
It also specifies that after the single byte for the 'LZW minimum code size', there is a block called 'Image Data', of which the actual size is unspecified, and is just called 'Data Sub-blocks'.
- What does it mean 'Data sub-blocks'?
- How do I work out the size of the data sub-blocks?
- And does this relate to the LZW codes? If so, how should I interpret it?
Sorry for all the questions. Thank you for your time.
As a side-note: Even a partial answer or an answer to any of the questions would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GIF 应用 LZW 算法,代码大小可变(增加):
在 维基百科 LZW 中进行了描述。 “初始位数”是初始
代码的大小。
您参考的文档对此进行了描述。颜色代码列表
像素是 LZW 压缩的(您引用的部分上方的“a”段落)。
它位于文件(第 30 页;-)接近末尾的位置,只需搜索
“可变长度代码 LZW 压缩”)
“数据子块”是 255(或更少字节)块中的实际图像数据。
也许
“如何计算数据子块的大小?”见上文。它是第一个字节
每个块。
见上文。
GIF applies the LZW algorithm with a variable (increasing) size of codes as
described in Wikipedia LZW. The 'initial number of bits' is the initial
size of the codes.
This is described in the document you refer to. The list of color codes of the
pixels is LZW compressed (paragraph "a" just above the part you are citing).
It is there in the file (on page 30 ;-) near the end, just search for
"Variable-Length-Code LZW Compression")
The "data sub-blocks" are the actual image data in chunks of 255 (or less bytes).
Maybe the
"How do I work out the size of the data sub-blocks?" See above. It is the first byte of
each of the blocks.
See above.