CN116366071A - Packaging method, packaging system, storage medium and packaging equipment based on ANS (analog to digital) coding - Google Patents
Packaging method, packaging system, storage medium and packaging equipment based on ANS (analog to digital) coding Download PDFInfo
- Publication number
- CN116366071A CN116366071A CN202310231231.2A CN202310231231A CN116366071A CN 116366071 A CN116366071 A CN 116366071A CN 202310231231 A CN202310231231 A CN 202310231231A CN 116366071 A CN116366071 A CN 116366071A
- Authority
- CN
- China
- Prior art keywords
- coding
- value
- current
- ans
- symbol
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 73
- 238000004806 packaging method and process Methods 0.000 title claims abstract description 43
- 230000004044 response Effects 0.000 claims abstract description 23
- 238000004590 computer program Methods 0.000 claims description 7
- 230000015572 biosynthetic process Effects 0.000 claims description 6
- 238000003786 synthesis reaction Methods 0.000 claims description 6
- 238000000605 extraction Methods 0.000 claims description 3
- 230000002194 synthesizing effect Effects 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 14
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 238000004422 calculation algorithm Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 238000005538 encapsulation Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000008901 benefit Effects 0.000 description 4
- 238000007906 compression Methods 0.000 description 4
- 230000006835 compression Effects 0.000 description 4
- 230000014509 gene expression Effects 0.000 description 4
- 230000011218 segmentation Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000013144 data compression Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000005315 distribution function Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 238000009827 uniform distribution Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/04—Protocols for data compression, e.g. ROHC
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention provides a packaging method, a packaging system, a storage medium and packaging equipment based on ANS coding, wherein the packaging method comprises the following steps: sequentially extracting symbols from the symbol sequence, and carrying out ANS coding on the extracted current symbol to obtain a current coding value; judging whether the current coding value is larger than a first threshold value or not; determining that the current code value is a large number in response to the current code value being greater than a first threshold; for the large number, the low-order part meeting the preset requirement is confirmed, and the low-order part is packaged and then output to the code stream. The invention avoids the occurrence of large numbers in the coding flow, improves the packaging efficiency in the ANS coding flow, solves the problem that the current main stream computer cannot process the large numbers to cause the limitation of ANS coding application scenes, and is beneficial to realizing stream decoding in the subsequent ANS decoding.
Description
Technical Field
The present invention relates to the field of coding technologies, and in particular, to an ANS coding-based packaging method, system, storage medium, and apparatus.
Background
Entropy coding is a lossless data compression scheme. The core idea of entropy coding is to represent rarely occurring elements with more bits by representing frequently occurring symbols with fewer bits.
Huffman coding and arithmetic coding are two of the most common entropy coding methods, which will be briefly described below. The Huffman coding algorithm is simple in principle, and the code length is allocated based on the probability ordering of the symbol set. Huffman coding always uses integer bits to represent one symbol and it encodes each symbol separately. So that the huffman code cannot guarantee an optimal compression effect. Huffman coding yields the best result when the probabilities of all symbols are negative integer powers of 2. In huffman codes, each occurrence of a symbol is always encoded into the same codeword. The Huffman coding has the advantage of fast coding rate.
From the theory of information, the ideal codeword length of a single symbol is determined only by the probability of occurrence of the symbol: code-length (x) = -log p(x) If the probability of occurrence of one symbol is 0.4, then the ideal codeword length is 1.32 (-log) 0.4 ). Unfortunately, however, the code codeword length allocated by Huffman coding can only be an integer. This is also the pain point of the huffman coding algorithm.
Arithmetic coding can solve this pain point of huffman coding, which is another entropy coding technique. It encodes the input data into a real interval between 0 and 1. As the input is encoded and the number of bits required to specify it increases, the interval becomes smaller, and arithmetic coding uses almost precise probabilities unlike huffman coding, so it achieves a compression rate close to the theoretical limit. However, the algorithm principle of arithmetic coding is also more complex. The coding efficiency is very low (approximately 1/10 of Huffman coding), and the method has few applications in the field of data compression with high real-time requirements.
As such, in recent years, many students have sought a new algorithm that "compression rate approaches arithmetic coding and coding efficiency approaches huffman coding". In 2009, jarek Duda proposed a Asymmetric Numeral Systems (ANS, asymmetric digital system). According to the Jarek Duda expression, an asymmetric digital system achieves a compression rate comparable to arithmetic coding while having a processing rate similar to huffman coding. The mathematical principles of the ANS are described below:
suppose that it is necessary to combine one set S of two symbols i The symbol sequence formed by e a= {0,1} is encoded into a number num. Considering first a standard binary digital system, the symbol sequence can be encoded as num = Σs i ·2 i At this point, each symbol ("0" or "1") in the sequence occupies 1 bit. The bit width n of the number num. It is clear that binary digital systems ignore the frequency of occurrence of two symbols (0, 1), i.e. binary digital systems are suitable for the case of conforming to a uniform distribution of (0, 1).
As known from shannon information theory, it is assumed that the probability distribution of each symbol in a symbol sequence is { P } 1 ,P 2 ,P 3 ,……,P n Then the average information amount per symbol of the symbol set (amount of information) is:
the amount of information contained in a symbol S and the probability P of the symbol S Correlation log (1/P) s ). Two symbols S 1 ,S 2 The amount of information taken together is:
the mathematical relationship of Jarek Duda from the above formula further envisages: combining the number x and the symbol s into a natural number x 'is encoded, and then the calculation formula of x' is as follows:
the above is the basic mathematical principle of the ANS. The ANS encodes a series of symbol sequences into natural numbers, similar to the AC (arithmetic coding) algorithm principle.
In fact, equation (3) cannot be directly used for ANS coding, and for convenience in describing the ANS codec flow, two expressions are introduced as follows:
s is the current symbol, x is the current number, x' is the number after encoding, C (-) represents the encoding algorithm, and D (-) represents the decoding algorithm. (x, s) represents the result after decoding.
The formula (3) describes the principle of natural number and (probability) symbol coding, belonging to the local layer. The natural numbers and symbol sequences are encoded as follows: let us assume that the natural number x is combined with the symbol sequence S 1 ,S 2 ,S 3 ,……S n ,]Synthetic coding, the probability of each symbol is [ P1, P2, P3, … … Pn, respectively]。
From a macroscopic point of view, the symbol sequence is encoded by an ANS algorithm, and the final generated number y is:
it is apparent that the natural number calculated by equation (5) is a very large number. Such large numbers are difficult to process by software and hardware due to the bit width of computer data processing. It can be said that it is almost impossible to implement such an ANS codec of "integral packing".
The ANS will convert the symbol sequence to a very large number and therefore it is not possible to construct an infinitely long list. One of the most viable solutions is to construct a fixed length list in the finite field and extend the list to an infinite length, i.e. the symbol distribution function is a periodic function S (x+n×t) =s (x).
Assume that symbol s occurs a number of times f in one period s Then it is apparent that the number of cycles that the xth s will occur isAnd is the mth occurrence in the period, m=mod (x, f s )。
Assuming that the S (x) period length is T, for a particular number y, it is apparent that the symbol at the y position coincides with the symbol at the y' =mod (y, T) position within the 1 st period, i.e., S (y) =s (mod (y, T)). Let S (y') be the mth occurrence in the week, while assuming y is the xth occurrence:
the symbol sequence is encoded by an ANS to obtain a very large natural number, and the current mainstream computer cannot process the very large number, so that the application scene of the ANS is limited. To address this challenge, there is a need to improve the coding mode of the ANS.
Disclosure of Invention
In view of the above, the present invention is directed to an ANS coding-based packaging method, system, storage medium and apparatus, which are used for solving the problem that the application scenario of ANS coding is limited because the mainstream computer cannot process a large number when ANS coding is performed at present.
Based on the above object, the present invention provides a packaging method based on ANS coding, comprising the following steps:
sequentially extracting symbols from the symbol sequence, and carrying out ANS coding on the extracted current symbol to obtain a current coding value;
judging whether the current coding value is larger than a first threshold value or not;
determining that the current code value is a large number in response to the current code value being greater than a first threshold;
for the large number, the low-order part meeting the preset requirement is confirmed, and the low-order part is packaged and then output to the code stream.
In some embodiments, the first threshold is a period value that is the inverse of the sum of probabilities of all symbols in the symbol sequence.
In some embodiments, the lower portion meeting the preset requirement satisfies the following relationship:
wherein n represents the bit width of the lower part, y represents a large number, f next Representing the probability of the next symbol.
In some embodiments, the method further comprises:
judging whether the current coding value is smaller than a second threshold value or not in response to the current coding value being smaller than the first threshold value;
and in response to being smaller than the second threshold value, judging the current coding value to be decimal, and directly outputting the decimal to the code stream.
In some embodiments, the method further comprises:
correspondingly obtaining a high-order part based on the low-order part aiming at the current coding value;
the high order part is used as the synthetic coding object of the next symbol.
In some embodiments, the synthetic encoding object with the high-order portion as the next symbol includes:
the probability of the higher order part divided by the next symbol is used for the synthesis coding.
In some embodiments, the method further comprises:
the high order part and the next symbol are synthesized and encoded to obtain a large number.
In some embodiments, the method further comprises:
and taking the current code value as a synthesized code object of the next symbol in response to the current code value not belonging to the major number or the minor number.
In another aspect of the present invention, there is also provided an ANS coding-based packaging system comprising:
the extraction module is configured to sequentially extract symbols from the symbol sequence, and perform ANS coding on the extracted current symbol to obtain a current coding value;
the judging module is configured to judge whether the current coding value is larger than a first threshold value;
a determination module configured to determine that the current code value is a large number in response to the current code value being greater than a first threshold; and
and the packaging module is configured to confirm the low-order part meeting the preset requirement aiming at the large number, package the low-order part and output the packaged low-order part to the code stream.
In yet another aspect of the present invention, there is also provided a computer readable storage medium storing computer program instructions which, when executed by a processor, implement the above-described method.
In yet another aspect of the present invention, there is also provided a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, performs the above method.
The invention has at least the following beneficial technical effects:
according to the packaging method based on ANS coding, the symbols are sequentially extracted from the symbol sequence, the extracted current symbol is subjected to ANS coding to obtain the current coding value, after the current coding value is judged to be a large number, the low-order part meeting the preset requirement is confirmed, and the low-order part is packaged and then output to the code stream, so that large numbers in the coding process are avoided, the packaging efficiency in the ANS coding process is improved, the problem that the current main stream computer cannot process the large numbers to cause the limitation of ANS coding application scenes is solved, and meanwhile, the streaming decoding is facilitated in the subsequent ANS decoding.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an ANS coding based packaging method provided in accordance with an embodiment of the present invention;
FIG. 2 is a schematic diagram of an ANS coding based packaging system provided in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer readable storage medium implementing an ANS coding based packaging method according to an embodiment of the present invention;
fig. 4 is a schematic hardware structure diagram of a computer device for performing an ANS coding-based encapsulation method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present invention, all the expressions "first" and "second" are used to distinguish two non-identical entities with the same name or non-identical parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present invention. Furthermore, the terms "comprise" and "have," and any variations thereof, are intended to cover a non-exclusive inclusion, such as a process, method, system, article, or other step or unit that comprises a list of steps or units.
With the above object in view, in a first aspect, embodiments of an embodiment of the present invention are presented for an ANS coding based packaging method. Fig. 1 is a schematic diagram of an embodiment of an ANS coding based packaging method provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
step S10, sequentially extracting symbols from a symbol sequence, and performing ANS coding on the extracted current symbol to obtain a current coding value;
step S20, judging whether the current coding value is larger than a first threshold value or not;
step S30, judging that the current coding value is a large number in response to the fact that the current coding value is larger than a first threshold value;
step S40, for the large number, confirming the low-order part which meets the preset requirement, and outputting the packaged low-order part to the code stream.
According to the packaging method based on ANS coding, the symbols are sequentially extracted from the symbol sequence, the extracted current symbol is subjected to ANS coding to obtain the current coding value, after the current coding value is judged to be a large number, the low-order part meeting the preset requirement is confirmed, and the low-order part is packaged and then output to the code stream, so that large numbers in the coding process are avoided, the packaging efficiency in the ANS coding process is improved, the problem that the current main stream computer cannot process the large numbers to cause the limitation of ANS coding application scenes is solved, and meanwhile, stream decoding is facilitated in the subsequent ANS decoding.
The packaging method based on ANS coding of the embodiment of the invention is suitable for an ANS (Asymmetric Numeral Systems, asymmetric digital system) algorithm with periodicity, and requires that the value of the period T is 2 to the integer power of 2 n (n≈10)。
In some embodiments, the first threshold is a period value that is the inverse of the sum of probabilities of all symbols in the symbol sequence.
In some embodiments, the lower portion meeting the preset requirement satisfies the following relationship:
wherein n represents the bit width of the lower part, y represents a large number, f next Representing the probability of the next symbol.
In some embodiments, the method further comprises: judging whether the current coding value is smaller than a second threshold value or not in response to the current coding value being smaller than the first threshold value; and in response to being smaller than the second threshold value, judging the current coding value to be decimal, and directly outputting the decimal to the code stream.
In some embodiments, the method further comprises: correspondingly obtaining a high-order part based on the low-order part aiming at the current coding value; the high order part is used as the synthetic coding object of the next symbol.
In this embodiment, since the current encoded value is composed of the high-order part and the low-order part, the high-order part can be obtained correspondingly based on the low-order part.
In some embodiments, the synthetic encoding object with the high-order portion as the next symbol includes: the probability of the higher order part divided by the next symbol is used for the synthesis coding.
In some embodiments, the method further comprises: the high order part and the next symbol are synthesized and encoded to obtain a large number.
In some embodiments, the method further comprises: and taking the current code value as a synthesized code object of the next symbol in response to the current code value not belonging to the major number or the minor number.
The following are specific embodiments of the ANS coding based encapsulation method of the present invention:
in this embodiment, it is assumed that the previous major number is split and packaged to obtain a decimal x 0 The next symbol is S next To realize the stream encapsulation function of the present invention, a stream encoderCase must ensure S next In any case a large number. If S next Instead of a large number, the decoding end cannot know the exact bit width of the data to be read.
1) First, the method for judging the large number is as follows: a common decision method is a threshold decision method. In this embodiment, a fixed threshold (i.e., a first threshold) is used to determine the large number: thresh 1 =T=2 n Where T represents a period value, and for any number greater than T, it will be determined as a large number.
2) The second is the decimal judging method: in this embodiment, the "adaptive" thresholding method is used to determine the decimal: threshold (i.e. second threshold) and next symbol S next Probability f of (f) next Correlation, thresh 2 =2×f next When a number x is less than the threshold, the number y will be determined to be a decimal.
3) A large number of segmentation rules: the allocation of the encapsulation portion, the reserved portion, and the bit width determination. The segmentation rule is as follows: the package portion is a large number of low bit portions (LSBs), while a large number of high bit portions (MSBs) are reserved. Bit width of LSB and MSB is determined by threshold value Thresh of decimal 2 And (3) determining:
assuming that the large number is y, the probability of the next symbol is f next Then the bit width n of the LSB portion satisfies the relationship:
wherein n represents the bit width of the lower part, y represents a large number, f next The probability of the next symbol is represented,>>representing a right shift operation, which is to shift an operand of one binary bit to the right by the number of bits specified to be shifted, the shifted-out bit is discarded.
In the above equation, the first half is for determining the decimal, and the second half is for ensuring that the MSB and the next symbol are encoded to obtain a decimal.
The pseudo code to achieve the calculation of the bit width n of the package portion is as follows:
the block coding pseudocode is as follows:
the pseudo code used in the decoding flow in this embodiment is as follows:
in a second aspect of the embodiments of the present invention, there is also provided a packaging system based on ANS encoding. Fig. 2 is a schematic diagram of an embodiment of an ANS-coding based packaging system provided by the present invention. As shown in fig. 2, an ANS coding-based packaging system includes: the extraction module 10 is configured to sequentially extract symbols from the symbol sequence, and perform ANS coding on the extracted current symbol to obtain a current coding value; a judging module 20 configured to judge whether the current code value is greater than a first threshold value; a determination module 30 configured to determine that the current code value is a large number in response to the current code value being greater than a first threshold; and a packaging module 40 configured to identify, for the large number, a low-order part that meets a preset requirement, and package the low-order part and output the packaged low-order part to the code stream.
According to the packaging system based on ANS coding, the symbols are sequentially extracted from the symbol sequence, the extracted current symbol is subjected to ANS coding to obtain the current coding value, after the current coding value is judged to be a large number, the low-order part meeting the preset requirement is confirmed, and the low-order part is packaged and then output to the code stream, so that large numbers in the coding process are avoided, the packaging efficiency in the ANS coding process is improved, the problem that the current main stream computer cannot process the large numbers to cause the limitation of ANS coding application scenes is solved, and meanwhile, the streaming decoding is facilitated in the subsequent ANS decoding.
The packaging method based on ANS coding is suitable for an ANS algorithm with periodicity, and requires that the value of the period T is 2 to the integer power of 2 n (n≈10)。
In some embodiments, the first threshold is a period value that is the inverse of the sum of probabilities of all symbols in the symbol sequence.
In some embodiments, the lower portion meeting the preset requirement satisfies the following relationship:
wherein n represents the bit width of the lower part, y represents a large number, f next Representing the probability of the next symbol.
In some embodiments, the system further comprises a fractional output module configured to determine, in response to the current encoding value being less than a first threshold, whether the current encoding value is less than a second threshold; and in response to being smaller than the second threshold value, judging the current coding value to be decimal, and directly outputting the decimal to the code stream.
In some embodiments, the system further comprises a high-order module configured to obtain, for the current encoded value, a high-order portion based on the low-order portion, respectively; the high order part is used as the synthetic coding object of the next symbol.
In some embodiments, the high-order module includes a synthesis encoding module configured to use the probability of the high-order portion divided by the next symbol for synthesis encoding.
In some embodiments, the system further comprises a large number module configured to synthesize the encoded high order part with the next symbol to obtain a large number.
In some embodiments, the system further comprises an object module configured to, in response to the current encoded value not belonging to the major or minor number, take the current encoded value as a synthetic encoded object for a next symbol.
Specifically, it is assumed that the previous large number is cut and packaged to obtain a fraction x 0 The next symbol is S next To implement the streaming encapsulation function of the present invention, the streaming coding scheme must ensure S next In any case a large number. If S next Instead of a large number, the decoding end cannot know the exact bit width of the data to be read.
1) First, the method for judging the large number is as follows: a common decision method is a threshold decision method. In this embodiment, a fixed threshold (i.e., a first threshold) is used to determine the large number: thresh 1 =T=2 n Where T represents a period value, and for any number greater than T, it will be determined as a large number.
2) The second is the decimal judging method: in this embodiment, the "adaptive" thresholding method is used to determine the decimal: threshold (i.e. second threshold) and next symbol S next Probability f of (f) next Correlation, thresh 2 =2×f next When a number x is less than the threshold, the number y will be determined to be a decimal.
3) A large number of segmentation rules: the allocation of the encapsulation portion, the reserved portion, and the bit width determination. The segmentation rule is as follows: the package portion is a large number of low bit portions (LSBs), while a large number of high bit portions (MSBs) are reserved. Bit width of LSB and MSB is determined by threshold value Thresh of decimal 2 And (3) determining:
assuming that the large number is y, the probability of the next symbol is f next Then the bit width n of the LSB portion satisfies the relationship:
wherein n represents the bit width of the lower part, y represents a large number, f next The probability of the next symbol is represented,>>representing a right shift operation, which is a bit in which an operand of one binary bit is shifted by a specified bitThe number is shifted to the right and the shift-out bit is discarded.
In the above equation, the first half is for determining the decimal, and the second half is for ensuring that the MSB and the next symbol are encoded to obtain a decimal.
In a third aspect of the embodiments of the present invention, there is further provided a computer readable storage medium, and fig. 3 is a schematic diagram of a computer readable storage medium implementing an ANS encoding-based packaging method according to an embodiment of the present invention. As shown in fig. 3, the computer-readable storage medium 3 stores computer program instructions 31. The computer program instructions 31 when executed by a processor implement the steps of:
sequentially extracting symbols from the symbol sequence, and carrying out ANS coding on the extracted current symbol to obtain a current coding value;
judging whether the current coding value is larger than a first threshold value or not;
determining that the current code value is a large number in response to the current code value being greater than a first threshold;
for the large number, the low-order part meeting the preset requirement is confirmed, and the low-order part is packaged and then output to the code stream.
In some embodiments, the first threshold is a period value that is the inverse of the sum of probabilities of all symbols in the symbol sequence.
In some embodiments, the lower portion meeting the preset requirement satisfies the following relationship:
wherein n represents the bit width of the lower part, y represents a large number, f next Representing the probability of the next symbol.
In some embodiments, the steps further comprise: judging whether the current coding value is smaller than a second threshold value or not in response to the current coding value being smaller than the first threshold value; and in response to being smaller than the second threshold value, judging the current coding value to be decimal, and directly outputting the decimal to the code stream.
In some embodiments, the steps further comprise: correspondingly obtaining a high-order part based on the low-order part aiming at the current coding value; the high order part is used as the synthetic coding object of the next symbol.
In some embodiments, the synthetic encoding object with the high-order portion as the next symbol includes: the probability of the higher order part divided by the next symbol is used for the synthesis coding.
In some embodiments, the steps further comprise: the high order part and the next symbol are synthesized and encoded to obtain a large number.
In some embodiments, the steps further comprise: and taking the current code value as a synthesized code object of the next symbol in response to the current code value not belonging to the major number or the minor number.
It should be understood that all of the embodiments, features and advantages set forth above for the ANS coding based packaging method according to the present invention apply equally, without conflict, to the ANS coding based packaging system and storage medium according to the present invention.
In a fourth aspect of the embodiment of the present invention, there is also provided a computer device, including a memory 402 and a processor 401 as shown in fig. 4, where the memory 402 stores a computer program, and the computer program is executed by the processor 401 to implement the method of any one of the embodiments above.
As shown in fig. 4, a hardware configuration diagram of an embodiment of a computer device for performing an ANS coding-based encapsulation method is provided. Taking the example of a computer device as shown in fig. 4, a processor 401 and a memory 402 are included in the computer device, and may further include: an input device 403 and an output device 404. The processor 401, memory 402, input device 403, and output device 404 may be connected by a bus or otherwise, for example in fig. 4. The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the ANS-code based packaging system. The output 404 may include a display device such as a display screen.
The processor 401 executes various functional applications of the server and data processing, i.e. implements the ANS coding based packaging method of the above method embodiments by running non-volatile software programs, instructions and modules stored in the memory 402.
Finally, it should be noted that the computer-readable storage media (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP and/or any other such configuration.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. The foregoing embodiment of the present invention has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the invention, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the invention, and many other variations of the different aspects of the embodiments of the invention as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present invention.
Claims (10)
1. An ANS coding based packaging method comprising the steps of:
sequentially extracting symbols from the symbol sequence, and carrying out ANS coding on the extracted current symbol to obtain a current coding value;
judging whether the current coding value is larger than a first threshold value or not;
determining that the current code value is a large number in response to the current code value being greater than the first threshold;
and for the large number, confirming a low-order part which meets the preset requirement, packaging the low-order part and outputting the packaged low-order part to a code stream.
2. The method of claim 1, wherein the first threshold is a period value that is the inverse of the sum of probabilities of all symbols in the sequence of symbols.
4. The method as recited in claim 1, further comprising:
in response to the current code value being less than the first threshold, determining whether the current code value is less than a second threshold;
and in response to being smaller than the second threshold value, judging the current coding value to be a decimal, and directly outputting the decimal to the code stream.
5. The method as recited in claim 1, further comprising:
correspondingly obtaining a high-order part based on the low-order part aiming at the current coding value;
and taking the high-order part as a synthetic coding object of the next symbol.
6. The method of claim 5, wherein taking the higher-order portion as a synthetic encoding object of a next symbol comprises:
the probability of the next symbol is divided by the upper portion to perform synthesis coding.
7. The method as recited in claim 5, further comprising:
and synthesizing and encoding the high-order part and the next symbol to obtain the large number.
8. The method as recited in claim 1, further comprising:
and in response to the current code value not belonging to the large number or the small number, taking the current code value as a synthesized code object of a next symbol.
9. An ANS coding based packaging system comprising:
the extraction module is configured to sequentially extract symbols from the symbol sequence, and perform ANS coding on the extracted current symbol to obtain a current coding value;
the judging module is configured to judge whether the current coding value is larger than a first threshold value or not;
a determination module configured to determine that the current encoding value is a large number in response to the current encoding value being greater than the first threshold; and
and the packaging module is configured to confirm a low-order part meeting preset requirements aiming at the large number, package the low-order part and output the packaged low-order part to the code stream.
10. A computer readable storage medium, characterized in that computer program instructions are stored, which, when executed by a processor, implement the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310231231.2A CN116366071A (en) | 2023-03-08 | 2023-03-08 | Packaging method, packaging system, storage medium and packaging equipment based on ANS (analog to digital) coding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310231231.2A CN116366071A (en) | 2023-03-08 | 2023-03-08 | Packaging method, packaging system, storage medium and packaging equipment based on ANS (analog to digital) coding |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116366071A true CN116366071A (en) | 2023-06-30 |
Family
ID=86933835
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310231231.2A Pending CN116366071A (en) | 2023-03-08 | 2023-03-08 | Packaging method, packaging system, storage medium and packaging equipment based on ANS (analog to digital) coding |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116366071A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117095752A (en) * | 2023-08-21 | 2023-11-21 | 基诺创物(武汉市)科技有限公司 | DNA protein coding region streaming data storage method capable of keeping codon preference |
-
2023
- 2023-03-08 CN CN202310231231.2A patent/CN116366071A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117095752A (en) * | 2023-08-21 | 2023-11-21 | 基诺创物(武汉市)科技有限公司 | DNA protein coding region streaming data storage method capable of keeping codon preference |
CN117095752B (en) * | 2023-08-21 | 2024-03-19 | 基诺创物(武汉市)科技有限公司 | DNA protein coding region streaming data storage method capable of keeping codon preference |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Duda | Asymmetric numeral systems: entropy coding combining speed of Huffman coding with compression rate of arithmetic coding | |
JPH0793586B2 (en) | Data compression model selection method and system | |
ES2878325T3 (en) | Binary arithmetic coding with parameterized probability estimation finite state machines | |
KR100733795B1 (en) | Method and arrangement for arithmetically encoding and decoding binary states, corresponding computer program, and corresponding computer-readable storage medium | |
CN108322220A (en) | Decoding method, device and coding/decoding apparatus | |
US11722148B2 (en) | Systems and methods of data compression | |
CN116366071A (en) | Packaging method, packaging system, storage medium and packaging equipment based on ANS (analog to digital) coding | |
Nikara et al. | Multiple-symbol parallel decoding for variable length codes | |
CN110413580B (en) | Compression method, system and device for FPGA configuration code stream | |
JP6159240B2 (en) | Binary arithmetic encoding device, binary arithmetic encoding method, and binary arithmetic encoding program | |
US20220368345A1 (en) | Hardware Implementable Data Compression/Decompression Algorithm | |
JPH11340838A (en) | Coder and decoder | |
CN106537914B (en) | The method and apparatus of arithmetic compiling is executed by the carry operations of limitation | |
CN113630125A (en) | Data compression method, data encoding method, data decompression method, data encoding device, data decompression device, electronic equipment and storage medium | |
CN113746487A (en) | Data compression method and device, electronic equipment and storage medium | |
JP3161697B2 (en) | Encoding device, decoding device, encoding / decoding device, and methods thereof | |
CN110120819B (en) | Boolean circuit coding method, device and system | |
CN115765755A (en) | ANS coding and decoding method, equipment and medium based on finite field multiplication | |
CN114429200A (en) | Standardized Huffman coding and decoding method and neural network computing chip | |
JP2005521324A (en) | Method and apparatus for lossless data compression and decompression | |
CN111181568A (en) | Data compression device and method, data decompression device and method | |
WO2011162964A2 (en) | System and method and computer program product for parameter estimation for lossless video compression | |
CN116248130A (en) | ANS coding-based data processing method, system, storage medium and device | |
KR100207428B1 (en) | Variable length coding apparatus and method adaptive to changes of the hoffman codes | |
JP2004056417A (en) | Decoder and decoding method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |