Video decoding method, video encoding method and apparatus
By obtaining the spatial information of the chroma block to determine the context model, the problem of inaccurate entropy encoding of tu_cb_coded_flag in the existing technology is solved, thus improving the efficiency and quality of video encoding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HISENSE VISUAL TECH CO LTD
- Filing Date
- 2024-07-05
- Publication Date
- 2026-06-26
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 obtaining the spatial information of the adjacent decoded chroma blocks of the first chroma block, the target context model is determined, thereby improving the entropy coding accuracy of tu_cb_coded_flag.
The entropy coding accuracy of tu_cb_coded_flag has been improved, thus enhancing the efficiency and quality of video encoding.
Smart Images

Figure CN121334401B_ABST
Abstract
Description
Technical Field
[0001] Some embodiments of this application relate to the field of video encoding and decoding technology. More specifically, they relate to a video decoding method, a video encoding method, and an apparatus. Background Technology
[0002] With the development of the information age, people obtain information by watching videos on the internet, and video transmission has become an important means of communication. Transmitting unprocessed videos directly over the network would consume a large amount of network bandwidth and data. Therefore, images or videos are encoded before transmission to reduce their file size.
[0003] Entropy coding is one of the main processes in video coding. It losslessly compresses information such as transform coefficients, intra-frame coding information, and inter-frame coding information generated during video coding, making the encoded result as close as possible to the entropy of the data, thereby achieving the purpose of data compression. Currently, the value of the syntax element tu_cb_coded_flag, which indicates whether a chroma transform block is a non-zero block, is generally entropy-encoded using Context-based Adaptive Binary Arithmetic Coding (CABAC). When entropy-encoding the value of tu_cb_coded_flag using CABAC, the context model selection is based on the initialization type of tu_cb_coded_flag and whether the current chroma block uses the bdpcmchroma mode (the value of the syntax element intra_bdpcm_chroma_flag). However, selecting the context model solely based on the initialization type of tu_cb_coded_flag and whether the bdpcm chroma mode is used does not take into account the spatial characteristics of tu_cb_coded_flag, which may lead to inaccurate context models used to encode the value of tu_cb_coded_flag. Summary of the Invention
[0004] Exemplary embodiments of this application provide a video decoding method, a video encoding method, and an apparatus for improving the accuracy of a context model used for value entropy encoding of tu_cb_coded_flag.
[0005] The technical solutions provided by some embodiments of this application are as follows:
[0006] In a first aspect, some embodiments of this application provide a video decoding method, including:
[0007] Obtain the entropy-encoded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block;
[0008] The spatial information of the first chroma block is obtained from the adjacent decoded chroma blocks of the first chroma block;
[0009] The target context model is determined based on the spatial domain information of the first chroma block;
[0010] Based on the target context model and the entropy-encoded data of the first syntax element of the first chroma block, the value of the first syntax element of the first chroma block is obtained.
[0011] Secondly, some embodiments of this application provide a video encoding method, including:
[0012] The spatial information of the first chroma block is obtained from the adjacent encoded chroma blocks of the first chroma block;
[0013] The target context model is determined based on the spatial domain information of the first chroma block;
[0014] Based on the target context model, the value of the first syntax element of the first chroma block is entropy encoded to obtain the entropy encoded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block.
[0015] Thirdly, some embodiments of this application provide a video decoding apparatus, including:
[0016] The first acquisition module is used to acquire the entropy-encoded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block;
[0017] The second acquisition module is used to acquire the spatial information of the first chroma block based on the adjacent decoded chroma blocks of the first chroma block;
[0018] The determination module is used to determine the target context model based on the spatial domain information of the first chroma block;
[0019] The entropy decoding module is used to obtain the 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.
[0020] Fourthly, some embodiments of this application provide a video encoding apparatus, including:
[0021] The acquisition unit is used to acquire the spatial information of the first chroma block based on the adjacent encoded chroma blocks of the first chroma block;
[0022] The determining unit is used to determine the target context model based on the spatial domain information of the first chroma block;
[0023] An entropy coding unit is used to entropy code the value of the first syntax element of the first chroma block based on the target context model to obtain the entropy-coded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block.
[0024] Fifthly, some embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to implement the video encoding method of the first aspect or the video decoding method of the second aspect when executing the computer program.
[0025] Sixthly, some embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a computing device, causes the computing device to implement the video encoding method of the first aspect or the video decoding method of the second aspect.
[0026] In a seventh aspect, some embodiments of this application provide a computer program product that, when run on a computer, causes the computer to implement the video encoding method described in the first aspect or the video decoding method described in the second aspect.
[0027] As can be seen from the above technical solutions, when the video decoding method provided in some embodiments of this application obtains the entropy encoded data of the first syntax element of the first chroma block (identifying whether the transform block of the first chroma block is a non-zero block) and obtains the value of the first syntax element of the first chroma block based on the entropy encoded data of the first syntax element of the first chroma block, it first obtains the spatial domain information of the first chroma block based on the adjacent decoded chroma blocks, then determines the target context model based on the spatial domain information of the first chroma block, and then obtains the 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. Since the video decoding method provided in some embodiments of this application obtains the spatial domain information of the first chroma block based on the adjacent decoded chroma blocks and determines the context model for entropy decoding of the value of the first syntax element of the first chroma block based on the spatial domain information of the first chroma block, some embodiments of this application can combine the spatial effects of the first syntax element to determine the context model for entropy decoding of the first syntax element, thereby improving the accuracy of the context model for entropy decoding of the first syntax element. Attached Figure Description
[0028] To more clearly illustrate the implementation methods in some embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0029] Figure 1 The present application shows a schematic diagram of the structure of a video encoder in some embodiments;
[0030] Figure 2 The present application shows a schematic diagram of the structure of a video decoder in some embodiments;
[0031] Figure 3 A flowchart illustrating the process of determining the index value of the context model in some embodiments of this application is shown;
[0032] Figure 4 The following is a flowchart illustrating the steps of a video decoding method in some embodiments of this application;
[0033] Figure 5 The following flowcharts illustrate the steps of a video decoding method in other embodiments of this application;
[0034] Figure 6 The following is a flowchart illustrating the steps of a video encoding method in some embodiments of this application;
[0035] Figure 7 The present application shows a schematic diagram of the structure of a video decoding device in some embodiments;
[0036] Figure 8 A schematic diagram of the structure of a video encoding apparatus in some embodiments of this application is shown. Detailed Implementation
[0037] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0038] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0039] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0040] The use of phrases such as "some implementations" or "some embodiments" in the specification indicates that the described implementations or embodiments may include specific features, structures, or characteristics, but not every embodiment may necessarily include that specific feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same implementation. Additionally, when describing a specific feature, structure, or characteristic in connection with an embodiment, it is considered that implementing that feature, structure, or characteristic in connection with other implementations (whether explicitly described herein or not) is within the knowledge of those skilled in the art.
[0041] The use of phrases such as "some implementations" or "some embodiments" in the specification indicates that the described implementations or embodiments may include specific features, structures, or characteristics, but not every embodiment may necessarily include that specific feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same implementation. Additionally, when describing a specific feature, structure, or characteristic in connection with an embodiment, it is considered that implementing that feature, structure, or characteristic in connection with other implementations (whether explicitly described herein or not) is within the knowledge of those skilled in the art.
[0042] The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different elements. Terms such as "including" or "comprising" mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects.
[0043] In the embodiments of this application, "up", "down", "left", "right", etc. are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0044] This application relates to the field of video encoding and decoding technology. The following describes the video encoding and decoding framework of some embodiments of this application.
[0045] A video can be viewed as a sequence of multiple video frames (images). Video playback can be seen as displaying video frames in the order they appear in the sequence at a preset rate (e.g., 24 frames / second, 30 frames / second, 60 frames / second). Theoretically, the amount of data in a video is positively correlated with the resolution of its video frames; the higher the resolution of the video frames, the larger the amount of data in the video. If the pixel data of every single pixel in all video frames were directly stored in the video file, the amount of data would be enormous, making the video difficult to store and transmit. Video encoding and decoding were proposed to address this problem to some extent. Video decoding includes video encoding and video decoding. Video encoding can be understood as the process of compressing the original video frames, while video decoding can be understood as the process of reconstructing the video frames based on the compressed video data.
[0046] Reference Figure 1 As shown, Figure 1 This is a schematic diagram of the encoder structure provided in some embodiments of this application.
[0047] like Figure 1 As shown, in some embodiments, the encoder may include an encoding control module 101. The encoding control module 101 is used to perform overall control of the video encoder, including: encoding mode selection, encoding logic control, bitrate control, quantization step size control, etc.
[0048] like Figure 1 As shown, in some embodiments, the encoder may include an intra-prediction module 102. The intra-prediction module 102 is configured to perform intra-prediction based on reconstructed samples in the current image and send intra-encoding information to an entropy coding module. The intra-encoding information may include at least one of an intra-prediction mode, a Most Probable Mode (MPM) flag, and an MPM index. The intra-encoding information may also include information about reference samples.
[0049] like Figure 1 As shown, in some embodiments, the encoder may include an inter-frame prediction module 103. The inter-frame prediction module 103 performs inter-frame prediction to predict the current image using a reference image stored in the Decoded Picture Buffer (DPB). The inter-frame prediction module 103 may include a motion estimation unit 103a and a motion compensation unit 103b. The motion estimation unit 103a performs motion estimation (ME) to obtain a motion vector of the current region by referencing a specific region of the reconstructed reference image. The motion compensation unit 103b performs motion compensation using the motion vector values obtained from the motion estimation unit 103a.
[0050] like Figure 1As shown, in some embodiments, the encoder may include a transform module 104. The transform module 104 obtains transform coefficients by transforming a residual signal, which is the difference between the input video and the predicted signal generated by the intra-frame prediction module 102 or the inter-frame prediction module 103. In some embodiments, a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), or a wavelet transform may be used. DCT and DST perform the transform by dividing the input image signal into multiple blocks. During the transform, the compilation efficiency can vary depending on the distribution and characteristics of the values in the transformed region.
[0051] like Figure 1 As shown, in some embodiments, the encoder may include a quantization module 105. The quantization module 105 is used to quantize the transform coefficients output by the transform module 104 to obtain quantized transform coefficients.
[0052] like Figure 1 As shown, in some embodiments, the encoder may include an entropy coding module 106. The entropy coding module 106 is used to entropy code information such as the coding mode, prediction module, motion vector, and quantization transform coefficients output by the quantization module 105 to obtain the output bitstream corresponding to the input video.
[0053] like Figure 1 As shown, in some embodiments, the encoder may include an inverse quantization module 107. The inverse quantization module 107 is used to perform the inverse operation of the quantization module 105, inverse quantizing (scaling) the quantized transform coefficients.
[0054] like Figure 1 As shown, in some embodiments, the encoder may include an inverse transform module 108. The inverse transform module 108 is used to reconstruct residual information using the transform coefficient values output by the inverse quantization module 107.
[0055] like Figure 1 As shown, in some embodiments, the encoder may include a loop filter 109. The loop filter 109 is used to perform filtering operations to improve the quality of the reconstructed image and improve compilation efficiency. Exemplarily, the loop filter 109 may include a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter, etc. The image filtered by the loop filter 109 is output or stored in the decoded image buffer for use as a reference image.
[0056] Reference Figure 2 As shown, Figure 2 This is a schematic diagram of the decoder structure provided in some embodiments of this application.
[0057] like Figure 2 As shown, in some embodiments, the decoder may include an entropy decoding module 201. The entropy decoding module 201 performs entropy decoding on the input bitstream to extract transform coefficient information, intra-frame coding information, inter-frame coding information, and other information for each region. In some embodiments, the entropy decoding module 201 can obtain binary code for transform coefficient information for a specific region from the input bitstream. Furthermore, the entropy decoding module 201 obtains the quantized transform coefficients by performing inverse binarization on the binary code.
[0058] like Figure 2 As shown, in some embodiments, the decoder may include an inverse quantization module 202. The inverse quantization module 202 performs inverse quantization on the quantized transform coefficients output by the entropy decoding module 201.
[0059] like Figure 2 As shown, in some embodiments, the decoder may include an inverse transform module 203. The inverse transform module 203 is used to reconstruct the residual value using the inverse-quantized transform coefficients.
[0060] like Figure 2 As shown, in some embodiments, the decoder may include an intra-prediction module 204. The intra-prediction module 204 generates prediction blocks using intra-coding information and recovered samples from the current image. The intra-coding information may 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 for the current block using recovered samples located to the left and / or above the current block as reference samples.
[0061] like Figure 2 As shown, in some embodiments, the decoder may include a motion compensation module 205. The motion compensation module 205 is used to generate prediction blocks using a reference image and inter-frame coding information stored in the decoded image buffer. The inter-frame coding information may include a set of motion information for the current block (reference image index, motion vector information, etc.) for the reference block.
[0062] The decoder also reconstructs the original pixel values by adding the residual values obtained by the inverse transform module 203 to the prediction blocks obtained by the intra-prediction module 204 or the motion compensation module 205.
[0063] like Figure 2 As shown, in some embodiments, the decoder may include a loop filter 206. The loop filter 206 is used to perform filtering operations to improve the quality of the reconstructed image and improve compilation efficiency.
[0064] The entropy coding module in the encoder performs entropy coding, a lossless coding method that follows the principle of entropy without losing any information. Common entropy coding methods include Shannon coding, Huffman coding, Exponential Golomb coding, and arithmetic coding. In practice, a suitable entropy coding model can be selected based on the distribution of the symbols to be encoded.
[0065] In some embodiments, the entropy coding module can be encoded using Context-based Adaptive Binary Arithmetic Coding (CABAC). The core algorithm of CABAC is adaptive binary arithmetic coding, which combines the context model with adaptive binary arithmetic coding, performing arithmetic coding based on the probability model and the binary values of the syntax elements, and then updating the context model.
[0066] The input to a CABAC encoder is the value of the syntax element to be encoded. The value of the syntax element can be binary or non-binary. The output of a CABAC encoder is the encoded bits. The encoding process of a CABAC encoder may include the following steps 1 to 3:
[0067] Step 1: Binary conversion.
[0068] CABAC encodes the values of syntax elements in slice data. Before performing arithmetic encoding, these syntax elements need to be converted into binary strings suitable for binary arithmetic encoding in a certain way. This conversion process is called binarization.
[0069] It should be noted that step 1 is for the value of non-binary syntax elements. If the input of CABAC is the value of binary syntax elements, step 1 is skipped and execution starts directly from step 2.
[0070] CABAC's binary conversion algorithms include: Fixed-length Binary Conversion (FL), Truncated Rice (TR), Truncated Binary (TB), and the k-th order Exp-Golomb (EGK). CABAC selects different binary conversion methods based on the different probability distribution characteristics of the values of different syntax elements.
[0071] 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, if the value of a given syntax element is x and 0 ≤ x ≤ cMax, then the fixed-length binary symbol string of x is directly obtained by using the method of converting a decimal number into a binary number. The length of the fixed-length binary symbol string of x , where is the length of the binary symbol string denotes rounding up.
[0072] The truncated Rice code binary code is formed by concatenating a prefix string and a suffix string. The calculation formula for the prefix value P is: P = V >> R. Among them, if the value of P is less than (cMax >> R), the prefix string consists of P 1s and one 0, and the length is P + 1; if the value of P is greater than or equal to (cMax >> R), the prefix string consists of (cMax >> R) 1s, and the length is (cMax >> R). The calculation formula for the suffix value S is: S = V - (P << R), and the suffix string is the binary string of S, with a length of R. When the value V of the syntax element is greater than or equal to cMax, there is no suffix string. Among them, cMax is the maximum value of the syntax element to be binaryized, R is the Rice parameter, and V is the value of the syntax element to be binaryized.
[0073] The binary code of the K-order exponential Golomb code binarization is also formed by concatenating a prefix and a suffix. Among them, the prefix part consists of the unary code corresponding to the value of l(x) = log2(x / 2k + 1) ( ) = 2( / 2 + 1) ; the suffix part can be calculated by using the binary value of x + 2k(1 +<00,00194>( ) with a length of k + l(x) 2l(x)) + 2 (1 2 ( )).
[0074] Step 2, Context modeling.
[0075] The Versatile Video Coding (H.266 / VVC) standard employs a biprobabilistic model to predict the least probable symbol (LPS) probability for each context. The probabilistic prediction model of the H.266 / VVC standard is shown below:
[0076]
[0077]
[0078]
[0079] in, , Let be the update rate of the probabilities for the two models. , Let be the prediction probabilities of the two models in the biprobability model for the t-th iteration. The sign of the t-th iteration in the biprobability model. , The prediction probabilities of the two models in the biprobability model at the (t+1)th iteration.
[0080] That is, the probabilistic prediction model of the H.266 / VVC standard is to obtain the prediction probability of LPS by averaging the prediction probabilities obtained from the biprobability model.
[0081] To avoid multiplication operations, , Limited to Then we have:
[0082]
[0083] in, for of Bit-integer representation.
[0084] In the H.266 / VVC standard Therefore, the probabilistic prediction model for the H.266 / VVC standard can be:
[0085]
[0086] In the H.266 / VVC standard, each context model used by a syntax element is specified by a unique context index ctxId. Each context model involves two types of variables: the update rate shiftIdx, which controls the model's probability update rate, and the predicted probability state pStateIdx0 (in the probability prediction model). ) and pStateIdx1 (in the probabilistic prediction model) ).
[0087] Based on the value of the encoded binary symbol and the update rate shiftIdx, the probability states pStateIdx0 and pStateIdx1 are continuously updated using a probabilistic prediction model. Furthermore, the predicted probability pState of LPS is obtained by averaging the predicted probabilities obtained from the dual-probability model, as shown in the following formula:
[0088]
[0089]
[0090]
[0091]
[0092]
[0093] in, (in the probabilistic prediction model) )and (in the probabilistic prediction model) ) represent the predicted probabilities and The update rate; Encoded binary symbols; predicted probability and They are represented as 10-bit and 14-bit integers, respectively.
[0094] Furthermore, how to initialize the context model for the first binary symbol before encoding it is one of the key techniques in 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's probability state, and the specific formula is as follows:
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102] in, These are the quantization parameters for the brightness signal.
[0103] In some embodiments, corresponding weights can be added to pStateIdx0 and pStateIdx1 predicted by the biprobability model, and a mechanism can be set to fine-tune shift0 and shift1 based on the encoded symbol being 0 or 1.
[0104] The operation of deriving the probability of the result used for binary arithmetic encoding by introducing weights is as follows:
[0105]
[0106] Among them, From a predefined set The selected weights can predefine three different weights for each context model of I, B, and P type slices. The weights of I type slices are only allowed to be used for intra-frame slices, while the weights of B type slices and P type slices are selected based on the initialization type initType obtained by sh_cabac_init_flag. I type slices are slices that use only the current image for reconstruction, B type slices are slices that use at most two motion vectors and reference image indices, also known as bidirectional prediction slices, and P type slices are slices that use at most one motion vector and reference image index.
[0107] The CABAC used in the H.266 / VVC standard has two probabilistic states, which are updated using short and long windows respectively. The size of the long and short windows is specified by the shiftIdx item in the standard document, which controls the different update rates of the long and short windows. In the above embodiment, the size of the long and short windows is fine-tuned based on the initial value of shiftIdx according to the encoded sign being 0 or 1. The update range of both the long and short windows is -7 to 7, and the lower limit of the window size is set to 2.
[0108] Step 3: Binary arithmetic encoding.
[0109] Binary arithmetic coding performs arithmetic coding on each binary symbol after the value of the current syntax element is binaryized, according to its probability model parameters, to obtain the final output bitstream.
[0110] Binary arithmetic coding is based on recursive interval partitioning, saving the coding interval and its lower bound during the recursive process. The H.266 / VVC standard includes two coding methods: conventional coding and bypass coding. Conventional coding uses an adaptive probability model for encoding; bypass coding uses equal probability, and its probability state does not need to be updated.
[0111] In the H.266 / VVC standard, the input to a conventional encoder is a context model (shiftIdx, pStateIdx0, pStateIdx1) and the binary symbol to be encoded (Bin). The encoder's state consists of the current encoding range width (Range) and the range lower limit (Low). The initial value of Range is 510, and the initial value of the range lower limit (Low) is 0. The encoding process may include the following steps (1) to (4):
[0112] Step 1: Calculate the interval width corresponding to LPS. and .
[0113] Calculate the interval width corresponding to LPS and The formula is as follows:
[0114]
[0115]
[0116]
[0117]
[0118]
[0119] in, This represents the prediction probability with 5-bit precision, when When the predicted probability is greater than 0.5, pState is the predicted probability of MPS, and the XOR operation ( This keeps it at the predicted probability of LPS.
[0120] Step 2: Update the encoding range width (Range) and the lower limit (Low).
[0121] The formulas for updating the encoding interval width (Range) and lower limit (Low) are as follows:
[0122]
[0123] If Bin = LPS, then Low = Low + Range= ;
[0124] If Bin = MPS, then Low remains unchanged, Range = .
[0125] Step 3: Renormalize the encoding range width (Range).
[0126] As the encoding range width (Range) is updated, its value may become less than 256 (the range width is initialized to 510). In this case, renormalization is required. The renormalization method is to simultaneously shift both the lower bound (Low) and the encoding range width (Range) to the left until the value of the encoding range width (Range) is greater than or equal to 256. The bits shifted out by the lower bound (Low) become the encoded output bits.
[0127] Step 4: Update the context model using the encoded binary symbols.
[0128] This concludes the explanation of the CABAC encoding implementation.
[0129] The entropy decoding module in the decoder performs the inverse operation of the entropy encoding module in the encoder. When the entropy encoding module encodes using CABAC, the entropy decoding module performs the same operation as the CABAC encoding part, which may include: decoding the corresponding binary symbol by reading the lower limit of the range written to the bitstream.
[0130] The input to the CABAC decoder is the lower bound of the interval and the index corresponding to the syntax element. The output of the CABAC decoder is the binary value of the corresponding syntax element. The encoding process of the CABAC decoder may include the following steps a and b:
[0131] Step a: Obtain the context.
[0132] Step a above (obtaining the context) may include the following steps a1 and a2:
[0133] Step a1: Determine which syntax element is being decoded based on the standard syntax element structure. Obtain the bypass flag (bypassFlag) and possible context model index (ctxIdx) of the current symbol based on the position of the encoded binary symbol in the bitstream, the index of the corresponding binary symbol (binIdx), and the context reference information.
[0134] Step a2: Based on the information obtained in step a1, obtain the update rate shiftIdx, the probability state pStateIdx0, the probability state pStateIdx1, the weights of pStateIdx0 and pStateIdx1, and use these to obtain the estimated probability of the current symbol.
[0135] The implementation of obtaining the estimated probability of the current symbol by updating the rate shiftIdx, probability state pStateIdx0, probability state pStateIdx1, and the weights of pStateIdx0 and pStateIdx1 can refer to step 2 above. To avoid redundancy, it will not be explained in detail here.
[0136] Step b: Binary arithmetic decoding.
[0137] Corresponding to step 3 above, step b (binary arithmetic decoding) includes two decoding methods: conventional decoding and bypass decoding. Conventional decoding uses an adaptive probability model for decoding; bypass decoding is performed with equal probability, and its probability state does not need to be updated. The two decoding methods are distinguished by the bypass flag obtained in step a.
[0138] The encoder input for conventional decoding is the context model (update rate shiftIdx, probability state pStateIdx0, probability state pStateIdx1) and the current encoding interval width Range. The initial value of the encoding interval width Range is 510, and the lower limit m_value of the interval is obtained by reading bytes from the bitstream. The basic principle of conventional decoding is as follows: after obtaining the corresponding context used for decoding the current symbol, the size of the interval corresponding to the LPS symbol is calculated based on the estimated probability and the current encoding interval width m_Range. The lower limit of the interval is compared with the size of the current encoding interval to determine whether the symbol symbol is 1 or 0. The specific decoding process may include the following steps ① to ④:
[0139] Step ①: Calculate the interval width corresponding to LPS. and .
[0140] Calculate the interval width corresponding to LPS and The formula is as follows:
[0141]
[0142]
[0143]
[0144]
[0145]
[0146] in, This represents the prediction probability with 5-bit precision, when When the predicted probability is greater than 0.5, pState is the predicted probability of MPS, and the XOR operation ( This keeps it at the predicted probability of LPS.
[0147] Step 2: Compare the lower limit m_Value of the interval with the corresponding sub-interval positions of MPS and LPS.
[0148] If m_Value < Then m_Value remains unchanged, Range = The corresponding syntax element's binary value is Bin=MPS;
[0149] If m_Value>= Then m_Value = m_Value - Range= The corresponding syntax element's binary value is Bin=LPS.
[0150] Step 3: Renormalize the encoding range width (Range).
[0151] Similarly, as the encoding range width (Range) is updated, its value may become less than 256 (the range width is initialized to 510). In this case, renormalization is required. The renormalization method is to simultaneously shift both the lower bound (Low) and the encoding range width (Range) to the left until the value of the encoding range width (Range) is greater than or equal to 256. The bits shifted out by the lower bound (Low) become the encoded output bits.
[0152] Step 4: Reconstruct the value of the syntax element
[0153] In some embodiments, reconstructing the value of a syntax element may include: performing the reverse process of binarizing the binary string obtained by decoding the value of the syntax element, thereby re-adding the value of the syntax element.
[0154] This concludes the explanation of the CABAC decoding implementation.
[0155] Some embodiments of this application involve entropy encoding of the value of the syntax element tu_cb_coded_flag. The syntax element tu_cb_coded_flag is first described below. The syntax element tu_cb_coded_flag is a syntax element in the H.266 / VVC standard that identifies whether the transform unit (TU) of the Cb chroma component of the current coding block is a non-zero block. That is, it identifies whether the transform unit of the current Cb chroma component contains non-zero transform coefficients. When the value of the syntax element tu_cb_coded_flag is 1, it indicates that the transform unit of the current Cb chroma component contains non-zero transform coefficients. When the value of the syntax element tu_cb_coded_flag is 0, it indicates that the transform unit of the current Cb chroma component does not contain non-zero transform coefficients. When tu_cb_coded_flag does not exist, it is assumed that the transform unit of the current Cb chroma component does not contain non-zero transform coefficients.
[0156] The process of entropy encoding the value of tu_cb_coded_flag in related technologies may include the following steps I to IV:
[0157] Step 1: Convert the value of tu_cb_coded_flag to binary.
[0158] The implementation of binary conversion of the tu_cb_coded_flag value can be found in Table 1 below:
[0159]
[0160] Table 1 above shows the method and input parameters for binarying the value of tu_cb_coded_flag. As can be seen from Table 1, the binarying of the value of tu_cb_coded_flag uses a fixed-length encoding scheme, and the maximum value of tu_cb_coded_flag is 1.
[0161] Step II: Context model selection for tu_cb_coded_flag.
[0162] The purpose of context model selection for tu_cb_coded_flag is to determine the context index value ctxIdx, which can be achieved in the following ways:
[0163] Step 1: Determine the set of context model index values for tu_cb_coded_flag based on the initialization type of tu_cb_coded_flag.
[0164] The H.266 / VVC standard provides a table of context index values (ctxIdx) for each syntax element. These index values determine the initial value (initValue) for each syntax element. The H.266 standard lists a table indicating the table number for each syntax element and the set of context index values (ctxIdx) corresponding to different initialization types. Taking the H.266 / VVC standard as an example, Table 2 shows the set of context index values (ctxIdx) for tu_cb_coded_flag under different initialization types. The initialization type (initType) is determined by the frame type and sh_cabac_init_flag. sh_cabac_init_flag is determined by pps_cabac_init_present_flag. pps_cabac_init_present_flag equals 1, indicating that sh_cabac_init_flag exists in the segment header referencing the Picture Parameter Set (PPS), and the value of sh_cabac_init_flag is determined to be 1. A value of 0 for pps_cabac_init_present_flag indicates that sh_cabac_init_flag does not exist in the fragment header that references PPS, and the value of sh_cabac_init_flag is determined to be 0.
[0165] The specific initialization type (initType) is determined by the frame type and sh_cabac_init_flag as follows:
[0166] if (sh_slice_type == I)
[0167] initType = 0
[0168] else if (sh_slice_type == P)
[0169] initType = sh_cabac_init_flag ? 2 : 1
[0170] else
[0171] initType = sh_cabac_init_flag ? 1 : 2
[0172] That is, the initialization type initType of I type frames is 0, the initialization type initType of P type frames is 2 or 1 depending on sh_cabac_init_flag, and the initialization type initType of B type frames is 1 or 2 depending on sh_cabac_init_flag.
[0173] For each type of frame, as shown in Table 2, tu_cb_coded_flag uses two context models: when initType=0, the candidate set of context index ctxIdx is 0 and 1; when initType=1, the candidate set of context index ctxIdx is 2 and 3; and when initType=2, the candidate set of context index ctxIdx is 4 and 5.
[0174]
[0175] Table 3 shows the initial values `initValue` and update rates `shiftIdx` for the six context models of `tu_cb_coded_flag` in the VVC reference software test model (VVC TEST MODEL, VTM). The initial value `initValue` is used to calculate the probability state of the context model, and the update rate `shiftIdx` controls the update rate of the model probabilities. The inputs (`shiftIdx`, `pStateIdx0`, and `pStateIdx1`) of the regular encoder can be obtained based on these two parameters. The implementation of obtaining `shiftIdx`, `pStateIdx0`, and `pStateIdx1` based on the initial value `initValue` and update rate `shiftIdx` is described in step 2 above, and will not be elaborated further here to avoid redundancy.
[0176]
[0177] Step 2: Determine the index offset binIdx based on intra_bdpcm_chroma_flag.
[0178] For `tu_cb_coded_flag`, the index offset `binIdx` is determined based on `intra_bdpcm_chroma_flag`. This 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.
[0179]
[0180] Step 3: Determine the context model index value of tu_cb_coded_flag based on the index offset binIdx of tu_cb_coded_flag.
[0181] That is, first select the set of context model index values 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 set of context model index values of tu_cb_coded_flag according to the index offset binIdx of tu_cb_coded_flag.
[0182] In summary, the mapping relationship between the initialization type initType of tu_cb_coded_flag, intra_bdpcm_chroma_flag, and the context model index value ctxIdx can be shown in Table 5 below:
[0183]
[0184] In some embodiments, Figure 5 The mapping relationship shown can also be calculated using an expression.
[0185] Step III: Perform arithmetic encoding on the value of tu_cb_coded_flag.
[0186] After obtaining the value of the context model index ctxIdx of tu_cb_coded_flag, arithmetic coding is started based on tu_cb_coded_flag and the context model (shiftIdx, pStateIdx0, pStateIdx1) determined by the initial value initValue and the update rate shiftIdx. The interval is divided, and the corresponding encoded data of tu_cb_coded_flag is obtained.
[0187] Step IV: Update the probability model corresponding to the context model used by tu_cb_coded_flag.
[0188] That is, the probability states pStateIdx0 and pStateIdx1 of the context model used are updated according to the value of tu_cb_coded_flag.
[0189] The entropy decoding process for the value of tu_cb_coded_flag in related technologies may include the following steps (i) to (iv):
[0190] Step 1: Determine the set of context model index values for tu_cb_coded_flag based on the initialization type of tu_cb_coded_flag.
[0191] The implementation method for determining the context model index value set of tu_cb_coded_flag based on the initialization type of tu_cb_coded_flag can refer to step 1 above. To avoid redundancy, it will not be explained in detail here.
[0192] Step 2: Determine the index offset binIdx based on intra_bdpcm_chroma_flag.
[0193] The implementation of determining the index offset binIdx based on intra_bdpcm_chroma_flag can be found in step 2 above. To avoid redundancy, it will not be explained in detail here.
[0194] Step 3: Determine the context model index value of tu_cb_coded_flag based on the index offset binIdx of tu_cb_coded_flag, and perform arithmetic decoding.
[0195] Arithmetic decoding may involve determining the symbol corresponding to tu_cb_coded_flag based on the interval division and the value corresponding to the lower limit of the interval in the bitstream. The value of this symbol may be 0 or 1.
[0196] Step 4: Assign the value of the symbol obtained by arithmetic decoding to tu_cb_coded_flag.
[0197] That is, the value (0 or 1) of the symbol corresponding to tu_cb_coded_flag is assigned to the value of tu_cb_coded_flag, and the value of tu_cb_coded_flag may be 0 or 1.
[0198] Step 5: Update the probability model corresponding to the context model used by tu_cb_coded_flag.
[0199] The implementation of the probability model corresponding to the context model used to update tu_cb_coded_flag can be referred to in step IV above. To avoid redundancy, it will not be explained in detail here.
[0200] As mentioned above, in related technologies, `tu_cb_coded_flag` corresponds to two context models based on the initialization type, and then determines which of the two context models corresponding to the initialization type to use based on `intra_bdpcm_chroma_flag` (an identifier indicating whether the current CU uses Chroma BDPC). The context index of `tu_cb_coded_flag` can be calculated using the following formula:
[0201] ctxIdx = intra_bdpcm_chroma_flag? 1 : 0
[0202] However, the relevant technologies only determine the context model of tu_cb_coded_flag based on the initialization type initType and the corresponding value of intra_bdpcm_chroma_flag, without considering the spatial characteristics of tu_cb_coded_flag, which may lead to an inaccurate context model of tu_cb_coded_flag.
[0203] The selection of the context model for tu_cb_coded_flag does not take into account the spatial characteristics of tu_cb_coded_flag, which may lead to inaccurate context models for tu_cb_coded_flag. Some embodiments of this application further provide the following technical solutions:
[0204] Some embodiments of this application modify the context model used when entropy encoding the syntax element tu_cb_coded_flag of a chroma block. Specifically, the context model index used when encoding the current tu_cb_coded_flag is determined based on the values of tu_cb_coded_flag in the chroma blocks above and to the left of the current chroma block, and the corresponding number and initial value of the context models are changed.
[0205] In some embodiments, after changing the context model used for entropy encoding of the chroma block syntax element tu_cb_coded_flag, the implementation of entropy encoding of tu_cb_coded_flag may include the following steps A to D:
[0206] Step A: Convert the value of tu_cb_coded_flag to binary.
[0207] The implementation of binary conversion of the tu_cb_coded_flag value can be referred to step I above. To avoid redundancy, it will not be explained in detail here.
[0208] Step B: Select the context model for entropy encoding of the tu_cb_coded_flag value.
[0209] The purpose of step B above (selecting the context model for entropy encoding of the tu_cb_coded_flag value) is to determine the context model ctxIdx used for entropy encoding of the tu_cb_coded_flag value. This can be achieved through steps B1 to B4 as follows:
[0210] Step B1: Determine the set of context model index values for tu_cb_coded_flag based on the initialization type of tu_cb_coded_flag.
[0211] In some embodiments of this application, the initialization type `initType` of `tu_cb_coded_flag` can include three values: 0, 1, and 2. The number of initialization types `initType` for each type of `tu_cb_coded_flag` changes from 2 to 6. The mapping relationship between the initialization type `initType` of `tu_cb_coded_flag` and the set of context model index values can be as follows: when `initType` = 0, the set of context model index values for `tu_cb_coded_flag` is {0, 1, 2, 3, 4, 5}; when `initType` = 1, the set of context model index values for `tu_cb_coded_flag` is {6, 7, 8, 9, 10, 11}; when `initType` = 2, the set of context model index values for `tu_cb_coded_flag` is {12, 13, 14, 15, 16, 17}. That is, in some embodiments of this application, the mapping relationship between the initialization type `initType` of `tu_cb_coded_flag` and the set of context model index values is shown in Table 6 below:
[0212]
[0213] In some embodiments, the initial values of the context model parameters corresponding to index numbers 1 to 17 are preset empirical values.
[0214] In some embodiments, the initial values of the context model parameters corresponding to index numbers 1 to 17 may include: initial value initValue set to CNU=35, update rate shiftIdx set to DWS=8, interval width set to DWE=18, and long and short window offsets set to DWO=119. The initial values of the context model parameters corresponding to index numbers 1 to 17 are shown in Table 7 below.
[0215]
[0216] In other embodiments, the context model probability at the end of each frame encoding of each sequence can be recorded, and the initial values of the context model parameters corresponding to index numbers 1 to 17 can be set according to historical data.
[0217] Step B2: Determine the value of tu_cb_coded_flag for the coded chroma block adjacent to the current chroma block.
[0218] In some embodiments, the encoded chroma blocks adjacent to the current chroma block may include a chroma block to the left of the current chroma block and a chroma block above the current chroma block. Therefore, based on the input encoding structure, chroma position, and chroma components, the chroma block to the left of the current chroma block and the chroma block above the current chroma block can be determined. Then, the values of `tu_cb_coded_flag` for the chroma block to the left of the current chroma block and the chroma block above the current chroma block are obtained.
[0219] Step B3: Determine the index value of the context model of the current chroma block based on the value of tu_cb_coded_flag of the coded chroma block adjacent to the current chroma block and the value of intra_bdpcm_chroma_flag of the current chroma block.
[0220] In some embodiments, determining the index value of the context model of the current chroma block based on the value of tu_cb_coded_flag of the coded chroma block adjacent to the current chroma block and the value of intra_bdpcm_chroma_flag of the current chroma block may include the following steps B31 and B32:
[0221] Step B31: Calculate the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block.
[0222] That is, the values of `tu_cb_coded_flag` of the chroma block to the left of the current chroma block and the chroma block above the current chroma block are accumulated to obtain the sum of the values of `tu_cb_coded_flag` of the encoded chroma blocks adjacent to the current chroma block, which is then used to calculate `Neibor_CbfcbFlag_Sum`. Since the chroma blocks to the left of the current chroma block and / or the chroma blocks to the left of the current chroma block may not exist, and the value of `tu_cb_coded_flag` may be 0 or 1, the value of `Neibor_CbfcbFlag_Sum` may be 0, 1, or 2.
[0223] Step B32: Determine the index value of the context model of the current chroma block based on the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and the value of intra_bdpcm_chroma_flag of the current chroma block.
[0224] In some embodiments, determining the index value of the context model of the current chroma block based on the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and the value of intra_bdpcm_chroma_flag of the current chroma block may include: when the value of 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 indices of the context index set corresponding to the initialization type. That is, if the initialization type initType=0, the selection range of the context model index value ctxIdx is {0,1,2}; if the initialization type initType=1, the selection range of the context model index value ctxIdx is {6,7,8}; if the initialization type initType=2, the selection range of the context model index value ctxIdx is {12,13,14}; when the value of intra_bdpcm_chroma_flag is 1 (bdpcm Chroma mode is used), the index value of the current chroma block is selected from the first three context model indices of the context index set corresponding to the initialization type. In Chroma mode, the index value of the context model of the current chroma block is selected from the last three context model indices of the context index set corresponding to the initialization type. That is, if the initialization type initType=0, the selection range of the context model index value ctxIdx is {3,4,5}; if the initialization type initType=1, the selection range of the context model index value ctxIdx is {9,10,11}; if the initialization type initType=2, the selection range of the context model index value ctxIdx is {15,16,17}.
[0225] In some embodiments, selecting the index value of the context model of the current chroma block from the first three context model indices of the context index set corresponding to the initialization type may include: if the initialization type initType=0, then the index value ctxIdx of the context model is equal to the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block, Neibor_CbfcbFlag_Sum, that is, ctxIdx=Neibor_CbfcbFlag_Sum; if the initialization type initType=1, then... In the context model, the index value ctxIdx is equal to the sum of the values of 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, then the index value ctxIdx of the context model is equal to the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and Neibor_CbfcbFlag_Sum and 12, i.e., ctxIdx = Nei `bor_CbfcbFlag_Sum+12;` Selects the index value of the context model for the current chroma block from the last three context model indices of the context index set corresponding to the initialization type. This may include: if the initialization type `initType` = 0, then the index value of the context model `ctxIdx` is equal to the sum of the value of `tu_cb_coded_flag` of the coded chroma block adjacent to the current chroma block and 3, i.e., `ctxIdx = Neibor_CbfcbFlag_Sum+3`; if the initialization type `initType` = 1, then the index value of the context model `ctxIdx` is equal to the sum of the values of `tu_cb_coded_flag` and 3 of the coded chroma blocks adjacent to the current chroma block .... The index value ctxIdx of the context model is equal to the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and 9, that is, ctxIdx = Neibor_CbfcbFlag_Sum + 9; if the initialization type initType = 2, then the index value ctxIdx of the context model is equal to the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block and 15, that is, ctxIdx = Neibor_CbfcbFlag_Sum + 15.
[0226] Reference Figure 3 As shown, the mapping relationship between the value of intra_bdpcm_chroma_flag of the current chroma block 31, the value of tu_cb_coded_flag of the chroma block 32 above the current chroma block 31, the value of tu_cb_coded_flag of the chroma block 33 to the left of the current chroma block 31, and the index value ctxIdx of the context model of the current chroma block 31 is as follows:
[0227] ctxIdx=! intra_bdpcm_chroma_flag? Neibor_CbfcbFlag_Sum:Neibor_CbfcbFlag_Sum+3
[0228] That is, in some embodiments of this application, the correspondence between the value of intra_bdpcm_chroma_flag of the current chroma block, the value of tu_cb_coded_flag of the coded chroma block adjacent to the current chroma block, Neibor_CbfcbFlag_Sum, and the index value ctxIdx of the context model of the current chroma block 31 can be shown in Table 8 below:
[0229]
[0230] In summary, the mapping relationship between the context model index ctxId, the initialization type initType, the value of intra_bdpcm_chroma_flag, the value of tu_cb_coded_flag of the coded chroma block adjacent to the current chroma block, and Neibor_CbfcbFlag_Sum in some embodiments of this application can be shown in Table 9 below:
[0231]
[0232] Step C: Perform arithmetic encoding on 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 update the model probability of the context model.
[0233] The implementation of arithmetic encoding of the value of tu_cb_coded_flag of the current chroma block based on the index value of the context model of the current chroma block, and updating the model probability of the context model can be referred to steps (3) and (4) above. To avoid redundancy, it will not be explained in detail here.
[0234] In some embodiments, the method may further include: obtaining the initial value of the context model of tu_cb_coded_flag when encoding a frame begins and the probability of the context model of tu_cb_coded_flag when encoding ends; if the initial value of the context model when encoding begins and the probability of the context model when encoding ends are less than a first threshold, then when encoding the next frame image, the context model of tu_cb_coded_flag is not initialized, but the context model of tu_cb_coded_flag when encoding the frame image ends is used instead.
[0235] The above embodiments classify chroma blocks using the Chroma BDPCM mode and those not using the Chroma BDPCM mode based on the context of the tu_cb_coded_flag of the upper and left chroma blocks. Under the same initial type, six context models can be included. In other embodiments, this context classification method can be applied only to chroma blocks not using the Chroma BDPCM mode, while only one fixed context column is set for chroma blocks using the Chroma BDPCM mode. That is, under the same initial type, four context models are set for tu_cb_coded_flag, with the first three columns representing the case without Chroma BDPCM and the last column representing the case with Chroma BDPCM. This can be specifically illustrated in Table 10 below:
[0236]
[0237] In the above embodiments, when calculating the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block (Neibor_CbfcbFlag_Sum), the values of the intra_bdpcm_chroma_flag of the coded chroma blocks adjacent to the current chroma block are not available. In other embodiments, the values of the intra_bdpcm_chroma_flag of the coded chroma blocks adjacent to the current chroma block can be obtained first, and when calculating the sum of the values of tu_cb_coded_flag of the coded chroma blocks adjacent to the current chroma block (Neibor_CbfcbFlag_Sum), only the values of tu_cb_coded_flag of adjacent coded chroma blocks with the same intra_bdpcm_chroma_flag value as the current chroma block are summed.
[0238] Some embodiments of this application provide a video decoding method, see below. Figure 4 As shown, the video decoding method may include the following steps:
[0239] S41. Obtain the entropy decoding data corresponding to the first syntax element of the first chroma block.
[0240] The first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block. That is, the first syntax element is tu_cb_coded_flag.
[0241] In some embodiments, the entropy-encoded data of the first syntax element of the first chroma block can be obtained from the video bitstream according to the standard syntax element structure.
[0242] In some embodiments, the first chroma block is the chroma block corresponding to the blue component Cb of the current coding block.
[0243] In other embodiments, the first chroma block is the chroma block corresponding to the red component Cr of the current coding block.
[0244] S42. Obtain the spatial information of the first chroma block based on the adjacent decoded chroma blocks of the first chroma block.
[0245] In some embodiments of this application, the adjacent 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 was decoded.
[0246] In some embodiments, the adjacent decoded chroma blocks of the first chroma block may include: a chroma block located above the first chroma block and / or a chroma block located to the left of the first chroma block; the above step S42 (obtaining the spatial information of the first chroma block based on the adjacent decoded chroma blocks of the first chroma block) may include: obtaining the spatial information of the first chroma block based on the chroma blocks located above the first chroma block and / or the chroma blocks located to the left of the first chroma block.
[0247] In some embodiments, step S42 (obtaining the spatial information of the first chroma block based on the adjacent decoded chroma blocks of the first chroma block) may include: obtaining the spatial information of the first chroma block based on whether the transform block of the adjacent decoded chroma block is a non-zero block.
[0248] S43. Determine the target context model based on the spatial information of the first chroma block.
[0249] In some embodiments, determining the target context model based on the spatial domain information of the first chroma block may include: selecting the target context model from a preset context model set based on the spatial domain information of the first chroma block.
[0250] In some embodiments, determining the target context model based on the spatial domain information of the first chroma block may include: determining the target context model based on the spatial domain information of the first chroma block, the initialization type (initType) of the first syntax element of the first chroma block, and the value of the second syntax element of the first chroma block;
[0251] The second syntax element is a syntax element that identifies whether the chroma block uses a block-based differential pulse code modulation mode. That is, the second syntax element is intra_bdpcm_chroma_flag.
[0252] S44. Based on the target context model and the entropy-encoded data of the first syntax element of the first chroma block, obtain the value of the first syntax element of the first chroma block.
[0253] The video decoding method provided in the above embodiments, when obtaining the entropy-encoded data of the first syntax element of the first chroma block (identifying whether the transform block of the first chroma block is a non-zero block) and obtaining the value of the first syntax element of the first chroma block based on the entropy-encoded data of the first syntax element of the first chroma block, firstly obtains the spatial domain information of the first chroma block based on the adjacent decoded chroma blocks, then determines the target context model based on 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-encoded data of the first syntax element of the first chroma block. Since the video decoding method provided in the above embodiments obtains the spatial domain information of the first chroma block based on the adjacent decoded chroma blocks and determines the context model for entropy decoding of the value of the first syntax element of the first chroma block based on the spatial domain information of the first chroma block, the above embodiments can combine the spatial effects of the first syntax element to determine the context model for entropy decoding of the first syntax element, thereby improving the accuracy of the context model for entropy decoding of the first syntax element.
[0254] As an extension and refinement of the above embodiments, some embodiments of this application provide another video decoding method, see below. Figure 5 As shown, the video decoding method may include the following steps:
[0255] S501. Obtain the entropy-encoded data of the first syntax element of the first chroma block.
[0256] The first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block.
[0257] S502, Obtain the value of the first syntax element of the adjacent decoded chroma block.
[0258] That is, obtain the value of tu_cb_coded_flag of the adjacent decoded chroma block.
[0259] S503. Obtain the spatial information of the first chroma block based on the value of the first syntax element of the adjacent decoded chroma block.
[0260] In some embodiments, step S503 (obtaining the spatial information of the first chroma block based on the value of the first syntax element of the adjacent decoded chroma blocks) may include: summing the values of the first syntax elements of the adjacent decoded chroma blocks to obtain the spatial information of the first chroma block.
[0261] For example, the adjacent decoded chroma blocks may include: a chroma block above the first chroma block and a chroma block to the left of the first chroma block. If 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 to the left of the first chroma block is 1, then the spatial information of the first chroma block can be determined to be 2.
[0262] For example, if the adjacent decoded chroma blocks only include the chroma block located to the left of the first chroma block, and the value of the first syntax element of the chroma block located above the first chroma block is 1, then the spatial information of the first chroma block can be determined to be 1.
[0263] For example, the adjacent decoded chroma blocks may include: a chroma block above the first chroma block and a chroma block to the left of the first chroma block. If 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 to the left of the first chroma block is 0, then the spatial information of the first chroma block can be determined to be 0.
[0264] In some embodiments, step S503 (obtaining the spatial information of the first chroma block based on the value of the first syntax element of the adjacent decoded chroma block) may include the following steps 5031 and 5032:
[0265] Step 5031: Obtain the value of the second syntax element of the adjacent decoded chroma block.
[0266] The second syntax element is a syntax element that identifies whether a chroma block uses a block-based differential pulse code modulation mode. That is, it determines whether the adjacent decoded chroma blocks use a block-based differential pulse code modulation mode.
[0267] Step 5032: Summate the values of the first syntax elements of the adjacent decoded chroma blocks whose values of the second syntax elements are the same as those of the first chroma block, to obtain the spatial information of the first chroma block.
[0268] For example, the value of the second syntax element of the first chroma block is 0. The adjacent decoded chroma blocks may include: a chroma block above the first chroma block and a chroma block to the left of 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 to the left of 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. Since only the chroma block above the first chroma block has the same value as the second syntax element of the first chroma block, the spatial information of the first chroma block is 1.
[0269] S504. Obtain the initialization type (initType) of the first syntax element of the first chroma block.
[0270] In some embodiments, obtaining the initialization type of the first syntax element of the first chroma block may include: determining the value of the syntax element sh_cabac_init_flag based on 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 based on the value of the syntax element sh_cabac_init_flag and the frame type (I type, B type, or P type) corresponding to the first chroma block.
[0271] In some embodiments, the implementation of obtaining the initialization type of the first syntax element of the first chroma block may include:
[0272] If the frame type corresponding to the first chroma block is type I, then the initialization type of the first syntax element of the first chroma block is determined to be the first initialization type; if the frame type corresponding to the first chroma block is type P, and the value of sh_cabac_init_flag is 1, then the initialization type of the first syntax element of the first chroma block is determined to be the second initialization type; if the frame type corresponding to the first chroma block is type P, and the value of sh_cabac_init_flag is 0, then the initialization type of the first syntax element of the first chroma block is determined to be the third initialization type; if the frame type corresponding to the first chroma block is type B, and the value of sh_cabac_init_flag is 1, then the initialization type of the first syntax element of the first chroma block is determined to be the third initialization type; if the frame type corresponding to the first chroma block is type B, and the value of sh_cabac_init_flag is 0, then the initialization type of the first syntax element of the first chroma block is determined to be the second initialization type.
[0273] S505, Obtain the value of the second syntax element of the first chroma block.
[0274] The second syntax element is a syntax element that identifies whether the chroma block uses a block-based differential pulse code modulation mode.
[0275] In some embodiments, when the first chroma block does not use a block-based differential pulse code modulation mode, the value of the second syntax element of the first chroma block is 0, and when the first chroma block does not use a block-based differential pulse code modulation mode, the value of the second syntax element of the first chroma block is 1.
[0276] S506. Determine the target index set according to the initialization type.
[0277] 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 each correspond to a context model index set; determining the target index set based on the initialization type may include: when the initialization type is a first initialization type, determining the context model index set corresponding to the first initialization type as the target index set; when the initialization type is a second initialization type, determining the context model index set corresponding to the second initialization type as the target index set; when the initialization type is a first initialization type, determining the context model index set corresponding to the third initialization type as the target index set.
[0278] As shown in Table 6 above, the context model index set corresponding to the first initialization type (initType=0) is {0, 1, 2, 3, 4, 5}, the context model index set corresponding to the second initialization type (initType=1) is {6, 7, 8, 9, 10, 11}, and the context model index set corresponding to the third initialization type (initType=3) is {12, 13, 14, 15, 16, 17}. Therefore, 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 first initialization type, the target index set is {6, 7, 8, 9, 10, 11}; and when the initialization type is the first initialization type, the target index set is {12, 13, 14, 15, 16, 17}.
[0279] As shown in Table 10 above, the context model index set corresponding to the first initialization type (initType=0) is {0, 1, 2, 3}, the context model index set corresponding to the second initialization type (initType=1) is {4, 5, 6, 7}, and the context model index set corresponding to the third initialization type (initType=2) is {8, 9, 10, 11}. Therefore, 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}.
[0280] S507. Select a target model index from the target index set based on the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block.
[0281] In some embodiments, the target index set may include: six context model indices (as shown in Table 6 above). Step S507 (selecting a target model index from the target index set based on the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block) may include:
[0282] When the value of the second syntax element of the first chroma block is a value that indicates that the first chroma block does not use a block-based differential pulse code modulation mode, the target model index is selected from the first three context model indices of the target index set according to the spatial domain information of the first chroma block.
[0283] When the value of the second syntax element of the first chroma block is a value that identifies that the first chroma block uses a block-based differential pulse code modulation mode, the target model index is selected from the last three context model indices of the target index set according to the spatial domain information of the first chroma block.
[0284] That is, if intra_bdpcm_chroma_flag=0, the target model index is selected from the first three context model indices of the target index set based on the spatial domain information of the first chroma block; if intra_bdpcm_chroma_flag=1, the target model index is selected from the last three context model indices of the target index set based on the spatial domain information of the first chroma block.
[0285] 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 domain information of the first chroma block; if intra_bdpcm_chroma_flag=1, the target model index is selected from {15, 16, 17} according to the spatial domain information of the first chroma block.
[0286] In some embodiments, selecting the target model index from the first three context model indices of the target index set based on the spatial information of the first chroma block may include: when the spatial information of the first chroma block is m, then selecting the (m+1)th context model index in the target index set as the target model index; 0≤m≤2.
[0287] Here, 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, and therefore m can be 0, 1, or 2.
[0288] That is, 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; and 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.
[0289] 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 indices of the target index set based on the spatial information of the first chroma block may include: when the spatial information of the first chroma block is m, then selecting the (m+4)th context model index in the target index set as the context model index corresponding to the first syntax element of the first chroma block, where 0≤m≤2.
[0290] That is, when the spatial 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 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 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.
[0291] In some embodiments, the target index set may include: four context model indices (as shown in Table 10 above). Step S507 (selecting a target model index from the target index set based on the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block) may include:
[0292] When the value of the second syntax element of the first chroma block is a value that indicates that the first chroma block does not use a block-based differential pulse code modulation mode, the target model index is selected from the first three context model indices of the target index set according to the spatial domain information of the first chroma block.
[0293] When the value of the second syntax element of the first chroma block is a value that indicates 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.
[0294] Similarly, selecting the target model index from the first three context model indices of the target index set based on the spatial information of the first chroma block may include: when the spatial information of the first chroma block is m, then the (m+1)th context model index in the target index set is selected as the target model index; 0≤m≤2.
[0295] That is, if 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; if intra_bdpcm_chroma_flag=1, when the spatial information of the first chroma block is 0, 1, or 2, the fourth context model index in the target index set is selected as the target model index.
[0296] S508. Determine the target context model based on the target model index.
[0297] In some embodiments, the above-described S508 (determining the target context model based on the target model index) may include the following steps 5801 and 5082:
[0298] Step 5081: Obtain the initial value and update rate of the target context model based on the target model index.
[0299] In some embodiments, the initial value (initValue) of the target context model is 35; the update rate (shiftIdx) of the target context model is 8.
[0300] Step 5082: Construct the target context model based on the initial value and update rate of the target context model.
[0301] In some embodiments, constructing the target context model based on the initial value and update rate of the target context model may include calculating the model probabilities pStateIdx0 and pStateIdx1 of the target context model based on the initial value (initValue) of the target context model.
[0302]
[0303]
[0304]
[0305]
[0306]
[0307]
[0308]
[0309] in, These are the quantization parameters for the brightness signal.
[0310] In some embodiments, determining the target context model based on the target model index may include: reading the target context model based on the target model index.
[0311] S509. Using the target context model as the context model of the CABAC algorithm, the entropy-encoded data of the first syntax element of the first chroma block is arithmetically decoded using the CABAC algorithm to obtain the value of the first syntax element of the first chroma block.
[0312] The implementation of arithmetic decoding of the entropy-encoded data of the first syntax element of the first chroma block using the CABAC algorithm can refer to step b above. To avoid redundancy, it will not be described in detail here.
[0313] S510. Update the target context model according to the value of the first syntax element of the first chroma block.
[0314] That is, the probability states pStateIdx0 and pStateIdx1 of the target context model are updated based on the value of tu_cb_coded_flag of the first chroma block.
[0315] In some embodiments, the video decoding method provided in some embodiments of this application may further include: determining the context model corresponding to the second chroma block according to the target context model; wherein the first chroma block and the second chroma block are chroma blocks corresponding to two chroma components of the same coding block.
[0316] In some embodiments, the first chromaticity block is the chromaticity block corresponding to the Cb component, and the second chromaticity block is the chromaticity block corresponding to the Cr chromaticity component.
[0317] That is, according to the video decoding method provided in some embodiments of this application, the target context model corresponding to the chroma block corresponding to the blue chroma component of the coded block is obtained, the value of the first syntax element of the first chroma block is obtained based on the target context model and the entropy encoding data of the first syntax element of the first chroma block, and the context model corresponding to the chroma block corresponding to the red chroma component of the coded block is determined according to the determined target context model.
[0318] In some embodiments, determining the context model corresponding to the second chroma block based on the target context model may include: determining the target context model as the context model corresponding to the second chroma block.
[0319] After determining the context model corresponding to the second chroma block based on the target context model, the video encoding method provided in some embodiments of this application may further include:
[0320] Based on the context model corresponding to the second chroma block and the entropy encoded data of the first syntax element of the second chroma block, the value of the first syntax element of the second chroma block is obtained.
[0321] Some embodiments of this application provide a video encoding method, see below. Figure 6 As shown, the video decoding method may include the following steps:
[0322] S61. Obtain the spatial information of the first chroma block based on the adjacent encoded chroma blocks of the first chroma block.
[0323] The implementation of step S61 can refer to the implementation of step S42. The difference is that in step S42, the spatial information of the first chroma block is obtained based on the adjacent decoded chroma blocks of the first chroma block, while in step S61, the spatial information of the first chroma block is obtained based on the adjacent encoded chroma blocks of the first chroma block. In addition, based on the order of encoding and decoding, the adjacent decoded chroma blocks of the first chroma block during the decoding process and the adjacent encoded chroma blocks of the first chroma block during the encoding process are the same chroma blocks.
[0324] S62. Determine the target context model based on the spatial information of the first chroma block.
[0325] The implementation method of determining the target context model based on the spatial domain information of the first chroma block can refer to the implementation method of determining the target context model based on the spatial domain information of the first chroma block in the above video decoding method. To avoid redundancy, it will not be described in detail here.
[0326] S63. Based on the target context model, entropy encoding is performed on the value of the first syntax element of the first chroma block to obtain the entropy encoded data of the first syntax element of the first chroma block.
[0327] The first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block.
[0328] The video encoding method provided in the above embodiments, when performing entropy encoding on the value of the first syntax element of the first chroma block, first obtains the spatial information of the first chroma block based on its neighboring encoded chroma blocks, then determines a target context model based on the spatial information of the first chroma block, and then performs entropy encoding on the value of the first syntax element of the first chroma block based on the target context model to obtain the entropy encoded data of the first syntax element of the first chroma block. Since the video encoding method provided in the above embodiments obtains the spatial information of the first chroma block based on its neighboring encoded chroma blocks and determines the context model for entropy encoding on the value of the first syntax element of the first chroma block based on the spatial information of the first chroma block, the above embodiments can combine the spatial characteristics of the first syntax element to determine the context model for entropy encoding on the first syntax element, thereby improving the accuracy of the context model for entropy encoding on the first syntax element.
[0329] Some embodiments of this application also provide a video decoding apparatus, see reference Figure 7 As shown, the video decoding device 700 may include:
[0330] The first acquisition module 71 is used to acquire the entropy encoded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block;
[0331] The second acquisition module 72 is used to acquire the spatial information of the first chroma block based on the adjacent decoded chroma blocks of the first chroma block;
[0332] The determination module 73 is used to determine the target context model based on the spatial information of the first chroma block;
[0333] The entropy decoding module 74 is used to obtain the 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.
[0334] The video decoding device provided in the above embodiments can execute the video decoding method provided in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0335] Some embodiments of this application provide a video encoding apparatus, see reference Figure 8 As shown, the video encoding device 800 may include:
[0336] The acquisition unit 81 is used to acquire the spatial information of the first chroma block based on the adjacent encoded chroma blocks of the first chroma block;
[0337] The determining unit 82 is used to determine the target context model based on the spatial domain information of the first chroma block;
[0338] Entropy coding unit 83 is used to entropy code the value of the first syntax element of the first chroma block based on the target context model to obtain the entropy coding data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block.
[0339] The video encoding apparatus provided in the above embodiments can execute the video encoding method provided in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0340] Some embodiments of this application provide an electronic device that may include:
[0341] Memory, configured to store computer programs;
[0342] The processor is configured to cause the video decoding device to implement the video decoding method or video encoding method described in any of the above embodiments when a computer program is invoked.
[0343] Some embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a computing device, causes the computing device to implement the video decoding method described in any of the above embodiments.
[0344] Some embodiments of this application provide a computer program product that, when run on a computer, enables the computer to implement the video decoding method described in any of the above embodiments.
[0345] Some embodiments of this application provide a chip including a memory and a processor. The processor may be a logic circuit, an integrated circuit, or a general-purpose processor. The memory stores computer instructions, and the processor can implement the video decoding method described in any of the above embodiments by reading the computer instructions stored in the memory.
[0346] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0347] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
Claims
1. A video decoding method, characterized in that, include: Obtain the entropy-encoded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block; Get the value of the first syntax element of the adjacent decoded chroma block; Based on the value of the first syntax element of the adjacent decoded chroma blocks, obtain the spatial information of the first chroma block; The target context model is determined based on 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; wherein, the second syntax element is a syntax element that identifies whether the chroma block uses a block-based differential pulse code modulation mode. Based on the target context model and the entropy-encoded data of the first syntax element of the first chroma block, the value of the first syntax element of the first chroma block is obtained.
2. The method according to claim 1, characterized in that, The step of obtaining the spatial information of the first chroma block based on its adjacent decoded chroma blocks includes: The spatial information of the first chroma block is obtained from the chroma blocks located above the first chroma block and / or the chroma blocks located to the left of the first chroma block.
3. The method according to claim 1, characterized in that, The step of obtaining the spatial information of the first chroma block based on the value of the first syntax element of the adjacent decoded chroma block includes: The values of the first syntax elements of the adjacent decoded chroma blocks are summed to obtain the spatial information of the first chroma block.
4. The method according to claim 1, characterized in that, The step of obtaining the spatial information of the first chroma block based on the value of the first syntax element of the adjacent decoded chroma block includes: Obtain the value of the second syntax element of the adjacent decoded chroma block; the second syntax element is a syntax element that identifies whether the chroma block uses a block-based differential pulse code modulation mode; The values of the first syntax elements in adjacent decoded chroma blocks that have the same value as the first chroma block are summed to obtain the spatial information of the first chroma block.
5. The method according to claim 1, characterized in that, Determining the target context model based on 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 includes: The target index set is determined based on the initialization type; Based on the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block, a target model index is selected from the target index set; The target context model is determined based on the target model index.
6. The method according to claim 5, characterized in that, The target index set includes: six context model indices; the step of selecting a target model index from the target index set based on the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block includes: When the value of the second syntax element of the first chroma block is a value that indicates that the first chroma block does not use a block-based differential pulse code modulation mode, the target model index is selected from the first three context model indices of the target index set according to the spatial domain information of the first chroma block. When the value of the second syntax element of the first chroma block is a value that identifies that the first chroma block uses a block-based differential pulse code modulation mode, the target model index is selected from the last three context model indices of the target index set according to the spatial domain information of the first chroma block.
7. The method according to claim 5, characterized in that, The target index set includes four context model indices; the step of selecting the context model index corresponding to the first syntax element of the first chroma block from the target index set based on the spatial domain information of the first chroma block and the value of the second syntax element of the first chroma block includes: When the value of the second syntax element of the first chroma block is a value that indicates that the first chroma block does not use a block-based differential pulse code modulation mode, the target model index is selected from the first three context model indices of the target index set according to the spatial domain information of the first chroma block. When the value of the second syntax element of the first chroma block is a value that indicates 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.
8. The method according to claim 6 or 7, characterized in that, The step of selecting the target model index from the first three context model indices of the target index set based on the spatial domain information of the first chroma block includes: 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.
9. The method according to claim 6, characterized in that, The step of selecting the context model index corresponding to the first syntax element of the first chroma block from the last three context model indices of the target index set based on the spatial domain information of the first chroma block includes: When the spatial information of the first chroma block is m, the (m+4)th 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, where 0≤m≤2.
10. The method according to claim 5, characterized in that, 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 each correspond to a context model index set; Determining the target index set based on the initialization type includes: 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 third initialization type, the context model index set corresponding to the third initialization type is determined as the target index set.
11. The method according to claim 5, characterized in that, Determining the target context model based on the target model index includes: The initial value and update rate of the target context model are obtained based on the target model index; The target context model is constructed based on the initial values and update rate of the target context model.
12. The method according to claim 11, characterized in that, The initial value of the target context model is 35, and the update rate of the target context model is 8.
13. The method according to claim 1, characterized in that, The step of obtaining the 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 includes: The target context model is used as the context model of the context-based adaptive arithmetic coding (CABAC) algorithm. The CABAC algorithm is used to perform arithmetic decoding on the entropy-encoded data of the first syntax element of the first chroma block to obtain the value of the first syntax element of the first chroma block.
14. The method according to claim 13, characterized in that, After obtaining the value of the first syntax element of the first chroma block, the method further includes: The target context model is updated based on the value of the first syntax element of the first chroma block.
15. The method according to claim 1, characterized in that, The method further includes: Determine the context model corresponding to the second chroma block based on the target context model; Wherein, the first chroma block and the second chroma block are chroma blocks corresponding to two chroma components of the same coding block.
16. A video encoding method, characterized in that, include: Get the value of the first syntax element of the adjacent encoded chroma block of the first chroma block; Based on the value of the first syntax element of the adjacent encoded chroma blocks, obtain the spatial information of the first chroma block; The target context model is determined based on 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; wherein, the second syntax element is a syntax element that identifies whether the chroma block uses a block-based differential pulse code modulation mode. Based on the target context model, the value of the first syntax element of the first chroma block is entropy encoded to obtain the entropy encoded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block.
17. A video decoding device, characterized in that, include: The first acquisition module is used to acquire the entropy-encoded data of the first syntax element of the first chroma block; The first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block; The second acquisition module is used to acquire the value of the first syntax element of the adjacent decoded chroma block; and to acquire the spatial information of the first chroma block based on the value of the first syntax element of the adjacent decoded chroma block. The determination module determines the target context model based on 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; wherein, the second syntax element is a syntax element that identifies whether the chroma block uses a block-based differential pulse code modulation mode. The entropy decoding module is used to obtain the 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.
18. A video encoding device, characterized in that, include: The acquisition unit is used to acquire the value of the first syntax element of the adjacent encoded chroma blocks of the first chroma block; Based on the value of the first syntax element of the adjacent encoded chroma blocks, obtain the spatial information of the first chroma block; The determining unit is configured to determine the target context model based on 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; wherein the second syntax element is a syntax element that identifies whether the chroma block uses a block-based differential pulse code modulation mode. An entropy coding unit is used to entropy code the value of the first syntax element of the first chroma block based on the target context model to obtain the entropy-coded data of the first syntax element of the first chroma block; the first syntax element is a syntax element that identifies whether the transform block of the chroma block is a non-zero block.
19. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the method as described in any one of claims 1-15.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a computing device, causes the computing device to perform the method according to any one of claims 1-15.
Citation Information
Patent Citations
Video frame encoding and decoding
US20050169374A1