Decoding method, apparatus and display device for huffman coded image

By determining the ambiguity of the data to be decoded and identifying the true code length during JPEG image decoding, the problem of low efficiency in Huffman decoding is solved, and a more efficient decoding process is achieved.

CN115695822BActive Publication Date: 2026-04-10ZHUHAI JIELI TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies for decoding JPEG format images have low Huffman decoding efficiency, especially due to the bit-by-bit reading method that results in a large number of invalid comparisons and low decoding efficiency.

Method used

By determining whether the current group of data to be decoded in the data buffer is a polysemous word, if not, it is compared with multiple minimum codeword extension values ​​to determine the true code length and find the corresponding Huffman codeword; if it is a polysemous word, different decoding methods are used to reduce invalid comparisons.

Benefits of technology

It improves the decoding efficiency of Huffman-coded images, reduces the number of invalid comparisons during the decoding process, and enhances the overall decoding speed and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695822B_ABST
    Figure CN115695822B_ABST
Patent Text Reader

Abstract

The application discloses a decoding method and device of a Huffman coded image and a display device. Whether the current group of data to be decoded in a data buffer is a polysemy is judged. If not, the current group of data to be decoded is compared with one of a plurality of minimum code word extension values in sequence. If the current group of data to be decoded is smaller than a certain minimum code word extension value, the comparison is stopped, a previous code word extension value of the certain code word extension value is taken as a first minimum code word extension value, a first real code length corresponding to the first minimum code word extension value is found in a mapping relationship, and bit data with the first real code length is read from the current group of data to be decoded as a first Huffman code word. In the embodiment of the application, the data to be decoded is first distinguished, the real code length of the current group of data to be decoded is determined after it is determined that the data to be decoded is not a polysemy, the number of invalid comparisons in the decoding process is reduced, and the decoding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, and in particular to a decoding method, device and equipment for Huffman coded images. BACKGROUND

[0002] In the process of decoding JPEG format images, a key step is Huffman decoding, which determines the image decoding efficiency. Huffman coding is variable length coding, which constructs code words with the shortest average length of different prefixes according to character occurrence probability. If the probability of character occurrence is higher, the length of the corresponding Huffman code is shorter. In the process of Huffman decoding, since the actual code length is unknown, a method of decoding by reading the to-be-decoded data bit by bit (hereinafter referred to as bit-by-bit decoding) is usually used, that is, one bit of the to-be-decoded data is read each time, and x bits B1B2…Bx are added to form B1B2…Bx+1 as a whole, and then the same code word is searched in the Huffman coding table. If found, the B1B2…Bx+1 is the actual code word of the to-be-decoded data, and x+1 is the code length of the to-be-decoded data; if not found, the x+2 bit Bx+2 of the to-be-decoded data is read and added to the x bits B1B2…Bx to form B1B2…Bx+2 as a whole, and then the same code word is searched in the Huffman coding table. x B1B2…Bx+1 as a whole. x B1B2…Bx+1 as a whole. x+1 B1B2…Bx+1 as a whole. x B1B2…Bx+1 as a whole. x+1 B1B2…Bx+1 as a whole. x B1B2…Bx+1 as a whole. x+1 B1B2…Bx+1 as a whole. X+2 B1B2…Bx+1 as a whole. x B1B2…Bx+1 as a whole. x+1 B1B2…Bx+1 as a whole. x B1B2…Bx+1 as a whole. x+1 B1B2…Bx+1 as a whole. x+2 B1B2…Bx+1 as a whole. x B1B2…Bx+1 as a whole. x+1 B1B2…Bx+1 as a whole. x+2 Usually, each code length corresponds to multiple code words (for example, the code words with a code length of 2 are 00 and 01), in order to realize decoding, if the code words are compared one by one from the code words with small code lengths with the corresponding bit number of the to-be-decoded data, the decoding efficiency is low.

[0003] In order to improve the decoding efficiency, the prior art proposes a technical solution: comparing the fixed length to-be-decoded data with the minimum code word extension value corresponding to each code length respectively, when the to-be-decoded code word is smaller than the minimum code word extension value corresponding to any one of the code lengths, determining the effective code length of the to-be-decoded code word, and according to the effective code length, searching the decoding code word corresponding to the effective code length from the corresponding relationship between the code length and the decoding code word, to realize the decoding scheme, however, the efficiency of this scheme still has room for improvement. SUMMARY

[0004] Based on the above status, the main purpose of the present application is to provide a decoding method, device and equipment of Huffman coding image, first, the to-be-decoded data is distinguished, and it is determined that it is not a polysemy word, and then the real code length of the current group of to-be-decoded data is determined, the number of invalid comparisons in the decoding process is reduced, and the decoding efficiency is improved.

[0005] In order to achieve the above purpose, the technical scheme adopted by the present application is as follows:

[0006] A decoding method of Huffman coding image, comprising the following steps:

[0007] S100, judging whether the current group of to-be-decoded data in the data buffer is a polysemy word, if not, executing S200, if yes, executing S300; wherein the length of each group of to-be-decoded data is a preset length;

[0008] S200, comparing the current group of to-be-decoded data with one of a plurality of minimum code word extension values in turn, if the current group of to-be-decoded data is smaller than a certain minimum code word extension value, stopping the comparison, taking the previous code word extension value of the certain code word extension value as the first minimum code word extension value, and finding the first real code length corresponding to the first minimum code word extension value in the mapping relationship, and reading the bit data with the first real code length from the current group of to-be-decoded data as the first Huffman code word; wherein the mapping relationship is the correspondence between each minimum code word extension value and the corresponding real code length, and the plurality of minimum code word extension values are obtained by filling 0 to the right of the corresponding Huffman code word to the preset length;

[0009] S300, decoding in a manner different from S200 according to the real meaning of the polysemy word.

[0010] Preferably, S300 comprises judging whether the next group of to-be-decoded data is a hexadecimal value 00;

[0011] If yes, judging that the real meaning of the polysemy word is a component of the Huffman code word, and starting to decode bit by bit from the Kth bit of the to-be-decoded data composed of the current group of to-be-decoded data and the next group of to-be-decoded data; wherein K is equal to the preset length plus 1;

[0012] If not, judging that the real meaning of the polysemy word is a component of the marker code, and composing a marker code with the polysemy word and the next group of to-be-decoded data, and decoding according to the real meaning of the marker code.

