Video encoding method and decoding method, and device, storage medium, electronic device, and computer program product thereof

By generating a list of predicted vector candidates based on decoded block displacement vectors, the problem of improper selection of default predicted vectors affecting coding performance is solved, and more accurate predicted vector selection and higher coding performance are achieved.

JP2025509017APending Publication Date: 2025-04-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024513809
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-03-16
Filing Date
2022-11-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the prior art, in video encoding and decoding, if the default prediction vector is not selected properly, it will affect the encoding performance.

Method used

By generating a list of predictive vector candidates based on the displacement vectors of the decoded blocks, a more accurate prediction vector is selected, thereby improving coding performance.

Benefits of technology

Ensure that the selected prediction vector is more accurate, improves encoding performance, and improves the efficiency of video encoding and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025509017000001_ABST
    Figure 2025509017000001_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a video encoding method and a video decoding method, and the apparatus, storage medium, electronic device, and computer program product thereof. The video decoding method includes: generating a prediction vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame; selecting a prediction vector of a current block to be decoded from the prediction vector candidate list; and performing a decoding process on the current block based on the prediction vector of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims priority to a Chinese patent application bearing application number 202210260543.1, filed with the China Patent Office on March 16, 2022, the entire contents of which are incorporated herein by reference.

[0002] The present application relates to the field of computers and communications technology, and in particular to a video encoding method and a video decoding method, and an apparatus, a storage medium, an electronic device, and a computer program product thereof. [Background technology]

[0003] In related audio-video encoding and decoding technologies, if a codestream does not contain a predictive vector for the current block, a default predictive vector can be derived, but if these default predictive vectors are not selected appropriately, it will affect the encoding performance. Summary of the Invention [Means for solving the problem]

[0004] The embodiments of the present application provide a video encoding method and a video decoding method, as well as an apparatus therefor, a computer-readable storage medium, an electronic device, and a computer program product, which can ensure that a more accurate prediction vector is selected from a list of more suitable prediction vector candidates by building the list based on the displacement vector of a decoded block whose reference frame is a current frame, thereby improving the encoding performance to a certain extent.

[0005] An embodiment of the present application provides a video decoding method, the method including: generating a predictor vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame; selecting a predictor vector for a current block to be decoded from the predictor vector candidate list; and performing a decoding process on the current block based on the predictor vector of the current block.

[0006] An embodiment of the present application provides a video encoding method, the method including: generating a predictor vector candidate list based on a displacement vector of an encoded block whose reference frame is a current frame; selecting a predictor vector for a current block to be encoded from the predictor vector candidate list; and performing an encoding process on the current block based on the predictor vector of the current block.

[0007] An embodiment of the present application provides a video decoding device, the device comprising: a first generation unit configured to generate a predictor vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame; a first selection unit configured to select a predictor vector of a current block to be decoded from the predictor vector candidate list; and a first processing unit configured to perform a decoding process on the current block based on the predictor vector of the current block.

[0008] An embodiment of the present application provides a video encoding device, the device comprising: a second generation unit configured to generate a predictor vector candidate list based on a displacement vector of an encoded block whose reference frame is a current frame; a second selection unit configured to select a predictor vector of a current block to be encoded from the predictor vector candidate list; and a second processing unit configured to perform an encoding process on the current block based on the predictor vector of the current block.

[0009] An embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium storing a computer program, the computer program, when executed by a processor, realizing the method according to the above embodiment.

[0010] An embodiment of the present application provides an electronic device, the electronic device comprising one or more processors and a memory configured to store one or more programs, the one or more programs, when executed by the one or more processors, causing the electronic device to realize a method according to the above embodiment.

[0011] An embodiment of the present application provides a computer program product or a computer program, said computer program product or computer program comprising computer instructions, said computer instructions being stored in a computer readable storage medium, a processor of a computing device reading said computer instructions from the computer readable storage medium, and said processor executing said computer instructions causes said computing device to perform the method provided above.

[0012] The technical solutions provided by the embodiments of the present application can bring the following beneficial effects:

[0013] A predictor vector candidate list is generated based on the displacement vector of a decoded block whose reference frame is the current frame, and a predictor vector for the current block is selected from the predictor vector candidate list. This ensures that a more accurate predictor vector is selected from the predictor vector candidate list, thereby improving encoding performance. [Brief description of the drawings]

[0014] [Figure 1] FIG. 1 is a schematic diagram of an exemplary system architecture according to an embodiment of the present application. [Diagram 2] 2 is a schematic diagram of an arrangement of a video encoding device and a video decoding device in a streaming system according to an embodiment of the present application; [Diagram 3] FIG. 2 is a schematic diagram showing the relationship between SB and B according to an embodiment of the present application. [Figure 4] 1 is a basic flow chart of one video encoder according to an embodiment of the present application; [Diagram 5] FIG. 2 is a schematic diagram of inter-frame prediction according to an embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram of intra-frame block duplication according to an embodiment of the present application; [Figure 7] FIG. 1 is a schematic diagram of the reference range of IBC in AV1 according to an embodiment of the present application. [Figure 8] FIG. 1 is a schematic diagram of the reference range for IBC in AV2 according to an embodiment of the present application. [Figure 9] 2 is a flowchart of a video decoding method according to an embodiment of the present application; [Figure 10] FIG. 2 is a schematic diagram of selecting decoded blocks adjacent to a current block according to an embodiment of the present application; [Figure 11] 2 is a flowchart of a video decoding method according to an embodiment of the present application; [Figure 12] 1 is a flowchart of a video encoding method according to an embodiment of the present application; [Figure 13] 1 is a block diagram of a video decoding device according to an embodiment of the present application; [Figure 14] 1 is a block diagram of a video encoding device according to an embodiment of the present application; [Figure 15] FIG. 1 is a schematic diagram illustrating a configuration of a computer system of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0015] In the following, exemplary embodiments will be described more comprehensively with reference to the drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as being limited to these examples. Rather, the purpose of providing these embodiments is to make the present application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.

[0016] In the following, references to "some embodiments" describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same or different subsets of all possible embodiments, and may be combined with each other without inconsistency.

[0017] Furthermore, the features, structures, or characteristics described herein may be combined in any suitable manner into one or more embodiments. In the following description, many details are described to allow a thorough understanding of the embodiments of the present application. However, those skilled in the art should understand that one or more specific details may be omitted or other methods, elements, devices, steps, etc. may be adopted without using all the detailed features in the embodiments during the implementation of the technical solution of the present application.

[0018] The illustrated blocks are functional entities that do not necessarily correspond to physically separate entities, i.e. these functional entities may be implemented in the form of software, in one or more hardware modules or integrated circuits, in different networks and / or processor and / or microcontroller devices.

[0019] The illustrated flowcharts are merely exemplary and do not necessarily include all contents and operations / steps, nor do they necessarily have to be performed in the order described. For example, some operations / steps may be further divided, and some operations / steps may be combined or partially combined. Thus, the actual execution order may change according to actual circumstances.

[0020] In this specification, "multiple" refers to two or more than two. The term "and / or" describes the association relationship of associated objects and indicates that three relationships may exist, for example, A and / or B can indicate three cases: A exists independently, A and B both exist, and B exists independently. The symbol " / " usually indicates that there is an "or" relationship between the associated objects before and after.

[0021] FIG. 1 is a schematic diagram of an exemplary system architecture of the technical solution of an embodiment of the present application.

[0022] 1, the system architecture 100 includes a plurality of terminal devices, which can communicate with each other, for example, via a network 150. For example, the system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected via the network 150. In the embodiment of FIG. 1, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.

[0023] For example, the first terminal device 110 encodes video data (e.g., a video image stream collected by the terminal device 110) and transmits the encoded video data to the second terminal device 120 via the network 150, where the encoded video data is transmitted in the form of one or more encoded video code streams. The second terminal device 120 can receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display video images based on the restored video data.

[0024] In one embodiment of the present application, the system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 performing bidirectional transmission of encoded video data, which may occur, for example, during a video conference. In the case of bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (e.g., a video image stream collected by the terminal device) and transmit it to the other of the third terminal device 130 and the fourth terminal device 140 via 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, and may decode the encoded video data to restore the video data, and display the video image on an accessible display device based on the restored video data.

[0025] In the embodiment shown in FIG. 1, the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140 may be servers or terminals, but the principles disclosed herein are not limited thereto.

[0026] The server may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), big data and artificial intelligence platforms, etc. The terminal may be, but is not limited to, a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, an intelligent voice dialogue device, a smart watch, a smart home appliance, an in-vehicle terminal, an aircraft, etc.

[0027] 1 represents any number of networks for transmitting 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, a wired communication network and / or a wireless communication network. The communication network 150 may exchange data over 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 purposes of this application, unless otherwise described below, the architecture and topology of the network 150 may not be critical to the operation of the present disclosure.

[0028] In one embodiment of the present application, Figure 2 is a schematic diagram of a video encoding device and a video decoding device arrangement in a streaming system. The subject matter disclosed herein is applicable to other video-enabled applications as well, including, for example, video conferencing, digital television (TV), and storage of compressed video on digital media including CDs, DVDs, memory sticks, etc.

[0029] The streaming system may include a collection subsystem 213, which may include a video source 201, such as a digital camera, that creates an uncompressed video image stream 202. In an embodiment, the video image stream 202 includes samples taken by a digital camera. Compared to the encoded video data 204 (or the encoded video code stream 204), the video image stream 202 is depicted in bold lines to emphasize the high data volume of the video image stream, and the video image stream 202 may be processed by an electronic device 220, which includes a video encoding device 203 connected to the video source 201. The video encoding device 203 may include hardware, software, or a combination of hardware and software for implementing or performing aspects of the disclosed subject matter, which are described in more detail below. Compared to the video image stream 202, the encoded video data 204 (or the encoded video code stream 204) is depicted in thin lines to emphasize the low data volume of the encoded video data 204 (or the encoded video code stream 204), which may be stored on a streaming server 205 for future use. One or more streaming client subsystems, such as client subsystem 206 and client subsystem 208 of FIG. 2, can access the streaming server 205 to retrieve copies 207 and 209 of encoded video data 204. Client subsystem 206 may include, for example, a video decoder 210 in electronic device 230. Video decoder 210 decodes input copy 207 of encoded video data and generates output video image stream 211 that may be presented on display 212 (e.g., a display screen) or another presentation device. In some streaming systems, encoded video data 204, video data 207, and video data 209 (e.g., video code streams) may be encoded according to some video encoding / compression standard.

[0030] It should be noted that the electronic device 220 and the electronic device 230 may include other components not shown in the drawings. For example, the electronic device 220 may include a video decoding device, and the electronic device 230 may further include a video encoding device.

[0031] In one embodiment of the present application, taking the international video coding standard High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), and China national video coding standard AVS as examples, when a video frame image is input, the video frame image is divided into several non-overlapping processing units according to a block size, and each processing unit performs a similar compression operation. This processing unit is called a coding tree unit (CTU) or a largest coding unit (LCU). By continuing to divide the CTU into smaller parts, one or more basic coding units (CUs) are obtained, and a CU is the most basic element in a coding stage.

[0032] In another embodiment, the processing unit may be called a coding tile (i.e., Tile), which is a rectangular region of a multimedia data frame that can be decoded and coded independently. Here, the coding tile is further divided to obtain one or more largest coding blocks (SB: Superblock), where SB is the starting point of block division and can be further divided into multiple sub-blocks, and then the largest coding block is further divided to obtain one or more blocks (Block). Each block is the most basic element in one coding stage. In some embodiments, the relationship between SB and block (B) is as shown in FIG. 3, i.e., one SB can include multiple Bs.

[0033] Below, some concepts in the encoding process are explained.

[0034] Predictive Coding: Predictive coding includes methods such as intraframe prediction and interframe prediction. After performing prediction on the original video signal using the selected reconstructed video signal, a residual video signal is obtained. The encoding side needs to decide which predictive coding mode to select for the current coding unit (or coding block) and notify the decoding side. Here, intraframe prediction means that the predicted signal is from a region that is coded and reconstructed in the same image. Interframe prediction means that the predicted signal is from another image (called a reference image) that is coded and different from the current image.

[0035] Transform & Quantization: The residual video signal is transformed into a transform domain through a transform operation such as Discrete Fourier Transform (DFT), Discrete Cosine Transform (DCT), etc., and is called a transform coefficient. The transform coefficient undergoes a lossy quantization operation to lose some information, which makes the quantized signal easier to compress and represent. In some video coding standards, multiple transform methods can be selected, so the coding side also needs to select one transform method for the current coding unit (or coding block) and notify the decoding side. The degree of quantization fineness is usually determined by a quantization parameter (QP). A larger value of QP means that a wider range of coefficients are quantized to the same output, so that the distortion is usually higher and the bit rate is lower. Conversely, a smaller value of QP means that a smaller range of coefficients are quantized to the same output, so that the distortion is usually lower and the bit rate is higher.

[0036] Entropy Coding or Statistical Coding: The quantized transform domain signal is statistically compression coded according to the frequency of occurrence of each value, and finally a binary (0 or 1) compressed code stream is output. The coding also generates other information such as the selected coding mode and motion vector data, which also need to be entropy coded to reduce the bit rate. Statistical coding is a lossless coding method, which can effectively reduce the bit rate required to represent the same signal. Common statistical coding methods are Variable Length Coding (VLC) or Content Adaptive Binary Arithmetic Coding (CABAC).

[0037] The context-adaptive binary arithmetic coding (CABAC) process mainly includes three steps: binarization, context modeling, and binary arithmetic coding. After the binarization process is performed on the input syntax element, the binary data can be coded by the normal coding mode and the bypass coding mode. The bypass coding mode speeds up the whole coding and decoding by directly coding the input binary bit bin value with a simple bypass coder without the need to assign a specific probability model to each binary bit. In general, different syntax elements are not completely independent of each other, and the same syntax element itself has a certain memory capacity. Therefore, according to the conditional entropy theory, performing conditional coding using another coded syntax element can improve the coding performance compared to independent coding and memoryless coding. These coded symbol information used as conditions are called context. In the normal coding mode, the binary bits of the syntax element are input sequentially to the context modeler, and the coder assigns an appropriate probability model to each input binary bit based on the value of the previously coded syntax element or binary bit. This process is called context modeling. The context model corresponding to the syntax element can be found by the context index increment (ctxIdxInc: context index increment) and the context start index (ctxIdxStart: context index Start). After the bin values ​​are fed into the binary arithmetic coder with the assigned probability models for encoding, the context model needs to be updated based on the bin values, which is an adaptive process in encoding.

[0038] Loop Filtering: The transformed and quantized signal undergoes inverse quantization, inverse transformation, and predictive compensation to obtain a reconstructed image. The reconstructed image is affected by quantization compared to the original image, and some information is different from the original image. That is, the reconstructed image has distortion. Therefore, the reconstructed image can be subjected to a filtering operation using a filter such as a deblocking filter (DB), a sample adaptive offset (SAO), or an adaptive loop filter (ALF), to effectively reduce the distortion caused by quantization. These filtered reconstructed images are used as references for subsequent coding images to predict future image signals, and therefore the above filtering operation is also called loop filtering, i.e., a filtering operation in the coding loop.

[0039] In one embodiment of the present application, FIG. 4 shows the basic flow chart of one video encoder, and the process takes intra-frame prediction as an example. Here, an original image signal

number

number

number

number

number

number

number

number

number

number

number

number

number

number

[0040] Based on the above encoding process, the decoding side obtains a compressed code stream (i.e., a bit stream) for each coding unit (or coding block), and then performs entropy decoding to obtain various mode information and quantization coefficients. Then, the quantization coefficients are inverse quantized and inverse transformed to obtain a residual signal. Furthermore, a prediction signal corresponding to the coding unit (or coding block) is obtained based on the known coding mode information, and then the residual signal and the prediction signal are added to obtain a reconstructed signal, and the reconstructed signal can be subjected to operations such as loop filtering to generate a final output signal.

[0041] Mainstream video coding standards (such as HEVC, VVC, AVS3, AV1, AV2, etc.) adopt a block-based hybrid coding framework. In practical applications, 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 realize the compression of the video data. Here, motion compensation is a prediction method commonly used in video coding. Motion compensation derives a predicted value of a current coding block from a coded domain based on the redundancy characteristics of video content in the time domain or the spatial domain. Such prediction methods include inter-frame prediction, intra-frame block duplication prediction, intra-frame string duplication prediction, etc., and in coding realization, these prediction methods may be used separately or in combination. For coding blocks using these prediction methods, it is usually necessary to explicitly or implicitly code one or more two-dimensional displacement vectors in the codestream to indicate the displacement of the current block (or the intra blocks of the current block) relative to its own one or more reference blocks.

[0042] Here, the official name of AV1 is Alliance for Open Media Video 1, the first generation video encoding standard established by the Open Media Alliance. The official name of AV2 is Alliance for Open Media Video 2, the second generation video encoding standard established by the Open Media Alliance.

[0043] It should be noted that in different prediction modes and different implementations, the displacement vector may have different names. In the embodiment of the present application, the displacement vectors are collectively described as follows: 1) the displacement vector in inter-frame prediction is called the motion displacement vector (MV), 2) the displacement vector in intra-frame block duplication is called the block displacement vector (BV), and 3) the displacement vector in intra-frame string duplication is called the string displacement vector (SV). The following describes related techniques of inter-frame prediction and intra-frame block duplication prediction.

[0044] As shown in Figure 5, inter-frame prediction utilizes the correlation in the video time domain to predict the pixels of the current image using the adjacent pixels in the encoded image, thereby achieving the purpose of effectively eliminating the redundancy in the video time domain, and effectively saving the bits of the encoded residual data. Here, P represents the current frame, Pr represents the reference frame, B represents the current encoding block, and Br represents the reference block of B. The coordinates of B' in the reference frame are the same as the coordinates of B in the current frame, and 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 (or MV), MV=(x r -x,y r -y).

[0045] Considering that time domain neighboring blocks or spatial domain neighboring blocks have strong correlation, MV prediction techniques can be adopted to reduce the bits required to code MV. In H.265 / HEVC, inter-frame prediction includes two MV prediction techniques: Merge and Advanced Motion Vector Prediction (AMVP). Merge mode establishes one MV candidate list for the current prediction unit (PU), in which there are five candidate MVs (and corresponding reference images). The five candidate MVs are scanned and the one with the lowest distortion cost is selected as the optimal MV. If the codec establishes the candidate list in the same manner, the encoder only needs to transmit the index of the optimal MV in the candidate list. Note that the MV prediction technique of HEVC also has a skip mode, which is a special example of the Merge mode. After finding the optimal MV by Merge mode, if the current block and the reference block are basically the same, there is no need to transmit residual data, and only the index of the MV and one skip flag need to be transmitted.

[0046] Similarly, AMVP mode establishes a candidate prediction MV list for the current PU by utilizing the MV correlation between the spatial domain and the time domain neighboring blocks. Different from Merge mode, AMVP mode selects the best prediction MV from the candidate prediction MV list and performs differential coding between the best MV obtained by performing motion search on the current coding block, i.e., MVD=MV-MVP coding. By establishing the same list, the decoding side can calculate the MV of the current coding block only by the motion vector difference (MVD) and the sequence number of the predicted motion vector (MVP) in the list. The AMVP candidate MV list also includes two cases: spatial domain and time domain. The difference is that the length of the AMVP list is only 2.

[0047] Intra-frame block duplication is a coding tool adopted in the HEVC Screen Content Coding (SCC) extension, which greatly improves the coding efficiency of screen content. AVS3 and VVC also adopt IBC technology to improve the performance of screen content coding. IBC exploits the spatial correlation of screen content video and uses pixels of the coded image of the current image to predict the pixels of the current block to be coded, which can effectively save the bits required for coding pixels. As shown in Figure 6, the displacement between the current block and its reference block in IBC is called the Block Displacement Vector (BV).

[0048] In the current AV1 standard, the IBC mode uses the global reference range technique, i.e., it is allowed to use the reconstructed region of the current frame as the reference block of the current block. However, because IBC uses off-chip memory to store reference samples, the following restrictions need to be added to solve the potential hardware implementation problems of IBC:

[0049] 1) If IBC mode is allowed for the current image, the loop filter is disabled to avoid additional image storage requirements. To reduce the impact of turning off the loop filter, IBC mode is only allowed on key frames.

[0050] 2) The location of the reference block must satisfy the write-back delay constraint of the hardware; for example, it is not allowed to use an area of ​​256 reconstructed samples in the horizontal direction of the current block as the reference block.

[0051] 3) The location of the reference block must satisfy the restrictions of parallel processing.

[0052] We can refer to the schematic diagram of the IBC reference range in the current AV1 standard shown in Fig. 7. Here, the size of SB is 128x128, and the encoder performs parallel coding according to SB rows, and is not allowed to use an area of ​​256 reconstructed samples in the horizontal direction of the current block (i.e., the size of two SBs) as a reference block.

[0053] In the related art, the Alliance for Open Media (AOM) next-generation standard AV2 improves the IBC mode. As shown in FIG. 8, in AV2, the reference range of IBC consists of two parts: a global reference range and a local reference range. Here, the global reference range is the reference range allowed in AV1, and the local reference range is the newly added reference range, and its size may be, for example, 64×64 (i.e., the SB area where the current block is located). The pixel samples of the reference range are stored in an additional on-chip memory. Therefore, when only the reference range is used, there is no need to disable the loop filter. Furthermore, depending on the frame type, the IBC is allowed to use different reference ranges. For example, for key frames, the IBC allows the use of the global reference range and the local reference range, and for non-key frames, the IBC is only allowed to use the local reference range.

[0054] Note that the local reference range may have different sizes in different implementations, for example 128x128 in addition to 64x64.

[0055] Since AV2 allows the use of different types of reference ranges, the values ​​of block vectors change considerably when the reference block is located within a different type of reference range. For example, when the reference block is located within a local reference range, the absolute values ​​of the block vectors will be smaller than 64, and when the reference block is located within a global reference range, the absolute values ​​of the block vectors will all be greater than 64. However, in the current version of AV2, the default prediction block vectors are all directed to the global reference range and do not take into account the case when the current block is within a local reference range. For reference blocks within a local reference range, the default prediction block vectors cannot provide good predictions, and the coding overhead of the block vectors becomes large. Furthermore, in related audio and video encoding and decoding techniques, if the code stream does not contain a prediction vector for the current block, a default prediction vector needs to be derived. However, in related techniques, there are certain limitations in the way these default prediction vectors are selected, which affects the overall coding performance.

