Video decoding method and apparatus, and video encoding method and apparatus
By obtaining the spatial information of the chroma block to determine the target context model, the entropy coding process is improved, the problem of inaccurate entropy coding of tu_cb_coded_flag in video coding is solved, and the coding efficiency is improved.
Patent Information
- Application Number
- PCT/CN2025/086881
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-05
- Filing Date
- 2025-04-02
- Publication Date
- 2026-01-08
AI Technical Summary
In existing technologies, the entropy coding context model selection for the syntax element tu_cb_coded_flag used to indicate whether a chroma transform block is a non-zero block in video coding is not accurate enough, resulting in low coding efficiency.
By acquiring the spatial information of chroma blocks, the target context model is determined, and the entropy coding process is improved to enhance the accuracy of the context model.
This improves the entropy coding accuracy of the tu_cb_coded_flag value during video encoding, thereby increasing encoding efficiency.
Smart Images

Figure CN2025086881_08012026_PF_FP_ABST
Abstract
Description
Video decoding method, video encoding method and device
[0001] This application claims priority to the Chinese Patent Application No. 202410902887.7, filed on July 5, 2024, entitled “Video decoding method, video encoding method and device”, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] Some embodiments of the present application relate to the field of video coding technology. More specifically, the present application relates to a video decoding method, a video encoding method and a device. BACKGROUND
[0003] Entropy coding is one of the main processes in video coding. At present, the value of the syntax element tu_cb_coded_flag used to indicate whether the transform block of a chroma block is a non-zero block is generally entropy coded by context-based adaptive binary arithmetic coding (CABAC). When the value of tu_cb_coded_flag is entropy coded by CABAC, the context model is selected according to the initialization type of tu_cb_coded_flag and whether the bdpcm chroma mode (the value of the syntax element intra_bdpcm_chroma_flag) is used for the current chroma block. However, the selection of the context model according to only the initialization type of tu_cb_coded_flag and whether the bdpcm chroma mode is used may result in an inaccurate context model for coding the value of tu_cb_coded_flag. SUMMARY
[0004] The exemplary embodiments of the present application provide a video decoding method, a video encoding method and a device for improving the accuracy of the context model used for entropy coding the value of tu_cb_coded_flag.
[0005] In a first aspect, some embodiments of the present application provide a video decoding method, comprising:
[0006] obtaining entropy coding data of a first syntax element of a first chroma block; the first syntax element being a syntax element used to indicate whether the transform block of a chroma block is a non-zero block; obtaining spatial information of the first chroma block according to a neighboring decoded chroma block of the first chroma block; determining a target context model according to the spatial information of the first chroma block; and obtaining the value of the first syntax element of the first chroma block based on the target context model and the entropy coding data of the first syntax element of the first chroma block.
[0007] In a second aspect, some embodiments of the present application provide a video encoding method, comprising:
[0008] obtaining spatial information of the first chroma block according to neighboring coded chroma blocks of the first chroma block; determining a target context model according to the spatial information of the first chroma block; entropy encoding a value of a first syntax element of the first chroma block based on the target context model to obtain entropy encoded data of the first syntax element of the first chroma block; the first syntax element being a syntax element identifying whether a transform block of a chroma block is a non-zero block.
[0009] In a third aspect, some embodiments of the present application provide a video decoding apparatus, comprising:
[0010] a first obtaining module, configured to obtain entropy encoded data of a first syntax element of a first chroma block; the first syntax element being a syntax element identifying whether a transform block of a chroma block is a non-zero block; a second obtaining module, configured to obtain spatial information of the first chroma block according to neighboring decoded chroma blocks of the first chroma block; a determining module, configured to determine a target context model according to the spatial information of the first chroma block; and a decoding module, configured to obtain a value of the first syntax element of the first chroma block based on the target context model and the entropy encoded data of the first syntax element of the first chroma block.
[0011] In a fourth aspect, some embodiments of the present application provide a video encoding apparatus, comprising:
[0012] an obtaining unit, configured to obtain spatial information of a first chroma block according to neighboring coded chroma blocks of the first chroma block; a determining unit, configured to determine a target context model according to the spatial information of the first chroma block; and an entropy encoding unit, configured to entropy encode a value of a first syntax element of the first chroma block based on the target context model to obtain entropy encoded data of the first syntax element of the first chroma block; the first syntax element being a syntax element identifying whether a transform block of a chroma block is a non-zero block. BRIEF DESCRIPTION OF DRAWINGS
[0013] FIG. 1 shows a structural schematic diagram of a video encoder in some embodiments of the present application;
[0014] FIG. 2 shows a structural schematic diagram of a video decoder in some embodiments of the present application;
[0015] FIG. 3 shows a flowchart of determining an index value of a context model in some embodiments of the present application;
[0016] FIG. 4 shows a flowchart of steps of a video decoding method in some embodiments of the present application;
[0017] FIG. 5 shows a flow chart of steps of a video decoding method in some embodiments of the present application;
[0018] FIG. 6 shows a flow chart of steps of a video encoding method in some embodiments of the present application;
[0019] FIG. 7 shows a structural schematic diagram of a video decoding apparatus in some embodiments of the present application;
[0020] FIG. 8 shows a structural schematic diagram of a video encoding apparatus in some embodiments of the present application. DETAILED DESCRIPTION
[0021] For the purpose of making the objects and implementations of the present application more clear, the following will combine the drawings in the exemplary embodiments of the present application to make a clear and complete description of the exemplary implementations of the present application. Obviously, the described exemplary embodiments are only some of the embodiments of the present application, but not all the embodiments. It should be noted that the brief description of the terms in the present application is only for the convenience of understanding the following described implementations, and is not intended to limit the implementations of the present application. Unless otherwise specified, these terms should be understood according to their ordinary and general meanings. The terms "include" and "have" and any variations thereof are intended to cover but not exclusively include, for example, a product or device including a series of components does not have to be limited to all the components clearly listed, but can include other components that are not clearly listed or inherent to such products or devices. The specification refers to "some implementations", "some embodiments" and the like, which means that the described implementations or embodiments can include a particular feature, structure or property, but can not necessarily include this particular feature, structure or property in each embodiment. In addition, such phrases do not necessarily refer to the same implementation. In addition, when a particular feature, structure or property is described in connection with an embodiment, it is considered that the implementation of such feature, structure or property in connection with other implementations (whether explicitly described herein or not) is within the knowledge of those skilled in the art.
[0022] Embodiments of the present application relate to the technical field of video coding. First, the video coding framework of some embodiments of the present application is described. A video can be regarded as a sequence of multiple video frames (images). Video playback can be regarded as displaying video frames in sequence at a preset rate (for example, 24 frames per second, 30 frames per second, 60 frames per second). In theory, the data volume of a video is positively correlated with the resolution of the video frames. The higher the resolution of the video frames, the larger the data volume of the video. If all pixel data of each pixel point of all video frames is directly saved in a video file, the data volume of the video will be very large, which will cause the video to be difficult to store and transmit. Video coding is proposed to solve this problem to some extent. Video coding can include video encoding and video decoding. Video encoding can be understood as a process of compressing original video frames, and video decoding can be understood as a process of reconstructing video frames according to compressed video data.
[0023] Referring to FIG. 1, FIG. 1 is a structural schematic diagram of an encoder provided by some embodiments of the present application. As shown in FIG. 1, in some embodiments, the encoder can include an encoding control module 101. The encoding control module 101 is configured to perform overall control of the video encoder, including performing encoding mode selection, encoding logic control, code rate control, quantization step control, and the like.
[0024] As shown in FIG. 1, in some embodiments, the encoder can include an intra prediction module 102. The intra prediction module 102 is configured to perform intra prediction according to reconstructed samples in the current image, and send intra coding information to an entropy encoding module. The intra coding information can include at least one of an intra prediction mode, a most probable mode (MPM) flag, and an MPM index. The intra coding information can include information of reference samples.
[0025] As shown in FIG. 1, in some embodiments, the encoder can include an inter prediction module 103. The inter prediction module 103 is configured to perform inter prediction to predict the current image by using reference images stored in a decoded picture buffer (DPB). The inter prediction module 103 can include a motion estimation unit 103a and a motion compensation unit 103b. The motion estimation unit 103a is configured to perform motion estimation (ME) to obtain a motion vector of a current region by referring to a specific region of a reconstructed reference image. The motion compensation unit 103b performs motion compensation using the motion vector value obtained from the motion estimation unit 103a.
[0026] As shown in FIG. 1, in some embodiments, the encoder can include a transform module 104. The transform module 104 obtains transform coefficients by transforming a residual signal, which is the difference between the input input video and the prediction signal generated by the intra prediction module 102 or the inter prediction module 103. In some embodiments, a discrete cosine transform (DCT), a discrete sine transform (DST), or a wavelet transform can be used. The DCT and the DST perform the transformation by dividing the input image signal into multiple blocks. In the transformation, the coding efficiency can vary depending on the distribution and characteristics of the values in the transformed region.
[0027] As shown in FIG. 1, in some embodiments, the encoder can include a quantization module 105. The quantization module 105 is configured to quantize the transform coefficients output by the transform module 104 to obtain quantized transform coefficients.
[0028] As shown in FIG. 1, in some embodiments, the encoder can include an entropy encoding module 106. The entropy encoding module 106 is configured to entropy encode the information such as the encoding mode, the prediction module, the motion vector, the quantized transform coefficients output by the quantization module 105, etc. to obtain an output bitstream corresponding to the input video.
[0029] As shown in FIG. 1, in some embodiments, the encoder can include a dequantization module 107. The dequantization module 107 is configured to perform the inverse operation of the quantization module 105 to inverse quantize (scale) the quantized transform coefficients.
[0030] As shown in FIG. 1, in some embodiments, the encoder can include an inverse transform module 108. The inverse transform module 108 is configured to reconstruct the residual information from the transform coefficient values output by the dequantization module 107.
[0031] As shown in FIG. 1, in some embodiments, the encoder can include a loop filter 109. The loop filter 109 is configured to perform filtering operations to improve the quality of the reconstructed image and improve the coding efficiency. Exemplarily, the loop filter 109 can include a deblocking filter, a sample adaptive offset (SAO), an adaptive loop filter, etc. The image filtered by the loop filter 109 is output or stored in a decoded picture buffer to be used as a reference picture.
[0032] Referring to FIG. 2, FIG. 2 is a structural diagram of a decoder provided by some embodiments of the present application. As shown in FIG. 2, in some embodiments, the decoder can include an entropy decoding module 201. The entropy decoding module 201 is configured to perform entropy decoding on an input bitstream to extract transform coefficient information, intra coding information, inter coding information, and the like of each region. In some embodiments, the entropy decoding module 201 can obtain binary codes of transform coefficient information of a specific region from the input bitstream. In addition, the entropy decoding module 201 obtains quantized transform coefficients by performing inverse binarization on the binary codes.
[0033] As shown in FIG. 2, in some embodiments, the decoder can include a dequantization module 202. The dequantization module 202 performs dequantization on the quantized transform coefficients output by the entropy decoding module 201.
[0034] As shown in FIG. 2, in some embodiments, the decoder can include an inverse transform module 203. The inverse transform module 203 is configured to reconstruct residual values using the dequantized transform coefficients.
[0035] As shown in FIG. 2, in some embodiments, the decoder can include an intra prediction module 204. The intra prediction module 204 is configured to generate a prediction block by using intra coding information and recovered samples in a current image. The intra coding information can include at least one of an intra prediction mode, a most probable mode (MPM) flag, and an MPM index. The intra prediction unit 252 predicts sample values of a current block by using recovered samples located on the left side and / or the upper side of the current block as reference samples.
[0036] As shown in FIG. 2, in some embodiments, the decoder can include a motion compensation module 205. The motion compensation module 205 is configured to generate a prediction block by using a reference picture and inter coding information stored in a decoded picture buffer. The inter coding information can include a motion information set (a reference picture index, motion vector information, and the like) of a current block for a reference block. The decoder further reconstructs original pixel values by adding the residual values obtained by the inverse transform module 203 to the prediction block obtained by the intra prediction module 204 or the motion compensation module 205.
[0037] As shown in FIG. 2, in some embodiments, the decoder can include a loop filter 206. The loop filter 206 is configured to perform a filtering operation to improve the quality of a reconstructed image and improve coding efficiency.
[0038] The entropy encoding operation performed by the entropy encoding module in the encoder is a lossless encoding mode according to the entropy principle without losing any information. Common entropy encodings include Shannon encoding, Huffman encoding, Exp-Golomb encoding, and arithmetic encoding. In actual use, a suitable entropy encoding model can be selected according to the distribution of the symbols to be encoded.
[0039] In some embodiments, the entropy encoding module can perform encoding through context-based adaptive binary arithmetic coding (CABAC). The core algorithm of CABAC is adaptive binary arithmetic coding, which combines a context model with adaptive binary arithmetic coding, performs arithmetic coding according to a probability model and a binary value of a syntax element, and then updates the context model.
[0040] The input of the CABAC encoder is the value of the syntax element to be encoded, which can be binary or non-binary, and the output of the CABAC encoder is the encoded bits. The encoding process of the CABAC encoder can include the following steps 1 to 3:
[0041] Step 1, binarization.
[0042] The CABAC encodes the values of the syntax elements in the slice data. Before arithmetic encoding, these syntax elements need to be converted into binary strings suitable for binary arithmetic encoding according to a certain method, and this conversion process is called binarization.
[0043] It should be noted that step 1 is for the values of non-binary syntax elements. If the input of the CABAC is the values of binary syntax elements, step 1 is skipped and step 2 is executed directly.
[0044] The binarization algorithm in CABAC includes fixed-length binary conversion (FL), truncated rice (TR), truncated binary (TB), and the k-th order Exp-Golomb (EGK). CABAC selects different binarization methods according to different probability distribution characteristics of the values of different syntax elements.
[0045] Fixed length binarization is a binary algorithm that converts the value of a syntax element into a fixed length binary symbol. When the probability of the value of a syntax element is uniformly distributed, a fixed length coding binarization scheme can be selected. For example: the value of a given syntax element is x, and 0≤x≤cMax, then the fixed length binary symbol string of x is obtained by directly converting the decimal number into a binary number, and the length of the fixed length binary symbol string of x is wherein, l FL is the length of the binary symbol string, represents the upward rounding.
[0046] The truncated rice code binary code is formed by splicing the prefix string and the suffix string. The calculation formula of the prefix value P is: P = V >> R. If the value of P is less than (cMax >> R), the prefix string is composed of P ones and a zero, and the length is P + 1; if the value of P is greater than or equal to (cMax >> R), the prefix string is composed of (cMax >> R) ones, and the length is (cMax >> R). The calculation formula of the suffix value S is: S = V-(P << R), and the suffix string is the binary string of S, and the length is R. When the value of the syntax element V is greater than or equal to cMax, there is no suffix string. Wherein, cMax is the maximum value of the syntax element to be binarized, R is the rice parameter, and V is the value of the syntax element to be binarized.
[0047] The binary code of K-order exponential Golomb code binarization is also formed by splicing the prefix and the suffix. Wherein, the prefix part is composed of the unary code corresponding to the value of The suffix part can be calculated by using the binary value of x+2k(1-2l(x)) of length k+l(x)k+l(x) bits.
[0048] Step 2, context modeling.
[0049] In the Versatile Video Coding (H.266 / VVC) standard, a double probability model is used to predict the Least Probable Symbol (LPS) symbol probability of each context. The probability prediction model of the H.266 / VVC standard is as follows: p(t+1) = (p0(t+1) + p1(t+1)) / 2 (1) p0(t+1) = p0(t) · (1-α0) + x(t) · α0 (2) p1(t+1) = p1(t) · (1-α1) + x(t) · ɑ1 (3)
[0050] wherein a0, a1 are the update rates of the two models, p0(t), p1(t) are the prediction probabilities of the two models of the double probability model at the t-th time, x(t) is the sign of the double probability model at the t-th time, p0(t+1), p1(t+1) are the prediction probabilities of the two models of the double probability model at the (t+1)-th time.
[0051] That is, the probability prediction model of the H.266 / VVC standard is to take the average of the prediction probabilities obtained by the double probability model to obtain the prediction probability of the LPS.
[0052] In order to avoid multiplication operations, a0, a1 are limited to a = 2 -β (β∈N + ), then q(t+1) = q(t) - (q(t) > > β + x(t) · ((2 b -1) > > β) (4)
[0053] wherein q(t) is the b-bit integerized representation of p(t).
[0054] In the H.266 / VVC standard, b0 = 10, b1 = 14, so the probability prediction model of the H.266 / VVC standard can be: p(t) = q(t) · 2 b +2 b -1 (5)
[0055] In the H.266 / VVC standard, each context model used by the syntax element is specified by a unique context index ctxId. Each context model involves two types of variables: an update rate shiftIdx that controls the model probability update rate, and pStateIdx0 (q0(t) in the probability prediction model) and pStateIdx1 (q1(t) in the probability prediction model) that predict the probability state.
[0056] According to the value of the coded binary symbol and the update rate shiftIdx, the probability states pStateIdx0 and pStateIdx1 are constantly updated using the probability prediction model. The prediction probability pState of LPS can be obtained by further averaging the prediction probabilities obtained by the double probability model, and the specific calculation formula is as follows: pState = pStateIdx1 + 16 pStateIdx0 (6) pStateIdx0 = pStateIdx0 » shift0 + ((2 10 - 1) Bin » shift0) (7) pStateIdx1 = pStateIdx1 » shift1 + ((2 14 - 1) Bin » shift1) (8) shift0 = (shiftIdx » 2) + 2 (9) shift1 = (shiftIdx & 3) + 3 + shift0 (10)
[0057] Wherein, shift0 (α0 in the probability prediction model) and shift1 (α1 in the probability prediction model) are the update rates of the prediction probabilities pStateIdx0 and pStateIdx1 respectively; Bin is the coded binary symbol; the prediction probabilities pStateIdx0 and pStateIdx1 are 10-bit and 14-bit integer representations respectively.
[0058] In addition, before coding the first binary symbol, how to initialize the context model of the symbol is one of the key technologies of context modeling. In the H.266 / VVC standard, an initial initValue and an update rate shiftIdx are assigned to each context index. initValue is used to calculate the model probability state, and the specific calculation formula is as follows: slopeIdx = initValue » 3 (11) offsetIdx = initValue (12) m = slopeIdx - 4 (13) n = (offsetIdx * 18) + 1 (14) preCtxState = Clip3(1, 127, ((m * (Clip3(0, 63, SliceQPy) - 16)) » 1) + n) (14) pStateIdx0 = preCtxState « 3 (15) pStateIdx1 = preCtxState » 7 (16)
[0059] where SliceQPy is the quantization parameter of the luma signal.
[0060] In some embodiments, the corresponding weights for the double probability model prediction of pStateIdx0 and pStateIdx1 can also be added, while setting the mechanism of shift0 and shift1 to fine-tune according to the coding symbol being 0 or 1.
[0061] The operation of deriving the resulting probability for the binary arithmetic coding by introducing a weight is as follows: p = ((32 - ω) · p0 + ω · p1) » 5 (17)
[0062] wherein, wherein ω is a weight selected from a predefined set ω ∈ {10, 12, 16, 20, 22}, three different weights can be predefined for each context model of I, B and P type slices, and the weight of I type slice is only allowed to be used for intra slices, while the weight of B type slice and P type slice is selected based on the initialization type initType obtained from sh_cabac_init_flag, the I type slice is a slice that only uses the current picture for reconstruction, the B type slice is a slice that uses at most two motion vectors and reference picture indexes, also known as bi-predictive slice, and the P type slice is a slice that uses at most one motion vector and reference picture index.
[0063] The CABAC used in H.266 / VVC standard has two probability states, which are updated by short window and long window respectively, and the size of long window and short window is specified by the shiftIdx item in the standard document, which controls the different update rates of long and short windows. The above embodiments fine-tune the size of long and short windows according to the initial value of shiftIdx for the coding symbol being 0 or 1, and the update range of long and short windows is -7 to 7, while the lower limit of the window size is set to 2.
[0064] Step 3, binary arithmetic coding.
[0065] The binary arithmetic coding encodes each binary symbol after the binaryization of the value of the current syntax element according to the probability model parameter, to obtain the final output code stream.
[0066] The binary arithmetic coding is based on the way of recursive interval division, and the coding interval and interval lower limit are saved in the recursive process. H.266 / VVC standard includes two coding methods: regular coding and bypass coding. Regular coding uses adaptive probability model for coding; bypass coding is coded in an equal probability manner, and its probability state does not need to be updated.
[0067] The input of a regular encoder in the H.266 / VVC standard is a context model (shiftldx, pStateIdx0, pStateIdx1) and a binary symbol (Bin) to be encoded, and the state of the encoder is the current coding interval width Range and the interval lower limit Low. The initial value of Range is 510, and the initial value of the interval lower limit Low is 0. The encoding process can include the following steps 1 to 7:
[0068] Step 1, calculate the interval width R corresponding to LPS LPS and R MPS .
[0069] Calculate the interval width R corresponding to LPS LPS and R MPS The formula is as follows: RangeIdx = Range » 5 (18) pState = pStateIdx1 + 16 pStateIdx0 (19) R LPS = (pStateIdx pState5) » 1 + 4 (21) R MPS = Range - R LPS (22)
[0070] Where pState5 represents the prediction probability of 5-bit precision, and when pState » 14 = 1, the prediction probability is greater than 0.5, and pState is the prediction probability of MPS, and the exclusive or operation Keep it as the prediction probability of LPS.
[0071] Step 2, update the coding interval width Range and the interval lower limit Low.
[0072] The formula for updating the coding interval width Range and the interval lower limit Low is as follows: MPS = pState » 14 (23)
[0073] If Bin = LPS, then Low = Low + R MPS , Range = R LPS ;
[0074] If Bin = MPS, then Low remains unchanged, and Range = R MPS .
[0075] Step 3, the coding interval width Range is renormalized.
[0076] With the update of the coding interval width Range, the value of the coding interval width Range can be less than 256 (the interval width is initialized as 510), and renormalization is needed. The renormalization is performed by left shifting the interval lower limit Low and the coding interval width Range at the same time until the value of the coding interval width Range is greater than or equal to 256, and the bits left shifted out of the interval lower limit Low are the coding output bits.
[0077] Step 7, updating the context model with the coded binary symbol.
[0078] Thus far, the encoding implementation of CABAC is described.
[0079] The operation performed by the entropy decoding module in the decoder is the inverse operation of the operation performed by the entropy encoding module in the encoder, and when the entropy encoding module is encoded by CABAC, the operation performed by the entropy decoding module also corresponds to the CABAC encoding part, which can include: decoding the corresponding binary symbol by reading the interval lower limit written in the code stream.
[0080] The input of the CABAC decoder is the interval lower limit and the index corresponding to the syntax element, and the output of the CABAC decoder is the binary value of the corresponding syntax element. The encoding process of the CABAC decoder can include the following steps a and b:
[0081] Step a, obtaining a context.
[0082] The above step a (obtaining a context) can include the following steps a1 and a2:
[0083] Step a1, determining which syntax element is currently decoded according to the standard syntax element structure, and obtaining the bypass flag (bypassFlag) and the context model index (ctxIdx) that can exist of the current symbol according to the position of the coded binary symbol in the bit stream, the index (binIdx) of the corresponding binary symbol and the context reference information.
[0084] Step a2, obtaining the update rate shiftIdx, the probability state pStateIdx0, the probability state pStateIdx1, the weight of pStateIdx0 and the weight of pStateIdx1 according to the information obtained in step a1, and obtaining the estimated probability of the current symbol.
[0085] The implementation of the update rate shiftIdx, the probability state pStateIdx0, the probability state pStateIdx1 and the weight of pStateIdx0 and pStateIdx1 to obtain the estimated probability of the current symbol can refer to the above step 2, and will not be described in detail here to avoid repetition.
[0086] Step b, binary arithmetic decoding.
[0087] Corresponding to step 3 above, step b (binary arithmetic decoding) above includes two decoding modes: regular decoding and bypass decoding. Regular decoding decodes using an adaptive probability model; bypass decoding decodes in an equiprobable manner, whose probability state does not need to be updated, and the two decoding modes are distinguished by the bypass flag (bypassFlag) obtained in step a.
[0088] The input of the encoder of regular decoding is the context model (update rate shiftIdx, probability state pStateIdx0, probability state pStateIdx1) and the current coding interval width Range, the initial value of which is 510, and the interval lower limit m_value is obtained from the byte read from the code stream. The basic principle of regular decoding is: after obtaining the corresponding context used for decoding the current symbol, the size of the interval corresponding to the LPS symbol is calculated according to the estimated probability and the current coding interval width m_Range, and the interval lower limit is compared with the size of the current coding interval to determine whether the symbol symbol is 1 or 0. The specific decoding process can include the following steps ① to ④:
[0089] Step ①, calculate the interval width R of LPS LPS and R MPS .
[0090] The calculation formula of the interval width R of LPS LPS and R MPS is as follows: qRangeIdx = Range » 5 (18) pState = pStateIdx1 + 16·pStateIdx0 (19) R LPS = (qRangeIdx·pState5) » 1 + 4 (21) R MPS = Range - R LPS (22)
[0091] Wherein, pState5 represents the prediction probability of 5-bit precision, and when pState » 14 = 1, the prediction probability is greater than 0.5, and pState is the prediction probability of MPS, and the exclusive OR operation keeps it as the prediction probability of LPS.
[0092] Step ②, compare the interval lower limit m_Value and the positions of the sub-intervals corresponding to MPS and LPS
[0093] If m_Value < RMPS If m_Value >= R, then m_Value remains unchanged, Range = R MPS The binary value of the corresponding syntax element is Bin = MPS.
[0094] If m_Value >= R MPS m_Value = m_Value - R LPS Range = R LPS The binary value of the corresponding syntax element is Bin = LPS.
[0095] Step 3, the coding interval width Range is renormalized.
[0096] Similarly, as the coding interval width Range is updated, the value of the coding interval width Range can be less than 256 (the interval width is initialized to 510), and renormalization is needed. The renormalization is as follows: the interval lower limit Low and the coding interval width Range are simultaneously left shifted until the value of the coding interval width Range is greater than or equal to 256, and the bits left shifted out of the interval lower limit Low are the coding output bits.
[0097] Step 4, the value of the syntax element is reconstructed
[0098] In some embodiments, the value of the syntax element can be reconstructed by performing the inverse of the binarization of the binary string obtained by decoding the value of the syntax element.
[0099] Thus far, the decoding implementation of CABAC has been described.
[0100] Some embodiments of the present application relate to entropy encoding the value of the syntax element tu_cb_coded_flag. First, the syntax element tu_cb_coded_flag is described below. The syntax element tu_cb_coded_flag is a syntax element in the H.266 / VVC standard that indicates whether the transform block (TU) of the Cb chroma component of the current coding block is a non-zero block, that is, whether the transform block of the current Cb chroma component contains a non-zero transform coefficient syntax element. When the value of the syntax element tu_cb_coded_flag is 1, it indicates that the transform block of the current Cb chroma component contains a non-zero transform coefficient. When the value of the syntax element tu_cb_coded_flag is 0, it indicates that the transform block of the current Cb chroma component does not contain a non-zero transform coefficient. When tu_cb_coded_flag does not exist, it is defaulted that the transform block of the current Cb chroma component does not contain a non-zero transform coefficient.
[0101] The process of entropy encoding the value of tu_cb_coded_flag in the related art can include steps I to IV as follows:
[0102] Step I, binarize the value of tu_cb_coded_flag.
[0103] The implementation of binarizing the value of tu_cb_coded_flag can refer to the following table 1:
[0104] Table 1 Syntax element and its input parameters based on basic binarization scheme
[0105] The above table 1 shows the way of binarizing the value of tu_cb_coded_flag and the input parameters. As can be seen from the above table 1, the binarization scheme selected for binarizing the value of tu_cb_coded_flag is the fixed-length coding binarization scheme, and the maximum value of tu_cb_coded_flag is 1.
[0106] Step II, context model selection of tu_cb_coded_flag.
[0107] The purpose of context model selection of tu_cb_coded_flag is to determine the context index value ctxIdx, and the implementation can include:
[0108] Step 1, determine the context model index value set of tu_cb_coded_flag according to the initialization type of tu_cb_coded_flag.
[0109] A table of context index values ctxldx is given for each syntax element in H.266 / VVC standard, which determines the initial value initValue of each syntax element. H.266 standard lists a table that specifies the table number of each syntax element and the set of context index values ctxldx corresponding to different initialization types. Taking H.266 / VVC standard as an example, Table 2 gives the set of context index values ctxldx of tu_cb_coded_flag in different initialization types. The initialization type initType is determined by the frame type and sh_cabac_init_flag, and sh_cabac_init_flag is determined by pps_cabac_init_present_flag, pps_cabac_init_present_flag equal to 1 indicates that sh_cabac_init_flag exists in the slice header referring to the picture parameter set (PPS), and the value of sh_cabac_init_flag is determined to be 1. pps_cabac_init_present_flag equal to 0 indicates that sh_cabac_init_flag does not exist in the slice header referring to the PPS, and the value of sh_cabac_init_flag is determined to be 0.
[0110] The specific way of determining the initialization type initType by the frame type and sh_cabac_init_flag is as follows:
[0111] That is, the initialization type initType of the I type frame is 0, the initialization type initType of the P type frame is 2 or 1 according to sh_cabac_init_flag, and the initialization type initType of the B type frame is 1 or 2 according to sh_cabac_init_flag.
[0112] For each type of frame, as shown in Table 2, tu_cb_coded_flag uses 2 context models, when initType = 0, the context index ctxldx candidate set is 0 and 1; when initType = 1, the context index ctxldx candidate set is 2 and 3; when initType = 2, the context index ctxldx candidate set is 4 and 5.
[0113] Table 2 Initialization type table number of syntax element and its set of context index values in different initialization types
[0114] Table 3 shows the initial value initValue and the update rate shiftIdx of the six context models of tu_cb_coded_flag in the reference software test platform (VTM) of VVC. The initial value initValue is used to calculate the probability state of the context model, and the update rate shiftIdx is used to control the update rate of the model probability. According to the two parameters of the initial value initValue and the update rate shiftIdx, the input (shiftIdx, pStateIdx0, pStateIdx1) of the regular encoder can be obtained. The implementation of obtaining shiftIdx, pStateIdx0, pStateIdx1 according to the initial value initValue and the update rate shiftIdx refers to step 2 above, and will not be described in detail here to avoid repetition.
[0115] Table 3 Initial value of context model parameter of tu_cb_coded_flag
[0116] Step ii determines the index offset binIdx according to intra_bdpcm_chroma_flag.
[0117] For tu_cb_coded_flag, determining the index offset binIdx according to intra_bdpcm_chroma_flag can include: when intra_bdpcm_chroma_flag is true, the index offset binIdx of tu_cb_coded_flag is parsed as 1, otherwise it is parsed as 0. See Table 4 below for details:
[0118] Table 4 Assigning context model offset to syntax element
[0119] Step iii determines the context model index value of tu_cb_coded_flag according to the index offset binIdx of tu_cb_coded_flag.
[0120] That is, first select the context model index value set of tu_cb_coded_flag according to the initialization type of tu_cb_coded_flag, and then select the context model index value of tu_cb_coded_flag from the context model index value set of tu_cb_coded_flag according to the index offset binIdx of tu_cb_coded_flag.
[0121] In summary, the mapping relationship of the initialization type initType of tu_cb_coded_flag, the intra_bdpcm_chroma_flag, and the context model index ctxIdx can be shown in Table 5 as follows:
[0122] Table 5: Context model selection for tu_cb_coded_flag
[0123] In some embodiments, the mapping relationship shown in Table 5 can also be calculated by expressions.
[0124] Step III, arithmetic coding is performed on the value of tu_cb_coded_flag.
[0125] After obtaining the value of the context model index ctxIdx of tu_cb_coded_flag, arithmetic coding is started according to tu_cb_coded_flag and the context model determined by the initial value initValue and the update rate shiftIdx (shiftIdx, pStateIdx0, pStateIdx1), the interval is divided, and the corresponding coding data of tu_cb_coded_flag is obtained.
[0126] Step IV, the probability model corresponding to the context model used by tu_cb_coded_flag is updated.
[0127] That is, the probability states pStateIdx0 and pStateIdx1 of the context model used are updated according to the value of tu_cb_coded_flag.
[0128] The process of entropy decoding the value of tu_cb_coded_flag in the related art can include the following steps ㈠ to ㈣:
[0129] Step ㈠, determine the context model index value set of tu_cb_coded_flag according to the initialization type of tu_cb_coded_flag.
[0130] The implementation of determining the context model index value set of tu_cb_coded_flag according to the initialization type of tu_cb_coded_flag can refer to the above step ㈠, and will not be described in detail here to avoid repetition.
[0131] Step ㈡, determine the index offset binIdx according to intra_bdpcm_chroma_flag.
[0132] The implementation of determining the index offset binltx according to the intra bdpcm chroma flag can refer to the step I, and details are not described here to avoid repetition.
[0133] Step III, determining the context model index value of the tu cb coded flag according to the index offset binltx of the tu cb coded flag, and performing arithmetic decoding.
[0134] The performing of the arithmetic decoding can include: determining a symbol corresponding to the tu cb coded flag according to the interval division condition and the value corresponding to the lower limit of the interval in the code stream. The value of the symbol can be 0 or 1.
[0135] Step IV, assigning a value to the tu cb coded flag according to the value of the symbol obtained by the arithmetic decoding.
[0136] That is, the value of the symbol (0 or 1) corresponding to the tu cb coded flag is assigned to the value of the tu cb coded flag, and the value of the tu cb coded flag can be 0 or 1.
[0137] Step VI, updating the probability model corresponding to the context model used by the tu cb coded flag.
[0138] The implementation of updating the probability model corresponding to the context model used by the tu cb coded flag can refer to the step IV, and details are not described here to avoid repetition.
[0139] As described above, in the related art, the tu cb coded flag corresponds to two context models according to the initialization type, and then determines which one of the two context models corresponding to the initialization type is used according to the intra bdpcm chroma flag (an identifier indicating whether the chroma bdpcm is used for the current CU). The context index of the tu cb coded flag can be calculated as follows: ctxltx = intra bdpcm chroma flag? 1 : 0
[0140] However, in the related art, the context model of the tu cb coded flag is determined only according to the initialization type initType of the tu cb coded flag and the value of the corresponding intra bdpcm chroma flag, without considering the spatial characteristics of the tu cb coded flag, which may lead to inaccurate context model of the tu cb coded flag.
[0141] The spatial characteristics of the tu_cb_coded_flag are not considered when the context model of the tu_cb_coded_flag is selected, which may result in an inaccurate context model of the tu_cb_coded_flag. Some embodiments of the present application further provide the following technical solutions:
[0142] Some embodiments of the present application change the context model used when the syntax element tu_cb_coded_flag of the chroma block is entropy coded. Specifically, the context model index used when the current tu_cb_coded_flag is coded is determined according to the values of the tu_cb_coded_flag in the upper and left neighboring chroma blocks of the current chroma block, and the number and initial value of the corresponding context model are changed.
[0143] In some embodiments, after the context model used when the syntax element tu_cb_coded_flag of the chroma block is entropy coded is changed, the implementation of entropy coding of the tu_cb_coded_flag can include the following steps A to D:
[0144] Step A, binarize the value of the tu_cb_coded_flag.
[0145] The implementation of binarizing the value of the tu_cb_coded_flag can refer to the above step I, and will not be described in detail here to avoid repetition.
[0146] Step B, select the context model for entropy coding of the value of the tu_cb_coded_flag.
[0147] The purpose of the above step B (selecting the context model for entropy coding of the value of the tu_cb_coded_flag) is to determine the context model ctxIdx used for entropy coding of the value of the tu_cb_coded_flag, and the implementation can include the following steps B1 to B4:
[0148] Step B1, determine the context model index value set of the tu_cb_coded_flag according to the initialization type of the tu_cb_coded_flag.
[0149] In some embodiments of the present application, the initialization type initType of tu_cb_coded_flag can include three values, i.e. 0, 1, and 2, and each initialization type initType of tu_cb_coded_flag is changed from 2 to 6. The mapping relationship between the initialization type initType of tu_cb_coded_flag and the context model index value set can include: when the initialization type initType is 0, the context model index value set of tu_cb_coded_flag is {0, 1, 2, 3, 4, 5}; when the initialization type initType is 1, the context model index value set of tu_cb_coded_flag is {6, 7, 8, 9, 10, 11}; and when the initialization type initType is 2, the context model index value set of tu_cb_coded_flag is {12, 13, 14, 15, 16, 17}. That is, in some embodiments of the present application, the mapping relationship between the initialization type initType of tu_cb_coded_flag and the context model index value set is shown in Table 6 as follows:
[0150] Table 6 Context index set of different initialization types of tu_cb_coded_flag
[0151] In some embodiments, the initialization values of the context model parameters corresponding to the index numbers 1 to 17 are preset empirical values.
[0152] In some embodiments, the initialization values of the context model parameters corresponding to the index numbers 1 to 17 can include: the initial value initValue is set to CNU=35, the update rate shiftIdx is set to DWS=8, the initial value of the interval width is set to DWE=18, and the initial value of the long-short window offset is set to DWO=119. The initialization values of the context model parameters corresponding to the index numbers 1 to 17 are shown in Table 7 as follows:
[0153] Table 7 Initialization values of context model parameters of tu_cb_coded_flag
[0154] In other embodiments, the context model probability after the end of encoding of each frame of each sequence can be recorded, and the initialization values of the context model parameters corresponding to the index numbers 1 to 17 can be set according to the historical data.
[0155] Step B2, determining the value of tu_cb_coded_flag of the coded chroma block adjacent to the current chroma block.
[0156] In some embodiments, the coded chroma blocks neighboring the current chroma block can include a chroma block located left of the current chroma block and a chroma block located above the current chroma block, and thus the chroma block located left of the current chroma block and the chroma block located above the current chroma block can be determined according to the incoming coding structure and chroma position, chroma component. Then the value of the tu_cb_coded_flag of the chroma block located left of the current chroma block and the value of the tu_cb_coded_flag of the chroma block located above the current chroma block are obtained.
[0157] Step B3, determining the index value of the context model of the current chroma block according to the value of the tu_cb_coded_flag of the coded chroma block neighboring the current chroma block and the value of the intra_bdpcm_chroma_flag of the current chroma block.
[0158] In some embodiments, determining the index value of the context model of the current chroma block according to the value of the tu_cb_coded_flag of the coded chroma block neighboring the current chroma block and the value of the intra_bdpcm_chroma_flag of the current chroma block can include the following steps B31 and B32.
[0159] Step B31, calculating the sum of the values of the tu_cb_coded_flag of the coded chroma blocks neighboring the current chroma block.
[0160] That is, the value of the tu_cb_coded_flag of the chroma block located left of the current chroma block and the value of the tu_cb_coded_flag of the chroma block located above the current chroma block are added to obtain the sum Neibor_CbfcbFlag_Sum of the values of the tu_cb_coded_flag of the coded chroma blocks neighboring the current chroma block. Since the chroma block located left of the current chroma block and / or the chroma block located left of the current chroma block can not exist, and the value of the tu_cb_coded_flag is 0 or 1, the value of Neibor_CbfcbFlag_Sum is 0 or 1 or 2.
[0161] Step B32, determining the index value of the context model of the current chroma block according to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks neighboring the current chroma block and the value of the intra_bdpcm_chroma_flag of the current chroma block.
[0162] In some embodiments, determining the index value of the context model of the current chroma block according to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and the value of the intra bdpcm chroma flag of the current chroma block can comprise: when the value of the intra bdpcm chroma flag is 0 (bdpcm Chroma mode is not used), the index value of the context model of the current chroma block is selected from the first three context model indexes of the context index set corresponding to the initialization type, i.e., if the initialization type initType = 0, the selected range of the index value ctxIdx of the context model is {0, 1, 2}, if the initialization type initType = 1, the selected range of the index value ctxIdx of the context model is {6, 7, 8}, and if the initialization type initType = 2, the selected range of the index value ctxIdx of the context model is {12, 13, 14}; when the value of the intra bdpcm chroma flag is 1 (bdpcm Chroma mode is used), the index value of the context model of the current chroma block is selected from the last three context model indexes of the context index set corresponding to the initialization type, i.e., if the initialization type initType = 0, the selected range of the index value ctxIdx of the context model is {3, 4, 5}, if the initialization type initType = 1, the selected range of the index value ctxIdx of the context model is {9, 10, 11}, and if the initialization type initType = 2, the selected range of the index value ctxIdx of the context model is {15, 16, 17}.
[0163] In some embodiments, the selecting the index value of the context model of the current chroma block from the first three context model indexes of the context index set corresponding to the initialization type can include: if the initialization type initType=0, the index value ctxIdx of the context model is equal to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block, i.e., ctxIdx=Neibor_CbfcbFlag_Sum; if the initialization type initType=1, the index value ctxIdx of the context model is equal to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and 6, i.e., ctxIdx=Neibor_CbfcbFlag_Sum+6; if the initialization type initType=2, the index value ctxIdx of the context model is equal to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and the sum of Neibor_CbfcbFlag_Sum and 12, i.e., ctxIdx=Neibor_CbfcbFlag_Sum+12. The selecting the index value of the context model of the current chroma block from the last three context model indexes of the context index set corresponding to the initialization type can include: if the initialization type initType=0, the index value ctxIdx of the context model is equal to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and 3, i.e., ctxIdx=Neibor_CbfcbFlag_Sum+3; if the initialization type initType=1, the index value ctxIdx of the context model is equal to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and 9, i.e., ctxIdx=Neibor_CbfcbFlag_Sum+9; if the initialization type initType=2, the index value ctxIdx of the context model is equal to the sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and 15, i.e., ctxIdx=Neibor_CbfcbFlag_Sum+15.
[0164] Referring to FIG. 3, the mapping relationship of the value of the intra_bdpcm_chroma_flag of the current chroma block 31, the value of the tu_cb_coded_flag of the chroma block 32 located above the current chroma block 31, the value of the tu_cb_coded_flag of the chroma block 33 located left to the current chroma block 31, and the index value ctxIdx of the context model of the current chroma block 31 is as follows:
[0165] ctxIdx =!intra bdpcm chroma flag? Neibor CbfcbFlag Sum : Neibor CbfcbFlag Sum + 3
[0166] That is, in some embodiments of the present application, the corresponding relationship between the value of intra bdpcm chroma flag of the current chroma block, the sum of the values of tu cb coded flag of the coded chroma blocks adjacent to the current chroma block, Neibor CbfcbFlag Sum, and the index value of the context model of the current chroma block 31, ctxIdx, can be shown in Table 8 as follows:
[0167] Table 8: Value standard of index value of context model
[0168] In summary, in some embodiments of the present application, the mapping relationship between the context model index ctxId, the initialization type initType, the value of intra bdpcm chroma flag, and the sum of the values of tu cb coded flag of the coded chroma blocks adjacent to the current chroma block, Neibor CbfcbFlag Sum, can be shown in Table 9 as follows:
[0169] Table 9: Context model selection of tu cb coded flag
[0170] Step C, arithmetically encoding the value of tu cb coded flag of the current chroma block according to the index value of the context model of the current chroma block, and updating the model probability of the context model.
[0171] The implementation of arithmetically encoding the value of tu cb coded flag of the current chroma block according to the index value of the context model of the current chroma block, and updating the model probability of the context model can refer to the above steps ⑶ and ⑷, and will not be described in detail here to avoid repetition.
[0172] In some embodiments, the method can further include: obtaining the initial value of the context model of tu cb coded flag when a frame image starts to be encoded and the probability of the context model of tu cb coded flag when the frame image ends to be encoded, and if the difference between the probability of the context model when the encoding starts and the probability of the context model when the encoding ends is less than a first threshold, then when the next frame image starts to be encoded, the context model of tu cb coded flag is not initialized, but the context model of tu cb coded flag when the frame image ends to be encoded is used.
[0173] The above embodiments perform context classification on the chroma block using the chroma bdpcm mode and the chroma block not using the chroma bdpcm mode according to the tu_cb_coded_flag of the upper chroma block and the left chroma block, and 6 context models can be included under the same initial type. In other embodiments, the context classification manner can be performed only on the chroma block not using the chroma bdpcm mode, and only one column of fixed contexts is set for the chroma block using the chroma bdpcm mode. That is, 4 columns of context models are set for the tu_cb_coded_flag under the same initial type, and the first 3 columns are for the case of not using the chroma bdpcm, and the last column is for the case of using the chroma bdpcm. Specifically, the context model selection of the tu_cb_coded_flag can be as shown in Table 10:
[0174] Table 10 Context model selection of tu_cb_coded_flag
[0175] In the above embodiments, when calculating the sum Neibor_CbfcbFlag_Sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block, the value of the intra_bdpcm_chroma_flag of the coded chroma block adjacent to the current chroma block is not considered. In other embodiments, the value of the intra_bdpcm_chroma_flag of the coded chroma block adjacent to the current chroma block can be obtained first, and when calculating the sum Neibor_CbfcbFlag_Sum of the values of the tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block, only the values of the tu_cb_coded_flag of the adjacent coded chroma blocks having the same value of the intra_bdpcm_chroma_flag of the current chroma block are summed.
[0176] Some embodiments of the present application provide a video decoding method, which can include the following steps with reference to FIG. 4.
[0177] [According to Rule 91 Correction 06.11.2025] S41, entropy encoding data of a first syntax element of a first chroma block is obtained.
[0178] The first syntax element is a syntax element identifying whether the transform block of the chroma block is a non-zero block. That is, the first syntax element is tu_cb_coded_flag.
[0179] In some embodiments, entropy coding data of a first syntax element of a first chroma block can be obtained from a video bitstream according to a standard syntax element structure. In some embodiments, the first chroma block is a chroma block corresponding to a blue component Cb of a current coding block. In other embodiments, the first chroma block is a chroma block corresponding to a red component Cr of the current coding block.
[0180] S42, obtaining spatial domain information of the first chroma block according to neighboring decoded chroma blocks of the first chroma block.
[0181] In some embodiments, the neighboring decoded chroma blocks of the first chroma block refer to chroma blocks that are adjacent to the first chroma block and have been decoded before the first chroma block is decoded.
[0182] In some embodiments, the neighboring decoded chroma blocks of the first chroma block can include chroma blocks above the first chroma block and / or chroma blocks left to the first chroma block; and the step S42 of obtaining the spatial domain information of the first chroma block according to the neighboring decoded chroma blocks of the first chroma block can include obtaining the spatial domain information of the first chroma block according to the chroma blocks above the first chroma block and / or the chroma blocks left to the first chroma block.
[0183] In some embodiments, the step S42 of obtaining the spatial domain information of the first chroma block according to the neighboring decoded chroma blocks of the first chroma block can include obtaining the spatial domain information of the first chroma block according to whether a transform block of the neighboring decoded chroma block is a non-zero block.
[0184] S43, determining a target context model according to the spatial domain information of the first chroma block.
[0185] In some embodiments, determining the target context model according to the spatial domain information of the first chroma block can include selecting the target context model from a pre-set context model set according to the spatial domain information of the first chroma block.
[0186] In some embodiments, determining the target context model according to the spatial domain information of the first chroma block can include determining the target context model according to the spatial domain information of the first chroma block, an initialization type (initType) of the first syntax element of the first chroma block, and a value of a second syntax element of the first chroma block.
[0187] The second syntax element is a syntax element that identifies whether a block-based differential pulse code modulation mode is used for the chroma block. That is, the second syntax element is intra bdpcm chroma flag.
[0188] S44, obtaining the value of the first syntax element of the first chroma block based on the target context model and the entropy coding data of the first syntax element of the first chroma block.
[0189] The video decoding method provided by the above embodiment, when obtaining the entropy coding data of the first syntax element of the first chroma block, and obtaining the value of the first syntax element of the first chroma block according to the entropy coding data of the first syntax element of the first chroma block, first obtains the spatial domain information of the first chroma block according to the adjacent decoded chroma block of the first chroma block, then determines the target context model according to the spatial domain information of the first chroma block, and finally obtains the value of the first syntax element of the first chroma block based on the target context model and the entropy coding data of the first syntax element of the first chroma block. Since the video decoding method provided by the above embodiment obtains the spatial domain information of the first chroma block according to the adjacent decoded chroma block, and determines the context model for entropy decoding the value of the first syntax element of the first chroma block according to the spatial domain information of the first chroma block, the above embodiment can determine the context model for entropy decoding the first syntax element according to the spatial characteristics of the first syntax element, thereby improving the accuracy of the context model for entropy decoding the first syntax element.
[0190] As an extension and refinement of the above embodiment, some embodiments of the present application provide another video decoding method, which can include the following steps with reference to FIG. 5:
[0191] S501, obtaining the entropy coding data of the first syntax element of the first chroma block. The first syntax element is a syntax element indicating whether the transform block of the chroma block is a non-zero block.
[0192] S502, obtaining the value of the first syntax element of the adjacent decoded chroma block. That is, obtaining the value of tu_cb_coded_flag of the adjacent decoded chroma block.
[0193] S503, obtaining the spatial domain information of the first chroma block according to the value of the first syntax element of the adjacent decoded chroma block.
[0194] In some embodiments, the above step S503 (obtaining the spatial domain information of the first chroma block according to the value of the first syntax element of the adjacent decoded chroma block) can include summing the value of the first syntax element of the adjacent decoded chroma block to obtain the spatial domain information of the first chroma block.
[0195] For example, the adjacent decoded chroma blocks can include a chroma block above the first chroma block and a chroma block left to the first chroma block, and the value of the first syntax element of the chroma block above the first chroma block is 1, and the value of the first syntax element of the chroma block left to the first chroma block is 1, and it can be determined that the spatial information of the first chroma block is 2.
[0196] For example, the adjacent decoded chroma blocks can include only a chroma block left to the first chroma block, and the value of the first syntax element of the chroma block above the first chroma block is 1, and it can be determined that the spatial information of the first chroma block is 1.
[0197] For example, the adjacent decoded chroma blocks can include a chroma block above the first chroma block and a chroma block left to the first chroma block, and the value of the first syntax element of the chroma block above the first chroma block is 0, and the value of the first syntax element of the chroma block left to the first chroma block is 0, and it can be determined that the spatial information of the first chroma block is 0.
[0198] In some embodiments, the step S503 of acquiring the spatial information of the first chroma block according to the value of the first syntax element of the adjacent decoded chroma blocks can include the following steps 5031 and 5032.
[0199] The step 5031 acquires the value of the second syntax element of the adjacent decoded chroma blocks.
[0200] The second syntax element is a syntax element identifying whether the chroma block uses a block-based differential pulse code modulation mode. That is, it is determined whether the adjacent decoded chroma blocks use a block-based differential pulse code modulation mode.
[0201] The step 5032 sums the value of the first syntax element of the chroma block whose value of the second syntax element is the same as that of the first chroma block in the adjacent decoded chroma blocks to acquire the spatial information of the first chroma block.
[0202] For example, the value of the second syntax element of the first chroma block is 0, the adjacent decoded chroma blocks can include a chroma block above the first chroma block and a chroma block left to the first chroma block, the value of the first syntax element of the chroma block above the first chroma block is 1, the value of the second syntax element of the chroma block above the first chroma block is 0, the value of the first syntax element of the chroma block left to the first chroma block is 1, and the value of the second syntax element of the chroma block above the first chroma block is 1, and since only the chroma block above the first chroma block has the same value of the second syntax element as the first chroma block, the spatial information of the first chroma block is 1.
[0203] S504, obtaining an initialization type (initType) of the first syntax element of the first chroma block.
[0204] In some embodiments, the implementation of obtaining the initialization type of the first syntax element of the first chroma block can comprise: determining the value of the syntax element sh_cabac_init_flag according to the value of the syntax element pps_cabac_init_present_flag, and determining the initialization type of the first syntax element of the first chroma block according to the value of the syntax element sh_cabac_init_flag and the frame type (I type or B type or P type) corresponding to the first chroma block.
[0205] In some embodiments, the implementation of obtaining the initialization type of the first syntax element of the first chroma block can comprise:
[0206] If the frame type corresponding to the first chroma block is I type, the initialization type of the first syntax element of the first chroma block is determined as the first initialization type; if the frame type corresponding to the first chroma block is P type and the value of sh_cabac_init_flag is 1, the initialization type of the first syntax element of the first chroma block is determined as the second initialization type; if the frame type corresponding to the first chroma block is P type and the value of sh_cabac_init_flag is 0, the initialization type of the first syntax element of the first chroma block is determined as the third initialization type; if the frame type corresponding to the first chroma block is B type and the value of sh_cabac_init_flag is 1, the initialization type of the first syntax element of the first chroma block is determined as the third initialization type; if the frame type corresponding to the first chroma block is B type and the value of sh_cabac_init_flag is 0, the initialization type of the first syntax element of the first chroma block is determined as the second initialization type.
[0207] S505, obtaining the value of the second syntax element of the first chroma block.
[0208] The second syntax element is a syntax element for identifying whether the chroma block uses a block-based differential pulse code modulation mode.
[0209] In some embodiments, when the first chroma block does not use the block-based differential pulse code modulation mode, the value of the second syntax element of the first chroma block is 0; when the first chroma block does not use the block-based differential pulse code modulation mode, the value of the second syntax element of the first chroma block is 1.
[0210] S506, determining a target index set according to the initialization type.
[0211] In some embodiments, the initialization type is a first initialization type, a second initialization type, or a third initialization type, and the first initialization type, the second initialization type, and the third initialization type correspond to a set of context model indexes respectively; and the determining the target index set according to the initialization type can include: when the initialization type is the first initialization type, determining the set of context model indexes corresponding to the first initialization type as the target index set; when the initialization type is the second initialization type, determining the set of context model indexes corresponding to the second initialization type as the target index set; and when the initialization type is the third initialization type, determining the set of context model indexes corresponding to the third initialization type as the target index set.
[0212] As shown in Table 6 above, the set of context model indexes corresponding to the first initialization type (initType=0) is {0, 1, 2, 3, 4, 5}, the set of context model indexes corresponding to the second initialization type (initType=1) is {6, 7, 8, 9, 10, 11}, and the set of context model indexes corresponding to the third initialization type (initType=3) is {12, 13, 14, 15, 16, 17}, so when the initialization type is the first initialization type, the target index set is {0, 1, 2, 3, 4, 5}, when the initialization type is the second initialization type, the target index set is {6, 7, 8, 9, 10, 11}, and when the initialization type is the third initialization type, the target index set is {12, 13, 14, 15, 16, 17}.
[0213] As shown in Table 10 above, the set of context model indexes corresponding to the first initialization type (initType=0) is {0, 1, 2, 3}, the set of context model indexes corresponding to the second initialization type (initType=1) is {4, 5, 6, 7}, and the set of context model indexes corresponding to the third initialization type (initType=2) is {8, 9, 10, 11}, so when the initialization type is the first initialization type, the target index set is {0, 1, 2, 3}, when the initialization type is the second initialization type, the target index set is {4, 5, 6, 7}, and when the initialization type is the third initialization type, the target index set is {8, 9, 10, 11}.
[0214] S507, selecting a target model index from the target index set according to the spatial information of the first chroma block and the value of the second syntax element of the first chroma block.
[0215] In some embodiments, the target index set can include six context model indexes (as shown in Table 6). The step S507 (selecting a target model index from the target index set according to the spatial information of the first chroma block and the value of the second syntax element of the first chroma block) can include:
[0216] When the value of the second syntax element of the first chroma block is a value identifying that the first chroma block does not use the block-based differential pulse code modulation mode, the target model index is selected from the first three context model indexes of the target index set according to the spatial information of the first chroma block.
[0217] When the value of the second syntax element of the first chroma block is a value identifying that the first chroma block uses the block-based differential pulse code modulation mode, the target model index is selected from the last three context model indexes of the target index set according to the spatial information of the first chroma block.
[0218] That is, if intra bdpcm chroma flag = 0, the target model index is selected from the first three context model indexes of the target index set according to the spatial information of the first chroma block, and if intra bdpcm chroma flag = 1, the target model index is selected from the last three context model indexes of the target index set according to the spatial information of the first chroma block.
[0219] For example, when initType = 2, if intra bdpcm chroma flag = 0, the target model index is selected from {12, 13, 14} according to the spatial information of the first chroma block, and if intra bdpcm chroma flag = 1, the target model index is selected from {15, 16, 17} according to the spatial information of the first chroma block.
[0220] In some embodiments, selecting the target model index from the first three context model indexes of the target index set according to the spatial information of the first chroma block can include: when the spatial information of the first chroma block is m, the (m+1)th context model index in the target index set is selected as the target model index; 0≤m≤2.
[0221] Wherein, 0≤m≤2 means that m≥0 and m≤2. Since the spatial information of the first chroma block is the sum of the values of at least one first syntax element, m is an integer, so m is 0 or 1 or 2.
[0222] That is, when the spatial domain information of the first chroma block is 0, the first context model index in the target index set is selected as the target model index; when the spatial domain information of the first chroma block is 1, the second context model index in the target index set is selected as the target model index; and when the spatial domain information of the first chroma block is 2, the third context model index in the target index set is selected as the target model index.
[0223] In some embodiments, selecting the context model index corresponding to the first syntax element of the first chroma block from the last three context model indexes of the target index set according to the spatial domain information of the first chroma block can include: when the spatial domain information of the first chroma block is m, the m+4th context model index in the target index set is selected as the context model index corresponding to the first syntax element of the first chroma block, 0≤m≤2.
[0224] That is, when the spatial domain information of the first chroma block is 0, the fourth context model index in the target index set is selected as the target model index; when the spatial domain information of the first chroma block is 1, the fifth context model index in the target index set is selected as the target model index; and when the spatial domain information of the first chroma block is 2, the sixth context model index in the target index set is selected as the target model index.
[0225] In some embodiments, the target index set can include four context model indexes (as shown in Table 10). The step S507 (selecting a target model index from the target index set according to the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block) can include:
[0226] When the value of the second syntax element of the first chroma block is a value identifying that the first chroma block does not use a block-based differential pulse code modulation mode, selecting the target model index from the first three context model indexes of the target index set according to the spatial domain information of the first chroma block;
[0227] When the value of the second syntax element of the first chroma block is a value identifying that the first chroma block uses a block-based differential pulse code modulation mode, the fourth context model index in the target index set is selected as the target model index.
[0228] Similarly, selecting the target model index from the first three context model indexes of the target index set according to the spatial domain information of the first chroma block can include: when the spatial domain information of the first chroma block is m, the m+1th context model index in the target index set is selected as the target model index; 0≤m≤2.
[0229] That is, in the case of intra bdpcm chroma flag = 0, when the spatial information of the first chroma block is 0, the first context model index in the target index set is selected as the target model index; when the spatial information of the first chroma block is 1, the second context model index in the target index set is selected as the target model index; when the spatial information of the first chroma block is 2, the third context model index in the target index set is selected as the target model index; in the case of intra bdpcm chroma flag = 1, when the spatial information of the first chroma block is 0 or 1 or 2, the fourth context model index in the target index set is selected as the target model index.
[0230] S508, determining the target context model according to the target model index.
[0231] In some embodiments, the above-mentioned S508 (determining the target context model according to the target model index) can include steps 5801 and 5082 as follows:
[0232] Step 5081, obtaining the initial value and the update rate of the target context model according to the target model index.
[0233] In some embodiments, the initial value (initValue) of the target context model is 35; and the update rate (shiftIdx) of the target context model is 8.
[0234] Step 5082, constructing the target context model according to the initial value and the update rate of the target context model.
[0235] In some embodiments, constructing the target context model according to the initial value and the update rate of the target context model can comprise calculating model probabilities pStateIdx0 and pStateIdx1 of the target context model according to an initial value (initValue) of the target context model: slopeIdx = initValue » 3 (11) offsetIdx = initValue (12) m = slopeIdx - 4 (13) n = (offsetIdx · 18) + 1 (14) preCtxState = Clip3(1, 127, ((m · (Clip3(0, 63, SliceQPy) - 16)) » 1) + n) (14) pStateIdx0 = preCtxState 3 (15) pStateIdx1 = preCtxState 7 (16)
[0236] wherein SliceQPy is a quantization parameter of the luma signal.
[0237] In some embodiments, determining the target context model according to the target model index can comprise reading the target context model according to the target model index.
[0238] S509, taking the target context model as a context model of the CABAC algorithm, and performing arithmetic decoding on entropy encoded data of a first syntax element of the first chroma block by the CABAC algorithm to obtain a value of the first syntax element of the first chroma block.
[0239] The implementation of performing arithmetic decoding on the entropy encoded data of the first syntax element of the first chroma block by the CABAC algorithm can refer to the above step b, and will not be described in detail here to avoid repetition.
[0240] S510, updating the target context model according to the value of the first syntax element of the first chroma block.
[0241] That is, updating the probability states pStateIdx0 and pStateIdx1 of the target context model used according to the value of tu_cb_coded_flag of the first chroma block.
[0242] In some embodiments, the video decoding method provided by some embodiments of the present application can further include: determining a context model corresponding to a second chroma block according to the target context model; wherein the first chroma block and the second chroma block are two chroma components corresponding to the same coding block.
[0243] In some embodiments, the first chroma block is a chroma block corresponding to a Cb component, and the second chroma block is a chroma block corresponding to a Cr component.
[0244] That is, according to the video decoding method provided by some embodiments of the present application, a target context model corresponding to a chroma block corresponding to a blue chroma component of a coding block is obtained, a value of a first syntax element of the first chroma block is obtained based on the target context model and entropy coding data of the first syntax element of the first chroma block, and a context model corresponding to a chroma block corresponding to a red chroma component of the coding block is determined according to the determined target context model.
[0245] In some embodiments, the determining a context model corresponding to a second chroma block according to the target context model can include: determining the target context model as the context model corresponding to the second chroma block.
[0246] After determining a context model corresponding to a second chroma block according to the target context model, the video decoding method provided by some embodiments of the present application can further include:
[0247] obtaining a value of a first syntax element of the second chroma block based on the context model corresponding to the second chroma block and entropy coding data of the first syntax element of the second chroma block.
[0248] Some embodiments of the present application provide a video decoding method, which can include the following steps with reference to FIG. 6:
[0249] S61, obtaining spatial domain information of the first chroma block according to neighboring coded chroma blocks of the first chroma block.
[0250] The implementation of the above step S61 can refer to the implementation of the above step S42, except that in step S42, the spatial domain information of the first chroma block is obtained according to neighboring decoded chroma blocks of the first chroma block, while in step S61, the spatial domain information of the first chroma block is obtained according to neighboring coded chroma blocks of the first chroma block. In addition, based on the order of coding and decoding, the neighboring decoded chroma blocks of the first chroma block in the decoding process and the neighboring coded chroma blocks of the first chroma block in the coding process are the same chroma blocks.
[0251] S62, determining a target context model according to the spatial domain information of the first chroma block.
[0252] The implementation of the target context model according to the spatial domain information of the first chroma block can refer to the implementation of the target context model according to the spatial domain information of the first chroma block in the video decoding method described above, and details are not described herein again to avoid repetition.
[0253] S63, entropy encode a value of the first syntax element of the first chroma block based on the target context model, to obtain entropy encoded data of the first syntax element of the first chroma block.
[0254] The first syntax element is a syntax element identifying whether a transform block of a chroma block is a non-zero block.
[0255] The video encoding method provided by the above embodiments first acquires spatial domain information of a first chroma block according to a neighboring coded chroma block of the first chroma block, then determines a target context model according to the spatial domain information of the first chroma block, and then entropy encodes a value of a first syntax element of the first chroma block based on the target context model, to obtain entropy encoded data of the first syntax element of the first chroma block. Since the video encoding method provided by the above embodiments acquires spatial domain information of a first chroma block according to a neighboring coded chroma block of the first chroma block, and determines a context model for entropy encoding a value of a first syntax element of the first chroma block according to the spatial domain information of the first chroma block, the above embodiments can determine a context model for entropy encoding the first syntax element by combining the spatial characteristics of the first syntax element, thereby improving the accuracy of the context model for entropy encoding the first syntax element.
[0256] Some embodiments of the present application also provide a video decoding device. Referring to FIG. 7, the video decoding device 700 can include:
[0257] A first obtaining module 71 is configured to obtain entropy encoded data of a first syntax element of a first chroma block. The first syntax element is a syntax element identifying whether a transform block of a chroma block is a non-zero block.
[0258] A second obtaining module 72 is configured to acquire spatial domain information of the first chroma block according to a neighboring decoded chroma block of the first chroma block.
[0259] A determining module 73 is configured to determine a target context model according to the spatial domain information of the first chroma block.
[0260] An entropy decoding module 74 is configured to obtain a value of the first syntax element of the first chroma block based on the target context model and the entropy encoded data of the first syntax element of the first chroma block.
[0261] The video decoding apparatus provided in the embodiments can perform the video decoding method provided in any of the embodiments, and has similar implementation principles and technical effects, which will not be described here.
[0262] Some embodiments of the present application provide a video encoding apparatus. Referring to FIG. 8, the video encoding apparatus 800 can include:
[0263] The obtaining unit 81 is configured to obtain the spatial domain information of the first chroma block according to a neighboring coded chroma block of the first chroma block.
[0264] The determining unit 82 is configured to determine a target context model according to the spatial domain information of the first chroma block.
[0265] The entropy encoding unit 83 is configured to entropy encode a value of a first syntax element of the first chroma block based on the target context model to obtain entropy encoded data of the first syntax element of the first chroma block, the first syntax element being a syntax element identifying whether a transform block of a chroma block is a non-zero block.
[0266] The video encoding apparatus provided in the embodiments can perform the video encoding method provided in any of the embodiments, and has similar implementation principles and technical effects, which will not be described here.
[0267] Some embodiments of the present application provide an electronic device. The electronic device can include:
[0268] The memory is configured to store a computer program.
[0269] The processor is configured to cause the video decoding apparatus to implement the video decoding method or the video encoding method described in any of the embodiments when the computer program is invoked.
[0270] Some embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which, when executed by a computing device, causes the computing device to implement the video decoding method described in any of the embodiments or the video decoding method described in any of the embodiments.
[0271] Some embodiments of the present application provide a computer program product, which, when executed on a computer, causes the computer to implement the video decoding method described in any of the embodiments or the video decoding method described in any of the embodiments.
[0272] Some embodiments of the present application provide a chip, which comprises a memory and a processor, the processor can be a logic circuit, an integrated circuit or a general processor, and the memory stores computer instructions, the processor can realize the video decoding method in any of the above embodiments or the video decoding method in any of the above embodiments by reading the computer instructions stored in the memory.
[0273] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
[0274] For the convenience of explanation, the above description has been made in combination with specific embodiments. However, the above exemplary discussion is not intended to exhaust or limit the embodiments to the specific forms disclosed above. Various modifications and variations can be derived according to the above teachings. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different modified embodiments suitable for specific use considerations.
Claims
1. A method of video decoding, the method comprising: The method comprises: obtaining entropy coding data of a first syntax element of a first chroma block; the first syntax element is a syntax element identifying whether a transform block of a chroma block is a non-zero block; obtaining spatial domain information of the first chroma block according to neighboring decoded chroma blocks of the first chroma block; determining a target context model according to the spatial domain information of the first chroma block; obtaining a value of the first syntax element of the first chroma block based on the target context model and the entropy coding data of the first syntax element of the first chroma block.
2. The method of claim 1, wherein, The obtaining of the spatial domain information of the first chroma block according to the neighboring decoded chroma blocks of the first chroma block comprises: obtaining the spatial domain information of the first chroma block according to chroma blocks located above the first chroma block and / or chroma blocks located on the left side of the first chroma block.
3. The method of claim 1, wherein, The obtaining of the spatial domain information of the first chroma block according to the neighboring decoded chroma blocks of the first chroma block comprises: obtaining values of the first syntax element of the neighboring decoded chroma blocks; obtaining the spatial domain information of the first chroma block according to the values of the first syntax element of the neighboring decoded chroma blocks.
4. The method of claim 3, wherein, The obtaining of the spatial domain information of the first chroma block according to the values of the first syntax element of the neighboring decoded chroma blocks comprises: summing the values of the first syntax element of the neighboring decoded chroma blocks to obtain the spatial domain information of the first chroma block.
5. The method of claim 3, wherein, The obtaining of the spatial domain information of the first chroma block according to the values of the first syntax element of the neighboring decoded chroma blocks comprises: obtaining values of second syntax elements of the neighboring decoded chroma blocks; the second syntax elements are syntax elements identifying whether a chroma block uses a block-based differential pulse code modulation mode; summing the values of the first syntax element of the chroma blocks whose values of the second syntax elements are the same as the first chroma block to obtain the spatial domain information of the first chroma block.
6. The method of claim 3, wherein, The determining of the target context model according to the spatial domain information of the first chroma block comprises: determining the target context model according to the spatial domain information of the first chroma block, an initialization type of the first syntax element of the first chroma block, and a value of a second syntax element of the first chroma block; wherein the second syntax element is a syntax element identifying whether a chroma block uses a block-based differential pulse code modulation mode.
7. The method of claim 6, wherein, The determining of the target context model according to the spatial domain information of the first chroma block, the initialization type of the first syntax element of the first chroma block, and the value of the second syntax element of the first chroma block comprises: determining a target index set according to the initialization type; selecting a target model index from the target index set according to the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block; determining the target context model according to the target model index.
8. The method of claim 7, wherein, The target index set comprises six context model indexes, and the selecting of the target model index from the target index set according to the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block comprises: when the value of the second syntax element of the first chroma block is a value identifying that the first chroma block does not use the block-based differential pulse code modulation mode, the target model index is selected from the first three context model indexes of the target index set according to the spatial information of the first chroma block; when the value of the second syntax element of the first chroma block is a value identifying that the first chroma block uses the block-based differential pulse code modulation mode, the target model index is selected from the last three context model indexes of the target index set according to the spatial information of the first chroma block.
9. The method of claim 7, wherein, The target index set comprises four context model indexes, and the selection of the context model index corresponding to the first syntax element of the first chroma block from the target index set according to the spatial information of the first chroma block and the value of the second syntax element of the first chroma block comprises: when the value of the second syntax element of the first chroma block is a value identifying that the first chroma block does not use the block-based differential pulse code modulation mode, the target model index is selected from the first three context model indexes of the target index set according to the spatial information of the first chroma block; when the value of the second syntax element of the first chroma block is a value identifying that the first chroma block uses the block-based differential pulse code modulation mode, the fourth context model index in the target index set is selected as the target model index.
10. The method according to claim 8 or 9, characterized in that, The selection of the target model index from the first three context model indexes of the target index set according to the spatial information of the first chroma block comprises: when the spatial information of the first chroma block is m, the m+1th context model index in the target index set is selected as the target model index, 0≤m≤2.
11. The method of claim 9, wherein, The selection of the context model index corresponding to the first syntax element of the first chroma block from the last three context model indexes of the target index set according to the spatial information of the first chroma block comprises: when the spatial information of the first chroma block is m, the m+4th context model index in the target index set is selected as the context model index corresponding to the first syntax element of the first chroma block, 0≤m≤2.
12. The method of claim 7, wherein, The initialization type is a first initialization type, a second initialization type or a third initialization type, and the first initialization type, the second initialization type and the third initialization type correspond to a context model index set respectively; The determination of the target index set according to the initialization type comprises: when the initialization type is the first initialization type, the context model index set corresponding to the first initialization type is determined as the target index set; when the initialization type is the second initialization type, the context model index set corresponding to the second initialization type is determined as the target index set; when the initialization type is the first initialization type, the context model index set corresponding to the third initialization type is determined as the target index set.
13. The method of claim 7, wherein, The target context model is determined according to the target model index, and the target context model comprises: An initial value and an update rate of the target context model are obtained according to the target model index; The target context model is constructed according to the initial value and the update rate of the target context model.
14. The method of claim 13, wherein, The initial value of the target context model is 35, and the update rate of the target context model is 8.
15. The method of claim 1, wherein, The value of the first syntax element of the first chroma block is obtained according to the entropy encoding data of the first syntax element of the first chroma block and the target context model, and the target context model comprises: The target context model is used as a context model of a context-based adaptive binary arithmetic coding (CABAC) algorithm, and the value of the first syntax element of the first chroma block is obtained by performing arithmetic decoding on the entropy encoding data of the first syntax element of the first chroma block according to the CABAC algorithm.
16. The method of claim 15, wherein, After the value of the first syntax element of the first chroma block is obtained, the method further comprises: The target context model is updated according to the value of the first syntax element of the first chroma block.
17. The method of claim 1, wherein, The method further comprises: A context model corresponding to a second chroma block is determined according to the target context model, and the first chroma block and the second chroma block are two chroma blocks corresponding to two chroma components of the same coding block. The method comprises:
18. A method of video encoding, comprising: Spatial domain information of the first chroma block is obtained according to adjacent coded chroma blocks of the first chroma block; A target context model is determined according to the spatial domain information of the first chroma block; The value of the first syntax element of the first chroma block is entropy encoded based on the target context model, so as to obtain the entropy encoding data of the first syntax element of the first chroma block, and the first syntax element is a syntax element for identifying whether a transform block of a chroma block is a non-zero block. The method comprises:
19. An apparatus for video decoding, the apparatus comprising: A first obtaining module is configured to obtain the entropy encoding data of the first syntax element of the first chroma block; The first syntax element is a syntax element for identifying whether a transform block of a chroma block is a non-zero block; A second obtaining module is configured to obtain the spatial domain information of the first chroma block according to adjacent coded chroma blocks of the first chroma block; A determining module is configured to determine a target context model according to the spatial domain information of the first chroma block; An entropy decoding module is configured to obtain the value of the first syntax element of the first chroma block based on the target context model and the entropy encoding data of the first syntax element of the first chroma block.
Citation Information
Patent Citations
Method and apparatus for video coding
CN113632471A
CABAC context modeling with information from spatial neighbors
CN117203961A
Video frame encoding and decoding
US20050169374A1
Variable length coding of coded block pattern (CBP) in video compression
US20110249754A1
Simplification of significance map coding
US20130195182A1