WO2019191886A1 - Probability update method and apparatus for context - Google Patents

Probability update method and apparatus for context Download PDF

Info

Publication number
WO2019191886A1
WO2019191886A1 PCT/CN2018/081648 CN2018081648W WO2019191886A1 WO 2019191886 A1 WO2019191886 A1 WO 2019191886A1 CN 2018081648 W CN2018081648 W CN 2018081648W WO 2019191886 A1 WO2019191886 A1 WO 2019191886A1
Authority
WO
WIPO (PCT)
Prior art keywords
probability update
update model
probability
context
sliding window
Prior art date
Application number
PCT/CN2018/081648
Other languages
French (fr)
Chinese (zh)
Inventor
马思伟
崔静
王苫社
郑萧桢
Original Assignee
北京大学
深圳市大疆创新科技有限公司
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 北京大学, 深圳市大疆创新科技有限公司 filed Critical 北京大学
Priority to CN201880011453.0A priority Critical patent/CN110495170A/en
Priority to PCT/CN2018/081648 priority patent/WO2019191886A1/en
Publication of WO2019191886A1 publication Critical patent/WO2019191886A1/en

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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]

Definitions

  • the present application relates to the field of video codec and, more particularly, to a method and apparatus for probabilistic updating of a context.
  • CABAC Context-based Adaptive Binary Arithmetic Coding
  • the syntax elements in the entropy coding are binarized to obtain a plurality of binary bits, each of which is called a bin, and the binary bit string formed by the multiple binary bits is called a bin string.
  • Each bin or a number of bins in a bin string is assigned a context, and the model-related parameters are updated by the probability stored in the context, and the bin string is encoded by CABAC.
  • the general process of encoding is to predict the probability value of the bin using a probability update model, and then arithmetically encode the bin according to the probability value.
  • CABAC CABAC
  • the present application provides a context probability update method and apparatus, which can further improve the encoding/decoding performance of CABAC.
  • a context update method comprising: adjusting a probability update model when a number of binary symbols for encoding/decoding binary symbols is satisfied using a probability update model of the context Binding/decoding binary symbols based on the adjusted probability update model.
  • the probability update model is adjusted according to the number of times of encoding/decoding of the model using the probability of using the context, so that the encoding/decoding performance can be improved to some extent.
  • a context probability updating apparatus comprising: a processing unit, configured to: when a number of binary symbols for encoding/decoding a binary symbol is satisfied using a probability update model of the context, The probability update model is adjusted; an encoding/decoding unit is configured to encode/decode the binary symbols based on the adjusted probability update model.
  • an encoder comprising a memory and a processor, the memory for storing instructions, the processor for executing the instructions stored by the memory, and instructions stored in the memory Execution of the processor causes the processor to perform the method of encoding provided by the first aspect.
  • a decoder comprising a memory and a processor, the memory for storing instructions, the processor for executing the instructions stored by the memory, and instructions stored in the memory Execution of the processor causes the processor to perform the method of decoding provided by the first aspect.
  • a chip comprising a processing module and a communication interface, the processing module is configured to control the communication interface to communicate with an external, and the processing module is further configured to implement the method provided by the first aspect.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a computer, causes the computer to implement the method provided by the first aspect.
  • the computer is for example an encoder/decoder.
  • a computer program product comprising instructions, which when executed by a computer, causes the computer to implement the method provided by the first aspect.
  • the computer is for example an encoder/decoder.
  • the probability update model is adjusted according to the number of times of encoding/decoding of the model using the probability of using the context, so that the encoding/decoding performance can be improved to some extent.
  • FIG. 1 is a schematic flowchart of a method for updating a probability of a context provided by an embodiment of the present application.
  • FIG. 2 is another schematic flowchart of a method for updating a probability of a context provided by an embodiment of the present application.
  • FIG. 3 is a schematic block diagram of a probability update apparatus for a context provided by an embodiment of the present application.
  • FIG. 4 is a schematic block diagram of an encoder according to an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of a decoder provided by an embodiment of the present application.
  • the syntax elements in entropy coding are converted to Binarization. After converting the syntax elements into binary, a plurality of binary symbols are obtained, each of which is called a bin, and the binary bit string formed by the plurality of binary symbols is called a bin string.
  • step 1) can be omitted.
  • Each bin or bins in a bin string is assigned a context, and the model-related parameters are updated by the probability stored in the context, and the bin string is encoded using CABAC.
  • For a bin to be encoded select the probability update model stored in the context to which it is assigned.
  • the binary arithmetic coding of the bin is performed by the selected probability update model.
  • the decoding process of CABAC corresponds to the coding process of CABAC.
  • the probability contained in the same context or the information contained in the indicated probability is not fixed, but is updated as the number of bins that decode the context is changed. Specifically, the probability included in the context or the information included to indicate the probability is updated based on the probability update model of the context.
  • the number of probability update models may be different, and the number of probability update models is not limited in this application.
  • a probability update model is used to update the probability in the context or the information pointing to the probability.
  • P[k+1] is the final prediction probability and U is the probability update model.
  • k and k+1 represent the current state and the next state, respectively.
  • 4 is a sliding window parameter.
  • the probability of predicting bin is estimated using two probability update models.
  • P[k+1] is the final prediction probability
  • U and V are two probability update models.
  • k and k+1 represent the current state and the next state, respectively.
  • 4 is the sliding window parameter in the probability update model U
  • 8 is the sliding window parameter in the probability update model V.
  • the expression of the probability update model may be different in different standards, because the probability update model is a process of maintaining the probability value in the arithmetic coding, and the manner in which the process is implemented in different standards is different.
  • the probabilistic update model may implement an update of the model in conjunction with a state jump of a pre-designed finite state machine that specifies the current state transition to the next state rule.
  • the state value of the finite state machine expresses probability related information.
  • a context update model to express a probability update model, and accordingly, to use contextual modeling instead of a probabilistic update process.
  • the most important thing stored in the context model is the information related to the probability update.
  • the related information expresses an implicit value of the probability value, such as the state value of the finite state machine described above.
  • the probability related information is an explicit form of probability correlation value, such as a probability value.
  • the sliding window parameter takes a fixed value, that is, the probability update model of the context remains unchanged.
  • the context is initialized with a certain period, which is called the initialization period of the context.
  • the context is initialized with a period of a slice, that is, the initialization period of the context is a slice.
  • Initializing the probability update model includes initializing the sliding window parameters in the probability update model.
  • the value of the initialized sliding window parameter is 4.
  • the values of the two sliding window parameters after initialization are 4 and 8, respectively.
  • the probability update model remains unchanged after initialization until initialization is initiated again at the beginning of the next initial cycle.
  • the present application provides a method and apparatus for probabilistic updating in CABAC, which can further improve encoding (or decoding) performance relative to the prior art.
  • the solution provided by the present application can be applied to coding as well as to decoding.
  • FIG. 1 is a schematic flowchart of a method for updating a probability of a context provided by an embodiment of the present application. This method can be performed by an encoder/decoder. The method includes the following steps.
  • the number of times the binary symbol is encoded/decoded using the probability update model of the context satisfies the condition that the number of times the binary symbol is encoded using the probability update model of the context satisfies the condition, or the probability of the context is updated using the context to update the model.
  • the number of decodings satisfies the condition.
  • the number of times the binary symbol is encoded/decoded using the probability update model of the context satisfies the condition, meaning that the number of times the binary symbol is encoded/decoded using the probability update model of the context reaches a threshold.
  • the number of times the binary symbol is encoded/decoded using the probability update model of the context reaches a threshold, which means that the number of times the binary symbol is encoded using the probability update model of the context reaches a threshold, or the binary symbol is updated using the probability update model of the context.
  • the number of decodings reaches the threshold.
  • the probability update model is adjusted.
  • the probability update model is adjusted.
  • the number of times the binary symbol is encoded/decoded using the probability update model of the context satisfies the condition, and may also represent other situations, for example, the number of times the binary symbol is encoded/decoded using the probability update model of the context.
  • the duration exceeds the preset value. This application does not limit this, as long as the number of encoding/decoding binary symbols is obtained by using the probability update model of the context to obtain a better timing for adjusting the probability update model.
  • Adjusting the probability update model refers to changing the probability update model so that the adjusted and updated probabilistic update model is different.
  • adjusting the probability update model includes adjusting a value of one or more parameters in the probability update model.
  • adjust the probability of updating the sliding window parameters in the model For example, adjust the probability to update other parameters in the model. This application does not limit this.
  • adjusting the value of the one or more parameters in the probability update model includes: reducing or increasing the value of the parameter in the probability update model.
  • S120 The binary symbol is encoded/decoded by using the adjusted probability update model.
  • the already coded information can be referenced less, and as the coding proceeds, the already coded information can be referred to more and more.
  • the already coded information can be referred to more and more.
  • the already decoded information can be referred to less, and as the decoding progresses, the already decoded information can be referred to more and more.
  • the already decoded information can be referred to more and more.
  • you always use a fixed probability to update the model for decoding it may not be conducive to the improvement of decoding performance.
  • the probability update model is adjusted according to the number of times of encoding/decoding of the model using the probability of using the context. For example, when the number of times of encoding/decoding of the probability update model using the context reaches the threshold, the probability update model is adjusted, and it can be considered that there is already a lot of already encoded information that can be referred to at this time, and the probability update model needs to be adjusted to adapt to the change.
  • the encoding environment which can improve the encoding/decoding performance to some extent.
  • the decoding process corresponds to the encoding process
  • the technical solution provided by the present application can be applied to the encoding process as well as to the decoding process.
  • some embodiments herein may only describe an encoding scenario (or a decoding scenario) as an example, and related schemes and technical effects thereof are equally applicable to a decoding scenario (or a coding scenario).
  • the probability update model is adjusted; in 120, in the same The binary symbols are encoded/decoded using the adjusted probability update model during the initialization cycle.
  • the probability update model of the context is initialized; after the initialization is completed, the probability of the model prediction bin is updated using the probability, and the binary probability encoding is performed on the bin using the predicted probability;
  • the probability update model is adjusted; in the initialization period, the adjusted probability is used to update the model to continue predicting the probability of bin, and the binary probability is used to perform binary arithmetic on the bin. coding.
  • the probability update model of the context is initialized; after the initialization is completed, the probability of the model prediction bin is updated using the probability, and the binary probability decoding of the bin is performed using the predicted probability;
  • the probability update model is adjusted; in the initialization period, the adjusted probability is used to update the model to continue predicting the probability of the bin, and the predicted probability is used to perform binary arithmetic on the bin. decoding.
  • the probability update model is fixed during the current initialization period, and in an initialization period, as the encoding (or decoding) proceeds, the referenced encoding may be performed (or More and more information is being decoded, and updating the model with a fixed probability may be detrimental to the performance of the encoding (or encoding).
  • the probability update model is adjusted according to the probability of updating the model according to the probability of using the context in the initialization period of the same context, and the encoding/decoding performance can be improved to a certain extent.
  • a frame of image consists of one or more slices, and a slice can be split into one or more coding tree units (CTUs).
  • CTUs coding tree units
  • the initialization of the context may be in a period of one slice, that is, the initialization period of the context is one slice.
  • the initialization of the context may be in a CTU period, that is, the initialization period of the context is one CTU.
  • the initialization of the context may also be cycled with one other image coding unit. That is, the initialization period of the context may be other image coding units, which is not limited in this application.
  • the method prior to encoding/decoding the binary symbols using the probability update model of the context, the method further comprises: initializing the probability update model.
  • the parameters in the probability update model are initialized.
  • the sliding window parameters in the probability update model are initialized.
  • the sliding window parameters may be initialized according to a quantization parameter (QP) of the current slice.
  • QP quantization parameter
  • the sliding window parameters may be initialized based on the quantization step size of the current CTU.
  • the sliding window parameters of the probability update model are initialized based on the quantization step size of the block currently being encoded or decoded.
  • the sliding window parameters may also be initialized based on the encoding state of the current context.
  • the probability update model of the context when the number of times the binary symbol is encoded/decoded by the probability update model of the context reaches the threshold, the probability update model is adjusted, wherein the threshold may be determined by the following implementation manners.
  • the threshold is determined based on the probability state value of the arithmetically encoded zoom interval two-dimensional lookup table.
  • the threshold is a positive integer that is less than a maximum of the probability state value.
  • the threshold is a positive integer less than 512, for example, the threshold is 128.
  • the arithmetic interval of the arithmetic interval is a coding table in CABAC.
  • the arithmetic interval of the scaled two-dimensional lookup table is a two-dimensional table.
  • the scaling interval two-dimensional lookup table of the arithmetic coding may also be simply referred to as an interval query table. For the sake of brevity, the description of the interval lookup table is used below.
  • the interval query table is used to query the current probability and the size of the new scaling interval corresponding to the scaling interval of the arithmetic coding engine.
  • the interval query table is an implementation of the CABAC-free multiplication method, that is, avoiding the multiplication operation between the probability and the size of the current zoom interval to obtain the size of the new zoom interval.
  • the interval lookup table has two index values: a probability state value and a scaling interval value.
  • the scale interval value represents the length of the interval in the interval lookup table (Range).
  • the probability state value represents the probability value of each interval.
  • index values are used to query the new zoom interval of CABAC.
  • the symbol “x” is used to represent the probability state value
  • the symbol “y” is used to represent the current scaling interval value of the arithmetic coding engine.
  • the symbol “x” is used hereinafter to represent the probability state value
  • the symbol “y” is used to represent the current scaling interval value of the arithmetic coding engine.
  • this application does not limit this.
  • other symbols may also be used to represent the probability state value and the current scaling interval value of the arithmetic coding engine.
  • the value of the scale interval value y represents the interval length (Range), and Range ranges from 1 to 512.
  • Range (Range>> 2) - 64.
  • Range can be regarded as a 9-bit binary, and shifting two bits to the right means that only the size of the upper 7 bits is considered, so the value of the scaling interval value y here is the high 7 bits minus 64. Regardless of the operation, the goal is to quantify the interval.
  • the range of the final scaling interval value y is [0, 64].
  • the Range value is between 488 (111101000) and 491 (111101011), that is, the value of Range is shifted to two by 122 (1111010), and after subtracting 64, it is 58, then the value of Range is in the range of 488-491. Its corresponding index value is 58.
  • the Range value is in the range of 492 (111101100) to 495 (111101111), the value of Range is shifted to two by 123 (1111011), and after subtracting 64, it is 59, then the Range value is in the range of 492-495. Its corresponding index value is 58.
  • the above method of determining the values of the probability state value x and the scaling interval value y is merely an example and not a limitation. In practice, it can be implemented in other ways. For example, the value of Range can be directly used without determining the value of the scaling interval value y.
  • the size of the interval lookup table is 512 x 64. That is, x ranges from 1 to 512, and y ranges from 1 to 64.
  • the maximum value of x and y may be 1024 or greater.
  • the threshold may be set to a positive integer less than 512.
  • the threshold is an integer between X/2 n1 and X/2 n2 , where X is the maximum value of the probability state value of the arithmetically encoded zoom interval two-dimensional look-up table, X/2 n1 is greater than 1 , n1 and n2 are natural numbers, and n1 is greater than n2.
  • the maximum value X of the probability state value of the scaled interval two-dimensional lookup table of the arithmetic coding is 512
  • the threshold may be an integer between 512/2 4 and 512/2 2 (ie an integer between 32 and 128), Or the threshold may be an integer between 512/2 3 and X/2 1 (ie an integer between 61 and 256).
  • the maximum value X of the probability state values of the scaled two-dimensional look-up table of the arithmetic coding may also be other values, such as 1024 or the like.
  • the threshold is adaptively adjusted.
  • the threshold is determined based on the average number of uses of the probability update model of the same context over one or more initialization cycles that have been encoded/decoded.
  • the average number of encoding/decoding times of the current context in one or more initialization periods that have been encoded/decoded is counted, and then the value of the threshold is determined according to the average number of encoding/decoding.
  • the probability update model of one context is encoded in the already-initialized initialization period T1, and the number of times of encoding in the already-initialized initialization period T2 is N2, which is performed in the already-encoded initialization period T3.
  • the number of times of encoding is N3, and N1, N2, and N3 are averaged, and the average value obtained is the average number of times the probability update model of the context is used in the three initialization periods.
  • the number of times the probability update model of one context is decoded in the already decoded initialization period T1 is N1
  • the number of times of decoding in the already decoded initialization period T2 is N2, and is performed in the already initialized initialization period T3.
  • the number of decodings is N3, and N1, N2, and N3 are averaged, and the average value obtained is the average number of times the probability update model of the context is used in the three initialization periods.
  • the average number of encodings of a plurality of different contexts within one or more initialization periods that have been encoded/decoded is counted, and then the value of the threshold is determined based on the average number of encodings.
  • the average number of encodings of the context within one or more initialization periods that have been encoded/decoded may be counted by pre-training.
  • the threshold is set to the first value.
  • the threshold is set to the second value, the first value being less than the second value.
  • the threshold is set to be greater than the first value and less than the integer of the second value.
  • the first value is Thrmin
  • the second value is Thrmax
  • the average number of uses is Numave.
  • the threshold Thr is determined according to the following formula:
  • the first value and the second value respectively represent the minimum value and the maximum value of the threshold.
  • the first data and the second value can be determined based on empirical values. For example, the first value is 32 and the second value is 512.
  • the value of the threshold is adaptively changed according to the average usage number of the probability update model of the same context in one or more initialization periods that have been encoded/decoded, so that it can be flexibly and appropriately
  • the timing adjusts the probability update model, so the coding performance can be further improved.
  • the threshold is determined according to an initialization period of the context.
  • the threshold is set to 512.
  • the threshold is set to an integer between 32 and 512.
  • the threshold may also be determined according to other feasible methods, as long as the probability update model can be adjusted at an appropriate timing.
  • the number of times a binary symbol is encoded/decoded using a probability update model can be counted by a counter.
  • the counter of each context is also initialized.
  • the counter also starts counting, and each time the encoding/decoding is performed using the context, the corresponding The counter is counted once, and when the count value of the counter reaches the threshold, it is determined that the number of binary symbols for encoding/decoding binary symbols using the probability update model reaches the threshold.
  • the context includes a counter that counts the number of encoding/decoding binary symbols used to update the model using the probability of the context.
  • each context has its own counter, and when a bin references a context, the context counter is incremented by one.
  • the counter is cleared when the current stripe encoding/decoding ends.
  • the counter is cleared when the current coding tree unit is encoded/decoded.
  • the counter is cleared at the end of the current initialization period.
  • the counter is cleared when the counter value of the counter reaches the threshold.
  • the counter is used to update the model to encode/decode the number of binary symbols, and when the counter's count reaches the threshold 1, the probabilistic update model is first adjusted while the counter is cleared; The counter count uses the probability update model to encode/decode the number of binary symbols. When the counter count reaches the threshold 2, the probability update model is adjusted a second time and the counter is cleared.
  • the threshold 1 and the threshold 2 may be the same or different.
  • the manner of the first adjustment and the second adjustment of the probability update model may be the same or different. This embodiment is described by taking two adjustments to the probability update model as an example. However, the present application is not limited thereto. In actual operation, the probability update model can be adjusted more times, the process of multiple adjustments, and two adjustments. The process is similar and will not be repeated here.
  • the counter is also cleared.
  • adjusting the probability update model in S110 specifically includes: adjusting a sliding window parameter in the probability update model.
  • the sliding window parameter can determine the speed of the probability update of the probability update model.
  • the larger the sliding window parameter the smaller the probability update speed of the probability update model, and vice versa. Therefore, since the sliding window parameter can determine the speed of the probability update of the probability update model, by adjusting the sliding window parameter, the probability that the probability update model can be adjusted for the probability update can be adjusted.
  • the sliding window parameter in the probability update model is adjusted, thereby adjusting the probability update probability of the probability update model, and thus balancing The probability update speed and probability update accuracy, which can further improve the coding performance.
  • the size of the sliding window parameter in the probability update model is adjusted by updating the model according to the number of times the binary symbol is encoded/decoded according to the usage probability, so that the number of times the binary symbol is encoded/decoded using the probability update model and the sliding
  • the values of the window parameters are related, which can improve the accuracy of the probability prediction of the context.
  • adjusting the probability update model in S110 may further include: adjusting other parameters in the probability update model.
  • other parameters may affect the speed and/or accuracy of the probability update of the probability update model.
  • each context has its own probability update model, ie each context has its own sliding window parameters.
  • the sliding window parameters in a context's probability update model are stored in that context.
  • the probability of the probabilistic update of the probability update model can be reduced.
  • the probability update model when using the probability update model for arithmetic coding, at the beginning, there is less information that can be referenced. At this time, a faster probability update speed can be used; as the coding proceeds, reference can already be made. More and more information is encoded, and a slower probability update speed should be used. In this embodiment, when the number of times of encoding using the probability update model reaches the threshold, the speed of the probability update is reduced by increasing the sliding window parameter, so that the encoding performance can be improved.
  • the already decoded information can be referenced less.
  • the faster probability update speed can be adopted; as the decoding progresses, the reference can already be used. More and more information is decoded, and a slower probability update speed should be used.
  • the speed of the probability update is reduced by increasing the sliding window parameter, so that the decoding performance can be improved.
  • adjusting the sliding window parameter in the probability update model in S110 specifically: reducing the sliding window parameter.
  • the speed of the probability update needs to be accelerated, and at this time, the binary symbol can be encoded/decoded using the probability update model.
  • the sliding window parameters are reduced.
  • the sliding window parameter may be adjusted rather than fixed, so that the speed of the probability update may be adjusted, thereby balancing the probability update speed and the probability update accuracy, thereby Can improve coding performance.
  • bins are encoded/decoded using a plurality of probabilistic update models, each probabilistic update model having a sliding window parameter, in this case having a plurality of sliding window parameters, S110 specifically including : When the number of times the binary symbol is encoded/decoded using the plurality of probability update models reaches the threshold, the plurality of sliding window parameters are increased.
  • the magnitude of the increase in the different sliding windows may be the same or different.
  • the sliding window parameter is increased, if the probability state value of the arithmetically encoded zoom interval two-dimensional lookup table is less than the third value, the sliding window parameter is increased by a magnitude less than the fourth value.
  • the third value and the fourth value may be empirical values.
  • the third value can be 11 and the fourth value can be 2.
  • the probability state value x of the arithmetically encoded zoom interval two-dimensional lookup table is smaller than the third value, the probability value of the context is already very small, and if a large sliding window parameter is used for the probability update, The probability of several bins using this context that result in consecutive encodings is very close, which is of little significance for arithmetic coding. Therefore, when the probability state value x of the arithmetically encoded zoom interval two-dimensional lookup table is smaller than the third value, the sliding window parameter should be increased in amplitude to be small.
  • the probability update model needs to be adjusted multiple times, that is, the sliding window parameters are adjusted multiple times, wherein the amplitude values of each adjustment may be the same or different.
  • the sliding window parameter in the probability update model has a value range of [Min, Max]. That is, the value of the sliding window parameter before or after the adjustment is greater than or equal to Min and less than or equal to Max.
  • Min is 2 and Max is 9.
  • P is the probability update model
  • a is the sliding window parameter
  • k and k+1 are the current device and the next state, respectively
  • is a value located in the interval (0, 1), for example
  • the value range of the sliding window parameter is defined as [2, SWP max ], where SWP max represents the maximum value of the sliding window parameter, and this value is not absolutely limited and can be artificially specified. Just guarantee It falls within the range of (0,1).
  • the probability update model of the context is adjusted multiple times based on the number of times the probability of the context is used to encode/decode the binary symbols.
  • the manner of each adjustment may be the same or different.
  • each adjustment can be done by increasing the sliding window parameters, and the magnitude of the increase can be the same or different.
  • some adjustment methods are to increase the sliding window parameters, and other adjustment methods are to reduce the sliding window parameters.
  • the sliding window parameter of the probability update model is increased; in S120, the sliding is based on the increase The probability update model of the window parameter encodes/decodes the binary symbol; the method further comprises: increasing again when the number of binary symbols for encoding/decoding the binary symbol reaches the threshold again using the adjusted probability update model The probability updates the sliding window parameter of the model; the binary symbol is encoded/decoded based on the probability that the sliding window parameter is increased for the second time.
  • the sliding window parameter is again increased by the same magnitude as the last increase.
  • the sliding window parameter is again increased by a magnitude that is less than the amplitude of the previous increase.
  • the amplitude of the sliding window parameter is increased again less than the amplitude of the previous increase.
  • the sliding window parameter is again increased by a magnitude that is less than the amplitude of the previous increase.
  • the probability update model can be adjusted multiple times during an initialization cycle.
  • the design context which includes a threshold (denoted as Thr) and a counter (denoted as c). Wherein, the number of bits of the counter can be determined according to the threshold.
  • the number of bits of the counter should be set to 6, 7, 8, and 9, respectively.
  • the probability update model is:
  • the probability update model is:
  • a and b are two sliding window parameters respectively.
  • U and V are two probability update models, respectively.
  • k and k+1 are the current state and the next state, respectively.
  • step 2 counter c begins counting.
  • the sliding window parameters a and b are adjusted by the solution provided by the present application.
  • the adjustment sliding window parameters a and b are assigned values a0 and b0, respectively.
  • step 2 the counter value of the counter c is monitored in real time.
  • the values of a and b remain unchanged, that is, when the initialization is maintained. Values: a0 and b0;
  • the values of a and b are respectively incremented by 1, the value of a becomes a1, and the value of b becomes b1. That is, the adjustment strategies of the sliding window parameters a and b are as follows:
  • step 2) there is no absolute sequence relationship between step 2) and step 3) in this example.
  • the adjustment values ⁇ 1 and ⁇ 2 of the sliding window parameters a and b may be the same or different, which is not limited in the present application.
  • the solution provided by the present application may also be applied to perform probability update.
  • the specific process is as follows.
  • the design context which includes a threshold (denoted as Thr) and a counter (denoted as c). Wherein, the number of bits of the counter can be determined according to the threshold.
  • the number of bits of the counter should be set to 6, 7, 8, and 9, respectively.
  • step 2 counter c begins counting.
  • the ⁇ in the formula (3) can be regarded as a sliding window parameter, and the sliding window parameter ⁇ is adjusted according to the count value of the counter c.
  • step 2) the counter value of the counter c is monitored in real time, and according to the technical value of the counter c, the following operations are performed:
  • denotes the value before the adjustment and ⁇ ' denotes the value after the adjustment.
  • step 2) there is no absolute sequence relationship between step 2) and step 3) in this example.
  • the probability update model when the number of times of coding using the probability update model of the context reaches a threshold, the probability update model is adjusted, and it can be considered that there is already a lot of already encoded information that can be referred to at this time. It is necessary to adjust the probability update model to adapt to the changing coding environment, which can improve the encoding/decoding performance to some extent.
  • the scheme involving the coding scenario in the method embodiment provided above may be applied to the encoder, and the scheme related to the decoding scenario in the method embodiment provided above may be applied to the decoder.
  • FIG. 3 is a schematic block diagram of a probability update apparatus 300 for a context provided by an embodiment of the present application.
  • the device 300 includes the following units.
  • the processing unit 310 is configured to adjust the probability update model when the number of binary symbols that encode/decode the binary symbols using the probability update model of the context satisfies the condition.
  • the encoding/decoding unit 320 is configured to encode/decode binary symbols based on the adjusted probability update model.
  • the probability update model is adjusted according to the number of times the model is updated according to the probability of using the context, so that the encoding/decoding performance can be improved to some extent.
  • the number of binary symbols that encode/decode the binary symbols using the probability update model of the context satisfies the condition, including: encoding/decoding the binary symbols when using the probability update model of the context The number of binary symbols reaches the threshold.
  • the probability update model is adjusted, and it can be considered that there is already a lot of already encoded information that can be referred to at this time, and the probability needs to be adjusted.
  • the model is updated to accommodate the changing coding environment, which can improve the encoding/decoding performance to some extent.
  • the threshold is a positive integer that is less than a maximum of a probability state value of the arithmetically encoded zoom interval two-dimensional lookup table.
  • the threshold is adaptively adjusted.
  • the threshold is determined based on an average number of uses of the probability update model of the same context over a plurality of initialization cycles in which encoding/decoding has been completed.
  • the threshold when the average number of uses is lower than the first value, the threshold is adaptively adjusted to the first value.
  • the threshold when the average number of uses is higher than the second value, the threshold is adaptively adjusted to the second value.
  • the threshold is an integer between X/2 n1 and X/2 n2 , where X is the maximum value of the probability state value of the arithmetically encoded zoom interval two-dimensional look-up table, X/ 2 n1 is greater than 1, n1 and n2 are natural numbers, and n1 is greater than n2.
  • the processing unit 310 is specifically configured to: use a counter to count the number of binary symbols that encode/decode the binary symbols using the probability update model of the context; when the counter reaches the counter value At the threshold, it is determined that the number of binary symbols that encode/decode the binary symbols using the probability update model of the context reaches the threshold.
  • the processing unit 310 is further configured to clear the counter when the current initialization period ends.
  • the processing unit 310 is further configured to clear the counter when the current stripe slice encoding/decoding ends.
  • the processing unit 310 is further configured to clear the counter when the current coding tree unit CTU encoding/decoding ends.
  • the processing unit 310 is specifically configured to adjust the sliding window parameter of the probability update model.
  • the processing unit 310 is specifically configured to increase a sliding window parameter of the probability update model.
  • the probability update model includes a plurality of sliding window parameters
  • the processing unit 310 is specifically configured to increase the plurality of sliding window parameters, wherein each sliding window parameter increases in amplitude by the same, or different, or not identical.
  • the probability state value of the arithmetically encoded zoom interval two-dimensional lookup table is less than a third value, and the sliding window parameter increases by less than the fourth value.
  • the sliding window parameter of the probability update model has a value ranging from 2 to 9.
  • the processing unit 310 is specifically configured to increase a sliding window parameter of the probability update model.
  • the processing unit 310 is further configured to: when the adjusted probability update model is used to encode/decode binary symbols, When the number of symbols satisfies the second condition, the sliding window parameter of the probability update model is again increased, and the amplitude of the sliding window parameter is increased again or the same as the amplitude of the previous increase.
  • the encoding/decoding unit 320 is further configured to: encode/decode binary symbols based on the probability update model that the sliding window parameter is secondarily increased.
  • the processing unit 310 is specifically configured to: when the number of binary symbols for encoding/decoding the binary symbols reaches a threshold in the initialization period of the context, when the probability update model of the context is used, The probability update model is adjusted.
  • the encoding/decoding unit 320 is specifically configured to: encode/decode binary symbols based on the adjusted probability update model during the initialization period.
  • the apparatus further includes: an initializing unit, configured to initialize the sliding window parameter of the probability update model based on a quantization step size of the block to be currently encoded or decoded.
  • the apparatus 300 can be used to perform the methods provided by the various method embodiments described above.
  • the functions of the processing unit 310, the encoding/decoding unit 320, and the initialization unit can all be implemented by a processor.
  • the embodiment of the present application further provides an encoding apparatus for performing the encoding related method in the above method embodiment.
  • the encoder may comprise means for performing the encoding related operations of the above method embodiments.
  • the embodiment of the present application further provides a decoding apparatus, which is used to perform the decoding related method in the above method embodiment.
  • the encoder may comprise means for performing the decoding related operations of the above method embodiments.
  • an embodiment of the present application further provides an encoder 400, including: a memory 420 for storing instructions, and a processor 410 for executing instructions stored in the memory 420, and Execution of the instructions stored in the memory 420 is such that the processor 410 is operative to perform the encoding related methods of the above method embodiments.
  • the encoder 400 is a CABAC encoder.
  • the embodiment of the present application further provides a decoder 500, including: a memory 520 for storing instructions, and a processor 510 for executing instructions stored by the memory 520, and Execution of the instructions stored in the memory 520 is such that the processor 510 is operative to perform the decoding related methods of the above method embodiments.
  • a decoder 500 including: a memory 520 for storing instructions, and a processor 510 for executing instructions stored by the memory 520, and Execution of the instructions stored in the memory 520 is such that the processor 510 is operative to perform the decoding related methods of the above method embodiments.
  • the decoder 500 is a CABAC decoder.
  • the embodiment of the present application further provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer executes the method of the foregoing method embodiment.
  • the embodiment of the present application further provides a computer program product comprising instructions, which when executed by a computer, cause a computer to execute the method of the above method embodiment.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server or data center via wired (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.).
  • the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)).
  • a magnetic medium for example, a floppy disk, a hard disk, a magnetic tape
  • an optical medium such as a digital video disc (DVD)
  • a semiconductor medium such as a solid state disk (SSD)
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

