CN109068144B - Probability estimation method and device and electronic equipment - Google Patents

Probability estimation method and device and electronic equipment Download PDF

Info

Publication number
CN109068144B
CN109068144B CN201810789951.XA CN201810789951A CN109068144B CN 109068144 B CN109068144 B CN 109068144B CN 201810789951 A CN201810789951 A CN 201810789951A CN 109068144 B CN109068144 B CN 109068144B
Authority
CN
China
Prior art keywords
symbol
probability
coded
target
accumulated
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.)
Active
Application number
CN201810789951.XA
Other languages
Chinese (zh)
Other versions
CN109068144A (en
Inventor
董胜富
朱洪波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201810789951.XA priority Critical patent/CN109068144B/en
Publication of CN109068144A publication Critical patent/CN109068144A/en
Application granted granted Critical
Publication of CN109068144B publication Critical patent/CN109068144B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The embodiment of the invention provides a probability estimation method, a probability estimation device and electronic equipment, wherein the method comprises the following steps: calculating the probability estimation value of each symbol in the symbol sequence to be coded; aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table; and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded. The embodiment of the invention corrects the probability estimation value of each symbol in the symbol sequence to be coded based on the predetermined probability correction value table, thereby improving the accuracy of probability estimation in arithmetic coding.

Description

Probability estimation method and device and electronic equipment
Technical Field
The present invention relates to the field of data compression technologies, and in particular, to a probability estimation method, apparatus and electronic device.
Background
Arithmetic coding is an efficient entropy coding method that can code symbols with near-entropy efficiency. The arithmetic coding process typically includes: firstly, estimating the probability of each symbol in a symbol sequence to be coded; the sequence of symbols to be encoded is then encoded according to the estimated probability of each symbol.
In the arithmetic coding process, each Symbol in a Symbol sequence to be coded is divided into a high probability Symbol (MPS) or a Low Probability Symbol (LPS), and two probability values are always stored in the system: current probability value P of MPSMPSAnd current probability value P of LPSLPSWherein P isMPS≥0.5,PLPSNot more than 0.5, and PMPSAnd PLPSThe sum is 1. P is updated after each symbol is encodedLPSAnd PMPS
In the international standard for advanced Video coding h.264/avc (advanced Video coding) or international standard for high Efficiency Video coding h.265/hevc (high Efficiency Video coding), the probability of each symbol can be estimated by a table lookup method. In particular, the probability of a symbolQuantized into 64 probability states, each probability state comprising: the sequence number of the probability state and P corresponding to the probability stateLPS(i.e., the probability value of the probability state), and the hop sequence number of the probability state. When probability estimation is performed on each symbol, the sequence number of the probability state corresponding to each symbol can be determined according to the sequence number of the probability state corresponding to the previous symbol and the category of the previous symbol; and then determining the probability of each symbol according to the sequence number of the probability state corresponding to each symbol and the category of each symbol.
However, the inventor finds that the prior art has at least the following problems in the process of implementing the invention: in the table lookup method, because the probability of the symbol is quantized into 64 probability values, when the probability value of the symbol is estimated, only one probability value which is closer to the actual probability value of the symbol can be selected from the 64 probability values as the probability estimation value of the symbol, and the probability estimation value may have a larger deviation from the actual probability value of the symbol, which results in inaccurate probability estimation of the symbol.
Disclosure of Invention
The embodiment of the invention aims to provide a probability estimation method, a probability estimation device and electronic equipment so as to improve the accuracy of probability estimation in arithmetic coding.
In order to achieve the above object, in a first aspect, the present invention provides a probability estimation method, including:
calculating the probability estimation value of each symbol in the symbol sequence to be coded;
aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; wherein, the target accumulated symbol is a binary number with N bits; n is an integer greater than 1;
according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table;
and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded.
Optionally, the determining of the probability correction value table includes:
constructing an accumulated symbol set; said accumulated symbol set comprising 2NThe method comprises the steps of (1) planting accumulated symbols, wherein each accumulated symbol is an N-bit binary number;
determining each target symbol corresponding to each accumulated symbol, and calculating the actual probability value of each target symbol based on a counting method;
calculating the probability estimation value of each target symbol;
subtracting the probability estimated value of each target symbol from the actual probability value of each target symbol to obtain a probability corrected value of each target symbol;
and establishing a probability correction value table based on the corresponding relation between the probability estimation value of each target symbol and the corresponding accumulated symbol and the probability correction value of each target symbol.
Optionally, the calculating a probability estimation value of each symbol in the symbol sequence to be encoded includes:
and calculating the probability estimation value of each symbol in the symbol sequence to be coded based on a predetermined probability state table.
Optionally, the calculating a probability estimation value of each symbol in the symbol sequence to be encoded includes:
and calculating the probability estimation value of each symbol in the symbol sequence to be coded according to a proportion-based probability estimation method.
Optionally, the constructing a target accumulated symbol corresponding to the current symbol to be encoded according to a symbol before the current symbol to be encoded includes:
setting an initial accumulated symbol as a binary number 0 of N bits, and taking the initial accumulated symbol as a current accumulated symbol cumbit;
sequentially coding the symbols before the current symbol to be coded, and acquiring the value bit of each symbol when each symbol is coded; after the cumbit is shifted to the left by 1 bit, the cumbit is added with the bit to obtain an updated current accumulated symbol cumbit;
and taking the current accumulated symbol updated after the previous symbol of the current symbol to be coded is coded as the target accumulated symbol corresponding to the current symbol to be coded.
In a second aspect, an embodiment of the present invention provides a probability estimation apparatus, including:
the first calculation module is used for calculating the probability estimation value of each symbol in the symbol sequence to be coded;
the first construction module is used for constructing a target accumulated symbol corresponding to the current symbol to be coded according to a symbol before the current symbol to be coded aiming at the current symbol to be coded; wherein, the target accumulated symbol is a binary number with N bits; n is an integer greater than 1;
the searching module is used for searching the probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded;
and the first processing module is used for adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded.
Optionally, the apparatus further comprises:
the second construction module is used for constructing an accumulated symbol set; said accumulated symbol set comprising 2NThe method comprises the steps of (1) planting accumulated symbols, wherein each accumulated symbol is an N-bit binary number;
the second calculation module is used for determining each target symbol corresponding to each accumulated symbol and calculating the actual probability value of each target symbol based on a counting method;
the third calculation module is used for calculating the probability estimation value of each target symbol;
the second processing module is used for subtracting the probability estimated value of each target symbol from the actual probability value of each target symbol to obtain the probability correction value of each target symbol;
and the establishing module is used for establishing a probability correction value table based on the corresponding relation between the probability estimation value of each target symbol, the corresponding accumulated symbol and the probability correction value of each target symbol.
Optionally, the first calculating module is specifically configured to calculate a probability estimation value of each symbol in the symbol sequence to be encoded based on a predetermined probability state table.
Optionally, the first calculating module is specifically configured to calculate a probability estimation value of each symbol in the symbol sequence to be encoded according to a ratio-based probability estimation method.
Optionally, the first building block includes:
the setting subunit is used for setting an initial accumulative symbol as a binary number 0 of N bits and taking the initial accumulative symbol as a current accumulative symbol cumbit;
the processing subunit is used for sequentially coding the symbols before the current symbol to be coded, and acquiring the value bit of each symbol when the symbol is coded; after the cumbit is shifted to the left by 1 bit, the cumbit is added with the bit to obtain an updated current accumulated symbol cumbit;
and the determining subunit is used for taking the current accumulated symbol updated after the previous symbol of the current symbol to be coded is coded as the target accumulated symbol corresponding to the current symbol to be coded.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the probability estimation method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium having stored therein instructions, which, when executed on a computer, cause the computer to perform the probability estimation method steps as described in the first aspect above.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method steps of probability estimation as described above in the first aspect.
According to the probability estimation method, the probability estimation device and the electronic equipment provided by the embodiment of the invention, the probability estimation value of each symbol in the symbol sequence to be coded is calculated; aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table; and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded. The embodiment of the invention corrects the probability estimation value of each symbol in the symbol sequence to be coded based on the predetermined probability correction value table, thereby improving the accuracy of probability estimation in arithmetic coding.
Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a probability estimation method according to an embodiment of the present invention;
FIG. 2 is another flow chart of a probability estimation method according to an embodiment of the present invention;
FIG. 3 is another flow chart of a probability estimation method according to an embodiment of the present invention;
fig. 4 is a structural diagram of a probability estimation apparatus according to an embodiment of the present invention;
FIG. 5 is another block diagram of a probability estimation apparatus according to an embodiment of the present invention;
fig. 6 is a structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
In order to improve the accuracy of probability estimation in arithmetic coding, embodiments of the present invention provide a probability estimation method, apparatus, and electronic device.
First, a probability estimation method provided in an embodiment of the present invention is described below.
As shown in fig. 1, a probability estimation method provided in an embodiment of the present invention may include:
s101, calculating a probability estimation value of each symbol in a symbol sequence to be coded.
In arithmetic coding, each symbol in a sequence of symbols to be coded is usually divided into a high probability symbol MPS or a low probability symbol LPS, i.e. there are only two symbols, MPS and LPS, in the sequence of symbols to be coded.
The process of arithmetic coding may include: firstly, probability estimation is carried out on each symbol in a symbol sequence to be coded; and secondly, determining the interval corresponding to each symbol according to the probability of each symbol. In practical applications, the more accurate the probability estimation of a symbol, the higher the compression efficiency of arithmetic coding.
In this embodiment, the probability estimation value of each symbol in the symbol sequence to be encoded may be calculated first, and then the probability estimation value may be corrected, so as to improve the accuracy of probability estimation on the symbol.
In one implementation, the calculating the probability estimation value of each symbol in the symbol sequence to be encoded in step S101 may include:
and calculating the probability estimation value of each symbol in the symbol sequence to be coded based on a predetermined probability state table.
Specifically, in order to facilitate probability estimation of symbols, in h.264/AVC or h.265/HEVC, the probability of a symbol is quantized into 64 probability states, which form a probability state table. Each probability state includes: the sequence number of the probability state and P corresponding to the probability stateLPS(i.e., the probability shapeState probability value), the hop sequence number of the probability state. Wherein, the calculation formula of the probability value of the mth probability state is as follows: pLPS=αm-1X 0.5, where m is the number of probability states and 0.5 is the initial PLPSThat is, if the first symbol is LPS, the probability is 0.5.
When the probability state table is used to perform probability estimation on a symbol, first, the sequence number of the probability state corresponding to the symbol needs to be determined, and then, the probability estimation is performed on the symbol according to the sequence number of the probability state corresponding to the symbol. Specifically, if the symbol is LPS, the probability is the probability value of the probability state corresponding to the symbol; if the symbol is MPS, the probability is 1 minus the probability value of the probability state corresponding to the symbol.
In the table lookup method, because the probability of the symbol is quantized into 64 probability values, when the probability value of the symbol is estimated, only one probability value which is closer to the actual probability value of the symbol can be selected from the 64 probability values as the probability estimation value of the symbol, so that the probability estimation value may have a larger deviation from the actual probability value of the symbol, and the probability estimation value needs to be corrected to improve the accuracy of the probability estimation of the symbol.
In another implementation manner, the calculating the probability estimation value of each symbol in the symbol sequence to be encoded in step S101 may include:
and calculating the probability estimation value of each symbol in the symbol sequence to be coded according to a proportion-based probability estimation method.
In the arithmetic coding process, two probability values, the current probability value P of MPS, are always stored in the systemMPsAnd current probability value P of LPSMPsWherein P isMPs≥0.5,PLPSNot more than 0.5, and PMPSAnd PLPSThe sum is 1. P is updated each time a symbol is encodedMPSAnd PLPSAnd according to the updated PMPSAnd PLPSAnd a class of the next symbol, the probability of the next symbol is estimated.
Wherein, PMPSAnd PLPSThe update rule of (2) is: if one is codedMPS, the updated PLPSWill decrease, updated PMPSWill increase; if an LPS is encoded, the updated PLPSWill increase, updated PMPSIt will be reduced.
In the ratio-based probability estimation method, the updated P can be calculated by the following two formulasLPS: if an MPS is encoded, the updated PLPS(by P)LPS_newTo represent) is: pLPS_new=α×PLPS_old(ii) a If an LPS is encoded, the updated PLPSComprises the following steps: pLPS_new=1-α+α×PLPS_old. Where α is a scaling factor and, correspondingly, updated PMPS(by P)MPS_newTo represent) is: pMPS_new=1-PLPS_new
In the ratio-based probability estimation method, since the ratio parameter α is an empirical value, and there may still be a certain deviation between the probability estimation value of the symbol calculated based on the empirical value and the actual probability value of the symbol, the probability estimation value needs to be corrected to improve the accuracy of probability estimation of the symbol.
S102, aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; wherein, the target accumulated symbol is a binary number of N bits; n is an integer greater than 1.
The target accumulated symbol represents information of a certain number of symbols preceding the symbol currently to be encoded. Based on the target accumulated symbol, the probability correction value of the current symbol to be coded can be directly inquired in the subsequent step. In this embodiment, for convenience of query, the number of bits of the target accumulated symbol is set to N. The value of N may be set according to actual needs, for example, N may be 2, 4, or 8, and the present invention is not limited thereto.
In this embodiment, the symbol before the current symbol to be encoded represents: and in the symbol sequence to be coded, all coded symbols before the current symbol to be coded.
In one implementation, as shown in fig. 3, constructing a target accumulated symbol corresponding to a symbol to be currently encoded according to a symbol before the symbol to be currently encoded in step S102 may include:
s301, setting an initial accumulative symbol as a binary number 0 of N bits, and taking the initial accumulative symbol as a current accumulative symbol cumbit;
s302, sequentially coding symbols before the current symbol to be coded, and acquiring the value bit of the symbol when each symbol is coded; shifting the cumbit by 1 bit to the left, and adding the cumbit and the bit to obtain an updated current accumulated symbol cumbit;
and S303, taking the current accumulated symbol updated after the previous symbol of the current symbol to be coded is coded as the target accumulated symbol corresponding to the current symbol to be coded.
The target accumulated symbol can be obtained through the steps. Exemplarily, the following steps are carried out: n is 8, the sequence of the symbols to be encoded is 110101011, and if the current symbol to be encoded is the 4 th symbol, the process of constructing the target accumulated symbol corresponding to the 4 th symbol is as follows: setting an initial accumulative symbol as binary number 0 of 8 bits, and taking the initial accumulative symbol as a current accumulative symbol cumbit, namely, the cumbit is 00000000; after a 1 st symbol of a symbol sequence to be coded is coded, obtaining the value bit of the symbol to be coded as 1, shifting the cumbit to the left by 1 bit, and adding the value bit to the bit to obtain the updated cumbit to be 00000001; after a 2 nd symbol of a symbol sequence to be coded is coded, obtaining the value bit of the symbol to be coded as 1, shifting the cumbit to the left by 1 bit, and adding the value bit to the bit to obtain the updated cumbit to be 00000011; after the 3 rd symbol of the symbol sequence to be coded is coded, the value bit of the symbol is obtained to be 0, the cumbit is shifted to the left by 1 bit and then added with the bit, and the updated cumbit is obtained to be 00000110; since the 3 rd symbol which is coded is the previous symbol of the current symbol to be coded (4 th symbol), the target accumulated symbol corresponding to the 4 th symbol is: 00000110.
s103, according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, the probability correction value corresponding to the current symbol to be coded is searched in a predetermined probability correction value table.
In a predetermined probability correction value table, the probability correction value corresponding to the current symbol to be encoded can be found through the target accumulated symbol and the probability estimation value corresponding to the current symbol to be encoded.
In this embodiment, as shown in fig. 2, the process of determining the probability correction value table may include:
s201, constructing an accumulative symbol set; the cumulative symbol set includes 2NAnd each accumulative symbol is an N-bit binary number.
The value of each binary digit in the accumulated symbol may be "0" or "1", and thus different values of 2 may be obtained based on two different values of all binary digits in the accumulated symbolNThe kind accumulated symbol constitutes accumulated symbol set. For example, if N is 2, the cumulative symbol set includes 4 cumulative symbols, which are: 00, 01, 10, 11.
S202, determining each target symbol corresponding to each accumulated symbol, and calculating the actual probability value of each target symbol based on a counting method.
The target symbol is necessarily a symbol in a sequence of symbols, and thus the target symbol may be: in the symbol sequence, the symbol corresponding to the accumulated symbol. That is, in the symbol sequence, as long as the symbol corresponds to the accumulated symbol, it is the target symbol. This will be the case: the same accumulated symbol corresponds to different target symbols. The method is characterized in that: the symbols before each target symbol corresponding to the same accumulated symbol are different, specifically: the symbols before the target symbols are different from the symbols other than the accumulated symbol. For example, the symbol sequence is: 11011011, the cumulative notation is: 110, the target sequence number corresponding to the accumulated symbol is: the 4 th symbol and the 7 th symbol in the symbol sequence.
In practical applications, due to the difference between the number of symbols and the type of the symbol sequence to be encoded, there may be a plurality of symbol sequences to be encoded, and accordingly, there may also be a plurality of accumulated symbols corresponding to each symbol in various symbol sequences to be encoded. In order to take the above various situations into consideration as much as possible, in this embodiment, the length of the sequence in which the target symbol is located may be set to be the same as the length of the symbol sequence to be encoded, and the sequence in which the target symbol is located may be set to be the same as the length of the symbol sequence to be encodedWith 2 ofMIn the following description, the length of a symbol sequence to be encoded is represented by M (similar to each accumulated symbol in the accumulated symbol set described above), i.e.: the number of symbols of the symbol sequence to be encoded.
In arithmetic coding, for a target symbol, the number and type of the previously coded symbols affect the actual probability value/probability estimate of the target symbol. That is, the actual probability value/probability estimate for a target symbol may vary depending on the number of previously encoded symbols and the type of symbols.
In this embodiment, the actual probability value of each target symbol may be calculated based on a counting method. The counting method is the prior art, and the present invention is not described in detail herein.
S203, calculates a probability estimation value for each target symbol.
In this step, the probability estimation value of each target symbol may be calculated according to a ratio-based probability estimation method or a predetermined probability state table. Of course, other methods may be used to calculate the probability estimation value for each target symbol, which is not limited in the present invention.
And S204, subtracting the probability estimated value of each target symbol from the actual probability value of each target symbol to obtain the probability correction value of each target symbol.
And S205, establishing a probability correction value table based on the corresponding relation between the probability estimation value of each target symbol, the corresponding accumulated symbol and the probability correction value of each target symbol.
In this embodiment, the established probability correction value table has the following meaning: the actual probability value/probability estimate for the current symbol may vary depending on the number and type of previous symbols, even when traversing the current symbol's previous symbol in all cases. If the probability of the current symbol is to be found, it is still necessary to know the values of all symbols before the current symbol to find the actual probability value of the current symbol. Thus, it is obviously cumbersome. Therefore, in this embodiment, the probability value of the current symbol can be determined only according to the accumulated symbol corresponding to the current symbol and the probability estimation value of the current symbol.
After the probability correction value of each target symbol is obtained, a probability correction value table can be established according to the probability estimation value of the target symbol and the corresponding relationship between the corresponding accumulated symbol and the probability correction value of each target symbol.
And S104, adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded.
And after the probability estimation value of the current symbol to be coded is corrected, the probability value of the current symbol to be coded is obtained. The current symbol to be encoded may be further encoded based on the probability value of the current symbol to be encoded.
According to the scheme provided by the embodiment of the invention, the probability estimation value of each symbol in the symbol sequence to be coded is calculated; aiming at a current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded according to a symbol before the current symbol to be coded; according to a target accumulated symbol and a probability estimation value corresponding to a current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table; and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded. The embodiment of the invention corrects the probability estimation value of each symbol in the symbol sequence to be coded based on the predetermined probability correction value table, thereby improving the accuracy of probability estimation in arithmetic coding.
Corresponding to the method embodiment shown in fig. 1, an embodiment of the present invention provides a probability estimation apparatus, as shown in fig. 4, the apparatus may include:
a first calculating module 401, configured to calculate a probability estimation value of each symbol in a symbol sequence to be encoded;
a first constructing module 402, configured to construct, for a current symbol to be encoded, a target accumulated symbol corresponding to the current symbol to be encoded according to a symbol before the current symbol to be encoded; wherein, the target accumulated symbol is a binary number with N bits; n is an integer greater than 1;
a searching module 403, configured to search, according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be encoded, a probability correction value corresponding to the current symbol to be encoded in a predetermined probability correction value table;
the first processing module 404 is configured to add the probability correction value of the current symbol to be encoded to the probability estimation value to obtain a probability value of the current symbol to be encoded.
According to the scheme provided by the embodiment of the invention, the probability estimation value of each symbol in the symbol sequence to be coded is calculated; aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table; and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded. The embodiment of the invention corrects the probability estimation value of each symbol in the symbol sequence to be coded based on the predetermined probability correction value table, thereby improving the accuracy of probability estimation in arithmetic coding.
Optionally, as shown in fig. 5, the apparatus may further include:
a second constructing module 501, configured to construct an accumulated symbol set; said accumulated symbol set comprising 2NThe method comprises the steps of (1) planting accumulated symbols, wherein each accumulated symbol is an N-bit binary number;
a second calculating module 502, configured to determine each target symbol corresponding to each accumulated symbol, and calculate an actual probability value of each target symbol based on a counting method;
a third calculating module 503, configured to calculate a probability estimation value of each target symbol;
a second processing module 504, configured to subtract the probability estimation value of each target symbol from the actual probability value of each target symbol to obtain a probability correction value of each target symbol;
an establishing module 505, configured to establish a probability correction value table based on a correspondence between the probability estimation value of each target symbol and the corresponding accumulated symbol and the probability correction value of each target symbol.
Optionally, the first calculating module 401 is specifically configured to calculate, based on a predetermined probability state table, a probability estimation value of each symbol in a symbol sequence to be encoded.
Optionally, the first calculating module 401 is specifically configured to calculate a probability estimation value of each symbol in the symbol sequence to be encoded according to a ratio-based probability estimation method.
Optionally, the first building module 402 may include:
the setting subunit is used for setting an initial accumulative symbol as a binary number 0 of N bits and taking the initial accumulative symbol as a current accumulative symbol cumbit;
the processing subunit is used for sequentially coding the symbols before the current symbol to be coded, and acquiring the value bit of each symbol when the symbol is coded; after the cumbit is shifted to the left by 1 bit, the cumbit is added with the bit to obtain an updated current accumulated symbol cumbit;
and the determining subunit is used for taking the current accumulated symbol updated after the previous symbol of the current symbol to be coded is coded as the target accumulated symbol corresponding to the current symbol to be coded.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
the memory 603 is used for storing computer programs;
the processor 601 is configured to implement the probability estimation method in any of the above embodiments when executing the program stored in the memory 603.
In the electronic device provided by the embodiment of the present invention, when the processor executes the program stored in the memory, the probability estimation value of each symbol in the symbol sequence to be encoded is calculated; aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table; and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded. The embodiment of the invention corrects the probability estimation value of each symbol in the symbol sequence to be coded based on the predetermined probability correction value table, thereby improving the accuracy of probability estimation in arithmetic coding.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, which when run on a computer, cause the computer to perform the probability estimation method of any of the above embodiments.
When the instruction stored in the computer-readable storage medium provided by the embodiment of the invention runs on a computer, the probability estimation value of each symbol in a symbol sequence to be coded is calculated; aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table; and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded. The embodiment of the invention corrects the probability estimation value of each symbol in the symbol sequence to be coded based on the predetermined probability correction value table, thereby improving the accuracy of probability estimation in arithmetic coding.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the probability estimation method of any of the above embodiments.
When the computer program product containing the instructions runs on a computer, the probability estimation value of each symbol in the symbol sequence to be coded is calculated; aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table; and adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded. The embodiment of the invention corrects the probability estimation value of each symbol in the symbol sequence to be coded based on the predetermined probability correction value table, thereby improving the accuracy of probability estimation in arithmetic coding.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The term "comprising" is used to specify the presence of stated features, integers, steps, operations, elements, components, and/or groups thereof, but does not exclude the presence of other similar features, integers, steps, operations, components, or groups thereof.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus/electronic device/storage medium/computer program product embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (11)

