jpeg - Fewer than 4 huffman tables in a JPEG file?
问题描述
So I've been attempting to write my own JPEG decoder (In Lua for the ROBLOX platform if that's of any use) and in every guide I find online, it always uses an example where the image has 4 distinct Huffman tables. 1 for DC Luminance, 1 for AC Luminance, 1 for DC Chrominance, and 1 for AC Chrominance. When this is the case, my decoder works fine and everything is happy and nice. However when trying to decode some random jpeg images off the internet, I find that a lot of them have fewer than 4 Huffman tables, and in these cases my decoder fails miserably. I've tried researching for if there are some standard Huffman tables I should use as defaults for when the other tables aren't present, or if I should instead use a duplicate of one of the tables as a replacement for the missing ones, but I have come up empty handed. Any help on the subject would be greatly appreciated, thank you!
解决方案
Okay so thank you to DaBler in explaining this to me in the comments on my original question, it was extremely helpful.
Apparently you can have multiple Huffman Tables under one DHT marker, which I did not know. I'll see if I can get it working and thank you for the help!
推荐阅读
- python - 使用 pydub 访问 ffprobe
- java - 传递包含空格的争论的Java运行时问题?
- javascript - d3中的水平分割条形图
- amazon-web-services - 带有 BitBucket 源的 AWS CodePipeline
- kotlin - 如何将此代码更改为 kotlin 以查看来自 firebase 数据库的 pdf
- python - 如何向上搜索目录?我可以 os.walk 向上到文件系统的根目录吗?
- google-cloud-platform - e2 媒体的购买承诺
- node.js - NodeJS Express 无法在 https 上下载文件
- python - Pygame 和 pygame.time.wait() 函数以一种奇怪的方式工作
- c# - 如何知道 Google PubSub 订阅者是否已断开连接