Video encoding and decoding method, device, computer readable medium and electronic device
By using Columbus codes with different orders of indexes to process displacement vector residuals in video encoding, the problem of cumbersome encoding and encoding mode in the existing technology is solved, and more efficient video encoding and decoding is achieved.
Patent Information
- Application Number
- CN202110273047.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-14
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2041-03-14
AI Technical Summary
In the existing video encoding standards, the string displacement vector encoding method in the intra string copy mode is cumbersome and has high encoding and decoding complexity, which affects the video encoding and decoding efficiency.
When the value of the first direction component of the displacement vector residual is less than 0, the k1-order exponential Columbus code is used for inverse binarization, and when the value is greater than 0, the t1-order exponential Columbus code is used for inverse binarization, the absolute value of the first direction component of the displacement vector residual is determined, thereby simplifying the encoding and decoding process.
The encoding and decoding process of displacement vector residuals is simplified, the encoding and decoding complexity is reduced, and the encoding and decoding efficiency of video is improved.
Smart Images

Figure CN115086656B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular to a video encoding and decoding method, device, computer-readable medium and electronic device. Background Art
[0002] In existing video coding standards, the motion vector encoding method used by the string displacement vector (SV) in the intra string copy (ISC) mode has a relatively complicated process and high encoding and decoding complexity, which affects the video encoding and decoding efficiency. Summary of the invention
[0003] The embodiments of the present application provide a video encoding and decoding method, apparatus, computer-readable medium and electronic device, thereby improving the encoding and decoding efficiency of the video at least to a certain extent.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a video decoding method is provided, including: decoding a symbol value of a first direction component of a displacement vector residual from a bit stream; if it is determined that the value of the first direction component of the displacement vector residual is less than 0 according to the symbol value of the first direction component of the displacement vector residual, then performing a debinarization process in accordance with a k1-order exponential Golomb code to obtain an absolute value of the first direction component of the displacement vector residual, k1≥0; if it is determined that the value of the first direction component of the displacement vector residual is greater than 0 according to the symbol value of the first direction component of the displacement vector residual, then performing a debinarization process in accordance with a t1-order exponential Golomb code to obtain an absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; determining the value of the first direction component of the displacement vector residual according to the absolute value of the first direction component of the displacement vector residual and the symbol value of the first direction component of the displacement vector residual.
[0006] According to one aspect of an embodiment of the present application, a video encoding method is provided, including: determining the symbol value of a first direction component of a displacement vector residual; if the value of the first direction component of the displacement vector residual is determined to be less than 0 according to the symbol value of the first direction component of the displacement vector residual, debinarization is performed in accordance with a k1-order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0; if the value of the first direction component of the displacement vector residual is determined to be greater than 0 according to the symbol value of the first direction component of the displacement vector residual, debinarization is performed in accordance with a t1-order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; encoding is performed according to the absolute value of the first direction component of the displacement vector residual and the symbol value of the first direction component of the displacement vector residual.
[0007] According to one aspect of an embodiment of the present application, a video decoding device is provided, including: a decoding unit, configured to decode the symbol value of the first direction component of the displacement vector residual from a bit stream; a first processing unit, configured to, if it is determined according to the symbol value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is less than 0, then perform debinarization processing in a k1-order exponential Golomb code manner to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0; a second processing unit, configured to, if it is determined according to the symbol value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is greater than 0, then perform debinarization processing in a t1-order exponential Golomb code manner to obtain the absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; a third processing unit, configured to determine the value of the first direction component of the displacement vector residual according to the absolute value of the first direction component of the displacement vector residual and the symbol value of the first direction component of the displacement vector residual.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit is configured to: decode the flag bit of the first direction component of the displacement vector residual from the code stream; if the flag bit of the first direction component of the displacement vector residual is a first value, decode the symbol value of the first direction component of the displacement vector residual from the code stream; wherein, the flag bit of the first direction component of the displacement vector residual is a first value indicating that the value of the first direction component of the displacement vector residual is not 0.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit is further configured to: if the flag bit of the first direction component of the displacement vector residual is a second value, determine that the value of the first direction component of the displacement vector residual is 0.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit is configured as: if the symbol value of the first direction component of the displacement vector residual is a first value, then it is determined that the value of the first direction component of the displacement vector residual is less than 0; if the symbol value of the first direction component of the displacement vector residual is a second value, then it is determined that the value of the first direction component of the displacement vector residual is greater than 0.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit is further configured to: decode from the code stream to obtain the absolute value of the second direction component of the displacement vector residual, and if the absolute value of the second direction component of the displacement vector residual is not 0, then decode from the code stream to obtain the symbol value of the second direction component of the displacement vector residual; the third processing unit is further configured to: determine the value of the second direction component of the displacement vector residual based on the absolute value of the second direction component of the displacement vector residual and the symbol value of the second direction component of the displacement vector residual.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit is configured to: decode and debinarize the code stream in a truncated unary code manner to obtain a prefix value of the second direction component of the displacement vector residual; and generate an absolute value of the second direction component of the displacement vector residual based on the prefix value of the second direction component of the displacement vector residual.
[0013] In some embodiments of the present application, based on the above scheme, the decoding unit is configured to: if the prefix value of the second direction component of the displacement vector residual is less than or equal to 4, use the prefix value of the second direction component of the displacement vector residual as the absolute value of the second direction component of the displacement vector residual;
[0014] If the prefix value of the second direction component of the displacement vector residual is equal to 5, the compensation value is set to 5, and based on the 2 bits obtained by further decoding from the code stream, the debinarization is performed in a 2-bit fixed-length code manner to obtain the suffix value of the second direction component of the displacement vector residual, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value of the second direction component of the displacement vector residual and the compensation value;
[0015] If the prefix value of the second direction component of the displacement vector residual is equal to 6, the compensation value is set to 9, and based on the 3 bits obtained by further decoding from the code stream, the suffix value of the second direction component of the displacement vector residual is obtained by performing debinarization processing in a 3-bit fixed-length code manner, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value of the second direction component of the displacement vector residual and the compensation value;
[0016] If the prefix value of the second direction component of the displacement vector residual is equal to 7, the compensation value is set to 17, and the parity of the absolute value of the second direction component of the displacement vector residual is determined based on the 1-bit bit obtained by continuing to decode from the code stream; continue to decode from the code stream, perform debinarization processing in accordance with the second-order exponential Golomb code, and generate the absolute value of the second direction component of the displacement vector residual based on the result of the debinarization processing in accordance with the second-order exponential Golomb code, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
[0017] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit is configured as: if the prefix value of the second direction component of the displacement vector residual is less than or equal to 2, then the prefix value of the second direction component of the displacement vector residual is used as the absolute value of the second direction component of the displacement vector residual; if the prefix value of the second direction component of the displacement vector residual is equal to 3, then the compensation value is set to 3, and based on the 1-bit bit obtained by continuing to decode from the code stream, the parity of the absolute value of the second direction component of the displacement vector residual is determined; continue to decode from the code stream, perform debinarization processing in accordance with the 0-order exponential Golomb code, and generate the absolute value of the second direction component of the displacement vector residual according to the result of the debinarization processing in accordance with the 0-order exponential Golomb code, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
[0018] In some embodiments of the present application, based on the aforementioned scheme, the displacement vector residual is: string displacement vector residual (String Vector Difference, referred to as SVD); or motion displacement vector residual (Motion Vector Difference, referred to as MVD); or block displacement vector residual (Block Vector Difference, referred to as BVD).
[0019] In some embodiments of the present application, based on the aforementioned scheme, the displacement vector residual is a string displacement vector residual SVD; the third processing unit is also configured to: if the predicted string displacement vector (String Vector Predictor, SVP for short) is not obtained, then the string displacement vector residual SVD is used as the string displacement vector SV; if the predicted string displacement vector SVP is obtained, then the string displacement vector SV is determined according to the string displacement vector residual SVD and the predicted string displacement vector SVP.
[0020] In some embodiments of the present application, based on the aforementioned scheme, the first direction component of the displacement vector residual is a vertical direction component of the string displacement vector residual.
[0021] In some embodiments of the present application, based on the aforementioned scheme, if the first direction component of the displacement vector residual is the vertical direction component of the string displacement vector residual, the decoding unit is further configured as: if the value of the vertical direction component of the string displacement vector residual is 0, then the symbol value of the horizontal direction component of the string displacement vector residual is decoded from the code stream; the first processing unit is further configured as: if it is determined that the value of the horizontal direction component of the string displacement vector residual is less than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the debinarization is performed in accordance with the k2-order exponential Golomb code to obtain the horizontal direction component of the string displacement vector residual. The absolute value of the horizontal component, k2≥0; the second processing unit is further configured as: if it is determined that the value of the horizontal component of the string displacement vector residual is greater than 0 according to the symbol value of the horizontal component of the string displacement vector residual, then debinarization is performed in accordance with the t2-order exponential Columbus code to obtain the absolute value of the horizontal component of the string displacement vector residual, t2≥0 and t2 is not equal to k2; the third processing unit is further configured as: according to the absolute value of the horizontal component of the string displacement vector residual and the symbol value of the horizontal component of the string displacement vector residual, determine the value of the horizontal component of the string displacement vector residual.
[0022] In some embodiments of the present application, based on the above scheme, if the first direction component of the displacement vector residual is a vertical direction component of the string displacement vector residual, the decoding unit is further configured to: before decoding the symbol value of the horizontal direction component of the string displacement vector residual from the bit stream, if the decoding starting row is the 0th row and the row where the starting point of the current string is located is an odd row, then decode the symbol value of the horizontal direction component of the string displacement vector residual from the bit stream;
[0023] The third processing unit is also configured to: if the row where the starting point of the current string is located is an even row, then the symbol value of the horizontal direction component of the string displacement vector residual is set to a first value to indicate that the value of the horizontal direction component of the string displacement vector residual is less than 0, and perform inverse binarization processing according to the k2-order exponential Columbus code to obtain the absolute value of the horizontal direction component of the string displacement vector residual; determine the value of the horizontal direction component of the string displacement vector residual according to the absolute value of the horizontal direction component of the string displacement vector residual and the symbol value of the horizontal direction component of the string displacement vector residual.
[0024] In some embodiments of the present application, based on the aforementioned scheme, if the first direction component of the displacement vector residual is the vertical direction component of the string displacement vector residual, the third processing unit is also configured as: if the value of the vertical direction component of the string displacement vector residual is greater than 0, the symbol value of the horizontal direction component of the string displacement vector residual is set to the first value to indicate that the value of the horizontal direction component of the string displacement vector residual is less than 0; perform inverse binarization processing in accordance with the k2-order exponential Columbus code to obtain the absolute value of the horizontal direction component of the string displacement vector residual; determine the value of the horizontal direction component of the string displacement vector residual according to the absolute value of the horizontal direction component of the string displacement vector residual and the symbol value of the horizontal direction component of the string displacement vector residual.
[0025] In some embodiments of the present application, based on the above scheme, if the first direction component of the displacement vector residual is a vertical direction component of the string displacement vector residual, the third processing unit is further configured to: if the value of the vertical direction component of the string displacement vector residual is less than 0, decode the flag bit of the horizontal direction component of the string displacement vector residual from the code stream; if the flag bit of the horizontal direction component of the string displacement vector residual is a first value, decode the symbol value of the horizontal direction component of the string displacement vector residual from the code stream; wherein the flag bit of the horizontal direction component of the string displacement vector residual is the first value indicating that the value of the horizontal direction component of the string displacement vector residual is not 0;
[0026] If it is determined that the value of the horizontal direction component of the string displacement vector residual is less than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in a k2-order exponential Golomb code manner, k2≥0;
[0027] If it is determined that the value of the horizontal direction component of the string displacement vector residual is greater than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in accordance with the t2-order exponential Golomb code, t2≥0 and t2 is not equal to k2;
[0028] The value of the horizontal direction component of the string displacement vector residual is determined according to the absolute value of the horizontal direction component of the string displacement vector residual and the sign value of the horizontal direction component of the string displacement vector residual.
[0029] In some embodiments of the present application, based on the aforementioned scheme, the third processing unit is further configured to: if the flag bit of the horizontal direction component of the string displacement vector residual is the second value, determine that the value of the horizontal direction component of the string displacement vector residual is 0.
[0030] According to one aspect of an embodiment of the present application, a video encoding device is provided, including: a determination unit, configured to determine the symbol value of a first direction component of a displacement vector residual; a fourth processing unit, configured to, if it is determined that the value of the first direction component of the displacement vector residual is less than 0 according to the symbol value of the first direction component of the displacement vector residual, then perform debinarization processing in a k1-order exponential Golomb code manner to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0; a fifth processing unit, configured to, if it is determined that the value of the first direction component of the displacement vector residual is greater than 0 according to the symbol value of the first direction component of the displacement vector residual, then perform debinarization processing in a t1-order exponential Golomb code manner to obtain the absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; an encoding unit, configured to perform encoding processing according to the absolute value of the first direction component of the displacement vector residual and the symbol value of the first direction component of the displacement vector residual.
[0031] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in the above embodiment is implemented.
[0032] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the methods described in the above embodiments.
[0033] 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 executes the methods provided in the above various optional embodiments.
[0034] In the technical solutions provided in some embodiments of the present application, when the value of the first direction component of the displacement vector residual is less than 0, debinarization is performed in accordance with the k1-order exponential Columbus code to obtain the absolute value of the first direction component of the displacement vector residual, and when the value of the first direction component of the displacement vector residual is greater than 0, debinarization is performed in accordance with the t1-order exponential Columbus code to obtain the absolute value of the first direction component of the displacement vector residual, t1 is not equal to k1, so that the absolute value of the first direction component of the displacement vector residual can be determined according to the value of the first direction component of the displacement vector residual by using Columbus codes of different orders of exponents, and then the value of the first direction component of the displacement vector residual can be determined based on the absolute value and the sign value of the first direction component of the displacement vector residual, which simplifies the encoding and decoding process of the displacement vector residual, reduces the encoding and decoding complexity, and helps to improve the encoding and decoding efficiency of the video.
[0035] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0037] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0038] Figure 2 A schematic diagram showing the placement of a video encoding device and a video decoding device in a streaming transmission system;
[0039] Figure 3 shows a basic flow chart of a video encoder;
[0040] Figure 4 A schematic diagram of inter-frame prediction is shown;
[0041] Figure 5 A schematic diagram of determining a candidate MV is shown;
[0042] Figure 6 A schematic diagram of intra-frame block copying is shown;
[0043] Figure 7 A schematic diagram of intra-frame string replication is shown;
[0044] Figure 8A flowchart of a video decoding method according to an embodiment of the present application is shown;
[0045] Fig. 9 A flowchart of a video decoding method according to an embodiment of the present application is shown;
[0046] Fig.10 A flowchart of a video decoding method according to an embodiment of the present application is shown;
[0047] Fig.11 A block diagram of a video decoding device according to an embodiment of the present application is shown;
[0048] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0050] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0051] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0052] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0053] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0054] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.
[0055] like Figure 1 As shown, the system architecture 100 includes a plurality of terminal devices, which can communicate with each other through, for example, a network 150. For example, the system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected through the network 150. Figure 1 In the embodiment of the present invention, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
[0056] For example, the first terminal device 110 may encode video data (e.g., a video picture stream captured by the terminal device 110) for transmission to the second terminal device 120 via the network 150. The encoded video data is transmitted in the form of one or more encoded video code streams. The second terminal device 120 may receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display the video picture based on the restored video data.
[0057] In one embodiment of the present application, the system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded video data, which may occur during a video conference, for example. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (e.g., a video picture stream collected by the terminal device) to transmit to the other terminal device of the third terminal device 130 and the fourth terminal device 140 through the network 150. Each of the third terminal device 130 and the fourth terminal device 140 may also receive the encoded video data transmitted by the other terminal device of the third terminal device 130 and the fourth terminal device 140, and may decode the encoded video data to restore the video data, and may display the video picture on an accessible display device according to the restored video data.
[0058] exist Figure 1In the embodiment of the present invention, the first terminal device 110, the second terminal device 120, the third terminal device 130 and the fourth terminal device 140 may be servers, personal computers and smart phones, but the principles disclosed in the present application may not be limited thereto. The embodiments disclosed in the present application are applicable to laptop computers, tablet computers, media players and / or dedicated video conferencing equipment. The network 150 represents any number of networks that transmit encoded video data between the first terminal device 110, the second terminal device 120, the third terminal device 130 and the fourth terminal device 140, including, for example, wired and / or wireless communication networks. The communication network 150 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 purpose of the present application, unless explained below, the architecture and topology of the network 150 may be irrelevant to the operation disclosed in the present application.
[0059] In one embodiment of the present application, Figure 2 The placement of the video encoding device and the video decoding device in the streaming environment is shown. The subject matter disclosed in the present application can be equally applicable to other video-supported applications, including, for example, video conferencing, digital TV (television), storing compressed video on digital media including CD, DVD, memory stick, etc.
[0060] The streaming system may include an acquisition subsystem 213, which may include a video source 201 such as a digital camera, which creates an uncompressed video picture stream 202. In an embodiment, the video picture stream 202 includes samples taken by a digital camera. The video picture stream 202 is depicted as a thick line to emphasize the high data volume of the video picture stream compared to the encoded video data 204 (or the encoded video code stream 204), and the video picture stream 202 can be processed by an electronic device 220, which includes a video encoding device 203 coupled to the video source 201. The video encoding device 203 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 202, the encoded video data 204 (or the encoded video code stream 204) is depicted as a thin line to emphasize the lower data volume of the encoded video data 204 (or the encoded video code stream 204), which can be stored on the streaming server 205 for future use. One or more streaming client subsystems, such as Figure 2, can access the streaming server 205 to retrieve the copies 207 and 209 of the encoded video data 204. The client subsystem 206 can include, for example, a video decoding device 210 in the electronic device 230. The video decoding device 210 decodes the incoming copy 207 of the encoded video data and generates an output video picture stream 211 that can be presented on a display 212 (e.g., a display screen) or another presentation device. In some streaming systems, the encoded video data 204, the video data 207, and the video data 209 (e.g., video bitstreams) can be encoded according to certain video encoding / compression standards.
[0061] It should be noted that the electronic device 220 and the electronic device 230 may include other components not shown in the figure. For example, the electronic device 220 may include a video decoding device, and the electronic device 230 may also include a video encoding device.
[0062] In one embodiment of the present application, taking the international video coding standards HEVC (High Efficiency Video Coding), VVC (Versatile Video Coding), and China's national video coding standard AVS as examples, after a video frame image is input, the video frame image will be divided into several non-overlapping processing units according to a block size, and each processing unit will perform similar compression operations. This processing unit is called CTU (Coding Tree Unit), or LCU (Largest Coding Unit). CTU can continue to be divided more finely to obtain one or more basic coding units CU (Coding Unit), which is the most basic element in a coding link.
[0063] The following introduces some concepts when encoding CU:
[0064] Predictive Coding: Predictive coding 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 decide which predictive coding mode to choose for the current CU and inform the decoder. Intra-frame prediction means that the predicted signal comes from the encoded and reconstructed area in the same image; inter-frame prediction means that the predicted signal comes from other images that have been encoded and different from the current image (called reference images).
[0065] Transform & Quantization: After the residual video signal is transformed by DFT (Discrete Fourier Transform), DCT (Discrete Cosine Transform), etc., the signal is converted into the transform domain, which is called the transform coefficient. The transform coefficient is further subjected to lossy quantization operation, which loses a certain amount of information, making the quantized signal conducive to compression expression. In some video coding standards, there may be more than one transform method to choose from, so the encoder also needs to select one of the transform methods for the current CU and inform the decoder. The degree of quantization is usually determined by the quantization parameter (QP). A larger QP 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.
[0066] 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 coding mode, motion vector data, etc., which also need 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).
[0067] The CABAC process mainly includes three steps: binarization, context modeling, and binary arithmetic coding. After the input syntax elements are binarized, the binary data can be encoded through the conventional coding mode and the bypass coding mode. The bypass coding mode does not need to assign a specific probability model to each binary bit. The input binary bit bin value is directly encoded with a simple bypass encoder to speed up the entire encoding and decoding. In general, different syntax elements are not completely independent, and the same syntax element itself has a certain memory. Therefore, according to the conditional entropy theory, conditional encoding using other encoded syntax elements can further improve the encoding performance compared to independent encoding or memoryless encoding. These encoded symbol information used as conditions are called context. In the conventional coding mode, the binary bits of the syntax elements enter the context modeler sequentially. The encoder assigns a suitable probability model to each input binary bit according to the value of the previously encoded syntax element or binary bit. This process is called context modeling. The context model corresponding to the syntax element can be located through ctxIdxInc (context index increment) and ctxIdxStart (context index Start). After the bin value 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.
[0068] Loop Filtering: The changed and quantized signal will be reconstructed through inverse quantization, inverse transformation and prediction compensation operations to obtain a reconstructed image. Compared with the original image, due to the influence of quantization, some information of the reconstructed image is different from the original image, that is, the reconstructed image will produce distortion. Therefore, the reconstructed image can be filtered, such as deblocking filter (DB), SAO (Sample Adaptive Offset) or ALF (Adaptive Loop Filter) and other filters, which can effectively reduce the degree of distortion caused by quantization. Since these filtered reconstructed images will be used as a reference for subsequent encoded images to predict future image signals, the above filtering operation is also called loop filtering, that is, filtering operation within the encoding loop.
[0069] In one embodiment of the present application, Figure 3 A basic flow chart of a video encoder is shown, in which intra-frame prediction is used as an example for explanation.k [x,y] and predicted image signal Perform difference operation to obtain the residual signal u k [x,y], residual signal u k [x,y] is transformed and quantized to obtain the quantized coefficients. The quantized coefficients are entropy coded to obtain the encoded bit stream, and the reconstructed residual signal u' is obtained through inverse quantization and inverse transformation. k [x,y], predicted image signal and reconstructed residual signal u' k [x,y] superposition generates image signal Image signal On the one hand, it is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing, and on the other hand, the reconstructed image signal s' is output through loop filtering k [x,y], reconstructed image signal s' k [x,y] can be used as the reference image for the next frame for motion estimation and motion compensation prediction. Then based on the result of motion compensation prediction s' r [x+m x ,y+m y ] and intra prediction results Get the predicted image signal of the next frame And continue to repeat the above process until the encoding is completed.
[0070] Based on the above encoding process, at the decoding end, for each CU, after obtaining the compressed code stream (i.e., bit stream), entropy decoding is performed to obtain various mode information and quantization coefficients. The quantization coefficients are then 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, and then the residual signal and the prediction signal are added to obtain the reconstructed signal. The reconstructed signal is then subjected to loop filtering and other operations to generate the final output signal.
[0071] The current mainstream video coding standards (such as HEVC, VVC, AVS3) all adopt a block-based hybrid coding framework. Specifically, the original video data is divided into a series of coding blocks, combined with video coding methods such as prediction, transformation 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.
[0072] It should be noted that in different prediction modes and different implementations, the displacement vector may have different names. In the embodiments of the present application, they are uniformly described in the following manner: 1) The displacement vector in inter-frame prediction is called a motion displacement vector (Motion Vector, MV for short); 2) The displacement vector in intra-frame block copying is called a block displacement vector (Block Vector, BV for short); 3) The displacement vector in intra-frame string copying is called a string displacement vector.
[0073] like Figure 4 As shown in the figure, inter-frame prediction uses the correlation in the video time domain and uses the pixels of the adjacent coded images to predict the pixels of the current image, so as to effectively remove the temporal redundancy of the video and effectively save the bits of the coded residual data. Wherein, P represents the current frame, Pr represents the reference frame, B represents the current coded block, and Br represents the reference block of B. The coordinates of B' in the reference frame are the same as those of B in the current frame. The coordinates of Br are (x r ,y r ), the coordinates of B' are (x, y), and the displacement between the current coding block and its reference block is called the motion vector (MV), where MV = (x r -x,y r -y).
[0074] Considering that adjacent blocks in the time domain 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). The Merge mode will establish an MV candidate list for the current PU (prediction unit), in which there are 5 candidate MVs (and their corresponding reference images). 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 finding the optimal MV through the Merge mode, if the current block and the reference block are basically the same, then there is no need to transmit residual data, only the index of the MV and a skip flag.
[0075] The MV candidate list established in Merge mode includes both spatial and temporal scenarios. For B Slice, it also includes a combined list. The spatial domain provides up to 4 candidate MVs. Figure 5 As shown in (a), the spatial domain 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 at most one candidate MV, and its establishment is as follows Figure 5 As shown in (b), the MV of the same-position block is expanded and contracted as follows:
[0076] curMV=td / tb×colMV
[0077] Among them, curMV and colMV represent the MVs of the current block and the co-located block respectively, and td and tb represent the distances between the current image and the co-located image and their reference images respectively. If the PU at position D0 on the co-located block is not available, it is replaced with the co-located PU at position D1; for the PU in the B Slice, since there are two MVs, its MV candidate list also needs to provide two MVPs. HEVC generates a combination list for B Slice by combining the first four candidate MVs in the MV candidate list in pairs.
[0078] Similarly, the AMVP mode uses the MV correlation of neighboring blocks in the spatial and temporal domains to establish a candidate prediction MV list for the current PU. Unlike the Merge mode, the AMVP mode selects the optimal predicted MV from the candidate prediction MV list, and performs differential encoding with the optimal MV obtained through motion search for the current coding block, that is, the encoded MVD = MV-MVP; the decoding end establishes the same list, and only needs the MVD and the sequence number of MVP (Motion Vector Predictor) in the list to calculate the MV of the current coding block. The AMVP candidate MV list also includes both spatial and temporal cases, but the difference is that the length of the AMVP list is only 2.
[0079] HMVP (History based Motion Vector Prediction) is a new MV prediction technology adopted in H.266 / VVC. HMVP is a motion vector prediction method based on historical information. The motion information of the historical coding block is stored in the HMVP list and used as the MVP of the current CU. H.266 / VVC adds HMVP to the candidate list of Merge mode, and its order is after the spatial and temporal MVP. The HMVP technology stores the motion information of the previous coding block in a first-input first-output (FIFO) queue. If the stored prediction candidate information is the same as the motion information just encoded, the duplicate candidate information will be removed first, and then all HMVP candidate information will be moved forward, and the motion information of the current coding unit will be added to the end of the FIFO queue. If the motion information of the current coding unit is different from the motion information of any candidate in the FIFO queue, the latest motion information is added to the end of the FIFO queue. When adding new motion information to the HMVP list, if the list has reached the maximum length, the first candidate information in the FIFO queue is removed, and the latest motion information is added to the end of the FIFO queue. The HMVP list will be reset (i.e. cleared) when encountering a new CTU row. In H.266 / VVC, the HMVP list size is set to 6. In order to reduce the number of redundant check operations, the following simplification strategy is introduced:
[0080] 1. Set the number of HMVP candidates used for Merge list generation to (N<=4)?M: (8-N), where N represents the number of existing candidates in the Merge list, and M represents the number of available HMVP candidates in the Merge list.
[0081] 2. Once the length of the available Merge list reaches the maximum allowed length minus 1, the HMVP merge candidate list construction process terminates.
[0082] Intra Block Copy (IBC) is a coding tool adopted in the HEVC Screen Content Coding (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 pixels of the encoded image on the current image to predict the pixels of the current block to be encoded, which can effectively save the bits required for encoding pixels. Figure 6 As shown, in IBC, the displacement between the current block and its reference block is called a block displacement vector (BlockVector, abbreviated as BV). H.266 / VVC uses a similar inter-frame prediction BV technology to further save the bits required for encoding BV.
[0083] Intra-frame string copying technology divides a coding block into a series of pixel strings or unmatched pixels according to a certain scanning order (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 encodes the residual between the current string pixel value and the predicted value instead of directly encoding the pixel value, which can effectively save bits. Figure 7 A 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 an unmatched pixel. The displacement of string 1 to the matched encoded string in the encoded area is called string vector 1, and the displacement of string 2 to the matched encoded string in the encoded area is called string vector 2.
[0084] The intra-frame string replication technology needs to encode the string vector (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, the string vector represents the displacement of the string to be encoded to its reference string, and 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 after the string is processed in the code stream, and the decoding end calculates the length of the current string L = N-N1-N2 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; 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.
[0085] Intra-block copy IBC and intra-string copy ISC are two screen content coding tools in AVS3, both of which use the current image as a reference and derive the prediction value of the coding unit through motion compensation. Considering that IBC and ISC have similar reference areas, the block displacement vector (BV) and string displacement vector (SV) have a high correlation, so the coding efficiency is further improved by allowing prediction between the two. AVS3 uses an intra-frame prediction history motion information table similar to HMVP (i.e., IntraHMVP) to record the displacement vector information, position information, size information, and number of repetitions of these two types of coding blocks, and IntraHMVP derives the predicted block displacement vector (Block Vector Predictor, referred to as BVP) and predicted string displacement vector.
[0086] AVS3 uses a method called Class based Block Vector Prediction (CBVP) to derive BVP, which classifies candidate BVs in IntraHMVP according to the following conditions:
[0087] Category 0: The area of the historical coding block is greater than or equal to 64 pixels;
[0088] Category 1: The frequency of BV is greater than or equal to 2;
[0089] Category 2: The coordinates of the upper left corner of the historical coding block are located to the left of the coordinates of the upper left corner of the current block;
[0090] Category 3: The coordinates of the upper left corner of the historical coding block are above the coordinates of the upper left corner of the current block;
[0091] Category 4: The coordinates of the upper left corner of the historical coding block are located to the upper left of the coordinates of the upper left corner of the current block;
[0092] Category 5: The coordinates of the upper left corner of the historical coding block are located above and to the right of the coordinates of the upper left corner of the current block;
[0093] Category 6: The coordinates of the upper left corner of the historically encoded block are located to the lower left of the coordinates of the upper left corner of the current block.
[0094] Among them, the instances in each category are arranged in reverse order of the coding order (that is, the closer the coding order is to the current block, the higher the order), and the BV corresponding to the first historical coding block is the candidate BV corresponding to the class, and then the candidate BV corresponding to each category is added to the CBVP list in the order of category 0 to category 6. When adding a new BV to the CBVP list, it is necessary to check whether there are duplicate BVs in the CBVP list. Only when there are no duplicate BVs, the BV is added to the CBVP list. The encoder selects the best candidate BV in the CBVP list as the BVP, and encodes an index in the bitstream, which indicates the index of the category corresponding to the best candidate BV in the CBVP list. The decoder decodes the BVP from the CBVP list according to the index.
[0095] After the decoding of the current prediction unit is completed, if the prediction type of the current prediction unit is block copy intra prediction, when NumOfIntraHmvpCand (the number of motion information in the historical motion information list) is greater than 0, the IntraHMVP is updated according to the method in the following embodiment based on the motion information of the block copy intra prediction of the current prediction block. The intra prediction motion information of the current prediction block includes displacement vector information, position information, size information and number of repetitions, wherein the displacement vector information of the block copy intra prediction block is a block displacement vector; the position information includes the upper left corner horizontal coordinate and the upper left corner vertical coordinate of the current prediction block; the size information is the product of the width and the height; the number of repetitions of the current prediction block is initialized to 0.
[0096] At the same time, AVS3 encodes an index for each string in the ISC coding block, indicating the position of the SVP of the string in IntraHMVP. Similar to the skip mode in inter-frame prediction, the SV of the current string is equal to the SVP, and there is no need to encode the residual SVD between the SV and SVP.
[0097] After the decoding of the current prediction unit is completed, if the prediction type of the current prediction unit is string copy intra prediction, when NumOfIntraHmvpCand is greater than 0, IntraHMVP is updated according to the method in the following embodiment based on the intra prediction motion information of the current prediction block. The intra prediction motion information includes displacement vector information, position information, size information and number of repetitions, wherein the displacement vector information of the current string is a string vector; the position information includes the horizontal coordinate and the vertical coordinate of the first pixel sample of the string; the size information is the string length of the part; and the number of repetitions is initialized to 0.
[0098] The following introduces the update process of the intra-frame prediction historical motion information table IntraHMVP: The intra-frame prediction motion information includes displacement vector information, position information, size information and number of repetitions. After completing the decoding of the current prediction unit, if the prediction type of the current prediction unit is block copy intra-frame prediction or string copy intra-frame prediction, and NumOfIntraHmvpCand is greater than 0, then according to the intra-frame prediction motion information of the current prediction block, update the intra-frame prediction historical motion information table IntraHmvpCandidateList. Assuming that the displacement vector information, position information, size information and number of repetitions of IntraHmvpCandidateList[X] are recorded as intraMvCandX, posCandX, sizeCandX and cntCandX respectively, perform the following process:
[0099] Step 101, initialize X to 0, and initialize cntCur to 0.
[0100] Step 102: If CntIntraHmvp=0, IntraHmvpCandidateList[CntIntraHmvp] is the intra prediction motion information of the current prediction unit, and CntIntraHmvp is increased by 1.
[0101] Step 103: If CntIntraHmvp≠0, determine whether the intra prediction motion information of the current prediction block is the same as IntraHmvpCandidateList[X] according to whether intraMvCur and intraMvCandX are equal:
[0102] Step 1031, if intraMvCur and intraMvCandX are the same, execute step 104, otherwise, add 1 to X.
[0103] Step 1032, if X is less than CntIntraHmvp, execute step 103; otherwise, execute step 105.
[0104] Step 104, cntCur is equal to the value of cntCandX plus 1. If sizeCur is less than sizeCandX, the current sizeCur is equal to sizeCandX.
[0105] Step 105, if X is less than CntIntraHmvp, then:
[0106] Step 1051, i increases from X to CntIntraHmvp-1, and IntraHmvpCandidateList[i] is equal to IntraHmvpCandidateList[i+1];
[0107] Step 1052, IntraHmvpCandidateList[CntIntraHmvp-1] is equal to the intra-frame prediction motion information of the current prediction unit.
[0108] Step 106: If X is equal to CntIntraHmvp and CntIntraHmvp is equal to NumOfIntraHmvpCand, then:
[0109] Step 1061, i ranges from 0 to CntIntraHmvp-1, and IntraHmvpCandidateList[i] is equal to IntraHmvpCandidateList[i+1];
[0110] Step 1062, IntraHmvpCandidateList[CntIntraHmvp-1] is equal to the intra prediction motion information of the current prediction unit.
[0111] Step 107: If X is equal to CntIntraHmvp and CntIntraHmvp is less than NumOfIntraHmvpCand, then IntraHmvpCandidateList[CntIntraHmvp] is equal to the intra prediction motion information of the current prediction unit, and CntIntraHmvp is increased by 1.
[0112] The following introduces the decoding process of the string displacement vector SV in AVS3. In the current AVS3, taking the string scanning direction as the horizontal direction as an example, referring to Table 1, the main process of SV (IscSvX, IscSvY) decoding in AVS3 is as follows (the underlined and bold fields in Table 1 represent the syntax elements to be decoded, and the fields without underlined capital letters represent variables, and the values of the variables can be obtained by decoding the syntax elements):
[0113] Step 201 , decoding the string vector above flag isc_sv_above_flag. If the value of isc_sv_above_flag is 1, the value of IscSvX is 0, and the value of IscSvY is -1.
[0114] Step 202: If the value of isc_sv_above_flag is 0, decode the string vector history flag isc_sv_recent_flag. If the value of isc_sv_recent_flag is 1, continue to decode the string vector history index isc_sv_recent_index, and look up the table to obtain the values of IscSvX and IscSvY according to the value of isc_sv_recent_index and the intra-frame prediction history motion information table.
[0115] Step 203: If the value of isc_sv_recent_flag is 0, decode to obtain SV according to the following steps:
[0116] Step 2031, decoding string vector Y component flag isc_sv_y_non_zero_flag;
[0117] Step 2032: If the value of isc_sv_y_non_zero_flag is 0, that is, the value of IscSvY is 0, decode to obtain IscSvx according to the following steps:
[0118] (1) If the value of IsOddRow is 1, that is, the row where the current string is located is an odd row (the starting row is row 0), then decode the string vector X component sign bit isc_sv_x_sign and obtain the value of isc_sv_x_sign; if the value of isc_sv_x_sign is 1, that is, the value of IscSvx is less than 0; if the value of isc_sv_x_sign is 0, that is, the value of IscSvx is greater than 0;
[0119] (2) If the value of IsOddRow is 0, set the value of isc_sv_x_sign to 1, that is, the value of IscSvx is less than 0;
[0120] (3) Decode and debinarize the absolute value of the string vector X component isc_sv_x_abs_minus1 according to the method of the third-order exponential Golomb code. Then the value of IscSvXAbs is equal to isc_sv_x_abs_minus1+1, and then combined with the value of isc_sv_x_sign, the value of IscSvX can be obtained.
[0121] Step 2033, if the value of isc_sv_y_non_zero_flag is 1, that is, the value of IscSvY is not 0, decode in sequence according to the following steps to obtain IscSvy and IscSvx:
[0122] (1) Decode the string vector Y component sign bit isc_sv_y_sign and obtain the value of isc_sv_y_sign; if the value of isc_sv_y_sign is 1, that is, the value of IscSvy is less than 0; if the value of isc_sv_y_sign is 0, that is, the value of IscSvy is greater than 0;
[0123] (2) Decode and de-binarize the absolute value of the Y component of the string vector isc_sv_y_abs_minus1 according to the method of the third-order exponential Golomb code. Then the value of IscSvYAbs is equal to isc_sv_y_abs_minus1+1. Combined with the value of isc_sv_y_sign, the value of IscSvY can be obtained;
[0124] (3) If the value of isc_sv_y_sign is 0, that is, the value of IscSvy is greater than 0, then decode and de-binarize according to the 3rd-order exponential Columbus method to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1, then the value of IscSvXAbs is equal to isc_sv_x_abs_minus1+1+SvOffset, and the value of isc_sv_x_sign is directly set to 1, that is, the value of IscSvX is less than 0. Combined with the value of isc_sv_x_sign, the value of IscSvX can be obtained. The value of SvOffset is obtained by the algorithm defined in the AVS standard, which will not be repeated here.
[0125] (4) If the value of isc_sv_y_sign is 1, that is, the value of IscSvy is less than 0, then the decoded string vector X component flag isc_sv_x_non_zero_flag. If the value of isc_sv_x_non_zero_flag is 0, that is, the value of IscSvX is 0;
[0126] (5) If the value of isc_sv_x_non_zero_flag is 1, the value of IscSvX is not 0. Then decode the string vector X component sign bit isc_sv_x_sign and obtain the value of isc_sv_x_sign; if the value of isc_sv_x_sign is 1, the value of IscSvx is less than 0; if the value of isc_sv_x_sign is 0, the value of IscSvx is greater than 0;
[0127] (6) Decode and debinarize the absolute value of the string vector X component isc_sv_x_abs_minus1 according to the method of the third-order exponential Golomb code. Then the value of IscSvXAbs is equal to isc_sv_x_abs_minus1+1. Combined with the value of isc_sv_x_sign, the value of IscSvX can be obtained.
[0128]
[0129] Table 1
[0130] In Table 1, the value of the string vector above flag isc_sv_above_flag[i] is "1" to indicate that the string vector of the i-th part of the current coding unit is (0, -1); the value is "0" to indicate that the string vector is not (0, -1). And IscSvAboveFlag[i] is equal to the value of isc_sv_above_flag[i].
[0131] The value of the string vector history flag isc_sv_recent_flag[i] is "1" to indicate that the string vector of the i-th part of the current coding unit should be derived from the intra-frame copy history information table; the value is "0" to indicate that the string vector should not be derived from the intra-frame copy history information table. And IscSvRecentFlag[i] is equal to the value of isc_sv_recent_flag[i]. If isc_sv_recent_flag[i] does not exist in the bitstream, then the value of IscSvRecentFlag[i] is 0.
[0132] If the values of IscSvAboveFlag[i] and IscSvRecentFlag[i] are both 0, then the value of the X component of the string vector of the i-th part of the current coding unit is determined by IscSvXNonZeroFlag[i], IscSvXSign[i] and IscSvXAbs[i], and the value of the Y component is determined by IscSvYNonZeroFlag[i], IscSvYSign[i] and IscSvYAbs[i].
[0133] The string vector history index isc_sv_recent_index[i] represents the index value of the string vector of the i-th part of the current coding unit in the intra-frame copy history information table. The value of iscSvRecentIndex[i] is equal to the value of isc_sv_recent_index[i].
[0134] The value of the string vector X component flag isc_sv_x_non_zero_flag[i] is "1" to indicate that the value of the X component of the string vector of the i-th part of the current coding unit is not equal to 0; the value of "0" indicates that the value of the X component is equal to 0. And, IscSvXNonZeroFlag[i] is equal to the value of isc_sv_x_non_zero_flag[i]. If isc_sv_x_non_zero_flag[i] does not exist in the bitstream, the value of IscSvXNonZeroFlag[i] is 1.
[0135] The value of the string vector Y component flag isc_sv_y_non_zero_flag[i] is "1" to indicate that the value of the Y component of the string vector of the i-th part of the current coding unit is not equal to 0; the value "0" indicates that the value of the Y component is equal to 0. And, IscSvYNonZeroFlag[i] is equal to the value of isc_sv_y_non_zero_flag[i]. If isc_sv_y_non_zero_flag[i] does not exist in the bitstream, the value of IscSvYNonZeroFlag[i] is 1.
[0136] The string vector X component sign bit isc_sv_x_sign[i] represents the sign bit of the X component of the string vector of the i-th part of the current coding unit. And IscSvXSign[i] is equal to the value of isc_sv_x_sign[i]. If isc_sv_x_sign[i] does not exist in the bitstream, the value of IscSvXSign[i] is 1.
[0137] The string vector Y component sign bit isc_sv_y_sign[i] represents the sign bit of the Y component of the string vector of the i-th part of the current coding unit. And IscSvYSign[i] is equal to the value of isc_sv_y_sign[i]. If isc_sv_y_sign[i] does not exist in the bitstream, the value of IscSvYSign[i] is 1.
[0138] The absolute value of the X component of the string vector isc_sv_x_abs_minus1[i] represents the absolute value of the X component of the string vector of the i-th part of the current coding unit minus 1. And IscSvXAbs[i] is equal to the value of isc_sv_x_abs_minus1[i] plus 1.
[0139] The absolute value of the Y component of the string vector isc_sv_y_abs_minus1[i] represents the absolute value of the Y component of the string vector of the i-th part of the current coding unit minus 1. And IscSvYAbs[i] is equal to the value of isc_sv_y_abs_minus1[i] plus 1.
[0140] Meanwhile, in the above method, the debinarization processing of isc_sv_x_abs_minus1 and isc_sv_y_abs_minus1 can be obtained by querying the corresponding synElVal value in Table 2 after parsing the binary symbol string. In Table 2, the binary symbol string is the 3rd order exponential Golomb code corresponding to the value of synElVal.
[0141]
[0142]
[0143] Table 2
[0144] The following describes the decoding process of the block displacement vector residual BVD in AVS3. Referring to Table 3, the main process of decoding the block displacement vector residual BVD in AVS3 is as follows (the underlined and bold fields in Table 3 represent the syntax elements to be decoded, and the fields without underlined capital letters represent variables, and the values of the variables can be obtained by decoding the syntax elements):
[0145] Step 301, deriving the absolute value mv_diff_x_abs_bv of the motion vector residual in the horizontal direction after decoding the bit stream, specifically includes:
[0146] (1) Decode and debinarize the bitstream in a truncated unary code manner (such as the two truncated unary code forms shown in Table 4-1 or Table 4-2, with truncation value maxVal=7) 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 mv_diff_x_abs_bv is equal to offset.
[0147] (2) If mv_diff_x_abs_bv_pre is equal to 5, then the value of mv_diff_x_abs_bv belongs to the interval [5,9). Let offset be equal to 5, entropy decode 2 bits from the bitstream, debinarize them according to the 2-bit fixed-length code (see Table 5) and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv is equal to offset + mv_diff_x_abs_bv_suf;
[0148] (3) If mv_diff_x_abs_bv_pre is equal to 6, then the value of mv_diff_x_abs_bv belongs to the interval [9,17). Let offset be equal to 9, entropy decode 3 bits from the bitstream, debinarize them according to the 3-bit fixed-length code (see Table 5) and derive the suffix value mv_diff_x_abs_bv_suf, then mv_diff_x_abs_bv is equal to offset + mv_diff_x_abs_bv_suf;
[0149] (4) If mv_diff_x_abs_bv_pre is equal to 7, the value of mv_diff_x_abs_bv belongs to the interval [17,∞). Set offset to 17, and 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;
[0150] (5) After obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding on the bitstream, debinarize it in accordance with the 2nd-order exponential Golomb code (see the k-order exponential Golomb code table shown in Table 6) 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;
[0151] Step 302: If the value of mv_diff_x_abs_bv is not 0, derive the sign mv_diff_x_sign_bv of the horizontal direction value of the motion vector residual by decoding 1 bit from the bit stream;
[0152] Step 303: Derived from the decoded bitstream is the absolute value of the motion vector residual in the vertical direction mv_diff_y_abs_bv. The specific method is similar to (1) to (5) in step 301.
[0153] Step 304: If the value of mv_diff_y_abs_bv is not 0, derive the sign mv_diff_y_sign_bv of the vertical direction value of the motion vector residual by decoding 1 bit from the bit stream.
[0154]
[0155] Table 3
[0156] In Table 3, mv_diff_x_abs_bv represents the absolute value of the horizontal component difference of the block vector, and mv_diff_y_abs_bv represents the absolute value of the vertical component difference of the block vector. Among them, 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.
[0157] mv_diff_x_sign_bv represents the horizontal component difference sign value of the block vector, and mv_diff_y_sign_bv represents the vertical component difference sign value of the block vector. In addition, 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, then the value of MvDiffXSignBv or MvDiffYSignBv is 0.
[0158] The values of the block vector horizontal component difference MvDiffXBv and the block vector vertical component difference MvDiffYBv are expressed as follows, and the value range is -32768 to 32767:
[0159] MvDiffXBv=(-1) MvDiffXSignBv ×MvDiffXAbsBv
[0160] MvDiffYBv=(-1) MvDiffYSignBv ×MvDiffYAbsBv
[0161]
[0162] Table 4-1
[0163]
[0164] Table 4-2
[0165]
[0166] Table 5
[0167]
[0168] Table 6
[0169] The following describes the decoding process of the motion vector residual MVD in AVS3. Referring to Table 7, the main process of decoding the motion vector residual MVD in AVS3 is as follows (the underlined and bold fields in Table 7 represent the syntax elements to be decoded, and the fields without underlined capital letters represent variables, and the values of the variables can be obtained by decoding the syntax elements):
[0170] Step 401, deriving the absolute value mv_diff_x_abs of the motion vector residual in the horizontal direction after decoding the bit stream, specifically includes:
[0171] (1) Decode and debinarize the bitstream in a truncated unary code manner (such as the two truncated unary code forms shown in Table 4-1 or Table 4-2, with truncation value maxVal=3) to obtain a prefix value mv_diff_x_abs_pre. If mv_diff_x_abs_pre is less than or equal to 2, set offset to mv_diff_x_abs_pre, and then mv_diff_x_abs is equal to offset.
[0172] (2) If mv_diff_x_abs_pre is equal to 3, the value of mv_diff_x_abs belongs to the interval [3,∞). Set offset to 3, and continue to decode 1 bit from the bitstream to obtain the identifier mv_diff_x_abs_parity indicating the parity of mv_diff_x_abs;
[0173] (3) After obtaining the value of mv_diff_x_abs_parity, continue to perform entropy decoding on the bitstream, debinarize in accordance with the 0-order exponential Golomb code (see Table 6) to obtain mv_diff_x_abs_k_eg, then mv_diff_x_abs=offset+mv_diff_x_abs_parity+2×mv_diff_x_abs_k_eg;
[0174] Step 402: If the value of mv_diff_x_abs is not 0, derive the sign mv_diff_x_sign of the horizontal direction value of the motion vector residual by decoding 1 bit from the bit stream;
[0175] Step 403: Derivation of the absolute value mv_diff_y_ab of the motion vector residual in the vertical direction from the decoded bitstream. The specific method is similar to (1) to (5) in step 401.
[0176] Step 404: If the value of mv_diff_y_abs is not 0, derive the sign mv_diff_y_sign of the vertical direction value of the motion vector residual by decoding 1 bit from the bit stream.
[0177]
[0178] Table 7
[0179] In Table 7, mv_diff_x_abs_l0 represents the absolute value of the horizontal component difference of the L0 motion vector, and mv_diff_y_abs_l0 represents the absolute value of the vertical component difference of the L0 motion vector. The absolute value of the horizontal component difference of the motion vector from the reference picture queue 0, MvDiffXAbsL0, is equal to the value of mv_diff_x_abs_l0, and the absolute value of the vertical component difference of the motion vector from the reference picture queue 0, MvDiffYAbsL0, is equal to the value of mv_diff_y_abs_l0.
[0180] mv_diff_x_sign_l0 represents the sign value of the horizontal component difference of the L0 motion vector, and mv_diff_y_sign_l0 represents the sign value of the vertical component difference of the L0 motion vector. The value of the sign bit MvDiffXSignL0 of the horizontal component difference of the motion vector from the reference picture queue 0 is equal to the value of mv_diff_x_sign_l0, and the value of the sign bit MvDiffYSignL0 of the vertical component difference of the motion vector from the reference picture queue 0 is equal to the value of mv_diff_y_sign_l0. If mv_diff_x_sign_l0 or mv_diff_y_sign_l0 does not exist in the bitstream, the value of MvDiffXSignL0 or MvDiffYSignL0 is 0.
[0181] The values of the motion vector horizontal component difference MvDiffXL0 and the motion vector vertical component difference MvDiffYL0 are expressed as follows, and the value range is -32768 to 32767:
[0182] MvDiffXL0=(-1) MvDiffXSignL0 ×MvDiffXAbsL0
[0183] MvDiffYL0=(-1) MvDiffYSignL0 ×MvDiffYAbsL0
[0184] From the above, it can be seen that in the existing video coding standards (such as VVC, AVS3), the motion vector encoding method used by the string displacement vector SV of the intra-frame string copy ISC mode is relatively cumbersome, the encoding and decoding complexity is high, and it is completely different from the motion vector encoding method of the motion vector MV of the inter-frame mode and the block displacement vector BV of the intra-frame block copy IBC mode. The embodiment of the present application proposes a motion vector encoding method that conforms to the SV distribution characteristics based on the statistical characteristics of SV, which can simplify the SV encoding and decoding process and reduce the SV encoding and decoding complexity while ensuring the compression performance of the video, which is generally helpful to improve the SV encoding and decoding efficiency.
[0185] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0186] Figure 8 A flowchart of a video decoding method according to an embodiment of the present application is shown. The video decoding method can be executed by a device with a computing and processing function, such as a terminal device or a server. Figure 8 As shown, the video decoding method at least includes steps S810 to S840, which are described in detail as follows:
[0187] In step S810, the symbol value of the first direction component of the displacement vector residual is decoded from the code stream.
[0188] In one embodiment of the present application, the displacement vector residual may be a string displacement vector residual SVD, a motion displacement vector residual MVD, or a block displacement vector residual BVD. The first direction component may be a vertical direction component, or may be a horizontal direction component.
[0189] The sign value of the first direction component of the displacement vector residual is used to indicate whether the value of the first direction component of the displacement vector residual is greater than 0 or less than 0. Specifically, if the sign value of the first direction component of the displacement vector residual is a first value (for example, 1), it is determined that the value of the first direction component of the displacement vector residual is less than 0; if the sign value of the first direction component of the displacement vector residual is a second value (for example, 0), it is determined that the value of the first direction component of the displacement vector residual is greater than 0.
[0190] In one embodiment of the present application, the flag bit of the first direction component of the displacement vector residual can be first decoded from the code stream, and the flag bit of the first direction component of the displacement vector residual is used to indicate whether the value of the first direction component of the displacement vector residual is 0. If the flag bit of the first direction component of the displacement vector residual is a first value (for example, 1), the symbol value of the first direction component of the displacement vector residual is decoded from the code stream; wherein, the flag bit of the first direction component of the displacement vector residual is a first value indicating that the value of the first direction component of the displacement vector residual is not 0. If the flag bit of the first direction component of the displacement vector residual is a second value (for example, 0), it can be directly determined that the value of the first direction component of the displacement vector residual is 0.
[0191] In step S820, if the value of the first direction component of the displacement vector residual is determined to be less than 0 according to the sign value of the first direction component of the displacement vector residual, then debinarization is performed according to the k1-order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0.
[0192] In step S830, if it is determined that the value of the first direction component of the displacement vector residual is greater than 0 according to the sign value of the first direction component of the displacement vector residual, then debinarization is performed according to the t1-order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1.
[0193] In step S840, the value of the first direction component of the displacement vector residual is determined according to the absolute value of the first direction component of the displacement vector residual and the sign value of the first direction component of the displacement vector residual.
[0194] In one embodiment of the present application, after knowing the symbol value of the first direction component of the displacement vector residual, the value of the first direction component of the displacement vector residual can be obtained based on the symbol value and according to the absolute value of the first direction component of the displacement vector residual. For example, if the absolute value of the first direction component of the displacement vector residual is isc_sv_y_abs_minus1 (i.e., the absolute value of the vertical direction component of the string displacement vector residual), then if the value of the vertical direction component of the string displacement vector residual IscSvY is less than 0 according to the symbol value of the vertical direction component of the string displacement vector residual, then IscSvY=-(isc_sv_y_abs_minus1+1); if IscSvY is greater than 0 according to the symbol value of the vertical direction component of the string displacement vector residual, then IscSvY=isc_sv_y_abs_minus1+1.
[0195] Figure 8 The technical solution of the shown embodiment makes it possible to determine the absolute value of the first direction component of the displacement vector residual by using Golomb codes of different order indices according to the value of the first direction component of the displacement vector residual, and then determine the value of the first direction component of the displacement vector residual based on the absolute value and the sign value of the first direction component of the displacement vector residual, thereby simplifying the encoding and decoding process of the displacement vector residual, reducing the encoding and decoding complexity, and helping to improve the encoding and decoding efficiency of the video.
[0196] It should be noted that: Figure 8 In the technical solution of the embodiment shown, the displacement vector residual may be a string displacement vector residual SVD. In this case, if the predicted string displacement vector SVP is not obtained, the string displacement vector residual SVD may be used as the string displacement vector SV. That is, when there is no SVP, Figure 8 The technical solution of the illustrated embodiment can be used for decoding SV, that is, SV=SVD.
[0197] If the predicted string displacement vector SVP is obtained, the string displacement vector SV can be determined based on the string displacement vector residual SVD and the predicted string displacement vector SVP. That is, when there is SVP, Figure 8 The technical solution of the illustrated embodiment can be used for decoding of SV and SVD, that is, SV=SVD+SVP.
[0198] at the same time, Figure 8 The technical solution of the illustrated embodiment can be used not only for SV / SVD decoding, but also for other amplitude decoding, such as decoding of motion vector residual MVD of inter-frame prediction block, decoding of block motion vector residual BVD of intra-frame block copy IBC, etc.
[0199] Fig. 9 A flowchart of a video decoding method according to an embodiment of the present application is shown. The video decoding method can be executed by a device with a computing and processing function, such as a terminal device or a server. Fig. 9 As shown, the video decoding method at least includes steps S910 to S930, which are described in detail as follows:
[0200] In step S910, the absolute value of the second direction component of the displacement vector residual is obtained by decoding from the code stream.
[0201] In one embodiment of the present application, the displacement vector residual may be a string displacement vector residual SVD, a motion displacement vector residual MVD, or a block displacement vector residual BVD. The second direction component may be a horizontal direction component, or may be a vertical direction component.
[0202] In one embodiment of the present application, the process of decoding from the code stream to obtain the absolute value of the second direction component of the displacement vector residual can be: decoding from the code stream in a truncated unary code manner and performing debinarization processing to obtain the prefix value of the second direction component of the displacement vector residual, and then generating the absolute value of the second direction component of the displacement vector residual based on the prefix value of the second direction component of the displacement vector residual.
[0203] Optionally, when generating the absolute value of the second direction component of the displacement vector residual according to the prefix value of the second direction component of the displacement vector residual, the following embodiments may be used:
[0204] If the prefix value of the second direction component of the displacement vector residual is less than or equal to 4, the prefix value of the second direction component of the displacement vector residual is used as the absolute value of the second direction component of the displacement vector residual;
[0205] If the prefix value of the second direction component of the displacement vector residual is equal to 5, the compensation value is set to 5, and based on the 2 bits obtained by further decoding from the code stream, the debinarization is performed in a 2-bit fixed-length code manner to obtain the suffix value of the second direction component of the displacement vector residual, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value and the compensation value of the second direction component of the displacement vector residual;
[0206] If the prefix value of the second direction component of the displacement vector residual is equal to 6, the compensation value is set to 9, and based on the 3 bits obtained by further decoding from the code stream, the suffix value of the second direction component of the displacement vector residual is obtained by performing debinarization processing in a 3-bit fixed-length code manner, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value and the compensation value of the second direction component of the displacement vector residual;
[0207] If the prefix value of the second direction component of the displacement vector residual is equal to 7, the compensation value is set to 17, and the parity of the absolute value of the second direction component of the displacement vector residual is determined based on the 1-bit bit obtained by continuing to decode from the code stream; continue to decode from the code stream, perform debinarization processing according to the second-order exponential Golomb code method, and generate the absolute value of the second direction component of the displacement vector residual according to the result of the debinarization processing using the second-order exponential Golomb code method, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
[0208] Optionally, when generating the absolute value of the second direction component of the displacement vector residual according to the prefix value of the second direction component of the displacement vector residual, there may also be the following embodiments:
[0209] If the prefix value of the second direction component of the displacement vector residual is less than or equal to 2, the prefix value of the second direction component of the displacement vector residual is used as the absolute value of the second direction component of the displacement vector residual;
[0210] If the prefix value of the second direction component of the displacement vector residual is equal to 3, the compensation value is set to 3, and the parity of the absolute value of the second direction component of the displacement vector residual is determined based on the 1-bit bit obtained by continuing to decode from the code stream; continue to decode from the code stream, perform debinarization processing according to the 0-order exponential Golomb code method, and generate the absolute value of the second direction component of the displacement vector residual according to the result of the debinarization processing according to the 0-order exponential Golomb code method, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
[0211] Continue to refer to Fig. 9 As shown, in step S920, if the absolute value of the second direction component of the displacement vector residual is not 0, the symbol value of the second direction component of the displacement vector residual is obtained by decoding from the code stream.
[0212] Optionally, when it is determined that the absolute value of the second direction component of the displacement vector residual is not 0, 1 bit may be further decoded from the code stream to determine the sign value of the second direction component of the displacement vector residual.
[0213] In step S930, the value of the second direction component of the displacement vector residual is determined according to the absolute value of the second direction component of the displacement vector residual and the sign value of the second direction component of the displacement vector residual.
[0214] It should be noted that: Fig. 9 In the technical solution of the embodiment shown, the displacement vector residual may be a string displacement vector residual SVD. In this case, if the predicted string displacement vector SVP is not obtained, the string displacement vector residual SVD may be used as the string displacement vector SV. That is, when there is no SVP, Fig. 9 The technical solution of the illustrated embodiment can be used for decoding SV, that is, SV=SVD.
[0215] If the predicted string displacement vector SVP is obtained, the string displacement vector SV can be determined based on the string displacement vector residual SVD and the predicted string displacement vector SVP. That is, when there is SVP, Fig. 9 The technical solution of the illustrated embodiment can be used for decoding of SV and SVD, that is, SV=SVD+SVP.
[0216] at the same time, Fig. 9 The technical solution of the illustrated embodiment can preferably be used for SV / SVD decoding. In this case, a method similar to BVD or MVD can be used to implement SV / SVD decoding, which simplifies the SV encoding and decoding process, reduces the encoding and decoding complexity, and helps to improve the encoding and decoding efficiency of the video.
[0217] Fig.10 A flowchart of a video decoding method according to an embodiment of the present application is shown. The video decoding method can be executed by a device with a computing and processing function, such as a terminal device or a server. Fig.10 As shown, the video decoding method at least includes steps S1010 to S1040, which are described in detail as follows:
[0218] In step S1010, the value of the vertical component of the decoded string displacement vector residual is obtained.
[0219] In one embodiment of the present application, the value of the vertical component of the string displacement vector residual can be obtained by the aforementioned Figure 8 The method of the embodiment shown in the figure can be decoded or the above Fig. 9 The method of the illustrated embodiment is decoded to obtain the information, and can also be obtained by a decoding method in an existing standard.
[0220] In step S1020, the symbol value of the horizontal direction component of the string displacement vector residual is obtained based on the relationship between the value of the vertical direction component of the string displacement vector residual and 0.
[0221] In one embodiment of the present application, if the value of the vertical component of the string displacement vector residual is 0, the symbol value of the horizontal component of the string displacement vector residual can be directly decoded from the code stream.
[0222] In one embodiment of the present application, when the decoding starting row is row 0, if the value of the vertical component of the string displacement vector residual is 0, and the row where the starting point of the current string is located is an odd row, the symbol value of the horizontal component of the string displacement vector residual can be decoded from the code stream. At the same time, in this case, if the row where the starting point of the current string is located is an even row, the sign bit of the horizontal component of the string displacement vector residual can be set to the first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0.
[0223] In one embodiment of the present application, if the value of the vertical component of the string displacement vector residual is greater than 0, the sign bit of the horizontal component of the string displacement vector residual can be set to a first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0.
[0224] In one embodiment of the present application, if the value of the vertical component of the string displacement vector residual is less than 0, the value of the flag bit of the horizontal component of the string displacement vector residual can be decoded from the code stream. If the flag bit of the horizontal component of the string displacement vector residual is a first value (for example, 1), the symbol value of the horizontal component of the string displacement vector residual is decoded from the code stream, that is, the flag bit of the horizontal component of the string displacement vector residual is the first value, indicating that the value of the horizontal component of the string displacement vector residual is not 0. If the flag bit of the horizontal component of the string displacement vector residual is a second value (for example, 0), it can be determined that the value of the horizontal component of the string displacement vector residual is 0.
[0225] Continue to refer to Fig.10 As shown, in step S1030, the order of the Golomb code is determined according to the symbol value of the horizontal component of the string displacement vector residual, and the absolute value of the horizontal component of the string displacement vector residual is obtained by performing debinarization processing according to the determined order of the Golomb code.
[0226] In one embodiment of the present application, if the symbol value of the horizontal component of the string displacement vector residual indicates that the value of the horizontal component of the string displacement vector residual is less than 0, then debinarization processing can be performed according to the k2-order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual, k2≥0; if the symbol value of the horizontal component of the string displacement vector residual indicates that the value of the horizontal component of the string displacement vector residual is greater than 0, then debinarization processing can be performed according to the t2-order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual, t2≥0 and t2 is not equal to k2.
[0227] That is, the technical solution of the embodiment of the present application can determine the absolute value of the horizontal component of the string displacement vector residual by using Golomb codes of different order indices according to the value of the horizontal component of the string displacement vector residual, thereby simplifying the encoding and decoding process of the string displacement vector residual, reducing the encoding and decoding complexity, and helping to improve the encoding and decoding efficiency of the video.
[0228] In step S1040, the value of the horizontal direction component of the string displacement vector residual is determined according to the absolute value of the horizontal direction component of the string displacement vector residual and the sign bit of the horizontal direction component of the string displacement vector residual.
[0229] exist Fig.10 In the technical solution of the embodiment shown, the value of the horizontal direction component of the string displacement vector residual depends on the value of the vertical direction component of the string displacement vector residual. In this case, it is necessary to first decode the value of the vertical direction component of the string displacement vector residual, and then determine the value of the horizontal direction component of the string displacement vector residual based on the value of the vertical direction component of the string displacement vector residual. Specifically, it is divided into the case where the value of the vertical direction component of the string displacement vector residual is 0, the case where the value of the vertical direction component of the string displacement vector residual is greater than 0, and the case where the value of the vertical direction component of the string displacement vector residual is less than 0.
[0230] When the value of the vertical component of the string displacement vector residual is 0, the symbol value of the horizontal component of the string displacement vector residual can be decoded from the code stream first; if the symbol value of the horizontal component of the string displacement vector residual indicates that the value of the horizontal component of the string displacement vector residual is less than 0, then it can be de-binarized in the manner of k2-order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual; if the symbol value of the horizontal component of the string displacement vector residual indicates that the value of the horizontal component of the string displacement vector residual is greater than 0, then it can be de-binarized in the manner of t2-order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual, and then the value of the horizontal component of the string displacement vector residual is determined according to the absolute value of the horizontal component of the string displacement vector residual and the symbol value of the horizontal component of the string displacement vector residual.
[0231] When the value of the vertical component of the string displacement vector residual is 0, it is also possible to first determine whether the row where the starting point of the current string is located is an odd row (when the decoding starting row is the 0th row). If it is an odd row, the symbol value of the horizontal component of the string displacement vector residual is decoded from the code stream. If it is an even row, the symbol value of the horizontal component of the string displacement vector residual can be directly set to the first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0, and the absolute value of the horizontal component of the string displacement vector residual is obtained by performing debinarization according to the k2-order exponential Golomb code, and then the value of the horizontal component of the string displacement vector residual is determined according to the absolute value of the horizontal component of the string displacement vector residual and the symbol value of the horizontal component of the string displacement vector residual.
[0232] When the value of the vertical component of the string displacement vector residual is greater than 0, the symbol value of the horizontal component of the string displacement vector residual can be set to the first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0, and then debinarization is performed in accordance with the k2-order exponential Columbus code to obtain the absolute value of the horizontal component of the string displacement vector residual, and the value of the horizontal component of the string displacement vector residual is determined based on the absolute value of the horizontal component of the string displacement vector residual and the symbol value of the horizontal component of the string displacement vector residual.
[0233] When the value of the vertical component of the string displacement vector residual is less than 0, the flag of the horizontal component of the string displacement vector residual can be decoded from the code stream. If the flag of the horizontal component of the string displacement vector residual is the first value (indicating that the value of the horizontal component of the string displacement vector residual is not 0), the symbol value of the horizontal component of the string displacement vector residual is decoded from the code stream; then, according to the value of the horizontal component of the string displacement vector residual, the absolute value of the horizontal component of the string displacement vector residual is determined by using Golomb codes of different order indices, and the value of the horizontal component of the string displacement vector residual is determined according to the absolute value of the horizontal component of the string displacement vector residual and the symbol value of the horizontal component of the string displacement vector residual. At the same time, if the flag of the horizontal component of the string displacement vector residual is the second value, it can be determined that the value of the horizontal component of the string displacement vector residual is 0.
[0234] It should be noted that: Fig.10 In the technical solution of the embodiment shown, if the predicted string displacement vector SVP is not obtained, the string displacement vector residual SVD can be used as the string displacement vector SV. That is, when there is no SVP, Fig.10 The technical solution of the embodiment shown can be used for decoding SV, that is, SV=SVD. If the predicted string displacement vector SVP is obtained, the string displacement vector SV can be determined according to the string displacement vector residual SVD and the predicted string displacement vector SVP. That is, when there is SVP, Fig.10 The technical solution of the illustrated embodiment can be used for decoding of SV and SVD, that is, SV=SVD+SVP.
[0235] comprehensive Figures 8 to 10 The technical solution of the embodiment of the present application can be more in line with the SV distribution characteristics, simplifying the SV encoding and decoding process and reducing the complexity of SV encoding and decoding, while ensuring the compression performance of the video, which is generally helpful to improve the efficiency of SV encoding and decoding. The following takes the horizontal direction as an example, and introduces the implementation details of the technical solution of the embodiment of the present application applied to the SV decoding scenario from the perspective of the decoding end, which can mainly include the following steps:
[0236] Step 501, decoding the string vector above flag isc_sv_above_flag, if the value of isc_sv_above_flag is 1, the value of IscSvX is 0, and the value of IscSvY is -1.
[0237] Step 502: If the value of isc_sv_above_flag is 0, decode the string vector history flag isc_sv_recent_flag. If the value of isc_sv_recent_flag is 1, continue to decode the string vector history index isc_sv_recent_index, and look up the table to obtain the values of IscSvX and IscSvY according to the value of isc_sv_recent_index and the intra-frame prediction history motion information table.
[0238] It should be noted that the processing process of step 502 is similar to the skip / direct mode of SV, which can be understood as a prediction process of SV, that is, SVP is not 0.
[0239] Step 503: If the value of isc_sv_recent_flag is 0, SV (IscSvX, IscSvY) are respectively decoded according to the following method.
[0240] It should be noted that: when there is no SVP, the technical solution of the embodiment of the present application can be used for decoding SV, that is, SV=SVD. If there is SVP, the technical solution of the embodiment of the present application can be used for decoding SV and SVD, where SV=SVD+SVP. That is, when step 501 and / or step 502 do not exist, the technical solution of the embodiment of the present application can be directly used to decode SV.
[0241] Derived from the bitstream decoding value of IscSvY , you can use any of the following methods:
[0242] Method 1y: Use a decoding method similar to MVD. For details, please refer to the relevant contents of step 401 to step 403 in the above embodiment.
[0243] Method 2y: Use a decoding method similar to BVD. For details, please refer to the relevant contents of steps 301 to 304 in the above embodiment.
[0244] Method 3y: Use the decoding method for SV in the existing standard. For details, please refer to the relevant contents of step 2031 to step 2033 in the above embodiment.
[0245] Method 4y: comprising the following steps:
[0246] (4y.1), decoded string vector Y component flag isc_sv_y_non_zero_flag.
[0247] (4y.2) If the value of isc_sv_y_non_zero_flag is 0, the value of IscSvY is 0.
[0248] (4y.3) If the value of isc_sv_y_non_zero_flag is 1, the value of IscSvY is not 0. Further decode the string vector Y component sign bit isc_sv_y_sign and obtain the value of isc_sv_y_sign. If the value of isc_sv_y_sign is 1, the value of IscSvY is less than 0; if the value of isc_sv_y_sign is 0, the value of IscSvY is greater than 0.
[0249] (4y.4) Decode and debinarize the absolute value of the Y component of the string vector isc_sv_y_abs_minus1 according to the following method:
[0250] If the value of isc_sv_y_sign is 1, that is, the value of IscSvY is less than 0, it is decoded and debinarized according to the k-order exponential Golomb method (see the k-order exponential Golomb code table shown in Table 6) to obtain the absolute value of the string vector Y component isc_sv_y_abs_minus1; if the value of isc_sv_y_sign is 0, that is, the value of IscSvY is greater than 0, it is decoded and debinarized according to the t-order exponential Golomb method to obtain the absolute value of the string vector Y component isc_sv_y_abs_minus1.
[0251] Wherein, k>=0, t>=0, k and t are integers, and k is not equal to t.
[0252] (4y.5) Let the value of IscSvYAbs be equal to isc_sv_y_abs_minus1+1, and then combine it with the value of isc_sv_y_sign to obtain the value of IscSvY.
[0253] Decode the value of IscSvX from the bitstream , you can use any of the following methods:
[0254] Method 1x: using a decoding method similar to MVD. For details, please refer to the relevant contents of step 401 to step 403 in the above embodiment.
[0255] Method 2x: using a decoding method similar to BVD. For details, please refer to the relevant contents of step 301 to step 304 in the above embodiment.
[0256] Method 3x: Use the decoding method for SV in the existing standard. For details, please refer to the relevant contents of step 2031 to step 2033 in the above embodiment.
[0257] Method 4x: includes the following steps:
[0258] (4x.1), decoded string vector X component flag isc_sv_x_non_zero_flag.
[0259] (4x.2) If the value of isc_sv_x_non_zero_flag is 0, the value of IscSvX is 0.
[0260] (4x.3) If the value of isc_sv_x_non_zero_flag is 1, the value of IscSvX is not 0. Further decode the string vector X component sign bit isc_sv_x_sign and obtain the value of isc_sv_x_sign. If the value of isc_sv_x_sign is 1, the value of IscSvX is less than 0; if the value of isc_sv_x_sign is 0, the value of IscSvX is greater than 0.
[0261] (4x.4), decode and debinarize according to the following method to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1:
[0262] If the value of isc_sv_x_sign is 1, that is, the value of IscSvX is less than 0, it is decoded and de-binarized in the manner of k-order exponential Golomb (see the k-order exponential Golomb code table shown in Table 6) to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1; if the value of isc_sv_x_sign is 0, that is, the value of IscSvX is greater than 0, it is decoded and de-binarized in the manner of t-order exponential Golomb to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1.
[0263] Wherein, k>=0, t>=0, k and t are integers, and k is not equal to t.
[0264] (4x.5) Let the value of IscSvXAbs equal to isc_sv_x_abs_minus1+1, and then combine it with the value of isc_sv_x_sign to obtain the value of IscSvX.
[0265] Method 5x: comprises the following steps:
[0266] (5x.1) If the value of IscSvY is 0 (where IscSvY can be decoded by any of the above methods 1y to 4y), decode IscSvx according to the following steps:
[0267] A. If the value of IsOddRow is 1, that is, the row where the starting point of the current string is located is an odd row (assuming the starting row is row 0), then decode the string vector X component sign bit isc_sv_x_sign and obtain the value of isc_sv_x_sign; if the value of isc_sv_x_sign is 1, that is, the value of IscSvx is less than 0; if the value of isc_sv_x_sign is 0, that is, the value of IscSvx is greater than 0.
[0268] B. If the value of IsOddRow is 0, that is, the row where the starting point of the current string is located is an even row, then directly set the value of isc_sv_x_sign to 1, that is, the value of IscSvx is less than 0.
[0269] It should be noted that in other embodiments of the present application, there is no need to perform steps A and B, that is, there is no need to calculate the value of IsOddRow, and the string vector X component sign bit isc_sv_x_sign is directly decoded from the bit stream to obtain the value of isc_sv_x_sign. This method can simplify the SV encoding and decoding process to a certain extent.
[0270] C. After obtaining the value of isc_sv_x_sign, the absolute value of the string vector X component isc_sv_x_abs_minus1 can be obtained by decoding and debinarizing as follows:
[0271] If the value of isc_sv_x_sign is 1, that is, the value of IscSvx is less than 0, it is decoded and de-binarized in the k-order exponential Golomb method to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1; if the value of isc_sv_x_sign is 0, that is, the value of IscSvx is greater than 0, it is decoded and de-binarized in the t-order exponential Golomb method to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1.
[0272] Wherein, k>=0, t>=0, k and t are integers, and k is not equal to t.
[0273] D. Let the value of IscSvXAbs equal to isc_sv_x_abs_minus1+1, and then combine it with the value of isc_sv_x_sign to obtain the value of IscSvX.
[0274] (5x.2) If the value of IscSvy is greater than 0, the value of isc_sv_x_sign can be directly set to 1, that is, the value of IscSvx is less than 0, then it can be decoded and debinarized in the k-order exponential Golomb method to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1. Then let the value of IscSvXAbs equal to isc_sv_x_abs_minus1+1, and then combine the value of isc_sv_x_sign to obtain the value of IscSvX.
[0275] (5x.3) If the value of IscSvy is less than 0, decode the string vector X component flag isc_sv_x_non_zero_flag. If the value of isc_sv_x_non_zero_flag is 0, that is, the value of IscSvX is 0.
[0276] If the value of isc_sv_x_non_zero_flag is 1, the value of IscSvX is not 0, and the sign bit of the string vector X component isc_sv_x_sign is further decoded to obtain the value of isc_sv_x_sign. If the value of isc_sv_x_sign is 1, that is, the value of IscSvx is less than 0, it is decoded and de-binarized in the k-order exponential Golomb method to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1; if the value of isc_sv_x_sign is 0, that is, the value of IscSvx is greater than 0, it is decoded and de-binarized in the t-order exponential Golomb method to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1.
[0277] Wherein, k>=0, t>=0, k and t are integers, and k is not equal to t.
[0278] Then let the value of IscSvXAbs equal to isc_sv_x_abs_minus1+1, and then combine it with the value of isc_sv_x_sign to obtain the value of IscSvX.
[0279] In the technical solution of the aforementioned embodiment, isc_sv_x_sign and isc_sv_y_sign may be decoded in a bypass manner, or isc_sv_x_sign and isc_sv_y_sign may be decoded in a CABAC manner.
[0280] If isc_sv_x_sign and isc_sv_y_sign are decoded in CABAC mode, the selection of the context model and the determination of ctxIdxInc can be carried out in one of the following ways:
[0281] a) Using a single context model, and ctxIdxInc=0;
[0282] b) For the solution of first decoding to obtain IscSvY, for example, the aforementioned method 5x, for ctxIdxInc of isc_sv_x_sign, the context model can be determined according to the sign of IscSvY: ctxIdxInc=IscSvY<0?0:(IscSvY==0?1:2).
[0283] It should be noted that: in the aforementioned embodiment, IscSvY can be decoded by any of the aforementioned methods 1y to 4y; IscSvX can be decoded by any of the aforementioned methods 1x to 5x. If IscSvX is decoded by any of the aforementioned methods 1x to 4x, then the decoding process of IscSvX is not dependent on the decoding process of IscSvY, and can be executed in parallel; if IscSvX is decoded by the aforementioned method 5x, then IscSvY needs to be decoded first, and then IscSvX.
[0284] Optionally, IscSvY can be decoded using the aforementioned method 2y, and IscSvX can be decoded using the aforementioned method 4x or method 5x.
[0285] The above embodiments are mainly described from the perspective of the decoding end, wherein the processing process of the encoding end is similar to that of the decoding end and will not be described in detail.
[0286] In summary, the technical solution of the embodiment of the present application proposes a motion vector encoding method that conforms to the distribution characteristics of SV based on the statistical characteristics of SV. While simplifying the SV encoding and decoding process and reducing the complexity of SV encoding and decoding, it can ensure the compression performance of the video, and overall helps to improve the SV encoding and decoding efficiency.
[0287] The following describes an apparatus embodiment of the present application, which can be used to execute the method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned method embodiment of the present application.
[0288] Fig.11 A block diagram of a video decoding device according to an embodiment of the present application is shown. The video decoding device can be set in a device with a computing and processing function, such as a terminal device or a server.
[0289] Reference Fig.11 As shown, a video decoding device 1100 according to an embodiment of the present application includes: a decoding unit 1102 , a first processing unit 1104 , a second processing unit 1106 and a third processing unit 1108 .
[0290] Among them, the decoding unit 1102 is configured to decode the symbol value of the first direction component of the displacement vector residual from the code stream; the first processing unit 1104 is configured to, if it is determined according to the symbol value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is less than 0, then perform debinarization processing in a k1-order exponential Columbus code manner to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0; the second processing unit 1106 is configured to, if it is determined according to the symbol value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is greater than 0, then perform debinarization processing in a t1-order exponential Columbus code manner to obtain the absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; the third processing unit 1108 is configured to determine the value of the first direction component of the displacement vector residual according to the absolute value of the first direction component of the displacement vector residual and the symbol value of the first direction component of the displacement vector residual.
[0291] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit 1102 is configured to: decode the flag bit of the first direction component of the displacement vector residual from the code stream; if the flag bit of the first direction component of the displacement vector residual is a first value, decode the symbol value of the first direction component of the displacement vector residual from the code stream; wherein, the flag bit of the first direction component of the displacement vector residual is a first value indicating that the value of the first direction component of the displacement vector residual is not 0.
[0292] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit 1102 is further configured to: if the flag bit of the first direction component of the displacement vector residual is the second value, determine that the value of the first direction component of the displacement vector residual is 0.
[0293] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit 1102 is configured as: if the symbol value of the first direction component of the displacement vector residual is a first value, then it is determined that the value of the first direction component of the displacement vector residual is less than 0; if the symbol value of the first direction component of the displacement vector residual is a second value, then it is determined that the value of the first direction component of the displacement vector residual is greater than 0.
[0294] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit 1102 is further configured to: decode from the code stream to obtain the absolute value of the second direction component of the displacement vector residual, and if the absolute value of the second direction component of the displacement vector residual is not 0, then decode from the code stream to obtain the symbol value of the second direction component of the displacement vector residual; the third processing unit 1108 is further configured to: determine the value of the second direction component of the displacement vector residual according to the absolute value of the second direction component of the displacement vector residual and the symbol value of the second direction component of the displacement vector residual.
[0295] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit 1102 is configured to: decode and debinarize the code stream in a truncated unary code manner to obtain a prefix value of the second direction component of the displacement vector residual; and generate an absolute value of the second direction component of the displacement vector residual based on the prefix value of the second direction component of the displacement vector residual.
[0296] In some embodiments of the present application, based on the above scheme, the decoding unit 1102 is configured to: if the prefix value of the second direction component of the displacement vector residual is less than or equal to 4, use the prefix value of the second direction component of the displacement vector residual as the absolute value of the second direction component of the displacement vector residual;
[0297] If the prefix value of the second direction component of the displacement vector residual is equal to 5, the compensation value is set to 5, and based on the 2 bits obtained by further decoding from the code stream, the debinarization is performed in a 2-bit fixed-length code manner to obtain the suffix value of the second direction component of the displacement vector residual, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value of the second direction component of the displacement vector residual and the compensation value;
[0298] If the prefix value of the second direction component of the displacement vector residual is equal to 6, the compensation value is set to 9, and based on the 3 bits obtained by further decoding from the code stream, the suffix value of the second direction component of the displacement vector residual is obtained by performing debinarization processing in a 3-bit fixed-length code manner, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value of the second direction component of the displacement vector residual and the compensation value;
[0299] If the prefix value of the second direction component of the displacement vector residual is equal to 7, the compensation value is set to 17, and the parity of the absolute value of the second direction component of the displacement vector residual is determined based on the 1-bit bit obtained by continuing to decode from the code stream; continue to decode from the code stream, perform debinarization processing in accordance with the second-order exponential Golomb code, and generate the absolute value of the second direction component of the displacement vector residual based on the result of the debinarization processing in accordance with the second-order exponential Golomb code, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
[0300] In some embodiments of the present application, based on the aforementioned scheme, the decoding unit 1102 is configured as: if the prefix value of the second direction component of the displacement vector residual is less than or equal to 2, then the prefix value of the second direction component of the displacement vector residual is used as the absolute value of the second direction component of the displacement vector residual; if the prefix value of the second direction component of the displacement vector residual is equal to 3, then the compensation value is set to 3, and based on the 1-bit bit obtained by continuing to decode from the code stream, the parity of the absolute value of the second direction component of the displacement vector residual is determined; continue to decode from the code stream, perform debinarization processing in accordance with the 0-order exponential Golomb code, and generate the absolute value of the second direction component of the displacement vector residual according to the result of the debinarization processing in accordance with the 0-order exponential Golomb code, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
[0301] In some embodiments of the present application, based on the aforementioned scheme, the displacement vector residual is: a string displacement vector residual SVD; or a motion displacement vector residual MVD; or a block displacement vector residual BVD.
[0302] In some embodiments of the present application, based on the aforementioned scheme, the displacement vector residual is a string displacement vector residual SVD; the third processing unit 1108 is also configured as: if the predicted string displacement vector (String Vector Predictor, SVP for short) is not obtained, then the string displacement vector residual SVD is used as the string displacement vector SV; if the predicted string displacement vector SVP is obtained, then the string displacement vector SV is determined according to the string displacement vector residual SVD and the predicted string displacement vector SVP.
[0303] In some embodiments of the present application, based on the aforementioned scheme, the first direction component of the displacement vector residual is a vertical direction component of the string displacement vector residual.
[0304] In some embodiments of the present application, based on the aforementioned scheme, if the first direction component of the displacement vector residual is the vertical direction component of the string displacement vector residual, the decoding unit 1102 is further configured as: if the value of the vertical direction component of the string displacement vector residual is 0, then the symbol value of the horizontal direction component of the string displacement vector residual is decoded from the code stream; the first processing unit 1104 is further configured as: if it is determined that the value of the horizontal direction component of the string displacement vector residual is less than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the debinarization is performed in accordance with the k2-order exponential Columbus code to obtain the horizontal direction component of the string displacement vector residual. The absolute value of the horizontal component, k2≥0; the second processing unit 1106 is further configured as: if it is determined that the value of the horizontal component of the string displacement vector residual is greater than 0 according to the symbol value of the horizontal component of the string displacement vector residual, then debinarization is performed in accordance with the t2-order exponential Columbus code to obtain the absolute value of the horizontal component of the string displacement vector residual, t2≥0 and t2 is not equal to k2; the third processing unit 1108 is further configured as: according to the absolute value of the horizontal component of the string displacement vector residual and the symbol value of the horizontal component of the string displacement vector residual, determine the value of the horizontal component of the string displacement vector residual.
[0305] In some embodiments of the present application, based on the above scheme, if the first direction component of the displacement vector residual is a vertical direction component of the string displacement vector residual, the decoding unit 1102 is further configured to: before decoding the symbol value of the horizontal direction component of the string displacement vector residual from the bit stream, if the decoding starting row is the 0th row and the row where the starting point of the current string is located is an odd row, then decode the symbol value of the horizontal direction component of the string displacement vector residual from the bit stream;
[0306] The third processing unit 1108 is also configured to: if the row where the starting point of the current string is located is an even row, then the symbol value of the horizontal direction component of the string displacement vector residual is set to the first value to indicate that the value of the horizontal direction component of the string displacement vector residual is less than 0, and perform inverse binarization processing according to the k2-order exponential Columbus code to obtain the absolute value of the horizontal direction component of the string displacement vector residual; determine the value of the horizontal direction component of the string displacement vector residual according to the absolute value of the horizontal direction component of the string displacement vector residual and the symbol value of the horizontal direction component of the string displacement vector residual.
[0307] In some embodiments of the present application, based on the aforementioned scheme, if the first direction component of the displacement vector residual is the vertical direction component of the string displacement vector residual, the third processing unit 1108 is also configured as: if the value of the vertical direction component of the string displacement vector residual is greater than 0, the symbol value of the horizontal direction component of the string displacement vector residual is set to the first value to indicate that the value of the horizontal direction component of the string displacement vector residual is less than 0; perform inverse binarization processing in accordance with the k2-order exponential Columbus code to obtain the absolute value of the horizontal direction component of the string displacement vector residual; determine the value of the horizontal direction component of the string displacement vector residual according to the absolute value of the horizontal direction component of the string displacement vector residual and the symbol value of the horizontal direction component of the string displacement vector residual.
[0308] In some embodiments of the present application, based on the above scheme, if the first direction component of the displacement vector residual is a vertical direction component of the string displacement vector residual, the third processing unit 1108 is further configured to: if the value of the vertical direction component of the string displacement vector residual is less than 0, decode the flag bit of the horizontal direction component of the string displacement vector residual from the code stream; if the flag bit of the horizontal direction component of the string displacement vector residual is a first value, decode the symbol value of the horizontal direction component of the string displacement vector residual from the code stream; wherein the flag bit of the horizontal direction component of the string displacement vector residual is the first value indicating that the value of the horizontal direction component of the string displacement vector residual is not 0;
[0309] If it is determined that the value of the horizontal direction component of the string displacement vector residual is less than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in a k2-order exponential Golomb code manner, k2≥0;
[0310] If it is determined that the value of the horizontal direction component of the string displacement vector residual is greater than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in accordance with the t2-order exponential Golomb code, t2≥0 and t2 is not equal to k2;
[0311] The value of the horizontal direction component of the string displacement vector residual is determined according to the absolute value of the horizontal direction component of the string displacement vector residual and the sign value of the horizontal direction component of the string displacement vector residual.
[0312] In some embodiments of the present application, based on the aforementioned scheme, the third processing unit 1108 is further configured to: if the flag bit of the horizontal direction component of the string displacement vector residual is the second value, determine that the value of the horizontal direction component of the string displacement vector residual is 0.
[0313] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0314] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0315] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method described in the above embodiment. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, the ROM 1202 and the RAM 1203 are connected to each other through the bus 1204. The input / output (I / O) interface 1205 is also connected to the bus 1204.
[0316] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0317] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0318] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0319] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0320] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0321] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0322] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0323] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0324] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0325] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A video decoding method, characterized in that: include: Decoding the symbol value of the first direction component of the displacement vector residual from the bit stream; If it is determined that the value of the first direction component of the displacement vector residual is less than 0 according to the sign value of the first direction component of the displacement vector residual, then debinarization is performed in a k1-order exponential Golomb code manner to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0; If it is determined that the value of the first direction component of the displacement vector residual is greater than 0 according to the sign value of the first direction component of the displacement vector residual, then debinarization is performed in accordance with the t1-order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; The value of the first direction component of the displacement vector residual is determined according to the absolute value of the first direction component of the displacement vector residual and the sign value of the first direction component of the displacement vector residual.
2. The video decoding method according to claim 1, characterized in that: Decoding the first direction component symbol value of the displacement vector residual from the bitstream includes: Decoding the flag bit of the first direction component of the displacement vector residual from the bit stream; If the flag bit of the first direction component of the displacement vector residual is a first value, decoding the symbol value of the first direction component of the displacement vector residual from the bit stream; Among them, the flag bit of the first direction component of the displacement vector residual is the first value, indicating that the value of the first direction component of the displacement vector residual is not 0.
3. The video decoding method according to claim 2, characterized in that: The video decoding method further comprises: If the flag bit of the first direction component of the displacement vector residual is the second value, it is determined that the value of the first direction component of the displacement vector residual is 0.
4. The video decoding method according to claim 1, characterized in that: The video decoding method further includes: If the sign value of the first direction component of the displacement vector residual is the first value, determining that the value of the first direction component of the displacement vector residual is less than 0; If the sign value of the first direction component of the displacement vector residual is the second value, it is determined that the value of the first direction component of the displacement vector residual is greater than 0.
5. The video decoding method according to claim 1, characterized in that: The video decoding method further comprises: Decoding the bitstream to obtain an absolute value of a second direction component of a displacement vector residual; If the absolute value of the second direction component of the displacement vector residual is not 0, decoding the second direction component of the displacement vector residual from the bit stream to obtain a symbol value; The value of the second direction component of the displacement vector residual is determined according to the absolute value of the second direction component of the displacement vector residual and the sign value of the second direction component of the displacement vector residual.
6. The video decoding method according to claim 5, characterized in that: The absolute value of the second direction component of the displacement vector residual is obtained by decoding the bitstream, including: Decoding the bit stream in a truncated unary code manner and performing inverse binarization processing to obtain a prefix value of the second direction component of the displacement vector residual; The absolute value of the second direction component of the displacement vector residual is generated according to the prefix value of the second direction component of the displacement vector residual.
7. The video decoding method according to claim 6, characterized in that: Generating the absolute value of the second direction component of the displacement vector residual according to the prefix value of the second direction component of the displacement vector residual includes: If the prefix value of the second direction component of the displacement vector residual is less than or equal to 4, the prefix value of the second direction component of the displacement vector residual is used as the absolute value of the second direction component of the displacement vector residual; If the prefix value of the second direction component of the displacement vector residual is equal to 5, the compensation value is set to 5, and based on the 2 bits obtained by further decoding from the code stream, the debinarization is performed in a 2-bit fixed-length code manner to obtain the suffix value of the second direction component of the displacement vector residual, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value of the second direction component of the displacement vector residual and the compensation value; If the prefix value of the second direction component of the displacement vector residual is equal to 6, the compensation value is set to 9, and based on the 3 bits obtained by further decoding from the code stream, the suffix value of the second direction component of the displacement vector residual is obtained by performing debinarization processing in a 3-bit fixed-length code manner, and the absolute value of the second direction component of the displacement vector residual is generated according to the suffix value of the second direction component of the displacement vector residual and the compensation value; If the prefix value of the second direction component of the displacement vector residual is equal to 7, the compensation value is set to 17, and the parity of the absolute value of the second direction component of the displacement vector residual is determined based on the 1-bit bit obtained by continuing to decode from the code stream; continue to decode from the code stream, perform debinarization processing in accordance with the second-order exponential Golomb code, and generate the absolute value of the second direction component of the displacement vector residual based on the result of the debinarization processing in accordance with the second-order exponential Golomb code, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
8. The video decoding method according to claim 6, characterized in that: Generating the absolute value of the second direction component of the displacement vector residual according to the prefix value of the second direction component of the displacement vector residual includes: If the prefix value of the second direction component of the displacement vector residual is less than or equal to 2, the prefix value of the second direction component of the displacement vector residual is used as the absolute value of the second direction component of the displacement vector residual; If the prefix value of the second direction component of the displacement vector residual is equal to 3, the compensation value is set to 3, and the parity of the absolute value of the second direction component of the displacement vector residual is determined based on the 1-bit bit obtained by continuing to decode from the code stream; continue to decode from the code stream, perform debinarization processing in accordance with the 0th-order exponential Golomb code, and generate the absolute value of the second direction component of the displacement vector residual based on the result of the debinarization processing in accordance with the 0th-order exponential Golomb code, the compensation value and the parity of the absolute value of the second direction component of the displacement vector residual.
9. The video decoding method according to any one of claims 1 to 8, characterized in that: The displacement vector residual is: String displacement vector residual SVD; or Motion displacement vector residual MVD; or Block displacement vector residual BVD.
10. The video decoding method according to any one of claims 1 to 8, characterized in that: The displacement vector residual is a string displacement vector residual SVD; the video decoding method further includes: If the predicted string displacement vector SVP is not obtained, the string displacement vector residual SVD is used as the string displacement vector SV; If the predicted string displacement vector SVP is obtained, the string displacement vector SV is determined based on the string displacement vector residual SVD and the predicted string displacement vector SVP.
11. The video decoding method according to any one of claims 1 to 4, characterized in that: The first direction component of the displacement vector residual is the vertical direction component of the string displacement vector residual.
12. The video decoding method according to claim 11, characterized in that: The video decoding method further comprises: If the value of the vertical component of the string displacement vector residual is 0, then decoding the symbol value of the horizontal component of the string displacement vector residual from the bit stream; If it is determined that the value of the horizontal direction component of the string displacement vector residual is less than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in a k2-order exponential Golomb code manner, k2≥0; If it is determined that the value of the horizontal direction component of the string displacement vector residual is greater than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in accordance with the t2-order exponential Golomb code, t2≥0 and t2 is not equal to k2; The value of the horizontal direction component of the string displacement vector residual is determined according to the absolute value of the horizontal direction component of the string displacement vector residual and the sign value of the horizontal direction component of the string displacement vector residual.
13. The video decoding method according to claim 12, characterized in that: Before decoding the horizontal component symbol value of the string displacement vector residual from the bit stream, the video decoding method further includes: In the case where the decoding start row is row 0, if the row where the start point of the current string is located is an odd row, a process of decoding the horizontal direction component symbol value of the string displacement vector residual from the bit stream is performed; If the row where the starting point of the current string is located is an even row, the symbol value of the horizontal direction component of the string displacement vector residual is set to the first value to indicate that the value of the horizontal direction component of the string displacement vector residual is less than 0, and the absolute value of the horizontal direction component of the string displacement vector residual is obtained by debinarization according to the k2-order exponential Columbus code; the value of the horizontal direction component of the string displacement vector residual is determined according to the absolute value of the horizontal direction component of the string displacement vector residual and the symbol value of the horizontal direction component of the string displacement vector residual.
14. The video decoding method according to claim 11, characterized in that: The video decoding method further comprises: If the value of the vertical direction component of the string displacement vector residual is greater than 0, the symbol value of the horizontal direction component of the string displacement vector residual is set to the first value to indicate that the value of the horizontal direction component of the string displacement vector residual is less than 0; Perform debinarization processing according to the k2-order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual; The value of the horizontal direction component of the string displacement vector residual is determined according to the absolute value of the horizontal direction component of the string displacement vector residual and the sign value of the horizontal direction component of the string displacement vector residual.
15. The video decoding method according to claim 11, characterized in that: The video decoding method further comprises: If the value of the vertical component of the string displacement vector residual is less than 0, decoding the flag bit of the horizontal component of the string displacement vector residual from the bit stream; If the flag bit of the horizontal component of the string displacement vector residual is a first value, the symbol value of the horizontal component of the string displacement vector residual is decoded from the bit stream; wherein the flag bit of the horizontal component of the string displacement vector residual is a first value indicating that the value of the horizontal component of the string displacement vector residual is not 0; If it is determined that the value of the horizontal direction component of the string displacement vector residual is less than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in a k2-order exponential Golomb code manner, k2≥0; If it is determined that the value of the horizontal direction component of the string displacement vector residual is greater than 0 according to the symbol value of the horizontal direction component of the string displacement vector residual, then the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing debinarization processing in accordance with the t2-order exponential Golomb code, t2≥0 and t2 is not equal to k2; The value of the horizontal direction component of the string displacement vector residual is determined according to the absolute value of the horizontal direction component of the string displacement vector residual and the sign value of the horizontal direction component of the string displacement vector residual.
16. The video decoding method according to claim 15, characterized in that: The video decoding method further comprises: If the flag bit of the horizontal direction component of the string displacement vector residual is the second value, the value of the horizontal direction component of the string displacement vector residual is determined to be 0.
17. A video encoding method, characterized in that: include: Determine the sign value of the first direction component of the displacement vector residual; If it is determined that the value of the first direction component of the displacement vector residual is less than 0 according to the sign value of the first direction component of the displacement vector residual, debinarization is performed in a k1-order exponential Golomb code manner to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0; If it is determined that the value of the first direction component of the displacement vector residual is greater than 0 according to the sign value of the first direction component of the displacement vector residual, debinarization is performed in accordance with the t1-order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; Encoding is performed according to the absolute value of the first direction component of the displacement vector residual and the sign value of the first direction component of the displacement vector residual.
18. A video decoding device, characterized in that: include: A decoding unit, configured to decode a symbol value of a first direction component of a displacement vector residual from a bit stream; A first processing unit is configured to, if it is determined according to the sign value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is less than 0, perform debinarization processing according to a k1-order exponential Golomb code to obtain an absolute value of the first direction component of the displacement vector residual, k1≥0; A second processing unit is configured to, if it is determined according to the sign value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is greater than 0, perform debinarization processing according to a t1-order exponential Golomb code to obtain an absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; The third processing unit is configured to determine the value of the first direction component of the displacement vector residual according to the absolute value of the first direction component of the displacement vector residual and the sign value of the first direction component of the displacement vector residual.
19. A video encoding device, characterized in that: include: A determination unit configured to determine a sign value of a first direction component of a displacement vector residual; a fourth processing unit configured to, if it is determined according to the sign value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is less than 0, perform debinarization processing in a manner of k1-order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, k1≥0; a fifth processing unit configured to, if it is determined according to the symbol value of the first direction component of the displacement vector residual that the value of the first direction component of the displacement vector residual is greater than 0, perform debinarization processing according to a t1-order exponential Golomb code to obtain an absolute value of the first direction component of the displacement vector residual, t1≥0 and t1 is not equal to k1; The encoding unit is configured to perform encoding processing according to the absolute value of the first direction component of the displacement vector residual and the sign value of the first direction component of the displacement vector residual.
20. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 17 is implemented.
21. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Low-cycle context adaptive binary arithmetic coding (CABAC) decoder and decoding method based on high efficiency video coding (HEVC)
CN108235013A
Decoding method and device of quantized block and electronic equipment
CN109788284A