Video encoding and decoding method and device, computer equipment and storage medium

By introducing template matching mode and motion vector difference merging mode in video encoding and decoding technology, the problem of low intra prediction efficiency in the prior art is solved, and more efficient video signal compression is achieved.

CN116491119BActive Publication Date: 2025-02-14TENCENT AMERICA LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280007296.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-09-16
Filing Date
2022-09-21
Publication Date
2025-02-14
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

The existing video encoding and decoding technology is difficult to effectively utilize the intra prediction mode when compressing video signals, resulting in low encoding efficiency.

Method used

The template matching (TM) mode is used to combine motion vector difference (MVD) information, and the merge mode of motion vector difference is determined through template matching, thereby optimizing the motion vector prediction of video blocks.

Benefits of technology

Improves the efficiency of video encoding, reduces redundancy through more accurate motion vector prediction, and improves compression ratio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116491119B_ABST
    Figure CN116491119B_ABST
Patent Text Reader

Abstract

Aspects of the present disclosure provide methods, apparatuses, computer devices, and non-volatile computer-readable storage media for video encoding and decoding. The apparatus includes a processing circuit configured to decode prediction information of a current block in an encoded bitstream. The prediction information indicates a merge mode (MMVD) with motion vector difference using a template matching (TM) mode and motion vector difference (MVD) information of the current block. The processing circuit determines one or more MVD candidates based on the MVD information. The processing circuit performs TM to search for a matching MVD between a current template of the current block and a reference template of a reference block of the current block based on the one or more MVD candidates. The processing circuit reconstructs the current block based on a motion vector (MV), the motion vector being the sum of a motion vector predictor (MVP) and the matching MVD.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Incorporation by Reference

[0002] This application claims priority to U.S. Patent Application No. 17 / 946,498, filed on September 16, 2022, entitled “SELECTABLE MERGE MODE WITH MOTION VECTOR DIFFERENCE USING TEMPLATE MATCHING”, which claims priority to U.S. Provisional Application No. 63 / 252,579, filed on October 5, 2021, entitled “SELECTABLE MERGE MODE WITH MOTION VECTOR DIFFERENCE (MMVD) USING TEMPLATE MATCHING”. The disclosure of the prior application is incorporated herein by reference in its entirety. Technical Field

[0003] This disclosure describes embodiments that generally relate to video encoding and decoding. Background Art

[0004] An uncompressed digital image and / or video may include a series of pictures, each picture having a spatial dimension of, for example, 1920×1080 luma samples and associated chroma samples. The series of pictures may have a fixed or variable picture rate (also informally referred to as a frame rate), such as 60 pictures per second or 60 Hz. Uncompressed images and / or videos have specific bit rate requirements. For example, 1080p60 4:2:0 video (1920x1080 luma sample resolution at 60 Hz frame rate) with 8 bits per sample requires close to 1.5 Gbit / s of bandwidth. One hour of such video would require over 600 GB of storage space.

[0005] One purpose of image and / or video encoding and decoding is to reduce the redundancy of input image and / or video signal by compression. Compression can help reduce the requirements of the above-mentioned bandwidth and / or storage space, and in some cases can reduce it by two or more orders of magnitude. Although the description of this article uses video encoding / decoding as an illustrative example, the same technology can be applied to image encoding / decoding in a similar manner without departing from the spirit of the present disclosure. Lossless compression and lossy compression, as well as a combination of the two, can be adopted. Lossless compression refers to the technology of reconstructing an exact copy of the original signal from the compressed original signal. When lossy compression is used, the reconstructed signal may not be exactly the same as the original signal, but the distortion between the original signal and the reconstructed signal is small enough so that the reconstructed signal can be used for the intended application. Lossy compression is widely used in video. The amount of distortion allowed depends on the application. For example, users of some consumer streaming applications can tolerate higher distortion than users of television applications. The achievable compression ratio reflects that higher allowed / allowed distortion can produce higher compression ratios.

[0006] Video encoders and decoders may utilize several broad categories of techniques including, for example: motion compensation, transform processing, quantization, and entropy coding.

[0007] Video codec techniques may include known intra-frame coding techniques. In intra-frame coding, sample values ​​are represented without reference to samples or other data of previously reconstructed reference pictures. In some video codecs, pictures are spatially subdivided into sample blocks. When all sample blocks are coded and decoded in intra-frame mode, the picture may be an intra-frame picture. Intra-frame pictures and their derivatives (e.g., independent decoder refresh pictures) may be used to reset decoder states, and may therefore be used as the first picture in an encoded video bitstream and video session, or as a still image. Samples of intra-frame blocks may be used for transformation, and transform coefficients may be quantized before entropy coding. Intra-frame prediction may be a technique for minimizing sample values ​​in a pre-transform domain. In some cases, the smaller the transformed DC value and the smaller the AC coefficient, the fewer bits are required to represent the entropy-coded block at a given quantization step size.

[0008] For example, conventional intra-frame codecs used in MPEG-2 (Moving Picture Experts Group-2) codecs do not use intra-frame prediction. However, some newer video compression techniques include techniques that attempt to perform predictions based on, for example, surrounding sample data and / or metadata that are obtained during encoding and / or decoding of a block of data. Such techniques have subsequently become known as "intra-frame prediction" techniques. It should be noted that, at least in some cases, intra-frame predictions use only reference data of the current picture being reconstructed, and not reference data of reference pictures.

[0009] There can be many different forms of intra-frame prediction. When more than one such technique can be used in a given video codec technique, the specific technique used can be encoded as a specific intra-frame prediction mode that uses that specific technique. In some cases, an intra-frame prediction mode can have sub-modes and / or parameters, where these sub-modes and / or parameters can be encoded separately or contained in a mode codeword that defines the prediction mode used. Which codeword is used for a given mode, sub-mode and / or parameter combination affects the codec efficiency gain obtained through intra-frame prediction, and therefore the entropy coding technique used to convert the codeword into the bitstream.

[0010] H.264 introduced an intra prediction mode, which was improved in H.265 and further improved in newer codecs such as the Joint Exploitation Model (JEM), Versatile Video Codec (VVC), Benchmark Sets (BMS), etc. A prediction block can be formed using neighboring sample values ​​of samples that are already available. Sample values ​​of neighboring samples are copied into the prediction block in a certain direction. A reference to the direction used can be encoded in the bitstream or can itself be predicted.

[0011] Reference Figure 1A, a subset of nine known prediction directions from the 33 possible prediction directions defined by H.265 (corresponding to the 33 angular modes of the 35 intra modes) is depicted in the lower right. The point (101) where the arrows converge represents the sample being predicted. The arrows represent the direction in which the sample is being predicted. For example, arrow (102) indicates that sample (101) is predicted based on one or more samples at a 45 degree angle to the horizontal direction at the upper right. Similarly, arrow (103) indicates that sample (101) is predicted based on one or more samples at a 22.5 degree angle to the horizontal direction at the lower left.

[0012] Still reference Figure 1A , a square block (104) consisting of 4×4 samples is shown in the upper left (indicated by the thick dashed line). The square block (104) consists of 16 samples, each of which is labeled with "S" and its position in the Y dimension (e.g., row index) and its position in the X dimension (e.g., column index). For example, sample S21 is the second sample in the Y dimension (starting from the top) and the first sample in the X dimension (starting from the left). Similarly, sample S44 is the fourth sample in the block (104) in both the Y dimension and the X dimension. Since the block is a 4×4 size sample, S44 is located in the lower right corner. Reference samples following a similar numbering scheme are also shown. Reference samples are labeled with "R" and their Y position (e.g., row index) and X position (e.g., column index) relative to the block (104). In H.264 and H.265, the prediction samples are adjacent to the block being reconstructed, so there is no need to use negative values.

[0013] Intra-picture prediction can be performed by copying reference sample values ​​from neighboring samples, where the neighboring samples are indicated by a signaled prediction direction. For example, assume that the encoded video bitstream includes signaling that indicates, for this block, a prediction direction consistent with arrow (102), i.e., the sample is predicted based on the sample to the upper right at a 45 degree angle to the horizontal direction. In this case, samples S41, S32, S23, and S14 are predicted based on the same reference sample R05. Then, sample S44 is predicted based on sample R08.

[0014] In some cases, for example by interpolation, the values ​​of multiple reference samples may be combined in order to calculate the reference sample, particularly when the direction is not divisible by 45 degrees.

[0015] As video codecs have evolved, the number of possible directions has increased. In H.264 (2003), nine different directions could be represented. This increased to 33 in H.265 (2013). Currently, JEM / VVC / BMS can support up to 65 directions. Experiments have been done to identify the most likely directions, and certain techniques in entropy coding are used to represent those possible directions using a small number of bits, accepting some penalty for less likely directions. Additionally, the direction itself can sometimes be predicted based on neighboring directions used in adjacent, already decoded blocks.

[0016] Figure 1B A schematic diagram (110) is shown, which depicts 65 intra prediction directions according to JEM to illustrate the increase in the number of prediction directions over time.

[0017] The mapping of the intra-frame prediction direction bits representing directions in the encoded video bitstream can vary depending on the video codec technology. For example, such mapping can include simple direct mapping to codewords, to complex adaptive schemes including the most likely mode, and similar techniques. However, in most cases, there may be certain directions in the video content that are statistically less likely to occur than other directions. Since the purpose of video compression is to reduce redundancy, in a well-functioning video codec technology, those unlikely directions will be represented using a larger number of bits than more likely directions.

[0018] Image and / or video encoding and decoding may be performed using inter-picture prediction with motion compensation. Motion compensation may be a lossy compression technique and may involve a technique where a block of sample data from a previously reconstructed picture or part of a reconstructed picture (reference picture) is used for prediction of a newly reconstructed picture or part of a picture after being spatially shifted in a direction indicated by a motion vector (hereinafter MV). In some cases, the reference picture may be the same as the picture currently being reconstructed. The MV may have two dimensions, X and Y, or three dimensions, where the third dimension indicates the reference picture being used (the latter may indirectly be a temporal dimension).

[0019] In some video compression techniques, the MV applied to a region of sample data can be predicted based on other MVs, such as those MVs related to another region of sample data that is spatially adjacent to the region being reconstructed and that precede the MV in decoding order. Doing so can greatly reduce the amount of data required to encode and decode the MV, thereby eliminating redundancy and increasing the amount of compression. MV prediction can be done efficiently, for example, because when encoding and decoding an input video signal derived from a camera (called natural video), there is a statistical probability that regions larger than the region applicable to a single MV move in a similar direction, so in some cases, similar motion vectors derived from MVs of adjacent regions can be used for prediction. This results in the MV found for a given region being similar or identical to the MV predicted from the surrounding MVs, and after entropy encoding and decoding, it can be represented with fewer bits than the number of bits used when the MV is directly encoded and decoded. In some cases, MV prediction can be an example of lossless compression of a signal (i.e., MV) derived from the original signal (i.e., sample stream). In other cases, MV prediction itself may be lossy, for example due to rounding errors generated when calculating predicted values ​​based on several surrounding MVs.

[0020] H.265 / HEVC (ITU-T Recommendation H.265, "High Efficiency Video Codec", December 2016) describes various MV prediction mechanisms. Among the various MV prediction mechanisms provided by H.265, refer to Figure 2 Described is a technique referred to hereinafter as "spatial merging".

[0021] Reference Figure 2 , the current block (201) includes samples found by the encoder during motion search, which can be predicted based on a previous block of the same size that has been spatially shifted. The MV is not encoded or decoded directly, but the MV associated with any of the five surrounding samples is used to derive the MV from metadata associated with one or more reference pictures, for example, the most recent (in decoding order) reference picture. The five surrounding samples are represented by A0, A1 and B0, B1, B2 (202 to 206 respectively). In H.265, MV prediction can use the prediction value of the same reference picture being used by the neighboring blocks. Summary of the invention

[0022] Aspects of the present disclosure provide methods and apparatus for video encoding and decoding. In some examples, the apparatus for video decoding includes a processing circuit. The processing circuit is configured to decode prediction information of a current block in an encoded bitstream, the prediction information indicating a merge mode (MMVD) with motion vector difference using a template matching (TM) mode and motion vector difference (MVD) information of the current block. The processing circuit determines one or more MVD candidates based on the MVD information. The processing circuit performs TM to search for a matching MVD between a current template of the current block and a reference template of a reference block of the current block based on the one or more MVD candidates. The processing circuit reconstructs the current block based on a motion vector (MV), the motion vector being the sum of a motion vector predictor (MVP) and the matching MVD.

[0023] In an embodiment, the one or more MVD candidates are one MVD candidate. The MVD information includes distance information indicating the magnitude of the one MVD candidate and direction information indicating the direction of the one MVD candidate. The processing circuit determines the one MVD candidate based on the magnitude of the one MVD candidate and the direction of the one MVD candidate, and performs the TM around the one MVD candidate. In an example, the encoded bitstream further includes a TM flag, which indicates that the TM is enabled for the current block. The distance information includes a distance index pointing to one of a plurality of distances, the distance being the magnitude of the one MVD candidate. The plurality of distances are based on a search range of the TM. For example, the search range of the TM is within the range of [-L, +L] in the horizontal and vertical directions, where L is a positive integer. The minimum distance among the plurality of distances is equal to L or L / 2.

[0024] In an example, the distance information includes a distance index pointing to a distance among a plurality of distances, the distance being a magnitude of the one MVD candidate. The plurality of distances are in an arithmetic progression.

[0025] In an embodiment, the one or more MVD candidates include multiple MVD candidates having the same direction. The MVD information includes direction information indicating the directions of the multiple MVD candidates. The processing circuit determines the multiple MVD candidates based on the directions of the multiple MVD candidates and multiple distances. The multiple MVD candidates are sorted based on the multiple distances. For each MVD candidate in the multiple MVD candidates, the processing circuit applies the TM to the corresponding MVD candidate to obtain a TM cost and a corresponding updated MVD candidate corresponding to the corresponding MVD candidate. The processing circuit determines the matching MVD based on the TM cost and the corresponding updated MVD candidate.

