Method, apparatus, and non-transitory computer-readable storage medium for motion vector refinement for geometric partition mode (GPM) - Patents.com

JP2024516076A5Active Publication Date: 2025-04-18ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023557291
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-04-07
Filing Date
2022-04-11
Publication Date
2025-04-18
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

Existing video encoding technologies, such as VVC, face challenges in achieving optimal motion vector refinement for geometric partition mode (GPM) due to limitations in current methods like template matching (TM) and merge mode with motion vector differences (MMVD), which do not effectively enhance motion prediction accuracy for GPM partitions.

Method used

The proposed method applies template matching (TM) to refine motion vectors in geometric partition mode (GPM) by dividing coding units into partitions and using template-based refinement techniques to improve motion prediction accuracy, allowing for more precise motion estimation and compensation.

Benefits of technology

This approach enhances the accuracy of motion vector refinement for GPM, leading to improved video encoding efficiency and quality by reducing errors and improving compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

A method, apparatus, and non-transitory computer-readable storage medium for video data processing are provided, the method including receiving a bitstream including coding units encoded by a geometric partition mode (GPM), decoding a first parameter associated with the coding units, the first parameter indicating whether template matching is applied to the coding units, and determining motion information for the coding units according to the first parameter, where if the first parameter indicates that template matching is applied to the coding units, the motion information is refined using template matching.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This disclosure claims benefit of priority to U.S. Provisional Patent Application No. 63 / 173,540, filed April 12, 2021, U.S. Provisional Patent Application No. 63 / 194,260, filed May 29, 2021, and U.S. Provisional Patent Application No. 63 / 215,519, filed June 27, 2021, which are incorporated by reference in their entireties herein.

[0002] Technical Field FIELD OF THE DISCLOSURE

[0002] The present disclosure relates generally to video processing, and more particularly to a method and system for motion vector refinement for geometric partition mode (GPM). [Background technology]

[0003] background

[0003] A video is a set of static pictures (or "frames") that capture visual information. To reduce storage memory and transmission bandwidth, a video can be compressed before storage or transmission and decompressed before display. The compression process is usually called encoding, and the decompression process is usually called decoding. There are various video coding formats that use standardized video coding techniques, most commonly based on prediction, transformation, quantization, entropy coding, and in-loop filtering. Video coding standards, such as the High Efficiency Video Coding (HEVC / H.265) standard, the Versatile Video Coding (VVC / H.266), and the standard AVS standard, are developed by standardization organizations that specify certain video coding formats. As more and more advanced video coding techniques are adopted into video standards, the coding efficiency of new video coding standards becomes higher and higher. Summary of the Invention [Means for solving the problem]

[0004] Summary of the Disclosure

[0004] An embodiment of the present disclosure provides a method for video data processing, the method including: receiving a bitstream including a coding unit coded by a geometric partition mode (GPM), decoding a first parameter associated with the coding unit, the first parameter indicating whether template matching is applied to the coding unit, and determining motion information for the coding unit according to the first parameter, where if the first parameter indicates that template matching is applied to the coding unit, the motion information is refined using template matching.

[0005]

[0005] An embodiment of the present disclosure provides an apparatus for video data processing, the apparatus including a memory configured to store instructions and one or more processors configured to execute the instructions to cause the apparatus to receive a bitstream including a coding unit encoded by a geometric partition mode (GPM), decode a first parameter associated with the coding unit, the first parameter indicating whether template matching is applied to the coding unit, and determine motion information for the coding unit according to the first parameter, where if the first parameter indicates that template matching is applied to the coding unit, the motion information is refined using template matching.

[0006]

[0006] An embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing a set of instructions executable by one or more processors of an apparatus to cause the apparatus to initiate a method for processing video data, the method including receiving a bitstream including coding units encoded in a geometric partition mode (GPM), decoding a first parameter associated with the coding unit, the first parameter indicating whether template matching is applied to the coding unit, and determining motion information for the coding unit according to the first parameter, where if the first parameter indicates that template matching is applied to the coding unit, the motion information is refined using template matching.

[0007] BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Embodiments and various aspects of the present disclosure are illustrated in the following detailed description and the accompanying drawings, in which various features illustrated are not drawn to scale. [Brief description of the drawings]

[0008] [Figure 1] FIG. 1 is a schematic diagram illustrating an example video sequence structure according to some embodiments of the present disclosure. [Figure 2A]

[0009] FIG. 2A is a schematic diagram illustrating an example encoding process of a hybrid video encoding system according to an embodiment of the present disclosure. [Figure 2B]

[0010] FIG. 2B is a schematic diagram illustrating another example encoding process of a hybrid video encoding system according to an embodiment of the present disclosure. [Figure 3A]

[0011] FIG. 3A is a schematic diagram illustrating an example decoding process of a hybrid video coding system according to an embodiment of the present disclosure. [Figure 3B]

[0012] FIG. 3B is a schematic diagram illustrating another example decoding process of a hybrid video encoding system according to an embodiment of the present disclosure. [Figure 4]

[0013] FIG. 4 is a block diagram of an example apparatus for encoding or decoding video in accordance with some embodiments of the present disclosure. [Diagram 5]

[0014] 1 illustrates an exemplary geometric partition mode (GPM) partition grouped by identical angles according to some embodiments of the present disclosure. [Figure 6]

[0015] 1 illustrates an example uni-predictive motion vector (MV) selection process for GPM according to some embodiments of the present disclosure. [Figure 7]

[0016] 1 illustrates an example generation of weights w0 using GPM according to some embodiments of the present disclosure. [Figure 8]

[0017] 1 illustrates an example process for weighted prediction of angle weighted prediction (AWP) according to some embodiments of the present disclosure. [Figure 9]

[0018] 1 illustrates eight example intra-prediction angles supported in AWP mode, according to some embodiments of the present disclosure. [Figure 10]

[0019] 1 illustrates seven different example weight array settings in AWP mode, according to some embodiments of the present disclosure. [Figure 11]

[0020] 13 illustrates template matching performed on a search area around an initial MV according to some embodiments of the present disclosure. [Figure 12]

[0021] 1 illustrates an exemplary flowchart of a method for applying template matching to a GPM to refine motion according to some embodiments of the present disclosure. [Figure 13A]

[0022] 1 illustrates an example template for a GPM according to some embodiments of the present disclosure. [Figure 13B]1 illustrates an example template for a GPM according to some embodiments of the present disclosure. [Figure 13C] 1 illustrates an example template for a GPM according to some embodiments of the present disclosure. [Figure 14]

[0023] 13 illustrates another exemplary flowchart of a method for applying template matching to a GPM to refine motion according to some embodiments of the present disclosure. [Figure 15A]

[0024] 13 illustrates another variation of an exemplary template for a GPM according to some embodiments of the present disclosure. [Figure 15B]

[0024] FIG. 1 illustrates another modification of an exemplary template for a GPM according to some embodiments of the present disclosure. [Figure 16]

[0025] 1 illustrates an example relationship between GPM segment modes and GPM segment angles according to some embodiments of the present disclosure. [Figure 17]

[0026] 1 illustrates example angles for a 16×16 block according to some embodiments of the present disclosure. [Figure 18A]

[0027] 18 illustrates example weights for each sample of the GPM partitioning mode for each partitioning angle shown in FIG. 17 for a 16×16 block according to some embodiments of the present disclosure. [Figure 18B] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18C] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18D] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18E]FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18F] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18G] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18H] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18I] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18J] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18K] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18L] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18M] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18N] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18O]FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18P] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18Q] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18R] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18S] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 18T] FIG. 18 illustrates example weights for each sample of the GPM partitioning modes for each partitioning angle shown in FIG. 17 for a 16×16 block, according to some embodiments of the present disclosure. [Figure 19]

[0028] 13 illustrates another exemplary flowchart of a method for applying template matching to a GPM to refine motion according to some embodiments of the present disclosure. [Figure 20]

[0029] 13 illustrates another exemplary flowchart of a method for applying template matching to a GPM to refine motion according to some embodiments of the present disclosure. [Figure 21]

[0030] 1 illustrates an exemplary flowchart of a method for applying GPM, TM, and MMVD according to some embodiments of the present disclosure. [Figure 22]

[0031] 1 illustrates an exemplary flowchart of a method for applying GPM, TM, and MMVD according to some embodiments of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] Detailed Description

[0032] Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings, in which the same reference numerals in different drawings represent the same or similar elements unless otherwise indicated. The implementations illustrated in the following description of the exemplary embodiments do not represent all implementations in accordance with the present invention. Rather, they are merely examples of apparatus and methods in accordance with aspects related to the present invention as recited in the appended claims. Certain aspects of the present disclosure are described in more detail below. In the event of a conflict with terms and / or definitions incorporated by reference, the terms and definitions provided herein shall control.

[0010]

[0033] In July 2020, the Versatile Video Coding (VVC / H.266) standard, developed by the ITU-T Video Coding Experts Group (ITU-T VCEG) and the Joint Video Experts Team (JVET) of the ISO / IEC Moving Picture Experts Group (ISO / IEC MPEG), was completed and published as an international standard. The VVC standard aims to double the compression efficiency of its predecessor, the High Efficiency Video Coding (HEVC / H.265) standard. In other words, the goal of VVC is to achieve the same subjective quality as HEVC / H.265 using half the bandwidth.

[0011]

[0034] To achieve the same subjective quality as HEVC / H.265 using half the bandwidth, JVET is developing techniques that go beyond HEVC using the joint exploration model (JEM) reference software. As the coding techniques are incorporated into JEM, JEM has achieved substantially higher coding performance than HEVC.

[0012]

[0035] The VVC standard is a recent development and continues to incorporate more coding techniques that result in better compression performance. VVC is based on the same hybrid video coding system that has been used in modern video compression standards such as HEVC, H.264 / AVC, MPEGT2, H.263, etc.

[0013]

[0036] After the completion of the VVC standard, JVET will begin to explore new encoding tools to further improve the encoding performance of the VVC standard. In January 2021, the Enhanced Compression Model (ECM) was proposed and used as a new software foundation for development tools that exceed the VVC standard.

[0014]

[0037] A video is a set of static pictures (or "frames") arranged in a time sequence to store visual information. A video capture device (e.g., a camera) can be used to capture and store those pictures in a time sequence, and a video playback device (e.g., a television, a computer, a smartphone, a tablet computer, a video player, or any end-user terminal with a display capability) can be used to display such pictures in a time sequence. In some applications, the video capture device can also transmit the captured video in real time to a video playback device (e.g., a computer with a monitor) for surveillance, conferencing, live broadcast, etc.

[0015]

[0038] To reduce the storage space and transmission bandwidth required by such applications, the video may be compressed before storage and transmission, and decompressed before display. Compression and decompression may be performed by software executed by a processor (e.g., a processor of a general-purpose computer), or by specialized hardware. A module for compression is generally referred to as an "encoder," and a module for decompression is generally referred to as a "decoder." The encoder and decoder may be collectively referred to as a "codec." The encoder and decoder may be implemented as any of a variety of suitable hardware, software, or combinations thereof. For example, hardware implementations of the encoder and decoder may include circuitry such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic circuits, or any combination thereof. Software implementations of the encoder and decoder may include program code, computer-executable instructions, firmware, or any suitable computer-implemented algorithm or process fixed in a computer-readable medium. Video compression and decompression may be performed by various algorithms or standards, such as MPEG-1, MPEG-2, MPEG-4, H.26x series, or the like. In some applications, a codec may decompress video from a first encoding standard and recompress the decompressed video using a second encoding standard. In this case, the codec may be referred to as a "transcoder."

[0016]

[0039] A video coding process can identify and keep useful information that can be used to reconstruct a picture and ignore information that is not important for reconstruction. If the ignored, unimportant information cannot be perfectly reconstructed, such a coding process may be called "lossy". Otherwise, it may be called "lossless". Most coding processes are lossy, which is a tradeoff to reduce the required storage space and transmission bandwidth.

[0017]

[0040] Useful information of the picture being coded (called the "current picture") includes changes relative to a reference picture (e.g., a previously coded and reconstructed picture). Such changes may include changes in pixel position, brightness, or color, of which position changes are of most interest. Changes in position of a group of pixels representing an object may reflect the motion of the object between the reference picture and the current picture.

[0018]

[0041] A picture that is coded without reference to another picture (i.e., the picture is its own reference picture) is called an "I-picture". If some or all blocks in a picture (e.g., blocks that generally refer to a portion of a video picture) are predicted using intra or inter prediction with one reference picture (e.g., unidirectional prediction), the picture is called a "P-picture". If at least one block in a picture is predicted with two reference pictures (e.g., bidirectional prediction), the picture is called a "B-picture".

[0019]

[0042] 1 illustrates the structure of an exemplary video sequence 100 according to some embodiments of the present disclosure. Video sequence 100 can be live video or captured and archived video. Video 100 can be real video, computer-generated video (e.g., computer game video), or a combination thereof (e.g., real video with augmented reality effects). Video sequence 100 can be input from a video capture device (e.g., a camera), a video archive containing previously captured video (e.g., video files stored in a storage device), or a video supply interface for receiving video from a video content provider (e.g., a video broadcast transceiver).