[0013] Preferably, the following steps are further included after S200:

[0014] S400, finding the decoding value corresponding to the first Huffman code word, and obtaining the first bit length by analyzing the decoding value.

[0015] S500, reading the bit data of the first bit length from after the first Huffman code word in the data buffer as quantized value data of the decoding value.

[0016] Preferably, after the S500, the method further comprises the following steps:

[0017] S600, if the sum of the real code length of the first Huffman code word and the first bit length is not equal to an integer multiple of the preset length, judging whether the next group of to-be-decoded data after the bit data of the first bit length in the data buffer is the ambiguous word, and if not, performing step S700;

[0018] S700, reading the preset length of to-be-decoded data from the (M+N+1)th bit in the data buffer starting from the first bit data of the current group of to-be-decoded data to form cross-group to-be-decoded data; wherein M is the first real code length, and N is the first bit length.

[0019] Comparing the cross-group to-be-decoded data with one of a plurality of minimum code word extension values in sequence, if the current group of to-be-decoded data is less than a certain minimum code word extension value, stopping the comparison, taking the previous code word extension value of the certain minimum code word extension value as a second minimum code word extension value, finding a second real code length corresponding to the second minimum code word extension value in the mapping relationship, and reading bit data of the second real code length from the cross-group to-be-decoded data as a second Huffman code word.

[0020] Preferably, in the S600, if the next group of to-be-decoded data is the ambiguous word, performing S800;

[0021] S800, bit-by-bit decoding the bit data between the bit data of the first bit length and the next group of to-be-decoded data from the (M+N+1)th bit in the data buffer starting from the first bit data of the current group of to-be-decoded data.

[0022] Preferably, the mapping relationship comprises a first sub-mapping relationship and a second sub-mapping relationship, the first sub-mapping relationship is a relationship between the minimum code word extension value and an index, and the second sub-mapping relationship is a relationship between the index and the real code length.

[0023] The finding of the first real code length corresponding to the first minimum code word extension value in the mapping relationship comprises:

[0024] S210, finding an index of the first minimum code word extension value corresponding to the current group of to-be-decoded data in the first sub-mapping relationship.

[0025] S220, according to the index, searching the corresponding first real code length of the current group of to-be-decoded data in the second sub-mapping relationship.

[0026] Preferably, in the S400, the decoding value corresponding to the first Huffman code word is searched by the following steps:

[0027] S410, determining a first address according to the first real code length, the first address being the address of the minimum Huffman code word with the code length equal to the first real code length in a Huffman coding table, the Huffman coding table being used to store the decoding values corresponding to the Huffman code words;

[0028] S420, calculating the difference value between the first Huffman code word and the minimum Huffman code word as an address offset value;

[0029] S430, determining a second address by offsetting the first address by the address offset value, and reading the value in the second address as the decoding value of the first Huffman code word.

[0030] Preferably, in the S200, if the current group of to-be-decoded data is greater than any minimum code word expansion value, in the second sub-mapping relationship, a third real code length corresponding to the maximum index is searched; bit data with the length of the third real code length is read from the current to-be-decoded data, and if the bit data with the length of the third real code length is not greater than the maximum Huffman code word, the bit data with the length of the third real code length is taken as the first Huffman code word, the maximum Huffman code word being the maximum value of the Huffman code words with the real code length of the third real code length.

[0031] Preferably, if the bit data with the length of the third real code length is greater than the maximum Huffman code word, the to-be-decoded data is decoded bit by bit from the Kth bit, where K is equal to the preset length plus 1.

[0032] The application further provides a decoding device for a Huffman coded image, comprising:

[0033] A first ambiguous word judging module is configured to judge whether the current group of to-be-decoded data in the data buffer is an ambiguous word, and if not, trigger the first decoding module to work, and if yes, trigger the second decoding module to work.

[0034] The first decoding module compares the current group of data to be decoded with one of a plurality of minimum code word extension values in sequence, stops the comparison if the current group of data to be decoded is smaller than a certain minimum code word extension value, takes the previous code word extension value of the certain code word extension value as a first minimum code word extension value, and finds a first real code length corresponding to the first minimum code word extension value in a mapping relationship, and reads bit data with the first real code length from the current group of data to be decoded as a first Huffman code word; wherein the mapping relationship is a corresponding relationship between each minimum code word extension value and a corresponding real code length, and the plurality of minimum code word extension values are obtained by filling 0 to the preset length on the right side of the corresponding Huffman code word.

[0035] The second decoding module is configured to decode the polysemous word according to the real meaning in a manner different from that of the first decoding module.

[0036] Preferably, the second decoding module further comprises a numerical zero detection unit configured to determine whether the next group of data to be decoded is a hexadecimal numerical value 00.

[0037] If yes, it is determined that the real meaning of the polysemous word is a component of a Huffman code word, and the polysemous word is decoded bit by bit from the Kth bit of the to-be-decoded data composed of the current group of data to be decoded and the next group of data to be decoded; wherein K is equal to the preset length plus 1.

[0038] If no, it is determined that the real meaning of the polysemous word is a component of a marker code, and the polysemous word and the next group of data to be decoded are combined to form a marker code, and the marker code is decoded according to the real meaning.

[0039] Preferably, the system further comprises a quantization value data acquisition module, which works after the first decoding module works, and is configured to:

[0040] find a decoding value corresponding to the first Huffman code word, and parse the decoding value to obtain a first bit length;

[0041] read bit data with the first bit length from the data buffer after the first Huffman code word as quantization value data of the decoding value.

[0042] Preferably, the system further comprises a third decoding module, which works after the quantization value data acquisition module works, and is configured to:

[0043] If the sum of the real code length of the first Huffman code word and the first bit length is not equal to an integer multiple of the preset length, it is determined whether the next group of data to be decoded after the bit data with the first bit length in the data buffer is the polysemous word, if not the polysemous word,

[0044] read the preset length of the to-be-decoded data from the (M+N+1)th bit in the data buffer, starting from the first bit of the current group of to-be-decoded data, to form cross-group to-be-decoded data, wherein M is the first real code length, and N is the first bit length;

[0045] compare the cross-group to-be-decoded data with one of a plurality of minimum code word extension values in sequence, if the current group of to-be-decoded data is smaller than a certain minimum code word extension value, stop the comparison, take the previous code word extension value of the certain minimum code word extension value as a second minimum code word extension value, find a second real code length corresponding to the second minimum code word extension value in the mapping relationship, and read bit data with the length of the second real code length from the cross-group to-be-decoded data as a second Huffman code word.

