gpt4 book ai didi

jpeg - 处理填充/填充位熵编码的 JPEG

转载 作者:行者123 更新时间:2023-12-01 06:09:19 27 4
gpt4 key购买 nike

decoding entropy encoded DC values in JPEG (或 entropy encoded prediction differences in lossless JPEG ),如何区分已填充以填充标记前字节的 1 位和霍夫曼编码值?

例如,如果我看到:

0xAF 0xFF 0xD9

并且我已经使用了 [0xA] 中的位,我如何判断下一个 0xF 是被填充还是应该被解码?

这是来自 JPEG 规范:

F.1.2.3 Byte stuffing

In order to provide code space for marker codes which can be located in the compressed image data without decoding, byte stuffing is used.

Whenever, in the course of normal encoding, the byte value X’FF’ is created in the code string, a X’00’ byte is stuffed into the code string. If a X’00’ byte is detected after a X’FF’ byte, the decoder must discard it. If the byte is not zero, a marker has been detected, and shall be interpreted to the extent needed to complete the decoding of the scan.

Byte alignment of markers is achieved by padding incomplete bytes with 1-bits. If padding with 1-bits creates a X’FF’ value, a zero byte is stuffed before adding the marker.

最佳答案

压缩数据流中FF值只有两种可能。

  1. 重新启动标记;或
  2. FF00代表FF。

如果您正在解码流,您将从重启间隔知道何时需要重启标记。当您到达解码中应该找到重新开始标记的位置时,您将丢弃当前字节中的剩余位。

关于jpeg - 处理填充/填充位熵编码的 JPEG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27949420/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com