Partitioning, template matching motion vector (MV) derivation, and sub-block MV derivation for sub-block-based MV predictor

The sub-block-based temporal motion vector prediction mode addresses inefficiencies in existing video coding by optimizing motion vector prediction, leading to improved compression ratios and reduced redundancy.

JP2025525266APending Publication Date: 2025-08-05TENCENT AMERICA LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024539540
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-11-10
Filing Date
2022-11-11
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in efficiently reducing redundancy and improving compression ratios, particularly in intra-prediction and motion vector prediction, due to the varying likelihood of direction angles and the need for efficient representation of less likely directions.

Method used

The implementation of sub-block-based temporal motion vector prediction (SbTMVP) mode, which involves determining a first co-located block and reference template based on motion information, and calculating a template matching cost to optimize motion vector prediction.

Benefits of technology

Enhances video coding efficiency by reducing redundancy and improving compression ratios through optimized motion vector prediction, especially in scenarios with complex motion patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025525266000001_ABST
    Figure 2025525266000001_ABST
Patent Text Reader

Abstract

Aspects of the present disclosure provide a method and an apparatus including a processing circuit. A current block in a current picture is decoded using a sub-block-based temporal motion vector prediction (SbTMVP) mode. A first co-located block in a first co-located picture is determined based on a first displacement vector candidate of the current block corresponding to a first SbTMVP candidate. The processing circuit determines first motion information of a current template of the current block based on one or more motion information of the first co-located block or a neighboring block of the first co-located block. The processing circuit determines one of a first reference template and a first sub-block reference template in the first reference picture based on the first motion information, and determines a first template matching cost based on the current template and one of the first reference template and the first sub-block reference template.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This disclosure describes embodiments that relate generally to video coding. [Background technology]

[0002] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims the benefit of priority to U.S. Patent Application No. 17 / 984,850, filed November 10, 2022, entitled "PARTITION, MOTION VECTOR (MV) DERIVATION OF TEMPLATE-MATCHING, AND SUBBLOCK MV DERIVATION FOR SUBBLOCK-BASED MV PREDICTOR," which in turn claims the benefit of priority to U.S. Provisional Application No. 63 / 388,109, filed July 11, 2022, entitled "Partition and Motion Vector Derivation of Template-Matching and Subblock MV Derivation from Multiple Collocated Reference Frames for Subblock Based Motion Vector Predictor." The disclosures of the prior applications are incorporated herein by reference in their entireties.

[0003] The discussion of the background art provided herein is intended to generally present the context for the present disclosure, and the inventors' work, to the extent described in this background art section, as well as aspects of the description that are not admitted as prior art at the time of filing, are not admitted, expressly or impliedly, as prior art to the present disclosure.

[0004] Uncompressed digital images and / or video can include a series of pictures, each having spatial dimensions of, for example, 1920 x 1080 luma samples and associated chrominance samples. The series of pictures can have a fixed or variable picture rate (informally known as a frame rate) of, for example, 60 pictures per second, or 60 Hz. Uncompressed images and / or video have specific bitrate requirements. For example, 1080p60 4:2:0 video (1920 x 1080 luma sample resolution at a 60 Hz frame rate) with 8 bits per sample requires a bandwidth approaching 1.5 Gbit / s. One hour of such video requires more than 600 gigabytes of storage space.

[0005] One goal of image and / or video coding and decoding may be to reduce redundancy in the input image and / or video signal through compression. Compression can help reduce the aforementioned bandwidth and / or storage space requirements, in some cases by more than two orders of magnitude. While the description herein uses video encoding / decoding as an illustrative example, the same techniques may be applied to image encoding / decoding in a similar manner without departing from the spirit of this disclosure. Both lossless and lossy compression, as well as combinations thereof, may be used. Lossless compression refers to a technique that allows an exact copy of an original signal to be reconstructed from a compressed version of the original signal. When lossy compression is used, the reconstructed signal may not be identical to the original signal, but the distortion between the original and reconstructed signal is small enough to allow the reconstructed signal to be used for its intended purpose. For video, lossy compression is widely used. The amount of acceptable distortion depends on the application; for example, users of a consumer streaming application may tolerate higher distortion than users of a television distribution application. The achievable compression ratio may reflect the following: the higher the tolerable / acceptable distortion, the higher the compression ratio that can be obtained.

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

[0007] Video codec technology may include a technique known as intra-coding. In intra-coding, sample values are represented without reference to samples or other data from previously reconstructed reference pictures. In some video codecs, a picture is spatially subdivided into blocks of samples. When all blocks of samples are coded in intra mode, the picture may be an intra-picture. Intra-pictures and their derivatives, such as independent decoder refresh pictures, may be used to reset the decoder state and therefore may be used as the first picture in a coded video bitstream and video session or as a still image. Samples of intra-blocks may be subjected to a transform, and the transform coefficients may be quantized before entropy coding. Intra-prediction may be a technique that minimizes sample values in the pre-transform domain. In some cases, the smaller the DC value and AC coefficients after the transform, the fewer bits are required at a given quantization step size to represent the block after entropy coding.

[0008] For example, traditional intra-coding, used in MPEG-2 generation coding techniques, does not use intra-prediction. However, some newer video compression techniques include techniques that attempt to perform prediction based on surrounding sample data and / or metadata obtained during the coding and / or decoding of a block of data. Such techniques are hereinafter referred to as "intra-prediction" techniques. Note that, at least in some cases, intra-prediction uses only reference data from the current picture being reconstructed, not from a reference picture.

[0009] Intra-prediction can take many different forms. When two or more of such techniques can be used in a given video coding technique, the particular technique in use can be coded as a particular intra-prediction mode that uses that particular technique. In some cases, an intra-prediction mode can have sub-modes and / or parameters that can be coded individually or included in a mode codeword that defines the prediction mode being used. Which codeword to use for a given mode, sub-mode, and / or parameter combination can affect the coding efficiency gain through intra-prediction, as can the entropy coding technique used to convert the codeword into a bitstream.

[0010] A mode of intra prediction was introduced with H.264, improved in H.265, and further refined in newer coding techniques such as joint search model (JEM), generic video coding (VVC), and benchmark set (BMS). A predictor block may be formed using neighboring sample values of already available samples. The sample values of the neighboring samples are copied to the predictor block according to the direction. The reference for the direction in use may be coded in the bitstream or may itself be predicted.

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

[0012] 1A, a square block (104) of 4x4 samples (indicated by a thick dashed line) is shown at the top left. The square block (104) includes 16 samples, each 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 (from the top) in the Y dimension and the first sample (from the left) in the X dimension. Similarly, sample S44 is the fourth sample in the block (104) in both the Y and X dimensions. Because the block is 4x4 samples in size, S44 is located at the bottom right. Also shown are reference samples that follow a similar numbering scheme. The reference samples are labeled with R and their Y position (e.g., row index) and X position (column index) relative to the block (104). In both H.264 and H.265, the prediction samples are adjacent to the block being reconstructed, so negative values do not need to be used.

[0013] Intra-picture prediction can work by copying reference sample values from adjacent samples indicated by the signaled prediction direction. For example, assume that the coded video bitstream includes signaling indicating a prediction direction consistent with the arrow (102) for this block, i.e., the sample is predicted from the sample to the upper right at a 45-degree angle from the horizontal. In that case, samples S41, S32, S23, and S14 are predicted from the same reference sample R05. Sample S44 is then predicted from reference sample R08.

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

[0015] As video coding technology develops, the number of possible directions increases. 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 conducted to identify the most likely directions, and techniques in entropy coding are used to represent the most likely directions with a small number of bits while accepting a penalty for less likely directions. Furthermore, the direction itself can be predicted from neighboring directions used in neighboring, already decoded blocks.

[0016] FIG. 1B shows a schematic diagram (110) illustrating 65 intra-prediction directions with JEM to illustrate the increase in the number of prediction directions over time.

[0017] The mapping of intra-prediction direction bits representing directions in a coded video bitstream may vary from one video coding technique to another. Such mappings may range, for example, from simple direct mappings to complex adaptive schemes including codewords, maximum likelihood modes, and similar techniques. However, in most cases, there may be certain directions in video content that are statistically less likely to occur than other directions. Because the goal of video compression is to reduce redundancy, in well-performing video coding techniques, these less likely directions are represented by more bits than more likely directions.

[0018] Image and / or video coding and decoding may be performed using inter-picture prediction with motion compensation. Motion compensation may be a lossy compression technique and may refer to a technique in which blocks of sample data from a previously reconstructed picture or portion thereof (reference picture) are spatially shifted in a direction indicated by a motion vector (hereinafter, MV) and then used to predict a newly reconstructed picture or picture portion. 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 may have three dimensions, with the third dimension being an indication of the reference picture in use (the latter may indirectly be a temporal dimension).

[0019] In some video compression techniques, the MV applicable to an area of sample data can be predicted from other MVs, for example, from an MV for another area of sample data that is spatially adjacent to the area being reconstructed and that precedes the MV in decoding order. Doing so can substantially reduce the amount of data required to code the MV, thereby eliminating redundancy and increasing compression ratios. MV prediction can work effectively because, for example, when coding an input video signal obtained from a camera (known as natural video), there is a statistical possibility that areas larger than the area to which a single MV is applicable move in a similar direction and therefore, in some cases, can be predicted using similar motion vectors derived from MVs of neighboring areas. As a result, the MV found for a region will be similar or the same as the MV predicted from the surrounding MVs, and after entropy coding, can be represented with fewer bits than would be used to code the MV directly. In some cases, MV prediction can be an example of lossless compression of a signal (i.e., an MV) derived from the original signal (i.e., a sample stream). In other cases, the MV prediction itself may be lossy, for example due to rounding errors when computing the predictor from several surrounding MVs.

[0020] Various MV prediction mechanisms are described in H.265 / HEVC (ITU-T Rec. H.265, "High Efficiency Video Coding", December 2016). Among the many MV prediction mechanisms provided by H.265, one that will be described with reference to Figure 2 is a technique referred to below as "spatial merge".

[0021] Referring to Figure 2, a current block (201) comprises samples that the encoder discovered during the motion search process to be predictable from a spatially shifted previous block of the same size. Instead of directly coding its MV, the MV can be derived from metadata associated with one or more reference pictures, e.g., from the most recent reference picture (in decoding order) using MVs associated with any one of five surrounding samples denoted A0, A1, and B0, B1, B2 (202-206, respectively). In H.265, MV prediction can use predictors from the same reference picture as neighboring blocks. Summary of the Invention

[0022] Aspects of the present disclosure provide methods and apparatuses for video and / or image encoding / decoding. In some examples, the apparatus for video / image decoding includes a processing circuit. The processing circuit decodes prediction information for a current block in a current picture from an encoded video / image bitstream. The prediction information indicates a sub-block-based temporal motion vector prediction (SbTMVP) mode. The processing circuit determines a first co-located block in a first co-located picture based on a first displacement vector (DV) candidate for the current block. The first DV candidate corresponds to the first SbTMVP candidate. The processing circuit determines first motion information for a current template of the current block based on one or more portions of motion information of (i) the first co-located block or (ii) at least one neighboring block of the first co-located block. The processing circuit determines one of a first reference template and a first sub-block reference template associated with a first SbTMVP candidate in a first reference picture based on first motion information of the current template, and determines a first template matching (TM) cost based on the current template and one of the first reference template and the first sub-block reference template associated with the first SbTMVP candidate. The first reference template and the current template may have the same size. The size of the first sub-block reference template may be smaller than the size of the current template.

[0023] In one embodiment, the DV candidates for the current block include the first DV candidate. The processing circuit can perform the TM process as follows: For each DV candidate different from the first DV candidate, the processing circuit determines a co-located block in one of the at least one co-located picture based on the respective DV candidate for the current block. The at least one co-located picture includes the first co-located picture. The processing circuit determines motion information for a current template based on one or more motion information of (i) the co-located block associated with the respective DV candidate or (ii) at least one neighboring block of the co-located block associated with the respective DV candidate. The processing circuit determines one of a reference template and a sub-block reference template associated with the respective DV candidate in the first reference picture based on the motion information of the current template, and determines a TM cost based on the current template and one of the first reference template and the sub-block reference template associated with the respective DV candidate. The reference template associated with the respective DV candidate and the current template can have the same size. The size of the sub-block reference template can be smaller than the size of the current template. The processing circuit determines an SbTMVP candidate based on the TM costs, including the first TM cost. The processing circuit reconstructs the current block based on the determined SbTMVP candidate.

[0024] In one example, one of the first reference template and the first sub-block reference template is the first reference template. The processing circuit determines first motion information of the current template as motion information of the center position of the first co-location block, and determines a first reference template associated with the first DV candidate based on the motion information of the center position of the first co-location block.

[0025] In one embodiment, one of the first reference template and the first subblock reference template is the first subblock reference template. The current template includes a first subblock template and a second subblock template. The first motion information of the current template includes first motion information of the first subblock template and second motion information of the second subblock template that is different from the first motion information. The processing circuit determines the first motion information of the first subblock template from the first subblock and determines the second motion information of the second subblock template from the second subblock. The first subblock and the second subblock are (i) a first co-located block or (ii) different subblocks in at least one neighboring block of the first co-located block. The processing circuit determines the first subblock reference template based on the first motion information of the first subblock template. The processing circuit determines the second subblock reference template based on the second motion information of the second subblock template. The second sub-block reference template may be in one of the first reference picture and the second reference picture. The processing circuit determines a predictor template based on the first sub-block reference template, and determines a TM cost based on the second sub-block reference template and the current template and the predictor template.

[0026] In one embodiment, the processing circuit determines first motion information of the first sub-block template based on motion information of sub-blocks in the first co-located block, where the sub-blocks in the first co-located block are co-located with sub-blocks in the current block adjacent to the first sub-block template.

[0027] In one embodiment, the processing circuit determines first motion information of the first sub-block template based on motion information of sub-blocks in at least one neighboring block of the first co-located block, wherein the sub-blocks in the at least one neighboring block of the first co-located block are co-located with the first sub-block template.

[0028] In one embodiment, the first subblock template is bi-predicted and the second subblock template is uni-predicted. The first motion information of the first subblock template includes a motion vector (MV) pointing to the first subblock reference template in the first reference picture and another MV pointing to the first subblock reference template in the second reference picture. The second motion information of the second subblock template includes an MV pointing to the second subblock reference template in the first reference picture. The processing circuit determines a first predictor subblock template based on the first subblock reference template in the first reference picture and the first subblock reference template in the second reference picture. The processing circuit determines a second predictor subblock template based on the second subblock reference template in the first reference picture.

[0029] In one embodiment, the processing circuit determines the predictor template based on the first predictor sub-block template and the second predictor sub-block template.

[0030] In one embodiment, the processing circuit determines a first sub-TM cost based on the first sub-block template and the first predictor sub-block template, determines a second sub-TM cost based on the second sub-block template and the second predictor sub-block template, and determines a first TM cost based on the first sub-TM cost and the second sub-TM cost.

[0031] In one embodiment, the processing circuit determines the first TM cost based on the first sub-TM cost, the second sub-TM cost, and at least one of (i) a first bias factor that modifies the first sub-TM cost or (ii) a second bias factor that modifies the second sub-TM cost.

[0032] In one example, in response to the first subblock template being above the current block and the width of the first subblock template being a multiple of the width of a subblock in the first co-located block, the processing circuit determines first motion information of the first subblock template based on motion information of a subblock in the top row of the first co-located block or a subblock above the first co-located block. In response to the first subblock template being a left neighboring block of the current block and the height of the first subblock template being a multiple of the height of a subblock in the first co-located block, the processing circuit determines first motion information of the first subblock template based on motion information of a subblock in the leftmost column of the first co-located block or a subblock that is a left neighboring block of the first co-located block.

[0033] In one example, each of the DV candidates for the current block corresponds to a respective one of the SbTMVP candidates for the current block. The SbTMVP candidates include a first SbTMVP candidate. The processing circuit sorts the SbTMVP candidates based on corresponding TM costs and selects an SbTMVP candidate from the sorted SbTMVP candidates.

[0034] In one example, the DV candidates include at least one of (i) a DV predictor of the current block, or (ii) a sum of a respective DV offset and one of the DV predictors. The processing circuit selects the SbTMVP candidates based on an index signaled in the coded video / picture bitstream.

[0035] In one example, the processing circuit selects the SbTMVP candidate as one of the sorted SbTMVP candidates corresponding to the smallest TM cost among the TM costs.

[0036] In one embodiment, the sub-block-based merge candidates include a first SbTMVP candidate and at least one affine merge candidate. The TM process includes (i) determining at least one TM cost of the at least one affine SbTMVP candidate, (ii) sorting the sub-block-based merge candidates based on the first TM cost of the first merge candidate and the at least one TM cost of the at least one affine merge candidate, and (iii) selecting a sub-block-based merge candidate from the sorted sub-block-based merge candidates. The selected sub-block-based merge candidate can be used to reconstruct the current block.

[0037] In one example, the at least one co-located picture includes multiple co-located pictures, and the reference picture for each of the DV candidates is one of the multiple co-located pictures.

[0038] In one example, the processing circuit determines the DV candidate based on a set of predefined candidates including at least one of (i) motion vectors (MVs) of spatially neighboring blocks of the current block, (ii) MVs of spatially neighboring subblocks of the current block, (iii) a history-based MV predictor (HMVP), or (iv) a candidate in a merge candidate list including at least one of (a) a spatial candidate, (b) a temporal candidate, (c) an HMVP candidate, (d) a pairwise average candidate, or (e) a zero MV.

[0039] In one example, the processing circuit sorts the DV candidates based on the corresponding TM costs and determines an SbTMVP candidate based on one of the sorted DV candidates corresponding to the smallest TM cost among the TM costs.

[0040] In one embodiment, a processing circuit of an apparatus for video / image coding decodes prediction information of a current block in a current picture from a coded video / image bitstream. The prediction information indicates inter-prediction and multiple co-located pictures for the current block. For each motion information candidate of multiple candidates for the current block, the processing circuit determines whether the reference picture of the motion information candidate is a respective one of multiple co-located pictures. In response to the reference picture of the motion information candidate being one of the multiple co-located pictures, the processing circuit determines a co-located block in the one of the multiple co-located pictures based on the motion information candidate for the current block. The processing circuit determines at least one temporal motion vector prediction (TMVP) candidate based on motion information of (i) the co-located block or (ii) a neighboring block of the co-located block. The motion information includes one motion vector (MV) for uni-prediction and two MVs for bi-prediction. A candidate list for the current block may be constructed based on at least one TMVP candidate.

[0041] Aspects of the present disclosure also provide a non-transitory computer-readable medium storing instructions that, when executed by a computer, cause the computer to perform a method for video and / or image encoding / decoding. [Brief explanation of the drawings]

[0042] Further features, nature and various advantages of the disclosed subject matter will become more apparent from the following detailed description and accompanying drawings. [Figure 1A] FIG. 1 is a schematic diagram illustrating an example subset of intra-prediction modes. [Figure 1B] FIG. 2 illustrates exemplary intra-prediction directions. [Figure 2] FIG. 2 shows an example of a current block (201) and surrounding samples. [Figure 3] FIG. 3 is a schematic diagram illustrating an example block diagram of a communication system (300). [Figure 4] FIG. 4 is a schematic diagram illustrating an example block diagram of a communication system (400). [Figure 5] FIG. 2 is a schematic diagram illustrating an exemplary block diagram of a decoder. [Figure 6] FIG. 1 is a schematic diagram illustrating an exemplary block diagram of an encoder. [Figure 7] 1 shows a block diagram of an exemplary encoder. [Figure 8] 1 shows a block diagram of an exemplary decoder. [Figure 9] 1 illustrates the locations of spatial merge candidates according to one embodiment of the present disclosure. [Figure 10] 1 illustrates candidate pairs considered for redundancy check of spatial merge candidates according to one embodiment of the present disclosure. [Figure 11] 10 illustrates an example motion vector scaling for temporal merge candidates. [Figure 12] 10 illustrates exemplary candidate positions for temporal merge candidates for the current coding unit. [Figure 13] 1 illustrates an example of a search process in merged motion vector differential (MMVD) mode. [Figure 14] 1 illustrates an example of a search process in merged motion vector differential (MMVD) mode. [Figure 15] 10 shows additional refinement positions along multiple diagonals in MMVD mode. [Figure 16] 1 illustrates an exemplary sub-block-based temporal motion vector prediction (SbTMVP) process used in SbTMVP mode. [Figure 17] 1 illustrates an exemplary sub-block-based temporal motion vector prediction (SbTMVP) process used in SbTMVP mode. [Figure 18] This shows an example of the sub-block-based template matching (TM) process in SbTMVP mode. [Figure 19] An example of a sub-block-based TM process in SbTMVP mode is shown. [Figure 20]10 illustrates an exemplary predictor template determined based on one or more reference templates in a TM process in SbTMVP mode. [Figure 21A] An example of a four-parameter affine motion model is shown. [Figure 21B] An example of a six-parameter affine motion model is shown. [Figure 22] 1 illustrates an example of sub-block-based affine transformation prediction. [Figure 23] An example of determining control point motion vector (CPMV) candidates in the affine merge list of the current CU is shown below. [Figure 24] 1 shows examples of spatial and temporal neighboring blocks of the current block. [Figure 25] An example of template matching when the current block is coded in affine mode is shown below. [Figure 26] 1 shows a flowchart outlining an encoding process according to some embodiments of the present disclosure. [Figure 27] 1 shows a flowchart outlining a decoding process according to some embodiments of the present disclosure. [Figure 28] 1 shows a flowchart outlining a decoding process according to some embodiments of the present disclosure. [Figure 29] FIG. 1 is a schematic diagram illustrating a computer system according to one embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0043] Figure 3 shows an exemplary block diagram of a communication system (300). The communication system (300) includes multiple terminal devices capable of communicating with each other, for example, via a network (350). For example, the communication system (300) includes a first pair of terminal devices (310) and (320) interconnected via the network (350). In the example of Figure 3, the first pair of terminal devices (310) and (320) perform unidirectional data transmission. For example, the terminal device (310) can code video data (e.g., a stream of video pictures captured by the terminal device (310)) for transmission to another terminal device (320) via the network (350). The coded video data can be transmitted in the form of one or more coded video bitstreams. The terminal device (320) can receive the coded video data from the network (350), decode the coded video data to reconstruct the video pictures, and display the video pictures according to the reconstructed video data. Unidirectional data transmission may be common in media serving applications, etc.

[0044] In another example, the communication system (300) includes a second pair of terminal devices (330) and (340) that perform bidirectional transmission of coded video data, for example, during a video conference. In the case of bidirectional transmission of data, in one embodiment, each of the terminal devices (330) and (340) can code video data (e.g., a stream of video pictures captured by that terminal device) for transmission over the network (350) to the other of the terminal devices (330) and (340). Each of the terminal devices (330) and (340) can also receive the coded video data transmitted by the other of the terminal devices (330) and (340), decode the coded video data to reconstruct the video pictures, and display the video pictures on an accessible display device according to the reconstructed video data.

[0045] In the example of FIG. 3 , terminal devices 310, 320, 330, and 340 are shown as a server, a personal computer, and a smartphone, respectively, although the principles of the present disclosure need not be so limited. Embodiments of the present disclosure find application in laptop computers, tablet computers, media players, and / or dedicated videoconferencing equipment. Network 350 represents any number of networks that convey coded video data between terminal devices 310, 320, 330, and 340, including, for example, wired and / or wireless communication networks. Communication network 350 may exchange data over circuit-switched and / or packet-switched channels. Exemplary networks include telecommunications networks, local area networks, wide area networks, and / or the Internet. For purposes of this description, the architecture and topology of network 350 may not be important to the operation of the present disclosure, unless otherwise described herein below.

[0046] 4 shows a video encoder and video decoder in a streaming environment as an example of an application for the disclosed subject matter. The disclosed subject matter is equally applicable to other video-enabled applications including, for example, video conferencing, digital TV, streaming services, storage of compressed video on digital media including CD-R, DVD-R, memory stick, etc.

[0047] The streaming system may include a capture subsystem (413), which may include a video source (401), such as a digital camera, that creates an uncompressed video picture stream (402). In one embodiment, the video picture stream (402) includes samples captured by the digital camera. The video picture stream (402), shown with a thick line to emphasize its high data volume compared to the coded video data (404) (or coded video bitstream), may be processed by an electronic device (420) that includes a video encoder (403) coupled to the video source (401). The video encoder (403) may include hardware, software, or a combination thereof to enable or implement aspects of the disclosed subject matter, as described in more detail below. The coded video data (404) (or coded video bitstream), shown with a thin line to emphasize its lower data volume compared to the video picture stream (402), may be stored on a streaming server (405) for future use. One or more streaming client subsystems, such as the client subsystems (406) and (408) of FIG. 4, can access the streaming server (405) to retrieve copies (407) and (409) of the coded video data (404). The client subsystem (406) can include a video decoder (410), for example, within an electronic device (430). The video decoder (410) decodes the input copy (407) of the coded video data and creates an output stream (411) of video pictures that can be rendered on a display (412) (e.g., a display screen) or other rendering device (not shown). In some streaming systems, the coded video data (404), (407), and (409) (e.g., a video bitstream) can be coded according to several video coding / compression standards. Examples of these standards include ITU-T Recommendation H.265.In one example, a developing video coding standard is informally known as Versatile Video Coding (VVC), and the disclosed subject matter may be used in the context of VVC.

[0048] It should be noted that the electronic devices (420) and (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).

[0049] 5 shows an example block diagram of a video decoder (510). The video decoder (510) may be included in an electronic device (530). The electronic device (530) may include a receiver (531) (e.g., a receiving circuit). The video decoder (510) may be used in place of the video decoder (410) in the example of FIG. 4.

[0050] The receiver (531) can receive one or more coded video sequences to be decoded by the video decoder (510). In one embodiment, one coded video sequence is received at a time, and the decoding of each coded video sequence is independent of the decoding of the other coded video sequences. The coded video sequences may be received from a channel (501), which may be a hardware / software link to a storage device that stores the coded video data. The receiver (531) can receive the coded video data along with other data, such as coded audio data and / or auxiliary data streams, which may be forwarded to respective usage entities (not shown). The receiver (531) can separate the coded video sequences from other data. To address network jitter, a buffer memory (515) may be coupled between the receiver (531) and the entropy decoder / parser (520) (hereinafter, "parser (520)"). In certain applications, the buffer memory (515) is part of the video decoder (510). In other embodiments, it may be external to the video decoder (510) (not shown). In still other embodiments, there may be a buffer memory (not shown) external to the video decoder (510), for example, to deal with network jitter, and there may also be a separate buffer memory (515) internal to the video decoder (510), for example, to handle playback timing. When the receiver (531) is receiving data from a storage / forwarding device with sufficient bandwidth and controllability, or from an isosynchronous network, the buffer memory (515) may not be necessary or may be small.For use over a best-effort packet network such as the Internet, a buffer memory (515) may be required, which may be relatively large, advantageously adaptively sized, and may be implemented at least in part within an operating system or similar element (not shown) external to the video decoder (510).

[0051] The video decoder (510) may include a parser (520) that reconstructs symbols (521) from the coded video sequence. These symbol categories include information used to manage the operation of the video decoder (510), as shown in FIG. 5, and information for controlling a rendering device, such as a rendering device (512) (e.g., a display screen), that is not an integral part of the electronic device (530) but may be coupled to the electronic device (530). The control information for the rendering device may be in the form of a supplemental enhancement information (SEI) message or a video usability information (VUI) parameter set fragment (not shown). The parser (520) may parse / entropy decode the received coded video sequence. The coding of the coded video sequence may follow a video coding technique or standard and may follow various principles, including variable length coding, Huffman coding, arithmetic coding with or without context sensitivity, etc. The parser (520) can extract, from the coded video sequence, a set of subgroup parameters for at least one of the subgroups of pixels in the video decoder based on at least one parameter corresponding to the group. The subgroups can include groups of pictures (GOPs), pictures, tiles, slices, macroblocks, coding units (CUs), blocks, transform units (TUs), prediction units (PUs), etc. The parser (520) can also extract information from the coded video sequence, such as transform coefficients, quantization parameter values, motion vectors, etc.

[0052] The parser (520) can perform entropy decoding / parsing operations on the video sequence received from the buffer memory (515) to create symbols (521).

[0053] The reconstruction of the symbols (521) can involve several different units, depending on the type of video picture or portion thereof being coded (e.g., inter-picture and intra-picture, inter-block and intra-block, etc.), as well as other factors. Which units are involved and how they are involved can be controlled by subgroup control information parsed from the coded video sequence by the parser (520). The flow of such subgroup control information between the parser (520) and the following units is not shown for clarity.

[0054] In addition to the functional blocks already mentioned, the video decoder (510) may be conceptually subdivided into several functional units, as described below. In an actual implementation operating under commercial constraints, many of these units may interact closely with each other and may be at least partially integrated with each other. However, for purposes of describing the disclosed subject matter, the following conceptual subdivision into functional units is appropriate:

[0055] The first unit is a scalar / inverse transform unit (551), which receives quantized transform coefficients as well as control information from the parser (520) as symbols (521), including which transform to use, block size, quantization coefficients, quantization scaling matrices, etc. The scalar / inverse transform unit (551) can output blocks containing sample values, which can be input to an aggregator (555).

[0056] In some cases, the output samples of the scaler / inverse transform unit (551) may relate to intra-coded blocks. Intra-coded blocks are blocks that do not use prediction information from a previously reconstructed picture, but can use prediction information from a previously reconstructed portion of the current picture. Such prediction 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, already reconstructed information fetched from a current picture buffer (558). The current picture buffer (558), for example, buffers partially reconstructed and / or fully reconstructed current pictures. The aggregator (555) optionally adds, on a sample-by-sample basis, the prediction information generated by the intra-prediction unit (552) to the output sample information provided by the scaler / inverse transform unit (551).

[0057] In other cases, the output samples of the scalar / inverse transform unit (551) may relate to an inter-coded, potentially motion-compensated, block. In such cases, the motion-compensated prediction unit (553) can access a reference picture memory (557) to fetch samples used for prediction. After motion-compensating the fetched samples according to the symbols (521) associated with the block, these samples can be added by the aggregator (555) to the output of the scalar / inverse transform unit (551) (in this case, referred to as residual samples or residual signals) to generate output sample information. The addresses in the reference picture memory (557) from which the motion-compensated prediction unit (553) fetches prediction samples can be controlled by motion vectors available to the motion-compensated prediction unit (553) in the form of symbols (521), which can have, for example, X, Y, and reference picture components. Motion compensation can also include interpolation of sample values fetched from the reference picture memory (557) when sub-sample accurate motion vectors are used, motion vector prediction mechanisms, etc.

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

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

[0060] Once a coded picture is fully reconstructed, it can be used as a reference picture for future prediction. For example, once a coded picture corresponding to a 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) can become part of the reference picture memory (557), and a new current picture buffer can be reallocated before beginning reconstruction of a subsequent coded picture.

[0061] The video decoder 510 may perform decoding operations according to a given video compression technology or standard (e.g., ITU-T Rec. H.265). A coded video sequence may conform to the syntax specified by the video compression technology or standard being used, in the sense that the coded video sequence conforms to both the syntax of the video compression technology or standard and the profile documented in the video compression technology or standard. Specifically, a profile may select some tools from all tools available in the video compression technology or standard as the only tools available for use under that profile. Also, a requirement for compliance may be that the complexity of the coded video sequence be within boundaries defined by the level of the video compression technology or standard. In some cases, the level limits the maximum picture size, maximum frame rate, maximum reconstruction sample rate (e.g., measured in megasamples per second), maximum reference picture size, etc. The limits set by the level may, in some cases, be further constrained through a hypothetical reference decoder (HRD) specification and metadata for HRD buffer management signaled in the coded video sequence.

[0062] In one embodiment, the receiver (531) can receive additional (redundant) data along with the coded video. The additional data may be included as part of the coded video sequence. The additional data may be used by the video decoder (510) to properly decode the data and / or to 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.

[0063] 6 shows an example block diagram of a video encoder (603). The video encoder (603) is included in an electronic device (620). The electronic device (620) includes a transmitter (640) (e.g., a transmitting circuit). The video encoder (603) may be used in place of the video encoder (403) in the example of FIG. 4.

[0064] The video encoder (603) can receive video samples from a video source (601) (not part of the electronic device (620) in the example of FIG. 6) that can capture video images to be coded by the video encoder (603). In another example, the video source (601) is part of the electronic device (620).

[0065] The video source (601) can provide a source video sequence to be coded by the video encoder (603) in the form of a digital video sample stream, which can be of any suitable bit depth (e.g., 8-bit, 10-bit, 12-bit, ...), any color space (e.g., BT.601 YCrCb, RGB, ...), and any suitable sampling structure (e.g., YCrCb 4:2:0, YCrCb 4:4:4). In a media delivery system, the video source (601) can be a storage device that stores previously prepared video. In a videoconferencing system, the video source (601) can be a camera that captures local image information as a video sequence. The video data can be provided as multiple individual pictures that, when viewed sequentially, impart motion. The pictures themselves can be organized as a spatial array of pixels, each of which can comprise one or more samples depending on the sampling structure, color space, etc., in use. Those skilled in the art can readily understand the relationship between pixels and samples. The following description focuses on samples.

[0066] According to one embodiment, the video encoder (603) can code and compress pictures of a source video sequence into a coded video sequence (643) in real time, or under any other time constraints as needed. Enforcing an appropriate coding rate is one function of the controller (650). In some embodiments, the controller (650) controls and is operatively coupled to other functional units as described below. This coupling is not shown for clarity. Parameters set by the controller (650) can include rate control-related parameters (picture skip, quantizer, lambda value for rate-distortion optimization techniques, ...), picture size, group of pictures (GOP) layout, maximum motion vector search range, etc. The controller (650) can be configured to have other appropriate functionality associated with the video encoder (603) optimized for a particular system design.

[0067] In some embodiments, the video encoder (603) is configured to operate in a coding loop. As an overly simplified explanation, in one example, the coding loop may include a source coder (630) (e.g., responsible for creating symbols, such as a symbol stream, based on an input picture to be coded and one or more reference pictures) 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 that of a (remote) decoder. The reconstructed sample stream (sample data) is input to a reference picture memory (634). Because decoding of the symbol stream produces bit-exact results independent of the location (local or remote) of the decoder, the contents of the reference picture memory (634) are also bit-exact between the local and remote encoders. In other words, the predictor of the encoder "sees" the exact same sample values as the decoder would "see" when using prediction during decoding. This basic principle of reference picture synchronism (and the resulting drift if synchronism cannot be maintained, eg due to channel errors) is also used in several related techniques.