[0056] 9 is a flowchart of a video decoding method according to an embodiment of the present application. The video decoding method can be performed by a device having a computing function, such as a terminal device or a server. As shown in FIG. 9, the video decoding method includes at least the following steps:

[0057] In step S910, a prediction vector candidate list is generated based on the displacement vector of a decoded block whose reference frame is the current frame.

[0058] In step S920, a predicted vector of the current block to be decoded is selected from the predicted vector candidate list.

[0059] In step S930, a decoding process is performed on the current block based on the predicted vector of the current block.

[0060] The technical solution of the embodiment shown in FIG. 9 can ensure that a more accurate prediction vector is selected from a more suitable prediction vector candidate list by constructing a more suitable prediction vector candidate list based on the displacement vector of a decoded block whose reference frame is the current frame, thereby improving the encoding performance.

[0061] It should be noted that the technical solution of the embodiment shown in Figure 9 can be used to derive a "default" predicted vector, that is, derive a predicted vector using the method shown in Figure 9 only when each component of the predicted block vector of the current block derived by using the fixed rule in the standard is 0. Of course, in another embodiment of the present application, the technical solution of the embodiment shown in Figure 9 can also be directly used.

[0062] In the following, the implementation of steps S910 to S930 shown in FIG. 9 will be specifically described in detail.

[0063] In step S910, a prediction vector candidate list is generated based on the displacement vector of a decoded block whose reference frame is the current frame.

[0064] In some embodiments, in different prediction modes and different implementations, the displacement vector may have different names, for example, the displacement vector in inter-frame prediction may be called the motion displacement vector MV, the displacement vector in intra-frame block replication may be called the block displacement vector BV, and the displacement vector in intra-frame string replication may be called the string displacement vector SV.

[0065] In one embodiment of the present application, a list of candidate predictor vectors can be constructed based on the displacement vectors of previously decoded blocks that are adjacent to the current block.

[0066] In practical application, the displacement vector of the decoded block adjacent to the current block can be obtained from the displacement vector of the decoded block whose reference frame is the current frame, and then the displacement vector of the decoded block adjacent to the current block can be sorted according to a set order to generate a first displacement vector list, and further generate a prediction vector candidate list according to the first displacement vector list. For example, the first displacement vector list can be used as the prediction vector candidate list.

[0067] In some embodiments, the decoded blocks adjacent to the current block may include at least one of the decoded blocks in n1 rows above the current block and the decoded blocks in n2 columns to the left of the current block, where n1 and n2 are positive integers. For example, as shown in FIG. 10, the decoded blocks adjacent to each other may be the decoded blocks in three rows above or three columns to the left of the current block, and the basic unit of each row or column may be 8×8 in size. Note that the information of the displacement vector is usually stored in a 4×4 unit. In realization, multiple displacement vectors can be obtained by searching one 8×8 unit, and the number of displacement vectors obtained by searching for different rows or columns may be different.

[0068] In some embodiments, the set order may be a decoding order of the decoded blocks, a scanning order of the decoded blocks, or a weight corresponding to a displacement vector, the weight corresponding to the displacement vector being associated with at least one element of a number of repetitions of the displacement vector, a block size corresponding to the displacement vector, or a block position corresponding to the displacement vector.

[0069] For example, if a displacement vector is repeated many times, the weight corresponding to the displacement vector will be larger and the displacement vector will be ranked higher in the first displacement vector list; if the block corresponding to the displacement vector is small, the weight corresponding to the displacement vector will be larger and the displacement vector will be ranked higher in the first displacement vector list; if the block position corresponding to the displacement vector is close to the current block, the weight corresponding to the displacement vector will be larger and the displacement vector will be ranked higher in the first displacement vector list.

[0070] In one embodiment of the present application, a list of candidate predictor vectors can be constructed based on the displacement vectors of historically decoded blocks.

[0071] In practical application, the displacement vector of the history decoded block is obtained from the displacement vector of the decoded block whose reference frame is the current frame, and then the displacement vector of the history decoded block is added to a queue of a set length in a first-in first-out manner according to a set order to generate a second displacement vector list, and further generate a prediction vector candidate list according to the second displacement vector list. For example, the second displacement vector list can be used as the prediction vector candidate list.

[0072] In some embodiments, for example, if the queue length is 3, displacement vector 1, displacement vector 2, and displacement vector 3 can be stored according to a set order, and if a new displacement vector 4 needs to be added, the displacement vectors in the queue become displacement vector 2, displacement vector 3, and displacement vector 4. If a new displacement vector 5 needs to be added, the displacement vectors in the queue become displacement vector 3, displacement vector 4, and displacement vector 5.

[0073] In some embodiments, the set order may be a decoding order of the decoded blocks, a scanning order of the decoded blocks, or a weight corresponding to a displacement vector, the weight corresponding to the displacement vector being associated with at least one element of a number of repetitions of the displacement vector, a block size corresponding to the displacement vector, or a block position corresponding to the displacement vector.

[0074] For example, if a displacement vector is repeated many times, the weight corresponding to the displacement vector will be larger and the displacement vector will be ranked higher in the first displacement vector list; if the block corresponding to the displacement vector is small, the weight corresponding to the displacement vector will be larger and the displacement vector will be ranked higher in the first displacement vector list; if the block position corresponding to the displacement vector is close to the current block, the weight corresponding to the displacement vector will be larger and the displacement vector will be ranked higher in the first displacement vector list.

[0075] In some embodiments, when adding a displacement vector of a history decoded block to a queue, if the same displacement vector already exists in the queue, the same displacement vector already exists in the queue is removed. For example, when displacement vector 1, displacement vector 2, and displacement vector 3 are stored in a queue and a new displacement vector 4 needs to be added, if the displacement vector 4 is the same as displacement vector 2, the displacement vector 2 can be removed from the queue, so that the resulting queue becomes displacement vector 1, displacement vector 3, and displacement vector 4.

[0076] In some embodiments, one second displacement vector list may correspond to at least one region to be decoded, and the region to be decoded includes at least one of the largest coding block SB in which the current block is located, the row in the largest coding block SB in which the current block is located, and the tile in which the current block is located. For example, one second displacement vector list corresponds to one SB, or one second displacement vector list corresponds to multiple SBs. Based on this, in some embodiments, when the displacement vector in the second displacement vector list corresponding to the target region to be decoded (i.e., the designated region to be decoded) exceeds a set value, the addition of the displacement vector to the second displacement vector list corresponding to the target region to be decoded is stopped. That is, a maximum number can be set for the second displacement vector list corresponding to the region to be decoded, and when the maximum number is exceeded, the addition of the displacement vector to the corresponding second displacement vector list can be stopped.

[0077] Of course, for one decoding target region, the number of operations of adding a displacement vector to its corresponding second displacement vector list can be recorded, and when the number of operations exceeds a predetermined value, the addition of new displacement vectors to the corresponding second displacement vector list is stopped. That is, in the above embodiment, the number of operations of adding a displacement vector to the second displacement vector list is recorded to determine whether to stop adding a displacement vector to the corresponding second displacement vector list.

[0078] In one embodiment of the present application, a candidate predictor vector list may be constructed based on the displacement vectors of previously decoded blocks adjacent to the current block and the displacement vectors of previously decoded blocks.

[0079] In practical application, the displacement vector of the decoded block adjacent to the current block can be obtained from the displacement vector of the decoded block whose reference frame is the current frame, and the displacement vector of the history decoded block can be obtained from the displacement vector of the decoded block whose reference frame is the current frame, and then generate a prediction vector candidate list according to the obtained displacement vector of the adjacent decoded block and the displacement vector of the history decoded block. Here, when generating a prediction vector candidate list according to the obtained displacement vector of the adjacent decoded block and the displacement vector of the history decoded block, the obtained displacement vector can be sorted according to a set order to generate the prediction vector candidate list. In this process, repeated displacement vectors can be deleted.

[0080] In some embodiments, when generating a candidate predictor vector list based on the obtained displacement vectors of adjacent decoded blocks and the displacement vectors of the historically decoded blocks, it is also possible to remove displacement vectors that are not located within a predetermined area, the predetermined area including at least one of the current image, the current tile, the current global reference range, and the current local reference range.

[0081] In some embodiments, when sorting the obtained displacement vectors according to a set order, the set order may be a decoding order of the decoded blocks, a scanning order of the decoded blocks, a type of the decoded blocks, and a weight corresponding to the displacement vector. The weight corresponding to the displacement vector may be associated with at least one element of a repeat number of the displacement vector, a block size corresponding to the displacement vector, and a block position corresponding to the displacement vector. A decoded block may be a decoded block adjacent to the current block (i.e., a coded block in the aforementioned first displacement vector list) or a history decoded block (i.e., a coded block in the aforementioned second displacement vector list). Thus, the type of the decoded block is used to represent whether the decoded block is a decoded block adjacent to the current block (i.e., a coded block in the aforementioned first displacement vector list) or a history decoded block (i.e., a coded block in the aforementioned second displacement vector list). For example, the displacement vector of the decoded block adjacent to the current block may be placed before the displacement vector of the history decoded block. Of course, the displacement vectors of the decoded blocks adjacent to the current block may be placed after the displacement vectors of the previously decoded blocks.

[0082] In one embodiment, from the displacement vector of a decoded block whose reference frame is the current frame, the displacement vector of a decoded block adjacent to the current block is obtained, and the displacement vectors of the decoded blocks adjacent to the current block are sorted according to a set order to generate a first displacement vector list; then, from the displacement vector of a decoded block whose reference frame is the current frame, the displacement vector of a history decoded block is obtained, and the displacement vector of the history decoded block is added to a queue of a set length in a first-in, first-out manner according to the set order to generate a second displacement vector list; and further, a prediction vector candidate list can be generated based on the first displacement vector list and the second displacement vector list.

[0083] Here, the process of generating the first displacement vector list and the second displacement vector list can refer to the technical solutions in the above embodiments, and will not be described repeatedly.

[0084] In some embodiments, the process of generating a predictor vector candidate list based on the first displacement vector list and the second displacement vector list may be to merge the first displacement vector list and the second displacement vector list, remove duplicate displacement vectors, and generate the predictor vector candidate list.

[0085] In some embodiments, when merging a first displacement vector list and a second displacement vector list, the displacement vectors in the first displacement vector list may be placed before the displacement vectors in the second displacement vector list, and of course, the displacement vectors in the first displacement vector list may be placed after the displacement vectors in the second displacement vector list.

[0086] In some embodiments, when merging the first displacement vector list and the second displacement vector list, it is also possible to detect whether there are displacement vectors in the first displacement vector list and the second displacement vector list that are not located within a predetermined region. The predetermined region includes at least one of a current image, a current tile, a current global reference range, and a current local reference range. Then, in the process of merging the first displacement vector list and the second displacement vector list, the displacement vectors that are not located within the predetermined region are deleted.

[0087] Still referring to FIG. 9, in step S920, a predicted vector for the current block to be decoded is selected from the predicted vector candidate list.

[0088] In one embodiment of the present application, the process of selecting a predictive vector for a current block from a predictive vector candidate list can decode a code stream to obtain predictive vector index information, and then select one predictive vector from a corresponding position in the predictive vector candidate list as a predictive vector for the current block based on the predictive vector index information.