1. A method of probability estimation, comprising:
calculating the probability estimation value of each symbol in the symbol sequence to be coded;
aiming at a current symbol to be coded, according to a symbol before the current symbol to be coded, constructing a target accumulated symbol corresponding to the current symbol to be coded; wherein, the target accumulated symbol is a binary number with N bits; n is an integer greater than 1;
according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded, searching a probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table;
adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded;
the probability correction value table is established according to the corresponding relation between the probability estimation value of the target symbol, the corresponding accumulated symbol and the probability correction value of the target symbol; the target symbol is a symbol corresponding to the accumulated symbol in the symbol sequence; and the probability correction value of the target symbol is obtained by subtracting the probability estimation value of the target symbol from the actual probability value of the target symbol.
2. The method according to claim 1, wherein the determining of the table of probability correction values comprises:
constructing an accumulated symbol set; said accumulated symbol set comprising 2NThe method comprises the steps of (1) planting accumulated symbols, wherein each accumulated symbol is an N-bit binary number;
determining each target symbol corresponding to each accumulated symbol, and calculating the actual probability value of each target symbol based on a counting method;
calculating the probability estimation value of each target symbol;
subtracting the probability estimated value of each target symbol from the actual probability value of each target symbol to obtain a probability corrected value of each target symbol;
and establishing a probability correction value table based on the corresponding relation between the probability estimation value of each target symbol and the corresponding accumulated symbol and the probability correction value of each target symbol.
3. The method of claim 1, wherein calculating the probability estimate for each symbol in the sequence of symbols to be encoded comprises:
and calculating the probability estimation value of each symbol in the symbol sequence to be coded based on a predetermined probability state table.
4. The method of claim 1, wherein calculating the probability estimate for each symbol in the sequence of symbols to be encoded comprises:
and calculating the probability estimation value of each symbol in the symbol sequence to be coded according to a proportion-based probability estimation method.
5. The method according to claim 1, wherein the constructing a target accumulated symbol corresponding to the symbol to be currently encoded according to a symbol before the symbol to be currently encoded comprises:
setting an initial accumulated symbol as a binary number 0 of N bits, and taking the initial accumulated symbol as a current accumulated symbol cumbit;
sequentially coding the symbols before the current symbol to be coded, and acquiring the value bit of each symbol when each symbol is coded; after the cumbit is shifted to the left by 1 bit, the cumbit is added with the bit to obtain an updated current accumulated symbol cumbit;
and taking the current accumulated symbol updated after the previous symbol of the current symbol to be coded is coded as the target accumulated symbol corresponding to the current symbol to be coded.
6. A probability estimation device, comprising:
the first calculation module is used for calculating the probability estimation value of each symbol in the symbol sequence to be coded;
the first construction module is used for constructing a target accumulated symbol corresponding to the current symbol to be coded according to a symbol before the current symbol to be coded aiming at the current symbol to be coded; wherein, the target accumulated symbol is a binary number with N bits; n is an integer greater than 1;
the searching module is used for searching the probability correction value corresponding to the current symbol to be coded in a predetermined probability correction value table according to the target accumulated symbol and the probability estimation value corresponding to the current symbol to be coded;
the first processing module is used for adding the probability correction value of the current symbol to be coded with the probability estimation value to obtain the probability value of the current symbol to be coded;
the probability correction value table is established according to the corresponding relation between the probability estimation value of the target symbol, the corresponding accumulated symbol and the probability correction value of the target symbol; the target symbol is a symbol corresponding to the accumulated symbol in the symbol sequence; and the probability correction value of the target symbol is obtained by subtracting the probability estimation value of the target symbol from the actual probability value of the target symbol.
7. The apparatus of claim 6, further comprising:
the second construction module is used for constructing an accumulated symbol set; said accumulated symbol set comprising 2NThe method comprises the steps of (1) planting accumulated symbols, wherein each accumulated symbol is an N-bit binary number;
the second calculation module is used for determining each target symbol corresponding to each accumulated symbol and calculating the actual probability value of each target symbol based on a counting method;
the third calculation module is used for calculating the probability estimation value of each target symbol;
the second processing module is used for subtracting the probability estimated value of each target symbol from the actual probability value of each target symbol to obtain the probability correction value of each target symbol;
and the establishing module is used for establishing a probability correction value table based on the corresponding relation between the probability estimation value of each target symbol, the corresponding accumulated symbol and the probability correction value of each target symbol.
8. The apparatus of claim 6,
the first calculating module is specifically configured to calculate a probability estimation value of each symbol in the symbol sequence to be encoded based on a predetermined probability state table.
9. The apparatus of claim 6,
the first calculating module is specifically configured to calculate a probability estimation value of each symbol in a symbol sequence to be encoded according to a ratio-based probability estimation method.
10. The apparatus of claim 6, wherein the first building block comprises:
the setting subunit is used for setting an initial accumulative symbol as a binary number 0 of N bits and taking the initial accumulative symbol as a current accumulative symbol cumbit;
the processing subunit is used for sequentially coding the symbols before the current symbol to be coded, and acquiring the value bit of each symbol when the symbol is coded; after the cumbit is shifted to the left by 1 bit, the cumbit is added with the bit to obtain an updated current accumulated symbol cumbit;
and the determining subunit is used for taking the current accumulated symbol updated after the previous symbol of the current symbol to be coded is coded as the target accumulated symbol corresponding to the current symbol to be coded.
11. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, implementing the probability estimation method steps of any of claims 1-5.
CN201810789951.XA 2018-07-18 2018-07-18 Probability estimation method and device and electronic equipment Active CN109068144B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810789951.XA CN109068144B (en) 2018-07-18 2018-07-18 Probability estimation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810789951.XA CN109068144B (en) 2018-07-18 2018-07-18 Probability estimation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109068144A CN109068144A (en) 2018-12-21
CN109068144B true CN109068144B (en) 2021-03-12