[0026] In an example, the MVD information includes a distance index. The processing circuit reorders the plurality of MVD candidates according to their TM costs and determines the matching MVD as the updated MVD candidate corresponding to the MVD candidate indicated by the distance index in the plurality of reordered MVD candidates.

[0027] In an example, the processing circuit determines the matching MVD as the updated MVD candidate corresponding to a minimum TM cost among the TM costs of the plurality of MVD candidates.

[0028] In an embodiment, the one or more MVD candidates include multiple MVD candidates having the same magnitude, and the MVD information includes distance information indicating the magnitudes of the multiple MVD candidates. The processing circuit determines the multiple MVD candidates based on the magnitudes of the multiple MVD candidates and multiple directions, and sorts the multiple MVD candidates according to the multiple directions. For each MVD candidate in the multiple MVD candidates, the processing circuit applies the TM to the corresponding MVD candidate to obtain a TM cost and a corresponding updated MVD candidate corresponding to the corresponding MVD candidate. The processing circuit determines the matching MVD based on the TM cost and the corresponding updated MVD candidate.

[0029] In an example, the MVD information includes a direction index. The processing circuit reorders the plurality of MVD candidates according to their TM costs and determines the matching MVD as the updated MVD candidate corresponding to the MVD candidate indicated by the direction index in the plurality of reordered MVD candidates.

[0030] In an example, the processing circuit determines the matching MVD as the updated MVD candidate corresponding to the minimum TM cost among the TM costs of the plurality of MVD candidates.

[0031] In some examples, a method of video decoding includes: decoding prediction information of a current block in an encoded bitstream, the prediction information indicating a merge mode with motion vector difference (MMVD) using a template matching (TM) mode and motion vector difference (MVD) information of the current block; determining one or more MVD candidates based on the MVD information; performing TM to search for a matching MVD between a current template of the current block and a reference template of a reference block of the current block based on the one or more MVD candidates; and reconstructing the current block based on a motion vector (MV), the motion vector being the sum of a motion vector predictor (MVP) and the matching MVD.

[0032] In some examples, a method of video encoding includes: using a merge mode with motion vector difference (MMVD) to determine one or more motion vector difference (MVD) candidates for a current block, the MMVD mode and a template matching (TM) mode being used together to encode the current block; determining the MVD of the current block by applying the TM to one or more MVD candidates; encoding the current block based on a motion vector (MV), the motion vector being the sum of a motion vector predictor (MVP) and the determined MVD; and encoding prediction information for the current block in a bitstream, the prediction information indicating that the MMVD and TM modes are applied together to the current block, the prediction information indicating MVD information of the current block.

[0033] In some examples, a video decoding apparatus includes: a decoding module for decoding prediction information of a current block in an encoded bitstream, the prediction information indicating a merge mode (MMVD) with motion vector difference using a template matching (TM) mode and motion vector difference (MVD) information of the current block; a determination module for determining one or more MVD candidates based on the MVD information; an execution module for executing TM to search for a matching MVD between a current template of the current block and a reference template of a reference block of the current block based on the one or more MVD candidates; and a reconstruction module for reconstructing the current block based on a motion vector (MV), the motion vector being the sum of a motion vector predictor (MVP) and the matching MVD.

[0034] In some examples, a video encoding device includes: a first determination module for determining one or more motion vector difference (MVD) candidates for a current block using a merge mode with motion vector difference (MMVD), the MMVD mode and a template matching (TM) mode being used together to encode the current block; a second determination module for determining the MVD of the current block by applying the TM to one or more MVD candidates; a first encoding module for encoding the current block based on a motion vector (MV), the motion vector being the sum of a motion vector predictor (MVP) and the determined MVD; and a second encoding module for encoding prediction information of the current block in a bitstream, the prediction information indicating that the MMVD and TM modes are applied together to the current block, the prediction information indicating MVD information of the current block.

[0035] Aspects of the present disclosure also provide a computer device, comprising at least one memory and at least one processor, wherein the at least one memory is used to store computer instructions, and when the computer instructions are loaded and executed by the at least one processor, the at least one processor performs the video decoding or encoding method.

[0036] Aspects of the present disclosure also provide a non-volatile computer-readable storage medium for storing a program, where the program can be executed by at least one processor to perform the video decoding or encoding method. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Other features, properties and various advantages of the disclosed subject matter will become further apparent from the following detailed description and accompanying drawings, in which:

[0038] Figure 1A is a schematic diagram of an exemplary subset of intra prediction modes.

[0039] Figure 1B is a schematic diagram of exemplary intra prediction directions.

[0040] Figure 2 An example of the current block and its surrounding samples is shown.

[0041] Figure 3 is a schematic diagram of an exemplary block diagram of a communication system.

[0042] Figure 4 is a schematic diagram of an exemplary block diagram of a communication system.

[0043] Figure 5 is a schematic diagram of an exemplary block diagram of a decoder.

[0044] Figure 6 is a schematic diagram of an exemplary block diagram of an encoder.

[0045] Figure 7 A block diagram of an exemplary encoder is shown.

[0046] Figure 8 A block diagram of an exemplary decoder is shown.

[0047] Fig. 9 The locations of exemplary spatial merging candidates are shown.

[0048] Fig.10 Exemplary candidate pairs considered for redundancy checking of spatial merging candidates are shown.

[0049] Fig.11 Exemplary motion vector scaling for temporal merging candidates is shown.

[0050] Fig.12 Exemplary candidate positions for temporal merging candidates are shown.

[0051] Fig.13 An example of template matching is shown.

[0052] Fig.14 A flow chart outlining an exemplary encoding process is shown.

[0053] Fig.15 A flow chart outlining an exemplary decoding process is shown.

[0054] Fig.16 is a schematic diagram of a computer system according to an embodiment. DETAILED DESCRIPTION

[0055] Figure 3 An exemplary block diagram of a communication system (300) is shown. The communication system (300) includes a plurality of terminal devices that can communicate with each other via, for example, a network (350). For example, the communication system (300) includes a first pair of terminal devices (310) and (320) interconnected via the network (350). Figure 3 In an embodiment, a first pair of terminal devices (310) and (320) perform unidirectional data transmission. For example, the terminal device (310) may encode video data (e.g., a video picture stream collected by the terminal device (310)) for transmission to another terminal device (320) via the network (350). The encoded video data is transmitted in the form of one or more encoded video code streams. The terminal device (320) may receive the encoded video data from the network (350), decode the encoded video data to restore the video data, and display the video picture based on the restored video data. Unidirectional data transmission is more common in applications such as media services.

[0056] In another embodiment, the communication system (300) includes a second pair of terminal devices (330) and (340) for performing bidirectional transmission of encoded video data, for example, during a video conference. For bidirectional data transmission, in one example, each of the terminal devices (330) and (340) can encode video data (for example, a video picture stream collected by the terminal device) for transmission to the other of the terminal devices (330) and (340) through the network (350). Each of the terminal devices (330) and (340) can also receive the encoded video data transmitted by the other of the terminal devices (330) and (340), and can decode the encoded video data to restore the video data, and can display the video picture on an accessible display device based on the restored video data.

[0057] exist Figure 3In the embodiment of the present disclosure, the terminal devices (310), (320), (330) and (340) may be servers, personal computers and smart phones, respectively, but the principles of the present disclosure may not be limited to this. The embodiments of the present disclosure are applicable to laptop computers, tablet computers, media players and / or dedicated video conferencing equipment. The network (350) represents any number of networks that transmit encoded video data between the terminal devices (310), (320), (330) and (340), including, for example, wired (wired) and / or wireless communication networks. The communication network (350) may exchange data in circuit switching and / or packet switching channels. The network may include a telecommunications network, a local area network, a wide area network and / or the Internet. For the purposes of the present disclosure, unless explained below, the architecture and topology of the network (350) may be irrelevant to the operation of the present disclosure.

[0058] As an example of application of the disclosed subject matter, Figure 4 A video encoder and a video decoder in a streaming environment are shown. The disclosed subject matter is equally applicable to other video-enabled applications including, for example, video conferencing, digital TV, streaming services, storing compressed video on digital media including CDs, DVDs, memory sticks, etc., and the like.

[0059] The streaming system may include an acquisition subsystem (413), which may include a video source (401) such as a digital camera, which creates an uncompressed video picture stream (402). In an embodiment, the video picture stream (402) includes samples taken by a digital camera. Compared to the encoded video data (404) (or the encoded video bitstream), the video picture stream (402) is depicted as a thick line to emphasize the high data volume of the video picture stream, and the video picture stream (402) can be processed by an electronic device (420), which includes a video encoder (403) coupled to the video source (401). The video encoder (403) may include hardware, software, or a combination of hardware and software to implement or implement various aspects of the disclosed subject matter as described in more detail below. Compared to the video picture stream (402), the encoded video data (404) (or the encoded video bitstream) is depicted as a thin line to emphasize the lower data volume, which can be stored on the streaming server (405) for future use. One or more streaming client subsystems, such as Figure 4The client subsystem (406) and the client subsystem (408) in the streaming server (405) can access the streaming server (405) to retrieve the copy (407) and the copy (409) of the encoded video data (404). The client subsystem (406) may include, for example, a video decoder (410) in the electronic device (430). The video decoder (410) decodes the incoming copy (407) of the encoded video data and generates an output video picture stream (411) that can be presented on a display (412) (e.g., a display screen) or another presentation device (not depicted). In some streaming systems, the encoded video data (404), (407) and (409) (e.g., a video bitstream) can be encoded according to certain video encoding / compression standards. Examples of such standards include ITU-T H.265. In an embodiment, the video codec standard under development is informally referred to as Versatile Video Coding (VVC), and the disclosed subject matter can be used in the context of the VVC standard.

[0060] It should be noted that the electronic device (420) and the electronic device (430) may include other components (not shown). For example, the electronic device (420) may include a video decoder (not shown), and the electronic device (430) may also include a video encoder (not shown).

[0061] Figure 5 An exemplary block diagram of a video decoder (510) is shown. The video decoder (510) may be disposed in an electronic device (530). The electronic device (530) may include a receiver (531) (eg, a receiving circuit). The video decoder (510) may be used to replace Figure 4 A video decoder (410) of an embodiment.

[0062] The receiver (531) may receive one or more encoded video sequences to be decoded by the video decoder (510). In one embodiment, the encoded video sequences are received one at a time, wherein the decoding of each encoded video sequence is independent of the decoding of other encoded video sequences. The encoded video sequence may be received from a channel (501), which may be a hardware / software link to a storage device storing the encoded video data. The receiver (531) may receive the encoded video data as well as other data, such as encoded audio data and / or auxiliary data streams that may be forwarded to their respective consuming entities (not shown). The receiver (531) may separate the encoded video sequence from the other data. To prevent network jitter, a buffer memory (515) may be coupled between the receiver (531) and the entropy decoder / parser (520) (hereinafter referred to as "parser (520)"). In some applications, the buffer memory (515) is part of the video decoder (510). In other cases, the buffer memory (515) may be provided external to the video decoder (510) (not shown). In other cases, a buffer memory (not shown) is provided outside the video decoder (510) to prevent network jitter, for example, and another buffer memory (515) may be configured inside the video decoder (510) to handle broadcast timing, for example. When the receiver (531) receives data from a storage / forward device with sufficient bandwidth and controllability or from an isochronous network, it may not be necessary to configure the buffer memory (515), or the buffer memory may be made smaller. Of course, in order to use on a service packet network such as the Internet, a buffer memory (515) may also be required, and the buffer memory may be relatively large and have an adaptive size, and may be at least partially implemented in an operating system or a similar element (not shown) outside the video decoder (510).

[0063] The video decoder (510) may include a parser (520) to reconstruct symbols (521) from the encoded video sequence. The types of symbols include information used to manage the operation of the video decoder (510) and potential information used to control a display device such as a display device (512) (e.g., a display screen) that is not part of the electronic device (530) but can be coupled to the electronic device (530), such as Figure 5As shown in . The control information for the display device may be a parameter set fragment (not indicated) of Supplemental Enhancement Information (SEI) message or Video Usability Information (VUI). The parser (520) may parse / entropy decode the received coded video sequence. The encoding of the coded video sequence may be performed according to a video coding technique or standard, and may follow various principles, including variable length coding, Huffman coding, arithmetic coding with or without context sensitivity, and the like. The parser (520) may extract a subgroup parameter set of at least one subgroup of the subgroups of pixels in the video decoder from the coded video sequence based on at least one parameter corresponding to the group. The subgroup may include a Group of Pictures (GOP), a picture, a tile, a slice, a macroblock, a Coding Unit (CU), a block, a Transform Unit (TU), a Prediction Unit (PU), and the like. The parser (520) may also extract information from the encoded video sequence, such as transform coefficients, quantizer parameter values, motion vectors, and so on.

[0064] The parser (520) may perform entropy decoding / parsing operations on the video sequence received from the buffer memory (515), thereby creating symbols (521).

[0065] Depending on the type of coded video picture or portion of coded video picture (e.g., inter- and intra-pictures, inter- and intra-blocks) and other factors, the reconstruction of the symbol (521) may involve multiple different units. Which units are involved and how they are involved may be controlled by subgroup control information parsed by the parser (520) from the coded video sequence. For the sake of brevity, such subgroup control information flow between the parser (520) and the multiple units below is not described.

[0066] In addition to the functional blocks already mentioned, the video decoder (510) can be conceptually subdivided into several functional units as described below. In a practical embodiment operating under commercial constraints, many of these units interact closely with each other and can be integrated with each other. However, for the purpose of describing the disclosed subject matter, the conceptual subdivision into the following functional units is appropriate.

[0067] The first unit is a sealer / inverse transform unit (551). The sealer / inverse transform unit (551) receives quantized transform coefficients as symbols (521) from the parser (520) and control information, including which transform method to use, block size, quantization factor, quantization scaling matrix, etc. The sealer / inverse transform unit (551) can output a block including sample values, which can be input into an aggregator (555).