Abstract

Provided are a probability update method and apparatus for context. The method comprises: when the number of times a binary symbol is coded/decoded using a probability update model for context meets a condition, adjusting the probability update model; and based on the adjusted probability update model, coding/decoding the binary symbol. According to the number of times that coding/decoding is carried out using a probability update model for context, the probability update model is adjusted, such that the coding/decoding performance can be improved to some extent.

Description

上下文的概率更新方法与装置Context probability update method and device
版权申明Copyright statement
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。The disclosure of this patent document contains material that is subject to copyright protection. This copyright is the property of the copyright holder. The copyright owner has no objection to the reproduction of the patent document or the patent disclosure in the official records and files of the Patent and Trademark Office.
技术领域Technical field
本申请涉及视频编解码领域,并且更为具体地,涉及一种上下文的概率更新方法与装置。The present application relates to the field of video codec and, more particularly, to a method and apparatus for probabilistic updating of a context.
背景技术Background technique
基于上下文的自适应二进制算术编码(Context-based Adaptive Binary Arithmetic Coding,CABAC)是国际视频编码标准H.264采用的一种熵编码方案。在H.264的下一代HEVC标准、以及当前正在开发的编解码标准中,也均采用了CABAC方法。Context-based Adaptive Binary Arithmetic Coding (CABAC) is an entropy coding scheme adopted by the international video coding standard H.264. The CABAC method is also adopted in the next-generation HEVC standard of H.264 and the codec standards currently under development.
熵编码中语法元素经过二值化,得到多个二进制位,每个二进制位称为一个bin,这多个二进制位形成的二进制比特串称为bin串。一个bin串中的每个bin或者若干个bin会被分配一个上下文,通过该上下文里存储的概率更新模型相关的参数,通过CABAC对bin串进行编码。编码的大致流程为:使用概率更新模型预测这个bin的概率值,然后根据该概率值对这个bin进行算术编码。The syntax elements in the entropy coding are binarized to obtain a plurality of binary bits, each of which is called a bin, and the binary bit string formed by the multiple binary bits is called a bin string. Each bin or a number of bins in a bin string is assigned a context, and the model-related parameters are updated by the probability stored in the context, and the bin string is encoded by CABAC. The general process of encoding is to predict the probability value of the bin using a probability update model, and then arithmetically encode the bin according to the probability value.
目前,CABAC的编码性能还有待于进一步提升与优化。At present, the coding performance of CABAC needs to be further improved and optimized.
发明内容Summary of the invention
本申请提供一种上下文的概率更新方法与装置,可以进一步地提高CABAC的编/解码性能。The present application provides a context probability update method and apparatus, which can further improve the encoding/decoding performance of CABAC.
第一方面,提供一种上下文的概率更新方法,该方法包括:当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件时,对所述概率更新模型进行调整;基于调整后的所述概率更新模型对二进制符号进行编/解码。In a first aspect, a context update method is provided, the method comprising: adjusting a probability update model when a number of binary symbols for encoding/decoding binary symbols is satisfied using a probability update model of the context Binding/decoding binary symbols based on the adjusted probability update model.
在本申请提供的方案中,根据使用上下文的概率更新模型的编/解码的次数,对概率更新模型进行调整,这样可以在一定程度上提高编/解码性能。In the solution provided by the present application, the probability update model is adjusted according to the number of times of encoding/decoding of the model using the probability of using the context, so that the encoding/decoding performance can be improved to some extent.
第二方面,提供一种上下文的概率更新装置,该装置包括:处理单元,用于当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件时,对所述概率更新模型进行调整;编/解码单元,用于基于调整后的所述概率更新模型对二进制符号进行编/解码。In a second aspect, a context probability updating apparatus is provided, the apparatus comprising: a processing unit, configured to: when a number of binary symbols for encoding/decoding a binary symbol is satisfied using a probability update model of the context, The probability update model is adjusted; an encoding/decoding unit is configured to encode/decode the binary symbols based on the adjusted probability update model.
第三方面,提供一种编码器,所述编码器包括存储器和处理器,所述存储器用于存储指令,所述处理器用于执行所述存储器存储的指令,并且对所述存储器中存储的指令的执行使得所述处理器执行第一方面提供的关于编码的方法。In a third aspect, an encoder is provided, the encoder comprising a memory and a processor, the memory for storing instructions, the processor for executing the instructions stored by the memory, and instructions stored in the memory Execution of the processor causes the processor to perform the method of encoding provided by the first aspect.
第四方面,提供一种解码器,所述解码器包括存储器和处理器,所述存储器用于存储指令,所述处理器用于执行所述存储器存储的指令,并且对所述存储器中存储的指令的执行使得所述处理器执行第一方面提供的关于解码的方法。In a fourth aspect, a decoder is provided, the decoder comprising a memory and a processor, the memory for storing instructions, the processor for executing the instructions stored by the memory, and instructions stored in the memory Execution of the processor causes the processor to perform the method of decoding provided by the first aspect.
第五方面,提供一种芯片,所述芯片包括处理模块与通信接口,所述处理模块用于控制所述通信接口与外部进行通信,所述处理模块还用于实现第一方面提供的方法。In a fifth aspect, a chip is provided, the chip comprising a processing module and a communication interface, the processing module is configured to control the communication interface to communicate with an external, and the processing module is further configured to implement the method provided by the first aspect.
第六方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被计算机执行时使得所述计算机实现第一方面提供的方法。具体地,所述计算机例如为编/解码器。In a sixth aspect, a computer readable storage medium is provided having stored thereon a computer program that, when executed by a computer, causes the computer to implement the method provided by the first aspect. In particular, the computer is for example an encoder/decoder.
第七方面,提供一种包含指令的计算机程序产品,所述指令被计算机执行时使得所述计算机实现第一方面提供的方法。具体地,所述计算机例如为编/解码器。In a seventh aspect, a computer program product comprising instructions, which when executed by a computer, causes the computer to implement the method provided by the first aspect. In particular, the computer is for example an encoder/decoder.
因此,在本申请提供的方案中,根据使用上下文的概率更新模型的编/解码的次数,对概率更新模型进行调整,这样可以在一定程度上提高编/解码性能。Therefore, in the solution provided by the present application, the probability update model is adjusted according to the number of times of encoding/decoding of the model using the probability of using the context, so that the encoding/decoding performance can be improved to some extent.
附图说明DRAWINGS
图1为本申请实施例提供的上下文的概率更新方法的示意性流程图。FIG. 1 is a schematic flowchart of a method for updating a probability of a context provided by an embodiment of the present application.
图2为本申请实施例提供的上下文的概率更新方法的另一示意性流程图。FIG. 2 is another schematic flowchart of a method for updating a probability of a context provided by an embodiment of the present application.
图3为本申请实施例提供的上下文的概率更新装置的示意性框图。FIG. 3 is a schematic block diagram of a probability update apparatus for a context provided by an embodiment of the present application.
图4为本申请实施例提供的编码器的示意性框图。FIG. 4 is a schematic block diagram of an encoder according to an embodiment of the present application.
图5为本申请实施例提供的解码器的示意性框图。FIG. 5 is a schematic block diagram of a decoder provided by an embodiment of the present application.
具体实施方式detailed description
为了便于理解与描述本申请实施例提供的方案,下文先描述如下概念。In order to facilitate understanding and description of the solutions provided by the embodiments of the present application, the following concepts are first described below.
1.CABAC的编码过程。1. CABAC encoding process.
1)二值化。1) Binarization.
将熵编码中的语法元素转化成二进制(Binarization)。将语法元素转化为二进制后,得到多个二进制符号,每个二进制符号称为一个bin,这多个二进制符号形成的二进制比特串称为bin串。The syntax elements in entropy coding are converted to Binarization. After converting the syntax elements into binary, a plurality of binary symbols are obtained, each of which is called a bin, and the binary bit string formed by the plurality of binary symbols is called a bin string.
如果待编码的符号已经是二进制符号,则步骤1)可以省略。If the symbol to be encoded is already a binary symbol, step 1) can be omitted.
2)选择概率更新模型。2) Select the probability update model.
一个bin串中的每个bin或者若干个bin会被分配一个上下文,通过该上下文里存储的概率更新模型相关的参数,使用CABAC对这个bin串进行编码。对于一个待编码的bin,选择其所分配的上下文里存储的概率更新模型。Each bin or bins in a bin string is assigned a context, and the model-related parameters are updated by the probability stored in the context, and the bin string is encoded using CABAC. For a bin to be encoded, select the probability update model stored in the context to which it is assigned.
3)二进制算术编码。3) Binary arithmetic coding.
通过选择的概率更新模型对bin进行二进制算术编码。The binary arithmetic coding of the bin is performed by the selected probability update model.
CABAC的解码过程与CABAC的编码过程相对应。The decoding process of CABAC corresponds to the coding process of CABAC.
2.概率更新模型。2. Probability update model.
在算术编码的过程中,同一个上下文所包含的概率或者所包含的用于指示概率的信息并不是固定的,而是会随着引用该上下文进行解码的bin的数量的变化而进行更新。具体的,上下文所包含的概率或者所包含的用于指示概率的信息会基于上下文的概率更新模型进行更新。In the process of arithmetic coding, the probability contained in the same context or the information contained in the indicated probability is not fixed, but is updated as the number of bins that decode the context is changed. Specifically, the probability included in the context or the information included to indicate the probability is updated based on the probability update model of the context.
在不同实现方式中,概率更新模型的数量可能会不同,本申请中不限定概率更新模型的数量。In different implementations, the number of probability update models may be different, and the number of probability update models is not limited in this application.
作为一种实现方式,使用一个概率更新模型更新上下文中的概率或者指向概率的信息。As an implementation, a probability update model is used to update the probability in the context or the information pointing to the probability.
当bin为“1”时,U[k+1]=U[k]+((2^15-U[k])>>4),When bin is "1", U[k+1]=U[k]+((2^15-U[k])>>4),
当bin为“0”时,U[k+1]=U[k]-(U[k]>>4),When bin is "0", U[k+1]=U[k]-(U[k]>>4),
P[k+1]=U[k+1]公式(1)P[k+1]=U[k+1] formula (1)
其中,P[k+1]为最终预测概率,U为概率更新模型。k和k+1分别表示当前状态和下一个状态。4为滑动窗口参数(sliding window parameter)。Where P[k+1] is the final prediction probability and U is the probability update model. k and k+1 represent the current state and the next state, respectively. 4 is a sliding window parameter.
作为另一种实现方式,使用两个概率更新模型预测bin的概率。As another implementation, the probability of predicting bin is estimated using two probability update models.
当bin为“1”时,When bin is "1",
U[k+1]=U[k]+((2^15-U[k])>>4),V[k+1]=V[k]+((2^15-V[k])>>8),U[k+1]=U[k]+((2^15-U[k])>>4),V[k+1]=V[k]+((2^15-V[k] )>>8),
当bin为“0”时,When bin is "0",
U[k+1]=U[k]-(U[k]>>4),V[k+1]=V[k]-(V[k]>>8),U[k+1]=U[k]-(U[k]>>4), V[k+1]=V[k]-(V[k]>>8),
P[k+1]=(U[k+1]+V[k+1])>>1公式(2)P[k+1]=(U[k+1]+V[k+1])>>1 formula (2)
其中,P[k+1]为最终预测概率,U和V为两个概率更新模型。k和k+1分别表示当前状态和下一个状态。4为概率更新模型U中的滑动窗口参数,8为概率更新模型V中的滑动窗口参数。Among them, P[k+1] is the final prediction probability, and U and V are two probability update models. k and k+1 represent the current state and the next state, respectively. 4 is the sliding window parameter in the probability update model U, and 8 is the sliding window parameter in the probability update model V.
需要说明的是,在不同的标准中,概率更新模型的体现也可能不同,因为概率更新模型是维持算术编码中的概率值的过程,不同的标准中实现该过程的方式有所不同。例如,在一些视频标准中,概率更新模型可能结合预先设计的有限状态机的状态跳转来实现模型的更新,该有限状态机规定了当前状态跳转到下一个状态规则。有限状态机的状态值表达的是概率相关信息。It should be noted that the expression of the probability update model may be different in different standards, because the probability update model is a process of maintaining the probability value in the arithmetic coding, and the manner in which the process is implemented in different standards is different. For example, in some video standards, the probabilistic update model may implement an update of the model in conjunction with a state jump of a pre-designed finite state machine that specifies the current state transition to the next state rule. The state value of the finite state machine expresses probability related information.
在一些视频标准中,倾向于使用上下文更新模型来表达概率更新模型,相应地,使用上下文的建模来代替概率更新的过程。In some video standards, it is preferred to use a context update model to express a probability update model, and accordingly, to use contextual modeling instead of a probabilistic update process.
在一些视频标准中,上下文模型中存储的最主要的是与概率更新相关的信息。该相关信息表达的是隐式形式的概率值,比如上述有限状态机的状态值。或者,该概率相关的信息是显式形式的概率相关值,比如概率值。无论上下文模型中存储的是显示形式还是隐式形式的概率相关值,上下文的建模规定了该上下文的概率以怎样的规则更新。In some video standards, the most important thing stored in the context model is the information related to the probability update. The related information expresses an implicit value of the probability value, such as the state value of the finite state machine described above. Alternatively, the probability related information is an explicit form of probability correlation value, such as a probability value. Regardless of whether the context model stores a probability-dependent value in the form of a display or an implicit form, the modeling of the context specifies what rules the probability of the context is updated with.
在现有的做法中,滑动窗口参数取固定值,即上下文的概率更新模型是保持不变的。In the current practice, the sliding window parameter takes a fixed value, that is, the probability update model of the context remains unchanged.
3.上下文的初始化周期。3. The initialization cycle of the context.
在CABAC的熵编码过程中,上下文以一定的周期进行初始化,这个周期称为上下文的初始化周期。例如,以条带(slice)为周期对上下文进行初 始化,即上下文的初始化周期为一个slice。In the entropy coding process of CABAC, the context is initialized with a certain period, which is called the initialization period of the context. For example, the context is initialized with a period of a slice, that is, the initialization period of the context is a slice.
在对上下文初始化的同时,也对上下文的概率更新模型进行初始化。对概率更新模型进行初始化,包括对概率更新模型中的滑动窗口参数进行初始化。At the same time as the context is initialized, the context's probability update model is also initialized. Initializing the probability update model includes initializing the sliding window parameters in the probability update model.
例如,在上文描述的使用一个概率更新模型预测概率的实现方式中,初始化后的滑动窗口参数的取值为4。再例如,在上文描述的使用两个概率更新模型预测概率的实现方式中,初始化后的两个滑动窗口参数的取值分别为4和8。For example, in the implementation described above using a probability update model prediction probability, the value of the initialized sliding window parameter is 4. For another example, in the implementation described above using two probability update model prediction probabilities, the values of the two sliding window parameters after initialization are 4 and 8, respectively.
在现有技术中,概率更新模型在初始化后保持不变,直至下一次初始周期开始才再次进行初始化。In the prior art, the probability update model remains unchanged after initialization until initialization is initiated again at the beginning of the next initial cycle.
本申请提供一种CABAC中概率更新的方法与装置,相对于现有技术,可以进一步提高编码(或解码)性能。The present application provides a method and apparatus for probabilistic updating in CABAC, which can further improve encoding (or decoding) performance relative to the prior art.
本申请提供的方案可以应用于编码,也可以应用于解码。The solution provided by the present application can be applied to coding as well as to decoding.
图1为本申请实施例提供的上下文的概率更新方法的示意性流程图。该方法可以由编码器/解码器执行。该方法包括如下步骤。FIG. 1 is a schematic flowchart of a method for updating a probability of a context provided by an embodiment of the present application. This method can be performed by an encoder/decoder. The method includes the following steps.
S110,当使用上下文的概率更新模型对二进制符号进行编/解码的次数满足条件时,对该概率更新模型进行调整。S110: When the number of times the binary symbol is encoded/decoded by using the probability update model of the context satisfies the condition, the probability update model is adjusted.
使用上下文的概率更新模型对二进制符号进行编/解码的次数满足条件,指的是,使用上下文的概率更新模型对二进制符号进行编码的次数满足条件,或者,使用上下文的概率更新模型对二进制符号进行解码的次数满足条件。The number of times the binary symbol is encoded/decoded using the probability update model of the context satisfies the condition that the number of times the binary symbol is encoded using the probability update model of the context satisfies the condition, or the probability of the context is updated using the context to update the model. The number of decodings satisfies the condition.
在一些实施方式,使用上下文的概率更新模型对二进制符号进行编/解码的次数满足条件,指的是,使用上下文的概率更新模型对二进制符号进行编/解码的次数达到阈值。In some embodiments, the number of times the binary symbol is encoded/decoded using the probability update model of the context satisfies the condition, meaning that the number of times the binary symbol is encoded/decoded using the probability update model of the context reaches a threshold.
使用上下文的概率更新模型对二进制符号进行编/解码的次数达到阈值,指的是,使用上下文的概率更新模型对二进制符号进行编码的次数达到阈值,或,使用上下文的概率更新模型对二进制符号进行解码的次数达到阈值。The number of times the binary symbol is encoded/decoded using the probability update model of the context reaches a threshold, which means that the number of times the binary symbol is encoded using the probability update model of the context reaches a threshold, or the binary symbol is updated using the probability update model of the context. The number of decodings reaches the threshold.
具体地,在S110中,当使用上下文的概率更新模型对二进制符号进行编/解码的次数达到阈值时,对该概率更新模型进行调整。Specifically, in S110, when the number of times the binary symbol is encoded/decoded by the probability update model of the context reaches a threshold, the probability update model is adjusted.
在编码场景中,当使用概率更新模型编码bin的数量达到该阈值时,对该概率更新模型进行调整。In the coding scenario, when the number of bins using the probability update model code reaches the threshold, the probability update model is adjusted.
在解码场景中,当使用概率更新模型解码bin的数量达到该阈值时,对该概率更新模型进行调整。In the decoding scenario, when the number of decoding bins using the probability update model reaches the threshold, the probability update model is adjusted.
下文将描述该阈值的确定方法。The method of determining the threshold will be described below.
在一些实施方式中,使用上下文的概率更新模型对二进制符号进行编/解码的次数满足条件,也可以表示其他的情形,例如,使用上下文的概率更新模型对二进制符号进行编/解码的次数对应的时长超过预设值。本申请对此不作限定,只要通过使用上下文的概率更新模型对二进制符号进行编/解码的数量获取到调整概率更新模型的较好时机即可。In some embodiments, the number of times the binary symbol is encoded/decoded using the probability update model of the context satisfies the condition, and may also represent other situations, for example, the number of times the binary symbol is encoded/decoded using the probability update model of the context. The duration exceeds the preset value. This application does not limit this, as long as the number of encoding/decoding binary symbols is obtained by using the probability update model of the context to obtain a better timing for adjusting the probability update model.
对该概率更新模型进行调整,指的是,改变该概率更新模型,使得调整后与调整前的概率更新模型不同。Adjusting the probability update model refers to changing the probability update model so that the adjusted and updated probabilistic update model is different.
可选地,对该概率更新模型进行调整,包括,调整该概率更新模型中的一个或多个参数的取值。Optionally, adjusting the probability update model includes adjusting a value of one or more parameters in the probability update model.
例如,调整概率更新模型中的滑动窗口参数。再例如,调整概率更新模型中的其他参数。本申请对此不作限定。For example, adjust the probability of updating the sliding window parameters in the model. For another example, adjust the probability to update other parameters in the model. This application does not limit this.
可选地,调整该概率更新模型中的一个或多个参数的取值,包括,将该概率更新模型中的参数的数值调小或调大。Optionally, adjusting the value of the one or more parameters in the probability update model includes: reducing or increasing the value of the parameter in the probability update model.
S120,使用调整后的概率更新模型对二进制符号进行编/解码。S120: The binary symbol is encoded/decoded by using the adjusted probability update model.
在编码场景下,在S110中,当使用上下文的概率更新模型对二进制符号进行编码的次数满足条件时,对概率更新模型进行调整,则在S120中,使用调整后的概率更新模型预测bin的概率,并利用该概率,对该bin进行二进制算术编码。In the coding scenario, in S110, when the number of times the binary symbol is encoded using the probability update model of the context satisfies the condition, the probability update model is adjusted, and in S120, the probability of the model is predicted using the adjusted probability update model. And using the probability, binary arithmetic coding of the bin.
在解码场景下,在S110中,当使用上下文的概率更新模型对二进制符号进行解码的次数满足条件时,对概率更新模型进行调整,则在S120中,使用调整后的概率更新模型预测bin的概率,并利用该概率,对该bin进行二进制算术解码。In the decoding scenario, in S110, when the number of times the binary symbol is decoded using the probability update model of the context satisfies the condition, the probability update model is adjusted, and in S120, the probability of the model is predicted using the adjusted probability update model. And using the probability, binary arithmetic decoding of the bin.
在编码场景中,利用上下文的概率更新模型进行算术编码的过程中,一开始进行编码时,可参考的已经编码的信息比较少,随着编码的进行,可参考的已经编码的信息越来越多,如果始终使用固定不变的概率更新模型进行编码,可能不利于编码性能的提升。In the coding scenario, in the process of using the probability update model of the context to perform arithmetic coding, when the coding is started, the already coded information can be referenced less, and as the coding proceeds, the already coded information can be referred to more and more. Many, if you always use a fixed probability to update the model for encoding, it may not be conducive to the improvement of encoding performance.
在解码场景中,利用上下文的概率更新模型进行算术解码的过程中,一 开始进行解码时,可参考的已经解码的信息比较少,随着解码的进行,可参考的已经解码的信息越来越多,如果始终使用固定不变的概率更新模型进行解码,可能不利于解码性能的提升。In the decoding scenario, in the process of performing arithmetic decoding by using the probability update model of the context, when the decoding is started, the already decoded information can be referred to less, and as the decoding progresses, the already decoded information can be referred to more and more. Many, if you always use a fixed probability to update the model for decoding, it may not be conducive to the improvement of decoding performance.
在本申请实施例中,根据使用上下文的概率更新模型的编/解码的次数,对概率更新模型进行调整。例如,当使用上下文的概率更新模型的编/解码的次数达到阈值时,对概率更新模型进行调整,可以认为这时可参考的已经编码的信息已经很多,这时需要调节概率更新模型以适应变化的编码环境,这样可以在一定程度上提高编/解码性能。In the embodiment of the present application, the probability update model is adjusted according to the number of times of encoding/decoding of the model using the probability of using the context. For example, when the number of times of encoding/decoding of the probability update model using the context reaches the threshold, the probability update model is adjusted, and it can be considered that there is already a lot of already encoded information that can be referred to at this time, and the probability update model needs to be adjusted to adapt to the change. The encoding environment, which can improve the encoding/decoding performance to some extent.
应理解,解码过程与编码过程相对应,本申请提供的技术方案可以应用于编码过程,也可以应用于解码过程。为了描述的方便,本文中有些实施例可能会仅以编码场景(或解码场景)为例进行描述,相关的方案及其技术效果同样适用于解码场景(或编码场景)。It should be understood that the decoding process corresponds to the encoding process, and the technical solution provided by the present application can be applied to the encoding process as well as to the decoding process. For convenience of description, some embodiments herein may only describe an encoding scenario (or a decoding scenario) as an example, and related schemes and technical effects thereof are equally applicable to a decoding scenario (or a coding scenario).
可选地,在S110中,在一个初始化周期内,当使用上下文的概率更新模型对二进制符号进行编/解码的次数达到该阈值时,对该概率更新模型进行调整;在120中,在同一个初始化周期内,使用调整后的概率更新模型对二进制符号进行编/解码。Optionally, in S110, when the number of times the binary symbol is encoded/decoded by the probability update model of the context reaches the threshold in an initialization period, the probability update model is adjusted; in 120, in the same The binary symbols are encoded/decoded using the adjusted probability update model during the initialization cycle.
以编码场景为例,在一个初始化周期的开始,对上下文的概率更新模型进行初始化;完成初始化后,使用该概率更新模型预测bin的概率,并使用预测的概率对bin进行二进制算术编码;当使用该概率更新模型进行编码的bin的数量达到该阈值时,调整该概率更新模型;在本初始化周期内,使用调整后的概率更新模型继续预测bin的概率,并使用预测的概率对bin进行二进制算术编码。Taking the coding scenario as an example, at the beginning of an initialization period, the probability update model of the context is initialized; after the initialization is completed, the probability of the model prediction bin is updated using the probability, and the binary probability encoding is performed on the bin using the predicted probability; When the number of bins encoded by the probability update model reaches the threshold, the probability update model is adjusted; in the initialization period, the adjusted probability is used to update the model to continue predicting the probability of bin, and the binary probability is used to perform binary arithmetic on the bin. coding.
以解码场景为例,在一个初始化周期的开始,对上下文的概率更新模型进行初始化;完成初始化后,使用该概率更新模型预测bin的概率,并使用预测的概率对bin进行二进制算术解码;当使用该概率更新模型进行解码的bin的数量达到该阈值时,调整该概率更新模型;在本初始化周期内,使用调整后的概率更新模型继续预测bin的概率,并使用预测的概率对bin进行二进制算术解码。Taking the decoding scene as an example, at the beginning of an initialization period, the probability update model of the context is initialized; after the initialization is completed, the probability of the model prediction bin is updated using the probability, and the binary probability decoding of the bin is performed using the predicted probability; When the number of bins to be decoded by the probability update model reaches the threshold, the probability update model is adjusted; in the initialization period, the adjusted probability is used to update the model to continue predicting the probability of the bin, and the predicted probability is used to perform binary arithmetic on the bin. decoding.
现有技术中,在对概率更新模型初始化后,在当前初始化周期内,概率更新模型固定不变,而在一个初始化周期内,随着编码(或解码)的进行, 可参考的已经编码(或解码)的信息越来越多,使用固定的概率更新模型可能不利于编码(或编码)性能的提升。In the prior art, after the initialization of the probability update model, the probability update model is fixed during the current initialization period, and in an initialization period, as the encoding (or decoding) proceeds, the referenced encoding may be performed (or More and more information is being decoded, and updating the model with a fixed probability may be detrimental to the performance of the encoding (or encoding).
而本申请实施例,在同一个上下文的初始化周期内,根据使用上下文的概率更新模型的编/解码的次数,对概率更新模型进行调整,在一定程度上,可以提高编/解码性能。In the embodiment of the present application, the probability update model is adjusted according to the probability of updating the model according to the probability of using the context in the initialization period of the same context, and the encoding/decoding performance can be improved to a certain extent.
一帧图像由一个或者多个条带(slice)组成,而一个slice又可以被分割成一个或多个编码树单元(coding tree unit,CTU)。A frame of image consists of one or more slices, and a slice can be split into one or more coding tree units (CTUs).
可选地,在一些实施方式中,上下文的初始化可以以一个条带(slice)为周期,即上下文的初始化周期为一个slice。Optionally, in some embodiments, the initialization of the context may be in a period of one slice, that is, the initialization period of the context is one slice.
可选地,在一些实施方式中,上下文的初始化可以以一个CTU为周期,即上下文的初始化周期为一个CTU。Optionally, in some embodiments, the initialization of the context may be in a CTU period, that is, the initialization period of the context is one CTU.
可选地,在另一些实施方式中,上下文的初始化还可以以一个其他的图像编码单元为周期。即上下文的初始化周期可以为其他的图像编码单元,本申请对此不做限定。Optionally, in other embodiments, the initialization of the context may also be cycled with one other image coding unit. That is, the initialization period of the context may be other image coding units, which is not limited in this application.
在一些实施方式中,在使用该上下文的概率更新模型对二进制符号进行编/解码之前,该方法还包括:对该概率更新模型进行初始化。In some embodiments, prior to encoding/decoding the binary symbols using the probability update model of the context, the method further comprises: initializing the probability update model.
具体地,对该概率更新模型中的参数进行初始化。例如,对该概率更新模型中的滑动窗口参数进行初始化。Specifically, the parameters in the probability update model are initialized. For example, the sliding window parameters in the probability update model are initialized.
在一些实施例中,可以根据当前slice的量化步长(Quantization Parameter,QP),来对滑动窗口参数进行初始化。In some embodiments, the sliding window parameters may be initialized according to a quantization parameter (QP) of the current slice.
在一些实施例中,可以根据当前CTU的量化步长,来对滑动窗口参数进行初始化。In some embodiments, the sliding window parameters may be initialized based on the quantization step size of the current CTU.
在一些实施例中,基于当前待编码或解码的块的量化步长对该概率更新模型的滑动窗口参数进行初始化。In some embodiments, the sliding window parameters of the probability update model are initialized based on the quantization step size of the block currently being encoded or decoded.
在一些实施例中,还可以根据当前上下文的编码状态对滑动窗口参数进行初始化。In some embodiments, the sliding window parameters may also be initialized based on the encoding state of the current context.
在本申请,当使用上下文的概率更新模型对二进制符号进行编/解码的次数达到该阈值时,对该概率更新模型进行调整,其中,该阈值可以通过如下几种实现方式确定。In the present application, when the number of times the binary symbol is encoded/decoded by the probability update model of the context reaches the threshold, the probability update model is adjusted, wherein the threshold may be determined by the following implementation manners.
第一种实现方式,根据算术编码的缩放区间二维查询表的概率状态值确 定该阈值。In the first implementation, the threshold is determined based on the probability state value of the arithmetically encoded zoom interval two-dimensional lookup table.
在一些实施方式中,该阈值为小于该概率状态值的最大值的正整数。In some embodiments, the threshold is a positive integer that is less than a maximum of the probability state value.
假设,该二维查询表的概率状态值的最大值为512,则该阈值为小于512的正整数,例如该阈值为128。Assuming that the maximum value of the probability state value of the two-dimensional lookup table is 512, the threshold is a positive integer less than 512, for example, the threshold is 128.
算术编码的缩放区间二维查询表为CABAC中的编码表。顾名思义,算术编码的缩放区间二维查询表是一个二维的表。算术编码的缩放区间二维查询表也可简称为区间查询表。为了简洁,下文采用区间查询表的描述。The arithmetic interval of the arithmetic interval is a coding table in CABAC. As the name implies, the arithmetic interval of the scaled two-dimensional lookup table is a two-dimensional table. The scaling interval two-dimensional lookup table of the arithmetic coding may also be simply referred to as an interval query table. For the sake of brevity, the description of the interval lookup table is used below.
区间查询表用来查询当前概率和算术编码引擎缩放区间对应的新的缩放区间的大小。区间查询表是CABAC免乘法的一种实现方式,即避免通过概率与当前缩放区间的大小之间的乘法运算来获得新的缩放区间的大小。The interval query table is used to query the current probability and the size of the new scaling interval corresponding to the scaling interval of the arithmetic coding engine. The interval query table is an implementation of the CABAC-free multiplication method, that is, avoiding the multiplication operation between the probability and the size of the current zoom interval to obtain the size of the new zoom interval.
区间查询表具有两个索引值:概率状态值和缩放区间值。缩放区间值表示区间查询表中的区间的长度(Range)。概率状态值表示每个区间的概率值。The interval lookup table has two index values: a probability state value and a scaling interval value. The scale interval value represents the length of the interval in the interval lookup table (Range). The probability state value represents the probability value of each interval.
这两个索引值,即概率状态值和缩放区间值,用于查询CABAC的新的缩放区间。These two index values, the probability state value and the scaling interval value, are used to query the new zoom interval of CABAC.
一些实现方式中,采用符号“x”表示概率状态值,采用符号“y”表示算术编码引擎当前的缩放区间值。为了描述的简洁,下文中用符号“x”表示将概率状态值,用符号“y”表示算术编码引擎当前的缩放区间值。但本申请对此不作限定,在其它的实现方式中,也可以采用其他符号来表示概率状态值和算术编码引擎当前的缩放区间值。In some implementations, the symbol "x" is used to represent the probability state value, and the symbol "y" is used to represent the current scaling interval value of the arithmetic coding engine. For simplicity of description, the symbol "x" is used hereinafter to represent the probability state value, and the symbol "y" is used to represent the current scaling interval value of the arithmetic coding engine. However, this application does not limit this. In other implementations, other symbols may also be used to represent the probability state value and the current scaling interval value of the arithmetic coding engine.
概率状态值x表示的是概率值,即上文描述的概率更新模型的示例中的P[k+1]的值)。假设U和V的取值范围是[1,2^15],所以P[k+1]的取值区间也是一样。但是x的值并不是2^15,因为这样表格太大了,所以一些实施方式中,x是P[k]>>6(也即是2^9=512)。在一些实施方式中,x的值也可能是1024或者更大。The probability state value x represents a probability value, that is, a value of P[k+1] in the example of the probability update model described above). Assuming that the range of U and V is [1, 2^15], the interval of P[k+1] is the same. However, the value of x is not 2^15, because the table is too large, so in some embodiments, x is P[k]>>6 (that is, 2^9=512). In some embodiments, the value of x may also be 1024 or greater.
缩放区间值y的值代表的是区间长度(Range),Range的取值范围为1到512。一些实施方式中,y=(Range>>2)–64。这样做的原因是,Range可以看成是一个9bit的二进制,右移两位表示只考虑高7位的大小,于是这里的缩放区间值y的值就是高7位减去64。不管怎样操作,目的都是将区间量化。最后缩放区间值y的取值范围即为[0,64]。The value of the scale interval value y represents the interval length (Range), and Range ranges from 1 to 512. In some embodiments, y = (Range>> 2) - 64. The reason for this is that Range can be regarded as a 9-bit binary, and shifting two bits to the right means that only the size of the upper 7 bits is considered, so the value of the scaling interval value y here is the high 7 bits minus 64. Regardless of the operation, the goal is to quantify the interval. The range of the final scaling interval value y is [0, 64].
例如,Range值在488(111101000)到491(111101011)之间,即Range 的值右移两位为122(1111010),减去64之后为58,那么Range值在488-491区间内的值,其对应的索引值均为58。又如,Range值在492(111101100)到495(111101111)范围内,Range的值右移两位为123(1111011),减去64之后为59,则Range值在492-495区间内的值,其对应的索引值均为58。For example, the Range value is between 488 (111101000) and 491 (111101011), that is, the value of Range is shifted to two by 122 (1111010), and after subtracting 64, it is 58, then the value of Range is in the range of 488-491. Its corresponding index value is 58. For another example, the Range value is in the range of 492 (111101100) to 495 (111101111), the value of Range is shifted to two by 123 (1111011), and after subtracting 64, it is 59, then the Range value is in the range of 492-495. Its corresponding index value is 58.
上述确定概率状态值x和缩放区间值y的值的方法仅为示例而非限定。实际操作中还可以采用其他的方式实现。例如,可以直接使用Range的值而不进行量化来,确定缩放区间值y的取值。The above method of determining the values of the probability state value x and the scaling interval value y is merely an example and not a limitation. In practice, it can be implemented in other ways. For example, the value of Range can be directly used without determining the value of the scaling interval value y.
一些实现方式中,区间查询表的大小为512×64。即x的取值范围为1到512,y的取值范围为1到64。In some implementations, the size of the interval lookup table is 512 x 64. That is, x ranges from 1 to 512, and y ranges from 1 to 64.
在另一些实现方式中,x和y的最大取值可能是1024或者更大。In other implementations, the maximum value of x and y may be 1024 or greater.
例如,当区间查询表的大小为512×64时,则该阈值可以设置为小于512的正整数。For example, when the size of the interval lookup table is 512 x 64, the threshold may be set to a positive integer less than 512.
在一些实施方式中,该阈值为位于X/2 n1到X/2 n2之间的整数,其中X为算术编码的缩放区间二维查询表的概率状态值的最大值,X/2 n1大于1,n1与n2为自然数,n1大于n2。 In some embodiments, the threshold is an integer between X/2 n1 and X/2 n2 , where X is the maximum value of the probability state value of the arithmetically encoded zoom interval two-dimensional look-up table, X/2 n1 is greater than 1 , n1 and n2 are natural numbers, and n1 is greater than n2.
例如,算术编码的缩放区间二维查询表的概率状态值的最大值X为512,该阈值可以为512/2 4到512/2 2之间的整数(即32到128之间的整数),或该阈值可以为512/2 3到X/2 1之间的整数(即61至256之间的整数)。 For example, the maximum value X of the probability state value of the scaled interval two-dimensional lookup table of the arithmetic coding is 512, and the threshold may be an integer between 512/2 4 and 512/2 2 (ie an integer between 32 and 128), Or the threshold may be an integer between 512/2 3 and X/2 1 (ie an integer between 61 and 256).
上面例子仅为示例而非限定,在一些标准中,算术编码的缩放区间二维查询表的概率状态值的最大值X还可以为其他值,例如1024等。The above examples are merely examples and are not limiting. In some standards, the maximum value X of the probability state values of the scaled two-dimensional look-up table of the arithmetic coding may also be other values, such as 1024 or the like.
第二种实现方式,该阈值是自适应调整的。In a second implementation, the threshold is adaptively adjusted.
该阈值是基于同一个上下文的概率更新模型在已经编码/解码的一个或者多个初始化周期内的平均使用次数确定的。The threshold is determined based on the average number of uses of the probability update model of the same context over one or more initialization cycles that have been encoded/decoded.
例如,统计当前的上下文在已经编码/解码的一个或多个初始化周期内的平均编/解码次数,然后根据该平均编/解码次数确定该阈值的取值。For example, the average number of encoding/decoding times of the current context in one or more initialization periods that have been encoded/decoded is counted, and then the value of the threshold is determined according to the average number of encoding/decoding.
以编码场景为,一个上下文的概率更新模型在已经编码的初始化周期T1内进行编码的次数为N1,在已经编码的初始化周期T2内进行编码的次数为N2,在已经编码的初始化周期T3内进行编码的次数为N3,对N1、N2和N3求平均,得到的平均值为该上下文的概率更新模型在这3个初始化周期内的平均使用次数。In the coding scenario, the probability update model of one context is encoded in the already-initialized initialization period T1, and the number of times of encoding in the already-initialized initialization period T2 is N2, which is performed in the already-encoded initialization period T3. The number of times of encoding is N3, and N1, N2, and N3 are averaged, and the average value obtained is the average number of times the probability update model of the context is used in the three initialization periods.
以解码场景为,一个上下文的概率更新模型在已经解码的初始化周期T1内进行解码的次数为N1,在已经解码的初始化周期T2内进行解码的次数为N2,在已经解码的初始化周期T3内进行解码的次数为N3,对N1、N2和N3求平均,得到的平均值为该上下文的概率更新模型在这3个初始化周期内的平均使用次数。In the decoding scenario, the number of times the probability update model of one context is decoded in the already decoded initialization period T1 is N1, and the number of times of decoding in the already decoded initialization period T2 is N2, and is performed in the already initialized initialization period T3. The number of decodings is N3, and N1, N2, and N3 are averaged, and the average value obtained is the average number of times the probability update model of the context is used in the three initialization periods.
再例如,统计多个不同的上下文在已经编码/解码的一个或多个初始化周期内的平均编码次数,然后根据该平均编码次数确定该阈值的取值。As another example, the average number of encodings of a plurality of different contexts within one or more initialization periods that have been encoded/decoded is counted, and then the value of the threshold is determined based on the average number of encodings.
具体地,可以通过预训练(pre-training),来统计上下文在已经编码/解码的一个或多个初始化周期内的平均编码次数。Specifically, the average number of encodings of the context within one or more initialization periods that have been encoded/decoded may be counted by pre-training.
当计算得到的平均使用次数小于第一数值时,将该阈值设置为该第一数值。When the calculated average usage count is less than the first value, the threshold is set to the first value.
当计算得到的平均使用次数大于第二数值时,将该阈值设置为该第二数值,该第一数值小于第二数值。When the calculated average usage count is greater than the second value, the threshold is set to the second value, the first value being less than the second value.
当计算得到的平均使用次数大于或等于第一数值,且小于或等于第二数值时,将该阈值设置为大于该第一数值且小于该第二数值的整数。When the calculated average usage count is greater than or equal to the first value and less than or equal to the second value, the threshold is set to be greater than the first value and less than the integer of the second value.
记第一数值为Thrmin,记第二数值为Thrmax,记平均使用次数为Numave,根据如下公式确定该阈值Thr:The first value is Thrmin, the second value is Thrmax, and the average number of uses is Numave. The threshold Thr is determined according to the following formula:
Figure PCTCN2018081648-appb-000001
Figure PCTCN2018081648-appb-000001
其中,第一数值和第二数值分别表示该阈值的最小值和最大值。第一数据与第二数值可以根据经验值确定。例如,第一数值为32,第二数值为512。Wherein, the first value and the second value respectively represent the minimum value and the maximum value of the threshold. The first data and the second value can be determined based on empirical values. For example, the first value is 32 and the second value is 512.
在本实施例中,该阈值的取值随着同一个上下文的概率更新模型在已经编码/解码的一个或者多个初始化周期内的平均使用次数进行自适应变化,从而可以灵活地、在合适的时机调整概率更新模型,因此可以进一步提高编码性能。In this embodiment, the value of the threshold is adaptively changed according to the average usage number of the probability update model of the same context in one or more initialization periods that have been encoded/decoded, so that it can be flexibly and appropriately The timing adjusts the probability update model, so the coding performance can be further improved.
第三种实现方式,根据上下文的初始化周期来确定该阈值。In a third implementation, the threshold is determined according to an initialization period of the context.
例如,当上下文的初始化周期为一个slice,该阈值被设置为512。当上下文的初始化周期为一个CTU,该阈值被设置为32到512之间的整数。For example, when the initialization period of the context is one slice, the threshold is set to 512. When the initialization period of the context is one CTU, the threshold is set to an integer between 32 and 512.
上文描述了三种确定该阈值的方法。本申请并不限定于此,在一些实施 方式中,还可以根据其它可行的方法来确定该阈值,只要能够实现在合适的时机调整概率更新模型即可。Three methods of determining the threshold are described above. The present application is not limited thereto. In some implementations, the threshold may also be determined according to other feasible methods, as long as the probability update model can be adjusted at an appropriate timing.
在一些实施例中,可通过计数器来计数使用概率更新模型对二进制符号进行编/解码的次数。In some embodiments, the number of times a binary symbol is encoded/decoded using a probability update model can be counted by a counter.
在初始化概率更新模型时,也对每个上下文的计数器进行初始化,当使用概率更新模型对二进制符号进行编/解码时,该计数器也开始计数,每使用该上下文进行一次编/解码,则其对应的计数器进行一次计数,当该计数器的计数值达到该阈值时,则确定使用该概率更新模型对二进制符号进行编/解码的二进制符号的数量达到该阈值。When the probability update model is initialized, the counter of each context is also initialized. When the binary symbol is encoded/decoded using the probability update model, the counter also starts counting, and each time the encoding/decoding is performed using the context, the corresponding The counter is counted once, and when the count value of the counter reaches the threshold, it is determined that the number of binary symbols for encoding/decoding binary symbols using the probability update model reaches the threshold.
对于一个上下文,该上下文里包括计数器,该计数器用于计数使用该上下文的概率更新模型编/解码二进制符号的数量。换句话说,每个上下文都有自己的一个计数器,当有bin引用一个上下文时,该上下文的计数器加1。For a context, the context includes a counter that counts the number of encoding/decoding binary symbols used to update the model using the probability of the context. In other words, each context has its own counter, and when a bin references a context, the context counter is incremented by one.
在一些实施方式中,当当前条带编/解码结束时,将该计数器清零。In some embodiments, the counter is cleared when the current stripe encoding/decoding ends.
在一些实施方式中,当当前编码树单元编/解码结束时,将该计数器清零。In some embodiments, the counter is cleared when the current coding tree unit is encoded/decoded.
在一些实施方式中,在当前的初始化周期结束时,该计数器被清零。In some embodiments, the counter is cleared at the end of the current initialization period.
在一些实施方式中,当该计数器的计数值达到该阈值时,该计数器被清零。In some embodiments, the counter is cleared when the counter value of the counter reaches the threshold.
例如,如果需要在一个初始化周期内对概率更新模型进行多次调整,这种情形下,当计数器的计数值达到该阈值时,该计数器被清零,随着下一次编/解码开始,重新开始计数。For example, if it is necessary to make multiple adjustments to the probability update model in an initialization cycle, in this case, when the count value of the counter reaches the threshold, the counter is cleared, and restarts with the next encoding/decoding start. count.
在一些实施例中,使用计数器计数使用概率更新模型编/解码二进制符号的数量,当计数器的计数值达到阈值1时,对概率更新模型进行第一次调整,同时将该计数器清零;继续使用计数器计数使用概率更新模型编/解码二进制符号的数量,当计数器的计数值达到阈值2时,对概率更新模型进行第二次调整,同时将该计数器清零。其中,阈值1和阈值2可以相同,也可以不同。对概率更新模型的第一次调整和第二次调整的方式可以相同或不同。本实施例以对概率更新模型进行两次调整为例进行描述,但本申请并非限定于此,实际操作中,可以对概率更新模型进行更多次的调整,多次调整的流程与两次调整的流程类似,这里不再赘述。In some embodiments, the counter is used to update the model to encode/decode the number of binary symbols, and when the counter's count reaches the threshold 1, the probabilistic update model is first adjusted while the counter is cleared; The counter count uses the probability update model to encode/decode the number of binary symbols. When the counter count reaches the threshold 2, the probability update model is adjusted a second time and the counter is cleared. The threshold 1 and the threshold 2 may be the same or different. The manner of the first adjustment and the second adjustment of the probability update model may be the same or different. This embodiment is described by taking two adjustments to the probability update model as an example. However, the present application is not limited thereto. In actual operation, the probability update model can be adjusted more times, the process of multiple adjustments, and two adjustments. The process is similar and will not be repeated here.
在一些实施方式中,当用概率更新模型对二进制符号进行编/解码的数量 未达到该阈值,但当前的初始化周期结束,该计数器也被清零。In some embodiments, when the number of binary symbols encoded/decoded with the probability update model does not reach the threshold, but the current initialization period ends, the counter is also cleared.
可选地,在一些实施例中,S110中对该概率更新模型进行调整,具体包括:对概率更新模型中的滑动窗口参数进行调整。Optionally, in some embodiments, adjusting the probability update model in S110 specifically includes: adjusting a sliding window parameter in the probability update model.
滑动窗口参数可以决定概率更新模型的概率更新的速度,滑动窗口参数越大,概率更新模型的概率更新速度越小,反之亦然。因此,由于滑动窗口参数可以决定概率更新模型的概率更新的速度,因此通过调整滑动窗口参数,可以调整概率更新模型进行概率更新的速度。The sliding window parameter can determine the speed of the probability update of the probability update model. The larger the sliding window parameter, the smaller the probability update speed of the probability update model, and vice versa. Therefore, since the sliding window parameter can determine the speed of the probability update of the probability update model, by adjusting the sliding window parameter, the probability that the probability update model can be adjusted for the probability update can be adjusted.
以编码场景为例,刚开始进行编码时,可参考的已经编码的信息比较少,这时候可以采用较快的概率更新速度;随着编码的进行,可参考的已经编码的信息越来越多,这时候应该采用较慢的概率更新速度。应理解,随着编码次数的增多,调整概率更新的速度,可以更好的平衡上下文的概率更新速度和概率更新准确度。Taking the coding scenario as an example, when coding is first started, there is less information that can be referenced, and the speed can be updated with a faster probability; as the coding proceeds, more and more information can be referenced. At this time, you should use a slower probability to update the speed. It should be understood that as the number of encodings increases, the speed of the probability update is adjusted, and the probability update speed and probability update accuracy of the context can be better balanced.
现有技术中,在初始化概率更新模型之后,滑动窗口参数始终维持不变。In the prior art, after initializing the probability update model, the sliding window parameters are always maintained.
而本申请实施例,当使用概率更新模型对二进制符号进行编/解码的次数达到阈值时,调整该概率更新模型中的滑动窗口参数,从而调整该概率更新模型的概率更新的速度,因此可以平衡概率更新速度和概率更新准确度,这样可以进一步提高编码性能。In the embodiment of the present application, when the number of times the binary symbol is encoded/decoded reaches a threshold by using the probability update model, the sliding window parameter in the probability update model is adjusted, thereby adjusting the probability update probability of the probability update model, and thus balancing The probability update speed and probability update accuracy, which can further improve the coding performance.
此外,本实施例通过根据使用概率更新模型对二进制符号进行编/解码的次数,来调整概率更新模型中滑动窗口参数的大小,从而将使用概率更新模型对二进制符号进行编/解码的次数与滑动窗口参数的取值关联起来,这样可以提高上下文的概率预测的准确度。In addition, in this embodiment, the size of the sliding window parameter in the probability update model is adjusted by updating the model according to the number of times the binary symbol is encoded/decoded according to the usage probability, so that the number of times the binary symbol is encoded/decoded using the probability update model and the sliding The values of the window parameters are related, which can improve the accuracy of the probability prediction of the context.
可选地,在一些实施例中,S110中对该概率更新模型进行调整,还可以包括:对概率更新模型中的其它参数进行调整。例如,其它参数可以影响该概率更新模型的概率更新的速度和/或准确度。Optionally, in some embodiments, adjusting the probability update model in S110 may further include: adjusting other parameters in the probability update model. For example, other parameters may affect the speed and/or accuracy of the probability update of the probability update model.
在一些实施方式中,每个上下文都具有自己的概率更新模型,即每个上下文都具有自己的滑动窗口参数。一个上下文的概率更新模型中的滑动窗口参数是被存储到该上下文中。In some embodiments, each context has its own probability update model, ie each context has its own sliding window parameters. The sliding window parameters in a context's probability update model are stored in that context.
可选地,在一些实施例中,如图2所示,在S110中,当使用上下文的概率更新模型对二进制符号进行编/解码的次数达到阈值时,增大该滑动窗口参数。Optionally, in some embodiments, as shown in FIG. 2, in S110, when the number of times the binary symbol is encoded/decoded using the probability update model of the context reaches a threshold, the sliding window parameter is increased.
当增大滑动窗口参数时,可以降低概率更新模型的概率更新的速度。When the sliding window parameter is increased, the probability of the probabilistic update of the probability update model can be reduced.
以编码场景为例,在使用概率更新模型进行算术编码时,刚开始,可参考的已经编码的信息比较少,这时候可以采用较快的概率更新速度;随着编码的进行,可参考的已经编码的信息越来越多,这时候应该采用较慢的概率更新速度。本实施例中,当使用该概率更新模型进行编码的次数达到该阈值时,通过增大滑动窗口参数,来降低概率更新的速度,这样可以提高编码性能。Taking the coding scenario as an example, when using the probability update model for arithmetic coding, at the beginning, there is less information that can be referenced. At this time, a faster probability update speed can be used; as the coding proceeds, reference can already be made. More and more information is encoded, and a slower probability update speed should be used. In this embodiment, when the number of times of encoding using the probability update model reaches the threshold, the speed of the probability update is reduced by increasing the sliding window parameter, so that the encoding performance can be improved.
以解码场景为例,在使用概率更新模型进行算术解码时,刚开始,可参考的已经解码的信息比较少,这时候可以采用较快的概率更新速度;随着解码的进行,可参考的已经解码的信息越来越多,这时候应该采用较慢的概率更新速度。本实施例中,当使用该概率更新模型进行解码的次数达到该阈值时,通过增大滑动窗口参数,来降低概率更新的速度,这样可以提高解码性能。Taking the decoding scene as an example, when using the probability update model for arithmetic decoding, at the beginning, the already decoded information can be referenced less. At this time, the faster probability update speed can be adopted; as the decoding progresses, the reference can already be used. More and more information is decoded, and a slower probability update speed should be used. In this embodiment, when the number of times of decoding using the probability update model reaches the threshold, the speed of the probability update is reduced by increasing the sliding window parameter, so that the decoding performance can be improved.
可选地,在一些实施例中,在S110中,对概率更新模型中的滑动窗口参数进行调整,具体包括:减小该滑动窗口参数。Optionally, in some embodiments, adjusting the sliding window parameter in the probability update model in S110, specifically: reducing the sliding window parameter.
例如,由于实际需求,如果在使用概率更新模型对二进制符号进行编/解码的次数达到该阈值时,需要加快概率更新的速度,这时,可以在使用概率更新模型对二进制符号进行编/解码的次数达到该阈值时,减小滑动窗口参数。For example, due to actual demand, if the number of times the binary symbol is encoded/decoded by using the probability update model reaches the threshold, the speed of the probability update needs to be accelerated, and at this time, the binary symbol can be encoded/decoded using the probability update model. When the number of times reaches this threshold, the sliding window parameters are reduced.
上述可知,在本申请实施例中,概率更新模型被初始化后,滑动窗口参数可以被调整而非固定不变,这样可以调整概率更新的速度,从而可以平衡概率更新速度和概率更新准确度,从而可以提高编码性能。As described above, in the embodiment of the present application, after the probability update model is initialized, the sliding window parameter may be adjusted rather than fixed, so that the speed of the probability update may be adjusted, thereby balancing the probability update speed and the probability update accuracy, thereby Can improve coding performance.
可选地,在一些实施例中,使用多个概率更新模型对bin进行编/解码,每个概率更新模型均具有一个滑动窗口参数,这种情形下,具有多个滑动窗口参数,S110具体包括:当使用该多个概率更新模型对二进制符号进行编/解码的次数达到该阈值时,增大该多个滑动窗口参数。Optionally, in some embodiments, bins are encoded/decoded using a plurality of probabilistic update models, each probabilistic update model having a sliding window parameter, in this case having a plurality of sliding window parameters, S110 specifically including : When the number of times the binary symbol is encoded/decoded using the plurality of probability update models reaches the threshold, the plurality of sliding window parameters are increased.
在一些实例方式中,不同滑动窗口增大的幅度可以相同,也可以不同。In some example manners, the magnitude of the increase in the different sliding windows may be the same or different.
在增大该滑动窗口参数的实施例中,如果算术编码的缩放区间二维查询表的概率状态值小于第三数值,使该滑动窗口参数被增大的幅度小于第四数值。其中,第三数值和第四数值可以为经验值。In an embodiment in which the sliding window parameter is increased, if the probability state value of the arithmetically encoded zoom interval two-dimensional lookup table is less than the third value, the sliding window parameter is increased by a magnitude less than the fourth value. Wherein, the third value and the fourth value may be empirical values.
例如,第三数值可以为11,第四数值可以为2。For example, the third value can be 11 and the fourth value can be 2.
这样做的原因是,当算术编码的缩放区间二维查询表的概率状态值x小于第三数值时,上下文的概率值的已经非常小,这时如果采用较大的滑动窗口参数进行概率更新,会导致连续编码的若干使用该上下文的bin的概率都非常接近,这对于算术编码来说,是没有太大意义的。所以,当算术编码的缩放区间二维查询表的概率状态值x小于第三数值时,该滑动窗口参数被增大的幅度应该较小。The reason for this is that when the probability state value x of the arithmetically encoded zoom interval two-dimensional lookup table is smaller than the third value, the probability value of the context is already very small, and if a large sliding window parameter is used for the probability update, The probability of several bins using this context that result in consecutive encodings is very close, which is of little significance for arithmetic coding. Therefore, when the probability state value x of the arithmetically encoded zoom interval two-dimensional lookup table is smaller than the third value, the sliding window parameter should be increased in amplitude to be small.
在一些实施例中,在一个初始化周期内,需要对概率更新模型进行多次调整,即对滑动窗口参数进行多次调整,其中,每次调整的幅度值可以相同也可以不同。In some embodiments, during an initialization period, the probability update model needs to be adjusted multiple times, that is, the sliding window parameters are adjusted multiple times, wherein the amplitude values of each adjustment may be the same or different.
在一些实施例中,概率更新模型中滑动窗口参数的取值范围为[Min,Max]。即调整之前或调整之后的滑动窗口参数的取值均大于或等于Min,且小于或等于Max。In some embodiments, the sliding window parameter in the probability update model has a value range of [Min, Max]. That is, the value of the sliding window parameter before or after the adjustment is greater than or equal to Min and less than or equal to Max.
在一些实施方式中,Min为2,Max为9。In some embodiments, Min is 2 and Max is 9.
下文以一个具体的概率更新模型为例,简单解释一下滑动窗口参数的最小值为2,最大值为9的原因。Let's take a specific probability update model as an example to explain briefly why the sliding window parameter has a minimum value of 2 and a maximum value of 9.
以如下公式(3)所示的概率更新模型为例:Take the probability update model shown in the following formula (3) as an example:
Figure PCTCN2018081648-appb-000002
Figure PCTCN2018081648-appb-000002
Figure PCTCN2018081648-appb-000003
Figure PCTCN2018081648-appb-000003
其中,P为概率更新模型,a为滑动窗口参数,k和k+1分别为当前装置和下一个状态,α是一个位于(0,1)区间内的值,例如
Figure PCTCN2018081648-appb-000004
Where P is the probability update model, a is the sliding window parameter, k and k+1 are the current device and the next state, respectively, and α is a value located in the interval (0, 1), for example
Figure PCTCN2018081648-appb-000004
在公式(3)所示的概率更新模型中,假设滑动窗口参数a为2,即α的值为
Figure PCTCN2018081648-appb-000005
则在bin为“0”的情况下,P[k+1]=0.75×P[k],bin为“0”时的概率值理论上被设计为[0.5,1)。如果滑动窗口参数a比2小的话,就会出现α值为
Figure PCTCN2018081648-appb-000006
即使p[k]=1,p[k+1]也会等于0.5,更何况p[k]不会等于1,所以滑动窗口参数a为1的时候,会使bin为“0”时的概率小于0.5, 这是不合理的,所以在这个示例中,滑动窗口参数a的最小值为2。
In the probability update model shown in equation (3), it is assumed that the sliding window parameter a is 2, that is, the value of α is
Figure PCTCN2018081648-appb-000005
Then, in the case where bin is "0", P[k+1]=0.75×P[k], and the probability value when bin is "0" is theoretically designed as [0.5, 1). If the sliding window parameter a is smaller than 2, the alpha value will appear.
Figure PCTCN2018081648-appb-000006
Even if p[k]=1, p[k+1] will be equal to 0.5, not to mention that p[k] will not be equal to 1, so the probability that the bin will be "0" when the sliding window parameter a is 1. Less than 0.5, this is unreasonable, so in this example, the minimum value of the sliding window parameter a is 2.
假设滑动窗口参数a取最大值为9,同理可以计算得到此时对应的α的值约为0.9980,已经几乎接近于1。如果滑动窗口参数a再增大为10,对应α约为0.9990。此时的概率更新的速度已经极为缓慢。Assuming that the sliding window parameter a takes a maximum value of 9, the same reason can be calculated that the value of α corresponding to this time is about 0.9980, which is almost close to 1. If the sliding window parameter a is further increased to 10, the corresponding a is about 0.9990. The speed of the probability update at this time has been extremely slow.
综上所述,滑动窗口参数的取值范围定义为[2,SWP max],其中,SWP max表示滑动窗口参数的最大值,这个值没有绝对的限定,可以人为规定。只要保证
Figure PCTCN2018081648-appb-000007
落在(0,1)范围内即可。
In summary, the value range of the sliding window parameter is defined as [2, SWP max ], where SWP max represents the maximum value of the sliding window parameter, and this value is not absolutely limited and can be artificially specified. Just guarantee
Figure PCTCN2018081648-appb-000007
It falls within the range of (0,1).
在一些实施例中,基于使用上下文的概率更新模型对二进制符号进行编/解码的次数,对上下文的概率更新模型进行多次调整。In some embodiments, the probability update model of the context is adjusted multiple times based on the number of times the probability of the context is used to encode/decode the binary symbols.
可选地,在对概率更新模型的多次调整中,每次调整的方式可以是相同的,也可以是不同的。Optionally, in the multiple adjustments to the probability update model, the manner of each adjustment may be the same or different.
例如,每次调整的方式可以都是增大滑动窗口参数,增大的幅度可以相同,也可以不同。For example, each adjustment can be done by increasing the sliding window parameters, and the magnitude of the increase can be the same or different.
再例如,一些调整方式为增大滑动窗口参数,另一些调整方式为减小滑动窗口参数。For another example, some adjustment methods are to increase the sliding window parameters, and other adjustment methods are to reduce the sliding window parameters.
在一些实施例中,在S110中,当使用上下文的概率更新模型对二进制符号进行编/解码的次数达到该阈值时,增大该概率更新模型的滑动窗口参数;在S120中,基于增大滑动窗口参数的该概率更新模型对二进制符号进行编/解码;该方法还包括:当使用调整后的该概率更新模型对二进制符号进行编/解码的二进制符号的数量又达到该阈值时,再次增大该概率更新模型的滑动窗口参数;基于滑动窗口参数第二次增大的该概率更新模型对二进制符号进行编/解码。In some embodiments, in S110, when the number of times the binary symbol is encoded/decoded by the probability update model of the context reaches the threshold, the sliding window parameter of the probability update model is increased; in S120, the sliding is based on the increase The probability update model of the window parameter encodes/decodes the binary symbol; the method further comprises: increasing again when the number of binary symbols for encoding/decoding the binary symbol reaches the threshold again using the adjusted probability update model The probability updates the sliding window parameter of the model; the binary symbol is encoded/decoded based on the probability that the sliding window parameter is increased for the second time.
在一些实施方式中,该滑动窗口参数再次增大的幅度与上一次增大的幅度相同。In some embodiments, the sliding window parameter is again increased by the same magnitude as the last increase.
在一些实施方式中,该滑动窗口参数再次增大的幅度小于上一次增大的幅度。In some embodiments, the sliding window parameter is again increased by a magnitude that is less than the amplitude of the previous increase.
例如,在区间查询表的概率状态值x小于第三数值的情况下,该滑动窗口参数再次增大的幅度小于上一次增大的幅度。For example, in the case where the probability state value x of the interval lookup table is smaller than the third value, the amplitude of the sliding window parameter is increased again less than the amplitude of the previous increase.
在一些实施方式中,该滑动窗口参数再次增大的幅度小于上一次增大的幅度。In some embodiments, the sliding window parameter is again increased by a magnitude that is less than the amplitude of the previous increase.
在一些实施方式中,可以在一个初始化周期内,对概率更新模型进行多次调整。In some embodiments, the probability update model can be adjusted multiple times during an initialization cycle.
为了更好地理解本申请提供的方案,下面给出一个应用本申请的方案进行算法编码的具体例子。In order to better understand the solution provided by the present application, a specific example of algorithm coding using the solution of the present application is given below.
1)设计上下文。1) Design context.
设计上下文,该上下文中包括一个阈值(记为Thr)和一个计数器(记为c)。其中,计数器的位数可以根据该阈值确定。The design context, which includes a threshold (denoted as Thr) and a counter (denoted as c). Wherein, the number of bits of the counter can be determined according to the threshold.
例如,当该阈值分别为设定为64、128、256、510时,该计数器的位数应该分别被设定为6、7、8、9。For example, when the threshold is set to 64, 128, 256, 510, respectively, the number of bits of the counter should be set to 6, 7, 8, and 9, respectively.
2)算术编码。2) Arithmetic coding.
当编码bin为“1”时,概率更新模型为:When the encoding bin is "1", the probability update model is:
U[k+1]=U[k]+((2^15-U[k])>>a),V[k+1]=V[k]+((2^15-V[k])>>b);U[k+1]=U[k]+((2^15-U[k])>>a),V[k+1]=V[k]+((2^15-V[k] )>>b);
当编码bin为“0”时,概率更新模型为:When the encoding bin is "0", the probability update model is:
U[k+1]=U[k]-(U[k]>>a),V[k+1]=V[k]-(V[k]>>b);U[k+1]=U[k]-(U[k]>>a), V[k+1]=V[k]-(V[k]>>b);
最终预测概率:P[k+1]=(U[k+1]+V[k+1])>>1。Final predicted probability: P[k+1]=(U[k+1]+V[k+1])>>1.
其中,a和b分别为两个滑动窗口参数。U和V分别为两个概率更新模型。k和k+1分别为当前状态和下一个状态。Among them, a and b are two sliding window parameters respectively. U and V are two probability update models, respectively. k and k+1 are the current state and the next state, respectively.
应理解,在步骤2)开始时,计数器c开始计数。It should be understood that at the beginning of step 2), counter c begins counting.
3)滑动窗口参数的调整。3) Adjustment of sliding window parameters.
通过本申请提供的方案,调整滑动窗口参数a和b。The sliding window parameters a and b are adjusted by the solution provided by the present application.
假设在初始化时,调整滑动窗口参数a和b分别为被赋值为a0和b0。It is assumed that at the time of initialization, the adjustment sliding window parameters a and b are assigned values a0 and b0, respectively.
在步骤2)的执行过程中,实时监测计数器c的计数值,当计数器c的计数值未达到步骤1)中设计的阈值(Thr)时,a和b的值保持不变,即维持初始化时的值:a0和b0;当计数器c的计数值达到步骤1)中设计的阈值(Thr)时,分别将a和b的值加1,a的值变为a1,b的值变为b1。即滑动窗口参数a和b的调整策略如下:During the execution of step 2), the counter value of the counter c is monitored in real time. When the counter value of the counter c does not reach the threshold (Thr) designed in step 1), the values of a and b remain unchanged, that is, when the initialization is maintained. Values: a0 and b0; When the count value of the counter c reaches the threshold (Thr) designed in the step 1), the values of a and b are respectively incremented by 1, the value of a becomes a1, and the value of b becomes b1. That is, the adjustment strategies of the sliding window parameters a and b are as follows:
c<Thr时,(a1,b1)=(a0,b0)When c<Thr, (a1, b1) = (a0, b0)
c>Thr时,(a1,b1)=(a0+1,b0+1)。When c>Thr, (a1, b1) = (a0+1, b0+1).
应理解,本例中的步骤2)和步骤3)没有绝对的先后顺序关系。It should be understood that there is no absolute sequence relationship between step 2) and step 3) in this example.
还应理解,上面例子仅为示例而非限定。滑动窗口参数a和b的调整策略还可以如下:It should also be understood that the above examples are illustrative only and not limiting. The adjustment strategies for sliding window parameters a and b can also be as follows:
c<Thr时,(a1,b1)=(a0,b0)When c<Thr, (a1, b1) = (a0, b0)
c≥Thr时,(a1,b1)=(a0+Δ1,b0+Δ2)。When c ≥ Thr, (a1, b1) = (a0 + Δ1, b0 + Δ2).
对滑动窗口参数a和b进行调整时,分别对滑动窗口参数a和b的调整值Δ1和Δ2可以相同,也可以不同,本申请对此不作限定。When the sliding window parameters a and b are adjusted, the adjustment values Δ1 and Δ2 of the sliding window parameters a and b, respectively, may be the same or different, which is not limited in the present application.
再例如,针对如公式(3)所示的概率更新模型,也可以应用本申请提供的方案来进行概率更新。具体流程如下。For another example, for the probability update model as shown in formula (3), the solution provided by the present application may also be applied to perform probability update. The specific process is as follows.
1)设计上下文。1) Design context.
设计上下文,该上下文中包括一个阈值(记为Thr)和一个计数器(记为c)。其中,计数器的位数可以根据阈值确定。The design context, which includes a threshold (denoted as Thr) and a counter (denoted as c). Wherein, the number of bits of the counter can be determined according to the threshold.
例如,当该阈值分别为设定为64、128、256、510时,该计数器的位数应该分别被设定为6、7、8、9。For example, when the threshold is set to 64, 128, 256, 510, respectively, the number of bits of the counter should be set to 6, 7, 8, and 9, respectively.
2)算术编码。2) Arithmetic coding.
Figure PCTCN2018081648-appb-000008
Figure PCTCN2018081648-appb-000008
Figure PCTCN2018081648-appb-000009
Figure PCTCN2018081648-appb-000009
应理解,在步骤2)开始时,计数器c开始计数。It should be understood that at the beginning of step 2), counter c begins counting.
3)滑动窗口参数的调整。3) Adjustment of sliding window parameters.
可以将公式(3)中α看作是滑动窗口参数,则根据计数器c的计数值,调整滑动窗口参数α。The α in the formula (3) can be regarded as a sliding window parameter, and the sliding window parameter α is adjusted according to the count value of the counter c.
假设在初始化时,调整滑动窗口参数α被赋值为α0。It is assumed that the adjustment sliding window parameter α is assigned to α0 at the time of initialization.
在步骤2)的执行过程中,实时监测计数器c的计数值,并根据计数器c的技术值,进行如下操作:During the execution of step 2), the counter value of the counter c is monitored in real time, and according to the technical value of the counter c, the following operations are performed:
如果c<=Thr时,α′=α;If c<=Thr, α'=α;
如果c>Thr时,α′=α+Δ;其中,α+Δ应满足取值范围属于(0,1)。If c>Thr, α'=α+Δ; where α+Δ should satisfy the value range of (0,1).
其中,α表示调整之前的值,α′表示调整之后的值。Where α denotes the value before the adjustment and α' denotes the value after the adjustment.
应理解,本例中的步骤2)和步骤3)没有绝对的先后顺序关系。It should be understood that there is no absolute sequence relationship between step 2) and step 3) in this example.
需要说明的是,上文描述的各个实施例可以根据内在逻辑以任意方式组合。It should be noted that the various embodiments described above may be combined in any manner according to intrinsic logic.
综上所述,在本申请实施例中,当使用上下文的概率更新模型的编码的次数达到阈值时,对概率更新模型进行调整,可以认为这时可参考的已经编码的信息已经很多,这时需要调节概率更新模型以适应变化的编码环境,这样可以在一定程度上提高编/解码性能。In summary, in the embodiment of the present application, when the number of times of coding using the probability update model of the context reaches a threshold, the probability update model is adjusted, and it can be considered that there is already a lot of already encoded information that can be referred to at this time. It is necessary to adjust the probability update model to adapt to the changing coding environment, which can improve the encoding/decoding performance to some extent.
上文提供的方法实施例中涉及编码场景的方案可以应用于编码器中,上文提供的方法实施例中涉及解码场景的方案可以应用于解码器。The scheme involving the coding scenario in the method embodiment provided above may be applied to the encoder, and the scheme related to the decoding scenario in the method embodiment provided above may be applied to the decoder.
应理解,本申请实施例提供的方案可以应用到各种视频编解码标准中。It should be understood that the solution provided by the embodiments of the present application can be applied to various video codec standards.
上文描述了本申请的方法实施例,下文描述本申请的装置实施例,应理解,装置实施例的描述与方法实施例的描述相互对应,因此,未详细描述的内容可以参见上文方法实施例,为了简洁,这里不再赘述。The method embodiments of the present application are described above, and the device embodiments of the present application are described below. It should be understood that the description of the device embodiments corresponds to the description of the method embodiments, and therefore, the content that is not described in detail can be referred to the above method implementation. For the sake of brevity, we will not repeat them here.
图3为本申请实施例提供的上下文的概率更新装置300的示意性框图。该装置300包括如下单元。FIG. 3 is a schematic block diagram of a probability update apparatus 300 for a context provided by an embodiment of the present application. The device 300 includes the following units.
处理单元310,用于当使用该上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件时,对该概率更新模型进行调整。The processing unit 310 is configured to adjust the probability update model when the number of binary symbols that encode/decode the binary symbols using the probability update model of the context satisfies the condition.
编/解码单元320,用于基于调整后的该概率更新模型对二进制符号进行编/解码。The encoding/decoding unit 320 is configured to encode/decode binary symbols based on the adjusted probability update model.
在本申请提供的方案中,根据使用上下文的概率更新模型的编码的次数,对概率更新模型进行调整,这样可以在一定程度上提高编/解码性能。In the solution provided by the present application, the probability update model is adjusted according to the number of times the model is updated according to the probability of using the context, so that the encoding/decoding performance can be improved to some extent.
可选地,在一些实施例中,该使用该上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件,包括:当使用该上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到阈值。Optionally, in some embodiments, the number of binary symbols that encode/decode the binary symbols using the probability update model of the context satisfies the condition, including: encoding/decoding the binary symbols when using the probability update model of the context The number of binary symbols reaches the threshold.
在本申请提供的方案中,当使用上下文的概率更新模型的编码的次数达到该阈值时,对概率更新模型进行调整,可以认为这时可参考的已经编码的信息已经很多,这时需要调节概率更新模型以适应变化的编码环境,这样可以在一定程度上提高编/解码性能。In the solution provided by the present application, when the number of times of coding using the probability update model of the context reaches the threshold, the probability update model is adjusted, and it can be considered that there is already a lot of already encoded information that can be referred to at this time, and the probability needs to be adjusted. The model is updated to accommodate the changing coding environment, which can improve the encoding/decoding performance to some extent.
可选地,在一些实施例中,该阈值为小于算数编码的缩放区间二维查询表的概率状态值的最大值的正整数。Optionally, in some embodiments, the threshold is a positive integer that is less than a maximum of a probability state value of the arithmetically encoded zoom interval two-dimensional lookup table.
可选地,在一些实施例中,该阈值是自适应调整的。Optionally, in some embodiments, the threshold is adaptively adjusted.
可选地,在一些实施例中,该阈值是基于同一个上下文的概率更新模型在已完成编码/解码的多个初始化周期内的平均使用次数确定的。Optionally, in some embodiments, the threshold is determined based on an average number of uses of the probability update model of the same context over a plurality of initialization cycles in which encoding/decoding has been completed.
可选地,在一些实施例中,当该平均使用次数低于第一数值时,该阈值自适应调整为该第一数值。Optionally, in some embodiments, when the average number of uses is lower than the first value, the threshold is adaptively adjusted to the first value.
可选地,在一些实施例中,当该平均使用次数高于第二数值时,该阈值自适应调整为该第二数值。Optionally, in some embodiments, when the average number of uses is higher than the second value, the threshold is adaptively adjusted to the second value.
可选地,在一些实施例中,该阈值为位于X/2 n1到X/2 n2之间的整数,其中X为算术编码的缩放区间二维查询表的概率状态值的最大值,X/2 n1大于1,n1与n2为自然数,n1大于n2。 Optionally, in some embodiments, the threshold is an integer between X/2 n1 and X/2 n2 , where X is the maximum value of the probability state value of the arithmetically encoded zoom interval two-dimensional look-up table, X/ 2 n1 is greater than 1, n1 and n2 are natural numbers, and n1 is greater than n2.
可选地,在一些实施例中,该处理单元310具体用于:采用计数器对使用该上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量进行计数;当该计数器的计数值达到该阈值时,确定使用该上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到该阈值。Optionally, in some embodiments, the processing unit 310 is specifically configured to: use a counter to count the number of binary symbols that encode/decode the binary symbols using the probability update model of the context; when the counter reaches the counter value At the threshold, it is determined that the number of binary symbols that encode/decode the binary symbols using the probability update model of the context reaches the threshold.
可选地,在一些实施例中,该处理单元310还用于,当当前初始化周期结束时,对该计数器清零。Optionally, in some embodiments, the processing unit 310 is further configured to clear the counter when the current initialization period ends.
可选地,在一些实施例中,该处理单元310还用于,当当前条带slice编/解码结束时,将该计数器清零。Optionally, in some embodiments, the processing unit 310 is further configured to clear the counter when the current stripe slice encoding/decoding ends.
可选地,在一些实施例中,该处理单元310还用于,当当前编码树单元CTU编/解码结束时,将该计数器清零。Optionally, in some embodiments, the processing unit 310 is further configured to clear the counter when the current coding tree unit CTU encoding/decoding ends.
可选地,在一些实施例中,该处理单元310具体用于,对该概率更新模型的滑动窗口参数进行调整。Optionally, in some embodiments, the processing unit 310 is specifically configured to adjust the sliding window parameter of the probability update model.
可选地,在一些实施例中,该处理单元310具体用于,增大该概率更新模型的滑动窗口参数。Optionally, in some embodiments, the processing unit 310 is specifically configured to increase a sliding window parameter of the probability update model.
可选地,在一些实施例中,该概率更新模型包括多个滑动窗口参数;Optionally, in some embodiments, the probability update model includes a plurality of sliding window parameters;
该处理单元310具体用于,增大该多个滑动窗口参数,其中每个滑动窗口参数增大的幅度相同,或不同,或不完全相同。The processing unit 310 is specifically configured to increase the plurality of sliding window parameters, wherein each sliding window parameter increases in amplitude by the same, or different, or not identical.
可选地,在一些实施例中,算数编码的缩放区间二维查询表的概率状态值小于第三数值,该滑动窗口参数增大的幅度小于第四数值。Optionally, in some embodiments, the probability state value of the arithmetically encoded zoom interval two-dimensional lookup table is less than a third value, and the sliding window parameter increases by less than the fourth value.
可选地,在一些实施例中,该概率更新模型的滑动窗口参数的取值范围为2到9之间。Optionally, in some embodiments, the sliding window parameter of the probability update model has a value ranging from 2 to 9.
可选地,在一些实施例中,该处理单元310具体用于,增大该概率更新模型的滑动窗口参数。在该编/解码单元320基于调整后的该概率更新模型对二进制符号进行编/解码之后,该处理单元310还用于,当使用调整后的该概率更新模型对二进制符号进行编/解码的二进制符号的数量满足第二条件时,再次增大该概率更新模型的滑动窗口参数,该滑动窗口参数再次增大的幅度与上一次增大的幅度相同或不同。该编/解码单元320还用于,基于滑动窗口参数第二次增大的该概率更新模型对二进制符号进行编/解码。Optionally, in some embodiments, the processing unit 310 is specifically configured to increase a sliding window parameter of the probability update model. After the encoding/decoding unit 320 encodes/decodes the binary symbols based on the adjusted probability update model, the processing unit 310 is further configured to: when the adjusted probability update model is used to encode/decode binary symbols, When the number of symbols satisfies the second condition, the sliding window parameter of the probability update model is again increased, and the amplitude of the sliding window parameter is increased again or the same as the amplitude of the previous increase. The encoding/decoding unit 320 is further configured to: encode/decode binary symbols based on the probability update model that the sliding window parameter is secondarily increased.
可选地,在一些实施例中,该处理单元310具体用于,在该上下文的初始化周期内,当使用该上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到阈值时,对该概率更新模型进行调整。该编/解码单元320具体用于,在该初始化周期内,基于调整后的该概率更新模型对二进制符号进行编/解码。Optionally, in some embodiments, the processing unit 310 is specifically configured to: when the number of binary symbols for encoding/decoding the binary symbols reaches a threshold in the initialization period of the context, when the probability update model of the context is used, The probability update model is adjusted. The encoding/decoding unit 320 is specifically configured to: encode/decode binary symbols based on the adjusted probability update model during the initialization period.
可选地,在一些实施例中,该装置还包括:初始化单元,用于基于当前待编码或解码的块的量化步长对该概率更新模型的滑动窗口参数进行初始化。Optionally, in some embodiments, the apparatus further includes: an initializing unit, configured to initialize the sliding window parameter of the probability update model based on a quantization step size of the block to be currently encoded or decoded.
该装置300可以用于执行上述各个方法实施例提供的方法。The apparatus 300 can be used to perform the methods provided by the various method embodiments described above.
处理单元310、编/解码单元320以及初始化单元的功能都可以由处理器来实现。The functions of the processing unit 310, the encoding/decoding unit 320, and the initialization unit can all be implemented by a processor.
本申请实施例还提供一种编码装置,该编码器用于执行上文方法实施例中与编码相关的方法。该编码器可以包括用于执行上述方法实施例中与编码相关的操作的单元。The embodiment of the present application further provides an encoding apparatus for performing the encoding related method in the above method embodiment. The encoder may comprise means for performing the encoding related operations of the above method embodiments.
本申请实施例还提供一种解码装置,该解码器用于执行上文方法实施例中与解码相关的方法。该编码器可以包括用于执行上述方法实施例中与解码相关的操作的单元。The embodiment of the present application further provides a decoding apparatus, which is used to perform the decoding related method in the above method embodiment. The encoder may comprise means for performing the decoding related operations of the above method embodiments.
如图4所示,本申请实施例还提供一种编码器400,包括:存储器420与处理器410,该存储器420用于存储指令,该处理器410用于执行该存储器420存储的指令,并且对该存储器420中存储的指令的执行使得,该处理器410用于执行上述方法实施例中与编码相关的方法。As shown in FIG. 4, an embodiment of the present application further provides an encoder 400, including: a memory 420 for storing instructions, and a processor 410 for executing instructions stored in the memory 420, and Execution of the instructions stored in the memory 420 is such that the processor 410 is operative to perform the encoding related methods of the above method embodiments.
例如,该编码器400为CABAC编码器。For example, the encoder 400 is a CABAC encoder.
如图5所示,本申请实施例还提供一种解码器500,包括:存储器520 与处理器510,该存储器520用于存储指令,该处理器510用于执行该存储器520存储的指令,并且对该存储器520中存储的指令的执行使得,该处理器510用于执行上述方法实施例中与解码相关的方法。As shown in FIG. 5, the embodiment of the present application further provides a decoder 500, including: a memory 520 for storing instructions, and a processor 510 for executing instructions stored by the memory 520, and Execution of the instructions stored in the memory 520 is such that the processor 510 is operative to perform the decoding related methods of the above method embodiments.
例如,该解码器500为CABAC解码器。For example, the decoder 500 is a CABAC decoder.
本申请实施例还提供一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得,该计算机执行上述方法实施例的方法。The embodiment of the present application further provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer executes the method of the foregoing method embodiment.
本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。The embodiment of the present application further provides a computer program product comprising instructions, which when executed by a computer, cause a computer to execute the method of the above method embodiment.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其他任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented in software, it 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. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present invention are generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server or data center via wired (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.). The computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)). .
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示 意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application. It should be covered by the scope of protection of this application. Therefore, the scope of protection of the present application should be determined by the scope of the claims.