[0089] In some embodiments, it can be determined whether the predictor vector index information needs to be decoded based on the length of the predictor vector candidate list, and if it is determined that the predictor vector index information needs to be decoded, the code stream is decoded to obtain the predictor vector index information. In practical applications, for example, when the length of the predictor vector candidate list is 1, there is no need to decode the code stream to obtain the predictor vector index information, and the predictor vector in the predictor vector candidate list can be directly used as the predictor vector of the current block.

[0090] In some embodiments, the predictor vector index information may be encoded employing context-based multi-symbol arithmetic.

[0091] In some embodiments, the codestream may further include a maximum value of the predictor vector index information, which may be located in a sequence header, an image header, or a tile header, and which may represent a maximum number of the predictor vector index information. In some embodiments, the maximum values ​​corresponding to different displacement vector prediction modes are the same or different.

[0092] In one embodiment of the present application, the process of selecting a predictive vector of a current block from the predictive vector candidate list may be to select one predictive vector from the predictive vector candidate list as a predictive vector of a current block according to a set selection policy. For example, the i-th (i is a positive integer) predictive vector may be selected in order as a predictive vector of a current block, or one may be selected randomly.

[0093] In step S930, a decoding process is performed on the current block based on the predicted vector of the current block.

[0094] In one embodiment of the present application, in step S930, the process of performing a decoding process on the current block based on the predicted vector of the current block may be performing a decoding process on the current block by using the predicted vector of the current block as a displacement vector of the current block.

[0095] In one embodiment of the present application, in step S930, the process of performing a decoding process on the current block based on the predicted vector of the current block may include decoding the code stream to obtain a vector residual of the current block, calculating a displacement vector of the current block based on the vector residual and the predicted vector of the current block, and then performing a decoding process on the current block based on the displacement vector of the current block.

[0096] 11 is a flowchart of a video decoding method according to an embodiment of the present application. The video decoding method can be performed by a device having a computing function, such as a terminal device or a server. As shown in FIG. 11, the video decoding method includes at least the following steps:

[0097] In step S1110, the codestream is decoded to obtain reference range category indication information, the reference range category indication information indicating a target reference range to be used for an intra-frame block duplication mode, the target reference range including at least one of a global reference range and a local reference range.

[0098] In some embodiments, the reference range category indication information can be realized by two flag bits, for example, the reference range category indication information can include a first flag bit and a second flag bit, where the first flag bit indicates whether the use of a global reference range is permitted in the intra-frame block duplication mode, and the second flag bit indicates whether the use of a local reference range is permitted in the intra-frame block duplication mode.

[0099] In some embodiments, for example, a value of 1 for the first flag bit indicates that the use of a global reference range is permitted in the intra-frame block replication mode, and a value of 0 for the first flag bit indicates that the use of a global reference range is not permitted in the intra-frame block replication mode, a value of 1 for the second flag bit indicates that the use of a local reference range is permitted in the intra-frame block replication mode, and a value of 0 for the second flag bit indicates that the use of a local reference range is not permitted in the intra-frame block replication mode.

[0100] In some embodiments, the reference range category indication information can be realized by one flag bit, for example, in one embodiment, the reference range category indication information can include a third flag bit, which, when the third flag bit is a first value (e.g., 1), indicates that the use of a global reference range is permitted in the intra-frame block replication mode, and which, when the third flag bit is a second value (e.g., 0), indicates that the use of a local reference range is permitted in the intra-frame block replication mode.

[0101] In another embodiment, the reference range category indication information may include a fourth flag bit, which, when the fourth flag bit is a first value (e.g., 1), indicates that the use of global reference ranges and local reference ranges is permitted in the intra-frame block duplication mode, and which, when the fourth flag bit is a second value (e.g., 0), indicates that the use of local reference ranges is permitted in the intra-frame block duplication mode.

[0102] In step S1120, generate a candidate predictor vector list based on the displacement vector of a decoded block whose reference frame is the current frame.

[0103] In the embodiment of the present application, the order of execution of steps S1110 and S1120 is not limited.

[0104] In one embodiment of the present application, in step S1120, the process of generating a predictor vector candidate list based on the displacement vector of a decoded block whose reference frame is the current frame may be to obtain a target decoded block whose corresponding reference block is located within a target reference range and adopts an intra-frame block duplication mode from the displacement vector of a decoded block whose reference frame is the current frame, and then generate a predictor vector candidate list based on the displacement vector of the target decoded block.

[0105] In one embodiment of the present application, in step S1120, the process of generating a predictor vector candidate list based on a displacement vector of a decoded block whose reference frame is the current frame may be to calculate a reference block of the current block based on the displacement vector of the decoded block whose reference frame is the current frame, then determine a target reference block located within a target reference range from the reference block of the current block, and further generate a predictor vector candidate list based on the displacement vector of a decoded block corresponding to the target reference block.

[0106] In some embodiments, the position information of the reference block of the current block can be determined according to the coordinate of the current block and the displacement vector of the decoded block, for example, the horizontal coordinate of the corresponding reference block is calculated according to the horizontal coordinate of the current block and the horizontal component of a displacement vector, and the vertical coordinate of the corresponding reference block is calculated according to the vertical coordinate of the current block and the vertical component of a displacement vector.

[0107] In some embodiments, the reference range category indication information may be image-level reference range category indication information or tile-level reference range category indication information, and if the number of displacement vectors included in the prediction vector candidate list does not reach a set number, a predetermined block vector can be embedded in the prediction vector candidate list based on the image-level reference range category indication information or the tile-level reference range category indication information.

[0108] For example, when a global reference range is indicated, at least one of the block vectors (-sb_w-D, 0), (0,-sb_h), (sb_x-b_w-cur_x-D, 0), (0,sb_y-b_h-cur_y), and (-M×sb_w-D,-N×sb_h) may be selected to embed the predicted vector candidate list. In some embodiments, the precision of these block vectors may be at the full pixel level, or different precision representations may be used in the implementation.

[0109] Here, sb_w represents the width of the largest coded block in which the current block is located, sb_h represents the height of the largest coded block in which the current block is located, sb_x represents the horizontal coordinate of the upper left corner of the largest coded block in which the current block is located, sb_y represents the vertical coordinate of the upper left corner of the largest coded block in which the current block is located, b_w represents the width of the current block, b_h represents the height of the current block, cur_x represents the horizontal coordinate of the upper left corner of the current block, cur_y represents the vertical coordinate of the upper left corner of the current block, and D, M, and N are set constants.

[0110] When a local reference range is indicated, at least one of the block vectors (-b_w,0), (0,-b_h), (-b_w,-b_h), (-2×b_w,0), (0,-2×b_h), (0,0), (0,-vb_w), (-vb_h,0), and (-vb_w,-vb_h) may be selected to embed the predictor vector candidate list. Here, b_w represents the width of the current block, b_h represents the height of the current block, vb_w represents a predetermined block width, which may be, for example, 64, 32, 16, 8, or 4, and vb_h represents a predetermined block height, which may be, for example, 64, 32, 16, 8, or 4. In some embodiments, the accuracy of these block vectors may be at the full pixel level, or a representation scheme with different accuracy may be used in the implementation.

[0111] When a global reference range and a local reference range are specified, at least one of the above block vectors can be selected and embedded.

[0112] In one embodiment of the present application, when embedding a prediction block vector in a prediction vector candidate list, a candidate prediction block vector that satisfies any one of the following conditions may be selected and embedded. cur_x+bvpi_x≧min_x; cur_y+bvpi_y≧min_y; cur_x+bvpi_x≧min_x and cur_y+bvpi_y≧min_y; cur_x+b_w-1+bvpi_x≦max_x; cur_y+b_h-1+bvpi_y≦max_y; cur_x+b_w-1+bvpi_x≦max_x and cur_y+b_h-1+bvpi_y≦max_y,

[0113] Here, cur_x represents the horizontal coordinate of the upper left corner of the current block, cur_y represents the vertical coordinate of the upper left corner of the current block, b_w represents the width of the current block, b_h represents the height of the current block, bvpi_x represents the horizontal component of the i-th candidate prediction block vector, bvpi_y represents the vertical component of the i-th candidate prediction block vector, and if the target reference range is a global reference range, min_x and min_y represent the coordinates of the upper left corner of the tile in which the current block is located, max_x and max_y represent the coordinates of the lower right corner of the global reference range in the row in which the specified maximum coding block is located, the specified maximum coding block is the maximum coding block in which the current block is located, and if the target reference range is a local reference range, min_x and min_y represent the coordinates of the upper left corner of the local reference range in which the current block is located, and max_x and max_y represent the coordinates of the lower right corner of the local reference range in which the current block is located.

[0114] In one embodiment, if the number of displacement vectors included in the candidate predictor list is less than four, the following operations may be performed.

[0115] A) When the use of global and local reference ranges is allowed, {(0,-sb_h), (-sb_w-D,0), (0,-h'), (-w',0)} can be added to the predicted vector candidate list, where SB size is 128 and D is 256.

[0116] B) If only local reference ranges are allowed, {(0,-h'), (-w',0), (-w',-h'), (0,-2×h')} can be added to the predicted vector candidate list.

[0117] C) If only the use of global reference ranges is allowed, then {(0,-sb_h), (-sb_w-D,0), (-sb_w,-sb_h), (-2×sb_w,-sb_h)} can be added to the predicted vector candidate list, where SB size is 128 and D is 256.

[0118] D) When filling the predictive vector candidate list, a duplicate checking operation can be performed to remove duplicate predictive vectors.

[0119] Here, w'=min(b_w,64) and h'=min(b_h,64).

[0120] In step S1130, a predicted vector corresponding to the target reference range is selected from the predicted vector candidate list.

[0121] In one embodiment of the present application, when a predictive vector included in the predictive vector candidate list corresponds to a target reference range, the process of selecting a predictive vector corresponding to the target reference range from the predictive vector candidate list may be to decode the code stream to obtain predictive vector index information, and then select one predictive vector from the corresponding position of the predictive vector candidate list as the predictive vector of the current block based on the predictive vector index information.

[0122] In one embodiment of the present application, the process of selecting a prediction vector corresponding to the target reference range from the prediction vector candidate list may be to select one prediction vector corresponding to the target reference range as the prediction vector of the current block from the prediction vector candidate list according to a set selection policy. For example, the i-th (i is a positive integer) prediction vector corresponding to the target reference range may be selected in order as the prediction vector of the current block, or one may be selected randomly.

[0123] In step S1140, a decoding process is performed on the current block based on the predicted vector of the current block.

[0124] In one embodiment of the present application, the process of performing a decoding process on the current block based on the predicted vector of the current block may be to perform a decoding process on the current block using the predicted vector of the current block as the displacement vector of the current block, or to decode the code stream to obtain a vector residual of the current block, calculate the displacement vector of the current block based on the vector residual and the predicted vector of the current block, and then perform a decoding process on the current block based on the displacement vector of the current block.

[0125] According to the technical solution of the embodiment shown in Fig. 9 or Fig. 11, in one embodiment of the present application, the code stream can also be decoded to obtain displacement vector prediction mode indication information. On this basis, if the displacement vector prediction mode indication information indicates that the current block adopts Skip prediction mode, the prediction vector of the current block is used as the displacement vector of the current block, and the decoding process for the residual coefficient of the current block is skipped, and the decoding process for the current block is performed.

[0126] If the displacement vector prediction mode indication information indicates that the current block adopts the NearMV prediction mode, the prediction vector of the current block is used as the displacement vector of the current block, and the residual coefficients of the current block are decoded to perform a decoding process on the current block.