[0020]

[0043] As shown in FIG. 1, a video sequence 100 may include a series of pictures arranged temporally along a timeline, including pictures 102, 104, 106, and 108. Pictures 102-106 are consecutive, with additional pictures between pictures 106 and 108. In FIG. 1, picture 102 is an I-picture whose reference picture is picture 102 itself. Picture 104 is a P-picture whose reference picture is picture 102, as indicated by the arrow. Picture 106 is a B-picture whose reference pictures are pictures 104 and 108, as indicated by the arrow. In some embodiments, the reference picture of a picture (e.g., picture 104) may not be immediately preceding or following the picture. For example, the reference picture of picture 104 may be a picture before picture 102. It should be noted that the reference pictures of pictures 102-106 are merely examples, and this disclosure does not limit the embodiments of reference pictures to the examples shown in FIG.

[0021]

[0044] Typically, video codecs do not encode or decode an entire picture at once due to the computational complexity of such a task. Rather, they may divide a picture into basic segments and encode or decode a picture segment by segment. Such basic segments are referred to as basic processing units ("BPUs") in this disclosure. For example, structure 110 in FIG. 1 illustrates an example structure of a picture (e.g., any of pictures 102-108) of video sequence 100. In structure 110, a picture is divided into 4x4 basic processing units, whose boundaries are shown as dashed lines. In some embodiments, a basic processing unit may be referred to as a "macroblock" in some video coding standards (e.g., MPEG family, H.261, H.263, or H.264 / AVC) or as a "coding tree unit" ("CTU") in some other video coding standards (e.g., H.265 / HEVC or H.266 / VVC). The basic processing units can have variable sizes in pictures or any shape and size of pixels, such as 128x128, 64x64, 32x32, 16x16, 4x8, 16x32, etc. The size and shape of the basic processing unit can be selected based on a balance between coding efficiency and the level of detail to be maintained in the basic processing unit for a picture.

[0022]

[0045] A basic processing unit may be a logical unit that may include a group of different kinds of video data stored in a computer memory (e.g., in a video frame buffer). For example, a basic processing unit for a color picture may include a luma component (Y) representing colorless luminance information, one or more chroma components (e.g., Cb and Cr) representing color information, and related syntax elements, where the luma and chroma components may have the same size of a basic processing unit. The luma and chroma components may be referred to as "coding tree blocks" (CTBs) in some video coding standards (e.g., H.265 / HEVC or H.266 / VVC). Any operation performed on a basic processing unit may be performed repeatedly on each of its luma and chroma components.

[0023]

[0046] Video coding has multiple operation stages, examples of which are shown in Figures 2A-2B and 3A-3B. For each stage, the size of the basic processing unit may still be too large for processing, and therefore may be further divided into segments, referred to as "basic processing subunits" in this disclosure. In some embodiments, the basic processing subunits may be referred to as "blocks" in some video coding standards (e.g., MPEG family, H.261, H.263, or H.264 / AVC), or as "coding units" ("CUs") in some other video coding standards (e.g., H.265 / HEVC or H.266 / VVC). The basic processing subunits may have the same or smaller size than the basic processing units. Similar to the basic processing units, the basic processing subunits are also logical units that may include groups of different types of video data (e.g., Y, Cb, Cr, and related syntax elements) stored in computer memory (e.g., in a video frame buffer). Any operation performed on a fundamental processing sub-unit may be repeatedly performed on each of its luma and chroma components. Note that such division may be performed to further levels as required for processing. Also note that different stages may use different schemes to divide the fundamental processing units.

[0024]

[0047] For example, in the mode decision stage (an example of which is shown in FIG. 2B), the encoder can decide what prediction mode (e.g., intra-picture prediction or inter-picture prediction) to use for the basic processing unit, but the basic processing unit may be too large to make such a decision. The encoder can divide the basic processing unit into multiple basic processing sub-units (e.g., CUs, as in the case of H.265 / HEVC or H.266 / VVC) and decide the type of prediction for each individual basic processing sub-unit.

[0025]

[0048] As another example, in the prediction stage (examples of which are shown in FIGS. 2A-2B), the encoder can perform prediction operations at the level of the basic processing subunit (e.g., CU). However, in some cases, the basic processing subunit may still be too large to process. The encoder can further divide the basic processing subunit into smaller segments (e.g., called "prediction blocks" or "PBs" in H.265 / HEVC or H.266 / VVC), at which the prediction operations can be performed.

[0026]

[0049] As another example, in the transform stage (examples of which are shown in FIG. 2A-2B), the encoder may perform transform operations for residual basic processing subunits (e.g., CUs). However, in some cases, the basic processing subunits may still be too large to process. The encoder may further divide the basic processing subunits into smaller segments (e.g., called "transform blocks" or "TBs" in H.265 / HEVC or H.266 / VVC), at which level the transform operations may be performed. Note that the division scheme of the same basic processing subunit may be different in the prediction stage and the transform stage. For example, in H.265 / HEVC or H.266 / VVC, the prediction blocks and transform blocks of the same CU may have different sizes and numbers.

[0027]

[0050] 1, the fundamental processing units 112 are further divided into 3x3 fundamental processing sub-units, the boundaries of which are shown as dotted lines. Different fundamental processing units of the same picture may be divided into fundamental processing sub-units in different ways.

[0028]

[0051] In some implementations, to provide parallel processing and error resilience capabilities to video encoding and decoding, a picture can be divided into regions for processing, such that the encoding or decoding process does not depend on information about one region of a picture from any other region of the picture. In other words, each region of a picture can be processed independently. By doing so, the codec can process different regions of a picture in parallel, thus increasing the coding efficiency. Also, when data of a region is corrupted during processing or lost during network transmission, the codec can also correctly encode or decode other regions of the same picture without relying on the corrupted or lost data, thus providing error resilience capabilities. In some video coding standards, a picture can be divided into different types of regions. For example, H.265 / HEVC and H.266 / VVC provide two types of regions: "slices" and "tiles". It should also be noted that different pictures of the video sequence 100 can have different partitioning schemes for dividing the picture into regions.

[0029]

[0052] For example, in Figure 1, structure 110 is divided into three regions 114, 116, and 118, whose boundaries are shown as solid lines inside structure 110. Region 114 includes four basic processing units. Regions 116 and 118 each include six basic processing units. It should be noted that the basic processing units, basic processing sub-units, and regions of structure 110 in Figure 1 are merely examples, and the present disclosure does not limit the embodiments thereof.

[0030]

[0053] FIG. 2A shows a schematic diagram of an exemplary encoding process 200A according to an embodiment of the present disclosure. For example, the encoding process 200A may be performed by an encoder. As shown in FIG. 2A, the encoder may encode a video sequence 202 into a video bitstream 228 according to the process 200A. Similar to the video sequence 100 in FIG. 1, the video sequence 202 may include a set of pictures (referred to as "original pictures") arranged in a temporal order. Similar to the structure 110 in FIG. 1, each original picture of the video sequence 202 may be divided by the encoder into basic processing units, basic processing sub-units, or regions for processing. In some embodiments, the encoder may perform the process 200A at the level of the basic processing units for each original picture of the video sequence 202. For example, the encoder may perform the process 200A in an iterative manner, in which case the encoder may encode a basic processing unit in one iteration of the process 200A. In some embodiments, the encoder may perform process 200A in parallel for regions of each original picture of video sequence 202 (eg, regions 114-118).

[0031]

[0054] 2A , the encoder may provide a fundamental processing unit (referred to as an “original BPU”) of an original picture of a video sequence 202 to a prediction stage 204 to generate prediction data 206 and a prediction BPU 208. The encoder may subtract the prediction BPU 208 from the original BPU to generate a residual BPU 210. The encoder may provide the residual BPU 210 to a transform stage 212 and a quantization stage 214 to generate quantized transform coefficients 216. The encoder may provide the prediction data 206 and the quantized transform coefficients 216 to a binary coding stage 226 to generate a video bitstream 228. Components 202, 204, 206, 208, 210, 212, 214, 216, 226, and 228 may be referred to as the “forward path.” During process 200A, after quantization stage 214, the encoder may provide quantized transform coefficients 216 to an inverse quantization stage 218 and an inverse transform stage 220 to generate a reconstructed residual BPU 222. The encoder may add the reconstructed residual BPU 222 to a prediction BPU 208 to generate a prediction reference 224, which is used in a prediction stage 204 for the next iteration of process 200A. The components 218, 220, 222, and 224 of process 200A may be referred to as a “reconstruction path.” The reconstruction path may be used to ensure that both the encoder and decoder use the same reference data for prediction.

[0032]

[0055] The encoder may iteratively perform process 200A to encode each original BPU of the original picture (in the forward path) and generate (in the reconstruction path) a prediction reference 224 for encoding the next original BPU of the original picture. After encoding all the original BPUs of the original picture, the encoder may proceed to encode the next picture in the video sequence 202.

[0033]

[0056] Referring to process 200A, an encoder may receive a video sequence 202 generated by a video capture device (e.g., a camera). As used herein, the term "receive" may refer to receiving, inputting, acquiring, getting, obtaining, reading, accessing, or any act in any manner for inputting data.

[0034]

[0057] In the prediction step 204, in the current iteration, the encoder may receive the original BPU and a prediction reference 224, perform a prediction operation, and generate prediction data 206 and a predicted BPU 208. The prediction reference 224 may be generated from a reconstruction path of a previous iteration of the process 200A. The purpose of the prediction step 204 is to reduce information redundancy by extracting the prediction data 206, which can be used to reconstruct the original BPU as a predicted BPU 208 from the prediction data 206 and the prediction reference 224.

[0035]

[0058] Ideally, the predicted BPU 208 can be identical to the original BPU. However, due to non-ideal prediction and reconstruction operations, the predicted BPU 208 generally differs slightly from the original BPU. To record such differences, after generating the predicted BPU 208, the encoder can subtract it from the original BPU to generate the residual BPU 210. For example, the encoder can subtract the values ​​(e.g., grayscale or RGB values) of pixels of the predicted BPU 208 from the values ​​of corresponding pixels of the original BPU. Each pixel of the residual BPU 210 can have a residual value as a result of such a subtraction between the corresponding pixels of the original BPU and the predicted BPU 208. Compared to the original BPU, the predicted data 206 and the residual BPU 210 can have fewer bits, which can be used to reconstruct the original BPU without significant quality degradation. Therefore, the original BPU is compressed.

[0036]

[0059] To further compress the residual BPU 210, in the transform stage 212, the encoder can reduce spatial redundancy in the residual BPU 210 by decomposing the residual BPU 210 into a set of two-dimensional "basis patterns," where each basis pattern is associated with a "transform coefficient." The basis patterns can have the same size (e.g., the size of the residual BPU 210). Each basis pattern can represent a change frequency (e.g., frequency of luminance change) component of the residual BPU 210. No basis pattern can be reconstructed from any combination (e.g., linear combination) of any other basis patterns. In other words, the decomposition can decompose the changes in the residual BPU 210 into the frequency domain. Such a decomposition is similar to a discrete Fourier transform of a function, where the basis patterns are similar to the basis functions (e.g., trigonometric functions) of the discrete Fourier transform, and the transform coefficients are similar to the coefficients associated with the basis functions.

[0037]

[0060] Different transform algorithms may use different basis patterns. For example, various transform algorithms may be used in transform stage 212, such as discrete cosine transform, discrete sine transform, or the like. The transform in transform stage 212 is invertible. That is, the encoder may recover residual BPU 210 by inverting the transform (referred to as an "inverse transform"). For example, to recover pixels of residual BPU 210, the inverse transform may multiply the values ​​of corresponding pixels of the basis pattern by their associated coefficients and add up the products to generate a weighted sum. For a video coding standard, both the encoder and the decoder may use the same transform algorithm (and therefore the same basis pattern). Therefore, the encoder may record only the transform coefficients, and the decoder may reconstruct residual BPU 210 from the transform coefficients without receiving the basis pattern from the encoder. Compared to residual BPU 210, the transform coefficients may have fewer bits, but they may be used to reconstruct residual BPU 210 without significant quality degradation. Therefore, the residual BPU 210 is further compressed.

[0038]

[0061] The encoder can further compress the transform coefficients in the quantization stage 214. In the transform process, different basis patterns can represent different change frequencies (e.g., luminance change frequencies). Since the human eye is generally better at recognizing low-frequency changes, the encoder can ignore high-frequency change information without significant quality degradation in decoding. For example, in the quantization stage 214, the encoder can generate the quantized transform coefficients 216 by dividing each transform coefficient by an integer value (referred to as a "quantization scale factor") and rounding the quotient to its nearest integer. After such an operation, some transform coefficients of the high-frequency basis patterns can be converted to zero, and the transform coefficients of the low-frequency basis patterns can be converted to smaller integers. The encoder can ignore the zero-value quantized transform coefficients 216, which further compresses the transform coefficients. The quantization process can also be inverted, in which case the quantized transform coefficients 216 can be reconstructed into transform coefficients in the inverse operation of quantization (referred to as "dequantization").

[0039]