Claims (43)

  1. 一种上下文的概率更新方法,其特征在于,包括:A context probability update method, comprising:
    当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件时,对所述概率更新模型进行调整;Adjusting the probability update model when the number of binary symbols that encode/decode binary symbols is satisfied using the probability update model of the context;
    基于调整后的所述概率更新模型对二进制符号进行编/解码。The binary symbols are encoded/decoded based on the adjusted probability update model.
  2. 根据权利要求1所述的方法,其特征在于,所述使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件,包括:The method according to claim 1, wherein the number of binary symbols for encoding/decoding binary symbols using the probability update model of the context satisfies conditions, including:
    当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到阈值The number of binary symbols that encode/decode binary symbols reaches a threshold when using the probability update model of the context
  3. 根据权利要求2所述的方法,其特征在于,所述阈值为小于算数编码的缩放区间二维查询表的概率状态值的最大值的正整数。The method of claim 2 wherein said threshold is a positive integer that is less than a maximum of a probability state value of a scaled two-dimensional lookup table of an arithmetically encoded scale.
  4. 根据权利要求2所述的方法,其特征在于,所述阈值是自适应调整的。The method of claim 2 wherein said threshold is adaptively adjusted.
  5. 根据权利要求4所述的方法,其特征在于,所述阈值是基于同一个上下文的概率更新模型在已完成编码/解码的多个初始化周期内的平均使用次数确定的。The method according to claim 4, wherein the threshold is determined based on an average number of uses of the probability update model of the same context over a plurality of initialization cycles in which encoding/decoding has been completed.
  6. 根据权利要求5所述的方法,其特征在于,当所述平均使用次数低于第一数值时,所述阈值自适应调整为所述第一数值。The method of claim 5 wherein said threshold is adaptively adjusted to said first value when said average number of uses is lower than said first value.
  7. 根据权利要求5所述的方法,其特征在于,当所述平均使用次数高于第二数值时,所述阈值自适应调整为所述第二数值。The method of claim 5 wherein said threshold is adaptively adjusted to said second value when said average number of uses is higher than said second value.
  8. 根据权利要求2至7中任一项所述的方法,其特征在于,所述阈值为位于X/2 n1到X/2 n2之间的整数,其中X为算术编码的缩放区间二维查询表的概率状态值的最大值,X/2 n1大于1,n1与n2为自然数,n1大于n2。 The method according to any one of claims 2 to 7, wherein the threshold is an integer between X/2 n1 and X/2 n2 , wherein X is an arithmetically coded zoom interval two-dimensional lookup table The maximum value of the probability state value, X/2 n1 is greater than 1, n1 and n2 are natural numbers, and n1 is greater than n2.
  9. 根据权利要求2至8中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 2 to 8, wherein the method further comprises:
    采用计数器对使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量进行计数;Counting the number of binary symbols that encode/decode binary symbols using a probability update model of the context using a counter;
    当所述计数器的计数值达到所述阈值时,确定使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到所述阈值。When the count value of the counter reaches the threshold, it is determined that the number of binary symbols that encode/decode binary symbols using the probability update model of the context reaches the threshold.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9 wherein the method further comprises:
    当当前初始化周期结束时,对所述计数器清零。The counter is cleared when the current initialization period ends.
  11. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9 wherein the method further comprises:
    当当前条带slice编/解码结束时,将所述计数器清零。The counter is cleared when the current stripe slice/decode ends.
  12. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9 wherein the method further comprises:
    当当前编码树单元CTU编/解码结束时,将所述计数器清零。The counter is cleared when the current coding tree unit CTU encoding/decoding ends.
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,所述对所述概率更新模型进行调整,包括:The method according to any one of claims 1 to 12, wherein the adjusting the probability update model comprises:
    对所述概率更新模型的滑动窗口参数进行调整。The sliding window parameters of the probability update model are adjusted.
  14. 根据权利要求13所述的方法,其特征在于,所述对所述概率更新模型的滑动窗口参数进行调整,包括:The method according to claim 13, wherein the adjusting the sliding window parameters of the probability update model comprises:
    增大所述概率更新模型的滑动窗口参数。Increase the sliding window parameters of the probability update model.
  15. 根据权利要求14所述的方法,其特征在于,所述概率更新模型包括多个滑动窗口参数;The method of claim 14, wherein the probability update model comprises a plurality of sliding window parameters;
    所述增大所述概率更新模型的滑动窗口参数,包括:The increasing the sliding window parameter of the probability update model includes:
    增大所述多个滑动窗口参数,其中每个滑动窗口参数增大的幅度相同,或不同,或不完全相同。The plurality of sliding window parameters are increased, wherein each sliding window parameter increases in amplitude by the same, or different, or not identical.
  16. 根据权利要求14或15所述的方法,其特征在于,算数编码的缩放区间二维查询表的概率状态值小于第三数值,所述滑动窗口参数增大的幅度小于第四数值。The method according to claim 14 or 15, wherein the probability state value of the arithmetically encoded zoom interval two-dimensional lookup table is smaller than the third value, and the sliding window parameter increases by less than the fourth value.
  17. 根据权利要求1至16中任一项所述的方法,其特征在于,所述概率更新模型的滑动窗口参数的取值范围为2到9之间。The method according to any one of claims 1 to 16, wherein the sliding window parameter of the probability update model has a value ranging from 2 to 9.
  18. 根据权利要求1至17中任一项所述的方法,其特征在于,所述对所述概率更新模型进行调整,包括:增大所述概率更新模型的滑动窗口参数;The method according to any one of claims 1 to 17, wherein the adjusting the probability update model comprises: increasing a sliding window parameter of the probability update model;
    在所述基于调整后的所述概率更新模型对二进制符号进行编/解码之后,所述方法还包括:After the encoding/decoding of the binary symbols based on the adjusted probability update model, the method further includes:
    当使用调整后的所述概率更新模型对二进制符号进行编/解码的二进制符号的数量满足第二条件时,再次增大所述概率更新模型的滑动窗口参数,所述滑动窗口参数再次增大的幅度与上一次增大的幅度相同或不同;When the number of binary symbols for encoding/decoding the binary symbols using the adjusted probability update model satisfies the second condition, the sliding window parameter of the probability update model is again increased, and the sliding window parameter is increased again. The amplitude is the same as or different from the previous increase;
    基于滑动窗口参数第二次增大的所述概率更新模型对二进制符号进行 编/解码。The binary symbol is encoded/decoded based on the probability update model that the sliding window parameter is secondarily increased.
  19. 根据权利要求1至17中任一项所述的方法,其特征在于,所述当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到阈值时,对所述概率更新模型进行调整,包括:The method according to any one of claims 1 to 17, wherein the probability of updating/decoding a binary symbol by using a probability update model of the context reaches a threshold Update the model to make adjustments, including:
    在所述上下文的初始化周期内,当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到阈值时,对所述概率更新模型进行调整;Adjusting the probability update model when the number of binary symbols for encoding/decoding binary symbols reaches a threshold using the probability update model of the context during an initialization period of the context;
    其中,所述基于调整后的所述概率更新模型对二进制符号进行编/解码,包括:The encoding/decoding of the binary symbols based on the adjusted probability update model includes:
    在所述初始化周期内,基于调整后的所述概率更新模型对二进制符号进行编/解码。The binary symbols are encoded/decoded based on the adjusted probability update model during the initialization period.
  20. 根据权利要求1至19中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 19, further comprising:
    基于当前待编码或解码的块的量化步长对所述概率更新模型的滑动窗口参数进行初始化。The sliding window parameters of the probability update model are initialized based on the quantization step size of the block to be currently encoded or decoded.
  21. 一种上下文的概率更新装置,其特征在于,包括:A context probability updating device, comprising:
    处理单元,用于当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件时,对所述概率更新模型进行调整;a processing unit, configured to adjust the probability update model when a quantity of binary symbols for encoding/decoding binary symbols is satisfied by using a probability update model of the context;
    编/解码单元,用于基于调整后的所述概率更新模型对二进制符号进行编/解码。And an encoding/decoding unit, configured to encode/decode binary symbols based on the adjusted probability update model.
  22. 根据权利要求21所述的装置,其特征在于,所述使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量满足条件,包括:The apparatus according to claim 21, wherein said number of binary symbols for encoding/decoding binary symbols using the probability update model of said context satisfies conditions, including:
    当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到阈值The number of binary symbols that encode/decode binary symbols reaches a threshold when using the probability update model of the context
  23. 根据权利要求22所述的装置,其特征在于,所述阈值为小于算数编码的缩放区间二维查询表的概率状态值的最大值的正整数。The apparatus of claim 22 wherein said threshold is a positive integer that is less than a maximum of a probability state value of a scaled two-dimensional lookup table of an arithmetically encoded scale.
  24. 根据权利要求22所述的装置,其特征在于,所述阈值是自适应调整的。The apparatus of claim 22 wherein said threshold is adaptively adjusted.
  25. 根据权利要求24所述的装置,其特征在于,所述阈值是基于同一 个上下文的概率更新模型在已完成编码/解码的多个初始化周期内的平均使用次数确定的。The apparatus according to claim 24, wherein said threshold is determined based on an average number of uses of a probability update model of the same context over a plurality of initialization periods in which encoding/decoding has been completed.
  26. 根据权利要求25所述的装置,其特征在于,当所述平均使用次数低于第一数值时,所述阈值自适应调整为所述第一数值。The apparatus according to claim 25, wherein said threshold is adaptively adjusted to said first value when said average number of uses is lower than said first value.
  27. 根据权利要求25所述的装置,其特征在于,当所述平均使用次数高于第二数值时,所述阈值自适应调整为所述第二数值。The apparatus according to claim 25, wherein said threshold is adaptively adjusted to said second value when said average number of uses is higher than said second value.
  28. 根据权利要求22至27中任一项所述的装置,其特征在于,所述阈值为位于X/2 n1到X/2 n2之间的整数,其中X为算术编码的缩放区间二维查询表的概率状态值的最大值,X/2 n1大于1,n1与n2为自然数,n1大于n2。 The apparatus according to any one of claims 22 to 27, wherein the threshold is an integer between X/2 n1 and X/2 n2 , wherein X is an arithmetically encoded zoom interval two-dimensional lookup table The maximum value of the probability state value, X/2 n1 is greater than 1, n1 and n2 are natural numbers, and n1 is greater than n2.
  29. 根据权利要求22至28中任一项所述的装置,其特征在于,所述处理单元具体用于:The device according to any one of claims 22 to 28, wherein the processing unit is specifically configured to:
    采用计数器对使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量进行计数;Counting the number of binary symbols that encode/decode binary symbols using a probability update model of the context using a counter;
    当所述计数器的计数值达到所述阈值时,确定使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到所述阈值。When the count value of the counter reaches the threshold, it is determined that the number of binary symbols that encode/decode binary symbols using the probability update model of the context reaches the threshold.
  30. 根据权利要求29所述的装置,其特征在于,所述处理单元还用于,The device according to claim 29, wherein said processing unit is further configured to:
    当当前初始化周期结束时,对所述计数器清零。The counter is cleared when the current initialization period ends.
  31. 根据权利要求29所述的装置,其特征在于,所述处理单元还用于,当当前条带slice编/解码结束时,将所述计数器清零。The apparatus according to claim 29, wherein said processing unit is further configured to clear said counter when the current stripe slice encoding/decoding ends.
  32. 根据权利要求29所述的装置,其特征在于,所述处理单元还用于,当当前编码树单元CTU编/解码结束时,将所述计数器清零。The apparatus according to claim 29, wherein the processing unit is further configured to clear the counter when the current coding tree unit CTU encoding/decoding ends.
  33. 根据权利要求21至32中任一项所述的装置,其特征在于,所述处理单元具体用于,对所述概率更新模型的滑动窗口参数进行调整。The apparatus according to any one of claims 21 to 32, wherein the processing unit is specifically configured to adjust a sliding window parameter of the probability update model.
  34. 根据权利要求33所述的装置,其特征在于,所述处理单元具体用于,增大所述概率更新模型的滑动窗口参数。The apparatus according to claim 33, wherein the processing unit is specifically configured to increase a sliding window parameter of the probability update model.
  35. 根据权利要求34所述的装置,其特征在于,所述概率更新模型包括多个滑动窗口参数;The apparatus according to claim 34, wherein said probability update model comprises a plurality of sliding window parameters;
    所述处理单元具体用于,增大所述多个滑动窗口参数,其中每个滑动窗口参数增大的幅度相同,或不同,或不完全相同。The processing unit is specifically configured to increase the plurality of sliding window parameters, wherein each sliding window parameter increases in amplitude by the same, or different, or not identical.
  36. 根据权利要求34或35所述的装置,其特征在于,算数编码的缩放 区间二维查询表的概率状态值小于第三数值,所述滑动窗口参数增大的幅度小于第四数值。The apparatus according to claim 34 or 35, wherein the probability state value of the arithmetically encoded zoom interval two-dimensional look-up table is smaller than the third value, and the sliding window parameter increases by less than the fourth value.
  37. 根据权利要求21至36中任一项所述的装置,其特征在于,所述概率更新模型的滑动窗口参数的取值范围为2到9之间。The apparatus according to any one of claims 21 to 36, wherein the sliding window parameter of the probability update model has a value ranging from 2 to 9.
  38. 根据权利要求21至37中任一项所述的装置,其特征在于,所述处理单元具体用于,增大所述概率更新模型的滑动窗口参数;The apparatus according to any one of claims 21 to 37, wherein the processing unit is specifically configured to increase a sliding window parameter of the probability update model;
    在所述编/解码单元基于调整后的所述概率更新模型对二进制符号进行编/解码之后,所述处理单元还用于,当使用调整后的所述概率更新模型对二进制符号进行编/解码的二进制符号的数量满足第二条件时,再次增大所述概率更新模型的滑动窗口参数,所述滑动窗口参数再次增大的幅度与上一次增大的幅度相同或不同;After the encoding/decoding unit encodes/decodes the binary symbols based on the adjusted probability update model, the processing unit is further configured to: encode/decode the binary symbols when the adjusted probability update model is used. When the number of binary symbols satisfies the second condition, the sliding window parameter of the probability update model is again increased, and the amplitude of the sliding window parameter is increased again or the same as the amplitude of the previous increase;
    所述编/解码单元还用于,基于滑动窗口参数第二次增大的所述概率更新模型对二进制符号进行编/解码。The encoding/decoding unit is further configured to encode/decode binary symbols based on the probability update model that the sliding window parameter is secondarily increased.
  39. 根据权利要求21至37中任一项所述的装置,其特征在于,所述处理单元具体用于,在所述上下文的初始化周期内,当使用所述上下文的概率更新模型对二进制符号进行编/解码的二进制符号的数量达到阈值时,对所述概率更新模型进行调整;The apparatus according to any one of claims 21 to 37, wherein the processing unit is configured to: when the initialization period of the context is used, edit a binary symbol when using a probability update model of the context The probability update model is adjusted when the number of decoded binary symbols reaches a threshold;
    所述编/解码单元具体用于,在所述初始化周期内,基于调整后的所述概率更新模型对二进制符号进行编/解码。The encoding/decoding unit is specifically configured to: encode/decode binary symbols based on the adjusted probability update model during the initialization period.
  40. 根据权利要求21至39中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 21 to 39, wherein the device further comprises:
    初始化单元,用于基于当前待编码或解码的块的量化步长对所述概率更新模型的滑动窗口参数进行初始化。And an initializing unit, configured to initialize a sliding window parameter of the probability update model based on a quantization step size of a block to be currently encoded or decoded.
  41. 一种编/解码器,其特征在于,包括:存储器与处理器,所述存储器用于存储指令,所述处理器用于执行所述存储器存储的指令,并且对所述存储器中存储的指令的执行使得,所述处理器用于执行如权利要求1至20中任一项所述的方法。An encoder/decoder, comprising: a memory for storing instructions, said processor for executing instructions stored by said memory, and performing execution of instructions stored in said memory The processor is used to perform the method of any one of claims 1 to 20.
  42. 一种计算机存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被计算机执行时使得,所述计算机执行如权利要求1至20中任一项所述的方法。A computer storage medium, characterized in that a computer program is stored thereon, the computer program being executed by a computer such that the computer performs the method of any one of claims 1 to 20.
  43. 一种包含指令的计算机程序产品,其特征在于,所述指令被计算机执行时使得计算机执行如权利要求1至20中任一项所述的方法。A computer program product comprising instructions, wherein the instructions, when executed by a computer, cause a computer to perform the method of any one of claims 1 to 20.