[0127] If the displacement vector prediction mode indication information indicates that the current block adopts the NewMV prediction mode, the code stream is decoded to obtain the displacement vector residual of the current block, the displacement vector of the current block is calculated based on the displacement vector residual and the prediction vector of the current block, the residual coefficient of the current block is decoded, and a decoding process is performed on the current block.

[0128] It should be noted that the above three prediction modes can be randomly combined during implementation, for example, one, two or all of these three modes can be used.

[0129] In one embodiment of the present application, it can also be determined whether it is necessary to decode the displacement vector prediction mode indication information based on the length of the prediction vector candidate list, and if it is determined that it is necessary to decode the displacement vector prediction mode indication information, the code stream is decoded to obtain the displacement vector prediction mode indication information. For example, if the length of the prediction vector candidate list is 0, it means that the prediction vector of the current block is 0. In this case, the NewMV prediction mode is used by default, and the displacement vector residual of the current block is decoded to be used as the prediction vector of the current block.

[0130] In one embodiment of the present application, the process of decoding the code stream to obtain the displacement vector residual of the current block may be to directly decode the code stream to obtain the symbols and values ​​of the displacement vector of the current block, or to decode the code stream to obtain the joint type indication information (joint_type). The joint type indication information indicates the consistency of components between the displacement vector residual of the current block and the prediction vector of the current block, i.e., the joint type indication information can indicate whether the components between the displacement vector residual of the current block and the prediction vector of the current block match or not, and the displacement vector residual of the current block is obtained by decoding based on the joint type indication information.

[0131] For example, if the joint type indication information indicates that the horizontal component between the displacement vector residual and the predicted vector is consistent and the vertical component is not consistent, only the vertical component needs to be decoded from the code stream, and in this case, the encoding side does not need to encode the horizontal component of the displacement vector residual from the code stream. If the joint type indication information indicates that the horizontal component between the displacement vector residual and the predicted vector is not consistent and the vertical component is consistent, only the horizontal component needs to be decoded from the code stream, and in this case, the encoding side does not need to encode the vertical component of the displacement vector residual from the code stream. If the joint type indication information indicates that both the horizontal component and the vertical component between the displacement vector residual and the predicted vector are consistent, it is not necessary to decode the displacement vector residual from the code stream, and in this case, the encoding side does not need to encode the displacement vector residual from the code stream. If the joint type indication information indicates that both the horizontal component and the vertical component between the displacement vector residual and the predicted vector are not consistent, it is necessary to decode the horizontal component and the vertical component of the displacement vector residual from the code stream.

[0132] 12 is a flowchart of a video encoding method according to an embodiment of the present application. The video encoding method may be performed by a device having a computing function, such as a terminal device or a server. Referring to FIG. 12, the video encoding method includes at least steps S1210 to S1230, which will be described in detail below.

[0133] In step S1210, a predictor vector candidate list is generated based on the displacement vector of a coded block whose reference frame is the current frame.

[0134] In step S1220, a predictive vector for the current block to be coded is selected from the predictive vector candidate list.

[0135] In step S1230, the current block is encoded based on the predicted vector of the current block.

[0136] In some embodiments, the step of selecting a predictor vector for a current block to be encoded from the predictor vector candidate list includes the steps of: decoding the codestream to obtain predictor vector index information; and selecting, based on the predictor vector index information, one predictor vector from a corresponding position in the predictor vector candidate list as a predictor vector for the current block to be encoded.

[0137] In some embodiments, the step of decoding the codestream to obtain predictor vector index information comprises: If it is determined based on the length of the predictor vector candidate list that the predictor vector index information needs to be decoded, the method includes the step of decoding the codestream to obtain the predictor vector index information.

[0138] In some embodiments, the predictor vector index information is encoded employing context-based multi-symbol arithmetic.

[0139] In some embodiments, the codestream includes a maximum value of the prediction vector index information, the maximum value being located in a sequence header, a picture header, or a tile header; Here, the maximum values ​​corresponding to different displacement vector prediction modes may be the same or different.

[0140] In some embodiments, the step of selecting a predictor vector for a current block to be encoded from the predictor vector candidate list comprises: The method includes selecting one predictive vector from the predictive vector candidate list as a predictive vector for a current block to be encoded according to a set selection policy.

[0141] In some embodiments, the step of generating a candidate list of predictor vectors based on a displacement vector of a coded block whose reference frame is the current frame comprises: obtaining a displacement vector of a coded block adjacent to the current block from a displacement vector of the coded block whose reference frame is the current frame; sorting the displacement vectors of the coded blocks adjacent to the current block according to a set order to obtain a first displacement vector list; generating a candidate predictor vector list based on the first displacement vector list.

[0142] In some embodiments, the neighboring coded blocks include at least one of the coded blocks in n1 rows above the current block and the coded blocks in n2 columns to the left of the current block, where n1 and n2 are positive integers.

[0143] In some embodiments, the step of generating a candidate list of predictor vectors based on a displacement vector of a coded block whose reference frame is the current frame comprises: obtaining a displacement vector of a history coded block from a displacement vector of a coded block whose reference frame is the current frame; adding the displacement vectors of the history-encoded blocks according to the set order to a queue of a set length in a first-in, first-out manner to obtain a second displacement vector list; generating a candidate predictor vector list based on the second displacement vector list.

[0144] In some embodiments, a video encoding method includes: When adding a displacement vector of a history-encoded block to the queue, if the same displacement vector already exists in the queue, the method further includes the step of deleting the same displacement vector already existing in the queue.

[0145] In some embodiments, one second list of displacement vectors corresponds to at least one region to be coded, the region to be coded being: It includes the largest coding block in which the current block is located, the row within the largest coding block in which the current block is located, and one of the tile in which the current block is located.

[0146] In some embodiments, a video encoding method includes: Stopping adding displacement vectors to the second displacement vector list corresponding to the target encoding target region when the displacement vector in the second displacement vector list corresponding to the target encoding target region exceeds a set value; or The method further includes a step of stopping addition of the displacement vector to the second displacement vector list corresponding to the target encoding target area when the number of times the displacement vector is added to the second displacement vector list corresponding to the target encoding target area exceeds a set number.

[0147] In some embodiments, the step of generating a candidate list of predictor vectors based on a displacement vector of a coded block whose reference frame is the current frame comprises: From the displacement vector of the coded block whose reference frame is the current frame, obtain the displacement vectors of the coded blocks adjacent to the current block, and sort the displacement vectors of the coded blocks adjacent to the current block according to a set order to obtain a first displacement vector list; obtaining a displacement vector of a history-encoded block from a displacement vector of an encoded block whose reference frame is a current frame, and adding the displacement vector of the history-encoded block to a queue of a set length in a first-in first-out manner according to a set order to obtain a second displacement vector list; generating a candidate predictor vector list based on the first displacement vector list and the second displacement vector list.

[0148] In some embodiments, the step of generating a candidate predictor vector list based on the first displacement vector list and the second displacement vector list comprises: merging the first displacement vector list and the second displacement vector list to obtain a merged displacement vector list; and removing duplicate displacement vectors from the merged displacement vector list to obtain a candidate predictor vector list.

[0149] In some embodiments, a video encoding method includes: detecting a displacement vector in a first displacement vector list and a second displacement vector list; In the process of merging the first displacement vector list and the second displacement vector list, removing the displacement vector that is not located within the predetermined region; Here, the predetermined area includes at least one of the current image, the current tile, the current global range of reference, and the current local range of reference.

[0150] In some embodiments, where the set order includes one of a coding order of the coded blocks, a scanning order of the coded blocks, a type of the coded blocks, and a weight of a displacement vector; Here, the weight is associated with at least one element of the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.

[0151] In some embodiments, a video encoding method includes: The method further includes: decoding the codestream to obtain a reference range category indication information, the reference range category indication information indicating a target reference range to be used for the intra-frame block replication mode, the target reference range including at least one of a global reference range and a local reference range; The step of selecting a predictive vector for a current block to be encoded from a predictive vector candidate list includes: The method includes a step of selecting, from the prediction vector candidate list, a prediction vector corresponding to the target reference range as a prediction vector for a current block to be encoded.

[0152] In some embodiments, the step of generating a candidate list of predictor vectors based on a displacement vector of a coded block whose reference frame is the current frame comprises: Obtaining a target coded block from the displacement vector of the coded block whose reference frame is the current frame, whose corresponding reference block is located within a target reference range and adopts an intra-frame block duplication mode; generating a candidate list of predicted vectors based on the displacement vector of the target encoded block.

[0153] In some embodiments, the step of generating a candidate list of predictor vectors based on a displacement vector of a coded block whose reference frame is the current frame comprises: determining a reference block for the current block based on a displacement vector of a coded block whose reference frame is the current frame; determining a target reference block located within the target reference range from the reference block of the current block; generating a candidate list of predictor vectors based on the displacement vectors of the encoded blocks corresponding to the target reference block.

[0154] In some embodiments, the reference range category indication is an image level reference range category indication or a tile level reference range category indication, and the video encoding method further comprises: If the number of displacement vectors in the prediction vector candidate list does not reach the set number, the method further includes a step of embedding a predetermined block vector in the prediction vector candidate list based on image level reference range category indication information or tile level reference range category indication information.

[0155] In some embodiments, the video encoding method further comprises the step of decoding the codestream to obtain the displacement vector prediction mode indication information, The step of performing an encoding process on the current block based on the prediction vector of the current block includes: if the displacement vector prediction mode indication information indicates that the current block adopts a skip prediction mode, using the prediction vector of the current block as the displacement vector of the current block, and skipping the encoding process for the residual coefficients of the current block; if the displacement vector prediction mode indication information indicates that the current block adopts a neighborhood motion vector prediction mode, using the predicted vector of the current block as the displacement vector of the current block, and encoding the residual coefficient of the current block; If the displacement vector prediction mode indication information indicates that the current block adopts a new motion vector prediction mode, the method includes a step of decoding the code stream to obtain a displacement vector residual of the current block, determining a displacement vector of the current block based on the displacement vector residual and the prediction vector of the current block, and encoding the residual coefficient of the current block.

[0156] In some embodiments, the step of decoding the code stream to obtain the displacement vector prediction mode indication information includes a step of decoding the code stream to obtain the displacement vector prediction mode indication information if it is determined based on the length of the predicted vector candidate list that the displacement vector prediction mode indication information needs to be decoded.

[0157] In some embodiments, when the displacement vector prediction mode indication information indicates that the current block adopts a new motion vector prediction mode, the step of decoding the codestream to obtain a displacement vector residual of the current block includes: Decoding the codestream to obtain symbols and values ​​of the displacement vector of the current block; or The method includes the steps of: decoding the code stream to obtain joint type indication information; and decoding based on the joint type indication information to obtain a displacement vector residual of the current block, the joint type indication information indicating a component consistency between the displacement vector residual of the current block and a prediction vector of the current block.

[0158] It should be noted that the implementation details of the above video encoding method are similar to those of the video decoding method described in the previous embodiment, and will not be described again.

[0159] Generally speaking, the technical solution of the embodiment of the present application can ensure that a more accurate prediction vector is selected from a more suitable prediction vector candidate list by constructing a more suitable prediction vector candidate list according to the displacement vector of the decoded block whose reference frame is the current frame, and can improve the coding performance. Furthermore, a suitable default prediction vector derivation method can be selected according to the reference range type to select corresponding prediction vectors for different reference ranges, thereby improving the accuracy of vector prediction, reducing the coding cost of the displacement vector, and improving the coding performance.

