A simple lossless compression and decoding method for images
By using a hybrid method of 0th-order Golomb coding and fixed-length coding, the problem of low efficiency in simple image compression in existing technologies is solved, saving time and resources and achieving efficient lossless compression.
Patent Information
- Application Number
- CN202311445997.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-10-31
AI Technical Summary
Existing lossless compression algorithms are inefficient, time-consuming, and resource-intensive for compressing simple images. In particular, Huffman coding, run-length coding, and LZW coding perform poorly on simple images.
A hybrid encoding method combining 0th-order Golomb coding with 5-bit and 8-bit fixed-length coding is adopted. The image only needs to be traversed once. By recording the length of consecutive identical characters and setting the difference threshold, lossless compression of simple images can be achieved.
It achieves high compression ratio with low time consumption and low resource consumption for simple images, and the lossless compression and decoding process is simple and efficient.
Smart Images

Figure CN119922326B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and specifically relates to a lossless compression and decoding method for simple images. Background Technology
[0002] In existing technologies, with the development of computer graphics, commonly used lossless compression methods include Huffman coding, run-length encoding, and LZW coding. Huffman coding is a variable-length encoding method that constructs the shortest codeword on average based on the probability of character occurrence. Run-length encoding primarily replaces a string of identical values with a single representative value. LZW coding achieves compression by establishing a string table and using shorter codes to represent longer strings.
[0003] However, in existing technologies, Huffman coding requires traversing the image twice: the first traversal obtains character frequencies and codewords for each character, and the second traversal begins encoding. These two scans are time-consuming, and transmitting the codewords corresponding to each character also requires space. Run-length encoding has limited compression performance for continuous-tone images. LZW, with its dictionary construction and sliding window matching algorithm, is also resource-intensive and has low compression rates for simple images.
[0004] In addition, commonly used terms in the prior art include:
[0005] Simple images: These are images with simple content and high data redundancy. They often appear as manually created electronic images, such as invoices, business cards, employee badges, and web pages.
[0006] Lossless compression: Compression is achieved by utilizing the statistical redundancy of data, which can completely restore the original data without causing any distortion.
[0007] Decoding: The encoding and decoding ends define the protocol content, and the decoding end restores the received data. Fixed-length encoding: This refers to the encoding process where the space occupied by the information bits remains constant.
[0008] Variable-length encoding: refers to the inconsistent space occupied by information bits during the encoding process. Summary of the Invention
[0009] To address the aforementioned issues, the purpose of this application is to achieve a considerable lossless compression ratio using a compression algorithm with relatively low time and resource consumption, with the following improvements:
[0010] 1) Use 0th-order Golomb encoding to record consecutive characters of the same length compressed into values that occupy very little space;
[0011] 2) Only one traversal of the image is needed, resulting in less time consumption;
[0012] 3) Only the value of the previous pixel and the counter value need to be cached, resulting in low space consumption;
[0013] 4) Set a 5-bit diff threshold to provide a small amount of fixed-length compression space for continuous-tone images.
[0014] Specifically, the present invention provides a lossless compression and decoding method for simple images, the method comprising the following steps:
[0015] S1, if lossless compression is performed, includes:
[0016] S1.1, Calculate the difference between the current pixel and the previous pixel; further determine whether the difference is 0; based on the result, proceed to steps S1.2 and S1.3 respectively;
[0017] S1.2, if the value is 0, update the counter and the next pixel value. If the next pixel is empty, perform Golomb encoding on the counter and proceed to step S1.4; if the next pixel is not empty, proceed to step S1.1.
[0018] The 0th-order Columbus coding further includes:
[0019] ① Perform 0th-order Golomb encoding on a non-negative integer x;
[0020] ②Increment by 1, i.e., x+1;
[0021] ③ Write x+1 in binary form (x+1)2;
[0022] ④ Count the number of bits in (x+1)2 in binary form, and denote it as M;
[0023] ⑤ Add M-1 zeros before the binary form (x+1)2;
[0024] S1.3 If the difference is not 0, first perform Golomb encoding on the non-zero Count, and then use 5-bit or 8-bit fixed-length encoding for pixels with non-zero differences, including setting a 5-bit difference threshold; update the next pixel, if the next pixel is empty, proceed to step S1.4; if the next pixel is not empty, proceed to step S1.1.
[0025] S1.4, Encoding ends;
[0026] S2, if lossless decoding is performed accordingly, the lossless decoding further includes:
[0027] S2.1, record the current bit; further determine whether the current bit is 0; based on the result, proceed to steps S2.2 and S2.3 respectively;
[0028] S2.2, If the current bit is 0, then perform 0th-order Columbus decoding; proceed to step S2.4.
[0029] The 0th-order Columbus decoding further includes:
[0030] ① Record the number of leading zeros in the Columbus code as M;
[0031] ② Convert the (M+1) bits following the leading 0 to decimal X;
[0032] ③X-1 is the decoded decimal number;
[0033] S2.3 If the current bit is not 0, then perform right shift of the corresponding bit by 2+5 or 2+8 bits for decoding, where the first two bits are the identifier, and then proceed to step S2.4.
[0034] S2.4, determine if the bit is empty; if yes, end; if no, return to step S2.1.
[0035] Step S1.1 further includes:
[0036] S1.1.1, Input image;
[0037] S1.1.2, set the pixel value of the 0th pixel to 0, i.e., predPel = 0; the value of the first pixel is denoted as curPel;
[0038] S1.1.3, Calculate the difference: Calculate the difference between the current pixel curPel and the previous pixel predPel, denoted as diff, diff = curPel - predPel;
[0039] S1.1.4, determine whether diff = 0 is true; if yes, proceed to step S1.2; if no, proceed to step S1.3.
[0040] If step S1.2 is 0, then the counter is incremented by 1, the next pixel is retrieved, predPel and curPel are updated, and the process returns to step S1.1.3; further including:
[0041] If S1.2.1 is executed, then the counter is incremented by 1, and Count is incremented.
[0042] S1.2.2, take the next pixel, update predPel and curPel, that is, predPel = curPel, and take the next pixel as curPel;
[0043] S1.2.3, determine if the pixel is empty; if not, return to step S1.1.3; if yes, proceed to step S1.2.4;
[0044] S1.2.4, perform Columbus encoding on Count; then proceed to step S1.4 to complete the encoding.
[0045] If step S1.3 is not 0 and the counter is not 0, then the Columbus code counter is used, and the counter is set to 0 after completion; 1 is encoded and the diff is compared to see if it is within the threshold. If it is within the threshold of -16 to 15, then 1 is encoded and the diff is encoded using 5 bits; otherwise, 0 is encoded and curPel is encoded using 8 bits. The next pixel is taken, predPel and curPel are updated, and the process returns to step S1.1.3; further including:
[0046] S1.3.1, determine if the condition Count == 0 is true;
[0047] S1.3.2, If no, then perform Columbus coding on Count, Count = 0; and proceed to step S1.3.3; if yes, then proceed directly to step S1.3.3;
[0048] S1.3.3, code 1;
[0049] S1.3.4, determine whether diff∈[-16,15] is true?
[0050] If so, then perform 1-bit encoding and 5-bit encoding diff;
[0051] If not, then encode 0, 8-bit curPel;
[0052] S1.3.5, predPel = curPel, take the next pixel and record it as curPel;
[0053] S1.3.6, Determine if a pixel is empty;
[0054] If not, return to step S1.1.3; if yes, proceed to step S1.4, and the encoding ends.
[0055] Step S2.1 further includes:
[0056] S2.1.1, Input bitstream;
[0057] S2.1.2, set the pixel value of the 0th pixel to 0, i.e., predPel = 0;
[0058] S2.1.3, record the current bit as curBit.
[0059] Step S2.2, if the current bit is 0, count the number of leading zeros as M, decode the count according to the Columbus code, then the value of the subsequent count pixels is predPel, shifted right by 2M+1 bits; further includes:
[0060] S2.2.1, starting from the current position, record the number of leading zeros as M;
[0061] S2.2.2, convert the M+1 bits of binary data after the leading 0 to decimal x;
[0062] S2.2.3, decode to obtain X-1;
[0063] S2.2.4, then there are X-1 more predPel after predPel;
[0064] S2.2.5, shift the bit right by 2M+1 bits; then proceed to step S2.4.
[0065] Step S2.3, if the current bit is not 0, it indicates that a diff exists, and the bit is shifted right by one bit; if the current bit is 1, the bit is shifted right by one bit, and the next 5 bits are the binary representation of the diff, shifted right by 5 bits; if the current bit is not 1, the bit is shifted right by one bit, and the next 8 bits are the binary representation of curPel, shifted right by 8 bits; further includes:
[0066] S2.3.1, If not, then shift the bit right by 1 bit;
[0067] S2.3.2, further determine whether curBit == 1 is true; if yes, then shift the bit right by 1 bit; proceed to step S2.3.3; if no, then shift the bit right by 1 bit; proceed to step S2.3.6; S2.3.3, convert the last 5 bits of the bit to decimal diff;
[0068] S2.3.4, curPel=PredPel+diff; predPel=curPel;
[0069] S2.3.5, shift the bit right by 5 bits; proceed to step S2.4;
[0070] S2.3.6, the last 8 bits are converted to decimal curPel;
[0071] S2.3.7, predPel = curPel;
[0072] S2.3.8, shift the bit right by 8 bits; proceed to step S2.4.
[0073] Step S2.4 further includes determining whether the bit is empty. If not, return to step S2.1.3; if yes, end.
[0074] Therefore, the advantage of this application is:
[0075] 1) It can implement a hardware-friendly algorithm with low compression ratio specifically for simple images; 2) It uses 0th-order Golomb coding to perform lossless compression on simple images;
[0076] 3) There are also solutions for dealing with color variations in simple images. Attached Figure Description
[0077] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.
[0078] Figure 1 This is a schematic diagram of the method flow of this application.
[0079] Figure 2 This is a flowchart illustrating the lossless compression process in the method described in this application.
[0080] Figure 3 This is a flowchart illustrating the lossless decoding process in the method described in this application. Detailed Implementation
[0081] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.
[0082] like Figure 1 As shown, this application proposes a simple lossless image compression and decoding method. The core idea of this technical solution is:
[0083] S1, if lossless compression is performed, includes:
[0084] S1.1, Calculate the difference between the current pixel and the previous pixel; further determine if the difference is 0? Based on the result, proceed to steps S1.2 and S1.3 respectively;
[0085] S1.2, if the value is 0, update the counter and the next pixel value. If the next pixel is empty, perform Golomb encoding on the counter and proceed to step S1.4; if the next pixel is not empty, proceed to step S1.1.
[0086] The 0th-order Columbus coding further includes:
[0087] ① Perform 0th-order Golomb encoding on a non-negative integer x;
[0088] ②Increment by 1, i.e., x+1;
[0089] ③ Write x+1 in binary form (x+1)2;
[0090] ④ Count the number of bits in (x+1)2 in binary form, and denote it as M;
[0091] ⑤ Add M-1 zeros before the binary form (x+1)2;
[0092] S1.3 If the difference is not 0, first perform Golomb encoding on the non-zero Count, and then use 5-bit or 8-bit fixed-length encoding for pixels with non-zero differences, including setting a 5-bit difference threshold; update the next pixel, if the next pixel is empty, proceed to step S1.4; if the next pixel is not empty, proceed to step S1.1.
[0093] S1.4, Encoding ends;
[0094] S2, if lossless decoding is performed accordingly, the lossless decoding further includes:
[0095] S2.1, record the current bit; further determine whether the current bit is 0; based on the result, proceed to steps S2.2 and S2.3 respectively;
[0096] S2.2, If the current bit is 0, then perform 0th-order Columbus decoding; proceed to step S2.4.
[0097] The 0th-order Columbus decoding further includes:
[0098] ① Record the number of leading zeros in the Columbus code as M;
[0099] ② Convert the (M+1) bits following the leading 0 to decimal X;
[0100] ③X-1 is the decoded decimal number;
[0101] S2.3 If the current bit is not 0, then perform right shift of the corresponding bit by 2+5 or 2+8 bits for decoding, where the first two bits are the identifier, and then proceed to step S2.4.
[0102] S2.4, Determine if the bit is empty. If yes, end; if no, proceed to step S2.1.
[0103] An example of the 0th-order Columbus coding:
[0104]
[0105]
[0106] Correspondingly, an example of the 0th-order Columbus decoding is as follows:
[0107]
[0108] In summary, such as Figure 2 As shown, the lossless compression process can also be described as follows:
[0109] (1) Set the pixel value of the 0th pixel to 0. The entire lossless compressed image encoding traversal order is from left to right and from top to bottom;
[0110] (2) Calculate the difference between the current pixel curPel and the previous pixel predPel and denote it as diff;
[0111] (3) If diff is 0, increment the counter by 1, take the next pixel, update predPel and curPel, and return to step (2).
[0112] (4) If diff is not 0 and the counter is not 0, then use the Columbus-encoded counter and set the counter to 0 after completion;
[0113] (5) Encode 1 and compare whether diff is within the threshold. If it is within the threshold of -16 to 15, then encode 1 and use 5 bits to encode diff; otherwise, encode 0 and use 8 bits to encode curPel. Take the next pixel, update predPel and curPel, and return to step (2).
[0114] Specifically, such as Figure 2 As shown, the lossless compression process further includes the following steps:
[0115] Step S1.1 further includes:
[0116] S1.1.1, Input image;
[0117] S1.1.2, set the pixel value of the 0th pixel to 0, i.e., predPel = 0; the value of the first pixel is denoted as curPel;
[0118] S1.1.3, Calculate the difference: Calculate the difference between the current pixel curPel and the previous pixel predPel, denoted as diff, diff = curPel - predPel;
[0119] S1.1.4, determine whether diff = 0 is true; if yes, proceed to step S1.2; if no, proceed to step S1.3.
[0120] If step S1.2 is 0, the counter is incremented by 1, the next pixel is retrieved, predPel and curPel are updated, and the process returns to step S1.1.3; further including:
[0121] If S1.2.1 is executed, then the counter is incremented by 1, and Count is incremented.
[0122] S1.2.2, take the next pixel, update predPel and curPel, that is, predPel = curPel, and take the next pixel as curPel;
[0123] S1.2.3, determine if the pixel is empty; if not, return to step S1.1.3; if yes, proceed to step S1.2.4;
[0124] S1.2.4, perform Columbus encoding on Count; then proceed to step S1.4 to complete the encoding.
[0125] In step S1.3, if the value is not 0 and the counter is not 0, then the Columbus code counter is used, and the counter is set to 0 after completion; 1 is encoded and the diff is compared to see if it is within the threshold. If it is within the threshold range of -16 to 15, then 1 is encoded and the diff is encoded using 5 bits; otherwise, 0 is encoded and curPel is encoded using 8 bits. The next pixel is then taken, predPel and curPel are updated, and the process returns to step S1.1.3; further including:
[0126] S1.3.1, determine if the condition Count == 0 is true;
[0127] S1.3.2, If no, then perform Columbus coding on Count, Count = 0; and proceed to step S1.3.3; if yes, then proceed directly to step S1.3.3;
[0128] S1.3.3, code 1;
[0129] S1.3.4, determine whether diff∈[-16,15] holds true;
[0130] If so, then perform 1-bit encoding and 5-bit encoding diff;
[0131] If not, then encode 0, 8-bit curPel;
[0132] S1.3.5, predPel = curPel, take the next pixel and record it as curPel;
[0133] S1.3.6, Determine if a pixel is empty;
[0134] If not, return to step S1.1.3; if yes, proceed to step S1.4, and the encoding ends.
[0135] like Figure 3 As shown, the lossless decoding process can also be described as follows:
[0136] (1) Set the pixel value of the 0th pixel to 0, i.e., predPel = 0. The image decoding traversal order is from left to right and from top to bottom.
[0137] (2) If the current bit is 0, count the number of leading zeros as m. Decode the count using the Columbus code, then the value of the subsequent count pixels is predPel, shifted right by 2m+1 bits.
[0138] (3) If the current bit is 1, it means that a diff exists. Shift right by one bit; if the current bit is 1, shift right by one bit, the next 5 bits are the binary representation of the diff, shift right by 5 bits; if the current bit is 0, shift right by one bit, the next 8 bits are the binary representation of curPel, shift right by 8 bits; the current step is the decoding identifier, for example, 11 indicates that the next 5 bits are waiting to be decoded, 10 indicates that the next 8 bits are waiting to be decoded, the first bit must be 1, indicating that a diff exists; the second bit 1 or 0 indicates different decoding methods, so shifting right by one bit when the current bit is 1 and shifting right by one bit when the current bit is 0 are parallel relationships;
[0139] Specifically, such as Figure 3 As shown, the lossless decoding process further includes the following steps:
[0140] Step S2.1 further includes:
[0141] S2.1.1, Input bitstream;
[0142] S2.1.2, set the pixel value of the 0th pixel to 0, i.e., predPel = 0;
[0143] S2.1.3, record the current bit as curBit.
[0144] Step S2.2, if the current bit is 0, count the number of leading zeros as M, decode the count according to the Columbus code, then the value of the subsequent count pixels is predPel, shifted right by 2M+1 bits; further includes:
[0145] S2.2.1, starting from the current position, record the number of leading zeros as M;
[0146] S2.2.2, convert the M+1 bits of binary data after the leading 0 to decimal x;
[0147] S2.2.3, decode to obtain X-1;
[0148] S2.2.4, then there are X-1 more predPel after predPel;
[0149] S2.2.5, shift the bit right by 2M+1 bits; then proceed to step S2.4.
[0150] Step S2.3, if the current bit is not 0, it indicates that a diff exists, and the bit is shifted right by one bit; if the current bit is 1, the bit is shifted right by one bit, and the next 5 bits are the binary representation of the diff, shifted right by 5 bits; if the current bit is not 1, the bit is shifted right by one bit, and the next 8 bits are the binary representation of curPel, shifted right by 8 bits; further includes:
[0151] S2.3.1, If not, then shift the bit right by 1 bit;
[0152] S2.3.2, further determine whether curBit == 1 is true; if yes, then shift the bit right by 1 bit; proceed to step S2.3.3; if no, then shift the bit right by 1 bit; proceed to step S2.3.6; S2.3.3, convert the last 5 bits of the bit to decimal diff;
[0153] S2.3.4, curPel=PredPel+diff; predPel=curPel;
[0154] S2.3.5, shift the bit right by 5 bits; proceed to step S2.4;
[0155] S2.3.6, the last 8 bits are converted to decimal curPel;
[0156] S2.3.7, predPel = curPel;
[0157] S2.3.8, shift the bit right by 8 bits; proceed to step S2.4.
[0158] Step S2.4 further includes,
[0159] Determine if the bit is empty; if not, return to step S2.1.3; if yes, end.
[0160] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A lossless compression and decoding method for simple images, characterized in that, The method includes the following steps: S1, if lossless compression is performed, includes: S1.1, Calculate the difference between the current pixel and the previous pixel; further determine whether the difference is 0; based on the result, proceed to steps S1.2 and S1.3 respectively; Step S1.1 further includes: S1.1.1, Input image; S1.1.2, set the pixel value of the 0th pixel to 0, i.e., predPel = 0; the value of the first pixel is denoted as curPel; S1.1.3, Calculate the difference: Calculate the difference between the current pixel curPel and the previous pixel predPel, denoted as diff, diff = curPel - predPel; S1.1.4, Determine if diff = 0 is true; if yes, proceed to step S1.2; if no, proceed to step S1.
3. S1.2, If the difference is 0, update the counter and the next pixel value; if the next pixel is empty, perform Golomb encoding on the counter and proceed to step S1.4; if the next pixel is not empty, return to step S1.
1. The 0th-order Columbus coding further includes: ① Perform a 0th-order Golomb encoding on a non-negative integer x; ②Increment by 1, i.e., x+1; ③ Write x+1 in binary form (x+1)2; ④ Count the number of bits in (x+1)2 in binary form, and denote it as M; ⑤ Add M-1 zeros before the binary form (x+1)2; S1.3 If the difference is not 0, first perform Golomb encoding on the non-zero Count, and then encode the pixels with non-zero differences using 5-bit or 8-bit fixed-length encoding, including setting a 5-bit difference threshold; update the next pixel. If the next pixel is empty, proceed to step S1.4; if the next pixel is not empty, return to step S1.
1. S1.4, Encoding ends; S2, if lossless decoding is performed accordingly, the lossless decoding further includes: S2.1, record the current bit; further determine whether the current bit is 0; based on the result, proceed to steps S2.2 and S2.3 respectively; S2.2, If the current bit is 0, then perform 0th-order Columbus decoding; then proceed to step S2.
4. The 0th-order Columbus decoding further includes: ① Record the number of leading zeros in the Columbus code as M; ② Convert the (M+1) bits following the leading 0 to decimal X; ③X-1 is the decoded decimal number; S2.3 If the current bit is not 0, then perform right shift of the corresponding bit by 2+5 or 2+8 bits for decoding, where the first two bits are the identifier, and then proceed to step S2.
4. S2.4, determine if the bit is empty; if yes, end; if no, return to step S2.
1.
2. The lossless compression and decoding method for a simple image according to claim 1, characterized in that, If step S1.2 is 0, then the counter is incremented by 1, the next pixel is retrieved, predPel and curPel are updated, and the process returns to step S1.1.3; further including: If S1.2.1 is executed, then the counter is incremented by 1, and Count is incremented. S1.2.2, take the next pixel, update predPel and curPel, that is, predPel = curPel, and take the next pixel as curPel; S1.2.3, determine if the pixel is empty; if not, return to step S1.1.3; if yes, proceed to step S1.2.
4. S1.2.4, perform Columbus encoding on Count; then proceed to step S1.4 to complete the encoding.
3. The lossless compression and decoding method for a simple image according to claim 2, characterized in that, If step S1.3 is not 0 and the counter is not 0, then the Columbus code counter is used, and the counter is set to 0 after completion; 1 is encoded and the diff is compared to see if it is within the threshold. If it is within the threshold of -16 to 15, then 1 is encoded and the diff is encoded using 5 bits; otherwise, 0 is encoded and curPel is encoded using 8 bits. The next pixel is taken, predPel and curPel are updated, and the process returns to step S1.1.3; further including: S1.3.1, determine if the condition Count == 0 is true; S1.3.2, If no, then perform Columbus coding on Count, Count = 0; and proceed to step S1.3.3; if yes, then proceed directly to step S1.3.3; S1.3.3, code 1; S1.3.4, determine whether diff∈[-16,15] holds true; If so, then perform 1-bit encoding and 5-bit encoding diff; If not, then encode 0, 8-bit curPel; S1.3.5, predPel = curPel, take the next pixel and record it as curPel; S1.3.6, Determine if a pixel is empty; If not, return to step S1.1.3; if yes, proceed to step S1.4, and the encoding ends.
4. The lossless compression and decoding method for a simple image according to claim 1, characterized in that, Step S2.1 further includes: S2.1.1, Input bitstream; S2.1.2, set the pixel value of the 0th pixel to 0, i.e., predPel = 0; S2.1.3, record the current bit as curBit.
5. The lossless compression and decoding method for a simple image according to claim 4, characterized in that, Step S2.2, if the current bit is 0, count the number of leading zeros as M, decode the count according to the Columbus code, then the value of the subsequent count pixels is predPel, shifted right by 2M+1 bits; further includes: S2.2.1, starting from the current position, record the number of leading zeros as M; S2.2.2, convert the M+1 bits of binary data after the leading 0 to decimal x; S2.2.3, decode to obtain X-1; S2.2.4, then there are X-1 more predPel after predPel; S2.2.5, shift the bit right by 2M+1 bits; then proceed to step S2.
4.
6. The lossless compression and decoding method for a simple image according to claim 5, characterized in that, Step S2.3, if the current bit is not 0, it indicates that a diff exists, and the bit is shifted right by one bit; if the current bit is 1, the bit is shifted right by one bit, and the next 5 bits are the binary representation of the diff, shifted right by 5 bits; if the current bit is not 1, the bit is shifted right by one bit, and the next 8 bits are the binary representation of curPel, shifted right by 8 bits; further includes: S2.3.1, If not, then shift the bit right by 1 bit; S2.3.2, further determine whether curBit == 1 is true; if yes, then shift the bit right by 1 bit; proceed to step S2.3.3; if no, then shift the bit right by 1 bit; proceed to step S2.3.6; S2.3.3, convert the last 5 bits of the bit to decimal diff; S2.3.4, curPel=PredPel+diff; predPel=curPel; S2.3.5, shift the bit right by 5 bits; proceed to step S2.4; S2.3.6, the last 8 bits are converted to decimal curPel; S2.3.7, predPel = curPel; S2.3.8, shift the bit right by 8 bits; proceed to step S2.
4.
7. The lossless compression and decoding method for a simple image according to claim 6, characterized in that, Step S2.4 further includes, Determine if the bit is empty; if not, return to step S2.1.
3. If so, then the process ends.
Citation Information
Patent Citations
Lossless encoding and decoding method of Bayer image
CN107105208A
Mathematical lossless coding method and equipment
CN113784140A