[0068] The operation of the "local" decoder (633) may be the same as the operation of a "remote" decoder, such as the video decoder (510) already described in detail above in connection with Figure 5. However, with brief reference also to Figure 5, because symbols are available and the coding / decoding of the symbols into a coded video sequence by the entropy coder (645) and parser (520) may be lossless, the entropy decoding portion of the video decoder (510), including the buffer memory (515) and parser (520), may not be fully implemented in the local decoder (633).

[0069] In one embodiment, decoder technology, excluding parsing / entropy decoding, present in the decoder is 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 the encoder technology may be omitted, as it is the reverse of the decoder technology described generically. In certain areas, more detailed descriptions are provided below.

[0070] In operation, in some examples, the source coder (630) may perform motion-compensated predictive coding, which predictively codes an input picture with reference to one or more previously coded pictures from a video sequence designated as "reference pictures." In this manner, the coding engine (632) codes differences between pixel blocks of the input picture and pixel blocks of reference pictures that may be selected as predictive references for the input picture.

[0071] The local video decoder (633) can decode coded video data of pictures that may be designated as reference pictures based on symbols created by the source coder (630). The operation of the coding engine (632) can advantageously be a lossy process. When the coded video data is decoded in a video decoder (not shown in FIG. 6), the reconstructed video sequence may generally be a replica of the source video sequence with some errors. The local video decoder (633) can replicate the decoding process that may be performed on reference pictures by the video decoder and store the reconstructed reference pictures in the reference picture memory (634). In this way, the video encoder (603) can locally store copies of reconstructed reference pictures that have common content with reconstructed reference pictures obtained by the far-end video decoder (in the absence of transmission errors).

[0072] The predictor (635) may perform the prediction search for the coding engine (632). That is, for a new picture to be coded, the predictor (635) may search the reference picture memory (634) for sample data (as candidate reference pixel blocks) or specific metadata, such as reference picture motion vectors, block shapes, etc., that may serve as suitable prediction references for the new picture. The predictor (635) may operate on a sample-by-sample and pixel-by-pixel block basis to find suitable prediction references. In some cases, as determined by the search results obtained by the predictor (635), the input picture may have prediction references drawn from multiple reference pictures stored in the reference picture memory (634).

[0073] The controller (650) can manage the coding operations of the source coder (630), including, for example, setting the parameters and subgroup parameters used to encode the video data.

[0074] The output of all the aforementioned functional units is entropy coded in entropy coder 645. The entropy coder (645) converts the symbols produced by the various functional units into a coded video sequence by applying lossless compression to the symbols according to techniques such as Huffman coding, variable length coding, or arithmetic coding.

[0075] The transmitter (640) may buffer the coded video sequence created by the entropy coder (645) for transmission over a communication channel (660), which may be a hardware / software link to a storage device that stores the coded video data. The transmitter (640) may merge the coded video data from the video encoder (603) with other data to be transmitted, such as coded audio data and / or auxiliary data streams (sources not shown).

[0076] The controller (650) may manage the operation of the video encoder (603). During coding, the controller (650) may assign each coded picture a particular coded picture type, which may affect the coding technique that may be applied to the respective picture. For example, pictures may often be assigned as one of the following picture types:

[0077] An intra picture (I-picture) may be one that can be coded and decoded without using other pictures in a sequence as a source of prediction. 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 these variations of I-pictures and their respective uses and characteristics.

[0078] A predictive picture (P picture) may be one that can be coded and decoded using intra- or inter-prediction, which uses at most one motion vector and reference index to predict the sample values of each block.

[0079] A bidirectionally predicted picture (B-picture) may be one that can be coded and decoded using intra- or inter-prediction, which uses at most two motion vectors and reference indices to predict the sample values of each block. Similarly, a multi-predicted picture can use more than two reference pictures and associated metadata for the reconstruction of a single block.

[0080] A source picture is generally spatially subdivided into multiple sample blocks (e.g., blocks of 4x4, 8x8, 4x8, or 16x16 samples each) and may be coded block by block. Blocks may be predictively coded with reference to other (already coded) blocks, as determined by the coding assignment applied to the block's respective picture. For example, blocks of an I-picture may be non-predictively coded or predictively coded with reference to already coded blocks of the same picture (spatial prediction or intra-prediction). Pixel blocks of a P-picture may be predictively coded via spatial prediction or via temporal prediction with reference to one previously coded reference picture. Blocks of a B-picture may be predictively coded via spatial prediction or via temporal prediction with reference to one or two previously coded reference pictures.

[0081] The video encoder (603) may perform coding operations in accordance with a predetermined video coding technique or standard, such as ITU-T Rec. H.265. In doing so, the video encoder (603) may perform various compression operations, including predictive coding operations that exploit temporal and spatial redundancy in the input video sequence. Thus, the coded video data may conform to a syntax specified by the video coding technique or standard being used.

[0082] In one embodiment, the transmitter (640) can transmit additional data along with the encoded video. The source coder (630) can include such data as part of the coded video sequence. The additional data can include temporal / spatial / SNR enhancement layers, other forms of redundant data such as redundant pictures and slices, SEI messages, VUI parameter set fragments, etc.

[0083] Video may be captured as multiple source pictures (video pictures) in a time sequence. Intra-picture prediction (often abbreviated as intra-prediction) exploits spatial correlation within a given picture, while inter-picture prediction exploits correlation (temporal or other) between pictures. In one example, a picture being encoded / decoded, called the current picture, is partitioned into blocks. When a block in the current picture is similar to a reference block in a previously coded and still buffered reference picture in the video, the block in the current picture may be coded by a vector called a motion vector. A motion vector points to a reference block within the reference picture and may have a third dimension that identifies the reference picture if multiple reference pictures are used.

[0084] In some embodiments, bi-prediction techniques may be used in inter-picture prediction. According to bi-prediction techniques, two reference pictures, such as a first reference picture and a second reference picture, are used, both of which are earlier in decoding order than a current picture in a video (but may be earlier and later, respectively, in display order). A block in the current picture may be coded 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. A block may be predicted by a combination of the first reference block and the second reference block.

[0085] Also, a merge mode technique can be used in inter-picture prediction to improve coding efficiency.

[0086] According to some embodiments of the present disclosure, predictions such as inter-picture prediction and intra-picture prediction are performed in units of blocks. For example, according to the HEVC standard, pictures in a sequence of video pictures are partitioned into coding tree units (CTUs) for compression, and the CTUs in a picture have the same size, such as 64×64 pixels, 32×32 pixels, or 16×16 pixels. Generally, a CTU includes three coding tree blocks (CTBs), one luma CTB and two chroma CTBs. Each CTU may be recursively quadtree partitioned into one or more coding units (CUs). For example, a 64×64 pixel CTU may be partitioned into one CU of 64×64 pixels, four CUs of 32×32 pixels, or 16 CUs of 16×16 pixels. In one example, each CU is analyzed to determine the prediction type of the CU, such as an inter prediction type or an intra prediction type. A CU is divided into one or more prediction units (PUs) according to temporal and / or spatial predictability. Generally, each PU includes a luma prediction block (PB) and two chroma PBs. In one embodiment, prediction operations during coding (encoding / decoding) are performed in prediction block units. Using a luma prediction block as an example of a prediction block, the prediction block includes a matrix of pixel values (e.g., luma values) of 8x8 pixels, 16x16 pixels, 8x16 pixels, 16x8 pixels, etc.

[0087] 7 shows an example diagram of a video encoder (703). The video encoder (703) is configured to receive a processed block (e.g., a predictive block) of sample values in a current video picture of a sequence of video pictures and encode the processed block into a coded picture that is part of a coded video sequence. In one example, the video encoder (703) is used in place of the video encoder (403) in the example of FIG. 4.

[0088] In an HEVC example, the video encoder (703) receives a matrix of sample values for a processing block, such as a predictive block of 8x8 samples. The video encoder (703) determines whether the processing block is best coded using intra-mode, inter-mode, or bi-prediction mode, e.g., using rate-distortion optimization. If the processing block is coded in intra-mode, the video encoder (703) may encode the processing block into a coded picture using intra-prediction techniques; if the processing block is coded in inter-mode or bi-prediction mode, the video encoder (703) may encode the processing block into a coded picture using inter-prediction or bi-prediction techniques, respectively. In some video coding techniques, the merge mode may be an inter-picture prediction sub-mode, in which motion vectors are derived from one or more motion vector predictors without the benefit of coded motion vector components outside the predictors. In some other video coding techniques, there may be motion vector components applicable to the current block. In one example, the video encoder (703) includes other components, such as a mode decision module (not shown), that determines the mode of the processing block.

[0089] In the example of Figure 7, the video encoder (703) includes an inter-encoder (730), an intra-encoder (722), a residual calculator (723), a switch (726), a residual encoder (724), a general-purpose controller (721), and an entropy encoder (725), coupled to each other as shown in Figure 7.

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

[0091] The intra encoder (722) is configured to receive samples of a current block (e.g., a processing block), possibly compare the block with previously coded blocks in the same picture, generate quantized coefficients after transformation, and possibly also generate intra prediction information (e.g., intra prediction direction information according to one or more intra encoding techniques). In one example, the intra encoder (722) also calculates intra prediction results (e.g., predicted blocks) based on the intra prediction information and reference blocks in the same picture.

[0092] The general-purpose controller (721) is configured to determine general-purpose control data and control other components of the video encoder (703) based on the general-purpose control data. In one example, the general-purpose controller (721) determines the mode of the block and provides a control signal to the switch (726) based on the mode. For example, if the mode is intra mode, the general-purpose controller (721) controls the switch (726) to select intra mode results to be used by the residual calculation unit (723) and controls the entropy encoder (725) to select intra prediction information to be included in the bitstream. If the mode is inter mode, the general-purpose controller (721) controls the switch (726) to select inter prediction results to be used by the residual calculation unit (723) and controls the entropy encoder (725) to select inter prediction information to be included in the bitstream.

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

[0094] The entropy encoder (725) is configured to format a bitstream to include the coded block. The entropy encoder (725) is configured to include various information in the bitstream in accordance with an appropriate standard, such as the HEVC standard. In one example, the entropy encoder (725) is configured to include general control data, selected prediction information (e.g., intra-prediction information or inter-prediction information), residual information, and other appropriate information in the bitstream. Note that, according to the disclosed subject matter, there is no residual information when coding a block in a merged sub-mode of either an inter mode or a bi-prediction mode.

[0095] 8 shows an example diagram of a video decoder (810). The video decoder (810) is configured to receive coded pictures that are part of a coded video sequence and decode the coded pictures to generate reconstructed pictures. In one example, the video decoder (810) is used in place of the video decoder (410) in the example of FIG. 4.

[0096] In the example of Figure 8, the video decoder (810) includes an entropy decoder (871), an inter-decoder (880), a residual decoder (873), a reconstruction module (874), and an intra-decoder (872), coupled together as shown in Figure 8.

[0097] The entropy decoder (871) may be configured to reconstruct, from a coded picture, specific symbols representing syntax elements that make up the coded picture. Such symbols may include, for example, the mode in which a block is coded (e.g., intra mode, inter mode, bi-prediction mode, the latter two in a merged submode, or another submode, etc.) and prediction information (e.g., intra-prediction information or inter-prediction information, etc.) that may identify specific samples or metadata used for prediction by the intra decoder (872) or inter decoder (880), respectively. The symbols may also include residual information, for example, in the form of quantized transform coefficients. In one example, if the prediction mode is an inter-prediction mode or a bi-prediction mode, the inter-prediction information is provided to the inter decoder (880), and if the prediction type is an intra-prediction type, the intra-prediction information is provided to the intra decoder (872). The residual information may undergo inverse quantization and be provided to the residual decoder (873).

[0098] The inter decoder (880) is configured to receive the inter prediction information and generate an inter prediction result based on the inter prediction information.

[0099] The intra decoder (872) is configured to receive intra prediction information and generate a prediction result based on the intra prediction information.

[0100] The residual decoder (873) is configured to perform inverse quantization to extract dequantized transform coefficients and process the dequantized transform coefficients to transform the residual information from the frequency domain to the spatial domain. The residual decoder (873) may also require certain control information (to include quantizer parameters (QP)), which may be provided by the entropy decoder (871) (data path not shown, as it may be only low volume control information).

[0101] The reconstruction module (874) is configured to combine, in the spatial domain, the residual information output by the residual decoder (873) and the prediction results (possibly output by the inter-prediction module or the intra-prediction module) to form reconstructed blocks that may be part of a reconstructed picture, which may be part of the reconstructed video. It should be noted that other appropriate operations, such as a deblocking operation, may be performed to improve visual quality.

[0102] It should be noted that the video encoders (403), (603), and (703) and the video decoders (410), (510), and (810) may be implemented using any suitable technology. In one embodiment, the video encoders (403), (603), and (703) and the video decoders (410), (510), and (810) may be implemented using one or more integrated circuits. In another embodiment, the video encoders (403), (603), and (603) and the video decoders (410), (510), and (810) may be implemented using one or more processors executing software instructions.

[0103] In VVC, various inter-prediction modes may be used. For an inter-predicted CU, motion parameters may include MVs, one or more reference picture indexes, a reference picture list usage index, and additional information about some coding features to be used for inter-predicted sample generation. The motion parameters may be signaled explicitly or implicitly. When a CU is coded in skip mode, the CU may be associated with a PU and may not have significant residual coefficients, coded motion vector deltas 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 one or more neighboring CUs, including spatial and / or temporal candidates, and optionally additional information as introduced in VVC. The merge mode can be applied not only to skip mode but also to inter-predicted CUs. In one example, an alternative to the merge mode is explicit transmission of motion parameters, in which the MV(s), corresponding reference picture indexes for each reference picture list, and a reference picture list usage flag, among other information, are explicitly signaled for each CU.

[0104] In one embodiment, such as VVC, the VVC Test Model (VTM) reference software includes one or more refined inter-prediction coding tools, including enhanced merge prediction, merge motion vector differential (MMVD) mode, adaptive motion vector prediction with symmetric MVD signaling (AMVP) mode, affine motion compensation 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), bi-prediction with CU level weights (BCW), bidirectional optical flow (BDOF), prediction refinement with optical flow (PROF), decoder-side motion vector refinement (DMVR), combined inter- and intra-prediction (CIIP), geometric partitioning mode (GPM), etc. Inter-prediction and related methods are described in more detail below.

[0105] Enhanced merge prediction may be used in some examples. In one example, such as VTM4, a merge candidate list is constructed by including five types of candidates in order: spatial motion vector predictors (MVPs) from spatially neighboring CUs, temporal MVPs from collocated CUs, history-based MVPs (HMVPs) from a first-in-first-out (FIFO) table, pairwise average MVPs, and zero MVs.

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

[0107] Some examples of the generation process for each category of merge candidates are given below. In one embodiment, spatial candidates are derived as follows: The derivation of spatial merge candidates in VVC may be the same as that in HEVC. As an example, up to four merge candidates are selected from the candidates in the positions shown in Figure 9. Figure 9 shows the positions of spatial merge candidates according to one embodiment of the present disclosure. Referring to Figure 9, the derivation order is B1, A1, B0, A0, and B2. Position B2 is only considered when any CU in positions A0, B0, B1, and A1 is unavailable (e.g., because the CU belongs to another slice or another tile) or is intra-coded. After the candidate in position A1 is added, the addition of the remaining candidates undergoes a redundancy check. This ensures that candidates with the same motion information are excluded from the candidate list, thereby improving coding efficiency.

[0108] To reduce computational complexity, not all possible candidate pairs are considered in the above-described redundancy check. Instead, only pairs linked by arrows in FIG. 10 are considered, and a candidate is only added to a candidate list if the corresponding candidates used in the redundancy check do not have the same motion information. FIG. 10 illustrates candidate pairs considered for a spatial merge candidate redundancy check according to an embodiment of the present disclosure. Referring to FIG. 10, the pairs connected by arrows are A1 and B1, A1 and A0, A1 and B2, B1 and B0, and B1 and B2. This allows candidates at positions B1, A0, and / or B2 to be compared with the candidate at position A1, and candidates at positions B0 and / or B2 to be compared with the candidate at position B1.

[0109] In one embodiment, temporal candidates are derived as follows: In one example, only one temporal merge candidate is added to the candidate list. Figure 11 shows exemplary motion vector scaling for temporal merge candidates. To derive a temporal merge candidate for a current CU (1111) in a current picture (1101), a scaled MV (1121) (e.g., indicated by a dotted line in Figure 11) may be derived based on a co-located CU (1112) belonging to a co-located reference picture (1104).

[0110] The reference picture list used to derive the co-located CU (1112) may be explicitly signaled in the slice header. The scaled MV (1121) for the temporal merge candidate may be obtained as shown by the dotted line in FIG. 11. The scaled MV (1121) may be scaled from the MV of the co-located CU (1112) using picture order count (POC) distances tb and td. The POC distance tb may be defined to be the POC difference between the current reference picture (1102) of the current picture (1101) and the current picture (1101). The POC distance td may be defined to be 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 may be set to zero.