[0160] In the following, from the perspective of the decoding side, the implementation details of the technical solutions of the embodiments of the present application will be described in detail again.

[0161] In some embodiments, when decoding a current block, it is necessary to decode the displacement vector of the current block. In the following, the case where the current block is an IBC block and the displacement vector of the IBC block is a block vector bv(bv_x, bv_y) is taken as an example.

[0162] In some embodiments, the codestream may include bvp_mode to indicate the block vector prediction mode to be used; the following prediction modes may be used individually or in combination:

[0163] A) The block vector prediction mode includes a Skip prediction mode, in which the bv of the current block is equal to the predicted block vector (bvp: Block Vector Prediction), and the residual coefficients of the current block are 0 by default and do not need to be decoded.

[0164] B) The block vector prediction mode includes a Near Motion Vector (NearMV) prediction mode, in which the bv of the current block is equal to bvp, but the residual coefficients of the current block need to be decoded.

[0165] C) The block vector prediction mode includes a new motion vector (NewMV) prediction mode, in which the block vector residual (bvd) needs to be decoded, and bv=bvd+bvp of the current block, and the residual coefficient of the current block needs to be decoded at the same time.

[0166] In some embodiments, when decoding bvd, a direct decoding method can be adopted, i.e., the symbol and absolute value of bvd are decoded from the code stream. Or the decoding method of bvd can be classified into several types, joint_type is decoded to check the category to which it belongs, and then bvd is decoded. For example, there are four cases: when all components of bvd and bvp match, there is no need to decode bvd; when the horizontal components of bvd and bvp match but the vertical components do not match, only the vertical components of bvd need to be decoded; when the horizontal components of bvd and bvp do not match but the vertical components match, only the horizontal components of bvd need to be decoded; when all components of bvd and bvp do not match, there is a need to decode the horizontal and vertical components of bvd from the code stream.

[0167] In one embodiment of the present application, the bvp of the current block can be derived from the prediction block vector candidate list, for example, by decoding the prediction block vector index bvp_index, and then deriving the bvp of the current block based on the position of the bvp in the prediction block vector candidate list indicated by bvp_index. Or, without decoding the index, the bvp can be derived according to a fixed rule order, for example, by checking the top two candidate bvps in the prediction block vector candidate list, and then deriving the first non-zero candidate bvp as the bvp of the current block.

[0168] If the codestream contains reference range category indication information ibc_ref_type indicating the reference range in which the reference block of the current IBC block is located, the bvp of the corresponding category must be used. For example, if it indicates that the reference block of the current IBC block is in a global reference range, the bvp corresponding to the global reference range must be used, and if it indicates that the reference block of the current IBC block is in a local reference range, the bvp corresponding to the local reference range must be used.

[0169] ibc_ref_type belongs to the block-level reference range category indication, and the codestream may include image-level reference range category indication or tile-level reference range category indication to indicate the reference range of the IBC block in the current image or current tile, respectively. Of course, it may be indicated by multiple levels of reference range category indication, such as image-level reference range category indication and block-level reference range category indication.

[0170] In one embodiment of the present application, the method for constructing the prediction block vector candidate list bvp_list is as follows.

[0171] 1. The prediction block vector candidate list bvp_list may include block vector information of adjacent decoded blocks in the spatial domain, that is, a spatial domain block vector prediction list (SBVP).

[0172] Exemplarily, an SBVP with length N1 may be constructed to record the bv of adjacent decoded IBC blocks in the spatial domain according to a set order.

[0173] Here, the decoded IBC blocks adjacent in the spatial domain include decoded blocks in n1 rows above or n2 columns to the left of the current block, where n1 and n2 are positive integers. The set order may be a decoded IBC block-wise decoding order of the decoded IBC blocks adjacent in the spatial domain, a scan order, weights corresponding to displacement vectors of the decoded IBC blocks adjacent in the spatial domain, etc. The weights corresponding to the displacement vectors may be associated with at least one element of the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.

[0174] In some embodiments, the SBVP may be constructed based on the reference scope type of bv (global reference scope, local reference scope, etc.), and may, for example, only include bv's reference blocks in the corresponding reference scope.

[0175] 2. The predicted block vector candidate list bvp_list may include block vector information of a historically decoded block, that is, a history based block vector prediction list (HBVP).

[0176] Exemplarily, an HBVP with length N2 can be constructed to record the bvs of decoded IBC blocks (or the bvs of decoded blocks whose reference frame is the current frame) according to a set order, and each time the decoding of an IBC block is completed, the bvs of the decoded block are added to the HBVP according to a First Input First Output (FIFO) order, where the decoding order has a higher priority than the bvs adjacent to the current block.

[0177] Note that when inserting a bv into the HBVP, a duplicate check operation can be performed, and if there is a BV in the list that duplicates the new BV that needs to be inserted, the duplicate BV in the HBVP is removed.

[0178] In some embodiments, the HBVP may have a check count limit, and may stop adding BVs of decoded blocks to the HBVP if the number of BVs added to the HBVP for one SB, SB row, or tile exceeds a predetermined value. Furthermore, the HBVP may be reset according to the SB, SB row, or tile.

[0179] The bvs in the HBVP can also have different sorting orders, such as according to the decoding order of the decoded IBC blocks, the scanning order, the weights corresponding to the displacement vectors of the decoded IBC blocks, etc. The weights corresponding to the displacement vectors can be related to at least one element of the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.

[0180] 3. The prediction block vector candidate list bvp_list may be composed of only SBVP or only HBVP, or may be composed of a combination of both.

[0181] When bvp_list is jointly constructed by SBVP and HBVP, a duplication check operation is performed to ensure that the list does not contain duplicate instances. In addition, when the codestream contains reference range category indication information (which may be block-level reference range category indication information ibc_ref_type, or image-level or tile-level reference range category indication information), the bvp_list can be constructed using the following method.

[0182] Construct a bvp_list using the bvs of decoded IBC blocks whose reference blocks are within the reference range indicated by the reference range category indication information, or first calculate the reference blocks of the current IBC block using the bvs of decoded blocks, and then construct a bvp_list using the bvs of the decoded blocks only if the reference blocks are within the reference range indicated by the reference range category indication information.

[0183] Thus, in an embodiment of the present application, the code stream includes one or more of the reference range category indication information, bvp_mode, and bvp_index, and below, an embodiment of the present application will be described using an example in which the reference range category indication information is ibc_ref_type.

[0184] In some embodiments, the codestream includes ibc_ref_type, bvp_mode, and bvp_index.

[0185] The processing process on the decoding side is to decode ibc_ref_type, and if the value of ibc_ref_type is 0, it indicates that the reference block of the current IBC block is located in the local reference range, otherwise it indicates that the reference block of the current IBC block is located in the global reference range.

[0186] Decode bvp_mode and determine the block vector prediction mode to be used based on the value of bvp_mode, i.e. When the value of bvp_mode is 1, it means that skip mode is used, and bv of the current block = bvp, and decoding of residual coefficients is skipped; when the value of bvp_mode is 1, it means that NearMv mode is used, and bv of the current block = bvp; when the value of bvp_mode is 2, it means that NewMV mode is used, and bvd is obtained by decoding using the category-based (i.e., joint_tpye) method, and bv of the current block = bvd + bvp.

[0187] Decode the bvp_index to determine the position of the bvp in the bvp_list.

[0188] In this embodiment, the maximum length of the constructed bvp_list is 8. At construction time, only candidates corresponding to ibc_ref_type are used to construct the prediction block vector candidate list. Also, it is allowed to use neighboring candidates bv in spatial domain or neighboring candidates bv in historical coding order, for example, it is possible to add candidates bv in SBVP to bvp_list first, and add candidates bv in HBVP if bvp_list list is not filled.

[0189] In some embodiments, the codestream includes a bvp_mode and a bvp_index.

[0190] In this embodiment, there are two types of block vector prediction modes: NearMV mode and NewMV mode. The position of the bvp in the bvp_list is checked based on the bvp_index, and then the bvp can be determined.

[0191] In this embodiment, the maximum length of the constructed bvp_list is 8. In the concrete construction, only candidate bvs in the SBVP can be used.

[0192] In some embodiments, the codestream includes a bvp_index.

[0193] In this embodiment, the block vector prediction mode has only one prediction mode, NewMV mode.The position of the bvp in the bvp_list is checked based on the bvp_index, and then the bvp can be determined.

[0194] In this embodiment, the maximum length of the constructed bvp_list is 8. In the concrete construction, only candidate bvs in the SBVP can be used.

[0195] In some embodiments, the codestream includes flags, bvp_mode and bvp_index, that indicate the reference range.

[0196] In some embodiments, the flags indicating the reference range may be allowed_global_intrabc and allowed_local_intrabc, indicating whether blocks within the current image or current tile are allowed to use the global reference range or the local reference range, respectively.

[0197] For example, when the value of allowed_global_intrabc is 1, it indicates that the use of the global reference range is permitted, and when the value of allowed_global_intrabc is 0, it indicates that the use of the global reference range is not permitted. When the value of allowed_local_intrabc is 1, it indicates that the use of the local reference range is permitted, and when the value of allowed_local_intrabc is 0, it indicates that the use of the local reference range is not permitted.

[0198] The decoder decodes the flags that indicate the reference range, and also Further includes decoding bvp_mode to confirm the mode used, which may include, for example, two modes, where 0 represents NewMV mode and 1 represents NearMv mode.

[0199] Decode the bvp_index to determine the position of the bvp in the bvp_list.

[0200] In this embodiment, the maximum length of the constructed bvp_list is 4, and the bvp_list is composed of SBVP and HBVP. If the length of the list is less than 4, fill the bvp_list according to the reference range, specifically as follows:

[0201] A) When the use of global and local reference ranges is allowed, {(0,-sb_h), (-sb_w-D,0), (0,-h'), (-w',0)} can be added to the predicted vector candidate list, where SB size is 128 and D is 256.

[0202] B) If only local reference ranges are allowed to be used, the predicted vector candidate list can be filled with {(0,-h'), (-w',0), (-w',-h'), (0,-2×h')}.

[0203] C) If only the use of global reference ranges is allowed, then {(0,-sb_h), (-sb_w-D,0), (-sb_w,-sb_h), (-2×sb_w,-sb_h)} can be added to the predicted vector candidate list, where SB size is 128 and D is 256.

[0204] D) When populating the candidate predictor vector list, a duplicate check operation can be performed to remove duplicate predictor vectors.

[0205] Here, w'=min(b_w,64) and h'=min(b_h,64).

[0206] As described above, the technical solution of the embodiment of the present application can select a suitable default predicted vector derivation method according to the reference range type, and select corresponding predicted vectors for different reference ranges, thereby improving the accuracy of vector prediction, reducing the coding cost of displacement vectors, and improving coding performance. Furthermore, a more suitable predicted vector candidate list can be constructed based on the displacement vector of the decoded block whose reference frame is the current frame, ensuring the selection of a more accurate predicted vector, and improving coding performance.

[0207] The following describes an apparatus embodiment of the present application, which can be used to implement the method in the above embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, reference can be made to the above method embodiment of the present application.

[0208] 13 is a block diagram of a video decoding device according to an embodiment of the present application, which may be disposed in a device having a computing function, such as a terminal device or a server.

