DHT에는 1 비트에서 16 비트까지 각 길이의 허프만 코드로 인코딩 된 값의 개수가 포함 된 16 바이트가 포함되어 있습니다. 그런 다음 인코딩 된 실제 값을 포함하며이 값은 모두 8 비트 크기입니다.JPEG의 DHT에는 실제 허프만 코드가 들어 있지 않습니다. 어떻게됩니까?
Q : 왜 huffman 코드가 저장되어 있지 않은가, 디코더가 코드를 어떻게 파생 시키나요?
Q : 3 비트 길이의 허프만 코드가있는 4 개의 값이 있으면 4 바이트로 기록해야합니다. 그들이 어떤 순서로 존재하는지 또는 오름차순 또는 내림차순으로 있어야하는지가 중요합니까? 그 값들이 1 비트 허프만 코드를 갖는 값들에 2 비트 허프만 코드 e.t.c를 갖는 값들이 뒤따라 오도록 그 값들이 순서대로되어야한다는 것을 알 수있다.
Q : 저는 jpegsnoop을 사용하여 다른 파일의 huffman 테이블을 보았습니다. 일부는 MS 페인트로 만들어졌으며 일부는 다운로드되었습니다. 나는 그들이 모두 같은 테이블을 가지고있는 것을 발견했다. 여기
내가 JPEG의 스눕에서받은 DHT 항목은 다음과 같습니다
Destination ID = 1
Class = 1 (AC Table)
Codes of length 01 bits (000 total):
Codes of length 02 bits (002 total): 00 01
Codes of length 03 bits (001 total): 02
Codes of length 04 bits (002 total): 03 11
Codes of length 05 bits (004 total): 04 05 21 31
Codes of length 06 bits (004 total): 06 12 41 51
Codes of length 07 bits (003 total): 07 61 71
Codes of length 08 bits (004 total): 13 22 32 81
Codes of length 09 bits (007 total): 08 14 42 91 A1 B1 C1
Codes of length 10 bits (005 total): 09 23 33 52 F0
Codes of length 11 bits (004 total): 15 62 72 D1
Codes of length 12 bits (004 total): 0A 16 24 34
Codes of length 13 bits (000 total):
Codes of length 14 bits (001 total): E1
Codes of length 15 bits (002 total): 25 F1
Codes of length 16 bits (119 total): 17 18 19 1A 26 27 28 29 2A 35 36 37 38 39 3A 43
44 45 46 47 48 49 4A 53 54 55 56 57 58 59 5A 63
64 65 66 67 68 69 6A 73 74 75 76 77 78 79 7A 82
83 84 85 86 87 88 89 8A 92 93 94 95 96 97 98 99
9A A2 A3 A4 A5 A6 A7 A8 A9 AA B2 B3 B4 B5 B6 B7
B8 B9 BA C2 C3 C4 C5 C6 C7 C8 C9 CA D2 D3 D4 D5
D6 D7 D8 D9 DA E2 E3 E4 E5 E6 E7 E8 E9 EA F2 F3
F4 F5 F6 F7 F8 F9 FA
Total number of codes: 162
그리고
Destination ID = 1
Class = 0 (DC/Lossless Table)
Codes of length 01 bits (000 total):
Codes of length 02 bits (003 total): 00 01 02
Codes of length 03 bits (001 total): 03
Codes of length 04 bits (001 total): 04
Codes of length 05 bits (001 total): 05
Codes of length 06 bits (001 total): 06
Codes of length 07 bits (001 total): 07
Codes of length 08 bits (001 total): 08
Codes of length 09 bits (001 total): 09
Codes of length 10 bits (001 total): 0A
Codes of length 11 bits (001 total): 0B
Codes of length 12 bits (000 total):
Codes of length 13 bits (000 total):
Codes of length 14 bits (000 total):
Codes of length 15 bits (000 total):
Codes of length 16 bits (000 total):
Total number of codes: 012
교류 테이블이 제로 런 길이와 AC 계수의 크기를 포함 RRRRSSSS를 압축 직류 표를 압축하는 동안 SSSS. 따라서 AC 테이블에는 총 255 개의 항목 (exlcuded 0)이 있어야하며 DC 테이블은 15 개의 항목 (0은 제외)이어야합니다. 그러나 어느 테이블도이 많은 수의 코드를 포함하지 않습니다. 왜?
itu t.81의 부록 K에있는 허프만 테이블에는 인코딩 할 수있는 모든 값이 있습니다. 그러나 위의 표에는 ac에 대해 256 개 미만의 항목과 dc에 대해 16 미만의 항목이 있습니다. 왜? 나는 연속 톤 이미지가 누락 된 코드로 압축 될 수 있다고 생각하지 않는다. – quantum231
당신은 값의 길이 만 인코딩하는 허프만입니다. – user3344003
그렇습니다. 그러나 연속 톤 이미지에서 모든 종류의 픽셀이 나타나고 ssss 및 rrrrssss의 모든 값이 필요합니다. – quantum231