[0111] FIG. 12 shows exemplary candidate positions (e.g., C0 and C1) for a temporal merge candidate of the current CU. The position of the temporal merge candidate may be selected from candidate positions C0 and C1. Candidate position C0 is located at the bottom 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 unavailable, 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 located in the current row of the CTU, candidate position C0 is used to derive the temporal merge candidate.

[0112] For skip mode or merge mode with motion vector representation method, merge with motion vector difference (MMVD) mode may be used. Merge candidates such as those used in VVC may be reused in MMVD mode. A candidate may be selected from among the merge candidates as a starting point (e.g., MV predictor (MVP)) and may be further extended by MMVD mode. MMVD mode can provide a new motion vector representation using simplified signaling. The motion vector representation method includes a starting point and MV difference (MVD). In one example, the MVD is indicated by the magnitude of the MVD (or motion magnitude) and the direction of the MVD (e.g., motion direction).

[0113] The MMVD mode can use a merge candidate list such as that used in VVC. In one embodiment, only candidates with a default merge type (e.g., MRG_TYPE_DEFAULT_N) are considered for the MMVD mode. The starting point can be indicated or defined by a base candidate index (IDX). The base candidate index can indicate a candidate (e.g., the best candidate) among the candidates (e.g., the base candidate) in the merge candidate list. Table 1 shows an example relationship between the base candidate index and the corresponding starting point. A base candidate index of 0, 1, 2, or 3 indicates that the corresponding starting point is the first MVP, the second MVP, the third MVP, or the fourth MVP. In one example, if the number of base candidates (one or more) is equal to 1, the base candidate IDX is not signaled.

[0114] [Table 1] The distance index may indicate motion magnitude information of the MVD, such as the magnitude of the MVD. For example, the distance index indicates a distance (e.g., a predefined distance) from a starting point (e.g., an MVP indicated by a base candidate index). In one example, the distance is one of a plurality of predetermined distances as shown in Table 2. Table 2 shows an exemplary relationship between the distance index and the corresponding distance (in units of samples or pixels). 1 pel in Table 2 is 1 sample or 1 pixel. For example, a distance index of 1 indicates that the distance is 1 / 2 pel or 1 / 2 sample.

[0115] [Table 2] The direction index can represent the direction of the MVD relative to the starting point. The direction index can represent one of multiple directions, such as the four directions shown in Table 3. For example, a direction index of 00 indicates that the direction of the MVD is along the positive x-axis.

[0116] [Table 3] The MMVD flag may be signaled after sending the skip and merge flags. If the skip and merge flags are true, the MMVD flag may be parsed. In one example, if the MMVD flag is equal to 1, the MMVD syntax (e.g., including distance indexes and / or direction indexes) may be parsed. If the MMVD flag is not equal to 1, the AFFINE flag may be parsed. If the AFFINE flag is equal to 1, code the current block using the AFFINE mode. If the AFFINE flag is not equal to 1, the skip / merge index may be parsed for the skip / merge mode, as used in VTM.

[0117] 13 and 14 show an example of a search process in MMVD mode. By performing the search process, indices including a base candidate index, a direction index, and / or a distance index may be determined for a current block (1300) in a current picture (also called a current frame) (1301).

[0118] A first motion vector (MV) (1311) and a second MV (1321) belonging to a first merging candidate are shown. The first merging candidate may be a merging candidate in a merging candidate list configured for the current block (1300). The first MV (1311) and the second MV (1321) may be associated with two reference pictures (1302) and (1303) in reference picture lists L0 and L1, respectively. Thus, the two starting points (1411) and (1421) in Figures 13-14 may be determined in the reference pictures (1302) and (1303), respectively.

[0119] In one example, based on the starting points (1411) and (1421), multiple predefined points (e.g., 1-12 shown in FIG. 14) extending from the starting points (1411) and (1421) in the vertical direction (represented by +Y or −Y) or the horizontal direction (represented by +X and −X) within the reference pictures (1302) and (1303) may be evaluated. In one example, pairs of points that mirror each other with respect to the respective starting points (1411) or (1421), such as the pair of points (1414) and (1424) or the pair of points (1415) and (1425), may be used to determine a pair of MVs (1314) and (1324) or a pair of MVs (1315) and (1325) that may form candidate MV predictors (MVPs) for the current block (1300). MVP candidates determined based on predetermined points surrounding the starting point (1411) and / or (1421) may be evaluated. Referring to Figure 13, the MVD (1312) between the first MV (1311) and MV (1314) has a magnitude of 1S. The MVD (1322) between the second MV (1321) and MV (1324) has a magnitude of 1S. Similarly, the MVD between the first MV (1311) and MV (1315) has a magnitude of 2S. The MVD between the second MV (1321) and MV (1325) has a magnitude of 2S.

[0120] In addition to the first merge candidate, other available or valid merge candidates in the merge candidate list of the current block (1300) may also be evaluated. In one example, for a uni-predictive merge candidate, only one prediction direction associated with one of the two reference picture lists is evaluated.

[0121] In one example, the best MVP candidate can be determined based on the evaluation. Therefore, an optimal merge candidate corresponding to the optimal MVP candidate can be selected from the merge list, and the motion direction and motion distance can also be determined. For example, a base candidate index can be determined based on the selected merge candidate and Table 1. Based on the selected MVP corresponding to a predetermined point 1415 (or 1425), the direction and distance (e.g., 2S) of point 1415 relative to the starting point 1411 can be determined. According to Tables 2 and 3, the direction index and distance index can be determined appropriately.

[0122] As described above, two indexes, such as a distance index and a direction index, can be used to indicate the MVD in MMVD mode. Alternatively, a single index can be used to indicate the MVD in MMVD mode, for example, using a table that pairs a single index with the MVD.

[0123] Template matching (TM)-based candidate reordering may be used in some prediction modes, such as MMVD mode and affine MMVD mode. In one embodiment, the MMVD offset is extended for MMVD mode and affine MMVD mode. FIG. 15 shows additional refinement positions along multiple diagonals, such as a k×π / 8 diagonal (k is an integer from 0 to 15). The additional refinement positions along multiple diagonals can increase the number of directions, for example, from four directions (e.g., +X, −X, +Y, and −Y) to 16 directions (e.g., k=0, 1, 2, ..., 15). In one example, each of the 16 directions is represented by an angle between the +X direction and a direction indicated by a center point (1500) and one of points 1-16. For example, point 1 indicates the +X direction with an angle of 0 (i.e., k=0), point 2 indicates a direction along an angle of 1×π / 8 (i.e., k=1), and so on.

[0124] The TM may be performed in MMVD mode. In one example, for each MMVD refinement position, a TM cost may be determined based on the current template of the current block and one or more reference templates. The TM cost may be determined using any method, such as sum of absolute differences (SAD) (e.g., SAD cost), sum of absolute translation differences (SATD), sum of squared errors (SSE), mean difference removed SAD / SATD / SSE, variance, partial SAD, partial SSE, partial SATD, or the like.

[0125] The current template for the current block may include any suitable samples, such as one row of samples above the current block and / or one column of samples to the left of the current block. All possible MMVD refinement positions (e.g., 16x6, representing 16 directions and 6 magnitudes) for each base candidate (e.g., MVP) may be reordered based on the TM cost (e.g., SAD cost) between the current template and the corresponding reference template for the refinement position, e.g., the MMVD refinement position. In one example, the top MMVD refinement position with the smallest TM cost (e.g., smallest SAD cost) is kept as the available MMVD refinement position for MMVD index coding. For example, a subset (e.g., eight) of the MMVD refinement positions with the smallest TM cost is used for MMVD index coding. For example, the MMVD index indicates which of the subset of MMVD refinement positions with the smallest TM cost is selected to code the current block. In one example, an MMVD index of 0 indicates that the MVD corresponding to the smallest TM cost (e.g., the MMVD refinement position) is used to code the current block. The MMVD index may be binarized, for example, by a Rice code with a parameter of 2.

[0126] In one embodiment, in addition to the MMVD offset extension described above, such as in Figure 15, the affine MMVD reordering is extended to add additional refinement positions along the k × π / 4 diagonal. After reordering, the top half refinement positions with the smallest TM cost (e.g., SAD cost) are retained for coding the current block.

[0127] To improve coding efficiency and reduce MV transmission overhead, subblock-level MV refinement may be applied to extend CU-level temporal motion vector prediction (TMVP). In one example, subblock-based TMVP (SbTMVP) mode enables inheriting motion information at the subblock level from a collocated reference picture. Each subblock of a current CU (e.g., a large-sized current CU) in a current picture can have its own motion information without explicitly transmitting a block partition structure or its own motion information. In SbTMVP mode, the motion information of each subblock may be obtained, for example, in three steps as follows: In the first step, a displacement vector (DV) of the current CU may be derived. In the second step, the availability of SbTMVP candidates may be checked, and the central motion (e.g., the central motion of the current CU) may be derived. In the third step, subblock motion information may be derived from the corresponding subblock in the co-located block using the DV. The three steps may be combined into one or two steps, and / or the order of the three steps may be adjusted.

[0128] Unlike TMVP candidate derivation, which derives temporal MVs from co-located blocks in a reference frame or picture, SbTMVP mode may apply DVs (e.g., DVs derived from the MVs of the CUs adjacent to the left of the current CU) to locate corresponding sub-blocks in the co-located picture for each sub-block in the current CU in the current picture. If the corresponding sub-block is not inter-coded, the motion information of the current sub-block may be set to the motion of the center of the co-located block.

[0129] The SbTMVP mode may be supported by various video coding standards, including, for example, VVC. Similar to the TMVP mode, for example, in HEVC, the SbTMVP mode may use a motion field (also referred to as a motion information field or MV field) in a co-located picture to improve MV prediction and merge mode for a CU in a current picture. In one example, the same co-located picture used by the TMVP mode is used in the SbTVMP mode. In one example, the SbTMVP mode differs from the TMVP mode in the following ways: (i) the TMVP mode predicts motion information at the CU level, while the SbTMVP mode predicts motion information at the sub-CU level; and (ii) the TMVP mode fetches temporal MVs from co-located blocks in a co-located picture (e.g., the co-located block is the bottom-right or center block relative to the current CU), while the SbTMVP mode may apply a motion shift before fetching temporal motion information from the co-located picture. In one example, the motion shift used in the SbTMVP mode is obtained from the MV of one of the spatially neighboring blocks of the current CU.

[0130] 16-17 show an exemplary SbTMVP process used in SbTMVP mode. The SbTMVP process can predict the MV of a sub-CU (e.g., a sub-block) in a current CU (e.g., a current block) (1601) in a current picture (1711), for example, in two steps. In the first step, a spatial neighboring block (e.g., A1) of the current block (1601) in FIGS. 16-17 is examined. If the spatial neighboring block (e.g., A1) has an MV (1721) that uses a co-located picture (1712) as a reference picture for the spatial neighboring block (e.g., A1), the MV (1721) may be selected to be the motion shift (or DV) to be applied to the current block (1601). If no such MV (e.g., an MV that uses the co-located picture (1712) as a reference picture) is identified, the motion shift or DV may be set to zero MV (e.g., (0,0)). In some examples, if no such MV is identified for spatial neighboring block A1, the MV(s) of additional spatial neighboring blocks, such as A0, B0, B1, etc., are checked.

[0131] In a second step, the motion shift or DV (1721) identified in the first step can be applied to the current block (1601) (e.g., adding the DV (1721) to the coordinates of the current block) to obtain sub-CU level motion information (e.g., including MV and reference index) from the co-located picture (1712). In the example shown in FIG. 17, the motion shift or DV (1721) is set to be the MV of the spatial neighbor block A1 (e.g., block A1) of the current block (1601). For each sub-CU or sub-block (1731) in the current block (1601), the motion information of the corresponding co-located block (1701) in the co-located picture (1712) (e.g., motion information of the minimum motion grid covering the center sample of the co-located block (1701)) can be used to derive the motion information of the sub-CU or sub-block (1731). After the motion information of the co-located sub-CU (1732) in the co-located block (1701) is identified, the motion information of the co-located sub-CU (1732) may be converted into motion information (e.g., MV and one or more reference indices) of the current sub-CU (1731) using a scaling method, such as a method similar to the TMVP process used in HEVC, where temporal motion scaling is applied to align the reference picture of the temporal MV with the reference picture of the current CU.

[0132] The motion field of the current block (1601) derived based on the DV (1721) may include motion information of each sub-block (1731) within the current block (1601), such as MV(s) and one or more associated reference indices. The motion field of the current block (1601) is also called an SbTMVP candidate and corresponds to the DV (1721).

[0133] 17 shows an example of a motion field or SbTMVP candidate for a current block (1601). The motion information of a bi-predicted sub-block (1731(1)) includes a first motion vector (MV), a first index indicating a first reference picture in reference picture list 0 (L0), a second motion vector (MV), and a second index indicating a second reference picture in reference picture list 1 (L1). In one example, the motion information of a uni-predicted sub-block (1731(2)) includes a motion vector (MV) and an index indicating a reference picture in L0 or L1.

[0134] In one example, the DV (1721) is applied to the center position of the current block (1601) to locate a displaced center position in the co-located picture (1712). If the block containing the displaced center position is not inter-coded, the SbTMVP candidate is considered unavailable. Otherwise, if the block containing the displaced center position (e.g., the co-located block (1701)) is inter-coded, the motion information of the center position of the current block (1601), referred to as the central motion of the current block (1601), may be derived from the motion information of the block containing the displaced center position in the co-located picture (1712). In one example, a scaling process may be used to derive the central motion of the current block (1601) from the motion information of the block containing the displaced center position in the co-located picture (1712). When SbTMVP candidates are available, DV (1721) may be applied to find a corresponding sub-block (1731) in the co-located picture (1712) for each sub-block (1732) of the current block (1601). The motion information of the corresponding sub-block (1732) may be used to derive motion information for the sub-block (1731) within the current block (1601), such as in the same manner as used to derive the central motion of the current block (1601). In one example, if the corresponding sub-block (1732) is not inter-coded, the motion information of the current sub-block (1731) is set to be the central motion of the current block (1601).

[0135] In some examples, such as VVC, a combined sub-block-based merge list containing an SbTMVP candidate and one or more affine merge candidates is used in signaling the sub-block-based merge mode. The SbTMVP mode can be enabled or disabled by a sequence parameter set (SPS) flag. When the SbTMVP mode is enabled, the SbTMVP candidate (or SbTMVP predictor) is added as the first entry of a sub-block-based merge list containing sub-block-based merge candidates, followed by affine merge candidates. The size of the sub-block-based merge list can be signaled in the SPS. In one example, the maximum allowed size of a sub-block-based merge list is 5 in VVC. In one example, multiple SbTMVP candidates are included in a sub-block-based merge list.

[0136] In some examples, such as VVC, the sub-CU size used in SbTMVP mode is fixed at 8x8, as used in affine merge mode. In one example, SbTMVP mode is only applicable to CUs whose width and height are both 8 or greater. The sub-block size (e.g., 8x8) may be configurable to other sizes, such as 4x4 in the ECM software model used for searching beyond VVC. In one example, multiple co-located pictures, such as two co-located frames, are utilized to provide temporal motion information for SbTMVP and / or TMVP in AMVP mode.

