CN114503596A - Interaction between motion vector refinement and other coding and decoding tools - Google Patents

Interaction between motion vector refinement and other coding and decoding tools Download PDF

Info

Publication number
CN114503596A
CN114503596A CN202080041806.9A CN202080041806A CN114503596A CN 114503596 A CN114503596 A CN 114503596A CN 202080041806 A CN202080041806 A CN 202080041806A CN 114503596 A CN114503596 A CN 114503596A
Authority
CN
China
Prior art keywords
block
video
codec
prediction
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202080041806.9A
Other languages
Chinese (zh)
Other versions
CN114503596B (en
Inventor
张凯
张莉
刘鸿彬
王悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
ByteDance Inc
Original Assignee
Beijing ByteDance Network Technology Co Ltd
ByteDance Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd, ByteDance Inc filed Critical Beijing ByteDance Network Technology Co Ltd
Publication of CN114503596A publication Critical patent/CN114503596A/en
Application granted granted Critical
Publication of CN114503596B publication Critical patent/CN114503596B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/583Motion compensation with overlapping blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

An apparatus, system, and method for digital video processing are described. An exemplary method for video processing includes making a first determination as to a codec mode for representing a current video block of a video in a codec representation of the video; based on the first determination, making a second determination as to whether to apply a deblocking filter; and performing a transformation between the current video block and the codec representation based on the first determination and the second determination, wherein the codec mode uses an affine codec tool and a particular motion prediction/compensation tool for the transformation.

Description

Interaction between motion vector refinement and other coding and decoding tools
Cross Reference to Related Applications
The present application aims to claim in time the priority and benefit of international patent application No. PCT/CN2019/090201 filed on 6/5 th in 2019, international patent application No. PCT/CN2019/094767 filed on 7/4 th in 2019, and international patent application No. PCT/CN2019/096180 filed on 7/16 th in 2019, according to applicable patent laws and/or rules according to paris convention. The entire disclosure of the foregoing application is incorporated by reference as part of the disclosure of this application for all purposes in accordance with law.
Technical Field
This patent document relates to video processing techniques, devices, and systems.
Background
Despite advances in video compression technology, digital video still occupies the greatest bandwidth usage on the internet and other digital communication networks. As the number of networked user devices capable of receiving and displaying video increases, the demand for bandwidth for digital video usage is expected to continue to grow.
Disclosure of Invention
Apparatus, systems, and methods related to digital video processing, for example, to predictive Refinement with Optical Flow (PROF) for video codec. The described methods may be applied to existing Video codec standards (e.g., High Efficiency Video Coding (HEVC)) and future Video codec standards or Video codecs.
In one representative aspect, the disclosed technology can be used to provide a method for video processing. The method includes making a first determination as to a codec mode for representing a current video block of the video in a codec representation of the video; based on the first determination, making a second determination as to whether to apply a deblocking filter; and performing a transformation between the current video block and the codec representation based on the first determination and the second determination, wherein the codec mode uses an affine codec tool and a particular motion prediction/compensation tool for the transformation.
In another representative aspect, the disclosed technology can be used to provide a method for video processing. The method includes determining to enable use of a switchable interpolation filter tool due to use of a particular motion vector precision in an affine codec tool for representing a current video block of a video in a codec representation of the video; and performing a conversion based on the determination, wherein the switchable interpolation filter tool allows switching for the current video block to another interpolation filter that is different from the interpolation filter used to process the previous video block.
In yet another representative aspect, the disclosed technology can be used to provide a method for video processing. The method comprises, for a current video block of a video comprising one or more video blocks, making a decision regarding applicability of bi-directional optical flow (BDOF) and/or motion information to use Predictive Refined Optical Flow (PROF) that refines optical flow of the current video block based on use of a switchable interpolation filter tool that allows the current video block and another video block to use different interpolation filters for determining a prediction block; and based on the decision, performing a conversion between the video and a codec representation of the video.
In yet another representative aspect, the disclosed technology can be used to provide a method for video processing. The method includes performing a transformation between a video block of a video region of the video and a codec representation of the video according to a rule, wherein the rule specifies that a first syntax element is included in the codec representation at a level of the video region corresponding to applicability of a codec-based tool or a decoder-side motion vector refinement tool for optical flow models, and wherein the transformation is performed according to a value of the first syntax element.
In yet another representative aspect, the above-described methods are embodied in the form of processor executable code and stored in a computer readable program medium.
In yet another representative aspect, an apparatus configured or operable to perform the above-described method is disclosed. The apparatus may include a processor programmed to implement the method.
In yet another representative aspect, a video decoder device may implement a method as described herein.
The above and other aspects and features of the disclosed technology are described in more detail in the accompanying drawings, the description and the claims.
Drawings
Fig. 1 shows an example of building a Merge candidate list.
Fig. 2 shows an example of the positions of spatial domain candidates.
Fig. 3 shows an example of a candidate pair on which redundancy checking of the spatial domain Merge candidate is performed.
Fig. 4A and 4B illustrate examples of a location of a second Prediction Unit (PU) based on a size and a shape of a current block.
Fig. 5 shows an example of motion vector scaling for temporal domain Merge candidates.
Fig. 6 shows an example of candidate positions of the time-domain Merge candidate.
Fig. 7 shows an example of generating combined bidirectional predictive Merge candidates.
Fig. 8 shows an example of constructing a motion vector prediction candidate.
Fig. 9 shows an example of motion vector scaling for spatial motion vector candidates.
Fig. 10 illustrates an example of Motion Prediction using an optional Temporal Motion Vector Prediction (ATMVP) algorithm for a Coding Unit (CU).
Fig. 11 shows an example of a Coding Unit (CU) having sub-blocks and neighboring blocks used by a Spatial-Temporal Motion Vector Prediction (STMVP) algorithm.
Fig. 12A and 12B show example snapshots (snapshots) of sub-blocks when using an Overlapped Block Motion Compensation (OBMC) algorithm.
Fig. 13 shows an example of neighboring spots used to derive parameters for a Local Illumination Compensation (LIC) algorithm.
FIG. 14 shows an example of a simplified affine motion model.
Fig. 15 shows an example of an affine Motion Vector Field (MVF) of each sub-block.
Fig. 16 shows an example of Motion Vector Prediction (MVP) for the AF _ INTER affine motion mode.
Fig. 17A and 17B show example candidates of the AF _ MERGE affine motion mode.
Fig. 18 shows an example of bilateral matching in a motion vector derivation (PMMVD) mode of pattern matching, which is a special Merge mode based on a Frame Rate Up Conversion (FRUC) algorithm.
Fig. 19 shows an example of template matching in the FRUC algorithm.
Fig. 20 shows an example of unilateral motion estimation in the FRUC algorithm.
FIG. 21 shows an example of an optical flow trace used by a bi-directional optical flow (BIO) algorithm.
FIGS. 22A and 22B show example snapshots using a bi-directional optical flow (BIO) algorithm without block expansion.
Fig. 23 shows an example of interpolated samples used in BIO.
Fig. 24 shows an example of a decoder-side motion vector refinement (DMVR) algorithm based on double-sided template matching.
Fig. 25 shows an example of the subblock MV VSB and the pixel Δ v (i, j).
Fig. 26 shows an example of phase change horizontal filtering.
Fig. 27 shows an example of applying 8-tap horizontal filtering.
Fig. 28 shows an example of non-uniform phase vertical filtering.
Fig. 29A-29D show a flow diagram of an example method for video processing.
Fig. 30A and 30B are block diagrams of examples of hardware platforms for implementing the visual media decoding or visual media encoding techniques described in this document.
Fig. 31 shows an example of 16 4 × 4 sub-blocks in a 16 × 16 region.
Detailed Description
Due to the increasing demand for higher resolution video, video processing methods and techniques are ubiquitous in modern technology. Video codecs typically include electronic circuits or software that compress or decompress digital video, and are continually being improved to provide higher codec efficiency. Video codecs convert uncompressed video into a compressed format and vice versa. There is a complex relationship between video quality, the amount of data used to represent the video (determined by the bit rate), the complexity of the encoding and decoding algorithms, the susceptibility to data loss and errors, ease of editing, random access, and end-to-end delay (latency). The compression format typically conforms to a standard video compression specification, such as the High Efficiency Video Codec (HEVC) standard (also known as h.265 or MPEG-H Part 2), a to-be-completed universal video codec standard, or other current and/or future video codec standards.
Embodiments of the disclosed techniques may be applied to existing video codec standards (e.g., HEVC, h.265) and future standards to improve compression performance. Section headings are used in this document to enhance readability of the description, and do not limit the discussion or the embodiments (and/or implementations) in any way to the corresponding sections only.
Example of inter prediction in HEVC/H.265
In recent years, video codec standards have improved significantly and now provide, in part, high codec efficiency and support for higher resolution. Recent standards such as HEVC and h.265 are based on hybrid video codec structures, where temporal prediction plus transform coding is utilized.
1.1 examples of prediction modes
Each inter-predicted PU (prediction unit) has motion parameters of one or two reference picture lists. In some embodiments, the motion parameters include a motion vector and a reference picture index. In other embodiments, the use of one of the two reference picture lists may also be signaled using inter _ pred _ idc. In other embodiments, the motion vectors may be explicitly codec as deltas relative to the predictor.
When a CU is coded in skip mode, one PU is associated with the CU and has no significant residual coefficients, no motion vector delta or reference picture index to code. A Merge mode is specified whereby the motion parameters of the current PU are obtained from neighboring PUs that include spatial and temporal candidates. The Merge mode may be applied to any inter-predicted PU, not just for the skip mode. An alternative to the Merge mode is the explicit transmission of motion parameters, where the motion vectors, the corresponding reference picture index per reference picture list and the reference picture list usage are explicitly signaled per PU.
When the signaling indicates that one of the two reference picture lists is to be used, the PU is generated from one sample block. This is called "one-way prediction". Unidirectional prediction applies to both P-slices and B-slices.
When the signaling indicates that two reference picture lists are to be used, the PU is generated from two blocks of samples. This is called "bi-prediction". Bi-directional prediction only applies to B slices.
1.1.1 example of constructing candidates for Merge mode
When predicting a PU using the Merge mode, the index pointing to an entry in the Merge candidate list is parsed from the bitstream and used to retrieve motion information. The construction of this list can be summarized according to the following sequence of steps:
step 1: initial candidate derivation
Step 1.1: spatial domain candidate derivation
Step 1.2: redundancy check of spatial domain candidates
Step 1.3: time domain candidate derivation
Step 2: additional candidate insertions
Step 2.1: creating bi-directional prediction candidates
Step 2.2: inserting zero motion candidates
Figure 1 shows an example of building a Merge candidate list based on the sequence of steps summarized above. For spatial domain Merge candidate derivation, a maximum of four Merge candidates are selected from among the candidates located at five different positions. For time domain Merge candidate derivation, at most one Merge candidate is selected among the two candidates. Since the number of candidates per PU is assumed to be constant at the decoder, additional candidates are generated when the number of candidates does not reach the maximum number of Merge candidates (MaxNumMergeCand) signaled in the slice header. Since the number of candidates is constant, the index of the best target candidate is encoded using Truncated Unary binarization (TU). If the size of the CU is equal to 8, all PUs of the current CU share a single Merge candidate list, which is the same as the Merge candidate list of the 2N × 2N prediction unit.
1.1.2 construction of spatial Merge candidates
In the derivation of spatial domain Merge candidates, up to four Merge candidates are selected from among the candidates located at the positions depicted in FIG. 2. The order of derivation is A1、B1、B0、A0And B2. Only when in position A1、 B1、B0、A0Is unavailable (e.g., because it belongs to another slice or slice) or is intra-codedConsidering position B2. In position A1After the candidate of (b) is added, the addition of the remaining candidates is subjected to a redundancy check that ensures that candidates with the same motion information are excluded from the list, thereby improving the coding efficiency.
In order to reduce computational complexity, all possible candidate pairs are not considered in the mentioned redundancy check. Instead, only the pairs linked with arrows in fig. 3 are considered, and only when the candidates for redundancy check do not have the same motion information, the corresponding candidates are added to the list. Another source of repetitive motion information is the "second PU" associated with a partition other than 2 nx 2N. As an example, fig. 4A and 4B depict the second PU for the N × 2N and 2N × N cases, respectively. When the current PU is partitioned into Nx 2N, position A1The candidates of (b) are not considered for list construction. In some embodiments, adding the candidate may result in both prediction units having the same motion information, which is redundant to having only one PU in the coded unit. Similarly, when the current PU is divided into 2N, position B is not considered1
1.1.3 construction of time-domain Merge candidates
In this step, only one candidate is added to the list. In particular, in the derivation of the temporal-domain Merge candidate, the scaled motion vector is derived based on the collocated PU belonging to the picture with the smallest POC difference from the current picture within a given reference picture list. The derived reference picture list to be used for concatenating PUs is signaled explicitly in the slice header.
Fig. 5 shows an example (shown as a dashed line) of the derivation of a scaled motion vector for a temporal region Merge candidate, which is scaled from the motion vector of a collocated PU using POC distances tb and td, where tb is defined as the POC difference between the reference picture of the current picture and td is defined as the POC difference between the reference picture of the collocated picture and the collocated picture. The reference picture index of the temporal region Merge candidate is set to zero. For B slices, two motion vectors are obtained, one for reference picture list 0 and the other for reference picture list 1, and combined to form a bi-predictive Merge candidate.
As depicted in FIG. 6, in the collocated PU (Y) belonging to the reference frame, in candidate C0And C1The location of the time domain candidate is selected. If at position C0Is unavailable, intra-coded or out of the current CTU, using location C1. Otherwise, position C is used in the derivation of the time domain Merge candidate0
1.1.4 construction of additional types of Merge candidates
In addition to the space-time Merge candidates, there are two additional types of Merge candidates: a combined bi-directional predicted Merge candidate and zero Merge candidate. The combined bidirectional predictive Merge candidate is generated by using the space-time Merge candidate. The combined bi-directionally predicted Merge candidates are for B slices only. The combined bi-directional prediction candidate is generated by combining the first reference picture list motion parameters of the initial candidate with the second reference picture list motion parameters of the other. If these two tuples provide different motion hypotheses they will form new bi-directional prediction candidates.
Fig. 7 shows an example of this process, where two candidates in the original list (710, on the left) with mvL0 and refIdxL0 or mvL1 and refIdxL1 are used to create a combined bi-predictive Merge candidate that is added to the final list (720, on the right).
Zero motion candidates are inserted to fill the remaining entries in the Merge candidate list and thus reach the maxnummerge capacity. These candidates have zero spatial displacement and a reference picture index that starts from zero and is incremented each time a new zero motion candidate is added to the list. The number of reference frames that these candidates use is one for unidirectional prediction and two for bidirectional prediction, respectively. In some embodiments, no redundancy check is performed on these candidates.
1.1.5 examples of motion estimation regions for parallel processing
To speed up the encoding process, motion estimation may be performed in parallel, thereby deriving motion vectors for all prediction units within a given region simultaneously. Deriving the Merge candidate from the spatial neighborhood may interfere with parallel processing because one prediction unit cannot derive motion parameters from neighboring PUs until its associated motion estimation is completed. To mitigate the trade-off between codec efficiency and processing latency, a Motion Estimation Region (MER) may be defined. The size of the MER may be signaled in a Picture Parameter Set (PPS) using a "log 2_ parallel _ merge _ level _ minus 2" syntax element. When defining MER, the Merge candidates falling into the same region are marked as unavailable and are therefore not considered in the list construction.
1.2 example of Advanced Motion Vector Prediction (AMVP)
AMVP exploits the spatial-temporal correlation of motion vectors with neighboring PUs, which is used for explicit transmission of motion parameters. The motion vector candidate list is constructed by first checking the availability of left, upper temporal neighboring PU locations, removing redundant candidates, and adding a zero vector to make the candidate list length constant. The encoder may then select the best predictor from the candidate list and send a corresponding index indicating the selected candidate. Similar to the Merge index signaling, the index of the best motion vector candidate is encoded using a truncated unary. In this case, the maximum value to be encoded is 2 (see fig. 8). In the following sections, details regarding the derivation process of motion vector prediction candidates are provided.
1.2.1 example of constructing motion vector prediction candidates
Fig. 8 summarizes the derivation process of motion vector prediction candidates and may be implemented for each reference picture list with refidx as input.
In motion vector prediction, two types of motion vector candidates are considered: spatial motion vector candidates and temporal motion vector candidates. For spatial motion vector candidate derivation, two motion vector candidates are finally derived based on the motion vectors of each PU located at five different positions as previously shown in fig. 2.
For temporal motion vector candidate derivation, one motion vector candidate is selected from two candidates, which are derived based on two different collocated positions. After the first list of spatio-temporal candidates is generated, the repeated motion vector candidates in the list are removed. If the number of potential candidates is greater than 2, the motion vector candidate with an in-list reference picture index greater than 1 is removed from the associated reference picture list. If the number of spatial-temporal motion vector candidates is less than two, additional zero motion vector candidates are added to the list.
1.2.2 construction of spatial motion vector candidates
In the derivation of spatial motion vector candidates, a maximum of two candidates are considered among five potential candidates derived from PUs located at the positions as shown previously in fig. 2, which are the same as the position of the motion Merge. The derivation order to the left of the current PU is defined as A0、A1And scaled A0Zoom of A1. The derivation order of the upper side of the current PU is defined as B0、B1、B2Zoomed B0Zoomed B1Zoomed B2. Thus, for each side, four cases may be used as motion vector candidates, two of which do not require spatial scaling and two of which use spatial scaling. These four different cases are summarized as follows:
-no spatial domain scaling
(1) Same reference picture list and same reference picture index (same POC)
(2) Different reference picture lists but the same reference picture (same POC)
-spatial scaling
(3) Same reference picture list but different reference pictures (different POCs)
(4) Different reference Picture lists and different reference pictures (different POCs)
The case of no spatial scaling is checked first, followed by the case of allowing spatial scaling. Regardless of the reference picture list, spatial scaling is considered when POC is different between the reference picture of the neighboring PU and the reference picture of the current PU. If all PUs of the left side candidate are not available or intra coded, scaling of the upper side motion vectors is allowed to facilitate parallel derivation of left and upper side MV candidates. Otherwise, spatial scaling of the upper motion vectors is not allowed.
As shown in the example in fig. 9, for the spatial scaling case, the motion vectors of neighboring PUs are scaled in a similar manner as the temporal scaling. One difference is that the reference picture list and the index of the current PU are given as input; the actual scaling procedure is the same as that of the time domain scaling.
1.2.3 construction of temporal motion vector candidates
All processes for deriving temporal Merge candidates are the same as those for deriving spatial motion vector candidates, except for reference picture index derivation (as shown in the example of FIG. 6). In some embodiments, the reference picture index is signaled to the decoder.
2. Example of inter-frame prediction method in Joint Exploration Model (JEM)
In some embodiments, reference software called Joint Exploration Model (JEM) is used to explore future video codec techniques. In JEM, subblock-based prediction is employed in several coding and decoding tools, such as affine prediction, optional temporal Motion Vector prediction, spatial-temporal Motion Vector prediction, Bi-directional Optical flow (BIO), Frame-Rate Up Conversion (FRUC), Local Adaptive Motion Vector Resolution (LAMVR), Overlapped Block Motion Compensation (OBMC), Local Illumination Compensation (LIC), and Decoder-side Motion Vector Refinement (DMVR).
2.1 example of sub-CU-based motion vector prediction
In a JEM with a quadtree plus Binary tree (QTBT), each CU may have at most one motion parameter set for each prediction direction. In some embodiments, two sub-CU level motion vector prediction methods are considered in the encoder by dividing the large CU into sub-CUs and deriving motion information for all sub-CUs of the large CU. An Alternative Temporal Motion Vector Prediction (ATMVP) method allows each CU to obtain multiple sets of motion information from multiple blocks smaller than the current CU in the collocated reference picture. In the spatial-temporal motion vector prediction (STMVP) method, a motion vector of a sub-CU is recursively derived by using a temporal motion vector predictor and a spatial neighboring motion vector. In some embodiments, in order to preserve more accurate motion fields for sub-CU motion prediction, motion compression of the reference frame may be disabled.
2.1.1 example of optional temporal motion vector prediction (ATMVP)
Among the ATMVP methods, the Temporal Motion Vector Prediction (TMVP) method is modified by acquiring a plurality of sets of motion information (including motion vectors and reference indices) from blocks smaller than the current CU.
Fig. 10 shows an example of the ATMVP motion prediction process for CU 1000. The ATMVP method predicts the motion vector of sub-CU 1001 within CU 1000 in two steps. The first step is to identify the corresponding block 1051 in the reference picture 1050 with a time domain vector. The reference picture 1050 is also referred to as a motion source picture. The second step is to divide the current CU 1000 into sub-CUs 1001 and obtain the motion vector and reference index of each sub-CU from the block corresponding to each sub-CU.
In a first step, the reference picture 1050 and the corresponding block are determined by the motion information of the spatial neighboring blocks of the current CU 1000. To avoid the repeated scanning process of neighboring blocks, the first Merge candidate in the Merge candidate list of the current CU 1000 is used. The first available motion vector and its associated reference index are set to the temporal vector and index of the motion source picture. In this way, the corresponding block can be identified more accurately than the TMVP, where the corresponding block (sometimes referred to as a collocated block) is always in the lower right or center position relative to the current CU.
In a second step, the corresponding block of the sub-CU 1051 is identified by the temporal vector in the motion source picture 1050 by adding the temporal vector to the coordinates of the current CU. For each sub-CU, the motion information of its corresponding block (e.g., the minimum motion grid covering the center sample point) is used to derive the motion information of the sub-CU. After the motion information of the corresponding nxn block is identified, it is converted into a motion vector and reference index of the current sub-CU in the same way as the TMVP of HEVC, where motion scaling and other procedures are applied. For example, the decoder checks whether a low delay condition is met (e.g., POC of all reference pictures of the current picture is less than POC of the current picture), and motion vector MVy for each sub-CU may be predicted using motion vector MVx (e.g., a motion vector corresponding to reference picture list X) (e.g., where X is equal to 0 or1, and Y is equal to 1-X).
2.1.2 example of spatial motion vector prediction (STMVP)
In the STMVP method, the motion vectors of sub-CUs are recursively derived in raster scan order. Fig. 11 shows an example of one CU and neighboring blocks having four sub-blocks. Consider an 8 × 8CU 1100, which includes four 4 × 4 sub-CUs a (1101), B (1102), C (1103), and D (1104). The neighboring 4 x 4 blocks in the current frame are labeled a (1111), b (1112), c (1113), and d (1114).
The motion derivation of sub-CU a begins by identifying its two spatial neighbors. The first neighbor is an N × N block on the upper side of sub-CU a1101 (block c 1113). If this block c (1113) is not available or intra coded, the other nxn blocks on the upper side of the sub-CU a (1101) are checked (from left to right, starting at block c 1113). The second neighbor is the block to the left of sub-CU a1101 (block b 1112). If block b (1112) is not available or intra-coded, the other blocks to the left of sub-CU a1101 are checked (from top to bottom, starting at block b 1112). The motion information obtained from the neighboring blocks of each list is scaled to the first reference frame of the given list. Next, the Temporal Motion Vector Predictor (TMVP) of sub-block a1101 is derived by following the same procedure as the TMVP derivation specified in HEVC. The motion information of the collocated block at block D1104 is obtained and scaled accordingly. Finally, after retrieving and scaling the motion information, all available motion vectors are averaged separately for each reference list. The average motion vector is specified as the motion vector of the current sub-CU.
2.1.3 example of sub-CU motion prediction mode signaling
In some embodiments, the sub-CU modes are enabled as additional Merge candidates, and no additional syntax elements are needed to signal these modes. Two additional Merge candidates are added to the Merge candidate list of each CU to represent ATMVP mode and STMVP mode. In other embodiments, up to seven large candidates may be used if the sequence parameter set indicates ATMVP and STMVP are enabled. The coding logic of the additional Merge candidates is the same as the coding logic of the Merge candidates in the HM, which means that two additional Merge candidates may also require two RD checks for each CU in a P-slice or a B-slice. In some embodiments, such as JEM, all bins (bins) of the target index are Context coded by CABAC (Context-based Adaptive Binary Arithmetic Coding). In other embodiments, such as HEVC, only the first bin is context coded and the remaining bins are context bypass coded.
2.2 example of adaptive motion vector difference resolution
In some embodiments, when use _ integer _ mv _ flag is equal to 0 in the slice header, a Motion Vector Difference (MVD) (between the Motion Vector of the PU and the predicted Motion Vector) is signaled in units of quarter (predictor) luma samples. In JEM, a locally adaptive motion vector resolution (lamfr) is introduced. In the JEM, the MVD may be coded in units of quarter luminance samples, integer luminance samples, or four luminance samples. The MVD resolution is controlled at the Codec Unit (CU) level, and the MVD resolution flag is conditionally signaled for each CU having at least one non-zero MVD component.
For a CU with at least one non-zero MVD component, a first flag is signaled to indicate whether quarter luma sample MV precision is used in the CU. When the first flag (equal to 1) indicates that quarter-luma sample MV precision is not used, another flag is signaled to indicate whether integer-luma sample MV precision or four-luma sample MV precision is used.
The quarter-luma sample MV resolution is used for a CU when the first MVD resolution flag of the CU is zero or is not coded for the CU (meaning all MVDs in the CU are zero). When a CU uses integer luma sample MV precision or four luma sample MV precision, the MVP in the CU's AMVP candidate list is rounded to the corresponding precision.
In the encoder, RD checking at the CU level is used to determine which MVD resolution is to be used for the CU. That is, RD checking at the CU level is performed three times for each MVD resolution. To speed up the encoder speed, the following encoding scheme is applied in JEM:
-storing motion information of the current CU (integer luminance sample accuracy) during RD checking of CUs with normal quarter-luminance sample MVD resolution. The stored motion information (after rounding) is used as a starting point for further small-range motion vector refinement during RD-checking for the same CU with integer luma samples and 4 luma sample MVD resolution, so that the time-consuming motion estimation process is not repeated three times.
-conditionally invoking the RD check of CUs with 4 luma samples MVD resolution. For a CU, when the RD cost of the integer-luma sample MVD resolution is much greater than the RD cost of the quarter-luma sample MVD resolution, the RD check for the 4-luma sample MVD resolution of the CU is skipped.
2.3 example of higher motion vector storage precision
In HEVC, the motion vector precision is one-quarter pixel (for 4:2:0 video, one-quarter luma samples and one-eighth chroma samples). In JEM, the accuracy of the internal motion vector storage and the Merge candidate is increased to 1/16 pixels. The higher motion vector precision (1/16 pixels) is used for motion compensated inter prediction of CUs coded with skip/Merge mode. For CUs coded with normal AMVP mode, integer-pixel or quarter-pixel motion is used.
An SHVC upsampling interpolation filter with the same filter length and normalization factor as the HEVC motion compensated interpolation filter is used as the motion compensated interpolation filter for the additional fractional pixel positions. The chroma component motion vector precision is 1/32 samples in JEM, and an additional interpolation filter for the fractional position of 1/32 pixels is derived by using the average of the filters for the two adjacent fractional positions of 1/16 pixels.
2.4 example of Overlapped Block Motion Compensation (OBMC)
In JEM, the OBMC can be turned on and off using CU-level syntax. When OBMC is used in JEM, OBMC is performed for all Motion Compensation (MC) block boundaries except for the right and lower boundaries of the CU. Furthermore, it is applied to the luminance and chrominance components. In JEM, the MC block corresponds to a codec block. When a CU is coded in sub-CU modes, including sub-CU Merge, affine, and FRUC (frame rate up conversion) modes, each sub-block of the CU is an MC block. To handle CU boundaries in a uniform manner, OBMC is performed for all MC block boundaries at the sub-block level, with the sub-block size set equal to 4 × 4, as shown in fig. 12A and 12B.
Fig. 12A shows sub-blocks at the CU/PU boundary, and the hatched sub-blocks are where OBMC is applied. Similarly, fig. 12B shows the subblocks in ATMVP mode.
When OBMC is applied to the current sub-block, in addition to the current motion vector, the motion vectors of the four connected neighboring sub-blocks (if available and not identical to the current motion vector) are used to derive a prediction block for the current sub-block. These multiple prediction blocks based on multiple motion vectors are combined to generate a final prediction signal for the current sub-block.
The prediction block based on the motion vectors of neighboring sub-blocks is denoted as PNWhere N denotes an index for adjacent upper, lower, left and right sub-blocks, and a prediction block based on a motion vector of a current sub-block is denoted as PC. When P is presentNOBMC is not from P when based on motion information that contains the same motion information of neighboring sub-blocks as the current sub-blockNAnd (4) executing. Otherwise, P is addedNIs added to PCIn the same spot as in (1), i.e. PNIs added to PCIn (1). Weighting factors {1/4,1/8,1/16,1/32} for PNAnd weighting factors {5/16,31/32} for PC. The exception is small MC blocks (i.e. when the height or width of a codec block is equal to 4 or a CU is codec in sub-CU mode), for such blocks only PNIs added to PCIn (1). In this case, the weighting factors {1/4,1/8} are used for PNAnd weighting factors {3/4,7/8} for PC. P generated for motion vector based on vertical (horizontal) neighboring sub-blocksNA1 is to PNWith the same weighting factor for samples in the same row (column)Adding to PC
In JEM, for CUs with a size less than or equal to 256 luma samples, a CU level flag is signaled to indicate whether OBMC is applied for the current CU. For CUs with a size larger than 256 luma samples or not coded with AMVP mode, OBMC is applied by default. At the encoder, when OBMC is applied to a CU, its impact is taken into account during the motion estimation phase. The prediction signal formed by OBMC using the motion information of the upper and left neighboring blocks is used to compensate the upper and left boundaries of the original signal of the current CU, and then the normal motion estimation procedure is applied.
2.5 example of Local Illumination Compensation (LIC)
The LIC uses a scaling factor a and an offset b based on a linear model of the illumination variation. And adaptively enables or disables each inter mode Codec Unit (CU).
When LIC is applied to a CU, a least squares error method is employed to derive the parameters a and b by using neighboring samples of the current CU and their corresponding reference samples. Fig. 13 is an example showing neighboring samples used to derive parameters of an IC algorithm. Specifically, and as shown in fig. 13, sub-sampling (2:1 sub-sampling) of a CU in a reference picture is used for neighboring samples and corresponding samples (identified by motion information of the current CU or sub-CU). IC parameters are derived and applied to each prediction direction separately.
When a CU is coded in the Merge mode, copying LIC flags from neighboring blocks in a manner similar to the motion information copy in the Merge mode; otherwise, signaling a LIC flag for the CU to indicate whether the LIC is applicable.
When LIC is enabled for a picture, an additional CU level RD check is needed to determine whether LIC is applied to a CU. When LIC is enabled for a CU, the Mean-Removed Sum of Absolute differences (MR-SAD) and the Mean-Removed Sum of Absolute Hadamard (Hadamard) Transformed differences (MR-SATD) (instead of SAD and SATD) are used for integer-pel motion search and fractional-pel motion search, respectively.
To reduce the coding complexity, the following coding scheme is applied in JEM:
-when there is no significant illumination change between the current picture and its reference picture, LIC is disabled for the whole picture. To identify this situation, a histogram of the current picture and each reference picture of the current picture is computed at the encoder. Disabling LIC for the current picture if the histogram difference between the current picture and each reference picture of the current picture is less than a given threshold; otherwise, LIC is enabled for the current picture.
Example of 2.6 affine motion compensated prediction
In HEVC, only the translational Motion model is applied to Motion Compensation Prediction (MCP). However, the camera and the object may have many kinds of motion, such as zoom in/out, rotation, perspective motion, and/or other irregular motion. JEM, on the other hand, applies a simplified affine transform motion compensated prediction. FIG. 14 shows a motion vector V from two control points0And V1An example of an affine motion field of block 1400 is described. The Motion Vector Field (MVF) of block 1400 can be described by the following equation:
Figure BDA0003394343540000141
as shown in FIG. 14, (v)0x,v0y) Is the motion vector of the upper left corner control point, and (v)1x,v1y) Is the motion vector of the upper right hand corner control point. To simplify motion compensated prediction, sub-block based affine transform prediction may be applied. The subblock size M × N is derived as follows:
Figure BDA0003394343540000142
here, MvPre is the motion vector fractional precision (e.g., 1/16 in JEM), (v)2x,v2y) Is the motion vector of the lower left control point calculated according to equation (1). If desired, M and N can be adjusted downward to be the cause of w and h, respectivelyNumber (divsor).
Fig. 15 shows an example of affine MVF for each sub-block of the block 1500. To derive the motion vector for each M × N sub-block, the motion vector for the center sample of each sub-block may be calculated according to equation (1) and rounded to motion vector fractional precision (e.g., 1/16 in JEM). A motion compensated interpolation filter may then be applied to generate a prediction for each sub-block using the derived motion vectors. After MCP, the high precision motion vector of each sub-block is rounded and saved to the same precision as the normal motion vector.
2.6.1 example of AF _ INTER mode
In JEM, there are two affine motion patterns: AF _ INTER mode and AF _ MERGE mode. For CUs with a width and height larger than 8, the AF _ INTER mode may be applied. An affine flag at the CU level is signaled in the bitstream to indicate whether AF _ INTER mode is used. In AF _ INTER mode, neighboring blocks are used to construct a block with a motion vector pair { (v)0,v1)|v0={vA,vB,vc},v1={vD,vE} of the candidate list.
Fig. 16 shows an example of Motion Vector Prediction (MVP) of a block 1600 in AF _ INTER mode. As shown in FIG. 16, v is selected from the motion vectors of sub-block A, block B, or block C0. The motion vectors from neighboring blocks may be scaled according to the reference list. The motion vector may also be scaled according to a relationship between a Picture Order Count (POC) of a reference of the neighboring block, the POC of the reference of the current CU, and the POC of the current CU. And selecting v from neighboring sub-blocks D and E1The method of (3) is similar. If the number of candidate lists is less than 2, the list is populated by pairs of motion vectors that are composed by copying each AMVP candidate. When the candidate list is greater than 2, the candidates may first be ordered according to neighboring motion vectors (e.g., based on similarity of two motion vectors in a pair of candidates). In some embodiments, the first two candidates are retained. In some embodiments, a rate-distortion (RD) cost check is used to determine which Motion Vector pair is selected as a candidate for Control Point Motion Vector predictor (Control Point Motion Vector P) for the current CUreproduction, CPMVP). An index indicating the location of the CPMVP in the candidate list may be signaled in the bitstream. After determining the CPMVP of the current affine CU, affine Motion estimation is applied and a Control Point Motion Vector (CPMV) is found. Then, the difference of CPMV and CPMVP is signaled in the bitstream.
Example of AF _ MERGE mode
When a CU is applied in AF _ MERGE mode, it gets the first block coded in affine mode from the valid neighboring reconstructed blocks. Fig. 17A shows an example of the selection order of candidate blocks of the current CU 1700. As shown in fig. 17A, the selection order may be from left (1701), top (1702), top right (1703), bottom left (1704), to top left (1705) of the current CU 1700. Fig. 17B shows another example of candidate blocks of the current CU 1700 in the AF _ MERGE mode. If the adjacent bottom-left block 1801 is coded in affine mode, as shown in fig. 17B, the motion vectors v of the upper-left, upper-right, and lower-left corners of the CU containing the sub-block 17012、v3And v4Is derived. Calculating a motion vector v of the upper left corner on the current CU 1700 based on v2, v3, and v40. The motion vector v1 at the top right of the current CU may be calculated accordingly.
After calculating CPMV v0 and v1 of the current CU according to the affine motion model in equation (1), the MVF of the current CU may be generated. To identify whether the current CU is codec in AF _ MERGE mode, an affine flag is signaled in the bitstream when there is at least one neighboring block codec in affine mode.
2.7 example of motion vector derivation by Pattern matching (PMMVD)
The PMMVD mode is a special Merge mode based on a Frame Rate Up Conversion (FRUC) method. With this mode, motion information of a block is derived at the decoder side, rather than signaling motion information of the block.
When the Merge flag of a CU is true, a FRUC flag may be signaled for the CU. When the FRUC flag is false, the Merge index may be signaled and the normal Merge mode is used. When the FRUC flag is true, an additional FRUC mode flag may be signaled to indicate which method (e.g., bilateral matching or template matching) will be used to derive the motion information for the block.
At the encoder side, the decision on whether to use FRUC Merge mode for a CU is based on the RD cost selection made for the normal Merge candidate. For example, a variety of matching patterns (e.g., bilateral matching and template matching) are checked against the CU by using RD cost selection. The matching pattern that results in the least cost is further compared to other CU patterns. If the FRUC matching pattern is the most efficient pattern, the FRUC flag is set to true for the CU and the associated matching pattern is used.
In general, the motion derivation process in FRUC Merge mode has two steps: CU-level motion search is performed first, followed by sub-CU-level motion refinement. At the CU level, an initial motion vector for the entire CU is derived based on bilateral matching or template matching. First, a list of MV candidates is generated and the candidate that results in the smallest matching cost is selected as the starting point for further CU-level refinement. Then, a local search based on bilateral matching or template matching is performed near the start point. And taking the MV result of the minimum matching cost as the MV of the whole CU. The motion information is then further refined at the sub-CU level, with the derived CU motion vector as a starting point.
For example, the following derivation process is performed for W × H CU motion information derivation. In the first stage, the MVs of the entire W × H CU are derived. In the second stage, the CU is further divided into M × M sub-CUs. The value of M is calculated as in equation (3), D is a predefined division depth, and is set to 3 by default in JEM. The MV of each sub-CU is then derived.
Figure BDA0003394343540000161
Fig. 18 shows an example of bilateral matching used in a Frame Rate Up Conversion (FRUC) method. Motion information of a current CU is derived using bilateral matching by finding a closest match between two blocks along a motion trajectory of the current CU (1800) in two different reference pictures (1810, 1811). Under the assumption of a continuous motion trajectory, the motion vectors MV0(1801) and MV1 (1802) pointing to the two reference blocks are proportional to the temporal distance between the current picture and the two reference pictures (e.g., TD0(1803) and TD1 (1804)). In some embodiments, bilateral matching becomes a mirror-based bi-directional MV when the current picture 1800 is temporally between two reference pictures (1810, 1811) and the temporal distance from the current picture to the two reference pictures is the same.
Fig. 19 shows an example of template matching used in a Frame Rate Up Conversion (FRUC) method. Template matching may be used to derive motion information for the current CU 1900 by finding a closest match between a template (e.g., top and/or left neighboring blocks of the current CU) in the current picture and a block (of the same size as the template) in the reference picture 1910. Template matching may also be applied to AMVP mode in addition to FRUC Merge mode described above. In JEM and HEVC, AMVP has two candidates. New candidates can be derived using a template matching method. If the newly derived candidate from template matching is different from the first existing AMVP candidate, it is inserted at the very beginning of the AMVP candidate list, and then the list size is set to 2 (e.g., by removing the second existing AMVP candidate). When applied to AMVP mode, only CU level search is applied. The CU level MV candidate sets may include the following: (1) the original AMVP candidate if the current CU is in AMVP mode, (2) all Merge candidates, (3) a few MVs in the interpolated MV field (described later), and top and left neighboring motion vectors.
When using bilateral matching, each valid MV of the Merge candidate is used as an input to generate a MV pair assuming bilateral matching. For example, in reference list a, one valid MV of the Merge candidate is (MVa, refa). Then, the reference picture refb of its paired bilateral MV is found in the other reference list B, so that refa and refb are located on different sides of the current picture in the time domain. If such refb is not available in reference list B, refb is determined to be a different reference from refa and its temporal distance to the current picture is the minimum in list B. After refb is determined, MVb is derived by scaling MVa based on the temporal distance between the current picture refa and refb.
In some embodiments, four MVs from the interpolated MV field may also be added to the CU level candidate list. More specifically, interpolation MVs at positions (0,0), (W/2,0), (0, H/2), and (W/2, H/2) of the current CU are added. When FRUC is applied in AMVP mode, the original AMVP candidate is also added to the CU level MV candidate set. In some implementations, at the CU level, 15 MVs may be added to the candidate list for AMVP CUs and 13 MVs may be added to the candidate list for Merge CUs.
The MV candidate sets at the sub-CU level include: (1) the MVs determined from the CU level search, (2) top, left side, top left and top right neighboring MVs, (3) scaled versions of collocated MVs from the reference picture, (4) one or more ATMVP candidates (e.g., up to four), and (5) one or more STMVP candidates (e.g., up to four). The scaled MV from the reference picture is derived as follows. Reference pictures in both lists are traversed. The MVs at the collocated positions of the sub-CUs in the reference picture are scaled to the reference of the starting CU level MV. The ATMVP and STMVP candidates may be the first four. At the sub-CU level, one or more MVs (e.g., up to 17) are added to the candidate list.
Generation of interpolated MV fields.Before encoding and decoding the frame, an interpolation motion field is generated for the whole picture based on the unilateral ME. The motion field may then be used later as a CU level or sub-CU level MV candidate.
In some implementations, the motion field of each reference picture in the two reference lists is traversed at the 4 x 4 block level. Fig. 20 shows an example of unilateral Motion Estimation (ME)2000 in the FRUC method. For each 4 x 4 block, if the motion associated with the block passes through a 4 x 4 block in the current picture and the block is not assigned any interpolated motion, the motion of the reference block is scaled to the current picture according to temporal distances TD0 and TD1 (in the same way as MV scaling of TMVP in HEVC) and the scaled motion is assigned to the block in the current frame. If no scaled MV are assigned to a 4 x 4 block, the motion of the block is marked as unavailable in the interpolated motion field.
Interpolation and matching costs.When the motion vector points to a fractional sample position, motion compensated interpolation is required. To reduce complexity, generationsInstead of the conventional 8-tap HEVC interpolation, bilinear interpolation may be used for both edge matching and template matching.
The computation of the matching cost is somewhat different at different steps. When selecting candidates from the CU-level candidate set, the matching cost may be the Absolute Sum Difference (SAD) of the bilateral matching or the template matching. After determining the starting MV, the matching cost C of the bilateral matching for the sub-CU level search is calculated as follows:
Figure BDA0003394343540000181
here, w is a weighting factor. In some embodiments, w may be empirically set to 4. MV and MVsIndicating the current MV and the starting MV, respectively. SAD may still be used as the matching cost for template matching for sub-CU level search.
In FRUC mode, the MV is derived by using only the luminance samples. The derived motion will be used for both luma and chroma for MC inter prediction. After the MV is determined, the final MC is performed using an 8-tap interpolation filter for luminance and a 4-tap interpolation filter for chrominance.
MV refinement is a pattern-based MV search, with a bilateral matching cost or template matching cost as criteria. In JEM, two Search modes are supported-the unconstrained centered-Biased Diamond Search (UCBDS) and the adaptive Cross Search, with MV refinement at the CU level and sub-CU level, respectively. For both CU and sub-CU level MV refinement, the MV is searched directly with quarter luma sample MV precision, and then one-eighth luma sample MV refinement. The search range for MV refinement for the CU and sub-CU step is set equal to 8 luma samples.
In the bilateral matching Merge mode, bi-prediction is applied, because the motion information of a CU is derived based on the closest match between two blocks along the motion trajectory of the current CU in two different reference pictures. In the template matching Merge mode, the encoder may select among unidirectional prediction according to List 0, unidirectional prediction according to List 1, or bidirectional prediction for a CU. The selection may be based on the template matching cost as follows:
if costBi & gt factor & ltmin (cost0, cost1)
Then bi-directional prediction is used;
otherwise, if cost0< ═ cost1
Then the one-way prediction in list 0 is used;
if not, then,
using the unidirectional prediction in table 1;
here, cost0 is the SAD for the list 0 template match, cost1 is the SAD for the list 1 template match, and cost bi is the SAD for the bi-prediction template match. For example, when the value of the factor is equal to 1.25, this means that the selection process is biased towards bi-directional prediction. Inter prediction direction selection may be applied to the CU level template matching process.
2.8 examples of generalized Bi-prediction improvement (GBi)
The generalized bidirectional prediction improvement (GBi) proposed in JFET-L0646 was adopted in VTM-3.0. In bi-directional prediction mode, GBi applies unequal weights to the predicted values from L0 and L1. In the inter-prediction mode, a plurality of weight pairs including equal weight pairs (1/2 ) are evaluated based on Rate-Distortion Optimization (RDO), and GBi indexes of the selected weight pairs are signaled to a decoder. In Merge mode, the GBi index inherits from the neighboring CU. The predicted value generation formula is shown in equation (5).
PGBi=(w0×PL0+w1×PL1+RoundingOffset)>>shiftNumGBiEquation (5)
In this context, PGBiIs the final predicted value of GBi, w0And w1Are predicted values (P) applied to List 0(L0) and List 1(L1), respectivelyL0And PL1) The selected GBi weight. roundingOffsetGBiAnd shiftNumGBiFor normalizing the final predicted values in GBi. Supported w1The set of weights is { -1/4,3/8, 1/2,5/8,5/4}, where five weights correspond to one equal weight pair and four unequal weight pairs. Hybrid gain, i.e. w1And w0The sum is fixed to 1.0. Therefore, the temperature of the molten metal is controlled,corresponding to w0The weight set is {5/4,5/8, 1/2,3/8, -1/4 }. The weight pair selection is at the CU level.
For non-low delay pictures, the weight set size is reduced from 5 to 3, where w1The set of weights is {3/8,1/2, 5/8}, and w0The set of weights is {5/8,1/2,3/8 }. The weight set size reduction of non-low delay pictures is applied to BMS2.1 GBi and all GBi tests in this manuscript.
2.8.1 GBi encoder error repair
To reduce GBi encoding time, in the current encoder design, the encoder will store the uni-directional prediction motion vector estimated from the GBi weight equal to 4/8 and reuse it for uni-directional prediction search of other GBi weights. The fast encoding method is applied to translational motion models and affine motion models. In VTM2.0, a 6-parameter affine model and a 4-parameter affine model are employed. When the GBi weight is equal to 4/8, the BMS2.1 encoder does not distinguish between the 4-parameter affine model and the 6-parameter affine model when storing the uni-predictive affine MV. Thus, after encoding with GBi weights 4/8, the 4-parameter affine MV may be overlaid by the 6-parameter affine MV. The stored 6-parameter affine MV can be used for 4-parameter affine MVs of other GBi weights, or the stored 4-parameter affine MV can be used for the 6-parameter affine MV. The proposed GBi encoder error repair is to separate the 4-parameter and 6-parameter affine MV storage. When the GBi weights are equal to 4/8, the encoder stores those affine MVs based on the affine model types and reuses the corresponding affine MVs based on the affine model types to the other GBi weights.
2.8.2 GBi encoder acceleration
In this prior embodiment, five encoder acceleration methods are proposed to reduce the encoding time when GBi is enabled.
(1) Affine motion estimation with conditional skipping of some GBi weights
In BMS2.1, affine ME including 4-parameter and 6-parameter affine ME is performed for all GBi weights. It is proposed to conditionally skip affine ME for those unequal GBi weights (weights not equal to 4/8). Specifically, affine ME will be performed on the other GBi weights if and only if affine mode is selected as the current best mode and it is not affine Merge mode after evaluation 4/8 of GBi weights. If the current picture is a non-low delay picture, bi-predictive motion estimation of the translation model will be skipped for unequal GBi weights when performing affine motion estimation. If the affine mode is not selected as the current best mode, or if the affine Merge is selected as the current best mode, then for all other GBi weights, the affine ME will be skipped.
(2) Reducing the number of weights for RD cost checking of low delay pictures in coding of 1-pixel and 4-pixel MVD precision
For low-delay pictures, there are five weights for RD cost check for all MVD precision including 1/4 pixels, 1 pixel, and 4 pixels. The encoder will first check the RD cost of the MVD precision of 1/4 pixels. It is proposed to skip part of the GBi weights of the RD cost check for 1-pixel and 4-pixel MVD accuracy. The unequal weights are ordered according to their RD cost of 1/4 pixel MVD precision. During encoding of 1-pixel and 4-pixel MVD precision, only the first two weights with the smallest RD cost and GBi weights 4/8 will be evaluated. Therefore, for 1-pixel and 4-pixel MVD precision of low-delay pictures, a maximum of three weights will be evaluated.
(3) Conditionally skipping bi-prediction search when L0 and L1 refer to the same picture
For some pictures in the RA, the same picture may appear in both reference picture lists (list 0 and list 1). For example, for a random access codec configuration in CTC, the reference picture structure of a first group of pictures (GOP) is listed below.
POC:16,TL:0,[L0:0][L1:0]
POC:8,TL:1,[L0:0 16][L1:16 0]
POC:4,TL:2,[L0:0 8][L1:8 16]
POC:2,TL:3,[L0:0 4][L1:4 8]
POC:1,TL:4,[L0:0 2][L1:2 4]
POC:3,TL:4,[L0:2 0][L1:4 8]
POC:6,TL:3,[L0:4 0][L1:8 16]
POC:5,TL:4,[L0:4 0][L1:6 8]
POC:7,TL:4,[L0:6 4][L1:8 16]
POC:12,TL:2,[L0:8 0][L1:16 8]
POC:10,TL:3,[L0:8 0][L1:12 16]
POC:9,TL:4,[L0:8 0][L1:10 12]
POC:11,TL:4,[L0:10 8][L1:12 16]
POC:14,TL:3,[L0:12 8][L1:12 16]
POC:13,TL:4,[L0:12 8][L1:14 16]
POC:15,TL:4,[L0:14 12][L1:16 14]
Note that pictures 16, 8, 4, 2,1, 12, 14, and 15 have the same reference picture(s) in both lists. For bi-prediction of these pictures, the L0 and L1 reference pictures may be the same. We propose that the encoder skips bi-prediction ME for unequal GBi weights when 1) the two reference pictures in bi-prediction are the same, and 2) the temporal layer is greater than 1, and 3) the MVD precision is 1/4 pixels. For affine bi-predictive ME, the fast skip method is only applied to 4-parameter affine ME.
(4) Skipping RD cost checking for unequal GBi weights based on temporal layers and POC distance between reference picture and current picture
It is proposed to skip those RD cost evaluations for those unequal GBi weights when the temporal layer is equal to 4 (highest temporal layer in RA) or the POC distance between the reference picture (list 0 or list 1) and the current picture is equal to 1 and the codec QP is greater than 32.
(5) During ME, floating point calculations are changed to fixed point calculations for unequal GBi
For existing bi-directional prediction search, the encoder will fix the MVs of one list and refine the MVs in another list. The target is modified prior to ME to reduce computational complexity. For example, if the MV of list 1 is fixed and the encoder is to refine the MV of list 0, the goal of list 0 MV refinement is modified by equation (6). O is the original signal, and P1Is the prediction signal of table 1. w is the GBi weight of list 1.
T=((O<<3)-w*P1)*(1/(8-w)) (6)
Herein, the term (1/(8-w)) is stored in floating point precision, which increases computational complexity. It is proposed to change equation (6) to fixed point as in equation (7).
T=(O*a1-P1*a2+round)>>N (7)
Wherein a is1And a2Are scaling factors and they are calculated as follows:
γ=(1<<N)/(8-w);a1=γ<<3;a2=γ*w;round=1<<(N-1)
CU size constraint of 2.8.3 GBi
In this approach, GBi is disabled for small CUs. In inter prediction mode, if bi-prediction is used and the CU region is smaller than 128 luma samples, GBi is disabled without any signaling.
2.9 example of bidirectional optical flow (BDOF or BIO)
Overview of 2.9.1 BDOF
In BIO, motion compensation is first performed to generate a first prediction (in each prediction direction) of the current block. The first prediction is used to derive the spatial gradient, temporal gradient, and optical flow for each subblock or pixel within the block, and then used to generate a second prediction, e.g., a final prediction of the subblock or pixel. The details are described below.
The bi-directional optical flow (BIO) method is a sample-wise motion refinement performed on the basis of bi-directionally predicted block-wise motion compensation. In some embodiments, the sample level motion refinement does not use signaling.
Let I(k)Luminance values from reference k (k0, 1) after block motion compensation, and will be separately processed
Figure BDA0003394343540000234
And
Figure BDA0003394343540000235
is shown as I(k)The horizontal and vertical components of the gradient. Assuming that the optical flow is valid, the motion vector field (v)x,vy) Given by:
Figure BDA0003394343540000236
combining the optical flow equation with a Hermite interpolation for the motion trajectory of each sample point, resulting in the sum function value I(k)And derivatives thereof
Figure BDA0003394343540000238
And
Figure BDA0003394343540000239
a matching unique third order polynomial. When t is 0, the value of the polynomial is predicted for BIO:
Figure BDA0003394343540000237
FIG. 24 illustrates an example optical flow trace in a bi-directional optical flow (BIO) method. Here, τ0And τ1Indicating the distance to the reference frame. Distance tau0And τ1Based on Ref0And Ref1POC of (a) is calculated:
τ0POC (current) -POC (Ref)0),τ1=POC(Ref1) -POC (current). If the two predictions are from the same temporal direction (both from the past or both from the future), then the signs are different (e.g., τ0·τ1< 0). In this case, if the predictions are not from the same time instant (e.g., τ)0≠τ1). Two reference regions have non-zero motion (e.g., MVx)0,MVy0,MVx1,MVy1Not equal to 0) and the block motion vector is proportional to the temporal distance (e.g., MVx)0/MVx1=MVy0/MVy1=-τ01)。
The motion vector field (vx, vy) is determined by minimizing the difference a between the values in points a and B. Fig. 9A-9B illustrate examples of the intersection of a motion trajectory and a reference frame plane. The model uses only the first linear term of the local taylor expansion of Δ:
Figure BDA00033943435400002310
all values in the above equation depend on the sample position and are denoted as (i ', j'). Assuming that the motion is consistent in the local surrounding area, it can be minimized inside a (2M +1) × (2M +1) square window Ω centered on the current predicted point (i, j), where M equals 2:
Figure BDA0003394343540000231
for this optimization problem, JEM uses a simplified approach, first minimizing in the vertical direction, and then minimizing in the horizontal direction. This will result in the following formula:
Figure BDA0003394343540000232
Figure BDA0003394343540000233
wherein,
Figure BDA0003394343540000241
to avoid division by zero or by very small values, the regularization parameters r and m can be introduced in equations (9) and (10), where:
r=500·4d-8equation (15)
m=700·4d-8Equation (16)
Here, d is the bit depth of the video samples.
To maintain memory access to BIO versus conventional dualThe same motion compensation to the prediction, all prediction and gradient values I(k)
Figure BDA0003394343540000243
Is calculated for the position inside the current block. FIG. 22A shows an example of an access location outside of block 2200. As shown in fig. 22A, in equation (9), (2m +1) × (2m +1) square window Ω centered on the current prediction point on the boundary of the prediction block needs to access a position outside the block. In JEM, value I outside the block(k)
Figure BDA0003394343540000244
Is set equal to the most recently available value inside the block. For example, this can be implemented as fill area 2201, as shown in fig. 22B.
With BIO it is possible that the motion field can be refined for each sample point. To reduce computational complexity, a block-based design of the BIO is used in JEM. The motion refinement may be calculated based on 4 x 4 blocks. In block-based BIO, s in equation (9) can be aggregated for all samples in a 4 × 4 blocknIs then snIs used for the derived BIO motion vector offset of the 4 x 4 block. More specifically, the following formula may be used for block-based BIO derivation:
Figure BDA0003394343540000242
here, bkRepresents a set of samples belonging to the kth 4 x 4 block of the prediction block. S in equations (12) and (13)nIs replaced by(s)n,bk) > 4) to derive the associated motion vector offset.
In some scenarios, MV refinement of BIO may not be reliable due to noise or irregular motion. Thus, in BIO, the magnitude of MV refinement is clipped to the threshold. The threshold is determined based on whether the reference pictures of the current picture are all from one direction. For example, if all reference pictures of the current picture are from one direction, the value of the threshold is set to 12 × 214-d(ii) a Otherwise, it is set to 12×213-d
The gradient of the BIO may be simultaneously computed using motion compensated interpolation using operations consistent with the HEVC motion compensation process (e.g., 2D separable Finite Impulse Response (FIR)). In some embodiments, the input to the 2D separable FIR is the same reference frame sample as the motion compensation process and fractional position (fracX, fracY) from the fractional portion of the block motion vector. For horizontal gradients
Figure BDA0003394343540000251
The signal is first vertically interpolated using the bianters corresponding to the fractional position fracY with de-scaling shift d-8. The gradient filter BIOfiltG is then applied in the horizontal direction corresponding to the fractional position fracX with the de-scaling shift 18-d. For vertical gradients
Figure BDA0003394343540000252
The gradient filter is applied vertically using the bianterg corresponding to the fractional position fracY with the de-scaling shift d-8. The signal shifting is then performed in the horizontal direction corresponding to the fractional position fracX with the de-scaling shift 18-d using bialters. The length of the interpolation filter bialterg for gradient calculations and the interpolation filter bialterf for signal displacement may be shorter (e.g. 6 taps) in order to keep a reasonable complexity. Table 1 shows example filters that may be used for gradient computation for different fractional positions of block motion vectors in a BIO. Table 2 shows an example interpolation filter that may be used for prediction signal generation in BIO.
Table 1: exemplary Filter for gradient computation in BIO
Fractional precision position Gradient interpolation filter (BIOfilterg)
0 {8,-39,-3,46,-17,5}
1/16 {8,-32,-13,50,-18,5}
1/8 {7,-27,-20,54,-19,5}
3/16 {6,-21,-29,57,-18,5}
1/4 {4,-17,-36,60,-15,4}
5/16 {3,-9,-44,61,-15,4}
3/8 {1,-4,-48,61,-13,3}
7/16 {0,1,-54,60,-9,2}
1/2 {-1,4,-57,57,-4,1}
Table 2: exemplary interpolation Filter for prediction Signal Generation in BIO
Fractional precision bitDevice for placing Interpolation filter for prediction signal (BIOfilters)
0 {0,0,64,0,0,0}
1/16 {1,-3,64,4,-2,0}
1/8 {1,-6,62,9,-3,1}
3/16 {2,-8,60,14,-5,1}
1/4 {2,-9,57,19,-7,2}
5/16 {3,-10,53,24,-8,2}
3/8 {3,-11,50,29,-9,2}
7/16 {3,-11,44,35,-10,3}
1/2 {3,-10,35,44,-11,3}
In JEM, when the two predictions are from different reference pictures, the BIO may be applied to all bi-predicted blocks. When Local Illumination Compensation (LIC) is enabled for a CU, the BIO may be disabled.
In some embodiments, OBMC is applied to a block after a normal MC procedure. To reduce computational complexity, BIO may not be applied during the OBMC process. This means that the BIO is applied to the MC process of a block when the MV of the block itself is used, and is not applied to the MC process when the MV of a neighboring block is used during the OBMC process.
2.9.2 examples of BIO in VTM-3.0 as set forth in JVET-L0256
Step 1: determine if BIO is applicable (W/H is the width/height of the current block)
BIO is not applicable if the following occurs
Omicron the current video block is affine coded or ATMVP coded
ο(iPOC-iPOC0)×(iPOC-iPOC1)≥0
O 4 or (W4 and H8)
Omicron weighted prediction
Omicron GBi weight is not (1, 1)
If two reference blocks (denoted as R)0And R1) Total SAD in between is less than a threshold, BIO is not used, where
Figure BDA0003394343540000261
Step 2: data preparation
For a WxH block, (W +2) x (H +2) samples are interpolated.
As in normal motion compensation, the inner WxH samples are interpolated with an 8-tap interpolation filter.
The four outer lines of samples (black circles in fig. 23) are interpolated with a bi-directional linear filter.
For each position, at two reference blocks (R)0And R1) The gradient is calculated.
Gx0(x,y)=(R0(x+1,y)-R0(x-1,y))>>4
Gy0(x,y)=(R0(x,y+1)-R0(x,y-1))>>4
Gx1(x,y)=(R1(x+1,y)-R1(x-1,y))>>4
Gy1(x,y)=(R1(x,y+1)-R1(x,y-1))>>4
For each position, the internal value is calculated as:
t1 ═ R0(x, y) > >6) - (R1(x, y) > >6, T2 ═ g x0(x, y) + Gx1(x, y)) > >3, T3 ═ g 0(x, y) + Gy1(x, y)) > > 3; and
B1(x,y)=T2*T2,B2(x,y)=T2*T3,B3(x,y)=-T1*T2,B5(x,y)=T3*T3, B6(x,y)=-T1*T3
step 3: computing a prediction for each block
If the SAD between two 4 x 4 reference blocks is less than a threshold, the BIO is skipped for the 4 x 4 block.
Vx and Vy are calculated.
Calculate the final prediction for each position in the 4 x 4 block:
b(x,y)=(Vx(Gx0(x,y)-Gx1(x,y))+Vy(Gy0(x,y)-Gy1(x,y))+1)>>1
P(x,y)=(R0(x,y)+R1(x,y)+b(x,y)+offset)>>shift
herein, b (x, y) is referred to as a correction term.
BIO in 2.9.3VTM-4.0
In VTM-4.0, JFET-M0063, which proposes rounding of the computation in BDOF according to bit depth, was adopted.
In VTM-4.0, JFET-M0487 is employed, which removes the bi-directional linear filtering and extracts the nearest integer pixels of the reference block to fill the four outer lines of samples (black circles in FIG. 23).
The working draft in VTM-4.0 relating to BIO is shown below (from JFET-M1001)
2.9.4 fractional sample interpolation process
General purpose
The inputs to this process are:
-a luminance position (xSb, ySb) specifying an upper left sample of the current codec sub-block relative to an upper left luminance sample of the current picture,
a variable sbWidth specifying the width of the current codec sub-block,
a variable sbHeight specifying the current codec subblock height,
-a motion vector offset mvOffset,
-a refined motion vector refMvLX,
-the selected reference picture sample array refPicLX,
-a bi-directional optical flow flag bdofllag,
a variable cIdx specifying the color component index of the current block.
The outputs of this process are:
-an array of (sbWidth + bdofOffset) x (sbHeight + bdofOffset) predicted sample values predSamplesLX.
The bi-directional optical flow boundary offset bdafoffset is derived as follows:
bdofOffset=bdofFlag2:0 (8-811)
-if cIdx is equal to 0, the following applies:
let (xtintl, yIntL) be the luminance position given in full sample units and (xFracL, yFracL) be the offset given in 1/16 sample units. These variables are used only in this clause to specify fractional sample positions within the reference sample array refPicLX.
-for each luminance sample position (x) within the predicted luminance sample array predSamplesLXL=0..sbWidth-1+bdofOffset,yLsbHeight-1+ bdafoffset), the corresponding predicted luma sample value predSamplesLX [ x ·L][yL]Is derived as follows:
-variable xtintL、yIntL、xFracLAnd yFracLIs derived as follows:
xIntL=xSb+(refMvLX[0]>>4)+xL (8-812)
yIntL=ySb+(refMvLX[1]>>4)+yL (8-813)
xFracL=refMvLX[0]&15 (8-814)
yFracL=refMvLX[1]&15 (8-815)
-predicting if bdafflag equals TRUE and one or more of the following conditions are TRUELuminance sample value predSamplesLXL][yL]The derivation is performed by invoking the luma integer sample point extraction process as specified in clause 8.5.7.3.3 to (xtint)L,yIntL)、 (xFracL,yFracL) And refPicLX is the output:
andbdafflag equals TRUE.
-xLEqual to 0.
-xLEqual to sbWidth + 1.
-yLEqual to 0.
-yLEqual to sbHeight + 1.
Otherwise, the following applies:
-the motion vector mvLX is set to (refMvLX-mvOffset).
The predicted luma sample value predSamplesLX [ xL ] [ yL ] is derived by calling the luma sample 8-tap interpolation filtering process specified in clause 8.5.7.3.2 to have as inputs (xIntL, yinll), (xFracL, yFracL), refPicLX, and padVal.
……
Luminance integer sample extraction process
The inputs to this process are:
luminance position in full sample units (xtint)L,yIntL),
Luminance reference sample array refPicLXL
The output of this process is the predicted luminance sample value predsamplelXL
Variable shift is set to Max (2,14-BitDepth)Y)。
The variable picW is set equal to pic _ width _ in _ luma _ samples and the variable picH is set equal to pic _ height _ in _ luma _ samples.
The luminance position (xnt, YnT) of the full sample unit is derived as follows:
xInt=Clip3(0,picW–1,sps_ref_wraparound_enabled_flag? (8-838)
ClipH((sps_ref_wraparound_offset_minus1+1)*MinCbSizeY,picW, xIntL):xIntL)
yInt=Clip3(0,picH-1,yIntL) (8-839)
predicting luminance sample values predSampleLXLIs derived as follows:
predSampleLXL=refPicLXL[xInt][yInt]<<shift3 (8-840)
bi-directional optical flow prediction process
The inputs to this process are:
two variables nCbW and nCbH, specifying the width and height of the current codec block,
two (nCbW +2) x (nCbH +2) luma prediction sample point arrays predSamplesL0 and predSamplesL1,
the prediction list utilizes the flags predflag l0 and predflag l1,
reference indices refIdxL0 and refIdxL1,
-the bi-directional optical flow makes use of the flag bdafutilizationnflag [ xIdx ] [ yIdx ], where xIdx ═ 0. (nCbW > >2) -1, yIdx ═ 0. (nCbH > >2) -1.
The output of this process is an (nCbW) x (ncbh) array of luma prediction sample values pbSamples.
The variables bitDepth, shift1, shift2, shift3, shift4, offset4, and mvRefineThres are derived as follows:
-the variable bitDepth is set equal to bitDepthY
Variable shift1 is set equal to Max (2, 14-bitDepth).
Variable shift2 is set equal to Max (8, bitDepth-4).
Variable shift3 is set equal to Max (5, bitDepth-7).
Variable shift4 is set equal to Max (3,15-bitDepth) and variable offset4 is set equal to 1< < (shift 4-1).
The variable mvRefineThres is set equal to Max (2,1< < (13-bitDepth)).
For xIdx ═ 0. (nCbW > >2) -1 and yIdx ═ 0. (nCbH > >2) -1, the following applies:
the variable xSb is set equal to (xIdx < <2) +1, and ySb is set equal to (yIdx < <2) + 1.
-if bdafulizationflag [ xsbdx ] [ yIdx ] is equal to FALSE, then for x ═ xSb-1.. xSb +2, y ═ ySb-1.. ySb +2, the predicted sample point value for the current subblock is derived
The following were used:
pbSamples[x][y]=Clip3(0,(2bitDepth)-1, (predSamplesL0[x+1][y+1]+offset2+predSamplesL1[x+1][y+1])>> shift2) (8-852)
-else (bdafulizationnflag [ xsbdx ] [ yIdx ] equals TRUE), prediction of the current subblock
The sample values are derived as follows:
for x ═ xSb-1.. xSb +4, y ═ ySb-1.. ySb +4, the following ordered procedure applies:
1. predicting the position (h) of each corresponding sample position (x, y) within the sample arrayx,vy) Is derived as follows:
hx=Clip3(1,nCbW,x) (8-853)
vy=Clip3(1,nCbH,y) (8-854)
2. the variables gradientHL0[ x ] [ y ], gradientVL0[ x ] [ y ], gradientHL1[ x ] [ y ] and gradientVL1[ x ] [ y ] are derived as follows:
gradientHL0[x][y]=(predSamplesL0[hx+1][vy]-predSampleL0[hx- 1][vy])>>shift1 (8-855)
gradientVL0[x][y]=(predSampleL0[hx][vy+1]-predSampleL0[hx] [vy-1])>>shift1 (8-856)
gradientHL1[x][y]=(predSamplesL1[hx+1][vy]-predSampleL1[hx- 1][vy])>>shift1 (8-857)
gradientVL1[x][y]=(predSampleL1[hx][vy+1]-predSampleL1[hx] [vy-1])>>shift1 (8-858)
3. the variables temp [ x ] [ y ], tempH [ x ] [ y ], and tempV [ x ] [ y ] are derived as follows:
diff[x][y]=(predSamplesL0[hx][vy]>>shift2)-(predSamplesL1[hx][ vy]>>shift2) (8-859)
tempH[x][y]=(gradientHL0[x][y]+gradientHL1[x][y])>>shift3
(8-860)
tempV[x][y]=(gradientVL0[x][y]+gradientVL1[x][y])>>shift3
(8-861)
the variables sGx2, sGy2, sGxGy, sGxdI and sGydI are derived as follows:
sGx2=∑ij(tempH[xSb+i][ySb+j]*tempH[xSb+i][ySb+j]) Wherein i, j ═ 1..4 (8-862)
sGy2=∑ij(tempV[xSb+i][ySb+j]*tempV[xSb+i][ySb+j]) Wherein i, j ═ 1..4 (8-863)
sGxGy=∑ij(tempH[xSb+i][ySb+j]*tempV[xSb+i][ySb+j]) Wherein i, j-1..4 (8-864)
sGxdI=∑ij(-tempH[xSb+i][ySb+j]*diff[xSb+i][ySb+j]) Wherein i, j ═ 1..4 (8-865)
sGydI=∑ij(-tempV[xSb+i][ySb+j]*diff[xSb+i][ySb+j]) Wherein i, j ═ 1..4 (8-866)
The horizontal and vertical motion offsets of the current sub-block are derived as follows:
vx=sGx2>0Clip3(-mvRefineThres,mvRefineThres, -(sGxdI<<3)>>Floor(Log2(sGx2))):0 (8-867)
vy=sGy2>0Clip3(-mvRefineThres,mvRefineThres, ((sGydI<<3)-((vx*sGxGym)<<12+vx*sGxGys)>>1)>>Floor(Log2( sGx2))):0 (8-868)
-for x-xSb-1.. xSb +2, y-ySb-1.. ySb +2, the predicted sample values for the current subblock are derived as follows:
bdofOffset=Round((vx*(gradientHL1[x+1][y+1]-gradientHL0[x +1][y+1]))>>1) +Round((vy*(gradientVL1[x+1][y+1]-gradientVL0[x+1][y+1]))> >1) (8-869)
[ Ed. (JC): the Round () operation is defined for floating point inputs. The Round () operation appears redundant here because the input is an integer value. Confirmation of person to be proposed)
pbSamples[x][y]=Clip3(0,(2bitDepth)-1,(predSamplesL0[x+1][y+ 1]+offset4+predSamplesL1[x+1][y+1]+bdofOffset)>>shift4)
(8-870)
2.10 decoder-side motion vector refinement (DMVR) example
In the bi-directional prediction operation, for prediction of one block region, two prediction blocks respectively formed using Motion Vectors (MVs) of list 0 and MVs of list 1 are combined to form a single prediction signal. In the decoder-side motion vector refinement (DMVR) method, the two motion vectors of the bi-prediction are further refined by a two-sided template matching process. The double-sided template matching is applied in the decoder to perform a distortion-based search between the double-sided template and reconstructed samples in the reference picture in order to obtain refined MVs without transmitting additional motion information.
At DMVR, as shown in fig. 24, a double-sided template is generated as a weighted combination (i.e., average) of two prediction blocks from the initial MV0 of list 0 and the MV1 of list 1, respectively. The template matching operation consists of computing a cost metric between the generated template and the sample point region (around the initial prediction block) in the reference picture. For each of the two reference pictures, the MV yielding the smallest template cost is considered the updated MV of the list to replace the original MV. In JEM, nine MV candidates are searched for each list. The nine candidate MVs include the original MV and 8 surrounding MVs with one luminance sample offset to the original MV in the horizontal or vertical direction or both. Finally, two new MVs, MV0 'and MV 1', as shown in fig. 24, are used to generate the final bi-directional prediction results. The Sum of Absolute Differences (SAD) is used as a cost measure. Note that when calculating the cost of a prediction block generated from one surrounding MV, the rounded MV (to integer pixels) is actually used to obtain the prediction block, rather than the true MV.
DMVR is applied to the bidirectionally predicted Merge mode, where one MV is from a past reference picture and another one is from a future reference picture, without transmitting additional syntax elements. In JEM, DMVR is not applied when LIC, affine motion, FRUC, or sub-CU Merge candidates are enabled for a CU.
2.11 JVET-N0236
This document proposes a method for refining sub-block based affine motion compensated prediction using optical flow. After performing sub-block based affine motion compensation, the predicted samples are refined by adding the differences derived from the optical flow equations, which is referred to as prediction refinement with optical flow (PROF). The method can realize inter-frame prediction of pixel level granularity under the condition of not increasing the memory access bandwidth.
In order to obtain a finer granularity of motion compensation, this document proposes a method for refining sub-block based affine motion compensation prediction using optical flow. After performing sub-block based affine motion compensation, the luma prediction samples are refined by adding the differences derived from the optical flow equations. The proposed PROF (predictive refinement with optical flow) is described as the following four steps.
Step 1) performs sub-block based affine motion compensation to generate a sub-block prediction I (I, j).
Step 2) use 3 tap filter [ -1, 0, 1[ -1]Computing the spatial gradient g of the subblock prediction at each sample point positionx(i, j) and gy(i,j)。
gx(i,j)=I(i+1,j)-I(i-1,j)
gy(i,j)=I(i,j+1)-I(i,j-1)
For gradient calculations, the sub-block prediction is extended by one pixel on each side. To reduce memory bandwidth and complexity, pixels on the extended boundary are copied from the nearest integer pixel position in the reference picture. Thus, additional interpolation of the fill area is avoided.
Step 3) compute the luminance prediction refinement (denoted as Δ I) from the optical flow equation.
ΔI(i,j)=gx(i,j)*Δvx(i,j)+gy(i,j)*Δvy(i,j)
Where the increment MV (denoted as Δ v (i, j)) is the difference between the pixel MV (denoted as v (i, j)) calculated for the sample position (i, j) and the sub-block MV of the sub-block to which the pixel (i, j) belongs, as shown in fig. 25.
Since the affine model parameters and pixel position relative to the center of the sub-blocks are not changed between sub-blocks, Δ v (i, j) may be calculated for the first sub-block and reused for other sub-blocks in the same CU. Assuming that x and y are the horizontal and vertical offsets from the pixel location to the center of the sub-block, av (x, y),
Figure BDA0003394343540000331
for a 4-parameter affine model,
Figure BDA0003394343540000332
for a 6-parameter affine model,
Figure BDA0003394343540000341
wherein (v)0x,v0y)、(v1x,v1y)、(v2x,v2y) Are the top left, top right and bottom left control point motion vectors, and w and h are the width and height of the CU.
Step 4) finally, a luma prediction refinement is added to the sub-block prediction I (I, j). The final prediction I' is generated as in the following equation.
I′(i,j)=I(i,j)+ΔI(i,j)
Some details in JFET-N0236
a) How to derive gradients for PROF
In JFET-N0263, a gradient is calculated for each sub-block of each reference list (the 4 × 4 sub-block in VTM-4.0). For each sub-block, the nearest integer sample of the reference block is taken to fill the four outer lines of samples (black circles in fig. 23).
Suppose the MV of the current sub-block is (MVx, MVy). The fraction part is then calculated as (FracX, FracY) ═ (MVx &15, MVy & 15). The integer part is calculated as (IntX, IntY) ═ (MVx > 4, MVy > 4). The offset (OffsetX, OffsetY) is derived as:
OffsetX=FracX>71∶0;
OffsetY=FracY>71∶0;
assume that the top-left coordinate of the current sub-block is (xCur, yCur), and the dimension of the current sub-block is W × H.
Then (xCor0, yCor0), (xCor1, yCor1), (xCor2, yCor2) and (xCor3, yCor3) are calculated as:
(xCor0,yCor0)=(xCur+IntX+OffsetX-1,yCur+IntY+OffsetY-1);
(xCor1,yCor1)=(xCur+IntX+OffsetX-1,yCur+IntY+OffsetY+H);
(xCor2,yCor2)=(xCur+IntX+OffsetX-1,yCur+IntY+OffsetY);
(xCor3,yCor3)=(xCur+IntX+OffsetX+W,yCur+IntY+OffsetY);
let PredSample [ x ] [ y ] (where x is 0.. W-1 and y is 0.. H-1) store the predicted samples of the subblock.
Then the filling samples are deduced as
PredSample [ x ] [ -1] - (Ref (xCor0+ x, yCor0) < Shift0) -roundding, for x-1.. W;
PredSample [ x ] [ H ] (Ref (xCor1+ x, yCor1) < < Shift0) -Rounding, for x-1.. W;
PredSample [ -1] [ y ] (Ref (xCor2, yCor2+ y) < < Shift0) -roundding, for y 0.. H-1;
PredSample [ W ] [ y ] (Ref (xCor3, yCor3+ y) < < Shift0) -roundding, 0.. H-1 for y;
where Rec denotes a reference picture. Round is an integer, implemented in an exemplary PROFIn the mode is equal to 213。Shift0=Max(2,(14-BitDepth));
PROF attempts to improve the accuracy of the gradient, unlike BIO in VTM-4.0, where the gradient is output with the same accuracy as the input luminance samples.
The gradient in PROF is calculated as follows:
Shift1=Shift0-4。
gradientH[x][y]=(predSamples[x+1][y]-predSample [x-1][y])>>Shift1
gradientV[x][y]=(predSample[x][y+1]-predSample [x][y-1])>>Shift1
it should be noted that predSamples x y maintains accuracy after interpolation.
b) How to derive Δ v for PROF
The derivation of Δ v (denoted dMvH [ posX ] [ posY ] and dMvV [ posX ] [ posY ], where posX ═ 0.. W-1 and posY ═ 0.. H-1) can be described as follows:
assuming that the dimension of the current block is cbWidth × cbHeight, the number of control point motion vectors is numCpMv, and the control point motion vector is cpMvLX [ cpIdx ], where cpIdx is 0.. numCpMv-1, and X is 0 or1, two reference lists are represented.
The variables log2CbW and log2CbH are derived as follows:
log2CbW=Log2(cbWidth)
log2CbH=Log2(cbHeight)
the variables mvScaleHor, mvscalehver, dHorX and dVerX are derived as follows:
mvScaleHor=cpMvLX[0][0]<<7
mvScaleVer=cpMvLX[0][1]<<7
dHorX=(cpMvLX[1][0]-cpMvLX[0][0])<<(7-log2CbW)
dVerX=(cpMvLX[1][1]-cpMvLX[0][1])<<(7-log2CbW)
the variables dHorY and dvey are derived as follows:
if numCpMv is equal to 3, the following applies:
dHorY=(cpMvLX[2][0]-cpMvLX[0][0])<<(7-log2CbH)
dVerY=(cpMvLX[2][1]-cpMvLX[0][1])<<(7-log2CbH)
else (numCpMv equal to 2), the following applies:
dHorY=-dVerX
dVerY=dHorX
the variables qHorX, qVerX, qHorY and qVerY are derived as follows
qHorX=dHorX<<2;
qVerX=dVerX<<2;
qHorY=dHorY<<2;
qVerY=dVerY<<2;
dMvH [0] [0] and dMvV [0] [0] are calculated as follows
dMvH[0][0]=((dHorX+dHorY)<<1)-((qHorX+qHorY)<<1);
dMvV[0][0]=((dVerX+dVerY)<<1)-((qVerX+qVerY)<<1);
dMvH [ xPos ] [0] and dMvV [ xPos ] [0] for xPos from 1 to W-1 are derived as follows:
dMvH[xPos][0]=dMvH[xPos-1][0]+qHorX;
dMvV[xPos][0]=dMvV[xPos-1][0]+qVerX;
for yPos from 1 to H-1, the following applies:
dMvH [ xPos ] [ yPos ] ═ dMvH [ xPos ] [ yPos-1] + qHorY, where xPos ═ 0.. W-1
dMvV [ xPos ] [ yPos ] ═ dMvV [ xPos ] [ yPos-1] + qVerY, where xPos ═ 0.. W-1
Finally, dMvH [ xPos ] [ yPos ] and dMvV [ xPos ] [ yPos ] (where posX ═ 0.. W-1, posY ═ 0.. H-1) are right-shifted to
dMvH[xPos][yPos]=SatShift(dMvH[xPos][yPos],7+2-1);
dMvV[xPos][yPos]=SatShift(dMvV[xPos][yPos],7+2-1);
Wherein SatShift (x, n) and Shift (x, n) are defined as
Figure BDA0003394343540000361
Shift(x,n)=(x+offset0)>>n
In one example, offset0 and/or offset1 is set to (1< < n) > > 1.
c) How to derive Δ I for PROF
For locations inside the sub-block (posX, posY), their corresponding Δ v (i, j) are denoted (dMvH [ posX ] [ posY ], dMvV [ posX ] [ posY ]). The corresponding gradients are denoted (gradientH [ posX ] [ posY ], gradientV [ posX ] [ posY ]).
Then Δ I (posX, posY) is derived as follows.
(dMvH [ posX ] [ posY ], dMvV [ posX ] [ posY ]) are tailored to
dMvH[posX][posY]=Clip3(-32768,32767,dMvH[posX][posY]);
dMvV[posX][posY]=Clip3(-32768,32767,dMvV[posX][posY]);
ΔI(posX,posY)=dMvH[posX][posY]×gradientH[posX][posY]+
dMvV[posX][posY]×gradientV[posX][posY];
ΔI(posX,posY)=Shift(ΔI(posX,posY),1+1+4);
ΔI(posX,posY)=Clip3(-(213-1),213-1,ΔI(posX,posY));
d) How to derive I 'of PROF'
If the current block is not coded as bi-directional prediction or weighted prediction
I’(posX,posY)=Shift((I(posX,posY)+ΔI(posX,posY)),Shift0),
I’(posX,posY)=ClipSample(I’(posX,posY)),
Where ClipSample clips the sample values to valid output sample values.
Then, I' (posX, posY) is output as an inter prediction value.
Otherwise (the current block is coded and decoded as bidirectional prediction or weighted prediction)
I' (posX, posY) will be stored and used to generate inter prediction values from other prediction values and/or weighting values.
2.12 JVET-N 0510
In jfet-N0510, a phase-varying affine sub-block motion compensation (MV) method is proposed. A conventional two-stage horizontal-vertical interpolation is applied. However, unlike phase invariant block based MVs that use the same horizontal filter for all rows of samples and the same vertical filter for all columns of samples, different phases of the filters can be applied to different rows and different columns of samples in the affine sub-block.
To better approximate the affine motion model in the affine sub-block, a phase change MC is applied to the sub-block. In the proposed method, the affine codec block is also divided into 4 × 4 sub-blocks and the sub-blocks MV are derived for each sub-block as is done in VTM 4.0. The MC of each sub-block is divided into two stages. The first stage is to filter the (4+ L-1) × (4+ L-1) reference block window with (4+ L-1) line horizontal filtering, where L is the filter tap length of the interpolation filter. However, unlike the translation MC, in the proposed phase-change affine sub-block MC, the filter phase of each sample line is different. For each sample row, MVx is derived as follows.
MVx=(subblockMVx<<7+dMvVerX×(rowIdx–L/2–2))>>7
The filter phase for each sample row is derived from MVx. subblockMVx is the x-component of the MV of the derived subblock MV, as was done in VTM 4.0. rowIdx is the sample row index. dMvVerX is (cubotomLeftCPMVx-cupTopLeftCPMVx) < (7-log 2LumaCbHeight), where cubotmLeftCPMVx is the x-component of the lower left control point MV of the CU, cupTopLeftCPMVx is the x-component of the upper left control point MV of the CU, and LumaCbHeight is log2 of the height of the luma Codec Block (CB).
After horizontal filtering, 4 × (4+ L-1) horizontal filtering samples are generated. Fig. 26 shows the proposed concept of horizontal filtering. In fig. 26 and 27, light gray dots (e.g., 2602 or 2702, which are a plurality of dots) are samples of the reference block window, and dark gray dots (e.g., 2604 or 2704) represent horizontal filtering samples. The 8 x1 sample blue tube representation applies 8 tap horizontal filtering once, as shown in fig. 26 and 27, respectively. Four horizontal filters are required for each sample row. The filter phases on the sample rows are the same. However, the filter phases on different rows are different. Skewed 4 x 11 samples are generated.
In the second stage, 4 × (4+ L-1) horizontal filtering samples (e.g., light gray samples (2602) in fig. 26) are further filtered vertically. For each sample column, MVy is derived as follows.
MVy ═ 7 (subablockMVy < <7+ dMvHorY × (columnIdx-2)) > >7 (equation 2)
The filter phase for each sample column is derived from MVy. subblockMVy is the y-component of the MV of the derived subblock MV, as was done in VTM 4.0. columnIdx is the sample column index. dmvhhory is (cuprprivcpmvy-cuptopleftcpmvy) < < (7-log 2LumaCbWidth), where cuprprivcpmvy is the y component of the CU upper right control point MV, cuptopleftcpmvy is the y component of the CU upper left control point MV, and log2LumaCbWidth is log2 of the width of the luminance CB.
After vertical filtering, 4 × 4 affine sub-block predictor samples are generated. Fig. 28 shows the proposed concept of vertical filtering. The light gray dots (2802) are the horizontally filtered samples from the first stage. The dark gray points (2804) are the vertically filtered samples that are the final predicted samples.
In this proposal, the same set of interpolation filters is used as in VTM 4.0. The only difference is that the horizontal filter phase on one sample row is different and the vertical filter phase on one sample column is different. The number of filtering operations for each affine sub-block in the proposed method is the same as in VTM 4.0.
2.2.13. JVET-O0057: switchable interpolation filter
This document proposes a switchable interpolation filter for half-sample (half-pixel) positions proposed in jfet-N0309. The switching of the half-pixel luminance interpolation filter is performed according to the motion vector precision. In addition to the existing quarter-pixel, full-pixel and 4-pixel AMVR modes, a new half-pixel precision AMVR mode is introduced. Only in case of half-pixel motion vector accuracy, an alternative half-pixel luminance interpolation filter can be signaled. In the case of the skip/Merge mode using spatial region Merge candidates, information of applying an interpolation filter to half pixel positions is inherited from neighboring blocks.
2.2.14 JVET-O1140
When the DMVR or BDOF SPS level control flag is true, the SPS flag SPS _ bdef _ DMVR _ slice _ present _ flag signaled in the SPS is used to indicate the presence of slice _ disable _ bdef _ DMVR _ flag. If so, then slice _ disable _ bdef _ dmvr _ flag is signaled after the fractional MMVD flag in the slice header.
Slice _ disable _ bdef _ dmvr _ flag equal to 1 specifies that bi-directional optical flow inter prediction and inter bi-directional prediction based on decoder motion vector refinement are both disabled in the current slice. Slice _ disable _ bdef _ dmvr _ flag equal to 0 specifies that bi-directional optical flow inter prediction or inter bi-directional prediction based on decoder motion vector refinement may or may not be disabled in the current slice. When slice _ disable _ bdef _ dmvr _ flag is not present, the value of slice _ disable _ bdef _ dmvr _ flag is inferred to be 0.
3. Disadvantages of the existing embodiments
Some existing implementations suffer from the following disadvantages:
(1) the gradient calculation methods are different in BDOF and PROF.
(a) In BDOF, the gradient is calculated for the entire block and one fill is performed. In PROF, the gradient is calculated for each subblock, and N padding (assuming N subblocks) is performed.
(b) PROF requires higher gradient accuracy than BDOF.
(2) The interaction between PROF and other tools is unclear.
(3) It is unclear how to apply PROF to the chrominance components.
(4) The derivation of av may not be correct.
(5) For higher codec performance, it is possible to conditionally perform PROF.
(6) It is unclear how to combine the methods in JFET-N0236 and JFET-N0510.
(7) The bit width of dMvH and dMvV may be too large.
4. Example methods for prediction refinement with optical flow (PROF)
Embodiments of the presently disclosed technology overcome the disadvantages of the prior implementations to provide video codecs with higher codec efficiency. Based on the disclosed techniques, a method for predictive refinement with optical flow can enhance existing and future video codec standards, set forth in the following examples described for various embodiments. The examples of the disclosed technology provided below illustrate the general concepts and are not meant to be construed as limiting. In examples, various features described in these examples may be combined unless explicitly indicated to the contrary.
Reference pictures for current pictures from list 0 and list 1 are denoted by Ref0 and Ref1, respectively, and denote τ0POC (current) -POC (Ref0), τ1POC (Ref1) -POC (current), and reference blocks for current blocks from Ref0 and Ref1 are represented by refblk0 and refblk1, respectively. For a sub-block in the current block, its MV pointing to refblk1 of the corresponding sub-block in refblk0 is represented by (v)x,vy) And (4) showing. The MVs of the sub-blocks in Ref0 and Ref1 are respectively composed of (mvL 0)x,mvL0y) And (mvL 1)x,mvL1y) And (4) showing.
Shift (x, s) is defined as Shift (x, s) ═ x + off > > s.
SignShift (x, s) is defined as
Figure BDA0003394343540000401
In an example, offset0 and/or offset1 is set to (1< < n) > >1 or (1< < n-1). In another example, offset0 and/or offset1 are set to 0. In yet another example, offset0 ═ offset1 ═ ((1< < n) > >1) -1 or ((1< (n-1))) -1.
Clip3(x, min, max) is defined as
Figure BDA0003394343540000402
Herein, Max (a, b) ═ a > -ba: b, and Min (a, b) ═ a < ═ ba: b.
In the following discussion, two movesThe operation between motion vectors means that the operation is to be applied to both components of the motion vector. For example, MV 3-MV 1+ MV2 corresponds to MV3x=MV1x+MV2xAnd MV3y=MV1y+MV2y. Alternatively, the operation may be applied to only the horizontal or vertical components of the two motion vectors. The term "absolute value" of MV (MVx, MVy) may refer to abs (MVx), or abs (MVy), or max (abs (MVx), abs (MVy), or abs (MVx) + abs (MVy), where function abs (x) returns the absolute value of x and function max (x, y) returns the larger of x and y.
In the following discussion, the left neighboring block, the lower left neighboring block, the upper side neighboring block, the upper right neighboring block, and the upper left neighboring block are represented as a block a as shown in fig. 21、A0、B1、B0And B2
1. It is proposed that the gradient calculation in PROF can be done in the M × N region level different from the sub-block size used for motion compensation in affine mode.
a. In one example, the gradient calculations in PROF may be performed for M N regions larger than the sub-blocks.
b. In one example, M and N may be some predefined number, e.g., M-N-8 or M-N-16.
c. In one example, M and N may be some number defined in terms of the width/height of the sub-block size, e.g., M-N-2-Wmc, where Wmc is the width/height of the sub-block size used in motion compensation.
d. The filling process for deriving the gradient in the PROF is performed at the M × N region level.
e. For all the above examples, M and N are defined as follows:
i. in one example, M ═ min (K0, block width), where K0 is an integer value.
in one example, N ═ min (K1, block height), where K0 is an integer value.
For the example above, K0-K1-16.
in one example, K0 and K1 are aligned for BDOF.
f. The gradient of first samples in the first sub-block may be derived using second samples in the second sub-block.
i. In one example, the second sub-block is adjacent to the first sub-block.
in one example, when the second sample is in the first sub-block or the second sub-block, the second sample is used to derive a gradient of the first sample in the same manner.
When mxn is larger than the sub-block, the above method may be applied.
g. One or more MVs may be derived for use in the filling process for each mxn region.
i. In one example, one specific MV is derived for the filling process of the mxn region. Integer reference samples can be located with a particular MV and then used to fill in samples outside the mxn region.
(i) In one example, the particular MV may be one MV of one sub-block in the M × N region, such as the top left sub-block or the center sub-block in the M × N region. Fig. 31 shows an example. The MV of sub-block A, B, C, D or E may be selected as the specific MV.
(ii) In one example, the particular MV may be derived from an affine model towards a particular location (such as the center) of the mxn region.
(iii) In one example, the specific MV may be derived from MVs of sub-blocks in the mxn region.
a. For example, the specific MV may be derived as an average of MVs of all sub-blocks in the M × N region.
b. For example, a particular MV may be derived as an average of several MVs of the center sub-block.
i. For example, a specific MV may be derived as an average of several MVs B, C, D and E in fig. 31.
For example, a specific MV may be derived as an average of several MVs of B and E in fig. 31.
For example, a specific MV may be derived as an average of several MVs of C and D in fig. 31.
c. For example, a particular MV may be derived as a function of multiple MVs (e.g., CPMVs or MVs of a sub-block).
in one example, a plurality of MVs are derived for use in a filling process of an mxn region. Integer reference samples may be located with one of the MVs and then used to fill in samples outside the mxn region.
(i) In one example, when filling a first sample adjacent to a first sub-block of the mxn region, a first MV of the first sub-block may be used to locate integer reference sample(s) used to fill the first sample.
Apply the above method when mxn is larger than the subblocks, and perform a filling process for deriving the gradient in the PROF for each mxn region.
2. The gradient calculation in PROF/BIO can be performed in the M N region level, and M/N can be adaptively changed.
a. In one example, M and N may depend on the dimension W × H of the current block.
i. For example, the region may be the entire current block, i.e., M ═ W and N ═ H.
For example, M ═ W/T1 and N ═ H/T2, where T1 and T2 are integers, e.g., T1 ═ T2 ═ 2.
in one example, M and/or N may be signaled from the encoder to the decoder, such as in VPS/DPS/SPS/PPS/APS/slice header/CTU/CU.
(i) Alternatively, M and/or N may be specified in a profile/level of the video codec standard.
in one example, M ═ Min (W, T1) and N ═ Min (H, T2). For example, T1-T2-16.
(i) In one example, T1 and/or T2 may be signaled from the encoder to the decoder, such as in VPS/DPS/SPS/PPS/APS/slice header/CTU/CU.
(ii) Alternatively, T1 and/or T2 may be specified in a profile/level of a video codec standard.
3. For the above method, the following may further apply:
a. in one example, M is at least equal to Mmin and N is at least equal to Nmin, e.g., Mmin Nmin 8.
b. In one example, a padding process is performed once for each M × N region to obtain a padded (M + dM) × (N + dN) region, e.g., dM ═ dN ═ 2.
i. In one example, samples inside the region (such as the white circles in fig. 23) may be derived from motion compensation with interpolation filtering.
(i) In one example, samples inside a region may be derived from motion compensation for several sub-blocks in the region.
in one example, four outer lines of samples (such as the black circles in fig. 23) may be filled in.
(i) In one example, the samples to be filled may replicate the strength of the nearest integer samples in the reference block.
(ii) In one example, the samples to be filled may replicate the intensity of the nearest samples in the unfilled region.
4. For each region where gradient computation in PROF/BIO is applied, instead of computing the gradient value for each sample, it is proposed to compute the gradient based on a fraction of the samples.
a. In one example, the gradient associated with a sample point at a given coordinate may be used in PROF/BIO, e.g., at (2x, y) or (x, 2y) or (2x +1, 2y +1) or (2x, 2y), where (m, n) is the coordinate relative to the top left sample point in the current block.
b. In one example, the samples may be first modified (e.g., downsampled) and the gradients may be derived using the modified samples.
5. It is proposed that the accuracy of the gradient values calculated in BDOF and PROF can be the same.
a. In one example, the sample point differences may be shifted by the same value.
i. In one example, the horizontal and/or vertical gradients (denoted gradientH, gradientV, respectively) may be calculated by:
gradientH[x][y]=(predSamples[x+1][y]-predSample[x -1][y])>>Shift0
gradientV[x][y]=(predSample[x][y+1]-predSample [x][y-1])>>Shift1
instead of this, the user can,
gradientH[x][y]=Shift((predSamples[x+1][y]- predSample[x-1][y]),Shift0)
gradientV[x][y]=Shift((predSample[x][y+1]- predSample[x][y-1]),Shift1)
instead of this, the user can,
gradientH[x][y]=SatShift((predSamples[x+1][y]- predSample[x-1][y]),Shift0)
gradientV[x][y]=SatShift((predSample[x][y+1]- predSample[x][y-1]),Shift1)
in one example, the horizontal and/or vertical gradients (represented by gradientH, gradientV, respectively) may be calculated by:
gradientH[x][y]=(predSamples[x][y]*2-predSamples [x+1][y]-predSample[x-1][y])>>Shift0
gradientV[x][y]=(predSamples[x][y]*2- predSample[x][y+1]-predSample[x][y-1])>>Shift1
instead of this, the user can either,
gradientH[x][y]=Shift((predSamples[x][y]*2- predSamples[x+1][y]-predSample[x-1][y]),Shift0)
gradientV[x][y]=Shift((predSamples[x][y]*2- predSample[x][y+1]-predSample[x][y-1]),Shift1)
instead of this, the user can,
gradientH[x][y]=SatShift((predSamples[x][y]*2- predSamples[x+1][y]-predSample[x-1][y]),Shift0)
gradientV[x][y]=SatShift((predSamples[x][y]*2- predSample[x][y+1]-predSample[x][y-1]),Shift1)
in one example, Shift0 and/or Shift1 may be set to Max (2, (14-BitDepth)), where BitDepth is the bit depth of reconstructed/input samples.
6. The following method of filling the outer lines of samples (represented as filling samples, such as the black circles in fig. 23) may be applied to either PROF, or BIO, or both PROF and BIO.
a. The filling spots can be filled in the same way as for PROF and/or BIO. The "same method" may be any of the filling methods disclosed below.
b. In one example, the padding samples may be derived (e.g., copied) from integer samples in a reference picture of the PROF and/or BIO.
i. In one example, integer samples used to derive the fill samples may be located by the position of the fill samples, adding MVs that may be rounded to integer MVs in the add operation.
(i) In one example, the MV (MvX, MvY) may be rounded to a rounded down integer MV (IntX, IntY). For example, IntX-MvX > > P, IntY-MvY > > P, where P is MV precision.
(ii) In one example, the MV (MvX, MvY) may be rounded to the most recently rounded integer MV (IntX, IntY). For example, FracX ═ MvX & ((1< < P) -1), FracY ═ MvY & ((1< < P) -1), OffX ═ FracX ═ 1< (P-1)))? 1:0, OffY ═ (FracY > ═ 1< (P-1))? 1:0, where P is MV precision, then IntX ═ MvX > > P) + OffX, IntY ═ MvY > > P) + OffY. HalfFrac may be equal to 1< (P-1), in other examples it may be equal to (1< (P-1)) -1 or (1< (P-1)) + 1.
(iii) In one example, MV (MvX, MvY) may be rounded to integer MV (IntX, IntY) when IntX ═ SatShift (MvX, P) and IntY ═ SatShift (MvY, P), where P is MV precision.
(iv) In the above bullets, the MV precision P may depend on the color format and/or the color component.
a. For example, the MV precision of the Cb/Cr component may be equal to the MV precision of the luma component plus K for the 4:2:0 color format. For example, K may be equal to 1.
(v) How padding is performed may be signaled from the encoder to the decoder, such as in VPS/DPS/SPS/PPS/APS/slice header/slice/CTU/CU.
a. Alternatively, how the padding is performed may be specified in a profile/level of the video codec standard.
(vi) How the padding is done may depend on the block dimensions.
7. It is proposed that when applying PROF, the codec tool X cannot be applied.
a. Alternatively, when codec tool X is applied, PROF cannot be applied.
b. In one example, if codec tool X cannot be applied, syntax element(s) to indicate codec tool X may not be signaled.
c. In one example, codec tool X may be generalized bi-directional prediction (GBI).
i. For example, when GbiIdx is not equal to 0, PROF is not applied.
Alternatively, GbiIdx must be 0 when applying PROF.
Alternatively, GbiIdx is not signaled and is inferred to be 0 when PROF is applied.
Alternatively, when applying PROF, GBI is not applied regardless of whether Gbiidx is equal to 0.
d. In one example, the codec tool X may be a local illumination compensation.
e. In one example, codec tool X may be a Multiple Transform Set (MTS).
i. For example, when applying PROF, only default transformations can be applied.
(i) For example, when applying PROF, the MTS to which the syntax element relates is not applied.
f. In one example, codec tool X may be weighted prediction.
i. For example, when unequal weights and/or unequal offsets due to weighted prediction are applied to one block, PROF is not applied.
8. How to apply the PROF is proposed may depend on the color format and/or the use of separate plane codecs.
a. In one example, if the color format is 4:0:0, PROF cannot be applied to the chroma components.
b. In one example, if the color format is 4:4:4, PROF may be applied to the chroma components.
c. In one example, if the color format is not equal to 4:0:0, PROF may be applied to the chroma components.
d. In one example, how delta MV (e.g., Δ v in section 2.11) is derived may depend on the color format.
9. It is proposed how to apply PROF may depend on the color component.
a. In one example, the gradient may be calculated independently for each color component.
i. Alternatively, the gradient calculated for the first color component may be used by the second color component.
Alternatively, the gradient may be calculated twice, once for the luma/dominant color component and another time for the two chroma/correlated color components.
b. In one example, the delta MV (e.g., Δ v in section 2.11) may be calculated independently for each color component.
i. Alternatively, the incremental MV calculated for the first color component may be used by the second color component.
c. In one example, the prediction refinement (e.g., Δ I in section 2.11) may be calculated independently for each color component.
i. Alternatively, the predictive refinement computed for the first color component (e.g., Δ I in section 2.11) may be used by the second color component.
d. In one example, the accuracy of the gradient in PROF may depend on the color component.
e. In one example, the precision of the delta MV in the PROF (e.g., Δ v in section 2.11) may depend on the color component.
f. In one example, whether and how the clipping operation is performed in PROF may depend on the color component.
g. In one example, whether and how a shift operation is performed in PROF may depend on the color component.
h. In one example, PROF may be applied only to the luminance component.
i. In one example, PROF may be applied to different color components of different sub-block sizes.
i. Alternatively, the PROF may be applied to different color components of the same sub-block size.
j. In one example, PROF may be applied to the chroma components of the M x N subblock sizes.
i. For example, M and N are set equal to 4.
k. The above method (bullet h-j) may further depend on the color format (e.g., 4:2:0 or 4:4: 4).
10. It is proposed that the derivation of the delta MV (e.g., Δ v in section 2.11) may depend on the width and/or height of the sub-block.
a. In one example, dMvH [0] [0] and dMvV [0] [0] are computed as
qHorX=dHorX*P0;
qVerX=dVerX*P0;
qHorY=dHorY*P0;
qVerY=dVerY*P0;
dMvH[0][0]=((iDMvHorX+iDMvVerX)*P1)-(quadHorX* (blockWidth>>1)+quadVerX*(blockHeight*P1));
dMvV[0][0]=((iDMvHorY+iDMvVerY)*P1)-(quadHorY* (blockWidth>>1)+quadVerY*(blockHeight*P1));
Wherein blockWidth and blockHeight represent the width and height of the subblock, respectively. P0 and P1 are two numbers of control accuracy.
i. For example, if P0 is 4 and P1 is 2, then dMvH [0] [0] and dMvV [0] [0] are calculated as:
qHorX=dHorX<<2;
qVerX=dVerX<<2;
qHorY=dHorY<<2;
qVerY=dVerY<<2;
dMvH[0][0]=((iDMvHorX+iDMvVerX)<<1)-(quadHorX* (blockWidth>>1)+quadVerX*(blockHeight>>1));
dMvV[0][0]=((iDMvHorY+iDMvVerY)<<1)-(quadHorY* (blockWidth>>1)+quadVerY*(blockHeight>>1));
11. it is proposed that for affine codec blocks, PROF can be done conditionally, rather than always applied.
a. In one example, whether and how PROF is performed may depend on the dimension W × H of the current block.
i. For example, if W < ═ T1 and/or H < ═ T2, then PROF may not be applied, e.g., T1 ═ T2 ═ 16;
for example, if W < T1 and/or H < T2, then PROF may not be applied, e.g., T1-T2-16;
for example, if W > -T1 and/or H > -T2, then PROF may not be applied, e.g., T1-T2-64;
for example, if W > T1 and/or H > T2, then PROF may not be applied, e.g., T1-T2-64;
v. for example, if W × H > T1, then PROF may not be applied, e.g. T1 ═ 64 × 64;
for example, if W × H > -T1, then PROF may not be applied, e.g., T1-64 × 64;
for example, if W H < T1, then PROF may not be applied, e.g., T1 — 16;
for example, if W H < ═ T1, then PROF may not be applied, e.g., T1 ═ 16;
for example, if min (W, H) > -T1, then PROF may not be applied, e.g., T1 ═ 64;
for example, if min (W, H) > T1, then PROF may not be applied, e.g., T1 ═ 64;
for example, if max (W, H) < ═ T1, then PROF may not be applied, e.g., T1 ═ 16;
xii. for example, if max (W, H) < T1, then PROF may not be applied, e.g. T1 ═ 16;
b. in one example, whether and/or how PROF is performed may depend on the control point motion vectors.
c. In one example, whether and/or how to perform PROF may depend on affine parameters and/or the number of affine parameters.
i. For a 4-parameter affine model, wherein
Figure BDA0003394343540000501
Whether and how the PROF is performed may depend on the parameters a and b.
For a 4-parameter affine model, wherein
Figure BDA0003394343540000502
Whether and how the PROF is performed may depend on the parameters a, b, c, and d.
in one example, if the maximum affine parameter is less than (or not greater than) the threshold, then PROF may not be applied.
(i) Alternatively, if all (such as four or six) affine parameters are less than (or not greater than) the threshold, then PROF may not be applied.
(ii) Alternatively, if the at least one affine parameter is less than (or not greater than) the threshold, then PROF may not be applied.
in one example, if the maximum value of the absolute values of the affine parameters is less than (or not greater than) the threshold, then PROF may not be applied.
(i) Alternatively, if the absolute values of all affine parameters are less than (or not greater than) the threshold, then PROF may not be applied.
(ii) Alternatively, PROF can only be applied when at least one of the absolute values of all affine parameters is greater than (or not less than) a threshold.
v. in one example, if the minimum affine parameter is greater than (or not less than) the threshold, then PROF may not be applied.
(i) Alternatively, if all (such as four or six) affine parameters are greater than (or not less than) the threshold, then PROF may not be applied.
(ii) Alternatively, if the at least one affine parameter is greater than (or not less than) the threshold, then PROF may not be applied.
In one example, if the minimum value of the absolute values of the affine parameters is greater than (or not less than) the threshold, then PROF may not be applied.
(i) Alternatively, if the absolute values of all affine parameters are greater than (or not less than) the threshold, then PROF may not be applied.
(ii) Alternatively, the PROF can be applied only when at least one of the absolute values of the affine parameters is less than (or not greater than) the threshold.
In one example, if the maximum value of the "absolute value" of delta MV as disclosed by jfet-N0236 is less than (or not greater than) the threshold value, then PROF may not be applied.
(i) Alternatively, if the "absolute value" of all incremental MVs is less than (or not greater than) the threshold, then PROF may not be applied.
(ii) Alternatively, the PROF can only be applied when at least one of the "absolute values" of the incremental MVs is greater than (or not less than) the threshold value.
In one example, if the minimum value of the "absolute value" of the delta MV is greater than (or not less than) the threshold, then PROF may not be applied.
(i) Alternatively, if the "absolute value" of all incremental MVs is greater than (or not less than) the threshold, then PROF may not be applied.
(ii) Alternatively, the PROF can only be applied when at least one of the "absolute values" of the incremental MVs is greater than (or not less than) the threshold value.
in one example, PROF may be applied to certain locations.
(i) For example, if the "absolute value" of the corresponding incremental MV for a location is less than (or not greater than) a threshold, PROF may be applied to that location.
(ii) For example, if the "absolute value" of the corresponding incremental MV for a location is greater than (or not less than) a threshold, PROF may be applied to that location.
In one example, affine parameters can be represented as integers dHorX, dVerX, dHorY, and dVerY with a certain precision as described by jfet-M1001.
In one example, the threshold may depend on the bit depth.
(i) In one example, the threshold may be derived as 1< < BitDepth.
(ii) Further, alternatively, the threshold may depend on whether bi-directional prediction or uni-directional prediction is applied.
a. For example, the threshold may be derived as (1< < BitDepth) + (Bi-prediction 1: 0).
Whether and/or how the disclosed method in bullet 11 is applied may depend on the reference picture structure, in one example.
(i) For example, if all reference pictures of the current picture are prior to the current picture in display order, i.e., the POC of all reference pictures is less than the POC of the current picture, one or more of the disclosed methods may not be applied.
(ii) Alternatively, whether and/or how the disclosed method in bullets 11 is applied may depend on the slice/picture type (such as I-slice or B-slice).
(iii) Alternatively, whether and/or how the disclosed method in bullet 11 is applied may depend on the time domain layer.
In bullet 11, the codec method "PROF" can be replaced by other codec methods to enhance affine predictive codec, such as interleaved prediction or phase-change affine sub-block motion compensation as disclosed by jfet-N0216.
12. It is proposed that phase change affine sub-block motion compensation such as proposed in JFET-N0510 can be applied first to get the predicted values, and then PROF is applied
13. The bit width of any variable proposed to derive dMvH [ x ] [ y ] and/or dMvV [ x ] [ y ] for any valid x and y cannot exceed a certain number, such as 32.
a. In one example, dMvH [ x ] [ y ] and/or dMvV [ x ] [ y ] are clipped before being used to derive other dMvH [ t ] [ z ] and/or dMvV [ t ] [ z ], where (t, z) is not equal to (x, y).
b. In one example, dMvH [ x ] [ y ] and/or dMvV [ x ] [ y ] are right shifted before being used to derive other dMvH [ t ] [ z ] and/or dMvV [ t ] [ z ], where (t, z) does not equal (x, y).
14. It is proposed that dMvH and/or dMvV may have the same accuracy as the stored motion vectors.
a. For example,
dMvH[xPos][yPos]=SatShift(dMvH[xPos][yPos],7+M);
dMvV[xPos][yPos]=SatShift(dMvV[xPos][yPos],7+M);
where M is an additional precision to derive dMvH and/or hMvV, e.g., M-2.
15. It is proposed that clipping of dMvH and/or dMvV before use to derive the prediction refinement Δ I may depend on the accuracy of dMvH and/or dMvV.
a. For example
dMvH[posX][posY]=Clip3(-2K-1,2K-1-1,dMvH[posX][posY]);
dMvV[posX][posY]=Clip3(-2K-1,2K-1-1,dMvV[posX][posY]);
Where K depends on the accuracy of dMvH and/or dMvV.
b. Alternatively, dMvH [ x ] [ y ] and/or dMvV [ x ] [ y ] are not clipped prior to being used to derive the prediction refinement.
16. It is proposed that the right shift to the predicted refinement Δ I (posX, posY) may depend on the sign of Δ I (posX, posY).
a. For example, Δ I (posX, posY) ═ SatShift (Δ I (posX, posY), N), where N is an integer.
17. It is proposed that the clipping of the prediction refinement Δ I (posX, posY) may depend on the sample bit depth.
a. For example,. DELTA.I (posX, posY) ═ Clip3(- (2)3+BitDepth-1),23+BitDpeth-1,ΔI(posX, posY));
18. Whether and/or how deblocking is performed on sub-block boundaries (e.g., intra sub-block boundaries) within an affine mode block may depend on whether interleaved prediction or/and PROF or/and phase-varying affine sub-block motion compensation is applied to the block as disclosed by jfet-N0216. The interleaved prediction comprises partitioning the video block into a first set of sub-blocks according to a first mode; partitioning the video block into a second set of sub-blocks according to a second pattern, wherein at least one sub-block in the second set has a different dimension than sub-blocks in the first set; and determining a prediction block that is a combination of a first intermediate prediction block generated from the first set of sub-blocks and a second intermediate prediction block generated from the second set of sub-blocks. Thus, using the interleaved prediction technique, a block is divided into sub-blocks having one or more division modes. The division mode indicates a manner of dividing a block into subblocks, including the size of the subblock and the position of the subblock. For each partition mode, a corresponding prediction block may be generated by deriving motion information of each sub-block based on the partition mode. Thus, in some embodiments, a plurality of prediction blocks may be generated through a plurality of partition modes even for one prediction direction. In some embodiments, only one partitioning mode may be applied for each prediction direction. Thus, the interleaved prediction technique uses a different way of partitioning blocks so that motion information can be obtained more robustly without increasing bandwidth consumption.
a. In one example, deblocking may be disabled when interleaved prediction or/and PROF or/and phase change affine sub-block motion compensation is applied to a block.
i. Alternatively, the deblocking filter may be weaker on sub-block boundaries, where the interleaved prediction or/and PROF or/and phase-varying affine sub-block motion compensation is applied to the block. For example, the boundary strength may be set to be smaller on such a boundary.
b. In one example, deblocking may be enabled when interleaved prediction or/and PROF or/and phase change affine sub-block motion compensation is not applied to the block.
19. A switchable interpolation filter may be applied to the affine codec block.
a. When applying a certain MV precision, such as 1/2 pixels or 1/4 pixels, a switchable interpolation filter may be applied to the affine codec block.
20. In one example, when a switchable interpolation filter is used for a block, BDOF is not applied.
a. In one example, BDOF is not applied to blocks with a particular MV resolution (such as 1/2 pixels).
b. In one example, BDOF is not applied to the block that selects a particular interpolation filter.
21. In one example, when a switchable interpolation filter is used for a block, PROF is not applied.
a. In one example, PROF is not applied to blocks with a particular MV resolution (such as 1/2 pixels).
b. In one example, PROF is not applied to the block that selects a particular interpolation filter.
22. It is proposed to calculate Δ v (i, j) for a sub-block in a PROF only when the PROF is applied to the sub-block.
23. It is proposed to signal a first syntax element, such as a flag named slice _ disable _ bdofprof _ DMVR _ flag, at the slice or picture level, such as in the slice header, to control the use of BDOF, PROF and DMVR in the slice.
a. When the first syntax element is not signaled, it is inferred that BDOF, PROF and DMVR are not all turned off in the slice.
b. In one example, the first syntax element is signaled only when at least one of BDOF, PROF, and DMVR is enabled at the sequence level (e.g., the corresponding SPS control flag is equal to 1).
c. Alternatively, a second syntax element (such as SPS _ bdofdmvr _ prof _ slice _ present _ flag in SPS) is signaled at the sequence level to indicate whether the first syntax element should be signaled.
i. In one example, the second syntax element is signaled only when at least one of BDOF, PROF, and DMVR is enabled at the sequence level.
in one example, when the second syntax element is not signaled, it is inferred that the first syntax element is not signaled.
d. In one example, when the first syntax element indicates that BDOF, PROF, and DMVR are all off (e.g., slice _ disable _ bdofpref _ PROF _ DMVR _ flag is equal to 1), none of BDOF, PROF, and DMVR can be applied in the current slice (picture).
24. It is proposed to signal a first syntax element, such as a flag named slice _ disable _ PROF _ bdoff _ flag, at the slice or picture level, such as in the slice header, to control the use of BDOF and PROF in a slice.
a. When the first syntax element is not signaled, it is inferred that BDOF and PROF are not both closed in the slice.
b. In one example, the first syntax element is signaled only when at least one of BDOF and PROF is enabled at the sequence level (e.g., the corresponding SPS control flag is equal to 1).
c. Alternatively, a second syntax element (such as SPS _ bdofprof _ slice _ present _ flag in SPS) is signaled at the sequence level to indicate whether the first syntax element should be signaled.
i. In one example, the second syntax element is signaled only when at least one of BDOF and PROF is enabled at the sequence level.
in one example, when the second syntax element is not signaled, it is inferred that the first syntax element is not signaled.
d. In one example, when the first syntax element indicates that both BDOF and PROF are off (e.g., slice _ disable _ bdofpref _ PROF _ flag is equal to 1), neither BDOF nor PROF can be applied in the current slice (picture).
5 examples
5.1 working draft populated 16x16 changed from the working draft provided by JVT-O0070.
The working draft is based on JFET-N1001.
Changes in JFET-O0070 are in bold and italic. The deleted text is marked with double brackets (for example, [ [ a ] ] indicates a deleted character "a").
Proposed changes areUnderlining
8.5.1 general decoding procedure for codec units that are codec in inter prediction mode
The inputs to this process are:
-a luminance position (xCb, yCb) specifying a top left sample of the current codec block relative to a top left luminance sample of the current picture,
a variable cbWidth specifying the width of the current codec block in luminance samples,
a variable cbHeight specifying the height of the current codec block in the luma samples,
a variable treeType, specifying whether a single tree or a dual tree is used, and if a dual tree is used, whether the current tree corresponds to a luma component or a chroma component.
The output of this process is the modified reconstructed picture before loop filtering.
The derivation process of the quantization parameter as specified in clause 8.7.1 is invoked with the luma position (xCb, yCb), the width cbWidth of the current codec block in luma samples, the height cbHeight of the current codec block in luma samples, and the variable treeType as inputs.
The decoding process of a codec unit for coding in inter prediction mode consists of the following sequential steps:
1. the variable dmvrFlag is set equal to 0.
2. The motion vector component and the reference index of the current codec unit are derived as follows:
-if the MergeTriangleFlag [ xCb ] [ yCb ], inter _ affine _ flag [ xCb ] [ yCb ] and merge _ sub _ flag [ xCb ] [ yCb ] are all equal to 0, then the following applies:
the derivation process for the motion vector component and the reference index as specified in clause 8.5.2.1 is invoked with the luma codec block position (xCb, yCb), the luma codec block width cbWidth and the luma codec block height cbHeight as inputs and the luma motion vectors mvL0[0] [0] and mvL1[0] [0], the reference indices refIdxL0 and refIdxL1, and the prediction list using the flags predflag l0[0] [0] and predflag l1[0] [0] and the bi-directional prediction weight index bcwIdx as outputs.
-dmvrFlag is set equal to 1 when all of the following conditions are true:
-sps _ dmvr _ enabled _ flag is equal to 1
-general _ merge _ flag [ xCb ] [ yCb ] equal to 1
predFlagL0[0] [0] and predFlagL1[0] [0] both equal 1
-mmvd _ merge _ flag [ xCb ] [ yCb ] equal to 0
DiffPicoderCnt (currPic, RefPicList [0] [ refIdxL0]) equals DiffPicoderCnt (RefPicList [1] [ refIdxL1], currPic)
BcwIdx [ xCb ] [ yCb ] equals 0
Luma _ weight _ l0_ flag [ refIdxL0] and luma _ weight _ l1_ flag [ refIdxL1] are both equal to 0
-cbWidth greater than or equal to 8
-cbHeight greater than or equal to 8
-cbHeight cbWidth greater than or equal to 128
If dmvrFlag is equal to 1, then the following applies:
-for X0 and 1, refPicLX ordered two-dimensional array of luminance samplesLAnd two ordered two-dimensional arrays of chroma samples refPicLXCbAnd refPicLXCrThe composed reference picture is derived by calling the process specified in clause 8.5.6.2 with X and refIdxLX as inputs.
The number of luma codec sub-blocks numSbX in the horizontal direction and the number of luma codec sub-blocks numSbY in the vertical direction, the sub-block width sbWidth, and the sub-block height sbHeight are derived as follows:
numSbX=(cbWidth>16)?(cbWidth>>4):1 (8-240)
numSbY=(cbHeight>16)?(cbHeight>>4):1 (8-241)
sbWidth=(cbWidth>16)?16:cbWidth (8-242)
sbHeight=(cbHeight>16)?16:cbHeight (8-243)
for xsbdx ═ 0.. numSbX-1 and ysbdx ═ 0.. numSbY-1, the following applies:
the luma motion vector mvLX [ xsbdx ] [ ysbdx ] and the prediction list are derived as follows using flags predFlagLX [ xsbdx ] [ ysbdx ] (where X equals 0 and 1), and the luma position (xSb [ xsbdx ] [ ysbdx ], ySb [ xsbdx ] [ ysbdx ]) specifying the upper-left sample of the codec sub-block relative to the upper-left luma sample of the current picture:
mvLX[xSbIdx][ySbIdx]=mvLX[0][0] (8-244)
predFlagLX[xSbIdx][ySbIdx]=predFlagLX[0][0] (8-245)
xSb[xSbIdx][ySbIdx]=xCb+xSbIdx*sbWidth (8-246)
ySb[xSbIdx][ySbIdx]=yCb+ySbIdx*sbHeight (8-247)
the decoder-side motion vector refinement procedure specified in clause 8.5.3.1 is xSb [ xSbIdx][ySbIdx]、ySb[xSbIdx][ySbIdx]sbWidth, sbHeight, motion vector mvLX [ xSbIdx [ ]][ySbIdx]And reference picture array refPicLXLAs input and with an incremental motion vector dMvLX [ xsbdx [ ]][ySbIdx]Called as output (where X equals 0 and 1).
The derivation process for the chroma motion vector in clause 8.5.2.13 is called with mvLX [ xsbid ] [ ysbid ] and refIdxLX as inputs and mvCLX [ xsbid ] [ ysbid ] as output (where X equals 0 and 1).
Else (dmvrFlag equal to 0), the following applies:
the derivation process for the chroma motion vector in clause 8.5.2.13 is invoked with mvLX [0] [0] and refIdxLX as inputs and mvCLX [0] [0] as output when treeType equals SINGLE _ TREE and predFlagLX [0] [0] (where X is 0 or1) equals 1.
The number of luma codec sub-blocks numSbX in the horizontal direction and the number of luma codec sub-blocks numSbY in the vertical direction are both set equal to 1.
Otherwise, if the mergetrigleflag [ xCb ] [ yCb ] is equal to 1, and the inter _ affine _ flag [ xCb ] [ yCb ] and the merge _ sub _ lock _ flag [ xCb ] [ yCb ] are all equal to 0, the derivation process for the triangle motion vector component and the reference index as specified in clause 8.5.4.1 is called with the luminance coding block position (xCb, yCb), the luminance coding block width cbWidth, and the luminance coding block height cbHeight as inputs, and with the luminance motion vectors mvA and mvB, the chrominance motion vectors mvCA and mvCB, the reference indexes refIdxA and refIdxB, and the prediction list flags predlistflag a and predlistflag b as outputs.
Otherwise (inter _ affine _ flag [ xCb ] [ yCb ] or merge _ sub _ lock _ flag [ xCb ] [ yCb ] is equal to 1), the derivation process for the sub-block motion vector components and the reference indices as specified in clause 8.5.5.1 is with luminance coding block position (xCb, yCb), luminance coding block width cbWidth, luminance coding block height cbHeight as input and with reference indices refIdxL0 and refIdxL1, the number of luminance coding sub-blocks in the horizontal direction numbx and the number of luminance coding sub-blocks in the vertical direction numSbY, the prediction list with flag predflag [ xsbx ] [ ysbid X ], luminance motion vector array mvsbidx ] [ xsbyidx ], and chrominance motion vector array mvCLX [ xsbysbx ] [ lx ] and chrominance motion vector array mvCLX [ xsbtx ] [ lx ] where xl [ idx ] (cbh) -2 and sby [ sbx ], >1 and where idbx ] is bidirectional index 0[ idbx ] and the prediction index 0[ idbx ] 1 And the motion vector difference array diffMv is called as an output.
3. The arrays refMvLX [ xsbdx ] [ ysbdx ] and refMvCLX [ xsbdx ] [ ysbdx ] (where X is 0 and 1) of luma and chroma motion vectors after decoder-side motion vector refinement are derived as follows for xsbdx ═ 0.. numSbX-1, ysbdx ═ 0.. numbsy-1:
if dmvrFlag is equal to 1, the derivation process for the chroma motion vector in clause 8.5.2.13 is called with refMvLX [ xsbdx ] [ ysbdx ] and refIdxLX as inputs and refMvCLX [ xsbdx ] [ ysbdx ] as output, and the input refMvLX [ xsbdx ] [ ysbdx ] is derived as follows:
refMvLX[xSbIdx][ySbIdx]=mvLX[xSbIdx][ySbIdx]+ dMvLX[xSbIdx][ySbIdx] (8-248)
refMvLX[xSbIdx][ySbIdx][0]=Clip3(-217,217-1, refMvLX[xSbIdx][ySbIdx][0]) (8-249)
refMvLX[xSbIdx][ySbIdx][1]=Clip3(-217,217-1, refMvLX[xSbIdx][ySbIdx][1]) (8-250)
else (dmvrFlag equal to 0), the following applies:
refMvLX[xSbIdx][ySbIdx]=mvLX[xSbIdx][ySbIdx] (8-251)
refMvCLX[xSbIdx][ySbIdx]=mvCLX[xSbIdx][ySbIdx] (8-252)
note that array refMvLX is stored in MvDmvrLX and used in the derivation process of the collocated motion vector in clause 8.5.2.12. The array of non-refined luma motion vectors MvLX is used in the spatial motion vector prediction and deblocking boundary strength derivation process.
4. The predicted samples of the current codec unit are derived as follows:
-if the MergeTriangleFlag [ xCb ] [ yCb ] is equal to 0, the predicted samples for the current codec unit are derived as follows:
the decoding process for inter blocks as specified in clause 8.5.6.1 is to encode the position (xCb, yCb) with luminance,Luminance codec block width cbWidth and luminance codec block height cbHeight, the number of luminance codec sub-blocks numSbX in the horizontal direction and the number of luminance codec sub-blocks numSbY in the vertical direction, luminance motion vector mvL0[ xsbdx [ ]][ySbIdx]And mvL1[ xSbIdx][ySbIdx]And a refined luminance motion vector refMvL0[ xSbIdx][ySbIdx]And refMvL1[ xSbIdx][ySbIdx](where xsbdx ═ 0.. numSbX-1 and ysbdx ═ 0.. numSbY-1), reference indices refIdxL0 and refIdxL1, prediction list utilization flag predflag l0[ xsbdx [ -0][ySbIdx]And predFlagL1[ xSbIdx][ySbIdx]Bi-directional prediction weight index bcwIdx, [ [ and ]]](cbWidth) x (cbHeight) array predSamples set to a variable cIdx set equal to 0 and a motion vector difference array diffMv as inputs and as predicted luminance samplesLAs output, the inter prediction samples (predSamples) of (a) are called.
The decoding process for inter blocks as specified in clause 8.5.6.1 is luminance codec block position (xCb, yCb), luminance codec block width cbWidth and luminance codec block height cbHeight, number of luminance codec sub-blocks numSbX in horizontal direction and number of luminance codec sub-blocks numSbY in vertical direction, chroma motion vector mvCL0[ xsbid x][ySbIdx]And mvCL1[ xSbIdx][ySbIdx]And a refined chrominance motion vector refMvCL0[ xSbIdx][ySbIdx]And refMvCL1[ xSbIdx][ySbIdx](where xsbdx ═ 0.. numSbX-1 and ysbdx ═ 0.. numSbY-1), reference indices refIdxL0 and refIdxL1, prediction list utilization flag predflag l0[ xsbdx [ -0][ySbIdx]And predFlagL1[ xSbIdx][ySbIdx]Bi-directional prediction weight index bcwIdx, [ [ and ]]]A variable cIdx set to 1, and a motion vector difference array diffMv as inputs and an (cbWidth/2) x (cbHeight/2) array predSamples as predicted chroma sampling points for chroma component CbCbAs output, the inter prediction samples (predSamples) of (1).
The decoding process for inter blocks as specified in clause 8.5.6.1 is luminance codec block position (xCb, yCb), luminance codec block width cbWidth and luminance codec block height cbHeight, number of luminance codec sub-blocks numSbX in horizontal direction and number of luminance codec sub-blocks numSbY in vertical direction, chrominance motion vector mvCL0[ xsbid x][ySbIdx]And mvCL1[ xSbIdx][ySbIdx]And a refined chrominance motion vector refMvCL0[ xSbIdx][ySbIdx]And refMvCL1[ xSbIdx][ySbIdx](where xsbdx ═ 0.. numSbX-1 and ysbdx ═ 0.. numSbY-1), reference indices refIdxL0 and refIdxL1, prediction list utilization flag predflag l0[ xsbdx [ -0][ySbIdx]And predFlagL1[ xSbIdx][ySbIdx]Bi-directional prediction weight index bcwIdx, [ [ and ]]]A variable cIdx set to 2, and a motion vector difference array diffMv as inputs and an (cbWidth/2) x (cbHeight/2) array predSamples as predicted chroma sampling points for the chroma component CrCrAs output, the inter prediction samples (predSamples) of (1).
Else (MergeTriangleFlag [ xCb)][yCb]Equal to 1), the decoding process for the triangle inter block as specified in clause 8.5.7.1 is (cbWidth) x (cbHeight) array predSamples with luma codec block position (xCb, yCb), luma codec block width cbWidth and luma codec block height cbHeight, luma motion vectors mvA and mvB, chroma motion vectors mvCA and mvCB, reference indices refIdxA and refIdxB, and prediction list flags predlistflag a and predlistflag as inputs and as predicted luma samplesLAnd two (cbWidth/2) x (cbHeight/2) arrays predSamples for predicting chroma samplesCbAnd predSamplesCrInter prediction samples (predSamples) (one for each of the chroma components Cb and Cr) are called as output.
5. The variables NumSbX [ xCb ] [ yCb ] and NumSbY [ xCb ] [ yCb ] are set equal to numbX and numbY, respectively.
6. The residual samples of the current codec unit are derived as follows:
-the decoding process of the residual signal of the codec block for codec in inter prediction mode as specified in clause 8.5.8 is input with the position (xTb0, yTb0) set equal to the luminance position (xCb, yCb), the width nTbW set equal to the luminance codec block width cbWidth, the height nTbH set equal to the luminance codec block height cbHeight, and the variable cIdx set equal to 0 and with the array resamples as inputLCalled as output.
-for inter prediction as specified in clause 8.5.8The decoding process of the residual signal of the codec block in the mode is input with a position (xTb0, yTb0) set equal to the chroma position (xCb/2, yCb/2), a width nTbW set equal to the chroma codec block width cbWidth/2, a height nTbH set equal to the chroma codec block height cbHeight/2, and a variable cIdx set equal to 1 and with an array resamplesCbCalled as output.
The decoding process of the residual signal of the codec block for coding in the inter prediction mode as specified in clause 8.5.8 is input with the position (xTb0, yTb0) set equal to the chroma position (xCb/2, yCb/2), the width nTbW set equal to the chroma codec block width cbWidth/2, the height nTbH set equal to the chroma codec block height cbHeight/2, and the variable cIdx set equal to 2 as input and with the array resSamplesCrCalled as output.
7. The reconstructed samples of the current codec unit are derived as follows:
the picture reconstruction process for color components as specified in clause 8.7.5 is with the block position (xB, yB) set equal to (xCb, yCb), the block width bWidth set equal to cbWidth, the block height bhight set equal to cbHeight, the variable cIdx set equal to 0, the variable cIdx set equal to predSamples set equal to predLAnd (cbWidth) x (cbHeight) array predSamples and set equal to resSamplesL(cbWidth) x (cbheight) array resSamples as input and the output is the modified reconstructed picture before loop filtering.
The picture reconstruction process for color components as specified in clause 8.7.5 is with the block position (xB, yB) set equal to (xCb/2, yCb/2), the block width bWidth set equal to cbWidth/2, the block height bhight set equal to cbHeight/2, the variable cIdx set equal to 1, the variable predSamples set equal to predCbAnd (cbWidth/2) x (cbHeight/2) array predSamples and set equal to resSamplesCbIs called as input, and the output is the modified reconstructed picture before loop filtering.
The picture reconstruction process for the color component as specified in clause 8.7.5 is invoked with block position (xB, yB) set equal to (xCb/2, yCb/2), block width bWidth set equal to cbWidth/2, block height bhight set equal to cbHeight/2, variable cIdx set equal to 2, (cbWidth/2) x (cbHeight/2) array predSamples set equal to predSamplesCr, and (cbWidth/2) x (cbHeight/2) array samples set equal to resSamplesCr as inputs, and the output is the modified reconstructed picture before loop filtering.
8.5.5 derivation procedure for sub-block motion vector components and reference indices
8.5.5.1 general purpose
The inputs to this process are:
-a luminance position of a top-left sample of the current luminance codec block relative to a top-left luminance sample of the current picture (xCb, yCb),
a variable cbWidth specifying the width of the current codec block in luminance samples,
a variable cbHeight specifying the height of the current codec block in the luma samples.
The outputs of this process are:
reference indices refIdxL0 and refIdxL1,
the number of luma codec sub-blocks numSbX in the horizontal direction and the number of luma codec sub-blocks numSbY in the vertical direction,
the prediction list utilizes the flag arrays predflag l0[ xsbdix ] [ ysbdx ] and predflag l1[ xsbdx ] [ ysbdx ], where xsbdx ═ 0.. numbx-1 and ysbdx · 0.. numbx-1,
1/16 fractional-sample-precision luminance sub-block motion vector arrays mvL0[ xsbeidx ] [ ysbeidx ] and mvL1[ xsbeidx ] [ ysbeidx ], where xsbeidx ═ 0.. numbx-1, ysbeidx ═ 0.. numbby-1,
-1/32 fractional sample precision chroma subblock motion vector arrays mvCL0[ xSbIdx ] [ ySbIdx ] and mvCL1[ xSbIdx ] [ ySbIdx ], where xSbIdx ═ 0.. numBX-1, ySbIdx ═ 0.. numBY-1,
-a bi-directional prediction weight index bcwIdx.
-motion vector difference array diffMv.
For the derivation of the variables mvL0[ xsbdx ] [ ysbdx ], mvL1[ xsbdx ] [ ysbdx ], mvCL0[ xsbdx ] [ ysbdx ], and mvCL1[ xsbdx ] [ ysbdx ], refIdxL0, refIdxL1, numSbX, numSbY, predflag l0[ xsbdx ] [ ysbdx ], and predflag l1[ xsbdx ] [ ysbdx ], the following applies:
-if merge _ sub _ flag [ xCb ] [ yCb ] is equal to 1, the derivation process for the motion vector and reference index in the sub-block Merge mode as specified in 8.5.5.2 takes as input the luminance codec block position (xCb, yCb), the luminance codec block width cbWidth and the luminance codec block height cbHeight, the prediction list is called with the number of luminance codec subblocks in the horizontal direction numSbX and the number of luminance codec subblocks in the vertical direction numSbY, the reference index refIdxL0, refIdxL1, a prediction list using flag arrays predflag l0[ xsbid ] [ ysbid ] and predflag l1[ xsbid ] [ ysbid ], a luminance subblock motion vector array mvL0[ xsbid ] [ ysbid ] and mvL0[ xsbid ] [ ysbid ], and a chrominance subblock motion vector array mvCL0[ xsbid ] [ ysbid ] and mvCL1[ xsbid ] [ ysbid ] (where xsbid ═ 0.. nusbx-1, ysbid ═ 0.. nuby-1), and a bidirectional weight prediction index bcwIdx as output.
Else (merge _ sublock _ flag [ xCb ] [ yCb ] equals 0), for X being replaced by 0 or1 in the variables predflag LX, cpMvLX, MvdCpLX and refIdxLX, in PRED _ LX and in the syntax element ref _ idx _ LX, the following ordered steps apply:
for the derivation of the number of control point motion vectors numCpMv, cpMvLX [ cpIdx ] (where cpIdx ranges from 0 to numCpMv-1), refIdxLX, predflagllx [0] [0], the following applies:
1. the number of control point motion vectors, numCpMv, is set equal to motionodeldc [ xCb ] [ yCb ] + 1.
2. The variables refIdxLX and predFlagLX are derived as follows:
if inter _ PRED _ idc [ xCb ] [ yCb ] is equal to PRED _ LX or PRED _ BI,
refIdxLX=ref_idx_lX[xCb][yCb] (8-457)
predFlagLX[0][0]=1 (8-458)
otherwise, the variables refIdxLX and predFlagLX are specified by:
refIdxLX=-1 (8-459)
predFlagLX[0][0]=0 (8-460)
3. the variable mvdCpLX [ cpIdx ] (where cpIdx ranges from 0 to numCpMv-1) is derived as follows:
mvdCpLX[cpIdx][0]=MvdCpLX[xCb][yCb][cpIdx][0] (8-461)
mvdCpLX[cpIdx][1]=MvdCpLX[xCb][yCb][cpIdx][1] (8-462)
4. when predFlagLX [0] [0] is equal to 1, the derivation process for the luma affine control point motion vector predictor as specified in clause 8.5.5.7 is invoked with the luma codec block position (xCb, yCb), and the variables cbWidth, cbHeight, refIdxLX, and the number of control point motion vectors numpMv as inputs, and the output is mvpCpLX [ cpIdx ], where cpIdx ranges from 0 to numpMv-1.
5. When predFlagLX [0] [0] is equal to 1, the luminance motion vector cpMvLX [ cpIdx ] (where cpIdx ranges from 0 to NumCPMv-1) is derived as follows:
uLX[cpIdx][0]=(mvpCpLX[cpIdx][0]+mvdCpLX[cpIdx][0]+ 218)%218 (8-463)
cpMvLX[cpIdx][0]=(uLX[cpIdx][0]>=217)? (uLX[cpIdx][0]-218):uLX[cpIdx][0] (8-464)
uLX[cpIdx][1]=(mvpCpLX[cpIdx][1]+mvdCpLX[cpIdx][1]+ 218)%218 (8-465)
cpMvLX[cpIdx][1]=(uLX[cpIdx][1]>=217)?(uLX[cpIdx][1]-218):uLX[cpIdx][1] (8-466)
the variables numSbX and numSbY are derived as follows:
numSbX=(cbWidth>>2) (8-467)
numSbY=(cbHeight>>2) (8-468)
for xsbeidx ═ 0.. numbx-1, ysbeidx ═ 0.. numbby-1, the following applies: predFlagLX [ xSbIdx ] [ ySbIdx ] ═ predFlagLX [0] [0] (8-469)
When predflagx [0] [0] is equal to 1, the derivation process of the motion vector array for motion vectors from affine control points as specified in subclause 8.5.5.9 is to call up the motion vector array mvLX [ xsbbx ] [ xSbIdx ], [ and ] chroma motion vector array mvclclx [ xsbx ] [ xSbIdx ], [ and ] chroma motion vector array mvCLX [ xsbx ], [ xSbIdx ], [ and ] motion vector difference as mvmfsdmv-1, and mfsdjx-1 with the luma codec block position (xCb, yCb), the luma codec block width cbWidth, the luma prediction block height cbHeight, the number numcpmpmpmpmpmmx of control point motion vectors, the control point motion vector cplx [ cpIdx ] (cpplx is 0 … 2), the reference index refldxlxxlx, and the number of luma codec subblocks in the horizontal direction, and the number numsbbx [ xsbdx ], [ xsbyidx ], [ wherein xmldx-1 ] motion vector array, and mfusffmsusy.
The bi-prediction weight index bcwIdx is set equal to bcw _ idx [ xCb ] [ yCb ].
8.5.5.9 derivation procedure for motion vector arrays from affine control point motion vectors the inputs to the procedure are:
-a luminance position of a top-left sample of the current luminance codec block relative to a top-left luminance sample of the current picture (xCb, yCb),
two variables cbWidth and cbHeight specifying the width and height of the luma codec block,
the number of control point motion vectors numcpv,
-a control point motion vector cpmvLX [ cpIdx ], wherein cpIdx ═ 0.. numCpV-1 and X is 0 or1,
-a reference index refIdxLX, and X is 0 or1,
the number of luma codec sub-blocks numSbX in the horizontal direction and the number of luma codec sub-blocks numSbY in the vertical direction.
The outputs of this process are:
-a luminance sub-block motion vector array mvLX [ xSbIdx ] [ ySbIdx ], wherein xSbIdx ═ 0.. numbX-1, ySbIdx ═ 0.. numbY-1, and X is 0 or1,
-a chroma subblock motion vector array mvCLX [ xsbdx ] [ ysbdx ], wherein xsbdx ═ 0.. numbx-1, ysbdx ═ 0.. numSbY-1, and X is 0 or 1.
-motion vector difference array diffMv.
For x xcb.. xCb + cbWidth-1 and y ycb.. yCb + cbHeight-1, the following assignments are made:
CpMvLX[x][y][0]=cpMvLX[0] (8-666)
CpMvLX[x][y][1]=cpMvLX[1] (8-667)
CpMvLX[x][y][2]=cpMvLX[2] (8-668)
the variables log2CbW and log2CbH are derived as follows:
log2CbW=Log2(cbWidth) (8-669)
log2CbH=Log2(cbHeight) (8-670)
the variables mvScaleHor, mvscalehver, dHorX and dVerX are derived as follows:
mvScaleHor=cpMvLX[0][0]<<7 (8-671)
mvScaleVer=cpMvLX[0][1]<<7 (8-672)
dHorX=(cpMvLX[1][0]-cpMvLX[0][0])<<(7-log2CbW) (8-673)
dVerX=(cpMvLX[1][1]-cpMvLX[0][1])<<(7-log2CbW) (8-674)
the variables dHorY and dVerY are derived as follows:
if numCpMv is equal to 3, the following applies:
dHorY=(cpMvLX[2][0]-cpMvLX[0][0])<<(7-log2CbH) (8-675)
dVerY=(cpMvLX[2][1]-cpMvLX[0][1])<<(7-log2CbH) (8-676)
else (numCpMv equal to 2), the following applies:
dHorY=-dVerX (8-677)
dVerY=dHorX (8-678)
the variables sbWidth and sbHeight are derived as follows:
sbWidth=cbWidth/numSbX (8-xxx)
sbHeight=cbHeight/numSbY (8-xxx)
the variable fallback modeltrigged is set equal to 1 and is modified as follows:
the variable bxWX4、bxHX4、bxWXh、bxHXh、bxWXvAnd bxHXvIs derived as follows:
maxW4=Max(0,Max(4*(2048+dHorX),Max(4*dHorY, 4*(2048+dHorX)+4*dHorY))) (8-679)
minW4=Min(0,Min(4*(2048+dHorX),Min(4*dHorY, 4*(2048+dHorX)+4*dHorY))) (8-680)
maxH4=Max(0,Max(4*dVerX,Max(4*(2048+dVerY), 4*dVerX+4*(2048+dVerY)))) (8-681)
minH4=Min(0,Min(4*dVerX,Min(4*(2048+dVerY), 4*dVerX+4*(2048+dVerY)))) (8-682)
bxWX4=((maxW4-minW4)>>11)+9 (8-683)
bxHX4=((maxH4-minH4)>>11)+9 (8-684)
bxWXh= ((Max(0,4*(2048+dHorX))-Min(0,4*(2048+dHorX)))>>11)+9
(8-685)
bxHXh=((Max(0,4*dVerX)-Min(0,4*dVerX))>>11)+9 (8-686)
bxWXv=((Max(0,4*dHorY)-Min(0,4*dHorY))>>11)+9 (8-687)
bxHXv
=((Max(0,4*(2048+dVerY))-Min(0,4*(2048+dVerY)))>>11)+
9(8-688)
if inter _ pred _ idc [ xCb)][yCb]Equal to PRED _ BI, and bxWX4*bxHX4Less than or equal to 225, the fallback modetrigged is set equal to 0.
Else, if bxWXh*bxHXhLess than or equal to 165, and bxWXv*bxHXvLess than or equal to 165, fallback modetrigged is set equal to 0.
For xsbdx ═ 0.. numSbX-1 and ysbdx ═ 0.. numSbY-1, the following applies:
derivation of the variables xPosCb and yPosCb as follows
-if fallback modeltrigged is equal to 1, the following applies:
xPosCb=(cbWidth>>1) (8-689)
yPosCb=(cbHeight>>1) (8-690)
else (fallback modeltrigged equals 0), the following applies:
xPosCb=2+(xSbIdx<<2) (8-691)
yPosCb=2+(ySbIdx<<2) (8 692)
the luminance motion vector mvLX [ xsbdx ] [ ysbdx ] is derived as follows:
mvLX[xSbIdx][ySbIdx][0]=(mvScaleHor+dHorX*xPosCb+dHorY *yPosCb) (8-693)
mvLX[xSbIdx][ySbIdx][1]=(mvScaleVer+dVerX*xPosCb+dVerY* yPosCb) (8-694)
the rounding-up process for the motion vector as specified in clause 8.5.2.14 is invoked with mvX set equal to mvLX [ xsbdx ] [ ysbdx ], rightShift set equal to 7, and leftShift set equal to 0 as inputs and the rounded mvLX [ xsbdx ] [ ysbdx ] as output.
The motion vector mvLX [ xsbdx ] [ ysbdx ] is clipped as follows:
mvLX[xSbIdx][ySbIdx][0]=Clip3(-217,217-1,mvLX[xSbIdx] [ySbIdx][0]) (8-695)
mvLX[xSbIdx][ySbIdx][1]=Clip3(-217,217-1,mvLX[xSbIdx] [ySbIdx][1]) (8-696)
for xsbdx ═ 0.. numSbX-1 and ysbdx ═ 0.. numSbY-1, the following applies:
the average luminance motion vector mvAvgLX is derived as follows:
mvAvgLX=mvLX[(xSbIdx>>1<<1)][(ySbIdx>>1<<1)]+mvLX [(xSbIdx>>1<<1)+1][(ySbIdx>>1<<1)+1] (8-697)
mvAvgLX[0]=(mvAvgLX[0]+1-(mvAvgLX[0]>=0))>>1
(8-698)
mvAvgLX[1]=(mvAvgLX[1]+1-(mvAvgLX[1]>=0))>>1
(8-699)
the derivation process for the chroma motion vector in clause 8.5.2.13 is called with mvAvgLX and refIdxLX as inputs and the chroma motion vector mvCLX [ xsbdx ] [ ysbdx ] as output.
Thus, four 2 × 2 chroma sub-blocks (4 × 4 chroma blocks) share the same motion vector derived from the average of the two 4 × 4 luma sub-block motion vectors. In the decoding process, motion compensation is still performed on the 2 × 2 chroma block, however this is motion compensation on the chroma 4 × 4 block, since all chroma MVs inside the 4 × 4 chroma block are the same. Affine chroma MC is performed on the 4 × 4 chroma blocks.
The motion vector difference array diffMv is derived as follows:
-if fallback modeltrigged is equal to 0, then the following applies:
variable shift1 is set equal to Max (6, bitDepth-6).
The variable dmvLimit is set equal to 1< < shift 1.
The variables posOffsetX and posOffsetY are derived as follows:
posOffsetX=6*dHorX+6*dVerX
posOffsetY=6*dHorY+6*dVerY
for x 0.. sbWidth-1 and y 0.. sbHeight-1, the following applies:
the following applies:
diffMv[x][y][0]=x*(dHorX<<2)+y*(dVerX<<2)–posOffsetX
diffMv[x][y][1]=x*(dHorY<<2)+y*(dVerY<<2)–posOffsetY
for i ═ 0..1, the following applies:
the rounding process for the motion vector as specified in clause 8.5.2.14 is invoked with mvX set equal to diffMv x y i, rightShift set equal to 7 and leftShift set equal to 0 as inputs and the rounded diffMv as output.
diffMv [ x ] [ y ] [ i ] is clipped as follows:
diffMv[x][y][i]=Clip3(-dmvLimit,dmvLimit-1,diffMv[x][y][i])
else (fallback modetrigged equals 1), for x ═ 0.. sbWidth-1 and y ═ 0.. sbHeight-1, the following applies:
diffMv[x][y][0]=0
diffMv[x][y][1]=0
8.5.6 decoding Process for inter blocks
8.5.6.1 general purpose
This procedure is invoked when a codec unit that was codec in the inter prediction mode is decoded. The inputs to this process are:
-a luminance position (xCb, yCb) specifying a top left sample of the current codec block relative to a top left luminance sample of the current picture,
a variable cbWidth specifying the width of the current codec block in luminance samples,
a variable cbHeight specifying the height of the current codec block in the luma samples,
variables numSbX and numSbY specifying the number of luma codec sub-blocks in the horizontal direction and the number of luma codec sub-blocks in the vertical direction,
-motion vectors mvL0[ xsbdx ] [ ysbdx ] and mvL1[ xsbdx ] [ ysbdx ], where xsbdx ═ 0.. numbx-1 and ysbdx ═ 0.. numSbY-1,
-refined motion vectors refMvL0[ xSbIdx ] [ ySbIdx ] and refMvL1[ xSbIdx ] [ ySbIdx ], wherein xSbIdx ═ 0.. numbX-1 and ySbIdx ═ 0.. numbY-1,
reference indices refIdxL0 and refIdxL1,
the prediction list utilizes the flags predflag l0[ xsbdix ] [ ysbdx ] and predflag l1[ xsbdx ] [ ysbdx ], where xsbdx ═ 0.. numbx-1 and ysbdx ═ 0.. numbby-1,
-a bi-directional prediction weight index bcwIdx,
a variable cIdx specifying the color component index of the current block.
-motion vector difference array diffMv.
The outputs of this process are:
-an array of predicted samples predSamples.
Suppose predSamplesL0L、predSamplesL1LAnd predSamplesIntraL(cbWidth) x (cbHeight) array for predicting luma sample values, and predSamplesL0Cb、predSamplesL1Cb、 predSamplesL0CrAnd predSamplesL1Cr、predSamplesIntraCbAnd predSamplesIntraCrIs an array of (cbWidth/2) x (cbHeight/2) for predicting chroma sample values.
The variable currPic, specifying the current picture, and the variable bdafflag is derived as follows:
-if all the following conditions are TRUE, then bdafflag is set equal to TRUE.
-sps _ bdofenabled _ flag is equal to 1.
predFlagL0[ xSbIdx ] [ ySbIdx ] and predFlagL1[ xSbIdx ] [ ySbIdx ] are both equal to 1.
-DiffPicOrderCnt (currPic, RefPicList [0] [ refIdxL0]) DiffPicOrderCnt (currPic, RefPicList [1] [ refIdxL1]) is less than 0.
-MotionModeldldc [ xCb ] [ yCb ] equals 0.
-merge _ sublock _ flag [ xCb ] [ yCb ] is equal to 0.
-sym _ mvd _ flag [ xCb ] [ yCb ] is equal to 0.
BcwIdx [ xCb ] [ yCb ] equals 0.
Luma _ weight _ l0_ flag [ refIdxL0] and luma _ weight _ l1_ flag [ refIdxL1] are both equal to 0.
-cbHeight greater than or equal to 8
-cIdx equals 0.
Else, bdafflag is set equal to FALSE.
-if numSbY equals 1 and numSbX equals 1, then the following applies:
when bdafflag equals TRUE, the variables numSbY, numSbX are modified as follows:
numSbX=(cbWidth>16)?(cbWidth>>4):1 (8700)
numSbY=(cbHeight>16)?(cbHeight>>4):1 (8-701)
for X ═ 0..1, xsbdx ═ 0.. numSbX-1 and ysbdx ═ 0.. numSbY-1, the following applies:
-predFlagLX [ xSbIdx ] [ ySbIdx ] is set equal to predFlagLX [0] [0 ].
-refMvLX [ xSbIdx ] [ ySbIdx ] is set equal to refMvLX [0] [0 ].
-mvLX [ xSbIdx ] [ ySbIdx ] is set equal to mvLX [0] [0 ].
The width sbWidth and height sbHeight of the current codec sub-block in the luma samples are derived as follows:
sbWidth=cbWidth/numSbX (8-702)
sbHeight=cbHeight/numSbY (8-703)
if inter _ affine _ flag [ xCb][yCb]Equal to 1, cIdx equal to 1, and profFlag equal to TRUE, then the following applies:
-for sub-block index (xsbdx, ysbdx) (where xsbdx ═ 0.. numSbX-1 and ysbdx ═ Each codec sub-block at numSbY-1), the following applies:
-specifying a luminance bit of a top-left sample of a current codec sub-block relative to a top-left luminance sample of a current picture The position (xSb, ySb) is derived as follows:
(xSb,ySb)=(xCb+xSbIdx*sbWidth,yCb+ySbIdx*sbHeight) (8-704)
-for each of X0 and 1, when predFlagLX [ xSbIdx ]][ySbIdx]Equal to 1, the following applies:
- Lfrom an ordered two-dimensional array of luminance samples refPicLX and two ordered two-dimensional arrays of chrominance samples Cb Crreference pictures consisting of refPicLX and refPicLX are called in clauses by taking X and refIdxLX as input 8.5.6.2, respectively.
-Array paddedSamplesX [ xsbdx [ ]][ySbIdx]By sampling the luminance at a luminance position (xSb, ySb) The width of coding and decoding subblocks in (1) sbWidth, the height of coding and decoding subblocks sbHeight, the offset of luminance motion vectors (0,0), and the refinement LLuminance motion vectorrefMvLX[xSbIdx][xSbIdx]Reference arrays refPicLX, bdofllag and cIdx as inputs Derived using the fractional sample interpolation process specified in clause 8.5.6.3.
- LnotPaddedSamplesX[x+xSb][y+ySb]Is set equal to predSamplesLX [ x + 1]][y+1], Wherein x is 0
For each codec sub-block at the sub-block index (xsbdx, ysbdx) (where xsbdx is 0.. numbx-1 and ysbdx is 0.. numbby-1), the following applies:
-the luminance position (xSb, ySb) specifying the top-left sample of the current codec sub-block relative to the top-left luminance sample of the current picture is derived as follows:
(xSb,ySb)=(xCb+xSbIdx*sbWidth,yCb+ySbIdx*sbHeight) (8-704)
for each of X0 and 1, when predFlagLX [ xsbdx ] [ ysbdx ] equals 1, the following applies:
an ordered two-dimensional array of luminance samples refPicLXLAnd two ordered two-dimensional arrays of chroma samples refPicLXCbAnd refPicLXCrThe composed reference picture is derived by calling the process specified in clause 8.5.6.2 with X and refIdxLX as inputs.
-the motion vector offset mvOffset is set equal to refMvLX [ xSbIdx ] [ xSbIdx ] -mvLX [ xSbIdx ] [ ySbIdx ].
-mvOffset [0] is set equal to 0 when one or more of the following conditions is true:
-xSb is not equal to xCb, and mvOffset [0] is less than 0
- (xSb + sbWidth) is not equal to (xCb + cbWidth) and mvOffset [0] is greater than 0
-mvOffset [1] is set equal to 0 when one or more of the following conditions is true:
-ySb does not equal yCb and mvOffset [1] is less than 0
- (ySb + sbHeight) is not equal to (yCb + cbHeight), and mvOffset [1] is greater than 0
-if cIdx is equal to 0, the following applies:
such asFruit _ affine _ flag [ xSb ]][ySb]Equal to 1, the prediction refinement process with optical flow specified in clause 8.5.6.7 is sbWidth, sbHeight, predSamplesLXLAnd the motion vector difference array diffMv as input and called with the refined predSamplesLXL as output.
- LOtherwise, the array predSamplesLX is coded by coding the sub-block width sbWidth in the luminance samples The decoded subblock height sbHeight, the codec block width cbWidth, the codec block height cbHeight, the luminance position (xSb, ySb), sample array paddedSamplesX [ xsbdx ]][ySbIdx]Sampling array notPaddedSamplesX, luminance Motion vector offset mvOffset, refined luminance motion vector refMvLX [ xSbIdx ]][xSbIdx]Reference array LrefPicLX, bdofllag, and cIdx are pushed as input calls for the fractional sample interpolation process specified in clause 8.5.6.3 And (4) guiding.
Otherwise, if cIdx is equal to 1, the following applies:
the array predSamplesLXCb is derived by calling the fractional sample interpolation process specified in 8.5.6.3 with the luma position (xSb, ySb), the codec sub-block width sbWidth/2, the codec sub-block height sbHeight/2, the chroma motion vector offset mvOffset, the refined chroma motion vector refMvLX [ xsbid ], the reference arrays refPicLXCb, bdofFlag, and cIdx as input.
Else (cIdx equals 2), the following applies:
array predSamplesLXCrBy using the luminance position (xSb, ySb), the width of coding/decoding sub-block sbWidth/2, the height of coding/decoding sub-block sbHeight/2, the chroma motion vector offset mvOffset, and the refined chroma motion vector refMvLX [ xSbIdx [ ]][xSbIdx]Reference array refPicLXCrBdoflag and cIdx are derived as inputs invoking the fractional sample interpolation process specified in clause 8.5.6.3.
-if bdafflag is equal to TRUE, the following applies:
variable shift is set equal to Max (2,14-BitDepth)Y)。
The variables sbDiffThres, bdafBlkDiffThres and sbSumDiff are derived as follows:
sbDiffThres=(1<<(BitDepthY-8+shift))*sbWidth*sbHeight (8-705)
bdofBlkDiffThres=1<<(BitDepthY-3+shift) (8-706)
sbSumDiff=0 (8-707)
for xIdx 0. (sbWidth >2) -1 and yIdx 0. (sbHeight >2) -1, the variables bdofBlkSumDiff and bi-directional optical flow are derived using the flags bdofulizationnflag [ xIdx ] [ yIdx ] as follows:
Figure BDA0003394343540000731
Figure BDA0003394343540000741
bdofUtilizationFlag[xIdx][yIdx]=bdofBlkSumDiff>=bdofBlkDiffThres
(8-709)
sbSumDiff+=bdofBlkSumDiff (8-710)
the variable sbbdafflag is derived as follows:
-if sbSumDiff is smaller than sbdiffthreads, sbbdofllag is set equal to FALSE.
-else, sbbdafflag is set equal to TRUE.
The array of predicted samples predSamples is derived as follows:
-if cIdx equals 0, then the prediction samples predSamples [ x ] inside the current luma codec sub-blockL+xSb][yL+ySb](wherein xLsbWidth-1 and yLsbHeight-1) is derived as follows:
-if sbBdofFlag is equal to TRUE, then the bi-directional optical-flow sample prediction process as specified in clause 8.5.6.4 is to set nCbW equal to luma codec sub-block width sbWidth, nCbH equal to luma codec sub-block height sbHeight, and sample array predSamplesL0LAnd predSamplesL1LAnd the variable predFlagL0[ xSbIdx][ySbIdx]、predFlagL1[xSbIdx][ySbIdx]refIdxL0, refIdxL1, and bdafUtilizationFlag [ xIdx [ ]][yIdx](wherein xIdx ═ 0. (sbWidth)>>2)-1,yIdx=0..(sbHeight>>2) -1) as input and with predSamples [ xL+xSb][yL+ySb]Called as output.
Else (sbBdofFlag equals FALSE), the weighted sample prediction process as specified in clause 8.5.6.5 is with luma codec sub-block width sbWidth, luma codec sub-block height sbHeight, and sample array predSamplesL0LAnd predSamplesL1LAnd the variable predFlagL0[ xSbIdx][ySbIdx]、 predFlagL1[xSbIdx][ySbIdx]refIdxL0, refIdxL1, bcwIdx, and cIdx as inputs and predSamples [ x ]L+xSb][yL+ySb]Called as output.
Else, if cIdx is equal to 1, the prediction samples predSamples [ x ] inside the current chroma component Cb codec sub-blockC+xSb/2][yC+ySb/2](wherein xCsbWidth/2-1 and yCsbHeight/2-1) is determined by sampling the sample array predSamplesL0 with nCbW set equal to sbWidth/2, nCbH set equal to sbHeight/2, and sample array predSamplesL0CbAnd predSamplesL1CbAnd the variable predFlagL0[ xSbIdx][ySbIdx]、predFlagL1[xSbIdx][ySbIdx]refIdxL0, refIdxL1, bcwIdx, and cIdx are derived as inputs invoking the weighted sample point prediction process specified in clause 8.5.6.5.
Else (cIdx equals 2), prediction samples predSamples [ x ] inside the current chroma component Cr codec sub-blockC+xSb/2][yC+ySb/2](wherein xCsbWidth/2-1 and yCsbHeight/2-1) is determined by sampling the sample array predSamplesL0 with nCbW set equal to sbWidth/2, nCbH set equal to sbHeight/2, and sample array predSamplesL0CrAnd predSamplesL1CrAnd the variable predFlagL0[ xSbIdx][ySbIdx]、 predFlagL1[xSbIdx][ySbIdx]refIdxL0, refIdxL1, bcwIdx, and cIdx are derived as inputs invoking the weighted sample point prediction process specified in clause 8.5.6.5.
-when cIdx is equal to 0, the following assignment is made for x 0.. sbWidth-1 and y 0.. sbHeight-1:
MvL0[xSb+x][ySb+y]=mvL0[xSbIdx][ySbIdx] (8-711)
MvL1[xSb+x][ySb+y]=mvL1[xSbIdx][ySbIdx] (8-712)
MvDmvrL0[xSb+x][ySb+y]=refMvL0[xSbIdx][ySbIdx] (8-713)
MvDmvrL1[xSb+x][ySb+y]=refMvL1[xSbIdx][ySbIdx] (8-714)
RefIdxL0[xSb+x][ySb+y]=refIdxL0 (8-715)
RefIdxL1[xSb+x][ySb+y]=refIdxL1 (8-716)
PredFlagL0[xSb+x][ySb+y]=predFlagL0[xSbIdx][ySbIdx] (8-717)
PredFlagL1[xSb+x][ySb+y]=predFlagL1[xSbIdx][ySbIdx] (8-718)
BcwIdx[xSb+x][ySb+y]=bcwIdx (8-719)
when ciip _ flag [ xCb ] [ yCb ] is equal to 1, the array of prediction samples predSamples is modified as follows:
-if cIdx is equal to 0, the following applies:
the general intra sample prediction process as specified in clause 8.4.5.2.5 is to be set equal to IntraPredModey [ xCb ] at a position (xTbCmp, yTbCmp) set equal to (xCb, yCb)][yCb]The intra prediction mode predModeIntra, the transform block width nTbW and height nTbH set equal to cbWidth and cbHeight, the codec block width nCbW and height nCbH set equal to cbWidth and cbHeight, and the variable cIdx as inputs, and the output is assigned to the (cbWidth) x (cbHeight) array predSamplesIntraL
The weighted sample prediction process for combined Merge and intra prediction as specified in clause 8.5.6.6 is with the position (xTbConmp, yTbConmp) set equal to (xCb, yCb), the coding block width cbWidth, the coding block height cbHeight, set equal to predSamples and predSamplesIntra, respectivelyLSample point arrays predsampleInter and predsampleIntra set equal to IntraPredModey [ xCb][yCb]And the color component index cIdx as inputAnd the output is assigned to the (cbWidth) x (cbheight) array predSamples.
Otherwise, if cIdx is equal to 1, the following applies:
the general intra sample prediction procedure as specified in clause 8.4.5.2.5 is to be set equal to IntraPredModey [ xCb ] at a position (xTbConmp, yTbConmp) set equal to (xCb/2, yCb/2)][yCb]The intra prediction mode predModeIntra, the transform block width nTbW and height nTbH set equal to cbWidth/2 and cbHeight/2, the codec block width nCbW and height nCbH set equal to cbWidth/2 and cbHeight/2, and the variable cIdx are called as inputs, and the inputs are assigned to the (cbWidth/2) x (cbHeight/2) array predSamplesIntraCb
The weighted sample prediction procedure for combined Merge and intra prediction as specified in clause 8.5.6.6 is with the position (xTbConmp, yTbConmp) set equal to (xCb, yCb), the coding block width cbWidth/2, the coding block height cbHeight/2, respectively set equal to predSamplesCbAnd predSamplesIntraCbSample point arrays predsampleInter and predsampleIntra set equal to IntraPredModey [ xCb][yCb]And the color component index cIdx, and the output is assigned to the (cbWidth/2) x (cbHeight/2) array predSamples.
Else (cIdx equals 2), the following applies:
the general intra sample prediction procedure as specified in clause 8.4.5.2.5 is to be set equal to IntraPredModey [ xCb ] at a position (xTbConmp, yTbConmp) set equal to (xCb/2, yCb/2)][yCb]The intra prediction mode predModeIntra, the transform block width nTbW and height nTbH set equal to cbWidth/2 and cbHeight/2, the codec block width nCbW and height nCbH set equal to cbWidth/2 and cbHeight/2, and the variable cIdx are called as inputs, and the output is assigned to the (cbWidth/2) x (cbHeight/2) array predSamplesIntraCr
The weighted sample prediction process for combined Merge and intra prediction as specified in clause 8.5.6.6 is to encode and decode the block with the position (xTbConmp, yTbConmp) set equal to (xCb, yCb)A width cbWidth/2, a codec block height cbHeight/2, set equal to predSamples, respectivelyCrAnd predSamplesIntraCrSample point arrays predsampleInter and predsampleIntra set equal to IntraPredModey [ xCb][yCb]And the color component index cIdx, and the output is assigned to the (cbWidth) (cbWidth/2) x (cbHeight/2) array predSamples.
8.5.6.3 fractional sample interpolation process
8.5.6.3.1 general purpose
The inputs to this process are:
-a luminance position (xSb, ySb) specifying an upper left sample of the current codec sub-block relative to an upper left luminance sample of the current picture,
a variable sbWidth specifying the width of the current codec sub-block,
a variable sbHeight specifying the height of the current codec subblock,
-a motion vector offset mvOffset,
-a refined motion vector refMvLX,
-the selected reference picture sample array refPicLX,
-a bi-directional optical flow flag bdofllag,
a variable cIdx specifying the color component index of the current block.
The outputs of this process are:
-an array of (sbWidth + borderExtension [ [ bdofOffset ] ]) x (sbHeight + borderExtension [ [ bdofOffset ] ]) predicted sample value (sdWidth + borderExtension [ [ bdofOffset ] ]) predSamplesLX.
The prediction block boundary extension borderExtension [ [ bidirectional optical flow boundary offset bdofOffset ] ] is derived as follows:
borderExtension[[bdofOffset]]=(bdofFlag||inter_affine_flag[xSb][ySb])? 2:0 (8-720)
-if cIdx is equal to 0, the following applies:
let (xIntL, yinll) be the luminance position given in full-pel units and (xFracL, yFracL) be the offset given in 1/16-pel units. These variables are used only in this clause to specify the fractional sample positions within the reference sample array refPicLX.
-for each luminance sample position (x) within the predicted luminance sample array predSamplesLXL=0..sbWidth-1+borderExtension [[bdofOffset]],yL=0..sbHeight-1+borderExtension[[bdofOffset]]),
Corresponding predicted luminance sample value predSamplesLX [ x ]L][yL]Is derived as follows:
-variable xtintL、yIntL、xFracLAnd yFracLIs derived as follows:
xIntL=xSb+(refMvLX[0]>>4)+xL (8-721)
yIntL=ySb+(refMvLX[1]>>4)+yL (8-722)
xFracL=refMvLX[0]&15 (8-723)
yFracL=refMvLX[1]&15 (8-724)
-predicting the luma sample value predSamplesLX [ x ] if bdafflag equals TRUE and one or more of the following conditions are TRUEL][yL]Is obtained by (xtint)L,yIntL)[[, (xFracL,yFracL)]]And refPicLX is derived as an input invoking the luma integer sample point extraction process as specified in clause 8.5.6.3.3:
-xLequal to 0.
-xLEqual to sbWidth + 1.
-yLEqual to 0.
-yLEqual to sbHeight + 1.
Else, if inter _ affine _ flag [ xSb ]][ySb]Equal to TRUE, and one or more of the following conditions is TRUE, then the luma sample value predSamplesLX [ x ] is predictedL][yL]Is obtained by (xIntRounded)L,yIntRoundedL) And refPicLX is derived as an input call to the luminance integer sample extraction process as specified in clause 8.5.6.3.3.
-xLEqual to 0.
-xLEqual to sbWidth + 1.
-yLEqual to 0.
-yLEqual to sbHeight + 1.
xIntRoundedLAnd yIntRoundedLIs derived as follows:
xIntRoundedL=xIntL+(xFracL>>3)
yIntRoundedL=yIntL+(yFracL>>3)
otherwise, the following applies:
-the motion vector mvLX is set equal to (refMvLX-mvOffset).
For dir ═ 0..1, the list padVal [ dir ] is derived as follows:
the variable disp is derived as follows:
disp=(refMvLX[dir]>>4)-(mvLX[dir]>>4)+(dir==0xL:yL)
(8-725)
-if disp is less than 0, padVal [ dir ] is set equal to disp.
Otherwise, if disp is greater than (dir ═ 0sbWidth: sbHeight) -1, padVal [ dir ] is set equal to disp- ((dir ═ 0sbWidth: sbHeight) -1).
Else padVal [ dir ] is set equal to 0.
The predicted luma sample value predSamplesLX [ xL ] [ yL ] is derived by invoking the luma sample point 8 tap interpolation filtering process as specified in clause 8.5.6.3.2 with (xtintl, yIntL), (xFracL, yFracL), refPicLX, sbWidth, sbHeight, (xSb, ySb) and padVal as inputs.
-otherwise (cIdx not equal to 0), the following applies:
let (xtintc, yIntC) be the chroma position given in full-pel units and (xFracC, yFracC) be the offset given in 1/32-pel units. These variables are used only in this clause to specify the general fractional sample position within the reference sample array refPicLX.
For each chroma sample position (xC 0.. sbWidth-1, yC 0.. sbHeight-1) within the predicted chroma sample array predSamplesLX, the corresponding predicted chroma sample value predSamplesLX [ xC ] [ yC ] is derived as follows:
the variables xontc, yIntC, xFracC and yFracC are derived as follows:
xIntC=(xSb/SubWidthC)+(mvLX[0]>>5)+xC (8-726)
yIntC=(ySb/SubHeightC)+(mvLX[1]>>5)+yC (8-727)
xFracC=mvLX[0]&31 (8-728)
yFracC=mvLX[1]&31 (8-729)
-the motion vector mvLX is set to (refMvLX-mvOffset).
For dir ═ 0..1, the list padVal [ dir ] is derived as follows:
the variable disp is derived as follows:
disp=(refMvLX[dir]>>4)-(mvLX[dir]>>4)+(dir==0xC:yC)
(8-730)
-if disp is less than 0, padVal [ dir ] is set equal to disp.
Otherwise, if disp is greater than (dir ═ 0 sbWidth/subpadthc: sbHeight/subpadthc) -1, padVal [ dir ] is set equal to disp- ((dir ═ 0 sbWidth/subpadthc: sbHeight/subpadthc) -1).
Else padVal [ dir ] is set equal to 0.
The predicted sample point value predSamplesLX [ xC ] [ yC ] is derived by calling the process specified in clause 8.5.6.3.4 with (xIntC, yitc), (xFracC, yFracC), refPicLX, and padVal as inputs.
Filling process of 8.5.6.x optical flow process
The inputs to this process are:
two variables sbWidth and sbHeight specifying the width and height of the current subblock,
two variables bWidth and bHeight specifying the width and height of the current subblock,
-one (bWidth +2) x (bHeight +2) predicted sample array paddedSamples
8.5.6.7 prediction refinement process using optical flow
The inputs to this process are:
two variables sbWidth and sbHeight specifying the width and height of the current subblock,
-two variables cbWidth and cbHeight, specifying the width and height of the current block,
-the luminance position (xSb, ySb),
-one (sbWidth +2) x (sbHeight +2) predicted sample array paddedSamples
-One cbWidth x cbHeight prediction sample point array nopaddedSamples
-one (sbWidthxsHeight) motion vector difference array diffMv
The output of this process is an array of predicted sample values (sbWidth) x (sbheight) pbSamples.
The variables bitDepth and shift1 are derived as follows:
variable shift1 is set equal to Max (6, bitDepth-6).
The variable dILimit is set equal to 1< (14-1).
The variable paddingW is derived as Min (16, cbWidth).
The variable paddingH is derived as Min (16, cbHeight).
(sbWidth +2) x (sbHeight +2) sample array predSamples is derived as:
predSamples[x][y]is set equal to paddedSamples x][y]Wherein x is 1sbWidth,y =1sbHeight。
If ySb% paddingH equals 0, predSamples [ x ]][0]Is set equal to paddedSamples [x][0]Wherein x is 1sbWidth. Otherwise, predSamples [ x][0]Is set equal to nopaddedSamples [ x + xSb-1][ySb-1]Wherein x is 1sbWidth。
If (ySb + sbHeight)%paddingH equals 0, then predSamples [ x][sbHeight+1]Is set up Is equal to paddedSamples [ x ]][sbHeight+1]Wherein x is 1sbWidth. Otherwise, predSamples [ x] [sbHeight+1]Is set equal to nopaddedSamples [ x + xSb-1 [ ]][ySb+sbHeight]Wherein x is 1sbWidth。
If xSb% paddingW is equal to 0, predSamples [0][y]Is set equal to paddedSamples [0][y]Wherein y is 1sbHeight. Otherwise, predSamples [0][y]Is set equal to nopaddedSamples [xSb-1][ySb+y-1]Wherein y is 1sbHeight。
If (xSb + sbWidth)% paddingW is equal to 0, predSamples [ sbWidth +1][y]Is arranged as Equal to paddedSamples [ sbWidth + 1]][y]Wherein y is 1sbHeight. Otherwise, predSamples [ sbWidth + 1][y]Is set equal to nopaddedSamples [ xSb + sbWidth [ ]][ySb+y-1]Wherein y is 1sbHeight。
For x 0.. sbWidth-1 and y 0.. sbHeight-1, the following ordered procedure applies:
the variables gradientH [ x ] [ y ] and gradientV [ x ] [ y ] are derived as follows:
gradientH[x][y]=(predSamples[x+ 2][y]-predSamples[x][y])>>shift1
gradientV[x][y]=(predSamples[x][y+ 2]-predSamples[x][y])>>shift1
the variable dI is derived as follows:
dI=gradientH[x][y]*diffMv[x][y][0]+gradientV[x][y]* diffMv[x][y][1]
-the predicted sample values at positions (x, y) in the sub-block are derived as follows:
pbSamples[x][y]=predSamples[x+1][y+1]+Clip3(-dILimit,dILimit-1,(d1+1)>>1))
5.2 draft work on bullets 22.
The working draft is based on JFET-O2001.
Changes in JFET-O0070 are in bold and italic. Deleted text is marked with double brackets (e.g., [ [ a ] ] representing the deleted character "a").
8.5.5.9 derivation of motion vector arrays from affine control point motion vectors
……
The variable cbproffllaglx is derived as follows:
-cbprofflagllx is set equal to FALSE if one or more of the following conditions is true.
Affine _ prof _ enabled _ flag is equal to 0.
-fallback modeltrigged equals 1.
-numCpMv equals 2, and cpmvLX [1] [0] equals cpmvLX [0] [0], and cpmvLX [1] [1] equals cpmvLX [0] [1 ].
-numCpMv equals 3, and cpmvLX [1] [0] equals cpmvLX [0] [0], and cpmvLX [1] [1] equals cpmvLX [0] [1], and cpmvLX [2] [0] equals cpmvLX [0] [0], and cpmvLX [2] [1] equals cpmvLX [0] [1 ].
-otherwise, cbproffllaglx is set equal to TRUE.
If cbProfFlagLX is 1, the motion vector difference array diffMv is derived as follows:
the variables sbWidth and sbHeight are derived as follows:
sbWidth=cbWidth/numSbX
sbHeight=cbHeight/numSbY
-the variable bitDepth is set equal to bitDepthYAnd variable shift1 is set equal to Max (6, bitDepth-6).
The variable dmvLimit is set equal to 1< < shift 1.
The variables posOffsetX and posOffsetY are derived as follows:
posOffsetX=6*dHorX+6*dVerX
posOffsetY=6*dHorY+6*dVerY
for x 0.. sbWidth-1 and y 0.. sbHeight-1, the following applies:
the following applies:
diffMv[x][y][0]=x*(dHorX<<2)+y*(dVerX<<2)–posOffsetX
diffMv[x][y][1]=x*(dHorY<<2)+y*(dVerY<<2)–posOffsetY
for i ═ 0..1, the following applies:
the rounding process for the motion vector as specified in clause 8.5.2.14 is invoked with mvX set equal to diffMv [ x ] [ y ] [ i ], rightShift set equal to 7, and leftShift set equal to 0 as inputs and the rounded diffMv [ x ] [ y ] [ i ] as output.
diffMv [ x ] [ y ] [ i ] is clipped as follows:
diffMv[x][y][i]=Clip3(-dmvLimit,dmvLimit-1,diffMv[x][y][i])
5.2 work draft of bullets 23.
The working draft is based on JFET-O2001.
Changes in JFET-O0070 are in bold and italic. Deleted text is marked with double brackets (e.g., [ [ a ] ] representing the deleted character "a").
7.3.2.3 sequence parameter set RBSP syntax
Figure BDA0003394343540000831
7.3.6 stripe head grammar
7.3.6.1 general purpose Bandwidth header grammar
Figure BDA0003394343540000832
The SPS _ bdofprof _ dmvr _ slice _ present _ flag equal to 1 specifies that slice _ disable _ bdofprof _ dmvr _ flag is present in the slice header of the reference SPS. The SPS _ bdofprof _ dmvr _ slice _ present _ flag equal to 0 specifies that the slice _ disable _ bdofprof _ dmvr _ flag is not present in the slice header of the reference SPS. When the sps _ bdofprof _ dmvr _ slice _ present _ flag is not present, the value of sps _ bdofprof _ dmvr _ slice _ present _ flag is inferred to be equal to 0.
Slice _ disable _ bdofprof _ dmvr _ flag equal to 1 specifies that bi-directional optical flow inter prediction, prediction refinement with optical flow, and decoder motion vector refinement based inter bi-prediction are not enabled in the current slice. Slice _ disable _ bdofprof _ dmvr _ flag equal to 0 specifies that bi-directional optical flow inter prediction, prediction refinement with optical flow, or decoder motion vector refinement based inter bi-directional prediction may be enabled or disabled in the current slice. When slice _ disable _ bdofprof _ dmvr _ flag is not present, the value of slice _ disable _ prof _ bdofdmvr _ flag is inferred to be 0.
8.5.1 general decoding procedure for codec units that codec in inter prediction mode
……
-dmvrFlag is set equal to 1 when all of the following conditions are true:
-sps _ dmvr _ enabled _ flag is equal to 1, and slice _ disable _ bdef _ prof _ dmvr _ flag is equal to 0
-general _ merge _ flag [ xCb ] [ yCb ] equal to 1
predFlagL0[0] [0] and predFlagL1[0] [0] both equal 1
-mmvd _ merge _ flag [ xCb ] [ yCb ] equal to 0
-ciip _ flag [ xCb ] [ yCb ] equal to 0
DiffPicoderCnt (currPic, RefPicList [0] [ refIdxL0]) equals DiffPicoderCnt (RefPicList [1] [ refIdxL1], currPic)
BcwIdx [ xCb ] [ yCb ] equals 0
Luma _ weight _ l0_ flag [ refIdxL0] and luma _ weight _ l1_ flag [ refIdxL1] are both equal to 0
-cbWidth greater than or equal to 8
-cbHeight greater than or equal to 8
-cbHeight cbWidth greater than or equal to 128
For each of X0 and 1, pic _ width _ in _ luma _ samples and pic _ height _ in _ luma _ samples of the reference picture refPicLX associated with the refIdxLX are equal to pic _ width _ in _ luma _ samples and pic _ height _ in _ luma _ samples, respectively, of the current picture.
……
8.5.6.1
-bdafflag is set to TRUE if all of the following conditions are TRUE.
-sps _ bdofenabled _ flag is equal to 1, and slice _ disable _ bdofprof _ dmvr _ flag is equal to 0.
predFlagL0[ xSbIdx ] [ ySbIdx ] and predFlagL1[ xSbIdx ] [ ySbIdx ] are both equal to 1.
-DiffPicOrderCnt (currPic, RefPicList [0] [ refIdxL0]) DiffPicOrderCnt (currPic, RefPicList [1] [ refIdxL1]) is less than 0.
-MotionModeldldc [ xCb ] [ yCb ] equals 0.
-merge _ sublock _ flag [ xCb ] [ yCb ] is equal to 0.
-sym _ mvd _ flag [ xCb ] [ yCb ] is equal to 0.
-ciip _ flag [ xCb ] [ yCb ] is equal to 0.
BcwIdx [ xCb ] [ yCb ] equals 0.
Luma _ weight _ l0_ flag [ refIdxL0] and luma _ weight _ l1_ flag [ refIdxL1] are both equal to 0.
-cbWidth greater than or equal to 8.
-cbHeight greater than or equal to 8.
-cbHeight cbWidth greater than or equal to 128.
For each of X0 and 1, pic _ width _ in _ luma _ samples and pic _ height _ in _ luma _ samples of the reference picture refPicLX associated with the refIdxLX are equal to pic _ width _ in _ luma _ samples and pic _ height _ in _ luma _ samples, respectively, of the current picture.
-cIdx equals 0.
Else, bdafflag is set equal to FALSE.
……
8.5.5.9
……
The variable cbproffllaglx is derived as follows:
-cbproffllaglx is set equal to FALSE if one or more of the following conditions is true.
Affine _ prof _ enabled _ flag is equal to 0.
-slice _ disable _ bdef _ prof _ dmvr _ flag is equal to 1.
-fallback modeltrigged equals 1.
-numCpMv equals 2, and cpmvLX [1] [0] equals cpmvLX [0] [0], and cpmvLX [1] [1] equals cpmvLX [0] [1 ].
-numCpMv is equal to 3, and cpmvLX [1] [0] is equal to cpmvLX [0] [0], and cpmvLX [1] [1] is equal to cpmvLX [0] [1], and cpmvLX [2] [0] is equal to cpmvLX [0] [0], and cpmvLX [2] [1] is equal to cpmvLX [0] [1 ].
-otherwise, cbproffllaglx is set equal to TRUE.
……
The examples described above may be incorporated in the context of the methods described below (e.g., methods 2900, 2920, 2940, and 2960) that may be implemented at a video decoder or video encoder.
Fig. 29A shows a flow diagram of an exemplary method for video processing. The method 2910 includes, at step 2912, making a first determination as to a codec mode for representing a current video block of the video in a codec representation of the video. Method 2910 also includes, at step 2914, making a second determination as to whether to apply a deblocking filter based on the first determination. Method 2910 further includes, at step 2916, performing a conversion between the current video block and the codec representation based on the first determination and the second determination. In some embodiments, the codec mode uses an affine codec tool and a specific motion prediction/compensation tool for the conversion.
Fig. 29B shows a flow diagram of an exemplary method for video processing. The method 2920 includes, at step 2922, determining to enable use of the switchable interpolation filter tool due to use of a particular motion vector precision in the affine codec tool for representing a current video block of the video in the codec representation of the video. Method 2920 further includes, at step 2924, performing a switch based on the determination, where the switchable interpolation filter tool allows switching for the current video block to another interpolation filter that is different from the interpolation filter used to process the previous video block.
Fig. 29C shows a flow diagram of an exemplary method for video processing. The method 2930 includes, at step 2932, making a decision regarding applicability of bi-directional optical flow (BDOF) and/or motion information to use Predictive Refined Optical Flow (PROF) that refines optical flow of a current video block based on use of a switchable interpolation filter tool that allows the current video block and another video block to use different interpolation filters for determining a prediction block for a current video block of a video including one or more video blocks. The method 2930 further includes, at step 2934, performing a conversion between the video and the codec representation of the video based on the decision.
Fig. 29D shows a flow diagram of an exemplary method for video processing. Method 2940 includes, at step 2942, performing a conversion between a video block of a video region of the video and a codec representation of the video according to a rule. In some embodiments, the rule specifies that the first syntax element is included in the codec representation at a level of the video region corresponding to applicability of a codec tool or decoder-side motion vector refinement tool based on an optical flow model, and the conversion is performed according to a value of the first syntax element.
5. Example embodiments of the disclosed technology
Fig. 30A is a block diagram of the video processing apparatus 3000. The apparatus 3000 may be used to implement one or more of the methods described herein. The apparatus 3000 may be embodied in a smartphone, tablet, computer, Internet of Things (IoT) receiver, or the like. The apparatus 3000 may include one or more processors 3002, one or more memories 3004, and video processing hardware 3006. Processor(s) 3002 may be configured to implement one or more methods described in this document (including, but not limited to, method 2900). The memory(s) 3004 may be used to store data and code for implementing the methods and techniques described herein. The video processing hardware 3006 may be used to implement some of the techniques described in this document in hardware circuitry.
Fig. 30B is another example of a block diagram of a video processing system in which the disclosed techniques may be implemented. Fig. 30B is a block diagram illustrating an example video processing system 4100 in which various techniques disclosed herein may be implemented. Various embodiments may include some or all of the components of system 4100. The system 4100 can include an input 4102 for receiving video content. The video content may be received in a raw or uncompressed format, e.g., 8 or 10 bit multi-component pixel values, or may be in a compressed or encoded format. Input 4102 may represent a network interface, a peripheral bus interface, or a storage interface. Examples of Network interfaces include wired interfaces such as ethernet, Passive Optical Network (PON), etc., and wireless interfaces such as Wi-Fi or cellular interfaces.
The system 4100 can include a codec component 4104 that can implement various codec or encoding methods described in this document. The codec component 4104 can reduce the average bit rate of the video from the input 4102 to the output of the codec component 4104 to produce a codec representation of the video. Codec techniques are therefore sometimes referred to as video compression or video transcoding techniques. The output of the codec component 4104 can be stored or transmitted via a communication connection as represented by component 4106. The stored or communicated bitstream (or codec) of the video received at input 4102 represents displayable video that may be used by component 4108 to generate pixel values or communicated to display interface 4110. The process of generating user-viewable video from a bitstream representation is sometimes referred to as video decompression. Further, while certain video processing operations are referred to as "codec" operations or tools, it will be understood that codec tools or operations are used at the encoder and that corresponding decoding tools or operations that reverse the codec results will be performed by the decoder.
Examples of the peripheral Bus Interface or the display Interface may include a Universal Serial Bus (USB), or a High Definition Multimedia Interface (HDMI), or a Displayport (Displayport), and the like. Examples of storage interfaces include SATA (Serial Advanced Technology Attachment), PCI, IDE interfaces, and the like. The techniques described in this document may be embodied in various electronic devices, such as mobile phones, laptops, smart phones, or other devices capable of performing digital data processing and/or video display.
Some embodiments of the disclosed technology include making a decision or determination to enable a video processing tool or mode. In an example, when a video processing tool or mode is enabled, the encoder will use or implement the tool or mode in the processing of the video blocks, but may not necessarily modify the resulting bitstream based on the use of the tool or mode. That is, when a video processing tool or mode is enabled based on the decision or determination, the conversion from a block of video to a bitstream representation of the video will use that video processing tool or mode. In another example, when a video processing tool or mode is enabled, the decoder will process the bitstream knowing that the bitstream has been modified based on the video processing tool or mode. That is, the conversion from a bitstream representation of the video to blocks of the video will be performed using a video processing tool or mode that is enabled based on the decision or determination.
Some embodiments of the disclosed technology include making a decision or determination to disable a video processing tool or mode. In an example, when a video processing tool or mode is disabled, the encoder will not use that tool or mode in the conversion of blocks of video to bitstream representations of video. In another example, when a video processing tool or mode is disabled, the decoder will process the bitstream knowing that the bitstream was not modified using the disabled video processing tool or mode based on the decision or determination.
In this document, the term "video processing" may refer to video encoding, video decoding, video compression, or video decompression. For example, a video compression algorithm may be applied during the conversion from a pixel representation of the video to a corresponding bitstream representation, and vice versa. The bitstream representation of the current video block may, for example, correspond to bits collocated or scattered at different locations within the bitstream, as defined by the syntax. For example, a macroblock may be encoded from the transformed and coded error residual values and also using bits in the header and other fields in the bitstream.
It should be appreciated that the disclosed methods and techniques would be beneficial to video encoder and/or decoder embodiments incorporated within video processing devices, such as smart phones, laptops, desktops, and the like, by allowing the use of the techniques disclosed in this document.
In some embodiments, the video encoding method may be implemented using an apparatus implemented on a hardware platform as described with reference to fig. 30A or fig. 30B.
The various techniques and embodiments may be described using the following clause-based format.
The first set of terms describes certain features and aspects of the disclosed technology in the previous section.
1. A method for video processing, comprising: performing a gradient calculation in a first region of the current video block, wherein a size (M × N) of the first region is different from a size of a sub-block of the current video block for motion compensation in an affine mode, and wherein M and N are positive integers; and performing a conversion between the current video block and a bitstream representation of the video comprising the current video block based on the gradient calculation.
2. The method of clause 1, wherein the size of the first region is greater than the size of the sub-block.
3. The method of clause 1 or2, wherein M and N are predefined positive integers.
4. The method of clause 1 or2, wherein the size of the first region is based on the size of the sub-block.
5. The method of clause 1, wherein M/N is adaptively changed.
6. The method of clause 1, wherein M and N are based on the dimensions of the current video block.
7. The method of any of clauses 1-6, wherein M has a minimum value Mmin, and wherein N has a minimum value Nmin.
8. The method of clause 7, wherein Mmin-Nmin-8.
9. The method of any of clauses 1-6, wherein the first region is filled to generate a first filled region having a size of (M + dM) × (N + dN).
10. The method of clause 9, wherein the samples in the first region or the first filled region are derived based on motion compensation with interpolation filtering.
11. The method of clause 1, wherein at least one sample point in the first region is omitted when performing the gradient calculation.
12. The method of clause 1, wherein the gradient computation is performed at a first precision in bi-directional optical flow (BDOF) and at a second precision in predictive refinement with optical flow (PROF), and wherein the first precision and the second precision are equal.
13. A method for video processing, comprising: making a decision regarding selectively applying a coding tool to the current video block based on selectively applying predictive refinement with optical flow (PROF) to the current video block, wherein the coding tool is different from the PROF; and performing a conversion between the current video block and a bitstream representation of the video that includes the current video block based on the determination.
14. The method of clause 13, wherein the PROF is not applied and the codec tool is applied.
15. The method of clause 13, wherein the coding tool comprises generalized bi-prediction.
16. The method of clause 15, wherein PROF is not applied, and wherein the index associated with generalized bi-prediction is not zero.
17. The method of clause 13, wherein the coding tool is local illumination compensation.
18. The method of clause 13, wherein the codec tool is a Multiple Transform Set (MTS).
19. The method of clause 18, wherein PROF is applied and only the default transform from MTS is applied to the current video block.
20. The method of clause 13, wherein the coding tool is weighted prediction.
21. A method for video processing, comprising: during a transition between a current video block and a bitstream representation of a video that includes the current video block, a decision is made regarding selectively applying a predictive refinement with optical flow (PROF) operation, wherein the decision is based on color information of the current video block.
22. The method of clause 21, wherein the PROF operation is not applied to one or more chroma components of the current video block, and wherein the color information comprises a 4:0:0 color format.
23. The method of clause 21, wherein the PROF operation is applied to one or more chroma components of the current video block, and wherein the color information comprises a 4:4:4 color format.
24. The method of clause 21, wherein the PROF operation is applied to one or more chroma components of the current video block, and wherein the color information comprises a 4:0:0 color format.
25. The method of clause 21, wherein the PROF operation is applied, and wherein the color information comprises a plurality of color components
26. The method of clause 25, wherein the one or more gradients of the PROF operation are calculated independently for each of the plurality of color components.
27. The method of clause 25, wherein the one or more gradients of the PROF operation are calculated for a first color component of the plurality of color components and reused for a second color component of the plurality of color components.
28. The method of clause 26 or 27, wherein the accuracy of the gradient is based on at least one of the plurality of color components.
29. A method for video processing, comprising: making a decision regarding selectively applying a predictive refinement with optical flow (PROF) operation based on the height (H) or width (W) of the current video block; and performing a conversion between the current video block and a bitstream representation of the video that includes the current video block based on the determination.
30. The method of clause 29, wherein the PROF operation is applied to the luma component of the current video block.
31. The method of clause 29, wherein the current video block is coded using affine mode.
32. The method of clause 31, wherein the PROF operation is not applied, wherein W ≦ T1 and/or H ≦ T2, and wherein T1 ≦ T2 ≦ 16.
33. The method of clause 31, wherein PROF operations are not applied, wherein W ≧ T1 and/or H ≧ T2, and wherein T1 ≧ T2 ≧ 64.
34. The method of clause 31, wherein the PROF operation is not applied, wherein W × H ≦ T or max (W, H) ≦ T, and wherein T ≦ 16.
35. The method of clause 31, wherein the PROF operation is not applied, wherein W H ≧ T or min (W, H) ≧ T, and wherein T64.
36. The method of clause 1 or2, wherein the size of the current video block is W × H, wherein M ═ min (K, W), and wherein K is an integer.
37. The method of clause 1 or2, wherein the size of the current video block is W × H, wherein N ═ min (K, H), and wherein K is an integer.
38. The method of clause 36 or 37, wherein K-16.
39. The method of clause 1 or2, further comprising:
before performing the gradient calculation, a padding process is performed in the first region of the current video block.
40. The method of clause 39, wherein performing the padding process comprises deriving one or more motion vectors.
41. The method of clause 40, wherein the one or more motion vectors comprise a motion vector derived from an affine model oriented to the particular location of the first region.
42. The method of clause 40, wherein the one or more motion vectors comprise a motion vector derived from at least one motion vector of at least one sub-block of the first region.
43. The method of clause 39, wherein performing the padding process is based on a height or width of the current video block.
44. The method of clause 39, wherein performing the padding process is based on a signaling in a Video Parameter Set (VPS), a Decoder Parameter Set (DPS), a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), an Adaptive Parameter Set (APS), a slice header, a slice group header, a Codec Tree Unit (CTU), or a Codec Unit (CU).
45. The method of clause 5 or 6, wherein M and N are signaled in a Video Parameter Set (VPS), a Decoder Parameter Set (DPS), a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), an Adaptive Parameter Set (APS), a slice header, a slice group header, a Codec Tree Unit (CTU), or a Codec Unit (CU).
46. The method of clause 5 or 6, wherein M and N are specified in a profile, level, or hierarchy of video codec standards.
47. A method of video processing, comprising: determining applicability of a codec mode from a codec representation of video that includes a plurality of video blocks based on a field in the codec representation of a video region level, wherein the video region level includes one or more video blocks; and performing a conversion between the codec representation and the plurality of video blocks using a result of the determination such that the codec mode is selectively used when determining applicability to the video region.
48. The method of clause 47, wherein the video region comprises a video strip.
49. The method of any of clauses 47-48, wherein the codec mode comprises a bi-directional optical flow mode or a prediction refinement mode that utilizes optical flow or a decoder-side motion vector refinement mode.
50. The method of any of clauses 47-49, wherein the determining comprises inferring that the codec mode is disabled based on detecting a value of or absence of a field in the codec representation.
51. The method of any of clauses 47-50, wherein the determining further comprises determining the presence of another field at another video region level.
52. The method of any of clauses 47-49, wherein the determining comprises inferring that the codec mode is enabled based on detecting a value of a field or a presence of a field in the codec representation.
53. The method according to any of clauses 47 and 49-52, wherein the video region comprises a video picture.
54. The method of any of clauses 47-53, wherein the converting comprises encoding the video to generate the codec representation.
55. The method of any of clauses 47-53, wherein the converting comprises decoding the codec representation to generate the video.
56. An apparatus in a video system comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to implement the method of any of clauses 1-55.
57. A video encoder comprising a processor or circuitry configured to implement the method according to one or more of clauses 1-55.
58. A video decoder comprising a processor or circuitry configured to implement the method according to one or more of clauses 1-55.
59. A computer program product stored on a non-transitory computer readable medium, the computer program product comprising program code for performing the method according to any of clauses 1 to 55.
The second set of terms describes certain features and aspects of the disclosed technology in the previous sections (including, for example, example embodiments 18-21, 23, and 24).
1. A video processing method, comprising: making a first determination as to a codec mode for representing a current video block of a video in a codec representation of the video; based on the first determination, making a second determination as to whether to apply a deblocking filter; and performing a transformation between the current video block and the codec representation based on the first determination and the second determination, wherein the codec mode uses an affine codec tool and a particular motion prediction/compensation tool for the transformation.
2. The method of clause 1, wherein the particular motion prediction/compensation tool comprises an interleaved prediction, wherein the interleaved prediction comprises partitioning the current video block into a first set of sub-blocks according to a first mode and partitioning the current video block into a second set of sub-blocks according to a second mode, wherein at least one sub-block in the second set has a different dimension than the sub-blocks in the first set.
3. The method of clause 1 or2, wherein the particular motion prediction/compensation tool comprises a phase-varying affine sub-block motion compensation tool in which filters having different phases are applied to each row of samples and each column of samples in the sub-block of the current video block.
4. The method of any of clauses 1-3, wherein the particular motion prediction/compensation tool comprises a Predicted Refined Optical Flow (PROF) in which the motion information is refined using optical flow applied to the current video block.
5. The method of any of clauses 2-4, wherein the deblocking filter is not applied to the current video block if at least one of interleaved prediction, PROF, or phase-varying affine sub-block motion compensation is applied to the current video block.
6. The method of any of clauses 2-4, wherein, where at least one of interleaved prediction, PROF, or phase-varying affine sub-block motion compensation is applied to the current video block, the deblocking filter is applied to boundaries of sub-blocks of the current video block with less intensity than is applied to another video block.
7. The method of clauses 2-4, wherein the deblocking filter is applied to the current video block in the event that at least one of interleaved prediction, PROF, or phase-varying affine sub-block motion compensation is not applied to the current video block.
8. The method of any of clauses 1-7, wherein performing the conversion comprises generating a codec representation from the video or generating the video from the codec representation.
9. A video processing method, comprising: determining to enable use of a switchable interpolation filter tool due to use of a particular motion vector precision in an affine codec tool for representing a current video block of a video in a codec representation of the video; and performing a conversion based on the determination, wherein the switchable interpolation filter tool allows switching for the current video block to another interpolation filter that is different from the interpolation filter used to process the previous video block.
10. The method of clause 9, wherein the particular motion vector precision is 1/2 pixels or 1/4 pixels.
11. The method of clause 9 or 10, wherein performing the conversion comprises generating a codec representation from the video or generating the video from the codec representation.
12. A video processing method, comprising: for a current video block of a video comprising one or more video blocks, making a decision regarding applicability of bi-directional optical flow (BDOF) and/or motion information to use Predictive Refined Optical Flow (PROF) that refines optical flow of the current video block based on use of a switchable interpolation filter tool that allows the current video block and another video block to use different interpolation filters for determining prediction blocks; and based on the decision, performing a conversion between the video and a codec representation of the video.
13. The method of clause 12, wherein BDOF is not applied where the switchable interpolation filter tool is used for the current video block.
14. The method of clause 12, wherein whether BDOF and/or PROF is applied to the current block is based on an interpolation filter for the current video block and/or a motion vector precision corresponding to the interpolation filter.
15. The method of any of clauses 12-14, wherein BDOF is not applied because a particular motion vector precision is used to represent the current video block of the video.
16. The method of any of clauses 12-14, wherein BDOF is not applied due to the use of a particular interpolation filter that is either an optional half-pixel precision filter or a default half-pixel precision filter.
17. The method of any of clauses 12-14, wherein, where the switchable interpolation filter tool is used for a current video block, no PROF is applied.
18. The method of any of clauses 12-14, wherein no PROF is applied because a particular motion vector precision is used to represent the current video block of the video.
19. The method of any of clauses 12-14, wherein PROF is not applied due to the use of a particular interpolation filter that is an optional half-pixel precision filter or a default half-pixel precision filter.
20. The method of any of clauses 12-19, wherein performing a conversion comprises generating a codec representation from a video or generating a video from a codec representation.
21. A video processing method, comprising: the conversion between the video block of the video region of the video and the codec representation of the video is performed according to a rule, wherein the rule specifies that the first syntax element is included in the codec representation at a level of the video region corresponding to applicability of a codec tool or a decoder-side motion vector refinement tool based on an optical flow model, and wherein the conversion is performed according to a value of the first syntax element.
22. The method of clause 21, wherein the video region comprises a video strip or a picture.
23. The method of clause 21, wherein the coding tool comprises at least one of bi-directional optical flow (BDOF), Predictive Refined Optical Flow (PROF), or decoder-side motion vector refinement (DMVR).
24. The method of any of clauses 21 to 23, wherein the rule specifies that, in the event that the first syntax element is not included in the codec representation, no codec tool is applied.
25. The method of any of clauses 21 to 23, wherein the rule specifies that the first syntax element is only included if a codec tool is applied at a sequence level in the codec representation.
26. The method of any of clauses 21 to 23, wherein the rule further specifies a second syntax element for indicating the presence of the first syntax element.
27. The method of clause 26, wherein the second syntax element is signaled at another video region level to indicate that the first syntax element is included in the codec representation.
28. The method of clause 26, wherein the absence of the second syntax element in the codec representation indicates that the syntax element is not included in the codec representation.
29. The method of any of clauses 21 to 23, wherein in the event that the first syntax element indicates that no coding tools are used, no coding tools are applied.
30. The method of any of clauses 21 to 29, wherein performing a conversion comprises generating a codec representation from a video or generating a video from a codec representation.
31. An apparatus in a video system comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to implement the method of any of clauses 1 to 30.
32. A computer program product stored on a non-transitory computer readable medium, the computer program product comprising program code for performing the method according to any of clauses 1 to 30.
From the foregoing it will be appreciated that specific embodiments of the presently disclosed technology have been described herein for purposes of illustration, but that various modifications may be made without deviating from the scope of the invention. Accordingly, the presently disclosed technology is not limited except as by the appended claims.
Implementations of the subject matter and the functional operations described in this patent document can be implemented in various systems, digital electronic circuitry, or in computer software, firmware, or hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer program products, i.e., one or more modules of computer program instructions encoded on a tangible and non-transitory computer readable medium for execution by, or to control the operation of, data processing apparatus. The computer readable medium can be a machine-readable storage device, a machine-readable storage substrate, a memory device, a combination of substances which affect a machine-readable propagated signal, or a combination of one or more of them. The term "data processing unit" or "data processing apparatus" encompasses all apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can include, in addition to hardware, code that creates an execution environment for the computer program in question, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.
A computer program (also known as a program, software application, script, or code) can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program does not necessarily correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub programs, or portions of code). A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communication network.
The processes and logic flows described in this specification can be performed by one or more programmable processors executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (Field Programmable Gate Array) or an ASIC (Application Specific Integrated Circuit).
Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer does not require such a device. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
It is intended that the specification and figures be considered as exemplary only, with an exemplary meaning being exemplary. As used herein, the use of "or" is intended to include "and/or" unless the context clearly indicates otherwise.
While this patent document contains many specifics, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this patent document in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Furthermore, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Moreover, the separation of various system components in the embodiments described in this patent document should not be understood as requiring such separation in all embodiments.
Only some embodiments and examples are described and other embodiments, enhancements and variations can be made based on what is described and illustrated in this patent document.