[0062] The quantization stage 214 may be lossy because the encoder ignores such division remainders in rounding operations. Typically, the quantization stage 214 may contribute the greatest information loss in the process 200A. The greater the information loss, the fewer bits the quantized transform coefficients 216 require. To obtain different information loss levels, the encoder may use different values ​​of the quantization parameter or any other parameter of the quantization process.

[0040]

[0063] In the binary encoding stage 226, the encoder may encode the prediction data 206 and the quantized transform coefficients 216 using a binary encoding technique, such as, for example, entropy coding, variable length coding, arithmetic coding, Huffman coding, context-adaptive binary arithmetic coding, or any other lossless or lossy compression algorithm. In some embodiments, in addition to the prediction data 206 and the quantized transform coefficients 216, the encoder may encode other information in the binary encoding stage 226, such as, for example, a prediction mode used in the prediction stage 204, parameters of the prediction operation, a type of transformation in the transformation stage 212, parameters of the quantization process (e.g., quantization parameters), encoder control parameters (e.g., bitrate control parameters), or the like. The encoder may use the output data of the binary encoding stage 226 to generate a video bitstream 228. In some embodiments, the video bitstream 228 may be further packetized for network transmission.

[0041]

[0064] Referring to the reconstruction path of process 200A, in an inverse quantization stage 218, the encoder may perform inverse quantization on the quantized transform coefficients 216 to generate reconstructed transform coefficients. In an inverse transform stage 220, the encoder may generate a reconstructed residual BPU 222 based on the reconstructed transform coefficients. The encoder may add the reconstructed residual BPU 222 to the prediction BPU 208 to generate a prediction reference 224 to be used in the next iteration of process 200A.

[0042]

[0065] It should be noted that other variations of the process 200A may be used to encode the video sequence 202. In some embodiments, the stages of the process 200A may be performed in a different order by the encoder. In some embodiments, one or more stages of the process 200A may be combined into a single stage. In some embodiments, a single stage of the process 200A may be split into multiple stages. For example, the transform stage 212 and the quantization stage 214 may be combined into a single stage. In some embodiments, the process 200A may include additional stages. In some embodiments, the process 200A may omit one or more stages in FIG. 2A.

[0043]

[0066] 2B shows a schematic diagram of another exemplary encoding process 200B according to an embodiment of the present disclosure. The process 200B may be modified from the process 200A. For example, the process 200B may be used by an encoder compliant with a hybrid video coding standard (e.g., H.26x series). Compared to the process 200A, the forward path of the process 200B additionally includes a mode decision stage 230 and divides the prediction stage 204 into a spatial prediction stage 2042 and a temporal prediction stage 2044. The reconstruction path of the process 200B additionally includes a loop filter stage 232 and a buffer 234.

[0044]

[0067] Generally, prediction techniques can be categorized into two types: spatial prediction and temporal prediction. Spatial prediction (e.g., intra-picture prediction or "intra prediction") can use pixels from one or more already coded neighboring BPUs in the same picture to predict the current BPU. That is, the prediction reference 224 in spatial prediction can include neighboring BPUs. Spatial prediction can reduce the inherent spatial redundancy of a picture. Temporal prediction (e.g., inter-picture prediction or "inter prediction") can use regions from one or more already coded pictures to predict the current BPU. That is, the prediction reference 224 in temporal prediction can include coded pictures. Temporal prediction can reduce the inherent temporal redundancy of a picture.

[0045]

[0068] Referring to process 200B, in the forward path, the encoder performs prediction operations in a spatial prediction stage 2042 and a temporal prediction stage 2044. For example, in the spatial prediction stage 2042, the encoder may perform intra prediction. For an original BPU of a picture being encoded, the prediction reference 224 may include one or more neighboring BPUs in the same picture that are coded (in the forward path) and reconstructed (in the reconstruction path). The encoder may generate the predicted BPU 208 by extrapolating the neighboring BPUs. The extrapolation technique may include, for example, linear extrapolation or interpolation, polynomial extrapolation or interpolation, or the like. In some embodiments, the encoder may perform the extrapolation at a pixel level, such as by extrapolating, for each pixel of the predicted BPU 208, the value of the corresponding pixel. The neighboring BPUs used for extrapolation can be located relative to the original BPU from various directions, such as vertically (e.g., above the original BPU), horizontally (e.g., to the left of the original BPU), diagonally (e.g., bottom-left, bottom-right, top-left, or top-right of the original BPU), or any direction defined in the video coding standard used. For intra prediction, the prediction data 206 can include, for example, the locations (e.g., coordinates) of the neighboring BPUs used, the size of the neighboring BPUs used, parameters of the extrapolation, the orientation of the neighboring BPUs used relative to the original BPU, or the like.

[0046]

[0069] As another example, in the temporal prediction stage 2044, the encoder may perform inter prediction. For an original BPU of the current picture, the prediction reference 224 may include one or more pictures (referred to as "reference pictures") that have been coded (in the forward path) and reconstructed (in the reconstruction path). In some embodiments, the reference pictures may be coded and reconstructed for each BPU. For example, the encoder may add the reconstructed residual BPU 222 to the prediction BPU 208 to generate a reconstructed BPU. When all reconstructed BPUs of the same picture have been generated, the encoder may generate the reconstructed picture as a reference picture. The encoder may perform a "motion estimation" operation to search for a matching region within a certain range (referred to as a "search window") of the reference picture. The position of the search window in the reference picture may be determined based on the position of the original BPU of the current picture. For example, the search window may be centered in the reference picture at a location having the same coordinates as the original BPU in the current picture, and may extend outward for a predetermined distance. When the encoder identifies a region similar to the original BPU within the search window (e.g., by using a pel-recursive algorithm, a block matching algorithm, or the like), the encoder can determine such region as a matching region. The matching region can have different dimensions (e.g., smaller than, equal to, larger than, or of a different shape) than the original BPU. Because the reference picture and the current picture are temporally separated in a timeline (e.g., as shown in FIG. 1), the matching region can be considered to "move" toward the location of the original BPU as time progresses. The encoder can record the direction and distance of such movement as a "motion vector." When multiple reference pictures are used (e.g., picture 106 in FIG. 1), the encoder can search for the matching region for each reference picture and determine its associated motion vector. In some embodiments, the encoder can weight the pixel values ​​of the matching region in each matching reference picture.

[0047]

[0070] Motion estimation may be used to identify various types of motion, such as, for example, translation, rotation, zooming, or the like. For inter prediction, the prediction data 206 may include, for example, the location (e.g., coordinates) of the matching region, a motion vector associated with the matching region, a number of reference pictures, weights associated with the reference pictures, or the like.

[0048]

[0071] To generate the predicted BPU 208, the encoder may perform a "motion compensation" operation. Motion compensation may be used to reconstruct the predicted BPU 208 based on the prediction data 206 (e.g., motion vectors) and the prediction reference 224. For example, the encoder may shift the matching region of the reference picture according to the motion vector, in which case the encoder may predict the original BPU of the current picture. When multiple reference pictures are used (e.g., picture 106 in FIG. 1), the encoder may shift the matching region of the reference picture according to each motion vector and average the pixel values ​​of the matching region. In some embodiments, if the encoder weights the pixel values ​​of the matching region of each matching reference picture, the encoder may add a weighted sum of the pixel values ​​of the shifted matching region.

[0049]

[0072] In some embodiments, inter prediction can be unidirectional or bidirectional. Unidirectional inter prediction can use one or more reference pictures in the same temporal direction relative to the current picture. For example, picture 104 in FIG. 1 is a unidirectional inter predicted picture where the reference picture (i.e., picture 102) precedes picture 104. Bidirectional inter prediction can use one or more reference pictures in both temporal directions relative to the current picture. For example, picture 106 in FIG. 1 is a bidirectional inter predicted picture where the reference pictures (i.e., pictures 104 and 108) are in both temporal directions relative to picture 104.

[0050]

[0073] Still referring to the forward path of the process 200B, after the spatial prediction 2042 and the temporal prediction stages 2044, in a mode decision stage 230, the encoder may select a prediction mode (e.g., one of intra prediction or inter prediction) for the current iteration of the process 200B. For example, the encoder may perform a rate-distortion optimization technique. In this technique, the encoder may select a prediction mode to minimize the value of a cost function depending on the bitrate of the candidate prediction modes and the distortion of the reconstructed reference picture under the candidate prediction modes. Depending on the selected prediction mode, the encoder may generate a corresponding prediction BPU 208 and prediction data 206.

[0051]

[0074] Within the reconstruction path of process 200B, if an intra prediction mode is selected within the forward path, after generating prediction reference 224 (e.g., the current BPU encoded and reconstructed in the current picture), the encoder may directly provide prediction reference 224 to spatial prediction stage 2042 for later use (e.g., for extrapolation of the next BPU of the current picture). The encoder may provide prediction reference 224 to loop filter stage 232, where the encoder may apply a loop filter to prediction reference 224 to reduce or eliminate distortions (e.g., blocking artifacts) introduced during encoding of prediction reference 224. The encoder may apply various loop filter techniques in loop filter stage 232, such as, for example, deblocking, sample adaptive offset, adaptive loop filter, or the like. The loop filtered reference picture may be stored in buffer 234 (or “decoded picture buffer”) for later use (e.g., to be used as an inter prediction reference picture for future pictures of video sequence 202). The encoder may store one or more reference pictures in a buffer 234 for use in the temporal prediction stage 2044. In some embodiments, the encoder may encode loop filter parameters (e.g., loop filter strength) along with the quantized transform coefficients 216, the prediction data 206, and other information in the binary encoding stage 226.

[0052]

[0075] FIG. 3A shows a schematic diagram of an exemplary decoding process 300A according to an embodiment of the present disclosure. Process 300A can be a decompression process corresponding to compression process 200A in FIG. 2A. In some embodiments, process 300A can be similar to the reconstruction path of process 200A. A decoder can decode video bitstream 228 into video stream 304 according to process 300A. Video stream 304 can be similar to video sequence 202. However, due to information loss in the compression and decompression process (e.g., quantization stage 214 in FIGS. 2A-2B), video stream 304 is generally not identical to video sequence 202. Similar to processes 200A and 200B in FIGS. 2A-2B, a decoder can perform process 300A at the level of a basic processing unit (BPU) for each picture encoded in video bitstream 228. For example, the decoder may perform process 300A in an iterative manner, in which case the decoder may decode a basic processing unit in one iteration of process 300A. In some embodiments, the decoder may perform process 300A in parallel for regions (e.g., regions 114-118) of each picture encoded in video bitstream 228.

[0053]

[0076] In FIG. 3A, a decoder may provide a portion of a video bitstream 228 associated with a basic processing unit (referred to as a "coding BPU") of a coded picture to a binary decoding stage 302. In the binary decoding stage 302, the decoder may decode the portion into prediction data 206 and quantized transform coefficients 216. The decoder may provide the quantized transform coefficients 216 to an inverse quantization stage 218 and an inverse transform stage 220 to generate a reconstructed residual BPU 222. The decoder may provide the prediction data 206 to a prediction stage 204 to generate a prediction BPU 208. The decoder may add the reconstructed residual BPU 222 to the prediction BPU 208 to generate a prediction reference 224. In some embodiments, the prediction reference 224 may be stored in a buffer (e.g., a decoded picture buffer in a computer memory). The decoder may provide the prediction reference 224 to a prediction stage 204 for a prediction operation of the process 300A.

[0054]

[0077] The decoder may iteratively perform the process 300A to decode each coded BPU of the coded picture and generate a prediction reference 224 for coding the next coded BPU of the coded picture. After decoding all coded BPUs of the coded picture, the decoder may output the picture to the video stream 304 for display and proceed to decode the next coded picture in the video bitstream 228.

[0055]

[0078] In binary decoding stage 302, the decoder may perform an inverse operation of the binary encoding technique used by the encoder (e.g., entropy encoding, variable length encoding, arithmetic encoding, Huffman encoding, context-adaptive binary arithmetic encoding, or any other lossless compression algorithm). In some embodiments, in addition to prediction data 206 and quantized transform coefficients 216, the decoder may decode other information in binary decoding stage 302, such as, for example, a prediction mode, parameters of the prediction operation, a type of transform, parameters of the quantization process (e.g., quantization parameters), encoder control parameters (e.g., bitrate control parameters), or the like. In some embodiments, if video bitstream 228 is transmitted in packets over a network, the decoder may depacketize video bitstream 228 before providing it to binary decoding stage 302.

[0056]

[0079] 3B shows a schematic diagram of another exemplary decoding process 300B according to an embodiment of the present disclosure. The process 300B may be modified from the process 300A. For example, the process 300B may be used by a decoder compliant with a hybrid video coding standard (e.g., H.26x series). Compared to the process 300A, the process 300B additionally divides the prediction stage 204 into a spatial prediction stage 2042 and a temporal prediction stage 2044, and additionally includes a loop filter stage 232 and a buffer 234.

[0057]

[0080] In the process 300B, for a coding basic processing unit (referred to as a "current BPU") of a coding picture being decoded (referred to as a "current picture"), the prediction data 206 decoded by the decoder from the binary decoding stage 302 may include various kinds of data depending on which prediction mode was used by the encoder to code the current BPU. For example, if intra prediction was used by the encoder to code the current BPU, the prediction data 206 may include a prediction mode indicator (e.g., a flag value) indicating intra prediction, parameters of the intra prediction operation, or the like. The parameters of the intra prediction operation may include, for example, the location (e.g., coordinates) of one or more neighboring BPUs used as a reference, the size of the neighboring BPUs, parameters of extrapolation, the orientation of the neighboring BPUs relative to the original BPU, or the like. As another example, if inter prediction was used by the encoder to code the current BPU, the prediction data 206 may include a prediction mode indicator (e.g., a flag value) indicating inter prediction, parameters of the inter prediction operation, or the like. Parameters for the inter prediction operation may include, for example, the number of reference pictures associated with the current BPU, weights respectively associated with the reference pictures, positions (e.g., coordinates) of one or more matching regions within each reference picture, one or more motion vectors respectively associated with the matching regions, or the like.

[0058]

[0081] Based on the prediction mode indicator, the decoder may determine whether to perform spatial prediction (e.g., intra prediction) in the spatial prediction stage 2042 or perform temporal prediction (e.g., inter prediction) in the temporal prediction stage 2044. Details of performing such spatial or temporal prediction are described in FIG. 2B and will not be repeated below. After performing such spatial or temporal prediction, the decoder may generate a prediction BPU 208. The decoder may add the prediction BPU 208 and the reconstructed residual BPU 222 to generate a prediction reference 224, as described in FIG. 3A.

[0059]

[0082] In the process 300B, the decoder can provide the prediction reference 224 to the spatial prediction stage 2042 or the temporal prediction stage 2044 for performing a prediction operation in the next iteration of the process 300B. For example, if the current BPU is decoded using intra prediction in the spatial prediction stage 2042, after generating the prediction reference 224 (e.g., the decoded current BPU), the decoder can directly provide the prediction reference 224 to the spatial prediction stage 2042 for later use (e.g., for extrapolation of the next BPU of the current picture). If the current BPU is decoded using inter prediction in the temporal prediction stage 2044, after generating the prediction reference 224 (e.g., the reference picture decoded by all the BPUs), the encoder can provide the prediction reference 224 to the loop filter stage 232 to reduce or eliminate distortion (e.g., blocking artifacts). The decoder can apply a loop filter to the prediction reference 224 in the manner described in FIG. 2B. The loop filtered reference picture may be stored in a buffer 234 (e.g., a decoded picture buffer in a computer memory) for later use (e.g., to be used as an inter-prediction reference picture for future encoded pictures of the video bitstream 228). The decoder may store one or more reference pictures in the buffer 234 for use in the temporal prediction stage 2044. In some embodiments, the prediction data may further include loop filter parameters (e.g., loop filter strength). In some embodiments, if the prediction mode indicator of the prediction data 206 indicates that inter prediction was used to encode the current BPU, the prediction data includes loop filter parameters.

[0060]

[0083] FIG. 4 is a block diagram of an exemplary device 400 for encoding or decoding video, according to an embodiment of the present disclosure. As shown in FIG. 4, the device 400 may include a processor 402. When the processor 402 executes instructions described herein, the device 400 may become a specialized machine for video encoding or decoding. The processor 402 may be any type of circuitry capable of manipulating or processing information. For example, the processor 402 may include any number or combination of a central processing unit (or "CPU"), a graphics processing unit (or "GPU"), a neural processing unit ("NPU"), a microcontroller unit ("MCU"), an optical processor, a programmable logic controller, a microcontroller, a microprocessor, a digital signal processor, an intellectual property (IP) core, a programmable logic array (PLA), a programmable array logic (PAL), a generic array logic (GAL), a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a system on a chip (SoC), an application specific integrated circuit (ASIC), or the like. In some embodiments, processor 402 may also be a set of processors grouped together as a single logical entity. For example, as shown in FIG. 4, processor 402 may include multiple processors, including processor 402a, processor 402b, and processor 402n.

[0061]

[0084] The device 400 may also include a memory 404 configured to store data (e.g., a set of instructions, computer code, intermediate data, or the like). For example, as shown in FIG. 4, the stored data may include program instructions (e.g., program instructions for performing steps in a process 200A, 200B, 300A, or 300B) as well as data for processing (e.g., video sequence 202, video bitstream 228, or video stream 304). The processor 402 may access (e.g., via bus 410) the program instructions and data for processing, execute the program instructions, and perform operations or manipulations on the data for processing. The memory 404 may include a high-speed random access storage device or a non-volatile storage device. In some embodiments, the memory 404 may include any number or combination of a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard drive, a solid-state drive, a flash drive, a security digital (SD) card, a memory stick, a compact flash (CF) card, or the like. The memory 404 can also be a group of memories (not shown in FIG. 4) grouped as a single logical entity.

[0062]

[0085] Bus 410 can be a communication device that transfers data between components internal to apparatus 400, such as an internal bus (e.g., a CPU-memory bus), an external bus (e.g., a Universal Serial Bus port, a Peripheral Component Interconnect Express port), or the like.

[0063]

[0086] For ease of explanation and without creating ambiguity, the processor 402 and other data processing circuitry are collectively referred to in this disclosure as "data processing circuitry." The data processing circuitry may be implemented entirely as hardware, or as a combination of software, hardware, or firmware. In addition, the data processing circuitry may be a single independent module, or may be fully or partially combined with any other components of the device 400.

[0064]

[0087] The device 400 may further include a network interface 406 for providing wired or wireless communication with a network (e.g., the Internet, an intranet, a local area network, a mobile communication network, or the like). In some embodiments, the network interface 406 may include any number or combination of a network interface controller (NIC), a radio frequency (RF) module, a transponder, a transceiver, a modem, a router, a gateway, a wired network adapter, a wireless network adapter, a Bluetooth® adapter, an infrared adapter, a near field communication ("NFC") adapter, a cellular network chip, or the like.

[0065]

[0088] In some embodiments, apparatus 400 may optionally further include a peripheral interface 408 for providing a connection to one or more peripheral devices. As shown in Figure 4, the peripheral devices may include, but are not limited to, a cursor control device (e.g., a mouse, a touchpad, or a touch screen), a keyboard, a display (e.g., a cathode ray tube display, a liquid crystal display, or a light emitting diode display), a video input device (e.g., a camera, or an input interface coupled to a video archive), or the like.

[0066]

[0089] It should be noted that a video codec (e.g., a codec performing processes 200A, 200B, 300A, or 300B) may be implemented as any combination of any software or hardware modules within device 400. For example, some or all of the stages of processes 200A, 200B, 300A, or 300B may be implemented as one or more software modules of device 400, such as program instructions that may be loaded into memory 404. As another example, some or all of the stages of processes 200A, 200B, 300A, or 300B may be implemented as one or more hardware modules of device 400, such as specialized data processing circuitry (e.g., FPGA, ASIC, NPU, or the like).

[0067]

[0090] This disclosure provides a method for performing motion vector refinement for a GPM.

[0068]

[0091] VVC supports geometric partition mode (GPM) for inter prediction. GPM is signaled using a CU level flag as a type of merge mode, along with other merge modes such as normal merge mode, merge mode by motion vector difference (MMVD) mode, combined inter-intra prediction (CIIP) mode, and sub-block merge mode. Possible CU size w×h=2 m ×2 n A total of 64 partitions per m, n ∈ {3...6} are supported by the GPM, excluding 8 × 64 and 64 × 8.

[0069]

[0092] When GPM is used, a CU is divided into two parts by a geometrically positioned straight line. FIG. 5 illustrates an exemplary GPM (geometric partition mode) partition grouped by the same angle according to some embodiments of the present disclosure. As shown in FIG. 5, the location of the partition line is mathematically derived from the angle and offset parameters of a particular partition. Each part of the geometric partition in a CU is inter-predicted using its own motion, and only unidirectional prediction is allowed for each partition. That is, each part has one motion vector and one reference index. This unidirectional prediction motion constraint is applied to ensure that only two motion compensated predictions are needed for each CU (which is the same as conventional bidirectional prediction). The unidirectional prediction motion for each partition is derived using a unidirectional prediction candidate list construction process, which is described in more detail below.

[0070]

[0093] When GPM is used for the current CU, the prediction signal for the entire CU is represented as follows: A geometric partition index (angle and offset) is signaled, indicating the partition mode of the geometric partition. Then two merge indices (one per partition) are further signaled. The size of the maximum number of GPM candidates is explicitly signaled in the SPS, specifying the binarization of the syntax for the GPM merge index. After predicting each part of the geometric partition, the sample values ​​along the edge of the geometric partition are adjusted using a blending process with adaptive weights, which will be described in more detail below. The transformation and quantization process applied to the entire CU will be the same as the process applied for other prediction modes. Finally, the motion field of the CU predicted using GPM is stored. The detailed process for storing the motion field for the GPM will be described in more detail below.

[0071]

[0094] The details of the unidirectional prediction candidate list construction process are described below. The unidirectional prediction candidate list is directly derived from the merge candidate list constructed for normal merge mode. Denote the index of the unidirectional prediction motion in the geometric unidirectional prediction candidate list by n. Use the motion vector of the nth extended merge candidate, denoted by LX (X is equal to the parity of n), as the nth unidirectional prediction motion vector for GPM. Figure 6 illustrates an exemplary unidirectional prediction motion vector (MV) selection process for GPM according to some embodiments of the present disclosure. As shown in Figure 6, the motion vectors are marked with "x". If there is no corresponding LX motion vector of the nth extended merge candidate, use the L(1-X) motion vector of the same candidate instead as the unidirectional prediction motion vector for GPM.

[0072]

[0095] Regarding the process for blending along the edge of a geometric partition, we predict each part of the geometric partition using its unique motion, and then apply blending to the two predicted signals of each part to derive samples around the edge of the geometric partition. The blending weights for each CU position are derived based on the distance between the individual position and the edge of the partition.

[0073]

[0096] 7 illustrates an example generation of weight w0 using GPM according to some embodiments of the present disclosure. As shown in FIG. 7, the distance of a location (x,y) to the edge of a partition is derived as follows:

number

[0074]

[0097] Derive the weights for each part of the geometric partition as follows:

number

[0075]

[0098] With respect to field storage for a GPM, MV1 from a first portion of the geometric partition, MV2 from a second portion of the geometric partition, and the combined MV of MV1 and MV2 are stored in the motion field of a GPM-encoded CU.

[0076]

[0099] The type of motion vector to be stored for each location in the motion field is determined as follows: sType=abs(motionIdx)<32?2:(motionIdx≦0?(1-partIdx):partIdx) (8) where motionIdx is equal to d(4x+2,4y+2) recalculated from equation (1). partIdx depends on the angular index i.

[0077]

[0100] If sType is equal to 0 or 1, then MV1 or MV2 is stored in the corresponding motion field, otherwise if sType is equal to 2, then a combined MV from MV1 and MV2 is stored. The combined MV is generated using the following process: (1) if MV1 and MV2 are from different reference picture lists (one from L0 and the other from L1), then MV1 and MV2 are simply combined to form a bi-directional predicted motion vector, (2) otherwise if MV1 and MV2 are from the same list, then only the uni-directional predicted motion vector MV2 is stored.

[0078]

[0101] Similar to GPM in VVC, a tool called Angle Weighted Prediction (AWP) is adopted in Audio Video Coding Standard 3 (AVS3). The AVS3 video standard was developed by the AVS workgroup established in China in 2002. The predecessors of the AVS3 standard, AVS1 and AVS2, were published as Chinese national standards in 2006 and 2016, respectively. In AVS3, the AWP mode is supported for skip and direct modes. The AWP mode is signaled using a CU level flag as a kind of skip or direct mode. In the AWP mode, a motion vector candidate list containing five different unidirectional predictive motion vectors is constructed by deriving a motion vector from spatial neighboring blocks and a temporal motion vector predictor. Then, two unidirectional predictive motion vectors are selected from the motion vector candidate list to predict the current block. Unlike the bidirectional predictive inter mode, which has equal weights for all samples, each sample coded in the AWP mode may have a different weight. The weight of each sample is predicted from a weight array with values ​​from 0 to 8.

[0079]

[0102] FIG. 8 illustrates an example process for weight prediction in angle weighted prediction (AWP), according to some embodiments of the present disclosure. FIG. 9 illustrates eight example intra prediction angles supported in AWP mode, according to some embodiments of the present disclosure. FIG. 10 illustrates seven different example weight array settings in AWP mode, according to some embodiments of the present disclosure. As shown in FIG. 8, angle weight prediction is similar to the process of intra prediction mode. Possible CU sizes w×h=2, with m,n∈{3...6} m ×2 nFor each AWP mode, a total of 56 different types of weights are supported by the AWP mode, including 8 intra prediction angles (shown in FIG. 9) and 7 different weight array settings (shown in FIG. 10). It should be noted that the AWP mode is directly signaled to the decoder without prediction. The AWP mode index is binarized using truncated binary notation, i.e., indexes from 0 to 7 are coded using 5 bits, and indexes from 8 to 55 are coded using 6 bits.

[0080]

[0103] Suppose the two selected unidirectional predictive motion vectors are MV1 and MV2. Two predictive blocks P0 and P1 are obtained by performing motion compensation using MV1 and MV2 respectively. The final predictive block P is calculated as follows: P = (P0 × w0 + P1 × (8 - w0)) >> 3 (9) where w0 is the weighting matrix derived by the weighted prediction method described above.

[0081]

[0104] After prediction, the unidirectionally predicted motion vectors are stored with a granularity of 4x4: for each 4x4 unit, one of two unidirectionally predicted motion vectors is stored.

[0082]

[0105] Template matching (TM) is a decoder-side MV derivation method for refining the motion information of a current CU by finding the closest match between a template in a current picture (e.g., a neighboring block above and / or to the left of the current CU) and a block in a reference picture (e.g., the same size as the template). Figure 11 illustrates template matching performed on a search area around an initial MV according to some embodiments of the present disclosure. As shown in Figure 11, a better MV is searched around the initial motion of the current CU within a search range of [-8, +8] pixels. The TM mode can be applied to merge mode and AMVP mode.

[0083]

[0106] When applied to merge mode, the merge candidate indicated by the signaled merge index is used as the initial motion. The search method shown in Table 1 is performed to refine the motion. Depending on whether an alternative interpolation filter (used when the AMVR is of half-pixel mode) is used according to the merged motion information, the TM can run up to 1 / 8-pixel MVD accuracy or skip beyond half-pixel MVD accuracy.

[0084] [Table 1]

[0085]

[0107] In AMVP mode, the MVP candidate is determined based on the error of template matching to obtain the one that reaches the minimum difference between the template of the current block and the template of the reference block, and then the TM performs MV refinement only on this particular MVP candidate. The TM refines this MVP candidate starting from 1-pel MVD accuracy (or 4-pel for 4-pel AMVR mode) within the search range of [-8, +8] pixels by using an iterative diamond search. Depending on the AMVR mode specified in Table 1, the AMVP candidate can be further refined by using a cross search with 1-pel MVD accuracy (or 4-pel for 4-pel AMVR mode) followed by half-pel and quarter-pel ones. This search process ensures that the MVP candidate still keeps the same MV accuracy as indicated by the AMVR mode after the TM process.

[0086]

[0108] A merge mode by motion vector difference (MMVD) is introduced in VVC to signal MVD for merge candidates. The MMVD flag is signaled immediately after sending the normal merge flag to specify whether the MMVD mode is used for a CU. In MMVD, after a merge candidate is selected, it is further refined by the signaled MVD information. The further information includes a merge candidate flag, an index to indicate the magnitude of the motion, and an index to indicate the direction of the motion. In the MMVD mode, one of the first two candidates in the merge list is selected to use as the basis for the MV. An MMVD candidate flag is signaled to indicate which one to use between the first and second merge candidates.

[0087]

[0109] The distance index specifies the information of the magnitude of the motion and indicates a predefined offset from the starting point. In MMVD mode, the offset is added to the horizontal or vertical component of the starting MV. The relationship between the distance index and the predefined offset is specified in Table 2 below.

[0088] [Table 2]

[0089]

[0110] The direction index represents the direction of the MVD relative to the starting point. The direction index can represent four directions as shown in the table below. It should be noted that the meaning of the sign of the MVD can change depending on the information of the starting MV. If the starting MV is a unidirectionally predicted MV or a bidirectionally predicted MV with both lists pointing to the same side of the current picture (e.g., the picture order counts (POC) of the two references are both greater than the POC of the current picture, or both less than the POC of the current picture), the sign in the table below specifies the sign of the MV offset added to the starting MV. If the starting MV is a bidirectionally predicted MV with two MVs pointing to different sides of the current picture (e.g., the POC of one reference is greater than the POC of the current picture, and the POC of the other reference is less than the POC of the current picture), and the difference of the POC in list 0 is greater than the difference of the POC in list 1, the sign in the table below specifies the sign of the MV offset added to the MV component of list 0 of the starting MV, and the sign of the MV in list 1 has the opposite value. Otherwise, if the difference in POC in list 1 is greater than in list 0, then the sign in the table below specifies the sign of the MV offset added to the MV components of list 1 of the starting MV, and the sign of the MV in list 0 has the opposite value.

[0090] [Table 3]

[0091]

[0111] Recently, it has been proposed that MMVD is applied to GPM. When a CU is coded using the GPM mode, each geometric partition is free to choose whether its motion is refined by the signaled MVD information. Two additional flags are signaled to indicate whether MMVD is applied to the two geometric partitions, respectively. To allow more flexible combinations of refining MVs of two GPM partitions, it is noted that the following conditions can be applied to the two selected MVs of the two GPM partitions: If neither the first nor the second GPM partition applies MV refinement, the two selected MVs of the two GPM partitions are not allowed to be identical. b. If one of the two GPM partitions applies MV refinement and the other does not, it is accepted that the two selected MVs of the two GPM partitions are identical. c. If two GPM compartments both apply MV refinement, then the two selected MVs are considered to be the same if the MV refinements of the two compartments are different, and are not considered to be the same if the two MV refinements are identical.

[0092]

[0112] The TM mode refines the motion at the decoder side without signaling motion vector differentials, but it only applies to normal merge mode and not to GPM, so GPM cannot benefit from the TM mode, which can provide more accurate motion prediction for either or both of the GPM partitions.

[0093]

[0113] In this disclosure, we propose a method for applying template matching to GPM to refine the motion.

[0094]

[0114] FIG. 12 illustrates an example flowchart of a method 1200 for applying template matching to a GPM to refine motion, according to some embodiments of the present disclosure. The method 1200 may be performed as part of a video encoding process (e.g., process 200A of FIG. 2A or process 200B of FIG. 2B) or by one or more software or hardware components of an apparatus (e.g., apparatus 400 of FIG. 4). For example, a processor (e.g., processor 402 of FIG. 4) may perform the method 1200. In some embodiments, the method 1200 may be implemented by a computer program product embodied in a computer-readable medium that includes computer-executable instructions, such as program code, executed by a computer (e.g., apparatus 400 of FIG. 4). With reference to FIG. 12, the method 1200 may include the following steps 1202-1206.

[0095]

[0115] In step 1202, it is determined whether the CU is encoded by the GPM.

[0096]

[0116] In step 1204, in response to the CU being encoded with a GPM that splits the CU into a first partition and a second partition, a parameter is signaled to indicate whether TM is applied. For example, the parameter can be a flag used to indicate whether TM is applied to the entire CU (e.g., the flag is signaled at the CU level), or multiple parameters (e.g., flags) can be used to indicate whether TM is applied to various partitions, respectively. Further details regarding the parameters are further described below.

[0097]

[0117] In step 1206, in response to the TM being applied, the TM is used to refine the motion of the GPM partition. If a TM is not applied to the CU, the motion is not refined. In some embodiments, if a TM is not applied to the CU, other methods may be used to refine the motion.

[0098]

[0118] In some embodiments, to obtain more flexibility, it is determined whether to apply TM to each partition respectively. For example, when the coding unit is coded by GPM, a first parameter (e.g., a first flag) is signaled to indicate whether the first motion (indicated by the first merge index) of the first partition is refined using TM. Then, a second parameter (e.g., a second flag) is signaled to indicate whether the second motion (indicated by the second merge index) of the second partition is refined using TM. An example is shown in Table 4.

[0099] [Table 4]

[0100]

[0119] If the first parameter and the second parameter are both equal to 0, then TM is not applied to the two segments. If the first parameter is equal to 0 and the second parameter is equal to 1, then TM is applied only to the second segment. If the first parameter is equal to 1 and the second parameter is equal to 0, then TM is applied only to the first segment. If the first parameter and the second parameter are both equal to 1, then TM is applied to both segments.

[0101]

[0120] It is noted that, as shown in Table 5, the first and second parameters can be combined into a third parameter (eg, an index).

[0102] [Table 5]

[0103]

[0121] When the third parameter is equal to 0, TM is not applied to the two segments. Neither the first movement of the first segment nor the second movement of the second segment is refined using TM. When the third parameter is equal to 1, TM is applied only to the second segment. The second movement of the second segment is refined using TM, whereas the first movement of the first segment is not refined. When the third parameter is equal to 2, TM is applied only to the first segment. The first movement of the first segment is refined using TM, whereas the second movement of the second segment is not refined. When the third parameter is equal to 3, TM is applied to both segments. Both the first and second movements are refined using TM. In some embodiments, when the third parameter is equal to 1, TM is applied only to the first segment. When the third parameter is equal to 2, TM is applied only to the second segment.

[0104]

[0122] In some embodiments, when refining the motion of the GPM, the template is constructed from the neighboring samples to the left and / or above. Figures 13A to 13C respectively show three example templates for a GPM according to some embodiments of the present disclosure.

[0105]

[0123] As shown in FIG. 13A, the template is composed of both the left neighbor sample and the above neighbor sample. To obtain more flexibility, in some embodiments, instead of always using both the above neighbor sample and the left neighbor sample, only the left neighbor sample or only the above neighbor sample can be used. As shown in FIG. 13B, the template is composed of only the above neighbor sample. As shown in FIG. 13C, the template is composed of only the left neighbor sample. Furthermore, when TM is applied to a GPM coded block, several parameters are signaled to indicate which of the three templates is used. For example, an index is signaled to indicate the template. If the index is equal to 0, the above neighbor sample and the left neighbor sample are used to construct the template (as shown in FIG. 13A). If the index is equal to 1, the above neighbor sample is used (as shown in FIG. 13B). If the index is equal to 2, the left neighbor sample is used (as shown in FIG. 13C). In some embodiments, three parameters are signaled to indicate three templates respectively.

[0106]

[0124] It is conceivable that each partition can select the template independently, for example the first partition can select the above adjacent sample as the template, the second partition can select the left adjacent sample as the template, etc.

[0107]

[0125] The above embodiments may be combined in any suitable manner. Figure 14 illustrates another exemplary flowchart of a method 1400 for applying template matching to a GPM to refine motion, according to some embodiments of the present disclosure. As shown in Figure 14, the method 1400 may include the following steps 1402-1410:

[0108]

[0126] In step 1402, it is determined whether the CU is encoded by the GPM.

[0109]

[0127] In step 1404, in response to the CU being encoded by a GPM that divides the CU into a first partition and a second partition, a first parameter (e.g., a first flag) is signaled to indicate whether TM is applied to the first partition.

[0110]

[0128] In step 1406, a second parameter (e.g., a second flag) is signaled to indicate whether TM is applied to the second partition, so that it is possible to individually reveal whether TM is applied to the partition.

[0111]

[0129] In step 1408, in response to TM being applied to the first segment, a first index is signaled to indicate which of the three templates is used to refine the motion of the first segment. If TM is not applied to the first segment, the first index is not signaled.

[0112]

[0130] In step 1410, in response to TM being applied to the second segment, a second index is signaled to indicate which of the three templates is used to refine the motion of the second segment. If TM is not applied to the second segment, the second index is not signaled.

[0113]

[0131] The TM can then be used with the template determined by the first index to refine the motion of the first segment, and the TM can be used with the template determined by the second index to refine the motion of the second segment.

[0114]

[0132] In some embodiments, instead of signaling which template to use, we propose to derive the template based on the GPM.

[0115]

[0133] 15A and 15B show another modification of an example template for GPM according to some embodiments of the present disclosure. In general, instead of signaling the index of the template for a given GPM partition, the selection of the template (left adjacent sample, upper adjacent sample, or both left and upper adjacent samples) may depend on the partition mode of the GPM. Take any of the GPM partitions as an example, if the GPM partition has only upper adjacent samples, only the upper template is used, if the GPM partition has only left adjacent samples, only the left template is used, and if the GPM partition has both upper and left adjacent samples, both the upper and left templates are used.

[0116]

[0134] As shown in Figure 15A, in the first section 1510A, only the top template 1511A is used to refine the motion, and in the second section 1520A, only the left template 1521A is used to refine the motion.

[0117]

[0135] As shown in Figure 15B, in the first section 1510B, both the left template and the top template 1511B are used to refine the motion. In the second section 1520B, only the top template 1521B is used to refine the motion.

[0118]

[0136] In some embodiments, the template is derived based on the GPM partition angle. Figure 16 illustrates an example relationship between the GPM partition mode and the GPM partition angle, according to some embodiments of the present disclosure. In the syntax, the GPM partition mode can be denoted as merge_gpm_partition_idx, the GPM partition angle can be denoted as angleIdx, and the distance can be denoted as distanceIdx. As shown in Figure 16, there are a total of 64 partition modes, including 20 angles and 4 distances.

[0119]

[0137] During the refinement of the GPM motion, a template is first selected from only the left adjacent sample, only the upper adjacent sample, or from both the left and upper adjacent samples according to the segment angle. The basic principle for template selection is as follows: For a segment, determine the upper and left adjacent samples. If only the upper adjacent sample is available for the segment and the left adjacent sample is not available, a template is selected from only the upper adjacent sample. If only the left adjacent sample is available for the segment and the upper adjacent sample is not available, a template is selected from only the left adjacent sample. If both the left and upper adjacent samples are available, a template is selected from both the left and upper adjacent samples.

[0120]