[0137] Motion vector offsets (MVOs) (also referred to as DV offsets) may be used in SbTMVP mode. In one example, to obtain more accurate matching, an MV offset (MVO) (or DV offset) is added to a DV to determine an updated DV (referred to as DV'). For example, the updated DV' is the vector sum of the DV and the MVO. The MVO may be indicated, for example, by signaling an index indicating the MVO from an MVO candidate. In one example, the MVO is signaled. In one example, an MMVD mode is used to indicate the MVO. For example, the MVO is an MVD indicated by a direction index and / or a distance index. By using the MVO, the position of the MV field within a co-located CU (or co-located block) may be adjusted. When the MVO is not 0, the updated DV' may be used as a displacement vector to indicate the position of the co-located CU (or co-located block) to perform the SbTMVP process.

[0138] The TM method may be applied with the SbTMVP process, for example, with or without MVO. In one example, the DV used in the SbTMVP mode is used as the MV for the TM process. In the SbTMVP mode, a DV predictor may be derived from motion information of neighboring blocks of the current block. An updated DV may be determined as a vector sum of the DV predictor and each DVO candidate (or MVO candidate). The DVO candidates (or MVO candidates) may be sorted based on their associated TM costs determined using the TM method. In the TM method, the current template of the current block may be compared with each of the templates of multiple blocks located at different candidate positions specified by the updated DV, and a TM cost is calculated for each DVO candidate. Based on the TM costs, the DVO candidates may be sorted, for example, based on ascending or descending order of TM costs. Accordingly, the DVO indexes (e.g., MMVD indexes) associated with the DVO candidates may be sorted. In one example, an index within the sorted DVO indexes (e.g., sorted MMVD indexes) is selected. An index may be signaled to indicate a selected DVO among the DVO candidates.

[0139] In one example, multiple DV predictors (or multiple DVP candidates) are available for the current block. The DV predictors may be sorted based on the associated TM costs derived by the TM method as described above. Based on the TM costs, the multiple DV predictors are sorted based on ascending or descending TM cost order. Accordingly, the DVP indices associated with the multiple DV predictors may be sorted. In one example, an index among the sorted DVP indices is selected. The index may be signaled to indicate which DV predictor is applied to derive the DV used in SbTMVP mode.

[0140] In one example, the candidates in the candidate list include (i) multiple DVP candidates and (ii) a DV predictor with DVO candidates as described above. The candidates may be sorted based on TM cost, as described above. An index indicating the candidate selected based on TM cost may be signaled in the bitstream.

[0141] As mentioned above, DV (e.g., DVP, or DV' based on DVP and DVO) is used as the MV used in TM for SbTMVP mode. DV is used to indicate the position of the motion field in the co-located reference picture. Since DV is not used as the MV for the current block in SbTMVP mode and SbTMVP mode together with MMVD, using DV in TM may not be reliable.

[0142] The SbTMVP mode is used to code the current block. When multiple DV candidates for the current block are available, each DV candidate can be used as a DV in the SbTMVP mode to determine the motion field (or MV field) of the current block, as described in Figures 16 and 17. The motion field of the current block corresponding to each DV candidate can include motion information for each sub-block in the current block, such as MV(s) and one or more associated reference indexes. The motion field of the current block is also called an SbTMVP candidate. Each of the multiple DV candidates corresponds to an SbTMVP candidate among the SbTMVP candidates.

[0143] Template matching may be used to determine a DV candidate from multiple DV candidates for a current block, for example, to determine an SbTMVP candidate from an SbTMVP candidate. A co-located block in a co-located picture may be determined based on the DV candidates among the multiple DV candidates. The reference picture for the DV candidate is the co-located picture. One or more motion information of (i) the co-located block or (ii) at least one neighboring block of the co-located block in the co-located picture may be used in TM. The motion information of the current template for the current block may be determined based on one or more motion information of (i) the co-located block or (ii) at least one neighboring block of the co-located block. A first reference template in a first reference picture and / or a second reference template in a second reference picture may be determined based on the motion information of the current template for the current block. A TM cost may be determined based on (i) the current template and (ii) the first reference template and / or the second reference template. Similarly, the TM cost of other DV candidates among the multiple DV candidates may be determined.

[0144] Each TM cost can correspond to a DV candidate and a respective SbTMVP candidate. In one example, the multiple DV candidates include a first DV candidate and a second DV candidate. The first SbTMVP candidate and the first TM can be determined based on the first DV candidate. The second SbTMVP candidate and the second TM can be determined based on the second DV candidate.

[0145] The SbTMVP candidates may be determined based on the TM costs associated with the SbTMVP candidates. In one example, the SbTMVP candidates are sorted or ranked based on the TM costs. The SbTMVP candidates may be determined based on the sorted SbTMVP candidates.

[0146] As shown in Figure 18, MVs for TM in SbTMVP mode or SbTMVP mode with MMVD can be derived. Figure 18 shows an example of a sub-block-based TM process. A current CU or block (1801) in a current picture (1811) is coded in SbTMVP mode. A DV (1831) (e.g., the MV of a spatially neighboring block A1 of the current block (1801)) can point to a co-located block (1802) in a co-located picture (or co-located reference picture) (1812). In one example, the reference picture for the DV (1831) is the co-located picture (1812). In one example, the DV (1831) points to the center position within the MV field of the co-located block (1802) in the co-located picture (1812). In the co-located picture (1812), motion information (e.g., MV data) of the center position of the corresponding MV field in the co-located picture (1812) can be determined. For example, the co-position block (1802) includes sub-blocks located at positions (0,0) through (3,3). The motion information of the central position of the co-position picture (1812) can be referred to as the central motion of the co-position block (1802). The central motion of the co-position block (1802) can be determined based on the motion information of centrally located sub-blocks within the co-position block (1802), for example, sub-blocks at positions (1,1), (2,1), (1,2), and (2,2). In one example, the central motion of the co-position block (1802) is the motion information of the sub-block at position (2,2) in the MV field.

[0147] The MV(s) of the TM in the SbTMVP mode or the SbTMVP mode with MMVD may be determined based on the derived central motion. Referring to Figure 18, the sub-block at position (2,2) in the co-located block (1802) is uni-predicted, and the central motion includes, for example, an MV (1832) that points to a reference picture (1813) in L0. The motion information (e.g., MV (1833)) of the current template (1821) of the current block (1801) may be determined based on the MV (1832) of the sub-block at position (2,2) in the co-located block (1802). In one example, a scaling process is performed to determine the MV (1833) based on the MV (1832).

[0148] The TM cost may be determined based on the current template (1821) and the reference template (1823), for example, based on the SAD between the current template (1821) and the reference template (1823). Other functions such as SSE, SATD, variance, partial SAD, partial SSE, partial SATD, mean removed SAD / SATD / SSE, etc. may also be used to determine the TM cost.

[0149] When multiple DVs, including DV (1831), are available for the current block (1801), the TM costs of other DVs in the multiple DVs may be determined as described above with respect to DV (1831). As described above, the SbTMVP candidates (or MV fields) of the current block (1801) corresponding to the multiple DVs may be sorted or ranked based on TM costs. SbTMVP candidates may be determined based on the sorted SbTMVP candidates or multiple sorted DVs.

[0150] According to an embodiment of the present disclosure, the current template of a current CU (or current block) may include multiple sub-block templates. For example, the current template is divided into sub-block templates. Figure 19 shows an example of a sub-block-based TM process in which a current template (1921) of a current block (1901) in a current picture (1911) includes multiple sub-block templates T1 to T8. The current template (1921) may include a top template including T1 to T4 and a left template including T5 to T8. The current block (1901) is coded in SbTMVP mode. The DV (1931) of the current block (1901) may point to the co-located block (1902) in the co-located picture (1912). In one example, the DV (1931) is the MV of the spatial neighbor block A1 of the current block (1901), and the reference picture of the DV (1931) is the co-located picture (1912).

[0151] The co-located block (1902) includes sub-blocks (0,0) to (3,3) located at positions (0,0) to (3,3). For example, sub-block (0,0) at position (0,0) is the top-left sub-block within the co-located block (1902), and sub-block (3,3) at position (3,3) is the bottom-right sub-block within the co-located block (1902). The MV field of the co-located block (1902) can include motion information for each sub-block, as shown in Figure 19.

[0152] In SbTMVP mode or SbTMVP mode with DV offset (e.g., using MMVD mode), the motion information of multiple sub-block templates T1 to T8 of the current template (1921) can be derived from the motion information of each sub-block in the co-located picture (1912), such as the motion information of each sub-block in the co-located block (1902) or at least one spatially adjacent block (neighbor) of the co-located block (1902).

[0153] In one embodiment, motion information of a subblock template (e.g., T2) in the current template (1921) is determined based on motion information of a subblock (e.g., located at (1,0)) in the co-located block (1902). In one example, the subblock (e.g., located at (1,0)) in the co-located block (1902) is collocated with a subblock (e.g., (1942)) in the current block (1901) that is adjacent to the subblock template (e.g., T2).

[0154] Motion information (e.g., one or more MVs) of each sub-block template in the current template (1921) of the current block (1901) may be derived based on motion information of each sub-block in the co-located block (1902) (e.g., sub-blocks in the top row and / or left column in the co-located block (1902)). In one example, the motion information of the sub-block templates in the current template (1921) is derived by copying the motion information of each sub-block in the top row or left column in the co-located block (1902). In one example, a scaling process (e.g., a scaling process similar to the MV scaling shown in FIG. 11) is used to derive motion information of the sub-block templates (e.g., T1-T8) in the current template (1921).

[0155] In one example, the motion information of sub-block templates T1 to T4 of the top template of the current block (1901) is copied from the motion information of sub-blocks (0,0), (1,0), (2,0), and (3,0) in the co-located block (1902), respectively. The motion information of sub-block templates T5 to T8 of the left template of the current block 1901 is copied from the motion information of sub-blocks (0,0), (0,1), (0,2), and (0,3) in the co-located block 1902, respectively.

[0156] In the co-located picture (1912), sub-blocks (0,-1), (0,-1), (0,-1), and (0,-1) located at positions (0,-1), (0,-1), (0,-1), and (0,-1) are adjacent to (e.g., above) the co-located block (1902) and are within one or more neighboring blocks of the co-located block (1902). In one embodiment, motion information of a sub-block template (e.g., T2) in the current template (1921) is determined based on motion information of a sub-block (e.g., (1,-1)) within one of the neighboring blocks of the co-located block (1902). One sub-block (e.g., (1,-1)) of the neighboring blocks of the co-located block (1902) may be co-located with the sub-block template (e.g., T2).

[0157] In one embodiment, the motion information of each subblock template (e.g., T2) in the current template (1921) of the current block (1901) may be derived based on the motion information of the corresponding subblock (e.g., (1,-1)) of the neighboring block of the co-located block (1902), for example, by copying the motion information of the corresponding subblock (e.g., (1,-1)). For example, the motion information of T1 through T4 is copied from the corresponding motion information of subblocks (0,-1), (0,-1), (0,-1), and (0,-1) in the top-neighboring coding block of the co-located block (1902), respectively. For example, the motion information of T5 through T8 is copied from the corresponding motion information of the subblocks in the left-neighboring coding block(s) of the co-located block (1902) (e.g., the left-neighboring subblock of the co-located block (1902)).

[0158] A subblock template in a current template (e.g., 1921) of a current block (e.g., 1902) may be bi-predictive or uni-predictive (e.g., using a reference picture in L0 or L1). The current template may include a first subblock template and a second subblock template. As described above, the first motion information of the first subblock template and the second motion information of the second subblock template may be determined based on different subblocks in a co-located picture (e.g., 1912). The first motion information of the first subblock template may be different from the second motion information of the second subblock template.

[0159] In one example, the first subblock template and the second subblock template are uni-predicted using a reference picture in L0 or L1. The first motion information includes MVs different from MVs in the second motion information.

[0160] In one example, the first subblock template and the second subblock template are uni-predicted. The first subblock template and the second subblock template are associated with a first reference picture in L0 and a second reference picture in L1, respectively. The first motion information includes a MV that is different from the MV in the second motion information.

[0161] In one example, referring to FIG. 19, a current template (e.g., (1921)) includes a first subblock template (e.g., T1) and a second subblock template (e.g., T6). The first subblock template (e.g., T1) is bi-predicted and has a bidirectional MV including a first MV and a second MV. For the first subblock template T1, the first MV indicates a subblock reference template F1 in a first reference picture (1913) in L0. The second MV indicates a subblock reference template B1 in a second reference picture (1914) in L1. Thus, two unidirectional subblock reference templates F1 and B1 corresponding to T1 are predicted from L0 and L1, respectively. Referring to FIG. 20, a predictor subblock template (e.g., bi-predictor subblock template) A1 corresponding to T1 may be determined based on F1 and B1, such as a weighted average of F1 and B1.

[0162] For other bi-predictive sub-block templates in the current template (1921), such as T2 to T5, T7, and T8, the sub-block reference templates (e.g., F2 to F5, F7, and F8) in the first reference picture (1913) are each determined based on corresponding motion information of other bi-predictive sub-block templates in the current template (1921) (e.g., motion information associated with the first reference picture (1913)). Similarly, the sub-block reference templates (e.g., B2 to B5, B7, and B8) in the second reference picture (1914) are each determined based on corresponding motion information of other bi-predictive sub-block templates in the current template (1921) (e.g., motion information associated with the second reference picture (1913)).

[0163] In one example, the first reference picture in L0 associated with the sub-block in the co-located block (1902) is the same first reference picture in L0 (1913), as described above. In one example, the first reference picture in L0 associated with the sub-block in the co-located block (1902) may include the first reference picture in L0 (1913) and other first reference pictures in L0.

[0164] In one example, the second reference picture in L1 associated with the sub-block in the co-located block (1902) is the same second reference picture in L1 (1914) as described above. In one example, the second reference picture in L1 associated with the sub-block in the co-located block (1902) may include the second reference picture in L1 (1914) and other second reference pictures in L1.

[0165] Referring to FIG. 20, predictor sub-block templates (e.g., bi-predictor sub-block templates) A2 to A5, A7, and A8 corresponding to T2 to T5, T7, and T8 may be determined based on F2 to F5, F7, and F8 and B2 to B5, B7, and B8, respectively, such as a weighted average of F2 to F5, F7, and F8 and B2 to B5, B7, and B8, respectively.

[0166] A second sub-block template (e.g., T6) is uni-predicted. T6 has only a single uni-directional MV. In the example shown in Figure 19, the uni-directional MV of T6 points to a sub-block reference template F6 in the first reference picture (1913). Referring to Figure 20, a predictor sub-block template (e.g., uni-predictor sub-block template) A6 corresponding to T6 may be determined based on F6. In one example, A6 is equal to F6.

[0167] Referring to FIG. 20 , the predictor template (2021) includes A1-A8. A TM cost may be derived based on the current template (1921) and the predictor template (e.g., including all predictor sub-block templates A1-A8) (2021), including the distortion between the current template (1921) and the predictor template (2021). The distortion may be determined using, but is not limited to, SAD, SATD, SSE, variance, partial SAD / SATD / SSE, mean-removed SAD / SATD / SSE, etc., as described above. In a partial SAD example, a portion of the current template (1921) and a corresponding portion of the predictor template (2021) are used to determine the TM cost. In a partial SAD example, (i) a portion of the current template (1921) and (ii) a portion of the predictor template (2021) are downsampled before being used to determine the TM cost.

[0168] In one example, the TM cost is determined as the SAD between the current template (1921) (denoted as TC) and the predictor template (2021) (denoted as TP) as follows:

[0169]

number

[0170]

number

[0171] In one embodiment, the strain value (e.g., (A k -T k ) or SAD(A k -T k ) can be modified by applying a bias factor depending on whether the sub-block templates of the current template (1921) of the current block (1901) have bidirectional MV or only unidirectional MV. In one example, when the sub-block templates of the current template (1921) have bidirectional MV, the bias factor is smaller than the bias factor used when the sub-block templates of the current template (1921) have only unidirectional MV.

[0172] In one example, a first distortion value (e.g., SAD(A1-T1)) is modified differently than a second distortion value (e.g., (SAD(A2-T2) or (SAD(A6-T6))).

[0173] In the example of Figure 19, the subblock reference templates in the first reference picture (1913) F1 to F8 correspond to T1 to T8, respectively, in the current template (1921). The subblock reference templates B1 to B5, B7, and B8 in the second reference picture (1913) correspond to T1 to T5, T7, and T8, respectively, in the current template (1921). Because T6 is uni-predicted using a unidirectional MV pointing to the first reference picture (1913), T6 does not have a corresponding subblock reference template in the second reference picture (1914).

[0174] The width (or sub-block template width) W1 and height (or sub-block template height) H1 of the sub-block templates T1 to T8 in the current template (1921) may be any suitable positive integer. The width (or sub-block width) W2 and height (or sub-block height) H2 of the sub-blocks in the co-located block (1902) may be any suitable positive integer.

[0175] The sub-block template width W1 of T1 to T4 in the upper template may be different from or the same as the sub-block width W2. The sub-block template height H1 of T5 to T8 in the left template may be different from or the same as the sub-block height H2.

[0176] In one example, the sub-block template width W1 of T1-T4 in the top template is a multiple of the sub-block width W2, such as W1=n×W2, where n is an integer greater than 1. In one example, the sub-block template height H1 of T5-T8 in the left template is a multiple of the sub-block width H2, such as H1=m×H2, where m is an integer greater than 1. In one example, n and m are 2.

[0177] The width W1 of the sub-block templates T1-T4 of the top template or the height H1 of the sub-block templates T5-T8 of the left template may depend on the coding block size, such as width, height, area size, aspect ratio, etc.

[0178] If the sub-block template width W1 of T1 to T4 in the top template is different from the sub-block width W2, for example, if W1>W2, multiple motion information from multiple sub-blocks in the co-located picture (1912) can be fetched for each sub-block template in T1 to T4. For example, if W1 is 2×W2, two pieces of motion information from sub-blocks (0,0) and (1,0) are used to determine the motion information of T1. Alternatively, two pieces of motion information from sub-blocks (0,−1) and (1,−1) are used to determine the motion information of T1.

[0179] When the sub-block template height H1 of T5 to T8 in the left template is different from the sub-block height H2, for example, when H1>H2, multiple motion information from multiple sub-blocks in the co-located picture (1912) can be fetched for each sub-block template in T5 to T8. For example, when H1 is 2×H2, two pieces of motion information from sub-blocks (0,0) and (0,1) are used to determine the motion information of T5. Alternatively, two pieces of motion information from sub-blocks (−1,0) and (−1,0) are used to determine the motion information of T5.

[0180] An average, weighted average, or median filter of multiple motion information from multiple sub-blocks in the co-located picture (1912) can be used to determine the motion information of the sub-block template in the current template (1921). The motion information of the sub-block template (e.g., T1) can then be used to identify sub-block reference templates (e.g., F1 and B1) in the reference picture to calculate the TM cost.

[0181] FIG. 19 shows an example for determining a TM cost corresponding to an SbTMVP candidate of a current block (1901) that corresponds to a DV candidate (e.g., DV(1931)) of the current block (1901). For example, motion information of multiple sub-blocks (e.g., (i) the top row of the sub-block and the left column of the sub-block, or (ii) the top-neighboring sub-block and the left-neighboring sub-block) in a co-located picture (1912) is determined based on the DV candidate (e.g., DV(1931)). Sub-block reference templates (e.g., F1-F8, B1-B5, B7, and B8) are determined based on the motion information of multiple sub-blocks in the co-located picture (1912). A predictor template (2021) may be determined based on the sub-block reference templates (e.g., F1-F8, B1-B5, B7, and B8). Then, a TM cost may be determined based on the current template (1921) and the predictor template (2021).

[0182] The current template (e.g., (1821) or (1921)) may include any appropriate samples from neighboring blocks and / or neighboring sub-blocks of the current block (e.g., (1801) or (1901)). The current template may include (i) only a top template including one or more rows of samples above the current block, (ii) only a left template including one or more columns of samples to the left of the current block, or (iii) a top template and a left template as used in FIGS. 18-19. In one example, additional sample(s) other than the top template and the left template may be included in the current template. In one example, the top template and / or the left template may be downsampled to obtain the current template. The top template and / or the left template may have any appropriate width and / or height.

[0183] In one embodiment, the subblock merge index and / or the SbTMVP MMVD index (which indicate the SbTMVP candidates in the subblock merge list) are sorted in ascending order according to TM cost. The SbTMVP candidates are sorted based on TM cost, where the SbTMVP candidates correspond to DV (or DVP only, or DVP+MMVD), and an index is signaled to indicate the selected candidate.

[0184] In one embodiment, multiple DV candidates are available for the current block. Each of the multiple DV candidates can correspond to an SbTMVP candidate for the current block. The TM cost corresponding to each SbTMVP candidate can be determined based on the corresponding DV candidate, for example, using the embodiment described in Figure 19. For example, the TM process described in Figure 19 is used to calculate the TM cost between the current template of the current block and predictor templates corresponding to multiple DV candidates in SbTMVP mode with or without DVO (e.g., MVD used in MMVD mode).

[0185] In one embodiment, the multiple DV candidates include multiple DV predictors. Each of the multiple DV predictors may be derived from a set of predetermined candidates including (i) MVs of spatially neighboring blocks of the current block, (ii) MVs of spatially neighboring sub-blocks of the current block, (iii) HMVP candidates, or (iv) candidates in a merge candidate list. In one example, if the MV of one of the predetermined candidates in the merge candidate list points to one of the co-located pictures for the current block, the MV is one of the multiple DV candidates for the current block.

[0186] HMVP candidates may reuse MVs of previously coded CUs, including non-adjacent CUs that are not adjacent to the current block.

[0187] In one example, the merge candidate list is a regular merge candidate list, such as a regular merge / skip candidate list. The regular merge candidate list may differ from the sub-block merge candidate list. The candidate(s) in the regular merge candidate list may include any suitable candidate(s) used in the regular merge / skip mode. The candidates may include spatial candidates (e.g., spatial MVPs from spatially adjacent CUs), temporal candidates (e.g., temporal MVPs from co-located CUs), HMVP candidates, pairwise average candidates (e.g., pairwise average MVPs), and / or zero MVs. The pairwise average MVP may be generated using two existing candidates in the regular merge candidate list. The regular merge / skip mode may differ from additional merge / skip modes, such as MMVD mode, CIIP mode, and GPM mode.

[0188] As described above, multiple DV predictors correspond to SbTMVP candidates. The SbTMVP candidates may be included in a subblock merge candidate list. A TM cost corresponding to each SbTMVP candidate may be determined based on the corresponding DV predictor without DVO. The SbTMVP candidates may be sorted based on their associated TM costs, such as in ascending or descending order of TM costs. An SbTMVP candidate may be selected from the sorted SbTMVP candidates to code the current block. In one example, an index, such as a subblock merge index indicating the SbTMVP candidate in the subblock merge candidate list, is signaled to indicate the selected SbTMVP candidate.

[0189] In one embodiment, the multiple DV candidates are based on a DV predictor derived from one or more candidates in the predetermined candidate set described above. The multiple DV candidates may be a vector sum of the DV predictor and a respective DV offset (or MV offset). As described above, the DV offset corresponds to the SbTMVP candidates in the sub-block merging candidate list. The TM cost corresponding to each SbTMVP candidate may be determined based on the corresponding DV candidate, which is a vector sum of the DV predictor and a respective DV offset. The SbTMVP candidates may be sorted based on their associated TM costs, such as in ascending or descending order of TM costs. An SbTMVP candidate may be selected from the sorted SbTMVP candidates for coding the current block. In one example, an index, such as a DV offset index (e.g., an MMVD index if an MMVD mode is used to determine the DV offset) indicating the SbTMVP candidate in the sub-block merging candidate list, is signaled to indicate the selected SbTMVP candidate.

[0190] In one embodiment, the multiple DV candidates include a DV predictor and a vector sum of the DV predictor and associated DV offsets corresponding to the SbTMVP candidates. A TM cost corresponding to each SbTMVP candidate may be determined based on the corresponding DV candidate (e.g., (i) the DV predictor, or (ii) the vector sum of the DV predictor and the DV offset). The SbTMVP candidates may be sorted based on their associated TM costs. An SbTMVP candidate may be selected from the sorted SbTMVP candidates for coding the current block. In one example, an index indicating the SbTMVP candidate in the sub-block merge candidate list is signaled to indicate the selected SbTMVP candidate.

[0191] In one example, after determining the TM costs corresponding to the SbTMVP candidates, the SbTMVP candidate is determined to be the SbTMVP candidate corresponding to the smallest TM cost among the TM costs. Therefore, no index is required, e.g., no index is signaled to indicate which SbTMVP candidate is selected.

[0192] In some embodiments, block-based affine transform motion compensation prediction is applied. In Figure 21A, the affine motion field of a block is described by two control point motion vectors (CPMVs) CPMV0 and CPMV1 for two control points (CPs) CP0 and CP1 when a four-parameter affine model is used. In Figure 21B, the affine motion field of a block is described by three CPMVs (CPMV0, CPMV1, CPMV3) for CPs (CP0, CP1, and CP2) when a six-parameter affine model is used.

[0193] For a four-parameter affine motion model, the motion vector at a sample position (x,y) within a block is derived as follows:

[0194]

number

[0195]

number

[0196] To simplify the motion compensation prediction, in some embodiments, sub-block-based affine transformation prediction is applied. For example, in Figure 22, a four-parameter affine motion model is used, and two CPMV (outside 1) JPEG2025525266000009.jpg13123 is determined. To derive a motion vector for each 4x4 (sample) luma sub-block (2202) divided from the current block (2210), the motion vector (2201) of the center sample of each sub-block (2202) is calculated according to Equation 3 and rounded to 1 / 16 fractional precision. A motion-compensated interpolation filter is then applied to generate a prediction for each sub-block (2202) using the derived motion vector (2201). The sub-block size of the chroma components is set to 4x4. The MV of a 4x4 chroma sub-block is calculated as the average of the MVs of the four corresponding 4x4 luma sub-blocks.

[0197] Similar to translational motion inter prediction, in some embodiments, two affine motion inter prediction modes are employed: affine merge mode and affine AMVP mode.

[0198] In some embodiments, the affine merge mode may be applied to CUs whose width and height are both 8 or greater. Affine merge candidates for the current CU may be generated based on motion information of spatially neighboring CUs. There may be up to five affine merge candidates, and an index indicating the one to be used for the current CU is signaled. For example, the following three types of affine merge candidates are used to create an affine merge candidate list:

[0199] inherited affine merge candidates extrapolated from the CPMVs of neighboring CUs; Constructed affine merge candidates, derived using the translational MVs of neighboring CUs; and Zero MV.

[0200] In some embodiments, there can be at most two inherited affine candidates derived from the affine motion models of neighboring blocks: one from the left-neighboring CU and one from the top-neighboring CU. The candidate blocks can be positioned, for example, as shown in Figure 9. For the left predictor, the scanning order is A0>A1, and for the top predictor, the scanning order is B0>B1>B2. Only the first inherited candidate from each side is selected. No pruning check is performed between the two inherited candidates.

[0201] Once the neighboring affine CUs are identified, the CPMVs of the identified neighboring affine CUs are used to derive the CPMV candidates in the affine merge list of the current CU. As shown in Figure 23, the neighboring bottom-left block A of the current CU (2310) is coded in affine mode. The motion vectors for the top-left, top-right, and bottom-left corners of the CU (2320) containing block A are: (outside 2) JPEG2025525266000010.jpg14123 is calculated. When block A is coded using the 4-parameter affine model, the two CPMVs of the current CU (2310) are (Outside 3) JPEG2025525266000011.jpg13123 is (outside 4) JPEG2025525266000012.jpg13123 and (outside 5) If block A is coded using a six-parameter affine model, the three CPMVs (not shown) of the current CU are calculated according to JPEG2025525266000013.jpg13122. (outside 6) Calculated according to JPEG2025525266000014.jpg13123.

[0202] The constructed affine candidates are constructed by combining the neighboring translational motion information of each control point. The motion information of a control point is derived from specific spatial and temporal neighbors as shown in Figure 24. CPMVk (k=1, 2, 3, 4) represents the kth control point. For CPMV1, B2>B3>A2 blocks are checked in order, and the MV of the first available block is used. For CPMV2, B1>B0 blocks are checked, and for CPMV3, A1>A0 blocks are checked. The TMVP in block T, if available, is used as CPMV4.

[0203] After the MVs of the four control points are obtained, affine merge candidates are constructed based on the motion information using the following combinations of control point MVs in order: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3}.

[0204] A combination of three CPMVs constitutes a six-parameter affine merge candidate, and a combination of two CPMVs constitutes a four-parameter affine merge candidate. To avoid the motion scaling process, if the reference indices of the control points are different, the associated combination of control point MVs is discarded.

[0205] After inherited and constructed affine merge candidates have been checked, if the list is not already full, a zero MV is inserted at the end of the merge candidate list.

[0206] TM may be applied in an affine mode, such as affine AMVP mode or affine merge mode, and is sometimes referred to as affine TM. Figure 25 shows an example of TM (2500) in affine merge mode or the like. The template (2521) of a current block (e.g., current CU) (2501) may include top current templates A0-A3 and left current templates L0-L3. The reference template (2525) of a reference block in a reference picture may include multiple sub-block templates (e.g., 4x4 sub-blocks) pointed to by control point MV (CPMV)-derived MVs of neighboring sub-blocks (e.g., A0-A3 and L0-L3 as shown in Figure 25) at block boundaries.

[0207] The search process of a TM applied in affine mode (e.g., affine merge mode) can start with CPMV0, while other CPMVs (e.g., (i) CPMV1 if a four-parameter model is used, and (ii) CPMV1 and CPMV2 if a six-parameter model is used) are kept constant. The search can be performed horizontally and vertically. In one example, the search is performed in the diagonal(s) only if the zero vector is not the best difference vector found from the horizontal and vertical searches. The affine TM can repeat the same search process for CPMV1. The affine TM can repeat the same search process for CPMV2 if a six-parameter model is used. If the zero vector is not the best difference vector from the previous iteration and the search process has run for less than three iterations, the entire search process can be restarted from the refined CPMV0 based on the refined CPMV.

[0208] In one example, a sub-block merge candidate list containing SbTMVP candidates contains only SbTMVP candidates and does not contain affine merge candidates. A separate sub-block merge candidate list is used to store affine merge candidates.

[0209] In one example, a subblock merge candidate list that includes an SbTMVP candidate also includes one or more affine merge candidates. In addition to determining the TM costs corresponding to the SbTMVP candidates, TM costs corresponding to the affine merge candidates may be determined. The SbTMVP candidates and affine merge candidates may be sorted based on the combined TM costs corresponding to the SbTMVP candidates and the affine merge candidates. In one example, (i) the TM costs corresponding to the SbTMVP candidates and / or (ii) the TM costs corresponding to the affine merge candidates are modified before sorting the SbTMVP candidates and the affine merge candidates.

[0210] A candidate (e.g., an SbTMVP candidate or an affine merge candidate) may be selected based on the sorted SbTMVP candidates and the affine merge candidates. In one example, an index is not signaled, and the candidate is the candidate corresponding to the smallest TM cost among the combined TM costs. In one example, an index indicates a candidate among the sorted SbTMVP candidates and the affine merge candidate(s).

[0211] In one example, the sub-block merging candidate list includes one SbTMVP candidate and one or more affine merging candidates.

[0212] In related technology, multiple co-located pictures are utilized for SbTMVP mode. The derivation of sub-block temporal motion information from multiple co-located pictures is described below.

[0213] In one embodiment, the multiple DV candidates described above may be associated with multiple co-located pictures. For example, the reference picture of the MV for each of the multiple DV candidates is one of the multiple co-located pictures. As described above, the SbTMVP candidates include two or more SbTMVP candidates derived from the multiple co-located pictures. A subblock merging candidate list including the SbTMVP candidates may be constructed. The motion information of the candidates (e.g., candidates in the set of predetermined candidates described above) may be checked to find an MV that uses one of the multiple co-located pictures as a reference picture. The MVs determined using the above method may be used as the multiple DV candidates for deriving the respective SbTMVP candidates, as described above.

[0214] In one embodiment, the candidates (eg, motion candidates) checked to derive the multiple DV candidates are from a subset of the set of predetermined candidates or from the entire set, as described above.

[0215] In one example, candidates (e.g., motion candidates) may be checked in a predetermined order, and all candidates with MVs that point to valid co-located pictures (e.g., one of multiple co-located pictures) may be included in the DV candidate list as DV candidates.

[0216] A pruning process may be used to derive DV candidates in the DV candidate list. For example, the DV candidate list includes a first DV candidate having a first MV that points to a first co-located picture among multiple co-located pictures. A second DV candidate having the same first MV that points to the same first co-located picture may not be added to the DV candidate list.

[0217] In one embodiment, each of the DV candidates from the DV candidate list is used to derive an SbTMVP candidate, thus forming an SbTMVP candidate list, such as the sub-block merge candidate list described above.

[0218] In one example, the SbTMVP candidates in the SbTMVP candidate list are sorted based on the TM cost, where the TM cost is determined based on the embodiments described above, such as FIGS. 18-19.

[0219] In one example, which SbTMVP candidate should be used is signaled by a candidate index in the bitstream, as described above. In another example, the SbTMVP candidate with the lowest TM cost may be used without signaling an index, as described above.

[0220] In one embodiment, the neighboring coded blocks of the current block have bi-predictive MVs. The above-described co-location picture check for determining whether one of the bi-predictive MVs (e.g., including a first MV and a second MV) can be one of multiple DV candidates may be applied to the first MV that points in a reference picture in L0, and then to the second MV that points in a reference picture in L1. Alternatively, the co-location picture check may be applied to the second MV, and then to the first MV.

[0221] In one embodiment, if one of the bi-predictive MVs (e.g., the first MV) in the neighboring block points to one of the co-located pictures, other available MVs (e.g., the second MV) pointing to the opposite reference list (e.g., L1) are not checked and not used. In one example, one of the bi-predictive MVs (e.g., the first MV) is included in multiple DV candidates.

[0222] In one embodiment, the subblock merging candidate list includes only one SbTMVP candidate. The embodiments described in this disclosure, such as those in Figures 18-19, may be applied to each of the co-located pictures and the multiple DV candidates associated with the co-located pictures. In one example, the multiple DV candidates may be sorted based on the corresponding TM costs determined using the embodiments described in this disclosure. A DV candidate may be selected based on the sorted multiple DV candidates. In one example, the DV candidate corresponds to the lowest TM cost among the TM costs. In one example, an index indicating which DV candidate is selected is signaled. The single SbTMVP candidate corresponding to the selected DV candidate may be included as a single SbTMVP candidate in the subblock merging candidate list.

[0223] In one embodiment, the DV candidate derivation method for multiple co-located pictures may be applied to derive full block-based TMVP candidates and generate multiple TMVP candidates. In one example, multiple candidates (e.g., candidates from the predetermined set of candidates described above) are available for the current block. With reference to Figure 18, for each candidate (e.g., each motion information candidate) (e.g., DV1831) of the multiple candidates for the current block, it may be determined whether the candidate's reference picture is one of the multiple co-located pictures. If the candidate's reference picture is one of the multiple co-located pictures, a co-located block (e.g., 1802) in one of the multiple co-located pictures may be determined based on the candidate (e.g., DV1831) for the current block (e.g., 1801). At least one TMVP candidate may be determined based on the motion information of (i) the co-located block or (ii) the co-located block's neighboring blocks. In one example, at least one TMVP candidate is determined based on motion information of a sub-block (2,2) of the co-located block (e.g., (1802)). In one example, at least one TMVP candidate is determined based on motion information of a neighboring block (e.g., a lower-right neighboring block) of the co-located block (e.g., (1802)).

[0224] FIG. 26 shows a flowchart outlining an encoding process (2600) according to one embodiment of the present disclosure. The process (2600) can be performed by a video / image coding device, which may include processing circuitry. Processing circuitry within a device, such as processing circuits (310), (320), (330), and (340) within a terminal device, or processing circuits performing the functions of a video encoder (e.g., (403), (603), (703)), can be configured to perform the process (2600). In some embodiments, the process (2600) is implemented with software instructions, and thus, the processing circuit performs the process (2600) when the processing circuit executes the software instructions. The process begins at (S2601) and proceeds to (S2610).

[0225] At S2610, a first co-located block in a first co-located picture may be determined based on a first displacement vector (DV) candidate of the current block in the current picture. The current block may be encoded in sub-block-based temporal motion vector prediction (SbTMVP) mode, and the first DV candidate corresponds to the first SbTMVP candidate.

[0226] At S2620, first motion information of the current template of the current block is determined based on at least one of (i) the first co-located block, or (ii) motion information of at least one neighboring block of the first co-located block.

[0227] At S2630, one of a first reference template and a first sub-block reference template associated with the first SbTMVP candidate in the first reference picture may be determined based on the first motion information of the current template. The first reference template and the current template may have the same size. The size of the first sub-block reference template may be smaller than the size of the current template.

[0228] At S2640, a first template matching (TM) cost may be determined based on the current template and one of the first reference template and the first sub-block reference template associated with the first SbTMVP candidate.

[0229] Then, the process (2600) proceeds to (S2699) and ends.

[0230] Process (2600) can be adapted appropriately for various scenarios, and the steps of process (2600) can be adjusted accordingly. One or more of the steps in process (2600) can be adapted, omitted, repeated, and / or combined. Any suitable order can be used to perform process (2600). Additional steps can be added.

[0231] In one embodiment, one of the first reference template and the first subblock reference template is the first subblock reference template. The current template includes a first subblock template and a second subblock template. The first motion information of the current template includes first motion information of the first subblock template and second motion information of a second subblock template different from the first motion information. The first motion information of the first subblock template is determined from the first subblock, and the second motion information of the second subblock template is determined from the second subblock. The first subblock and the second subblock are (i) the first co-located block, or (ii) different subblocks in at least one neighboring block of the first co-located block. The first subblock reference template is determined based on the first motion information of the first subblock template. The second subblock reference template is determined based on the second motion information of the second subblock template. The second subblock reference template may be in one of the first reference picture and the second reference picture. A predictor template may be determined based on the first sub-block reference template and the second sub-block reference template. A TM cost may be determined based on the current template and the predictor template.

[0232] In one example, the first motion information of the first subblock template is determined based on the motion information of a subblock in a first co-located block, and the subblock in the first co-located block is collocated with a subblock in a current block adjacent to the first subblock template.

[0233] In one example, first motion information of the first sub-block template is determined based on motion information of sub-blocks in at least one adjacent block of the first co-located block, where the sub-blocks in the at least one adjacent block of the first co-located block are co-located with the first sub-block template.

[0234] If the first subblock template is above the current block and the width of the first subblock template is a multiple of the width of a subblock in the first co-located block, the first motion information of the first subblock template is determined based on the motion information of the top row subblock in the first co-located block or the subblock above the first co-located block.

[0235] If the first subblock template is a left adjacent block of the current block and the height of the first subblock template is a multiple of the height of a subblock in the first co-located block, the first motion information of the first subblock template is determined based on the motion information of a subblock in the leftmost column in the first co-located block or a subblock that is a left adjacent block of the first co-located block.

[0236] In one example, one of the first reference template and the first sub-block reference template is the first reference template. In S2620, the first motion information of the current template is determined as the motion information of the center position of the first co-position block, and a first reference template associated with the first motion vector candidate is determined based on the motion information of the center position of the first co-position block.

[0237] In one embodiment, the DV candidates for the current block include the first DV candidate. The TM process may be performed as follows: For each DV candidate different from the first DV candidate, a co-located block in one of at least one co-located picture may be determined based on the respective DV candidate for the current block. The at least one co-located picture includes the first co-located picture. Motion information for the current template may be determined based on one or more motion information of (i) the co-located block associated with the respective DV candidate, or (ii) at least one neighboring block of the co-located block associated with the respective DV candidate. One of a reference template and a sub-block reference template associated with each DV candidate in the first reference picture is determined based on the motion information of the current template. The reference template associated with each DV candidate and the current template may have the same size. The size of the sub-block reference template may be smaller than the size of the current template. A TM cost may be determined based on the current template and one of the reference template and the sub-block reference template associated with the respective DV candidate. An SbTMVP candidate may be determined based on TM costs, including a first TM cost. The current block may be encoded based on the determined SbTMVP candidate.

[0238] In one example, each of the DV candidates for the current block corresponds to a respective one of the SbTMVP candidates for the current block, including the first SbTMVP candidate, and the SbTMVP candidates are sorted based on the corresponding TM costs, and an SbTMVP candidate can be selected from the sorted SbTMVP candidates.

[0239] In one example, the DV candidates include at least one of (i) the DV predictors of the current block, or (ii) the sum of the respective DV offsets and one of the DV predictors. An index may be encoded and included in the video / picture bitstream to indicate the selected SbTMVP candidate.

[0240] In one example, the SbTMVP candidate is selected as one of the sorted SbTMVP candidates corresponding to the smallest TM cost among the TM costs.

[0241] In one embodiment, the first subblock template is bi-predicted and the second subblock template is uni-predicted. The first motion information of the first subblock template includes a motion vector (MV) pointing to the first subblock reference template in the first reference picture and another MV pointing to the first subblock reference template in the second reference picture. The second motion information of the second subblock template includes an MV pointing to the second subblock reference template in the first reference picture. The first predictor subblock template is determined based on the first subblock reference template in the first reference picture and the first subblock reference template in the second reference picture. The second predictor subblock template is determined based on the second subblock reference template in the first reference picture.

[0242] In one example, the predictor template is determined based on a first predictor sub-block template and a second predictor sub-block template.

[0243] In one example, the first sub-TM cost is determined based on the first sub-block template and the first predictor sub-block template, and the second sub-TM cost is determined based on the second sub-block template and the second predictor sub-block template. The first TM cost is determined based on the first sub-TM cost and the second sub-TM cost.

[0244] In one example, the first TM cost is determined based on the first sub-TM cost, the second sub-TM cost, and at least one of (i) a first bias factor that modifies the first sub-TM cost or (ii) a second bias factor that modifies the second sub-TM cost.

[0245] In one embodiment, the subblock-based merge candidates include a first SbTMVP candidate and at least one affine merge candidate. The TM process includes (i) determining at least one TM cost of the at least one affine SbTMVP candidate, (ii) sorting the subblock-based merge candidates based on the first TM cost of the first SbTMVP candidate and the at least one TM cost of the at least one affine merge candidate, and (iii) selecting a subblock-based merge candidate from the sorted subblock-based merge candidates. The selected subblock-based merge candidate may be used to encode the current block.

[0246] In one embodiment, the at least one co-located picture includes multiple co-located pictures, and the reference picture for each of the DV candidates is one of the multiple co-located pictures.

[0247] In one example, the DV candidates are determined based on a set of predetermined candidates including at least one of (i) motion vectors (MVs) of spatially neighboring blocks of the current block, (ii) MVs of spatially neighboring sub-blocks of the current block, (iii) a history-based MV predictor (HMVP), or (iv) a candidate in a merge candidate list that includes at least one of (a) a spatial candidate, (b) a temporal candidate, (c) an HMVP candidate, (d) a pairwise average candidate, or (e) a zero MV.

[0248] In one example, the DV candidates are sorted based on their corresponding TM costs, and the SbTMVP candidate is determined based on one of the sorted DV candidates that corresponds to the smallest TM cost among the TM costs.

[0249] FIG. 27 shows a flowchart outlining a decoding process (2700) according to one embodiment of the present disclosure. The process (2700) may be performed by an apparatus for video / image coding, which may include receiving circuitry and processing circuitry. Processing circuitry within the apparatus, such as processing circuitry within terminal devices (310), (320), (330), and (340), processing circuitry performing the functions of the video encoder (403), processing circuitry performing the functions of the video decoder (410), processing circuitry performing the functions of the video decoder (510), or processing circuitry performing the functions of the video encoder (603), may be configured to perform the process (2700). In some embodiments, the process (2700) is implemented with software instructions, and thus, the processing circuitry performs the process (2700) when the processing circuitry executes the software instructions. The process begins at S2701 and proceeds to S2710.

[0250] At S2710, prediction information for the current block in the current picture may be decoded from the coded video / image bitstream. The prediction information may indicate a sub-block-based temporal motion vector prediction (SbTMVP) mode.

[0251] At S2720, a first co-located block in the first co-located picture may be determined based on a first displacement vector (DV) candidate of the current block. The first DV candidate may correspond to a first SbTMVP candidate.

[0252] At S2730, first motion information of the current template for the current block is determined based on at least one of (i) the first co-located block, or (ii) motion information of at least one neighboring block of the first co-located block.

[0253] At (2740), one of a first reference template and a first sub-block reference template associated with a first SbTMVP candidate in a first reference picture may be determined based on first motion information of a current template. The first reference template and the current template may have the same size. The size of the first sub-block reference template may be smaller than the size of the current template.

[0254] At (2750), a first template matching (TM) cost may be determined based on the current template and one of the first reference template and the first sub-block reference template associated with the first SbTMVP candidate.

[0255] The process (2700) proceeds to (S2799) and ends.

[0256] Process (2700) can be adapted appropriately for various scenarios, and the steps of process (2700) can be adjusted accordingly. One or more of the steps in process (2700) can be adapted, omitted, repeated, and / or combined. Any suitable order can be used to perform process (2700). Additional steps can be added.

[0257] In one embodiment, one of the first reference template and the first subblock reference template is the first subblock reference template. The current template includes a first subblock template and a second subblock template. The first motion information of the current template includes first motion information of the first subblock template and second motion information of the second subblock template, which is different from the first motion information. The first motion information of the first subblock template is determined from the first subblock, and the second motion information of the second subblock template is determined from the second subblock. The first subblock and the second subblock are (i) the first co-located block, or (ii) different subblocks in at least one neighboring block of the first co-located block. The first subblock reference template may be determined based on the first motion information of the first subblock template. The second subblock reference template may be determined based on the second motion information of the second subblock template. The second subblock reference template is in one of the first reference picture and the second reference picture. A predictor template may be determined based on the first sub-block reference template and the second sub-block reference template. A TM cost may be determined based on the current template and the predictor template.

[0258] In one example, the first motion information of the first subblock template is determined based on the motion information of a subblock in a first co-located block, and the subblock in the first co-located block is co-located with a subblock in a current block adjacent to the first subblock template.

[0259] In one example, first motion information of the first sub-block template is determined based on motion information of sub-blocks in at least one adjacent block of the first co-located block, where the sub-blocks in the at least one adjacent block of the first co-located block are co-located with the first sub-block template.

[0260] If the first subblock template is above the current block and the width of the first subblock template is a multiple of the width of a subblock in the first co-located block, the first motion information of the first subblock template is determined based on the motion information of the top row of subblocks in the first co-located block or the motion information of a subblock above the first co-located block.

[0261] If the first subblock template is a left adjacent block of the current block and the height of the first subblock template is a multiple of the height of a subblock in the first co-located block, the first motion information of the first subblock template is determined based on the motion information of a subblock in the leftmost column in the first co-located block or the motion information of a subblock that is a left adjacent block of the first co-located block.

[0262] In one example, one of the first reference template and the first sub-block reference template is the first reference template. At S2730, the first motion information of the current template is determined as the motion information of the center position of the first co-position block, and the first reference template associated with the first DV candidate is determined based on the motion information of the center position of the first co-position block.

[0263] In one embodiment, the DV candidates for the current block include the first DV candidate. The TM process may be performed as follows: For each DV candidate different from the first DV candidate, a co-located block in one of at least one co-located picture may be determined based on the respective DV candidate for the current block. The at least one co-located picture includes the first co-located picture. Motion information for the current template may be determined based on one or more motion information of (i) the co-located block associated with the respective DV candidate, or (ii) at least one neighboring block of the co-located block associated with the respective DV candidate. One of a reference template and a sub-block reference template associated with each DV candidate in the first reference picture is determined based on the motion information of the current template. The reference template associated with each DV candidate and the current template may have the same size. The size of the sub-block reference template may be smaller than the size of the current template. A TM cost may be determined based on the current template and one of the reference template and the sub-block reference template associated with the respective DV candidate. An SbTMVP candidate may be determined based on TM costs, including a first TM cost. The current block can be reconstructed based on the determined SbTMVP candidates.

[0264] In one example, each of the DV candidates for the current block corresponds to a respective one of the SbTMVP candidates for the current block, including the first SbTMVP candidate, and the SbTMVP candidates are sorted based on the corresponding TM costs, and an SbTMVP candidate can be selected from the sorted SbTMVP candidates.

[0265] In one example, the DV candidates include at least one of (i) the DV predictor of the current block, or (ii) the sum of the respective DV offset and one of the DV predictors. The SbTMVP candidates are selected based on an index signaled in the coded video / picture bitstream.

[0266] In one example, the SbTMVP candidate is selected as one of the sorted SbTMVP candidates corresponding to the smallest TM cost among the TM costs.

[0267] In one embodiment, the first subblock template is bi-predicted and the second subblock template is uni-predicted. The first motion information of the first subblock template includes a motion vector (MV) pointing to the first subblock reference template in the first reference picture and another MV pointing to the first subblock reference template in the second reference picture. The second motion information of the second subblock template includes an MV pointing to the second subblock reference template in the first reference picture. The first predictor subblock template is determined based on the first subblock reference template in the first reference picture and the first subblock reference template in the second reference picture. The second predictor subblock template is determined based on the second subblock reference template in the first reference picture.

[0268] In one example, the predictor template is determined based on a first predictor sub-block template and a second predictor sub-block template.

[0269] In one example, the first sub-TM cost is determined based on the first sub-block template and the first predictor sub-block template, and the second sub-TM cost is determined based on the second sub-block template and the second predictor sub-block template. The first TM cost is determined based on the first sub-TM cost and the second sub-TM cost.

[0270] In one example, the first TM cost is determined based on the first sub-TM cost, the second sub-TM cost, and at least one of (i) a first bias factor that modifies the first sub-TM cost or (ii) a second bias factor that modifies the second sub-TM cost.

[0271] In one embodiment, the sub-block-based merge candidates include a first SbTMVP candidate and at least one affine merge candidate. The TM process includes (i) determining at least one TM cost of the at least one affine merge candidate, (ii) sorting the sub-block-based merge candidates based on the first TM cost of the first SbTMVP candidate and the at least one TM cost of the at least one affine merge candidate, and (iii) selecting a sub-block-based merge candidate from the sorted sub-block-based merge candidates. The selected sub-block-based merge candidate can be used to reconstruct the current block.

[0272] In one embodiment, the at least one co-located picture includes multiple co-located pictures, and the reference picture for each of the DV candidates is one of the multiple co-located pictures.

[0273] In one example, the DV candidates are determined based on a set of predetermined candidates including at least one of (i) motion vectors (MVs) of spatially neighboring blocks of the current block, (ii) MVs of spatially neighboring sub-blocks of the current block, (iii) a history-based MV predictor (HMVP), or (iv) a candidate in a merge candidate list that includes at least one of (a) a spatial candidate, (b) a temporal candidate, (c) an HMVP candidate, (d) a pairwise average candidate, or (e) a zero MV.

[0274] In one example, the DV candidates are sorted based on their corresponding TM costs, and the SbTMVP candidate is determined based on one of the sorted DV candidates that corresponds to the smallest TM cost among the TM costs.

[0275] FIG. 28 shows a flowchart outlining a decoding process (2800) according to an embodiment of the present disclosure. The process (2800) may be performed by an apparatus for video / image coding, which may include receiving circuitry and processing circuitry. Processing circuitry within the apparatus, such as processing circuitry within terminal devices (310), (320), (330), and (340), processing circuitry performing the functions of the video encoder (403), processing circuitry performing the functions of the video decoder (410), processing circuitry performing the functions of the video decoder (510), or processing circuitry performing the functions of the video encoder (603), may be configured to perform the process (2800). In some embodiments, the process (2800) is implemented with software instructions, and thus, the processing circuitry performs the process (2800) when the processing circuitry executes the software instructions. The process begins at S2801 and proceeds to S2810.

[0276] In operation S2810, prediction information of a current block in a current picture may be decoded from a coded video / image bitstream. The prediction information may indicate inter-prediction of the current block and multiple co-located pictures.

[0277] In operation S2820, for each motion information candidate among the plurality of candidates for the current block, it is determined whether the reference picture of the motion information candidate is one of the plurality of co-located pictures.

[0278] In (2830), for each motion information candidate of the multiple candidates for the current block, if the reference picture of the motion information candidate is one of multiple co-located pictures, a co-located block in one of the multiple co-located pictures may be determined based on the motion information candidate of the current block. At least one temporal motion vector prediction (TMVP) candidate may be determined based on motion information of (i) the co-located block or (ii) a neighboring block of the co-located block. The motion information may include one motion vector (MV) for uni-prediction and two MVs for bi-prediction. A candidate list for the current block may be constructed based on the at least one TMVP candidate.

[0279] The process (2800) proceeds to (S2899) and ends.

[0280] Process 2800 can be adapted appropriately for various scenarios, and the steps of process 2800 can be adjusted accordingly. One or more of the steps in process 2800 can be adapted, omitted, repeated, and / or combined. Any suitable order can be used to perform process 2800. Additional steps can be added.

[0281] The embodiments of the present disclosure may be used separately or combined in any order. Furthermore, 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 on a non-transitory computer-readable medium.

[0282] The techniques described above may be implemented as computer software using computer-readable instructions and physically stored on one or more computer-readable media. For example, Figure 29 illustrates a computer system (2900) suitable for implementing certain embodiments of the disclosed subject matter.

[0283] Computer software can be coded using any suitable machine code or computer language, which can be assembled, compiled, linking, or similar mechanisms to produce code containing instructions that can be executed by one or more computer central processing units (CPUs), graphics processing units (GPUs), etc., directly, or via interpretation, microcode execution, etc.

[0284] The instructions may be executed on various types of computers or components thereof, including, for example, personal computers, tablet computers, servers, smartphones, gaming devices, Internet of Things devices, and the like.

[0285] 29 for computer system (2900) are exemplary in nature and are not intended to suggest any limitation as to the scope of use or functionality of the computer software implementing embodiments of the present disclosure, nor should the arrangement of components be interpreted as having any dependency or requirement regarding any one or combination of components illustrated in the exemplary embodiment of computer system (2900).

[0286] The computer system (2900) may include human interface input devices that can respond to input by one or more human users, for example, through tactile input (e.g., keystrokes, swipes, data glove movements), audio input (e.g., voice, clapping), visual input (e.g., gestures), olfactory input (not shown), etc. The human interface devices may also be used to capture certain media not necessarily directly associated with conscious human input, such as audio (e.g., speech, music, ambient sounds), images (e.g., scanned images, photographic images obtained from a still image camera), and video (e.g., two-dimensional video, three-dimensional video including stereoscopic video).

[0287] The input human interface devices may include one or more (only one of each is shown) of a keyboard (2901), a mouse (2902), a trackpad (2903), a touchscreen (2910), a data glove (not shown), a joystick (2905), a microphone (2906), a scanner (2907), and a camera (2908).

[0288] The computer system (2900) may also include certain human interface output devices. Such human interface output devices may stimulate one or more of the human user's senses through, for example, tactile output, sound, light, and smell / taste. Such human interface output devices may include haptic output devices (e.g., haptic feedback via a touchscreen (2910), data gloves (not shown), or joystick (2905), although some haptic feedback devices may not function as input devices), audio output devices (such as speakers (2909), headphones (not shown)), visual output devices (such as screens (2910), including CRT screens, LCD screens, plasma screens, and OLED screens, each with or without touchscreen input capability and each with or without haptic feedback capability, some of which may be capable of outputting two-dimensional visual output or more than three-dimensional output through means such as stereoscopic output), virtual reality glasses (not shown), holographic displays, and smoke tanks (not shown), and printers (not shown).

[0289] The computer system (2900) may include human-accessible storage devices and associated media, such as optical media including CD / DVD ROM / RW (2920), including CD / DVD or similar media (2721), thumb drives (2922), removable hard drives or solid state drives (2923), legacy magnetic media such as tape and floppy disks (not shown), and proprietary ROM / ASIC / PLD-based devices such as security dongles (not shown).

[0290] Those skilled in the art will also understand that the term "computer-readable medium" as used in connection with the subject matter disclosed herein does not encompass transmission media, carrier waves, or other transitory signals.

[0291] The computer system (2900) may also include an interface (2954) to one or more communication networks (2955). The networks may be, for example, wireless, wired, or optical. The networks may further be local, wide-area, metropolitan, vehicular, and industrial, real-time, delay-tolerant, and the like. Examples of networks include local area networks such as Ethernet; cellular networks including WLAN, GSM, 3G, 4G, 5G, LTE, and the like; television wired or wireless wide-area digital networks including cable, satellite, and terrestrial broadcast television; vehicular and industrial networks including CAN Bus; and the like. Some networks generally require an external network interface adapter attached to some general-purpose data port or peripheral bus (2949) (e.g., a USB port on the computer system (2900)); other networks are generally integrated into the core of the computer system (2900) by attachment to a system bus (e.g., an Ethernet interface to a personal computer system or a cellular network interface to a smartphone computer system), as described below. Using any of these networks, the computer system (2900) can communicate with other entities. Such communication can be one-way receive-only (e.g., broadcast TV), one-way transmit-only (e.g., from the CANbus to a specific CANbus device), or two-way, for example, to other computer systems using local or wide-area digital networks. Certain protocols and protocol stacks can be used over each of these networks and network interfaces, as described above.

[0292] The aforementioned human interface devices, human-accessible storage devices, and network interfaces may be attached to the core (2940) of the computer system (2900).

[0293] The cores (2940) may include one or more central processing units (CPUs) (2941), graphics processing units (GPUs) (2942), dedicated programmable processing units in the form of field programmable gate arrays (FPGAs) (2943), hardware accelerators for specific tasks (2944), graphics adapters (2950), etc. These devices may be connected via a system bus (2948), along with read-only memory (ROM) (2945), random access memory (2946), internal mass storage devices (2947), such as internal non-user-accessible hard drives or SSDs. In some computer systems, the system bus (2948) may be accessible in the form of one or more physical plugs to allow expansion with additional CPUs, GPUs, etc. Peripheral devices may be connected directly to the core's system bus (2948) or via a peripheral bus (2949). In one example, a screen (2910) may be connected to the graphics adapter (2950). Peripheral bus architectures include PCI, USB, etc.

[0294] The CPU (2941), GPU (2942), FPGA (2943), and accelerator (2944) can execute specific instructions, which in combination can constitute the aforementioned computer code. The computer code can be stored in ROM (2945) or RAM (2946). Also, transient data can be stored in RAM (2946), while persistent data can be stored in, for example, an internal mass storage device (2947). Rapid storage and retrieval from any of the memory devices can be enabled through the use of cache memory, which can be closely associated with one or more of the CPU (2941), GPU (2942), mass storage device (2947), ROM (2945), RAM (2946), etc.

[0295] The computer-readable medium can bear computer code for performing various computer-implemented operations. The medium and computer code may be those specially designed and constructed for the purposes of the present disclosure, or they may be of the kind well known and available to those skilled in the computer software arts.

[0296] By way of example and not limitation, the architecture (2900), and in particular a computer system having a core (2940), can provide functionality as a result of the processor (including a CPU, GPU, FPGA, accelerator, etc.) executing software embodied in one or more tangible computer-readable media. Such computer-readable media can be user-accessible mass storage devices, as introduced above, as well as media associated with the core's (2940) specific storage device that is non-transitory in nature, such as the core's internal mass storage device (2947) or ROM (2945). Software implementing various embodiments of the present disclosure can be stored in such devices and executed by the core (2940). The computer-readable media can include one or more memory devices or chips, depending on specific needs. The software can cause the core (2940), and in particular the processor (including a CPU, GPU, FPGA, etc.) therein, to perform specific processes or specific portions of specific processes described herein, including defining data structures stored in RAM (2946) and modifying such data structures according to the software-defined processes. Additionally, or alternatively, a computer system may provide functionality as a result of logic hardwired or otherwise embodied in circuitry (e.g., accelerator (2944)), which may operate in place of or in conjunction with software to perform particular processes or portions of particular processes described herein. References to software may encompass logic, where appropriate, and vice versa. References to computer-readable media may encompass, where appropriate, circuitry (such as an integrated circuit (IC)) that stores software for execution, circuitry that embodies logic for execution, or both. The present disclosure encompasses any appropriate combination of hardware and software.

[0297] Appendix A: Acronyms.

[0298] JEM: joint exploration model VVC: versatile video coding BMS: benchmark set MV: Motion Vector HEVC: High Efficiency Video Coding SEI: Supplementary Enhancement Information VUI: Video Usability Information GOPs: Groups of Pictures TUs: Transform Units PUs: Prediction Units CTUs: Coding Tree Units CTBs: Coding Tree Blocks PBs: Prediction Blocks HRD: Hypothetical Reference Decoder SNR: Signal-to-Noise Ratio CPUs: Central Processing Units GPUs: Graphics Processing Units CRT: Cathode Ray Tube LCD: Liquid-Crystal Display OLED: Organic Light-Emitting Diode CD: Compact Disc DVD: Digital Video Disc ROM: Read-Only Memory RAM: Random Access Memory ASIC: Application-Specific Integrated Circuit PLD: Programmable Logic Device LAN: Local Area Network GSM: Global System for Mobile communications LTE: Long-Term Evolution CANBus: Controller Area Network Bus USB: Universal Serial Bus PCI: Peripheral Component Interconnect FPGA: Field Programmable Gate Areas SSD: solid-state drive IC: Integrated Circuit CU: Coding Unit JVET: Joint Video Exploration Team AMVR: Adaptive Motion Vector Resolution POC: Picture Order Count SbTMVP: Subblock-based temporal motion vector prediction While this disclosure has described several exemplary embodiments, there are alterations, permutations, and various substitute equivalents that fall within the scope of this disclosure. It will thus be appreciated that those skilled in the art will be able to devise numerous systems and methods that, although not explicitly shown or described herein, embody the principles of the present disclosure and therefore are within the spirit and scope of the present disclosure.

Claims

1. A decoding method in a decoder decoding prediction information of a current block in a current picture from a coded bitstream, the prediction information indicating a sub-block-based temporal motion vector prediction (SbTMVP) mode; determining a first co-located block in a first co-located picture based on a first displacement vector (DV) candidate of the current block, the first DV candidate corresponding to a first SbTMVP candidate; determining first motion information of a current template of the current block based on one or more motion information of (i) the first co-located block, or (ii) at least one neighboring block of the first co-located block; determining one of a first reference template and a first sub-block reference template associated with the first SbTMVP candidate in a first reference picture based on the first motion information of the current template, where the first reference template and the current template have the same size and the size of the first sub-block reference template is smaller than the size of the current template; determining a first template matching (TM) cost based on the current template and the one of the first reference template and the first sub-block reference template associated with the first SbTMVP candidate. method.

2. the DV candidates for the current block include the first DV candidate; The method comprises: In carrying out the TM process, For each of the DV candidates that is different from the first DV candidate, determining a co-located block in one of at least one co-located picture based on each DV candidate of the current block, the at least one co-located picture including the first co-located picture; determining motion information of the current template based on one or more motion information of (i) the co-located block associated with the respective DV candidate, or (ii) at least one neighboring block of the co-located block associated with the respective DV candidate; determining one of a reference template associated with each DV candidate in the first reference picture and a sub-block reference template based on the motion information of the current template, wherein the reference template associated with each DV candidate and the current template have the same size, and the size of the sub-block reference template is smaller than the size of the current template; performing a TM process by determining a TM cost based on the current template and the one of the reference template and the sub-block reference template associated with each DV candidate; determining an SbTMVP candidate based on the TM costs including a first TM cost; and reconstructing the current block based on the determined SbTMVP candidate. The method of claim 1.

3. the one of the first reference template and the first sub-block reference template is the first reference template; determining the first motion information of the current template includes determining the first motion information of the current template as motion information of a center position of the first co-position block; determining the first reference template includes determining the first reference template associated with the first DV candidate based on the motion information of the center position of the first co-located block. The method of claim 1.

4. the one of the first reference template and the first sub-block reference template is the first sub-block reference template; the current template includes a first sub-block template and a second sub-block template; the first motion information of the current template includes first motion information of the first sub-block template and second motion information of the second sub-block template that is different from the first motion information; determining the first motion information of the current template includes determining the first motion information of the first sub-block template from a first sub-block and determining the second motion information of the second sub-block template from a second sub-block, wherein the first sub-block and the second sub-block are (i) the first co-located block or (ii) different sub-blocks in the at least one adjacent block of the first co-located block; The method further comprises: determining the first sub-block reference template based on the first motion information of the first sub-block template; determining a second sub-block reference template based on the second motion information of the second sub-block template, the second sub-block reference template being in one of the first reference picture and a second reference picture; determining a predictor template based on the first sub-block reference template and the second sub-block reference template; determining the first TM cost includes determining the first TM cost based on the current template and the predictor template. The method of claim 1.

5. Determining the first motion information of the first sub-block template includes: determining the first motion information of the first sub-block template based on motion information of a sub-block in the first co-located block, the sub-block in the first co-located block being co-located with a sub-block in the current block adjacent to the first sub-block template; The method of claim 4.

6. Determining the first motion information of the first sub-block template includes: determining the first motion information of the first sub-block template based on motion information of sub-blocks in the at least one neighboring block of the first co-located block, wherein the sub-blocks in the at least one neighboring block of the first co-located block are co-located with the first sub-block template; The method of claim 4.

7. the first sub-block template is bi-predicted and the second sub-block template is uni-predicted; the first motion information of the first sub-block template includes a motion vector (MV) pointing to the first sub-block reference template in the first reference picture and another MV pointing to the first sub-block reference template in a second reference picture; the second motion information of the second sub-block template includes a motion vector pointing to the second sub-block reference template in the first reference picture; Determining the predictor template comprises: determining a first predictor sub-block template based on the first sub-block reference template in the first reference picture and the first sub-block reference template in the second reference picture; determining a second predictor sub-block template based on the second sub-block reference template in the first reference picture. The method of claim 4.

8. Determining the predictor template comprises: determining the predictor template based on the first predictor sub-block template and the second predictor sub-block template. The method of claim 7.

9. Determining the first TM cost includes: determining a first sub-TM cost based on the first sub-block template and the first predictor sub-block template; determining a second sub-TM cost based on the second sub-block template and the second predictor sub-block template; determining the first TM cost based on the first sub-TM cost and the second sub-TM cost. The method of claim 7.

10. Determining the first TM cost includes: determining the first TM cost based on the first sub-TM cost, the second sub-TM cost, and at least one of (i) a first bias factor that modifies the first sub-TM cost or (ii) a second bias factor that modifies the second sub-TM cost; 10. The method of claim 9.

11. Determining the first motion information of the current template includes: determining the first motion information of the first sub-block template based on motion information of a sub-block in the top row of the first co-located block or a sub-block above the first co-located block, according to which the first sub-block template is above the current block and the width of the first sub-block template is a multiple of the width of a sub-block in the first co-located block; and determining the first motion information of the first sub-block template based on motion information of a sub-block in the leftmost column of the first co-located block or a sub-block adjacent to the left of the first co-located block, where the first sub-block template is adjacent to the left of the current block and the height of the first sub-block template is a multiple of the height of the sub-block in the first co-located block. The method of claim 4.

12. a respective one of the DV candidates of the current block corresponds to each of the SbTMVP candidates of the current block, the SbTMVP candidates including the first SbTMVP candidate; determining the SbTMVP candidate, sorting the SbTMVP candidates based on the corresponding TM costs; selecting the SbTMVP candidate from the sorted SbTMVP candidates; The method of claim 2.

13. the DV candidates include at least one of (i) a DV predictor of the current block, or (ii) a sum of a respective DV offset and one of the DV predictors; selecting the SbTMVP candidate includes selecting the SbTMVP candidate based on an index signaled in the coded bitstream. The method of claim 12.

14. The step of selecting the SbTMVP candidate includes: selecting the SbTMVP candidate as one of the sorted SbTMVP candidates corresponding to the smallest TM cost among the TM costs; The method of claim 12.

15. sub-block-based merging candidates include the first SbTMVP candidate and at least one affine merging candidate; The method determining at least one TM cost of the at least one affine merge candidate; sorting the sub-block-based merging candidates based on the first TM cost of the first SbTMVP candidate and the at least one TM cost of the at least one affine merging candidate; selecting a sub-block-based merging candidate from the reordered sub-block-based merging candidates, wherein the selected sub-block-based merging candidate is used to reconstruct the current block. The method of claim 1.

16. the at least one co-located picture includes a plurality of co-located pictures; a reference picture of each of the DV candidates is one of the plurality of co-located pictures; The method of claim 2.

17. (i) motion vectors (MVs) of spatially neighboring blocks of the current block, (ii) MVs of spatially neighboring sub-blocks of the current block, (iii) a history-based MV predictor (HMVP), or (iv) determining the DV candidate based on a set of predetermined candidates including at least one of (a) spatial candidates, (b) temporal candidates, (c) HMVP candidates, (d) pairwise average candidates, or (e) candidates in a merge candidate list having at least one of zero MVs.

17. The method of claim 16.

18. determining the SbTMVP candidate sorting the DV candidates based on the corresponding TM costs; determining the SbTMVP candidate based on one of the sorted DV candidates corresponding to a minimum TM cost among the TM costs; 17. The method of claim 16.

19. A decoding method in a decoder decoding prediction information for a current block in a current picture from a coded bitstream, the prediction information indicating inter prediction and multiple co-located pictures for the current block; For each of the plurality of candidate motion information candidates of the current block, determining whether the reference picture of the motion information candidate is a respective co-located picture among the plurality of co-located pictures; In response to the reference picture of the motion information candidate being the co-located picture among the plurality of co-located pictures, determining a co-located block in the co-located picture among the plurality of co-located pictures based on the motion information candidate of the current block; determining at least one temporal motion vector prediction (TMVP) candidate based on motion information of (i) the co-located block or (ii) a neighboring block of the co-located block, the motion information including one motion vector (MV) for uni-prediction and two MVs for bi-prediction, and a candidate list for the current block is constructed based on the at least one TMVP candidate; Decoding method.

20. 1. An apparatus for decoding, comprising: a processing circuit, the processing circuit comprising: Decoding prediction information for a current block in a current picture from the coded bitstream, the prediction information indicating a sub-block-based temporal motion vector prediction (SbTMVP) mode; determining a first co-located block in a first co-located picture based on a first displacement vector (DV) candidate of the current block, the first DV candidate corresponding to a first SbTMVP candidate; determining first motion information of a current template of the current block based on one or more motion information of (i) the first co-located block or (ii) at least one neighboring block of the first co-located block; determining one of a first reference template and a first sub-block reference template associated with the first SbTMVP candidate in a first reference picture based on the first motion information of the current template, wherein the first reference template and the current template have the same size, and the size of the first sub-block reference template is smaller than the size of the current template; determining a first template matching (TM) cost based on the current template and the one of the first reference template and the first sub-block reference template associated with the first SbTMVP candidate; Device.