Coding and decoding method and device based on bounded integer sequence and data stream fusion

By adopting an encoding and decoding method based on the fusion of bounded integer sequences and data streams, the problems of storage space waste and transmission bandwidth waste when encoding data of different integer types in fixed-length encoding and variable-length encoding are solved, and more efficient encoding utilization and decoding accuracy are achieved.

CN121644825AActive Publication Date: 2026-03-10SHENG MICROELECTRONICS (SUZHOU) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-05
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, fixed-length encoding wastes storage space when storing integer type encoded data that is not in the range of powers of two, while fixed-length encoding is inefficient when storing integer type encoded data that is in the range of powers of two. Variable-length encoding also wastes transmission bandwidth when the frequency of encoded data varies greatly.

Method used

An encoding and decoding method based on the fusion of bounded integer sequences and data streams is adopted. By trying multiple compression methods, the optimal scheme is selected. The bounded integer sequence in the encoded content is encoded, and the compression method selection flag is fused with the bounded integer sequence in the data stream. Finally, the actual compressed data stream is output. During decoding, the compression method is identified and the bounded integer sequence is decoded.

Benefits of technology

It achieves improved overall compression performance with a smaller storage space, avoids confusion between different compression algorithms, improves encoding utilization and signal-to-noise ratio, and expands the applicability of bounded integer sequence encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644825A_ABST
    Figure CN121644825A_ABST
Patent Text Reader

Abstract

The invention discloses a coding and decoding method and device based on bounded integer sequence and data stream fusion, and the coding part comprises the steps: carrying out various compression method attempts on a to-be-compressed object, and selecting an optimal compression scheme according to the size of an error; carrying out bounded integer sequence coding on a bounded integer sequence in the coding content under the optimal compression scheme; under the optimal compression scheme, a compression method selection mark in the coding content is coded; performing data stream fusion on the compression method selection and the bounded integer sequence; outputting an actual compressed data stream; the decoding part comprises the following steps: identifying a compression method mark in the compressed data stream; and according to the identified compression method, carrying out bounded integer sequence decoding on the remaining part in the compressed data with the fixed length.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of image compression coding, and relates to an encoding and decoding method and device based on bounded integer sequence and data stream fusion. BACKGROUND

[0002] In the field of image processing or image enhancement, especially in scenarios requiring high-quality visual effects and performance, compression coding is needed. Compression coding is usually divided into fixed-length coding and variable-length coding. Fixed-length coding refers to converting data units into binary sequences of fixed length. Fixed-length coding is efficient when the frequency of encoded data is uniformly distributed, but if the frequency of encoded data varies greatly, there will be a problem of storage space or transmission bandwidth waste. Fixed-length coding is usually used for data types with high randomness of encoding errors.

[0003] The core of variable-length coding is to dynamically adjust the coding length of each encoded data (such as Huffman coding). Shorter coding is used for high-frequency encoded data, and longer coding is used for low-frequency encoded data to optimize the overall coding length.

[0004] The problem of fixed-length coding is that there is a certain waste of storage space when storing integer type encoded data in the range of non-power of two, and the storage efficiency is higher when storing integer type encoded data in the range of power of two.

[0005] To solve these problems, the application proposes an encoding and decoding method and device based on bounded integer sequence and data stream fusion, which further expands the range of bounded integer sequence, making the application range wider. SUMMARY

[0006] An encoding and decoding method based on bounded integer sequence and data stream fusion, characterized by the encoding part comprising: S1.1. Attempting multiple compression methods on the object to be compressed, and selecting the optimal compression scheme according to the error size; S1.2. Bounded integer sequence encoding of the bounded integer sequence in the encoded content under the optimal compression scheme; S1.3. Encoding the compression method selection flag in the encoded content under the optimal compression scheme; S1.4. Data stream fusion of the compression method selection flag and the bounded integer sequence; S1.5. Output the actual compressed data stream; The decoding part comprises: S2.1. Identifying the compression method flag in the compressed data stream; S2.2. Bounded integer sequence decoding of the remaining part of the fixed-length compressed data according to the identified compression method.

[0007] Further, the error size comparison method in S1.1 is as follows: Suppose the average error and the maximum error of different units in the compression object are and , then the final comparison error is: ; wherein, is a weight coefficient; The compression mode with the minimum final comparison error is selected as the compression mode to be encoded.