[0138] FIG. 17 illustrates example angles for a 16×16 block according to some embodiments of the present disclosure. As shown in FIG. 17, the block can be partitioned at various angles, e.g., with different numerical values ​​shown as partition angles. FIG. 18A-T illustrates example weights for each sample of various GPM partition modes for each partition angle shown in FIG. 17 for a 16×16 block according to some embodiments of the present disclosure. As shown in FIG. 18A-T, a CU is partitioned into a first partition 1810 and a second partition 1820 by a partition line. Adaptive weights are used to adjust sample values ​​along the edges (partition lines) of the geometric partition. The first partition 1810 is predicted using a first motion indicated by a first merge index, and the second partition 1820 is predicted using a second motion indicated by a second merge index. The first merge index and the second merge index are signaled when the block is coded using GPM. As shown in Figures 18A, 18B, 18C, 18I, 18J, 18K, 18L, 18M, 18S, and 18T, for each of segment angles 0, 2, 3, 13, 14, 16, 18, 19, 29, and 30, the upper adjacent sample is selected as a template for the first segment predicted using the first motion, and the left adjacent sample and the upper adjacent sample are selected as templates for the second segment predicted using the second motion. As shown in Figures 18D and 18N, for each of segment angles 4 and 20, the upper adjacent sample is selected as a template for the first segment, and the left adjacent sample is selected as a template for the second segment. As shown in Figures 18E, 18F, 18G, 18O, 18P, and 18Q, for segment angles 5, 8, 11, 21, 24, and 27, the left adjacent sample and the top adjacent sample are both selected as templates for the first segment, and the left adjacent sample is selected as a template for the second segment. For segment angles 12 and 28, the left adjacent sample and the top adjacent sample are both selected as templates for the first and second segments.

[0121]

[0139] When refining the GPM movement, the search pattern can be any one of the patterns shown in Table 1. In some embodiments, the search method can be the same as that used for merge mode with the alternative interpolation filter turned off.

[0122]

[0140] FIG. 19 illustrates another exemplary flowchart of a method 1900 for applying template matching to a GPM to refine motion, according to some embodiments of the present disclosure. The method 1900 may be performed as a video encoding process (e.g., process 200A of FIG. 2A or process 200B of FIG. 2B) or by one or more software or hardware components of an apparatus (e.g., apparatus 400 of FIG. 4). For example, a processor (e.g., processor 402 of FIG. 4) may perform the method 1900. In some embodiments, the method 1900 may be implemented by a computer program product embodied in a computer-readable medium that includes computer-executable instructions, such as program code, executed by a computer (e.g., apparatus 400 of FIG. 4). With reference to FIG. 19, the method 1900 may include the following steps 1902-1912.

[0123]

[0141] In step 1902, it is determined whether the CU is coded in TM mode.

[0124]

[0142] In step 1904, in response to the CU being coded by the TM mode, a flag is signaled to indicate whether the CU is split into two partitions and predicted using GPM. For example, if the flag is equal to 1, the CU is split into a first partition and a second partition, and GPM is used for prediction. If the flag is equal to 0, GPM is not applied and the CU is not split.

[0125]

[0143] In step 1906, in response to the GPM being applied to the CU, one partition mode and two merge indexes are further signaled. Thus, when the GPM is applied, the CU is split based on the partition mode. Two merge indexes indicating two movements of the first partition and the second partition, respectively, are signaled.

[0126]

[0144] In step 1908, the TM is used to refine the two moves indicated by the two merge indexes.

[0127]

[0145] In some embodiments, the method 1900 may further include steps 1910 and 1912.

[0128]

[0146] In step 1910, motion compensation is performed using the refined motion.

[0129]

[0147] In step 1912, a blending process along the edges of the geometric partition is applied according to the partition mode.

[0130]

[0148] In some embodiments, steps 1910 and 1912 may be performed within any other method, for example methods 1200 and 1400, in which a TM is used to refine the movement of a CU encoded by a GPM.

[0131]

[0149] It should be noted that the method of applying TM to GPM can also be applied to the AWP mode in the AVS3 standard.

[0132]

[0150] FIG. 20 illustrates another exemplary flowchart of a method 2000 for applying template matching to a GPM to refine motion, according to some embodiments of the present disclosure. The method 2000 may be performed as part of a video decoding process (e.g., process 300A of FIG. 3A or process 300B of FIG. 3B) or by one or more software or hardware components of an apparatus (e.g., apparatus 400 of FIG. 4). For example, a processor (e.g., processor 402 of FIG. 4) may perform the method 2000. In some embodiments, the method 2000 may be implemented by a computer program product embodied in a computer-readable medium that includes computer-executable instructions, such as program code, executed by a computer (e.g., apparatus 400 of FIG. 4). With reference to FIG. 20, the method 2000 may include the following steps 2002-2008.

[0133]

[0151] In step 2002, a bitstream containing coding units (eg, video bitstream 228 of FIG. 3B) is received by a decoder.

[0134]

[0152] In step 2004, it is determined whether the CU is encoded by the GPM.

[0135]

[0153] In step 2006, in response to the block being encoded with a GPM that splits the CU into a first partition and a second partition, a parameter (e.g., a flag) is decoded to indicate whether TM has been applied. In some embodiments, the parameter may include multiple flags indicating whether TM has been applied to each partition, respectively (see again Table 4). In some embodiments, the parameter may include an index indicating the combination of partitions to which TM has been applied (see again Table 5).

[0136]

[0154] In step 2008, in response to the TM being applied, the TM is used to refine the motion of the GPM partition. If a TM is not applied to the CU, the motion is not refined. In some embodiments, if a TM is not applied to the CU, other methods may be used to refine the motion.

[0137]

[0155] The present disclosure further provides a method for combining a GPM with an MMVD and a TM.

[0138]

[0156] In some embodiments, MMVD and TM cannot be applied to the same CU. If the CU is encoded using GPM, a first parameter (e.g., a first flag) is signaled to indicate whether TM is applied to the CU. If TM is applied, the GPM and two merge indexes are further signaled. Then, the motions of both of the two GPM partitions are refined using TM. If TM is not applied to the CU, a second parameter is signaled to indicate whether MMVD is applied to the GPM partition. If MMVD is applied to the GPM partition, MVD information is further signaled, and the motions are refined using the signaled MVD information. In one example, the second parameter includes a second flag and a third flag. The second flag indicates whether MMVD is applied to the first GPM partition, and the third flag indicates whether MMVD is applied to the second GPM partition. In another example, the second parameter includes only a fourth flag, which indicates whether the MMVD applies to both of the two GPM partitions.

[0139]

[0157] In some embodiments, MMVD and TM cannot be applied to the same GPM partition. If a CU is coded by GPM, the CU is divided into two GPM partitions. For each GPM partition, a first parameter is signaled to indicate whether TM is applied to the GPM partition. If TM is applied, the motion of the GPM partition is refined using TM. If TM is not applied, a second parameter is signaled to indicate whether MMVD is applied to the GPM partition. It is noted that if the first parameter indicates that TM is applied to the GPM partition, the second parameter is not signaled. It is also noted that the two GPM partitions can individually select whether to use TM or MMVD to refine the motion. That is, the motion of one GPM partition can be refined using TM, and the motion of the other GPM partition can be refined using MMVD.

[0140]

[0158] In some embodiments, the order of signaling of the two parameters (a parameter indicating whether TM is applied and another parameter indicating whether MMVD is applied) can be rearranged. The parameter indicating whether MMVD is applied can be signaled before the parameter indicating whether TM is applied. If the parameter indicates whether MMVD is signaled first and whether MMVD is applied to the GPM partition, the parameter indicating whether TM is applied is no longer signaled and is inferred to be off. Thus, TM is not applied to the GPM partition. FIG. 21 illustrates an example flowchart of a method 2100 for applying GPM, TM, and MMVD according to some embodiments of the present disclosure. Method 2100 may be performed as part of a video encoding process (e.g., process 200A of FIG. 2A or process 200B of FIG. 2B) or by one or more software or hardware components of an apparatus (e.g., apparatus 400 of FIG. 4). For example, a processor (e.g., processor 402 of FIG. 4) may perform method 2100. In some embodiments, the method 2100 may be implemented by a computer program product embodied in a computer-readable medium that includes computer-executable instructions, such as program code, for execution by a computer (e.g., device 400 of FIG. 4). With reference to FIG. 21, the method 2100 may include the following steps 2102-2110.

[0141]

[0159] In step 2102, it is determined whether the CU is encoded by GPM.

[0142]

[0160] In step 2104, in response to the CU being encoded by the GPM that divides the CU into a first partition and a second partition, a first parameter is signaled to indicate whether MMVD is applied to the first partition. For example, the first parameter may be a first flag. If the first flag is equal to 1, MMVD is applied to the first partition. If the first flag is equal to 0, MMVD is not applied to the first partition.

[0143]

[0161] In step 2106, a second parameter is signaled to indicate whether the MMVD applies to the second partition. For example, the second parameter may be a second flag. If the second flag is equal to 1, the MMVD applies to the second partition. If the second flag is equal to 0, the MMVD does not apply to the second partition.

[0144]

[0162] In step 2108, in response to determining that MMVD is not applied to either the first partition or the second partition, a third parameter is signaled to indicate whether TM is applied to both the first partition and the second partition. For example, the third parameter may be a third flag. When the third flag is equal to 1, TM is applied to both partitions. When the third flag is equal to 0, TM is not applied to either partition.

[0145]

[0163] In step 2110, in response to the TM being applied to both the first segment and the second segment, the TM is used to refine the motion of the first segment and the second segment. Further, in some embodiments, the template used to refine the motion is determined according to a segmentation mode or a segmentation angle.

[0146]

[0164] FIG. 22 illustrates an example flowchart of a method 2200 for applying GPM, TM, and MMVD according to some embodiments of the present disclosure. The method 2100 may be performed as part of a video decoding process (e.g., process 300A of FIG. 3A or process 300B of FIG. 3B) or by one or more software or hardware components of an apparatus (e.g., apparatus 400 of FIG. 4). For example, a processor (e.g., processor 402 of FIG. 4) may perform the method 2200. In some embodiments, the method 2200 may be implemented by a computer program product embodied in a computer-readable medium that includes computer-executable instructions, such as program code, executed by a computer (e.g., apparatus 400 of FIG. 4). Referring to FIG. 22, the method 2200 may include the following steps 2202-2212.

[0147]

[0165] In step 2202, a bitstream containing coding units (eg, video bitstream 228 of FIG. 3B) is received by a decoder.

[0148]

[0166] In step 2204, it is determined whether the CU is encoded by the GPM.

[0149]

[0167] In step 2206, in response to the block being encoded with a GPM that divides the CU into a first partition and a second partition, a first parameter is decoded indicating whether MMVD is applied to the first partition. For example, the first parameter may be a first flag, where if the first flag is equal to 1, MMVD is applied to the first partition, and if the first flag is equal to 0, MMVD is not applied to the first partition.

[0150]

[0168] In step 2208, a second parameter indicating whether MMVD is applied to the second partition is decoded. For example, the second parameter may be a second flag, where if the second flag is equal to 1, MMVD is applied to the second partition, and if the second flag is equal to 0, MMVD is not applied to the second partition.

[0151]

[0169] In step 2210, in response to determining that MMVD is not applied to the first partition or the second partition, a third parameter is decoded to indicate whether TM is applied to both the first partition and the second partition. For example, the third parameter may be a third flag, where if the third flag is equal to 1, TM is applied to both partitions, and if the third flag is equal to 0, TM is not applied to either partition.

[0152]

[0170] In step 2210, in response to the TM being applied to both the first and second partitions, the TM is used to refine the motion of the first and second partitions. Further, in some embodiments, the template used to refine the motion is determined according to a partitioning mode or a partitioning angle. In some embodiments, the template used to refine the motion is determined by decoding a plurality of parameters.

[0153]

[0171] In some embodiments, MMVD and TM can be applied to the same GPM partition. For each GPM partition, a first parameter and a second parameter are signaled to indicate whether TM and MMVD are applied, respectively. In one example, when both TM and MMVD are applied to a GPM partition, the motion is first refined using TM. Then, the refined motion is further modified by adding the signaled MVD information. In another example, when both TM and MMVD are applied to a GPM partition, the signaled MVD information is first added to the motion. Then, the modified motion is used as the starting point of TM and refined by TM.

[0154]

[0172] In some embodiments, MMVD and TM may be applied to the same GPM partition only if the signaled MVD information satisfies a number of conditions. In one example, the number of conditions includes that the distance index of the signaled MVD information is less than a default value (e.g., 1, i.e., the MVD offset is less than 1 / 2 pixel). For each GPM partition, a second parameter is signaled to indicate whether MMVD is applied. If MMVD is applied, MVD information including a distance index and a direction index is further signaled. If the distance index is less than a default value, a first parameter is signaled to indicate whether TM is applied. If MMVD is not applied, the first parameter is always signaled to indicate whether TM is applied. In another example, the number of conditions includes that the distance index of the signaled MVD information is greater than a default value.

[0155]

[0173] In some embodiments, MMVD and TM can be applied to the same GPM partition only if the size / coding mode of the CU encoded by the GPM meets certain conditions. In one example, MMVD and TM can be both applied to the same GPM partition if the width and / or height of the CU is above a predefined threshold (e.g., 16 or 32). In another example, MMVD and TM can both be applied to the same GPM partition if the aspect ratio of the CU is below a predefined threshold. The aspect ratio can be defined as CU_width / CU_height if CU_width>CU_height, or CU_height / CU_width if CU_height>=CU_width. In another example, MMVD and TM can both be applied to the same GPM partition if the CU is encoded using a merge mode rather than a skip mode. In another example, MMVD and TM can both be applied to the same GPM partition if the CU is encoded using a skip mode rather than a merge mode.

[0156]

[0174] The embodiments may be further described using the following clauses. 1. Receiving a bitstream including coding units coded by geometric partition mode (GPM); decoding a first parameter associated with the coding unit, the first parameter indicating whether template matching has been applied to the coding unit; and determining motion information for the coding unit according to the first parameter, where if the first parameter indicates that template matching has been applied to the coding unit, the motion information is refined using template matching; A video decoding method comprising: 2. The coding unit is divided into a first partition and a second partition, the motion information of the coding unit includes a first motion of the first partition and a second motion of the second partition, the first parameter includes a first flag, and the motion information is refined using template matching. refining both the first movement of the first segment and the second movement of the second segment using template matching according to the first flag; 2. The method of claim 1, further comprising: 3. The coding unit is divided into a first partition and a second partition, the first parameters include a first flag indicating whether template matching is applied to the first partition and a second flag indicating whether template matching is applied to the second partition, and the refinement of the motion information is refining the first movement of the first segment using template matching according to the first flag; and refining the second movement of the second segment using template matching according to the second flag; 2. The method of claim 1, further comprising: 4. The coding unit is divided into a first partition and a second partition, and the first parameter includes an index indicating whether template matching is applied to the first partition and the second partition, and the refinement of the motion information is refining the first movement of the first segment, the second movement of the second segment, or both the first movement of the first segment and the second movement of the second segment according to the value of the index. 2. The method of claim 1, further comprising: 5. The coding unit is divided into a first partition and a second partition, and the motion information includes a first motion of the first partition and a second motion of the second partition, and the refinement of the motion information includes: constructing a first template for the first partition, the first template being comprised of a first set of adjacent samples; constructing a second template for the second partition, the second template being comprised of a second set of adjacent samples; refining the first motion and the second motion using the first template and the second template, respectively; Further comprising: Each of the first set of adjacent samples and the second set of adjacent samples is Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample comprising one or more adjacent samples selected from 5. The method according to any one of clauses 1 to 4. 6. A set of first neighboring samples is selected based on the availability of left neighboring samples and top neighboring samples of the first partition; a set of second neighboring samples is selected based on availability of left neighboring samples and top neighboring samples of the second partition; The method described in clause 5. 7. Configuring the first template and the second template based on the GPM classification mode 7. The method of claim 5 or 6, further comprising: 8. Configuring the first template and the second template based on the GPM segment angle 8. The method of claim 7, further comprising: 9. Decoding a second parameter associated with the first template; Decoding a third parameter associated with the second template. wherein the second parameter and the third parameter are: Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample 9. The method of any one of clauses 5 to 8, each indicating whether the 10. The method of any one of clauses 5 to 9, wherein the first set of adjacent samples is different from the second set of adjacent samples. 11. The method of any one of clauses 5 to 9, wherein the first set of adjacent samples is the same as the second set of adjacent samples. 12. Performing motion compensation using the refined motion; and Applying the blending process along the edges of the geometric segments according to the GPM segmentation mode 12. The method of any one of clauses 1 to 11, further comprising: 13. In response to template matching not being applied to the coding unit, decoding a second parameter indicating whether a merge mode by motion vector difference (MMVD) is applied; responsive to the MMVD being applied, decoding motion vector differential (MVD) information; and Using MVD information to refine motion 13. The method of any one of clauses 1 to 12, further comprising: 14. The method of claim 13, wherein the second parameters include a first flag indicating whether MMVD is applied to the first segment and a second flag indicating whether MMVD is applied to the second segment. 15. A coding unit is divided into a first partition and a second partition, and the method comprises: Decoding a second parameter indicating whether MMVD is applied to the first partition; decoding a third parameter indicating whether MMVD is applied to the second segment; determining whether template matching is applied to both the first segment and the second segment in response to MMVD not being applied to the first segment or the second segment according to a first parameter; responsive to template matching being applied to both the first segment and the second segment, refining the motion information of the first segment and the second segment using template matching; 13. The method of any one of clauses 1 to 12, further comprising: 16. The method of claim 15, wherein the template used to refine the motion is determined based on the segmentation mode. 17. An apparatus for processing video data, comprising: A memory configured to store instructions; one or more processors, the one or more processors executing instructions receiving a bitstream including coding units encoded by geometric partition mode (GPM); decoding a first parameter associated with the coding unit, the first parameter indicating whether template matching has been applied to the coding unit; and determining motion information for the coding unit according to a first parameter, where if the first parameter indicates that template matching is applied to the coding unit, the motion information is refined using template matching; The apparatus is configured to cause the apparatus to perform the following: 18. The coding unit is divided into a first partition and a second partition, the motion information of the coding unit includes a first motion of the first partition and a second motion of the second partition, and the first parameter includes a first flag; The processor executes the instructions refining both the first movement of the first segment and the second movement of the second segment using template matching according to the first flag; configured to cause the apparatus to 17. Apparatus according to clause 17. 19. The coding unit is divided into a first partition and a second partition, and the first parameters include a first flag indicating whether template matching is applied to the first partition and a second flag indicating whether template matching is applied to the second partition; The processor executes the instructions refining the first movement of the first segment using template matching according to the first flag; and refining the second movement of the second segment using template matching according to the second flag; and further configured to cause the apparatus to: 17. Apparatus according to clause 17. 20. The coding unit is divided into a first partition and a second partition, and the first parameter includes an index indicating whether template matching is applied to the first partition and the second partition; The processor executes the instructions refining the first movement of the first segment, the second movement of the second segment, or both the first movement of the first segment and the second movement of the second segment according to the value of the index. and further configured to cause the apparatus to: 17. Apparatus according to clause 17. 21. The coding unit is divided into a first partition and a second partition, and the motion information includes a first motion of the first partition and a second motion of the second partition; The processor executes the instructions constructing a first template for the first partition, the first template being comprised of a first set of adjacent samples; constructing a second template for the second partition, the second template being comprised of a second set of adjacent samples; refining the first motion and the second motion using the first template and the second template, respectively; and further configured to cause the apparatus to Each of the first set of adjacent samples and the second set of adjacent samples is Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample comprising one or more adjacent samples selected from 21. Apparatus according to any one of clauses 17 to 20. 22. A set of first neighboring samples is selected based on availability of left neighboring samples and top neighboring samples of the first partition; a set of second neighboring samples is selected based on availability of left neighboring samples and top neighboring samples of the second partition; 2. Apparatus according to clause 21. 23. The processor executes instructions and Configuring the first template and the second template based on a GPM classification mode and further configured to cause the apparatus to: 23. Apparatus according to clause 21 or 22. 24. The processor executes instructions and Configuring the first template and the second template based on the GPM segment angle and further configured to cause the apparatus to: 23. Apparatus according to clause 23. 25. A processor executes instructions to Decoding a second parameter associated with the first template; Decoding a third parameter associated with the second template. and further configured to cause the apparatus to The second parameter and the third parameter are each a first set of adjacent samples and a second set of adjacent samples, Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample 25. The apparatus of any one of clauses 21 to 24, each indicating whether it is selected from: 26. An apparatus according to any one of clauses 21 to 25, wherein the first set of adjacent samples is different from the second set of adjacent samples. 27. An apparatus according to any one of clauses 21 to 25, wherein the first set of adjacent samples is the same as the second set of adjacent samples. 28. A processor executes instructions to performing motion compensation using the refined motion; and Applying the blending process along the edges of the geometric segments according to the GPM segmentation mode and further configured to cause the apparatus to: 28. Apparatus according to any one of clauses 17 to 27. 29. A processor executes instructions to In response to template matching not being applied to the coding unit, decoding a second parameter indicating whether a merge mode with motion vector difference (MMVD) is applied; responsive to the MMVD being applied, decoding motion vector differential (MVD) information; and Using MVD information to refine motion and further configured to cause the apparatus to: 29. Apparatus according to any one of clauses 17 to 28. 30. The apparatus of clause 29, wherein the second parameters include a first flag indicating whether MMVD is applied to the first segment and a second flag indicating whether MMVD is applied to the second segment. 31. A coding unit is divided into a first partition and a second partition; The processor executes the instructions Decoding a second parameter indicating whether MMVD is applied to the first partition; decoding a third parameter indicating whether MMVD is applied to the second segment; determining whether template matching is applied to both the first segment and the second segment according to a first parameter in response to MMVD not being applied to the first segment or the second segment; responsive to template matching being applied to both the first segment and the second segment, refining the motion information of the first segment and the second segment using template matching; and further configured to cause the apparatus to: 29. Apparatus according to any one of clauses 17 to 28. 32. The apparatus of clause 31, wherein the template used to refine the movement is determined based on the segmentation mode. 33. A non-transitory computer-readable medium storing a set of instructions executable by one or more processors of an apparatus to cause the apparatus to initiate a method for processing video data, the method comprising: receiving a bitstream including coding units encoded by geometric partition mode (GPM); decoding a first parameter associated with the coding unit, the first parameter indicating whether template matching has been applied to the coding unit; and determining motion information for the coding unit according to a first parameter, where if the first parameter indicates that template matching is applied to the coding unit, the motion information is refined using template matching; A non-transitory computer readable medium comprising: 34. The coding unit is divided into a first partition and a second partition, the motion information of the coding unit includes a first motion of the first partition and a second motion of the second partition, and the first parameter includes a first flag; The set of instructions is refining both the first movement of the first segment and the second movement of the second segment using template matching according to the first flag; 34. The non-transitory computer-readable medium of claim 33, executable by one or more processors of the device to further cause the device to perform. 35. The coding unit is divided into a first partition and a second partition, and the first parameters include a first flag indicating whether template matching is applied to the first partition and a second flag indicating whether template matching is applied to the second partition; The set of instructions is refining the first movement of the first segment using template matching according to the first flag; and refining the second movement of the second segment using template matching according to the second flag; 34. The non-transitory computer-readable medium of claim 33, executable by one or more processors of the device to further cause the device to perform. 36. The coding unit is divided into a first partition and a second partition, and the first parameter includes an index indicating whether template matching is applied to the first partition and the second partition; The set of instructions is refining the first movement of the first segment, the second movement of the second segment, or both the first movement of the first segment and the second movement of the second segment according to the value of the index. 34. The non-transitory computer-readable medium of claim 33, executable by one or more processors of the device to further cause the device to perform. 37. The coding unit is divided into a first partition and a second partition, and the motion information includes a first motion of the first partition and a second motion of the second partition; The set of instructions is constructing a first template for the first partition, the first template being comprised of a first set of adjacent samples; constructing a second template for the second partition, the second template being comprised of a second set of adjacent samples; refining the first motion and the second motion using the first template and the second template, respectively; and executable by one or more processors of the device to cause the device to further perform Each of the first set of adjacent samples and the second set of adjacent samples is Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample comprising one or more adjacent samples selected from 37. A non-transitory computer-readable medium according to any one of clauses 33 to 36. 38. A set of first neighboring samples is selected based on availability of left neighboring samples and top neighboring samples of the first partition; a set of second neighboring samples is selected based on availability of left neighboring samples and top neighboring samples of the second partition; A non-transitory computer readable medium as described in clause 37. 39. A set of instructions is Configuring the first template and the second template based on a GPM classification mode 39. A non-transitory computer-readable medium as described in clause 37 or 38, executable by one or more processors of the device to further cause the device to perform. 40. A set of instructions is Configuring the first template and the second template based on the GPM segment angle 40. The non-transitory computer-readable medium of claim 39, executable by one or more processors of the device to further cause the device to perform. 41. A set of instructions is Decoding a second parameter associated with the first template; Decoding a third parameter associated with the second template. and executable by one or more processors of the device to cause the device to further perform The second parameter and the third parameter are each a first set of adjacent samples and a second set of adjacent samples, Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample The non-transitory computer-readable medium of any one of clauses 37 to 40, each indicating whether or not the non-transitory computer-readable medium is selected from the following: 42. The non-transitory computer-readable medium of any one of clauses 37-41, wherein the first set of adjacent samples is different from the second set of adjacent samples. 43. The non-transitory computer-readable medium of any one of clauses 37-41, wherein the first set of adjacent samples is the same as the second set of adjacent samples. 44. A set of instructions is performing motion compensation using the refined motion; and Applying the blending process along the edges of the geometric segments according to the GPM segmentation mode A non-transitory computer-readable medium as described in any one of clauses 33 to 43, executable by one or more processors of the device to cause the device to further perform the following: 45. A set of instructions is In response to template matching not being applied to the coding unit, decoding a second parameter indicating whether a merge mode with motion vector difference (MMVD) is applied; responsive to the MMVD being applied, decoding motion vector differential (MVD) information; and Using MVD information to refine motion A non-transitory computer-readable medium as described in any one of clauses 33 to 44, executable by one or more processors of the device to cause the device to further perform the following: 46. ​​The non-transitory computer-readable medium of clause 45, wherein the second parameters include a first flag indicating whether MMVD is applied to the first partition and a second flag indicating whether MMVD is applied to the second partition. 47. A coding unit is divided into a first partition and a second partition; The set of instructions is Decoding a second parameter indicating whether MMVD is applied to the first partition; decoding a third parameter indicating whether MMVD is applied to the second segment; determining whether template matching is applied to both the first segment and the second segment according to a first parameter in response to MMVD not being applied to the first segment or the second segment; responsive to template matching being applied to both the first segment and the second segment, refining the motion information of the first segment and the second segment using template matching; A non-transitory computer-readable medium as described in any one of clauses 33 to 44, executable by one or more processors of the device to cause the device to further perform the following: 48. The non-transitory computer-readable medium of clause 47, wherein the template used to refine the movement is determined based on the partitioning mode. 49. A non-transitory computer-readable medium storing a bitstream, the bitstream including a first parameter associated with an encoding unit; The non-transitory computer-readable medium, wherein a first parameter indicates whether template matching is applied, and the coding unit is coded by a geometric partition mode (GPM). 50. The coding unit is divided into a first partition and a second partition, and the first parameter is a first flag indicating whether template matching is applied to the first segment; and A second flag indicating whether template matching is applied to the second segment. 49. The non-transitory computer readable medium of claim 49, further comprising: 51. The bitstream includes a second parameter associated with the coding unit; The second parameter indicates the template for template matching, and the template is Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample consisting of one or more adjacent samples selected from 49. A non-transitory computer readable medium as described in Clause 49. 52. The bitstream is a second parameter associated with the coding unit, the second parameter indicating whether a merge mode by motion vector difference (MMVD) is applied; 49. The non-transitory computer readable medium of claim 49, further comprising: 53. A coding unit is divided into a first partition and a second partition, and a bitstream is a second parameter associated with the coding unit, the second parameter indicating whether a merge mode with motion vector difference (MMVD) is applied to the first partition; and a third parameter associated with the video data, the third parameter indicating whether the MMVD is applied to the second division; 49. The non-transitory computer readable medium of claim 49, further comprising:

