Data compression encoding method, device, equipment and storage medium

The proposed order value of the exponential Golomb coding is obtained by using a probabilistic statistical method, which solves the problem of long calculation time in the existing technology and achieves more efficient data compression.

CN116347087BActive Publication Date: 2025-10-03HUNAN GOKE MICROELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310164955.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2025-10-03
Estimated Expiration
2043-02-24

AI Technical Summary

Technical Problem

When calculating the optimal order of exponential Golomb coding, the existing technology needs to compare the number of bits at each order in sequence, resulting in excessively long calculation time and low compression efficiency when the probability of digital distribution is uniform.

Method used

The number of digital types, occurrence times and total amount of the data to be compressed are obtained through probabilistic statistical methods, the probability distribution information is calculated, the recommended order value of the exponential Golomb coding is determined based on the sorting information, and the optimal order value is directly or further determined for encoding.

Benefits of technology

It effectively reduces the time for calculating the number of bits of the Exponential Golomb coding and improves the data compression efficiency, especially significantly improving the coding speed when the numbers are evenly distributed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116347087B_ABST
    Figure CN116347087B_ABST
Patent Text Reader

Abstract

This application discloses a data compression encoding method, apparatus, device, and storage medium. The method comprises obtaining the number of digit types, the number of occurrences of each digit, and the total number of digits in the data to be compressed; obtaining probability distribution information of each digit in the data to be compressed based on the number of digit types, the number of occurrences of each digit, and the total number of digits in the data to be compressed; determining a recommended order value of an Exponential Golomb code for encoding the data to be compressed based on the probability distribution information; and performing Exponential Golomb coding on the data to be compressed based on the recommended order value. This application can effectively reduce the time required to calculate the number of bits of the Exponential Golomb code for the data to be compressed, thereby effectively improving data compression efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital video processing technology, and in particular to a data compression encoding method, apparatus, device and storage medium. Background Art

[0002] Exponential-Golomb coding is a universal lossless data compression method widely used in fields such as digital video processing. It is a variable-length coding method that uses shorter code lengths to encode smaller numbers and longer code lengths to encode larger numbers. Exponential-Golomb coding consists of two parts: a prefix and a suffix. Both of these parts depend on the order k of the Exponential-Golomb coding. Therefore, when using Exponential-Golomb coding to encode and compress data, it is crucial to select the order K of the Exponential-Golomb coding used to encode the data based on the distribution probability of each number in the data to be compressed.

[0003] In the related prior art, the optimal value of the exponential Golomb coding order K is usually determined by sequentially comparing the number of bits of the corresponding exponential Golomb coding of the data to be compressed at each order K. The specific process is as follows: first, the number of bits of the data to be compressed when the order K=0 is obtained according to the sum of the exponential Golomb coding lengths of each digit of the data to be compressed, and then the number of bits of the data to be compressed when the order K=1 is calculated, and the number of bits of the data to be compressed when the order K=0 is compared with the number of bits of the data to be compressed when the order K=1 is compared. When the number of bits when the order K=1 is relatively small, the number of bits to be compressed needs to be further calculated. The number of bits of the data to be compressed when the order K=2 is calculated, and then the number of bits of the data to be compressed when the order K=1 and the order K=2 are compared, until the number of bits of the data to be compressed under the currently calculated order K is greater than the number of bits under the last calculated order K. The optimal exponential Columbus coding order K of the data to be compressed can be obtained (that is, the last order K is selected as the optimal order of the exponential Columbus coding of the data to be compressed), and then the optimal exponential Columbus coding order K is used to encode and compress the data to be compressed, so that the number of bits of the data to be compressed after being compressed by the exponential Columbus coding is minimized.

[0004] When the above method is used to calculate the optimal order K of the exponential Golomb coding, the more evenly the distribution probability of each number in the data to be compressed is, the larger the optimal order K is. The more times the number of bits after the exponential Golomb coding of the data to be compressed needs to be calculated, the longer the calculation time of the optimal order K is, which may lead to low data compression efficiency. Summary of the Invention

[0005] To address the above technical issues, the present application provides a data compression encoding method that can effectively reduce the time required to calculate the number of bits of the Exponential Golomb coding of the compressed data, thereby effectively improving the data compression efficiency. The present application also provides a data compression encoding device, device, and storage medium, all having the same technical effects.

[0006] The first object of this application is to provide a data compression encoding method.

[0007] The above-mentioned application objective 1 of this application is achieved through the following technical solutions:

[0008] A data compression encoding method, comprising:

[0009] Obtain the number of digit types, the number of occurrences of various digits, and the total number of digits in the data to be compressed;

[0010] Obtaining probability distribution information of various numbers in the data to be compressed based on the number of types of numbers in the data to be compressed, the number of occurrences of various numbers, and the total number of numbers;

[0011] determining a recommended value of an order of an exponential Golomb code for encoding the data to be compressed based on the probability distribution information;

[0012] The data to be compressed is subjected to exponential Golomb coding based on the order recommendation value.

[0013] Preferably, the obtaining of probability distribution information of various numbers in the data to be compressed based on the number of types of numbers, the number of occurrences of various numbers, and the total number of numbers in the data to be compressed includes:

[0014] A probability distribution diagram of various numbers in the data to be compressed is obtained by performing a probability distribution calculation based on the number of types of numbers in the data to be compressed, the number of occurrences of various numbers, and the total number of numbers.

[0015] Preferably, determining a recommended value of an order of an Exponential Golomb code for encoding the data to be compressed based on the probability distribution information includes:

[0016] Based on the number of occurrences of various numbers in the data to be compressed, sorting the various numbers in the data to be compressed in descending order of the number of occurrences to obtain sorting information;

[0017] A recommended value of an order of an Exponential Golomb code for encoding the data to be compressed is determined based on the sorting information.

[0018] Preferably, determining the recommended value of the order of the Exponential Golomb code for encoding the to-be-compressed data based on the sorting information includes:

[0019] Step a, initialize the number of calculations L;

[0020] Step b, calculate the sum of the occurrence times of the top P numbers after sorting based on the sorting information, where P = 1 << L, and << represents the left shift operation;

