Adaptive motion vector resolution based on template matching using adaptive order of motion vector resolution
Patent Information
- Application Number
- JP2023552567
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-10-20
- Filing Date
- 2022-10-26
- Publication Date
- 2025-03-27
- Estimated Expiration
- 2042-10-26
AI Technical Summary
【0034】 開示されている主題のさらなる特徴、性質、および様々な利点は、以下の詳細な説明および添付の図面からより明らかになる。
Smart Images

Figure 0007652917000014 
Figure 0007652917000015 
Figure 0007652917000016
Abstract
Description
[Technical field]
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims the benefit of priority to U.S. Provisional Application No. 63 / 291,180, entitled "Adaptive Motion Vector Resolution Based on Template Matching with Adaptive Order of Motion Vector Resolution (AMVR)," filed on December 17, 2021, which claims the benefit of priority to U.S. Patent Application No. 17 / 970,407, entitled "Adaptive Motion Vector Resolution Based on Template Matching with Adaptive Order of Motion Vector Resolution," filed on October 20, 2022. The disclosures of the prior applications are incorporated herein by reference in their entireties.
[0002] This disclosure describes embodiments related generally to video coding. [Background technology]
[0003] The background discussion provided herein is intended to generally present the context of the present disclosure. The inventors' work, to the extent that it is described in this background section, and aspects of the description that may not be admitted as prior art at the time of filing, are not admitted expressly or impliedly as prior art to the present disclosure.
[0004] Uncompressed digital images and / or videos may include a sequence of pictures, each having spatial dimensions of, for example, 1920x1080 luma samples and associated chroma samples. The sequence of pictures may have a fixed or variable picture rate (also informally known as frame rate), for example, 60 pictures per second or 60 Hz. Uncompressed images and / or videos have specific bitrate requirements. For example, 1080p60 4:2:0 video (1920x1080 luma sample resolution at a frame rate of 60 Hz) with 8 bits per sample requires a bandwidth approaching 1.5 Gbit / s. One hour of such video requires more than 600 GByte of storage space.
[0005] One objective of image and / or video coding and decoding may be the reduction of redundancy in the input image and / or video signal through compression. Compression may help reduce the aforementioned bandwidth and / or storage space requirements, possibly by more than one order of magnitude. The description herein uses video encoding / decoding as an illustrative example, but the same techniques may be applied to image encoding / decoding in a similar manner without departing from the spirit of this disclosure. Both lossless and lossy compression, and combinations thereof, may be employed. Lossless compression refers to techniques where an exact copy of the original signal can be reconstructed from a compressed original signal. When using lossy compression, the reconstructed signal may not be identical to the original signal, but the distortion between the original signal and the reconstructed signal is small enough to make the reconstructed signal useful for its intended application. For video, lossy compression is widely adopted. The amount of tolerable distortion depends on the application, e.g., a user of a particular consumer streaming application may tolerate higher distortion than a user of a television distribution application. The achievable compression ratio may reflect that a higher tolerable / acceptable distortion can result in a higher compression ratio.
[0006] Video encoders and decoders can utilize techniques from a number of broad categories, including, for example, motion compensation, transform processing, quantization, and entropy coding.
[0007] Video codec technology can include a technique known as intra-coding. In intra-coding, sample values are represented without reference to samples or other data from previously reconstructed reference pictures. In some video codecs, a picture is spatially subdivided into blocks of samples. If all blocks of samples are intra-mode decoded, the picture may be an intra picture. Intra pictures and their derivatives, such as independent decoder refresh pictures, can be used to reset the decoder state and therefore can be used as the first picture in a coded video bitstream and video session or as a still image. Samples of an intra block can undergo a transform, and the transform coefficients can be quantized before entropy coding. Intra prediction can be a technique that minimizes sample values in the pre-transform domain. In some cases, the smaller the DC value after the transform and the smaller the AC coefficients, the fewer bits are needed at a given quantization step size to represent the block after entropy coding.
[0008] For example, traditional intra-coding, used in MPEG-2 generation coding techniques, does not use intra-prediction. However, some newer video compression techniques include techniques that attempt to perform prediction based on surrounding sample data and / or metadata obtained during encoding / decoding of a data block, for example. Such techniques are hereafter referred to as "intra-prediction" techniques. It should be noted that at least in some cases, intra-prediction uses only reference data from the current picture being reconstructed, and not from a reference picture.
[0009] Intra prediction may take many different forms. If more than one of such techniques may be used in a given video coding technique, the particular technique in use may be coded as a particular intra prediction mode that uses the particular technique. In certain cases, an intra prediction mode may have sub-modes and / or parameters that may be coded separately or included in a mode codeword that defines the prediction mode used. Which codeword is used for a given mode, sub-mode, and / or parameter combination may affect coding efficiency gains via intra prediction, and so may the entropy coding technique used to convert the codeword into a bitstream.
[0010] A specific mode of intra prediction was introduced in H.264, elaborated in H.265, and further elaborated in newer coding techniques such as Joint Search Model (JEM), Versatile Video Coding (VVC), and Benchmark Set (BMS). A predictor block can be formed using neighboring sample values belonging to already available samples. The sample values of the neighboring samples are copied to the predictor block according to the direction. The reference to the direction in use can be decoded in the bitstream or can be predicted itself.
[0011] Referring to FIG. 1A, depicted at the bottom right is a subset of 9 predictor directions known from the 33 possible predictor directions defined in H.265 (corresponding to the 33 angle modes of the 35 intra modes). The point where the arrows converge (101) represents the sample being predicted. The arrows represent the direction in which the sample is predicted. For example, arrow (102) indicates that sample (101) is predicted from one or more samples to the upper right, at an angle of 45 degrees from the horizontal. Similarly, arrow (103) indicates that sample (101) is predicted from one or more samples to the lower left of sample (101), at an angle of 22.5 degrees from the horizontal.
[0012] 1A, at the top left is shown a square block (104) of 4×4 samples (indicated by a thick dashed line). The square block (104) contains 16 samples, each labeled with "S", its position in the Y dimension (e.g., row index), and its position in the X dimension (e.g., column index). For example, sample S21 is the second sample (from the top) in the Y dimension and the first sample (from the left) in the X dimension. Similarly, sample S44 is the fourth sample in both the Y and X dimensions in the block (104). Since the block is 4×4 samples in size, S44 is at the bottom right. Also shown are reference samples that follow a similar numbering scheme. The reference samples are labeled with R, their Y position (e.g., row index), and X position (column index) relative to the block (104). In both H.264 and H.265, the predicted samples are adjacent to the block being reconstructed, and therefore negative values do not need to be used.
[0013] Intra-picture prediction can work by copying reference sample values from adjacent samples indicated by the signaled prediction direction. For example, assume that the coded video bitstream includes signaling for this block indicating a prediction direction that coincides with the arrow (102), i.e., the sample is predicted from the sample to the upper right, at an angle of 45 degrees from the horizontal. In that case, samples S41, S32, S23, S14 are predicted from the same reference sample R05. Then, sample S44 is predicted from reference sample R08.
[0014] In certain cases, to calculate a reference sample, especially when the orientation is not evenly divisible by 45 degrees, the values of multiple reference samples may be combined, for example by interpolation.
[0015] The number of possible directions has increased as video coding techniques have developed. In H.264 (2003), nine different directions could be represented; this increased to 33 in H.265 (2013). Currently, JEM / VVC / BMS can support up to 65 directions. Experiments have been carried out to identify the most likely directions, and certain techniques of entropy coding are used to represent those likely directions with a small number of bits, accepting a certain penalty for less likely directions. Furthermore, it may be possible for the direction itself to be predicted from neighboring directions used in neighboring, already decoded blocks.
[0016] FIG. 1B shows a schematic diagram (110) showing 65 intra prediction directions with JEM to illustrate the increasing number of prediction directions over time.
[0017] The mapping of intra-prediction direction bits representing directions in the coded video bitstream may vary between video coding techniques. Such mappings may range from simple direct mappings to complex adaptive schemes including codewords, most probable modes, and similar techniques. However, in most cases, there may be certain directions that are statistically less likely to occur in the video content than certain other directions. Since the goal of video compression is to reduce redundancy, these less likely directions are represented with more bits than more likely directions in well-performing video coding techniques.
[0018] Image and / or video coding and decoding may be performed using inter-picture prediction with motion compensation. Motion compensation may be a lossy compression technique and may relate to a technique in which blocks of sample data from a previously reconstructed picture or part thereof (reference picture) are spatially shifted in a direction indicated by a motion vector (hereinafter MV) and then used to predict a newly reconstructed picture or part of a picture. In some cases, the reference picture may be the same as the picture currently being reconstructed. The MV may have two dimensions X and Y, or three dimensions, with the third dimension being an indication of the reference picture in use (the latter may indirectly be a temporal dimension).
[0019] In some video compression techniques, the MV applicable to a particular area of sample data can be predicted from other MVs, e.g., from MVs associated with other areas of sample data that are spatially adjacent to the area being reconstructed and that precede that MV in decoding order. Doing so can significantly reduce the amount of data required to code the MV, thereby eliminating redundancy and increasing the compression ratio. MV prediction can work effectively because, for example, when coding an input video signal derived from a camera (known as natural video), there is a statistical likelihood that areas larger than the area to which a single MV is applicable move in similar directions and can therefore, in some cases, be predicted using similar motion vectors derived from MVs of neighboring areas. As a result, the detected MV for a given area will be similar or the same as the MV predicted from the surrounding MVs, which, after entropy coding, can be represented with fewer bits than would be used if the MV were coded directly. In some cases, MV prediction can be an example of lossless compression of a signal (i.e., MV) derived from an original signal (i.e., a sample stream). In other cases, the MV prediction itself can be lossy, e.g., due to rounding errors when calculating a predictor from several surrounding MVs.
[0020] Various MV prediction mechanisms are described in H.265 / HEVC (ITU-T Rec. H.265, "High Efficiency Video Coding", December 2016). Among the many MV prediction mechanisms offered by H.265, one that will be described with reference to Fig. 2 is a technique hereafter referred to as "spatial merging".
[0021] Referring to Figure 2, a current block (201) contains samples that are found by the encoder during the motion search process to be predictable from a previous block of the same size but spatially shifted. Instead of coding its MV directly, the MV can be derived from metadata associated with one or more reference pictures, e.g., from the most recent reference picture (in decoding order), using MVs associated with any one of five surrounding samples, denoted A0, A1, and B0, B1, B2 (202-206, respectively). In H.265, MV prediction can use predictors from the same reference picture that neighboring blocks are using. Summary of the Invention [Means for solving the problem]
[0022] Aspects of the present disclosure provide a method and apparatus for video encoding and decoding. In some examples, the apparatus for video decoding includes a processing circuit. The processing circuit is configured to decode prediction information of a current block in a current picture from a coded video bitstream. The prediction information may indicate that an Adaptive Motion Vector Prediction (AMVP) mode is applied to the current block along with an Adaptive Motion Vector Resolution (AMVR) mode. The prediction information may indicate motion information. The processing circuit may determine a respective first Motion Vector Predictor (MVP) for each of a first plurality of Motion Vector Resolutions (MVRs) corresponding to a first reference picture based on the motion information and a respective first MVR of the first plurality of MVRs. The processing circuit may perform template matching (TM) by determining a TM cost based at least on the first plurality of MVRs and the first MVP.
[0023] In one embodiment, the processing circuit generates an adaptive order of the first plurality of MVRs based on the TM costs, and applies the signaled MVR index based on the generated adaptive order.
[0024] In one embodiment, the current block is predicted uni-predictively. Each of the TM costs corresponds to a respective first MVR of the first plurality of MVRs. The processing circuit can sort the first plurality of MVRs based on the determined TM costs, and reconstruct the current block based on one of the sorted first plurality of MVRs.
[0025] In one embodiment, the motion information indicates an MVP candidate in a candidate list corresponding to a first reference picture. For each of the first plurality of MVRs, the processing circuit can determine a respective first MVP based on the MVP candidate and the respective first MVR. For each of the first plurality of MVRs, the processing circuit can determine a first reference block in the first reference picture. The first MVP of the respective first MVR can point from the current block to the first reference block. The processing circuit can determine a TM cost based on the first reference template of the first reference block and the current template of the current block.
[0026] In one embodiment, the motion information indicates MVP candidates in the candidate list corresponding to the first reference picture. The first plurality of MVRs includes a quarter pixel (pel) and one or more MVRs having a spatial resolution lower than the quarter pixel (pel). The processing circuit can determine an MVP corresponding to the quarter pixel based on the MVP candidate and the quarter pixel. The processing circuit can then determine one or more remaining MVPs of the first MVP based on the MVP corresponding to the quarter pixel and the respective one or more MVRs. For each of the first plurality of MVRs, the processing circuit can determine a first reference block in the first reference picture. The first MVP of each first MVR can point from the current block to the first reference block. The processing circuit can determine a TM cost based on a first reference template of the first reference block and a current template of the current block.
[0027] In one embodiment, the motion information includes MV difference (MVD) information. For each of the first plurality of MVRs, the processing circuit can determine a respective first MVD based on the MVD information and the respective first MVR, and determine a first MV of the respective first MVR based on the respective first MVD. The processing circuit can determine a first reference block in the first reference picture. The first MV of the respective first MVR can point from the current block to the first reference block. The processing circuit can determine a TM cost based on a first reference template of the first reference block and a current template of the current block.
[0028] In one embodiment, the current block is predicted bi-predictively. Each of the TM costs corresponds to a respective one of a plurality of MVR pairs. Each MVR pair includes (i) a first MVR of the first plurality of MVRs and (ii) a second MVR of the second plurality of MVRs corresponding to a second reference picture. The processing circuit can reorder the plurality of MVR pairs based on the determined TM cost, and reconstruct the current block based on one of the reordered plurality of MVR pairs.
[0029] In one example, the motion information indicates a first MVP candidate in a first candidate list corresponding to the first reference picture and a second MVP candidate in a second candidate list corresponding to the second reference picture. The processing circuit can determine a second MVP for each of the second plurality of MVRs corresponding to the second reference picture based on the second MVP candidate and the respective second MVR. For each MVR pair of the plurality of MVR pairs, the processing circuit can determine a first reference block in the first reference picture. The first MVP of each first MVR of the MVR pair can point from the current block to the first reference block. The processing circuit can determine a second reference block in the second reference picture. The second MVP of each second MVR of the MVR pair can point from the current block to the second reference block. The processing circuit can determine a TM cost based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block.
[0030] In one example, for each of the first plurality of MVRs, the processing circuitry may determine a respective first MVP based on the first MVP candidates and the respective first MVR.
[0031] In one example, the first plurality of MVRs includes a quarter pixel and one or more first MVRs having a spatial resolution lower than a quarter pixel. The second plurality of MVRs includes a quarter pixel and one or more second MVRs having a spatial resolution lower than a quarter pixel. The processing circuit can determine a first MVP corresponding to a quarter pixel based on the first MVP candidate and the quarter pixel, and determine one or more remaining first MVPs of the first MVPs based on the first MVP corresponding to the quarter pixel and the respective one or more first MVRs. The processing circuit can determine a second MVP corresponding to a quarter pixel based on the second MVP candidate and the quarter pixel, and determine one or more remaining second MVPs of the second MVPs based on the second MVP corresponding to the quarter pixel and the respective one or more second MVRs.
[0032] In one example, the motion information includes MV difference (MVD) information. For each of the first plurality of MVRs, the processing circuit can determine a first MVD based on the MVD information and a first MVR of each of the first plurality of MVRs, and determine a first MV for each of the first MVR of the first plurality of MVRs based on the first MVD. For each of the second plurality of MVRs, the processing circuit can determine a second MVD based on the MVD information and a second MVR of each of the second plurality of MVRs, and determine a second MV for each of the second MVR of the second plurality of MVRs based on the second MVD. For each MVR pair of the MVR pairs, the processing circuit can determine a first reference block in the first reference picture, and the first MV of each of the first MVR of the MVR pairs can point from the current block to the first reference block. The processing circuit can determine a second reference block in the second reference picture, and a second MV for each second MVR of the MVR pair can point from the current block to the second reference block. The processing circuit can determine a TM cost based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block.
[0033] Aspects of the present disclosure also provide a non-transitory computer-readable storage medium storing a program executable by at least one processor to perform a method for video decoding.
[0034] Further features, nature and various advantages of the disclosed subject matter will become more apparent from the following detailed description and the accompanying drawings. [Brief description of the drawings]
[0035] [Figure 1A] FIG. 2 is a schematic diagram of an example subset of intra-prediction modes. [Figure 1B] FIG. 2 is a diagram of an example intra-prediction direction. [Diagram 2] FIG. 2 shows an example of a current block (201) and surrounding samples. [Diagram 3] FIG. 3 is a schematic diagram of an example block diagram of a communication system (300). [Figure 4] FIG. 4 is a schematic diagram of an example block diagram of a communication system (400). [Diagram 5] FIG. 2 is a schematic diagram of an example block diagram of a decoder. [Figure 6] FIG. 2 is a schematic diagram of an example block diagram of an encoder; [Figure 7] 1 is a block diagram illustrating an exemplary encoder. [Figure 8] FIG. 2 is a block diagram illustrating an exemplary decoder. [Figure 9] FIG. 2 illustrates locations of spatial merge candidates according to one embodiment of the present disclosure. [Figure 10] FIG. 1 illustrates candidate pairs considered for redundancy check of spatial merge candidates, according to one embodiment of the present disclosure. [Figure 11] FIG. 13 illustrates an example motion vector scaling for temporal merge candidates. [Figure 12] A diagram illustrating example candidate positions for temporal merge candidates for a current coding unit. [Figure 13] FIG. 2 is a diagram showing examples of adaptive motion vector resolution (AMVR) shift values (e.g., AmvrShift) corresponding to motion vector resolutions (MVRs). [Figure 14] A diagram showing exemplary modifications of motion vector differentials in adaptive motion vector prediction (AMVP) mode and affine AMVP mode when AMVR mode is enabled. [Figure 15A] FIG. 13 shows an affine motion field of a block when using a four-parameter affine model. [Figure 15B] FIG. 13 shows an affine motion field for a block when using a six-parameter affine model. [Figure 16] 1 illustrates an example of sub-block based affine transform prediction. [Figure 17] FIG. 13 illustrates an example of control point motion vector (CPMV) candidate determination in an affine merge list for a current coding unit (CU). [Figure 18] FIG. 2 illustrates an example of spatial and temporal neighbors of a current block. [Figure 19] FIG. 1 is a diagram illustrating an example of template matching (TM). [Figure 20] FIG. 13 is a diagram showing an example of a TM applied to a set of MVRs. [Figure 21] FIG. 13 illustrates an example of a TM when a current block is predicted using a bi-prediction mode. [Figure 22] FIG. 13 is a diagram showing an example of a TM in affine merge mode. [Figure 23] 1 is a flowchart outlining an encoding process according to one embodiment of the present disclosure. [Figure 24] 1 is a flow chart outlining a decoding process according to one embodiment of the present disclosure. [Diagram 25] 13 is a flowchart outlining a decoding process according to one embodiment of the present disclosure. [Figure 26] FIG. 1 is a schematic diagram of a computer system according to one embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0036] FIG. 3 illustrates an example block diagram of a communication system (300). The communication system (300) includes a plurality of terminal devices that can communicate with each other, for example, via a network (350). For example, the communication system (300) includes a first pair of terminal devices (310) and (320) interconnected via the network (350). In the example of FIG. 3, the first pair of terminal devices (310) and (320) perform unidirectional transmission of data. For example, the terminal device (310) may code video data (e.g., a stream of video pictures captured by the terminal device (310)) for transmission to the other terminal device (320) via the network (350). The encoded video data may be transmitted in the form of one or more coded video bitstreams. The terminal device (320) may receive the coded video data from the network (350), decode the coded video data to reconstruct the video pictures, and display the video pictures according to the reconstructed video data. One-way data transmission may be common, such as in media serving applications.
[0037] In another example, the communication system (300) includes a second pair of terminal devices (330) and (340) implementing bidirectional transmission of coded video data, for example during a video conference. In the case of bidirectional transmission of data, in one example, each of the terminal devices (330) and (340) can code video data (e.g., a stream of video pictures captured by the terminal device) for transmission to the other of the terminal devices (330) and (340) over the network (350). Each of the terminal devices (330) and (340) can also receive coded video data transmitted by the other of the terminal devices (330) and (340), can decode the coded video data to recover the video pictures, and can display the video pictures on an accessible display device according to the recovered video data.
[0038] In the example of FIG. 3, terminal devices (310), (320), (330), and (340) are illustrated as a server, a personal computer, and a smartphone, respectively, although the principles of the present disclosure may not be so limited. The embodiments of the present disclosure apply with laptop computers, tablet computers, media players, and / or dedicated video conferencing equipment. Network (350) represents any number of networks that convey decoded video data between terminal devices (310), (320), (330), and (340), including, for example, wired (wired) and / or wireless communication networks. Communication network (350) may exchange data over circuit-switched channels and / or packet-switched channels. Representative networks include telecommunications networks, local area networks, wide area networks, and / or the Internet. For purposes of this discussion, the architecture and topology of network (350) may not be important to the operation of the present disclosure unless otherwise described herein below.
[0039] 4 shows a video encoder and video decoder in a streaming environment as an example of an application for the disclosed subject matter. The disclosed subject matter may be equally applicable to other video-enabled applications including, for example, video conferencing, digital television, streaming services, storage of compressed video on digital media including CDs, DVDs, memory sticks, etc.
[0040] The streaming system may include a capture subsystem (413) that may include a video source (401), such as a digital camera, that creates a stream of uncompressed video pictures (402). In one example, the stream of video pictures (402) includes samples taken by a digital camera. The stream of video pictures (402) is depicted with a thick line to emphasize its high amount of data compared to the encoded video data (404) (or coded video bitstream) and may be processed by an electronic device (420) that includes a video encoder (403) coupled to the video source (401). The video encoder (403) may include hardware, software, or a combination thereof to enable or implement aspects of the disclosed subject matter, as described in more detail below. The encoded video data (404) (or encoded video bitstream), depicted as a thin line to emphasize its smaller amount of data compared to the stream of video pictures (402), may be stored in a streaming server (405) for future use. One or more streaming client subsystems, such as the client subsystems (406) and (408) of FIG. 4, can access the streaming server (405) to retrieve copies (407) and (409) of the encoded video data (404). The client subsystem (406) can include a video decoder (410), for example within an electronic device (430). The video decoder (410) decodes an input copy (407) of the encoded video data and creates an output stream (411) of video pictures that can be rendered on a display (412) (e.g., a display screen) or other rendering device (not shown). In some streaming systems, the encoded video data (404), (407), and (409) (e.g., a video bitstream) can be encoded according to a particular video coding / compression standard. Examples of such standards include ITU-T Recommendation H.265.In one example, a developing video coding standard is informally known as Versatile Video Coding (VVC), and the disclosed subject matter may be used in the context of VVC.
[0041] It should be noted that the electronic devices (420) and (430) may include other components (not shown). For example, the electronic device (420) may include a video decoder (not shown), and the electronic device (430) may also include a video encoder (not shown).
[0042] 5 shows an example block diagram of a video decoder (510). The video decoder (510) can be included in an electronic device (530). The electronic device (530) can include a receiver (531) (e.g., receiving circuitry). The video decoder (510) can be used in place of the video decoder (410) in the example of FIG. 4.
[0043] The receiver (531) may receive one or more coded video sequences to be decoded by the video decoder (510). In one embodiment, one coded video sequence is received at a time, and the decoding of each coded video sequence is independent of the decoding of the other coded video sequences. The coded video sequences may be received from a channel (501), which may be a hardware / software link to a storage device that stores the encoded video data. The receiver (531) may receive the encoded video data along with other data, such as coded audio data and / or auxiliary data streams, that may be forwarded to their respective using entities (not shown). The receiver (531) may separate the coded video sequences from the other data. To combat network jitter, a buffer memory (515) may be coupled between the receiver (531) and the entropy decoder / parser (520) (hereinafter "parser (520)"). In certain applications, the buffer memory (515) is part of the video decoder (510). In other applications, the buffer memory (515) may be external to the video decoder (510) (not shown). In still other applications, there may be a buffer memory (not shown) external to the video decoder (510), e.g., to combat network jitter, plus another buffer memory (515) internal to the video decoder (510), e.g., to handle playout timing. When the receiver (531) is receiving data from a storage / forwarding device with sufficient bandwidth and controllability, or from an isosynchronous network, the buffer memory (515) may be unnecessary or may be small. For use with best-effort packet networks such as the Internet, the buffer memory (515) may be required and may be relatively large, advantageously of adaptive size, and may be implemented at least in part in an operating system or similar element (not shown) external to the video decoder (510).
[0044] The video decoder (510) may include a parser (520) to reconstruct symbols (521) from the coded video sequence. These categories of symbols include information used to manage the operation of the video decoder (510) and potentially information for controlling a rendering device such as a rendering device (512) (e.g., a display screen) that is not an integral part of the electronic device (530) but may be coupled to the electronic device (530) as shown in FIG. 5. The control information for the rendering device may be in the form of a supplemental enhancement information (SEI) message or a video usability information (VUI) parameter set fragment (not shown). The parser (520) may parse / entropy decode the received coded video sequence. The coding of the coded video sequence may follow a video coding technique or standard and may follow various principles including variable length coding with or without context dependency, Huffman coding, arithmetic coding, etc. The parser (520) may extract from the coded video sequence a set of subgroup parameters for at least one of the subgroups of pixels in the video decoder based on at least one parameter corresponding to the group. The subgroups may include Group of Pictures (GOPs), pictures, tiles, slices, macroblocks, coding units (CUs), blocks, transform units (TUs), prediction units (PUs), etc. The parser (520) may also extract from the coded video sequence information such as transform coefficients, quantization parameter values, motion vectors, etc.
[0045] The parser (520) can perform an entropy decoding / parsing operation on the video sequence received from the buffer memory (515) to produce symbols (521).
[0046] The reconstruction of the symbols (521) can involve several different units, depending on the type of video picture or portion thereof being coded (inter-picture and intra-picture, inter-block and intra-block, etc.), as well as other factors. Which units are involved and how can be controlled by subgroup control information parsed from the coded video sequence by the parser (520). The flow of such subgroup control information between the parser (520) and the following units is not depicted for the sake of clarity.
[0047] In addition to the functional blocks already mentioned, the video decoder (510) may be conceptually subdivided into several functional units, as described below. In an actual implementation operating under commercial constraints, many of these units may interact closely with each other and may be at least partially integrated with each other. However, for purposes of describing the disclosed subject matter, the following conceptual subdivision into functional units is appropriate.
[0048] The first unit is a scalar / inverse transform unit (551), which receives quantized transform coefficients as well as control information from the parser (520) including which transform to use, block size, quantization coefficients, quantization scaling matrices, etc. as symbol(s) (521). The scalar / inverse transform unit (551) may output a block comprising sample values that may be input to an aggregator (555).
[0049] In some cases, the output samples of the scaler / inverse transform unit (551) may relate to intra-coded blocks. Intra-coded blocks are blocks that do not use prediction information from a previously reconstructed picture, but can use prediction information from a previously reconstructed portion of the current picture. Such prediction information can be provided by an intra-picture prediction unit (552). In some cases, the intra-picture prediction unit (552) generates a block of the same size and shape as the block being reconstructed using surrounding already reconstructed information fetched from a current picture buffer (558). The current picture buffer (558) buffers, for example, a partially reconstructed current picture and / or a fully reconstructed current picture. The aggregator (555) adds, possibly on a sample-by-sample basis, the prediction information generated by the intra-prediction unit (552) to the output sample information provided by the scaler / inverse transform unit (551).
[0050] In other cases, the output samples of the scalar / inverse transform unit (551) may relate to an inter-coded, potentially motion-compensated block. In such cases, the motion compensated prediction unit (553) may access the reference picture memory (557) to fetch samples used for prediction. After motion compensating the fetched samples according to the symbols (521) related to the block, these samples may be added to the output of the scalar / inverse transform unit (551) by the aggregator (555) to generate output sample information (in this case referred to as residual samples or residual signals). The addresses in the reference picture memory (557) from which the motion compensated prediction unit (553) fetches the prediction samples may be controlled by motion vectors available to the motion compensated prediction unit (553) in the form of symbols (521), which may have, for example, X, Y, and reference picture components. Motion compensation may also include interpolation of sample values fetched from the reference picture memory (557) when sub-sample accurate motion vectors are used, motion vector prediction mechanisms, etc.
[0051] The output samples of the aggregator (555) may be subjected to various loop filtering techniques in a loop filter unit (556). Video compression techniques may include in-loop filter techniques controlled by parameters contained in the coded video sequence (also called a coded video bitstream) and provided to the loop filter unit (556) as symbols (521) from the parser (520). Video compression may also be performed in response to meta-information obtained during decoding of a previous portion (in decoding order) of the coded picture or coded video sequence, or in response to previously reconstructed and loop filtered sample values.
[0052] The output of the loop filter unit (556) may be a sample stream that can be output to a rendering device (512), but also stored in a reference picture memory (557) for use in future inter-picture prediction.
[0053] Once a particular coded picture image is fully reconstructed, it can be used as a reference picture for future prediction. For example, once a coded picture corresponding to a current picture is fully reconstructed and the coded picture is identified as a reference image (e.g., by the parser (520)), the current picture buffer (558) can become part of the reference picture memory (557), and a fresh current picture buffer can be reallocated before beginning reconstruction of the next coded picture.
[0054] The video decoder (510) may perform decoding operations according to a given video compression technique or standard, such as ITU-T Rec. H.265. The coded video sequence may comply with the syntax specified by the video compression technique or standard used in the sense that the coded video sequence adheres to both the syntax of the video compression technique or standard and the profile documented in the video compression technique or standard. Specifically, the profile may select certain tools from among all tools available in the video compression technique or standard as tools that are only available to them under that profile. Also, what is required for compliance may be that the complexity of the coded video sequence is within a range defined by the level of the video compression technique or standard. In some cases, the level limits the maximum picture size, maximum frame rate, maximum reconstruction sample rate (e.g., measured in megasamples per second), maximum reference picture size, etc. The limits set by the level may be further limited in some cases by the specification of a Hypothetical Reference Decoder (HRD) and metadata of HRD buffer management signaled in the coded video sequence.
[0055] In one embodiment, the receiver (531) can receive additional (redundant) data along with the encoded video. The additional data may be included as part of the coded video sequence(s). The additional data may be used by the video decoder (510) to properly decode the data and / or to more accurately reconstruct the original video data. The additional data may be in the form of, for example, temporal, spatial, or signal-to-noise ratio (SNR) enhancement layers, redundant slices, redundant pictures, forward error correction codes, etc.
[0056] 6 shows an example block diagram of a video encoder (603). The video encoder (603) is included in an electronic device (620). The electronic device (620) includes a transmitter (640) (e.g., a transmitting circuit). The video encoder (603) can be used in place of the video encoder (403) of the example of FIG.
[0057] The video encoder (603) may receive video samples from a video source (601) (which is not part of the electronic device (620) in the example of FIG. 6) that may capture the video image(s) to be coded by the video encoder (603). In other examples, the video source (601) is part of the electronic device (620).
[0058] The video source (601) may provide a source video sequence to be coded by the video encoder (603) in the form of a digital video sample stream, which may be of any suitable bit depth (e.g., 8-bit, 10-bit, 12-bit, ...), any color space (e.g., BT.601YCrCB, RGB, ...) and suitable sampling structure (e.g., YCrCb4:2:0, YCrCb4:4:4). In a media serving system, the video source (601) may be a storage device that stores previously prepared video. In a video conferencing system, the video source (601) may be a camera that captures local image information as a video sequence. The video data may be provided as multiple individual pictures that convey motion when viewed in sequence. The pictures themselves may be organized as a spatial array of pixels, each pixel may contain one or more samples, depending on the sampling structure, color space, etc. in use. Those skilled in the art can easily understand the relationship between pixels and samples. The following description focuses on samples.
[0059] According to one embodiment, the video encoder (603) may code and compress pictures of a source video sequence into a coded video sequence (643) in real time or under any other time constraints required. Enforcing an appropriate coding rate is one function of the controller (650). In some embodiments, the controller (650) controls and is functionally coupled to other functional units described below. This coupling is not depicted for clarity. Parameters set by the controller (650) may include rate control related parameters (picture skip, quantizer, lambda value for rate distortion optimization techniques, ...), picture size, group of pictures (GOP) layout, maximum motion vector search range, etc. The controller (650) may be configured with other appropriate functions for the video encoder (603) optimized for a particular system design.
[0060] In some embodiments, the video encoder (603) is configured to operate in a coding loop. As an oversimplified explanation, in one example, the coding loop can include a source coder (630) (responsible for creating symbols, such as a symbol stream, based on an input picture to be coded and a reference picture, for example), as well as a (local) decoder (633) embedded in the video encoder (603). The decoder (633) reconstructs the symbols to create sample data in a manner similar to what a (remote) decoder would also create. The reconstructed sample stream (sample data) is input to a reference picture memory (634). Since the decoding of the symbol stream results in bit-exact results regardless of the location of the decoder (local or remote), the contents of the reference picture memory (634) are also bit-exact between the local and remote encoders. In other words, the predictive part of the encoder "sees" exactly the same sample values as the decoder would "see" when using prediction during decoding as reference picture samples. This basic principle of reference picture synchrony (and the drift that occurs when synchrony cannot be maintained, for example due to channel errors) is also used in several related techniques.
[0061] The operation of the "local" decoder (633) may be the same as the operation of a "remote" decoder, such as the video decoder (510), already described in detail above in conjunction with Figure 5. Referring also briefly to Figure 5, however, because symbols are available and the encoding / decoding of symbols into a coded video sequence by the entropy coder (645) and parser (520) may be lossless, the entropy decoding portion of the video decoder (510), including the buffer memory (515), and the parser (520), may not be fully implemented in the local decoder (633).
[0062] In one embodiment, the decoder technology, except for parsing / entropy decoding, present in the decoder, is present in the corresponding encoder in the same or substantially the same functional form. Thus, the disclosed subject matter focuses on the operation of the decoder. The description of the encoder technology can be omitted since it is the inverse of the decoder technology described generically. Only in certain areas is more detailed description required and is provided below.
[0063] In some examples, during operation, the source coder (630) may perform motion-compensated predictive coding, which predictively codes an input picture with reference to one or more previously coded pictures from a video sequence designated as “reference pictures.” In this manner, the coding engine (632) codes differences between pixel blocks of the input picture and pixel blocks of reference pictures that may be selected as predictive references for the input picture.
[0064] The local video decoder (633) may decode the coded video data of pictures that may be designated as reference pictures based on the symbols created by the source coder (630). The operation of the coding engine (632) may advantageously be a lossy process. When the coded video data may be decoded in a video decoder (not shown in FIG. 6), the reconstructed video sequence may usually be a copy of the source video sequence with some errors. The local video decoder (633) may replicate the decoding process that may be performed by the video decoder on the reference pictures and store the reconstructed reference pictures in the reference picture memory (634). In this way, the video encoder (603) may locally store copies of reconstructed reference pictures that have common content as reconstructed reference pictures that will be obtained by the far-end video decoder (without transmission errors).
[0065] The predictor (635) may perform a prediction search for the coding engine (632). That is, for a new picture to be coded, the predictor (635) may search the reference picture memory (634) for sample data (as candidate reference pixel blocks) or specific metadata such as reference picture motion vectors, block shapes, etc., that can serve as suitable prediction references for the new pixels. The predictor (635) may operate on sample blocks on a pixel block by pixel block basis to find suitable prediction references. In some cases, as determined by the search results obtained by the predictor (635), the input picture may have prediction references drawn from multiple reference pictures stored in the reference picture memory (634).
[0066] The controller (650) may manage the coding operations of the source coder (630), including, for example, setting the parameters and subgroup parameters used to encode the video data.
[0067] The output of all the aforementioned functional units may undergo entropy coding in an entropy coder (645), which converts the symbols produced by the various functional units into a coded video sequence by applying lossless compression to the symbols according to techniques such as Huffman coding, variable length coding, arithmetic coding, etc.
[0068] The transmitter (640) may buffer the coded video sequence created by the entropy coder (645) and prepare it for transmission over a communication channel (660), which may be a hardware / software link to a storage device that stores the encoded video data. The transmitter (640) may merge the coded video data from the video encoder (603) with other data to be transmitted, such as coded audio data and / or auxiliary data streams (sources not shown).
[0069] The controller (650) may manage the operation of the video encoder (603). During coding, the controller (650) may assign a particular coded picture type to each coded picture, which may affect the coding techniques that may be applied to the respective picture. For example, pictures may often be assigned as one of the following picture types:
[0070] An intra picture (I-picture) may be one that can be coded and decoded without using other pictures in a sequence as a source of prediction. Some video codecs allow different types of intra pictures, including, for example, independent decoder refresh ("IDR") pictures. Those skilled in the art are aware of these variants of I-pictures and their respective uses and characteristics.
[0071] A predictive picture (P picture) may be one that can be coded and decoded using intra- or inter-prediction, which uses at most one motion vector and reference index to predict the sample values of each block.
[0072] Bidirectionally predicted pictures (B-pictures) may be those that can be coded and decoded using intra- or inter-prediction, which uses up to two motion vectors and reference indices to predict the sample values of each block. Similarly, multiple predicted pictures can use more than two reference pictures and associated metadata to reconstruct a single block.
[0073] A source picture may generally be spatially subdivided into multiple sample blocks (e.g., blocks of 4x4, 8x8, 4x8, or 16x16 samples each) and coded block by block. A block may be predictively coded with reference to other (already coded) blocks determined by the coding assignment applied to the block's respective picture. For example, a block of an I picture may be non-predictively coded or predictively coded with reference to already coded blocks of the same picture (spatial or intra prediction). A pixel block of a P picture may be predictively coded with reference to one previously coded reference picture via spatial prediction or via temporal prediction. A block of a B picture may be predictively coded with reference to one or two previously coded reference pictures by spatial prediction or by temporal prediction.
[0074] The video encoder (603) may perform coding operations according to a given video coding technique or standard, such as ITU-T Rec. H.265. In its operations, the video encoder (603) may perform various compression operations, including predictive coding operations that exploit temporal and spatial redundancies in the input video sequence. Thus, the coded video data may conform to a syntax specified by the video coding technique or standard being used.
[0075] In one embodiment, the transmitter (640) may transmit additional data along with the encoded video. The source coder (630) may include such data as part of the coded video sequence. The additional data may include temporal / spatial / SNR enhancement layers, other forms of redundant data such as redundant pictures and slices, SEI messages, VUI parameter set fragments, etc.
[0076] Video may be captured as multiple source pictures (video pictures) in a time sequence. Intra-picture prediction (often abbreviated as intra-prediction) exploits spatial correlation within a given picture, while inter-picture prediction exploits correlation (temporal or other) between pictures. In one example, a particular picture being encoded / decoded, called the current picture, is divided into blocks. When a block in the current picture is similar to a reference block in a previously coded, yet buffered reference picture in the video, the block in the current picture may be coded by a vector called a motion vector. A motion vector points to a reference block in a reference picture, and may have a third dimension that identifies the reference picture if multiple reference pictures are used.
[0077] In some embodiments, a bi-prediction technique may be used for inter-picture prediction. According to the bi-prediction technique, two reference pictures, such as a first reference picture and a second reference picture, are used, both of which are before the decoding order of the current picture in the video (but the display order may be past and future, respectively). A block in the current picture may be coded by a first motion vector that points to a first reference block in the first reference picture and a second motion vector that points to a second reference block in the second reference picture. A block may be predicted by a combination of the first reference block and the second reference block.
[0078] Furthermore, to improve coding efficiency, merge mode techniques can be used for inter-picture prediction.
[0079] According to some embodiments of the present disclosure, prediction, such as inter-picture prediction and intra-picture prediction, is performed on a block-by-block basis. For example, according to the HEVC standard, a picture in a sequence of video pictures is divided into coding tree units (CTUs) for compression, and the CTUs in a picture have the same size, such as 64×64 pixels, 32×32 pixels, and 16×16 pixels. In general, a CTU includes three coding tree blocks (CTBs), one luma CTB and two chroma CTBs. Each CTU can be recursively quadtree partitioned into one or more coding units (CUs). For example, a CTU of 64×64 pixels can be partitioned into one CU of 64×64 pixels, or into four CUs of 32×32 pixels, or into 16 CUs of 16×16 pixels. In one example, each CU is analyzed to determine the prediction type of the CU, such as an inter prediction type or an intra prediction type. A CU is divided into one or more prediction units (PUs) according to temporal predictability and / or spatial predictability. In general, each PU includes one luma prediction block (PB) and two chroma PBs. In one embodiment, the prediction operation in coding (encoding / decoding) is performed in units of prediction blocks. Taking a luma prediction block as an example of a prediction block, the prediction block includes a matrix of pixel values (e.g., luma values), such as 8×8 pixels, 16×16 pixels, 8×16 pixels, and 16×8 pixels.
[0080] 7 shows an example diagram of a video encoder (703). The video encoder (703) is configured to receive a processed block of sample values (e.g., a predictive block) in a current video picture in a sequence of video pictures and encode the processed block into a coded picture that is part of a coded video sequence. In one example, the video encoder (703) is used in place of the video encoder (403) of the example of FIG. 4.
[0081] In an HEVC example, the video encoder (703) receives a matrix of sample values for a processing block, such as a predictive block of 8×8 samples. The video encoder (703) determines whether the processing block is optimally coded using intra-mode, inter-mode, or bi-predictive mode, for example, using rate-distortion optimization. If the processing block is to be intra-mode decoded, the video encoder (703) may encode the processing block into a coded picture using intra-prediction techniques, and if the processing block is to be inter-mode or bi-predictive mode decoded, the video encoder (703) may encode the processing block into a coded picture using inter-prediction techniques or bi-prediction techniques, respectively. In certain video coding techniques, the merge mode may be an inter-picture prediction sub-mode in which a motion vector is derived from one or more motion vector predictors without the aid of coded motion vector components outside the predictors. In certain other video coding techniques, there may be motion vector components applicable to the current block. In one example, the video encoder (703) includes other components, such as a mode decision module (not shown) for determining the mode of the processing blocks.
[0082] In the example of FIG. 7, the video encoder (703) includes an inter-encoder (730), an intra-encoder (722), a residual calculator (723), a switch (726), a residual encoder (724), a general controller (721), and an entropy encoder (725), coupled to each other as shown in FIG. 7.
[0083] The inter-encoder (730) is configured to receive samples of a current block (e.g., a processing block), compare the block to one or more reference blocks in reference pictures (e.g., blocks in previous and subsequent pictures), generate inter-prediction information (e.g., inter-encoding techniques, motion vectors, description of redundant information by merge mode information), and calculate an inter-prediction result (e.g., a predictive block) based on the inter-prediction information using any suitable technique. In some examples, the reference picture is a decoded reference picture that is decoded based on the encoded video information.
[0084] The intra encoder (722) is configured to receive samples of a current block (e.g., a processing block), possibly compare the block with already coded blocks in the same picture, generate transformed quantized coefficients, and possibly also generate intra prediction information (e.g., intra prediction direction information according to one or more intra encoding techniques). In one example, the intra encoder (722) also calculates intra prediction results (e.g., prediction blocks) based on the intra prediction information and reference blocks in the same picture.
[0085] The generic controller (721) is configured to determine generic control data and control other components of the video encoder (703) based on the generic control data. In one example, the generic controller (721) determines the mode of the block and provides a control signal to the switch (726) based on the mode. For example, if the mode is an intra mode, the generic controller (721) controls the switch (726) to select an intra mode result for the residual calculator (723) to use, and controls the entropy encoder (725) to select intra prediction information to include in the bitstream. If the mode is an inter mode, the generic controller (721) controls the switch (726) to select an inter prediction result for the residual calculator (723) to use, and controls the entropy encoder (725) to select inter prediction information to include in the bitstream.
[0086] The residual calculator (723) is configured to calculate a difference (residual data) between the received block and a prediction result selected from the intra-encoder (722) or the inter-encoder (730). The residual encoder (724) is configured to operate based on the residual data to encode the residual data to generate transform coefficients. In one example, the residual encoder (724) is configured to transform the residual data from the spatial domain to the frequency domain to generate transform coefficients. The transform coefficients then undergo a quantization process to obtain quantized transform coefficients. In various embodiments, the video encoder (703) also includes a residual decoder (728). The residual decoder (728) is configured to perform an inverse transform and generate decoded residual data. The decoded residual data can be used by the intra-encoder (722) and the inter-encoder (730) as appropriate. For example, the inter-encoder (730) may generate decoded blocks based on the decoded residual data and the inter-prediction information, and the intra-encoder (722) may generate decoded blocks based on the decoded residual data and the intra-prediction information. In some examples, the decoded blocks may be appropriately processed to generate a decoded picture, which may be buffered in a memory circuit (not shown) and used as a reference picture.
[0087] The entropy encoder (725) is configured to format a bitstream to include the encoded block. The entropy encoder (725) is configured to include various information in the bitstream according to an appropriate standard, such as the HEVC standard. In one example, the entropy encoder (725) is configured to include in the bitstream general control data, selected prediction information (e.g., intra-prediction information or inter-prediction information), residual information, and other appropriate information. It should be noted that, according to the disclosed subject matter, when coding a block in a merged sub-mode of either an inter mode or a bi-prediction mode, no residual information is present.
[0088] 8 shows an example diagram of a video decoder (810). The video decoder (810) is configured to receive coded pictures that are part of a coded video sequence and decode the coded pictures to generate reconstructed pictures. In one example, the video decoder (810) is used in place of the video decoder (410) of the example of FIG. 4.
[0089] In the example of FIG. 8, the video decoder (810) includes an entropy decoder (871), an inter-decoder (880), a residual decoder (873), a reconstruction module (874), and an intra-decoder (872), coupled to each other as shown in FIG.
[0090] The entropy decoder (871) may be configured to reconstruct from the coded picture certain symbols that represent syntax elements of which the coded picture is composed. Such symbols may include, for example, prediction information (e.g., intra-mode, inter-mode, bi-predictive mode, inter-mode and bi-predictive mode of merged or other submodes, etc.) that may identify the mode in which the block is coded, as well as certain samples or metadata used for prediction by the intra-decoder (872) or the inter-decoder (880), respectively (e.g., intra-prediction and inter-prediction information, etc.). The symbols may also include, for example, residual information in the form of quantized transform coefficients, etc. In one example, if the prediction mode is an inter-mode or bi-predictive mode, the inter-prediction information is provided to the inter-decoder (880), and if the prediction type is an intra-prediction type, the intra-prediction information is provided to the intra-decoder (872). The residual information may undergo inverse quantization and is provided to the residual decoder (873).
[0091] The inter decoder (880) is configured to receive the inter prediction information and to generate inter prediction results based on the inter prediction information.
[0092] The intra decoder (872) is configured to receive the intra prediction information and to generate a prediction result based on the intra prediction information.
[0093] The residual decoder (873) is configured to perform inverse quantization to extract inverse quantized transform coefficients, and to process the inverse quantized transform coefficients to transform the residual information from the frequency domain to the spatial domain. The residual decoder (873) may also require certain control information (to include quantization parameters (QPs)), which may be provided by the entropy decoder (871) (this may be only a small amount of control information, so a data path is not depicted).
[0094] The reconstruction module (874) is configured to combine, in the spatial domain, the residual information output by the residual decoder (873) and the prediction result (possibly output by the inter prediction module or the intra prediction module) to form a reconstructed block that may become part of a reconstructed picture, which may become part of a reconstructed video. It should be noted that other suitable operations, such as a deblocking operation, may be performed to improve visual quality.
[0095] It should be noted that the video encoders (403), (603), and (703) and the video decoders (410), (510), and (810) can be implemented using any suitable technology. In one embodiment, the video encoders (403), (603), and (703) and the video decoders (410), (510), and (810) may be implemented using one or more integrated circuits. In other embodiments, the video encoders (403), (603), and (603) and the video decoders (410), (510), and (810) can be implemented using one or more processors executing software instructions.
[0096] Various inter prediction modes may be used in VVC. For inter predicted CUs, the motion parameters may include MV(s), one or more reference picture indexes, reference picture list usage index, and additional information about the specific coding features to be used for inter predicted sample generation. The motion parameters may be signaled explicitly or implicitly. If a CU is skip mode decoded, the CU may be associated with a PU and may not have significant residual coefficients, coded motion vector deltas, MV differences (e.g. MVD), or reference picture indexes. A merge mode may be specified, and the motion parameters of the current CU are obtained from neighboring CUs, including spatial and / or temporal candidates, and possibly additional information as introduced in VVC. The merge mode may be applied to inter predicted CUs, not only for skip mode. In one example, an alternative to the merge mode is explicit transmission of motion parameters, in which the MV(s), the corresponding reference picture index of each reference picture list, and a reference picture list usage flag and other information are explicitly signaled for each CU.
[0097] In an embodiment such as VVC, the VVC Test Model (VTM) reference software includes the following features: Enhanced merge prediction, Merge Motion Vector Difference (MMVD) mode, Adaptive Motion Vector Prediction (AMVP) mode with symmetric MVD signaling, Affine motion compensation prediction, Subblock-based Temporal Motion Vector Prediction (SbTMVP), Adaptive Motion Vector Resolution (AMVR), Motion Field Storage (1 / 16 Luma sample MV storage and 8x8 motion field compression), Bi-prediction with CU-level weights (BCW), Bi-Directional Optical Flow (BDOF), Prediction Refinement using Optical Flow (PROF), Decoder side Motion Vector Refinement (DMVR), Combined Inter and Intra Combined Prediction (CIIP), and 8x8 Motion Field Compression (8x8) motion field compression. The present invention includes one or more sophisticated inter-prediction coding tools, including Inter Prediction (IPC), Geometric Partitioning Mode (GPM), etc. Inter prediction and related methods are described in more detail below.
[0098] In some examples, enhanced merge prediction may be used. In examples such as VTM4, a merge candidate list is constructed by including five types of candidates in order: spatial Motion Vector Predictor (MVP) from spatially adjacent CUs, temporal MVP from co-located CUs, history-based MVP from a first-in-first-out (FIFO) table, pair-wise average MVP, and zero MV.
[0099] The size of the merge candidate list may be signaled in the slice header. In one example, the maximum allowed size of the merge candidate list is 6 in VTM4. For each merge mode decoded CU, the index of the best merge candidate (e.g., merge index) may be encoded using truncated unary binarization (TU). The first bin of the merge index may be context (e.g., Context-Adaptive Binary Arithmetic Coding (CABAC)) decoded, and bypass coding may be used for the other bins.
[0100] Some examples of the generation process for each category of merge candidates are given below. In one embodiment, spatial candidates are derived as follows: The derivation of spatial merge candidates in VVC may be the same as that in HEVC. In one example, up to four merge candidates are selected from the candidates at the positions shown in FIG. 9. FIG. 9 shows the positions of spatial merge candidates according to one embodiment of the present disclosure. With reference to FIG. 9, the order of derivation is B1, A1, B0, A0, and B2. Position B2 is considered only if any of the CUs at positions A0, B0, B1, and A1 are unavailable (e.g., because the CU belongs to another slice or another tile) or are intra-coded. After the candidate at position A1 is added, the addition of the remaining candidates is subject to a redundancy check that ensures that candidates with the same motion information are removed from the candidate list to improve coding efficiency.
[0101] In order to reduce computational complexity, not all possible candidate pairs are considered in the above-mentioned redundancy check. Instead, only the pairs connected by the arrows in FIG. 10 are considered, and a candidate is added to the candidate list only if the corresponding candidates used in the redundancy check do not have the same motion information. FIG. 10 illustrates candidate pairs considered for a spatial merge candidate redundancy check according to one embodiment of the present disclosure. With reference to FIG. 10, each of the arrow-connected pairs includes A1 and B1, A1 and A0, A1 and B2, B1 and B0, and B1 and B2. Thus, candidates at positions B1, A0, and / or B2 can be compared with candidates at positions A1, and candidates at positions B0 and / or B2 can be compared with candidates at positions B1.
[0102] In one embodiment, the temporal candidates are derived as follows: In one example, only one temporal merge candidate is added to the candidate list. FIG. 11 illustrates an example motion vector scaling of a temporal merge candidate. To derive a temporal merge candidate for a current CU (1111) in a current picture (1101), a scaled MV (1121) (e.g., shown by a dotted line in FIG. 11) may be derived based on a co-located CU (1112) belonging to a co-located reference picture (1104). The reference picture list used to derive the co-located CU (1112) may be explicitly signaled in the slice header. The scaled MV (1121) for the temporal merge candidate may be determined as shown by a dotted line in FIG. 11. The scaled MV (1121) may be scaled from the MV of the co-located CU (1112) using Picture Order Count (POC) distances tb and td. The POC distance tb may be defined to be the POC difference between the current reference picture (1102) of the current picture (1101) and the current picture (1101). The POC distance td may be defined to be the POC difference between the co-located reference picture (1104) of the co-located picture (1103) and the co-located picture (1103). The reference picture index of the temporal merge candidate may be set to zero.
[0103] FIG. 12 shows exemplary candidate positions (e.g., C0 and C1) of a temporal merge candidate for a current CU. The position of the temporal merge candidate may be selected between candidate positions C0, C1. Candidate position C0 is located at the bottom right corner of the current CU's colocated CU (1210). Candidate position C1 is located at the center of the current CU's colocated CU (1210). If the CU at candidate position C0 is unavailable, intra-coded, or outside the current row of the CTU, candidate position C1 is used to derive the temporal merge candidate. Otherwise, for example, if the CU at candidate position C0 is available and intra-coded, and in the current row of the CTU, candidate position C0 is used to derive the temporal merge candidate.
[0104] An adaptive motion vector resolution (AMVR) mode may be used in video / image coding such as VVC. In some technologies, such as video coding standards HEVC and AVC / H.264, a fixed motion vector resolution (MVR) of one-quarter (1 / 4) luma samples (or 1 / 4 pixels) is used. In general, an optimal trade-off between displacement vector rate and prediction error rate is selected to optimize rate distortion. In related technologies, such as VVC, an AMVR mode may be enabled and an MVR may be selected, for example, from multiple MVRs at the coding block level, thus making a trade-off between fidelity and bit rate of signaling motion parameters. The AMVR mode may be signaled, for example, at the coding block level, if at least one component of the MVD is not equal to zero. The motion vector predictor (MVP) may be rounded to a given MVR, such that the resulting MV (e.g., the sum of the MVP and the MVD) may fit into the grid of the given MVR.
[0105] FIG. 13 shows an example of Amvr shift values (e.g., AmvrShift) corresponding to resolutions (e.g., MVR). For each given resolution (e.g., MVR), the corresponding Amvr shift value (e.g., AmvrShift) indicates a shift operation (e.g., left shift operation). For example, AmvrShift is defined to specify the MVR of an MVD with a left shift operation, and the number of bits to be shifted is indicated by AmvrShift.
[0106] In some examples, a flag such as an AMVR flag (e.g., amvr_flag) specifies the resolution (e.g., MVR) of the MVD. In one example, an AMVR flag (e.g., amvr_flag) equal to 0 specifies that the MVR of the MVD is ¼ luma samples (¼ pixel). In FIG. 13, an MVR of ¼ pixel corresponds to a left shift operation of 2 bits (e.g., AmvrShift is 2 bits).
[0107] An AMVR flag (e.g., amvr_flag) equal to 1 specifies that the MVR of the MVD is further specified by additional information such as an index (e.g., an AMVR precision index, or represented as amvr_precision_idx in FIG. 13) and / or a prediction mode. With reference to FIG. 13, the prediction mode may be an affine prediction mode indicated by the inter-affine flag, an IBC mode indicated by the parameter mode_IBC, or an inter prediction mode that is neither an affine prediction mode nor an IBC mode. For example, the inter prediction mode is inter prediction based on the entire block.
[0108] For example, if the AMVR precision index is 0, 1, or 2, respectively, if the inter prediction mode (e.g., inter prediction based on the entire block) is neither an affine prediction mode nor an IBC mode, the coding block is predicted in AMVP mode, the AMVR flag (e.g., amvr_flag) is 1, and therefore the MVR is 1 / 2 luma sample (1 / 2 pixel), 1 luma sample (1 pixel), or 4 luma samples (4 pixels), respectively. In one example, 1 / 2 pixel, 1 pixel, or 4 pixels correspond to an AmvrShift of 3, 4, or 6 bits.
[0109] A given MVD, denoted as MvdL0 and MvdL1 in AMVP mode or denoted as MvdCpL0 and MvdCpL1 in affine AMVP mode, may be modified as shown in FIG. 14 when AMVR mode is enabled.
[0110] In some examples, a translational motion model is applied to Motion Compensation Prediction (MCP). However, the translational motion model may not be suitable for modeling other types of motion, such as zoom in / out, rotation, perspective motion, and other irregular motion. In some embodiments, a block-based affine transformation motion compensation prediction is applied. In FIG. 15A, the affine motion field of a block is described by two control point motion vectors (CPMVs), CPMV0 and CPMV1, of two control points (CPs), CP0 and CP1, when a four-parameter affine model is used. In FIG. 15B, the affine motion field of a block is described by three of CPMV0, CPMV1, and CPMV3, of CP0, CP1, and CP2, when a six-parameter affine model is used.
[0111] For the four-parameter affine motion model, the motion vector at a sample position (x, y) within a block is derived as follows:
number
[0112] For a six-parameter affine motion model, the motion vector at a sample position (x, y) within a block is derived as follows:
number
[0113] In formula 1-2, (mv 0x , mv 0y ) is the motion vector of the upper left corner control point, and (mv 1x , mv 1y ) is the motion vector of the upper right corner control point, and (mv 2x , mv 2y ) is the motion vector of the lower-left corner control point. The coordinates (x, y) are based on the upper-left corner of each block, and W and H indicate the width and height of each block.
[0114] To simplify the motion compensation prediction, in some embodiments, a sub-block based affine transformation prediction is applied. For example, in FIG. 16, a four-parameter affine motion model is used, with two CPMVs,
number
[0115] Similar to translational motion inter prediction, in some embodiments, two affine motion inter prediction modes are used: affine merge mode and affine AMVP mode.
[0116] In some embodiments, the affine merge mode may be applied to CUs with both width and height equal to or greater than 8. Affine merge candidates for the current CU may be generated based on motion information of spatially neighboring CUs. There may be up to five affine merge candidates, and an index is signaled to indicate the one to be used for the current CU. For example, the following three types of affine merge candidates are used to form the affine merge candidate list: (i) Inherited affine merge candidates extrapolated from the CPMVs of neighboring CUs (ii) Construct affine merge candidates derived using the translation MV of adjacent CUs (iii) Zero MV.
[0117] In some embodiments, there can be at most two inherited affine candidates derived from the affine motion models of the neighboring blocks, one from the left neighboring CU and one from the top neighboring CU. The candidate blocks can be placed, for example, at the positions shown in FIG. 9. For the left predictor, the scanning order is A0>A1, and for the top predictor, the scanning order is B0>B1>B2. Only the first inherited candidate from each side is selected. No pruning check is performed between the two inherited candidates.
[0118] Once the neighboring affine CUs are identified, the CPMVs of the identified neighboring affine CUs are used to derive CPMV candidates in the affine merge list of the current CU. As shown in Figure 17, the neighboring lower-left corner block A of the current CU (1710) is affine mode decoded. The motion vectors above the upper-left, right and lower-left corners of the CU (1720) containing block A are
number
number
number
number
[0119] The constructed affine candidates are constructed by combining the adjacent translational motions of each control point. The motion information of the control points is derived from the specific spatial and temporal neighbors shown in FIG. 18. CPMVk (k=1,2,3,4) represents the kth control point. For CPMV1, the B2>B3>A2 blocks are checked in order, and the MV of the first available block is used. For CPMV2, the B1>B0 block is checked, and for CPMV3, the A1>A0 block is checked. The TMVP in block T, if available, is used as CPMV4.
[0120] After the MVs of the four control points are obtained, affine merge candidates are constructed based on the motion information. The following combinations of control point MVs are used to construct them in order: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3}.
[0121] A combination of three CPMVs constructs a six-parameter affine merge candidate, and a combination of two CPMVs constructs a four-parameter affine merge candidate. To avoid motion scaling processing, if the reference indexes of the control points are different, the associated combination of control point MVs is discarded.
[0122] After the inherited and constructed affine merge candidates have been checked, a zero MV is inserted at the end of the merge candidate list if the list is not already full.
[0123] In some embodiments, affine AMVP mode may be applied to CUs with both width and height equal to or greater than 16. A CU-level affine flag is signaled in the bitstream to indicate whether affine AMVP mode is used, and then another flag is signaled to indicate whether 4-parameter affine or 6-parameter affine is used. The difference between the CPMV of the current CU and their predictors is signaled in the bitstream. The affine AVMP candidate list size is 2, and can be generated using the following four types of CPVM candidates in order: (i) Affine AMVP candidates extrapolated and inherited from the CPMVs of neighboring CUs (ii) Construct affine AMVP candidates derived using the translation MV of neighboring CUs (iii) Parallel translation MV from adjacent CU (iv) Zero MV.
[0124] The check order of the inherited affine AMVP candidates is similar to that of the inherited affine merge candidates in one example. The difference is that for AVMP candidates, affine CUs with the same reference picture as the current block are considered. When inserting the inherited affine motion predictor into the candidate list, no pruning process is applied.
[0125] The constructed AMVP candidate is derived from a specific spatial neighborhood shown in Figure 18. The same check order as done in affine merge candidate construction is used. The reference picture indexes of the neighboring blocks are also checked. The first block in the check order that is inter-coded and has the same reference picture as the current CU is used. If the current CU is 4-parameter affine model decoded and both CPMV0 and CPMV1 are available, the available CPMV is added as one candidate in the affine AMVP list. If the current CU is 6-parameter affine mode decoded and all three CPMVs (CPMV0, CPMV1, and CPMV2) are available, the available CPMV is added as one candidate in the affine AMVP list. Otherwise, the constructed AMVP candidate is set as unavailable.
[0126] If the affine AMVP list candidates are still less than 2 after the inherited and constructed AMVP candidates are checked, the translational motion vectors adjacent to the control points are added to predict all control point MVs for the current CU, if available. Finally, if the affine AMVP list is not yet filled, the zero MVs are used to fill the affine AMVP list.
[0127] Template matching (TM) techniques may be used in video / image coding. To further improve the compression efficiency of the VVC standard, for example, TM may be used to refine the MV. In one example, TM is used at the decoder side. In the TM mode, the MV may be refined by constructing a template (e.g., a current template) of a block (e.g., a current block) in a current picture, and determining the closest match between the template of the block in the current picture and multiple possible templates (e.g., multiple possible reference templates) in a reference picture. In one embodiment, the template of the block in the current picture may include the left neighboring reconstructed sample of the block and the top neighboring reconstructed sample of the block. TM may be used for video / image coding beyond VVC.
[0128] 19 shows an example of template matching (1900). The TM may be used to derive motion information for a current CU (e.g., a current block) (1901) (e.g., derive final motion information from initial motion information such as initial MV 1902) by determining a closest match between a template (e.g., a current template) (1921) of a current CU (1901) in a current picture (1910) and a template (e.g., a reference template) of a plurality of possible templates (e.g., one template (1925) of a plurality of possible templates) in a reference picture (1911). The template (1921) of the current CU (1901) may have any suitable shape and any suitable size.
[0129] In one embodiment, the template (1921) of the current CU (1901) includes a top template (1922) and a left template (1923). Each of the top template (1922) and the left template (1923) can have any suitable shape and any suitable size.
[0130] The top template (1922) may include samples in one or more top-neighboring blocks of the current CU (1901). In one example, the top template (1922) includes four rows of samples in one or more top-neighboring blocks of the current CU (1901). The left template (1923) may include samples in one or more left-neighboring blocks of the current CU (1901). In one example, the left template (1923) includes four columns of samples in one or more left-neighboring blocks of the current CU (1901).
[0131] Each of the multiple possible templates (e.g., template (1925)) in the reference picture (1911) corresponds to a template (1921) in the current picture (1910). In one embodiment, the initial MV (1902) points from the current CU (1901) in the reference picture (1911) to the reference block (1903). Each of the multiple possible templates (e.g., template (1925)) in the reference picture (1911) and the template (1921) in the current picture (1910) may have the same shape and size. For example, the template (1925) of the reference block (1903) includes a top template (1926) in the reference picture (1911) and a left template (1927) in the reference picture (1911). The top template (1926) may include samples in one or more top neighboring blocks of the reference block (1903). The left template (1927) may include samples in one or more left neighboring blocks of the reference block (1903).
[0132] The TM cost may be determined based on a template pair of a template (e.g., a current template) (1921) and a template (e.g., a reference template) (1925). The TM cost may indicate a match between the template (1921) and the template (1925). The optimized MV (or final MV) may be determined based on a search around the initial MV (1902) of the current CU (1901) in a search range (1915). The search range (1915) may have any suitable shape and any suitable number of reference samples. In one example, the search range (1915) in the reference picture (1911) includes a [-L,L] pixel range, where L is a positive integer such as 8 (e.g., 8 samples). For example, a difference (e.g., [0,1]) is determined based on the search range (1915), and an intermediate MV is determined by a sum of the initial MV (1902) and the difference (e.g., [0,1]). Based on the intermediate MV, an intermediate reference block in the reference picture (1911) and a corresponding template can be determined. A TM cost can be determined based on the template (1921) in the reference picture (1911) and the intermediate template. The TM cost can correspond to a difference (e.g., [0,0], [0,1], etc., corresponding to the initial MV (1902)) determined based on a search range (1915). In one example, the difference corresponding to the minimum TM cost is selected, and the optimized MV is the sum of the difference corresponding to the minimum TM cost and the initial MV (1902). As described above, the TM can derive the final motion information (e.g., the optimized MV) from the initial motion information (e.g., the initial MV 1902).
[0133] The TM can be modified accordingly. In one example, the search step size is determined by the AMVR mode. In one example, the TM can be cascaded (e.g., used together) with other coding methods such as bidirectional matching processes.
[0134] In the related art, the MV resolution index (e.g., AMVR precision index) in the AMVR mode is encoded according to a fixed order in the bi-predictive and affine modes (e.g., affine AMVP mode). For example, in the bi-predictive mode, the relationship between (i) each MVR index or each MVR index pair and (ii) each corresponding MVR is fixed. Signaling the MVR index (or MVR index) for the bi-predictive and affine modes may not be efficient if the MVR indexes in the AMVR mode are encoded in a fixed order. In the AMVP mode, TM may be applied to sort the MVRs, MVR pairs, or MV precision indexes. For example, a TM search procedure may be performed on the possible MVRs or possible MVR pairs in the ascending order of the corresponding TM cost, where one of the TM costs is based on the current template of the current block and the reference template of the reference block, and the MVR indexes may be sorted.
[0135] A set of MVRs in AMVP mode (also referred to as a set of MV precisions) is available for coding the current block. According to one aspect of the present disclosure, template matching (TM) can be performed using the multiple MVRs in the set of MVRs. The TM can be performed by (i) determining a TM cost corresponding to each of the multiple MVRs based on motion information (e.g., motion information shared by the multiple MVRs) and each of the multiple MVRs, (ii) ranking or sorting the multiple MVRs based on the determined TM costs respectively corresponding to each of the multiple MVRs, and (iii) selecting an MVR from the ranked or sorted multiple MVRs. In one example, the motion information indicates MVP information used to determine MVP candidates and MVD information. In one example, the motion information shared by the multiple MVRs includes a candidate index that points to an MVP candidate in a candidate list. The MVPs of the multiple MVRs may be determined based on the MVP candidates indicated by the motion information and the multiple MVRs, and therefore may be different for each of the multiple MVRs. The MVs of the multiple MVRs used to determine the TM cost in the TM may be based on the respective MVPs.
[0136] For example, for each of the multiple MVRs, such as 1 / 2 pixel, a MV or MVP associated with the MVR (e.g., 1 / 2 pixel) may be determined based on the MVR and motion information (e.g., a candidate index pointing to an MVP candidate in a candidate list). The MV and / or MVP associated with the MVR are determined based on the motion information and the MVR. The MV and / or MVP associated with the MVR may indicate a reference block associated with the MVR (e.g., 1 / 2 pixel) in the reference picture. For example, the determined MV associated with the MVR (e.g., 1 / 2 pixel) points from a current block in the current picture to a reference block associated with the MVR (e.g., 1 / 2 pixel) in the reference picture. A cost (e.g., TM cost) corresponding to the MVR (e.g., 1 / 2 pixel) may be determined based on a current template of a current block in the current picture and a reference template of a reference block associated with the MVR (e.g., 1 / 2 pixel) in the reference picture. The multiple MVRs may be ranked (e.g., sorted) based on the determined TM costs, respectively. In one example, if a flag (eg, sps_amvr_enabled_flag) is true, multiple MVRs are ranked (eg, sorted) in ascending order of TM cost.
[0137] In one example, the set of MVRs in AMVP mode includes 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel. In one example, the plurality of MVRs is a set of MVRs. In another example, the plurality of MVRs is a subset of the set of MVRs that excludes the highest resolution (e.g., 1 / 4 pixel). For example, the plurality of MVRs includes 1 / 2 pixel, 1 pixel, and 4 pixel, excluding 1 / 4 pixel.
[0138] FIG. 20 illustrates an example of template matching (2000) applied to a set of MVRs. Template matching may be performed against a current template (2021) for a current block (2001) in a current picture (2010) and reference templates (2051)-(2054) for respective reference blocks (2031)-(2034) in a reference picture (2011). The current template (2021) may have any suitable shape and any suitable size. The shape and size of the reference templates (2051)-(2054) may match the shape and size of the current template (2021), respectively. In one embodiment, the current template (2021) includes a top template and a left template.
[0139] The MV (2041) corresponding to 1 / 4 pixel resolution points from the current block (2001) to the reference block (2031) in the reference picture (2011). The MV (2042) corresponding to 1 / 2 pixel resolution points from the current block (2001) to the reference block (2032) in the reference picture (2011). The MV (2043) corresponding to 1 pixel resolution points from the current block (2001) to the reference block (2033) in the reference picture (2011). The MV (2044) corresponding to 4 pixel resolution points from the current block (2001) to the reference block (2034) in the reference picture (2011).
[0140] Template matching between the current template (2021) of the current block (2001) and each of the reference templates (2051) to (2054) in the reference picture (2011) can be performed as follows. A TM cost (TM0) is calculated based on the reference template (2051) and the current template (2021). A TM cost (TM1) is calculated based on the reference template (2052) and the current template (2021). A TM cost (TM2) is calculated based on the reference template (2053) and the current template (2021). A TM cost (TM4) is calculated based on the reference template (2054) and the current template (2021). The TM costs can be determined based on the sum of absolute differences (SAD) between the current template (2021) and each reference template (e.g., (2051)). Other functions such as the Sum of Squared Errors (SSE), variance, partial SAD, etc. may also be used to determine the TM cost.
[0141] The MVRs may then be ranked (e.g., sorted) based on TM cost, for example, in ascending order of corresponding TM costs between the current template (2021) and the reference templates (2051)-(2054) corresponding to the set of MVRs. In one example, the set of MVRs includes 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel, with ascending TM costs TM2, TM1, TM3, and TM0. TM2 is the smallest among TM0-TM3. The set of MVRs may be ranked (e.g., sorted) as 1 pixel, 1 / 2 pixel, 4 pixel, and 1 / 4 pixel.
[0142] A flag such as a TM-AMVR flag (e.g., tm_amvr_flag) may be used to indicate which MVR is selected for the current block (2001). In one example, the TM-AMVR flag (e.g., tm_amvr_flag) being false indicates that the first MVR (e.g., 1 pixel) corresponding to the smallest TM cost (e.g., TM2) among the TM costs (e.g., TM0-TM3) is selected. If the TM-AMVR flag (e.g., tm_amvr_flag) is true, an index such as a TM-AMVR precision index (e.g., tm_amvr_precision_idx) is further signaled to indicate which MVR is selected for the current block (2001). The MVR can be selected from the remaining MVRs (e.g., TM0, TM1, and TM3) in the set of MVRs excluding the first MVR (e.g., 1 pixel). For example, the ranked remaining MVRs are TM1, TM3, and TM0. An AMVR precision index (e.g., tm_amvr_precision_idx) of 0, 1, or 2 indicates that the MVR is TM1, TM3, or TM0, respectively.
[0143] An exemplary pseudo-syntax is shown in Table 1. If certain conditions are met, such as AMVR mode is enabled (e.g., sps_amvr_enabled_flag is true), affine mode is not enabled (e.g., inter_affine_flag is false), and at least one component of the MVD of the current block (2001) is not equal to 0, then the TM-AMVR flag (e.g., tm_amvr_flag) is signaled. If the TM-AMVR flag (e.g., tm_amvr_flag) is false, then the first MVR corresponding to the smallest TM cost among the TM costs is selected, and the TM-AMVR precision index (e.g., tm_amvr_precision_idx) is not signaled. Otherwise, if the TM-AMVR flag (e.g., tm_amvr_flag) is true, then the TM-AMVR precision index (e.g., tm_amvr_precision_idx) is signaled.
[0144] [Table 1]
[0145] In one embodiment, the TM is applied to all or a portion of the MVRs in the set of MVRs. For example, the set of MVRs includes 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel, and the MVRs to which the TM is applied include 1 / 2 pixel, 1 pixel, and 4 pixel, but exclude 1 / 4 pixel. In this case, when a flag such as the AMVR flag is false, the 1 / 4 pixel is used to code the current block (2001).
[0146] Template matching may be performed for a plurality of MVRs (e.g., 1 / 2 pixel, 1 pixel, and 4 pixel) as a modified example of FIG. 20. For example, TM costs TM1, TM2, and TM3 corresponding to 1 / 2 pixel, 1 pixel, and 4 pixel are calculated as described in FIG. 20, respectively, and TM0 is not calculated. Next, the plurality of MVRs (e.g., 1 / 2 pixel, 1 pixel, and 4 pixel) are sorted in ascending order of corresponding TM costs (e.g., in the order of TM2, TM1, TM3, with TM2 being the smallest among TM1, TM2, and TM3) between the current template (2021) in the current picture (2010) and the reference blocks (e.g., (2032) to (2034)) in the reference picture (2011). The plurality of MVRs may be ranked (e.g., sorted) as 1 pixel, 1 / 2 pixel, and 4 pixel. For example, an index such as a TM-AMVR precision index (e.g., tm_amvr_precision_idx) is signaled to indicate which MVR is selected for the current block. The MVR may be selected from multiple MVRs (e.g., TM1-TM3). A TM-AMVR precision index (e.g., tm_amvr_precision_idx) of 0, 1, or 2 indicates that the MVR is TM2, TM1, or TM3, respectively.
[0147] An exemplary pseudo-syntax is shown in Table 2. The AMVR flag (e.g., amvr_flag) is signaled when certain conditions are met, such as AMVR mode is enabled (e.g., sps_amvr_enabled_flag is true), affine mode is not enabled (e.g., inter_affine_flag is false), and at least one component of the MVD of the current block (2001) is not equal to 0. If the AMVR flag (e.g., amvr_flag) is false, quarter pixel is selected and the TM-AMVR precision index (e.g., tm_amvr_precision_idx) is not signaled. Otherwise, if the AMVR flag (e.g., amvr_flag) is true, the TM-AMVR precision index (e.g., tm_amvr_precision_idx) is signaled.
[0148] [Table 2]
[0149] In one embodiment, the TM is applied to a set of MVRs. For example, the set of MVRs includes 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel. Template matching may be performed on the set of MVRs. For example, TM costs TM0-TM3 corresponding to 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel are calculated, respectively, as described in FIG. 20. Then, the set of MVRs is sorted in ascending order of corresponding TM costs (e.g., TM2, TM1, TM3, and TM0, with TM2 being the minimum of TM0-TM3) between the current template (2021) in the current picture (2010) and the reference templates (e.g., (2051) to (2054)) in the reference picture (2011). The set of MVRs may be ranked (e.g., sorted) as 1 pixel, 1 / 2 pixel, 4 pixel, and 1 / 4 pixel.
[0150] The TM-AMVR flag (e.g., tm_amvr_flag) may be set as true when the MVR (e.g., 1 pixel) with the smallest TM cost (e.g., TM2) is selected. Otherwise, the TM-AMVR flag (e.g., tm_amvr_flag) may be set to false and normal AMVR signaling is used. In normal AMVR signaling, the AMVR flag is signaled. When the AMVR flag is false, 1 / 4 pixel is used to encode the current block. When the AMVR flag is true, an AMVR precision index (e.g., amvr_precision_idx) is signaled to indicate, for example, which MVR of multiple MVRs (e.g., TM1-TM3) is selected for the current block. An MVR may be selected from multiple MVRs (e.g., TM1-TM3). An AMVR precision index (e.g., amvr_precision_idx) of 0, 1, or 2 indicates that the MVR is TM1, TM2, or TM3, respectively.
[0151] An exemplary pseudo-syntax is shown in Table 3. If certain conditions are met, such as AMVR mode is enabled (e.g., sps_amvr_enabled_flag is true), affine mode is not enabled (e.g., inter_affine_flag is false), and at least one component of the MVD of the current block is not equal to 0, then the TM-AMVR flag (e.g., tm_amvr_flag) is signaled. If the TM-AMVR flag (e.g., tm_amvr_flag) is false, then the following is done. For example, the AMVR flag (e.g., amvr_flag) is signaled. If the AMVR flag (e.g., amvr_flag) is false, then quarter pixel is selected and the AMVR precision index (e.g., amvr_precision_idx) is not signaled. Otherwise, if the AMVR flag (e.g., amvr_flag) is true, the AMVR precision index (e.g., amvr_precision_idx) is signaled.
[0152] [Table 3]
[0153] In one embodiment, an AMVR flag (eg, amvr_flag) is signaled to indicate whether AMVR mode is enabled.
[0154] If AMVR mode is not enabled (e.g., the AMVR flag is false), then 1 / 4 pixel may be selected.
[0155] If the AMVR mode is enabled (e.g., the AMVR flag is true), a TM-AMVR flag (e.g., tm_amvr_flag) is signaled to indicate whether the MVR with the smallest TM cost has been selected.
[0156] If the TM-AMVR flag (e.g., tm_amvr_flag) is true, template matching is applied to a plurality of MVRs (e.g., 1 / 2 pixel, 1 pixel, and 4 pixel) excluding 1 / 4 pixel. For example, TM costs TM1, TM2, and TM3 corresponding to 1 / 2 pixel, 1 pixel, and 4 pixel are calculated as described in FIG. 20, respectively, and TM0 is not calculated. Then, the plurality of MVRs (e.g., 1 / 2 pixel, 1 pixel, and 4 pixel) are sorted in ascending order of corresponding TM costs (e.g., in the order of TM2, TM1, TM3, where TM2 is the minimum value of TM1 to TM3) between the current template (2021) in the current picture (2010) and the reference templates (e.g., (2052) to (2054)) in the reference picture (2011). The plurality of MVRs may be ranked (e.g., sorted) as 1 pixel, 1 / 2 pixel, and 4 pixel. An MVR (eg, 1 pixel) is selected corresponding to the minimum TM cost (eg, TM2) among multiple MVRs (eg, 1 / 2 pixel, 1 pixel, and 4 pixel) excluding 1 / 4 pixel.
[0157] When the TM-AMVR flag (e.g., tm_amvr_flag) is set to false, the AMVR precision index is signaled and the MVR is selected based on the AMVR precision index without reordering the MVRs. For example, if the AMVR precision index is 0, 1, or 2, the MVR is 1 / 2 pixel, 1 pixel, or 4 pixels, respectively.
[0158] [Table 4]
[0159] An exemplary pseudo-syntax is shown in Table 4. An AMVR flag (e.g., amvr_flag) is signaled when certain conditions are met, such as AMVR mode is enabled (e.g., sps_amvr_enabled_flag is true), affine mode is not enabled (e.g., inter_affine_flag is false), and at least one component of the MVD of the current block is not equal to 0. If the AMVR flag (e.g., amvr_flag) is true, the following is done: For example, a TM-AMVR flag (e.g., tm_amvr_flag) is signaled. If the TM-AMVR flag (e.g., tm_amvr_flag) is false, an AMVR precision index (e.g., amvr_precision_idx) is signaled. Otherwise, if the TM-AMVR flag (e.g., tm_amvr_flag) is true, the AMVR precision index (e.g., amvr_precision_idx) is not signaled.
[0160] The above description may be applied to a uni-predictively decoded block. The above description may be adapted to a scenario in which a block is bi-predictively decoded. In one example, when a bi-predictive mode is used, a current block in a current picture may be coded using a first reference picture from a reference list 0 (L0) and a second reference picture from a reference list 1 (L1).
[0161] Figure 21 shows an example of template matching (2100) when a current block (2001) is predicted using a bi-prediction mode. The current block (2001), current picture (2010), current template (2021), MVs (2041)-(2044), reference templates (2051)-(2054), reference blocks (2031)-(2034), and reference picture (2011) in Figure 21 are described in Figure 20.
[0162] Referring to FIG. 21, a reference picture (2011) is referred to as a first reference picture (2011) and is associated with a first plurality of MVRs. The MVs (2041)-(2044), reference templates (2051)-(2054), and reference blocks (2031)-(2034) corresponding to the first plurality of MVRs are referred to as first MVs (2041)-(2044), first reference templates (2051)-(2054), and first reference blocks (2031)-(2034), respectively. The first plurality of MVRs may include any suitable MVR and any suitable number of MVRs. In one example, the first plurality of MVRs include ¼ pixel, ½ pixel, 1 pixel, and 4 pixel subsets. In one example, the first plurality of MVRs include ¼ pixel, ½ pixel, 1 pixel, and 4 pixel subsets.
[0163] Referring to FIG. 21, the second reference picture (2111) is associated with a second plurality of MVRs. The second MVs (2141)-(2144) may correspond to a second plurality of MVRs, such as 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel, respectively. The second MVs (2141)-(2144) may point to the second reference blocks (2131)-(2134) in the second reference picture (2111) from the current block (2001), respectively. The second reference templates (2151)-(2154) are associated with the second reference blocks (2131)-(2134), respectively.
[0164] The second plurality of MVRs may include any suitable MVR and any suitable number of MVRs. In one example, the second plurality of MVRs includes ¼ pixel, ½ pixel, 1 pixel, and 4 pixel. In one example, the second plurality of MVRs includes subsets of ¼ pixel, ½ pixel, 1 pixel, and 4 pixel.
[0165] A first number of MVRs in the first plurality of MVRs may be the same as or different from a second number of MVRs in the second plurality of MVRs.
[0166] The current block (2001) can be predicted based on the first reference picture (2011) from L0 and the second reference picture (2111) from L1.
[0167] According to an embodiment of the present disclosure, TM can be performed on MVR pairs. The MVR pairs can include any suitable combination of a first plurality of MVRs and a second plurality of MVRs. In an embodiment, the MVR pairs of the MVR pairs include (i) a first MVR (e.g., 1 / 2 pixel) of the first plurality of MVRs, and (ii) a second MVR (e.g., 1 pixel) of the second plurality of MVRs. The TM can include determining a TM cost corresponding to each MVR pair of the MVR pairs, for example, the MVR pair includes 1 / 2 pixel as the first MVR and 1 pixel as the second MVR. The TM cost can be determined based on a portion of the current template (2021) of the current block (2001) and a bi-predictor of each MVR pair. The bi-predictor may be based on a portion of a first reference template (e.g., (2051)) in a first reference picture (2011) corresponding to a first MVR of the respective MVR pair and a portion of a second reference template (e.g., (2151)) in a second reference picture (2111) corresponding to a second MVR of the respective MVR pair. In one embodiment, the TM includes ranking the MVR pairs based on the determined corresponding TM costs and selecting an MVR pair from the ranked MVR pairs. The current block (2001) may be reconstructed based on the selected MVR pair.
[0168] As described above, TM may be applied to a bi-predictive CU, such as a bi-predictive current block (e.g., current block (2001)) whose MVR pair in the AMVP mode may be reordered. Referring to Figure 21, each of the TM costs may be calculated according to the distortion (e.g., difference) between the current template (2021) and the corresponding bi-predictor based on the reference template (e.g., (2051) and (2151)).
[0169] In one embodiment as shown in FIG. 21, for an MVR pair including a first MVR (e.g., 1 / 2 pixel) and a second MVR (e.g., 1 pixel), a bi-predictor is determined based on a first reference template (e.g., (2051)) corresponding to the first MVR and a second reference template (e.g., (2151)) corresponding to the second MVR. The bi-predictor may be an average of the first reference template (e.g., (2051)) and the second reference template (e.g., (2151)). In one example, the bi-predictor is a weighted average of the first reference template (e.g., (2051)) and the second reference template (e.g., (2151)). In one example, the bi-predictor is modified by an offset.
[0170] In one example, the bipredictor (TP b (i,j) is calculated using Equation 3. TP b (i,j)=(TP0 i +TP1 j +1)≫1 formula 3 Parameter TP0 i and parameter TP1 j may represent a first reference template for reference list L0 (e.g., (2051)) and a second reference template for reference list L1 (e.g., (2151)). The integers i and j represent the first and second MVRs of the MVR pair, respectively. Based on Equation 3, the bipredictor TP bThe predictor sample value in (i,j) may be the average of a first reference sample value in a first reference template and a second reference sample value in a second reference template.
[0171] The TM cost corresponding to an MVR pair (denoted as TMcost(i,j)) can be calculated by, for example, using the following Equation 4: b It can be calculated based on (i,j). TM cost(i,j)=SAD(TP b (i,j)-TC) Equation 4
[0172] The parameter TC represents the current template (2021) of the current block (2001). The sum of absolute differences (SAD) is, for example, the sum of sample values in the current template (2021) and the bipredictor TP b It indicates the function of the sum of absolute differences between the corresponding values of the predictor samples in (i,j).
[0173] Other functions such as SSE, variance, partial SAD, etc. may be used to determine the TM cost. In one example of partial SAD, a portion of the current template (2021), a corresponding portion of a first reference template (e.g., 1851), and a corresponding portion of a second reference template (e.g., 1951) are used to determine the TM cost.
[0174] In one example of partial SAD, part or all of the current template (2021), part or all of the first reference template (e.g., 1851), and part or all of the second reference template (e.g., 1951) are downsampled before being used to determine the TM cost.
[0175] As described above, the MVR pairs used to code the current block (2001) may be derived according to the TM costs of the MVR pairs sorted in ascending order of TM cost.
[0176] In one embodiment, the first MVR and the second MVR of the MVR pair are the same (e.g., i=j in Equation 3) when the current block is bi-predictive mode decoded (e.g., encoded and / or decoded). For example, the first plurality of MVRs and the second plurality of MVRs are the same. 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel in the first plurality of MVRs correspond to i being 0, 1, 2, and 3, respectively. 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel in the second plurality of MVRs correspond to j being 0, 1, 2, and 3, respectively. The first MVs (2041)-(2044) correspond to 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel, respectively. The second MVs (2141)-(2144) correspond to 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel, respectively. Therefore, the MVR pairs include four MVR pairs, namely, a first MVR pair, a second MVR pair, a third MVR pair, and a fourth MVR pair, as shown in Table 5. For example, the first MVR pair includes a first MVR of a quarter pixel where i is 0, and a second MVR of a quarter pixel where j is 0.
[0177] [Table 5]
[0178] Four bipredictor TPs corresponding to four MVR pairs b (0,0), TP b (1,1), TP b (2,2), and TP b (3,3) can be determined based on Equation 3. For example, the bipredictor TP b (0,0) is the first reference template (2051) (e.g., TP0 for i=0). i ) and the corresponding second reference template (2151) (e.g., TP1 for j=0 j In one example, the TP b (0,0) is the average of TP00 and TP10.
[0179] The four TM costs corresponding to the four MVR pairs (e.g., TM cost(0,0), TM cost(1,1), TM cost(2,2), and TM cost(3,3)) are used in the current template (2021) and the bipredictor TP b (0,0), TP b (1,1), TP b (2,2), and TP b For example, the TM cost (0,0) can be determined based on the bipredictor TP b This can be determined using Equation 4, which is the SAD between (0,0) and the current template (2021).
[0180] The four MVR pairs may be ranked based on their corresponding four TM costs (e.g., sorted into a different order than that shown in Table 5), such as ascending order of the four TM costs. In one example, the ascending order of the four TM costs is TM cost(1,1), TM cost(2,2), TM cost(0,0), and TM cost(3,3). The ranked MVR pairs corresponding to TM cost(1,1), TM cost(2,2), TM cost(0,0), and TM cost(3,3) include the second MVR pair, the third MVR pair, the first MVR pair, and the fourth MVR pair.
[0181] The MVR pair may be selected from the ranked MVR pairs. In one example, the selected MVR pair is the MVR pair corresponding to the smallest TM cost, such as the second MVR pair (1,1) corresponding to the TM cost. In one embodiment, if the selected MVR pair is the MVR pair corresponding to the smallest TM cost, no index is signaled.
[0182] In one example, an index is signaled to indicate which of the ranked MVR pairs is selected. For example, an index of 0, 1, 2, or 3 indicates that the selected MVR pair is the second MVR pair, the third MVR pair, the first MVR pair, or the fourth MVR pair, respectively, based on the ranked (e.g., sorted) MVR pairs.
[0183] In one embodiment, when the current block is bi-predictive mode decoded (e.g., encoded and / or decoded), the first MVR and the second MVR in one of the MVR pairs are the same (e.g., i=j in Equation 3), and the first MVR and the second MVR in the other one of the MVR pairs are different (e.g., i≠j in Equation 3). In one example, the first plurality of MVRs has N1 first MVRs, and the second plurality of MVRs has N2 second MVRs, where N1 and N2 are positive integers. N1 and N2 may be the same or different. In one example, N1 and N2 are 4, and 16 MVR pairs or 16 different combinations of the first MVR and the second MVR are associated with the bi-predictive current block. Table 6 shows an example of 16 MVR pairs.
[0184] [Table 6]
[0185] In one example, the first MVs (2041) to (2044) correspond to ¼ pixel, ½ pixel, 1 pixel, and 4 pixels, respectively. The second MVs (2141) to (2144) correspond to ¼ pixel, ½ pixel, 1 pixel, and 4 pixels, respectively.
[0186] The 16 bipredictor TPs corresponding to the 16 MVR pairs in Table 6 b (i,j) (e.g., TP b (0,0)~TP b (3,3)) can be determined based on Equation 3. For example, the bipredictor T P corresponding to the eighth MVR pair in Table 6 b (1,3) is the first reference template (2052) (e.g., TP0 for i=1). i ) and the corresponding second reference template (2154) (e.g., TP1 for j=3 j In one example, the TP b (1,3) is the average of TP01 and TP13.
[0187] The 16 TM costs (e.g., TM cost(0,0) to TM cost(3,3)) corresponding to the 16 MVR pairs are the current template (2021) and the bipredictor TP b (0,0)~TP b For example, the TM cost (1,3) can be determined based on the bipredictor TP b It is determined using Equation 4, which is the SAD between (1,3) and the current template (2021).
[0188] The 16 MVR pairs in Table 6 may be ranked (e.g., sorted) based on the corresponding 16 TM costs, such as ascending order of the 16 TM costs. An MVR pair may be selected from the ranked 16 MVR pairs. In one example, the selected MVR pair is the MVR pair corresponding to the smallest TM cost among the 16 TM costs. For example, if the selected MVR pair is the MVR pair corresponding to the smallest TM cost among the 16 TM costs, an index is not signaled. In one example, an index is signaled to indicate which MVR pair of the ranked (e.g., sorted) 16 MVR pairs has been selected.
[0189] For simplicity, the MVR pairs shown in Table 5 are referred to as the first set of MVR pairs. The MVR pairs shown in Table 6 are referred to as the second set of MVR pairs.
[0190] In one embodiment, a flag is signaled in the video bitstream, such as in the Sequence Parameter Set (SPS), Picture Parameter Set (PPS), Picture Header (PH), slice header, etc., to indicate whether TM is performed for an MVR pair (e.g., a first set of MVR pairs or a second set of MVR pairs).
[0191] The embodiments relating to bi-prediction are described with respect to a first plurality of MVRs and a second plurality of MVRs including ¼ pixel, ½ pixel, 1 pixel, and 4 pixel. The description relating to bi-prediction may be adapted to cases where the first plurality of MVRs and / or the second plurality of MVRs include fewer or more MVRs.
[0192] The TM may be applied in an affine mode, such as an affine AMVP mode, an affine merge mode, and may be referred to as an affine TM. FIG. 22 shows an example of a TM (2200) in an affine merge mode, and the like. A template (2221) of a current block (e.g., a current CU) (2201) may correspond to a template (e.g., template (1921) of FIG. 19) in a TM applied to a translational motion model. A reference template (2225) of a reference block in a reference picture may include multiple subblock templates (e.g., 4×4 subblocks) pointed to by control point MV (CPMV) derived MVs of neighboring subblocks (e.g., A0-A3 and L0-L3 as shown in FIG. 22) at block boundaries.
[0193] The search process of the TM applied in affine mode (e.g., affine merge mode) can start from CPMV0 while keeping other CPMVs constant (e.g., (i) CPMV1 if a four-parameter model is used, or (ii) CPMV1 and CPMV2 if a six-parameter model is used). The search can be done in horizontal and vertical directions. In one example, the search continues in the diagonal direction only if the zero vector is not the best difference vector found from the horizontal and vertical search. The affine TM can repeat the same search process for CPMV1. The affine TM can repeat the same search process for CPMV2 if a six-parameter model is used. If the zero vector is not the best difference vector from the previous iteration and the search process has been iterated less than three times, the entire search process can be restarted from refined CPMV0 based on the refined CPMV.
[0194] Various embodiments may be used to determine (i) the MVs (2041)-(2044) of Figure 20 (e.g., when the current block (2001) is uni-predictively decoded), and / or (ii) the MVs (2041)-(2044) and second MVs (2141)-(2144) of Figure 21 (e.g., when the current block (2001) is bi-predictively decoded).
[0195] According to one embodiment of the present disclosure, MVs (2041)-(2044) in Figure 20 may be equal to respective MV predictors (MVPs) corresponding to the multiple MVRs in Figure 20. MVs (2041)-(2044) and second MVs (2141)-(2144) in Figure 21 may be equal to respective MVPs corresponding to the first and second multiple MVRs in Figure 21.
[0196] In one embodiment, one or more of the MVPs of each MVR (e.g., (i) the multiple MVRs of FIG. 20, or (ii) the first multiple MVRs and the second multiple MVRs of FIG. 21) may be determined based on a given reference list, one or more reference picture indexes, and one or more MVP indexes.
[0197] In one embodiment, each MVP of an MVR is determined based on a given reference list, one or more reference picture indexes, and a corresponding MVP index. For example, each MVP of an MVR is determined directly (e.g., simultaneously) from the corresponding MVP index.
[0198] In one example, the current block is uni-predictively decoded. The MVP for MVR is applied as the MV used in TM between the current template of the current block and the reference template in the reference picture. TM is performed based on the MVP of MVR, and the TM cost of MVR is calculated based on the MVP respectively. The order of MVR indexes may be based on the ascending order of the TM cost of MVR.
[0199] Referring to Figure 20, a current block (2001) is uni-predictively decoded. Multiple MVRs are available for the current block (2001). The MVPs of the multiple MVRs can be determined based on a reference picture list (e.g., reference list 0 (L0) or reference list 1 (L1)), a reference picture index indicating a reference picture (2011) in the reference picture list, and an MVP index.
[0200] In one example, an MVP candidate is determined based on a reference picture list (e.g., L0 or L1), a reference picture (2011), and an MVP index. For example, a candidate list of a current block (2001) including MVP candidates is determined, and an MVP index indicates which MVP candidate is selected as an MVP candidate. MVPs for multiple MVRs are determined based on an MVP candidate and multiple MVRs (e.g., 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel), respectively. The MVPs include MVP0, MVP1, MVP2, and MVP3, which correspond to 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel, respectively. Referring to FIG. 20, MV(2041)-(2044) are determined to be equal to MVP0, MVP1, MVP2, and MVP3, respectively.
[0201] In one embodiment, multiple MVRs (e.g., 1 / 4 pixel MVPs) may be used. a ) is determined based on a given reference list (e.g., L0), a reference picture index (e.g., indicating reference picture (2011)), and an MVP index. In one example, one of the multiple MVRs corresponds to the highest resolution (e.g., ¼ pixel) of the multiple MVRs. Then, other MVPs of the remaining MVRs of the multiple MVRs (e.g., MVPs corresponding to ½ pixel, 1 pixel, and 4 pixel, respectively) are determined. b , MVP c and MVP d ) is one MVP (e.g., 1 / 4 pixel MVP) among multiple MVRs. a ) can be determined from other MVPs (e.g., MVP b , MVP c, and MVPd) to obtain the MVP (e.g., the 1 / 4 pixel MVP a ) to the remaining MVRs of 1 / 2 pixel, 1 pixel, and 4 pixels, respectively, so that the precision of the resulting MVPs can be within the given MVRs. a is MVP0. MVP b may be the same as or different from MVP1, and MVP c may be the same as MVP2 or different, and MVP d may be the same as or different from MVP3.
[0202] In one embodiment, the MVDs of the multiple MVRs are determined based on the multiple MVRs, respectively. The MVDs of the multiple MVRs may be determined simultaneously, respectively, based on the multiple MVRs. For example, the MVDs (e.g., MVD0-MVD3) for the multiple MVRs (e.g., 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel) are determined, respectively, based on the multiple MVRs and MVD information. The MVD information may indicate the size and direction of the initial MVD. In one example, the MVDs are respectively obtained from the initial MVD according to the multiple MVRs.
[0203] Alternatively, the MVD (e.g., the MVD corresponding to a quarter pixel) a ) may be determined based on the MVD information and the corresponding MVR (e.g., 1 / 4 pixel) of the plurality of MVRs. Then, the remaining MVDs (e.g., MVD b -MVD d ) is one of the MVDs (e.g., MVD a ) and the remaining MVR. In one example, MVD0 may be determined based on MVD a It is.
[0204] In one embodiment, the MV is determined based on the MVD and the respective MVP. The MVD used to determine the MV can be obtained using the above-mentioned embodiment or any other suitable method. The MVP used to determine the MV can be obtained using the above-mentioned embodiment or any other suitable method.
[0205] In one example, MVs (2041) to (2044) are determined based on (i) MVD0-MVD3 and (ii) the corresponding MVP0-MVP3, respectively.
[0206] In one example, MV(2041)~(2044) are (i) MVD a -MVD d and the corresponding MVP a -MVP d are determined based on the above.
[0207] In one example, MV(2041) to (2044) are (i) MVD0-MVD3 and the corresponding MVP a -MVP d are determined based on the above.
[0208] In one example, MVs (2041) to (2044) are determined based on (i) MVDa-MVDd and corresponding MVP0-MVP3, respectively.
[0209] In one example, the current block is bi-predictively decoded. For each MVR pair in the MVR pairs available for the current block (e.g., MVR pairs listed in Table 5 or Table 6), two MVPs from L0 and L1 may be applied as MV pairs (e.g., MVs (2041) and (2141) in FIG. 21) between the current template (e.g., (2021)) and two reference templates (e.g., the first reference template (2051) and the second reference template (2151)) of L0 and L1, respectively. The TM costs of the MVR pairs may be sorted in ascending order to determine the order of the MVR indexes, as described in FIG. 21.
[0210] Referring to Figure 21, a current block (2001) is bi-predictively decoded. A first plurality of MVRs and a second plurality of MVRs are available for the current block (2001). A first MVP of the first plurality of MVRs and a second MVP of the second plurality of MVRs can be determined. Thus, the first MVs (2041) to (2044) used in the TM can be determined to be equal to the first MVP, respectively, and the second MVs (2141) to (2144) used in the TM can be determined to be equal to the second MVP, respectively.
[0211] The first MVP of the first plurality of MVRs may be determined, for example, based on a first reference picture list (e.g., L0), a first reference picture index indicating a first reference picture (2011) in the first reference picture list, and a first MVP index of the first reference picture list.
[0212] In one example, the first MVP candidate may be determined based on a first reference picture list (e.g., L0), an index of the first reference picture (2011) indicating the first reference picture, and a first MVP index. The first MVP index may indicate the first MVP candidate in a candidate list (e.g., the first candidate list of the first reference picture list).
[0213] A first MVP of the first plurality of MVRs may be determined based on the first MVP candidates and the first plurality of MVRs (e.g., 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel), respectively. The first MVP may include MVPs corresponding to 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel. 00 , MVP 01 , MVP 02 , MVP 03 Referring to FIG. 21, the first MV (2041) to (2044) are MVP 00 , MVP 01 , MVP 02 , MVP 03 In one example, the MVP 00 , MVP 01, MVP 02 , and MVP 03 are equal to MVP0, MVP1, MVP2, and MVP3 described in FIG. 20, respectively.
[0214] Similarly, a second MVP of a second plurality of MVRs may be determined, for example, based on a second reference picture list (e.g., L1), a second reference picture index indicating a second reference picture (2111) in the second reference picture list, and a second MVP index of the second reference picture list.
[0215] In one example, a second MVP candidate may be determined based on a second reference picture list (e.g., L1), a second reference picture index indicating the second reference picture (2111), and a second MVP index of the first reference picture list. The second MVP index may indicate a second MVP candidate in a candidate list (e.g., a second candidate list of the second reference picture list).
[0216] A second MVP for the second plurality of MVRs may be determined based on the second MVP candidates and the second plurality of MVRs (e.g., 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel), respectively. The second MVP may include MVPs corresponding to 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel. 10 , MVP 11 , MVP 12 and MVP 13 Referring to FIG. 21, the second MV (2041) to (2044) are MVP 10 , MVP 11 , MVP 12 , and MVP 13 are determined to be equal to
[0217] In one example, a single MVP index is used to indicate the first MVP candidate and the second MVP candidate.
[0218] In one embodiment, a first MVP of one of the first plurality of MVRs may be determined, followed by a first remaining MVP of a first remaining MVR of the first plurality of MVRs based on the first MVP and the first remaining MVR. Similarly, a second MVP of one of the second plurality of MVRs may be determined, followed by a second remaining MVP of a second remaining MVR of the second plurality of MVRs based on the second MVP and the second remaining MVR.
[0219] In one embodiment, a first MVP (e.g., a quarter pixel MVP) of one of the first plurality of MVRs is 0a ) is determined based on the first reference list (e.g., L0), the first reference picture index (e.g., indicating the first reference picture (2011)), and the first MVP index. For example, the first MVP is determined from the first MVP candidates. In one example, one of the first plurality of MVRs corresponds to the highest resolution (e.g., ¼ pixel) in the first plurality of MVRs. Other first MVPs (e.g., MVPs corresponding to ½ pixel, 1 pixel, and 4 pixel, respectively) of the first remaining MVRs of the first plurality of MVRs are determined. 0b , MVP 0c and MVP 0d ) is the first MVP (e.g., the 1 / 4 pixel MVP 0a For example, to obtain other first MVPs (e.g., MVP0b, MVP0c, and MVP0d), the first MVP (e.g., MVP0a at 1 / 4 pixel) can be rounded to first remaining MVRs of 1 / 2 pixel, 1 pixel, and 4 pixels, respectively, so that the precision of the obtained first MVPs can each fall within a given MVR. In one example, MVP 0a is MVP 00 MVP 0b is MVP 01 MVP 0c is MVP 02 MVP 0d is MVP 03 may be the same as or different from.
[0220] One of the second plurality of MVRs (e.g., a quarter pixel MVP 1a ) is determined based on the second reference list (e.g., L1), the second reference picture index (e.g., indicating the second reference picture (2111)), and the second MVP index. For example, the second MVP is determined from the second MVP candidates. In one example, one of the second plurality of MVRs corresponds to the highest resolution (e.g., ¼ pixel) in the second plurality of MVRs. Other second MVPs of the second remaining MVRs of the second plurality of MVRs (e.g., MVPs corresponding to ½ pixel, 1 pixel, and 4 pixel, respectively) are determined. 1b , MVP 1c and MVP 1d ) is the second MVP (e.g., the 1 / 4 pixel MVP 1a ) can be determined from another second MVP (e.g., MVP 1b , MVP 1c and MVP 1d ), a second MVP (e.g., a quarter-pixel MVP) is used to obtain 1a ) are rounded to second remaining MVRs of 1 / 2 pixel, 1 pixel, and 4 pixels, respectively, so that the precision of the resulting second MVPs can each fit within a given MVR. 1a is MVP 10 MVP 1b is MVP 11 MVP 1c is MVP 12 MVP 1d is MVP 13 may be the same as or different from.
[0221] In one embodiment, when the current block is bi-predictively decoded, the first MVDs of the first plurality of MVRs are respectively determined based on the first plurality of MVRs. The first MVDs of the first plurality of MVRs may be respectively simultaneously determined based on the first plurality of MVRs. For example, the first MVDs (e.g., MVDs) of the first plurality of MVRs (e.g., 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel) may be respectively simultaneously determined based on the first plurality of MVRs. 00 , M.V.D. 01 , M.V.D. 02, and MVD 03 or MVD 00 ~MVD 03 ) are determined based on the first plurality of MVRs and the first MVD information, respectively. The first MVD information may indicate a magnitude and a direction of the first initial MVD. In one example, the first MVD is obtained from the first initial MVD according to the first plurality of MVRs, respectively.
[0222] Alternatively, the first MVD (e.g., the MVD corresponding to a quarter pixel) 0a ) may be determined based on the first MVD information and a corresponding first MVR (e.g., 1 / 4 pixel) of the first plurality of MVRs. Then, a remaining first MVD (e.g., MVD 0b ~MVD 0d ) is one of the first MVDs (e.g., MVD 0a ) and the remaining first MVR.
[0223] In one embodiment, the first MV is determined based on the first MVD and the respective first MVP. The first MVD used to determine the first MV can be obtained using the above-mentioned embodiment or any other suitable method. The first MVP used to determine the first MV can be obtained using the above-mentioned embodiment or any other suitable method.
[0224] Referring to FIG. 20 or FIG. 21, in one example, MV(2041) to (2044) are: (i) MVD 01 ~MVD 03 , and (ii) the corresponding MVP 01 ~MVP 03 In one example, MV(2041) to MV(2044) are determined based on (i) MVD 0a ~MVD 0d and the corresponding MVP 0a ~MVP 0dIn one example, MV(2041) to MV(2044) are determined based on (i) MVD 01 ~MVD 03 and the corresponding MVP 0a ~MVP 0d In one example, MV(2041) to MV(2044) are determined based on (i) MVD 0a ~MVD 0d and the corresponding MVP 01 ~MVP 03 are determined based on the above.
[0225] In one embodiment, when the current block is bi-predictively decoded, the second MVDs of the second plurality of MVRs are respectively determined based on the second plurality of MVRs. The second MVDs of the second plurality of MVRs can be respectively simultaneously determined based on the second plurality of MVRs. For example, the second MVDs of the second plurality of MVRs (e.g., 1 / 4 pixel, 1 / 2 pixel, 1 pixel, and 4 pixel) (e.g., MVD 10 , M.V.D. 11 , M.V.D. 12 , and MVD 13 or MVD 10 ~MVD 13 ) are determined based on the second plurality of MVRs and the second MVD information, respectively. The second MVD information may indicate a magnitude and a direction of the second initial MVD. In one example, the second MVDs are obtained from the second initial MVD according to the second plurality of MVRs, respectively.
[0226] Alternatively, a second MVD (e.g., a MVD corresponding to a quarter pixel) 1a ) may be determined based on the second MVD information and a corresponding second MVR (e.g., 1 / 4 pixel) of the second plurality of MVRs. Then, a remaining second MVD (e.g., MVD 1b ~MVD 1d ) is one of the second MVDs (e.g., MVD 1a ) and the remaining second MVR.
[0227] In one embodiment, the second MV is determined based on the second MVD and the respective second MVP. The second MVD used to determine the second MV can be obtained using the above-mentioned embodiment or any other suitable method. The second MVP used to determine the second MV can be obtained using the above-mentioned embodiment or any other suitable method.
[0228] Referring to FIG. 21, in one example, the second MVs (2141) to (2144) are: (i) MVD 10 ~MVD 13 and (ii) the corresponding MVP. 10 ~MVP 13 In one example, MV(2141) to MV(2144) are determined based on (i) MVD 1a ~MVD 1d , and the corresponding MVP 1a ~MVP 1d In one example, MV(2141) to (2144) are determined based on (i) MVD 10 -MVD 13 and the corresponding MVP 1a ~MVP 1d In one example, MV(2141) to (2144) are determined based on (i) MVD 1a ~MVD 1d and the corresponding MVP 10 ~MVP 13 are determined based on the following:
[0229] FIG. 23 shows a flow chart outlining an encoding process (2300) according to one embodiment of the disclosure. In various embodiments, the process (2300) is performed by processing circuitry, such as processing circuitry in terminal devices (310), (320), (330), and (340), processing circuitry performing the functions of a video encoder (e.g., (403), (603), (703)). In some embodiments, the process (2300) is implemented with software instructions, such that the processing circuitry performs the process (2300) when it executes the software instructions. The process starts at (S2301) and proceeds to (S2310).
[0230] At (S2310), for a current block in a current picture to be encoded in an adaptive motion vector prediction (AMVP) mode and an adaptive motion vector resolution (AMVR) mode, a respective first motion vector predictor (MVP) for each of a first plurality of motion vector resolutions (MVRs) corresponding to a first reference picture may be determined based on an MVP candidate and a respective first MVR among the first plurality of MVRs.
[0231] At (S2320), template matching (TM) may be performed by determining a TM cost based on at least a first plurality of MVRs and the first MVP.
[0232] In (S2330), prediction information may be encoded, including (i) motion information indicating that AMVP and AMVR modes are applied to the current block, and (ii) indicating MVP candidates.
[0233] At (S2340), the encoded prediction information may be included in a video bitstream.
[0234] Then, the process (2300) proceeds to (S2399) and ends.
[0235] Process (2300) may be adapted appropriately to various scenarios, and steps within process (2300) may be adjusted accordingly. One or more of the steps within process (2300) may be adapted, omitted, repeated, and / or combined. Any suitable order may be used to perform process (2300). Additional step(s) may be added.
[0236] In one embodiment, the current block is encoded uni-predictively. Each of the TM costs corresponds to a respective first MVR of the first plurality of MVRs. The TM may further include ranking the first plurality of MVRs based on the determined TM costs. The current block may be encoded based on one of the ranked first plurality of MVRs. In one example, the TM includes selecting an MVR from the ranked first plurality of MVRs. The current block may be encoded based on the selected MVR. At (S2340), the encoded current block may be included in a video bitstream.
[0237] In one embodiment, the motion information indicates the MVP candidate in the candidate list that corresponds to the first reference picture.
[0238] In one example, for each of the first plurality of MVRs, step (S2310) may include determining a respective first MVP based on the MVP candidate and the respective first MVR, and step (S2320) may include determining a first reference block in the first reference picture to which the first MVP of the respective first MVR can point from the current block to the first reference block. For each of the first plurality of MVRs, step (S2320) may further include determining a TM cost based on a first reference template of the first reference block and a current template of the current block.
[0239] In one example, the first plurality of MVRs includes 1 / 4 pixel and one or more MVRs with a spatial resolution lower than 1 / 4 pixel. Step (S2310) may include determining an MVP corresponding to 1 / 4 pixel based on the MVP candidate and the 1 / 4 pixel, and determining one or more remaining MVPs of the first MVP based on the MVP corresponding to 1 / 4 pixel and the respective one or more MVRs. For each of the first plurality of MVRs, step (S2320) may include determining a first reference block in the first reference picture, to which the first MVP of the respective first MVR may point from the current block to the first reference block. For each of the first plurality of MVRs, step (S2320) may include determining a TM cost based on a first reference template of the first reference block and a current template of the current block.
[0240] In one embodiment, for each of the first plurality of MVRs, a respective first MVD may be determined based on the respective first MVR, and a first MV of the respective first MVR may be determined based on the respective first MVD. In (S2320), a first reference block in a first reference picture may be determined, where the first MV for the respective first MVR may point from a current block to the first reference block. Furthermore, a TM cost may be determined based on a first reference template of the first reference block and a current template of the current block. In (S2330), MVD information indicating the first MVD may be encoded. In one example, the motion information includes the MVD information.
[0241] In one embodiment, the current block is bi-predictively encoded. Each of the TM costs corresponds to a respective one of a plurality of MVR pairs, and each MVR pair may include (i) a first MVR of the first plurality of MVRs and (ii) a second MVR of the second plurality of MVRs corresponding to a second reference picture. In (S2320), the plurality of MVR pairs may be ranked based on the determined TM costs. In one example, the current block may be encoded based on one of the ranked plurality of MVR pairs. In one example, the MVR pair is selected from the ranked plurality of MVR pairs. The current block may be encoded based on the selected MVR pair.
[0242] In one embodiment, a second MVP of each of the second plurality of MVRs corresponding to the second reference picture may be determined based on a second MVP candidate in the second candidate list corresponding to the second reference picture and the respective second MVR. At (2320), for each MVR pair of the plurality of MVR pairs, a first reference block in the first reference picture may be determined, and the first MVP of the first MVR of each of the MVR pairs may point from the current block to the first reference block. A second reference block in the second reference picture may be determined, and the second MVP of the second MVR of each of the MVR pairs may point from the current block to the second reference block. Furthermore, a TM cost may be determined based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block. The motion information may indicate a second MVP candidate.
[0243] In one example, at (S2310), for each of a first plurality of MVRs, a respective first MVP is determined based on a first MVP candidate in a first candidate list corresponding to a first reference picture and the respective first MVR.
[0244] In one example, the first plurality of MVRs includes 1 / 4 pixel and one or more first MVRs with a spatial resolution lower than 1 / 4 pixel, and the second plurality of MVRs includes 1 / 4 pixel and one or more second MVRs with a spatial resolution lower than 1 / 4 pixel. In (S2310), the first MVP corresponding to 1 / 4 pixel may be determined based on the first MVP candidate and 1 / 4 pixel, and one or more remaining first MVPs in the first MVP may be determined based on the first MVP corresponding to 1 / 4 pixel and the respective one or more first MVRs. Furthermore, the second MVP corresponding to 1 / 4 pixel may be determined based on the second MVP candidate and 1 / 4 pixel, and one or more remaining second MVPs in the second MVP may be determined based on the second MVP corresponding to 1 / 4 pixel and the respective one or more second MVRs.
[0245] In one example, for each of the first plurality of MVRs, a first MVD may be determined based on a first MVR of each of the first plurality of MVRs, and a first MV for each of the first MVR of each of the first plurality of MVRs may be determined based on the first MVD. For each of the second plurality of MVRs, a second MVD may be determined based on a second MVR of each of the second plurality of MVRs, and a second MV for each of the second MVR of each of the second plurality of MVRs may be determined based on the second MVD. In (S2320), for each MVR pair of the MVR pair, a first reference block in the first reference picture may be determined, and the first MV of the first MVR of each of the MVR pairs points from the current block to the first reference block. Furthermore, a second reference block in the second reference picture may be determined, and the second MV for the second MVR of each of the MVR pairs points from the current block to the second reference block. The TM cost may be determined based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block.
[0246] FIG. 24 shows a flow chart outlining a decoding process (2400) according to one embodiment of the disclosure. In various embodiments, the process (2400) is performed by processing circuitry within the terminal devices (310), (320), (330), and (340), processing circuitry performing the functions of a video encoder (403), processing circuitry performing the functions of a video decoder (410), processing circuitry performing the functions of a video decoder (510), processing circuitry performing the functions of a video encoder (603), etc. In some embodiments, the process (2400) is implemented with software instructions, such that the processing circuitry performs the process (2400) when it executes the software instructions. The process starts at (S2401) and proceeds to (S2410).
[0247] At (S2410), prediction information of a current block in a current picture may be decoded from a coded video bitstream. The prediction information may indicate that an adaptive motion vector prediction (AMVP) mode and an adaptive motion vector resolution (AMVR) mode are applied to the current block. The prediction information may indicate motion information.
[0248] At (S2420), a respective first motion vector predictor (MVP) for each of a first plurality of motion vector resolutions (MVRs) corresponding to the first reference picture may be determined based on the motion information and a respective first MVR of the first plurality of MVRs.
[0249] At (S2430), template matching (TM) may be performed by determining a TM cost based on at least a first plurality of MVRs and the first MVP.
[0250] The process (2400) proceeds to (S2499) and ends.
[0251] Process (2400) may be adapted appropriately to various scenarios, and steps within process (2400) may be adjusted accordingly. One or more of the steps within process (2400) may be adapted, omitted, repeated, and / or combined. Any suitable order may be used to perform process (2400). Additional step(s) may be added.
[0252] In one embodiment, the current block is predicted uni-predictively. Each of the TM costs corresponds to a respective first MVR of the first plurality of MVRs. The TM may further include ranking the first plurality of MVRs based on the determined TM costs. In one example, the current block is reconstructed based on one of the ranked first plurality of MVRs. In one example, the TM includes selecting an MVR from the ranked first plurality of MVRs. The current block may be reconstructed based on the selected MVR.
[0253] In one embodiment, the motion information indicates the MVP candidate in the candidate list that corresponds to the first reference picture.
[0254] In one example, for each of the first plurality of MVRs, step (S2420) may include determining a respective first MVP based on the MVP candidate and the respective first MVR, and step (S2430) may include determining a first reference block in the first reference picture to which the first MVP of the respective first MVR can point from the current block to the first reference block. For each of the first plurality of MVRs, step (S2430) may further include determining a TM cost based on a first reference template of the first reference block and a current template of the current block.
[0255] In one example, the first plurality of MVRs includes 1 / 4 pixel and one or more MVRs with a spatial resolution lower than 1 / 4 pixel. Step (S2420) may include determining an MVP corresponding to 1 / 4 pixel based on the MVP candidate and the 1 / 4 pixel, and determining one or more remaining MVPs of the first MVP based on the MVP corresponding to 1 / 4 pixel and the respective one or more MVRs. For each of the first plurality of MVRs, step (S2430) may include determining a first reference block in the first reference picture, to which the first MVP of the respective first MVR may point from the current block to the first reference block. For each of the first plurality of MVRs, step (S2430) may include determining a TM cost based on a first reference template of the first reference block and a current template of the current block.
[0256] In one embodiment, the motion information includes MV difference (MVD) information. For each of the first plurality of MVRs, a respective first MVD may be determined based on the MVD information and the respective first MVR, and a first MV for each first MVR may be determined based on the respective first MVD. At (S2430), a first reference block in the first reference picture may be determined, where the first MV of each first MVR may point from the current block to the first reference block. Furthermore, a TM cost may be determined based on the first reference template of the first reference block and the current template of the current block.
[0257] In one embodiment, the current block is predicted bi-predictively. Each of the TM costs corresponds to a respective one of a plurality of MVR pairs, and each MVR pair may include (i) a first MVR of the first plurality of MVRs and (ii) a second MVR of the second plurality of MVRs corresponding to a second reference picture. In (S2430), the plurality of MVR pairs may be ranked based on the determined TM costs. In one example, the current block may be reconstructed based on one of the ranked plurality of MVR pairs. In one example, the MVR pair is selected from the ranked plurality of MVR pairs. The current block may be reconstructed based on the selected MVR pair.
[0258] In one embodiment, the motion information indicates a first MVP candidate in a first candidate list corresponding to the first reference picture and a second MVP candidate in a second candidate list corresponding to the second reference picture. A second MVP of each of the second plurality of MVRs corresponding to the second reference picture may be determined based on the second MVP candidate and the respective second MVR. At (2430), for each MVR pair of the plurality of MVR pairs, a first reference block in the first reference picture may be determined, and the first MVP of the first MVR of each of the MVR pairs may point from the current block to the first reference block. A second reference block in the second reference picture may be determined, and the second MVP of the second MVR of each of the MVR pairs may point from the current block to the second reference block. Furthermore, a TM cost may be determined based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block.
[0259] In one example, at (S2420), for each of the first plurality of MVRs, a respective first MVP is determined based on the first MVP candidate and the respective first MVR.
[0260] In one example, the first plurality of MVRs includes 1 / 4 pixel and one or more first MVRs with a spatial resolution lower than 1 / 4 pixel, and the second plurality of MVRs includes 1 / 4 pixel and one or more second MVRs with a spatial resolution lower than 1 / 4 pixel. In (S2420), the first MVP corresponding to 1 / 4 pixel may be determined based on the first MVP candidate and 1 / 4 pixel, and one or more remaining first MVPs in the first MVP may be determined based on the first MVP corresponding to 1 / 4 pixel and the respective one or more first MVRs. Furthermore, the second MVP corresponding to 1 / 4 pixel may be determined based on the second MVP candidate and 1 / 4 pixel, and one or more remaining second MVPs in the second MVP may be determined based on the second MVP corresponding to 1 / 4 pixel and the respective one or more second MVRs.
[0261] In one example, the motion information includes MVD information. For each of the first plurality of MVRs, a first MVD may be determined based on the MVD information and a first MVR of each of the first plurality of MVRs, and a first MV for each of the first MVR of the first plurality of MVRs may be determined based on the first MVD. For each of the second plurality of MVRs, a second MVD may be determined based on the MVD information and a second MVR of each of the second plurality of MVRs, and a second MV for each of the second MVR of the second plurality of MVRs may be determined based on the second MVD. In (S2430), for each MVR pair of the MVR pairs, a first reference block in the first reference picture may be determined, and the first MV for each of the first MVR of the MVR pair points from the current block to the first reference block. Further, a second reference block in the second reference picture may be determined, and a second MV for each second MVR of the MVR pair points from the current block to the second reference block. A TM cost may be determined based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block.
[0262] FIG. 25 shows a flow chart outlining a decoding process (2500) according to one embodiment of the disclosure. In various embodiments, the process (2500) is performed by processing circuitry within the terminal devices (310), (320), (330), and (340), processing circuitry performing the functions of a video encoder (403), processing circuitry performing the functions of a video decoder (410), processing circuitry performing the functions of a video decoder (510), processing circuitry performing the functions of a video encoder (603), etc. In some embodiments, the process (2500) is implemented with software instructions, and thus the processing circuitry performs the process (2500) as the processing circuitry executes the software instructions. The process starts at (S2501) and proceeds to (S2510).
[0263] At (S2510), prediction information of a current block in a current picture may be decoded from a coded video bitstream. The prediction information may indicate that an adaptive motion vector prediction (AMVP) mode and an adaptive motion vector resolution (AMVR) mode are applied to the current block. The prediction information may indicate motion information.
[0264] At (S2520), a respective first motion vector predictor (MVP) for each of a first plurality of motion vector resolutions (MVRs) corresponding to the first reference picture may be determined based on the motion information and a respective first MVR of the first plurality of MVRs.
[0265] At (S2530), template matching (TM) may be performed by determining a TM cost based on at least a first plurality of MVRs and the first MVP.
[0266] At (S2540), an adaptation order of the first plurality of MVRs may be generated based on the TM costs.
[0267] At (S2550), the signaled MVR index is applied based on the generated adaptation order.
[0268] The process (2500) proceeds to (S2599) and ends.
[0269] Process (2500) may be adapted to various scenarios and steps within process (2500) may be adjusted accordingly. One or more of the steps within process (2500) may be adapted, omitted, repeated, and / or combined. Any suitable order may be used to perform process (2500). Additional step(s) may be added.
[0270] The embodiments of the present disclosure may be used separately or combined in any order. Furthermore, each of the methods (or embodiments), the encoder, and the decoder may be implemented by a processing circuit (e.g., one or more processors or one or more integrated circuits). In one example, the one or more processors execute a program stored on a non-transitory computer-readable medium.
[0271] The techniques described above can be implemented as computer software using computer-readable instructions physically stored on one or more computer-readable media. For example, Figure 26 illustrates a computer system (2600) suitable for implementing certain embodiments of the disclosed subject matter.
[0272] Computer software can be coded using any suitable machine code or computer language that is amenable to mechanisms such as assembly, compilation, linking, etc. to create code that includes instructions that can be executed by one or more computer central processing units (CPUs), graphics processing units (GPUs), etc. directly, or via interpretation, microcode execution, etc.
[0273] The instructions may be executed on various types of computers or computer components including, for example, personal computers, tablet computers, servers, smartphones, gaming consoles, Internet of Things devices, and the like.
[0274] 26 with respect to the computer system (2600) are exemplary in nature and are not intended to suggest any limitation as to the scope of use or functionality of the computer software implementing the embodiments of the present disclosure. The arrangement of components should not be interpreted as having a dependency or requirement regarding any one or combination of components illustrated in the exemplary embodiment of the computer system (2600).
[0275] The computer system (2600) may include certain human interface input devices that may respond to input by one or more human users, for example, via tactile input (e.g., keystrokes, swipes, data glove movements), audio input (e.g., voice, clapping), visual input (e.g., gestures), olfactory input (not shown). Human interface devices may also be used to capture certain media not necessarily directly associated with conscious human input, such as audio (voice, music, ambient sounds, etc.), images (scanned images, photographic images obtained from still image cameras, etc.), video (two-dimensional video, three-dimensional video including stereoscopic video, etc.).
[0276] The input human interface devices may include one or more (only one of each shown) of a keyboard (2601), a mouse (2602), a trackpad (2603), a touch screen (2610), a data glove (not shown), a joystick (2605), a microphone (2606), a scanner (2607), and a camera (2608).
[0277] The computer system (2600) may also include certain human interface output devices. Such human interface output devices may stimulate one or more of the human user's senses, for example, by haptic output, sound, light, and smell / taste. Such human interface output devices may include haptic output devices (e.g., haptic feedback via a touch screen (2610), data gloves (not shown), or joystick (2605), although there may also be haptic feedback devices that do not function as input devices), audio output devices (e.g., speakers (2609), headphones (not shown)), visual output devices (e.g., screens (2610), including CRT screens, LCD screens, plasma screens, OLED screens, each with or without touch screen input capability, each with or without haptic feedback capability, some of which may be capable of two-dimensional visual output, or four or more dimensions of output by means of stereoscopic image output, virtual reality glasses (not shown), holographic displays, and smoke tanks (not shown), etc.), and printers (not shown).
[0278] The computer system (2600) may also include human accessible storage devices and their associated media, such as optical media including CD / DVD ROM / RW (2620) with media (2621) such as CDs / DVDs, thumb drives (2622), removable hard drives or solid state drives (2623), legacy magnetic media such as tapes and floppy disks (not shown), dedicated ROM / ASIC / PLD based devices (not shown) such as security dongles, and the like.
[0279] Those skilled in the art should also understand that the term "computer-readable medium" as used in connection with the subject matter of this disclosure does not encompass transmission media, carrier waves, or other transitory signals.
[0280] The computer system (2600) may also include an interface (2654) to one or more communication networks (2655). The networks may be, for example, wireless, wired, optical. The networks may further be local, wide area, metropolitan, vehicular and industrial, real-time, delay tolerant, and the like. Examples of networks include local area networks such as Ethernet, cellular networks including WLAN, GSM, 3G, 4G, 5G, LTE, and the like, TV wired or wireless wide area digital networks including cable TV, satellite TV, terrestrial broadcast TV, and the like, vehicular and industrial including CANBus, and the like. Certain networks typically require an external network interface adapter connected to a particular general-purpose data port or peripheral bus (2649) (e.g., a USB port on the computer system (2600)), while others are generally integrated into the core of the computer system (2600) by connecting to a system bus as described below (e.g., an Ethernet interface to a PC computer system or a cellular network interface to a smartphone computer system). Using any of these networks, the computer system (2600) may communicate with other entities. Such communications may be one-way receive only (e.g., television broadcast), one-way transmit only (e.g., a CANbus to a particular CANbus device), or bidirectional, for example, to other computer systems using local or wide area digital networks. Specific protocols and protocol stacks may be used in each of these networks and network interfaces, as described above.
[0281] The aforementioned human interface devices, human accessible storage, and network interfaces may be attached to the core (2640) of the computer system (2600).
[0282] The cores (2640) may include one or more central processing units (CPUs) (2641), graphics processing units (GPUs) (2642), dedicated programmable processing units in the form of field programmable gate areas (FPGAs) (2643), hardware accelerators for specific tasks (2644), graphics adapters (2650), and the like. These devices may be connected via a system bus (2648), along with read only memory (ROM) (2645), random access memory (2646), internal mass storage (2647), such as an internal non-user accessible hard drive, SSD, and the like. In some computer systems, the system bus (2648) may be accessible in the form of one or more physical plugs to allow expansion with additional CPUs, GPUs, and the like. Peripheral devices may be attached directly to the core's system bus (2648) or via a peripheral bus (2649). In one example, a screen (2610) may be connected to a graphics adapter (2650). Architectures for peripheral buses include PCI, USB, etc.
[0283] The CPU (2641), GPU (2642), FPGA (2643), and accelerator (2644) can execute certain instructions that may combine to constitute the aforementioned computer code. That computer code can be stored in ROM (2645) or RAM (2646). Persistent data can be stored, for example, in internal mass storage (2647), while transitory data can also be stored in RAM (2646). Rapid storage and retrieval in any of the memory devices can be made possible by the use of cache memories that can be closely associated with one or more of the CPU (2641), GPU (2642), mass storage (2647), ROM (2645), RAM (2646), etc.
[0284] The computer-readable medium can bear computer code for performing various computer-implemented operations. The medium and computer code may be those specially designed and constructed for the purposes of the present disclosure, or they may be of the available kind well known to those skilled in the computer software arts.
[0285] As an example, but not by way of limitation, a computer system (2600) having an architecture, and in particular a core (2640), can provide functionality as a result of a processor (including a CPU, GPU, FPGA, accelerator, etc.) executing software embodied in one or more tangible computer-readable media. Such computer-readable media can be the user-accessible mass storage devices introduced above, as well as media associated with a particular storage device of the core (2640) that is of a non-transitory nature, such as the core internal mass storage (2647) or ROM (2645). Software implementing various embodiments of the present disclosure can be stored in such devices and executed by the core (2640). The computer-readable media can include one or more memory devices or chips according to particular needs. The software can cause the core (2640), and in particular the processor therein (including a CPU, GPU, FPGA, etc.) to perform certain processes or certain parts of certain processes described herein, including defining data structures stored in RAM (2646) and modifying such data structures according to processes defined by the software. Additionally, or alternatively, the computer system may provide functionality as a result of hardwired or otherwise embodied logic in circuitry (e.g., accelerator (2644)) that may operate in place of or in conjunction with software to perform particular processes or particular portions of particular processes described herein. Where appropriate, references to software may encompass logic and vice versa. Where appropriate, references to computer-readable media may encompass circuitry (such as integrated circuits (ICs)) that store software for execution, circuitry that embodies logic for execution, or both. The present disclosure encompasses any suitable combination of hardware and software. Appendix A: Acronyms JEM: Joint Exploration Model VVC: Versatile Video Coding BMS: Benchmark Set MV: Motion Vector HEVC: High Efficiency Video Coding SEI: Supplementary Enhancement Information VUI: Video Usability Information GOP: Group of Pictures TU: Transform Units PU: Prediction Units CTU: Coding Tree Units CTB: Coding Tree Blocks PB: Prediction Blocks HRD: Hypothetical Reference Decoder SNR: Signal to Noise Ratio CPU: Central Processing Units GPU: Graphics Processing Units CRT: Cathode Ray Tube LCD: Liquid Crystal Display OLED: Organic Light-Emitting Diode CD: Compact Disc DVD: Digital Video Disc ROM: Read-Only Memory RAM: Random Access Memory ASIC: Application-Specific Integrated Circuit PLD: Programmable Logic Device LAN: Local Area Network GSM: Global System for Mobile communications LTE: Long-Term Evolution CANBus: Controller Area Network Bus USB: Universal Serial Bus PCI: Peripheral Component Interconnect FPGA: Field Programmable Gate Areas SSD: Solid-state drive IC: Integrated Circuit CU: Coding Unit RD: Rate-Distortion
[0286] While this disclosure describes several exemplary embodiments, there are alterations, permutations, and various substitute equivalents that fall within the scope of this disclosure. It will thus be appreciated that those skilled in the art will be able to devise numerous systems and methods that, although not explicitly shown or described herein, embody the principles of the present disclosure and are therefore within the spirit and scope of the present disclosure. [Explanation of symbols]
[0287] 101 points, sample 102 Arrow 103 Arrow 104 Square Block 110 Schematic diagram 201 Current Block 300 Communication Systems 310 Terminal Devices 320 Terminal Devices 330 Terminal Devices 340 Terminal Devices 350 Communication Network 400 Communication Systems 401 Video Source 402 Video Picture Stream 403 Video Encoder 404 Encoded video data 405 Streaming Server 406 Client Subsystem 407 Video data input copy 408 Client Subsystem 409 Copy of encoded video data 410 Video Decoder 411 Output Stream 412 Display 413 Capture Subsystem 420 Electronic Devices 430 Electronic Devices 501 Channel 510 Video Decoder 512 Rendering Device 515 Buffer Memory 520 Parser 521 Symbols 530 Electronic Devices 531 Receiver 551 Scaler / Descaler Unit 552 Intra-picture prediction unit 553 Motion Compensation Prediction Unit 555 Aggregator 556 Loop Filter Unit 557 Reference Picture Memory 558 Current Picture Buffer 601 Video Sources 603 Video Encoder 620 Electronic Devices 630 Source Coder 632 Coding Engine 633 Decoder, Local Video Decoder 634 Reference Picture Memory 635 Predictor 640 Transmitter 643 Video Sequences 645 Entropy Coder 650 Controller 660 Communication Channels 703 Video Encoder 721 General-purpose controller 722 Intra Encoder 723 Residual Calculator 724 Residual Encoder 725 Entropy Encoder 726 Switch 728 Residual Decoder 730 InterEncoder 810 Video Decoder 871 Entropy Decoder 872 Intra Decoder 873 Residual Decoder 874 Reconstruction Module 880 Interdecoder 1101 Current Picture 1102 Current Reference Picture 1103 Colocated Pictures 1104 Colocated Reference Picture 1111 Current CU 1112 Colocated CU 1121 Scaled MV 1210 Colocated CU 1601 Motion Vectors 1602 Luminance Sub-Block 1610 Current Block 1710 Current CU 1720 CU containing Block A 1900 Template Matching 1901 Current Block 1902 Early MV 1903 Reference Block 1910 Current Picture 1911 Reference Picture 1915 Search Area 1921 Template 1922 Upper Template 1923 Left Template 1925 Template 1926 Upper Template 1927 Left Template 2000 Template Matching 2001 Current Block 2010 Current Picture 2011 Reference Picture 2021 Current Template 2031 Reference Block 2032 Reference Block 2033 Reference Block 2034 Reference Block 2041 M.V. 2042 M.V. 2043 M.V. 2044 M.V. 2051 Reference Template 2052 Reference Template 2053 Reference Template 2054 Reference Template 2100 Template Matching 2111 Second reference picture 2131 Second Reference Block 2132 Second Reference Block 2133 Second Reference Block 2134 Second Reference Block 2141 2nd MV 2142 2nd MV 2143 2nd MV 2144 2nd MV 2151 Second Reference Template 2152 Second Reference Template 2153 Second Reference Template 2154 Second Reference Template 2200 TM 2201 current block 2221 Template 2225 Reference Template 2300 Encoding Process 2400 Decoding Process 2500 Decoding Processes 2600 Computer Systems 2601 Keyboard 2602 Mouse 2603 Trackpad 2605 Joystick 2606 Microphone 2607 Scanner 2608 Camera 2609 Speaker 2610 Screen 2621 CD / DVD and other media 2620 CD / DVD ROM / RW 2622 Thumb Drive 2623 Removable Hard Drive or Solid State Drive 2640 cores 2641 CPU 2642 GPU 2643 Field Programmable Gate Area (FPGA) 2644 Hardware Accelerator 2645 Read-Only Memory (ROM), ROM 2646 Random Access Memory, RAM 2647 Internal Mass Storage 2648 System Bus 2649 Surrounding bus 2650 Graphics Adapter 2654 Interface 2655 Communication Network
Claims
1. 1. A method for video decoding in a video decoder, comprising: decoding prediction information of a current block in a current picture from a coded video bitstream, the prediction information indicating (i) an adaptive motion vector prediction (AMVP) mode is applied to the current block together with an adaptive motion vector resolution (AMVR) mode, and (ii) motion information indicating a motion vector predictor (MVP) candidate in a candidate list corresponding to a first reference picture; determining a respective first MVP for each of a first plurality of motion vector resolutions (MVRs) corresponding to the first reference picture based on the motion information and a respective first MVR of the first plurality of MVRs, the first plurality of MVRs including a quarter pixel and one or more MVRs having a spatial resolution lower than a quarter pixel; determining an MVP corresponding to a quarter pixel based on the MVP candidate and the quarter pixel; Based on the MVP corresponding to a quarter pixel and each of the one or more MVRs, determining one or more remaining MVPs among the first MVP; and determining a template matching (TM) cost by performing TM based on at least the first plurality of MVRs and the first MVP, For each of the first plurality of MVRs: determining a first reference block in the first reference picture, wherein the first MVP of the respective first MVR points from the current block to the first reference block; determining the TM cost based on a first reference template of the first reference block and a current template of the current block; and generating an adaptive order for the first plurality of MVRs based on the TM costs; applying a signaled MVR index based on the generated adaptation order; 13. A method for video decoding, comprising:
2. the current block is predicted in a uni-predictive manner, each of the TM costs corresponds to a respective first MVR of the first plurality of MVRs; The generating step includes: Sorting the first plurality of MVRs based on the determined TM costs. Further comprising: The method comprises: reconstructing the current block based on one of the reordered first plurality of MVRs indicated by the signaled MVR index. The method of claim 1, further comprising:
3. the motion information indicates an MVP candidate in a candidate list corresponding to the first reference picture; The step of determining the first MVP comprises: determining, for each of the first plurality of MVRs, a respective first MVP based on the MVP candidates and the respective first MVR; Including, The step of determining the TM cost comprises: For each of the first plurality of MVRs: determining a first reference block in the first reference picture, wherein the first MVP of the respective first MVR points from the current block to the first reference block; determining a TM cost based on a first reference template of the first reference block and a current template of the current block; 3. The method of claim 2, comprising:
4. the motion information includes MV difference (MVD) information; For each of the first plurality of MVRs: The method comprises: determining a respective first MVD based on the MVD information and the respective first MVR; determining a first MV of each of the first MVRs based on the respective first MVD; Further comprising: The step of determining the TM cost comprises: determining a first reference block in the first reference picture, the first MVR for the respective first MVR pointing from the current block to the first reference block; determining a TM cost based on a first reference template of the first reference block and a current template of the current block; 3. The method of claim 2, comprising:
5. the current block is predicted bi-predictively, each of the TM costs corresponds to a respective one of a plurality of MVR pairs, each MVR pair including (i) a first MVR of the first plurality of MVRs and (ii) a second MVR of a second plurality of MVRs corresponding to a second reference picture; The generating step includes: reordering the plurality of MVR pairs based on the determined TM costs, wherein the adapted order of the first plurality of MVRs is based on the reordered plurality of MVR pairs. Including, The method comprises: reconstructing the current block based on one of the reordered MVR pairs. The method of claim 1, further comprising:
6. the motion information indicates a first MVP candidate in a first candidate list corresponding to the first reference picture and a second MVP candidate in a second candidate list corresponding to the second reference picture; The method further includes determining a second MVP for each of the second plurality of MVRs corresponding to the second reference picture based on the second MVP candidates and the respective second MVRs; The step of determining the TM cost comprises: For each MVR pair of the plurality of MVR pairs, determining a first reference block in the first reference picture, wherein the first MVP of the first MVR of each of the MVR pairs points from the current block to the first reference block; determining a second reference block in the second reference picture, wherein the second MVP of the second MVR of each of the MVR pairs points from the current block to the second reference block; determining the TM cost based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block; 6. The method of claim 5, comprising:
7. The step of determining the first MVP comprises: determining, for each of the first plurality of MVRs, a respective first MVP based on the first MVP candidates and the respective first MVRs; 7. The method of claim 6, comprising:
8. the first plurality of MVRs includes one or more first MVRs having a spatial resolution less than one-quarter pixel; the second plurality of MVRs includes one or more second MVRs having a spatial resolution less than one-quarter pixel; The step of determining the first MVP comprises: determining a first MVP corresponding to a quarter pixel based on the first MVP candidate and the quarter pixel; determining one or more remaining first MVPs in the first MVP based on the first MVP corresponding to the quarter pixel and each of the one or more first MVRs; Including, The step of determining the second MVP comprises: determining a second MVP corresponding to a quarter pixel based on the second MVP candidate and the quarter pixel; determining one or more remaining second MVPs in the second MVP based on the second MVP corresponding to the quarter pixel and the one or more second MVRs respectively; 7. The method of claim 6, comprising:
9. the motion information includes MV difference (MVD) information; The method comprises: For each of the first plurality of MVRs: determining a first MVD based on the MVD information and the respective first MVRs of the first plurality of MVRs; determining a first MV for the respective first MVRs of the first plurality of MVRs based on the first MVD; For each of the second plurality of MVRs: determining a second MVD based on the MVD information and the respective second MVRs of the second plurality of MVRs; determining a second MV for the respective second MVRs of the second plurality of MVRs based on the second MVD; Further comprising: The step of determining the TM cost comprises: For each of said MVR pairs, determining a first reference block in the first reference picture, wherein the first MV for the first MVR of each of the MVR pairs points from the current block to the first reference block; determining a second reference block in the second reference picture, wherein the second MV for the second MVR of each of the MVR pairs points from the current block to the second reference block; determining a TM cost based on a current template of the current block, a first reference template of the first reference block, and a second reference template of the second reference block; 6. The method of claim 5, comprising:
10. An apparatus for video decoding configured to perform a method according to any one of claims 1 to 9.
11. A computer program configured to cause a computer to carry out the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Video signal processing method and apparatus using adaptive motion vector resolution
US20210112268A1