Family

ID=64817258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810789951.XA Active CN109068144B (en) 2018-07-18 2018-07-18 Probability estimation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109068144B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1875545A (en) * 2003-10-29 2006-12-06 日本电气株式会社 Decoding apparatus or encoding apparatus wherein intermediate buffer is inserted between arithmetic sign decoder or encoder and debinarizer or binarizer
JP2011109364A (en) * 2009-11-17 2011-06-02 Renesas Electronics Corp Image processing apparatus
CN104869397A (en) * 2015-05-20 2015-08-26 哈尔滨工业大学 Adaptive range coding method and decoding method based on SLWE probability
CN104954099A (en) * 2015-06-17 2015-09-30 重庆邮电大学 Optimized design method for accumulate rateless codes under constraint of decoding iterations
WO2016025281A1 (en) * 2014-08-15 2016-02-18 Google Technology Holdings LLC Method for coding pulse vectors using statistical properties
CN104041038B (en) * 2011-11-07 2018-03-27 杜比国际公司 For coding and decoding method, the coding and decoding equipment of image

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1875545A (en) * 2003-10-29 2006-12-06 日本电气株式会社 Decoding apparatus or encoding apparatus wherein intermediate buffer is inserted between arithmetic sign decoder or encoder and debinarizer or binarizer
JP2011109364A (en) * 2009-11-17 2011-06-02 Renesas Electronics Corp Image processing apparatus
CN104041038B (en) * 2011-11-07 2018-03-27 杜比国际公司 For coding and decoding method, the coding and decoding equipment of image
WO2016025281A1 (en) * 2014-08-15 2016-02-18 Google Technology Holdings LLC Method for coding pulse vectors using statistical properties
CN104869397A (en) * 2015-05-20 2015-08-26 哈尔滨工业大学 Adaptive range coding method and decoding method based on SLWE probability
CN104954099A (en) * 2015-06-17 2015-09-30 重庆邮电大学 Optimized design method for accumulate rateless codes under constraint of decoding iterations

Also Published As

Publication number Publication date
CN109068144A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN111143371B (en) Data query method, device, equipment, system and medium
CN110554732B (en) Identification number generation method and device, electronic equipment and storage medium
CN111062013B (en) Account filtering method and device, electronic equipment and machine-readable storage medium
JP2019530269A (en) Encoding method, device and apparatus
CN110377681B (en) Data query method and device, readable storage medium and electronic equipment
CN112818387B (en) Method, apparatus, storage medium and program product for model parameter adjustment
CN111858577A (en) Method, apparatus and computer program product for storage management
CN108809943B (en) Website monitoring method and device
CN114817651B (en) Data storage method, data query method, device and equipment
CN111106840A (en) Method, system, medium and computer device for accelerating erasure code decoding
CN110798230A (en) Run length detection method and device and electronic equipment
CN111966712A (en) Data processing method, device, server and storage medium
CN109068144B (en) Probability estimation method and device and electronic equipment
CN108989825B (en) Arithmetic coding method and device and electronic equipment
CN111402958B (en) Method, system, equipment and medium for establishing gene comparison table
CN103049445B (en) A kind of method, system and picture state server for inquiring about pictorial information
CN108810543B (en) Video coding compensation method and device and electronic equipment
CN110852098B (en) Data correction method, electronic equipment and storage medium
CN106484753B (en) Data processing method
CN113688601B (en) Watermark generation method and device based on form, electronic equipment and computer medium
CN114268608B (en) Address segment retrieval method and device, electronic equipment and storage medium
CN110990611B (en) Picture caching method and device, electronic equipment and storage medium
CN110290391B (en) Exponential Golomb code decoding method, system, electronic equipment and storage medium
CN112688696A (en) Method, apparatus, device and storage medium for finite field coding and decoding
CN109005413B (en) Probability estimation method and device in arithmetic coding and electronic equipment

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
GR01 Patent grant
GR01 Patent grant