PCT/CN2018/081648 2018-04-02 2018-04-02 Probability update method and apparatus for context WO2019191886A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880011453.0A CN110495170A (en) 2018-04-02 2018-04-02 The probability updating method and apparatus of context
PCT/CN2018/081648 WO2019191886A1 (en) 2018-04-02 2018-04-02 Probability update method and apparatus for context

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/081648 WO2019191886A1 (en) 2018-04-02 2018-04-02 Probability update method and apparatus for context

Publications (1)

Publication Number Publication Date
WO2019191886A1 true WO2019191886A1 (en) 2019-10-10

Family

ID=68099788

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081648 WO2019191886A1 (en) 2018-04-02 2018-04-02 Probability update method and apparatus for context

Country Status (2)

Country Link
CN (1) CN110495170A (en)
WO (1) WO2019191886A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116015312B (en) * 2023-03-28 2023-06-09 山东奔虎智能科技有限公司 Gas alarm system data storage method based on Internet of things platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790879A (en) * 2011-05-17 2012-11-21 李国君 Method for high throughput parallel avc/h.264 context-based adaptive binary arithmetic coding decoder
CN106899848A (en) * 2015-12-18 2017-06-27 黑莓有限公司 For the adaptive binary device selection of image and video coding
CN107667530A (en) * 2015-05-29 2018-02-06 高通股份有限公司 Advanced mathematical decoder

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051895B (en) * 2012-12-07 2016-04-13 浙江大学 The method and apparatus that a kind of context model is selected
US10127913B1 (en) * 2017-07-07 2018-11-13 Sif Codec Llc Method of encoding of data stream, method of decoding of data stream, and devices for implementation of said methods

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790879A (en) * 2011-05-17 2012-11-21 李国君 Method for high throughput parallel avc/h.264 context-based adaptive binary arithmetic coding decoder
CN107667530A (en) * 2015-05-29 2018-02-06 高通股份有限公司 Advanced mathematical decoder
CN106899848A (en) * 2015-12-18 2017-06-27 黑莓有限公司 For the adaptive binary device selection of image and video coding

