feat(jpeg_decode): Add support for default Huffman tables

- In case of a missing Huffman table, while decoding a JPEG image
    - Define a default Huff table and add it to JPEG image header
This commit is contained in:
peter.marcisovsky
2025-02-14 18:55:34 +01:00
parent 4cdd5087ef
commit 146c1d72c0
6 changed files with 85 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ typedef struct {
uint8_t huffbits[2][2][JPEG_HUFFMAN_BITS_LEN_TABLE_LEN]; // Huffman bit distribution tables [id][dcac]
uint8_t huffcode[2][2][JPEG_HUFFMAN_AC_VALUE_TABLE_LEN]; // Huffman decoded data tables [id][dcac]
uint32_t tmp_huff[JPEG_HUFFMAN_AC_VALUE_TABLE_LEN]; // temp buffer to store huffman code
bool dht_marker; // If we have Huffman table present in header
uint16_t ri; // Restart interval
} jpeg_dec_header_info_t;