Video coding and decoding method and device, computer readable medium and electronic equipment
By decoding from the code stream, the absolute value and symbol value of the string displacement vector residual are simplified, the encoding and decoding process of the intra string copy mode is solved, the problem of high encoding and decoding complexity in the prior art is solved, and the encoding and decoding efficiency of video is improved.
Patent Information
- Application Number
- CN202510436924.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-14
- Publication Date
- 2025-05-30
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.
By decoding from the code stream the absolute value and symbol value of the first direction component of the string displacement vector residual is obtained, the encoding and decoding process of the string displacement vector residual is simplified and the encoding and decoding complexity is reduced.
The encoding and decoding process of string 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 CN120075461A_ABST
Abstract
Description
[0001] This application is a divisional application of the application with the application number 202110273048X and the invention name "Video Coding and Decoding Method, Device, Computer Readable Medium and Electronic Device", which was filed on March 14, 2021. Technical Field
[0002] This application relates to the field of computer and communication technologies, and in particular, to a video coding and decoding method, device, computer readable medium and electronic device. Background Art
[0003] In the existing video coding standard, the process of the motion vector coding method used for the string vector (SV) of the intra string copy (ISC) mode is relatively cumbersome, and the coding and decoding complexity is relatively high, which affects the video coding and decoding efficiency. Summary of the Invention
[0004] Embodiments of the present application provide a video coding and decoding method, device, computer readable medium and electronic device, which can at least improve the video coding and decoding efficiency to a certain extent.
[0005] Other features and advantages of the present application will become apparent through the following detailed description, or be learned in part through the practice of the present application.
[0006] According to one aspect of the embodiments of the present application, a video decoding method is provided, including: decoding an absolute value of a first direction component of a string displacement vector residual from a bitstream; if the absolute value of the first direction component of the string displacement vector residual is not 0, decoding a sign value of the first direction component of the string displacement vector residual from the bitstream; and determining a value of the first direction component of the string displacement vector residual according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
[0007] According to one aspect of the embodiments of the present application, a video coding method is provided, including: determining an absolute value of a first direction component of a string displacement vector residual; if the absolute value of the first direction component of the string displacement vector residual is not 0, obtaining a sign value of the first direction component of the string displacement vector residual; and performing coding processing according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
[0008] According to one aspect of the embodiments of the present application, a video decoding device is provided, including: a first decoding unit configured to decode an absolute value of a first direction component of a string displacement vector residual from a bitstream; a second decoding unit configured to, if the absolute value of the first direction component of the string displacement vector residual is not 0, decode a sign value of the first direction component of the string displacement vector residual from the bitstream; a first processing unit configured to determine a value of the first direction component of the string displacement vector residual according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
[0009] According to one aspect of the embodiments of the present application, a video encoding device is provided, including: a first determining unit configured to determine an absolute value of a first direction component of a string displacement vector residual; a second determining unit configured to, if the absolute value of the first direction component of the string displacement vector residual is not 0, obtain a sign value of the first direction component of the string displacement vector residual; an encoding unit configured to perform encoding processing according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
[0010] According to one aspect of the embodiments of the present application, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the above embodiments is implemented.
[0011] According to one aspect of the embodiments of the present application, an electronic device is provided, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in the above embodiments.
[0012] 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, and 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 alternative embodiments.
[0013] According to one aspect of the embodiments of the present application, a method for storing a video bitstream is provided, where the video bitstream is decoded according to the video decoding method described in the above embodiments, or the video bitstream is generated according to the video encoding method described in the above embodiments.
[0014] In the technical solutions provided by some embodiments of the present application, by decoding the absolute value of the first direction component of the string displacement vector residual from the bitstream, and when the absolute value of the first direction component of the string displacement vector residual is not 0, decoding the sign value of the first direction component of the string displacement vector residual from the bitstream, and then determining the value of the first direction component of the string displacement vector residual according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual, the encoding and decoding process of the string displacement vector residual can be simplified, the encoding and decoding complexity can be reduced, and it helps to improve the encoding and decoding efficiency of the video.
[0015] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts. In the drawings:
[0017] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied;
[0018] Figure 2 A schematic diagram showing the placement of a video encoding device and a video decoding device in a streaming system;
[0019] Figure 3 A basic flowchart showing a video encoder;
[0020] Figure 4 A schematic diagram showing inter-frame prediction;
[0021] Figure 5 A schematic diagram showing the determination of candidate MVs;
[0022] Figure 6 A schematic diagram showing intra-block copy;
[0023] Figure 7 A schematic diagram showing intra-string copy;
[0024] Figure 8 A flowchart showing a video decoding method according to an embodiment of the present application;
[0025] Figure 9 A flowchart showing a video decoding method according to an embodiment of the present application;
[0026] Figure 10 The flowchart of a video decoding method according to an embodiment of the present application is shown;
[0027] Figure 11 The block diagram of a video decoding apparatus according to an embodiment of the present application is shown;
[0028] Figure 12 The structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown. Detailed implementation manners
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various 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 will fully convey the concept of the example embodiments to those skilled in the art.
[0030] In addition, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present application.
[0031] The block diagrams shown in the accompanying drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can 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.
[0032] The flowcharts shown in the accompanying drawings are only illustrative and do not necessarily include all the contents and operations / steps, nor are they necessarily executed in the described order. 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 the actual situation.
[0033] It should be noted that: "a plurality of" mentioned in this article means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0034] Figure 1A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
[0035] As Figure 1 shown, the system architecture 100 includes a plurality of terminal devices, and the terminal devices 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. In Figure 1 the embodiment, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
[0036] For example, the first terminal device 110 may encode video data (such as a video picture stream collected by the terminal device 110) for transmission to the second terminal device 120 through the network 150. The encoded video data is transmitted in the form of one or more encoded video bitstreams. The second terminal device 120 may receive the encoded video data from the network 150, decode the encoded video data to recover the video data, and display the video picture according to the recovered video data.
[0037] In an 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. Such bidirectional transmission may occur, for example, during a video conference. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (such as a video picture stream collected by the terminal device) for transmission to the other 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 of the third terminal device 130 and the fourth terminal device 140, decode the encoded video data to recover the video data, and may display the video picture on an accessible display device according to the recovered video data.
[0038] In Figure 1In an embodiment, the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140 may be a server, a personal computer, and a smart phone, but the principles disclosed in this application are not limited thereto. The embodiments disclosed in this application are applicable to laptop computers, tablet computers, media players, and / or dedicated video conferencing devices. The network 150 represents any number of networks that transfer the 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-switched and / or packet-switched channels. The network may include a telecommunications network, a local area network, a wide area network, and / or the Internet. For the purposes of this application, unless otherwise explained below, the architecture and topology of the network 150 may be irrelevant to the operations disclosed in this application.
[0039] In an embodiment of the present application, Figure 2 illustrates the placement of a video encoding device and a video decoding device in a streaming environment. The subject matter disclosed in this application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television (TV), storing compressed video on digital media including CDs, DVDs, memory sticks, and so on.
[0040] The streaming system may include an acquisition subsystem 213, and the acquisition subsystem 213 may include a video source 201 such as a digital camera. The video source creates an uncompressed video picture stream 202. In an embodiment, the video picture stream 202 includes samples taken by the digital camera. Compared with the encoded video data 204 (or the encoded video bitstream 204), the video picture stream 202 is depicted as a thick line to emphasize the high data volume of the video picture stream. The video picture stream 202 may be processed by an electronic device 220, and the electronic device 220 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 enforce aspects of the subject matter disclosed in more detail below. Compared with the video picture stream 202, the encoded video data 204 (or the encoded video bitstream 204) is depicted as a thin line to emphasize the lower data volume of the encoded video data 204 (or the encoded video bitstream 204), which may be stored on the streaming server 205 for future use. One or more streaming client subsystems, such as Figure 2The client subsystems 206 and 208 therein can access the streaming server 205 to retrieve copies 207 and 209 of the encoded video data 204. The client subsystem 206 can include, for example, the 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 the display 212 (such as a display screen) or another presentation device. In some streaming systems, the encoded video data 204, video data 207, and video data 209 (such as video bitstreams) can be encoded according to certain video coding / compression standards.
[0041] It should be noted that the electronic devices 220 and 230 can include other components not shown in the figure. For example, the electronic device 220 can include a video decoding device, and the electronic device 230 can also include a video encoding device.
[0042] In one embodiment of the present application, taking High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC) in the international video coding standard, and the Chinese national video coding standard, i.e., the source coding standard Audio Video coding Standard (AVS) as examples, after inputting a video frame image, 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 a Coding Tree Unit (CTU), or the Largest Coding Unit (LCU). The CTU can be further divided more finely to obtain one or more basic Coding Units (CUs), and the CU is the most basic element in a coding link.
[0043] The following introduces some concepts when encoding the CU:
[0044] Predictive Coding: Predictive coding includes methods such as intra-frame prediction and inter-frame prediction. After the original video signal is predicted by the selected reconstructed video signal, a residual video signal is obtained. The encoding end needs to decide which predictive coding mode to select for the current CU and inform the decoding end. Among them, intra-frame prediction means that the predicted signal comes from the region that has been encoded and reconstructed within the same image; inter-frame prediction means that the predicted signal comes from other images (called reference images) that have been encoded and are different from the current image.
[0045] Transform & Quantization: After the residual video signal undergoes transformation operations such as the Discrete Fourier Transform (DFT) and the Discrete Cosine Transform (DCT), the signal is converted into the transform domain, and the resulting coefficients are called transform coefficients. The transform coefficients are further subjected to a lossy quantization operation, losing some information, which makes the quantized signal conducive to compressed representation. In some video coding standards, there may be more than one transform method to choose from. Therefore, the encoder also needs to select one of the transform methods for the current CU and inform the decoder. The fineness of quantization is usually determined by the Quantization Parameter (QP). A larger QP value means that coefficients within a larger value range will be quantized to the same output, usually resulting in greater distortion and a lower bitrate. Conversely, a smaller QP value means that coefficients within a smaller value range will be quantized to the same output, usually resulting in less distortion and a corresponding higher bitrate.
[0046] Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically compressed and encoded according to the frequencies of each value, and finally a binary (0 or 1) compressed bitstream is output. At the same time, other information generated during encoding, such as the selected coding mode, motion vector data, etc., also needs to be entropy encoded to reduce the bitrate. Statistical coding is a lossless coding method that can effectively reduce the bitrate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) or Content-Adaptive Binary Arithmetic Coding (CABAC).
[0047] The context-based binary arithmetic coding (CABAC) process mainly consists of three steps: binaryization, context modeling, and binary arithmetic coding. After binaryizing the input syntax element, the binary data can be encoded through the regular coding mode and the bypass coding mode. In the bypass coding mode, there is no need to assign a specific probability model to each binary bit. The input binary bit bin value is directly encoded by a simple bypass encoder to speed up the entire encoding and decoding process. Generally, different syntax elements are not completely independent, and the same syntax element itself also has a certain degree of memory. Therefore, according to the conditional entropy theory, using other already encoded syntax elements for conditional coding can further improve the coding performance compared to independent coding or memoryless coding. The information of these already encoded symbols used as conditions is called context. In the regular coding mode, the binary bits of the syntax element enter the context modeler sequentially. The encoder assigns an appropriate probability model to each input binary bit according to the values of the previously encoded syntax elements or binary bits. This process is context modeling. The context model corresponding to the syntax element can be located through the context index increment (ctxIdxInc) and the context index start (ctxIdxStart). After sending the bin value and the assigned probability model into 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.
[0048] Loop Filtering: The signal after transformation and quantization will obtain the reconstructed image through operations such as inverse quantization, inverse transformation, and prediction compensation. Compared with the original image, due to the influence of quantization, some information is different from the original image, that is, the reconstructed image will produce distortion. Therefore, filtering operations can be performed on the reconstructed image, such as deblocking filters (Deblocking filter, DB), sample adaptive offset (SAO), or adaptive loop filters (Adaptive Loop Filter, ALF), etc., which can effectively reduce the distortion degree caused by quantization. Since these filtered reconstructed images will be used as references for subsequent encoded images to predict future image signals, the above filtering operations are also called loop filtering, that is, filtering operations within the encoding loop.
[0049] In an embodiment of the present application, Figure 3 shows a basic flowchart of a video encoder, which is illustrated by taking intra-frame prediction as an example. Among them, the original image signal sk [x, y] and the predicted image signal perform a difference operation to obtain the residual signal u k [x, y], the residual signal u k [x, y] is transformed and quantized to obtain quantization coefficients. On the one hand, the quantization coefficients are entropy-coded to obtain the encoded bitstream. On the other hand, the reconstructed residual signal u' is obtained through inverse quantization and inverse transformation processing k [x, y], the predicted image signal and the reconstructed residual signal u' k [x, y] is superimposed with the reconstructed residual signal u' to generate an image signal The image signal is input to the intra-mode decision module and the intra-prediction module for intra-prediction processing on the one hand, and the reconstructed image signal s' is output through loop filtering on the other hand k [x, y], the reconstructed image signal s' k [x, y] can be used as a reference image for the next frame for motion estimation and motion compensation prediction. Then, based on the result s' of the motion compensation prediction r [x + m x , y + m y and the intra-prediction result to obtain the predicted image signal for the next frame and continue to repeat the above process until the encoding is completed
[0050] Based on the above encoding process, at the decoding end, for each CU, after obtaining the compressed bitstream (i.e., the bitstream), entropy decoding is performed to obtain various mode information and quantization coefficients. Then, the quantization coefficients are inverse quantized and inverse transformed to obtain the residual signal. On the other hand, according to the known encoding mode information, the prediction signal corresponding to the CU can be obtained. Then, after adding the residual signal and the prediction signal, the reconstructed signal is obtained. The reconstructed signal is further processed through loop filtering and other operations to generate the final output signal
[0051] Currently, 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, and video coding methods such as prediction, transformation, and entropy coding are combined to achieve the compression of video data. Among them, motion compensation is a commonly used prediction method in video coding. Based on the redundancy characteristics of video content in the time domain or spatial domain, the predicted value of the current coding block is derived from the already encoded region. Such prediction methods include: inter-frame prediction, intra-block copy prediction, intra-string copy prediction, etc. In specific coding implementations, these prediction methods may be used alone or in combination. For coding blocks that use these prediction methods, usually one or more two-dimensional displacement vectors need to be explicitly or implicitly encoded in the bitstream to indicate the displacement of the current block (or the co-located block of the current block) relative to one or more of its reference blocks.
[0052] It should be noted that under different prediction modes and different implementations, the displacement vector may have different names. In the embodiments of this application, it is uniformly described as follows: 1) The displacement vector in inter-frame prediction is called the motion displacement vector (Motion Vector, MV); 2) The displacement vector in intra-block copy is called the block displacement vector (Block Vector, BV); 3) The displacement vector in intra-string copy is called the string displacement vector SV.
[0053] As Figure 4 shown, inter-frame prediction utilizes the correlation in the video time domain, and uses the pixels of the neighboring already encoded images to predict the pixels of the current image, so as to effectively remove the redundancy in the video time domain and can effectively save the bits of the coding residual data. Among them, P represents the current frame, Pr represents the reference frame, B represents the current coding block, and Br represents the reference block of B. The coordinates of B' in the reference frame are the same as the coordinate position 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 (i.e., MV), where MV = (x r - x, y r - y).
[0054] Considering that neighboring blocks in the time domain or spatial domain have strong correlations, MV prediction technology can be adopted to further reduce the bits required for encoding MVs. In H.265 / HEVC, inter-frame prediction includes two MV prediction technologies: Merge and Advanced Motion Vector Prediction (AMVP). The Merge mode creates a list of MV candidates for the current prediction unit (PU), which contains 5 candidate MVs (and their corresponding reference images). Traverse these 5 candidate MVs and select the one with the minimum rate-distortion cost as the optimal MV. If the codec creates 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 there is also a skip mode in the MV prediction technology of HEVC, which is a special case of the Merge mode. After finding the optimal MV through the Merge mode, if the current block is basically the same as the reference block, then there is no need to transmit the residual data, and only the index of the MV and a skip flag need to be transmitted.
[0055] The MV candidate list established by the Merge mode includes both spatial and temporal cases. For B Slice, it also includes the way of a combined list. Among them, the spatial domain provides at most 4 candidate MVs, and its establishment is as Figure 5 shown in (a) below. The spatial list is established in the order of A1 -> B1 -> B0 -> A0 -> B2, where B2 is a substitute, that is, when one or more of A1, B1, B0, A0 do not exist, the motion information of B2 needs to be used; the temporal domain provides at most only 1 candidate MV, and its establishment is as Figure 5 shown in (b) below, which is obtained by scaling the MV of the co-located block according to the following formula:
[0056] curMV = td / tb × colMV
[0057] where 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. If the PU at the D0 position on the co-located block is not available, it is replaced by the co-located PU at the D1 position; for the PU in B Slice, since there are two MVs, its MV candidate list also needs to provide two MVPs. HEVC generates a combined list for B Slice by combining the first 4 candidate MVs in the MV candidate list in pairs.
[0058] Similarly, the AMVP mode utilizes the MV correlation of spatially and temporally adjacent blocks to establish a candidate prediction MV list for the current PU. Different from the Merge mode, the optimal prediction MV is selected from the candidate prediction MV list in the AMVP mode, and differential coding is performed with the optimal MV obtained by motion search for the current coded block, that is, coding MVD = MV - MVP; at the decoding end, by establishing the same list, only the sequence number of the motion vector difference (MVD) and the motion vector predictor (MVP) in this list are required to calculate the MV of the current coded block. The AMVP candidate MV list also includes two cases of spatial and temporal domains. The difference is that the length of the AMVP list is only 2.
[0059] History based Motion Vector Prediction (HMVP) is a newly adopted MV prediction technology in H.266 / VVC. HMVP is a motion vector prediction method based on historical information. The motion information of historical coded blocks 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 the Merge mode, and its order is after the spatial and temporal MVPs. The HMVP technology stores the motion information of previous coded blocks in a First Input First Output (FIFO) queue. If the stored prediction candidate information is the same as the motion information just coded, this duplicate candidate information will be removed first, 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 then the latest motion information is added to the end of the FIFO queue. The HMVP list will be reset (i.e., cleared) when a new CTU row is encountered. In H.266 / VVC, the size of the HMVP list is set to 6. To reduce the number of redundant check operations, the following simplification strategies are introduced:
[0060] 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.
[0061] 2. Once the length of the available Merge list reaches the maximum allowed length minus 1, the process of constructing the merge candidate list for HMVP terminates.
[0062] Intra Block Copy (IBC) is an encoding tool adopted in the Screen Content Coding (SCC) extension of HEVC, which significantly improves the encoding efficiency of screen content. In AVS3 and VVC, IBC technology is also adopted to improve the performance of screen content encoding. IBC utilizes the spatial correlation of screen content videos 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. As Figure 6 shown, the displacement between the current block and its reference block in IBC is called the block displacement vector BV. H.266 / VVC adopts a BV technology similar to inter prediction to further save the bits required for encoding BV.
[0063] The intra-string copy technology divides an encoded block into a series of pixel strings or unmatched pixels according to a certain scanning order (such as raster scanning, back-and-forth scanning, and Zig-Zag scanning). Similar to IBC, each string searches for a reference string with the same shape in the encoded area of the current image, derives the predicted value of the current string, and replaces the direct encoding of pixel values by encoding the residuals between the pixel values of the current string and the predicted value, which can effectively save bits. Figure 7 The schematic diagram of intra-string copy is given. The dark gray area is the encoded area, the 28 white pixels are string 1, the 35 light gray pixels are string 2, and the 1 black pixel represents the unmatched pixel. The displacement of string 1 to the encoded string matched in the encoded area is called string vector 1, and the displacement of string 2 to the encoded string matched in the encoded area is called string vector 2.
[0064] The intra-string copy technology needs to encode the string vector SV, string length, and the flag indicating whether there is a matching string corresponding to each string in the currently encoded block. 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 included in the string. In different implementation methods, there are various ways to encode the string length. The following are several examples (some examples may be used in combination): 1) directly encode the length of the string in the bitstream; 2) encode the number of pixels to be processed after processing the string in the bitstream, and the decoding end calculates the length L of the current string according to the size N of the current block, the number of pixels N1 that have been processed, and the number of pixels N2 to be processed obtained by decoding, i.e., L = N - N1 - N2; 3) encode a flag in the bitstream to indicate whether the string is the last string. If it is the last string, the length L of the current string is calculated according to the size N of the current block and the number of pixels N1 that have been processed, i.e., L = N - 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.
[0065] Intra-block copy (IBC) and intra-string copy (ISC) are two screen content encoding tools in AVS3. Both of them use the current image as a reference and derive the predicted value of the coding unit through motion compensation. Considering that IBC and ISC have similar reference areas and the block displacement vector (BV) and string displacement vector (SV) have a high correlation, 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 repetition times of these two types of coding blocks, and derives the predicted block displacement vector (Block Vector Predictor, BVP) and predicted string displacement vector from IntraHMVP.
[0066] AVS3 uses a method called Class based Block Vector Prediction (CBVP) to derive BVP. This method classifies the candidate BVs in IntraHMVP according to the following conditions:
[0067] Category 0: The area of the historical coding block is greater than or equal to 64 pixels;
[0068] Category 1: The frequency of BV is greater than or equal to 2;
[0069] Category 2: The coordinates of the upper left corner of the historical coding block are to the left of the coordinates of the upper left corner of the current block;
[0070] 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;
[0071] Category 4: The coordinates of the upper left corner of the historical coding block are located above and to the left of the coordinates of the upper left corner of the current block;
[0072] 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;
[0073] Category 6: The coordinates of the upper left corner of the historical coding block are located below and to the left of the coordinates of the upper left corner of the current block.
[0074] Among them, the instances in each category are arranged in reverse order of the coding sequence (that is, the closer the coding sequence is to the current block, the higher the sorting). The BV corresponding to the first historical coding block is the candidate BV corresponding to this category, and then the candidate BV corresponding to each category is added to the CBVP list in the order from category 0 to category 6. When adding a new BV to the CBVP list, it is necessary to check whether there is a duplicate BV in the CBVP list. Only when there is no duplicate BV, the BV is added to the CBVP list. The encoding end selects the best candidate BV in the CBVP list as the BVP and encodes an index in the bitstream, indicating the index of the category corresponding to the best candidate BV in the CBVP list. The decoding end decodes the BVP from the CBVP list according to this index.
[0075] After completing the decoding of the current prediction unit, 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, according to the motion information of the block copy intra prediction of the current prediction block, update IntraHMVP according to the method in the following embodiments. The intra prediction motion information of the current prediction block includes displacement vector information, position information, size information, and repetition times. Among them, the displacement vector information of the block copy intra prediction block is the block displacement vector; the position information includes the abscissa of the upper left corner and the ordinate of the upper left corner of the current prediction block; the size information is the product of the width and the height; the repetition times of the current prediction block are initialized to 0.
[0076] 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 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 the SVP.
[0077] After decoding the current prediction unit, if the prediction type of the current prediction unit is string copy intra prediction, when NumOfIntraHmvpCand is greater than 0, update IntraHMVP according to the intra prediction motion information of the current prediction block by the method in the following embodiments. The intra prediction motion information includes displacement vector information, position information, size information, and repetition count. The displacement vector information of the current string is the string vector; the position information includes the abscissa and ordinate of the first pixel sample of the string; the size information is the string length of this part; the repetition count is initialized to 0.
[0078] The following introduces the update process of the intra prediction history motion information table IntraHMVP: The intra prediction motion information includes displacement vector information, position information, size information, and repetition count. After decoding the current prediction unit, if the prediction type of the current prediction unit is block copy intra prediction or string copy intra prediction, and NumOfIntraHmvpCand is greater than 0, update the intra prediction history motion information table IntraHmvpCandidateList according to the intra prediction motion information of the current prediction block. Assume that the displacement vector information, position information, size information, and repetition count of IntraHmvpCandidateList[X] are denoted as intraMvCandX, posCandX, sizeCandX, and cntCandX respectively, then perform the following process:
[0079] Step 101, initialize X to 0 and cntCur to 0.
[0080] Step 102, if CntIntraHmvp = 0, then IntraHmvpCandidateList[CntIntraHmvp] is the intra prediction motion information of the current prediction unit, and increment CntIntraHmvp by 1.
[0081] Step 103, if CntIntraHmvp ≠ 0, then 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:
[0082] Step 1031, if intraMvCur and intraMvCandX are the same, then perform Step 104; otherwise, increment X by 1.
[0083] Step 1032, if X is less than CntIntraHmvp, then perform Step 103; otherwise, perform Step 105.
[0084] Step 104, cntCur is equal to the value of cntCandX plus 1. If sizeCur is less than sizeCandX, then the current sizeCur is respectively equal to sizeCandX.
[0085] Step 105, if X is less than CntIntraHmvp, then:
[0086] Step 1051, for i from X to CntIntraHmvp - 1, let IntraHmvpCandidateList[i]
[0087] be equal to IntraHmvpCandidateList[i + 1];
[0088] Step 1052, IntraHmvpCandidateList[CntIntraHmvp - 1] is equal to the intra prediction motion information of the current prediction unit.
[0089] Step 106, if X is equal to CntIntraHmvp and CntIntraHmvp is equal to NumOfIntraHmvpCand, then:
[0090] Step 1061, for i from 0 to CntIntraHmvp - 1, let IntraHmvpCandidateList[i]
[0091] be equal to IntraHmvpCandidateList[i + 1];
[0092] Step 1062, IntraHmvpCandidateList[CntIntraHmvp - 1] is equal to the intra prediction motion information of the current prediction unit.
[0093] 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 incremented by 1.
[0094] The following introduces the decoding process of the serial displacement vector SV in AVS3. In the current AVS3, taking the serial scan direction as the horizontal direction as an example, as shown in Table 1, the main process of decoding SV(IscSvX, IscSvY) in AVS3 is as follows (the underlined and bold fields in Table 1 represent the syntax elements to be decoded, and the fields with the first letter capitalized without underlining represent variables, and the values of the variables can be obtained by decoding the syntax elements):
[0095] Step 201, decode the string vector upper flag isc_sv_above_flag. If the value of isc_sv_above_flag is 1, then the value of IscSvX is 0 and the value of IscSvY is -1.
[0096] Step 202, if the value of isc_sv_above_flag is 0, then 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. According to the value of isc_sv_recent_index and combined with the intra prediction history motion information table, look up the values of IscSvX and IscSvY.
[0097] Step 203, if the value of isc_sv_recent_flag is 0, then decode the SV according to the following steps:
[0098] Step 2031, decode the string vector Y component flag isc_sv_y_non_zero_flag;
[0099] Step 2032, if the value of isc_sv_y_non_zero_flag is 0, that is, the value of IscSvY is 0, decode IscSvx according to the following steps:
[0100] (1) If the value of IsOddRow is 1, that is, the current string is on an odd row (the starting row is row 0), then decode the string vector X component sign bit isc_sv_x_sign and get 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;
[0101] (2) If the value of IsOddRow is 0, then set the value of isc_sv_x_sign to 1, that is, the value of IscSvx is less than 0;
[0102] (3) Decode and de-binarize and derive the absolute value of the string vector X component isc_sv_x_abs_minus1 according to the method of 3rd 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.
[0103] Step 2033, if the value of isc_sv_y_non_zero_flag is 1, that is, the value of IscSvY is not 0, then decode to obtain IscSvy and IscSvx successively according to the following steps:
[0104] (1) Decode the sign bit isc_sv_y_sign of the string vector Y component 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;
[0105] (2) Decode and de-binarize and deduce the absolute value isc_sv_y_abs_minus1 of the string vector Y component according to the method of the 3rd-order exponential Golomb code. Then the value of IscSvYAbs is equal to isc_sv_y_abs_minus1 + 1. Combining with the value of isc_sv_y_sign, the value of IscSvY can be obtained;
[0106] (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 and deduce the absolute value isc_sv_x_abs_minus1 of the string vector X component according to the method of the 3rd-order exponential Golomb. Then the value of IscSvXAbs is equal to isc_sv_x_abs_minus1 + 1 + SvOffset. Directly set the value of isc_sv_x_sign to 1, that is, the value of IscSvX is less than 0. Combining with the value of isc_sv_x_sign, the value of IscSvX can be obtained.
[0107] The value of SvOffset is obtained through the algorithm defined in the AVS standard and will not be elaborated here.
[0108] (4) If the value of isc_sv_y_sign is 1, that is, the value of IscSvy is less than 0, then 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;
[0109] (5) If the value of isc_sv_x_non_zero_flag is 1, then the value of IscSvX is not 0. Then decode the sign bit isc_sv_x_sign of the string vector X component 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;
[0110] (6) Decode and de-binarize the derived string vector X-component absolute value isc_sv_x_abs_minus1 according to the method of 3rd-order exponential Golomb code. Then the value of IscSvXAbs is equal to isc_sv_x_abs_minus1 + 1. Combining with the value of isc_sv_x_sign, the value of IscSvX can be obtained.
[0111]
[0112] Table 1
[0113] In Table 1, when the value of the string vector upper flag isc_sv_above_flag[i] is "1", it means that the string vector of the i-th part of the current coding unit is (0, -1); when the value is "0", it means that the string vector is not (0, -1). And IscSvAboveFlag[i] is equal to the value of isc_sv_above_flag[i].
[0114] When the value of the string vector history flag isc_sv_recent_flag[i] is "1", it means 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; when the value is "0", it means 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.
[0115] If the values of both IscSvAboveFlag[i] and IscSvRecentFlag[i] are 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].
[0116] 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].
[0117] The value of the string vector X-component flag isc_sv_x_non_zero_flag[i] being "1" indicates 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 being "0" indicates that the value of the X-component is equal to 0. Also, 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, then the value of IscSvXNonZeroFlag[i] is 1.
[0118] The value of the string vector Y-component flag isc_sv_y_non_zero_flag[i] being "1" indicates 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 being "0" indicates that the value of the Y-component is equal to 0. Also, 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, then the value of IscSvYNonZeroFlag[i] is 1.
[0119] 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. Also, 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, then the value of IscSvXSign[i] is 1.
[0120] 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. Also, 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, then the value of IscSvYSign[i] is 1.
[0121] The string vector X-component absolute value 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. Also, IscSvXAbs[i] is equal to the value of isc_sv_x_abs_minus1[i] plus 1.
[0122] The string vector Y-component absolute value 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. Also, IscSvYAbs[i] is equal to the value of isc_sv_y_abs_minus1[i] plus 1.
[0123] Meanwhile, in the above method, the inverse binarization processing of isc_sv_x_abs_minus1 and isc_sv_y_abs_minus1 can specifically be obtained by querying the corresponding synElVal value in Table 2 below 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.
[0124]
[0125] Table 2
[0126] The decoding process of the Block Vector Difference (BVD) in AVS3 is introduced below. As shown in Table 3, the main process of decoding the BVD in AVS3 is as follows (the underlined and bold fields in Table 3 represent the syntax elements to be decoded, and the fields with the first letter capitalized without an underline represent variables, and the values of the variables can be obtained by decoding the syntax elements):
[0127] Step 301: Derive the absolute value of the horizontal direction of the motion vector residual mv_diff_x_abs_bv from the bitstream after decoding, which specifically includes:
[0128] (1) Decode and inverse-binarize from the bitstream in the form of a truncated unary code (two forms of truncated unary codes shown in Table 4-1 or Table 4-2, with the 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, let offset be equal to mv_diff_x_abs_bv_pre, then mv_diff_x_abs_bv is equal to offset;
[0129] (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, inverse-binarize in the form of a 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;
[0130] (3) If mv_diff_x_abs_bv_pre equals 6, then the value of mv_diff_x_abs_bv belongs to the interval [9, 17). Let offset equal 9, entropy decode 3 bits from the bitstream, de-binarize in the way of 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 equals offset + mv_diff_x_abs_bv_suf;
[0131] (4) If mv_diff_x_abs_bv_pre equals 7, then the value of mv_diff_x_abs_bv belongs to the interval [17, ∞). Let offset equal 17, continue to decode 1 bit from the bitstream to obtain the flag mv_diff_x_abs_bv_parity indicating the parity of mv_diff_x_abs_bv;
[0132] (5) After obtaining the value of mv_diff_x_abs_bv_parity, continue to perform entropy decoding from the bitstream, de-binarize in the way of 2nd-order exponential Golomb code (see the k-th 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;
[0133] Step 302, if the value of mv_diff_x_abs_bv is not 0, then decode 1 bit from the bitstream and derive the sign mv_diff_x_sign_bv of the horizontal direction value of the motion vector residual;
[0134] Step 303, derive the absolute value mv_diff_y_abs_bv of the vertical direction of the motion vector residual after decoding from the bitstream. The specific method is similar to (1) - (5) in Step 301.
[0135] Step 304, if the value of mv_diff_y_abs_bv is not 0, then decode 1 bit from the bitstream and derive the sign mv_diff_y_sign_bv of the vertical direction value of the motion vector residual.
[0136]
[0137] Table 3
[0138] 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, the value of MvDiffXAbsBv is equal to the value of mv_diff_x_abs_bv, and the value of MvDiffYAbsBv is equal to the value of mv_diff_y_abs_bv.
[0139] mv_diff_x_sign_bv represents the sign value of the horizontal component difference of the block vector, and mv_diff_y_sign_bv represents the sign value of the vertical component difference of the block vector. Moreover, the value of MvDiffXSignbV is equal to the value of mv_diff_x_sign_bv, and the value of MvDiffYSignBv is equal to the value of 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.
[0140] The values of the horizontal component difference MvDiffXBv and the vertical component difference MvDiffYBv of the block vector are represented as follows, and the value range is -32768 to 32767:
[0141] MvDiffXBv = (-1) MvDiffXSignBv × MvDiffXAbsBv
[0142] MvDiffYBv = (-1) MvDiffYSignBv × MvDiffYAbsBv
[0143]
[0144] Table 4-1
[0145]
[0146] Table 4-2
[0147]
[0148] Table 5
[0149]
[0150] Table 6
[0151] The following introduces 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 with the first letter capitalized without underlining represent variables, and the values of the variables can be obtained by decoding the syntax elements):
[0152] Step 401, derive the absolute value mv_diff_x_abs of the horizontal direction of the motion vector residual from the bitstream after decoding, specifically including:
[0153] (1) Decode and de-binarize from the bitstream in the form of truncated unary code (two forms of truncated unary code shown in Table 4-1 or Table 4-2, with the truncation value maxVal = 3) to obtain the prefix value mv_diff_x_abs_pre. If mv_diff_x_abs_pre is less than or equal to 2, let offset be equal to mv_diff_x_abs_pre, then mv_diff_x_abs is equal to offset;
[0154] (2) If mv_diff_x_abs_pre is equal to 3, then the value of mv_diff_x_abs belongs to the interval [3, ∞). Let offset be equal to 3, and continue to decode 1 bit from the bitstream to obtain the flag mv_diff_x_abs_parity indicating the parity of mv_diff_x_abs;
[0155] (3) After obtaining the value of mv_diff_x_abs_parity, continue to perform entropy decoding from the bitstream, and de-binarize in the manner of 0th 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;
[0156] 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 after decoding 1 bit from the bitstream;
[0157] Step 403, derive the absolute value mv_diff_y_ab of the vertical direction of the motion vector residual from the bitstream after decoding. The specific method is similar to (1) - (5) in Step 401.
[0158] Step 404, if the value of mv_diff_y_abs is not 0, then derive the sign mv_diff_y_sign of the vertical direction value of the motion vector residual after decoding 1 bit from the bitstream.
[0159]
[0160] Table 7
[0161] 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 value of MvDiffXAbsL0, which is the absolute value of the horizontal component difference of the motion vector from reference image queue 0, is equal to the value of mv_diff_x_abs_l0, and the value of MvDiffYAbsL0, which is the absolute value of the vertical component difference of the motion vector from reference image queue 0, is equal to the value of mv_diff_y_abs_l0.
[0162] 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 MvDiffXSignL0, which is the sign bit of the horizontal component difference of the motion vector from reference image queue 0, is equal to the value of mv_diff_x_sign_l0, and the value of MvDiffYSignL0, which is the sign bit of the vertical component difference of the motion vector from reference image 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.
[0163] The values of the horizontal component difference MvDiffXL0 and the vertical component difference MvDiffYL0 of the motion vector are represented as follows, and the value range is -32768 to 32767:
[0164] MvDiffXL0 = (-1) MvDiffXSignL0 × MvDiffXAbsL0
[0165] MvDiffYL0 = (-1) MvDiffYSignL0 × MvDiffYAbsL0
[0166] As can be seen from the above, in existing video coding standards (such as VVC and AVS3), the process of the motion vector coding method used for the string displacement vector SV in the intra string copy ISC mode is relatively cumbersome, with a high encoding and decoding complexity, and is completely different from the motion vector coding methods of the motion vector MV in the inter frame mode and the block displacement vector BV in the intra block copy IBC mode. According to the statistical characteristics of the SV, the embodiment of the present application proposes a motion vector coding method that conforms to the distribution characteristics of the SV, which can simplify the SV encoding and decoding process, reduce the SV encoding and decoding complexity, ensure the compression performance of the video, and generally contribute to the improvement of the SV encoding and decoding efficiency.
[0167] The implementation details of the technical solution of the embodiment of the present application are elaborated in detail as follows:
[0168] Figure 8 The flowchart of a video decoding method according to an embodiment of the present application is shown. This video decoding method can be executed by a device with computing and processing capabilities, such as a terminal device or a server. Referring to Figure 8 As shown, this video decoding method at least includes steps S810 to S840, which are introduced in detail as follows:
[0169] In step S810, the symbol value of the first direction component of the displacement vector residual is decoded from the bitstream.
[0170] In an embodiment of the present application, the displacement vector residual can be a string displacement vector residual SVD, a motion displacement vector residual MVD, or a block displacement vector residual BVD. The first direction component can be a vertical direction component or a horizontal direction component.
[0171] The symbol 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 symbol value of the first direction component of the displacement vector residual is the first value (such as 1), 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 the second value (such as 0), it is determined that the value of the first direction component of the displacement vector residual is greater than 0.
[0172] In one embodiment of the present application, the flag bit of the first direction component of the displacement vector residual can be decoded from the bitstream first. 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 the first value (for example, when it is 1), the sign value of the first direction component of the displacement vector residual is decoded from the bitstream; wherein, the flag bit of the first direction component of the displacement vector residual being the first value indicates 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 the second value (for example, when it is 0), the value of the first direction component of the displacement vector residual can be directly determined to be 0.
[0173] In step S820, 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, then according to k 1 inverse binary processing is performed in the manner of the k - order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, where k 1 ≥0.
[0174] In step S830, 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, then according to t 1 inverse binary processing is performed in the manner of the t - order exponential Golomb code to obtain the absolute value of the first direction component of the displacement vector residual, where t 1 ≥0 and t 1 is not equal to k 1 and.
[0175] In step S840, 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, the value of the first direction component of the displacement vector residual is determined.
[0176] In one embodiment of the present application, after knowing the sign 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 this sign 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 it is determined according to the sign value of the vertical direction component of the string displacement vector residual that the value of the vertical direction component of the string displacement vector residual IscSvY is less than 0, then IscSvY = -(isc_sv_y_abs_minus1 + 1); if it is determined according to the sign value of the vertical direction component of the string displacement vector residual that IscSvY is greater than 0, then IscSvY = isc_sv_y_abs_minus1 + 1.
[0177] Figure 8The technical solution of the illustrated embodiment enables the use of Columbus codes with different orders of exponents to determine the absolute value of the first direction component of the displacement vector residual according to the value of the first direction component of the displacement vector residual, and further enables the determination of 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, simplifying the encoding and decoding process of the displacement vector residual, reducing the encoding and decoding complexity, and contributing to improving the encoding and decoding efficiency of the video.
[0178] It should be noted that: In Figure 8 In the technical solution of the illustrated embodiment, the displacement vector residual may be a string vector difference (SVD). In this case, if the string vector predictor (SVP) is not obtained, then the SVD can be used as the string vector (SV). That is, when there is no SVP, Figure 8 The technical solution of the illustrated embodiment can be used for the decoding of SV, that is, SV = SVD.
[0179] If the SVP is obtained, then the SV can be determined according to the SVD and the SVP. That is, when there is an SVP, Figure 8 The technical solution of the illustrated embodiment can be used for the decoding of SV and SVD, that is, SV = SVD + SVP.
[0180] Meanwhile, Figure 8 The technical solution of the illustrated embodiment can not only be used for the decoding of SV / SVD, but also for other amplitude decoding, such as the decoding of the motion displacement vector residual (MVD) of the inter-frame prediction block, the decoding of the block motion vector residual (BVD) of the intra-block copy (IBC), etc.
[0181] Figure 9 The flowchart of a video decoding method according to an embodiment of the present application is shown. This video decoding method can be executed by a device with computing and processing capabilities, such as a terminal device or a server. Referring to Figure 9 As shown, this video decoding method at least includes steps S910 to S930, which are introduced in detail as follows:
[0182] In step S910, the absolute value of the second direction component of the displacement vector residual is decoded from the bitstream.
[0183] In an embodiment of the present application, the displacement vector residual may be an SVD, or an MVD, or a BVD. The second direction component may be a horizontal direction component, or a vertical direction component.
[0184] In an embodiment of the present application, the process of decoding the absolute value of the second direction component of the displacement vector residual from the bitstream may be as follows: Decode the bitstream in the manner of a truncated unary code and perform inverse binarization to obtain the prefix value of the second direction component of the displacement vector residual, and then generate 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.
[0185] Optionally, when 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, the following embodiments may exist:
[0186] If the prefix value of the second direction component of the displacement vector residual is less than or equal to 4, then 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;
[0187] If the prefix value of the second direction component of the displacement vector residual is equal to 5, set the compensation value to 5, and based on the 2-bit bits continuously decoded from the bitstream, perform inverse binarization in the manner of a 2-bit fixed-length code to obtain the suffix value of the second direction component of the displacement vector residual, and generate the absolute value of the second direction component of the displacement vector residual according to the suffix value and the compensation value of the second direction component of the displacement vector residual;
[0188] If the prefix value of the second direction component of the displacement vector residual is equal to 6, set the compensation value to 9, and based on the 3-bit bits continuously decoded from the bitstream, perform inverse binarization in the manner of a 3-bit fixed-length code to obtain the suffix value of the second direction component of the displacement vector residual, and generate the absolute value of the second direction component of the displacement vector residual according to the suffix value and the compensation value of the second direction component of the displacement vector residual;
[0189] If the prefix value of the second direction component of the displacement vector residual is equal to 7, set the compensation value to 17, and based on the 1-bit bit continuously decoded from the bitstream, determine the parity of the absolute value of the second direction component of the displacement vector residual; continue to decode from the bitstream, perform inverse binarization in the manner of a second-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 inverse binarization in the manner of 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.
[0190] Optionally, when 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, the following embodiments may also exist:
[0191] If the prefix value of the second direction component of the displacement vector residual is less than or equal to 2, then 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;
[0192] If the prefix value of the second direction component of the displacement vector residual is equal to 3, set the compensation value to 3, and determine the parity of the absolute value of the second direction component of the displacement vector residual based on 1 bit decoded continuously from the bitstream; continue to decode from the bitstream, perform inverse binarization in the manner of the 0th 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 inverse binarization in the manner of 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.
[0193] Continue to refer to Figure 9 As shown, in step S920, if the absolute value of the second direction component of the displacement vector residual is not 0, decode the sign value of the second direction component of the displacement vector residual from the bitstream.
[0194] Optionally, when it is determined that the absolute value of the second direction component of the displacement vector residual is not 0, continue to decode 1 bit from the bitstream to determine the sign value of the second direction component of the displacement vector residual.
[0195] In step S930, 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 sign value of the second direction component of the displacement vector residual.
[0196] It should be noted that: in Figure 9 In the technical solution of the embodiment shown, the displacement vector residual can be the string displacement vector residual SVD. In this case, if the predicted string displacement vector SVP is not obtained, then the string displacement vector residual SVD can be used as the string displacement vector SV. That is, when there is no SVP, Figure 9 The technical solution of the embodiment shown can be used for the decoding of SV, that is, SV = SVD.
[0197] If the predicted string displacement vector SVP is obtained, then 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, Figure 9 The technical solution of the embodiment shown can be used for the decoding of SV and SVD, that is, SV = SVD + SVP.
[0198] Meanwhile, Figure 9 The technical solution of the embodiment shown is preferably applicable to the decoding of SV / SVD. In this case, the decoding of SV / SVD can be implemented in a manner similar to BVD or MVD, which simplifies the encoding and decoding process of SV, reduces the encoding and decoding complexity, and helps to improve the encoding and decoding efficiency of the video.
[0199] Figure 10The figure shows a flowchart of a video decoding method according to an embodiment of the present application. The video decoding method can be executed by a device with computing and processing capabilities, such as a terminal device or a server. Referring to Figure 10 as shown, the video decoding method at least includes steps S1010 to S1040, which are introduced in detail as follows:
[0200] In step S1010, obtain the value of the vertical component of the string displacement vector residual obtained by decoding.
[0201] In an embodiment of the present application, the value of the vertical component of the string displacement vector residual can be decoded by the method of the foregoing Figure 8 shown embodiment, or can also be decoded by the method of the foregoing Figure 9 shown embodiment, and can also be obtained by the decoding method in existing standards.
[0202] In step S1020, obtain the sign value of the horizontal component of the string displacement vector residual according to the relationship between the value of the vertical component of the string displacement vector residual and 0.
[0203] In an embodiment of the present application, if the value of the vertical component of the string displacement vector residual is 0, the sign value of the horizontal component of the string displacement vector residual can be directly decoded from the bitstream.
[0204] In an embodiment of the present application, when the starting row of decoding 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 sign value of the horizontal component of the string displacement vector residual can be decoded from the bitstream again. 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 a first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0.
[0205] In an 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.
[0206] In an embodiment of the present application, if the value of the vertical direction component of the string displacement vector residual is less than 0, the value of the flag bit of the horizontal direction component of the string displacement vector residual can be decoded from the bitstream. If the flag bit of the horizontal direction component of the string displacement vector residual is the first value (for example, when it is 1), the sign value of the horizontal direction component of the string displacement vector residual is decoded from the bitstream, that is, the flag bit of the horizontal direction component of the string displacement vector residual being the first value indicates that the value of the horizontal direction component of the string displacement vector residual is not 0. If the flag bit of the horizontal direction component of the string displacement vector residual is the second value (for example, when it is 0), it can be determined that the value of the horizontal direction component of the string displacement vector residual is 0.
[0207] Continue to refer to Figure 10 As shown, in step S1030, according to the sign value of the horizontal direction component of the string displacement vector residual, the order of the exponential Golomb code is determined, and the absolute value of the horizontal direction component of the string displacement vector residual is obtained by performing inverse binarization in the manner of the Golomb code.
[0208] In an embodiment of the present application, if the sign value of the horizontal direction component of the string displacement vector residual indicates that the value of the horizontal direction component of the string displacement vector residual is less than 0, inverse binarization can be performed according to the k 2 -order exponential Golomb code to obtain the absolute value of the horizontal direction component of the string displacement vector residual, where k 2 ≥0; if the sign value of the horizontal direction component of the string displacement vector residual indicates that the value of the horizontal direction component of the string displacement vector residual is greater than 0, inverse binarization is performed according to the t 2 -order exponential Golomb code to obtain the absolute value of the horizontal direction component of the string displacement vector residual, where t 2 ≥0 and t 2 is not equal to k 2 .
[0209] That is, the technical solution of the embodiment of the present application can use Golomb codes with different orders of exponents according to the value of the horizontal direction component of the string displacement vector residual to determine the absolute value of the horizontal direction component of the string displacement vector residual, 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.
[0210] In step S1040, 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, the value of the horizontal direction component of the string displacement vector residual is determined.
[0211] In Figure 10In the technical solution of the illustrated embodiment, the value of the horizontal component of the string displacement vector residual depends on the value of the vertical component of the string displacement vector residual. In this case, it is necessary to first decode the value of the vertical component of the string displacement vector residual, and then determine the value of the horizontal component of the string displacement vector residual based on the value of the vertical component of the string displacement vector residual. Specifically, it is divided into the case where the value of the vertical component of the string displacement vector residual is 0, the case where the value of the vertical component of the string displacement vector residual is greater than 0, and the case where the value of the vertical component of the string displacement vector residual is less than 0.
[0212] When the value of the vertical component of the string displacement vector residual is 0, the sign value of the horizontal component of the string displacement vector residual can be decoded from the bitstream first; if the sign 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 the absolute value of the horizontal component of the string displacement vector residual can be obtained by performing inverse binarization in the manner of the k 2 -order exponential Golomb code; if the sign 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 the absolute value of the horizontal component of the string displacement vector residual can be obtained by performing inverse binarization in the manner of the t 2 -order exponential Golomb code, and then the value of the horizontal component of the string displacement vector residual can be determined according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
[0213] 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 (in the case where the starting decoding row is the 0th row). If it is an odd row, then the sign value of the horizontal component of the string displacement vector residual can be decoded from the bitstream. If it is an even row, the sign 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 can be obtained by performing inverse binarization according to the k 2 -order exponential Golomb code, and then the value of the horizontal component of the string displacement vector residual can be determined according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
[0214] When the value of the vertical component of the string displacement vector residual is greater than 0, the sign 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 the absolute value of the horizontal component of the string displacement vector residual can be obtained by performing inverse binarization in the manner of the k 2 -order exponential Golomb code, and the value of the horizontal component of the string displacement vector residual can be determined according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
[0215] When the value of the vertical direction component of the string displacement vector residual is less than 0, the flag bit of the horizontal direction component of the string displacement vector residual can be decoded from the bitstream. If 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), then the sign value of the horizontal direction component of the string displacement vector residual is decoded from the bitstream; and then the absolute value of the horizontal direction component of the string displacement vector residual is determined by using the Golomb code of different orders according to the value of the horizontal direction component of the string displacement vector residual, and 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. At the same time, if the flag bit of the horizontal direction component of the string displacement vector residual is the second value, it can be determined that the value of the horizontal direction component of the string displacement vector residual is 0.
[0216] It should be noted that: in Figure 10 the technical solution of the illustrated embodiment, if the predicted string displacement vector SVP is not obtained, then the string displacement vector residual SVD can be used as the string displacement vector SV. That is, when there is no SVP, Figure 10 the technical solution of the illustrated embodiment can be used for the decoding of SV, that is, SV = SVD. If the predicted string displacement vector SVP is obtained, then 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, Figure 10 the technical solution of the illustrated embodiment can be used for the decoding of SV and SVD, that is, SV = SVD + SVP.
[0217] In summary Figures 8 to 10 , the technical solution of the embodiment of the present application can better conform to the SV distribution characteristics. 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 generally helps to improve the efficiency of SV encoding and decoding. The following takes the string scanning direction as the horizontal direction as an example, and details of the application of the technical solution of the embodiment of the present application to the SV decoding scenario are introduced in detail from the perspective of the decoding end, which mainly includes the following steps:
[0218] Step 501, decode 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.
[0219] Step 502, if the value of isc_sv_above_flag is 0, then 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. According to the value of isc_sv_recent_index, combined with the intra prediction history motion information table, look up the table to obtain the values of IscSvX and IscSvY.
[0220] It should be noted that the processing procedure of step 502 is similar to the skip / direct mode of SV, and it can be understood that there is a prediction process of SV, that is, SVP is not 0.
[0221] Step 503, if the value of isc_sv_recent_flag is 0, then decode SV(IscSvX, IscSvY) respectively according to the following method.
[0222] 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.
[0223] Derive the value of IscSvY by decoding from the bitstream , any of the following methods can be adopted:
[0224] Method 1y: Use a decoding method similar to MVD. Specifically, reference can be made to the relevant content of steps 401 to 403 in the foregoing embodiment.
[0225] Method 2y: Use a decoding method similar to BVD. Specifically, reference can be made to the relevant content of steps 301 to 304 in the foregoing embodiment.
[0226] Method 3y: Use the decoding method for SV in existing standards. Specifically, reference can be made to the relevant content of steps 2031 to 2033 in the foregoing embodiment.
[0227] Method 4y: includes the following steps:
[0228] (4y.1), decode the string vector Y component flag isc_sv_y_non_zero_flag.
[0229] (4y.2), if the value of isc_sv_y_non_zero_flag is 0, then the value of IscSvY is 0.
[0230] (4y.3) If the value of isc_sv_y_non_zero_flag is 1 and the value of IscSvY is not 0. Further decode the sign bit isc_sv_y_sign of the Y component of the string vector 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.
[0231] (4y.4) Decode and inverse-binarize to obtain the absolute value isc_sv_y_abs_minus1 of the Y component of the string vector according to the following method:
[0232] If the value of isc_sv_y_sign is 1, that is, the value of IscSvY is less than 0, then decode and inverse-binarize 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 isc_sv_y_abs_minus1 of the Y component of the string vector; if the value of isc_sv_y_sign is 0, that is, the value of IscSvY is greater than 0, then decode and inverse-binarize in the manner of t-order exponential Golomb to obtain the absolute value isc_sv_y_abs_minus1 of the Y component of the string vector.
[0233] Where k >= 0, t >= 0, k and t are integers, and k is not equal to t.
[0234] (4y.5) Let the value of IscSvYAbs be equal to isc_sv_y_abs_minus1 + 1, and then the value of IscSvY can be obtained by combining the value of isc_sv_y_sign.
[0235] Derive the value of IscSvX by decoding from the bitstream , any of the following methods can be adopted:
[0236] Method 1x: Use a decoding method similar to MVD. Specifically, refer to the relevant content of steps 401 to 403 in the foregoing embodiment.
[0237] Method 2x: Use a decoding method similar to BVD. Specifically, refer to the relevant content of steps 301 to 304 in the foregoing embodiment.
[0238] Method 3x: Use the decoding method for SV in existing standards. Specifically, refer to the relevant content of steps 2031 to 2033 in the foregoing embodiment.
[0239] Method 4x: Includes the following steps:
[0240] (4x.1) Decode the flag isc_sv_x_non_zero_flag of the X component of the string vector.
[0241] (4x.2) If the value of isc_sv_x_non_zero_flag is 0, then the value of IscSvX is 0.
[0242] (4x.3) If the value of isc_sv_x_non_zero_flag is 1, the value of IscSvX is not 0. Further decode the sign bit isc_sv_x_sign of the string vector X component 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.
[0243] (4x.4) Decode and de-binarize to obtain the absolute value isc_sv_x_abs_minus1 of the string vector X component according to the following method:
[0244] If the value of isc_sv_x_sign is 1, that is, the value of IscSvX is less than 0, then decode and de-binarize in the manner of k-th order exponential Golomb (see the k-th order exponential Golomb code table shown in Table 6) to obtain the absolute value isc_sv_x_abs_minus1 of the string vector X component; if the value of isc_sv_x_sign is 0, that is, the value of IscSvX is greater than 0, then decode and de-binarize in the manner of t-th order exponential Golomb to obtain the absolute value isc_sv_x_abs_minus1 of the string vector X component.
[0245] Where k >= 0, t >= 0, k and t are integers, and k is not equal to t.
[0246] (4x.5) Let the value of IscSvXAbs be equal to isc_sv_x_abs_minus1 + 1, and then combine the value of isc_sv_x_sign to obtain the value of IscSvX.
[0247] Method 5x: includes the following steps:
[0248] (5x.1) If the value of IscSvY is 0 (where IscSvY can be decoded by any one of the above methods 1y to 4y), then decode to obtain IscSvx according to the following steps:
[0249] 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 sign bit isc_sv_x_sign of the X component of the string vector 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.
[0250] 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.
[0251] It should be noted that: in other embodiments of the present application, steps A and B do not need to be executed either, that is, there is no need to calculate the value of IsOddRow, and directly decode the sign bit isc_sv_x_sign of the X component of the string vector from the bitstream and obtain the value of isc_sv_x_sign. This method can simplify the encoding and decoding process of SV to a certain extent.
[0252] C. After obtaining the value of isc_sv_x_sign, the absolute value isc_sv_x_abs_minus1 of the X component of the string vector can be decoded and de-binarized according to the following method:
[0253] If the value of isc_sv_x_sign is 1, that is, the value of IscSvx is less than 0, then decode and de-binarize in the manner of k-order exponential Golomb to obtain the absolute value isc_sv_x_abs_minus1 of the X component of the string vector. If the value of isc_sv_x_sign is 0, that is, the value of IscSvx is greater than 0, then decode and de-binarize in the manner of t-order exponential Golomb to obtain the absolute value isc_sv_x_abs_minus1 of the X component of the string vector.
[0254] Where k >= 0, t >= 0, k and t are integers, and k is not equal to t.
[0255] D. Let the value of IscSvXAbs be equal to isc_sv_x_abs_minus1 + 1, and then the value of IscSvX can be obtained in combination with the value of isc_sv_x_sign.
[0256] (5x.2) If the value of IscSvy is greater than 0, then the value of isc_sv_x_sign can be directly set to 1. That is, if the value of IscSvx is less than 0, then it can be decoded and inverse binaryized in the way of k-th order exponential Golomb to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1. Then let the value of IscSvXAbs be equal to isc_sv_x_abs_minus1 + 1, and combined with the value of isc_sv_x_sign, the value of IscSvX can be obtained.
[0257] (5x.3) If the value of IscSvy is less than 0, then 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.
[0258] If the value of isc_sv_x_non_zero_flag is 1, then 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, that is, the value of IscSvx is less than 0, then decode and inverse binaryize in the way of k-th order exponential Golomb 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, then decode and inverse binaryize in the way of t-th order exponential Golomb to obtain the absolute value of the string vector X component isc_sv_x_abs_minus1.
[0259] Among them, k >= 0, t >= 0, k and t are integers, and k is not equal to t.
[0260] Then let the value of IscSvXAbs be equal to isc_sv_x_abs_minus1 + 1, and combined with the value of isc_sv_x_sign, the value of IscSvX can be obtained.
[0261] In the technical solution of the foregoing embodiment, isc_sv_x_sign and isc_sv_y_sign can be decoded in a bypass manner. Or isc_sv_x_sign and isc_sv_y_sign can also be decoded in a CABAC manner.
[0262] If isc_sv_x_sign and isc_sv_y_sign are decoded in a CABAC manner, then the selection of its context model and the determination of ctxIdxInc can be carried out in one of the following ways:
[0263] a), adopting a single context model and ctxIdxInc = 0;
[0264] 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);
[0265] c), if first decoding to obtain IscSvX and then decoding IscSvY, then for ctxIdxInc of isc_sv_y_sign, the context model can be determined according to the sign of IscSvX: ctxIdxInc = IscSvX < 0? 0 : (IscSvX == 0? 1 : 2).
[0266] It should be noted that: in the foregoing embodiments, IscSvY can be decoded by any one of the aforementioned methods 1y to 4y; IscSvX can be decoded by any one of the aforementioned methods 1x to 5x. If IscSvX is decoded by any one of the aforementioned methods 1x to 4x, then there is no dependence between the decoding process of IscSvX and the decoding process of IscSvY, and they can be executed in parallel; if IscSvX adopts the aforementioned method 5x, then it is necessary to first decode IscSvY and then decode IscSvX.
[0267] Optionally, IscSvY can be decoded by the aforementioned method 2y, and IscSvX can be decoded by the aforementioned method 4x or method 5x.
[0268] The above embodiments are mainly described from the perspective of the decoding end. The processing process at the encoding end is similar and will not be elaborated here.
[0269] Generally speaking, the technical solution of the embodiment of the present application proposes a motion vector encoding method that conforms to the SV distribution characteristics according to the statistical characteristics of SV. While simplifying the SV encoding and decoding process and reducing the SV encoding and decoding complexity, it can ensure the compression performance of the video, and generally helps to improve the SV encoding and decoding efficiency.
[0270] The following introduces the device embodiments of the present application, which can be used to execute the methods in the above embodiments of the present application. For the details not disclosed in the device embodiments of the present application, please refer to the above method embodiments of the present application.
[0271] Figure 11 The 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 computing and processing functions, such as a terminal device or a server.
[0272] Refer to Figure 11 As shown, the video decoding device 1100 according to an embodiment of the present application includes: a first decoding unit 1102, a second decoding unit 1104, and a first processing unit 1106.
[0273] Among them, the first decoding unit 1102 is configured to decode the absolute value of the first direction component of the string displacement vector residual from the bitstream; the second decoding unit 1104 is configured to, if the absolute value of the first direction component of the string displacement vector residual is not 0, decode the sign value of the first direction component of the string displacement vector residual from the bitstream; the first processing unit 1106 is configured to determine the value of the first direction component of the string displacement vector residual according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
[0274] In some embodiments of the present application, based on the foregoing solution, the first decoding unit 1102 is configured to: decode from the bitstream in the manner of truncated unary code and perform inverse binarization processing to obtain the prefix value of the first direction component of the string displacement vector residual; generate the absolute value of the first direction component of the string displacement vector residual according to the prefix value of the first direction component of the string displacement vector residual.
[0275] In some embodiments of the present application, based on the foregoing solution, the first decoding unit 1102 is configured to: if the prefix value of the first direction component of the string displacement vector residual is less than or equal to 4, use the prefix value of the first direction component of the string displacement vector residual as the absolute value of the first direction component of the string displacement vector residual;
[0276] If the prefix value of the first direction component of the string displacement vector residual is equal to 5, set the compensation value to 5, and based on the 2-bit bits continuously decoded from the bitstream, perform inverse binarization processing in the manner of 2-bit fixed-length code to obtain the suffix value of the first direction component of the string displacement vector residual, and generate the absolute value of the first direction component of the string displacement vector residual according to the suffix value of the first direction component of the string displacement vector residual and the compensation value;
[0277] If the prefix value of the first direction component of the string displacement vector residual is equal to 6, set the compensation value to 9, and based on the 3-bit bits continuously decoded from the bitstream, perform inverse binarization processing in the manner of 3-bit fixed-length code to obtain the suffix value of the first direction component of the string displacement vector residual, and generate the absolute value of the first direction component of the string displacement vector residual according to the suffix value of the first direction component of the string displacement vector residual and the compensation value;
[0278] If the prefix value of the first direction component of the string displacement vector residual is equal to 7, set the compensation value to 17, and determine the parity of the absolute value of the first direction component of the string displacement vector residual based on 1 bit decoded continuously from the bitstream; continue to decode from the bitstream, perform inverse binarization in the manner of a second-order exponential Golomb code, and generate the absolute value of the first direction component of the string displacement vector residual according to the result of the inverse binarization in the manner of the second-order exponential Golomb code, the compensation value, and the parity of the absolute value of the first direction component of the string displacement vector residual.
[0279] In some embodiments of the present application, based on the foregoing solution, the first decoding unit 1102 is configured to: if the prefix value of the first direction component of the string displacement vector residual is less than or equal to 2, use the prefix value of the first direction component of the string displacement vector residual as the absolute value of the first direction component of the string displacement vector residual;
[0280] If the prefix value of the first direction component of the string displacement vector residual is equal to 3, set the compensation value to 3, and determine the parity of the absolute value of the first direction component of the string displacement vector residual based on 1 bit decoded continuously from the bitstream; continue to decode from the bitstream, perform inverse binarization in the manner of a zero-order exponential Golomb code, and generate the absolute value of the first direction component of the string displacement vector residual according to the result of the inverse binarization in the manner of the zero-order exponential Golomb code, the compensation value, and the parity of the absolute value of the first direction component of the string displacement vector residual.
[0281] In some embodiments of the present application, based on the foregoing solution, if the first direction component of the string displacement vector residual is the vertical direction component of the string displacement vector residual, the video decoding device 1100 further includes: a second processing unit configured to, if the value of the vertical direction component of the string displacement vector residual is 0, decode the symbol value of the horizontal direction component of the string displacement vector residual from the bitstream; if it is determined according to the symbol value of the horizontal direction component of the string displacement vector residual that the value of the horizontal direction component of the string displacement vector residual is less than 0, perform inverse binarization in the manner of a k 1 -order exponential Golomb code to obtain the absolute value of the horizontal direction component of the string displacement vector residual, k 1 ≥0; if it is determined according to the symbol value of the horizontal direction component of the string displacement vector residual that the value of the horizontal direction component of the string displacement vector residual is greater than 0, perform inverse binarization in the manner of a t 1 -order exponential Golomb code to obtain the absolute value of the horizontal direction component of the string displacement vector residual, t 1 ≥0 and t 1 is different from k 1Not equal; determine the value of the horizontal component of the string displacement vector residual according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
[0282] In some embodiments of the present application, based on the foregoing solution, the second processing unit is configured to: before decoding the sign value of the horizontal component of the string displacement vector residual from the bitstream, if the starting row of decoding is row 0 and the row where the starting point of the current string is located is an odd row, then decode the sign value of the horizontal component of the string displacement vector residual from the bitstream; if the row where the starting point of the current string is located is an even row, then set the sign value of the horizontal component of the string displacement vector residual to a first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0, and perform inverse binary conversion processing according to the k 1 -order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual; determine the value of the horizontal component of the string displacement vector residual according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
[0283] In some embodiments of the present application, based on the foregoing solution, the second processing unit is further configured to: if the value of the vertical component of the string displacement vector residual is greater than 0, then set the sign value of the horizontal component of the string displacement vector residual to a first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0; perform inverse binary conversion processing in the manner of the k 1 -order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual; determine the value of the horizontal component of the string displacement vector residual according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
[0284] In some embodiments of the present application, based on the foregoing solution, the second processing unit is further configured to: if the value of the vertical component of the string displacement vector residual is less than 0, then decode the flag bit of the horizontal component of the string displacement vector residual from the bitstream; if the flag bit of the horizontal component of the string displacement vector residual is the first value, then decode the sign value of the horizontal component of the string displacement vector residual from the bitstream; wherein, the flag bit of the horizontal component of the string displacement vector residual being the first value indicates that the value of the horizontal component of the string displacement vector residual is not 0; if it is determined according to the sign value of the horizontal component of the string displacement vector residual that the value of the horizontal component of the string displacement vector residual is less than 0, then perform inverse binary conversion processing in the manner of the k 1 -order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual, k 1 ≥0; if it is determined according to the sign value of the horizontal component of the string displacement vector residual that the value of the horizontal component of the string displacement vector residual is greater than 0, then according to t1 The absolute value of the horizontal component of the string displacement vector residual is obtained by performing inverse binarization in the form of a hierarchical exponential Golomb code, t 1 ≥0 and t 1 is not equal to k 1 ; Based on the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual, determine the value of the horizontal component of the string displacement vector residual.
[0285] In some embodiments of the present application, based on the foregoing solution, the second processing unit is further configured to: if the flag bit of the horizontal component of the string displacement vector residual is a second value, determine that the value of the horizontal component of the string displacement vector residual is 0.
[0286] In some embodiments of the present application, based on the foregoing solution, the video decoding device 1100 further includes: a third processing unit configured to: decode the sign value of the second direction component of the string displacement vector residual from the bitstream; if it is determined according to the sign value of the second direction component of the string displacement vector residual that the value of the second direction component of the string displacement vector residual is less than 0, then perform inverse binarization in the form of a k 2 -order exponential Golomb code to obtain the absolute value of the second direction component of the string displacement vector residual, k 2 ≥0; if it is determined according to the sign value of the second direction component of the string displacement vector residual that the value of the second direction component of the string displacement vector residual is greater than 0, then perform inverse binarization in the form of a t 2 -order exponential Golomb code to obtain the absolute value of the second direction component of the string displacement vector residual, t 2 ≥0 and t 2 is not equal to k 2 ; Based on the absolute value of the second direction component of the string displacement vector residual and the sign value of the second direction component of the string displacement vector residual, determine the value of the second direction component of the string displacement vector residual.
[0287] In some embodiments of the present application, based on the foregoing solution, the third processing unit is configured to: decode the flag bit of the second direction component of the string displacement vector residual from the bitstream; if the flag bit of the second direction component of the string displacement vector residual is a first value, then decode the sign value of the second direction component of the string displacement vector residual from the bitstream; wherein, the flag bit of the second direction component of the string displacement vector residual being a first value indicates that the value of the second direction component of the string displacement vector residual is not 0.
[0288] In some embodiments of the present application, based on the foregoing solution, the third processing unit is further configured to: if the flag bit of the second direction component of the string displacement vector residual is a second value, determine that the value of the second direction component of the string displacement vector residual is 0.
[0289] In some embodiments of the present application, based on the foregoing solution, the third processing unit is configured to: if the sign value of the second direction component of the string displacement vector residual is the first value, determine that the value of the second direction component of the string displacement vector residual is less than 0; if the sign value of the second direction component of the string displacement vector residual is the second value, determine that the value of the second direction component of the string displacement vector residual is greater than 0.
[0290] In some embodiments of the present application, based on the foregoing solution, the first processing unit 1106 is further configured to: if the predicted string displacement vector SVP is not obtained, use the string displacement vector residual SVD as the string displacement vector SV; if the predicted string displacement vector SVP is obtained, determine the string displacement vector SV according to the string displacement vector residual SVD and the predicted string displacement vector SVP.
[0291] Figure 12 The structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown.
[0292] It should be noted that Figure 12 The computer system 1200 of the electronic device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.
[0293] As Figure 12 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 section 1208 into the random access memory (RAM) 1203, such as executing the method described in the foregoing embodiments. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, ROM 1202, and RAM 1203 are connected to each other through a bus 1204. The input / output (I / O) interface 1205 is also connected to the bus 1204.
[0294] 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 such as 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 required. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1210 as required so that a computer program read therefrom is installed into the storage section 1208 as required.
[0295] Specifically, according to an embodiment of the present application, the processes 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 the communication section 1209, and / or installed from the 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.
[0296] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0297] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0298] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not, in some cases, constitute a limitation on the unit itself.
[0299] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist separately 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 methods described in the above embodiments.
[0300] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0301] From the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the methods according to the embodiments of the present application.
[0302] After considering the specification and practicing the embodiments disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. 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 known common general knowledge or conventional technical means in the technical field not disclosed in the present application.
[0303] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A video decoding method, characterized in that, the video decoding method includes: decoding a first direction component absolute value of a string displacement vector residual from a bitstream; if the first direction component absolute value of the string displacement vector residual is not 0, decoding a first direction component sign value of the string displacement vector residual from the bitstream; determining a value of a first direction component of the string displacement vector residual according to the first direction component absolute value of the string displacement vector residual and the first direction component sign value of the string displacement vector residual.
2. The video decoding method according to claim 1, characterized in that, decoding a first direction component absolute value of a string displacement vector residual from a bitstream includes: decoding from the bitstream in the manner of a truncated unary code and performing an inverse binarization process to obtain a prefix value of a first direction component of the string displacement vector residual; generating the first direction component absolute value of the string displacement vector residual according to the prefix value of the first direction component of the string displacement vector residual.
3. The video decoding method according to claim 2, characterized in that, generating the first direction component absolute value of the string displacement vector residual according to the prefix value of the first direction component of the string displacement vector residual includes: if the prefix value of the first direction component of the string displacement vector residual is less than or equal to 4, using the prefix value of the first direction component of the string displacement vector residual as the first direction component absolute value of the string displacement vector residual; if the prefix value of the first direction component of the string displacement vector residual is equal to 5, setting a compensation value to 5, and performing an inverse binarization process on 2 bits continuously decoded from the bitstream in the manner of a 2-bit fixed-length code to obtain a suffix value of the first direction component of the string displacement vector residual, and generating the first direction component absolute value of the string displacement vector residual according to the suffix value of the first direction component of the string displacement vector residual and the compensation value; if the prefix value of the first direction component of the string displacement vector residual is equal to 6, setting a compensation value to 9, and performing an inverse binarization process on 3 bits continuously decoded from the bitstream in the manner of a 3-bit fixed-length code to obtain a suffix value of the first direction component of the string displacement vector residual, and generating the first direction component absolute value of the string displacement vector residual according to the suffix value of the first direction component of the string displacement vector residual and the compensation value; if the prefix value of the first direction component of the string displacement vector residual is equal to 7, setting a compensation value to 17, and determining the parity of the first direction component absolute value of the string displacement vector residual based on 1 bit continuously decoded from the bitstream; continuously decoding from the bitstream, performing an inverse binarization process in the manner of a second-order exponential Golomb code, and generating the first direction component absolute value of the string displacement vector residual according to the result of the inverse binarization process in the manner of the second-order exponential Golomb code, the compensation value, and the parity of the first direction component absolute value of the string displacement vector residual.
4. The video decoding method according to claim 2, characterized in that, generating the first direction component absolute value of the string displacement vector residual according to the prefix value of the first direction component of the string displacement vector residual includes: If the prefix value of the first direction component of the string displacement vector residual is less than or equal to 2, then use the prefix value of the first direction component of the string displacement vector residual as the absolute value of the first direction component of the string displacement vector residual; If the prefix value of the first direction component of the string displacement vector residual is equal to 3, then set the compensation value to 3, and determine the parity of the absolute value of the first direction component of the string displacement vector residual based on 1 bit of data continuously decoded from the bitstream; continue to decode from the bitstream, perform inverse binarization in the manner of the 0th order exponential Golomb code, and generate the absolute value of the first direction component of the string displacement vector residual according to the result of the inverse binarization in the manner of the 0th order exponential Golomb code, the compensation value, and the parity of the absolute value of the first direction component of the string displacement vector residual.
5. The video decoding method according to any one of claims 1 to 4, characterized in that, the first direction component of the string displacement vector residual is the vertical direction component of the string displacement vector residual.
6. The video decoding method according to claim 5, characterized in that, the video decoding method further includes: If the value of the vertical direction component of the string displacement vector residual is 0, then decode the sign value of the horizontal direction component of the string displacement vector residual from the bitstream; If it is determined according to the sign value of the horizontal component of the string displacement vector residual that the value of the horizontal component of the string displacement vector residual is less than 0, then perform inverse binarization processing in the manner of the k 1 -th order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual, where k 1 ≥0; If it is determined according to the sign value of the horizontal direction component of the string displacement vector residual that the value of the horizontal direction component of the string displacement vector residual is greater than 0, then perform inverse binarization processing in the manner of the t 1 -th order exponential Golomb code to obtain the absolute value of the horizontal direction component of the string displacement vector residual, where t 1 ≥0 and t 1 is not equal to k 1 ; 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, determine the value of the horizontal direction component of the string displacement vector residual.
7. The video decoding method according to claim 6, characterized in that, Before decoding the sign value of the horizontal direction component of the string displacement vector residual from the bitstream, the video decoding method further includes: In the case where the starting row of decoding is row 0, if the row where the starting point of the current string is located is an odd row, then perform the process of decoding the sign value of the horizontal direction component of the string displacement vector residual from the bitstream; If the row where the starting point of the current string is located is an even row, set the sign value of the horizontal component of the string displacement vector residual to a first value to indicate that the value of the horizontal component of the string displacement vector residual is less than 0, and perform inverse binarization processing according to the k 1 -th order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual; determine the value of the horizontal component of the string displacement vector residual according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
8. The video decoding method according to claim 5, characterized in that, the video decoding method further includes: If the value of the vertical direction component of the string displacement vector residual is greater than 0, then set the sign value of the horizontal direction component of the string displacement vector residual to a first value to indicate that the value of the horizontal direction component of the string displacement vector residual is less than 0; According to k 1 Inverse binarization is performed in the manner of the k-th order exponential Golomb code to obtain the absolute value of the horizontal 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 sign 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.
9. The video decoding method according to claim 5, characterized in that, the video decoding method further includes: If the value of the vertical direction component of the string displacement vector residual is less than 0, then decode the flag bit of the horizontal direction component of the string displacement vector residual from the bitstream; If the flag bit of the horizontal direction component of the string displacement vector residual is the first value, then decode the sign value of the horizontal direction component of the string displacement vector residual from the bitstream; wherein, the flag bit of the horizontal direction component of the string displacement vector residual being the first value indicates that the value of the horizontal direction component of the string displacement vector residual is not 0; If it is determined according to the sign value of the horizontal direction component of the string displacement vector residual that the value of the horizontal direction component of the string displacement vector residual is less than 0, then perform inverse binarization processing in the manner of the k 1 -th order exponential Golomb code to obtain the absolute value of the horizontal direction component of the string displacement vector residual, where k 1 ≥0; If it is determined according to the sign value of the horizontal component of the string displacement vector residual that the value of the horizontal component of the string displacement vector residual is greater than 0, then perform inverse binarization processing in the manner of the t 1 -th order exponential Golomb code to obtain the absolute value of the horizontal component of the string displacement vector residual, where t 1 ≥0 and t 1 is not equal to k 1 ; Determine the value of the horizontal component of the string displacement vector residual according to the absolute value of the horizontal component of the string displacement vector residual and the sign value of the horizontal component of the string displacement vector residual.
10. The video decoding method according to claim 9, wherein, the video decoding method further includes: If the flag bit of the horizontal component of the string displacement vector residual is the second value, determine that the value of the horizontal component of the string displacement vector residual is 0.
11. The video decoding method according to any one of claims 1 to 4, wherein, the method further includes: Decode the sign value of the second direction component of the string displacement vector residual from the bitstream; If it is determined according to the sign value of the second direction component of the string displacement vector residual that the value of the second direction component of the string displacement vector residual is less than 0, then perform inverse binarization processing in the manner of the k 2 -th order exponential Golomb code to obtain the absolute value of the second direction component of the string displacement vector residual, where k 2 ≥0; If it is determined according to the sign value of the second direction component of the string displacement vector residual that the value of the second direction component of the string displacement vector residual is greater than 0, then perform inverse binarization processing in the manner of the t 2 -th order exponential Golomb code to obtain the absolute value of the second direction component of the string displacement vector residual, where t 2 ≥0 and t 2 is not equal to k 2 ; Determine the value of the second direction component of the string displacement vector residual according to the absolute value of the second direction component of the string displacement vector residual and the sign value of the second direction component of the string displacement vector residual.
12. The video decoding method according to claim 11, wherein, Decoding the sign value of the second direction component of the string displacement vector residual from the bitstream includes: Decode the flag bit of the second direction component of the string displacement vector residual from the bitstream; If the flag bit of the second direction component of the string displacement vector residual is the first value, decode the sign value of the second direction component of the string displacement vector residual from the bitstream; wherein, the flag bit of the second direction component of the string displacement vector residual being the first value indicates that the value of the second direction component of the string displacement vector residual is not 0.
13. The video decoding method according to claim 12, wherein, the video decoding method further includes: If the flag bit of the second direction component of the string displacement vector residual is the second value, determine that the value of the second direction component of the string displacement vector residual is 0.
14. The video decoding method according to claim 11, wherein, the video decoding method further includes: If the sign value of the second direction component of the string displacement vector residual is the first value, determine that the value of the second direction component of the string displacement vector residual is less than 0; If the sign value of the second direction component of the string displacement vector residual is the second value, determine that the value of the second direction component of the string displacement vector residual is greater than 0.
15. The video decoding method according to any one of claims 1 to 4, wherein, the video decoding method further includes: If the predicted string displacement vector SVP is not obtained, use the string displacement vector residual SVD as the string displacement vector SV; If the predicted string displacement vector SVP is obtained, determine the string displacement vector SV according to the string displacement vector residual SVD and the predicted string displacement vector SVP.
16. A video encoding method, wherein, comprising: Determine the absolute value of the first direction component of the string displacement vector residual; If the absolute value of the first direction component of the string displacement vector residual is not 0, obtain the sign value of the first direction component of the string displacement vector residual; Perform encoding processing according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
17. A video decoding device, wherein, comprising: A first decoding unit configured to decode the absolute value of the first direction component of the string displacement vector residual from the bitstream; A second decoding unit, configured to decode a sign value of a first direction component of a string displacement vector residual from the bitstream if an absolute value of the first direction component of the string displacement vector residual is not 0; A first processing unit, configured to determine a value of a first direction component of a string displacement vector residual according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
18. A video encoding device, characterized in that, comprising: A first determining unit, configured to determine an absolute value of a first direction component of a string displacement vector residual; A second determining unit, configured to obtain a sign value of a first direction component of a string displacement vector residual if the absolute value of the first direction component of the string displacement vector residual is not 0; An encoding unit, configured to perform encoding processing according to the absolute value of the first direction component of the string displacement vector residual and the sign value of the first direction component of the string displacement vector residual.
19. 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 16 is implemented.
20. An electronic device, characterized in that, comprising: One or more processors; A storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of claims 1 to 16.