Index sorting for Bidirectional Prediction by CU-level Weights (BCW) using template matching
By employing template matching to determine optimal CU-level weights for bi-prediction in video coding, the method addresses the inefficiencies in current video coding techniques, enhancing coding efficiency and compression ratios.
Patent Information
- Application Number
- JP2023553293
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-10-21
- Filing Date
- 2022-10-26
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-10-26
AI Technical Summary
Current video coding techniques face challenges in efficiently encoding and decoding videos due to the complexity of intra-prediction modes and the increasing number of possible prediction directions, which affects coding efficiency and compression ratios.
The proposed solution involves using template matching (TM) to reorder bi-prediction with CU-level weights (BCW) by determining the respective TM cost for each BCW candidate weight, based on the current template and bidirectional predictor templates, and selecting the optimal BCW weights for reconstructing the current block.
This approach improves coding efficiency by selecting the most suitable BCW weights based on template matching costs, leading to better compression ratios and reduced computational complexity in video encoding and decoding processes.
Smart Images

Figure 0007648786000022 
Figure 0007648786000023 
Figure 0007648786000024
Abstract
Description
[Technical field]
[0001] [Incorporated by reference] This application claims benefit of priority to U.S. patent application Ser. No. 17 / 971,255, entitled "INDEX REORDERING OF BI-PREDICTION WITH CU-LEVEL WEIGHT (BCW) BY USING TEMPLATE-MATCHING," filed on October 21, 2022, which claims benefit of priority to U.S. Provisional Application No. 63 / 274,286, entitled "INDEX REORDERING OF BI-PREDICTION WITH CU-LEVEL WEIGHT (BCW) BY USING TEMPLATE-MATCHING," filed on November 1, 2021, and U.S. Provisional Application No. 63 / 289,135, entitled "INDEX REORDERING OF BI-PREDICTION WITH CU-LEVEL WEIGHT (BCW) BY USING TEMPLATE-MATCHING," filed on December 13, 2021. The disclosure of the prior application is incorporated by reference in its entirety.
[0002] [Technical field] This disclosure describes embodiments generally related to video coding. [Background technology]
[0003] The background discussion provided herein is intended to generally present the context of the present disclosure. Work of the inventors named in this application, to the extent that their work is described in this background section, and aspects of this description that may not otherwise qualify as prior art at the time of filing, are not admitted, either explicitly or implicitly, as prior art to the present disclosure.
[0004] An uncompressed digital image and / or video may include a sequence of pictures, each having spatial dimensions of, for example, 1920x1080 luminance samples and associated chrominance samples. The sequence of pictures may have a fixed or variable picture rate (also informally known as frame rate), for example, 60 pictures per second or a picture rate of 60 Hz. Uncompressed images and / or videos have specific bitrate requirements. For example, 1080p60 4:2:0 video (1920x1080 luminance sample resolution at a frame rate of 60 Hz) with 8 bits per sample requires a bandwidth approaching 1.5 Gbit / s. One hour of such video requires more than 600 Gbytes of storage space.
[0005] One objective of image and / or video encoding and decoding may be the reduction of redundancy in the input image and / or video signal through compression. Compression may help to reduce the aforementioned bandwidth and / or storage space requirements, in some cases by more than one order of magnitude. Although the description herein uses video encoding / decoding as an illustrative example, the same techniques may be equally applicable to image encoding / decoding without departing from the spirit of this disclosure. Both lossless and lossy compression, as well as combinations thereof, may be used. Lossless compression refers to techniques whereby an exact copy of the original signal can be reconstructed from the compressed original signal. When using lossy compression, the reconstructed signal may not be identical to the original signal, but the distortion between the original and reconstructed signals is small enough to make the reconstructed signal useful for the intended application. For video, lossy compression is widely used. The amount of acceptable distortion depends on the application, e.g., users of a particular consumer streaming application may tolerate higher distortion than users of a television distribution application. The achievable compression ratio may reflect that a higher tolerable / acceptable distortion can result in a higher compression ratio.
[0006] Video encoders and decoders can utilize techniques from a number of broad categories, including, for example, motion compensation, transform processing, quantization, and entropy coding.
[0007] Video codec techniques can include a technique known as intra-coding. In intra-coding, sample values are represented without reference to samples or other data from previously reconstructed reference pictures. In some video codecs, a picture is spatially divided into blocks of samples. If all blocks of samples are coded in intra mode, the picture may be an intra picture. Intra pictures and their derivatives, such as independent decoder refresh pictures, can be used to reset the decoder state and thus can be used as the first picture in a coded video bitstream and video session or as a still image. Samples of an intra block can be subjected to a transform, and the transform coefficients can be quantized before entropy coding. Intra prediction can be a technique that minimizes sample values in the pre-transform domain. In some cases, the smaller the DC value and the smaller the AC coefficients after the transform, the fewer bits are needed for a given quantization step size to represent the block after entropy coding.
[0008] Traditional intra-coding, e.g., as used in MPEG-2 generation coding techniques, does not use intra-prediction. However, some newer video compression techniques include techniques that attempt to perform prediction based on, e.g., surrounding sample data and / or metadata obtained during the encoding / decoding of a block of data. Such techniques are referred to below as "intra-prediction" techniques. Note that, at least in some cases, intra-prediction uses only reference data from the current picture being reconstructed, and not from reference pictures.
[0009] There may be various forms of intra prediction. If more than one such technique is available for a given video coding technique, the particular technique used may be coded as a particular intra prediction mode using the particular technique. In certain cases, an intra prediction mode may have sub-modes and / or parameters that may be coded separately or may be included in a mode codeword that defines the prediction mode. Which codeword is used for a given mode, sub-mode and / or parameter combination may affect the coding efficiency gain through intra prediction, as well as the entropy coding technique used to convert the codeword into a bitstream.
[0010] Certain modes of intra prediction were introduced in H.264, refined in H.265, and further refined in newer coding techniques such as the Joint Exploration Model (JEM), Versatile Video Coding (VVC), and Benchmark Set (BMS). A predictor block can be formed using neighboring sample values of already available samples. The sample values of the neighboring samples are copied to the predictor block according to a certain direction. The reference to the direction used can be coded in the bitstream or it may be predicted itself.
[0011] Referring to FIG. 1A, at the bottom right, a subset of 9 known predictor directions is depicted from the 33 possible predictor directions defined in H.265 (corresponding to the 33 angle modes out of the 35 intra modes). The point (101) where the arrows converge represents the sample to be predicted. The arrows represent the direction in which the sample is predicted. For example, arrow (102) indicates that sample (101) is predicted from the sample(s) to the top right and at an angle of 45 degrees from the horizontal. Similarly, arrow (103) indicates that sample (101) is predicted from the sample(s) to the bottom left of sample (101), at an angle of 22.5 degrees from the horizontal.
[0012] 1A, at the top left, a square block (104) of 4×4 samples is depicted (indicated by a thick dashed line). The square block (104) contains 16 samples, each labeled with an “S” and its position in the Y dimension (e.g., row index) and its position in the X dimension (e.g., column index). For example, sample S21 is the second sample (from the top) in the Y dimension and the first sample (from the left) in the X dimension. Similarly, sample S44 is the fourth sample in the block (104) in both the Y and X dimensions. Since the block is 4×4 samples in size, S44 is at the bottom right. Additionally, a reference sample is shown that follows a similar numbering scheme. The reference sample is labeled R and its Y position (e.g., row index) and X position (column index) relative to the block (104). In both H.264 and H.265, the predicted samples are neighbors of the block being reconstructed, so there is no need to use negative values.
[0013] Intra-picture prediction can work by copying reference sample values from neighboring samples indicated by a signaled prediction direction. For example, assume that the coded video bitstream includes signaling for this block indicating a prediction direction that is consistent with the arrow (102). That is, the sample is predicted from the top right sample at an angle of 45 degrees from the horizontal. Then samples S41, S32, S23, and S14 are predicted from the same reference sample R05. Then sample S44 is predicted from reference sample R08.
[0014] In certain cases, especially when the direction is not divisible by 45 degrees, the values of multiple reference samples may be combined, for example by interpolation, to calculate the reference sample.
[0015] As video coding techniques have developed, the number of possible directions has increased. In H.264 (2003), nine different directions could be represented. This increased to 33 in H.265 (2013). Currently, JEM / VVC / BMS can support up to 65 directions. Experiments are performed to identify the most likely directions, and specific techniques in entropy coding are used to represent those more likely directions with a small number of bits, while accepting some penalty for the less likely directions. Furthermore, the direction itself can sometimes be predicted from nearby directions used in nearby already decoded blocks.
[0016] FIG. 1B shows a schematic diagram (110) depicting 65 intra prediction directions with JEM to illustrate the increasing number of prediction directions over time.
[0017] The mapping of intra-prediction direction bits in the coded video bitstream to represent directions can vary from one video coding technique to another. Such mappings can range, for example, from simple direct mappings to complex adaptation schemes involving codewords, most probable modes, and similar techniques. However, in most cases, there may be certain directions that are statistically less likely to occur in the video content than other certain directions. Since the goal of video compression is to reduce redundancy, in a well-performing video coding technique, such less likely ways are represented by a larger number of bits than more probable directions.
[0018] Image and / or video encoding and decoding can be performed using inter-picture prediction with motion compensation. Motion compensation can be a lossy compression technique and can refer to a technique in which blocks of sample data from a previously reconstructed picture or part thereof (reference picture) are used for prediction of a newly reconstructed picture or part thereof after being spatially shifted in a direction indicated by a motion vector (hereinafter MV). In some cases, the reference picture can be the same as the picture currently being reconstructed. The MV can have two dimensions, X and Y, or three dimensions, with the third dimension being an indication of the reference picture used (which can indirectly be the temporal dimension).
[0019] In some video compression techniques, the MV applicable to a region of sample data can be predicted from other MVs, e.g., from an MV associated with another region of sample data that is spatially adjacent to the region being reconstructed and precedes it in decoding order. Doing so can significantly reduce the amount of data required to encode the MV, thereby removing redundancy and increasing compression. MV prediction can work effectively because, for example, when encoding an input video signal derived from a camera (known as natural video), there is a statistical probability that regions larger than the region to which a single MV is applicable move in a similar direction and can therefore be predicted, in certain cases, using similar motion vectors derived from the MVs of nearby regions. As a result, the MV found for a given region will be similar or identical to the MV predicted from the surrounding MVs, which, after entropy encoding, can be represented with fewer bits than would be used if encoding the MVs directly. In some cases, MV prediction can be an example of lossless compression of a signal (i.e., an MV) derived from the original signal (i.e., a sample stream). In other cases, the MV prediction itself may be lossy, for example due to rounding errors in computing the predictor from several surrounding MVs.
[0020] Various MV prediction mechanisms are described in H.265 / HEVC (ITU-T Rec. H.265, "High Efficiency Video Coding", December 2016). Among the many MV prediction mechanisms provided by H.265, one that will be described with reference to FIG. 2 is a technique hereafter referred to as "spatial merge".
[0021] Referring to Figure 2, a current block (201) contains samples that the encoder found during the motion search process to be predictable from a previous block of the same size but spatially shifted. Instead of directly encoding its MV, the MV can be derived from metadata associated with one or more reference pictures, for example from the most recent reference picture (in decoding order) using MVs associated with any of the five surrounding samples, denoted A0, A1, and B0, B1, B2 (202-206, respectively). In H.265, MV prediction can use predictors from the same reference picture that neighboring blocks use. Summary of the Invention
[0022] Aspects of the disclosure provide methods and apparatus for video encoding and decoding. In some examples, the apparatus for video decoding includes a processing circuit. The processing circuit is configured to decode prediction information for a current block in a current picture from a coded video bitstream. The prediction information indicates that the current block is predicted with bi-prediction with CU-level weights (BCW). The processing circuit can perform template matching (TM) for each BCW candidate weight by determining a respective TM cost corresponding to each of the respective BCW candidate weights. Each TM cost can be determined based at least on a current template for the current block and a portion or all of a respective bi-directional predictor template. The bi-directional predictor template can be determined based on the respective BCW candidate weights, a portion or all of a first reference template in a first reference picture, and a portion or all of a second reference template in a second reference picture. The first reference template and the second reference template correspond to a current template. The portion of the first reference template and the portion of the second reference template correspond to a portion of the current template. The processing circuitry can perform TM for each BCW candidate weight by selecting, based on the respective determined TM costs, from the respective BCW candidate weights, a BCW candidate weight to be used to reconstruct the current block. The processing circuitry can reconstruct the current block based on the selected BCW weight.
[0023] In one embodiment, the processing circuitry sorts the BCW candidate weights based on their respective determined TM costs and selects a BCW candidate weight from the sorted BCW candidate weights to be the BCW weight.
[0024] In one embodiment, all of the current templates are used to determine each TM cost. For each BCW candidate weight, all of the first reference templates determined based on a first motion vector (MV) of the current block are used to calculate the bidirectional predictor template, and all of the second reference templates determined based on a second MV of the current block are used to calculate the bidirectional predictor template.
[0025] In one example, for each BCW candidate weight, the bidirectional predictor template is a weighted average of all of the first reference templates and all of the second reference templates, where the weights of the weighted average are based on the respective BCW candidate weight.
[0026] In one example, the prediction information indicates that the current block is predicted in an affine adaptive motion vector prediction (AMVP) mode with multiple control points, where the first MV and the second MV are associated with a control point among the multiple control points.
[0027] In one embodiment, the shape of the current template is based on one or more of: (i) reconstructed samples of neighboring blocks of the current block; (ii) the decoding order of the current block; or (iii) the size of the current block.
[0028] In one example, the current template includes one or more reconstruction regions that are adjacent regions of the current block.
[0029] In one example, the one or more reconstruction regions that are neighboring regions of the current block are one of (i) a left neighboring region and an upper neighboring region, (ii) a left neighboring region, an upper neighboring region and an upper left neighboring region, (iii) an upper neighboring region, or (iv) a left neighboring region.
[0030] In one embodiment, the prediction information indicates that the current block is predicted in affine mode. The current template includes a current subblock, and the portion of the current template used to determine each TM cost is one of the current subblocks. For each BCW candidate weight, the first reference template includes a first reference subblock that corresponds to the current subblock, and the portion of the first reference template used to calculate the bidirectional predictor template is one of the first reference subblocks. The second reference template includes a second reference subblock that corresponds to the current subblock, and the portion of the second reference template used to calculate the bidirectional predictor template is one of the second reference subblocks. The bidirectional predictor template is based on the respective BCW candidate weight, one of the first reference subblocks, and one of the second reference subblocks.
[0031] In one example, for each BCW candidate weight, the bidirectional predictor template is a weighted average of one of the first reference subblocks and one of the second reference subblocks, where the weights of the weighted average are based on the respective BCW candidate weight.
[0032] In one example, the BCW candidate weights are normalized by 8, 16 or 32.
[0033] In one embodiment, a processing circuit decodes prediction information for a current block in a current picture from a coded video bitstream. The processing circuit determines that the prediction information indicates that (1) the current block is predicted with bi-prediction and (2) bi-prediction of coding unit (CU) level weights (BCW) is valid for the current block. The processing circuit performs template matching (TM) for each BCW candidate weight by determining a respective TM cost corresponding to each of the respective BCW candidate weights. Each TM cost is determined based at least on a current template for the current block and some or all of a respective bi-predictor template. The bi-predictor template is based on the respective BCW candidate weight, some or all of a first reference template in a first reference picture, and some or all of a second reference template in a second reference picture. The first reference template and the second reference template correspond to the current template. The processing circuit reorders the BCW candidate weights based on the respective determined TM costs. The processing circuitry reconstructs the current block based on the reordered BCW candidate weights.
[0034] Aspects of the present disclosure also provide a non-transitory computer-readable storage medium storing a program executable by at least one processor to perform a method for video decoding. [Brief description of the drawings]
[0035] Further features, nature and various advantages of the disclosed subject matter will become more apparent from the following detailed description and the accompanying drawings. [Figure 1A] FIG. 2 is a schematic diagram of an example subset of intra-prediction modes. [Figure 1B] FIG. 2 is an illustration of an exemplary intra-prediction direction. [Diagram 2] An example of a current block (201) and its surrounding samples in one example is shown. [Diagram 3] FIG. 3 is a schematic diagram of an example block diagram of a communication system (300). [Figure 4] FIG. 4 is a schematic diagram of a simplified block diagram of a communication system (400) according to an embodiment. [Diagram 5] FIG. 2 is a schematic diagram of an example block diagram of a decoder. [Figure 6] FIG. 2 is a schematic diagram of an example block diagram of an encoder; [Figure 7] 1 shows a block diagram of an exemplary encoder. [Figure 8] 1 shows a block diagram of an exemplary decoder. [Figure 9] 1 illustrates locations of spatial merge candidates according to one embodiment of the present disclosure. [Figure 10] 1 illustrates candidate pairs considered for redundancy checking of spatial merge candidates according to one embodiment of the present disclosure. [Figure 11] 13 illustrates an example motion vector scaling for temporal merge candidates. [Figure 12] 13 illustrates example candidate positions for temporal merge candidates for the current coding unit. [Figure 13A] 1 shows an example of an affine prediction mode using a four-parameter model. [Figure 13B] 1 shows an example of an affine prediction mode using a six-parameter model. [Figure 14] 1 illustrates an example of sub-block based affine transform prediction. [Figure 15] 1 illustrates an example of determining control point motion vector (CPMV) candidates in an affine merge list of a current coding unit (CU). [Figure 16] 1 shows examples of spatial and temporal neighbors of the current block. [Figure 17] An example of template matching will be given below. [Figure 18] An example of template matching when the current block is coded in affine mode will be described below. [Figure 19]13 illustrates an example of template matching applied to bidirectional prediction (BCW) candidate weights with CU-level weights when a current block is predicted using BCW. [Figure 20A] 13 illustrates an exemplary current template for a current block that can be used in template matching based BCW index reordering. [Figure 20B] 13 illustrates an exemplary current template for a current block that can be used in template matching based BCW index reordering. [Figure 20C] 13 illustrates an exemplary current template for a current block that can be used in template matching based BCW index reordering. [Figure 20D] 13 illustrates an exemplary current template for a current block that can be used in template matching based BCW index reordering. [Figure 21] 4 shows an example of template matching applied to BCW candidate weights when the current block is coded in affine mode. [Figure 22] We present an example of the prediction refinement using optical flow (PROF) method. [Diagram 23] 4 shows an example of template matching applied to BCW candidate weights when the current block is coded in affine mode. [Figure 24] 1 shows a flowchart outlining an encoding process according to one embodiment of the present disclosure. [Diagram 25] 1 shows a flowchart outlining a decoding process according to one embodiment of the present disclosure. [Figure 26] 1 shows a flowchart outlining a decoding process according to one embodiment of the present disclosure. [Figure 27] FIG. 1 is a schematic diagram of a computer system according to one embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0036] FIG. 3 illustrates an example block diagram of a communication system (300). The communication system (300) includes a plurality of terminal devices that can communicate with each other, for example, via a network (350). For example, the communication system (300) includes a first pair of terminal devices (310) and (320) interconnected via the network (350). In the example of FIG. 3, the first pair of terminal devices (310) and (320) perform a unidirectional transmission of data. For example, the terminal device (310) may encode video data (e.g., a stream of video pictures captured by the terminal device (310)) for transmission to the other terminal device (320) via the network (350). The encoded video data may be transmitted in the form of one or more encoded video bitstreams. The terminal device (320) may receive the encoded video data from the network (350), decode the encoded video data to reconstruct the video pictures, and display the video pictures according to the reconstructed video data. One-way data transmission may be common, such as in media service applications.
[0037] In another example, the communication system (300) includes a second pair of terminal devices (330) and (340) performing bidirectional transmission of encoded video data, for example during a video conference. For the bidirectional transmission of data, in one example, each of the terminal devices (330) and (340) may encode video data (e.g., a stream of video pictures captured by the terminal device) for transmission to the other of the terminal devices (330) and (340) over the network (350). Each of the terminal devices (330) and (340) may receive the encoded video data transmitted by the other of the terminal devices (330) and (340), decode the encoded video data to reconstruct the video pictures, and display the video pictures on an accessible display device in accordance with the reconstructed video data.
[0038] In the example of FIG. 3, terminal devices (310), (320), (330), and (340) are shown as a server, a personal computer, and a smartphone, respectively, although the principles of the present disclosure may not be so limited. Embodiments of the present disclosure find application in laptop computers, tablet computers, media players, and / or dedicated video conferencing equipment. Network (350) represents any number of networks that convey encoded video data between terminal devices (310), (320), (330), and (340), including, for example, wired (wired) and / or wireless communication networks. Communications network (350) may exchange data in circuit-switched and / or packet-switched channels. Exemplary networks include telecommunications networks, local area networks, wide area networks, and / or the Internet. For purposes of discussion herein, the architecture and topology of network (350) may not be important to the operation of the present disclosure, unless otherwise described below.
[0039] 4 shows a video encoder and a video decoder in a streaming environment as an example of an application for the disclosed subject matter. The disclosed subject matter may be equally applicable to other video-enabled applications including, for example, video conferencing, digital TV, streaming services, storage of compressed video on digital media including CDs, DVDs, memory sticks, etc.
[0040] The streaming system may include a video source (401), e.g., a digital camera, and may include a capture subsystem (413) that generates, e.g., a stream of uncompressed video pictures (402). In one example, the stream of video pictures (402) includes samples captured by a digital camera. The stream of video pictures (402), depicted as a thick line to emphasize its high data volume compared to the encoded video data (404) (or encoded video bitstream), may be processed by an electronic device (420) that includes a video encoder (403) coupled to the video source (401). The video encoder (403) may include hardware, software, or a combination thereof to enable or implement aspects of the disclosed subject matter, as described in more detail below. The encoded video data (404) (or encoded video bitstream), depicted as a thin line to emphasize its lower data volume compared to the stream of video pictures (402), may be stored in a streaming server (405) for future use. One or more streaming client subsystems, such as the client subsystems (406) and (408) of FIG. 4, can access the streaming server (405) to retrieve copies (407) and (409) of the encoded video data (404). The client subsystem (406) can include a video decoder (410), for example within an electronic device (430). The video decoder (410) decodes an input copy (407) of the encoded video data and generates an output stream (411) of video pictures that can be rendered on a display (412) (e.g., a display screen) or other rendering device (not shown). In some streaming systems, the encoded video data (404), (407), and (409) (e.g., a video bitstream) can be encoded according to a particular video encoding / compression standard. Examples of these standards include ITU-T Recommendation H.265.In one example, the developing video coding standard is informally known as Versatile Video Coding (VVC), and the disclosed subject matter may be used in the context of VVC.
[0041] It is noted that electronic devices 420 and 430 may include other components (not shown). For example, electronic device 420 may include a video decoder (not shown), and electronic device 430 may also include a video encoder (not shown).
[0042] 5 shows an example block diagram of a video decoder (510). The video decoder (510) can be included in an electronic device (530). The electronic device (530) can include a receiver (531) (e.g., a receiving circuit). The video decoder (510) can be used in place of the video decoder (310) in the example of FIG. 4.
[0043] The receiver (531) may receive one or more coded video sequences to be decoded by the video decoder (510). In some embodiments, one coded video sequence is received at a time, and the decoding of each coded video sequence is independent of the decoding of the other coded video sequences. The coded video sequences may be received from a channel (501), which may be a hardware / software link to a storage device that stores the coded video data. The receiver (531) may receive the coded video data together with other data, such as coded audio data and / or auxiliary data streams, which may be forwarded to respective usage entities (not shown). The receiver (531) may separate the coded video sequences from the other data. To combat network jitter, a buffer memory (515) may be coupled between the receiver (531) and the entropy decoder / parser (520) (hereinafter the "parser"). In certain applications, the buffer memory (515) is part of the video decoder (510). In other applications, it may be external to the video decoder (510) (not shown). In still other applications, there may be a buffer memory (not shown) external to the video decoder (510), e.g., to combat network jitter, and yet another buffer memory (515) internal to the video decoder (510), e.g., to handle playback timing. If the receiver (531) is receiving data from a store / forward device of sufficient bandwidth and controllability, or from an isochronous network, the buffer memory (515) may not be needed or may be small. For use with best-effort packet networks such as the Internet, the buffer memory (515) may be required and may be relatively large, advantageously of adaptive size, and may be implemented at least in part in an operating system or similar element (not shown) external to the video decoder (510).
[0044] The video decoder (510) may include a parser (520) for reconstructing symbols (521) from the coded video sequence. These categories of symbols include information used to manage the operation of the video decoder (510) and potentially information for controlling a rendering device such as a render device (512) (e.g., a display screen). The rendering device may not be an integral part of the electronic device (530) as shown in FIG. 5, but may be coupled to the electronic device (530). The control information for the rendering device(s) may be in the form of Supplementary Enhancement Information (SEI messages) or Video Usability Information (VUI) parameter set fragments (not shown). The parser (520) may parse / entropy decode the received coded video sequence. The coding of the coded video sequence may follow a video coding technique or standard and may follow various principles including variable length coding, Huffman coding, arithmetic coding with or without context sensitivity, etc. The parser (520) can extract from the coded video sequence a set of subgroup parameters for at least one of the subgroups of pixels in the video decoder based on at least one parameter corresponding to the group. The subgroups can include Groups of Pictures (GOPs), pictures, tiles, slices, macroblocks, Coding Units (CUs), blocks, Transform Units (TUs), Prediction Units (PUs), etc. The parser (520) can also extract information from the coded video sequence, such as transform coefficients, quantizer parameter values, motion vectors, etc.
[0045] The parser (520) can perform an entropy decoding / parsing operation on the video sequence received from the buffer memory (515) to generate symbols (521).
[0046] The reconstruction of symbols (521) can involve several different units, depending on the type of coded video picture or portions thereof (e.g., inter and intra pictures, inter and intra blocks) and other factors. Which units are involved and how can be controlled by subgroup control information parsed by the parser (520) from the coded video sequence. The flow of such subgroup control information between the parser (520) and the following units is not depicted for clarity.
[0047] In addition to the functional blocks already mentioned, the video decoder (510) can be conceptually divided into a number of functional units, as described below. In a practical implementation operating under commercial constraints, many of these units will interact closely with each other and may be at least partially integrated with each other. However, for purposes of describing the disclosed subject matter, the following conceptual subdivision into functional units is adequate.
[0048] The first unit is a scalar / inverse transform unit (551). The scalar / inverse transform unit (551) receives quantized transform coefficients and control information as symbol(s) (521) from the parser (520). The control information includes which transform to use, block size, quantization factor, quantization scaling matrix, etc. The scalar / inverse transform unit (551) can output blocks containing sample values that can be input to an aggregator (555).
[0049] In some cases, the output samples of the scaler / inverse transform (551) may relate to intra-coded blocks, which are blocks that do not use prediction information from a previously reconstructed picture, but can use prediction information from a previously reconstructed portion of the current picture. Such prediction information may be provided by an intra-picture prediction unit (552). In some cases, the intra-picture prediction unit (552) generates a block of the same size and shape as the block being reconstructed using surrounding already reconstructed information taken from a current picture buffer (558). The current picture buffer (558) buffers, for example, a partially reconstructed current picture and / or a fully reconstructed current picture. The aggregator (555) optionally adds, on a sample-by-sample basis, the prediction information generated by the intra-prediction unit (552) to the output sample information provided by the scaler / inverse transform unit (551).
[0050] In other cases, the output samples of the scalar / inverse transform unit (551) may relate to an inter-coded, potentially motion-compensated block. In such cases, the motion compensation prediction unit (553) may access a reference picture memory (557) to fetch samples used for prediction. After motion compensating the fetched samples according to the symbols (521) for the block, these samples may be added by an aggregator (555) to the output of the scalar / inverse transform unit (in this case referred to as residual samples or residual signals) to generate output sample information. The addresses in the reference picture memory (557) from which the motion compensation unit (553) fetches prediction samples may be controlled by motion vectors available to the motion compensation unit (553) in the form of symbols (521). The symbols may have, for example, X, Y, and reference picture components. Motion compensation may include interpolation of sample values fetched from the reference picture memory (557) when subsample accurate motion vectors are used, motion vector prediction mechanisms, and the like.
[0051] The output samples of the aggregator (555) may be subjected to various loop filtering techniques in a loop filter unit (556). Video compression techniques may include in-loop filter techniques controlled by parameters contained in the coded video sequence (also called the coded video bitstream) and made available to the loop filter unit (556) as symbols (521) from the parser (520). Video compression may also be responsive to meta-information obtained during decoding of previous portions (in decoding order) of the coded picture or coded video sequence, as well as to previously reconstructed loop filtered sample values.
[0052] The output of the loop filter unit (556) can be a sample stream, which can be output to a render device (512) or stored in a reference picture memory (557) for use in future inter-picture prediction.
[0053] Once a coded picture is fully reconstructed, it can be used as a reference picture for future prediction. For example, once a coded picture corresponding to a current picture is fully reconstructed and the coded picture is identified as a reference picture (e.g., by the parser (520)), the current picture buffer (558) can become part of the reference picture memory (557), and a fresh current picture buffer can be reallocated before starting the reconstruction of a subsequent coded picture.
[0054] The video decoder (510) may perform decoding operations according to a given video compression technique or standard, such as ITU-T Recommendation H.265. The encoded video sequence may be compliant with the syntax prescribed by the video compression technique or standard being used, in the sense that the encoded video sequence follows the syntax of the video compression technique or standard and a profile documented in the video compression technique or standard. In particular, a profile may select a particular tool from all tools available in the video compression technique or standard as the only tool available for use under that profile. Compliance may also require that the complexity of the encoded video sequence be within a range defined by a level of the video compression technique or standard. In some cases, the level constrains the maximum picture size, maximum frame rate, maximum reconstruction sample rate (e.g., measured in units of megasamples per second), maximum reference picture size, etc. The limits set by the level may be further constrained through a Hypothetical Reference Decoder (HRD) specification and metadata for HRD buffer management, possibly signaled in the encoded video sequence.
[0055] In some embodiments, the receiver (531) may receive additional (redundant) data along with the encoded video. The additional data may be included as part of the encoded video sequence(s). The additional data may be used by the video decoder (510) to properly decode the data and / or to more accurately reconstruct the original video data. The additional data may be in the form of, for example, temporal, spatial, or signal-to-noise ratio (SNR) enhancement layers, redundant slices, redundant pictures, forward error correction codes, etc.
[0056] 6 shows an example block diagram of a video encoder (603). The video encoder (603) is included in an electronic device (620). The electronic device (620) includes a transmitter (640) (e.g., a transmission circuit). The video encoder (603) can be used in place of the video encoder (403) in the example of FIG. 4.
[0057] The video encoder (603) can receive video samples from a video source (601) (which is not part of the electronic device (620) in the example of FIG. 6) that can capture video images to be encoded by the video encoder (603). In another example, the video source (601) is part of the electronic device (620).
[0058] The video source (601) may provide a source video sequence to be encoded by the video encoder (603) in the form of a digital video sample stream that may be of any suitable bit depth (e.g., 8-bit, 10-bit, 12-bit, ...), any color space (e.g., BT.601 YCrCB, RGB, ...) and any suitable sampling structure (e.g., YCrCb 4:2:0, YCrCb 4:4:4). In a media service system, the video source (601) may be a storage device that stores pre-prepared video. In a video conferencing system, the video source (601) may be a camera that captures image information locally as a video sequence. The video data may be provided as a number of individual pictures that impart motion when viewed in sequence. The pictures themselves may be organized as a spatial array of pixels, each of which may contain one or more samples, depending on the sampling structure, color space, etc., in use. Those skilled in the art can easily understand the relationship between pixels and samples. The following description focuses on samples.
[0059] According to an embodiment, the video encoder (603) can encode and compress pictures of a source video sequence into an encoded video sequence (643) in real time or under any other required time constraint. Enforcing an appropriate encoding rate is one function of the controller (650). In some embodiments, the controller (650) controls and is operatively coupled to other functional units, such as those described below. Such couplings are not depicted for clarity. Parameters set by the controller (650) can include parameters related to rate control (picture skip, quantizer, lambda value for rate-distortion optimization techniques, ...), picture size, group of pictures (GOP) layout, maximum motion vector search range, etc. The controller (650) can be configured to have other suitable functions for the video encoder (603) optimized for a particular system design.
[0060] In some embodiments, the video encoder (603) is configured to operate in an encoding loop. As a simplistic description, in one example, the encoding loop can include a source encoder (630) (e.g., responsible for generating symbols, such as a symbol stream, based on an input picture to be encoded and a reference picture(s)) and a (local) decoder (633) embedded in the video encoder (603). The decoder (633) reconstructs the symbols to generate sample data in a similar manner that a (remote) decoder would also generate. The reconstructed sample stream (sample data) is input to a reference picture memory (634). Since the decoding of the symbol stream results in bit-exact results regardless of the decoder location (local or remote), the contents of the reference picture memory (634) are also bit-exact between the local and remote encoders. In other words, the prediction part of the encoder "sees" exactly the same sample values as the decoder "sees" when using the prediction during decoding as reference picture samples. This basic principle of reference picture synchrony (and the resulting drift when synchrony cannot be maintained, for example due to channel errors) is also used in several related techniques.
[0061] The operation of the "local" decoder (633) may be the same as the operation of a "remote" decoder, e.g., the video decoder (410), already described in detail above in connection with Figure 5. However, referring also briefly to Figure 5, because symbols are available and the encoding / decoding of the symbols into a coded video sequence by the entropy coder (645) and parser (420) may be lossless, the entropy decoding portion of the video decoder (410), including the buffer memory (415) and the parser (420), may not be fully implemented in the local decoder (633).
[0062] In some embodiments, the decoder techniques, except for parsing / entropy decoding, present in the decoder are present in the same or substantially the same functional form in the corresponding encoder. Thus, the disclosed subject matter focuses on the decoder operation. A description of the encoder techniques can be omitted, since they are the inverse of the decoder techniques described generically. In certain areas, more detailed descriptions are provided below.
[0063] During operation, in some examples, the source encoder (630) may perform motion-compensated predictive encoding, which predictively encodes an input picture with reference to one or more previously encoded pictures from a video sequence, designated as “reference pictures.” In this manner, the encoding engine (632) encodes differences between pixel blocks of the input picture and pixel blocks of a reference picture(s) that may be selected as predictive references for the input picture.
[0064] The local video decoder (633) can decode the encoded video data of the pictures that may be designated as reference pictures based on the symbols generated by the source encoder (630). The operation of the encoding engine (632) can advantageously be a lossy process. When the encoded video data can be decoded in a video decoder (not shown in FIG. 6), the reconstructed video sequence can be a copy of the source video sequence, typically with some errors. The local video decoder (633) can replicate the decoding process that may be performed on the reference pictures by the video decoder and store the reconstructed reference pictures in the reference picture memory (634). In this way, the video encoder (603) can locally store copies of reconstructed reference pictures that have common content (in the absence of transmission errors) as the reconstructed reference pictures that would be obtained by the far-end video decoder.
[0065] The predictor (635) may perform a prediction search for the coding engine (632). That is, for a new picture to be coded, the predictor (635) may search the reference picture memory (634) for sample data (as candidate reference pixel blocks) or specific metadata, such as reference picture motion vectors, block shapes, etc., that may serve as suitable prediction references for the new picture. The predictor (635) may operate on a sample block-by-pixel block basis to find suitable prediction references. In some cases, as determined by the search results obtained by the predictor (635), the input picture may have prediction references drawn from multiple reference pictures stored in the reference picture memory (634).
[0066] The controller (650) may manage the encoding operations of the source encoder (630), including, for example, setting the parameters and subgroup parameters used to encode the video data.
[0067] The output of all of the above functional units may undergo entropy coding in an entropy coder (645), which converts the symbols produced by the various functional units into a coded video sequence by applying lossless compression to the symbols according to techniques such as Huffman coding, variable length coding, arithmetic coding, etc.
[0068] The transmitter (640) can buffer the encoded video sequence generated by the entropy encoder (645) and prepare it for transmission over a communication channel (660), which may be a hardware / software link to a storage device that stores the encoded video data. The transmitter (640) can merge the encoded video data from the video encoder (630) with other data to be transmitted, such as encoded audio data and / or auxiliary data streams (sources not shown).
[0069] The controller (650) may manage the operation of the video encoder (603). During encoding, the controller (650) may assign a certain coding picture type to each coded picture. The coding picture type may affect the coding technique that may be applied to each picture. For example, pictures may often be assigned as one of the following picture types:
[0070] An intra picture (I-picture) may be one that can be coded and decoded without using other pictures in a sequence as a source of prediction. Some video codecs allow different types of intra pictures, including, for example, Independent Decoder Refresh ("IDR") pictures. Those skilled in the art will recognize these variations of I-pictures and their respective uses and characteristics.
[0071] A predictive picture (P-picture) may be one that can be encoded and decoded using intra- or inter-prediction, which uses at most one motion vector and reference index to predict the sample values of each block.
[0072] Bidirectionally predicted pictures (B-pictures) may be those that can be coded and decoded using intra- or inter-prediction, which uses up to two motion vectors and reference indices to predict the sample values of each block. Similarly, multi-predictive pictures can use more than two reference pictures and associated metadata for the reconstruction of a single block.
[0073] A source picture is usually spatially divided into multiple sample blocks (e.g., blocks of 4x4, 8x8, 4x8, or 16x16 samples each) and may be coded block by block. Blocks may be predictively coded with reference to other (already coded) blocks, as determined by the coding assignment applied to the respective picture of the block. For example, blocks of an I-picture may be non-predictively coded or may be predictively coded with reference to already coded blocks of the same picture (spatial or intra prediction). Pixel blocks of a P-picture may be predictively coded via spatial prediction or via temporal prediction with reference to one previously coded reference picture. Blocks of a B-picture may be predictively coded via spatial prediction or via temporal prediction with reference to one or two previously coded reference pictures.
[0074] The video encoder (603) may perform encoding operations according to a given video encoding technique or standard, such as ITU-T Recommendation H.265. In its operations, the video encoder (603) may perform various compression operations, including predictive encoding operations that exploit temporal and spatial redundancy in the input video sequence. Thus, the encoded video data may conform to a syntax specified by the video encoding technique or standard used.
[0075] In some embodiments, the transmitter (640) may transmit additional data along with the encoded video. The source encoder (630) may include such data as part of the encoded video sequence. The additional data may include temporal / spatial / SNR enhancement layers, other forms of redundant data such as redundant pictures and slices, SEI messages, VUI parameter set fragments, etc.
[0076] A video may be captured as multiple source pictures (video pictures) in a temporal sequence. Intra-picture prediction (often abbreviated as intra-prediction) exploits spatial correlation in a given picture, while inter-picture prediction exploits correlation (temporal or other) between pictures. In one example, a particular picture to be coded / decoded, called a current picture, is divided into blocks. If a block in the current picture is similar to a reference block in a previously coded and still buffered reference picture in the video, that block in the current picture can be coded by a vector called a motion vector. A motion vector points to a reference block in a reference picture, and may have a third dimension that identifies the reference picture if multiple reference pictures are used.
[0077] In some embodiments, bi-prediction techniques can be used in inter-picture prediction. According to bi-prediction techniques, two reference pictures are used, such as a first reference picture and a second reference picture, both of which precede the current picture in decoding order (but may also be past and future, respectively, in display order) in the video. A block in the current picture can be coded by a first motion vector that points to a first reference block in the first reference picture and a second motion vector that points to a second reference block in the second reference picture. A block can be predicted by a combination of the first and second reference blocks.
[0078] Furthermore, to improve coding efficiency, merge mode techniques can be used in inter-picture prediction.
[0079] According to some embodiments of the present disclosure, predictions such as inter-picture prediction and intra-picture prediction are performed on a block-by-block basis. For example, according to the HEVC standard, pictures in a sequence of video pictures are divided into coding tree units (CTUs) for compression, and the CTUs in a picture have the same size, such as 64×64 pixels, 32×32 pixels, or 16×16 pixels. In general, a CTU includes three coding tree blocks (CTBs), one luma CTB and two chroma CTBs. Each CTU can be recursively quadtree partitioned into one or more coding units (CUs). For example, a CTU of 64×64 pixels can be partitioned into one CU of 64×64 pixels, or four CUs of 32×32 pixels, or 16 CUs of 16×16 pixels. In one example, each CU is analyzed to determine a prediction type for that CU, such as an inter prediction type or an intra prediction type. A CU is divided into one or more prediction units (PUs) depending on temporal and / or spatial predictability. In general, each PU includes a luma prediction block (PB) and two chroma PBs. In an embodiment, prediction operations in coding (encoding / decoding) are performed in units of prediction blocks. Taking a luma prediction block as an example of a prediction block, the prediction block includes a matrix of values (e.g., luma values) for pixels, such as 8×8 pixels, 16×16 pixels, 8×16 pixels, 16×8 pixels, etc.
[0080] 7 shows an example diagram of a video encoder (703). The video encoder (703) is configured to receive a processed block of sample values (e.g., a predictive block) in a current video picture in a sequence of video pictures and to encode the processed block into a coded picture that is part of a coded video sequence. In one example, the video encoder (703) is used in place of the video encoder (403) in the example of FIG. 4.
[0081] In an HEVC example, the video encoder (703) receives a matrix of sample values for a processing block, such as a predictive block, such as 8×8 samples. The video encoder (703) determines whether the processing block is best coded using intra mode, inter mode, or bi-predictive mode, e.g., using rate-distortion optimization. If the processing block is coded in intra mode, the video encoder (703) may use intra prediction techniques to code the processing block into a coded picture. If the processing block is coded in inter mode or bi-predictive mode, the video encoder (703) may use inter prediction techniques or bi-predictive techniques, respectively, to code the processing block into a coded picture. In certain video coding techniques, a merge mode may be an inter-picture prediction sub-mode in which motion vectors are derived from one or more motion vector predictors, but without the benefit of coded motion vector components outside the predictors. In certain other video coding techniques, there may be motion vector components applicable to the current block. In one example, the video encoder (703) includes other components, such as a mode decision module (not shown) for determining the mode of the processing blocks.
[0082] In the example of FIG. 7, the video encoder (703) includes an inter-encoder (730), an intra-encoder (722), a residual calculator (723), a switch (726), a residual encoder (724), a general controller (721), and an entropy coder (725), coupled together as shown in FIG.
[0083] The inter-encoder (730) is configured to receive samples of a current block (e.g., a processing block), compare the block with one or more reference blocks in a reference picture (e.g., blocks in previous and subsequent pictures), generate inter-prediction information (e.g., a description of redundant information due to inter-coding techniques, motion vectors, merge mode information), and calculate an inter-prediction result (e.g., a predicted block) based on the inter-prediction information using any suitable technique. In some examples, the reference picture is a decoded reference picture that is decoded based on the coded video information.
[0084] The intra encoder (722) is configured to receive samples of a current block (e.g., a processing block), possibly compare the block with blocks already encoded in the same picture, generate transformed and quantized coefficients, and possibly also generate intra prediction information (e.g., intra prediction direction information according to one or more intra encoding techniques). In one example, the intra encoder (722) also calculates an intra prediction result (e.g., a predicted block) based on the intra prediction information and a reference block in the same picture.
[0085] The general controller (721) is configured to determine general control data and control other components of the video encoder (703) based on the general control data. In one example, the general controller (721) determines the mode of the block and provides a control signal to the switch (726) based on the mode. For example, if the mode is an intra mode, the general controller (721) controls the switch (726) to select the result of the intra mode for use by the residual calculator (723), and controls the entropy encoder (725) to select intra prediction information and include the intra prediction information in the bitstream. If the mode is an inter mode, the general controller (721) controls the switch (726) to select the result of inter prediction for use by the residual calculator (723), and controls the entropy encoder (725) to select inter prediction information and include the inter prediction information in the bitstream.
[0086] The residual calculator (723) is configured to calculate a difference (residual data) between the received block and a prediction result selected from the intra-encoder (722) or the inter-encoder (730). The residual encoder (724) is configured to encode the residual data to generate transform coefficients based on the residual data. In one example, the residual encoder (724) is configured to transform the residual data from the spatial domain to the frequency domain to generate transform coefficients. The transform coefficients are then subjected to a quantization process to obtain quantized transform coefficients. In various embodiments, the video encoder (703) also includes a residual decoder (728). The residual decoder (728) is configured to perform an inverse transform to generate decoded residual data. The decoded residual data can be suitably used by the intra-encoder (722) and the inter-encoder (730). For example, the inter-encoder (730) can generate decoded blocks based on the decoded residual data and the inter-prediction information, and the intra-encoder (722) can generate decoded blocks based on the decoded residual data and the intra-prediction information. The decoded blocks are suitably processed to generate decoded pictures, which can be buffered in a memory circuit (not shown) and used as reference pictures in some examples.
[0087] The entropy encoder (725) is configured to format a bitstream to include the encoded block. The entropy encoder (725) is configured to include various information in the bitstream according to a suitable standard, such as the HEVC standard. In one example, the entropy encoder (725) is configured to include general control data, selected prediction information (e.g., intra-prediction information or inter-prediction information), residual information, and other suitable information in the bitstream. Note that in accordance with the disclosed subject matter, when encoding a block in a merged sub-mode of either the inter mode or the bi-prediction mode, the residual information is not present.
[0088] 8 shows an example diagram of a video decoder (810). The video decoder (810) is configured to receive encoded pictures that are part of an encoded video sequence and decode the encoded pictures to generate reconstructed pictures. In one example, the video decoder (810) is used in place of the video decoder (410) in the example of FIG. 4.
[0089] In the example of FIG. 8, the video decoder (810) includes an entropy decoder (871), an inter decoder (880), a residual decoder (873), a reconstruction module (874), and an intra decoder (872) coupled together as shown in FIG. 8.
[0090] The entropy decoder (871) may be configured to reconstruct from the coded picture certain symbols representing the syntax elements of which the coded picture is composed. Such symbols may include, for example, prediction information (e.g., intra- or inter-prediction information, etc.) that may identify the mode in which the block is coded (e.g., intra- or inter-prediction mode, merged submode, or the latter two in another submode), and the specific samples or metadata used for prediction by the intra-decoder (872) or the inter-decoder (880), respectively. The symbols may also include residual information, for example in the form of quantized transform coefficients, etc. In one example, if the prediction mode is an inter- or bi-prediction mode, the inter-prediction information is provided to the inter-decoder (880). If the prediction type is an intra-prediction type, the intra-prediction information is provided to the intra-decoder (872). The residual information may undergo inverse quantization and is provided to the residual decoder (873).
[0091] The inter decoder (880) is configured to receive inter prediction information and to generate inter prediction results based on the inter prediction information.
[0092] The intra decoder (872) is configured to receive intra prediction information and generate a prediction result based on the intra prediction information.
[0093] The residual decoder (873) is configured to perform inverse quantization to extract dequantized transform coefficients, and to process the dequantized transform coefficients to transform the residual information from the frequency domain to the spatial domain. The residual decoder (873) may also require certain control information (including quantizer parameters (QP)), which may be provided by the entropy decoder (871) (data path not depicted since this is only low volume control information).
[0094] The reconstruction module (874) is configured to combine, in the spatial domain, the residual information output by the residual decoder (873) and the prediction result (output by the intra- or inter-prediction module, as the case may be) to form a reconstructed block, which may be part of a reconstructed picture, which may be part of a reconstructed video. It is noted that other suitable operations, such as a deblocking operation, may be performed to improve visual quality.
[0095] It should be noted that the video encoders (403), (603), (703) and the video decoders (410), (510), (810) may be implemented using any suitable technology. In some embodiments, the video encoders (403), (603), (703) and the video decoders (410), (510), (810) may be implemented using one or more integrated circuits. In other embodiments, the video encoders (403), (603), (703) and the video decoders (410), (510), (810) may be implemented using one or more processors executing software instructions.
[0096] Various inter prediction modes can be used in VVC. For an inter predicted CU, the motion parameters can include MV, one or more reference picture indexes, reference picture list usage index, and additional information for the specific coding features used for inter prediction sample generation. The motion parameters can be signaled explicitly or implicitly. If the CU is coded in skip mode, it can be associated with a PU and may not have significant residual coefficients, coded motion vector delta or MV difference (e.g., MVD) or reference picture index. A merge mode can be specified in which the motion parameters of the current CU are obtained from neighboring CUs, including spatial and / or temporal candidates, and optionally additional information as introduced in VVC. The merge mode can be applied not only to skip mode but also to inter predicted CUs. In one example, the selection for the merge mode is an explicit signaling of the motion parameters, and the MV, the corresponding reference picture index and reference picture list usage flag of each reference picture list, as well as other information, are explicitly signaled for each CU.
[0097] In a VVC-like embodiment, the VVC Test model (VTM) reference software supports a number of motion vector prediction modes, including enhanced merge prediction, merge motion vector difference (MMVD) mode, adaptive motion vector prediction (AMVP) mode with symmetric MVD signaling, affine motion compensation prediction, subblock-based temporal motion vector prediction (SbTMVP), adaptive motion vector resolution (AMVR), motion field storage (1 / 16 luma sample MV storage and 8x8 motion field compression), bi-prediction with CU-level weights (BCW), bi-directional optical flow (BDOF), prediction refinement using optical flow (PROF), decoder side motion vector refinement (DMVR), combined inter and intra prediction (CIIP), geometric partitioning mode (GPM), and motion vector compression (CMC). The present invention includes one or more sophisticated inter-prediction coding tools, including a multi-level coding (M-C) coding mode, etc. Inter-prediction and related methods are described in detail below.
[0098] In some cases, enhanced merge prediction can be used. In cases such as VTM4, the merge candidate list is constructed by including, in order, five types of candidates: spatial motion vector predictor (MVP) from spatially neighboring CUs, temporal MVP from co-located CUs, history-based MVP from a first-in-first-out (FIFO) table, pair-wise average MVP, and zero MV.
[0099] The size of the merge candidate list can be signaled in the slice header. In one example, the maximum allowed size of the merge candidate list is 6 in VTM4. For each CU coded in merge mode, the index of the best merge candidate (e.g., merge index) can be coded using truncated unary binarization (TU). The first bin of the merge index can be coded with context (e.g., context-adaptive binary arithmetic coding (CABAC)) and bypass coding can be used for the other bins.
[0100] Some examples of the generation process of each category of merge candidates are provided below. In one embodiment, spatial candidates are derived as follows: The derivation of spatial merge candidates in VVC can be the same as that in HEVC. In one example, up to four merge candidates are selected from the candidates at the positions shown in FIG. 9. FIG. 9 illustrates the positions of spatial merge candidates according to one embodiment of the present disclosure. With reference to FIG. 9, the derivation order is B1, A1, B0, A0, and B2. Position B2 is considered only if any CU at positions A0, B0, B1, and A1 is unavailable (e.g., because the CU belongs to another slice or another tile) or is intra-coded. After the candidate at position A1 is added, the addition of the remaining candidates is subject to a redundancy check, which ensures that candidates with the same motion information are removed from the candidate list, thereby improving the coding efficiency.
[0101] In order to reduce computational complexity, not all possible candidate pairs are considered in the above redundancy check. Instead, only pairs linked by arrows in FIG. 10 are considered, and a candidate is added to the candidate list only if the corresponding candidates used in the redundancy check do not have the same motion information. FIG. 10 illustrates candidate pairs considered for spatial merge candidate redundancy check according to one embodiment of the present disclosure. Referring to FIG. 10, each arrow-linked pair includes A1 and B1, A1 and A0, A1 and B2, B1 and B0, and B1 and B2. Thus, candidates at positions B1, A0, and / or B2 can be compared with candidates at positions A1, and candidates at positions B0 and / or B2 can be compared with candidates at positions B1.
[0102] In one embodiment, the temporal candidates are derived as follows: In one example, only one temporal merge candidate is added to the candidate list. FIG. 11 shows an example of motion vector scaling for a temporal merge candidate. To derive a temporal merge candidate for a current CU (1111) in a current picture (1101), a scaled MV (1121) (e.g., shown by dotted lines in FIG. 11) can be derived based on a co-located CU (1112) belonging to a co-located reference picture (1104). The reference picture list used to derive the co-located CU (1112) can be explicitly signaled in the slice header. The scaled MV (1121) for the temporal merge candidate can be obtained as shown by dotted lines in FIG. 11. The scaled MV (1121) can be scaled from the MV of the co-located CU (1112) using picture order count (POC) distances tb and td. The POC distance tb may be defined as the POC difference between the current reference picture (1102) of the current picture (1101) and the current picture (1101). The POC distance td may be defined as the POC difference between the co-located reference picture (1104) of the co-located picture (1103) and the co-located picture (1103). The reference picture index of the temporal merge candidate may be set to 0.
[0103] FIG. 12 shows exemplary candidate positions (e.g., C0 and C1) of temporal merge candidates for the current CU. The position of the temporal merge candidate can be selected between candidate position C0 and candidate position C1. Candidate position C0 is located at the bottom right corner of the current CU's co-located CU (1210). Candidate position C1 is located at the center of the current CU's co-located CU (1210). If the CU at candidate position C0 is not available, is intra-coded, or is outside the current row of the CTU, candidate position C1 is used to derive the temporal merge candidate. Otherwise, for example, if the CU at candidate position C0 is available, is intra-coded, and is in the current row of the CTU, candidate position C0 is used to derive the temporal merge candidate.
[0104] In some examples, a translational motion model is applied for motion compensation prediction (MCP). However, the translational motion model may not be suitable for modeling other types of motion, such as zoom in / out, rotation, perspective motion, and other irregular motion. In some embodiments, a block-based affine transform motion compensation prediction is applied. In FIG. 13A, when a four-parameter affine model is used, the affine motion field of the block is described by two control point motion vectors (CPMVs), CPMV0 and CPMV1, of two control points (CPs), CP0 and CP1. In FIG. 13B, when a six-parameter affine model is used, the affine motion field of the block is described by three CPMVs, CPMV0, CPMV1, and CPMV3, of CPs, CP0, CP1, and CP2.
[0105] For a four-parameter affine motion model, the motion vector at a sample position (x,y) within a block is derived as follows:
number
[0106] For a six-parameter affine motion model, the motion vector at a sample position (x,y) within a block is derived as follows:
number
[0107] In formulas 1 and 2, (mv 0x ,mv 0y ) is the motion vector of the upper left corner control point, and (mv 1x ,mv 1y ) is the motion vector of the control point in the upper right corner, and (mv 2x ,mv 2y ) is the motion vector of the control point in the lower left corner. Furthermore, the coordinates (x, y) are relative to the upper left corner of each block, and W and H denote the width and height of each block.
[0108] In some embodiments, sub-block-based affine transformation prediction is applied to simplify motion compensation prediction. For example, in FIG. 14, a four-parameter affine motion model is used, and two CPMVs are used.
number
[0109] In some embodiments, two affine motion inter prediction modes are used, affine merge mode and affine AMVP mode, as well as translational motion inter prediction.
[0110] In some embodiments, the affine merge mode can be applied to CUs whose width and height are both equal to or greater than 8. Affine merge candidates for the current CU can be generated based on the motion information of spatially neighboring CUs. There can be up to five affine merge candidates, and an index is signaled to indicate the one to be used for the current CU. For example, the following three types of affine merge candidates are used to form the affine merge candidate list: (i) Inherited affine merge candidates extrapolated from the CPMVs of neighboring CUs; (ii) Construct affine merge candidates derived using the translation MVs of neighboring CUs; and (iii) Zero MV
[0111] In some embodiments, there are at most two inherited affine candidates derived from the affine motion models of the neighboring blocks, one from the left neighboring CU and one from the top neighboring CU. For example, the candidate blocks can be located at the positions shown in Fig. 9. For the left predictor, the scan order is A0>A1, and for the top predictor, the scan order is B0>B1>B2. Only the first inherited candidate from each side is selected. No pruning check is performed between the two inherited candidates.
[0112] Once the neighboring affine CUs are identified, the CPMVs of the identified neighboring affine CUs are used to derive CPMV candidates in the affine merge list of the current CU. As shown in Figure 15, the neighboring bottom-left block A of the current CU (1510) is coded in affine mode. The motion vectors for the top-left, top-right, and bottom-left corners of the CU (1520) containing block A are
number
number
number
number
[0113] Constructing affine candidates is constructed by combining the neighboring translational motion information of each control point. The motion information of a control point is derived from the specified spatial and temporal neighbors shown in Figure 16. CPMV k (k=1,2,3,4) represents the kth control point. For CPMV1, blocks with B2>B3>A2 are examined in order, and the MV of the first available block is used. For CPMV2, blocks with B1>B0 are examined, and for CPMV3, blocks with A1>A0 are examined. The TMVP in block T is used as CPMV4 if available.
[0114] After the MVs of the four control points are obtained, an affine merge candidate is constructed based on the motion information. The following combinations of control point MVs are used to construct the candidate affine merge candidate in order: {CPMV1,CPMV2,CPMV3}, {CPMV1,CPMV2,CPMV4}, {CPMV1,CPMV3,CPMV4}, {CPMV2,CPMV3,CPMV4}, {CPMV1,CPMV2}, {CPMV1,CPMV3}.
[0115] A combination of three CPMVs constructs a six-parameter affine merge candidate, and a combination of two CPMVs constructs a four-parameter affine merge candidate. To avoid the motion scaling process, if the reference indices of the control points are different, the associated control point MV combination is discarded.
[0116] After the inheritance and construction affine merge candidates have been examined, if the list is still not full, a zero MV is inserted at the end of the merge candidate list.
[0117] In some embodiments, the affine AMVP mode is applicable to CUs whose width and height are both 16 or greater. An affine flag at the CU level is signaled in the bitstream to indicate whether the affine AMVP mode is used, and then another flag is signaled to indicate whether a 4-parameter affine or a 6-parameter affine is used. The difference in CPMV of the current CU and its predictor is signaled in the bitstream. The affine AVMP candidate list size is 2 and can be generated by using the following four types of CPVM candidates in order: (i) Inherited affine AMVP candidates extrapolated from the CPMVs of neighboring CUs; (ii) Constructed affine AMVP candidates derived using the translational MVs of neighboring CUs; (iii) translational MVs from adjacent CUs, and (iv) Zero MV
[0118] In one example, the inspection order of the inherited affine AMVP candidate is similar to that of the inherited affine merge candidate. The difference is that for the AVMP candidate, the affine CU with the same reference picture as the current block is considered. When inserting the inherited affine motion predictor into the candidate list, the pruning process is not applied.
[0119] The constructed AMVP candidate is derived from the specified spatial neighborhood shown in Figure 16. The same check order is used as done in affine merge candidate construction. In addition, the reference picture indexes of the neighboring blocks are also checked. The first block in the check order that has the same reference picture as the current CU and is inter-coded is used. If the current CU is coded with a four-parameter affine model and both CPMV0 and CPMV1 are available, the available CPMV is added as one candidate in the affine AMVP list. If the current CU is coded with a six-parameter affine mode and all three CPMVs (CPMV0, CPMV1, and CPMV2) are available, the available CPMV is added as one candidate in the affine AMVP list. Otherwise, the constructed AMVP candidate is set to unavailable.
[0120] After the inherited affine AMVP candidates and the constructed AMVP candidates have been examined, if the affine AMVP list candidates are still less than two, translational motion vectors adjacent to the control points are added to predict all control point MVs of the current CU, if available. Finally, if the affine AMVP list is still not full, zero MVs are used to fill the affine AMVP list.
[0121] Template matching (TM) techniques can be used in video / image coding. To further improve the compression efficiency of the VVC standard, for example, TM can be used to refine MV. In one example, TM is used at the decoder side. With the TM mode, MV can be refined by constructing a template (e.g., a current template) of a block (e.g., a current block) in a current picture and determining the closest match between the template of the block in the current picture and multiple possible templates (e.g., multiple possible reference templates) in a reference picture. In one embodiment, the template of the block in the current picture can include the left neighboring reconstructed sample of the block and the top neighboring reconstructed sample of the block. TM can be used in video / image coding beyond VVC.
[0122] 17 shows an example of template matching (1700). The TM can be used to derive motion information for a current CU (e.g., a current block) (1701) (e.g., derive final motion information from initial motion information such as initial MV 1702) by determining the closest match between a template (e.g., a current template) (1721) of a current CU (1701) in a current picture (1710) and a template (e.g., a reference template) of multiple possible templates (e.g., one of the multiple possible templates is a template (1725)) in a reference picture (1711). The template (1721) of the current CU (1701) can have any suitable shape and any suitable size.
[0123] In one embodiment, the template (1721) of the current CU (1701) includes a top template (1722) and a left template (1723). Each of the top template (1722) and the left template (1723) may have any suitable shape and any suitable size.
[0124] The top template (1722) can include samples in one or more top neighboring blocks of the current CU (1701). In one example, the top template (1722) includes four rows of samples in one or more top neighboring blocks of the current CU (1701). The left template (1723) can include samples in one or more left neighboring blocks of the current CU (1701). In one example, the left template (1723) includes four columns of samples in one or more left neighboring blocks of the current CU (1701).
[0125] Each of the multiple possible templates (e.g., template (1725)) in the reference picture (1711) corresponds to a template (1721) in the current picture (1710). In one embodiment, the initial MV (1702) points from the current CU (1701) to a reference block (1703) in the reference picture (1711). Each of the multiple possible templates (e.g., template (1725)) in the reference picture (1711) and the template (1721) in the current picture (1710) may have the same shape and size. For example, the template (1725) of the reference block (1703) includes a top template (1726) in the reference picture (1711) and a left template (1727) in the reference picture (1711). The top template (1726) may include samples in one or more top neighboring blocks of the reference block (1703). The left template (1727) may include samples in one or more left neighboring blocks of the reference block (1703).
[0126] The TM cost may be determined based on a pair of templates, such as a template (e.g., a current template) (1721) and a template (e.g., a reference template) (1725). The TM cost may indicate a match between the template (1721) and the template (1725). An optimized MV (or final MV) may be determined based on a search around the initial MV (1702) of the current CU (1701) within a search range (1715). The search range (1715) may have any suitable shape and any suitable number of reference samples. In one example, the search range (1715) in the reference picture (1711) includes a [-L,L] pel range, where L is a positive integer such as 8 (e.g., 8 samples). For example, a difference (e.g., [0,1]) is determined based on the search range (1715), and an intermediate MV is determined by adding the initial MV (1702) and the difference (e.g., [0,1]). An intermediate reference block and a corresponding template in the reference picture (1711) can be determined based on the intermediate MV. A TM cost can be determined based on the template (1721) and the intermediate template in the reference picture (1711). The TM cost can correspond to a difference (e.g., [0,0], [0,1], etc., corresponding to the initial MV (1702)) determined based on a search range (1715). In one example, the difference corresponding to the smallest TM cost is selected, and the optimized MV is the sum of the difference corresponding to the smallest TM cost and the initial MV (1702). As described above, the TM can derive final motion information (e.g., optimized MV) from the initial motion information (e.g., initial MV 1702).
[0127] The TM can be modified appropriately. In one example, the search step size is determined by the AMVR mode. In one example, the TM can be cascaded (e.g., used together) with other coding methods such as a bilateral matching process.
[0128] TM can be applied in an affine mode such as affine AMVP mode or affine merge mode, and can be called affine TM. FIG. 18 shows an example of a TM (1800) in an affine merge mode or the like. A template (1821) of a current block (e.g., current CU) (1801) can correspond to a template (e.g., template (1721) in FIG. 17) in a TM applied to a translational motion model. A reference template (1825) of a reference block in a reference picture can include multiple subblock templates (e.g., 4×4 subblocks) pointed to by MVs derived at control point MVs (CPMVs) of neighboring subblocks (e.g., A0-A3 and L0-L3 as shown in FIG. 18) at block boundaries.
[0129] The search process of the TM applied in affine mode (e.g., affine merge mode) can start from CPMV0 while keeping other CPMVs constant (e.g., (i) CPMV1 when a four-parameter model is used, or (ii) CPMV1 and CPMV2 when a six-parameter model is used). Searches can be performed in the horizontal and vertical directions. In one example, a diagonal search follows only if the zero vector is not the best difference vector found from the horizontal and vertical searches. The affine TM can repeat the same search process for CPMV1. The affine TM can repeat the same search process for CPMV2 when a six-parameter model is used. Based on the refined CPMV, if the zero vector is not the best difference vector from the previous iteration and the search process has been repeated less than three times, the entire search process can be restarted from the refined CPMV0.
[0130] In one embodiment, the BCW technique is designed to predict a block by weighted averaging two motion compensation prediction blocks. Although weighting prediction (WP) can indicate weights at slice level, the weights used in BCW can be signaled at CU level by using an index (e.g., BCW index denoted as bcwIdx). The index in BCW can point to a selected weight in a predefined list of candidate weights (e.g., weight list). The list (e.g., BCW list) can predefine multiple (e.g., five) candidate weights, such as {-2, 3, 4, 5, 10} / 8, to be selected for reference pictures in a reference list (e.g., reference list 1 or L1). The two weights -2 / 8 and 10 / 8 can be used to reduce noise that is negatively correlated between prediction blocks used in bi-prediction. If forward and backward reference pictures in both reference lists (e.g., L0 and L1) are used to achieve a better tradeoff between performance and complexity, the list may be reduced to a list of {3, 4, 5} / 8. In general, the list may include any suitable number of candidate weights. Since the unit-gain constraint is applied, once the weight (e.g., referred to as the second weight, denoted as w) pointed to by the index (e.g., bcwIdx) corresponding to reference list 1 is determined, the other weight (e.g., referred to as the first weight) corresponding to the other reference list (e.g., L0) is (1-w). In one example, each luma prediction sample or each chroma prediction sample of the BCW is determined as follows:
number
[0131] In Equation 3, P0 and P1 are prediction samples pointed to by motion vectors from the first reference picture in Reference List 0 (L0) and the second reference picture in Reference List 1 (L1), respectively. BCW is the final prediction for the sample in the current block, and P BCWis the weighted average of P0 and P1. In one embodiment, BCW is enabled only for CUs that are bidirectionally predicted with at least 256 luma samples, and when WP is turned off for bidirectionally predicted CUs. The above BCW can be extended to bidirectionally predicted CUs coded in affine AMVP mode.
[0132] The use of the index (e.g., bcwIdx) can be buffered for subsequent CUs in the same picture or the same frame to perform spatial motion merging as in normal merge mode (e.g., whole block-based merge mode) or affine merge mode. When the spatial neighbor merge candidate is bidirectionally predicted and the current CU selects the spatial neighbor merge candidate, motion information including one or more of (i) one or more reference indexes, (ii) motion vectors (or CPMV in inherit affine merge mode), and (iii) corresponding BCW indexes (e.g., bcwIdx) can be inherited by the current CU. In one example, all of (i) one or more reference indexes, (ii) motion vectors (or CPMV in inherit affine merge mode), and (iii) corresponding BCW indexes (e.g., bcwIdx) can be inherited by the current CU. In one example, if the current CU has a valid CIIP flag, the weight index (e.g., bcwIdx) is not inherited. In the constructed affine merge mode, the BCW index (e.g., bcwIdx) can be inherited from the weight index associated with the top-left CPMV(s) (or the top-right CPMV if the top-left CPMV is not used). In one example, if the inferred BCW index (e.g., bcwIdx) points to a weight other than 0.5, the DMVR mode and the BDOF mode are turned off.
[0133] In some embodiments, such as VVC and EE2, the BCW index is coded in a fixed order. For example, the relationship between the BCW index (e.g., bcwIdx) and the corresponding BCW candidate weight in the BCW list is fixed. In one example, a BCW index (e.g., bcwIdx) of i corresponds to the i-th candidate weight in the BCW list (e.g., {-2,3,4,5,10} / 8), where i is an integer equal to or greater than 0. For example, if the BCW index is 0, 1, 2, 3, or 4, w is -2 / 8, 3 / 8, 4 / 8, 5 / 8, or 10 / 8, respectively. Coding the BCW index in a fixed order may result in high signaling costs for the BCW (e.g., signaling the BCW index), and thus the BCW mode may not be used efficiently in some examples.
[0134] A current CU or a current block in a current picture can be coded bidirectionally in a BCW mode. The current block can be coded based on a first reference block in a first reference picture in a first reference list (e.g., L0) and a second reference block in a second reference picture in a second reference list (e.g., L1). According to an embodiment of the present disclosure, in order to improve the efficiency of the BCW mode (e.g., to reduce the cost of signaling a BCW index), TM can be applied to BCW candidate weights such as -2 / 8, 3 / 8, 4 / 8, 5 / 8, or 10 / 8 in a BCW list (e.g., {-2,3,4,5,10} / 8). A TM cost corresponding to each BCW candidate weight can be determined, and the BCW candidate weight can be selected as the BCW weight used to code (e.g., encode or reconstruct) the current CU or the current block based on the TM cost. In one example, the BCW candidate weights can be ranked or sorted based on the determined TM cost, respectively. The BCW weight may be selected from the ranked or sorted BCW candidate weights. For example, the BCW candidate weights may be ranked or sorted based on the ascending order of the determined TM cost. The current block or current CU may be coded (e.g., encoded or reconstructed) based on the selected BCW weight (e.g., w), as shown in Equation 3.
[0135] According to an embodiment of the present disclosure, the TM cost in the TM cost corresponding to each BCW candidate weight in the BCW candidate weights is determined based on reconstructed samples in adjacent reconstructed blocks of the current block, the first reference block, and the second reference block, respectively. For example, the TM cost corresponding to each BCW candidate weight is determined based on a current template of the current block and a respective bidirectional predictor (e.g., a bidirectional predictor template). The bidirectional predictor template can be determined based on the respective BCW candidate weight, a first reference template of the first reference block in the first reference picture, and a second reference template of the second reference block in the second reference picture. The first reference block and the second reference block correspond to the current block, and the first reference template and the second reference template correspond to the current template.
[0136] In one embodiment, if a current CU (e.g., a current block) is coded with bi-prediction and a BCW mode is enabled for the current CU (e.g., sps_bcw_enabled_flag is true), a TM is applied to derive a BCW index. The TM search procedure can be performed on the BCW weights (e.g., all possible BCW weights) to sort the BCW index in ascending order, for example, by using the TM cost between a current template in the current picture and a reference template in a reference picture, such as the first reference template and the second reference template.
[0137] In one embodiment, to calculate each TM cost between a current picture (e.g., a current reconstructed picture) and a reference picture (e.g., a first reference picture and a second reference picture), the adjacent reconstructed regions of the current block, the first reference block and the second reference block can be used as a current template, a first reference template and a second reference template, respectively.
[0138] FIG. 19 shows an example of a template matching based BCW index reordering process (1900). A current block (1902) being reconstructed in a current picture (1901) is coded in bi-prediction in BCW mode. A first MV (1916) can point from the current block (1902) to a first reference block (1912) in a first reference picture (1911) in a first reference list (e.g., L0). A second MV (1926) can point from the current block (1902) to a second reference block (1922) in a second reference picture (1921) in a second reference list (e.g., L1). The current block (1902) can be predicted based on a weighted average of a first reference block (1912) in a first reference picture (1911) and a second reference block (1922) in a second reference picture (1921), as described in Equation 3. For example, a sample (e.g., P C ) is a weighted average (e.g., P) of a first sample (e.g., P0) in a first reference block (1912) (e.g., with a weight of (1-w)) and a second sample (e.g., P1) in a second reference block (1922) (e.g., with a weight of w). BCW In one example, P C P BCW In one example, P C P BCW and the sum of the corresponding residuals.
[0139] TM can be applied to determine BCW weights w used in calculating the weighted average of the first reference block (1912) and the second reference block (1922), such as the BCW weights w used in Equation 3. TM can be performed for BCW candidate weights such as -2 / 8, 3 / 8, 4 / 8, 5 / 8, or 10 / 8 in the BCW list (e.g., {-2, 3, 4, 5, 10} / 8). For example, TM is performed to determine each TM matching cost (also referred to as TM cost) between the current template (1905) of the current block (1902) and each bidirectional predictor template corresponding to the BCW candidate weight in the BCW candidate weights. Each bidirectional predictor template can be determined based on (i) the first reference template (1915) of the first reference block (1912) and (ii) the second reference template (1925) of the second reference block (1922) and the corresponding BCW candidate weights.
[0140] The current template (1905) may include samples (e.g., reconstructed samples) in neighboring reconstructed blocks of the current block (1902). The current template (1905) may have any suitable shape and any suitable size. The shapes and sizes of the first reference template (1915) and the second reference template (1925) may each match the shape and size of the current template (1905).
[0141] In the example shown in Figure 19, the current template (1905) includes a top template (1904) and a left template (1903). Thus, the first reference template (1915) includes a first top reference template (1914) and a first left reference template (1913), and the second reference template (1925) includes a second top reference template (1924) and a second left reference template (1923).
[0142] The shape and / or size of the current template may vary and thus be adaptive to, for example, neighboring reconstructed data of the current block (1902) (e.g., reconstructed samples in neighboring reconstructed blocks), the decoding order of the current block (1902), the size of the current block (1902) (e.g., the number of samples in the current block (1902), the width of the current block (1902), the height of the current block (1902), etc.), the availability of reconstructed samples in neighboring reconstructed blocks, etc. In one example, if the width of the current block is greater than a threshold, the current template includes only the top template (e.g., (1904)) and does not include the left template (e.g., (1903)). In one example, the left template (e.g., (1903)) is not available and the current template includes only the top template (e.g., (1904)) and does not include the left template (e.g., (1903)). As described above, the shape and / or size of the reference template (e.g., the first reference template (1915) or the second reference template (1925)) may change and thus be adaptable according to the shape and / or size of the current template.
[0143] 20A to 20D show examples of a current template of a current block that can be used in template matching-based BCW index sorting. The current template (1905) in FIG. 20A is the same as that shown in FIG. 19, and the current template (1905) includes a top template (1904) and a left template (1903). The current template (2005) of the current block (1902) in FIG. 20B includes a top template (1904), a left template (1903), and a top-left template (2001). The current template (2015) of the current block (1902) in FIG. 20C is the top template (1904). The current template (2025) of the current block (1902) in FIG. 20D is the left template (1903).
[0144] The current templates (1905) and (2005) in Figures 20A and 20B each have an L-shape. The current templates (2015) and (2025) in Figures 20C and 20D each have a rectangular shape.
[0145] Returning to FIG. 19, the current template (1905), the first reference template (1915), and the second reference template (1925) have an L-shape and can be used to calculate TM costs. The TM process can be performed for the BCW candidate weights (e.g., all the BCW candidate weights in the BCW list). Each TM cost can be performed between the current template (1905) in the current picture (1901) and each bidirectional predictor template predicted from the first reference template (1915) in the first reference picture (1911) in the first reference list (e.g., L0) and the second reference template (1925) in the second reference picture (1921) in the second reference list (e.g., L1). Each TM cost is calculated based on the bidirectional predictor template (TP) of the current template (denoted as TC) (1905) and each of the first reference template (1915) and the second reference template (1925) with their respective BCW candidate weights (e.g., predefined BCW candidate weights). BCW In BCW mode, the distortion between the first reference template (1915) and the second reference template (1925) can be calculated according to the bidirectional predictor template TP BCW can be derived as follows:
number
[0146] The parameter TP0 may represent a first reference template (1915). The parameter TP1 may represent a second reference template (1925). Based on Equation 4, the bidirectional predictor template TP BCWThe value of the predictor sample in may be a weighted average of the first reference sample value in the first reference template (1915) and the second reference sample value in the second reference template (1925) based on the BCW candidate weights w.
[0147] In the above example shown in Equation 4, the weights are normalized by 8. Other normalization factors such as 16, 32, etc. may also be used.
[0148] In one example, Equation 4 can be rewritten as follows:
number
[0149] The TM cost corresponding to the BCW candidate weight w is calculated using, for example, the following Equation 6: BCW It can be calculated based on:
number
[0150] The sum of absolute differences (SAD) is, for example, the difference between the sample value (1905) in the current template and the bidirectional predictor template TP BCW , which represents a function of the sum of absolute differences between corresponding values of predictor samples in
[0151] Other functions may be used to determine the TM cost, such as the sum of squared errors (SSE), variance, partial SAD, etc. In an example of partial SAD, a portion of the current template (1905), a corresponding portion of the first reference template (1915), and a corresponding portion of the second reference template (1925) are used to determine the TM cost.
[0152] In a partial SAD example, some or all of the current template (1905), some or all of the first reference template (1915), and some or all of the second reference template (1925) are downsampled before being used to determine the TM cost.
[0153] In one example, the BCW list is {-2,3,4,5,10} / 8, which includes five BCW candidate weights -2 / 8, 3 / 8, 4 / 8, 5 / 8, and 10 / 8. As mentioned above, without TM, when the BCW index is 0, 1, 2, 3, or 4, respectively, w is -2 / 8, 3 / 8, 4 / 8, 5 / 8, or 10 / 8, and the relationship between the BCW index (e.g., bcwIdx) and the corresponding BCW candidate weight in the BCW list is fixed. According to one embodiment of the present disclosure, TM is performed for the five BCW candidate weights -2 / 8, 3 / 8, 4 / 8, 5 / 8, and 10 / 8, and the five corresponding TM costs (TM0-TM4) are determined using Equations 4 and 6.
[0154] The five BCW candidate weights can be ranked (e.g., sorted) based on the corresponding TM cost. For example, the TM costs are TM3, TM4, TM0, TM2, and TM1 in ascending order, with TM1 being the largest among TM0 to TM4, and TM3 being the smallest among TM0 to TM4. The five BCW candidate weights are ranked (e.g., sorted) as 5 / 8, 10 / 8, -2 / 8, 4 / 8, and 3 / 8. Thus, when the BCW index is 0, 1, 2, 3, or 4, respectively, w is 5 / 8, 10 / 8, -2 / 8, 4 / 8, or 3 / 8. As mentioned above, when TM is used, the relationship between the BCW index (e.g., bcwIdx) and the corresponding BCW candidate weight in the BCW list is not fixed. The relationship between the BCW index (e.g., bcwIdx) and the corresponding BCW candidate weight in the BCW list can be adapted to the values of the reconstructed samples in the current template (1905), the first reference template (1915) and / or the second reference template (1925). For example, if the signaled BCW index (e.g., bcwIdx) is 0, then 5 / 8 is selected to be the BCW weight (e.g., w in Equation 3) used to code the current block (1902) with TM. In contrast, the signaled BCW index of 3 indicates 5 / 8 without TM. Thus, compared to signaling the BCW index without TM, fewer bits can be used to signal the BCW index when TM is used to rank (e.g., sort) the BCW candidate weights, and thus the signaling cost of the BCW mode can be reduced. For example, TM-based reordering is advantageous because the most useful BCW candidate weights (e.g., BCW candidate weights with relatively small TM costs, such as (i) 5 / 8 or (ii) 5 / 8 and 10 / 8 in the above example) can have shorter codewords for entropy coding.
[0155] In one example, the BCW candidate weight (e.g., 5 / 8) corresponding to the smallest TM cost (e.g., TM3) is selected as the BCW weight used to code the current block (1902), as shown below in Equation 7. In one example, the BCW index (e.g., bcwIdx) is not signaled, thus reducing the signaling cost of the BCW mode.
number
[0156] The TM applied to the BCW candidate weights described in FIG. 19 can be adapted to a sub-block based TM such as the TM used in an affine mode such as the affine AMVP mode or the affine merge mode.
[0157] In one embodiment, if the current block or the current CU is coded in affine mode (e.g., affine AMVP mode), TM is performed on all BCW candidate weights to sort the BCW index by using the TM cost between the current template and the reference template. In affine mode, the current template can be divided into multiple N×N sub-block templates, where N is a positive integer. In one example, N is 4.
[0158] 21 shows an example of a subblock-based TM (2100) applied to BCW candidate weights in an affine mode (e.g., affine AMVP mode). The TM (2100) can be applied to the BCW candidate weights in a BCW list (e.g., {-2, 3, 4, 5, 10} / 8).
[0159] The current block (2110) includes a plurality of sub-blocks (2101). The current block (2110) can be coded in a sub-block-based bidirectional prediction mode. In one example, each sub-block (2101) in the current block (2110) is associated with a respective MV pair including a first MV pointing to a respective first reference sub-block (2103) in a first reference block (2111) and a second MV pointing to a respective second reference sub-block (2105) in a second reference block (2113).
[0160] The MV pair associated with each sub-block (2101) can be determined based on the affine parameters of the current block (2110) and the position of each sub-block (2101), as described in Fig. 14. In the example, the affine parameters of the current block (2110) are determined based on the CPMV (e.g., CPMV0 to CPMV1 or CPMV0 to CPMV2) of the current block (2110).
[0161] The current template (2121) of the current block (2110) may include reconstructed samples in neighboring reconstructed blocks of the current block (2110). The current template (2121) may have any suitable shape and / or any suitable size. The shape and / or size of the current template (2121) may vary, as described with reference to Figures 20A-20D.
[0162] In an affine mode (e.g., affine AMVP mode), the current template (2121) may include a plurality of subblocks (also referred to as a subblock template). The current template (2121) may include any suitable number of subblocks at any suitable position. Each of the plurality of subblock templates may have any suitable size, such as N×N. In one example, the plurality of subblock templates include a top subblock template (e.g., A0-A3) and / or a left subblock template (e.g., L0-L3). For example, the current template (2121) may include (i) a top template including a top subblock template, and / or (ii) a left template including a left subblock template. In the example of FIG. 21, the current template (2121) includes top subblock templates A0-A3 and left subblock templates L0-L3.
[0163] Each sub-block template (e.g., one of A0-A3 or one of L0-L3) in the current template (2121) can be associated with a respective MV pair including a first MV and a second MV. The MV pair associated with the sub-block template can be determined based on the affine parameters of the current block (2110) and the respective positions of the sub-block templates as described in FIG. 14, and therefore the MV pair associated with each sub-block template can be different.
[0164] The first reference template (2123) associated with the first reference block (2111) can be determined based on the sub-block templates in the current template (2121) and the MV pairs (e.g., associated first MVs) associated with the sub-block templates, respectively. Referring to FIG. 21, the first reference sub-block template (e.g., the first upper reference sub-block template A) in the first reference template (2123) can be determined based on the sub-block templates in the current template (2121) and the MV pairs (e.g., associated first MVs) associated with the sub-block templates, respectively. 00 ~A 03 and / or the first left reference sub-block template L00 ~L 03 ) can be determined based on a plurality of sub-block templates (e.g., A0-A3 and / or L0-L3) and respective MV pairs associated with each of the plurality of sub-block templates (e.g., A0-A3 and / or L0-L3). In one example, if the first MVs associated with the plurality of sub-block templates are different, the shape of the first reference template (2123) is different from the current template (2121).
[0165] Similarly, a second reference template (2125) associated with the second reference block (2113) can be determined based on the sub-block templates in the current template (2121) and the MV pairs (e.g., associated second MVs) associated with each of the sub-block templates. Referring to FIG. 21, a second reference sub-block template (e.g., second upper reference sub-block template A) in the second reference template (2123) can be determined based on the sub-block templates in the current template (2121) and the MV pairs (e.g., associated second MVs) associated with each of the sub-block templates. 10 ~A 13 and / or a second left reference sub-block template L 10 ~L 13 ) can be determined based on a plurality of sub-block templates (e.g., A0-A3 and / or L0-L3) in the current template (2121) and respective MV pairs associated with each of the plurality of sub-block templates (e.g., A0-A3 and / or L0-L3). In one example, if the second MVs associated with the plurality of sub-block templates are different, the shape of the second reference template (2125) is different from the current template (2121).
[0166] For example, the first MV pair of a sub-block template (e.g., A0) is the first reference sub-block template (2123) in the first reference template (2123) (e.g., A 00 ) and a second reference sub-block template (e.g., A 10The second MV pair of the sub-block template (e.g., A1) includes a first MV pair that points to a first reference sub-block template (e.g., A 01 ) and a second reference sub-block template (e.g., A 11 21, the first MV is different from the third MV, and the second MV is different from the fourth MV.
[0167] The TM embodiment described in FIG. 19 can be applied to the BCW candidate weights when the current block (2110) is coded in an affine mode, such as the affine AMVP mode. For the BCW candidate weights in the BCW list, a TM cost can be determined based on the current template (2121) and a bidirectional predictor (e.g., bidirectional predictor template) of the first reference template (2123) and the second reference template (2125) based on the BCW candidate weight. The bidirectional predictor template can be determined based on a weighted average of the first reference template (2123) and the second reference template (2125) by the BCW candidate weight, as shown in Equations 4-5. The TM cost can be determined based on the current template (2121) and the bidirectional predictor template, for example, using Equation 6, as described in FIG. 19. In one embodiment, a TM cost corresponding to each BCW candidate weight in the BCW list is determined. The BCW candidate weights can be ranked (e.g., sorted) based on the determined corresponding TM cost, such as in ascending order of determined TM cost. From the ranked BCW candidate weights, a BCW candidate weight may be selected as the BCW weight to be used to code the current block (2110). The current block (2110) may be reconstructed based on the selected BCW weight, as shown in Equation 3.
[0168] The differences between the embodiments in Figures 19 and 21 are explained below.
[0169] In the example of Figure 19, the current block (1902) is coded in a non-subblock-based mode such as a translational motion mode. Thus, a first reference template (1915) is determined based on a single MV (e.g., MV (1916)), and the shape of the first reference template (1915) is the same as the current template (1905). Similarly, a second reference template (1925) is determined based on a single MV (e.g., MV (1926)), and the shape of the second reference template (1925) is the same as the current template (1905).
[0170] In the example of FIG. 21, the current block (2110) is coded in an affine mode (e.g., affine AMVP mode). Therefore, a first reference template (2123) can be determined based on different MVs, and the first reference template (2123) (e.g., A 00 ~A 03 and L 00 ~L 03 The shape of the MVs (including A0 to A3 and L0 to L3) can be different from the current template (2121) (e.g., including A0 to A3 and L0 to L3). In the example in FIG. 21, two different MVs are A0 and A1 to A2, respectively. 00 and A 01 Therefore, A 00 and A 01 The relative displacement between A0 and A1 is different from the relative displacement between A0 and A1. In one example, a second reference template (2125) is determined based on a different MV, and the second reference template (2125) (e.g., A 10 ~A 13 and L 10 ~L 13 The shape of the current template (2121) is different from that of the template (2122).
[0171] Because the current template (2121) includes multiple sub-block templates (e.g., including A0-A3 and L0-L3), the TM costs calculated using equations 4 and 6 can be rewritten based on sub-block-based TM costs, where each sub-block-based TM cost is based on a corresponding sub-block-based bidirectional predictor template and a corresponding sub-block template.
[0172] Sub-block based bidirectional predictor template (e.g., k-th sub-block based bidirectional predictor template) TP BCW,k is the kth first reference sub-block template TP0 associated with the sub-block template (e.g., A0) using Equation 8. k (For example, A 00 ) and the kth second reference subblock template TP1 k (For example, A 10 ) can be determined.
number
[0173] Subblock-based TM cost (e.g., kth subblock-based TM cost TM k ) is the kth subblock-based bidirectional predictor template TP BCW,k and the corresponding k-th sub-block template (e.g., A0) in the current template (2121). For example, TM k =SAD(TC k -TP BCW,k ) and the parameter TC k represents the k-th sub-block template (e.g., A0).
[0174] In one example, the TM cost corresponding to the BCW candidate weight is determined based on a portion of the current template (2121), a portion of the first reference template (2123), and a portion of the second reference template (2125). In another example, the TM cost corresponding to the BCW candidate weight is determined based on the entire current template (2121), the entire first reference template (2123), and the entire second reference template (2125). Thus, the TM cost can be accumulated based on the sub-block-based TM costs of some (a subset) or all of the sub-block templates, as shown in Equation 9.
number
[0175] Equation 9 can be adapted to Equation 10 below: In one example, the TM cost is rewritten as:
number
[0176] Parameter TC Ap represents the p-th upper sub-block template (e.g., A0 if p is 0) in the current template (2121), and parameter TP0 Ap is the pth first upper reference subblock template (e.g., if p is 0, then A 00 ) and parameter TP1 Ap is the p-th second upper reference subblock template (e.g., if p is 0, then A 10 ) The first sum in Equation 10 is performed on the top sub-block templates in the current template (2121), such as A0 to A3 when the parameter p in Equation 10 is 0 to 3.
[0177] Parameter TC Lm represents the m-th left sub-block template (e.g., L0 if m is 0) in the current template (2121), and parameter TP0 Lmis the mth left reference subblock template (e.g., if m is 0, then L 00 ) and parameter TP1 Lm is the mth left reference subblock template (e.g., if l is 0, then L 10 ) The second summation in Equation 10 is performed on the left sub-block templates of the current template (2121), such as L0 to L3 when the parameter m in Equation 10 is 0 to 3.
[0178] As above, the weightings are normalized by 8 as shown in equations 8 and 10. Other normalization factors such as 16, 32, etc. may also be used.
[0179] Other functions such as SSE, variance, partial SAD, etc. may be used to determine the TM cost in Equation 9 or 10.
[0180] In the example of partial SAD, a portion of the current template (2121) (e.g., A0 to A3) and a corresponding portion of the first reference template (2123) (e.g., A 00 ~A 03 ) and a corresponding portion of a second reference template (2125) (e.g., A 10 ~A 13 ) is used to determine the TM cost.
[0181] In an example of partial SAD, some or all of the current template (2121), some or all of the first reference template (2123), and some or all of the second reference template (2125) are downsampled before being used to determine the TM cost.
[0182] In the example shown in FIG. 21, a first number (eg, 4) in the top sub-block template is equal to a second number (eg, 4) in the left sub-block template.
[0183] In another example, the first number in the top sub-block template is different from the second number in the left sub-block template.
[0184] In one embodiment, the inherited affine parameters of the current block (2110) can be applied (e.g., directly applied) to a reference template, such as the first reference template (2123) and / or the second reference template (2125) in the sub-block based TM. For example, the first reference sub-block template (e.g., A 00 ~A 03 and L 00 ~L 03 ) is determined based on the affine parameters (e.g., inherited affine parameters) of the current block (2110) and the first reference sub-block template (e.g., A 00 ~A 03 One of the following or L 00 ~L 03 ) may have the same motion information (eg, the same MV).
[0185] Figure 22 shows an example of the PROF method. In some embodiments, the PROF method is implemented to improve the sub-block-based affine motion compensation to have finer granularity of motion compensation. According to the PROF method, after the sub-block-based affine motion compensation is performed (as shown in Figure 14), the prediction sample (e.g., the luma prediction sample) can be refined by adding a set of adjustment values derived by the optical flow formula.
[0186] Referring to FIG. 22, a current block (2210) is divided into four sub-blocks (2212, 2214, 2216, and 2218). For example, each of the sub-blocks (2212, 2214, 2216, and 2218) has a size of 4×4 pixels. SB can be derived according to affine prediction and point to the reference subblock (2232). The initial subblock prediction samples can be determined according to the reference subblock (2232). The refinement value applied to the initial subblock prediction samples is the refinement value applied to the initial subblock prediction samples, where each prediction sample is the subblock MV of the subblock 2212 adjusted by the adjustment vector ΔMVSB The pixel MV (2242) can be calculated as if the pixel MV (2212a) were at a position (e.g., the position (2232a) of the sample (2212a)) indicated by the refined MV (e.g., pixel MV) (2242) determined according to the following formula: SB The initial sub-block prediction sample (2252) based on is refined to become a refined sample at a position (2232a) based on the pixel MV (2242).
[0187] In some embodiments, the PROF method may begin by performing subblock-based affine motion compensation to generate an initial subblock prediction sample I(i1,i2) (2252), where (i1,i2) corresponds to a particular sample in the current subblock. Then, the spatial gradient g x (i1, i2) and g y (i1,i2) can be calculated using a 3-tap filter [-1,0,1] according to:
number
[0188] The sub-block prediction is extended by one pixel on each side for gradient calculation. In some embodiments, to reduce memory bandwidth and complexity, the pixels on the extended boundary can be copied from the nearest integer pixel location in the reference picture. Thus, further interpolation for the padding region is avoided.
[0189] The prediction refinement can be calculated by optical flow formulas.
number
[0190] Δmv(i1,i2) (for example, ΔMV) is the pixel MV (2242) at the sample position (i1,i2) and the sub-block MV of the sub-block to which the pixel position (i1,i2) belongs. SBSince the affine model parameters and pixel position relative to the subblock center do not change for each subblock, Δmv(i1,i2) is calculated for the first subblock (e.g., (2212)) and can be reused for other subblocks (e.g., (2214), (2216), and (2218)) in the same coding block or CU (e.g., (2210)). In some examples, where x and y are the horizontal and vertical positions of Δ(i1,i2) relative to the center of the subblock (2212), Δ(i1,i2) can be derived by the following formula:
number
[0191] For a four-parameter affine model, we have:
number
[0192] For a six-parameter affine model, we have:
number
[0193] (v 0x ,v 0y ), (v 1x ,v 1y ) and (v 2x ,v 2y ) are the motion vectors of the top-left, top-right and bottom-left control points, and w and h are the width and height of the coding block or CU.
[0194] Prediction refinement can be added to the initial sub-block prediction sample I(i1,i2). The final prediction sample I' using the PROF method can be generated using Equation 17.
number
[0195] In one embodiment, referring back to FIG. 21, for example, each first reference sub-block template (e.g., A 00 ~A 03 One of the following or L 00 ~L 03 ) or each second reference sub-block template (e.g., A 10 ~A 13 One of the following or L 10 ~L 13 PROF is applied to each sub-block template to determine one of the reference sub-block templates (e.g., A 00 ~A 03 One of the following or L 00 ~L 03 ) is determined using the PROF mode, and two samples in the same first reference sub-block template may have different motion information (eg, two different MVs).
[0196] In one embodiment, referring to FIG. 23, when a current CU (e.g., a current block) (2310) is coded in an affine mode (e.g., an affine AMVP mode), a TM (2300) is performed on the BCW candidate weights (e.g., all BCW candidate weights) in the BCW list, and the BCW indexes can be sorted by using a pair of translational MVs (e.g., including a first MV and a second MV) for the entire current template (2321) of the current block (2310). The current block (2310) includes a number of sub-blocks (2301). The first reference block (2311) includes a first sub-block (2303) that is predicted based on the multiple sub-blocks (2301) using the affine mode, for example, based on the CPMV (e.g., CPMV0-CPMV1 or CPMV0-CPMV2) of the current block (2310). The second reference block (2313) includes a second sub-block (2305) that is predicted based on multiple sub-blocks (2301) using an affine mode, for example based on the CPMV (e.g., CPMV0 to CPMV1 or CPMV0 to CPMV2) of the current block (2310).
[0197] The current template (2321) of the current block (2310) includes a top template (2341) and a left template (2342). According to one embodiment of the present disclosure, the first reference template (2323) can be predicted from the current template (2321) using a single MV (e.g., the first MV of a translational MV pair), and the second reference template (2325) can be predicted from the current template (2321) using another single MV (e.g., the second MV of a translational MV pair). The MV pair (e.g., the first MV and the second MV) can be determined based on CPMV0, CPMV1, or CPMV2. In one example, the first reference template (2323) includes a first top reference template (2351) and a first left reference template (2352). In one example, the second reference template (2325) includes a second top reference template (2353) and a second left reference template (2354). The first reference template (2323) and the second reference template (2325) may have the same shape as the current template (2321) and may have the same size as the current template (2321).
[0198] The TM (2300) can be performed on the BCW candidate weights using the current template (2321), the first reference template (2323) and the second reference template (2325) as described with reference to FIG.
[0199] The TM in Figure 21 or Figure 23 is described using the current template (2121) or the current template (2321) as an example. If the current block is predicted using an affine mode (e.g., affine AMVP mode), other shapes such as those described in Figures 20A to 20D can be used as the current template, and Figures 21 and 23 can be adapted appropriately.
[0200] The various embodiments in Figures 19, 21 and 23 are described using the entire current template and corresponding first and second reference templates. The embodiments in Figures 19, 21 and 23 may be suitably adapted for use when only a portion of the current template and corresponding portions of the first and second reference templates are used in determining the TM cost as used in Equations 4-10.
[0201] The TMs described in FIGS. 19, 21 and 23 can be applied to a subset or all of the BCW candidate weights in the BCW list.
[0202] FIG. 24 shows a flow chart outlining an encoding process (2400) according to one embodiment of the present disclosure. In various embodiments, the process (2400) is performed by processing circuitry such as processing circuitry in terminal devices (310), (320), (330), and (340), processing circuitry performing the functions of a video encoder (e.g., (403), (603), (703)), etc. In some embodiments, the process (2400) is implemented with software instructions, and thus the processing circuitry performs the process (2400) when it executes the software instructions. The process begins at (S2401) and proceeds to (S2410).
[0203] At (S2410), for a current block in a current picture that is coded with bi-prediction with CU-level weights (BCW), template matching (TM) can be performed, for example, for each BCW candidate weight in the BCW list, as illustrated in Figures 19, 21, and 23. The TM can be performed by (i) determining a respective TM cost corresponding to each BCW candidate weight, and (ii) selecting, based on the respective determined TM costs, a BCW candidate weight to be the BCW weight used to code the current block.
[0204] In one embodiment, as described in Figures 21 and 23, each TM cost can be determined based at least on a portion of a current template of the current block and a respective bidirectional predictor template. The bidirectional predictor template can be based on a respective BCW candidate weight, a portion of a first reference template in a first reference picture, and a portion of a first reference template in a second reference picture, where the first reference template and the second reference template correspond to the current template.
[0205] In one example, as illustrated in Figures 19, 21, and 23, each TM cost can be determined based on all of the current templates of the current block (i.e., the entire current template) and the respective bidirectional predictor templates, which can be based on the respective BCW candidate weights, all of the first reference templates, and all of the second reference templates.
[0206] In one embodiment, the BCW candidate weights are ranked or sorted based on their respective determined TM costs, and a BCW candidate weight is selected from the ranked or sorted BCW candidate weights to be the BCW weight used to encode the current block.
[0207] In one embodiment, all of the current templates are used to determine each TM cost. For each BCW candidate weight, all of the first reference templates determined based on a first motion vector (MV) of the current block are used to calculate the bidirectional predictor template, and all of the second reference templates determined based on a second MV of the current block are used to calculate the bidirectional predictor template. In one example, for each BCW candidate weight, the bidirectional predictor template is a weighted average of all of the first reference templates and all of the second reference templates based on the respective BCW candidate weight.
[0208] In one example, the current block is predicted in an affine AMVP mode with multiple control points, and the first MV and the second MV are associated with a control point among the multiple control points.
[0209] In one embodiment, the shape of the current template is based on one or more of: (i) reconstructed samples of neighboring blocks of the current block; (ii) the decoding order of the current block; or (iii) the size of the current block.
[0210] In one example, the current template includes reconstruction regions that are neighboring regions of the current block, for example, the reconstruction regions are one of: (i) a left neighboring region and an above neighboring region, (ii) a left neighboring region, an above neighboring region and an above-left neighboring region, (iii) an above neighboring region, or (iv) a left neighboring region.
[0211] In one embodiment, the current block is predicted in an affine mode (e.g., affine AMVP mode). The current template includes a current subblock, and the portion of the current template used to determine each TM cost is one of the current subblocks. For each BCW candidate weight, the first reference template includes a first reference subblock that corresponds to the current subblock, and the portion of the first reference template used to calculate the bidirectional predictor template is one of the first reference subblocks. The second reference template includes a second reference subblock that corresponds to the current subblock, and the portion of the second reference template used to calculate the bidirectional predictor template is one of the second reference subblocks. The bidirectional predictor template can be based on the respective BCW candidate weight, one of the first reference subblocks, and one of the second reference subblocks. In one example, for each BCW candidate weight, the bidirectional predictor template is a weighted average of one of the first reference subblocks and one of the second reference subblocks based on the respective BCW candidate weight.
[0212] In one example, the BCW candidate weights are normalized by 8, 16 or 32.
[0213] In (S2420), the current block may be encoded based on the selected BCW weight. Prediction information indicating that the current block is predicted with a BCW may be encoded. In one example, the prediction information indicates a BCW index that points to a BCW candidate weight among the ranked BCW candidate weights.
[0214] In one example, the prediction information indicates that the current block is predicted in an affine mode (eg, affine AMVP mode).
[0215] At S2430, the encoded prediction information and the encoded current block may be included in the video bitstream. The process then proceeds to S2499 and ends.
[0216] The process 2400 can be adapted to various scenarios as appropriate, and the steps in the process 2400 can be adjusted accordingly. One or more steps in the process 2400 can be adapted, omitted, repeated, and / or combined. Any suitable order can be used to implement the process 2400. Additional steps can be added.
[0217] FIG. 25 shows a flow chart outlining a decoding process (2500) according to one embodiment of the present disclosure. In various embodiments, the process (2500) is performed by a processing circuit such as a processing circuit in the terminal devices (310), (320), (330), and (340), a processing circuit performing the function of a video encoder (403), a processing circuit performing the function of a video decoder (410), a processing circuit performing the function of a video decoder (510), a processing circuit performing the function of a video encoder (603), etc. In some embodiments, the process (2500) is implemented with software instructions, and thus the processing circuit performs the process (2500) when the processing circuit executes the software instructions. The process starts at (S2501) and proceeds to (S2510).
[0218] At (S2510), prediction information for a current block in a current picture can be decoded from a coded video bitstream. The prediction information can indicate that the current block is predicted with bi-prediction with CU-level weights (BCW).
[0219] In (S2520), for example, template matching (TM) can be performed for each BCW candidate weight in the BCW list, as described in Figures 19, 21, and 23. TM can be performed by (i) determining a respective TM cost corresponding to each of the respective BCW candidate weights, and (ii) selecting a BCW candidate weight to be the BCW weight used to reconstruct the current block based on the respective determined TM costs.
[0220] 21 and 23, each TM cost can be determined based at least on a current template of the current block and some or all of the respective bidirectional predictor templates. The bidirectional predictor templates can be based on the respective BCW candidate weights, some or all of a first reference template in the first reference picture, and some or all of a first reference template in the second reference picture, where the first reference template and the second reference template correspond to the current template.
[0221] In one embodiment, the BCW candidate weights are ranked (e.g., sorted) based on their respective determined TM costs, and a BCW candidate weight is selected from the ranked BCW candidate weights to be the BCW weight.
[0222] In one embodiment, all of the current templates (i.e., the entire current templates) are used to determine each TM cost. For each BCW candidate weight, all of the first reference templates (i.e., the entire first reference templates) determined based on the first motion vector (MV) of the current block are used to calculate the bidirectional predictor template, and all of the second reference templates (i.e., the entire second reference templates) determined based on the second MV of the current block are used to calculate the bidirectional predictor template. In one example, for each BCW candidate weight, the bidirectional predictor template is a weighted average of all of the first reference templates and all of the second reference templates based on the respective BCW candidate weight.
[0223] In one example, the prediction information decoded in (S2510) indicates that the current block is predicted in an affine AMVP mode with multiple control points, and the first MV and the second MV are associated with a control point among the multiple control points.
[0224] In one embodiment, the shape of the current template is based on one or more of: (i) reconstructed samples of neighboring blocks of the current block; (ii) the decoding order of the current block; or (iii) the size of the current block.
[0225] In one embodiment, the current template includes reconstruction regions that are neighboring regions of the current block, for example, the reconstruction regions are one of: (i) a left neighboring region and an above neighboring region, (ii) a left neighboring region, an above neighboring region and an above-left neighboring region, (iii) an above neighboring region, or (iv) a left neighboring region.
[0226] In one embodiment, the prediction information decoded in (S2510) indicates that the current block is predicted in an affine mode (e.g., affine AMVP mode). The current template includes a current subblock, and the portion of the current template used to determine each TM cost is one of the current subblocks. For each BCW candidate weight, the first reference template includes a first reference subblock corresponding to the current subblock, and the portion of the first reference template used to calculate the bidirectional predictor template is one of the first reference subblocks. The second reference template includes a second reference subblock corresponding to the current subblock, and the portion of the second reference template used to calculate the bidirectional predictor template is one of the second reference subblocks. The bidirectional predictor template can be based on the respective BCW candidate weight, one of the first reference subblocks, and one of the second reference subblocks. In one example, for each BCW candidate weight, the bidirectional predictor template is a weighted average of one of the first reference subblocks and one of the second reference subblocks based on the respective BCW candidate weight.
[0227] In one example, the BCW candidate weights are normalized by 8, 16 or 32.
[0228] At (S2530), the current block can be reconstructed based on the selected BCW weights.
[0229] The process (2500) proceeds to (S2599) and ends.
[0230] The process (2500) may be adapted to various scenarios as appropriate, and the steps in the process (2500) may be adjusted accordingly. One or more steps in the process (2500) may be adapted, omitted, repeated, and / or combined. Any suitable order may be used to implement the process (2500). Additional steps may be added.
[0231] FIG. 26 shows a flow chart outlining a decoding process (2600) according to one embodiment of the present disclosure. In various embodiments, the process (2600) is performed by a processing circuit, such as a processing circuit in the terminal devices (310), (320), (330), and (340), a processing circuit performing the function of a video encoder (403), a processing circuit performing the function of a video decoder (410), a processing circuit performing the function of a video decoder (510), a processing circuit performing the function of a video encoder (603), etc. In some embodiments, the process (2600) is implemented with software instructions, and thus the processing circuit performs the process (2600) when the processing circuit executes the software instructions. The process starts at (S2601) and proceeds to (S2610).
[0232] At (S2610), prediction information for a current block in a current picture can be decoded from the coded video bitstream.
[0233] At (S2620), it is determined that the current block is predicted with bi-prediction and the prediction information indicates that bi-prediction with CU-level weights (BCW) is valid for the current block.
[0234] At (S2630), for example, template matching (TM) can be performed for each BCW candidate weight in the BCW list, as described in Figures 19, 21, and 23. TM can be performed by (i) determining a respective TM cost corresponding to each of the respective BCW candidate weights, and (ii) sorting the BCW candidate weights based on the respective determined TM costs.
[0235] Each TM cost can be determined based at least on a current template of the current block and some or all of a respective bidirectional predictor template, the bidirectional predictor template being based on a respective BCW candidate weight, some or all of a first reference template in the first reference picture, and some or all of a first reference template in the second reference picture, the first reference template and the second reference template corresponding to the current template.
[0236] At (S2640), the current block can be reconstructed based on the reordered BCW candidate weights.
[0237] The process (2600) proceeds to (S2699) and ends.
[0238] The process 2600 can be adapted to various scenarios as appropriate, and the steps in the process 2600 can be adjusted accordingly. One or more steps in the process 2600 can be adapted, omitted, repeated, and / or combined. Any suitable order can be used to implement the process 2600. Additional steps can be added.
[0239] The embodiments in this disclosure may be used individually or combined in any order. Furthermore, each of the methods (or embodiments), the encoder, and the decoder may be implemented by a processing circuit (e.g., one or more processors or one or more integrated circuits). In one example, the one or more processors execute a program stored on a non-transitory computer-readable medium.
[0240] The techniques described above can be implemented as computer software using computer-readable instructions and can be physically stored on one or more computer-readable media. For example, Figure 27 illustrates a computer system (2700) suitable for implementing certain embodiments of the disclosed subject matter.
[0241] Computer software can be coded using any suitable machine code or computer language and can be subject to assembly, compilation, linking, or similar mechanisms to produce code containing instructions that can be executed by one or more computer central processing units (CPUs), graphics processing units (GPUs), etc., either directly, or through interpretation, microcode execution, etc.
[0242] The instructions may be executed on various types of computers or components thereof, including, for example, personal computers, tablet computers, servers, smart phones, gaming devices, Internet of Things devices, etc.
[0243] 27 for computer system (2700) are exemplary in nature and are not intended to suggest any limitation as to the scope of use or functionality of the computer software implementing the embodiments of the present disclosure, nor should the arrangement of components be interpreted as having any dependency or requirement regarding any one or combination of components illustrated in the exemplary embodiment of computer system (2700).
[0244] The computer system (2700) may include certain human interface input devices that may be responsive to input by one or more human users through, for example, tactile input (e.g., keystrokes, swipes, data glove movements), audio input (e.g., voice, clapping), visual input (e.g., gestures), and olfactory input (not shown). Human interface devices may also be used to capture certain media that are not necessarily directly related to conscious human input, such as audio (e.g., speech, music, ambient sounds), images (e.g., scanned images, photographic images obtained from still image cameras), and video (e.g., two-dimensional video, three-dimensional video including stereoscopic video).
[0245] The input human interface devices may include one or more (only one of each is shown) of a keyboard (2701), a mouse (2702), a trackpad (2703), a touch screen (2710), a data glove (not shown), a joystick (2705), a microphone (2706), a scanner (2707), and a camera (2708).
[0246] The computer system (2700) may also include certain human interface output devices. Such human interface output devices may stimulate one or more of the human user's senses, for example, through haptic output, sound, light, and smell / taste. Such human interface output devices may include haptic output devices (e.g., haptic feedback via a touch screen (2710), data gloves (not shown), or joystick (2705); although there may be haptic feedback devices that do not act as input devices), audio output devices (e.g., speakers (2709), headphones (not shown)), visual output devices (e.g., screens (2710), including CRT screens, LCD screens, plasma screens, OLED screens; each may or may not have touch screen input capability, each may or may not have haptic feedback capability, some of which may output two-dimensional visual output or higher than three-dimensional output through such means as stereoscopic output; virtual reality glasses (not shown), holographic displays, and smoke tanks (not shown)), and printers (not shown).
[0247] The computer system (2700) may also include human accessible storage devices and associated media, such as optical media including CD / DVD ROM / RW (2720) along with CD / DVD or similar media (2721), thumb drives (2722), removable hard drives or solid state drives (2723), legacy magnetic media such as tapes and floppy disks (not shown), specialized ROM / ASIC / PLD based devices (not shown) such as security dongles, etc.
[0248] Those skilled in the art should also understand that the term "computer-readable medium" as used in connection with the presently disclosed subject matter does not encompass transmission media, carrier waves, or other transitory signals.
[0249] The computer system (2700) may also include an interface (2754) to one or more communication networks (2755). The networks may be, for example, wireless, wired, optical. The networks may further be local, wide area, metropolitan, in-vehicle and industrial, real-time, delay tolerant, etc. Examples of networks include Ethernet, WLAN, cellular networks including GSM, 3G, 4G, 5G, LTE, etc., TV wired or wireless wide area digital networks including cable television, satellite television, terrestrial broadcast television, in-vehicle and industrial including CANBus, etc. Certain networks usually require an external network interface adapter that is attached to a particular general purpose data port or peripheral bus (2749) (e.g., a USB port of the computer system (2700)). Others are usually integrated into the core of the computer system (2700) by attachment to a system bus as described below (e.g., an Ethernet interface to a PC computer system or a cellular network interface to a smartphone computer system). Using any of these networks, computer system (2700) can communicate with other entities. Such communications may be unidirectional, receive only (e.g., broadcast television), unidirectional transmit only (e.g., CANbus to a specific CANbus device), or bidirectional, for example, to other computer systems using local or wide area digital networks. Specific protocols and protocol stacks may be used with each of these networks and network interfaces as described above.
[0250] The aforementioned human interface devices, human accessible storage devices, and network interfaces may be attached to a core (2740) of the computer system (2700).
[0251] The core (2740) may include one or more central processing units (CPUs) (2741), graphics processing units (GPUs) (2742), specialized programmable processing units in the form of field programmable gate arrays (FPGAs) (2743), hardware accelerators for specific tasks (2744), graphics adapters (2750), etc. These devices may be connected through a system bus (2748), along with read only memory (ROM) (2745), random access memory (2746), internal mass storage devices (2747), such as internal non-user accessible hard drives, solid state drives (SSDs), etc. In some computer systems, the system bus (2748) may be accessible in the form of one or more physical plugs to allow expansion with additional CPUs, GPUs, etc. Peripheral devices may be attached directly to the core's system bus (2748) or through a peripheral bus (2749). In one example, a screen (2710) may be connected to the graphics adapter (2750). Architectures for peripheral buses include PCI, USB, and the like.
[0252] The CPU (2741), GPU (2742), FPGA (2743), and accelerator (2744) can execute certain instructions that, in combination, may constitute the above-mentioned computer code. The computer code may be stored in a ROM (2745) or a RAM (2746). Temporary data may be stored in the RAM (2746), while persistent data may be stored, for example, in an internal mass storage device (2747). Rapid storage and retrieval from any of the memory devices may be enabled through the use of a cache memory that may be closely associated with one or more of the CPU (2741), GPU (2742), mass storage device (2747), ROM (2745), RAM (2746), etc.
[0253] The computer-readable medium can have computer code thereon for performing various computer-implemented operations. The medium and computer code may be those specially designed and constructed for the purposes of the present disclosure, or they may be of the kind well known and available to those having skill in the computer software arts.
[0254] By way of example and not limitation, a computer system having the architecture (2700), and in particular the core (2740), can provide functionality as a result of the processor (including CPU, GPU, FPGA, accelerator, etc.) executing software embodied in one or more tangible computer-readable media. Such computer-readable media can be user-accessible mass storage as introduced above as well as media associated with the core's (2740) specific storage of a non-transitory nature, such as the core's internal mass storage device (2747) or ROM (2745). Software implementing various embodiments of the present disclosure can be stored in such devices and executed by the core (2740). The computer-readable media can include one or more memory devices or chips, depending on the particular needs. The software can cause the core (2740) and in particular the processor therein (including CPU, GPU, FPGA, etc.) to execute certain processes or certain specific portions thereof described herein, including defining data structures stored in RAM (2746) and modifying such data structures according to the software-defined processes. Additionally or alternatively, the computer system may provide functionality as a result of logic hardwired or otherwise embodied in circuitry (e.g., accelerator (2744)), which may operate in place of or in conjunction with software to perform particular processes or portions of particular processes described herein. Reference to software includes logic, and vice versa, as appropriate. Reference to a computer-readable medium may include circuitry (e.g., an integrated circuit (IC)) that stores software for execution, circuitry that embodies logic for execution, or both, as appropriate. The present disclosure encompasses any suitable combination of hardware and software.
[0255] Appendix A: Acronyms JEM: joint exploration model VVC: versatile video coding BMS: benchmark set MV: Motion Vector HEVC: High Efficiency Video Coding SEI: Supplementary Enhancement Information VUI: Video Usability Information GOP: Group of Pictures TU: Transform Unit PU: Prediction Unit CTU: Coding Tree Unit CTB: Coding Tree Block PB: Prediction Block HRD: Hypothetical Reference Decoder SNR: Signal Noise Ratio CPU: Central Processing Unit GPU: Graphics Processing Unit CRT: Cathode Ray Tube LCD: Liquid-Crystal Display OLED: Organic Light-Emitting Diode CD: Compact Disc DVD: Digital Video Disc ROM: Read-Only Memory RAM: Random Access Memory ASIC: Application-Specific Integrated Circuit PLD: Programmable Logic Device LAN: Local Area Network GSM: Global System for Mobile communications LTE: Long-Term Evolution CANBus: Controller Area Network Bus USB: Universal Serial Bus PCI: Peripheral Component Interconnect FPGA: Field Programmable Gate Areas SSD: solid-state drive IC: Integrated Circuit CU: Coding Unit RD: Rate-Distortion
[0256] While this disclosure has described several exemplary embodiments, there are alterations, substitutions, and various substitute equivalents, which fall within the scope of this disclosure. Thus, it will be appreciated that those skilled in the art will be able to devise many systems and methods that, although not explicitly shown or described herein, embody the principles of the present disclosure and are thus within the spirit and scope of the present disclosure.
Claims
1. 1. A method for video decoding in a video decoder, comprising: decoding prediction information for a current block in a current picture from a coded video bitstream; determining that the prediction information indicates that (1) the current block is predicted with bidirectional prediction and (2) coding unit (CU) level weighting bidirectional prediction (BCW) is enabled for the current block; determining a respective template matching (TM) cost corresponding to each of the respective BCW candidate weights, where each TM cost is determined based at least on a current template and a respective bidirectional predictor template of the current block, the bidirectional predictor template being based on the respective BCW candidate weights, a portion or all of a first reference template in a first reference picture, and a portion or all of a second reference template in a second reference picture, the first reference template and the second reference template corresponding to the current template; Reorder the BCW candidate weights based on their respective determined TM costs. performing TM for each BCW candidate weight by reconstructing the current block based on the reordered BCW candidate weights; Including, performing the TM step further comprises selecting, from the reordered BCW candidate weights, a BCW candidate weight to be used to reconstruct the current block; all of the current templates are used to determine each TM cost; For each BCW candidate weight, all of the first reference templates determined based on a first motion vector (MV) of the current block are used to calculate the bidirectional predictor template; all of the second reference templates determined based on a second MV of the current block are used to calculate the bidirectional predictor template; A method, wherein the prediction information indicates that the current block is predicted in an affine adaptive motion vector prediction (AMVP) mode having multiple control points, and the first MV and the second MV are associated with a control point among the multiple control points.
2. The method of claim 1 , wherein the shape of the current template is based on one or more of: (i) reconstructed samples of neighboring blocks of the current block; (ii) a decoding order of the current block; or (iii) a size of the current block.
3. The method of claim 1 , wherein the current template includes one or more reconstruction regions that are neighboring regions of the current block.
4. 4. The method of claim 3, wherein the one or more reconstruction regions that are neighboring regions of the current block are one of: (i) a left neighboring region and an above neighboring region; (ii) the left neighboring region, the above neighboring region and an above-left neighboring region; (iii) the above neighboring region; or (iv) the left neighboring region.
5. 1. An apparatus for video decoding including a processing circuit, comprising: Apparatus, wherein the processing circuitry is configured to perform a method according to any one of claims 1 to 4.
6. A program causing at least one processor to carry out the method according to any one of claims 1 to 4.
7. 1. A method for video encoding in a video encoder, comprising: determining that prediction information indicates that (1) a current block is predicted with bidirectional prediction and (2) coding unit (CU) level weighting bidirectional prediction (BCW) is enabled for the current block; encoding the prediction information of the current block into a coded video bitstream; determining a respective template matching (TM) cost corresponding to each of the respective BCW candidate weights, where each TM cost is determined based at least on a current template and a respective bidirectional predictor template of the current block, the bidirectional predictor template being based on the respective BCW candidate weights, a portion or all of a first reference template in a first reference picture, and a portion or all of a second reference template in a second reference picture, the first reference template and the second reference template corresponding to the current template; Reorder the BCW candidate weights based on their respective determined TM costs. performing template matching (TM) for each BCW candidate weight by encoding the current block based on the permuted BCW candidate weights; Including, performing the TM step further comprises selecting, from the reordered BCW candidate weights, a BCW candidate weight to be used to reconstruct the current block; all of the current templates are used to determine each TM cost; For each BCW candidate weight, all of the first reference templates determined based on a first motion vector (MV) of the current block are used to calculate the bidirectional predictor template; all of the second reference templates determined based on a second MV of the current block are used to calculate the bidirectional predictor template; A method, wherein the prediction information indicates that the current block is predicted in an affine adaptive motion vector prediction (AMVP) mode having multiple control points, and the first MV and the second MV are associated with a control point among the multiple control points.
Citation Information
Patent Citations
Systems and methods for generalized multi-hypothesis prediction for video coding
JP2019519148A
Motion vector precision in merge with motion vector difference mode
US20210203945A1
Encoder, decoder, encoding method, and decoding method
US20210266590A1
Encoding device, decoding device, encoding method and decoding method
WO2020116241A1