Also Published As

Publication number Publication date
CN110495170A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
US8736467B2 (en) Adaptive binarization for arithmetic coding
KR101136212B1 (en) Optimized cabac decoder
US9941900B1 (en) Techniques for general-purpose lossless data compression using a recurrent neural network
US7978103B2 (en) Code amount estimating device, image coding apparatus including the code amount estimating device, and code amount estimating method
US20110181448A1 (en) Lossless compression
KR20060051149A (en) Lossless adaptive golomb/rice encoding and decoding of integer data using backward-adaptive rules
JP2009510962A (en) Adaptive variable length code for independent variables
WO2007056657A2 (en) Extended amplitude coding for clustered transform coefficients
WO2019041919A1 (en) Data coding method and device, and storage medium
TW201943274A (en) Video decoder, video encoder, method for decoding a video content, method for encoding a video content, computer program and video bitstream
KR20060051157A (en) Lossless adaptive encoding and decoding of integer data
US20090087113A1 (en) Variable length coding of coefficient clusters for image and video compression
WO2010044099A1 (en) Lossless content encoding
WO2019191886A1 (en) Probability update method and apparatus for context
KR101898664B1 (en) Method and apparatus for performing arithmetic coding by limited carry operation
CN107105274B (en) Method for decoding video quantization parameter
US8798139B1 (en) Dual-pipeline CABAC encoder architecture
CN106851278B (en) Image quantization parameter decoding method and decoder
US20220005229A1 (en) Point cloud attribute encoding method and device, and point cloud attribute decoding method and devcie
US7538697B1 (en) Heuristic modeling of adaptive compression escape sequence
US9973209B2 (en) Processor and data processing method thereof
JP6509916B2 (en) Method and apparatus for performing arithmetic coding based on concatenated ROM-RAM table
CN108282662B (en) Optimization method and device for continuous tone static image compression
JP4936574B2 (en) Encoding apparatus and control method thereof
JP2009159366A (en) Encoding system, encoding method, encoding program, decoding system, decoding method, and decoding program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18913841

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18913841

Country of ref document: EP

Kind code of ref document: A1