# A Low-Complexity Lossless Compression Method Based on a Code Table for Infrared Images
## 2 Related Works  
The speed and efficiency of image compression are common objectives in both academia and industry. There are two main approaches to improving the encoder speed: hardware acceleration and designing low-complexity algorithms. The speed of the encoder is dependent on the processor's performance, and the slowdown in processor performance improvements has driven the development of parallel architecture processors. As a result, image encoding algorithms have transitioned from single-threaded to multi-threaded algorithms [23; 24]. However, in embedded platforms with limited hardware resources, it is crucial to design lossless compression algorithms with higher bit depths and lower computational complexity.  
The core of the method proposed in this article is Huffman coding. We researched and improved the Huffman code. Lossless data compression is based on information theory, with its theoretical limit being entropy [25]. Huffman coding needs to count the probability of occurrence of source symbols, assign shorter codes to the symbols with high probability and longer codes to those with low probability, thereby achieving entropy coding, which approximates the theoretical entropy value. Huffman coding requires two passes over the source data to build the frequency table and generate the code table. [PERSON] [26] proposed a dynamic Huffman algorithm to scan the data only once. However, with the constant modification of the Huffman tree as new symbols appear, the dynamic Huffman algorithm leads to a rapid increase in computational effort. This algorithm is not suitable for compressing large datasets with multiple source symbols. [PERSON]'s [27] canonical Huffman coding requires minimal data storage to reconstruct the Huffman tree. Unfortunately, both Huffman and canonical Huffman coding need to count the probability of symbol occurrence before compression, which seriously affects the compression speed. [PERSON] [28] improved compression speed by pre-allocating a Huffman code table. Nevertheless, this method requires offline data analysis to define the code table and is limited to 256 symbols, restricting its range of applications. [PERSON]'s [29] algorithm for dynamic code table enhances adaptability by increasing the number of code table. However, it requires evaluating the variance of symbol changes to reselect the code table each time, leading to high complexity and reduced compression speed. The code table method necessitates longer codes when compressing large datasets with multiple source symbols. Nonetheless, symbols corresponding to these longer codes typically have low occurrence probabilities, and constructing such long codes can adversely affect both the compression efficiency and processing speed. [PERSON] [30] proposed a truncated Huffman tree algorithm by only preserving codes with high-frequency occurrences, while symbols with low-frequency occurrences have no designated code. To distinguish between coded and uncoded bit streams, an extra 1-bit (0 or 1) is required, which increases the length of all encoded symbols by one bit and significantly degrades the compression performance. [PERSON]'s [31] modified adaptive Huffman coding algorithm adds unknown symbol nodes to achieve uniform coding without requiring additional 1-bit identifiers, but it suffers from high complexity.  
To reduce the algorithmic complexity, this paper proposes a novel method for constructing a Huffman code table that bypasses the process of calculating pixel occurrence probabilities in entropy coding. Additionally, an improved Huffman coding scheme is introduced to handle the longer codes required for 14-bit images by truncating longer codes with low complexity and minimal compression ratio loss. This ultimately achieves a low-complexity lossless compression method based on a code table for infrared images.