[0068] In some cases, the output samples of the scaler / inverse transform unit (551) may belong to an intra-coded block. An intra-coded block is a block that does not use predictive information from a previously reconstructed picture, but may use predictive information from a previously reconstructed portion of the current picture. Such predictive information may be provided by an intra-picture prediction unit (552). In some cases, the intra-picture prediction unit (552) generates a block of the same size and shape as the block being reconstructed using surrounding reconstructed information extracted from a current picture buffer (558). For example, the current picture buffer (558) buffers a partially reconstructed current picture and / or a fully reconstructed current picture. In some cases, the aggregator (555) adds the prediction information generated by the intra-picture prediction unit (552) to the output sample information provided by the scaler / inverse transform unit (551) on a per-sample basis.

[0069] In other cases, the output samples of the scaler / inverse transform unit (551) may belong to an inter-frame coded and potentially motion compensated block. In this case, the motion compensated prediction unit (553) may access the reference picture memory (557) to extract samples for prediction. After the extracted samples are motion compensated according to the symbols (521), these samples may be added to the output of the scaler / inverse transform unit (551) (in this case referred to as residual samples or residual signals) by the aggregator (555) to generate output sample information. The acquisition of the predicted samples by the motion compensated prediction unit (553) from the address in the reference picture memory (557) may be controlled by a motion vector, and the motion vector is provided to the motion compensated prediction unit (553) in the form of the symbols (521), for example, including X, Y and reference picture components. Motion compensation may also include interpolation of sample values ​​extracted from the reference picture memory (557) when using sub-sample accurate motion vectors, motion vector prediction mechanisms, and the like.

[0070] The output samples of the aggregator (555) may be employed by various loop filtering techniques in a loop filter unit (556). The video compression techniques may include in-loop filter techniques controlled by parameters included in the coded video sequence (also referred to as the coded video bitstream) and available to the loop filter unit (556) as symbols (521) from the parser (520). The video compression may also be responsive to meta-information obtained during decoding of a coded picture or a previous (in decoding order) portion of the coded video sequence, and to previously reconstructed and loop filtered sample values.

[0071] The output of the loop filter unit (556) may be a sample stream that may be output to a display device (512) and stored in a reference picture memory (557) for subsequent inter-picture prediction.

[0072] Once fully reconstructed, certain coded pictures may be used as reference pictures for future prediction. For example, once the coded picture corresponding to the current picture is fully reconstructed, and the coded picture is identified as a reference picture (e.g., by the parser (520)), the current picture buffer (558) may become part of the reference picture memory (557), and a new current picture buffer may be reallocated before starting to reconstruct a subsequent coded picture.

[0073] The video decoder (510) may perform decoding operations according to a predetermined video compression technology or standard such as ITU-T H.265. The encoded video sequence may conform to the syntax specified by the video compression technology or standard used in the sense that the encoded video sequence follows the syntax of the video compression technology or standard and the profile recorded in the video compression technology or standard. Specifically, the profile may select certain tools from all the tools available in the video compression technology or standard as the only tools available for use under the profile. For compliance, the complexity of the encoded video sequence is also required to be within the range defined by the hierarchy of the video compression technology or standard. In some cases, the hierarchy limits the maximum picture size, the maximum frame rate, the maximum reconstruction sampling rate (measured in, for example, mega samples per second), the maximum reference picture size, etc. In some cases, the limits set by the hierarchy may be further limited by the Hypothetical Reference Decoder (HRD) specification and the metadata of the HRD buffer management signaled in the encoded video sequence.

[0074] In an embodiment, the receiver (531) may receive additional (redundant) data along with the encoded video. The additional data may be part of the encoded video sequence. The additional data may be used by the video decoder (510) to properly decode the data and / or more accurately reconstruct the original video data. The additional data may be in the form of, for example, temporal, spatial or signal-to-noise ratio (SNR) enhancement layers, redundant slices, redundant pictures, forward error correction codes, etc.

[0075] Figure 6 An exemplary block diagram of a video encoder (603) is shown. The video encoder (603) is disposed in an electronic device (620). The electronic device (620) includes a transmitter (640) (eg, a transmission circuit). The video encoder (603) may be used to replace Figure 6 A video encoder (603) in an embodiment.