[0209] Referring to FIG. 13, a video decoding device 1300 according to an embodiment of the present application includes a first generating unit 1302, a first selecting unit 1304, and a first processing unit 1306.

[0210] Here, the first generation unit 1302 is configured to generate a prediction vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame, the first selection unit 1304 is configured to select a prediction vector of a current block to be decoded from the prediction vector candidate list, and the first processing unit 1306 is configured to perform a decoding process on the current block based on the prediction vector of the current block.

[0211] In some embodiments, the first selection unit 1304 is configured to decode a codestream to obtain predictor vector index information, and based on the predictor vector index information, select one predictor vector from a corresponding position in the predictor vector candidate list as a predictor vector for the current block.

[0212] In some embodiments, the first selection unit 1304 is further configured to determine whether the predictor vector index information needs to be decoded based on a length of the predictor vector candidate list, and if it determines that the predictor vector index information needs to be decoded, to decode the codestream to obtain the predictor vector index information.

[0213] In some embodiments, the predictor vector index information is encoded employing context-based multi-symbol arithmetic.

[0214] In some embodiments, the codestream includes a maximum value of the prediction vector index information, the maximum value being located in a sequence header, an image header or a tile header, and the maximum values ​​corresponding to different displacement vector prediction modes are the same or different.

[0215] In some embodiments, the first selection unit 1304 is configured to select one predictor vector from the predictor vector candidate list as the predictor vector for the current block according to a set selection policy.

[0216] In some embodiments, the first generation unit 1302 is configured to obtain displacement vectors of decoded blocks adjacent to the current block from displacement vectors of a decoded block whose reference frame is the current frame, sort the displacement vectors of the decoded blocks adjacent to the current block according to a set order to generate a first displacement vector list, and generate the prediction vector candidate list based on the first displacement vector list.

[0217] In some embodiments, the adjacent decoded blocks include at least one of a decoded block in n1 rows above the current block and a decoded block in n2 columns to the left of the current block, where n1 and n2 are positive integers.

[0218] In some embodiments, the first generation unit 1302 is configured to obtain a displacement vector of a history decoded block from a displacement vector of a decoded block whose reference frame is a current frame, add the displacement vector of the history decoded block to a queue of a set length in a first-in, first-out manner according to a set order to generate a second displacement vector list, and generate the prediction vector candidate list based on the second displacement vector list.

[0219] In some embodiments, the first generating unit 1302 is further configured to, when adding a displacement vector of the historically decoded block to the queue, if the same displacement vector already exists in the queue, delete the same displacement vector already existing in the queue.

[0220] In some embodiments, one of the second displacement vector lists corresponds to at least one region to be decoded, the region to be decoded including one of the largest coding block in which the current block is located, the row within the largest coding block in which the current block is located, and the tile in which the current block is located.

[0221] In some embodiments, the first generation unit 1302 is further configured to stop adding displacement vectors to the second displacement vector list corresponding to the target decoding target region if the displacement vectors in the second displacement vector list corresponding to the target decoding target region exceed a set value.

[0222] In some embodiments, the first generation unit 1302 is further configured to stop adding displacement vectors to the second displacement vector list corresponding to the target decoding target region when the number of times that the displacement vectors are added to the second displacement vector list corresponding to the target decoding target region exceeds a set number.

[0223] In some embodiments, the first generating unit 1302 obtains the displacement vectors of the decoded blocks adjacent to the current block from the displacement vectors of the decoded blocks whose reference frame is the current frame, and sorts the displacement vectors of the decoded blocks adjacent to the current block according to a set order to generate a first displacement vector list; Obtain the displacement vectors of the history-decoded blocks from the displacement vectors of the decoded blocks whose reference frame is the current frame, and add the displacement vectors of the history-decoded blocks to a queue of a set length in a first-in, first-out manner according to a set order to generate a second displacement vector list; The predictor vector candidate list is configured to generate the predictor vector candidate list based on the first displacement vector list and the second displacement vector list.

[0224] In some embodiments, the first generating unit 1302 is configured to merge the first displacement vector list and the second displacement vector list and remove duplicate displacement vectors to generate the candidate predictor vector list.

[0225] In some embodiments, the first generation unit 1302 is further configured to perform the steps of detecting whether there are any displacement vectors in the first displacement vector list and the second displacement vector list that are not located within a predetermined area, the predetermined area including at least one of a current image, a current tile, a current global reference range, and a current local reference range, and deleting displacement vectors that are not located within the predetermined area in the process of merging the first displacement vector list and the second displacement vector list.

[0226] In some embodiments, the set order includes one of a decoding order of the decoded blocks, a scanning order of the decoded blocks, a type of the decoded blocks, and a weight of the displacement vector, and the weight is associated with at least one element of a number of repetitions of the displacement vector, a block size corresponding to the displacement vector, and a block position corresponding to the displacement vector.

[0227] In some embodiments, the video decoding apparatus further comprises a decoding unit and a first selection unit 1304, the decoding unit configured to decode the codestream to obtain reference range category indication information, the reference range category indication information indicating a target reference range to be used for an intra-frame block replication mode, the target reference range including at least one of a global reference range and a local reference range, and the first selection unit 1304 configured to select a prediction vector corresponding to the target reference range from the prediction vector candidate list.

[0228] In some embodiments, the first generation unit 1302 is configured to obtain a target decoded block whose corresponding reference block is within the target reference range and adopts an intra-frame block duplication mode from a displacement vector of a decoded block whose reference frame is a current frame, and generate the prediction vector candidate list based on the displacement vector of the target decoded block.

[0229] In some embodiments, the first generation unit 1302 is configured to calculate a reference block for the current block based on a displacement vector of a decoded block whose reference frame is the current frame, determine a target reference block located within the target reference range from the reference block of the current block, and generate the prediction vector candidate list based on the displacement vector of a decoded block corresponding to the target reference block.

[0230] In some embodiments, the reference range category indication information is image level reference range category indication information or tile level reference range category indication information, and the first generation unit 1302 is further configured to embed a predetermined block vector in the prediction vector candidate list based on the image level reference range category indication information or the tile level reference range category indication information when the number of displacement vectors included in the prediction vector candidate list does not reach a set number.

[0231] In some embodiments, the video decoding apparatus comprises a decoding unit and a first processing unit 1306, the decoding unit configured to decode a codestream to obtain displacement vector prediction mode indication information, the first processing unit 1306 being configured to: If the displacement vector prediction mode indication information indicates that the current block adopts a Skip prediction mode, a prediction vector of the current block is used as the displacement vector of the current block, and a decoding process for a residual coefficient of the current block is skipped, and a decoding process is performed on the current block; If the displacement vector prediction mode indication information indicates that the current block adopts a NearMV prediction mode, using a prediction vector of the current block as a displacement vector of the current block, and decoding residual coefficients of the current block to perform a decoding process on the current block; When the displacement vector prediction mode indication information indicates that the current block adopts the NewMV prediction mode, the decoder is configured to decode the code stream to obtain a displacement vector residual of the current block, calculate a displacement vector of the current block based on the displacement vector residual and the prediction vector of the current block, decode the residual coefficients of the current block, and perform a decoding process on the current block.

[0232] In some embodiments, the decoding unit is further configured to determine whether the displacement vector prediction mode indication information needs to be decoded based on a length of the prediction vector candidate list, and if it determines that the displacement vector prediction mode indication information needs to be decoded, to decode the code stream to obtain the displacement vector prediction mode indication information.

[0233] In some embodiments, in the first processing unit 1306, decoding the codestream to obtain a displacement vector residual for the current block comprises decoding the codestream to obtain symbols and values ​​of the displacement vector for the current block; or The method is configured to perform a process including the steps of: decoding the code stream to obtain joint type indication information; and decoding based on the joint type indication information to obtain a displacement vector residual for the current block, the joint type indication information indicating a component consistency between the displacement vector residual for the current block and a prediction vector for the current block.

[0234] 14 is a block diagram of a video encoding device according to an embodiment of the present application, which may be disposed in a device having a computing function, such as a terminal device or a server.

[0235] Referring to FIG. 14, a video encoding device 1400 according to an embodiment of the present application includes a second generating unit 1402, a second selecting unit 1404, and a second processing unit 1406.

[0236] Here, the second generation unit 1402 is configured to generate a prediction vector candidate list based on a displacement vector of an encoded block whose reference frame is the current frame, the second selection unit 1404 is configured to select a prediction vector of a current block to be encoded from the prediction vector candidate list, and the second processing unit 1406 is configured to perform an encoding process on the current block based on the prediction vector of the current block.

[0237] FIG. 15 is a schematic diagram showing the configuration of a computer system adapted to implement an electronic device according to an embodiment of the present application.

[0238] It should be noted that the computer system 1500 of the electronic device shown in FIG. 15 is merely an example and does not limit the functions or scope of use of the embodiments of the present application.

[0239] As shown in FIG. 15, the computer system 1500 includes a central processing unit (CPU) 1501, which can execute various appropriate operations and processes, such as executing the method described in the above embodiment, based on a program stored in a read-only memory (ROM) 1502 or a program loaded from a storage unit 1508 to a random access memory (RAM) 1503. The RAM 1503 further stores various programs and data necessary for the operation of the system. The CPU 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0240] To the I / O interface 1505, there are connected an input unit 1506 including a keyboard, a mouse, etc., an output unit 1507 including a CRT (Cathode Ray Tube), an LCD (Liquid Crystal Display), etc., and a speaker, a storage unit 1508 including a hard disk, etc., and a communication unit 1509 including a network interface card such as a LAN (Local Area Network) card and a modem. The communication unit 1509 performs communication processing using a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as necessary. A removable medium 1511 such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory is mounted to the drive 1510 as necessary, and a computer program read from the removable medium is installed in the storage unit 1508 as necessary.

[0241] According to an embodiment of the present application, the process described above with reference to the flowcharts may be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product including a computer program carried on a computer-readable storage medium, the computer program including a computer program for performing the method illustrated in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication unit 1509 and / or installed from a removable medium 1511. When the computer program is executed by the central processing unit (CPU) 1501, it performs various functions defined in the system of the present application.

[0242] In addition, the computer-readable storage medium shown in the embodiments of the present application may be a memory such as a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic memory, an optical disk, or a CD-ROM, or may be any of various devices including one or any combination of the above memories.

[0243] The units described in the embodiments of the present application may be implemented in the form of software or hardware, and the described units may be provided in a processor, where the names of these units do not necessarily limit the units themselves.

[0244] The present embodiment further provides a computer-readable storage medium, which may be included in the electronic device in the above embodiment, or may be separate from the electronic device without being assembled to the electronic device, the computer-readable storage medium carrying one or more programs, which, when executed by the electronic device, causes the electronic device to realize the method according to the above embodiment.

[0245] It should be noted that, although the above detailed description refers to multiple modules or units of an apparatus configured to perform operations, such division is not required. Indeed, in accordance with embodiments of the present application, features and functions of two or more of the modules or units described above may be implemented in a single module or unit. Conversely, features and functions of a single module or unit described above may be divided so as to be embodied by multiple modules or units.

[0246] From the above description of the embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software or by software combined with 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 (which can be a CD-ROM, a USB memory, a removable hard drive, etc.) or on a network, and includes a number of instructions for making a computer device (which can be a personal computer, a server, a touch terminal, a network device, etc.) execute the method according to the embodiments of the present application.