[0021] Step c, determine whether the sum value is greater than or equal to half of the total number of digits. If so, execute step d; if not, execute step e;

[0022] Step d, determine the current number of calculations L as the order recommendation value of the exponential Golomb code for encoding the data to be compressed;

[0023] Step e, calculate L + 1, and jump to step b

[0024] Preferably, after determining the order recommendation value of the exponential Golomb code for encoding the data to be compressed based on the probability distribution information, the method further includes:

[0025] Determine the optimal order value according to the order recommendation value;

[0026] The exponential Golomb coding of the data to be compressed based on the order recommendation value includes:

[0027] Perform exponential Golomb coding on the data to be compressed based on the optimal order value.

[0028] Preferably, the determining the optimal order value according to the order recommendation value includes:

[0029] When the order recommendation value is greater than or equal to 1, calculate the number of bits of the exponential Golomb coding of the data to be compressed when the exponential Golomb coding order value is the order recommendation value and the order recommendation value minus 1, respectively;

[0030] Determine the exponential Golomb coding order value corresponding to the smaller number of bits as the optimal order value.

[0031] The second object of the present application is to provide a data compression coding device.

[0032] The above object two of the present application is achieved by the following technical solutions:

[0033] A data compression coding device, including:

[0034] A data statistics module, used to obtain the number of digital types of the data to be compressed, the occurrence times of various digits, and the total number of digits;

[0035] a probability distribution determination module, configured to obtain probability distribution information of various numbers in the data to be compressed based on the number of types of numbers, the number of occurrences of various numbers, and the total number of numbers in the data to be compressed;

[0036] a coding order recommended value determination module, configured to determine a recommended order value of an Exponential Golomb code for encoding the data to be compressed based on the probability distribution information;

[0037] An encoding module is used to perform exponential Golomb encoding on the data to be compressed based on the order recommendation value.

[0038] Preferably, the probability distribution determination module is specifically used to:

[0039] A probability distribution diagram of various numbers in the data to be compressed is obtained by performing a probability distribution calculation based on the number of types of numbers in the data to be compressed, the number of occurrences of various numbers, and the total number of numbers.

[0040] Preferably, the coding order recommended value determination module includes:

[0041] a data sorting unit, configured to sort the various numbers in the data to be compressed in descending order of the number of occurrences of the various numbers in the data to be compressed, based on the number of occurrences of the various numbers in the data to be compressed, to obtain sorting information;

[0042] An order recommendation value determining unit is used to determine an order recommendation value of an Exponential Golomb code used to encode the data to be compressed based on the sorting information.

[0043] The third object of this application is to provide a data compression encoding device.

[0044] The third object of the present application is achieved through the following technical solutions:

[0045] A data compression encoding device, comprising:

[0046] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the data compression encoding method described in any one of the first objectives of the present application are implemented.

[0047] The fourth object of this application is to provide a computer-readable storage medium.

[0048] The fourth object of the present application is achieved through the following technical solutions:

[0049] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the data compression encoding method described in any one of the first objectives of the present application.

[0050] In summary, the present application discloses a data compression encoding method, apparatus, device and storage medium. When digital video data needs to be compressed and encoded, the number of digital types, the number of occurrences of various numbers and the total number of numbers in the data to be compressed are first obtained; then, based on the number of digital types, the number of occurrences of various numbers and the total number of numbers in the data to be compressed, the probability distribution information of various numbers in the data to be compressed is obtained; then, based on the probability distribution information, the recommended order value of the exponential Columbus code used to encode the data to be compressed is determined; finally, the data to be compressed is exponentially Columbus encoded based on the recommended order value.

[0051] The present application calculates the probability distribution of the number of types of digits in the data to be compressed, the number of occurrences of various digits, and the total number of digits based on a probability statistics method, and then analyzes the probability distribution of various digits in the data to be compressed, and obtains the order value of the exponential Columbus code of the data to be compressed through the probability distribution information of the data to be compressed. Finally, the exponential Columbus code is performed on the data to be compressed according to the obtained order value, effectively reducing the time for repeatedly calculating the number of bits of the exponential Columbus code of each order of the data to be compressed, thereby effectively improving the data compression efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 A flowchart of a data compression encoding method according to an embodiment of the present application is shown;

[0054] Figure 2 A histogram of the probability distribution of various numbers of the data to be compressed in a specific example of the present application;

[0055] Figure 3 Flowchart of a method for determining a recommended order value of an Exponential Golomb code for encoding data to be compressed based on sorting information in an embodiment of the present application;

[0056] Figure 4 This is a structural diagram of a data compression encoding device according to an embodiment of the present application;

[0057] Figure 5 This is a structural diagram of a data compression encoding device in an embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to help those skilled in the art better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of this application.

[0059] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely illustrative. For example, the division of units and modules is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or modules can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0060] In addition, all functional units in the embodiments of the present application may be integrated into one processor, or each unit may be a separate device, or two or more units may be integrated into one device; each functional unit in the embodiments of the present application may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0061] Those skilled in the art will understand that all or part of the steps of the following method embodiments can be implemented by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, the steps of the following method embodiments are executed; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.

[0062] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. Throughout the description of this application, "plurality" or "several" means two or more, unless otherwise specifically defined.

[0063] like Figure 1 As shown, an embodiment of the present application provides a data compression encoding method, which may include the following steps:

[0064] S101: Obtain the number of digit types, the number of occurrences of various digits, and the total number of digits in the data to be compressed.

[0065] When using Exponential Golomb coding to compress data, it is necessary to select the optimal Exponential Golomb coding order K to minimize the number of bits after compression. Therefore, to improve compression efficiency, it is particularly important to quickly and accurately calculate the optimal Exponential Golomb coding order K for the data being compressed.

[0066] In this embodiment, a probabilistic statistical method is used to select the optimal order K of the exponential Golomb coding based on the distribution probability of each number in the data to be compressed. In this way, compared with the method in the prior art of determining the value of the optimal exponential Golomb coding order K by sequentially comparing the number of bits of the corresponding exponential Golomb coding of the data to be compressed at each order K, the time for repeatedly calculating the number of bits of the exponential Golomb coding of each order of the data to be compressed is effectively reduced, thereby improving the compression efficiency.