[0157]

[0175] In some embodiments, a non-transitory computer-readable storage medium including instructions is also provided. In some embodiments, the medium can store all or part of a video bitstream with one or more flags indicating GPM, TM, or MMVD being applied to a CU or partition. In some embodiments, the medium can store instructions that can be executed by a device (such as the disclosed encoder and decoder) to perform the above method. Common forms of non-transitory media include, for example, floppy disks, flexible disks, hard disks, solid state drives, magnetic tapes, or any other magnetic data storage media, CD-ROMs, any other optical data storage media, any physical media with a pattern of holes, RAM, PROMs, and EPROMs, FLASH-EPROMs or any other flash memory, NVRAMs, caches, registers, any other memory chips or cartridges, and networked versions thereof. The device can include one or more processors (CPUs), input / output interfaces, network interfaces, and / or memories.

[0158]

[0176] It should be noted that relational terms herein, such as "first" and "second," are used merely to distinguish one entity or operation from another, and do not require or imply any actual relationship or order between those entities or operations. Furthermore, the words "comprising," "having," "containing," and "including," and other similar forms, are intended to be equivalent in meaning and to be open-ended in that the element or elements following any of these words are not meant to be an exclusive enumeration of such elements or elements, or to be limited to only the listed element or elements.

[0159]

[0177] As used herein, unless specifically stated otherwise, the term "or" includes all possible combinations unless impracticable. For example, if it is stated that a database may include A or B, then the database may include A, B, A and B, unless specifically stated otherwise or impracticable. As a second example, if it is stated that a database may include A, B, or C, then the database may include A, B, C, A and B, A and C, B and C, A and B and C, unless specifically stated otherwise or impracticable.

[0160]

[0178] It is understood that the above-described embodiments may be implemented by hardware, or software (program code), or a combination of hardware and software. If implemented by software, it may be stored in the above-described computer-readable medium. The software, when executed by a processor, may perform the methods of the present disclosure. The computational units and other functional units described in the present disclosure may be implemented by hardware, or software, or a combination of hardware and software. Those skilled in the art will also understand that multiple of the above-described modules / units may be combined into one module / unit, and each of the above-described modules / units may be further divided into multiple sub-modules / sub-units.

[0161]

[0179] In the foregoing specification, the embodiments have been described with reference to numerous specific details that may vary from implementation to implementation. Certain adaptations and modifications of the above-described embodiments may be made. Other embodiments may become apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. It is intended that the specification and examples be considered as examples only, with the true scope and spirit of the invention being indicated by the appended claims. It is also intended that the sequences of steps depicted in the figures are for illustrative purposes only, and are not intended to be limited to any particular sequence of steps. Thus, one skilled in the art can appreciate that the steps may be performed in different orders while implementing the same method.

[0162]

[0180] In the drawings and specification, illustrative embodiments have been disclosed. However, many variations and modifications to these embodiments may be made. Thus, although specific terminology is employed, it is used in a generic and descriptive sense only and not for purposes of limitation.

Claims

1. receiving a bitstream including coding units coded in a geometric partition mode (GPM); decoding a first parameter associated with the coding unit, the first parameter indicating whether template matching has been applied to the coding unit; and determining motion information for the coding unit according to the first parameter, and refining the motion information using the template matching if the first parameter indicates that the template matching has been applied to the coding unit; A video decoding method comprising:

2. the coding unit is divided into a first partition and a second partition, the motion information of the coding unit includes a first motion of the first partition and a second motion of the second partition, the first parameter includes a first flag, and the motion information is refined using the template matching; using the template matching to refine both the first motion of the first segment and the second motion of the second segment according to the first flag; The method of claim 1 further comprising:

3. The coding unit is divided into a first partition and a second partition, the first parameters include a first flag indicating whether the template matching is applied to the first partition and a second flag indicating whether the template matching is applied to the second partition, and the refinement of the motion information is refining a first motion of the first segment using the template matching according to the first flag; and refining a second motion of the second segment using the template matching according to the second flag; The method of claim 1 further comprising:

4. The coding unit is divided into a first partition and a second partition, the first parameter includes an index indicating whether the template matching is applied to the first partition and the second partition, and the refinement of the motion information includes: refining a first movement of the first segment, a second movement of the second segment, or both the first movement of the first segment and the second movement of the second segment according to the value of the index. The method of claim 1 further comprising:

5. The coding unit is divided into a first partition and a second partition, the motion information includes a first motion of the first partition and a second motion of the second partition, and the refinement of the motion information includes: constructing a first template for the first partition, the first template being comprised of a first set of adjacent samples; constructing a second template for the second partition, the second template being comprised of a second set of adjacent samples; refining the first motion and the second motion using the first template and the second template, respectively; Further comprising: Each of the first set of adjacent samples and the second set of adjacent samples comprises: Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample one or more adjacent samples selected from The method of claim 1.

6. in response to the template matching not being applied to the coding unit, decoding a second parameter indicating whether a merge mode based on motion vector difference (MMVD) is applied; responsive to the MMVD being applied, decoding motion vector differential (MVD) information; and refining the motion using the MVD information; The method of claim 1 further comprising:

7. The coding unit is divided into a first partition and a second partition, the method comprising: decoding a second parameter indicating whether MMVD is applied to the first partition; decoding a third parameter indicating whether the MMVD is applied to the second partition; in response to the MMVD not being applied to the first partition or the second partition, determining whether the template matching is applied to both the first partition and the second partition according to the first parameter; responsive to the template matching being applied to both the first partition and the second partition, refining motion information of the first partition and the second partition using the template matching. The method of claim 1 further comprising:

8. An encoding method comprising the steps of: receiving a video sequence; encoding the coding units of the video sequence according to a geometric partition mode (GPM); encoding a first parameter associated with the coding unit, the first parameter indicating whether template matching has been applied to the coding unit; and determining motion information for the coding unit according to the first parameter, and refining the motion information using the template matching if the first parameter indicates that the template matching has been applied to the coding unit; The method is configured to cause the device to:

9. the coding unit is divided into a first partition and a second partition, the motion information of the coding unit includes a first motion of the first partition and a second motion of the second partition, the first parameter includes a first flag, and the motion information is refined using the template matching; using the template matching to refine both the first motion of the first segment and the second motion of the second segment according to the first flag; Further comprising: The method according to claim 8.

10. the coding unit is divided into a first partition and a second partition, and the first parameters include a first flag indicating whether the template matching is applied to the first partition and a second flag indicating whether the template matching is applied to the second partition; said refining said motion information comprising: refining a first motion of the first segment using the template matching according to the first flag; and refining a second motion of the second segment using the template matching according to the second flag; Further comprising: The method according to claim 8.

11. the coding unit is divided into a first partition and a second partition, and the first parameter includes an index indicating whether the template matching is applied to the first partition and the second partition; said refining said motion information comprising: refining a first movement of the first segment, a second movement of the second segment, or both the first movement of the first segment and the second movement of the second segment according to the value of the index. Further comprising: The method according to claim 8.

12. the coding unit is divided into a first partition and a second partition, and the motion information includes a first motion of the first partition and a second motion of the second partition; said refining said motion information comprising: constructing a first template for the first partition, the first template being comprised of a first set of adjacent samples; constructing a second template for the second partition, the second template being comprised of a second set of adjacent samples; refining the first motion and the second motion using the first template and the second template, respectively; Further comprising: Each of the first set of adjacent samples and the second set of adjacent samples comprises: Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample one or more adjacent samples selected from The method according to claim 8.

13. In response to the template matching not being applied to the coding unit, encoding a second parameter indicating whether a merge mode with motion vector difference (MMVD) is applied. responsive to the MMVD being applied, encoding motion vector differential (MVD) information; and refining the motion using the MVD information; The method of claim 8 , further comprising:

14. the coding unit is divided into a first partition and a second partition; The method further comprising: encoding a second parameter indicating whether MMVD is applied to the first partition; encoding a third parameter indicating whether the MMVD is applied to the second partition; in response to the MMVD not being applied to the first partition or the second partition, determining whether the template matching is applied to both the first partition and the second partition according to the first parameter; and responsive to the template matching being applied to both the first partition and the second partition, refining motion information of the first partition and the second partition using the template matching. Further comprising: The method according to claim 8.

15. A method for storing a bitstream of a video sequence, the method comprising: receiving a video sequence; encoding one or more pictures of the video sequence; generating a bitstream; and storing the bitstream in a non-transitory computer readable storage medium; and said encoding comprises: encoding the coding units of the video sequence according to a geometric partition mode (GPM); encoding a first parameter associated with the coding unit, the first parameter indicating whether template matching has been applied to the coding unit; and determining motion information for the coding unit according to the first parameter, and refining the motion information using the template matching if the first parameter indicates that the template matching is applied to the coding unit; A method comprising:

16. the coding unit is divided into a first partition and a second partition, the motion information of the coding unit includes a first motion of the first partition and a second motion of the second partition, the first parameter includes a first flag, and the motion information is refined using the template matching; using the template matching to refine both the first motion of the first segment and the second motion of the second segment according to the first flag; Further comprising: The method of claim 15.

17. the coding unit is divided into a first partition and a second partition, and the first parameters include a first flag indicating whether the template matching is applied to the first partition and a second flag indicating whether the template matching is applied to the second partition; said refining said motion information comprising: refining a first motion of the first segment using the template matching according to the first flag; and refining a second motion of the second segment using the template matching according to the second flag; Further comprising: The method of claim 15.

18. the coding unit is divided into a first partition and a second partition, and the first parameter includes an index indicating whether the template matching is applied to the first partition and the second partition; said refining said motion information comprising: refining a first movement of the first segment, a second movement of the second segment, or both the first movement of the first segment and the second movement of the second segment according to the value of the index. Further comprising: The method of claim 15.

19. the coding unit is divided into a first partition and a second partition, and the motion information includes a first motion of the first partition and a second motion of the second partition; said refining said motion information comprising: constructing a first template for the first partition, the first template being comprised of a first set of adjacent samples; constructing a second template for the second partition, the second template being comprised of a second set of adjacent samples; refining the first motion and the second motion using the first template and the second template, respectively; Further comprising: Each of the first set of adjacent samples and the second set of adjacent samples comprises: Only the adjacent sample on the left, Only the adjacent samples above, or Both the left adjacent sample and the above adjacent sample one or more adjacent samples selected from The method of claim 15.

20. the coding unit is divided into a first partition and a second partition; said refining said motion information comprising: encoding a second parameter indicating whether MMVD is applied to the first partition; encoding a third parameter indicating whether the MMVD is applied to the second partition; in response to the MMVD not being applied to the first partition or the second partition, determining whether the template matching is applied to both the first partition and the second partition according to the first parameter; responsive to the template matching being applied to both the first partition and the second partition, refining motion information of the first partition and the second partition using the template matching. Further comprising: The method of claim 15.