[0046] Preferably, if the next group of to-be-decoded data is the ambiguous word, bit data between the first bit length of bit data and the next group of to-be-decoded data is decoded bit by bit, starting from the (M+N+1)th bit in the data buffer, starting from the first bit of the current group of to-be-decoded data.

[0047] Preferably, the mapping relationship includes a first sub-mapping relationship and a second sub-mapping relationship, the first sub-mapping relationship is the relationship between the minimum code word extension value and the index, and the second sub-mapping relationship is the relationship between the index and the real code length,

[0048] The finding of the first real code length corresponding to the first minimum code word extension value in the mapping relationship includes:

[0049] finding the index of the first minimum code word extension value corresponding to the current group of to-be-decoded data in the first sub-mapping relationship;

[0050] According to the index, find the first real code length corresponding to the current group of to-be-decoded data in the second sub-mapping relationship.

[0051] Preferably, the quantization value data acquisition module finds the decoding value corresponding to the first Huffman code word by the following steps: determining a first address according to the first real code length, the first address is the address of the minimum Huffman code word with the code length equal to the first real code length in the Huffman coding table, and the Huffman coding table is used to store the decoding value corresponding to the Huffman code word;

[0052] Calculate the difference between the first Huffman code word and the minimum Huffman code word as an address offset value;

[0053] A second address is determined by offsetting the first address by the address offset value, and a value in the second address is read as a decoding value of the first Huffman code word.

[0054] Preferably, the first decoding module is further configured to, if the current group of to-be-decoded data is greater than any minimum code word extension value, in the second sub-mapping relationship, find a third real code length corresponding to a maximum index; read bit data with the third real code length from the current group of to-be-decoded data, and if the bit data with the third real code length is not greater than a maximum Huffman code word, take the bit data with the third real code length as a first Huffman code word, the maximum Huffman code word being a maximum value of a Huffman code word with the third real code length.

[0055] Preferably, if the bit data with the temporary code length is greater than the maximum Huffman code word, start bit-by-bit decoding from a Kth bit of to-be-decoded data composed of the current group of to-be-decoded data and the next group of to-be-decoded data, where K is equal to the preset length plus 1.

[0056] The application further provides an embedded display device which adopts any of the methods for decoding a Huffman coded image or comprises any of the decoding apparatuses.

[0057] The application further provides a computer readable storage medium having a computer program stored thereon, the computer program being executable to implement any of the methods.

[0058] The application further provides a decoding chip comprising a processor and a memory, the memory storing a computer program, and the processor being capable of executing the computer program to implement any of the methods.

[0059] According to the decoding method, apparatus and device for a Huffman coded image disclosed in the embodiments of the application, whether the current group of to-be-decoded data in the data buffer is an ambiguous word is judged, if not, the current group of to-be-decoded data is compared with each minimum code word extension value in turn, and if the current group of to-be-decoded data is smaller than a certain minimum code word extension value, the comparison is stopped, a previous code word extension value of the certain code word extension value is taken as a first minimum code word extension value, a first real code length corresponding to the first minimum code word extension value is found in a mapping relationship, and bit data with the first real code length is read from the current group of to-be-decoded data as a first Huffman code word. The embodiments of the application first distinguish the to-be-decoded data, determine that the to-be-decoded data is not an ambiguous word, then determine a real code length of the current group of to-be-decoded data, reduce the number of invalid comparisons in the decoding process, and improve the decoding efficiency.

[0060] Other beneficial effects of the present application will be illustrated in the detailed description of the embodiments by introducing specific technical features and technical solutions, which should be understood by those skilled in the art to bring about the beneficial technical effects. BRIEF DESCRIPTION OF DRAWINGS

[0061] The preferred embodiments of the decoding method, device and equipment of the Huffman coded image will be described below with reference to the accompanying drawings. In the drawings:

[0062] Figure 1 The flow chart of the decoding method of the Huffman coded image according to a preferred embodiment of the present application;

[0063] Figures 2a to 2d The schematic diagram of the data buffer in the decoding method of the Huffman coded image according to a preferred embodiment of the present application;

[0064] Figure 3 The flow chart of the decoding method of the Huffman coded image according to another preferred embodiment of the present application;

[0065] Figure 4a The schematic diagram of the first sub-mapping relationship in the decoding method of the Huffman coded image according to a preferred embodiment of the present application;

[0066] Figures 4b to 4c The schematic diagram of the second sub-mapping relationship in the decoding method of the Huffman coded image according to a preferred embodiment of the present application;

[0067] Figure 5a The schematic diagram of the first sub-mapping relationship in the decoding method of the Huffman coded image according to a preferred embodiment of the present application;

[0068] Figure 5b The schematic diagram of the second sub-mapping relationship in the decoding method of the Huffman coded image according to a preferred embodiment of the present application;

[0069] Figure 6 The flow chart of the decoding method of the Huffman coded image according to a preferred embodiment of the present application. DETAILED DESCRIPTION

[0070] The present application will be described below based on the embodiments, but the present application is not limited to these embodiments only. In the following detailed description of the present application, some specific details are described in detail, in order to avoid confusion of the essence of the present application, the well-known methods, processes, flows, elements are not described in detail.

[0071] Moreover, those skilled in the art will appreciate that the accompanying drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.

[0072] Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is to say, in the sense of "including, but not limited to".

[0073] In the description of the application, it should be understood that the terms "first", "second" and the like are used to describe purposes only, and cannot be understood as indicating or implying relative importance. In addition, in the description of the application, the meaning of "a plurality of" is two or more, unless otherwise stated.

[0074] There can be ambiguous words representing multiple meanings in the code stream of Huffman coded images (such as images in jpeg format), for example, 0xFF (representing the hexadecimal number "FF", and the number starting with 0x below represents the hexadecimal number), which can be part of a two-byte marker code, such as marker code 0xFFD8 representing the image start bit flag, marker code 0xFFFE representing the annotation, etc. The 0xFF can also be part of a Huffman code word (i.e. the 0xFF is part of a two-byte compressed code stream generated by Huffman coding, such as 0xFF00). When decoding, if the data to be decoded is 0xFF, it is necessary to further judge whether the 0xFF is part of a marker code or part of a Huffman code word.

[0075] The present application discloses a decoding method of a Huffman coded image, referring to Figure 1 and Figure 2a , Figure 1 is a flowchart of a decoding method of a Huffman coded image in the present embodiment. Figure 2a A schematic diagram of data processing in a data buffer and a decoder is shown, which decodes in units of MCUs (Minimum Coding Units), and it is assumed that there are currently 8 groups of data to be decoded, A1-A8, 4 groups of data to be decoded A1-A4 are stored in the data buffer, and the current group of data to be decoded currently being decoded by the decoder is A1. Among them, the length of each group of data to be decoded is a preset length, and the value of the preset length can be determined according to the probability of occurrence of Huffman code words, for example, if the probability of occurrence of Huffman code words with a code length less than 8 bits is greater than 70%, the preset length can be 8 bits, and the preset length in the present embodiment is 8 bits.

[0076] The decoding method of the Huffman coded image comprises the following steps:

[0077] S100, judging whether the current group of data to be decoded in the data buffer is an ambiguous word, if not, executing S200, if yes, executing S300; wherein the length of each group of data to be decoded is a preset length;

[0078] S200, comparing the current group of data to be decoded with one of a plurality of minimum code word extension values in turn, i.e. comparing in the order of minimum code word extension values from small to large, if the current group of data to be decoded A1 is smaller than a certain minimum code word extension value, stopping the comparison, taking the previous code word extension value of the certain code word extension value as the first minimum code word extension value, and finding the first real code length corresponding to the first minimum code word extension value in the mapping relationship, and reading the bit data with the length of the first real code length from the current group of data to be decoded A1 as the first Huffman code word.

[0079] wherein the mapping relationship is the correspondence between each minimum code word extension value and the corresponding real code length, the plurality of minimum code word extension values are obtained by filling 0 to the preset length on the right side of the corresponding Huffman code word, and the corresponding Huffman code word refers to the minimum code word with the code length n, for example, in the case of a preset length of 8 bits, the minimum Huffman code word corresponding to the code length 2 is 00, and the minimum code word extension value corresponding to the minimum Huffman code word 00 is 0000 0000; the minimum Huffman code word corresponding to the code length 3 is 100, and the minimum code word extension value corresponding to the minimum Huffman code word 100 is 1000 0000, and if the code length is 8, there is no need to fill 0, and the minimum Huffman code word is equal to the minimum code word extension value.

[0080] S300, decoding according to the real meaning of the ambiguous word in a manner different from S200.

[0081] The specific decoding manner can adopt a bit-by-bit decoding manner, or other decoding manners, which are not limited here. As shown in Figure 2a in some embodiments, S300 includes judging whether the next group of data to be decoded A2 is the hexadecimal value 00; if yes, judging that the real meaning of the ambiguous word is a component of the Huffman code word, and starting to decode from the Kth bit (the 9th bit) of the to-be-decoded data (0xFF72) composed of the current group of data to be decoded A1 and the group of data to be decoded A3 (0x72) in turn; wherein K is equal to the preset length plus 1. As shown in Figure 2b if the next group of data to be decoded is not the hexadecimal value 00, judging that the real meaning of the ambiguous word is a component of the marker code, and composing the marker code according to the ambiguous word (0xFF) and the next group of data to be decoded (0xDB), and decoding according to the real meaning of the marker code (0xFFDB), such as the meaning of the marker code 0xFFDB is a quantization table, and turning to the quantization table processing program for processing.

[0082] In this embodiment, if the determination of whether the current group of data to be decoded, A1, is not first performed to determine if it is a polysemous word, and instead the decoding is directly performed according to step S200, and after comparing the current group of data to be decoded, A1, with all minimum codeword extension values, the first minimum codeword extension value is still not found (the number of comparisons is equal to the preset length), then determining whether the current group of data to be decoded, A1, is a polysemous word and finding that the current group of data to be decoded is a component of a marker code, rather than a component of a Huffman codeword, then the aforementioned multiple comparisons assuming the current group of data to be decoded, A1, to be decoded as a Huffman codeword become useless and redundant, i.e., invalid, resulting in low decoding efficiency. However, in the actual solution of this embodiment, the determination of whether the current group of data to be decoded, A1, in the data buffer is a polysemous word is first performed. If it is not a polysemous word, then the decoding is performed according to step S200; if it is a polysemous word, then the decoding is performed according to step S300. This effectively avoids the aforementioned invalid comparison counts and improves decoding efficiency. Figure 3 As shown, after determining the first Huffman codeword, it is necessary to further solve for the corresponding decoded value to determine the quantized value data. Specifically, this includes the following steps: S400, finding the decoded value corresponding to the first Huffman codeword and parsing the decoded value to obtain the first bit length; S500, reading the first bit length of bit data from the data buffer after the first Huffman codeword as the quantized value data of the decoded value. For example, as... Figure 2c As shown, the current group of data to be decoded, A1, is 1110 0011, and the next group of data to be decoded, A2, is 10010010. Step S400 is executed to solve for the first Huffman codeword, which is 111000. The corresponding decoded value is found to be the hexadecimal value 06. Based on the decoded value, the run length is calculated to be 0, and the bit width occupied by the non-zero coefficients is 6, where the bit width occupied by the non-zero coefficients is the first bit length. Step S500 is executed to read the first bit length (6 bits) of bit data (111001) from the data buffer after the first Huffman codeword (111000) as the non-zero quantized value data of the decoded value (hexadecimal value 06).

[0083] Please continue to refer to this. Figure 2c and Figure 3After the first group of to-be-decoded data completes the decoding steps described above, S600 is executed. If the sum of the first real code length (6) of the first Huffman code word and the first bit length (6) is not equal to an integer multiple of the preset length (8), it is determined whether the next group of to-be-decoded data A3 (10010010) after the bit data of the first bit length in the data buffer is an ambiguous word. If it is not an ambiguous word, step S700 is executed. S700 reads a preset length of to-be-decoded data from the data buffer starting from the (M+N+1)th bit (the 13th bit in this embodiment) of the first bit data of the current group of to-be-decoded data to form cross-group to-be-decoded data (0010 1001); where M is the first real code length (6), and N is the first bit length (6). The cross-group to-be-decoded data is compared with one of a plurality of minimum code word extension values in sequence. If the current group of to-be-decoded data is smaller than a certain minimum code word extension value, the comparison is stopped, the certain minimum code word extension value is taken as a previous code word extension value, a second minimum code word extension value, and a second real code length corresponding to the second minimum code word extension value is found in the mapping relationship, and bit data of the second real code length is read from the cross-group to-be-decoded data as a second Huffman code word. The method for solving the quantization value data of the second Huffman code word is the same as that for solving the quantization value data corresponding to the first Huffman code word, and will not be described again here.

[0084] As shown in Figure 2d S800, the bit data (0010) between the bit data of the first bit length and the next group of to-be-decoded data A3 is decoded from the (M+N+1)th bit (the 13th bit) of the first bit data of the current group of to-be-decoded data in the data buffer.

[0085] In some embodiments, the real code length of a Huffman code word is not continuous. For example, the real code length of a Huffman code word less than the preset length (such as the preset length being 8) includes 2, 3, 4, 5, 7, and 8. That is, there is no Huffman code word with a code length of 1 or 6. If it is solved in step S200 that the to-be-decoded data is smaller than the first minimum code word extension value corresponding to the real code length of 7, it can only be determined that the real code length of the to-be-decoded data is less than 7, but the real code length of the to-be-decoded data cannot be directly determined. If it is directly determined that the real code length of the to-be-decoded data is 6, a decoding error occurs. To solve the above problem, the mapping relationship in step S200 includes a first sub-mapping relationship (as shown in Figure 4a and a second sub-mapping relationship (as shown in Figure 4bThe first sub-mapping relationship is the relationship between the minimum code word extension value (denoted as p_cw[idx]) and the index (denoted as idx), and the second sub-mapping relationship is the relationship between the index idx and the real code length (for the convenience of understanding, the values of the real code length are listed in Figure 4a 、 Figure 5a and Figure 5b . The values of the real code length do not actually exist in the first sub-mapping relationship of Figure 4a 、 Figure 5a and Figure 5b . Specifically, S200 includes: step S210, finding the index of the first minimum code word extension value corresponding to the current group of to-be-decoded data A1 in the first sub-mapping relationship. If the value of the current group of to-be-decoded data A1 is less than p_cw[4], it is known that the real code length of the current group of to-be-decoded data A1 is less than the real code length corresponding to idx=4, that is, the real code length in the current group of to-be-decoded data A1 is the real code length corresponding to the index idx=3 (i.e., the previous code word extension value corresponding to p_cw[4]), and step S220 is continued. S220, according to the index, finding the corresponding real code length of the current group of to-be-decoded data A1 in the second sub-mapping relationship. Specifically, according to the index idx=3, the real code length corresponding to idx=3 is found to be 5 in the second sub-mapping relationship, and the real code length in the to-be-decoded data is determined. In order to facilitate the subsequent further solving of the decoding value of the Huffman code word, in other embodiments, the second sub-mapping relationship is the relationship between the index value idx and the value (denoted as p_len[idx]) corresponding to the real code length (as shown in Figure 4c , wherein the value of p_len[idx] is equal to the value of the real code length minus 1. In some embodiments, finding the decoding value corresponding to the first Huffman code word includes the following steps: S410, determining the first address according to the real code length, the first address being the address (denoted as hpos) of the minimum Huffman code word with the code length equal to the real code length in the Huffman coding table, wherein the Huffman coding table is used to store the decoding value corresponding to the Huffman code word. S420, calculating the difference between the first Huffman code word (denoted as tdat) and the minimum Huffman code word (denoted as hmin) as an address offset value. S430, determining the second address (denoted as code_pos, code_pos=hpos+(tdat-hmin)) by offsetting the first address by the address offset value to read the value in the second address as the decoding value of the first Huffman code word.

[0086] In step S200, if the current group of to-be-decoded data A1 is greater than any minimum code word extension value stored in the first sub-mapping relationship, it is further determined whether the real code length of the Huffman code word in the to-be-decoded data is equal to the maximum value of the real code length in the preset length range or greater than the preset length. Please refer to Figure 5a and Figure 5b , Figure 5aFor the first sub-mapping relationship, the index is denoted as idx, and the minimum code word extension value is denoted as p_cw[idx], Figure 5b For the second sub-mapping relationship, the value corresponding to the real code length is denoted as p_len[idx] (equal to the real code length minus 1), and the preset length is 8. In this embodiment, the number of Huffman code words with a real code length of 8 is 0, and the maximum value of the real code length in the preset length range is 7. In order to facilitate indexing, the number of indexes of the first sub-mapping relationship and the second sub-mapping relationship is uniformly extended to the preset length in this embodiment, so that the third real code length corresponding to the maximum index is the value corresponding to the maximum real code length in the preset range. Specifically, the extension of the first sub-mapping relationship is to copy the maximum value of the minimum code word extension value in the preset range to the minimum code word extension value corresponding to the remaining indexes, that is, p_cw[7] = p_cw[6] = p_cw[5] = p_cw[4] = 11110000. Correspondingly, in the second sub-mapping relationship, p_len[7] = p_len[6] = p_len[5] = p_len[4] = 6. Therefore, the maximum value of the minimum code word extension value in the first sub-mapping relationship is p_cw[7], and the value corresponding to the maximum real code length in the preset length range in the second sub-mapping relationship is the value corresponding to the maximum index p_len[7]. In the second sub-mapping relationship, the third real code length (p_len[7]) corresponding to the maximum index (idx = 7) is found; the bit data with the third real code length is read from the current to-be-decoded data A1, and if the bit data with the third real code length is not greater than the maximum Huffman code word (the maximum value in the Huffman code word with a real code length of 7), the bit data with the third real code length is taken as the first Huffman code word.

[0087] If the real code length corresponding to the current group of to-be-decoded data is less than the preset length, after the first Huffman code word is decoded, the bit data read more than once last time is returned to the to-be-decoded data, and the to-be-decoded data that has not yet started decoding is continuously decoded.

[0088] If the bit data with the third real code length is greater than the maximum Huffman code word, the decoding starts from the Kth bit (the 9th bit) of the to-be-decoded data composed of the current group of to-be-decoded data and the next group of to-be-decoded data, where K is equal to the preset length plus 1.

[0089] If the Huffman code words in the preset length range are not used when reading the Huffman coding table, if the preset length is equal to 8, and the Huffman code word with the real code length less than or equal to 8 does not exist, then each bit of the extension value of each minimum code word in the preset length range in the mapping relationship is assigned as 0 (for example, if the preset length is 8, then 8 bits of 0 are assigned), and the real code length in the second sub-mapping relationship is also assigned as 0 (correspondingly, each element of p_len[idx] is assigned as -1). After reading the current group of to-be-decoded data from the data buffer, the current group of to-be-decoded data is compared with the plurality of minimum code word extension values in sequence, if the current group of to-be-decoded data is greater than any minimum code word extension value, the real code length corresponding to the index value of the maximum value in the second sub-mapping relationship is found, if the real code length corresponding to the index value is 0 (or p_len[7] is -1), then it is judged that the Huffman code word in the code length range of 1-8 does not exist, and the data is decoded from the (9) bit of the preset length plus 1 in sequence. If the real code length corresponding to the index value is not 0, then the third real code length corresponding to the maximum index is found; the bit data with the length of the third real code length is read from the current to-be-decoded data, if the bit data with the length of the third real code length is not greater than the maximum Huffman code word, then the bit data with the length of the third real code length is taken as the first Huffman code word, wherein the maximum Huffman code word is the maximum value of the Huffman code word with the real code length of the third real code length.

[0090] Since the memory space of the small embedded platform is limited, the to-be-decoded data is usually loaded into the data buffer in segments, therefore, when the decoding of the data buffer is completed, the next segment of to-be-decoded data needs to be loaded. In order to indicate the timing of loading the next segment of to-be-decoded data, the embodiment further includes the following steps, please refer to Figure 2c, the remaining group number dctr is initialized as 4, and the remaining group number is used to record the number of groups of remaining undecoded data to be decoded stored in the data buffer. The number of remaining undecoded bits of the current group of data to be decoded A1 is recorded as bitpos, and the initial value of bitpos is 8 if the preset length is 8. After 1 bit of data is decoded, bitpos is decremented by 1. A tsign is set to indicate whether the number of remaining bits of the current group is greater than the real code length corresponding to the data to be decoded. Specifically, tsign = bitpos - real code length, and when tsign is greater than 0, it indicates that the number of remaining bits of the current group is greater than the real code length, and the value of bitpos is updated to tsign. When tsign is less than 0, it indicates that the number of remaining bits of the current group is less than the real code length, and the next group of data has started to be decoded, and the value of bitpos is updated to 8 + tsign. The first bit length is recorded as num. After reading the non-zero coefficient (quantized data) corresponding to the first Huffman code word, if there are still undecoded bits in the group of data to be decoded in which the non-zero quantized data is located, the group in which the undecoded bit data is located is still counted in the remaining group number. Specifically, if the first real code length of the first Huffman code word is 6, after reading the first Huffman code word, the number of remaining undecoded bits of the current group of data to be decoded A1 is bitpos = 2. After the decoding value corresponding to the first Huffman code word is found according to the first Huffman code word, the first bit length num is parsed as 6. The first bit length num is greater than the number of remaining undecoded bits of the current group of data to be decoded bitpos = 2, and less than the sum (10) of bitpos and the preset length (8). It indicates that the bit data stored in the A1 group has been completely decoded, and the group in which the undecoded bit data is located is A2-A4, and the remaining group number dctr = 3. If the first bit length num is 1, the first bit length num is less than the number of remaining undecoded bits of the current group of data to be decoded bitpos (bitpos = 2), which indicates that there are still undecoded bit data in the A1 group, and the group in which the undecoded bit data is located is A1-A4, and the remaining group number is 4. If the first bit length num is 14, the first bit length num is greater than the number of remaining undecoded bits of the current group of data to be decoded bitpos = 2, and greater than the sum (10) of bitpos and the preset length. It indicates that the bit data stored in the A1 and A2 groups has been completely decoded, and the group in which the undecoded bit data is located is A3-A4, and the remaining group number dctr = 2. In this way, when the remaining group number is 0, the next segment of data to be decoded is loaded into the data buffer.

[0091] Taking a specific AC component decoding process of a JPEG image as an example, in the first sub-mapping relationship, idx is an index, and p_cw is a minimum code word extension value; in the second sub-mapping relationship, idx is an index, and p_len is a value corresponding to an actual code length (equal to the actual code length minus 1). The current group of data to be decoded is A1, which is 10100100, and is not an ambiguous word. S210 is executed, and it is determined that the value of A1 is less than the minimum code word extension value p_cw[3]. The index of the first minimum code word extension value corresponding to the current group of data to be decoded is idx=2. S220 is executed, and p_len[2]=3 is found in the second mapping relationship. It is determined that the actual code length of the first Huffman code word in A1 is 4 (p_len[2]+1=4), and the first Huffman code word is 1010. S410 is executed, the minimum Huffman code word with the actual code length of 4 is 1010, the first address is recorded as hpos, S420 is executed, and the address offset value is calculated as 0. S430 is executed, and the second address is determined based on the first address and the address offset value. Because the address offset value is 0, the value of the second address in the embodiment is equal to the first address. The decoding value (recorded as rvalue) corresponding to the first Huffman code word is read from the second address, which is 0x23. The run length is 2 (corresponding to the decoding value of 2 bytes of zero quantization value data), the first bit length is 3, and the bit data (010) with the first bit length (3) is read from the first Huffman code word (1010) in the data buffer as the non-zero quantization value data of the decoding value.

[0092] After the quantization data is solved, inverse quantization and inverse DCT (Discrete Cosine Transform) operations are further performed. In the embodiment, when the Huffman coding is decoded, the decoding is performed in the MCU unit. After the quantization value data is analyzed, the inverse quantization and inverse DCT operations are still performed in the MCU unit, until the final decoding value of all MCUs of a frame of image is solved. As shown in FIG. 6, after the quantization value of the i-th MCU is read, the inverse quantization and inverse DCT operations are performed on the quantization data of the i-th MCU, until the decoding of all MCUs of a frame of image is completed (in the embodiment, a frame of image includes N MCUs). Figure 6

[0093] The application further provides a decoding device for a Huffman coded image, which comprises:

[0094] The first ambiguous word judgment module is used to judge whether the current group of data to be decoded in the data buffer is an ambiguous word. If not, the first decoding module is triggered to work. If yes, the second decoding module is triggered to work.

[0095] ​The first decoding module compares the current group of data to be decoded with one of a plurality of minimum code word extension values in sequence, stops the comparison if the current group of data to be decoded is smaller than a certain minimum code word extension value, takes the previous code word extension value of the certain code word extension value as a first minimum code word extension value, and looks up a first real code length corresponding to the first minimum code word extension value in a mapping relationship, and reads bit data with the first real code length from the current group of data to be decoded as a first Huffman code word; wherein the mapping relationship is a corresponding relationship between each minimum code word extension value and a corresponding real code length, and the plurality of minimum code word extension values are obtained by filling 0 to the right of a corresponding Huffman code word to the preset length.

[0096] The second decoding module is configured to decode the polysemous word in a manner different from the first decoding module according to the real meaning of the polysemous word.

[0097] The application further provides an embedded display device which decodes a Huffman coded image by using the method or comprises the decoding apparatus.

[0098] In addition, the application further provides a computer readable storage medium, such as a chip, an optical disc, etc., which stores a computer program and can implement the method when executed.

[0099] It should be noted that the computer readable storage medium of the embodiments of the present disclosure is not limited to the above-mentioned embodiments, for example, it can also be an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or instrument, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection with one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or instrument.

[0100] Those skilled in the art can understand that the above-mentioned preferred embodiments can be freely combined, superimposed, without conflict. Among them, the flowcharts and block diagrams in the drawings illustrate the possible implementation architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, which contains one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions noted in the blocks can also occur in different order from that noted in the drawings, for example, two blocks indicated in succession can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the function involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of special-purpose hardware and computer instructions. The numbering of the steps herein is only for the convenience of description and reference, and does not limit the front and rear order, and the specific execution order is determined by the technology itself, and those skilled in the art can determine various allowed, reasonable orders according to the technology itself.

[0101] It should be noted that the step numbering (letter or number) is used in the present application to refer to certain specific method steps, only for the purpose of convenience and brevity, and absolutely not to limit the order of the method steps by letters or numbers. Those skilled in the art can understand that the order of the related method steps should be determined by the technology itself, and should not be improperly limited by the existence of step numbering, and those skilled in the art can determine various allowed, reasonable step orders according to the technology itself.

[0102] Those skilled in the art can understand that the above-mentioned preferred embodiments can be freely combined, superimposed, without conflict.

[0103] It should be understood that the above-described embodiments are only exemplary and not limiting, and those skilled in the art can make various obvious or equivalent modifications or replacements to the above-described details without departing from the essential principles of the present application, which will be included in the scope of the claims of the present application.

Claims

1. A decoding method of a Huffman-coded image, characterized by, The method comprises the following steps: S100, judging whether the current group of to-be-decoded data in the data buffer is an ambiguous word, if not, executing S200, if yes, executing S300; wherein the length of each group of to-be-decoded data is a preset length; S200, comparing the current group of to-be-decoded data with one of a plurality of minimum code word extension values in sequence, if the current group of to-be-decoded data is smaller than a certain minimum code word extension value, stopping the comparison, taking the previous code word extension value of the certain minimum code word extension value as a first minimum code word extension value, and searching for a first real code length corresponding to the first minimum code word extension value in a mapping relationship, and reading bit data with the first real code length from the current group of to-be-decoded data as a first Huffman code word; wherein the mapping relationship is a corresponding relationship between each minimum code word extension value and a corresponding real code length, and the plurality of minimum code word extension values are obtained by filling 0 to the right of a corresponding Huffman code word to the preset length; S300, decoding according to the real meaning of the ambiguous word in a manner different from S200, comprising: judging whether the next group of to-be-decoded data is a hexadecimal value 00; if yes, judging that the real meaning of the ambiguous word is a component of the Huffman code word, and decoding bit by bit from the Kth bit of the to-be-decoded data composed of the current group of to-be-decoded data and the next group of to-be-decoded data; wherein K is equal to the preset length plus 1; if not, judging that the real meaning of the ambiguous word is a component of a marker code, and composing a marker code with the ambiguous word and the next group of to-be-decoded data, and decoding according to the real meaning of the marker code.

2. The decoding method of claim 1, wherein, The method further comprises the following steps after S200: S400, searching for a decoding value corresponding to the first Huffman code word, and parsing the decoding value to obtain a first bit length; S500, reading bit data with the first bit length from the data buffer after the first Huffman code word as quantization value data of the decoding value.

3. The decoding method of claim 2, wherein, The method further comprises the following steps after S500: S600, if the sum of the real code length of the first Huffman code word and the first bit length is not equal to an integer multiple of the preset length, judging whether the next group of to-be-decoded data after the bit data with the first bit length in the data buffer is the ambiguous word, if not, executing step S700; S700, reading the preset length of to-be-decoded data from the data buffer starting from the (M+N+1)th bit of the first bit data of the current group of to-be-decoded data as cross-group to-be-decoded data; wherein M is the first real code length, and N is the first bit length; The cross-group data to be decoded is compared with one of a plurality of minimum code word extension values in sequence, if the current group data to be decoded is less than a certain minimum code word extension value, the comparison is stopped, the previous code word extension value of the certain minimum code word extension value is taken as a second minimum code word extension value, a second real code length corresponding to the second minimum code word extension value is searched in the mapping relationship, and bit data with the second real code length is read from the cross-group data to be decoded as a second Huffman code word.

4. The decoding method of claim 3, wherein, In the S600, if the next group data to be decoded is the ambiguous word, the S800 is executed. In the S800, bit data between the first bit length of bit data and the next group data to be decoded is decoded from the (M+N+1)th bit in the data buffer starting from the first bit data of the current group data to be decoded.

5. The decoding method of claim 1, wherein, The mapping relationship comprises a first sub-mapping relationship and a second sub-mapping relationship, the first sub-mapping relationship is a relationship between the minimum code word extension value and an index, and the second sub-mapping relationship is a relationship between the index and the real code length. In the searching of the first real code length corresponding to the first minimum code word extension value in the mapping relationship, the following steps are included: In the S210, an index of the first minimum code word extension value corresponding to the current group data to be decoded is searched in the first sub-mapping relationship. In the S220, according to the index, a first real code length corresponding to the current group data to be decoded is searched in the second sub-mapping relationship.

6. The decoding method of claim 2, wherein, In the S400, the following steps are included to search a decoding value corresponding to the first Huffman code word: In the S410, a first address is determined according to the first real code length, the first address is an address of a minimum Huffman code word with a code length equal to the first real code length in a Huffman coding table, and the Huffman coding table is used to store decoding values corresponding to the Huffman code words; In the S420, a difference value between the first Huffman code word and the minimum Huffman code word is calculated as an address offset value; In the S430, a second address is determined by offsetting the first address by the address offset value, and a value in the second address is read as a decoding value of the first Huffman code word.

7. The decoding method of claim 5, wherein, In the S200, if the current group data to be decoded is greater than any minimum code word extension value, a third real code length corresponding to a maximum index is searched in the second sub-mapping relationship; Bit data with the third real code length is read from the current group data to be decoded, if the bit data with the third real code length is not greater than a maximum Huffman code word, the bit data with the third real code length is taken as a first Huffman code word, and the maximum Huffman code word is a maximum value of Huffman code words with the third real code length.

8. The decoding method of claim 7, wherein, If the bit data of the third real code length is greater than the maximum Huffman code word, the Kth bit of the to-be-decoded data composed of the current group of to-be-decoded data and the next group of to-be-decoded data is decoded bit by bit, where K is equal to the preset length plus 1.

9. A decoding device for Huffman-coded images, characterized in that, The application comprises: A first ambiguous word judgment module is configured to judge whether the current group of to-be-decoded data in the data buffer is an ambiguous word. If not, the first decoding module is triggered to work. If yes, the second decoding module is triggered to work. The length of each group of to-be-decoded data is a preset length. The first decoding module compares the current group of to-be-decoded data with one of a plurality of minimum code word extension values in sequence. If the current group of to-be-decoded data is less than a certain minimum code word extension value, the comparison is stopped, the previous code word extension value of the certain minimum code word extension value is taken as a first minimum code word extension value, and a first real code length corresponding to the first minimum code word extension value is found in a mapping relationship. Bit data with the first real code length is read from the current group of to-be-decoded data as a first Huffman code word. The mapping relationship is a corresponding relationship between each minimum code word extension value and a corresponding real code length. The plurality of minimum code word extension values are obtained by filling 0 to the right of a corresponding Huffman code word to the preset length. The second decoding module is configured to decode in a manner different from that of the first decoding module according to the real meaning of the ambiguous word. The second decoding module further comprises a value zero detection unit configured to judge whether the next group of to-be-decoded data is a hexadecimal value 00. If yes, it is judged that the real meaning of the ambiguous word is a component of the Huffman code word, and the Kth bit of the to-be-decoded data composed of the current group of to-be-decoded data and the next group of to-be-decoded data is decoded bit by bit, where K is equal to the preset length plus 1. If no, it is judged that the real meaning of the ambiguous word is a component of a marker code, and the ambiguous word and the next group of to-be-decoded data are combined to form a marker code, and the marker code is decoded according to its real meaning.

10. The decoding device of claim 9, wherein, The application further comprises a quantization value data acquisition module, which works after the first decoding module works, and is configured to: find a decoding value corresponding to the first Huffman code word, and parse the decoding value to obtain a first bit length; read bit data with the first bit length from the data buffer after the first Huffman code word as quantization value data of the decoding value.

11. The decoding device of claim 10, wherein, The application further comprises a third decoding module, which works after the quantization value data acquisition module works, and is configured to: If the sum of the real code length of the first Huffman code word and the first bit length is not equal to an integer multiple of the preset length, it is judged whether the next group of to-be-decoded data after the bit data with the first bit length in the data buffer is the ambiguous word. If not, Start reading the preset length of the to-be-decoded data from the (M+N+1)th bit in the data buffer, where the first bit of the current group of to-be-decoded data is taken as a starting point, and M is the first real code length and N is the first bit length; Compare the cross-group to-be-decoded data with one of a plurality of minimum code word extension values in sequence, if the current group of to-be-decoded data is smaller than a certain minimum code word extension value, stop the comparison, take the previous code word extension value of the certain minimum code word extension value as a second minimum code word extension value, and find a second real code length corresponding to the second minimum code word extension value in the mapping relationship, and read bit data with the second real code length from the cross-group to-be-decoded data as a second Huffman code word.

12. The decoding apparatus of claim 11, wherein, if the next group of to-be-decoded data is the ambiguous word, bit data between the first bit length of bit data and the next group of to-be-decoded data is decoded bit by bit from the (M+N+1)th bit in the data buffer, where the first bit of the current group of to-be-decoded data is taken as a starting point.

13. The decoding device of claim 9, wherein, The mapping relationship includes a first sub-mapping relationship and a second sub-mapping relationship, the first sub-mapping relationship is a relationship between a minimum code word extension value and an index, and the second sub-mapping relationship is a relationship between the index and the real code length, The finding of the first real code length corresponding to the first minimum code word extension value in the mapping relationship includes: finding an index of the first minimum code word extension value corresponding to the current group of to-be-decoded data in the first sub-mapping relationship; finding the first real code length corresponding to the current group of to-be-decoded data in the second sub-mapping relationship according to the index.

14. The decoding device of claim 10, wherein, The quantization value data acquisition module finds the decoding value corresponding to the first Huffman code word by the following steps: determining a first address according to the first real code length, the first address is an address of a minimum Huffman code word with a code length equal to the first real code length in a Huffman coding table, and the Huffman coding table is used to store decoding values corresponding to the Huffman code words; calculating a difference value between the first Huffman code word and the minimum Huffman code word as an address offset value; determining a second address by offsetting the first address by the address offset value, and reading a value in the second address as a decoding value of the first Huffman code word.

15. The decoding device of claim 13, wherein, The first decoding module is further configured to, if the current group of to-be-decoded data is greater than any minimum code word extension value, find a third real code length corresponding to a maximum index in the second sub-mapping relationship; read bit data with the third real code length from the current group of to-be-decoded data, if the bit data with the third real code length is not greater than a maximum Huffman code word, take the bit data with the third real code length as a first Huffman code word, and the maximum Huffman code word is a maximum value of a Huffman code word with the third real code length.

16. The decoding device of claim 15, wherein, If the third real code length bit data is greater than the maximum Huffman code word, the Kth bit of the to-be-decoded data composed of the current group of to-be-decoded data and the next group of to-be-decoded data is decoded bit by bit, wherein K is equal to the preset length plus 1.

17. An embedded display device, comprising: The decoding apparatus comprises any one of claims 9-16.

18. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the method of any one of claims 1-8.

19. A decoding chip, comprising: The computer program is executed by a processor to implement the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Huffman decoding method and device

    CN104980161A

  • JPG picture fragment recombination method, terminal equipment and storage medium

    CN111223154A