Claims (32)

1. A video processing method, comprising:
making a first determination as to a codec mode for representing a current video block of a video in a codec representation of the video;
based on the first determination, making a second determination as to whether to apply a deblocking filter; and
performing a conversion between the current video block and the codec representation based on the first determination and the second determination,
wherein the codec mode uses an affine codec tool and a specific motion prediction/compensation tool for the conversion.
2. The method of claim 1, wherein the particular motion prediction/compensation tool comprises an interleaved prediction, wherein the interleaved prediction comprises partitioning a current video block into a first set of sub-blocks according to a first mode and partitioning the current video block into a second set of sub-blocks according to a second mode, wherein at least one sub-block in the second set has a different dimension than sub-blocks in the first set.
3. The method of claim 1 or2, wherein the particular motion prediction/compensation tool comprises a phase-varying affine sub-block motion compensation tool in which filters having different phases are applied to each row of samples and each column of samples in a sub-block of a current video block.
4. The method of any of claims 1-3, wherein the particular motion prediction/compensation tool comprises a Prediction Refined Optical Flow (PROF) in which motion information is refined using optical flow applied to a current video block.
5. The method of any of claims 2-4, wherein in the event that at least one of interleaved prediction, PROF, or phase-varying affine sub-block motion compensation is applied to the current video block, the deblocking filter is not applied to the current video block.
6. The method of any of claims 2-4, wherein in the case that at least one of interleaved prediction, PROF, or phase-varying affine sub-block motion compensation is applied to the current video block, the deblocking filter is applied to boundaries of sub-blocks of the current video block with less intensity than is applied to another video block.
7. The method of claims 2-4, wherein the deblocking filter is applied to the current video block in the event that at least one of interleaved prediction, PROF, or phase-varying affine sub-block motion compensation is not applied to the current video block.
8. The method of any of claims 1 to 7, wherein performing a conversion comprises generating a codec representation from a video or generating a video from a codec representation.
9. A video processing method, comprising:
determining to enable use of a switchable interpolation filter tool due to use of a particular motion vector precision in an affine codec tool for representing a current video block of a video in a codec representation of the video; and
a conversion is performed based on the determination,
wherein the switchable interpolation filter tool allows switching to another interpolation filter for the current video block that is different from the interpolation filter used to process the previous video block.
10. The method of claim 9, wherein the particular motion vector precision is 1/2 pixels or 1/4 pixels.
11. The method according to claim 9 or 10, wherein performing a conversion comprises generating a codec representation from the video or generating the video from the codec representation.
12. A video processing method, comprising:
for a current video block of a video comprising one or more video blocks, making a decision regarding applicability of bi-directional optical flow (BDOF) and/or motion information to use Predictive Refined Optical Flow (PROF) that refines optical flow of the current video block based on use of a switchable interpolation filter tool that allows the current video block and another video block to use different interpolation filters for determining prediction blocks; and
based on the decision, a conversion between the video and a codec representation of the video is performed.
13. The method of claim 12, wherein BDOF is not applied if a switchable interpolation filter tool is used for the current video block.
14. The method of claim 12, wherein whether the BDOF and/or PROF is applied to the current block is based on an interpolation filter for the current video block and/or a motion vector precision corresponding to the interpolation filter.
15. The method of any of claims 12-14, wherein BDOF is not applied due to the use of a particular motion vector precision for representing a current video block of a video.
16. The method of any of claims 12 to 14, wherein BDOF is not applied due to the use of a particular interpolation filter that is a selectable half-pixel precision filter or a default half-pixel precision filter.
17. The method of any of claims 12-14, wherein, in case a switchable interpolation filter tool is used for the current video block, no PROF is applied.
18. The method of any of claims 12-14, wherein PROF is not applied due to the use of a particular motion vector precision for representing a current video block of the video.
19. The method of any of claims 12 to 14, wherein PROF is not applied due to the use of a particular interpolation filter that is either an optional half-pixel precision filter or a default half-pixel precision filter.
20. The method of any of claims 12 to 19, wherein performing a conversion comprises generating a codec representation from a video or generating a video from a codec representation.
21. A video processing method, comprising:
the conversion between video blocks of a video region of the video and the codec representation of the video is performed according to rules,
wherein the rule specifies that the first syntax element is included in the codec representation at a level of the video region corresponding to applicability of a codec-based tool or decoder-side motion vector refinement tool based on an optical flow model, and wherein the conversion is performed according to a value of the first syntax element.
22. The method of claim 21, wherein the video region comprises a video strip or a picture.
23. The method of claim 21, wherein the coding tools comprise at least one of bi-directional optical flow (BDOF), Predictive Refined Optical Flow (PROF), or decoder-side motion vector refinement (DMVR).
24. The method of any of claims 21 to 23, wherein the rule specifies that, in the event that the first syntax element is not included in the codec representation, no codec tool is applied.
25. The method of any of claims 21 to 23, wherein the rule specifies that the first syntax element is only included if a codec tool is applied at a sequence level in the codec representation.
26. The method of any of claims 21-23, wherein the rule further specifies a second syntax element for indicating the presence of the first syntax element.
27. The method according to claim 26, wherein the second syntax element is signaled at another video region level to indicate that the first syntax element is included in the codec representation.
28. The method of claim 26, wherein an absence of the second syntax element in the coded representation indicates that a syntax element is not included in the coded representation.
29. The method of any of claims 21 to 23, wherein in the event that the first syntax element indicates that no coding tools are used, no coding tools are applied.
30. The method of any of claims 21 to 29, wherein performing a conversion comprises generating a codec representation from a video or generating a video from a codec representation.
31. An apparatus in a video system comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to implement the method of any of claims 1-30.
32. A computer program product stored on a non-transitory computer readable medium, the computer program product comprising program code for performing the method of any of claims 1-30.
CN202080041806.9A 2019-06-05 2020-06-03 Interaction between motion vector refinement and other codec tools Active CN114503596B (en)