[0067] Specifically, in this embodiment, the data to be compressed refers to digital video data to be compressed. Since digital video data is usually represented by numbers before compression, when using a probabilistic statistical method to select the optimal order K of the exponential Golomb coding according to the distribution probability of each number in the data to be compressed, it is first necessary to calculate the number of types of numbers in the data to be compressed, the number of occurrences of various numbers, and the total number of numbers.

[0068] Assuming that the data to be compressed is 0000123, the digital range of the data to be compressed is 0 to 3. Through calculation, it can be obtained that the number of digital types of the data to be compressed is 4 (that is, there are 4 numbers 0, 1, 2, and 3 in the data to be compressed), the number of occurrences of various numbers (the number 0 appears 4 times, and the numbers 1, 2, and 3 appear 1 time respectively), and the total number of numbers is 7 (that is, there are 4+1+1+1=7 numbers in the data to be compressed).

[0069] S102: Obtain probability distribution information of various numbers in the data to be compressed based on the number of types of numbers, the number of occurrences of various numbers, and the total number of numbers in the data to be compressed.

[0070] After calculating the number of types of digits, the number of occurrences of various digits, and the total number of digits in the data to be compressed, it is necessary to calculate the probability distribution information of the data to be compressed based on the above data information, that is, to obtain the probability distribution information of various digits in the data to be compressed based on the number of types of digits, the number of occurrences of various digits, and the total number of digits in the data to be compressed.

[0071] In this embodiment, the specific method for obtaining the probability distribution information of various numbers in the data to be compressed is as follows:

[0072] Based on the number of digit types, the number of occurrences of various digits, and the total number of digits in the data to be compressed, a probability distribution diagram of various digits in the data to be compressed is obtained. Specifically, in this embodiment, the probability distribution diagram is a histogram.

[0073] Specifically, the probability distribution histogram of various numbers of the data to be compressed 0000123 obtained by probability distribution calculation in this embodiment is as follows: Figure 2 As shown, the values ​​of the horizontal axis represent various types of numbers in the data to be compressed, and the values ​​of the vertical axis represent the number of occurrences of various numbers in the data to be compressed.

[0074] S103: Determine a recommended value of an order of an Exponential Golomb code for encoding the data to be compressed based on the probability distribution information.

[0075] After obtaining the probability distribution information of various numbers in the data to be compressed through probability distribution calculation, it is necessary to further analyze the probability distribution of various numbers in the data to be compressed, and obtain the recommended order value of the exponential Columbus code of the data to be compressed through the probability distribution information of the data to be compressed, that is, the recommended order value of the exponential Columbus code is calculated based on the probability distribution information of various numbers in the data to be compressed.

[0076] In this embodiment, determining the recommended value of the order of the Exponential Golomb code for encoding the to-be-compressed data based on the probability distribution information includes:

[0077] Based on the number of occurrences of various numbers in the data to be compressed, sorting the various numbers in the data to be compressed in descending order of the number of occurrences to obtain sorting information;

[0078] A recommended value of an order of an Exponential Golomb code for encoding the data to be compressed is determined based on the sorting information.

[0079] Specifically, for the data to be compressed 0000123, according to its Figure 2From the histogram of the probability distribution shown, in the data to be compressed, the number 0 appears 4 times, and the numbers 1, 2, and 3 appear 1 time each. After sorting the occurrence times of various numbers in the data to be compressed in descending order, we get 0 (4 times), 1 (1 time), 2 (1 time), 3 (1 time). Then, according to the sorting information obtained, the recommended value of the order of the Exponential Golomb code used to encode the data to be compressed is determined.

[0080] As Figure 3 shown, in this embodiment, determining the recommended value of the order of the Exponential Golomb code used to encode the data to be compressed based on the sorting information specifically includes the following steps:

[0081] Step a, initialize the calculation count L, that is, set the calculation count L to the initial value 0, i.e., set L = 0.

[0082] Step b, based on the sorting information, calculate the sum of the occurrence times of the first P sorted numbers to obtain the sum value. Here, P = 1 << L, and << represents the left shift operation. From the formula P = 1 << L, the value of P is the decimal number corresponding to the binary value obtained by shifting the binary value of 1 to the left by L bits. Specifically, when L = 0, according to the formula P = 1 << L, we can calculate that P = 1. Similarly, when L = 1, P = 2; when L = 2, P = 4; when L = 3, P = 8, and so on. We can calculate the corresponding value of P according to different values of L. Taking L = 0 as an example, calculate the sum value, that is, P = 1 << 0, and we get P = 1. Then calculate the sum of the occurrence times of the first 1 sorted number to obtain the sum value. According to the sorting information, the occurrence times of the first 1 sorted number (i.e., the number 0) is 4 times, so the sum value = 4.

[0083] Step c, determine whether the sum value is greater than or equal to half of the total number of digits. If so, execute step d; if not, execute step e. In this embodiment, when L = 0, the sum value of the data to be compressed 0000123 is 4, and the total number of digits of the data to be compressed is 7. It can be seen that 4 is greater than or equal to 7 / 2, so at this time, the calculation can be stopped and step d can be directly executed. Of course, for some other data to be compressed, if the sum value when L = 0 is not greater than or equal to half of the total number of digits, step e needs to be continued.

[0084] In step d, the current number of calculations, L, is determined as a recommended order value for the Exponential Golomb code used to encode the data to be compressed. When the sum of the number of calculations is greater than or equal to half of the total number of digits, L can be directly used as the recommended order value for the Exponential Golomb code. Specifically, for the data to be compressed 0000123 in this embodiment, since the sum of the number of calculations is greater than or equal to half of the total number of digits when L=0, L=0 is used as the recommended order value for the Exponential Golomb code, i.e., the recommended order value for the Exponential Golomb code of the data to be compressed 0000123 is 0.

[0085] In step e, increment the calculation count L by 1 and jump to step b. If the sum of the times is greater than or equal to half of the total number of digits, then increment L by 1 and calculate the sum of the occurrences of the first P numbers after sorting again to obtain the sum of the times. Repeat this process until the sum of the times is greater than or equal to half of the total number of digits.

[0086] S104: Perform exponential Golomb coding on the data to be compressed based on the order recommendation value.

[0087] After calculating the recommended value of the order of the Exponential Golomb coding, it is necessary to further perform Exponential Golomb coding on the data to be compressed according to the recommended value of the order of the Exponential Golomb coding, so as to achieve compression coding of the data to be compressed.

[0088] To sum up, the above embodiment performs probability distribution calculation on the number of types of digits, the number of occurrences of various digits and the total number of digits in the data to be compressed based on the probability statistics method, and then analyzes the probability distribution of various digits in the data to be compressed, and obtains the recommended order value of the exponential Golumbus code of the data to be compressed through the probability distribution information of the data to be compressed, and finally performs exponential Golumbus coding on the data to be compressed according to the recommended order value of the exponential Golumbus code of the data to be compressed. This can save or reduce the time for querying and calculating the exponential Golumbus code length of the data to be compressed, and effectively reduce the time for repeatedly calculating the number of bits of the exponential Golumbus codes of each order of the data to be compressed, thereby effectively improving the data compression efficiency.

[0089] On the basis of the above embodiment, in S104, the exponential Golumbus encoding of the data to be compressed based on the order recommendation value can specifically adopt but is not limited to the following method to perform exponential Golumbus encoding on the data to be compressed: using the order recommendation value L of the exponential Golumbus encoding as the order value of the exponential Golumbus encoding used to compress the data to be compressed to perform exponential Golumbus encoding on the data to be compressed.

[0090] In this method, the recommended order value L of the exponential Golumbus code is directly used as the order value of the exponential Golumbus code used to compress the data to be compressed. In this way, although the order value L used for the exponential Golumbus code of the data to be compressed is not necessarily the actual optimal order value of the exponential Golumbus code, the recommended order value L is very close to the actual optimal order value of the exponential Golumbus code. Since this method can save the time of querying and calculating the exponential Golumbus code length of the data to be compressed, and there is no need to calculate the number of bits of each order of the exponential Golumbus code of the data to be compressed, the time for determining the optimal order of the exponential Golumbus code can be greatly reduced, and thus the data compression efficiency can be better improved.

[0091] In order to obtain a more accurate and reliable order value of the Exponential Golomb code used to compress the data to be compressed so as to reduce the length of the encoded data to be compressed, based on the above embodiment, preferably, after determining the recommended order value of the Exponential Golomb code used to encode the data to be compressed based on the probability distribution information in step S103, the method further includes:

[0092] determining an optimal order value according to the order suggested value;

[0093] Accordingly, performing exponential Golomb coding on the data to be compressed based on the order recommendation value includes:

[0094] The data to be compressed is subjected to exponential Golomb coding based on the optimal order value.

[0095] Specifically, determining the optimal order value according to the order recommendation value includes:

[0096] When the order recommended value is greater than or equal to 1, respectively calculating the number of bits of the exponential Golomb coding of the to-be-compressed data when the exponential Golomb coding order value is the order recommended value and the order recommended value minus 1;

[0097] The Exponential Golomb coding order value corresponding to the smaller number of bits is determined as the optimal order value.

[0098] It can be understood that since L or L-1 needs to be used as the exponential Golomb coding order value, and the exponential Golomb coding order value cannot be negative, when determining the optimal order value based on the order recommendation value L, it is necessary to ensure that L-1 cannot be a negative number, that is, this method can only be used when L is greater than or equal to 1.

[0099] In this method, before performing exponential Columbus coding on the data to be compressed based on the order recommendation value, the number of bits of the exponential Columbus coding of the data to be compressed when the exponential Columbus coding order value is the order recommendation value and the order recommendation value minus 1 is calculated respectively, and then the exponential Columbus coding order value corresponding to the smaller number of bits is determined as the optimal order value. In this way, the optimal order value for performing exponential Columbus coding on the data to be compressed when compressing the data to be compressed can be obtained, so that in subsequent encoding, the optimal order value can be used as the order value for the exponential Columbus coding of the data to be compressed to perform exponential Columbus coding on the data to be compressed. The optimal order of the exponential Golumbus coding selected in this way is more accurate and reliable. When the optimal order of the exponential Golumbus coding is selected by this method, although the number of bits of the L-order and L-1-order exponential Golumbus codes of the data to be compressed are calculated, the number of bits of the exponential Golumbus codes of the corresponding orders of the data to be compressed only needs to be calculated twice. Compared with the method in the prior art that requires multiple calculations of the number of bits after the exponential Golumbus coding of the data to be compressed, the time for calculating the exponential Golumbus code length of the data to be compressed and the time for repeatedly calculating the number of bits of the exponential Golumbus codes of each order of the data to be compressed can be effectively reduced, thereby effectively improving the data compression efficiency.

[0100] Specifically, the process of determining the optimal order value according to the order recommendation value is described in detail below by taking the to-be-compressed data 0000123 as an example:

[0101] Table 1 Exponential Golomb coding table corresponding to numbers 0 to 3 at different orders K (0 to 3)

[0102]

[0103] Exponential Golomb codes represent the number to be compressed in binary. In Table 1 above, the number of 0s and 1s in the Exponential Golomb code of a certain order corresponding to a particular number represents its code length. For example, for the number 0, when K = 0, its Exponential Golomb code is 1, and its code length is 1; for the number 3, when K = 0, its Exponential Golomb code is 00100, and its code length is 5. For the data to be compressed 0000123, when K=0, the total length of the Exponential Golomb codes of the digits (0, 1, 2, 3) of the data to be compressed is 1+1+1+1+3+3+5=15. Accordingly, the number of bits of the 0th-order Exponential Golomb code of the data to be compressed 0000123 is 15. When K=1, the total length of the Exponential Golomb codes of the digits (0, 1, 2, 3) of the data to be compressed is 2+2+2+2+2+4+4=18. Accordingly, the number of bits of the 1st-order Exponential Golomb code of the data to be compressed 0000123 is 18. The number of bits of the Exponential Golomb codes of other orders of the data to be compressed are calculated using the same method and will not be repeated here.

[0104] For the data to be compressed 0000123, the previous analysis shows that when L=0, the number of times and value is greater than or equal to half of the total number of digits, that is, the recommended order value of the exponential Golumbus coding of the data to be compressed 0000123 is 0, then the recommended order value 0 can be used as the order value of the exponential Golumbus coding to perform exponential Golumbus coding on the data to be compressed.

[0105] In the above example, it is assumed that when L=0, the sum of the times is greater than or equal to half of the total number of digits is not true, and when L=1, the sum of the times is greater than or equal to half of the total number of digits is true, that is, the recommended order value of the exponential Golomb code is 1. At this time, when encoding the data to be compressed, if it is necessary to minimize the length of the encoded data to be compressed, it is necessary to further calculate a more accurate and reliable order value of the exponential Golomb code used to compress the data to be compressed, that is, determine the optimal order value based on the recommended order value. The process is as follows:

[0106] First, the number of bits of the exponential Golomb coding of the data to be compressed is calculated when the recommended values ​​of the exponential Golomb coding order are 1 and 0 respectively;

[0107] Then, the recommended value of the Exponential Golomb code number corresponding to the smaller number of bits is selected as the optimal Exponential Golomb code order for compressing the data to be compressed.

[0108] It can be seen from the previous calculations that when the recommended value of the Exponential Columbus coding order is 1, the number of bits of the Exponential Columbus coding of the data to be compressed 0000123 is 18, and when the recommended value of the Exponential Columbus coding order is 0, the number of bits of the Exponential Columbus coding of the data to be compressed 0000123 is 15. By comparison, it can be seen that when the recommended value of the Exponential Columbus coding order is 0, the number of bits of the Exponential Columbus coding of the data to be compressed 0000123 is smaller, so the recommended value of the Exponential Columbus coding number 0 is selected as the optimal Exponential Columbus coding order for compressing the data to be compressed. It can be seen from verification that the optimal Exponential Columbus coding order selected in this way is more accurate and reliable, and the calculation time is shorter than that of the existing technology. Therefore, the scheme of determining the optimal order value according to the recommended order value and performing Exponential Columbus coding on the data to be compressed based on the optimal order value can also effectively improve the data compression efficiency compared with the existing technology.

[0109] After determining the recommended order value of the exponential Golumbus code for encoding the data to be compressed based on the probability distribution information, the optimal order value is further determined based on the recommended order value, and the scheme of performing exponential Golumbus encoding on the data to be compressed based on the optimal order value, relative to the scheme of using the recommended order value L of the exponential Golumbus code as the order value of the exponential Golumbus code for compressing the data to be compressed to perform exponential Golumbus encoding on the data to be compressed, the optimal order value is used to encode the data to be compressed, and the length of the encoded data obtained is shorter. In the subsequent compression process, the overall compression efficiency of the data will be higher. Therefore, in actual applications, the user can determine whether it is necessary to continue to determine the optimal order value based on the recommended order value after determining the recommended order value of the exponential Golumbus code for encoding the data to be compressed based on the probability distribution information, so as to perform exponential Golumbus encoding on the data to be compressed at the optimal order value during subsequent encoding, based on the actual needs of coding efficiency and compression efficiency.

[0110] like Figure 4 As shown, an embodiment of the present application provides a data compression encoding device, which may include:

[0111] The data statistics module 201 is used to obtain the number of digit types, the number of occurrences of various digits, and the total number of digits in the data to be compressed.

[0112] When using Exponential Golomb coding to compress data, it is necessary to select the optimal Exponential Golomb coding order K to minimize the number of bits after compression. Therefore, to improve compression efficiency, it is particularly important to quickly and accurately calculate the optimal Exponential Golomb coding order K for the data being compressed.

[0113] In this embodiment, a probabilistic statistical method is used to select the optimal order K of the exponential Golumbus code based on the distribution probability of each number in the data to be compressed. In this way, compared with the method in the prior art of determining the value of the optimal exponential Golumbus code order K by sequentially comparing the number of bits of the corresponding exponential Golumbus codes of the data to be compressed at each order K, the time for querying and calculating the exponential Golumbus code length of the data to be compressed can be saved, and the time for repeatedly calculating the number of bits of the exponential Golumbus codes of each order of the data to be compressed can be effectively reduced, thereby improving the compression efficiency.

[0114] Specifically, in this embodiment, the data to be compressed refers to digital video data to be compressed. Since digital video data is typically represented as numbers before compression, when using a probabilistic statistical method to select the optimal order K of the Exponential Golomb coding based on the distribution probability of each number in the data to be compressed, it is first necessary to calculate the number of types of numbers in the data to be compressed, the number of occurrences of each number, and the total number of numbers. Specifically, N and M are both positive integers.

[0115] Assuming that the data to be compressed is 0000123, the digital range of the data to be compressed is 0 to 3. Through calculation, it can be obtained that the number of digital types of the data to be compressed is 4 (that is, there are 4 numbers 0, 1, 2, and 3 in the data to be compressed), the number of occurrences of various numbers (the number 0 appears 4 times, and the numbers 1, 2, and 3 appear 1 time respectively), and the total number of numbers is 7 (that is, there are 4+1+1+1=7 numbers in the data to be compressed).

[0116] The probability distribution determination module 202 is configured to obtain probability distribution information of various numbers in the data to be compressed based on the number of types of numbers, the number of occurrences of various numbers, and the total number of numbers in the data to be compressed.

[0117] After calculating the number of types of digits, the number of occurrences of various digits, and the total number of digits in the data to be compressed, it is necessary to calculate the probability distribution information of the data to be compressed based on the above-mentioned data information obtained by calculation, that is, to obtain the probability distribution information of various digits in the data to be compressed based on the number of types of digits, the number of occurrences of various digits, and the total number of digits in the data to be compressed.

[0118] In this embodiment, the specific method for the probability distribution determination module 202 to obtain the probability distribution information of various numbers in the data to be compressed is as follows:

[0119] Based on the number of digit types, the number of occurrences of various digits, and the total number of digits in the data to be compressed, a probability distribution diagram of various digits in the data to be compressed is obtained. Specifically, in this embodiment, the probability distribution diagram is a histogram.