[0008] Further, the bounded integer sequence encoding in S1.2 is used to process the encoding data reduction problem of fixed range data. When the number of bounded integers to be encoded becomes larger, the storage space is obviously wasted. The length of the bounded integer encoding field is reduced by combining the encoding of several bounded integers.

[0009] Further, suppose the bounded integer to be encoded is The storage space utilization is improved by combining the encoding of every five bounded integers , and the encoding bit width is reduced from 10 bits to 8 bits: .

[0010] Further, suppose the bounded integer to be encoded is The storage space utilization is improved by combining the encoding of every three bounded integers , and the encoding bit width is reduced from 9 bits to 7 bits: .

[0011] Further, suppose the bounded integer to be encoded is The storage space utilization is improved by combining the encoding of every two bounded integers , and the encoding bit width is reduced from 8 bits to 7 bits: .

[0012] Further, suppose the bounded integer to be encoded is The storage space utilization is improved by combining the encoding of every three bounded integers , and the encoding bit width is reduced from 12 bits to 10 bits ; .

[0013] Further, S1.3 since the compression method selection flag field and the bounded integer encoding field constitute a compression data stream with a fixed size of N bits, the length of the compression method selection flag field is equal to N minus the length of the bounded integer encoding field, and the remaining field length one is used to distinguish the compression methods by the binary number of the bits occupied by the remaining field length one; S1.4 the compression method selection flag field is then fused into the remaining field of the bounded integer sequence, and all data streams are spliced together; S1.5 assuming that the compression objects are 1-M, and the data stream of each compression object after compression is maintained at N bits, the compression data stream is output in the order of compression objects 1-M.

[0014] Further, S2.1 the compression method selection flag field of each N-bit data stream is parsed from the compression data stream in units of N-bit bits to obtain the compression method used by the compression object; S2.2 since the compression method selection flag field and the bounded integer encoding field constitute a compression data stream with a fixed size of N bits, the length of the bounded integer encoding field is equal to N minus the length of the compression method selection flag field, and the remaining field length two is used to parse the data required by the compression method in the remaining field length two, including the decoding of each bounded integer, and the bounded integer decoding is the inverse operation of the bounded integer encoding.

[0015] The application also provides an encoding and decoding device based on the fusion of bounded integer sequences and data streams, comprising: The compression method selection unit selects the optimal compression method for the compression object, transmits the compression method to the compression method encoding unit, and compresses under the compression method to obtain a plurality of bounded integers that need to be encoded and transmits them to the bounded integer encoding unit. The compression method encoding unit encodes the selected compression method into binary data and transmits it to the compression data stream splicing unit. The bounded integer encoding unit encodes the plurality of bounded integers that need to be encoded into a bounded integer encoding format and transmits them to the compression data stream splicing unit. The compression data stream splicing unit splices the binary data encoded by the compression method and the bounded integer encoding into a complete compression data stream, and sequentially splices the complete compression data streams of different compression objects. The compression data stream division unit divides the complete compression data streams of different compression objects into equal lengths to obtain the complete compression data streams of individual compression objects. The compression method identification unit identifies the compression method coding field in the complete compression data stream of a single compression object, and transmits the identified compression method and the remaining undecoded compression data stream to the bounded integer decoding unit; The bounded integer decoding unit performs multiple bounded integer decodings on the remaining undecoded compression data according to the identified compression method, obtains all information required by the decompression method, and further obtains the restored compression object after decompression.

[0016] The compression encoding algorithm of the present application effectively solves the fusion problem of data stream. For lossy compression, if a single compression method is used to compress the target object, the final compression error greatly depends on the compression effect of the single compression method. Therefore, the use of the multiple compression combination method proposed in the present application can obtain better compression effect. The present application proposes a non-ambiguous encoding and decoding combination method, which can not only avoid confusion of different compression algorithms during decoding, but also improve the overall compression effect on the basis of smaller storage space. BRIEF DESCRIPTION OF DRAWINGS

[0017] Figure 1 The figure shows the encoding part flow chart of the present application; Figure 2 The figure shows the decoding part flow chart of the present application; Figure 3 The figure shows that the compression method selection flag field occupies 3 bits to distinguish 8 encoding methods; Figure 4 The figure shows that the compression method selection and bounded integer sequence are fused in data stream in the present application; Figure 5 The figure shows that the compression data stream is output in the order of compression objects 1~M in the present application; Figure 6 The figure shows the structure schematic diagram of the encoding and decoding device of the present application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0019] Please refer to Figures 1-5 The present application provides an encoding and decoding method based on bounded integer sequence and data stream fusion, and the encoding part includes: S1.1 multiple compression methods are tried on the compression object, and the optimal compression scheme is selected according to the error size; S1.2 encode the bounded integer sequence in the encoding content under the optimal compression scheme; S1.3 encode the compression method selection flag in the encoding content under the optimal compression scheme; S1.4 data stream fusion of the compression method selection flag and the bounded integer sequence; S1.5 output the actual compression data stream; The decoding part includes: S2.1 identify the compression method flag in the compression data stream; S2.2 decode the bounded integer sequence in the remaining part of the fixed length compression data according to the identified compression method.

[0020] The compression method used in the present application is not limited, and it is assumed that for the same compression object, compression method one, compression method two,..., and compression method can be compressed, then the error size under different compression methods is compared, and the optimal compression scheme is selected, and the error size comparison method is as follows: Assuming that the average error and the maximum error of different units in the compression object are and , then the final comparison error is: ; Among them, is the weight coefficient; The compression method with the smallest final comparison error is selected as the compression method to be encoded.

[0021] The bounded integer sequence encoding in S1.2 is used to process the encoding data reduction problem of fixed range data, and when the number of bounded integers to be encoded becomes larger, the storage space is obviously wasted, and the length of the bounded integer encoding field can be reduced by combining the encoding of a plurality of bounded integers.

[0022] The following four embodiments are listed: Assuming that the bounded integer to be encoded is , 2 bits are usually used for encoding, and the storage space is wasted, and when the number of bounded integers to be encoded is larger, the storage space is wasted more obviously, and the utilization rate of the storage space can be improved by combining the encoding of every five bounded integers , and the encoding bit width is reduced from 10 bits to 8 bits: .

[0023] Similarly, assuming that the bounded integer to be encoded is , 2 bits are usually used for encoding, and the storage space is wasted, and when the number of bounded integers to be encoded is larger, the storage space is wasted more obviously, and the utilization rate of the storage space can be improved by combining the encoding of every three bounded integers By using combined encoding, the storage space utilization is improved, and the encoding bit width is reduced from 9 bits to 7 bits: .

[0024] The above are two optimized encoding methods mentioned for bounded integers. In addition, this encoding method can be extended to any prime number. For example, suppose the bounded integer to be encoded... Encoding typically uses 4 bits, resulting in wasted storage space. This waste becomes more pronounced when the number of bounded integers to be encoded is large. This can be mitigated by encoding every two bounded integers... By using combined encoding, the storage space utilization is improved, and the encoding bit width is reduced from 8 bits to 7 bits: .

[0025] Furthermore, bounded integer encoding can also be applied to composite numbers using prime factorization. For example, suppose a bounded integer is encoded. Encoding typically uses 4 bits, resulting in wasted storage space. This waste becomes more pronounced when the number of bounded integers to be encoded is large. This can be mitigated by encoding every three bounded integers... Combinatorial encoding is used to improve storage space utilization, reducing the encoding bit width from 12 bits to 10 bits. ; .

[0026] Typically, compression methods select flag fields that use fixed-width encoding, such as... Figure 3 The compression method selection flag field shown occupies 3 bits and can distinguish 8 encoding methods: Since the compression method selection flag field and the bounded integer encoding field form a compressed data stream of fixed size N bits, the length of the compression method selection flag field is equal to N minus the length of the bounded integer encoding field, resulting in a remaining field length of 1. The binary number of bits occupied by this remaining field length 1 is used to distinguish each compression method. For example, if compression methods 1 to 5 need to be encoded, the remaining field length 1 of compression method 1 occupies 1 bit, and the remaining field length 1 of compression methods 2 to 5 occupies 3 bits. Then, 1 bit of binary 0 is used to distinguish compression method 1, and 3 bits of binary 100, 101, 110, 111 are used to distinguish compression methods 2 to 5, thus fixing the entire compressed data stream to N bits.

[0027] Then use the compression method selection flag field. Figure 4The method shown integrates the remaining fields of the bounded integer sequence to concatenate all data streams. It is essential to ensure that the length of the remaining encoded segment plus the length of the compression method selection flag field equals the target compressed data volume. If the remaining encoded segment length is long, the length of the compression method selection flag field should be appropriately reduced; if the remaining encoded segment length is short, the length of the compression method selection flag field should be appropriately increased. Simultaneously, the uniqueness of the compression method selection flag field during reverse parsing must be guaranteed. Assuming the number of compressed objects is 1 to M, and the compressed data stream for each object remains at N bits, then the compressed data stream follows the following... Figure 5 The compressed objects 1 to M shown are output sequentially.

[0028] The compressed data stream is decomposed into N-bit units, and the compression method selection flag field of each N-bit data stream is parsed to obtain the compression method used by the compressed object. Since the compression method selection flag field and the bounded integer encoding field form a compressed data stream of fixed size N bits, the length of the bounded integer encoding field is equal to N minus the length of the compression method selection flag field, resulting in a remaining field of length two. The data in this remaining field of length two is then parsed to obtain the data required by the compression method, including the decoding of each bounded integer. Bounded integer decoding is the inverse operation of bounded integer encoding. For example, five bounded integers can be obtained by decoding. , .

[0029] Figure 6 The diagram shows an encoding and decoding apparatus based on the fusion of bounded integer sequences and data streams according to the present invention, comprising: Compression method selection unit: The compression method selection unit selects the optimal compression method for the compression object and transmits the compression method to the compression method encoding unit. At the same time, it compresses the object under the compression method to obtain several bounded integers that need to be encoded and transmits them to the bounded integer encoding unit. Compression method encoding unit: The compression method encoding unit encodes the selected compression method into binary data and transmits it to the compressed data stream splicing unit; Bounded Integer Encoding Unit: The bounded integer encoding unit encodes several bounded integers that need to be encoded into a bounded integer encoding format and transmits it to the compressed data stream splicing unit; Compressed data stream splicing unit: The compressed data stream splicing unit splices the binary data encoded by the compression method and the bounded integer encoding into a complete compressed data stream, and at the same time splices the complete compressed data streams of different compression objects sequentially; Compressed data stream segmentation unit: Divides the complete compressed data streams of different compressed objects into equal-length segments to obtain the complete compressed data stream of a single compressed object; Compression method identification unit: identifies the compression method encoding field in the complete compressed data stream of a single compressed object, and transmits the identified compression method and the remaining undecoded compressed data stream to the bounded integer decoding unit; Bounded integer decoding unit: According to the identified compression method, the remaining undecoded compressed data is decoded multiple times using bounded integers to obtain all the information required by the decompression method, and then the decompressed and restored compressed object is obtained.

[0030] The encoding and decoding method mentioned in this invention is simple in its encoding and decoding process, has high encoding utilization, can further compress storage space, can effectively combine multiple compression methods to improve compression effect and signal-to-noise ratio, and also expands the usable range of bounded integer sequence encoding methods, making it more widely applicable.

[0031] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0032] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is limited by the appended claims and their equivalents.

Claims

1. A method of encoding and decoding based on bounded integer sequence and data stream fusion, characterized by, The encoding part comprises: S1.1 tries multiple compression methods for the object to be compressed, and selects the optimal compression scheme according to the error size; S1.2 encodes the bounded integer sequence in the encoded content under the optimal compression scheme; S1.3 encodes the compression method selection flag in the encoded content under the optimal compression scheme; S1.4 fuses the compression method selection flag and the bounded integer sequence into a data stream; S1.5 outputs the actual compressed data stream; The decoding part comprises: S2.1 identifies the compression method flag in the compressed data stream; S2.2 decodes the remaining part of the fixed-length compressed data according to the identified compression method.

2. The method of claim 1, wherein, The error size comparison method in S1.1 is as follows: Assuming the average error and the maximum error of different units in the compression object are and the final comparison error is: ; wherein are weight coefficients; The compression method with the minimum final comparison error is selected as the compression method to be encoded.

3. The method of claim 1, wherein the method is characterized by: The bounded integer sequence encoding in S1.2 is used to process the encoding data reduction problem of fixed range data. When the number of bounded integers to be encoded becomes large, the storage space is obviously wasted. The length of the bounded integer encoding field is reduced by combining the encoding of several bounded integers.

4. The encoding and decoding method based on bounded integer sequence and data stream fusion according to claim 2, characterized in that: Assume that the bounded integer to be encoded , by combining the encoding of every five bounded integers to improve the utilization of storage space, the encoding bit width is reduced from 10 bits to 8 bits: .

5. The method of claim 2, wherein: Assume that the bounded integers to be encoded By means of the combined encoding of every three bounded integers The utilization of storage space is improved, and the encoding bit width is reduced from 9 bits to 7 bits: 。 6. The method of claim 2, wherein: Assuming the bounded integers to be encoded , the storage space utilization is improved by encoding each two bounded integers in a combined manner, the encoding bit width is reduced from 8 bits to 7 bits: 。 7. The method of claim 2, wherein: Assuming bounded integers with encoding The storage space utilization is improved by encoding every three bounded integers with a combination of encoding, the encoding bit width is reduced from 12 bits to 10 bits ; 。 8. The encoding and decoding method based on bounded integer sequence and data stream fusion according to any one of claims 4-7, characterized in that: S1.3 Since the compression method selection flag field and the bounded integer encoding field constitute a compressed data stream with a fixed size of N bits, the length of the compression method selection flag field is equal to N minus the length of the bounded integer encoding field, and the remaining field length one is used to distinguish the compression methods by using the binary number of the bits occupied by the remaining field length one; S1.4 Then the compression method selection flag field is fused into the remaining field of the bounded integer sequence, and all data streams are spliced; S1.5 Assuming that the compression object is 1-M, and the data stream after compression of each compression object is maintained at N bits, the compressed data stream is output in the order of compression objects 1-M.

9. The encoding and decoding method based on bounded integer sequence and data stream fusion according to claim 8, characterized in that: S2.1 The compression method selection flag field of each N-bit data stream is parsed according to N-bit units to obtain the compression method used by the compression object; S2.2 Since the compression method selection flag field and the bounded integer encoding field constitute a compressed data stream with a fixed size of N bits, the length of the bounded integer encoding field is equal to N minus the length of the compression method selection flag field, and the remaining field length two is used to parse the data required by the compression method in the remaining field length two, including the decoding of each bounded integer. The bounded integer decoding is the inverse operation of the bounded integer encoding.

10. An encoding and decoding device based on bounded integer sequence and data stream fusion, comprising: The compression method selection unit selects the optimal compression method for the compression object, transmits the compression method to the compression method encoding unit, and compresses the compression object under the compression method to obtain a plurality of bounded integers to be encoded and transmits the bounded integers to the bounded integer encoding unit; The compression method encoding unit encodes the selected compression method into binary data and transmits the binary data to the compressed data stream splicing unit; The bounded integer encoding unit encodes the plurality of bounded integers to be encoded into a bounded integer encoding format and transmits the bounded integer encoding format to the compressed data stream splicing unit; The compressed data stream splicing unit splices the binary data encoded by the compression method encoding unit and the bounded integer encoding to obtain a complete compressed data stream, and sequentially splices the complete compressed data streams of different compression objects; The compressed data stream division unit divides the complete compressed data streams of different compression objects into equal lengths to obtain complete compressed data streams of individual compression objects; The compression method recognition unit recognizes the compression method encoding field in the complete compressed data stream of the individual compression object, and transmits the recognized compression method and the remaining undecoded compressed data stream to the bounded integer decoding unit; The bounded integer decoding unit performs multiple bounded integer decodings on the remaining undecoded compressed data according to the recognized compression method to obtain all information required for decompression, and further obtains the restored compression object after decompression.

Citation Information

Patent Citations

  • Method for generating multi-dimensional integer chaotic pseudo-random sequence with uniform distribution characteristics

    CN112272091A

  • Apparatus for encoding and decoding sequence of integer values, method for encoding and decoding sequence of integer values, and computer program for implementing these methods

    CN116018758A

  • Image processing method and device, electronic equipment and readable storage medium

    CN116962693A

  • Streaming error bounded floating point type data compression method

    CN119093941A

  • Compression and decompression engines and compressed domain processors

    US20190013823A1