[0247] Those skilled in the art may easily conceive other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, applications or adaptations of the present application, which modifications, applications or adaptations follow the general principles of the present application and include common general knowledge or conventional technical means in the art that are not disclosed herein.

[0248] It should be understood that the present application is not limited to the exact structure described above and illustrated in the drawings, and various modifications and variations may be made without departing from the scope of the present application, which is limited only by the appended claims. [Explanation of symbols]

[0249] 100 System Architecture 110 First terminal device 120 Second Terminal Device 130 Third Terminal Device 140 4th Terminal Device 150 Communication Network 201 Video Sources 202 Video Image Stream 203 Video Encoding Device 204 Video Code Stream 205 Streaming Server 206 Client Subsystem 207 Video Data 208 Client Subsystem 209 Video Data 210 Video Decoding Device 211 Output Video Image Stream 212 Display 213 Collection Subsystem 220 Electronic equipment 230 Electronic equipment 1300 Video Decoder 1302 First Generation Unit 1304 First Selection Unit 1306 First Processing Unit 1400 Video Encoder 1402 Second Generation Unit 1404 Second Selection Unit 1406 Second Processing Unit 1500 Computer System 1501 Central Processing Unit (CPU) 1502 Dedicated memory (ROM: Read-Only Memory) 1503 Random Access Memory (RAM) 1504 Bus 1505 Output (I / O: Input / Output) Interface 1506 Input section 1507 Output section 1508 Storage section 1509 Communications Department 1510 Drive 1511 Removable Media

Claims

1. 1. A video decoding method, comprising: generating a candidate list of predicted vectors based on a displacement vector of a decoded block whose reference frame is a current frame; selecting a prediction vector for a current block to be decoded from the prediction vector candidate list; performing a decoding process on the current block based on a prediction vector of the current block.

2. The step of selecting a prediction vector for a current block to be decoded from the prediction vector candidate list includes: decoding the codestream to obtain predicted vector index information; selecting, based on the predictor index information, one predictor vector from a corresponding position in the predictor vector candidate list as a predictor vector for a current block to be decoded; The video decoding method of claim 1.

3. The step of decoding the codestream to obtain predicted vector index information includes: if it is determined based on a length of the prediction vector candidate list that the prediction vector index information needs to be decoded, decoding the codestream to obtain prediction vector index information; The video decoding method of claim 2.

4. The prediction vector index information is encoded employing context-based multi-symbol arithmetic. A video decoding method according to claim 2 or 3.

5. the codestream includes a maximum value of the prediction vector index information, the maximum value being located in a sequence header, an image header, or a tile header; The maximum values ​​corresponding to different displacement vector prediction modes may be the same or different. The video decoding method of claim 2.

6. The step of selecting a prediction vector for a current block to be decoded from the prediction vector candidate list includes: selecting one predictive vector from the predictive vector candidate list as a predictive vector for a current block to be decoded according to a set selection policy; The video decoding method of claim 1.

7. The step of generating a prediction vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame includes: obtaining a displacement vector of a decoded block adjacent to the current block from a displacement vector of the decoded block whose reference frame is the current frame; sorting the displacement vectors of the decoded blocks adjacent to the current block according to a set order to obtain a first displacement vector list; generating the candidate predictor vector list based on the first displacement vector list; The video decoding method of claim 1.

8. The adjacent decoded blocks are n blocks above the current block. 1 The decoded block in the row, n to the left of the current block 2 at least one of the decoded blocks in the column; n 1 and n 2 is a positive integer, The video decoding method of claim 7.

9. The step of generating a prediction vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame includes: obtaining a displacement vector of a previously decoded block from a displacement vector of a previously decoded block whose reference frame is the current frame; adding the displacement vectors of the history-decoded blocks to a queue of a set length in a first-in, first-out manner according to a set order to obtain a second displacement vector list; generating the candidate predictor vector list based on the second displacement vector list; The video decoding method of claim 1.

10. The video decoding method includes: and when adding the displacement vector of the historically decoded block to the queue, if the same displacement vector already exists in the queue, removing the same displacement vector already existing in the queue.

10. The video decoding method of claim 9.

11. One of the second displacement vector lists corresponds to at least one region to be decoded, and the region to be decoded is a largest coding block in which the current block is located, a row in the largest coding block in which the current block is located, or a tile in which the current block is located; 10. The video decoding method of claim 9.

12. The video decoding method includes: Stopping adding displacement vectors to the second displacement vector list corresponding to the target region to be decoded when the displacement vector in the second displacement vector list corresponding to the target region to be decoded exceeds a set value; or When the number of times of adding the displacement vector to the second displacement vector list corresponding to the target decoding target region exceeds a set number, stopping adding the displacement vector to the second displacement vector list corresponding to the target decoding target region. The video decoding method of claim 11.

13. The step of generating a prediction vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame includes: From the displacement vector of a decoded block whose reference frame is a current frame, obtain the displacement vectors of the decoded blocks adjacent to the current block, and sort the displacement vectors of the decoded blocks adjacent to the current block according to a set order to obtain a first displacement vector list; obtaining a displacement vector of a history-decoded block from the displacement vector of a decoded block whose reference frame is a current frame, and adding the displacement vector of the history-decoded block to a queue of a set length in a first-in first-out manner according to a set order to obtain a second displacement vector list; generating the predicted vector candidate list based on the first displacement vector list and the second displacement vector list; The video decoding method of claim 1.

14. The step of generating the predictor vector candidate list based on the first displacement vector list and the second displacement vector list includes: merging the first displacement vector list and the second displacement vector list to obtain a merged displacement vector list; and removing duplicate displacement vectors from the merged displacement vector list to obtain the predicted vector candidate list.

14. The video decoding method of claim 13.

15. The video decoding method includes: detecting a displacement vector in the first displacement vector list and the second displacement vector list; In the process of merging the first displacement vector list and the second displacement vector list, removing the displacement vectors that are not located within a predetermined region; the predetermined region includes at least one of a current image, a current tile, a current global range of reference, and a current local range of reference; 15. The video decoding method of claim 14.

16. the set order includes one of a decoding order of the decoded blocks, a scanning order of the decoded blocks, a type of the decoded blocks, and a weight of a displacement vector; The weight is associated with at least one element of a number of repetitions of the displacement vector, a block size corresponding to the displacement vector, and a block position corresponding to the displacement vector. A video decoding method according to claim 7, 8 or 13.

17. The video decoding method includes: The method further includes: decoding the codestream to obtain a reference range category indication information, the reference range category indication information indicating a target reference range to be used for an intra-frame block replication mode, the target reference range including at least one of a global reference range and a local reference range; The step of selecting a prediction vector for a current block to be decoded from the prediction vector candidate list includes: selecting a prediction vector corresponding to the target reference range from the prediction vector candidate list as a prediction vector for the current block to be decoded; The video decoding method of claim 1.

18. The step of generating a prediction vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame includes: Obtaining a target decoded block from the displacement vector of the decoded block whose reference frame is the current frame, whose corresponding reference block is within the target reference range and adopts an intra-frame block duplication mode; generating the candidate predictor vector list based on a displacement vector of the target decoded block; 20. The video decoding method of claim 17.

19. The step of generating a prediction vector candidate list based on a displacement vector of a decoded block whose reference frame is a current frame includes: determining a reference block for the current block based on a displacement vector of a decoded block whose reference frame is the current frame; determining a target reference block located within the target reference range from a reference block of the current block; generating the candidate predictor vector list based on a displacement vector of a decoded block corresponding to the target reference block; 20. The video decoding method of claim 17.

20. The reference range category indication information is an image level reference range category indication information or a tile level reference range category indication information, and the video decoding method includes: If the number of displacement vectors in the prediction vector candidate list does not reach a set number, the method further includes embedding a predetermined block vector in the prediction vector candidate list based on the image level reference range category indication information or the tile level reference range category indication information.

20. The video decoding method of claim 17.

21. The video decoding method further includes decoding the codestream to obtain displacement vector prediction mode indication information; The step of performing a decoding process on the current block based on a prediction vector of the current block includes: if the displacement vector prediction mode indication information indicates that the current block adopts a skip prediction mode, using a prediction vector of the current block as a displacement vector of the current block, and skipping a decoding process for a residual coefficient of the current block; if the displacement vector prediction mode indication information indicates that the current block adopts a neighborhood motion vector prediction mode, using a predicted vector of the current block as a displacement vector of the current block, and decoding a residual coefficient of the current block; If the displacement vector prediction mode indication information indicates that the current block adopts a new motion vector prediction mode, decoding the code stream to obtain a displacement vector residual of the current block, determining a displacement vector of the current block according to the displacement vector residual and the prediction vector of the current block, and decoding a residual coefficient of the current block. A video decoding method according to any one of claims 1 to 3, 5 to 15, 17 to 20.

22. The step of decoding the codestream to obtain displacement vector prediction mode indication information includes: when determining based on a length of the prediction vector candidate list that the displacement vector prediction mode indication information needs to be decoded, decoding the code stream to obtain the displacement vector prediction mode indication information; 22. The video decoding method of claim 21.

23. When the displacement vector prediction mode indication information indicates that the current block adopts a new motion vector prediction mode, the step of decoding the codestream to obtain a displacement vector residual of the current block includes: decoding the codestream to obtain symbols and values ​​of the displacement vector of the current block; or decoding the codestream to obtain joint type indication information, and decoding based on the joint type indication information to obtain a displacement vector residual of the current block, the joint type indication information indicating a component consistency between the displacement vector residual of the current block and a prediction vector of the current block; 22. The video decoding method of claim 21.

24. 1. A video encoding method, comprising: generating a candidate list of predicted vectors based on a displacement vector of a coded block whose reference frame is a current frame; selecting a predictive vector for a current block to be encoded from the predictive vector candidate list; performing an encoding process on the current block based on a prediction vector of the current block.

25. 1. A video decoding device, comprising: a first generating unit configured to generate a candidate list of predictor vectors based on a displacement vector of a decoded block whose reference frame is a current frame; a first selection unit configured to select a prediction vector for a current block to be decoded from the prediction vector candidate list; a first processing unit configured to perform a decoding process on the current block based on a prediction vector of the current block.

26. 1. A video encoding device, comprising: a second generating unit configured to generate a candidate list of predictor vectors based on a displacement vector of a coded block whose reference frame is a current frame; a second selection unit configured to select a predictor vector for a current block to be encoded from the predictor vector candidate list; a second processing unit configured to perform an encoding process on the current block based on a prediction vector of the current block.

27. 1. A computer-readable storage medium, comprising: A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the video decoding method according to any one of claims 1 to 23 or the video encoding method according to claim 24.

28. An electronic device, one or more processors; An electronic device comprising: a memory configured to store one or more programs which, when executed by the one or more processors, cause the electronic device to realize the video decoding method of any one of claims 1 to 23 or the video encoding method of claim 24.

29. 1. A computer program product comprising: The computer program product includes computer instructions, the computer instructions being stored in a computer-readable storage medium, and a processor of an electronic device reads and executes the computer instructions from the computer-readable storage medium to cause the electronic device to perform the video decoding method of any one of claims 1 to 23 or realize the video encoding method of claim 24.

Citation Information

Patent Citations

  • Video encoding device, video encoding method, video encoding program, video decoding device, video decoding method, and video decoding program

    WO2020256102A1