[0120] Specifically, the probability distribution histogram of various numbers of the data to be compressed 0000123 obtained by probability distribution calculation in this embodiment is as follows: Figure 2 As shown, the values ​​of the horizontal axis represent various types of numbers in the data to be compressed, and the values ​​of the vertical axis represent the number of occurrences of various numbers in the data to be compressed.

[0121] The coding order recommended value determination module 203 is configured to determine a recommended order value of the Exponential Golomb coding for encoding the data to be compressed based on the probability distribution information.

[0122] After obtaining the probability distribution information of various numbers in the data to be compressed through probability distribution calculation, it is necessary to further analyze the probability distribution of various numbers in the data to be compressed, and obtain the recommended order value of the exponential Columbus code of the data to be compressed through the probability distribution information of the data to be compressed, that is, the recommended order value of the exponential Columbus code is calculated based on the probability distribution information of various numbers in the data to be compressed.

[0123] In this embodiment, the coding order recommended value determination module 203 includes:

[0124] a data sorting unit, configured to sort the various numbers in the data to be compressed in descending order of the number of occurrences of the various numbers in the data to be compressed, based on the number of occurrences of the various numbers in the data to be compressed, to obtain sorting information;

[0125] An order recommendation value determining unit is used to determine an order recommendation value of an Exponential Golomb code used to encode the data to be compressed based on the sorting information.

[0126] Specifically, for the data to be compressed 0000123, according to its Figure 2 From the histogram of the probability distribution shown, it can be seen that in the data to be compressed, the number 0 appears 4 times, and the numbers 1, 2, and 3 appear once each. Then, the number of occurrences of various numbers in the data to be compressed are sorted in descending order to obtain 0 (4 times), 1 (1 time), 2 (1 time), and 3 (1 time). Then, the recommended value of the order of the exponential Columbus code used to encode the data to be compressed is determined based on the sorting information obtained after sorting.

[0127] like Figure 3 As shown, in this embodiment, the order recommended value determining unit determines the order recommended value of the Exponential Golomb code for encoding the to-be-compressed data based on the sorting information, specifically including the following steps:

[0128] Step a: Initialize the calculation times L, that is, set the calculation times L to an initial value of 0, that is, set L=0.

[0129] Step b: Calculate the sum of the occurrences of the top P numbers after sorting based on the sorting information to obtain the sum value of occurrences. Here, P = 1 << L, where << represents the left shift operation. From the formula P = 1 << L, it can be known that the value of P is the decimal number corresponding to the binary value obtained by shifting the binary value of 1 to the left by L bits. Specifically, when L = 0, according to the formula P = 1 << L, it can be calculated that P = 1. Similarly, when L = 1, P = 2; when L = 2, P = 4; when L = 3, P = 8, and so on. The corresponding value of P can be calculated according to different values of L. Taking L = 0 as an example below, calculate the sum value of occurrences, that is, P = 1 << 0, and get P = ½ Then calculate the sum of the occurrences of the top 1 number after sorting to obtain the sum value of occurrences. According to the sorting information, the number of occurrences of the top 1 number (i.e., the number 0) after sorting is 4 times, so the sum value of occurrences = 4 can be obtained.

[0130] Step c: Determine whether the sum value of occurrences is greater than or equal to half of the total number of digits. If so, execute step d; if not, execute step e. In this embodiment, when L = 0, the sum value of occurrences of the data to be compressed 0000123 is 4, and the total number of digits of the data to be compressed is 7. It can be seen that 4 is greater than or equal to 7 / 2, so at this time, the calculation can be stopped and step d can be directly executed. Of course, for some other data to be compressed, if the sum value of occurrences when L = 0 is not greater than or equal to half of the total number of digits, step e needs to be continued.

[0131] Step d: Determine the current calculation times L as the order suggestion value of the exponential Golomb code for encoding the data to be compressed. When the sum value of occurrences is greater than or equal to half of the total number of digits, L can be directly used as the order suggestion value of the exponential Golomb code. Specifically, for the data to be compressed 0000123 in this embodiment, since when L = 0, the sum value of occurrences is greater than or equal to half of the total number of digits, L = 0 is used as the order suggestion value of the exponential Golomb code, that is, the order suggestion value of the exponential Golomb code for the data to be compressed 0000123 is 0.

[0132] Step e: Add 1 to the calculation times L and jump to step b. When the sum value of occurrences is not greater than or equal to half of the total number of digits, add 1 to the calculation times L, and then calculate the sum of the occurrences of the top P numbers after sorting again to obtain the sum value of occurrences. Repeat this cycle until the sum value of occurrences is greater than or equal to half of the total number of digits.

[0133] The encoding module 204 is configured to perform exponential Golomb encoding on the data to be compressed based on the order suggestion value. <F

[0134] After calculating the order suggestion value of the exponential Golomb code, it is necessary to further perform exponential Golomb encoding on the data to be compressed according to the order suggestion value of the exponential Golomb code, so as to achieve the encoding and compression of the data to be compressed.

[0135] To sum up, the above embodiment performs probability distribution calculation on the number of types of digits, the number of occurrences of various digits and the total number of digits in the data to be compressed based on the probability statistics method, and then analyzes the probability distribution of various digits in the data to be compressed, and obtains the recommended order value of the exponential Golumbus code of the data to be compressed through the probability distribution information of the data to be compressed, and finally performs exponential Golumbus coding on the data to be compressed according to the recommended order value of the exponential Golumbus code of the data to be compressed. This can save or reduce the time for querying and calculating the exponential Golumbus code length of the data to be compressed, and effectively reduce the time for repeatedly calculating the number of bits of the exponential Golumbus codes of each order of the data to be compressed, thereby effectively improving the data compression efficiency.

[0136] Based on the above embodiment, preferably, when the encoding module 204 performs exponential Golomb coding on the data to be compressed based on the order recommended value, the encoding module 204 may specifically use, but is not limited to, the following method to perform exponential Golomb coding on the data to be compressed:

[0137] The data to be compressed is subjected to exponential Golomb coding by adopting the recommended value L of the exponential Golomb coding order as the exponential Golomb coding order value for compressing the data to be compressed.