[0076] The video encoder (603) can be used to obtain the video source (601) (not Figure 6 In another embodiment, the video source (601) is a part of the electronic device (620) to receive video samples, and the video source can collect video images to be encoded by the video encoder (603). In another embodiment, the video source (601) is a part of the electronic device (620).

[0077] The video source (601) may provide a source video sequence in the form of a digital video sample stream to be encoded by the video encoder (603), wherein the digital video sample stream may have any suitable bit depth (e.g., 8-bit, 10-bit, 12-bit, ...), any color space (e.g., BT.601 Y CrCB, RGB, ...), and any suitable sampling structure (e.g., Y CrCb 4:2:0, Y CrCb 4:4:4). In a media service system, the video source (601) may be a storage device storing previously prepared videos. In a video conferencing system, the video source (601) may be a camera that captures local image information as a video sequence. The video data may be provided as a plurality of separate pictures that are given motion when viewed sequentially. The pictures themselves may be constructed as a spatial pixel array, wherein each pixel may include one or more samples depending on the sampling structure, color space, etc. used. The relationship between pixels and samples may be easily understood by those skilled in the art. The following description focuses on samples.

[0078] According to an embodiment, the video encoder (603) may encode and compress pictures of a source video sequence into an encoded video sequence (643) in real time or under any other time constraints as required. Implementing an appropriate encoding speed is a function of the controller (650). In some embodiments, the controller (650) controls other functional units as described below and is functionally coupled to these units. For the sake of brevity, couplings are not shown in the figure. The parameters set by the controller (650) may include rate control related parameters (picture skipping, quantizer, lambda value of rate-distortion optimization technology, etc.), picture size, group of pictures (group of pictures, GOP) layout, maximum motion vector search range, etc. The controller (650) can be used to have other suitable functions that are related to the video encoder (603) optimized for a certain system design.

[0079] In some embodiments, the video encoder (603) operates in a coding loop. As a simple description, in embodiments, the coding loop may include a source encoder (630) (e.g., responsible for creating symbols, such as a symbol stream, based on an input picture to be encoded and a reference picture) and a (local) decoder (633) embedded in the video encoder (603). The decoder (633) reconstructs the symbols to create sample data in a manner similar to how the (remote) decoder creates sample data. The reconstructed sample stream (sample data) is input to a reference picture memory (634). Since the decoding of the symbol stream produces bit-accurate results that are independent of the decoder location (local or remote), the contents of the reference picture memory (634) are also bit-accurate between the local encoder and the remote encoder. In other words, the reference picture samples "seen" by the prediction part of the encoder are exactly the same as the sample values ​​that the decoder will "see" when using the prediction during decoding. This basic principle of reference picture synchronization (and the drift that occurs when synchronization cannot be maintained, such as due to channel errors) is also used in some related technologies.

[0080] The operation of the "local" decoder (633) can be combined with the above Figure 5 The "remote" decoder described in detail for the video decoder (510) is identical. However, additional brief reference is made to Figure 5 , when symbols are available and the entropy encoder (645) and parser (520) are capable of losslessly encoding / decoding the symbols into an encoded video sequence, the entropy decoding portion of the video decoder (510), including the buffer memory (515) and the parser (520), may not be fully implemented in the local decoder (633).

[0081] In an embodiment, decoder techniques other than parsing / entropy decoding present in a decoder are present in the corresponding encoder in the same or substantially the same functional form. Therefore, the disclosed subject matter focuses on decoder operation. The description of encoder techniques can be simplified because encoder techniques are reciprocal to the decoder techniques described comprehensively. A more detailed description in some areas is provided below.

[0082] During operation, in some embodiments, the source encoder (630) may perform motion compensated predictive coding. The motion compensated predictive coding predictively encodes an input picture with reference to one or more previously encoded pictures from a video sequence designated as "reference pictures." In this manner, the encoding engine (632) encodes the differences between pixel blocks of the input picture and pixel blocks of a reference picture that may be selected as a prediction reference for the input picture.

[0083] The local video decoder (633) may decode the encoded video data that may be designated as a reference picture based on the symbol created by the source encoder (630). The operation of the encoding engine (632) may be a lossy process. When the encoded video data is available at the video decoder ( Figure 6 When the video sequence is decoded at a remote location (not shown), the reconstructed video sequence may typically be a copy of the source video sequence with some errors. The local video decoder (633) replicates the decoding process that may be performed by the video decoder on the reference picture and may cause the reconstructed reference picture to be stored in the reference picture memory (634). In this way, the video encoder (603) may locally store a copy of the reconstructed reference picture that has common content (absent transmission errors) with the reconstructed reference picture to be obtained by the remote video decoder.

[0084] The predictor (635) may perform a prediction search for the encoding engine (632). That is, for a new picture to be encoded, the predictor (635) may search the reference picture memory (634) for sample data (as candidate reference pixel blocks) or certain metadata, such as reference picture motion vectors, block shapes, etc., that may serve as appropriate prediction references for the new picture. The predictor (635) may operate pixel-by-pixel based on sample blocks to find a suitable prediction reference. In some cases, based on the search results obtained by the predictor (635), it may be determined that the input picture may have prediction references taken from a plurality of reference pictures stored in the reference picture memory (634).

[0085] The controller (650) may manage encoding operations of the source encoder (630), including, for example, setting parameters and subgroup parameters for encoding video data.

[0086] The outputs of all the above functional units may be entropy encoded in an entropy encoder (645). The entropy encoder (645) applies lossless compression to the symbols generated by the various functional units according to techniques such as Huffman coding, variable length coding, arithmetic coding, etc., thereby converting the symbols into a coded video sequence.

[0087] The transmitter (640) may buffer the encoded video sequence created by the entropy encoder (645) in preparation for transmission over a communication channel (660), which may be a hardware / software link to a storage device where the encoded video data will be stored. The transmitter (640) may combine the encoded video data from the video encoder (603) with other data to be transmitted, such as encoded audio data and / or ancillary data streams (source not shown).

[0088] The controller (650) may manage the operation of the video encoder (603). During encoding, the controller (650) may assign a certain coded picture type to each coded picture, but this may affect the coding techniques that can be applied to the corresponding picture. For example, a picture may generally be assigned to any of the following picture types:

[0089] An intra picture (I picture) may be a picture that can be encoded and decoded without using any other picture in the sequence as a prediction source. Some video codecs allow different types of intra pictures, including, for example, Independent Decoder Refresh ("IDR") pictures. Those skilled in the art are aware of the variations of I pictures and their corresponding applications and features.

[0090] A predictive picture (P picture) may be a picture that can be encoded and decoded using intra prediction or inter prediction, which uses at most one motion vector and a reference index to predict sample values ​​for each block.

[0091] Bidirectional predictive pictures (B pictures), which can be pictures that can be encoded and decoded using intra prediction or inter prediction, which uses up to two motion vectors and reference indices to predict the sample values ​​of each block. Similarly, multiple predictive pictures can use more than two reference pictures and associated metadata for reconstruction of a single block.

[0092] The source picture may typically be spatially subdivided into blocks of samples (e.g., blocks of 4×4, 8×8, 4×8, or 16×16 samples), and coded block by block. These blocks may be predictively coded with reference to other (already coded) blocks, which are determined according to the coding allocation applied to the block's corresponding picture. For example, blocks of an I picture may be non-predictively coded, or the blocks may be predictively coded (spatial prediction or intra prediction) with reference to already coded blocks of the same picture. Blocks of pixels of a P picture may be predictively coded by spatial prediction with reference to one previously coded reference picture or by temporal prediction. Blocks of a B picture may be predictively coded by spatial prediction with reference to one or two previously coded reference pictures or by temporal prediction.

[0093] The video encoder (603) may perform encoding operations according to a predetermined video encoding technique or standard, such as ITU-T H.265 Recommendation. In operation, the video encoder (603) may perform various compression operations, including predictive encoding operations that exploit temporal and spatial redundancy in an input video sequence. Thus, the encoded video data may conform to the syntax specified by the video encoding technique or standard used.

[0094] In an embodiment, the transmitter (640) may transmit additional data when transmitting the encoded video. The source encoder (630) may include such data as part of the encoded video sequence. The additional data may include other forms of redundant data such as temporal / spatial / SNR enhancement layers, redundant pictures and slices, supplemental enhancement information (SEI) messages, visual usability information (VUI) parameter set fragments, etc.

[0095] The captured video may be taken as a plurality of source pictures (video pictures) in a temporal sequence. Intra-picture prediction (often simplified to intra-prediction) exploits spatial correlations in a given picture, while inter-picture prediction exploits (temporal or other) correlations between pictures. In an embodiment, a particular picture being encoded / decoded is divided into blocks, and the particular picture being encoded / decoded is referred to as the current picture. When a block in the current picture is similar to a reference block in a reference picture that was previously encoded in the video and is still buffered, the block in the current picture may be encoded by a vector called a motion vector. The motion vector points to a reference block in a reference picture, and in the case where multiple reference pictures are used, the motion vector may have a third dimension that identifies the reference picture.

[0096] In some embodiments, bidirectional prediction techniques may be used in inter-picture prediction. According to the bidirectional prediction technique, two reference pictures are used, for example, a first reference picture and a second reference picture that are both before the current picture in the video in decoding order (but may be in the past and future in display order, respectively). A block in the current picture may be encoded by a first motion vector pointing to a first reference block in the first reference picture and a second motion vector pointing to a second reference block in the second reference picture. Specifically, the block may be predicted by a combination of the first reference block and the second reference block.

[0097] In addition, merge mode technology can be used in inter-picture prediction to improve coding efficiency.

[0098] According to some embodiments of the present disclosure, predictions such as inter-picture prediction and intra-picture prediction are performed in blocks. For example, according to the HEVC standard, pictures in a video picture sequence are divided into coding tree units (CTUs) for compression, and the CTUs in the pictures have the same size, such as 64×64 pixels, 32×32 pixels, or 16×16 pixels. In general, a CTU includes three coding tree blocks (CTBs), which are a luminance CTB and two chrominance CTBs. Furthermore, each CTU can be split into one or more coding units (CUs) using a quadtree. For example, a 64×64 pixel CTU can be split into a 64×64 pixel CU, or 4 32×32 pixel CUs, or 16 16×16 pixel CUs. In an embodiment, each CU is analyzed to determine the prediction type for the CU, such as an inter-prediction type or an intra-prediction type. In addition, depending on temporal and / or spatial predictability, the CU is split into one or more prediction units (PUs). Typically, each PU includes a luma prediction block (PB) and two chroma PBs. In an embodiment, the prediction operation in encoding (encoding / decoding) is performed in units of prediction blocks. Taking the luma prediction block as an example of a prediction block, the prediction block includes a matrix of pixel values ​​(e.g., luma values), such as 8×8 pixels, 16×16 pixels, 8×16 pixels, 16×8 pixels, and the like.

[0099] Figure 7 An exemplary schematic diagram of a video encoder (703) is shown. The video encoder (703) is configured to receive a processed block (e.g., a prediction block) of sample values ​​within a current video picture in a video picture sequence and encode the processed block into an encoded picture that is part of an encoded video sequence. In this embodiment, the video encoder (703) is configured to replace Figure 4 A video encoder (403) in an embodiment.

[0100] In an HEVC embodiment, a video encoder (703) receives a matrix of sample values ​​for a processing block, such as a prediction block of 8×8 samples. The video encoder (703) uses, for example, rate-distortion optimization to determine whether to use intra mode, inter mode, or bidirectional prediction mode to encode the processing block. When encoding the processing block in intra mode, the video encoder (703) may use intra prediction techniques to encode the processing block into an encoded picture; and when encoding the processing block in inter mode or bidirectional prediction mode, the video encoder (703) may use inter prediction or bidirectional prediction techniques to encode the processing block into an encoded picture, respectively. In some video encoding techniques, the merge mode may be an inter-picture prediction submode, in which a motion vector is derived from one or more motion vector predictors without the aid of an encoded motion vector component external to the predictor. In some other video encoding techniques, there may be a motion vector component applicable to the subject block. In an embodiment, the video encoder (703) includes other components, such as a mode decision module (not shown) for determining the processing block mode.

[0101] exist Figure 7 In an embodiment of the present invention, the video encoder (703) includes: Figure 7 Shown are an inter-frame encoder (730), an intra-frame encoder (722), a residual calculator (723), a switch (726), a residual encoder (724), a common controller (721), and an entropy encoder (725) coupled together.

[0102] The inter-frame encoder (730) is used to receive samples of a current block (e.g., a processing block), compare the block with one or more reference blocks in a reference picture (e.g., blocks in a previous picture and a subsequent picture), generate inter-frame prediction information (e.g., redundant information description according to an inter-frame coding technique, motion vectors, merge mode information), and calculate an inter-frame prediction result (e.g., a predicted block) based on the inter-frame prediction information using any suitable technique. In some embodiments, the reference picture is a decoded reference picture decoded based on the encoded video information.

[0103] The intra-frame encoder (722) is used to receive samples of a current block (e.g., a processing block), compare the block with an encoded block in the same picture in some cases, generate quantization coefficients after transformation, and in some cases also generate intra-frame prediction information (e.g., intra-frame prediction direction information according to one or more intra-frame coding techniques). In an embodiment, the intra-frame encoder (722) also calculates an intra-frame prediction result (e.g., a predicted block) based on the intra-frame prediction information and a reference block in the same picture.

[0104] The general controller (721) is used to determine the general control data and control other components of the video encoder (703) based on the general control data. In an embodiment, the general controller (721) determines the mode of the block and provides a control signal to the switch (726) based on the mode. For example, when the mode is intra mode, the general controller (721) controls the switch (726) to select the intra mode result for use by the residual calculator (723) and controls the entropy encoder (725) to select intra prediction information and add the intra prediction information to the bitstream; and when the mode is inter mode, the general controller (721) controls the switch (726) to select the inter prediction result for use by the residual calculator (723) and controls the entropy encoder (725) to select the inter prediction information and add the inter prediction information to the bitstream.

[0105] The residual calculator (723) is used to calculate the difference (residual data) between the received block and the prediction result selected from the intra-frame encoder (722) or the inter-frame encoder (730). The residual encoder (724) is used to operate based on the residual data to encode the residual data to generate a transform coefficient. In an embodiment, the residual encoder (724) is used to convert the residual data from the spatial domain to the frequency domain and generate a transform coefficient. The transform coefficient is then processed by quantization to obtain a quantized transform coefficient. In various embodiments, the video encoder (703) also includes a residual decoder (728). The residual decoder (728) is used to perform an inverse transform and generate decoded residual data. The decoded residual data can be used appropriately by the intra-frame encoder (722) and the inter-frame encoder (730). For example, the inter-frame encoder (730) can generate a decoded block based on the decoded residual data and the inter-frame prediction information, and the intra-frame encoder (722) can generate a decoded block based on the decoded residual data and the intra-frame prediction information. The decoded blocks are appropriately processed to generate a decoded picture, and in some embodiments, the decoded picture may be buffered in a memory circuit (not shown) and used as a reference picture.

[0106] The entropy encoder (725) is used to format the bitstream to produce encoded blocks. The entropy encoder (725) includes various information in the bitstream according to a suitable standard such as the HEVC standard. In an embodiment, the entropy encoder (725) is used to obtain general control data, selected prediction information (such as intra-frame prediction information or inter-frame prediction information), residual information, and other suitable information in the bitstream. It should be noted that according to the disclosed subject matter, when the block is encoded in the inter-frame mode or the merge sub-mode of the bidirectional prediction mode, there is no residual information.

[0107] Figure 8An exemplary schematic diagram of a video decoder (810) is shown. The video decoder (810) is used to receive an encoded image as part of an encoded video sequence and decode the encoded image to generate a reconstructed picture. In an embodiment, the video decoder (810) is used to replace Figure 4 A video decoder (410) of an embodiment.

[0108] exist Figure 8 In an embodiment, the video decoder (810) includes Figure 8 An entropy decoder (871), an inter-frame decoder (880), a residual decoder (873), a reconstruction module (874) and an intra-frame decoder (872) coupled together are shown in FIG.

[0109] The entropy decoder (871) may be used to reconstruct certain symbols from the encoded picture, which represent syntax elements constituting the encoded picture. Such symbols may include, for example, a mode for encoding the block (e.g., intra mode, inter mode, bidirectional prediction mode, a merged submode of the latter two, or another submode), prediction information (e.g., intra prediction information or inter prediction information) that may identify certain samples or metadata for prediction by the intra decoder (872) or the inter decoder (880), respectively. Such symbols may also include residual information in the form of, for example, quantized transform coefficients, and the like. In an embodiment, when the prediction mode is an inter or bidirectional prediction mode, the inter prediction information is provided to the inter decoder (880); and when the prediction type is an intra prediction type, the intra prediction information is provided to the intra decoder (872). The residual information may be inverse quantized and provided to the residual decoder (873).

[0110] The inter-frame decoder (880) is used for receiving the inter-frame prediction information and generating an inter-frame prediction result based on the inter-frame prediction information.

[0111] The intra-frame decoder (872) is used to receive intra-frame prediction information and generate a prediction result based on the intra-frame prediction information.

[0112] The residual decoder (873) is used to perform inverse quantization to extract dequantized transform coefficients, and process the dequantized transform coefficients to convert residual information from the frequency domain to the spatial domain. The residual decoder (873) may also require some control information (to obtain the quantizer parameter QP), and this information can be provided by the entropy decoder (871) (the data path is not indicated because this is only low-volume control information).

[0113] The reconstruction module (874) is used to combine the residual information output by the residual decoder (873) with the prediction result (which can be output by the inter-frame prediction module or the intra-frame prediction module) in the spatial domain to form a reconstructed block, which can be part of a reconstructed picture, which in turn can be part of a reconstructed video. It should be noted that other suitable operations such as deblocking operations can be performed to improve visual quality.

[0114] It should be noted that the video encoder (403), video encoder (603) and video encoder (703) and video decoder (410), video decoder (510) and video decoder (810) may be implemented using any suitable technology. In an embodiment, the video encoder (403), video encoder (603) and video encoder (703) and video decoder (410), video decoder (510) and video decoder (610) may be implemented using one or more integrated circuits. In another embodiment, the video encoder (403), video encoder (603) and video encoder (703) and video decoder (410), video decoder (510) and video decoder (810) may be implemented using one or more processors that execute software instructions.

[0115] Various inter prediction modes can be used in VVC. For an inter-predicted CU, motion parameters may include one or more motion vectors (MVs), one or more reference picture indexes, a reference picture list usage index, and additional information for certain coding features of sample generation for inter prediction. Motion parameters may be signaled explicitly or implicitly. When a CU is encoded using skip mode, the CU may be associated with a PU and may not have significant residual coefficients, encoded motion vector increments or MV differences (e.g., MVDs), or reference picture indexes. A merge mode may be specified in which the motion parameters of the current CU are obtained from neighboring CUs, including spatial and / or temporal candidates, and optionally additional information such as that introduced in VVC. The merge mode may be applied to inter-predicted CUs, not just to skip mode. In one example, an alternative to the merge mode is explicit transmission of motion parameters, in which one or more MVs, corresponding reference picture indexes for each reference picture list, reference picture list usage flags, and other information are explicitly signaled per CU.

[0116] In one embodiment, for example in VVC, the VVC Test Model (VTM) reference software includes one or more improved inter-frame prediction coding tools, including: extended merge prediction, merged motion vector difference (MMVD) mode, adaptive motion vector prediction (AMVP) mode with symmetric MVD signaling, affine motion compensated prediction, sub-block-based temporal motion vector prediction (SbTMVP), adaptive motion vector resolution (AMVR), motion field storage (1 / 16 luma sample MV storage and 8x8 motion field compression), bidirectional prediction (BCW) with CU-level weights, bidirectional optical flow (BDOF), prediction correction (PROF) using optical flow, decoder-side motion vector correction (DMVR), combined inter-frame and intra-frame prediction (CIIP), geometric partitioning mode (GPM), etc. Inter-frame prediction and related methods are described in detail below.

[0117] In some examples, extended merge prediction may be used. In one example, such as in VTM4, a merge candidate list is constructed by including the following five types of candidates in order: one or more spatial motion vector predictors (MVPs) from one or more spatially adjacent CUs, one or more temporal MVPs from one or more co-located CUs, one or more history-based MVPs from a first-in-first-out (FIFO) table, one or more pairwise average MVPs, and one or more zero MVs.

[0118] The size of the merge candidate list can be signaled in the slice header. In one example, in VTM4, the maximum allowed size of the merge candidate list is 6. For each CU encoded in merge mode, the index of the best merge candidate (e.g., merge index) can be encoded using truncated unary binarization (TU). The first bin of the merge index can be encoded using context (e.g., context-adaptive binary arithmetic coding (CABAC)), while the other bins can be encoded using bypass coding.

[0119] Some examples of the generation process for each type of merge candidate are provided below. In one embodiment, one or more spatial candidates are derived as follows. The derivation of spatial merge candidates in VVC can be the same as that in HEVC. In one example, from the location Fig. 9 Select up to four merge candidates from the candidates at the positions shown. Fig. 9 FIG. 2 shows the positions of spatial merging candidates according to an embodiment of the present disclosure. Fig. 9, the order of derivation is B1, A1, B0, A0 and B2. Position B2 is considered only when any CU at positions A0, B0, B1 and A1 is unavailable (for example, because the CU belongs to another slice or another tile) or is intra-coded. After the candidate at position A1 is added, a redundancy check is performed on the addition of the remaining candidates, which ensures that candidates with the same motion information are excluded from the candidate list, thereby improving encoding and decoding efficiency.

[0120] In order to reduce computational complexity, not all possible candidate pairs are considered in the above redundancy check. Instead, only pairs with Fig.10 The arrows in are linking candidate pairs, and a candidate can be added to the candidate list only if the corresponding candidate used for redundancy check does not have the same motion information. Fig.10 FIG. 4 shows candidate pairs considered for redundancy check of spatial merging candidates according to an embodiment of the present disclosure. Fig.10 , candidate pairs linked to each arrow include A1 and B1, A1 and A0, A1 and B2, B1 and B0, and B1 and B2. Therefore, the candidates at positions B1, A0, and / or B2 can be compared with the candidate at position A1, and the candidates at positions B0 and / or B2 can be compared with the candidate at position B1.

[0121] In an embodiment, one or more temporal candidates are derived as follows: In the example, only one temporal merging candidate is added to the candidate list. Fig.11 An exemplary motion vector scaling for a temporal merge candidate is shown. To derive a temporal merge candidate for a current CU (1111) in a current picture (1101), a scaled MV (1121) may be derived based on a co-located CU (1112) belonging to a co-located reference picture (1104) (e.g., Fig.11 The reference picture list used to derive the co-located CU (1112) can be explicitly signaled in the slice header. Fig.11 As shown by the dotted line in , a scaled MV (1121) for a temporal merge candidate can be obtained. The scaled MV (1121) can be obtained by scaling the MV of the co-located CU (1112) using the picture order number (POC) distances tb and td. The POC distance tb can be defined as the POC difference between the current reference picture (1102) of the current picture (1101) and the current picture (1101). The POC distance td can be defined as the POC difference between the co-located reference picture (1104) of the co-located picture (1103) and the co-located picture (1103). The reference picture index of the temporal merge candidate can be set to zero.

[0122] Fig.12Exemplary candidate positions (e.g., C0 and C1) for temporal merge candidates for the current CU are shown. The position for the temporal merge candidate can be selected between candidate positions C0 and C1. Candidate position C0 is located at the lower right corner of the co-located CU (1210) of the current CU. Candidate position C1 is located at the center of the co-located CU (1210) of the current CU. If the CU at candidate position C0 is not available, intra-coded, or outside the current row of the CTU, candidate position C1 is used to derive the temporal merge candidate. Otherwise, for example, if the CU at candidate position C0 is available, intra-coded, and in the current row of the CTU, candidate position C0 is used to derive the temporal merge candidate.

[0123] Merge mode with MVD (MMVD) can be used in video / image codecs, such as VVC. In MMVD mode, implicitly derived motion information can be used to predict samples of a CU. For example, after signaling a skip flag or a merge flag, an MMVD merge flag can be signaled to specify whether MMVD mode is used for a CU.

[0124] In addition to the merge mode, the MMVD mode can encode the MV difference (MVD) so that the MV, which is the sum of the MVP and the MVD (or motion offset), is corrected. The MMVD mode can combine the concepts of the merge mode and the AMVP mode by providing a predefined MVD as the derived merge motion information. In the MMVD mode, one of the first two candidates in the merge candidate list can be selected as a reference (also called an MV reference or MV starting point). For example, a merge candidate flag (e.g., signaled) indicates one of the first two candidates in the candidate merge list.

[0125] After selecting the MV reference, the MV reference may be modified by additional information (e.g., MVD information signaled to indicate the MVD of the MV reference). The MVD represented by the direction and distance may be encoded (e.g., encoded) as a modification of the MV reference. The additional information may include a distance index for specifying the distance (also referred to as the magnitude) of the MVD and a direction index for indicating the direction of the MVD.

[0126] Multiple distances (also referred to as offsets) can be designed for MVD (e.g., eight distance entries in each distance set in Table 1). Table 1 shows two exemplary distance sets including a first distance set and a second distance set, and shows an exemplary relationship between a distance index and multiple distances in each distance set. When the full-pixel MMVD is turned off, the first distance set can be used, and the range of the MMVD predefined offset can be from 1 / 4 brightness sample to 32 brightness samples. When the full-pixel MMVD is turned off, the predefined offset can have a non-integer value, such as a fraction of brightness samples (e.g., 1 / 4 pixel or 1 / 2 pixel). When the full-pixel MMVD is turned on, the second distance set can be used, and the range of the MMVD predefined offset can be from 1 brightness sample to 128 brightness samples. In an example, when the full-pixel MMVD is turned on, the predefined offset has only an integer value, such as one or more brightness samples.

[0127] The encoder may select the distance set from Table 1, for example, at the picture level. A distance index may be signaled for the MVD to indicate which one of a plurality of distances in the selected distance set is applied.

[0128] Table 1 - Exemplary relationship between distance index and multiple distances (in units of luma samples) in MMVD mode

[0129] Distance Index Distance Set 1 Distance Set 2 0 1 / 4 1 1 1 / 2 2 2 1 4 3 2 8 4 4 16 5 8 32 6 16 64 7 32 128

[0130] In an example, the MVD allows multiple directions (eg, four directions, such as 0°, 90°, 180°, and 270°). A direction index may be signaled to indicate which of the multiple directions (eg, the four directions) is selected as the direction of the MVD.

[0131] Table 2 shows an exemplary relationship between four directions and direction indexes. Referring to Table 2, direction index 00 indicates a positive direction on the x-axis, direction index 01 indicates a negative direction on the x-axis, direction index 10 indicates a positive direction on the y-axis, and direction index 11 indicates a negative direction on the y-axis.

[0132] Table 2 - Exemplary relationship between direction and direction index of MVD

[0133] Direction Index 00 01 10 11 x-axis + - N / A N / A y-axis N / A N / A + -

[0134] Template matching (TM) technology can be used in video / image codecs. In order to further improve the compression efficiency of the VVC standard, for example, TM can be used to correct MV. In the example, TM is used on the decoder side. Using the TM mode, the MV can be corrected by constructing a template (e.g., current template) of a block in the current picture to be reconstructed (e.g., current block), and determining the closest match between the template of the block in the current picture and multiple templates in the reference picture (e.g., multiple reference templates). In an embodiment, the template of the block in the current picture may include the left adjacent reconstructed samples of the block and the top adjacent reconstructed samples of the block. TM can be used in video / image codecs other than VVC.

[0135] Fig.13 An example of template matching (1300) is shown. The TM can be used to derive motion information for the current CU (1301) by determining the closest match between a template (1321) of the current CU (1301) in the current picture (1310) and one of multiple templates in the reference picture (1311) (e.g., one of the multiple templates is template (1325)). The template (1321) of the current CU (1301) can have any suitable shape and any suitable size.

[0136] In an embodiment, the template (1321) of the current CU (1301) includes a top template (1322) and a left template (1323). Each of the top template (1322) and the left template (1323) can have any suitable shape and any suitable size.

[0137] The top template (1322) may include samples from one or more top neighboring blocks of the current CU (1301). In an example, the top template (1322) includes four rows of samples from one or more top neighboring blocks of the current CU (1301). The left template (1323) may include samples from one or more left neighboring blocks of the current CU (1301). In an example, the left template (1323) includes four columns of samples from one or more left neighboring blocks of the current CU (1301).

[0138] Each of the multiple templates in the reference picture (1311) (e.g., template (1325)) corresponds to the template (1321) in the current picture (1310). In an embodiment, the initial MV (1302) points from the current CU (1301) to the reference block (1303) in the reference picture (1311). Each of the multiple templates in the reference picture (1311) (e.g., template (1325)) and the template (1321) in the current picture (1310) may have the same shape and the same size. For example, the template (1325) includes a top template (1326) in the reference picture (1311) and a left template (1327) in the reference picture (1311). The top template (1326) may include samples in one or more top neighboring blocks of the reference block (1303). The left template (1327) may include samples in one or more left neighboring blocks of the reference block (1303).

[0139] A TM cost may be determined based on a template (1321) and a template (1325). The TM cost may indicate a match between the template (1321) and the template (1325). An optimized MV may be determined based on a search of an initial MV (1302) around a current CU (1301) within a search range (1315). The search range (1315) may have any suitable shape and any suitable number of reference samples. In an example, the search range (1315) in the reference picture (1311) includes a [-L, L] pixel range, where L is a positive integer, such as 8 (e.g., 8 samples). For example, a difference value (e.g., [0, 1]) is determined based on the search range (1315), and an intermediate MV is determined by the sum of the initial MV (1302) and the difference value (e.g., [0, 1]). An intermediate reference block and a corresponding template in the reference picture (1311) may be determined based on the intermediate MV. The TM cost may be determined based on the template (1321) and the intermediate template in the reference picture (1311). The TM cost may correspond to a difference value determined based on the search range (1315) (e.g., [0,0], [0,1], etc. corresponding to the initial MV (1302)). In the example, the difference value corresponding to the minimum TM cost is selected, and the optimized MV is the sum of the difference value corresponding to the minimum TM cost and the initial MV (1302).

[0140] The TM may be modified appropriately. In an example, the search step size is determined by the AMVR mode. In an example, the TM may be cascaded (eg, used together) with one or more other encoding and decoding methods such as a bidirectional matching process.

[0141] In an example, the TM is used to modify the motion information of an MVP candidate in AMVP mode and / or a merge candidate in merge mode.

[0142] The present disclosure includes aspects related to MMVD mode, wherein TM is used to improve MMVD mode. TM can be used to correct MV information of MVD candidates in MMVD mode. TM can be used to derive direction information (e.g., direction index) and / or distance information (e.g., distance index) in MMVD mode.

[0143] In an example, a current block in a current picture is encoded using an MMVD mode. The MVP of the MV of the current block may be determined based on a candidate list (e.g., a merge candidate list) and information (e.g., an index or a flag) indicating which of the candidates in the candidate list (e.g., the merge candidate) is used as the MVP. For example, the flag may be a merge candidate flag as described above. One or more parsed MVD candidates may be determined using an MMVD mode (e.g., based on the MVD information of the current block).

[0144] According to an embodiment of the present disclosure, TM is applied together with the MMVD mode to determine the MVD of the MV of the current block (also referred to as the TM-matched MVD). A TM search process may be performed around one or more parsed MVD candidates determined using the MMVD mode to determine the TM-matched MVD. In an example, the current template of the current block in the current picture and the reference template of the reference block in the reference picture corresponding to the TM-matched MVD have the smallest TM cost (or closest match) in the template pair between the current picture and the reference picture (e.g., the current template of the current block in the current picture and the reference template of the corresponding reference block in the reference picture). The MV of the current block may be determined based on the MVP and the TM-matched MVD, for example, by summing the MVP and the TM-matched MVD.

[0145] In an embodiment, a single MVD candidate is determined using the MMVD mode. A TM is performed around the MVD candidate to determine the MVD that the TM matches. A single MVD candidate can be determined based on the MVD information of the current block. The MVD information can indicate a distance index and / or a direction index. Any suitable distance set and / or any suitable direction set can be used in the MMVD mode. Which distance set and / or which direction set is used to determine a single MVD candidate can be predefined or can be indicated in the prediction information including the MVD information. In the example, the MVD information indicates the use of the first distance set in Table 1, the distance index is 1, and the direction index is 00. Accordingly, the MVD candidate has a magnitude of 1 / 2 of a luminance sample and a direction that is the same as the positive x-axis.

[0146] In an embodiment, a plurality of MVD candidates are determined using the MMVD mode. A TM may be performed around each of the plurality of MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. A TM-matched MVD may be determined based on the TM cost and the corresponding updated MVD candidate.

[0147] In an embodiment, when the MMVD mode is used, a TM flag is signaled to indicate whether the TM process is enabled. The TM flag may be signaled at a sequence parameter set (SPS) level, a picture parameter set (PPS) level, a picture level (e.g., in a picture header (PH)), a slice level, a block level, etc. If the TM flag indicates that the TM is enabled in the MMVD mode, the TM may be applied to determine the TM-matched MVD. Otherwise, if the TM flag indicates that the TM is not enabled in the MMVD mode, the TM is not applied to obtain the TM-matched MVD.

[0148] In an embodiment, the distance set used in the MMVD mode depends on whether TM is enabled for the current block. For example, when the TM flag indicates that the TM process is enabled, a distance set different from the first distance set and the second distance set shown in Table 1 is used in the MMVD mode.

[0149] In an example, when TM is enabled for MMVD mode, the distance set available for one or more MVD candidates in MMVD mode starts from a larger distance, such as 4 luma samples instead of 1 / 4 luma samples in the first distance set or 1 luma sample in the second distance set. The distance set may depend on the search range of TM. In an example, the search range of TM mode is in the range of [-L, +L] in the horizontal and vertical directions, where L is a positive number. Return to reference Fig.13 , when L is 8, the search range is [-8,8]. The minimum distance in the distance set may depend on the search range of the TM process in the MMVD mode. In an example, the minimum distance in the distance set corresponds to a distance index of 0. When the distance value (e.g., the minimum distance) of distance index 0 changes, the distance set changes accordingly. Table 3 shows an exemplary relationship between a distance index and a plurality of distances (in units of luminance samples) in the MMVD mode.

[0150] Table 3 - Example relationship between distance index and multiple distances (in units of luma samples) in MMVD mode

[0151]

[0152]

[0153] In the example, the distance value corresponding to distance index 0 (e.g., the minimum distance in the distance set) is equal to L, where the search range of the TM process in the MMVD mode is in the range of [-L, +L]. For example, when the TM search range is in the range of [–8, +8] pixels, the distance value is 8 brightness samples.

[0154] In the example, the distance value corresponding to distance index 0 (e.g., the minimum distance in the distance set) is a fraction of L, such as equal to L / 2, where the search range of the TM process in the MMVD mode is the range of [-L, +L]. For example, when the TM search range is in the range of [–8, +8] pixels, the distance value is 4 brightness samples.

[0155] In one example, the distance values ​​in the distance set are in an arithmetic progression. For example, the distance values ​​are 8, 16, 24, 32, 40, 48, 56, and 64, corresponding to distance indexes 0-7, respectively. In another example, the distance values ​​are 4, 12, 20, 28, 36, 44, 52, and 60, corresponding to distance indexes 0-7, respectively.

[0156] As described above, any suitable set of distances may be used in the MMVD mode.The set of distances used in the MMVD mode may include any suitable number of distances and / or any suitable distance values.

[0157] As described above, a plurality of MVD candidates may be determined using the MMVD mode. A TM may be performed around each of the plurality of MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. A TM-matched MVD may be determined based on the TM cost and the corresponding updated MVD candidate.

[0158] In an embodiment, one or more direction indices, distance steps, and / or one or more distance indices may be derived or arranged (eg, reordered) based on one or more TM costs.

[0159] In an embodiment, multiple MVD candidates have the same direction. The directions of multiple MVD candidates can be parsed in MMVD mode. For example, the MVD information indicates the directions of multiple MVD candidates (e.g., by a direction index). The magnitudes (or distances) of multiple MVD candidates can be determined based on a distance set, such as shown in Tables 1 and 3. In an example, the magnitudes of multiple MVD candidates are distances in the distance set, respectively. After parsing the direction, the TM process can be applied to multiple MVD candidates along the parsed direction to determine the corresponding TM cost and the corresponding updated MVD candidate. The search range of the TM process can be any suitable search range, such as within the [-L, L] range as described above. The search step size can be any suitable step size. In an example, the search range is limited to certain directions, such as the parsed direction. Multiple MVD candidates can be arranged (e.g., reordered) based on the TM cost, such as sorted in ascending order of the TM cost. In an example, the MVD information indicates distance information, such as a distance index. In an example, the distance index is signaled. The TM-matched MVD may be determined as an updated MVD candidate corresponding to the MVD candidate indicated by the distance index among the plurality of reordered MVD candidates. In an example, the distance index is not signaled, and the TM-matched MVD is determined as an updated MVD candidate corresponding to the minimum TM cost among the plurality of reordered MVD candidates.

[0160] For example, the direction of the plurality of MVD candidates is the positive x-axis indicated by direction index 00. The number of the plurality of MVD candidates is 8. The magnitudes of the plurality of MVD candidates are 4, 8, 16, 32, 64, 128, 256, and 512 luma samples, respectively, as shown in Table 3. Before TM, the relationship between the distance index and the corresponding distance is indicated by Table 3, for example, distance index 0 corresponds to a distance value of 4 luma samples. The TM process is applied to each of the plurality of MVD candidates to determine a TM cost and a corresponding updated MVD candidate, as shown in Table 4.

[0161] Table 4 - Exemplary relationship between multiple MVD candidates, TM costs and corresponding updated MVD candidates

[0162] MVD Candidate TM Cost Updated MVD candidates Value: 4, Direction: +x axis TM Cost 0 Updated MVD candidate 0 Value: 8, Direction: +x axis TM Cost 1 Updated MVD candidate 1 Value: 16, Direction: +x axis TM Cost 2 Updated MVD Candidate 2 Value: 32, Direction: +x axis TM Cost 3 Updated MVD Candidate 3 Value: 64, Direction: +x axis TM Cost 4 Updated MVD Candidate 4 Value: 128, Direction: +x axis TM Cost 5 Updated MVD candidate 5 Value: 256, Direction: +x axis TM Cost 6 Updated MVD Candidate 6 Value: 512, Direction: +x axis TM Cost 7 Updated MVD candidate 7

[0163] The first column in Table 4 shows multiple MVD candidates. Multiple MVD candidates (e.g., MVD candidates 0-7) have the same direction: positive x-axis. The magnitudes or distances of MVD candidates 0-7 are 4, 8, 16, 32, 64, 128, 256, and 512 luma samples, respectively. The TM costs of MVD candidates 0-7 are TM costs 0-7, respectively. The updated MVD candidates corresponding to MVD candidates 0-7 are updated MVD candidates 0-7, respectively. The magnitude of the updated MVD candidate (e.g., updated MVD candidate 0) may be different from or the same as the magnitude of the corresponding MVD candidate (e.g., MVD candidate 0). The direction of the updated MVD candidate (e.g., updated MVD candidate 0) may be different from or the same as the direction of the corresponding MVD candidate (e.g., MVD candidate 0).

[0164] In the example, the TM costs in Table 4 are TM cost 3, TM cost 4, TM cost 6, TM cost 0, TM cost 1, TM cost 2, TM cost 7, and TM cost 5 in ascending order. TM cost 3 is the smallest of the TM costs. Table 5 shows the relationship of the MVD candidates, updated MVD candidates, and TM costs shown in Table 4. The rows in Table 5 are different from those in Table 4. In Table 5, the rows are reordered based on the TM cost.

[0165] Table 5 – Re-ranked MVD candidates and updated MVD candidates

[0166]

[0167]

[0168] The plurality of MVD candidates may be arranged (eg, reordered) based on the TM cost, for example, in ascending order of the TM cost. Table 6 shows the arranged (eg, reordered) MVD candidates based on the TM cost and the corresponding distance index.

[0169] Table 6 – Re-ranked MVD candidates

[0170] Distance Index MVD Candidate 0 Value: 32, Direction: +x axis 1 Value: 64, Direction: +x axis 2 Value: 256, Direction: +x axis 3 Value: 4, Direction: +x axis 4 Value: 8, Direction: +x axis 5 Value: 16, Direction: +x axis 6 Value: 512, Direction: +x axis 7 Value: 128, Direction: +x axis

[0171] If the distance index is 0, the MVD candidate indicated by the distance index 0 is a candidate having a magnitude of 32 luma samples and a direction of the +x axis, such as the first candidate in Table 6. Based on the relationship of the plurality of MVD candidates, the TM cost, and the corresponding updated MVD candidates, such as indicated in Table 4 or Table 5, the updated MVD candidate corresponding to the MVD candidate (e.g., magnitude: 32, direction: +x axis) is derived as the updated MVD candidate 3. Accordingly, the TM-matched MVD is determined as the updated MVD candidate 3. Both the MVD candidate (e.g., magnitude: 32, direction: +x axis) and the updated MVD candidate 3 correspond to the TM cost 3.

[0172] In an embodiment, the distance index is not signaled. Direction information (e.g., direction index) and distance step information (e.g., indicating which distance set is used in MMVD mode) are signaled. The TM-matched MVD can be determined as an updated MVD candidate (e.g., updated MVD candidate 3) corresponding to the minimum TM cost (e.g., TM cost 3) among the TM costs of multiple MVD candidates. In the example, multiple MVD candidates along the resolved direction are arranged (e.g., reordered) based on the corresponding TM costs, as described above. Referring to Table 6, the distance index is not signaled. The minimum TM cost is TM cost 3. TM cost 3 corresponds to updated MVD candidate 3, so the TM-matched MVD is updated MVD candidate 3.

[0173] In an embodiment, multiple MVD candidates have the same distance (or magnitude). The distances of multiple MVD candidates can be parsed in MMVD mode. For example, the MVD information indicates the distances of multiple MVD candidates (e.g., by distance index). The directions of multiple MVD candidates can be determined based on a set of directions, such as shown in Table 2. In the example, the directions of multiple MVD candidates are the four directions shown in Table 2. The TM process can be applied to multiple MVD candidates to determine the corresponding TM cost and the corresponding updated MVD candidates. The search range of the TM process can be any suitable search range, such as within the [-L, L] range as described above. The search step size can be any suitable step size. Multiple MVD candidates can be arranged (e.g., reordered) based on the TM cost, such as sorted in ascending order of the TM cost. In the example, the MVD information indicates direction information, such as a direction index. In the example, the direction index is signaled. The MVD matched by the TM can be determined as an updated MVD candidate corresponding to the MVD candidate indicated by the direction index in the multiple reordered MVD candidates.

[0174] For example, the distance of the plurality of MVD candidates is 8 luma samples indicated by the distance index 5 pointing to the first distance set in Table 1. The number of the plurality of MVD candidates is 4. The directions of the plurality of MVD candidates are +x axis, -x axis, +y axis and -y axis, respectively, as shown in Table 2. Before TM, the relationship between the direction index and the corresponding direction is indicated by Table 2, for example, the direction index 00 corresponds to the direction of the +x axis. The TM process is applied to each of the plurality of MVD candidates to determine the TM cost and the corresponding updated MVD candidate, as shown in Table 7.

[0175] Table 7 - Exemplary relationship between multiple MVD candidates, TM costs and corresponding updated MVD candidates

[0176] MVD Candidate TM Cost Updated MVD candidates Value: 8, Direction: +x axis TM Cost A Updated MVD Candidate A Amount: 8, Direction: -x axis TM Cost B Updated MVD Candidate B Value: 8, Direction: +y axis TM cost C Updated MVD Candidate C Value: 8, Direction: -y axis TM Cost D Updated MVD candidate D

[0177] The first column in Table 7 shows multiple MVD candidates. Multiple MVD candidates (e.g., MVD candidates AD) have the same distance: 8 brightness samples. The directions of MVD candidates AD are +x axis, -x axis, +y axis and -y axis, respectively. The TM costs of MVD candidates AD are TM costs AD, respectively. The updated MVD candidates corresponding to MVD candidate AD are updated MVD candidates AD, respectively. The magnitude of the updated MVD candidate (e.g., updated MVD candidate A) may be different from or the same as the magnitude of the corresponding MVD candidate (e.g., MVD candidate A). The direction of the updated MVD candidate (e.g., updated MVD candidate A) may be different from or the same as the direction of the corresponding MVD candidate (e.g., MVD candidate A).

[0178] In the example, the TM costs in Table 7 are TM cost B, TM cost C, TM cost D, and TM cost A in ascending order. TM cost B is the smallest of the TM costs. Table 8 shows the relationship of the MVD candidates, updated MVD candidates, and TM costs shown in Table 7. The rows in Table 8 are different from those in Table 7. In Table 8, the rows are reordered based on the TM cost.

[0179] Table 8 – Re-ranked MVD candidates and updated MVD candidates

[0180] MVD Candidate TM Cost Updated MVD candidates Amount: 8, Direction: -x axis TM Cost B Updated MVD Candidate B Value: 8, Direction: +y axis TM cost C Updated MVD Candidate C Value: 8, Direction: -y axis TM Cost D Updated MVD candidate D Value: 8, Direction: +x axis TM Cost A Updated MVD Candidate A

[0181] The plurality of MVD candidates may be arranged (eg, reordered) based on the TM cost, for example, in ascending order of the TM cost. Table 9 shows MVD candidates arranged (eg, reordered) based on the TM cost and the corresponding distance index.

[0182] Table 9 – Re-ranked MVD candidates

[0183] Distance Index MVD Candidate 0 Amount: 8, Direction: -x axis 1 Value: 8, Direction: +y axis 2 Value: 8, Direction: -y axis 3 Value: 8, Direction: +x axis

[0184] If the direction index is 0, the MVD candidate indicated by the direction index 0 is a candidate having a magnitude of 8 luma samples and a direction of the -x axis, such as the first candidate in Table 9. Based on the relationship of the plurality of MVD candidates, the TM cost, and the corresponding updated MVD candidates, such as indicated in Table 7 or Table 8, the updated MVD candidate corresponding to the MVD candidate (e.g., magnitude: 8, direction: -x axis) is derived as an updated MVD candidate B. Accordingly, the TM-matched MVD is determined as the updated MVD candidate B. Both the MVD candidate (e.g., magnitude: 8, direction: -x axis) and the updated MVD candidate B correspond to the TM cost B.

[0185] In an embodiment, the direction index is not signaled. The TM-matched MVD may be determined as an updated MVD candidate (e.g., updated MVD candidate B) corresponding to the minimum TM cost (e.g., TM cost B) among the TM costs of the plurality of MVD candidates. In an example, a plurality of MVD candidates having the same distance are arranged (e.g., reordered) based on the corresponding TM costs, as described above. The minimum TM cost is TM cost B. TM cost B corresponds to the updated MVD candidate B, and thus the TM-matched MVD is the updated MVD candidate B.

[0186] Fig.14 A flowchart outlining the encoding process (1400) according to an embodiment of the present disclosure is shown. In various embodiments, the process (1400) is performed by a processing circuit, such as a processing circuit in a terminal device (310), (320), (330), and (340), a processing circuit that performs the functions of a video encoder (e.g., (403), (603), (703), etc. In some embodiments, the process (1400) is implemented in software instructions, so when the processing circuit executes the software instructions, the processing circuit performs the process (1400). The process starts at (S1401) and proceeds to (S1410)

[0187] At (S1410), one or more motion vector difference (MVD) candidates of the current block may be determined using a merge mode with motion vector difference (MMVD). The MMVD mode and the template matching (TM) mode are used together to encode the current block.

[0188] At (S1420), an MVD of the current block may be determined by applying the TM to one or more MVD candidates.

[0189] In an embodiment, the one or more MVD candidates are one MVD candidate. As described in the present disclosure, the MVD may be determined by applying a TM to one MVD candidate.

[0190] In an embodiment, one or more MVD candidates include multiple MVD candidates having the same direction. The multiple MVD candidates may have multiple distances, respectively. In an example, the multiple MVD candidates are sorted based on the multiple distances. A TM may be applied to each of the multiple MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. The MVD may be determined based on the TM cost and the corresponding updated MVD candidate.

[0191] In an example, the plurality of MVD candidates are arranged (eg, reordered) according to their TM costs, and the MVD is determined as an updated MVD candidate based on the corresponding TM cost.

[0192] In an example, the MVD is determined to be an updated MVD candidate corresponding to a minimum TM cost among TM costs of a plurality of MVD candidates.

[0193] In an embodiment, one or more MVD candidates include multiple MVD candidates with the same magnitude. Multiple MVD candidates may have multiple directions respectively. In an example, multiple MVD candidates are sorted according to multiple directions. TM may be applied to each of the multiple MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. MVD may be determined based on the TM cost and the corresponding updated MVD candidate.

[0194] In an example, the MVD is determined to be an updated MVD candidate corresponding to a minimum TM cost among TM costs of a plurality of MVD candidates.

[0195] At (S1430), the current block may be encoded based on a motion vector (MV) which is a sum of a motion vector predictor (MVP) and the determined MVD.

[0196] At (S1440), prediction information of the current block may be encoded in a bitstream. The prediction information may indicate that the MMVD and TM modes are applied together to the current block. The prediction information may indicate MVD information of the current block.

[0197] In an example, the encoded current block and the encoded prediction information are transmitted in a bitstream.

[0198] The process (1400) proceeds to (S1499) and ends.

[0199] The process (1400) may be appropriately adapted to various scenarios, and the steps in the process (1400) may be adjusted accordingly. One or more steps in the process (1400) may be adjusted, omitted, repeated, and / or combined. The process (1400) may be implemented in any suitable order. One or more other steps may be added.

[0200] In an example, a TM flag is encoded, indicating that TM is enabled for the current block. The encoded bitstream may include the TM flag.

[0201] In an embodiment, the multiple distances are a set of distances described in Tables 1 and 3 or a subset of the set of distances described in Tables 1 and 3. The values ​​of the multiple distances and the values ​​of the distance set can be based on the search range of the TM. In an example, the search range of the TM is within the range of [-L, +L] in the horizontal and vertical directions, where L is a positive integer. The minimum distance among the multiple distances is equal to L or L / 2. In an example, the multiple distances are in an arithmetic progression.

[0202] In the embodiment described in (S1420), multiple MVD candidates may have the same direction or the same magnitude. In some examples, multiple MVD candidates may have different directions and different magnitudes. TM may be applied to each of the multiple MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. The MVD may be determined based on the TM cost and the corresponding updated MVD candidate. In an embodiment, the updated MVD candidates are arranged based on the corresponding TM costs. In an example, the MVD is determined as the updated MVD candidate corresponding to the minimum TM cost among the TM costs of the multiple MVD candidates.

[0203] As described above, the MVD may be determined based on the TM cost and the corresponding updated MVD candidate. In an example, multiple MVD candidates are arranged (e.g., reordered) according to their TM costs. The MVD is determined as an updated MVD candidate based on the corresponding TM cost. An index (e.g., a distance index or a direction index) may be encoded in the bitstream to indicate an MVD candidate corresponding to the updated MVD candidate, which is the determined MVD.

[0204] Fig.15 A flowchart outlining a decoding process (1500) according to an embodiment of the present disclosure is shown. In various embodiments, the process (1500) is performed by a processing circuit, such as a processing circuit in a terminal device (310), (320), (330) and (340), a processing circuit that performs the functions of a video encoder (403), a processing circuit that performs the functions of a video decoder (410), a processing circuit that performs the functions of a video decoder (510), a processing circuit that performs the functions of a video encoder (603), and the like. In some embodiments, the process (1500) is implemented in software instructions, so when the processing circuit executes the software instructions, the processing circuit performs the process (1500). The process starts at (S1501) and proceeds to (S1510).

[0205] At (S1510), prediction information of a current block in an encoded bitstream may be decoded. The prediction information may indicate that a merge mode with motion vector difference (MMVD) using a template matching (TM) mode is applied to the current block. The prediction information may indicate a motion vector difference (MVD) of the current block.

[0206] In an example, the encoded bitstream further includes a TM flag indicating that TM is enabled for the current block.

[0207] At (S1520), one or more MVD candidates may be determined based on the MVD information.

[0208] At (S1530), the MVD of the current block (e.g., the TM-matched MVD) may be determined by applying the TM to one or more MVD candidates. In an embodiment, the TM is performed to search for a matching MVD between a current template of the current block and a reference template of a reference block of the current block based on the one or more MVD candidates. In the example, the one or more MVD candidates are one MVD candidate, and the TM is performed to search for a matching MVD around the one MVD candidate. In the example, the one or more MVD candidates include a plurality of MVD candidates, and the TM is performed to search for a matching MVD among the plurality of MVD candidates. In the example, the TM is performed to search for a matching MVD around each of the plurality of MVD candidates.

[0209] In an embodiment, one or more MVD candidates are one MVD candidate. The MVD information includes distance information indicating the magnitude of the one MVD candidate and direction information indicating the direction of the one MVD candidate. Using the MMVD mode, the one MVD candidate is determined based on the magnitude of the one MVD candidate and the direction of the one MVD candidate. As described in the present disclosure, the MVD can be determined by applying a TM to the one MVD candidate. For example, the matching MVD can be determined by performing a TM around the one MVD candidate.

[0210] In an embodiment, one or more MVD candidates include multiple MVD candidates having the same direction. The MVD information includes direction information indicating the directions of the multiple MVD candidates. The multiple MVD candidates can be determined based on the directions of the multiple MVD candidates and multiple distances. In an example, the multiple MVD candidates are sorted based on the multiple distances. A TM can be applied to each of the multiple MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. A matching MVD can be determined based on the TM cost and the corresponding updated MVD candidate.

[0211] In an example, the MVD information includes a distance index. The multiple MVD candidates may be arranged (eg, reordered) according to their TM costs. The matching MVD may be determined as an updated MVD candidate corresponding to the MVD candidate indicated by the distance index in the multiple reordered MVD candidates.

[0212] In an example, the distance index is not signaled.The matching MVD is determined as an updated MVD candidate corresponding to a minimum TM cost among the TM costs of the plurality of MVD candidates.

[0213] In an embodiment, one or more MVD candidates include multiple MVD candidates with the same magnitude. The MVD information includes distance information indicating the magnitudes of the multiple MVD candidates. The multiple MVD candidates can be determined based on the magnitudes of the multiple MVD candidates and multiple directions. In an example, the multiple MVD candidates are sorted according to the multiple directions. A TM can be applied to each of the multiple MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. A matching MVD can be determined based on the TM cost and the corresponding updated MVD candidate.

[0214] In an example, the MVD information includes a direction index. The plurality of MVD candidates may be reordered according to their TM costs. The matching MVD may be determined as an updated MVD candidate corresponding to the MVD candidate indicated by the direction index in the plurality of reordered MVD candidates.

[0215] In an example, the direction index is not signaled.The matching MVD is determined as an updated MVD candidate corresponding to a minimum TM cost among the TM costs of the plurality of MVD candidates.

[0216] Alternatively, when one or more MVD candidates include multiple MVD candidates, TM can be applied to the multiple MVD candidates to obtain corresponding TM costs. For example, TM is performed in multiple MVD candidates. A matching MVD can be determined based on the TM cost and the corresponding MVD candidate. In the example, the matching MVD is determined as the MVD candidate indicated by the distance index in the multiple reordered MVD candidates. In the example, the distance index is not signaled, and the matching MVD is determined as the MVD candidate corresponding to the minimum TM cost among the TM costs of the multiple MVD candidates.

[0217] At (S1540), the current block may be reconstructed based on a motion vector (MV) which is a sum of a motion vector predictor (MVP) and a determined MVD (eg, a matched MVD).

[0218] The process (1500) proceeds to (S1599) and ends.

[0219] The process (1500) may be appropriately adapted to various scenarios, and the steps in the process (1500) may be adjusted accordingly. One or more steps in the process (1500) may be adjusted, omitted, repeated, and / or combined. The process (1500) may be implemented in any suitable order. One or more other steps may be added.

[0220] In an embodiment, the distance information includes a distance index pointing to a distance in a plurality of distances. For example, the plurality of distances is a distance set described in Table 1 and Table 3 or a subset of the distance set described in Table 1 and Table 3. The distance is a magnitude of an MVD candidate. The values ​​of the plurality of distances may be based on a search range of the TM. In the example, the search range of the TM is within the range of [-L, +L] in the horizontal and vertical directions, where L is a positive integer. The minimum distance in the plurality of distances is equal to L or L / 2. In the example, the plurality of distances are in an arithmetic progression.

[0221] In the embodiment described in (S1530), multiple MVD candidates may have the same direction or the same magnitude. In some examples, multiple MVD candidates may have different directions and different magnitudes. In the example, the MMVD mode is used, for example, to determine multiple MVD candidates based on MVD information. TM can be applied to each of the multiple MVD candidates to obtain a TM cost and a corresponding updated MVD candidate. The matching MVD can be determined based on the TM cost and the corresponding updated MVD candidate. In an embodiment, the updated MVD candidates are arranged based on the corresponding TM cost. In the example, an index is signaled, and the matching MVD is determined as an updated MVD candidate corresponding to the MVD candidate indicated by the index in the multiple arranged (e.g., reordered) MVD candidates. In the example, the matching MVD is determined as an updated MVD candidate corresponding to the minimum TM cost among the TM costs of the multiple MVD candidates.

[0222] The embodiments of the present disclosure may be used alone or in any combination in any order. In addition, each of the method (or embodiment), encoder, and decoder may be implemented by a processing circuit (e.g., one or more processors or one or more integrated circuits). In one example, the one or more processors execute a program stored in a non-volatile computer-readable medium.

[0223] The above techniques may be implemented as computer software via computer-readable instructions and physically stored in one or more computer-readable media. Fig.16 A computer system (1600) is shown that is suitable for implementing certain embodiments of the disclosed subject matter.

[0224] The computer software may be encoded in any suitable machine code or computer language, and may be assembled, compiled, linked, or the like to create a code comprising instructions, which may be directly executed by one or more computer central processing units (CPUs), graphics processing units (GPUs), etc., or executed by decoding, microcode, or the like.

[0225] The instructions may be executed on various types of computers or components thereof, including, for example, personal computers, tablets, servers, smartphones, gaming devices, IoT devices, etc.

[0226] Fig.16 The components shown for the computer system (1600) are exemplary in nature and are not intended to impose any limitations on the scope of use or functionality of computer software implementing the disclosed embodiments. Nor should the configuration of the components be interpreted as having any dependency or requirement on any one or combination of components shown in the exemplary embodiment of the computer system (1600).

[0227] The computer system (1600) may include certain human-computer interface input devices. Such human-computer interface input devices may respond to input from one or more human users through tactile input (e.g., keyboard input, sliding, data glove movement), audio input (e.g., sound, applause), visual input (e.g., gestures), and olfactory input (not shown). The human-computer interface devices may also be used to capture certain media that are not necessarily directly related to human conscious input, such as audio (e.g., speech, music, ambient sound), images (e.g., scanned images, photographic images obtained from a still image camera), and videos (e.g., two-dimensional video, three-dimensional video including stereoscopic video).

[0228] The human-computer interface input device may include one or more of the following (only one of which is drawn): keyboard (1601), mouse (1602), touchpad (1603), touch screen (1610), data gloves (not shown), joystick (1605), microphone (1606), scanner (1607), camera (1608).

[0229] The computer system (1600) may also include certain human-computer interface output devices. Such human-computer interface output devices may stimulate one or more human user senses through, for example, tactile output, sound, light, and smell / taste. Such human-computer interface output devices may include tactile output devices (e.g., tactile feedback through a touch screen (1610), a data glove (not shown), or a joystick (1605), but there may also be tactile feedback devices that are not used as input devices), audio output devices (e.g., speakers (1609), headphones (not shown)), visual output devices (e.g., screens (1610) including cathode ray tube screens, liquid crystal screens, plasma screens, organic light emitting diode screens, each of which has or does not have a touch screen input function, each of which has or does not have a tactile feedback function - some of which can output two-dimensional visual output or output of more than three dimensions through means such as stereoscopic picture output; virtual reality glasses (not shown), holographic displays, and smoke boxes (not shown)) and printers (not shown).

[0230] The computer system (1600) may also include human-accessible storage devices and their associated media, such as optical media including high-density read-only / rewritable optical disks (CD / DVD ROM / RW) (1620) with CD / DVD or similar media (1621), thumb drives (1622), removable hard disk drives or solid state drives (1623), traditional magnetic media such as tapes and floppy disks (not shown), special-purpose ROM / ASIC / PLD-based devices such as security software protectors (not shown), and the like.

[0231] Those skilled in the art should also understand that the term "computer-readable media" used in connection with the disclosed subject matter does not include transmission media, carrier waves, or other transient signals.

[0232] The computer system (1600) may also include an interface (1654) to one or more communication networks (1655). For example, the network may be wireless, wired, or optical. The network may also be a local area network, a wide area network, a metropolitan area network, an in-vehicle network, an industrial network, a real-time network, a delay-tolerant network, and the like. The network also includes local area networks such as Ethernet, wireless local area networks, cellular networks (GSM, 3G, 4G, 5G, LTE, etc.), television wired or wireless wide area digital networks (including cable television, satellite television, and terrestrial broadcast television), in-vehicle and industrial networks (including CANBus), and the like. Some networks typically require an external network interface adapter for connecting to some universal data port or peripheral bus (1649) (e.g., a USB port of the computer system (1600)); other systems are typically integrated into the core of the computer system (1600) by connecting to a system bus as described below (e.g., an Ethernet interface integrated into a PC computer system or a cellular network interface integrated into a smart phone computer system). By using any of these networks, the computer system (1600) can communicate with other entities. The communication can be one-way, for receiving only (e.g., wireless television), one-way for sending only (e.g., CAN bus to certain CAN bus devices), or two-way, such as to other computer systems via a local or wide area digital network. Each of the above networks and network interfaces can use certain protocols and protocol stacks.

[0233] The above-mentioned human-machine interface devices, human-accessible storage devices, and network interfaces may be connected to the core (1640) of the computer system (1600).

[0234] The core (1640) may include one or more central processing units (CPUs) (1641), graphics processing units (GPUs) (1642), dedicated programmable processing units in the form of field programmable gate arrays (FPGAs) (1643), hardware accelerators for specific tasks (1644), graphics adapters (1650), etc. These devices, as well as read-only memory (ROM) (1645), random access memory (1646), internal mass storage (e.g., internal non-user accessible hard disk drives, solid-state drives, etc.) (1647), etc., may be connected via a system bus (1648). In some computer systems, the system bus (1648) may be accessed in the form of one or more physical plugs so that it may be expanded by additional central processing units, graphics processing units, etc. Peripheral devices may be directly attached to the core's system bus (1648), or connected via a peripheral bus (1649). In an example, a screen (1610) may be connected to a graphics adapter (1650). The architecture of the peripheral bus includes a peripheral controller interface PCI, a universal serial bus USB, etc.

[0235] The CPU (1641), GPU (1642), FPGA (1643) and accelerator (1644) can execute certain instructions, which can be combined to form the above-mentioned computer code. The computer code can be stored in ROM (1645) or RAM (1646). Transition data can also be stored in RAM (1646), while permanent data can be stored in, for example, internal mass storage (1647). Fast storage and retrieval of any memory device can be achieved by using a cache memory, which can be closely associated with one or more CPUs (1641), GPUs (1642), mass storage (1647), ROM (1645), RAM (1646), etc.

[0236] The computer readable medium may have computer code thereon for performing various computer-implemented operations. The medium and computer code may be specially designed and constructed for the purposes of the present disclosure, or may be the medium and code well known and available to those skilled in the art of computer software.

[0237] As an example and not a limitation, a computer system (1600) having an architecture, in particular a core (1640), can be provided as a processor (including a CPU, a GPU, an FPGA, an accelerator, etc.) to execute software contained in one or more tangible computer-readable media. Such a computer-readable medium can be a medium associated with the above-mentioned user-accessible mass storage, as well as a specific memory of the core (1640) having non-volatility, such as a core internal mass storage (1647) or a ROM (1645). Software implementing various embodiments of the present disclosure can be stored in such a device and executed by the core (1640). Depending on specific needs, the computer-readable medium may include one or more storage devices or chips. The software can enable the core (1640), in particular the processor therein (including a CPU, a GPU, an FPGA, etc.) to perform a specific process or a specific part of a specific process described herein, including defining a data structure stored in the RAM (1646) and modifying such a data structure according to a software-defined process. Additionally or alternatively, the computer system may provide functionality hardwired in logic or otherwise contained in circuitry (e.g., accelerator (1644)) that may operate in place of or in conjunction with software to perform specific processes or specific portions of specific processes described herein. Where appropriate, references to software may include logic and vice versa. Where appropriate, references to computer-readable media may include circuitry (e.g., integrated circuits (ICs)) storing executing software, circuitry containing executing logic, or both. The present disclosure includes any suitable combination of hardware and software.

[0238] Appendix A: Acronyms

[0239] JEM: Joint Exploration Model

[0240] VVC: universal video coding

[0241] BMS: Benchmark Set

[0242] MV: Motion Vector

[0243] HEVC: High Efficiency Video Coding

[0244] SEI: Supplementary Enhancement Information

[0245] VUI: Video Usability Information

[0246] GOPs: Groups of Pictures

[0247] TUs: Transform Units

[0248] PUs: Prediction Units

[0249] CTUs: Coding Tree Units

[0250] CTBs: Coding Tree Blocks

[0251] PBs: Prediction Blocks

[0252] HRD: Hypothetical Reference Decoder

[0253] SNR: Signal Noise Ratio

[0254] CPUs: Central Processing Units

[0255] GPUs: Graphics Processing Units

[0256] CRT: Cathode Ray Tube

[0257] LCD: Liquid-Crystal Display

[0258] OLED: Organic Light-Emitting Diode

[0259] CD: Compact Disc

[0260] DVD: Digital Video Disc

[0261] ROM: Read-Only Memory

[0262] RAM: Random Access Memory

[0263] ASIC: Application-Specific Integrated Circuit

[0264] PLD: Programmable Logic Device

[0265] LAN: Local Area Network

[0266] GSM: Global System for Mobile communications

[0267] LTE: Long-Term Evolution

[0268] CANBus: Controller Area Network Bus

[0269] USB: Universal Serial Bus

[0270] PCI: Peripheral Component Interconnect

[0271] FPGA: Field Programmable Gate Areas

[0272] SSD: solid-state drive

[0273] IC:Integrated Circuit

[0274] CU: Coding Unit

[0275] Although the present disclosure has described a number of exemplary embodiments, various changes, arrangements and various equivalent substitutions of the embodiments are within the scope of the present disclosure. It should therefore be understood that those skilled in the art are capable of designing a variety of systems and methods, which, although not explicitly shown or described herein, embody the principles of the present disclosure and are therefore within the spirit and scope of the present disclosure.

Claims

1. A video decoding method, characterized in that: include: Decoding prediction information of a current block in an encoded bitstream, the prediction information indicating a merge mode (MMVD) with motion vector difference using a template matching (TM) mode and motion vector difference (MVD) information of the current block; Determine one or more MVD candidates using an MMVD mode based on the MVD information and a preset first plurality of distances in units of luma samples; performing TM to search for a matching MVD between a current template of the current block and a reference template of a reference block of the current block based on the one or more MVD candidates determined using an MMVD mode; as well as Reconstructing the current block based on a motion vector MV, wherein the motion vector is a sum of a motion vector prediction value MVP and the matched MVD; wherein a first plurality of distances used in the MMVD mode to determine the one or more MVD candidates when the TM is enabled is different from a second plurality of distances used in the MMVD mode when the TM is not enabled; in, The one or more MVD candidates are one MVD candidate; The MVD information includes distance information indicating a magnitude of the one MVD candidate as one of the first plurality of distances and direction information indicating a direction of the one MVD candidate; The determining one or more MVD candidates comprises: determining the one MVD candidate based on a magnitude of the one MVD candidate and a direction of the one MVD candidate; or, The one or more MVD candidates include a plurality of MVD candidates having the same direction; The MVD information includes direction information indicating directions of the plurality of MVD candidates; The determining one or more MVD candidates comprises: determining the multiple MVD candidates based on the directions of the multiple MVD candidates and the first multiple distances, and sorting the multiple MVD candidates based on the first multiple distances; or, The one or more MVD candidates include a plurality of MVD candidates having the same magnitude; The MVD information includes distance information indicating that the magnitude of the plurality of MVD candidates is one of the first plurality of distances; The determining one or more MVD candidates includes: determining the multiple MVD candidates based on magnitudes of the multiple MVD candidates and multiple directions, and sorting the multiple MVD candidates according to the multiple directions.

2. The method according to claim 1, characterized in that In a case where the one or more MVD candidates are one MVD candidate, the performing the TM includes: performing the TM around the one MVD candidate.

3. The method according to claim 2, characterized in that The encoded bit stream further includes a TM flag; The TM flag indicates that the TM is enabled for the current block.

4. The method according to claim 3, characterized in that The distance information includes a distance index pointing to a distance in the first plurality of distances, the distance being a magnitude of the one MVD candidate; The first plurality of distances are based on a search range of the TM.

5. The method according to claim 4, characterized in that The search range of the TM is within the range of [-L, +L] in the horizontal and vertical directions, where L is a positive integer; and The minimum distance among the first plurality of distances is equal to L or L / 2.

6. The method according to claim 3, characterized in that The distance information includes a distance index pointing to a distance in the first plurality of distances, the distance being a magnitude of the one MVD candidate; The first plurality of distances are in an arithmetic progression.

7. The method according to claim 1, characterized in that In a case where the one or more MVD candidates include multiple MVD candidates having the same direction, performing TM includes: For each MVD candidate of the plurality of MVD candidates, applying the TM to the corresponding MVD candidate to obtain a TM cost and a corresponding updated MVD candidate corresponding to the corresponding MVD candidate; and The matching MVD is determined based on the TM cost and the corresponding updated MVD candidate.

8. The method according to claim 7, characterized in that The MVD information includes a distance index; The execution of TM includes: reordering the plurality of MVD candidates according to their TM costs; and The matched MVD is determined as the updated MVD candidate corresponding to the MVD candidate indicated by the distance index among the plurality of reordered MVD candidates.

9. The method according to claim 7, characterized in that: The execution of TM includes: The matched MVD is determined as the updated MVD candidate corresponding to a minimum TM cost among the TM costs of the plurality of MVD candidates.

10. The method according to claim 1, characterized in that In a case where the one or more MVD candidates include a plurality of MVD candidates having the same magnitude, performing TM includes: For each MVD candidate of the plurality of MVD candidates, applying the TM to the corresponding MVD candidate to obtain a TM cost and a corresponding updated MVD candidate corresponding to the corresponding MVD candidate; and The matching MVD is determined based on the TM cost and the corresponding updated MVD candidate.

11. The method according to claim 10, characterized in that The MVD information includes a direction index; The execution of TM includes: reordering the plurality of MVD candidates according to their TM costs; and The matched MVD is determined as the updated MVD candidate corresponding to the MVD candidate indicated by the direction index among the plurality of reordered MVD candidates.

12. The method according to claim 10, characterized in that The execution of TM includes: The matched MVD is determined as the updated MVD candidate corresponding to the minimum TM cost among the TM costs of the plurality of MVD candidates.

13. A video encoding method, characterized in that: include: Based on a preset first plurality of distances in units of luma samples, determine one or more motion vector difference (MVD) candidates of a current block using a merge mode (MMVD) with a motion vector difference, wherein the MMVD mode and a template matching (TM) mode are used together to encode the current block; determining an MVD for the current block by applying TM to the one or more MVD candidates determined using MMVD; Encoding the current block based on a motion vector MV, wherein the motion vector is a sum of a motion vector prediction value MVP and the determined MVD; as well as encoding prediction information of the current block in a bitstream, the prediction information indicating that the MMVD and TM modes are applied together to the current block, the prediction information indicating MVD information of the current block; wherein a first plurality of distances used in the MMVD mode to determine the one or more MVD candidates when the TM is enabled is different from a second plurality of distances used in the MMVD mode when the TM is not enabled; in, The one or more MVD candidates are one MVD candidate; The MVD information includes distance information indicating a magnitude of the one MVD candidate as one of the first plurality of distances and direction information indicating a direction of the one MVD candidate; The determining one or more MVD candidates comprises: determining the one MVD candidate based on a magnitude of the one MVD candidate and a direction of the one MVD candidate; or, The one or more MVD candidates include a plurality of MVD candidates having the same direction; The MVD information includes direction information indicating directions of the plurality of MVD candidates; The determining one or more MVD candidates comprises: determining the multiple MVD candidates based on the directions of the multiple MVD candidates and the first multiple distances, and sorting the multiple MVD candidates based on the first multiple distances; or, The one or more MVD candidates include a plurality of MVD candidates having the same magnitude; The MVD information includes distance information indicating that the magnitude of the plurality of MVD candidates is one of the first plurality of distances; The determining one or more MVD candidates includes: determining the multiple MVD candidates based on magnitudes of the multiple MVD candidates and multiple directions, and sorting the multiple MVD candidates according to the multiple directions.

14. A video decoding device, characterized in that: include: A processing circuit configured to execute the method according to any one of claims 1 to 12.

15. A video decoding device, characterized in that: include: A decoding module, configured to decode prediction information of a current block in an encoded bit stream, wherein the prediction information indicates a merge mode MMVD with a motion vector difference using a template matching TM mode and motion vector difference MVD information of the current block; A determination module, configured to determine one or more MVD candidates using an MMVD mode based on the MVD information and a preset first plurality of distances in units of luminance samples; an execution module, configured to execute the TM to search for a matching MVD between a current template of the current block and a reference template of a reference block of the current block based on the one or more MVD candidates determined using the MMVD mode; as well as A reconstruction module, configured to reconstruct the current block based on a motion vector MV, wherein the motion vector is a sum of a motion vector prediction value MVP and the matched MVD; wherein a first plurality of distances used in the MMVD mode to determine the one or more MVD candidates when the TM is enabled is different from a second plurality of distances used in the MMVD mode when the TM is not enabled; in, The one or more MVD candidates are one MVD candidate; The MVD information includes distance information indicating a magnitude of the one MVD candidate as one of the first plurality of distances and direction information indicating a direction of the one MVD candidate; The determination module is used to: determine the one MVD candidate based on the magnitude of the one MVD candidate and the direction of the one MVD candidate; or, The one or more MVD candidates include a plurality of MVD candidates having the same direction; The MVD information includes direction information indicating directions of the plurality of MVD candidates; The determination module is used to: determine the multiple MVD candidates based on the directions of the multiple MVD candidates and the first multiple distances, and sort the multiple MVD candidates based on the first multiple distances; or, The one or more MVD candidates include a plurality of MVD candidates having the same magnitude; The MVD information includes distance information indicating that the magnitude of the plurality of MVD candidates is one of the first plurality of distances; The determination module is used to determine the multiple MVD candidates based on the magnitudes of the multiple MVD candidates and multiple directions, and sort the multiple MVD candidates according to the multiple directions.

16. The device according to claim 15, characterized in that When the one or more MVD candidates are one MVD candidate, the execution module is configured to execute the TM around the one MVD candidate.

17. The device according to claim 16, characterized in that The encoded bit stream further includes a TM flag; The TM flag indicates that the TM is enabled for the current block.

18. The device according to claim 15, characterized in that In the case where the one or more MVD candidates include multiple MVD candidates having the same direction, the execution module is used to: for each of the multiple MVD candidates, apply the TM to the corresponding MVD candidate to obtain a TM cost and a corresponding updated MVD candidate corresponding to the corresponding MVD candidate; and determine the matching MVD based on the TM cost and the corresponding updated MVD candidate.

19. The device according to claim 18, characterized in that The MVD information includes a distance index; The determination module is configured to reorder the plurality of MVD candidates according to their TM costs; and determine the matched MVD as the updated MVD candidate corresponding to the MVD candidate indicated by the distance index in the plurality of reordered MVD candidates.

20. The device according to claim 15, characterized in that In the case where the one or more MVD candidates include multiple MVD candidates with the same magnitude, the execution module is used to: for each of the multiple MVD candidates, apply the TM to the corresponding MVD candidate to obtain a TM cost and a corresponding updated MVD candidate corresponding to the corresponding MVD candidate; and determine the matching MVD based on the TM cost and the corresponding updated MVD candidate.

21. The device according to claim 20, characterized in that The MVD information includes a direction index; The determination module is used for reordering the multiple MVD candidates according to the TM costs of the multiple MVD candidates; and determining the matching MVD as the updated MVD candidate corresponding to the MVD candidate indicated by the direction index in the multiple reordered MVD candidates.

22. A video encoding device, characterized in that: include: A first determination module, configured to determine one or more motion vector difference MVD candidates of a current block based on a preset first plurality of distances in units of luma samples using a merge mode MMVD with motion vector differences, wherein the MMVD mode and a template matching TM mode are used together to encode the current block; a second determination module, configured to determine the MVD of the current block by applying TM to the one or more MVD candidates determined using the MMVD mode; A first encoding module, configured to encode the current block based on a motion vector MV, wherein the motion vector is a sum of a motion vector prediction value MVP and the determined MVD; as well as a second encoding module, configured to encode prediction information of the current block in a bitstream, the prediction information indicating that the MMVD and TM modes are applied together to the current block, the prediction information indicating MVD information of the current block; wherein a first plurality of distances used in the MMVD mode to determine the one or more MVD candidates when the TM is enabled is different from a second plurality of distances used in the MMVD mode when the TM is not enabled; in, The one or more MVD candidates are one MVD candidate; The MVD information includes distance information indicating a magnitude of the one MVD candidate as one of the first plurality of distances and direction information indicating a direction of the one MVD candidate; The first determination module is used to: determine the one MVD candidate based on the magnitude of the one MVD candidate and the direction of the one MVD candidate; or, The one or more MVD candidates include a plurality of MVD candidates having the same direction; The MVD information includes direction information indicating directions of the plurality of MVD candidates; The first determination module is used to: determine the multiple MVD candidates based on the directions of the multiple MVD candidates and the first multiple distances, and sort the multiple MVD candidates based on the first multiple distances; or, The one or more MVD candidates include a plurality of MVD candidates having the same magnitude; The MVD information includes distance information indicating that the magnitude of the plurality of MVD candidates is one of the first plurality of distances; The first determination module is used to determine the multiple MVD candidates based on the magnitudes of the multiple MVD candidates and multiple directions, and sort the multiple MVD candidates according to the multiple directions.

23. A computer device comprising at least one memory and at least one processor, wherein the at least one memory is used to store computer instructions, and when the computer instructions are loaded and executed by the at least one processor, the at least one processor executes the method according to any one of claims 1 to 13.

24. A non-volatile computer-readable storage medium storing a program executable by at least one processor to perform the method of any one of claims 1 to 13.

25. A method for processing a video code stream, characterized in that: A video code stream is stored on a non-volatile computer-readable medium, wherein the video code stream is decoded according to the video decoding method according to any one of claims 1 to 12, or is generated based on the video encoding method according to claim 13.