Video decoding method, video coding method, device and equipment
By designing suitable binarization and inverse binarization methods based on the value interval to which the absolute value of the displacement vector residual belongs, the problem of insufficient encoding and decoding performance of inter prediction mode and IBC mode in the prior art is solved, and the codec performance of inter-frame prediction mode and IBC mode in the existing technology is improved. Efficiency and compression performance of video encoding and codec.
Patent Information
- Application Number
- CN202411508144.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-04
- Publication Date
- 2024-12-13
AI Technical Summary
In the existing video codec standards, the MVD in the inter prediction mode and the BVD in the IBC mode use the same codec method, resulting in the inadequate improvement of the codec performance and the failure to effectively utilize the distribution characteristics of BVD.
In the video decoding and encoding method, a binary and inverse binarization method suitable for the distribution characteristics is determined based on the value interval to which the absolute value of the displacement vector residual belongs, and a codec method for the displacement vector residual is designed. , to improve encoding and decoding efficiency and compression performance.
The encoding and decoding method based on the absolute value distribution characteristics of displacement vector residuals is realized, which improves the efficiency and compression performance of video encoding and decoding, and is suitable for displacement vector residual encoding and decoding in different prediction modes.
Smart Images

Figure CN119135922A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with application number 202011414460.0 filed on December 4, 2020 and invention name “Video decoding method, video encoding method, device and equipment”. Technical Field
[0002] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a video decoding method, a video encoding method, a device and an apparatus. Background Art
[0003] In current video codec standards, such as VVC (Versatile Video Coding) and AVS3 (Audio Video Coding Standard 3), the MVD (motion vector residual) in inter-frame prediction mode and the BVD (block displacement vector residual) in IBC (intra-frame block copy) mode use the same coding and decoding method. However, this is not conducive to improving codec performance. Summary of the invention
[0004] The embodiments of the present application provide a video decoding method, a video encoding method, a device and an apparatus, which are conducive to improving encoding and decoding performance. The technical solution is as follows:
[0005] According to one aspect of an embodiment of the present application, a video decoding method is provided, the method comprising:
[0006] Determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs;
[0007] In a case where it is determined based on the first value interval that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, a first suffix debinarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction is determined based on the first value interval;
[0008] Using the first suffix debinarization method, debinarize the first suffix partial binary symbol string in the code stream to obtain a suffix value corresponding to the displacement vector residual in the first direction;
[0009] Based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction, the displacement vector residual in the first direction is determined.
[0010] According to one aspect of an embodiment of the present application, a video encoding method is provided, the method comprising:
[0011] Determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs;
[0012] In a case where it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value, based on the first value interval, determining a first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction;
[0013] Using the first suffix binarization method, binarize the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string;
[0014] The encoding generates a code stream including the binary symbol string of the first suffix part.
[0015] According to one aspect of an embodiment of the present application, a video decoding device is provided, the device comprising:
[0016] An interval determination module, used to determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs;
[0017] a method determination module, configured to determine, based on the first value interval, a first suffix debinarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction, when it is determined that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, based on the first value interval;
[0018] a debinarization module, configured to perform debinarization processing on the first suffix partial binary symbol string in the code stream by using the first suffix debinarization method, so as to obtain a suffix value corresponding to the displacement vector residual in the first direction;
[0019] A residual determination module is used to determine the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
[0020] According to one aspect of an embodiment of the present application, a video encoding device is provided, the device comprising:
[0021] An interval determination module, used to determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs;
[0022] a method determination module, configured to determine, based on the first value interval, a first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction when it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value;
[0023] A binarization module, configured to use the first suffix binarization method to perform binarization processing on the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string;
[0024] The code stream generation module is used to encode and generate a code stream including the binary symbol string of the first suffix part.
[0025] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above-mentioned video decoding method, or to implement the above-mentioned video encoding method.
[0026] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the above-mentioned video decoding method, or to implement the above-mentioned video encoding method.
[0027] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned video decoding method, or implements the above-mentioned video encoding method.
[0028] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0029] The binarization and debinarization method of the suffix value corresponding to the displacement vector residual is not a fixed method, but a method determined based on the value interval to which the absolute value of the displacement vector residual belongs. In this way, the distribution characteristics of the absolute value of the displacement vector residual in different value intervals are realized, and a binarization and debinarization method suitable for the distribution characteristics and with good encoding and decoding performance is designed, which helps to improve the encoding and decoding efficiency and compression performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a basic flow chart of a video encoding process exemplarily shown in this application;
[0031] Figure 2 is a schematic diagram of an inter-frame prediction mode provided by an embodiment of the present application;
[0032] Figure 3 is a schematic diagram of candidate motion vectors provided by an embodiment of the present application;
[0033] Figure 4 is a schematic diagram of an intra-frame block copy mode provided by an embodiment of the present application;
[0034] Figure 5 is a schematic diagram of an intra-frame string replication mode provided by an embodiment of the present application;
[0035] Figure 6 is a simplified block diagram of a communication system provided by one embodiment of the present application;
[0036] Figure 7 is a schematic diagram of the placement of a video encoder and a video decoder in a streaming transmission environment exemplarily shown in the present application;
[0037] Figures 8 to 13 is a flowchart of a video decoding method provided by an embodiment of the present application;
[0038] Fig.14 is a flowchart of a video encoding method provided by an embodiment of the present application;
[0039] Fig.15 is a block diagram of a video decoding device provided by an embodiment of the present application;
[0040] Fig.16 is a block diagram of a video encoding device provided by an embodiment of the present application;
[0041] Fig.17 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0043] Before introducing the embodiments of the present application, Figure 1 A brief introduction to video encoding technology. Figure 1 A basic flow chart of a video encoding process is exemplarily shown.
[0044] Video signal refers to an image sequence consisting of multiple frames. A frame is a representation of the spatial information of a video signal. Taking the YUV mode as an example, a frame includes a brightness sample matrix (Y) and two chrominance sample matrices (Cb and Cr). From the perspective of how the video signal is obtained, it can be divided into two methods: captured by a camera and generated by a computer. Due to different statistical characteristics, the corresponding compression encoding methods may also be different.
[0045] In some mainstream video coding technologies, such as H.265 / HEVC (High Efficient Video Coding), H.266 / VVC (Versatile Video Coding), AVS (Audio Video Coding Standard) (such as AVS3), a hybrid coding framework is used to perform the following operations and processing on the input original video signal:
[0046] 1. Block partition structure: The input image is divided into several non-overlapping processing units, each of which will perform similar compression operations. This processing unit is called CTU (Coding Tree Unit) or LCU (Large Coding Unit). Below CTU, more detailed divisions can be made to obtain one or more basic coding units, called CU (Coding Unit). Each CU is the most basic element in the coding process. The following describes various coding methods that may be used for each CU.
[0047] 2. Predictive Coding: It includes intra-frame prediction and inter-frame prediction. The original video signal is predicted by the selected reconstructed video signal to obtain the residual video signal. The encoder needs to choose the most suitable one among many possible predictive coding modes for the current CU and inform the decoder. Intra-frame prediction means that the predicted signal comes from the area that has been encoded and reconstructed in the same image. Inter-frame prediction means that the predicted signal comes from other images that have been encoded and are different from the current image (called reference images).
[0048] 3. Transform coding and quantization (Transform & Quantization): The residual video signal is transformed into the transform domain through transformation operations such as DFT (Discrete Fourier Transform) and DCT (Discrete Cosine Transform), which are called transform coefficients. The signal in the transform domain is further subjected to lossy quantization operations, which loses certain information, making the quantized signal conducive to compression expression. In some video coding standards, there may be more than one transform mode to choose from, so the encoder also needs to select one of the transforms for the current CU and inform the decoder. The degree of quantization is usually determined by the quantization parameter. A larger QP (Quantization Parameter) value means that coefficients with a larger value range will be quantized to the same output, which usually results in greater distortion and lower bit rate; on the contrary, a smaller QP value means that coefficients with a smaller value range will be quantized to the same output, which usually results in less distortion and a higher bit rate.
[0049] 4. Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically compressed and encoded according to the frequency of occurrence of each value, and finally output as a binary (0 or 1) compressed bit stream. At the same time, the encoding generates other information, such as the selected mode, motion vector, etc., which also needs to be entropy encoded to reduce the bit rate. Statistical coding is a lossless coding method that can effectively reduce the bit rate required to express the same signal. Common statistical coding methods include variable length coding (VLC) or context-based binary arithmetic coding (CABAC).
[0050] 5. Loop Filtering: The encoded image can be reconstructed into a decoded image after undergoing inverse quantization, inverse transformation and prediction compensation (the reverse operation of 2 to 4 above). Compared with the original image, the reconstructed image has some information that is different from the original image due to the influence of quantization, resulting in distortion. Filtering the reconstructed image, such as deblocking, SAO (Sample Adaptive Offset) or ALF (Adaptive Lattice Filter), can effectively reduce the distortion caused by quantization. Since these filtered reconstructed images will be used as a reference for subsequent encoded images and used to predict future signals, the above filtering operation is also called loop filtering, and the filtering operation in the encoding loop.
[0051] According to the above encoding process, it can be seen that at the decoding end, for each CU, after the decoder obtains the compressed bitstream, it first performs entropy decoding to obtain various mode information and quantized transform coefficients. Each coefficient is dequantized and inversely transformed to obtain a residual signal. On the other hand, based on the known encoding mode information, the prediction signal corresponding to the CU can be obtained. After adding the two, the reconstructed signal can be obtained. Finally, the reconstructed value of the decoded image needs to undergo a loop filtering operation to generate the final output signal.
[0052] Some mainstream video coding standards, such as HEVC, VVC, AVS3, etc., all adopt a block-based hybrid coding framework. They divide the original video data into a series of coding blocks, and combine video coding methods such as prediction, transform and entropy coding to achieve video data compression. Among them, motion compensation is a commonly used prediction method for video coding. Motion compensation is based on the redundant characteristics of video content in the time domain or spatial domain, and derives the prediction value of the current coding block from the encoded area. This type of prediction method includes: inter-frame prediction, intra-frame block copy prediction, intra-frame string copy prediction, etc. In specific coding implementations, these prediction methods may be used alone or in combination. For coding blocks using these prediction methods, it is usually necessary to explicitly or implicitly encode one or more two-dimensional displacement vectors in the bitstream to indicate the displacement of the current block (or the same-position block of the current block) relative to one or more reference blocks.
[0053] It should be noted that in different prediction modes and different implementations, the displacement vector may have different names. This article uniformly describes them in the following way: 1) The displacement vector in the inter-frame prediction mode is called the motion vector (MV); 2) The displacement vector in the IBC (Intra Block Copy) prediction mode is called the block vector (BV); 3) The displacement vector in the ISC (Intra String Copy) prediction mode is called the string vector (SV). Intra-frame string copy is also called "string prediction" or "string matching".
[0054] MV refers to the displacement vector used in the inter-frame prediction mode, which points from the current image to the reference image, and its value is the coordinate offset between the current block and the reference block, where the current block and the reference block are in two different images. In the inter-frame prediction mode, motion vector prediction can be introduced. By predicting the motion vector of the current block, the predicted motion vector corresponding to the current block is obtained, and the difference between the predicted motion vector corresponding to the current block and the actual motion vector is encoded and transmitted. Compared with directly encoding and transmitting the actual motion vector corresponding to the current block, it is beneficial to save bit overhead. In the embodiment of the present application, the predicted motion vector refers to the predicted value of the motion vector of the current block obtained by the motion vector prediction technology.
[0055] BV refers to the displacement vector used in the IBC prediction mode, and its value is the coordinate offset between the current block and the reference block, where both the current block and the reference block are in the current image. In the IBC mode, block vector prediction can be introduced. By predicting the block vector of the current block, the predicted block vector corresponding to the current block is obtained, and the difference between the predicted block vector corresponding to the current block and the actual block vector is encoded and transmitted. Compared with directly encoding and transmitting the actual block vector corresponding to the current block, it is beneficial to save bit overhead. In an embodiment of the present application, the predicted block vector refers to the predicted value of the block vector of the current block obtained by the block vector prediction technology.
[0056] SV refers to the displacement vector used in the ISC prediction mode, and its value is the coordinate offset between the current string and the reference string, where both the current string and the reference string are in the current image. In the ISC mode, string vector prediction can be introduced. By predicting the string vector of the current string, a predicted string vector corresponding to the current string is obtained, and the difference between the predicted string vector corresponding to the current string and the actual string vector is encoded and transmitted. Compared with directly encoding and transmitting the actual string vector corresponding to the current string, it is beneficial to save bit overhead. In the embodiment of the present application, the predicted string vector refers to the predicted value of the string vector of the current string obtained by the string vector prediction technology.
[0057] Several different prediction modes are introduced below:
[0058] 1. Inter-frame prediction mode
[0059] like Figure 2 As shown in the figure, inter-frame prediction uses the correlation in the video time domain and uses the pixels of the adjacent encoded images to predict the pixels of the current image, so as to effectively remove the redundancy in the video time domain and effectively save the bits of the encoded residual data. Where P is the current frame, Pr is the reference frame, B is the current block to be encoded, and Br is the reference block of B. B' and B have the same coordinate position in the image, Br coordinates are (xr, yr), and B' coordinates are (x, y). The displacement between the current block to be encoded and its reference block is called the motion vector (MV), that is:
[0060] MV=(xr-x,yr-y).
[0061] Considering that adjacent blocks in the temporal or spatial domain have a strong correlation, MV prediction technology can be used to further reduce the bits required for encoding MV. In H.265 / HEVC, inter-frame prediction includes two MV prediction technologies: Merge and AMVP (Advanced Motion Vector Prediction).
[0062] The Merge mode will establish an MV candidate list for the current PU (Prediction Unit), which contains 5 candidate MVs (and their corresponding reference images). It will traverse these 5 candidate MVs and select the one with the lowest rate-distortion cost as the optimal MV. If the codec establishes the candidate list in the same way, the encoder only needs to transmit the index of the optimal MV in the candidate list. It should be noted that HEVC's MV prediction technology also has a skip mode, which is a special case of the Merge mode. After the Merge mode finds the optimal MV, if the current block is basically the same as the reference block, then there is no need to transmit the residual data, only the MV index and a skip flag.
[0063] The MV candidate list established in Merge mode includes two cases: spatial domain and temporal domain. For BSlice (B frame image), it also includes a combined list. Among them, the spatial domain provides up to 4 candidate MVs, which are established as follows: Figure 3 The spatial list is established in the order of A1→B1→B0→A0→B2, where B2 is a substitute, that is, when one or more of A1, B1, B0, A0 does not exist, the motion information of B2 needs to be used; the temporal domain only provides one candidate MV at most, and its establishment is as follows Figure 3 As shown in part (b) of , the MV of the same-position PU is scaled as follows:
[0064] curMV=td*colMV / tb;
[0065] Among them, curMV represents the MV of the current PU, colMV represents the MV of the co-located PU, td represents the distance between the current image and the reference image, and tb represents the distance between the co-located image and the reference image. If the PU at position D0 on the co-located block is not available, it is replaced by the co-located PU at position D1. For the PU in B Slice, since there are two MVs, its MV candidate list also needs to provide two MVPs (Motion Vector Predictor). HEVC generates a combination list for B Slice by combining the first 4 candidate MVs in the MV candidate list in pairs.
[0066] Similarly, the AMVP mode uses the MV correlation of neighboring blocks in the spatial and temporal domains to establish a MV candidate list for the current PU. Unlike the Merge mode, the AMVP mode selects the optimal predicted MV from the MV candidate list, and performs differential encoding with the optimal MV obtained through motion search for the current block to be encoded, that is, encoding MVD = MV-MVP, where MVD is the motion vector residual (Motion Vector Difference); by establishing the same list, the decoding end only needs the sequence number of MVD and MVP in the list to calculate the MV of the current decoding block. The MV candidate list of the AMVP mode also includes both spatial and temporal scenarios. The difference is that the length of the MV candidate list of the AMVP mode is only 2.
[0067] As mentioned above, in the AMVP mode of HEVC, MVD (Motion Vector Difference) needs to be encoded. In HEVC, the resolution of MVD is controlled by the use_integer_mv_flag in the slice_header. When the value of the flag is 0, MVD is encoded at 1 / 4 (brightness) pixel resolution; when the value of the flag is 1, MVD is encoded at an integer (brightness) pixel resolution. An adaptive motion vector precision (Adaptive Motion Vector Resolution, referred to as AMVR) method is used in VVC. This method allows each CU to adaptively select the resolution of the encoded MV. In the normal AMVP mode, the optional resolutions include 1 / 4, 1 / 2, 1 and 4 pixel resolutions. For a CU with at least one non-zero MVD component, a flag is first encoded to indicate whether the quarter brightness sampling MVD precision is used for the CU. If the flag is 0, the MVD of the current CU is encoded at 1 / 4 pixel resolution. Otherwise, a second flag needs to be encoded to indicate that the CU uses a 1 / 2 pixel resolution or other MVD resolution. Otherwise, a third flag is encoded to indicate whether 1-pixel resolution or 4-pixel resolution is used for the CU.
[0068] 2. IBC Prediction Model
[0069] IBC is an intra-frame coding tool adopted in the HEVC Screen Content Coding (Screen Content Coding, referred to as SCC) extension, which significantly improves the coding efficiency of screen content. In AVS3 and VVC, IBC technology is also adopted to improve the performance of screen content coding. IBC uses the spatial correlation of screen content video and uses the coded image pixels on the current image to predict the pixels of the current block to be coded, which can effectively save the bits required for coding pixels. Figure 4 As shown, the displacement between the current block and its reference block in IBC is called BV (block vector). H.266 / VVC uses a BV prediction technique similar to inter-frame prediction to further save the bits required to encode BV, and allows encoding BVD (Block Vector Difference) with 1 or 4 pixel resolution.
[0070] 3. ISC Forecast Model
[0071] ISC technology divides a coding block into a series of pixel strings or unmatched pixels according to a certain scanning order (such as raster scanning, round-trip scanning and Zig-Zag scanning, etc.). Similar to IBC, each string searches for a reference string of the same shape in the encoded area of the current image, derives the predicted value of the current string, and effectively saves bits by encoding the residual between the current string pixel value and the predicted value instead of directly encoding the pixel value. Figure 5 The schematic diagram of intra-frame string replication is given. The dark gray area is the encoded area, the 28 white pixels are string 1, the 35 light gray pixels are string 2, and the 1 black pixel represents the unmatched pixel. The displacement between string 1 and its reference string is Figure 4 The string vector 1 in ; the displacement between string 2 and its reference string is Figure 4 The string vector 2 in .
[0072] The intra-frame string replication technology needs to encode the SV corresponding to each string in the current coding block, the string length, and the flag of whether there is a matching string. Among them, SV represents the displacement of the string to be encoded to its reference string. The string length represents the number of pixels contained in the string. In different implementations, there are many ways to encode the string length. The following are several examples (some examples may be used in combination): 1) Encode the length of the string directly in the code stream; 2) Encode the number of pixels to be processed in the code stream, and the decoding end calculates the length of the current string according to the size N of the current block, the number of processed pixels N1, and the number of pixels to be processed obtained by decoding N2, L = N-N1-N2; 3) Encode a flag in the code stream to indicate whether the string is the last string. If it is the last string, the length of the current string L = N-N1 is calculated according to the size N of the current block and the number of processed pixels N1. If a pixel does not find a corresponding reference in the referenceable area, the pixel value of the unmatched pixel will be directly encoded.
[0073] The following table 1 shows the decoding process of BVD in the AVS3 standard (the underlined and bold fields indicate the syntax elements that need to be decoded, the ununderlined fields with capitalized first letters indicate variables, and the values of the variables can be obtained by decoding the syntax elements. The following process omits some details not related to this application):
[0074] Table 1
[0075]
[0076] Related semantic description:
[0077] 1. Intra-frame block copy mode flag ibc_cu_flag
[0078] Binary variable. A value of '1' indicates that the current coding unit is in IBC prediction mode; a value of '0' indicates that the current coding unit is not in IBC prediction mode. The value of IbcCuFlag is equal to ibc_cu_flag. If ibc_cu_flag does not exist in the bitstream, the value of IbcCuFlag is equal to 0.
[0079] 2. Adaptive block vector precision enable flag abvr_enable_flag
[0080] Binary variable. A value of '1' indicates that adaptive block vector precision can be used; a value of '0' indicates that adaptive block vector precision should not be used. The value of AbvrEnableFlag is equal to the value of abvr_enable_flag. If abvr_enable_flag is not present in the bitstream, the value of AbvrEnableFlag is 0.
[0081] 3. Adaptive block vector precision index abvr_index
[0082] Used to determine the block vector precision of the coding unit. If the abvr_index value is '0', the value of AbvrIndex is equal to 0. If the abvr_index value is '1', the value of AbvrIndex is equal to 2. If abvr_index does not exist in the bitstream, the value of AbvrIndex is equal to 0.
[0083] If the coding unit is in IBC prediction mode, the basic unit of BV is determined according to AbvrIndex:
[0084] If the value of AbvrIndex is 0, the basic unit of BV is 1 integer sample;
[0085] If the value of AbvrIndex is 1, the basic unit of BV is 4 integer samples.
[0086] 4. The absolute value of the horizontal component difference of the block vector mv_diff_x_abs_bv; the absolute value of the vertical component difference of the block vector mv_diff_y_abs_bv
[0087] The absolute value of BVD. MvDiffXAbsBv is equal to the value of mv_diff_x_abs_bv, and MvDiffYAbsBv is equal to the value of mv_diff_y_abs_bv.
[0088] 5. Block vector horizontal component difference sign value mv_diff_x_sign_bv; block vector vertical component difference sign value mv_diff_y_sign_bv
[0089] The sign bit of BVD. The value of MvDiffXSignbV is equal to the value of mv_diff_x_sign_bv, and the value of MvDiffYSignBv is equal to mv_diff_y_sign_bv. If mv_diff_x_sign_bv or mv_diff_y_sign_bv does not exist in the bitstream, the value of MvDiffXSignBv or MvDiffYSignBv is 0. If the value of MvDiffXSignBv is 0, MvDiffXBv (the horizontal component of BVD) is equal to MvDiffXAbsBv; if the value of MvDiffXSignBv is 1, MvDiffXBv is equal to -MvDiffXAbsBv. If the value of MvDiffYSignBv is 0, MvDiffYBv (the vertical component of BVD) is equal to BvDiffYAbsBv; if the value of MvDiffYSignBv is 1, BvDiffYBv is equal to -MvDiffYAbsBv. The value range of MvDiffXBv and MvDiffYBv is -32768 to 32767.
[0090] In addition, the BV export process of the IBC prediction model is as follows:
[0091] MvDiffXBv=MvDiffXBv<<(AbvrIndex+2)
[0092] MvDiffYBv=MvDiffYBv<<(AbvrIndex+2)
[0093] MvPredXBv=Rounding(MvPredXBv,AbvrIndex+2)<<(AbvrIndex+2)
[0094] MvPredYBv=Rounding(MvPredYBv,AbvrIndex+2)<<(AbvrIndex+2)
[0095] bvE_x=Clip3(-32768,32767,MvDiffXBv+MvPredXBv)
[0096] bvE_y=Clip3(-32768,32767,MvDiffYBv+MvPredYBv)
[0097] Among them, MvDiffXBv is the horizontal component of BVD, MvDiffYBv is the vertical component of BVD, MvPredXBv is the horizontal component of BVP (Block Vector Predictor), MvPredYBv is the vertical component of BVP, bvE_x is the horizontal component of BV, and bvE_y is the vertical component of BV.
[0098] Combined with Table 1, the following introduces the entropy coding scheme for MVD / BVD in the AVS3 standard. Since BVD and MVD use the same entropy coding and binarization scheme in the current AVS3 standard, taking the decoding end as an example, the following mainly introduces the entropy decoding process of BVD:
[0099] 1) First decode the absolute value of BVD horizontal direction mv_diff_x_abs_bv;
[0100] 2) If mv_diff_x_abs_bv is not 0, decode the sign of mv_diff_x_abs_bv mv_diff_x_sign_bv;
[0101] 3) Decode the absolute value of the vertical direction of BVD mv_diff_y_abs_bv;
[0102] 4) If mv_diff_y_abs_bv is not 0, decode the sign mv_diff_y_sign_bv of mv_diff_y_abs_bv.
[0103] The following is an introduction to the BVD debinarization method in the AVS3 standard (some details not relevant to this application are omitted):
[0104] 1. The steps for parsing a binary symbol string are as follows:
[0105] a) Let the value of the binary symbol index binIdx be -1 and the binary symbol string be empty;
[0106] b) Add 1 to the value of binIdx, and then do the following:
[0107] 1) If the current binary symbol is one of the following binary symbols, set the value of BypassFlag to 1;
[0108] The binary sign of mv_diff_x_sign or mv_diff_y_sign;
[0109] Binary symbols with binIdx greater than or equal to 3 in mv_diff_x_abs or mv_diff_y_abs;
[0110] 2) Otherwise, if the current binary symbol is one of the following binary symbols, set the value of BypassFlag to 0 and the value of StuffingBitFlag to 1;
[0111] The binary sign of aec_lcu_stuffing_bit;
[0112] The binary sign of the aec_ipcm_stuffing_bit.
[0113] 3) Otherwise, set the values of BypassFlag and StuffingBitFlag to 0, obtain the unique ctxIdx corresponding to each binary symbol according to binIdx, and derive the binary symbol model ctx according to ctxIdx.
[0114] c) If the current binary symbol is coeff_last, set the value of CtxWeight to 1; otherwise, set the value of CtxWeight to 0;
[0115] d) parsing the current binary symbol;
[0116] e) adding the binary symbol obtained in step c to the end of the binary symbol string to obtain an updated binary symbol string;
[0117] f) Compare the binary symbol string obtained in step d with a related table (the table records the correspondence between index values and binary symbol strings, such as Table 2 below). If the binary symbol string matches a binary symbol string in the table, the binary symbol string parsing is completed; otherwise, return to step b and continue parsing the next binary symbol.
[0118] 2. Debinarization method of mv_diff_x_abs_bv and mv_diff_y_abs_bv:
[0119] The value of synElVal is obtained by looking up Table 2 from the binary symbol string. In Table 2, if the value of synElVal is greater than or equal to 3 and the value of synElVal is an odd number, the first four bits of the binary symbol string are '1110', and the subsequent bits are the 0th order exponential Golomb code corresponding to (synElVal-3) / 2; if the value of synElVal is greater than 3 and the value of synElVal is an even number, the first four bits of the binary symbol string are '1111', and the subsequent bits are the 0th order exponential Golomb code corresponding to (synElVal-3) / 2.
[0120] The value of mv_diff_x_abs_bv or mv_diff_y_abs_bv is equal to synElVal.
[0121] Table 2
[0122]
[0123]
[0124] The following is an introduction to CABAC. The CABAC process mainly includes the following three steps:
[0125] 1. Binarization;
[0126] 2. Context modeling;
[0127] 3. Binary arithmetic coding.
[0128] After binarizing the input syntax elements, the binary data can be encoded by the conventional coding mode and the bypass coding mode. In the bypass coding mode, there is no need to assign a specific probability model to each binary bit. The input binary bit (bin) is directly encoded with a simple bypass encoder to speed up the entire encoding and decoding.
[0129] In general, different syntax elements are not completely independent, and the same syntax elements themselves also have a certain degree of memory. Therefore, according to the conditional entropy theory, conditional coding using other encoded syntax elements can further improve the coding performance compared to independent coding or memoryless coding. These encoded symbol information used as conditions are called contexts. In the conventional coding mode, the bins of syntax elements enter the context modeler sequentially. The encoder assigns a suitable probability model to each input binary bit based on the value of the previously encoded syntax element or binary bit. This process is called context modeling. After the bin and the assigned probability model are sent to the binary arithmetic encoder for encoding, the context model needs to be updated according to the bin value, which is the adaptive process in encoding.
[0130] Theoretically, the more conditions there are, the smaller the conditional entropy is, so increasing the context order can achieve better coding performance. However, as the order of the context model increases, the complexity of storing and updating the probability model will also increase at an alarming rate. If the number of probability models is reduced, the encoder will not be able to make an accurate estimate of the probability, causing a decrease in coding performance. Therefore, when designing a context model, it is necessary to consider both how to make full use of the context model to improve coding efficiency and the complexity of the probability model implementation increased by introducing the context model.
[0131] At the same time, in order to use limited probability model resources to achieve the highest possible coding performance, the application of context models must be targeted. Specifically, for those events with high probability of occurrence that play a dominant role in the impact on coding performance, a sophisticated context model can be established, and the order of the context model can be increased to achieve a more precise conditional estimate; while for low-probability events that have little impact on coding performance, a relatively simple context model can be established, and even different context models can exist, or they can be regarded as equal-probability events for encoding.
[0132] In the current AVS3 standard, the MVD of the inter-frame prediction mode and the BVD of the IBC prediction mode use the same encoding and decoding method. However, the distribution of MVD (absolute value) is relatively sharp, and most of the values are concentrated near 0. Compared with MVD, the distribution of BVD (absolute value) is relatively more dispersed, and the probability of larger values is higher. Most of the values of BVD (absolute value) are concentrated in smaller values, and then the distribution is relatively flat in the middle range. In addition, when the value of BVD in the horizontal direction is equal to 0, the probability of BVD value in the vertical direction being equal to 0 is higher.
[0133] The current encoding and decoding scheme for displacement vector residual is more suitable for encoding syntax elements such as MVD, which have a sharper distribution and tend to have smaller values. However, due to factors such as differences in the reference range restrictions of the inter-frame prediction mode and the IBC prediction mode, the distribution characteristics of MVD and BVD are not completely consistent. As mentioned above, compared with MVD, the distribution of BVD is relatively more uniform and the data skewness is relatively small. Therefore, using the encoding method suitable for MVD to encode BVD cannot fully utilize the characteristics of BVD distribution, resulting in the compression efficiency of BVD encoding not being optimal.
[0134] Based on the differences in distribution characteristics of MVD and BVD, this application proposes a displacement vector residual encoding and decoding method that is more in line with the distribution characteristics of BVD, which helps to improve the encoding and decoding efficiency of BVD, thereby improving the compression performance of the video.
[0135] like Figure 6 As shown, it shows a simplified block diagram of a communication system provided by an embodiment of the present application. The communication system 600 includes multiple devices, and the devices can communicate with each other through, for example, a network 650. For example, the communication system 600 includes a first device 610 and a second device 620 interconnected through the network 650. Figure 6In an embodiment, the first device 610 and the second device 620 perform unidirectional data transmission. For example, the first device 610 may encode video data, such as a video picture stream collected by the first device 610, for transmission to the second device 620 via the network 650. The encoded video data is transmitted in the form of one or more encoded video code streams. The second device 620 may receive the encoded video data from the network 650, decode the encoded video data to recover the video data, and display the video picture based on the recovered video data. Unidirectional data transmission is more common in applications such as media services.
[0136] In another embodiment, the communication system 600 includes a third device 630 and a fourth device 640 that perform bidirectional transmission of encoded video data, which may occur, for example, during a video conference. For bidirectional data transmission, each of the third device 630 and the fourth device 640 may encode video data (e.g., a video picture stream collected by the device) for transmission to the other of the third device 630 and the fourth device 640 via the network 650. Each of the third device 630 and the fourth device 640 may also receive encoded video data transmitted by the other of the third device 630 and the fourth device 640, and may decode the encoded video data to recover the video data, and may display the video picture on an accessible display device based on the recovered video data.
[0137] exist Figure 6 In the embodiment of, the first device 610, the second device 620, the third device 630 and the fourth device 640 may be computer devices such as servers, personal computers and smart phones, but the principles disclosed in the present application may not be limited thereto. The embodiments of the present application are applicable to PCs (Personal Computers), mobile phones, tablet computers, media players and / or dedicated video conferencing devices. The network 650 represents any number of networks that transmit encoded video data between the first device 610, the second device 620, the third device 630 and the fourth device 640, including, for example, wired and / or wireless communication networks. The communication network 650 may exchange data in circuit switching and / or packet switching channels. The network may include a telecommunications network, a local area network, a wide area network and / or the Internet. For the purposes of the present application, unless explained below, the architecture and topology of the network 650 may be irrelevant to the operations disclosed in the present application.
[0138] As an example, Figure 7The video encoder and the video decoder are shown in a streaming environment. The subject matter disclosed in the present application is equally applicable to other video-supported applications, including, for example, video conferencing, digital TV, storing compressed video on digital media including CD (Compact Disc), DVD (Digital Versatile Disc), memory stick, etc.
[0139] The streaming system may include an acquisition subsystem 713, which may include a video source 701 such as a digital camera, which creates an uncompressed video picture stream 702. In an embodiment, the video picture stream 702 includes samples taken by a digital camera. The video picture stream 702 is depicted as a thick line to emphasize the high data volume of the video picture stream compared to the encoded video data 704 (or the encoded video code stream), and the video picture stream 702 can be processed by an electronic device 720, which includes a video encoder 703 coupled to the video source 701. The video encoder 703 may include hardware, software, or a combination of hardware and software to implement or implement various aspects of the disclosed subject matter as described in more detail below. Compared to the video picture stream 702, the encoded video data 704 (or the encoded video code stream 704) is depicted as a thin line to emphasize the lower data volume of the encoded video data 704 (or the encoded video code stream 704), which can be stored on the streaming server 705 for future use. One or more streaming client subsystems, such as Figure 7 , client subsystem 706 and client subsystem 708 in the streaming server 705 can access the streaming server 705 to retrieve the copies 707 and 709 of the encoded video data 704. The client subsystem 706 may include, for example, a video decoder 710 in an electronic device 730. The video decoder 710 decodes the incoming copy 707 of the encoded video data and produces an output video picture stream 711 that can be presented on a display 712 (e.g., a display screen) or another presentation device (not depicted). In some streaming systems, the encoded video data 704, video data 707, and video data 709 (e.g., video bitstreams) may be encoded according to certain video encoding / compression standards.
[0140] It should be noted that the electronic device 720 and the electronic device 730 may include other components (not shown). For example, the electronic device 720 may include a video decoder (not shown), and the electronic device 730 may further include a video encoder (not shown). The video decoder is used to decode the received encoded video data; the video encoder is used to encode the video data.
[0141] It should be noted that the technical solution provided in the embodiments of the present application can be applied to the H.266 / VVC standard, the H.265 / HEVC standard, AVS (such as AVS3) or the next-generation video coding and decoding standard, and the embodiments of the present application are not limited to this.
[0142] Another point that needs to be explained is that the execution subject of each step of the video decoding method provided in the embodiment of the present application can be a decoding end device. The execution subject of each step of the video encoding method provided in the embodiment of the present application can be an encoding end device. The decoding end device and the encoding end device can be any computer device with data calculation, processing and storage capabilities, such as a PC, a mobile phone, a tablet computer, a media player, a dedicated video conferencing device, a server, etc.
[0143] In addition, the method provided in the present application can be used alone or in combination with other methods in any order. The encoder and decoder based on the method provided in the present application can be implemented by one or more processors or one or more integrated circuits. Below, the technical solution of the present application is introduced and explained through several embodiments.
[0144] The video decoding method provided by the present application is described below through embodiments.
[0145] Please refer to Figure 8 , which shows a flow chart of a video decoding method provided by an embodiment of the present application. The method can be applied to a decoding end device. The method can include the following steps (801-804):
[0146] Step 801: Determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs.
[0147] Optionally, the first direction is a horizontal direction or a vertical direction. The absolute value of the displacement vector residual of the current decoding unit in the first direction may be equal to 0 or may be greater than 0.
[0148] The first value interval may be any one of the above-mentioned multiple candidate value intervals. For example, the multiple candidate value intervals include: [0,5), [5,9), [9,17), [17,∞). The first value interval may be any one of the above-mentioned 4 candidate value intervals.
[0149] Optionally, multiple candidate value intervals are set based on the distribution characteristics of the displacement vector residual. For different prediction modes, such as inter-frame prediction mode, IBC prediction mode, ISC prediction mode, etc., the distribution characteristics of the displacement vector residual will be different. Therefore, when the technical solution of the present application is applied to a certain prediction mode, it is necessary to set multiple candidate value intervals based on the distribution characteristics of the displacement vector residual under this prediction mode. For example, for the IBC prediction mode, most of the absolute values of BVD are concentrated in [0,5), and then the distribution is relatively flat in the intervals of [5,9) and [9,17). Then, for the IBC prediction mode, based on the above distribution characteristics of BVD, exemplarily, the following four candidate value intervals can be set: [0,5), [5,9), [9,17), [17,∞).
[0150] It should be noted that the encoding and decoding method of the displacement vector residual provided in the embodiment of the present application is not limited to the encoding and decoding of BVD in the IBC prediction mode, but can also be applied to the encoding and decoding of SVD in the ISC prediction mode, the encoding and decoding of MVD in the inter-frame prediction mode, etc., and the embodiment of the present application does not limit this. Therefore, if the current decoding unit belongs to the IBC decoding block, the displacement vector residual is BVD; if the current decoding unit belongs to the ISC decoding block, the displacement vector residual is SVD; if the current decoding unit belongs to the decoding block of the inter-frame prediction mode, the displacement vector residual is MVD.
[0151] In addition, in the embodiments of the present application, a variety of methods are provided to determine the first value interval from multiple candidate value intervals. For example, the first value interval can be determined based on the prefix value corresponding to the displacement vector residual in the first direction; the first value interval can also be determined based on one or more range identifiers; the first value interval can also be determined in combination with the prefix value corresponding to the displacement vector residual in the first direction and one or more range identifiers. For specific methods, please refer to the description in the embodiments below.
[0152] Step 802, when it is determined based on the first value interval that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, based on the first value interval, a first suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction is determined.
[0153] In the current AVS3 standard, the prefix value corresponding to the displacement vector residual is binarized and debinarized using a truncated unary code with a truncation value of 3, and the suffix value corresponding to the displacement vector residual is binarized and debinarized using a 0-order exponential Golomb code. That is, the binarization and debinarization methods of the prefix value and the suffix value are both fixed methods.
[0154] Different from this, in the embodiment of the present application, the method for binarization and debinarization of the suffix value corresponding to the displacement vector residual is not a fixed method, but a method determined based on the value interval to which the absolute value of the displacement vector residual belongs.
[0155] For example, when the first value interval satisfies the first condition, the first suffix debinarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction is determined to be the first method; when the first value interval satisfies the second condition, the first suffix debinarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction is determined to be the second method; and the first method and the second method are two different debinarization methods, and are set based on the distribution characteristics of the absolute value of the displacement vector residual in the value interval, and are suitable for the distribution characteristics and have better encoding and decoding performance.
[0156] In an exemplary embodiment, when the first value interval satisfies the first condition, the first suffix debinarization method is determined to be a fixed-length code; when the first value interval satisfies the second condition, the first suffix debinarization method is determined to be an exponential Golomb code. Of course, in some other examples, other different debinarization methods can be set accordingly according to the conditions satisfied by the value interval, and the embodiments of the present application are not limited to this.
[0157] Step 803: Use the first suffix debinarization method to debinarize the binary symbol string of the first suffix part in the code stream to obtain the suffix value corresponding to the displacement vector residual in the first direction.
[0158] For example, when it is determined that the first suffix debinarization method is a fixed-length code, the fixed-length code is used to debinarize the first suffix partial binary symbol string in the code stream to obtain a suffix value corresponding to the displacement vector residual in the first direction. The number of decoded bits of the fixed-length code can be a pre-set fixed value or a value determined based on the first value interval.
[0159] For another example, when the first suffix debinarization method is determined to be an exponential Golomb code, the exponential Golomb code is used to debinarize the first suffix partial binary symbol string in the code stream to obtain a suffix value corresponding to the displacement vector residual in the first direction. The order of the exponential Golomb code can be a preset fixed value or a value determined based on the first value interval.
[0160] Step 804, determining the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
[0161] Optionally, this step includes the following sub-steps:
[0162] 1. Determine a first offset value based on a prefix value corresponding to a displacement vector residual in a first direction;
[0163] 2. Determine the absolute value of the displacement vector residual in the first direction based on the first offset value and the suffix value corresponding to the displacement vector residual in the first direction;
[0164] 3. When the absolute value of the displacement vector residual in the first direction is not 0, obtain the sign of the displacement vector residual in the first direction by decoding from the code stream, and determine the displacement vector residual in the first direction based on the absolute value and sign of the displacement vector residual in the first direction;
[0165] Assuming that the displacement vector residual in the first direction is denoted as y, and the absolute value of the displacement vector residual in the first direction is denoted as x, then, when the sign of the displacement vector residual in the first direction is positive, the displacement vector residual in the first direction y=x; when the sign of the displacement vector residual in the first direction is negative, the displacement vector residual in the first direction y=-x.
[0166] 4. When the absolute value of the displacement vector residual in the first direction is 0, the displacement vector residual in the first direction is directly determined to be 0, and there is no need to decode the sign of the displacement vector residual in the first direction from the code stream.
[0167] Optionally, the sign of the displacement vector residual is entropy decoded using CABAC with a corresponding context model; or, entropy decoding is performed using bypass.
[0168] In addition, for different debinarization methods, the manner of determining the prefix value, the suffix value, and the offset value may be different accordingly. For details, please refer to the description of the relevant examples in the following embodiments.
[0169] In addition, the displacement vector residual usually includes components in both the horizontal and vertical directions. Fig. 9 As shown, the video decoding method provided by the present application may also include the following steps (805-808):
[0170] Step 805: Determine, from a plurality of candidate value intervals, a second value interval to which the absolute value of the displacement vector residual of the current decoding unit in the second direction belongs.
[0171] Step 806, when it is determined based on the second value interval that the displacement vector residual in the second direction corresponds to a suffix value in addition to a prefix value, a second suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the second direction is determined based on the second value interval.
[0172] Optionally, when the second value interval satisfies the first condition, the second suffix debinarization method is determined to be a fixed-length code; when the second value interval satisfies the second condition, the second suffix debinarization method is determined to be an exponential Golomb code.
[0173] Step 807: Use the second suffix debinarization method to debinarize the binary symbol string of the second suffix part in the code stream to obtain the suffix value corresponding to the displacement vector residual in the second direction.
[0174] Step 808, determining the displacement vector residual in the second direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the second direction.
[0175] Optionally, this step includes the following sub-steps:
[0176] 1. Determine a second offset value based on a prefix value corresponding to the displacement vector residual in the second direction;
[0177] 2. Determine the absolute value of the displacement vector residual in the second direction based on the second offset value and the suffix value corresponding to the displacement vector residual in the second direction;
[0178] 3. When the absolute value of the displacement vector residual in the second direction is not 0, obtain the sign of the displacement vector residual in the second direction by decoding from the code stream, and determine the displacement vector residual in the second direction based on the absolute value and sign of the displacement vector residual in the second direction;
[0179] 4. When the absolute value of the displacement vector residual in the second direction is 0, the displacement vector residual in the second direction is directly determined to be 0, and there is no need to decode the sign of the displacement vector residual in the second direction from the code stream.
[0180] The first direction is a horizontal direction and the second direction is a vertical direction, or the first direction is a vertical direction and the second direction is a horizontal direction.
[0181] The decoding method for the displacement vector residual in the second direction is the same as or similar to the decoding method for the displacement vector residual in the first direction introduced above. This is easy to think of based on the decoding method for the displacement vector residual in the first direction introduced above, and will not be repeated here.
[0182] In an exemplary embodiment, if the prefix value corresponding to the displacement vector residual in the second direction is entropy encoded and decoded using CABAC, its first bit has a first context model and a second context model. In the case where the displacement vector residual in the first direction is decoded first and then the displacement vector residual in the second direction is decoded, if the displacement vector residual in the first direction is 0, the value of the first bit is determined based on the first context model; if the displacement vector residual in the first direction is not 0, the value of the first bit is determined based on the second context model.
[0183] In the embodiment of the present application, considering that the displacement vector residual in the horizontal direction (x direction) is 0, the probability that the displacement vector residual in the vertical direction (y direction) is also 0 is high. Therefore, for the displacement vector residual in the vertical direction (y direction), a more refined context model is established, that is, the context model of the first bit of the prefix value (the value is 0, indicating that the displacement vector residual in the vertical direction is 0) is increased to 2, and which of the above two context models to use is determined by whether the displacement vector residual in the horizontal direction is 0. In this way, the number of context models can be increased to achieve more refined conditional estimation and improve encoding and decoding efficiency.
[0184] To sum up, the technical solution provided in the embodiment of the present application, the binarization and debinarization method of the suffix value corresponding to the displacement vector residual, is not a fixed method, but a method determined based on the value interval to which the absolute value of the displacement vector residual belongs. In this way, the distribution characteristics of the absolute value of the displacement vector residual in different value intervals are realized, and a binarization and debinarization method suitable for the distribution characteristics and with better encoding and decoding performance is designed, which helps to improve the encoding and decoding efficiency and compression performance.
[0185] Please refer to Fig.10 , which shows a flow chart of a video decoding method provided by another embodiment of the present application. The method can be applied to a decoding end device. The method can include the following steps (1001-1006):
[0186] Step 1001, using a first prefix debinarization method, debinarizes a first prefix partial binary symbol string in a code stream to obtain a prefix value corresponding to a displacement vector residual of a current decoding unit in a first direction.
[0187] Optionally, the first prefix debinarization method may be truncated unary code. The first prefix part binary symbol string in the code stream is debinarized by truncated unary code to obtain a prefix value corresponding to the displacement vector residual in the first direction.
[0188] Step 1002, based on the prefix value corresponding to the displacement vector residual in the first direction, determine the first value interval to which the absolute value of the displacement vector residual in the first direction belongs from multiple candidate value intervals.
[0189] Optionally, based on the distribution characteristics of the displacement vector residual, multiple candidate value intervals are pre-set, namely, R 0 , R 1 , R 2 , …, R n , n is a positive integer. Among them, the interval R x The index is x, the interval is R x It can be expressed as [R x _start,R x _end), the determined interval related information is shown in Table 3 below:
[0190] Table 3
[0191]
[0192]
[0193] Step 1003, when it is determined based on the first value interval that the displacement vector residual in the first direction has no corresponding suffix value, the displacement vector residual in the first direction is determined based on the prefix value corresponding to the displacement vector residual in the first direction.
[0194] Step 1004, when it is determined based on the first value interval that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, based on the first value interval, determine a first suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction.
[0195] Step 1005: Use the first suffix debinarization method to debinarize the binary symbol string of the first suffix part in the code stream to obtain the suffix value corresponding to the displacement vector residual in the first direction.
[0196] Step 1006, determining the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
[0197] In this embodiment, only the decoding method of the displacement vector residual in the first direction is introduced and explained. The decoding method of the displacement vector residual in the second direction is the same or similar to this, and is not described in detail in this embodiment.
[0198] Exemplarily, the decoding method of the displacement vector residual in the first direction is as follows:
[0199] 1. Debinarize the binary symbol string of the first prefix part in the code stream by truncating the unary code to obtain the prefix value corresponding to the displacement vector residual in the first direction;
[0200] Optionally, assuming that the candidate value intervals are divided as shown in Table 3 above, the cutoff value maxVal of the truncated unary code is R 0 _end+n-1. The binary symbol string of the first prefix part in the code stream is debinarized by truncating the unary code to obtain the prefix value mv_diff_x_abs_bv_pre corresponding to the displacement vector residual in the first direction (denoted as the x direction).
[0201] Optionally, the prefix value mv_diff_x_abs_bv_pre is entropy decoded in a CABAC manner, and each binary bit has a corresponding context model.
[0202] 2. If the prefix value obtained in step 1 is less than or equal to the first threshold, determining the absolute value of the displacement vector residual in the first direction based on the prefix value;
[0203] If the prefix value obtained in step 1 is less than or equal to the first threshold, the prefix value is determined as the first offset value, and the absolute value of the displacement vector residual in the first direction is equal to the first offset value.
[0204] The first threshold can be set to R 0 _end-1. If mv_diff_x_abs_bv_pre≤R 0 _end-1, let the first offset value offset=mv_diff_x_abs_bv_pre, and the absolute value of the displacement vector residual in the first direction mv_diff_x_abs_bv=offset.
[0205] 3. If the prefix value obtained in step 1 is greater than the first threshold value and less than the second threshold value, then determine the first value interval to which the absolute value of the displacement vector residual in the first direction belongs based on the prefix value; determine the number of decoding bits n of the fixed-length code based on the first value interval, where n is a positive integer; use an n-bit fixed-length code to perform debinarization processing on the binary symbol string of the first suffix part in the code stream to obtain the suffix value corresponding to the displacement vector residual in the first direction; determine the absolute value of the displacement vector residual in the first direction based on the prefix value and the suffix value;
[0206] The second threshold can be set to R 0 _end+n-1. If R 0 _end-1<mv_diff_x_abs_bv_pre<R 0 _end+n-1, that is, mv_diff_x_abs_bv_pre=R0 _end+x-1(x=1~n-1), then the value of mv_diff_x_abs_bv belongs to the interval R x =[R x-1 _end,R x _end). Let the first offset value offset = R x-1 _end, entropy decoding from the bitstream len = Ceil (log2 (R x _end-R x-1 _end)) bits, debinarize and derive the suffix value mv_diff_x_abs_bv_suf corresponding to the displacement vector residual in the first direction in the manner of len bits of fixed-length code, then the absolute value of the displacement vector residual in the first direction mv_diff_x_abs_bv=offset+mv_diff_x_abs_bv_suf.
[0207] As an alternative, you can also debinarize the suffix value as follows:
[0208] (1) De-binarize the suffix value according to the k-order exponential Golomb code method;
[0209] (2) According to the truncated unary code (truncation value maxVal = R x _end-offset-1) to debinarize the suffix value;
[0210] (3) De-binarize the suffix value in the form of unary code.
[0211] 4. If the prefix value obtained in step 1 is equal to the second threshold, a parity flag is decoded from the code stream, and the parity flag is used to indicate the parity of the absolute value of the displacement vector residual in the first direction; the binary symbol string of the first suffix part in the code stream is debinarized using a k-order exponential Golomb code to obtain a suffix value corresponding to the displacement vector residual in the first direction, where k is an integer greater than or equal to 0; based on the prefix value, the parity flag and the suffix value, the absolute value of the displacement vector residual in the first direction is determined.
[0212] If mv_diff_x_abs_bv_pre = R 0 _end+n-1, then the value of mv_diff_x_abs_bv belongs to the interval R n =[R n-1 _end,R n _end). Let the first offset value offset = R n-1_end, continue to decode 1 bit from the bit stream to obtain the identifier mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv; after obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding on the bit stream, and debinarize it in the manner of k-order exponential Golomb code to obtain mv_diff_x_abs_bv_k_eg, then mv_diff_x_abs_bv=offset+mv_diff_x_abs_bv_parity+2*mv_diff_x_abs_bv_k_eg.
[0213] Optionally, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a CABAC manner with a corresponding context model; or, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a bypass manner.
[0214] Optionally, the order of the EGG code is k=0-5.
[0215] Next, R 0 =[0,5),R 1 =[5,9), R 2 =[9,17), R 3 =[17,33), R 4 =[33,∞), that is, n = 4, x = 0~4, R 0 Take _end=5 as an example to illustrate as follows:
[0216] 1. For the displacement vector residual value, first determine a series of candidate value intervals with integer values, denoted as R 0 =[0,5),R 1 =[5,9), R 2 =[9,17), R 3 =[17,33), R 4 =[33,∞);
[0217] 2. Decode and debinarize the code stream in a truncated unary code manner (truncated value maxVal = 5 + 4 - 1 = 8) to obtain the prefix value mv_diff_x_abs_bv_pre. If mv_diff_x_abs_bv_pre is less than or equal to 4, set offset to mv_diff_x_abs_bv_pre, then mv_diff_x_abs_bv = offset.
[0218] 3. Otherwise, if mv_diff_x_abs_bv_pre is equal to 5 (x=1), the value of mv_diff_x_abs_bv belongs to interval R 1 = [5,9). Let offset be 5, entropy decode 2 bits from the bitstream, debinarize according to the 2-bit fixed-length code and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv = offset + mv_diff_x_abs_bv_suf;
[0219] 4. Otherwise, if mv_diff_x_abs_bv_pre is equal to 6 (x=2), the value of mv_diff_x_abs_bv belongs to interval R 2 =[9,17). Let offset be 9, entropy decode 3 bits from the bitstream, debinarize according to the 3-bit fixed-length code and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv = offset + mv_diff_x_abs_bv_suf;
[0220] 5. Otherwise, if mv_diff_x_abs_bv_pre is equal to 7 (x=3), the value of mv_diff_x_abs_bv belongs to interval R 3 =[17,33). Let offset be 17, entropy decode 4 bits from the bitstream, debinarize according to the 4-bit fixed-length code and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv = offset + mv_diff_x_abs_bv_suf;
[0221] 6. Otherwise, if mv_diff_x_abs_bv_pre is equal to 5+4-1=8, then the value of mv_diff_x_abs_bv belongs to interval R 4 = [33,∞). Set offset = 33, continue to decode 1 bit from the bitstream to obtain the identifier mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv; after obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding on the bitstream, and inversely binary the value to obtain mv_diff_x_abs_bv_k_eg in the manner of k-order exponential Golomb code, then mv_diff_x_abs_bv = offset + mv_diff_x_abs_bv_parity + 2*mv_diff_x_abs_bv_k_eg.
[0222] Please refer to Fig.11 , which shows a flow chart of a video decoding method provided by another embodiment of the present application. The method can be applied to a decoding end device. The method can include the following steps (1101-1107):
[0223] Step 1101, using a first prefix debinarization method, debinarizes the first prefix partial binary symbol string in the code stream to obtain a prefix value corresponding to the displacement vector residual in the first direction of the current decoding unit.
[0224] Optionally, the first prefix debinarization method may be truncated unary code. The first prefix part binary symbol string in the code stream is debinarized by truncated unary code to obtain a prefix value corresponding to the displacement vector residual in the first direction.
[0225] Step 1102, if the prefix value corresponding to the displacement vector residual in the first direction belongs to the first value range, then based on the prefix value corresponding to the displacement vector residual in the first direction, determine the first value interval to which the absolute value of the displacement vector residual in the first direction belongs from multiple candidate value intervals.
[0226] Step 1103, if the prefix value corresponding to the displacement vector residual in the first direction belongs to the second value range, a second range identifier is decoded from the code stream, and the second range identifier is used to indicate whether the absolute value of the displacement vector residual in the first direction belongs to the second set range; based on the second range identifier, the first value interval to which the absolute value of the displacement vector residual in the first direction belongs is determined from multiple candidate value intervals.
[0227] Step 1104, when it is determined based on the first value interval that the displacement vector residual in the first direction has no corresponding suffix value, the displacement vector residual in the first direction is determined based on the prefix value corresponding to the displacement vector residual in the first direction.
[0228] Step 1105, when it is determined based on the first value interval that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, based on the first value interval, determine a first suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction.
[0229] Step 1106, using the first suffix debinarization method, debinarizes the binary symbol string of the first suffix part in the code stream to obtain the suffix value corresponding to the displacement vector residual in the first direction.
[0230] Step 1107, determining the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
[0231] In this embodiment, only the decoding method of the displacement vector residual in the first direction is introduced and explained. The decoding method of the displacement vector residual in the second direction is the same or similar to this, and is not described in detail in this embodiment.
[0232] Exemplarily, the decoding method of the displacement vector residual in the first direction is as follows:
[0233] 1. Debinarize the binary symbol string of the first prefix part in the code stream by truncating the unary code to obtain the prefix value corresponding to the displacement vector residual in the first direction;
[0234] Optionally, the truncation value maxVal of the truncated unary code is T+1, where T is an integer greater than or equal to 0. The first prefix binary symbol string in the code stream is debinarized by truncating the unary code to obtain a prefix value mv_diff_x_abs_bv_pre corresponding to the displacement vector residual in the first direction (denoted as the x direction).
[0235] Optionally, the prefix value mv_diff_x_abs_bv_pre is entropy decoded in a CABAC manner, and each binary bit has a corresponding context model.
[0236] 2. If the prefix value obtained in step 1 is less than or equal to T, then determining the absolute value of the displacement vector residual in the first direction based on the prefix value;
[0237] If the prefix value obtained in step 1 is less than or equal to T, the prefix value is determined as the first offset value, and the absolute value of the displacement vector residual in the first direction is equal to the first offset value.
[0238] If mv_diff_x_abs_bv_pre≤T, let the first offset value offset=mv_diff_x_abs_bv_pre, and the absolute value of the displacement vector residual in the first direction mv_diff_x_abs_bv=offset.
[0239] 3. If the prefix value obtained in step 1 is equal to T+1, a second range identifier is obtained by decoding from the bitstream, where the second range identifier is used to indicate whether the absolute value of the displacement vector residual in the first direction belongs to a second set range;
[0240] If mv_diff_x_abs_bv_pre=T+1, continue to decode 1 bit from the bitstream to obtain the range flag mv_diff_x_abs_bv_less_M_flag, which is used to indicate whether mv_diff_x_abs_bv is less than M, where M is an integer greater than T. For example, T=0-32, M=3-65.
[0241] Optionally, the range identifier mv_diff_x_abs_bv_less_M_flag adopts CABAC to perform entropy decoding with a corresponding context model; or, the range identifier mv_diff_x_abs_bv_less_M_flag adopts bypass to perform entropy decoding.
[0242] 4. If it is determined based on the second range identifier that the absolute value of the displacement vector residual in the first direction belongs to the second set range, the number of decoding bits n of the fixed-length code is determined based on the second set range, where n is a positive integer; the binary symbol string of the first suffix part in the code stream is debinarized by using an n-bit fixed-length code to obtain a suffix value corresponding to the displacement vector residual in the first direction; the absolute value of the displacement vector residual in the first direction is determined based on the prefix value and the suffix value;
[0243] If mv_diff_x_abs_bv_less_M_flag is equal to 1, entropy decode len=Ceil(log2(MT-1)) bits from the bit stream, debinarize them according to the len-bit fixed-length code and derive the suffix value mv_diff_x_abs_bv_suf corresponding to the displacement vector residual in the first direction, then mv_diff_x_abs_bv=mv_diff_x_abs_bv_suf+mv_diff_x_abs_bv_pre.
[0244] As an alternative, you can also debinarize the suffix value as follows:
[0245] (1) De-binarize the suffix value according to the k-order exponential Golomb code method;
[0246] (2) Debinarizing the suffix value by truncating the unary code (truncated value maxVal=MT-2);
[0247] (3) De-binarize the suffix value in the form of unary code.
[0248] 5. If it is determined based on the second range identifier that the absolute value of the displacement vector residual in the first direction does not belong to the second set range, a parity identifier is decoded from the code stream, and the parity identifier is used to indicate the parity of the absolute value of the displacement vector residual in the first direction; the binary symbol string of the first suffix part in the code stream is debinarized using a k-order exponential Columbus code to obtain a suffix value corresponding to the displacement vector residual in the first direction, where k is an integer greater than or equal to 0; based on the prefix value, the parity identifier and the suffix value, the absolute value of the displacement vector residual in the first direction is determined.
[0249] If mv_diff_x_abs_bv_less_M_flag is equal to 0, continue to decode 1 bit from the bitstream to obtain the identifier mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv; after obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding on the bitstream, and debinarize it in the manner of k-order exponential Golomb code to obtain mv_diff_x_abs_bv_k_eg, then mv_diff_x_abs_bv=M+mv_diff_x_abs_bv_parity+2*mv_diff_x_abs_bv_k_eg.
[0250] Optionally, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a CABAC manner with a corresponding context model; or, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a bypass manner.
[0251] Optionally, the order of the EGG code is k=0-5.
[0252] The following is an example using T=4 and M=9:
[0253] 1. Decode and debinarize the code stream in a truncated unary code manner (truncation value maxVal=5) to obtain a prefix value mv_diff_x_abs_bv_pre. If mv_diff_x_abs_bv_pre is less than or equal to 4, then mv_diff_x_abs_bv=mv_diff_x_abs_bv_pre;
[0254] 2. Otherwise, mv_diff_x_abs_bv_pre is equal to 5, and continue to decode 1 bit from the bitstream to obtain mv_diff_x_abs_bv_less_M_flag;
[0255] 3. If mv_diff_x_abs_bv_less_M_flag is equal to 1, entropy decode len=2 bits from the bitstream, debinarize according to the 2-bit fixed-length code and derive the suffix value mv_diff_x_abs_bv_suf, mv_diff_x_abs_bv=mv_diff_x_abs_bv_suf+mv_diff_x_abs_bv_pre;
[0256] 4. Otherwise, continue to decode 1 bit from the bit stream to obtain the identifier mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv; then, continue to perform entropy decoding on the bit stream, and debinarize it in a manner of k-order exponential Golomb code to obtain mv_diff_x_abs_bv_k_eg, then mv_diff_x_abs_bv=M+mv_diff_x_abs_bv_parity+2*mv_diff_x_abs_bv_k_eg.
[0257] Please refer to Fig.12 , which shows a flow chart of a video decoding method provided by another embodiment of the present application. The method can be applied to a decoding end device. The method can include the following steps (1201-1206):
[0258] Step 1201, decoding from the code stream to obtain a first range identifier, where the first range identifier is used to indicate whether the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs to a first set range.
[0259] Step 1202: Determine a first value interval from a plurality of candidate value intervals based on the first range identifier.
[0260] Step 1203, when it is determined based on the first value interval that the displacement vector residual in the first direction has no corresponding suffix value, the displacement vector residual in the first direction is determined based on the prefix value corresponding to the displacement vector residual in the first direction.
[0261] Step 1204, when it is determined based on the first value interval that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, based on the first value interval, determine a first suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction.
[0262] Step 1205, using the first suffix debinarization method, debinarizes the binary symbol string of the first suffix part in the code stream to obtain the suffix value corresponding to the displacement vector residual in the first direction.
[0263] Step 1206, determining the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
[0264] In this embodiment, only the decoding method of the displacement vector residual in the first direction is introduced and explained. The decoding method of the displacement vector residual in the second direction is the same or similar to this, and is not described in detail in this embodiment.
[0265] Exemplarily, the decoding method of the displacement vector residual in the first direction is as follows:
[0266] 1. Decoding from the bitstream to obtain a first range identifier, where the first range identifier is used to indicate whether the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs to a first set range;
[0267] For example, one bit is decoded from the bitstream to obtain a value of a range flag mv_diff_x_abs_bv_less_M_flag, where the range flag mv_diff_x_abs_bv_less_M_flag is used to indicate whether mv_diff_x_abs_bv is less than M, where M is an integer greater than 0, such as M=1-65.
[0268] Optionally, the range identifier mv_diff_x_abs_bv_less_M_flag adopts CABAC to perform entropy decoding with a corresponding context model; or, the range identifier mv_diff_x_abs_bv_less_M_flag adopts bypass to perform entropy decoding.
[0269] 2. If it is determined based on the first range identifier that the absolute value of the displacement vector residual in the first direction belongs to the first set range, a truncated unary code is used to perform a debinarization process on the binary symbol string of the first prefix part in the code stream to obtain a prefix value corresponding to the displacement vector residual in the first direction; and the displacement vector residual in the first direction is determined based on the prefix value;
[0270] If mv_diff_x_abs_bv_less_M_flag is equal to 1, mv_diff_x_abs_bv is obtained by decoding and debinarizing the bitstream in a truncated unary code manner (the truncation value is M-1).
[0271] Optionally, mv_diff_x_abs_bv performs entropy decoding in a CABAC manner, and each binary bit has a corresponding context model.
[0272] As an alternative, you can also perform entropy decoding and debinarization to obtain mv_diff_x_abs_bv in one of the following ways:
[0273] (1) Debinarization is performed in a unary code manner;
[0274] (2) Debinarization is performed according to the method of len-bit fixed-length code, len = Ceil(log2(M));
[0275] (3) Debinarization is performed using k-order exponential Golomb code.
[0276] 3. If, based on the first range identifier, it is determined that the absolute value of the displacement vector residual in the first direction does not belong to the first set range, a parity identifier is decoded from the code stream, and the parity identifier is used to indicate the parity of the absolute value of the displacement vector residual in the first direction; the binary symbol string of the first suffix part in the code stream is debinarized using a k-order exponential Columbus code to obtain a suffix value corresponding to the displacement vector residual in the first direction, where k is an integer greater than or equal to 0; based on the prefix value, the parity identifier and the suffix value, the absolute value of the displacement vector residual in the first direction is determined.
[0277] If mv_diff_x_abs_bv_less_M_flag is equal to 0, continue to decode 1 bit from the bit stream to obtain the identifier mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv; after obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding on the bit stream, and debinarize it in the manner of k-order exponential Golomb code to obtain mv_diff_x_abs_bv_k_eg, then mv_diff_x_abs_bv=M+mv_diff_x_abs_bv_parity+2*mv_diff_x_abs_bv_k_eg.
[0278] Optionally, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a CABAC manner with a corresponding context model; or, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a bypass manner.
[0279] Optionally, the order of the EGG code is k=0-5.
[0280] Please refer to Fig.13 , which shows a flow chart of a video decoding method provided by another embodiment of the present application. The method can be applied to a decoding end device. The method can include the following steps (1301-1307):
[0281] Step 1301: Obtain a third range identifier from the code stream by decoding, where the third range identifier is used to indicate whether the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs to a third set range.
[0282] Step 1302: If it is determined based on the third range identifier that the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs to the third set range, then the first value interval to which the absolute value of the displacement vector residual in the first direction belongs is determined based on the third set range.
[0283] Step 1303: If it is determined based on the third range identifier that the absolute value of the displacement vector residual in the first direction of the current decoding unit does not belong to the third set range, the first prefix de-binarization method is used to de-binarize the first prefix part of the binary symbol string in the code stream to obtain the prefix value corresponding to the displacement vector residual in the first direction; based on the prefix value corresponding to the displacement vector residual in the first direction, determine the first value interval to which the absolute value of the displacement vector residual in the first direction belongs from multiple candidate value intervals.
[0284] Step 1304, when it is determined based on the first value interval that the displacement vector residual in the first direction has no corresponding suffix value, the displacement vector residual in the first direction is determined based on the prefix value corresponding to the displacement vector residual in the first direction.
[0285] Step 1305, when it is determined based on the first value interval that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, based on the first value interval, determine a first suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction.
[0286] Step 1306: Use the first suffix debinarization method to debinarize the binary symbol string of the first suffix part in the code stream to obtain the suffix value corresponding to the displacement vector residual in the first direction.
[0287] Step 1307, determining the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
[0288] In this embodiment, only the decoding method of the displacement vector residual in the first direction is introduced and explained. The decoding method of the displacement vector residual in the second direction is the same or similar to this, and is not described in detail in this embodiment.
[0289] Exemplarily, the decoding method of the displacement vector residual in the first direction is as follows:
[0290] Based on the distribution characteristics of the displacement vector residual, multiple candidate value intervals are pre-set, namely R 0 , R 1 , R 2 , …, R n , n is a positive integer. Among them, the interval R x The index is x, the interval is R x It can be expressed as [R x _start,R x _end), the determined interval related information can be shown in Table 3 above.
[0291] 1. Decoding from the bitstream to obtain a third range identifier, where the third range identifier is used to indicate whether the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs to a third set range;
[0292] For example, a value of the range identifier mv_diff_x_abs_bv_M_to_N_flag is obtained by decoding 1 bit from the bitstream. The range identifier mv_diff_x_abs_bv_M_to_N_flag is used to indicate whether mv_diff_x_abs_bv belongs to the interval [M, N), where M and N are both preset values and their values are consistent with the preset candidate value interval R t For example, Table 3 shows that t is the interval index, that is, M = R t-1 _end, N = R t _end.
[0293] Optionally, the range identifier mv_diff_x_abs_bv_M_to_N_flag adopts CABAC to perform entropy decoding with a corresponding context model; or, the range identifier mv_diff_x_abs_bv_M_to_N_flag adopts bypass to perform entropy decoding.
[0294] 2. If it is determined based on the third range identifier that the absolute value of the displacement vector residual in the first direction belongs to the third set range, the number of decoding bits n of the fixed-length code is determined based on the third set range, where n is a positive integer; the binary symbol string of the first suffix part in the code stream is debinarized by using an n-bit fixed-length code to obtain a suffix value corresponding to the displacement vector residual in the first direction; the absolute value of the displacement vector residual in the first direction is determined based on the prefix value (or the first offset value) and the suffix value;
[0295] If mv_diff_x_abs_bv_M_to N_flag is equal to 1, let the first offset value offset be equal to M, entropy decode len=Ceil(log2(NM)) bits from the bit stream, debinarize and derive the suffix value mv_diff_x_abs_bv_suf according to the len-bit fixed-length code, then mv_diff_x_abs_bv=mv_diff_x_abs_bv_suf+offset.
[0296] 3. If it is determined based on the third range identifier that the absolute value of the displacement vector residual in the first direction does not belong to the third set range, a truncated unary code is used to perform a debinarization process on the binary symbol string of the first prefix part in the code stream to obtain a prefix value;
[0297] If mv_diff_x_abs_bv_M_to_N_flag equals 0, then decode and inverse binary transform from the bitstream in the way of truncated unary code (truncation value maxVal = R 0 _end + n - 2) to obtain the prefix value mv_diff_x_abs_bv_pre.
[0298] Optionally, the prefix value mv_diff_x_abs_bv_pre is entropy decoded in the way of CABAC, and each binary bit has a corresponding context model.
[0299] 4. If the prefix value is less than or equal to the first threshold value, then determine the absolute value of the displacement vector residual in the first direction based on the prefix value;
[0300] If mv_diff_x_abs_bv_pre is less than or equal to R 0 _end - 1, let the first offset value offset equal mv_diff_x_abs_bv_pre, then mv_diff_x_abs_bv = offset.
[0301] 5. If the prefix value is greater than the first threshold value and less than the second threshold value, then determine the first value range to which the absolute value of the displacement vector residual in the first direction belongs based on the prefix value; determine the decoding number n of the fixed - length code based on the first value range, where n is a positive integer; inverse binary transform the first suffix part binary symbol string in the bitstream in the way of n - bit fixed - length code to obtain the suffix value; determine the absolute value of the displacement vector residual in the first direction based on the prefix value and the suffix value;
[0302] If mv_diff_x_abs_bv_pre equals R 0 _end + x - 1, then the value of mv_diff_x_abs_bv belongs to the interval R x =[R x-1 _end,R x _end), and x < t (x = 1 ~ t - 1), let offset equal R x-1 _end, entropy decode len = Ceil(log2(R x _end - R x-1 _end)) bits from the bitstream, inverse binary transform and deduce to obtain the suffix value mv_diff_x_abs_bv_suf in the way of len - bit fixed - length code, then mv_diff_x_abs_bv = mv_diff_x_abs_bv_suf + offset.
[0303] If mv_diff_x_abs_bv_pre equals R 0_end+x-2, then the value of mv_diff_x_abs_bv belongs to the interval R x =[R x-1 _end,R x _end), and x>t(x=t+1~n-1), let offset equal to R x-1 _end, entropy decoding from the bitstream len = Ceil (log2 (R x _end-R x-1 _end)) bits, debinarize according to the len bit fixed-length code method and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv=mv_diff_x_abs_bv_suf+offset.
[0304] As an alternative, the suffix value mv_diff_x_abs_bv_suf may be entropy decoded and debinarized and its value may be derived in one of the following ways:
[0305] (1) Debinarize the suffix value mv_diff_x_abs_bv_suf according to the k-order exponential Golomb code;
[0306] (2) According to the truncated unary code (truncation value maxVal = R x _end-offset-1) method to debinarize the suffix value mv_diff_x_abs_bv_suf;
[0307] (3) Debinarize the suffix value mv_diff_x_abs_bv_suf in unary form.
[0308] 6. If the prefix value is equal to the second threshold value, a parity flag is decoded from the code stream to indicate the parity of the absolute value of the displacement vector residual in the first direction; the binary symbol string of the first suffix part in the code stream is debinarized using a k-order exponential Golomb code to obtain a suffix value, where k is an integer greater than or equal to 0; based on the prefix value, the parity flag and the suffix value, the absolute value of the displacement vector residual in the first direction is determined.
[0309] If mv_diff_x_abs_bv_pre is equal to R 0 _end+n-2(x=n), then the value of mv_diff_x_abs_bv belongs to the interval R n =[R n-1 _end,R n _end). Let offset=R n-1_end, continue to decode 1 bit from the bit stream to obtain the identifier mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv; after obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding on the bit stream, and debinarize it in the manner of k-order exponential Golomb code to obtain mv_diff_x_abs_bv_k_eg, then mv_diff_x_abs_bv=offset+mv_diff_x_abs_bv_parity+2*mv_diff_x_abs_bv_k_eg.
[0310] Optionally, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a CABAC manner with a corresponding context model; or, the parity flag mv_diff_x_abs_bv_parity is entropy decoded in a bypass manner.
[0311] Optionally, the order of the EGG code is k=0-5.
[0312] Next, R 0 =[0,5),R 1 =[5,9), R 2 =[9,17), R 3 =[17,∞), that is, n=3, x=0~3, R 0 Take _end=5 as an example to illustrate as follows:
[0313] 1. For the motion residual value, first determine a series of intervals with integer values, denoted as R 0 =[0,5),R 1 =[5,9), R 2 =[9,17), R 3 =[17,∞), let t=2, x=0~3;
[0314] 2. Entropy decode 1 bit from the bitstream to get mv_diff_x_abs_bv_9_to_17_flag;
[0315] 3. If mv_diff_x_abs_bv_9_to 17_flag is equal to 1, let offset be 9, entropy decode 3 bits from the bitstream, debinarize according to the 3-bit fixed-length code and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv is equal to mv_diff_x_abs_bv_suf+offset;
[0316] 4. Otherwise, decode and debinarize the code stream in a truncated unary code manner (truncation value maxVal = 6) to obtain the prefix value mv_diff_x_abs_bv_pre. If mv_diff_x_abs_bv_pre is less than or equal to 4, set offset to mv_diff_x_abs_bv_pre, and then set mv_diff_x_abs_bv to offset.
[0317] 5. Otherwise, if mv_diff_x_abs_bv_pre is equal to 5 (x=1), the value of mv_diff_x_abs_bv belongs to interval R 1 = [5, 9) Let offset = 5, entropy decode 2 bits from the bitstream, debinarize according to the 2-bit fixed-length code and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv is equal to mv_diff_x_abs_bv_suf + offset;
[0318] 6. Otherwise, if mv_diff_x_abs_bv_pre is equal to 6, the value of mv_diff_x_abs_bv belongs to interval R n = [17,∞). Set offset = 17, continue to decode 1 bit from the bitstream to obtain the identifier mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv; after obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding on the bitstream, and debinarize it in the manner of k-order exponential Golomb code to obtain mv_diff_x_abs_bv_k_eg, then mv_diff_x_abs_bv = offset + mv_diff_x_abs_bv_parity + 2*mv_diff_x_abs_bv_k_eg.
[0319] In an embodiment of the present application, a plurality of methods are provided to determine the value interval to which the absolute value of the displacement vector residual belongs from a plurality of candidate value intervals. In practical applications, a suitable method can be selected in combination with the prediction method adopted by the scheme or the distribution characteristics of the displacement vector residual. The embodiment of the present application does not limit this.
[0320] In addition, in the above embodiments, a variety of binarization and debinarization methods such as truncated unary code, fixed-length code, exponential Golomb code, unary code, etc. are used.
[0321] Tables 4 and 5 below show the relationship between synElVal and the binary symbol string in two forms of truncated unary codes.
[0322] Table 4
[0323]
[0324] Table 5
[0325]
[0326] Table 6 below shows the relationship between synElVal and the binary symbol string under a fixed-length code of length len.
[0327] Table 6
[0328]
[0329]
[0330] Table 7 below shows a k-order Exponential Golomb code table.
[0331] Table 7
[0332]
[0333] Tables 8 and 9 below show the relationship between synElVal and the binary symbol string in two forms of unary codes.
[0334] Table 8
[0335]
[0336]
[0337] Table 9
[0338]
[0339] The video encoding method provided by the present application is described below through an embodiment. The video encoding method corresponds to the video decoding method described in the above embodiment. For details not described in detail in the video encoding method, please refer to the description of the video decoding method.
[0340] Please refer to Fig.14 , which shows a flow chart of a video encoding method provided by an embodiment of the present application. The method can be applied to an encoding end device. The method can include the following steps (1401-1404):
[0341] Step 1401, determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs.
[0342] Optionally, the first direction is a horizontal direction or a vertical direction. The absolute value of the displacement vector residual of the current coding unit in the first direction may be equal to 0 or may be greater than 0.
[0343] The first value interval can be any one of the multiple candidate value intervals mentioned above. For example, the multiple candidate value intervals include: [0,5), [5,9), [9,17), [17,∞). The first value interval can be any one of the four candidate value intervals mentioned above. For example, the absolute value of the displacement vector residual in the first direction is 2, then the first value interval to which it belongs is [0,5). For another example, the absolute value of the displacement vector residual in the first direction is 10, then the first value interval to which it belongs is [9,17).
[0344] Optionally, multiple candidate value intervals are set based on the distribution characteristics of the displacement vector residual. For different prediction modes, such as inter-frame prediction mode, IBC prediction mode, ISC prediction mode, etc., the distribution characteristics of the displacement vector residual will be different. Therefore, when the technical solution of the present application is applied to a certain prediction mode, it is necessary to set multiple candidate value intervals based on the distribution characteristics of the displacement vector residual under this prediction mode. For example, for the IBC prediction mode, most of the absolute values of BVD are concentrated in [0,5), and then the distribution is relatively flat in the intervals of [5,9) and [9,17). Then, for the IBC prediction mode, based on the above distribution characteristics of BVD, exemplarily, the following four candidate value intervals can be set: [0,5), [5,9), [9,17), [17,∞).
[0345] It should be noted that the encoding and decoding method of the displacement vector residual provided in the embodiment of the present application is not limited to the encoding and decoding of BVD in the IBC prediction mode, but can also be applied to the encoding and decoding of SVD in the ISC prediction mode, the encoding and decoding of MVD in the inter-frame prediction mode, etc., and the embodiment of the present application does not limit this. Therefore, if the current coding unit belongs to the IBC coding block, the displacement vector residual is BVD; if the current coding unit belongs to the ISC coding block, the displacement vector residual is SVD; if the current coding unit belongs to the inter-frame prediction mode coding block, the displacement vector residual is MVD.
[0346] Step 1402, when it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value, based on the first value interval, determine a first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction.
[0347] In the current AVS3 standard, the prefix value corresponding to the displacement vector residual is binarized and debinarized using a truncated unary code with a truncation value of 3, and the suffix value corresponding to the displacement vector residual is binarized and debinarized using a 0-order exponential Golomb code. That is, the binarization and debinarization methods of the prefix value and the suffix value are both fixed methods.
[0348] Different from this, in the embodiment of the present application, the method for binarization and debinarization of the suffix value corresponding to the displacement vector residual is not a fixed method, but a method determined based on the value interval to which the absolute value of the displacement vector residual belongs.
[0349] For example, when the first value interval satisfies the first condition, the first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction is determined to be the first method; when the first value interval satisfies the second condition, the first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction is determined to be the second method; and the first method and the second method are two different binarization methods, and are set based on the distribution characteristics of the absolute value of the displacement vector residual in the value interval, and are methods that are suitable for the distribution characteristics and have better encoding and decoding performance.
[0350] In an exemplary embodiment, when the first value interval satisfies the first condition, the first suffix binarization method is determined to be a fixed-length code; when the first value interval satisfies the second condition, the first suffix binarization method is determined to be an exponential Golomb code. Of course, in some other examples, other different binarization methods can be set accordingly according to the conditions satisfied by the value interval, and the embodiments of the present application are not limited to this.
[0351] Step 1403, using the first suffix binarization method, binarizes the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string.
[0352] For example, when the first suffix binarization method is determined to be a fixed-length code, the fixed-length code is used to binarize the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string. The number of encoding bits of the fixed-length code can be a pre-set fixed value or a value determined based on the first value interval.
[0353] For another example, when the first suffix binarization method is determined to be an exponential Golomb code, the exponential Golomb code is used to binarize the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string. The order of the exponential Golomb code can be a preset fixed value or a value determined based on the first value interval.
[0354] Step 1404: Encode and generate a code stream including a binary symbol string of the first suffix part.
[0355] In the case where the displacement vector residual in the first direction corresponds to a prefix value and a suffix value, the code stream includes a first prefix part binary symbol string and a first suffix part binary symbol string. In the case where the displacement vector residual in the first direction only corresponds to a prefix value but no suffix value, the code stream only includes the first prefix part binary symbol string. The first prefix part binary symbol string is obtained by binarizing the prefix value corresponding to the displacement vector residual in the first direction using the first prefix binarization method. The first suffix part binary symbol string is obtained by the method described in the above step 1403.
[0356] Optionally, the first prefix binarization method may be a truncated unary code method. The prefix value corresponding to the displacement vector residual in the first direction is binarized by truncating the unary code to obtain a first prefix partial binary symbol string.
[0357] In addition, when the absolute value of the displacement vector residual in the first direction is not 0, it is necessary to encode the sign of the displacement vector residual in the first direction in the code stream; when the absolute value of the displacement vector residual in the first direction is 0, it is not necessary to encode the sign of the displacement vector residual in the first direction in the code stream. The sign of the displacement vector residual can be indicated by a 1-bit flag. Optionally, the sign of the displacement vector residual is entropy encoded in a CABAC manner with a corresponding context model; or, entropy encoding is performed in a bypass manner.
[0358] In addition, the displacement vector residual usually includes components in two directions: horizontal direction and vertical direction. The video encoding method provided by the present application may also include the following steps (1405-1408, Fig.14 Not shown):
[0359] Step 1405: Determine, from a plurality of candidate value intervals, a second value interval to which the absolute value of the displacement vector residual of the current coding unit in the second direction belongs.
[0360] Step 1406, when it is determined that the displacement vector residual in the second direction corresponds to a prefix value and a suffix value, based on the second value interval, determine a second suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the second direction.
[0361] Optionally, when the second value interval satisfies the first condition, the second suffix binarization method is determined to be a fixed-length code; when the second value interval satisfies the second condition, the second suffix binarization method is determined to be an exponential Golomb code.
[0362] Step 1407, using the second suffix binarization method, binarizes the suffix value corresponding to the displacement vector residual in the second direction to obtain a second suffix partial binary symbol string.
[0363] Step 1408: Encode and generate a code stream including a binary symbol string of the second suffix part.
[0364] The first direction is a horizontal direction and the second direction is a vertical direction, or the first direction is a vertical direction and the second direction is a horizontal direction.
[0365] In the case where the displacement vector residual in the second direction corresponds to a prefix value and a suffix value, the code stream includes a second prefix part binary symbol string and a second suffix part binary symbol string. In the case where the displacement vector residual in the second direction only corresponds to a prefix value but no suffix value, the code stream only includes a second prefix part binary symbol string. The second prefix part binary symbol string is obtained by binarizing the prefix value corresponding to the displacement vector residual in the second direction using a second prefix binarization method. The second suffix part binary symbol string is obtained by using the method described in step 1407 above.
[0366] Optionally, the second prefix binarization method may be a truncated unary code method. The prefix value corresponding to the displacement vector residual in the second direction is binarized by truncating the unary code to obtain a second prefix partial binary symbol string.
[0367] In addition, when the absolute value of the displacement vector residual in the second direction is not 0, the sign of the displacement vector residual in the second direction needs to be encoded in the code stream; when the absolute value of the displacement vector residual in the second direction is 0, the sign of the displacement vector residual in the second direction does not need to be encoded in the code stream.
[0368] In an exemplary embodiment, if the prefix value corresponding to the displacement vector residual in the second direction is entropy encoded and decoded using CABAC, its first bit has a first context model and a second context model. In the case where the displacement vector residual in the first direction is encoded first and then the displacement vector residual in the second direction is encoded, if the displacement vector residual in the first direction is 0, the first context model is entropy encoded based on the value of the first bit; if the displacement vector residual in the first direction is not 0, the second context model is entropy encoded based on the value of the first bit.
[0369] In the embodiment of the present application, considering that the displacement vector residual in the horizontal direction (x direction) is 0, the probability that the displacement vector residual in the vertical direction (y direction) is also 0 is high. Therefore, for the displacement vector residual in the vertical direction (y direction), a more refined context model is established, that is, the context model of the first bit of the prefix value (the value is 0, indicating that the displacement vector residual in the vertical direction is 0) is increased to 2, and which of the above two context models to use is determined by whether the displacement vector residual in the horizontal direction is 0. In this way, the number of context models can be increased to achieve more refined conditional estimation and improve encoding and decoding efficiency.
[0370] To sum up, the technical solution provided in the embodiment of the present application, the binarization and debinarization method of the suffix value corresponding to the displacement vector residual, is not a fixed method, but a method determined based on the value interval to which the absolute value of the displacement vector residual belongs. In this way, the distribution characteristics of the absolute value of the displacement vector residual in different value intervals are realized, and a binarization and debinarization method suitable for the distribution characteristics and with better encoding and decoding performance is designed, which helps to improve the encoding and decoding efficiency and compression performance.
[0371] In addition, in order to enable the decoding end device to know the value interval to which the absolute value of the displacement vector residual belongs during the decoding process, and then select the corresponding debinarization method based on the value interval to debinarize the suffix value, the encoding end device needs to encode the relevant information used to determine the above value interval into the bit stream during the encoding process, so that the decoding end device can obtain the above relevant information from the bit stream, and then decode to obtain the value interval to which the absolute value of the displacement vector residual belongs.
[0372] The following mainly introduces the encoding process of the displacement vector residual in the first direction as an example. The encoding process of the displacement vector residual in the second direction is the same or similar to it and will not be described in detail.
[0373] In one example, if the decoding end device adopts Fig.10The method provided in the embodiment determines the first value interval based on the prefix value corresponding to the displacement vector residual in the first direction. Then for the encoding end device, after determining the first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs from multiple candidate value intervals, based on the mapping relationship between the pre-set value interval and the prefix value, obtain the prefix value corresponding to the first value interval, and then encode the prefix value into the bitstream.
[0374] In another example, if the decoding end device adopts Fig.12 The method provided in the embodiment determines the first value interval based on the range identifier (such as the first range identifier). Then for the encoding end device, after determining the first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs from multiple candidate value intervals, the value of the range identifier is determined, and then the range identifier is encoded into the bitstream.
[0375] In another example, if the decoding end device adopts Fig.11 or Fig.13 The method provided in the embodiment combines the prefix value and the range identifier (such as the second range identifier or the third range identifier) to determine the first value interval. Then for the encoding end device, after determining the first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs from multiple candidate value intervals, the values of the prefix value and the range identifier are determined, and then the prefix value and the range identifier are respectively encoded into the bitstream.
[0376] In addition, both the prefix value and the range identifier may be entropy encoded using a CABAC method, or may be entropy encoded using a bypass method, which is not limited in the embodiments of the present application.
[0377] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0378] Please refer to Fig.15 , which shows a block diagram of a video decoding device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned video decoding method example, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be the decoding end device introduced above, and can also be set on the decoding end device. The device 1500 may include: an interval determination module 1510, a method determination module 1520, a debinarization module 1530 and a residual determination module 1540.
[0379] The interval determination module 1510 is used to determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs.
[0380] The method determination module 1520 is used to determine, based on the first value interval, a first suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction, when it is determined that the displacement vector residual in the first direction corresponds to a suffix value in addition to a prefix value, based on the first value interval.
[0381] The debinarization module 1530 is used to use the first suffix debinarization method to perform debinarization processing on the first suffix partial binary symbol string in the code stream to obtain the suffix value corresponding to the displacement vector residual in the first direction.
[0382] The residual determination module 1540 is used to determine the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
[0383] In an exemplary embodiment, the interval determination module 1510 is used to:
[0384] Using a first prefix debinarization method, debinarize the binary symbol string of the first prefix part in the code stream to obtain a prefix value corresponding to the displacement vector residual in the first direction;
[0385] Based on the prefix value corresponding to the displacement vector residual in the first direction, the first value interval is determined from the multiple candidate value intervals.
[0386] In an exemplary embodiment, the interval determination module 1510 is used to:
[0387] Decoding the bitstream to obtain a first range identifier, where the first range identifier is used to indicate whether an absolute value of a displacement vector residual in the first direction belongs to a first set range;
[0388] Based on the first range identifier, the first value interval is determined from the multiple candidate value intervals.
[0389] In an exemplary embodiment, the interval determination module 1510 is used to:
[0390] Using a first prefix debinarization method, debinarize the binary symbol string of the first prefix part in the code stream to obtain a prefix value corresponding to the displacement vector residual in the first direction;
[0391] If the prefix value corresponding to the displacement vector residual in the first direction belongs to the first value range, determining the first value interval from the multiple candidate value intervals based on the prefix value corresponding to the displacement vector residual in the first direction;
[0392] If the prefix value corresponding to the displacement vector residual in the first direction belongs to the second value range, a second range identifier is decoded from the code stream, and the second range identifier is used to indicate whether the absolute value of the displacement vector residual in the first direction belongs to the second set range; based on the second range identifier, the first value interval is determined from the multiple candidate value intervals.
[0393] In an exemplary embodiment, the interval determination module 1510 is used to:
[0394] Decoding the bitstream to obtain a third range identifier, where the third range identifier is used to indicate whether the absolute value of the displacement vector residual in the first direction belongs to a third set range;
[0395] If it is determined based on the third range identifier that the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs to the third set range, then the first value interval is determined based on the third set range;
[0396] If it is determined based on the third range identifier that the absolute value of the displacement vector residual of the current decoding unit in the first direction does not belong to the third set range, the first prefix de-binarization method is used to de-binarize the binary symbol string of the first prefix part in the code stream to obtain the prefix value corresponding to the displacement vector residual in the first direction; based on the prefix value corresponding to the displacement vector residual in the first direction, the first value interval is determined from the multiple candidate value intervals.
[0397] In an exemplary embodiment, the interval determination module 1510 is used to perform debinarization processing on the binary symbol string of the first prefix part in the code stream by truncating the unary code to obtain the prefix value corresponding to the displacement vector residual in the first direction.
[0398] In an exemplary embodiment, the method determines module 1520 for:
[0399] When the first value interval satisfies the first condition, determining that the first suffix debinarization method is a fixed-length code mode;
[0400] When the first value interval satisfies the second condition, the first suffix debinarization method is determined to be an exponential Golomb code.
[0401] In an exemplary embodiment, the current decoding unit belongs to an IBC decoding block, and the displacement vector residual is BVD; or, the current decoding unit belongs to an ISC decoding block, and the displacement vector residual is SVD; or, the current decoding unit belongs to a decoding block of an inter-frame prediction mode, and the displacement vector residual is MVD.
[0402] In an exemplary embodiment, the plurality of candidate value intervals are set based on distribution characteristics of the displacement vector residual.
[0403] In an exemplary embodiment, the interval determination module 1510 is further used to determine, from the multiple candidate value intervals, a second value interval to which the absolute value of the displacement vector residual of the current decoding unit in the second direction belongs.
[0404] The method determination module 1520 is also used to determine, based on the second value interval, a second suffix de-binarization method for decoding the suffix value corresponding to the displacement vector residual in the second direction when, based on the second value interval, it is determined that the displacement vector residual in the second direction corresponds to a suffix value in addition to a prefix value.
[0405] The debinarization module 1530 is further configured to perform debinarization processing on the second suffix partial binary symbol string in the code stream by using the second suffix debinarization method to obtain a suffix value corresponding to the displacement vector residual in the second direction.
[0406] The residual determination module 1540 is further used to determine the displacement vector residual in the second direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the second direction.
[0407] The first direction is a horizontal direction and the second direction is a vertical direction, or the first direction is a vertical direction and the second direction is a horizontal direction.
[0408] In an exemplary embodiment, the prefix value corresponding to the displacement vector residual in the second direction is entropy encoded and decoded using CABAC, and its first bit has a first context model and a second context model. In the case where the displacement vector residual in the first direction is decoded first and then the displacement vector residual in the second direction is decoded, the interval determination module 1510 is also used to: if the displacement vector residual in the first direction is 0, determine the value of the first bit based on the first context model; if the displacement vector residual in the first direction is not 0, determine the value of the first bit based on the second context model.
[0409] Please refer to Fig.16, which shows a block diagram of a video encoding device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned video encoding method example, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be the encoding end device introduced above, or it can be set on the encoding end device. The device 1600 may include: an interval determination module 1610, a method determination module 1620, a binarization module 1630 and a code stream generation module 1640.
[0410] The interval determination module 1610 is used to determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs.
[0411] The method determination module 1620 is used to determine a first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction based on the first value interval when it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value.
[0412] The binarization module 1630 is used to use the first suffix binarization method to binarize the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string.
[0413] The code stream generating module 1640 is used to encode and generate a code stream including the binary symbol string of the first suffix part.
[0414] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0415] Please refer to Fig.17 , which shows a block diagram of a computer device provided by an embodiment of the present application. The computer device may be the decoding end device or the encoding end device introduced above. The computer device 170 may include: a processor 171, a memory 172, a communication interface 173, an encoder / decoder 174 and a bus 175.
[0416] The processor 171 includes one or more processing cores. The processor 171 executes various functional applications and information processing by running software programs and modules.
[0417] The memory 172 may be used to store a computer program, and the processor 171 may be used to execute the computer program to implement the above-mentioned video decoding method or the above-mentioned video encoding method.
[0418] The communication interface 173 may be used to communicate with other devices, such as receiving and transmitting audio and video data.
[0419] The encoder / decoder 174 may be used to implement encoding and decoding functions, such as encoding and decoding audio and video data.
[0420] The memory 172 is connected to the processor 171 via a bus 175 .
[0421] In addition, the memory 172 can be implemented by any type of volatile or non-volatile storage device or a combination thereof. The volatile or non-volatile storage device includes but is not limited to: a magnetic disk or an optical disk, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM (Erasable Programmable Read-Only Memory), an SRAM (Static Random-Access Memory), a ROM (Read-Only Memory), a magnetic memory, a flash memory, and a PROM (Programmable Read-Only Memory).
[0422] Those skilled in the art will understand that Fig.17 The structure shown in the figure does not constitute a limitation on the computer device 170, and the computer device 170 may include more or less components than shown in the figure, or combine some components, or adopt a different arrangement of components.
[0423] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. When the at least one instruction, the at least one program, the code set or the instruction set is executed by a processor, the at least one instruction, the at least one program, the code set or the instruction set implements the above-mentioned video decoding method, or implements the above-mentioned video encoding method.
[0424] Optionally, the computer readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0425] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned video decoding method, or implements the above-mentioned video encoding method.
[0426] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0427] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A video decoding method, characterized in that: The method comprises: Determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs; In a case where it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value, based on the first value interval, determining a first suffix debinarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction; Using the first suffix debinarization method, debinarize the binary symbol string of the first suffix part in the code stream to obtain a suffix value corresponding to the displacement vector residual in the first direction; Based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction, the displacement vector residual in the first direction is determined.
2. The method according to claim 1, characterized in that The step of determining, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs includes: Using a first prefix debinarization method, debinarize the binary symbol string of the first prefix part in the code stream to obtain a prefix value corresponding to the displacement vector residual in the first direction; Based on the prefix value corresponding to the displacement vector residual in the first direction, the first value interval is determined from the multiple candidate value intervals.
3. The method according to claim 1, characterized in that The step of determining, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs includes: Decoding the bitstream to obtain a first range identifier, where the first range identifier is used to indicate whether an absolute value of a displacement vector residual in the first direction belongs to a first set range; Based on the first range identifier, the first value interval is determined from the multiple candidate value intervals.
4. The method according to claim 1, characterized in that: The step of determining, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs includes: Using a first prefix debinarization method, debinarize the binary symbol string of the first prefix part in the code stream to obtain a prefix value corresponding to the displacement vector residual in the first direction; If the prefix value corresponding to the displacement vector residual in the first direction belongs to the first value range, determining the first value interval from the multiple candidate value intervals based on the prefix value corresponding to the displacement vector residual in the first direction; If the prefix value corresponding to the displacement vector residual in the first direction belongs to the second value range, a second range identifier is decoded from the code stream, and the second range identifier is used to indicate whether the absolute value of the displacement vector residual in the first direction belongs to the second set range; based on the second range identifier, the first value interval is determined from the multiple candidate value intervals.
5. The method according to claim 1, characterized in that: The step of determining, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs includes: Decoding the bitstream to obtain a third range identifier, where the third range identifier is used to indicate whether the absolute value of the displacement vector residual in the first direction belongs to a third set range; If it is determined based on the third range identifier that the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs to the third set range, then the first value interval is determined based on the third set range; If it is determined based on the third range identifier that the absolute value of the displacement vector residual of the current decoding unit in the first direction does not belong to the third set range, the first prefix de-binarization method is used to de-binarize the binary symbol string of the first prefix part in the code stream to obtain the prefix value corresponding to the displacement vector residual in the first direction; based on the prefix value corresponding to the displacement vector residual in the first direction, the first value interval is determined from the multiple candidate value intervals.
6. The method according to claim 2, 4 or 5, characterized in that: The method of using the first prefix debinarization method to debinarize the first prefix part binary symbol string in the code stream to obtain the prefix value corresponding to the displacement vector residual in the first direction includes: The binary symbol string of the first prefix part in the code stream is debinarized by truncating the unary code to obtain a prefix value corresponding to the displacement vector residual in the first direction.
7. The method according to any one of claims 1 to 6, characterized in that: The method of determining, based on the first value interval, a first suffix debinarization method for decoding a suffix value corresponding to the displacement vector residual in the first direction includes: When the first value interval satisfies the first condition, determining that the first suffix debinarization method is a fixed-length code mode; When the first value interval satisfies the second condition, the first suffix debinarization method is determined to be an exponential Golomb code.
8. The method according to any one of claims 1 to 7, characterized in that: The current decoding unit belongs to an intra-block copy IBC decoding block, and the displacement vector residual is a block vector residual BVD; or, The current decoding unit belongs to an intra-frame string copy ISC decoding block, and the displacement vector residual is a string vector residual SVD; or, The current decoding unit belongs to a decoding block of an inter-frame prediction mode, and the displacement vector residual is a motion vector residual MVD.
9. The method according to any one of claims 1 to 8, characterized in that: The multiple candidate value intervals are set based on the distribution characteristics of the displacement vector residual.
10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: Determine, from the multiple candidate value intervals, a second value interval to which the absolute value of the displacement vector residual of the current decoding unit in the second direction belongs; In the case where it is determined that the displacement vector residual in the second direction has a prefix value and a suffix value, based on the second value interval, determining a second suffix debinarization method for decoding the suffix value corresponding to the displacement vector residual in the second direction; Using the second suffix debinarization method, debinarize the second suffix partial binary symbol string in the code stream to obtain a suffix value corresponding to the displacement vector residual in the second direction; Determine the displacement vector residual in the second direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the second direction; The first direction is a horizontal direction and the second direction is a vertical direction, or the first direction is a vertical direction and the second direction is a horizontal direction.
11. The method according to claim 10, characterized in that The prefix value corresponding to the displacement vector residual in the second direction is entropy encoded and decoded using context-based adaptive binary arithmetic coding CABAC, and its first bit has a first context model and a second context model; In the case where the displacement vector residual in the first direction is decoded first and then the displacement vector residual in the second direction is decoded, the method further includes: If the displacement vector residual in the first direction is 0, determining the value of the first bit based on the first context model; If the displacement vector residual in the first direction is not 0, the value of the first bit is determined based on the second context model.
12. The method according to any one of claims 1 to 11, characterized in that: The determining the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction includes: determining a first offset value based on a prefix value corresponding to the displacement vector residual in the first direction; determining an absolute value of the displacement vector residual in the first direction based on the first offset value and a suffix value corresponding to the displacement vector residual in the first direction; When the absolute value of the displacement vector residual in the first direction is not 0, decoding from the code stream to obtain a sign of the displacement vector residual in the first direction, and determining the displacement vector residual in the first direction based on the absolute value and sign of the displacement vector residual in the first direction; When the absolute value of the displacement vector residual in the first direction is 0, the displacement vector residual in the first direction is directly determined to be 0, and there is no need to decode the sign of the displacement vector residual in the first direction from the code stream.
13. A video encoding method, characterized in that: The method comprises: Determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs; In a case where it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value, based on the first value interval, determining a first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction; Using the first suffix binarization method, binarize the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string; The encoding generates a code stream including the binary symbol string of the first suffix part.
14. A video decoding device, characterized in that: The device comprises: An interval determination module, used to determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current decoding unit in the first direction belongs; a method determination module, configured to determine, based on the first value interval, a first suffix debinarization method for decoding the suffix value corresponding to the displacement vector residual in the first direction when it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value; a debinarization module, configured to perform debinarization processing on the binary symbol string of the first suffix part in the code stream by using the first suffix debinarization method, so as to obtain a suffix value corresponding to the displacement vector residual in the first direction; A residual determination module is used to determine the displacement vector residual in the first direction based on the prefix value and the suffix value corresponding to the displacement vector residual in the first direction.
15. A video encoding device, characterized in that: The device comprises: An interval determination module, used to determine, from a plurality of candidate value intervals, a first value interval to which the absolute value of the displacement vector residual of the current coding unit in the first direction belongs; a method determination module, configured to determine, based on the first value interval, a first suffix binarization method for encoding the suffix value corresponding to the displacement vector residual in the first direction when it is determined that the displacement vector residual in the first direction corresponds to a prefix value and a suffix value; A binarization module, configured to use the first suffix binarization method to perform binarization processing on the suffix value corresponding to the displacement vector residual in the first direction to obtain a first suffix partial binary symbol string; The code stream generation module is used to encode and generate a code stream including the binary symbol string of the first suffix part.
16. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the method according to any one of claims 1 to 13.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program, and the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 13.
18. A computer program product, characterized in that The computer program product comprises computer instructions, which are stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the method according to any one of claims 1 to 13.