[0138] In this method, the recommended order value L of the exponential Golumbus code is directly used as the order value of the exponential Golumbus code used to compress the data to be compressed. In this way, although the order value L used for the exponential Golumbus code of the data to be compressed is not necessarily the actual optimal order value of the exponential Golumbus code, the recommended order value L is very close to the actual optimal order value of the exponential Golumbus code. Since this method can save the time of querying and calculating the exponential Golumbus code length of the data to be compressed, and there is no need to calculate the number of bits of each order of the exponential Golumbus code of the data to be compressed, the time for determining the optimal order of the exponential Golumbus code can be greatly reduced, and thus the data compression efficiency can be better improved.

[0139] In order to obtain a more accurate and reliable order value of the Exponential Golomb code used to compress the data to be compressed so as to reduce the length of the encoded data to be compressed, based on the above embodiment, as a preference, the apparatus may further include:

[0140] an optimal order value determination module, configured to determine an optimal order value according to the recommended order value after the recommended order value determination module 203 determines the recommended order value of the Exponential Golomb code for encoding the data to be compressed based on the probability distribution information;

[0141] Accordingly, the encoding module 204 is specifically configured to perform exponential Golomb coding on the data to be compressed based on the optimal order value.

[0142] Specifically, the optimal order value determination module is specifically used to:

[0143] When the order recommended value is greater than or equal to 1, respectively calculating the number of bits of the exponential Golomb coding of the to-be-compressed data when the exponential Golomb coding order value is the order recommended value and the order recommended value minus 1;

[0144] The Exponential Golomb coding order value corresponding to the smaller number of bits is determined as the optimal order value.

[0145] It can be understood that since L or L-1 needs to be used as the exponential Golomb coding order value, and the exponential Golomb coding order value cannot be negative, when determining the optimal order value based on the order recommendation value L, it is necessary to ensure that L-1 cannot be a negative number, that is, this method can only be used when L is greater than or equal to 1.

[0146] In this method, before performing exponential Columbus coding on the data to be compressed based on the order recommendation value, the number of bits of the exponential Columbus coding of the data to be compressed when the exponential Columbus coding order value is the order recommendation value and the order recommendation value minus 1 is calculated respectively, and then the exponential Columbus coding order value corresponding to the smaller number of bits is determined as the optimal order value. In this way, the optimal order value for performing exponential Columbus coding on the data to be compressed when compressing the data to be compressed can be obtained, so that in subsequent encoding, the optimal order value can be used as the order value for the exponential Columbus coding of the data to be compressed to perform exponential Columbus coding on the data to be compressed. The optimal order of the exponential Golumbus coding selected in this way is more accurate and reliable. When the optimal order of the exponential Golumbus coding is selected by this method, although the number of bits of the L-order and L-1-order exponential Golumbus codes of the data to be compressed are calculated, the number of bits of the exponential Golumbus codes of the corresponding orders of the data to be compressed only needs to be calculated twice. Compared with the method in the prior art that requires multiple calculations of the number of bits after the exponential Golumbus coding of the data to be compressed, the time for calculating the exponential Golumbus code length of the data to be compressed and the time for repeatedly calculating the number of bits of the exponential Golumbus codes of each order of the data to be compressed can be effectively reduced, thereby effectively improving the data compression efficiency.

[0147] Specifically, the process of determining the optimal order value according to the order recommendation value is described in detail below by taking the to-be-compressed data 0000123 as an example:

[0148] Exponential Golomb codes represent the number to be compressed in binary. In Table 1 above, the number of 0s and 1s in the Exponential Golomb code of a certain order corresponding to a particular number represents its code length. For example, for the number 0, when K = 0, its Exponential Golomb code is 1, and its code length is 1; for the number 3, when K = 0, its Exponential Golomb code is 00100, and its code length is 5. For the data to be compressed 0000123, when K=0, the total length of the Exponential Golomb codes of the digits (0, 1, 2, 3) of the data to be compressed is 1+1+1+1+3+3+5=15. Accordingly, the number of bits of the 0th-order Exponential Golomb code of the data to be compressed 0000123 is 15. When K=1, the total length of the Exponential Golomb codes of the digits (0, 1, 2, 3) of the data to be compressed is 2+2+2+2+2+4+4=18. Accordingly, the number of bits of the 1st-order Exponential Golomb code of the data to be compressed 0000123 is 18. The number of bits of the Exponential Golomb codes of other orders of the data to be compressed are calculated using the same method and will not be repeated here.

[0149] For the data to be compressed 0000123, the previous analysis shows that when L=0, the number of times and value is greater than or equal to half of the total number of digits, that is, the recommended order value of the exponential Golumbus coding of the data to be compressed 0000123 is 0, then the recommended order value 0 can be used as the order value of the exponential Golumbus coding to perform exponential Golumbus coding on the data to be compressed.

[0150] In the above example, it is assumed that when L=0, the sum of the times is greater than or equal to half of the total number of digits is not true, and when L=1, the sum of the times is greater than or equal to half of the total number of digits is true, that is, the recommended order value of the exponential Golomb code is 1. At this time, when encoding the data to be compressed, if it is necessary to minimize the length of the encoded data to be compressed, it is necessary to further calculate a more accurate and reliable order value of the exponential Golomb code used to compress the data to be compressed, that is, determine the optimal order value based on the recommended order value. The process is as follows:

[0151] First, the number of bits of the exponential Golomb coding of the data to be compressed is calculated when the recommended values ​​of the exponential Golomb coding order are 1 and 0 respectively;

[0152] Then, the recommended value of the Exponential Golomb code number corresponding to the smaller number of bits is selected as the optimal Exponential Golomb code order for compressing the data to be compressed.

[0153] It can be seen from the previous calculations that when the recommended value of the Exponential Columbus coding order is 1, the number of bits of the Exponential Columbus coding of the data to be compressed 0000123 is 18, and when the recommended value of the Exponential Columbus coding order is 0, the number of bits of the Exponential Columbus coding of the data to be compressed 0000123 is 15. By comparison, it can be seen that when the recommended value of the Exponential Columbus coding order is 0, the number of bits of the Exponential Columbus coding of the data to be compressed 0000123 is smaller, so the recommended value of the Exponential Columbus coding number 0 is selected as the optimal Exponential Columbus coding order for compressing the data to be compressed. It can be seen from verification that the optimal Exponential Columbus coding order selected in this way is more accurate and reliable, and the calculation time is shorter than that of the existing technology. Therefore, the scheme of determining the optimal order value according to the recommended order value and performing Exponential Columbus coding on the data to be compressed based on the optimal order value can also effectively improve the data compression efficiency compared with the existing technology.

[0154] After determining the recommended order value of the exponential Golomb coding for encoding the data to be compressed based on the probability distribution information, further determining the optimal order value based on the recommended order value, and performing exponential Golomb coding on the data to be compressed based on the optimal order value, the scheme can improve the accuracy of the selected optimal order of the exponential Golomb coding compared to the scheme of using the recommended order value L of the exponential Golomb coding as the order value of the exponential Golomb coding for compressing the data to be compressed. However, the calculation time is slightly longer, and thus the encoding efficiency of the data is relatively lower. However, since the optimal order value is used to encode the data to be compressed, the length of the encoded data is shorter, and in the subsequent compression process, the overall compression efficiency of the data will be higher. Therefore, in actual applications, the user can determine whether it is necessary to determine the optimal order value based on the recommended order value after determining the recommended order value of the exponential Golomb coding for encoding the data to be compressed based on the probability distribution information, so as to perform exponential Golomb coding on the data to be compressed at the optimal order value during subsequent encoding based on the actual requirements of encoding efficiency and compression efficiency.

[0155] like Figure 5 As shown, an embodiment of the present application provides a data compression encoding device 3, which includes a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and executable on the processor 302. When the processor 302 executes the computer program 303, the steps of the data compression encoding method of the above-mentioned method embodiment of the present application are implemented.

[0156] Specifically, the data compression encoding device 3 can be an intelligent device with memory and processor, such as an industrial computer, a PC, or an intelligent mobile terminal, or a computer component with memory and processor, such as a CPU or a GPU.

[0157] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the data compression encoding method of the above-mentioned method embodiment of the present application are implemented.

[0158] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0159] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0160] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, software modules executed by a processor, or a combination of the two. The software modules may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0161] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data compression encoding method, characterized in that: The method includes: Obtaining the number of digit types of the data to be compressed, the occurrence times of various digits, and the total number of digits; Obtaining the probability distribution information of various digits in the data to be compressed based on the number of digit types of the data to be compressed, the occurrence times of various digits, and the total number of digits; Determining a recommended order value of the Golomb-Rice code for encoding the data to be compressed based on the probability distribution information; Performing Golomb-Rice encoding on the data to be compressed based on the recommended order value; Among them, the determining a recommended order value of the Golomb-Rice code for encoding the data to be compressed based on the probability distribution information includes: Based on the occurrence times of various digits in the data to be compressed, sorting various digits in the data to be compressed in descending order of the occurrence times to obtain sorting information; Initializing the calculation times L, and calculating the sum of the occurrence times of the first P sorted digits based on the sorting information, where P = 1 << L, and << represents the left shift operation; Judging whether the sum of the times is greater than or equal to half of the total number of digits. If so, determining the current calculation times L as the recommended order value of the Golomb-Rice code for encoding the data to be compressed. If not, adding 1 to the calculation times L and continuing to execute the step of calculating the sum of the occurrence times of the first P sorted digits based on the sorting information; 2. The data compression encoding method according to claim 1, wherein: The obtaining the probability distribution information of various digits in the data to be compressed based on the number of digit types of the data to be compressed, the occurrence times of various digits, and the total number of digits includes: Performing probability distribution calculation based on the number of digit types of the data to be compressed, the occurrence times of various digits, and the total number of digits to obtain the probability distribution diagram of various digits in the data to be compressed; 3. The data compression encoding method according to any one of claims 1 to 2, characterized in that: After determining the recommended order value of the Golomb-Rice code for encoding the data to be compressed based on the probability distribution information, the method further includes: Determining the optimal order value according to the recommended order value; Correspondingly, the performing Golomb-Rice encoding on the data to be compressed based on the recommended order value includes: Performing Golomb-Rice encoding on the data to be compressed based on the optimal order value; 4. The data compression encoding method according to claim 3, wherein: The determining the optimal order value according to the recommended order value includes: When the recommended order value is greater than or equal to 1, respectively calculating the number of bits of the Golomb-Rice encoding of the data to be compressed when the Golomb-Rice encoding order value is the recommended order value and the recommended order value minus 1; Determining the Golomb-Rice encoding order value corresponding to the smaller number of bits as the optimal order value; 5. A data compression encoding device, characterized in that: The device includes: A data statistics module for obtaining the number of digit types of the data to be compressed, the occurrence times of various digits, and the total number of digits; A probability distribution determination module for obtaining the probability distribution information of various digits in the data to be compressed based on the number of digit types of the data to be compressed, the occurrence times of various digits, and the total number of digits; A coding order recommended value determination module for determining a recommended order value of the Golomb-Rice code for encoding the data to be compressed based on the probability distribution information; An encoding module, configured to perform Exponential Golomb encoding on the data to be compressed based on the order suggested value; Wherein, the encoding order suggested value determination module includes: A data sorting unit, configured to sort various numbers in the data to be compressed in descending order of the occurrence times based on the occurrence times of various numbers in the data to be compressed, so as to obtain sorting information; An order suggested value determination unit, configured to initialize the calculation times L, calculate the sum of the occurrence times of the first P sorted numbers based on the sorting information to obtain a sum value of times, where P = 1 << L, and << represents a left shift operation; determine whether the sum value of times is greater than or equal to half of the total number of digits, wherein if so, determine the current calculation times L as the order suggested value for performing Exponential Golomb encoding on the data to be compressed, if not, add 1 to the calculation times L, and continue to execute the step of calculating the sum of the occurrence times of the first P sorted numbers based on the sorting information to obtain the sum value of times.

6. A data compression encoding device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the data compression encoding method according to any one of claims 1-4.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps of the data compression encoding method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Method, apparatus and system for encoding and decoding subset of transform units of encoded video data

    CN104221288A