Applications Claiming Priority (7)

Application Number Priority Date Filing Date Title
CNPCT/CN2019/090201 2019-06-05
CN2019090201 2019-06-05
CNPCT/CN2019/094767 2019-07-04
CN2019094767 2019-07-04
CN2019096180 2019-07-16
CNPCT/CN2019/096180 2019-07-16
PCT/CN2020/094156 WO2020244545A1 (en) 2019-06-05 2020-06-03 Interaction between motion vector refinements and other coding tools

Publications (2)

Publication Number Publication Date
CN114503596A true CN114503596A (en) 2022-05-13
CN114503596B CN114503596B (en) 2023-12-29

Family

ID=73653054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202080041806.9A Active CN114503596B (en) 2019-06-05 2020-06-03 Interaction between motion vector refinement and other codec tools

Country Status (2)

Country Link
CN (1) CN114503596B (en)
WO (1) WO2020244545A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024192895A1 (en) * 2023-03-20 2024-09-26 Beijing Xiaomi Mobile Software Co., Ltd. Encoding/decoding video picture data

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022228430A1 (en) * 2021-04-27 2022-11-03 Beijing Bytedance Network Technology Co., Ltd. Method, device, and medium for video processing
EP4258666A1 (en) * 2022-04-07 2023-10-11 Beijing Xiaomi Mobile Software Co., Ltd. Encoding/decoding video picture data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150016550A1 (en) * 2013-07-12 2015-01-15 Qualcomm Incorporated Adaptive filtering in video coding
CN104396248A (en) * 2012-10-12 2015-03-04 韩国电子通信研究院 Image encoding/decoding method and device using same
US20170134750A1 (en) * 2014-06-19 2017-05-11 Sharp Kabushiki Kaisha Image decoding device, image coding device, and predicted image generation device
US20180098066A1 (en) * 2016-10-05 2018-04-05 Qualcomm Incorporated Systems and methods of switching interpolation filters

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2014202921B2 (en) * 2014-05-29 2017-02-02 Canon Kabushiki Kaisha Method, apparatus and system for de-blocking a block of video samples
WO2019070770A1 (en) * 2017-10-02 2019-04-11 Arris Enterprises Llc System and method for reducing blocking artifacts and providing improved coding efficiency

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104396248A (en) * 2012-10-12 2015-03-04 韩国电子通信研究院 Image encoding/decoding method and device using same
US20150016550A1 (en) * 2013-07-12 2015-01-15 Qualcomm Incorporated Adaptive filtering in video coding
US20170134750A1 (en) * 2014-06-19 2017-05-11 Sharp Kabushiki Kaisha Image decoding device, image coding device, and predicted image generation device
US20180098066A1 (en) * 2016-10-05 2018-04-05 Qualcomm Incorporated Systems and methods of switching interpolation filters

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHUN-CHI CHEN: "BoG report on CE2 sub-block based motion prediction related contributions", 《JVET-N0776-V4,JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024192895A1 (en) * 2023-03-20 2024-09-26 Beijing Xiaomi Mobile Software Co., Ltd. Encoding/decoding video picture data

Also Published As

Publication number Publication date
WO2020244545A1 (en) 2020-12-10
CN114503596B (en) 2023-12-29

Similar Documents

Publication Publication Date Title
CN113711609B (en) Incremental motion vectors in predictive refinement using optical flow
CN113728626B (en) Region-based gradient computation in different motion vector refinements
US11825113B2 (en) Interaction between intra block copy mode and inter prediction tools
CN113711608B (en) Suitability of predictive refinement procedure with optical flow
CN110933420A (en) Fast algorithm for adaptive motion vector resolution in affine mode
CN112956197A (en) Restriction of decoder-side motion vector derivation based on coding information
CN110662041B (en) Method and apparatus for video bitstream processing, method of storing video bitstream, and non-transitory computer-readable recording medium
CN113412623A (en) Recording context of affine mode adaptive motion vector resolution
CN114503596B (en) Interaction between motion vector refinement and other codec tools
CN115918080A (en) Affine prediction improvement for video coding and decoding
CN111010570B (en) Affine motion information based size restriction
CN113678444A (en) Entropy coding and decoding of affine mode with adaptive motion vector resolution

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant