Bidirectional Optical Flow in Video Coding
By selectively applying bidirectional optical flow (BDOF) at the sub-block level based on distortion values, the method addresses inefficiencies in existing video coding standards, enhancing decoding performance and efficiency.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2026-03-03
AI Technical Summary
Existing video coding techniques face challenges in efficiently utilizing bidirectional optical flow (BDOF) for improved coding performance, particularly in standards like HEVC, VVC, and EVC, due to the lack of selective application of per-pixel BDOF or bypassing it at the sub-block level.
A method and device for video decoding that selectively determines whether to perform per-pixel BDOF or bypass it for sub-blocks based on distortion values, allowing for improved coding performance by reusing distortion value calculations.
Enhances coding efficiency by selectively applying BDOF at the sub-block level, improving video decoding performance and reducing computational overhead.
Smart Images

Figure 0007823046000015 
Figure 0007823046000016 
Figure 0007823046000017
Abstract
Description
[Technical Field]
[0001] This application claims priority to U.S. Application No. 17 / 645,233, filed December 20, 2021, and U.S. Provisional Application No. 63 / 129,190, filed December 22, 2020, the entire contents of each of which are incorporated herein by reference. U.S. Application No. 17 / 645,233 claims the benefit of U.S. Provisional Application No. 63 / 129,190, filed December 22, 2020.
[0002] TECHNICAL FIELD This disclosure relates to video encoding and decoding. [Background technology]
[0003] Digital video capabilities may be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video gaming devices, video game consoles, cellular or satellite radiotelephones, so-called "smartphones," video teleconferencing devices, video streaming devices, etc. Digital video devices implement video coding techniques such as those described in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4, Part 10, Advanced Video Coding (AVC), ITU-T H.265 / High Efficiency Video Coding (HEVC), and extensions to such standards. By implementing such video coding techniques, video devices may more efficiently transmit, receive, encode, decode, and / or store digital video information.
[0004] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) may be partitioned into video blocks, which are also sometimes referred to as coding tree units (CTUs), coding units (CUs), and / or coding nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction with respect to reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial prediction with respect to reference samples in neighboring blocks in the same picture or temporal prediction with respect to reference samples in other reference pictures. A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame. [Prior art documents] [Non-patent literature]
[0005] [Non-Patent Document 1] "Series H: Audiovisual and Multimedia Systems, Infrastructure of Audiovisual Services-Coding of Moving Video, High Efficiency Video Coding", International Telecommunication Union, December 2016, 664 pages [Non-patent document 2] VVC Test Model 10 (VTM10.0), https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM [Non-patent document 3] Bross et al., "Versatile Video Coding (Draft 10)," Joint Video Experts Team (JVET) of ITU-T SG16 WP 3 and ISO / IEC JTC 1 / SC29 / WG11, 18th Meeting via Teleconference, June 22-July 1, 2020, JVET-S2001-vA [Non-patent document 4] Bross et al., "Versatile Video Coding Editorial Refinements on Draft 10," Joint Video Experts Team (JVET) of ITU-T SG16 WP 3 and ISO / IEC JTC 1 / SC29 / WG11, 20th Meeting via Teleconference, October 7-16, 2020, JVET-T2001-v2 [Non-patent document 5] J. Chen, Y. Ye, and S. Kim, "Algorithm description for Versatile Video Coding and Test Model 11 (VTM 11)," JVET-T2002, December 2020. Summary of the Invention [Problem to be solved by the invention]
[0006] Generally, this disclosure describes techniques for decoder-side motion vector derivation (e.g., template matching, bidirectional matching, decoder-side motion vector (MV) refinement, and / or bi-directional optical flow (BDOF)). The techniques of this disclosure may be applied to any of the existing video codecs, such as High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), Essential Video Coding (EVC), etc., or may be efficient coding tools in any future video coding standard. [Means for solving the problem]
[0007] In one or more examples, for BDOF, a video encoder and a video decoder (e.g., a video coder) may be configured to selectively determine whether per-pixel BDOF is performed on a sub-block of a block or whether BDOF is bypassed. That is, the video coder may select one of per-pixel BDOF or per-pixel BDOF (or BDOF in general) being bypassed. In this way, example techniques may facilitate selection between coding modes that may result in better coding performance when combined together (e.g., when the video coder determines that one of per-pixel BDOF is performed on a sub-block or BDOF is bypassed for the sub-block).
[0008] Moreover, in some examples, determining whether to perform per-pixel BDOF or to bypass BDOF for a sub-block may be based on determining a distortion value and comparing the distortion value to a threshold. In some examples, the video coder may be configured to determine the distortion value in a manner such that the calculations used to determine the distortion value can be reused by the video coder when performing per-pixel BDOF. For example, if the video coder is to perform per-pixel BDOF, the video coder may reuse results from the calculations performed to determine the distortion value to perform per-pixel BDOF.
[0009] In one example, the present disclosure describes a method for decoding video data, the method comprising: determining that bidirectional optical flow (BDOF) is enabled for a block of the video data; dividing the block into a plurality of sub-blocks based on the determination that BDOF is enabled for the block; determining a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks; determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, one of performing pixel-wise BDOF or bypassing BDOF based on the respective distortion value; determining a predicted sample for each sub-block of the one or more sub-blocks based on the determination that pixel-wise BDOF is performed or bypassing BDOF; and reconstructing the block based on the predicted sample.
[0010] In one example, the present disclosure describes a device for decoding video data, the device comprising: a memory configured to store the video data; and processing circuitry coupled to the memory; the processing circuitry is configured to: determine that bidirectional optical flow (BDOF) is enabled for a block of the video data; divide the block into a plurality of sub-blocks based on the determination that BDOF is enabled for the block; determine a respective distortion value for each sub-block of one or more of the plurality of sub-blocks; determine, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, one of whether pixel-wise BDOF is performed or BDOF is bypassed based on the respective distortion value; determine a predictive sample for each sub-block of the one or more sub-blocks based on the determination that pixel-wise BDOF is performed or BDOF is bypassed; and reconstruct the block based on the predictive sample.
[0011] In one example, the present disclosure describes a computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to determine that bidirectional optical flow (BDOF) is enabled for a block of video data, divide the block into a plurality of sub-blocks based on a determination that BDOF is enabled for the block, determine a respective distortion value for each sub-block of one or more of the plurality of sub-blocks, determine one of whether pixel-wise BDOF is performed or BDOF is bypassed for each sub-block of the one or more sub-blocks based on the respective distortion value, determine a predicted sample for each sub-block of the one or more sub-blocks based on the determination that pixel-wise BDOF is performed or BDOF is bypassed, and reconstruct the block based on the predicted sample.
[0012] In one example, the present disclosure describes a device for decoding video data, the device comprising: means for determining that bidirectional optical flow (BDOF) is enabled for a block of the video data; means for dividing the block into a plurality of sub-blocks based on a determination that BDOF is enabled for the block; means for determining a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks; means for determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, one of whether pixel-wise BDOF is performed or BDOF is bypassed based on the respective distortion value; means for determining a predicted sample for each sub-block of the one or more sub-blocks based on the determination that pixel-wise BDOF is performed or BDOF is bypassed; and means for reconstructing the block based on the predicted sample.
[0013] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will become apparent from the description, drawings, and claims. [Brief explanation of the drawings]
[0014] [Figure 1] FIG. 1 is a block diagram illustrating an example video encoding and decoding system that may implement the techniques of this disclosure. [Figure 2A] FIG. 1 is a conceptual diagram illustrating an exemplary quad-tree binary tree (QTBT) structure and corresponding coding tree unit (CTU). [Figure 2B] FIG. 1 is a conceptual diagram illustrating an exemplary quad-tree binary tree (QTBT) structure and corresponding coding tree unit (CTU). [Figure 3] FIG. 2 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure. [Figure 4] FIG. 2 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure. [Figure 5A] FIG. 10 is a conceptual diagram illustrating examples of spatially adjacent motion vector candidates for merge mode. [Figure 5B] FIG. 1 is a conceptual diagram illustrating examples of spatially neighboring motion vector candidates for an Advanced Motion Vector Predictor (AMVP) mode. [Figure 6A] FIG. 1 is a conceptual diagram illustrating examples of temporal motion vector predictor (TMVP) candidates. [Figure 6B] FIG. 10 is a conceptual diagram illustrating an example of motion vector scaling. [Figure 7] FIG. 1 is a conceptual diagram illustrating template matching performed on a search area around an initial motion vector (MV). [Figure 8] FIG. 10 is a conceptual diagram illustrating an example of proportional motion vector differentials based on temporal distance. [Figure 9] FIG. 10 is a conceptual diagram illustrating an example of specular motion vector differentials independent of time distance. [Figure 10] FIG. 1 is a conceptual diagram illustrating an example of a 3×3 square search pattern within a search range of [−8, 8]. [Figure 11] FIG. 10 is a conceptual diagram illustrating an example of improving a decoding-side motion vector. [Figure 12]FIG. 1 is a conceptual diagram illustrating an extended coding unit (CU) used in bidirectional optical flow (BDOF). [Figure 13] 10 is a flowchart illustrating an example process for per-pixel BDOF with sub-block bypass. [Figure 14] FIG. 10 is a conceptual diagram illustrating an example of pixel-based BDOF for an 8×8 sub-block. [Figure 15] 10 is a flowchart illustrating an example method for decoding a current block, in accordance with techniques of this disclosure. [Figure 16] 10 is a flowchart illustrating an example method for encoding a current block, in accordance with techniques of this disclosure. DETAILED DESCRIPTION OF THE INVENTION
[0015] A video encoder may be configured to generate a predictive block from one or more reference blocks in one or more reference pictures using one or more motion vectors for the block. The video encoder determines a residual between the predictive block and the block and signals information indicative of the residual and information used to determine the motion vector. The video decoder receives the information indicative of the residual and the information used to determine the motion vector. The video decoder determines the motion vector, determines a reference block from the motion vector, and generates the predictive block. The video decoder adds the predictive block to the residual to reconstruct the block.
[0016] In some cases, the reference block and the predictive block are the same block. However, it is not necessary that the reference block and the predictive block be the same in all examples. In some examples, such as in bi-prediction, the video encoder and the video decoder may determine a first reference block based on a first motion vector and a second reference block based on a second motion vector. The video encoder and the video decoder may blend the first reference block and the second reference block to generate a predictive block.
[0017] Moreover, in some examples, the video encoder and video decoder may generate the predictive block based on adjustments to sample values of the first and second reference blocks. One exemplary method for adjusting sample values to generate samples of the predictive block is called bidirectional optical flow (BDOF). For example, (0) (x,y) points to the first reference block, and I (1) Assume (x,y) points to the second reference block. In BDOF, the predicted block is I (0) (x,y) plus I (1) As described below, video encoders and decoders may determine an adjustment factor (i.e., b(x,y)) as part of the process of determining the prediction sample and add the adjustment factor to the prediction block (i.e., I (0) (x,y) + I (1) (x,y) + b(x,y)). To determine the predicted sample, (0) (x,y) + I (1) There may be additional scaling and offsetting of the result of (x,y) + b(x,y).
[0018] In BDOF, video encoders and video decoders use motion vectors to determine adjustment factors (e.g., factors to be multiplied or added) to adjust sample values of a predictive block to generate a predictive sample. As an example, the video encoder and video decoder may generate a predictive sample by adding a corresponding sample of a first reference block, a corresponding sample of a second reference block, and a corresponding value generated from the motion refinement.
[0019] There may be various types of BDOF techniques. One example of BDOF is sub-block BDOF, and another example of a BDOF technique is per-pixel BDOF. In sub-block BDOF, video encoders and video decoders determine a motion improvement (also referred to as enhanced motion) for a sub-block. For sub-block BDOF, video encoders and video decoders use the same motion improvement to adjust samples from a predictive block, where the predictive block may be generated using a first reference block and a second reference block (e.g., a sum of the first reference block and the second reference block, or a weighted average of the first reference block and the second reference block). For per-pixel BDOF, video encoders and video decoders may determine a motion improvement factor, which may be different, for two or more samples in a current block. For per-pixel BDOF, video encoders and video decoders may adjust samples from a predictive block using the motion improvement (also referred to as enhanced motion) determined for the per-pixel samples, where the predictive block may be generated using the first reference block and the second reference block.
[0020] While BDOF or other improvement techniques may be selectively enabled at the block level, whether BDOF is applied at the sub-block level may be estimated based on distortion values. For example, a video encoder may enable BDOF for a block and may signal information indicating that BDOF is enabled for the block.
[0021] In response, the video decoder may divide the block into multiple sub-blocks based on the determination that BDOF is enabled for the block. Although BDOF is enabled for the block, the video decoder may determine for each sub-block whether BDOF is to be actually performed or to be bypassed. For example, the video decoder determines a respective distortion value for each sub-block of one or more sub-blocks of the multiple sub-blocks.
[0022] According to one or more examples described in this disclosure, a video decoder may determine, for each sub-block of one or more sub-blocks of the plurality of sub-blocks, one of whether to perform per-pixel BDOF or to bypass BDOF based on a respective distortion value. For example, the video decoder may determine a first distortion value for a first sub-block and determine, based on the first distortion value, that per-pixel BDOF is to be performed for the first sub-block. The video decoder may determine a second distortion value for a second sub-block and determine, based on the second distortion value, that BDOF is to be bypassed for the second sub-block, and so on.
[0023] In one or more examples, when the video decoder determines that BDOF is to be performed, the video decoder may perform per-pixel BDOF, and other BDOF techniques may not be available to the video decoder. That is, the video decoder may determine, for each sub-block, whether per-pixel BDOF is to be performed or BDOF is to be bypassed. When BDOF is performed, the BDOF technique available to the video decoder may be per-pixel BDOF, and other BDOF techniques may not be available.
[0024] In one or more examples, as described above, the video decoder may determine a distortion value for each sub-block to determine whether per-pixel BDOF is performed or whether BDOF is bypassed. In some examples, as described in more detail below, the video decoder may reuse the calculations used to determine the distortion value to determine the per-pixel motion improvement for the per-pixel BDOF. For example, for a first sub-block, the video decoder may determine a first distortion value. Assume that the video decoder has determined that per-pixel BDOF is enabled for the first sub-block. In some examples, rather than recalculating all values needed to determine the per-pixel motion improvement, the video decoder may be configured to reuse results from the calculations that the video decoder performed to determine that per-pixel BDOF is performed to determine the per-pixel motion improvement.
[0025] The video decoder may be configured to determine a predictive sample for each sub-block of one or more sub-blocks based on a determination that per-pixel BDOF is performed or BDOF is bypassed. For example, assume that per-pixel BDOF is performed for the sub-block. In this example, the video decoder may generate a predictive sample for the sub-block by improving a sample of the predictive block (e.g., a block generated from combining two reference blocks) based on per-pixel motion refinement. As another example, assume that BDOF is bypassed for the sub-block. In this example, the video decoder may not perform refinement of the sample of the predictive block to generate a predictive sample. Rather, the sample of the predictive block may be the same as the predictive sample (or possibly with some adjustment not based on BDOF). For example, when BDOF is bypassed, the video encoder and video decoder may generate a predictive sample by determining a weighted average of corresponding samples in the first reference block and the second reference block.
[0026] The video decoder may reconstruct the block based on the prediction samples. For example, the video decoder may receive residual values indicating differences between the prediction samples and the samples of the block, and may add the residual values to the prediction samples to reconstruct the block. The above example is described from the perspective of a video decoder. A video encoder may be configured to perform similar techniques. For example, the prediction samples generated by the video decoder should be the same as the prediction samples generated by the video encoder. Thus, the video encoder may perform techniques similar to those described above to determine the prediction samples in the same manner as a video decoder.
[0027] 1 is a block diagram illustrating an example video encoding and decoding system 100 that may perform the techniques of this disclosure. The techniques of this disclosure are generally directed to coding (encoding and / or decoding) video data. Generally, video data includes any data for processing video. Thus, video data may include raw uncoded video, coded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.
[0028] 1, system 100 includes a source device 102 that, in this example, provides encoded video data to be decoded and displayed by a destination device 116. In particular, source device 102 provides video data to destination device 116 via a computer-readable medium 110. Source device 102 and destination device 116 may comprise any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, mobile devices, tablet computers, set-top boxes, telephone handsets such as smartphones, televisions, cameras, display devices, digital media players, video gaming consoles, video streaming devices, broadcast receiver devices, etc. In some cases, source device 102 and destination device 116 may be equipped for wireless communication and therefore may be referred to as wireless communication devices.
[0029] In the example of FIG. 1, source device 102 includes a video source 104, memory 106, video encoder 200, and output interface 108. Destination device 116 includes an input interface 122, a video decoder 300, memory 120, and a display device 118. According to this disclosure, video encoder 200 of source device 102 and video decoder 300 of destination device 116 may be configured to apply techniques for decoder-side motion vector derivation techniques, such as template matching, bidirectional matching, decoder-side motion vector (MV) refinement, and bidirectional optical flow. Thus, source device 102 represents an example of a video encoding device, and destination device 116 represents an example of a video decoding device. In other examples, the source device and destination device may include other components or configurations. For example, source device 102 may receive video data from an external video source, such as an external camera. Similarly, destination device 116 may interface with an external display device rather than including an integrated display device.
[0030] System 100 as shown in FIG. 1 is merely an example. In general, any digital video encoding and / or decoding device may perform techniques for decoder-side motion vector derivation techniques, such as template matching, bidirectional matching, decoder-side motion vector (MV) refinement, and bidirectional optical flow (BDOF). Source device 102 and destination device 116 are merely examples of coding devices, such that source device 102 generates coded video data for transmission to destination device 116. This disclosure refers to a “coding” device as a device that performs coding (encoding and / or decoding) of data. Accordingly, video encoder 200 and video decoder 300 represent examples of coding devices, specifically, video encoders and video decoders, respectively. In some examples, source device 102 and destination device 116 may operate substantially symmetrically, such that source device 102 and destination device 116 each include video encoding and decoding components. Thus, system 100 may support one-way or two-way video transmission between source device 102 and destination device 116, for example, video streaming, video playback, video broadcasting, or video telephony.
[0031] Generally, video source 104 represents a source of video data (i.e., raw, unencoded video data) and provides a continuous series of pictures (also called “frames”) of the video data to video encoder 200, which encodes the data for the pictures. Video source 104 of source device 102 may include a video capture device, such as a video camera, a video archive containing previously captured raw video, and / or a video feed interface for receiving video from a video content provider. As a further alternative, video source 104 may generate computer-graphics-based data as source video, or a combination of live video, archived video, and computer-generated video. In each case, video encoder 200 encodes the captured video data, pre-captured video data, or computer-generated video data. Video encoder 200 may reorder the pictures from the order in which they were received (sometimes referred to as “display order”) to a coding order for coding. Video encoder 200 may generate a bitstream including the encoded video data. Source device 102 may then output the encoded video data onto computer-readable medium 110 via output interface 108 for receipt and / or retrieval by, for example, input interface 122 of destination device 116 .
[0032] Memory 106 of source device 102 and memory 120 of destination device 116 represent general-purpose memory. In some examples, memory 106, 120 may store raw video data, e.g., raw video from video source 104 and raw decoded video data from video decoder 300. Additionally or alternatively, memory 106, 120 may store software instructions executable by video encoder 200 and video decoder 300, respectively, for example. While memory 106 and memory 120 are shown separate from video encoder 200 and video decoder 300 in this example, it should be understood that video encoder 200 and video decoder 300 may also include internal memory for functionally similar or equivalent purposes. Furthermore, memory 106, 120 may store encoded video data, e.g., output from video encoder 200 and input to video decoder 300. In some examples, portions of the memory 106, 120 may be allocated as one or more video buffers, for example, for storing raw decoded video data and / or encoded video data.
[0033] The computer-readable medium 110 may represent any type of medium or device capable of transporting encoded video data from the source device 102 to the destination device 116. In one example, the computer-readable medium 110 represents a communication medium that enables the source device 102 to transmit encoded video data directly to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. The output interface 108 may modulate a transmission signal containing the encoded video data, and the input interface 122 may demodulate a received transmission signal, in accordance with a communication standard such as a wireless communication protocol. The communication medium may comprise any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that may be useful for facilitating communication from the source device 102 to the destination device 116.
[0034] In some examples, source device 102 may output encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access encoded data from storage device 112 via input interface 122. Storage device 112 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, a Blu-ray disc, a DVD, a CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.
[0035] In some examples, source device 102 may output the encoded video data to file server 114 or another intermediate storage device, which may store the encoded video data generated by source device 102. Destination device 116 may access the stored video data from file server 114 via streaming or download.
[0036] File server 114 may be any type of server device capable of storing encoded video data and transmitting the encoded video data to destination device 116. File server 114 may represent a web server (e.g., for a website), a server configured to provide file transfer protocol services (e.g., File Transfer Protocol (FTP) or File Delivery over Unidirectional Transport (FLUTE) protocol), a content delivery network (CDN) device, a Hypertext Transfer Protocol (HTTP) server, a Multimedia Broadcast Multicast Service (MBMS) or enhanced MBMS (eMBMS) server, and / or a network-attached storage (NAS) device. File server 114 may additionally or alternatively implement one or more HTTP streaming protocols, such as Dynamic Adaptive Streaming over HTTP (DASH), HTTP Live Streaming (HLS), Real Time Streaming Protocol (RTSP), HTTP Dynamic Streaming, etc.
[0037] Destination device 116 may access the encoded video data from file server 114 through any standard data connection, including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., a digital subscriber line (DSL), a cable modem, etc.), or a combination of both suitable for accessing encoded video data stored on file server 114. Input interface 122 may be configured to operate according to any one or more of the various protocols described above for retrieving or receiving media data from file server 114, or other such protocols for retrieving media data.
[0038] Output interface 108 and input interface 122 may represent wireless transmitters / receivers, modems, wired networking components (e.g., Ethernet cards), wireless communication components operating according to any of the various IEEE 802.11 standards, or other physical components. In examples in which output interface 108 and input interface 122 comprise wireless components, output interface 108 and input interface 122 may be configured to transfer data such as encoded video data according to cellular communication standards such as 4G, 4G-LTE (Long Term Evolution), LTE-Advanced, 5G, etc. In some examples in which output interface 108 comprises a wireless transmitter, output interface 108 and input interface 122 may be configured to transfer data such as encoded video data according to other wireless standards such as the IEEE 802.11 specification, the IEEE 802.15 specification (e.g., ZigBee™), the Bluetooth™ standard, etc. In some examples, source device 102 and / or destination device 116 may include respective system-on-chip (SoC) devices. For example, the source device 102 may include an SoC device for performing functionality attributed to the video encoder 200 and / or the output interface 108, and the destination device 116 may include an SoC device for performing functionality attributed to the video decoder 300 and / or the input interface 122.
[0039] The techniques of this disclosure may be applied to video coding supporting any of a variety of multimedia applications, such as over-the-air television broadcast, cable television transmission, satellite television transmission, Internet streaming video transmission such as Dynamic Adaptive Streaming over HTTP (DASH), digital video being encoded on a data storage medium, decoding of digital video stored on a data storage medium, or other applications.
[0040] The input interface 122 of the destination device 116 receives the encoded video bitstream from the computer-readable medium 110 (e.g., a communication medium, a storage device 112, a file server 114, etc.). The encoded video bitstream may include signaling information specified by the video encoder 200 that is also used by the video decoder 300, such as syntax elements having values that describe the characteristics and / or processing of video blocks or other coded units (e.g., slices, pictures, groups of pictures, sequences, etc.). The display device 118 displays decoded pictures of the decoded video data to a user. The display device 118 may represent any of a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light-emitting diode (OLED) display, or another type of display device.
[0041] 1, in some examples, the video encoder 200 and the video decoder 300 may each be integrated with an audio encoder and / or an audio decoder and may include an appropriate MUX-DEMUX unit or other hardware and / or software to process multiplexed streams that include both audio and video in a common data stream. Where applicable, the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol or other protocols, such as the User Datagram Protocol (UDP).
[0042] The video encoder 200 and the video decoder 300 may each be implemented as any of a variety of suitable encoder and / or decoder circuit configurations, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When the techniques are implemented partially in software, the device may store instructions for the software on a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the techniques of this disclosure. That is, there may be a computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to perform the example techniques described in this disclosure. The video encoder 200 and the video decoder 300 may each be included in one or more encoders or decoders, any of which may be integrated as part of a combined encoder / decoder (codec) within the respective device. The device including the video encoder 200 and / or the video decoder 300 may comprise an integrated circuit, a microprocessor, and / or a wireless communication device such as a cellular phone.
[0043] The following describes video coding standards: ITU-T H.261, ISO / IEC MPEG-1 Visual, ITU-T H.262 or ISO / IEC MPEG-2 Visual, ITU-T H.263, ISO / IEC MPEG-4 Visual, and ITU-T H.264 (also known as ISO / IEC MPEG-4 AVC), including its scalable video coding (SVC) and multiview video coding (MVC) extensions. In addition, High Efficiency Video Coding (HEVC) or ITU-T H.265, including its range extension, multiview extension (MV-HEVC), and scalable extension (SHVC), is being developed by the Joint Study Group on Video Coding (JCT-VC) and the Joint Study Group on 3D Video Coding Extensions (JCT-3V) between the ITU-T Video Coding Expert Group (VCEG) and the ISO / IEC Motion Picture Expert Group (MPEG). The HEVC specification is available at ITU-T H.265, "Series H: Audiovisual and Multimedia Systems, Infrastructure of Audiovisual Services—Coding of Moving Video, High efficiency Video Coding," International Telecommunication Union, December 2016, p. 664.
[0044] ITU-T VCEG (Q6 / 16) and ISO / IEC MPEG (JTC 1 / SC29 / WG11) are considering standardizing future video coding technologies with compression capabilities significantly exceeding those of the current HEVC standard (including its current and upcoming extensions for screen content coding and high dynamic range coding). The groups are working together on this exploration in a collaborative research effort called the Joint Video Exploratory Team (JVET) to evaluate compression technology designs proposed by their experts in this area. The latest version of the reference software, i.e., VVC Test Model 10 (VTM10.0), can be downloaded from https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM.
[0045] Video encoder 200 and video decoder 300 may operate according to a video coding standard, such as ITU-T H.265, also known as High Efficiency Video Coding (HEVC), or extensions thereto, such as multiview and / or scalable video coding extensions. Alternatively, video encoder 200 and video decoder 300 may operate according to other proprietary or industry standards, such as ITU-T H.266, also known as Versatile Video Coding (VVC). A draft of the VVC standard is set forth in Bross et al., "Versatile Video Coding (Draft 10)," Joint Video Experts Team (JVET) of ITU-T SG16 WP 3 and ISO / IEC JTC 1 / SC29 / WG11, 18th Meeting by Teleconference, June 22-July 1, 2020, JVET-S2001-vA (hereinafter, "VVC Draft 10"). Editorial refinements of VVC Draft 10 are described in Bross et al., "Versatile Video Coding Editorial Refinements on Draft 10," Joint Video Experts Team (JVET) of ITU-T SG16 WP 3 and ISO / IEC JTC 1 / SC29 / WG11, 20th Meeting via Teleconference, October 7-16, 2020, JVET-T2001-v2. The algorithm description of Versatile Video Coding and Test Model 10 (VTM10.0) may be referenced as J. Chen, Y. Ye, and S. Kim, "Algorithm description for Versatile Video Coding and Test Model 11 (VTM 11)," JVET-T2002, December 2020 (hereinafter JVET-T2002). However, the techniques of this disclosure are not limited to any particular coding standard.
[0046] Generally, the video encoder 200 and the video decoder 300 may perform block-based coding of pictures. The term “block” generally refers to a structure containing data to be processed (e.g., encoded, decoded, or otherwise used in an encoding and / or decoding process). For example, a block may include a two-dimensional matrix of luminance and / or chrominance data samples. Generally, the video encoder 200 and the video decoder 300 may code video data represented in YUV (e.g., Y, Cb, Cr) format. That is, rather than coding red, green, and blue (RGB) data for the samples of a picture, the video encoder 200 and the video decoder 300 may code the luminance and chrominance components, where the chrominance components may include chrominance components of both red and blue hues. In some examples, the video encoder 200 converts received RGB-formatted data into a YUV representation before encoding, and the video decoder 300 converts the YUV representation into an RGB format. Alternatively, pre-processing and post-processing units (not shown) may perform these transformations.
[0047] This disclosure may generally refer to coding (e.g., encoding and decoding) a picture to include the process of encoding or decoding data for the picture. Similarly, this disclosure may refer to coding of a block of a picture, e.g., predictive and / or residual coding, to include the process of encoding or decoding data for the block. A coded video bitstream generally includes a series of values for syntax elements that represent coding decisions (e.g., coding modes) and the partitioning of a picture into blocks. Thus, references to coding a picture or a block should generally be understood as coding values for the syntax elements that form the picture or block.
[0048] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video coder (such as video encoder 200) partitions coding tree units (CTUs) into CUs according to a quadtree structure. That is, the video coder partitions CTUs and CUs into four equal, non-overlapping squares, and each node in the quadtree has either zero or four child nodes. A node with no child nodes may be called a "leaf node," and a CU of such a leaf node may include one or more PUs and / or one or more TUs. The video coder may further partition PUs and TUs. For example, in HEVC, a residual quadtree (RQT) represents a partition of TUs. In HEVC, a PU represents inter-predicted data, and a TU represents residual data. An intra-predicted CU includes intra-prediction information, such as an intra-mode indication.
[0049] As another example, video encoder 200 and video decoder 300 may be configured to operate according to VVC. According to VVC, a video coder (such as video encoder 200) partitions a picture into multiple coding tree units (CTUs). Video encoder 200 may partition the CTUs according to a tree structure, such as a quadtree-binary tree (QTBT) structure or a multi-type tree (MTT) structure. The QTBT structure eliminates the concept of multiple partition types, such as the separation between CUs, PUs, and TUs in HEVC. The QTBT structure includes two levels: a first level partitioned according to quadtree partitioning and a second level partitioned according to binary tree partitioning. The root node of the QTBT structure corresponds to a CTU. The leaf nodes of the binary tree correspond to coding units (CUs).
[0050] In the MTT partitioning structure, blocks may be partitioned using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of triple tree (TT) (also called ternary tree (TT)) partitioning. A triple tree partitioning or triple tree partitioning is a partitioning in which a block is divided into three sub-blocks. In some examples, a triple tree partitioning or triple tree partitioning divides a block into three sub-blocks without splitting the original block through the center. The partition types in MTT (e.g., QT, BT, and TT) can be symmetric or asymmetric.
[0051] In some examples, the video encoder 200 and the video decoder 300 may use a single QTBT or MTT structure to represent each of the luminance and chrominance components, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT or MTT structures, such as one QTBT / MTT structure for the luminance component and another QTBT / MTT structure for both chrominance components (or two QTBT / MTT structures for each chrominance component).
[0052] Video encoder 200 and video decoder 300 may be configured to use quadtree partitioning according to HEVC, QTBT partitioning, MTT partitioning, or other partition structures. For illustrative purposes, the description of the techniques of this disclosure is presented with respect to QTBT partitioning. However, it should be understood that the techniques of this disclosure may also be applied to video coders configured to use quadtree partitioning or other types of partitioning.
[0053] In some examples, a CTU includes a coding tree block (CTB) of luma samples and two corresponding CTBs of chroma samples for a picture having three sample arrays, or a CTB of samples for a monochrome picture or a picture coded using three separate color planes and syntax structures used to code the samples. The CTB may be an N×N block of samples for some value of N such that the division of the components into the CTB is partitioned. A component is an array or a single sample from one of the three arrays (luma and two chroma) that make up a picture in 4:2:0, 4:2:2, or 4:4:4 color format, or an array or a single sample from an array that creates a picture in monochrome format. In some examples, a coding block is an M×N block of samples for some value of M and N such that the division of the CTB into the coding block is partitioned.
[0054] Blocks (e.g., CTUs or CUs) may be grouped in various ways within a picture. As an example, a brick may refer to a rectangular region of a CTU row within a particular tile within a picture. A tile may be a rectangular region of a CTU within a particular tile column and a particular tile row within a picture. A tile column refers to a rectangular region of a CTU with a height equal to the height of the picture and a width specified by a syntax element (e.g., in a picture parameter set). A tile row refers to a rectangular region of a CTU with a height specified by a syntax element (e.g., in a picture parameter set) and a width equal to the width of the picture.
[0055] In some examples, a tile may be partitioned into multiple bricks, each of which may include one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick. However, a brick that is a true subset of a tile may not be referred to as a tile.
[0056] The bricks in a picture may also be arranged into slices. A slice may be an integer number of bricks of a picture that may be contained exclusively within a single Network Abstraction Layer (NAL) unit. In some examples, a slice includes either several complete tiles or only a contiguous sequence of complete bricks of one tile.
[0057] This disclosure may use "N x N" and "N by N," e.g., 16 x 16 samples or 16 by 16 samples, interchangeably to refer to the sample dimensions of a block (such as a CU or other video block) in terms of the vertical and horizontal dimensions. Generally, a 16 x 16 CU has 16 samples in the vertical direction (y = 16) and 16 samples in the horizontal direction (x = 16). Similarly, an N x N CU generally has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. Samples within a CU may be arranged in rows and columns. Moreover, a CU does not necessarily have to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may comprise N x M samples, where M is not necessarily equal to N.
[0058] Video encoder 200 encodes video data for a CU, which represents prediction and / or residual information, as well as other information. The prediction information indicates how the CU will be predicted to form a predictive block for the CU. The residual information generally represents sample-by-sample differences between the samples of the CU before encoding and the samples of the predictive block.
[0059] To predict a CU, video encoder 200 may generally form a predictive block for the CU through inter-prediction or intra-prediction. Inter-prediction generally refers to predicting a CU from data of a previously coded picture, and intra-prediction generally refers to predicting a CU from previously coded data of the same picture. To perform inter-prediction, video encoder 200 may generate a predictive block using one or more motion vectors. Video encoder 200 may generally perform motion search to identify a reference block that closely matches the CU with respect to the difference between the CU and the reference block, for example. Video encoder 200 may calculate a difference metric using sum of absolute differences (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared difference (MSD), or other such difference calculation to determine whether the reference block closely matches the current CU. In some examples, video encoder 200 may predict the current CU using unidirectional prediction or bidirectional prediction.
[0060] Some examples of VVC also provide an affine motion compensation mode, which may be considered an inter-prediction mode. In the affine motion compensation mode, the video encoder 200 may determine two or more motion vectors that represent non-translational motion, such as zooming in or out, rotation, viewpoint shifting, or other irregular motion types.
[0061] To perform intra prediction, video encoder 200 may select an intra prediction mode to generate a predictive block. Some examples of VVC provide 67 intra prediction modes, including various directional modes, as well as a planar mode and a DC mode. Generally, video encoder 200 selects an intra prediction mode that describes neighboring samples to a current block (e.g., a block of a CU) from which samples of the current block should be predicted. Such samples may generally be above, above and to the left, or to the left of the current block in the same picture as the current block, assuming that video encoder 200 codes CTUs and CUs in raster scan order (left to right, top to bottom).
[0062] The video encoder 200 encodes data representing a prediction mode for the current block. For example, in the case of an inter prediction mode, the video encoder 200 may encode data representing which of various available inter prediction modes is used as well as motion information for the corresponding mode. In the case of unidirectional or bidirectional inter prediction, for example, the video encoder 200 may encode a motion vector using an advanced motion vector prediction (AMVP) mode or a merge mode. The video encoder 200 may use a similar mode to encode a motion vector for an affine motion compensation mode.
[0063] Following prediction, such as intra- or inter-prediction, of a block, the video encoder 200 may calculate residual data for the block. The residual data, such as a residual block, represents sample-by-sample differences between the block and a predictive block for that block formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to generate transform data in the transform domain rather than the sample domain. For example, the video encoder 200 may apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. Additionally, the video encoder 200 may apply a secondary transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, or a Karhunen-Loeve transform (KLT), following the initial transform. The video encoder 200 generates transform coefficients following application of the one or more transforms.
[0064] As described above, following any transformation to generate transform coefficients, the video encoder 200 may perform quantization of the transform coefficients. Quantization generally refers to a process in which transform coefficients are quantized to possibly reduce the amount of data used to represent the transform coefficients, thereby providing further compression. By performing the quantization process, the video encoder 200 may reduce the bit depth associated with some or all of the transform coefficients. For example, the video encoder 200 may truncate an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, the video encoder 200 may perform a bitwise right shift of the value to be quantized.
[0065] Following quantization, the video encoder 200 may scan the transform coefficients, generating a one-dimensional vector from a two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place transform coefficients with higher energy (and therefore lower frequency) at the front of the vector and transform coefficients with lower energy (and therefore higher frequency) at the back of the vector. In some examples, the video encoder 200 may utilize a default scan order to scan the quantized transform coefficients to generate a serialized vector and then entropy encode the quantized transform coefficients of the vector. In other examples, the video encoder 200 may perform an adaptive scan. After scanning the quantized transform coefficients to form the one-dimensional vector, the video encoder 200 may entropy encode the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). The video encoder 200 may also entropy encode values for syntax elements describing metadata associated with the encoded video data for use by the video decoder 300 in decoding the video data.
[0066] To perform CABAC, video encoder 200 may assign a context in a context model to a symbol to be transmitted. The context may relate, for example, to whether neighboring values of the symbol are zeroed. A probability determination may be based on the context assigned to the symbol.
[0067] Video encoder 200 may further generate syntax data such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, among other syntax data such as a picture header, a block header, a slice header, or a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS), to video decoder 300. Video decoder 300 may similarly decode such syntax data to determine how to decode corresponding video data.
[0068] In this manner, video encoder 200 may generate a bitstream including coded video data, e.g., syntax elements that describe partitions of a picture into blocks (e.g., CUs) and prediction and / or residual information for the blocks. Finally, video decoder 300 may receive the bitstream and may decode the coded video data.
[0069] Generally, video decoder 300 performs a reciprocal process to that performed by video encoder 200 to decode encoded video data of a bitstream. For example, video decoder 300 may decode values for syntax elements of a bitstream using CABAC in a manner that is reciprocal but substantially similar to the CABAC encoding process of video encoder 200. The syntax elements may specify partition information for the partition of a picture into CTUs and the partition of each CTU according to a corresponding partition structure, such as a QTBT structure, to specify the CUs of the CTU. The syntax elements may further specify prediction information and residual information for blocks of video data (e.g., CUs).
[0070] The residual information may be represented by, for example, quantized transform coefficients. The video decoder 300 may inverse quantize and inverse transform the quantized transform coefficients of the block to reconstruct a residual block for the block. The video decoder 300 may form a predictive block for the block using the signaled prediction mode (intra-prediction or inter-prediction) and associated prediction information (e.g., motion information for inter-prediction). The video decoder 300 may then combine the predictive block and the residual block (sample by sample) to reconstruct the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process to reduce visual artifacts along block boundaries.
[0071] According to the techniques of this disclosure, video encoder 200 and video decoder 300 may be configured to perform bidirectional optical flow (BDOF). For example, video encoder 200 may be configured to perform BDOF as part of encoding a current block, and video decoder 300 may be configured to perform BDOF as part of decoding the current block.
[0072] As will be described in more detail, in some examples, a video coder (e.g., video encoder 200 and / or video decoder 300) may be configured to: divide an input block into a plurality of sub-blocks, wherein the size of the input block is smaller than or equal to the size of a coding unit; determine, based on a condition being met, that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks; divide the sub-block into a plurality of sub-sub-blocks; determine an improved motion vector for one or more of the sub-sub-blocks, wherein the improved motion vector for a sub-sub-block of the one or more sub-sub-blocks is the same for a plurality of samples in the sub-sub-block; and perform BDOF on the sub-block based on the improved motion vector for the one or more sub-sub-blocks.
[0073] As another example, a video coder may be configured to divide an input block into a plurality of sub-blocks, determine based on satisfied conditions that the size of the input block is smaller than or equal to the size of a coding unit and that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks, divide the sub-block into a plurality of sub-sub-blocks, determine an improved motion vector for each of one or more samples in the sub-block, and perform BDOF on the sub-block based on the improved motion vector for each of the one or more samples in the sub-block.
[0074] For example, as described above, video encoder 200 or video decoder 300 may determine an improved motion vector for each of one or more samples in a sub-block and may perform BDOF based on the improved motion vector for each of one or more samples in the sub-block. In this disclosure, performing BDOF based on the improved motion vector for each of one or more samples in a sub-block is referred to as "per-pixel BDOF." For example, in per-pixel BDOF, rather than having one improved motion vector that is the same for all samples in the sub-block, the improved motion vector for each sample in the sub-block is determined separately.
[0075] An improved motion vector may not necessarily mean that the motion vector for a subblock is changed. Rather, the improved motion vector for a sample may be used to determine the amount by which a sample in a predictive block is adjusted to generate a predicted sample. For example, for a first sample of a first subblock, a first improved motion vector may indicate how much the first sample in the predictive block should be adjusted to generate the first predicted sample, and for a second sample of the first subblock, a second improved motion vector may indicate how much the second sample in the predictive block should be adjusted to generate the second predicted sample, and so on.
[0076] According to one or more examples described in this disclosure, video encoder 200 and video decoder 300 may determine whether to perform per-pixel BDOF or bypass BDOF for each sub-block of one or more sub-blocks of a block (e.g., an input block) based on the respective distortion values. For example, as described above, video encoder 200 and video decoder 300 may perform per-pixel BDOF based on a condition being satisfied. The condition being satisfied may be whether the distortion value for the sub-block is greater than a threshold.
[0077] Thus, in some examples, an option for video encoder 200 and video decoder 300 may be set to either perform per-pixel BDOF or bypass BDOF for a sub-block based on whether the distortion value for the sub-block is greater than or equal to a threshold. For example, in some techniques, it may be possible for video encoder 200 and video decoder 300 to perform per-pixel BDOF but not determine on a sub-block basis whether BDOF is bypassed. In some techniques in which BDOF may be bypassed on a sub-block basis, per-pixel BDOF may not have been available. Using example techniques described in this disclosure, video encoder 200 and video decoder 300 may be configured to selectively perform per-pixel BDOF or bypass BDOF, which may result in better video compression that appropriately balances decoding overhead.
[0078] In one or more examples, to encode or decode video data, respectively, video encoder 200 and video decoder 300 may be configured to determine that BDOF is enabled for a block of video data and to divide the block into multiple sub-blocks based on the determination that BDOF is enabled for the block, or more generally, when BDOF is enabled for the block. Video encoder 200 and video decoder 300 may determine a respective distortion value for each sub-block of one or more sub-blocks of the multiple sub-blocks. Exemplary methods for determining the respective distortion values are described in more detail below. Video encoder 200 and video decoder 300 may determine one of whether pixel-wise BDOF is performed or BDOF is bypassed for each sub-block of one or more sub-blocks of the multiple sub-blocks based on the respective distortion value, and may determine a predicted sample for each sub-block of the one or more sub-blocks based on the determination that pixel-wise BDOF is performed or BDOF is bypassed.
[0079] The video encoder 200 may determine residual values indicative of differences between the prediction samples and the samples of the block and may signal the residual values. The video decoder 300 may receive the residual values indicative of differences between the prediction samples and the samples of the block and may add the residual values to the prediction samples to reconstruct the block. In some examples, to receive the residual values, the video decoder 300 may be configured to receive information indicative of the residual values, and the video decoder 300 determines the residual values from such information.
[0080] This disclosure may generally refer to “signaling” some information, such as syntax elements. The term “signaling” may generally refer to communicating values for syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 may signal values for syntax elements in a bitstream. Generally, signaling refers to generating values in a bitstream. As mentioned above, source device 102 may transport the bitstream to destination device 116 in substantially real time or non-real time, as may occur when storing syntax elements to storage device 112 for later retrieval by destination device 116.
[0081] 2A and 2B are conceptual diagrams illustrating an exemplary quadtree / binary tree (QTBT) structure 130 and corresponding coding tree unit (CTU) 132. Solid lines represent quadtree partitioning, and dotted lines represent binary tree partitioning. At each partitioned (i.e., non-leaf) node of the binary tree, one flag is signaled to indicate which partition type (i.e., horizontal or vertical) is used, where, in this example, 0 indicates horizontal partitioning and 1 indicates vertical partitioning. In the case of quadtree partitioning, the quadtree node divides a block horizontally and vertically into four equal-sized sub-blocks, so there is no need to indicate the partition type. Therefore, syntax elements (e.g., partition information) for the region tree level (i.e., solid lines) of the QTBT structure 130 and syntax elements (e.g., partition information) for the prediction tree level (i.e., dashed lines) of the QTBT structure 130 may be encoded by the video encoder 200 and decoded by the video decoder 300. Video encoder 200 may encode and video decoder 300 may decode video data, such as prediction data and transform data, for CUs represented by terminal leaf nodes of QTBT structure 130.
[0082] 2B may be associated with parameters that define the sizes of blocks corresponding to nodes of the QTBT structure 130 at the first and second levels. These parameters may include a CTU size (representing the size of the CTU 132 in samples), a minimum quadtree size (MinQTSize, representing the smallest allowed quadtree leaf node size), a maximum binary tree size (MaxBTSize, representing the largest allowed binary tree root node size), a maximum binary tree depth (MaxBTDepth, representing the largest allowed binary tree depth), and a minimum binary tree size (MinBTSize, representing the smallest allowed binary tree leaf node size).
[0083] The root node of the QTBT structure corresponding to the CTU may have four child nodes at the first level of the QTBT structure, and each child node may be partitioned according to a quadtree partition. That is, a node at the first level is either a leaf node (with no child nodes) or has four child nodes. The example QTBT structure 130 represents a node with a parent node and child nodes with solid lines for branching. If a node at the first level is not larger than the maximum allowed binary tree root node size (MaxBTSize), the node may be further partitioned by its respective binary tree. The binary tree split of a node may be repeated until the resulting node reaches the minimum allowed binary tree leaf node size (MinBTSize) or the maximum allowed binary tree depth (MaxBTDepth). The example QTBT structure 130 represents a node with dashed lines for branching. The binary tree leaf nodes are called coding units (CUs), which are used for prediction (e.g., intra-picture or inter-picture prediction) and transformation without further partitioning. As explained above, CUs are sometimes called "video blocks" or "blocks."
[0084] In one example of a QTBT partitioning structure, the CTU size is set as 128x128 (luma samples and two corresponding 64x64 chroma samples), MinQTSize is set as 16x16, MaxBTSize is set as 64x64, MinBTSize (for both width and height) is set as 4, and MaxBTDepth is set as 4. Quadtree partitioning is first applied to the CTU to generate a quadtree leaf node. The quadtree leaf node may have a size from 16x16 (i.e., MinQTSize) to 128x128 (i.e., CTU size). If the quadtree leaf node is 128x128, the quadtree leaf node is not further partitioned by the binary tree because the size exceeds MaxBTSize (i.e., 64x64 in this example). Otherwise, the quadtree leaf node is further partitioned by the binary tree. Therefore, the quadtree leaf node is also the root node for the binary tree and has the binary tree depth as 0. When the binary tree depth reaches MaxBTDepth (4 in this example), no further splits are allowed. A binary tree node with a width equal to MinBTSize (4 in this example) implies that no further vertical splits (i.e., width splits) are allowed for that binary tree node. Similarly, a binary tree node with a height equal to MinBTSize implies that no further horizontal splits (i.e., height splits) are allowed for that binary tree node. As mentioned above, the leaf nodes of the binary tree are called CUs and are further processed according to the prediction and transformation without further partitioning.
[0085] 3 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. FIG. 3 is provided for purposes of explanation and should not be considered a limitation of the techniques as broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes video encoder 200 in accordance with VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be performed by video encoding devices configured for other video coding standards.
[0086] 3, video encoder 200 includes video data memory 230, mode select unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, decoded picture buffer (DPB) 218, and entropy coding unit 220. Any or all of video data memory 230, mode select unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, DPB 218, and entropy coding unit 220 may be implemented in one or more processors or processing circuitry. For example, the units of video encoder 200 may be implemented as one or more circuits or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Moreover, video encoder 200 may include additional or alternative processors or processing circuitry for performing these and other functions.
[0087] Video data memory 230 may store video data to be encoded by components of video encoder 200. Video encoder 200 may receive video data stored in video data memory 230, for example, from video source 104 (FIG. 1). DPB 218 may act as a reference picture memory, storing reference video data for use in predicting subsequent video data by video encoder 200. Video data memory 230 and DPB 218 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. Video data memory 230 and DPB 218 may be provided by the same memory device or separate memory devices. In various examples, video data memory 230 may be on-chip with other components of video encoder 200, as shown, or may be off-chip relative to those components.
[0088] In this disclosure, references to video data memory 230 should not be construed as limited to memory internal to video encoder 200 unless specifically stated as such, or to memory external to video encoder 200 unless specifically stated as such. Rather, references to video data memory 230 should be understood as a reference memory that stores video data that video encoder 200 receives for encoding (e.g., video data for a current block to be encoded). Memory 106 of FIG. 1 may also provide temporary storage of outputs from various units of video encoder 200.
[0089] The various units in FIG. 3 are shown to aid in understanding the operations performed by video encoder 200. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. A fixed-function circuit refers to a circuit that provides specific functionality and is preconfigured for the operations that may be performed. A programmable circuit refers to a circuit that can be programmed to perform various tasks and provides flexible functionality in the operations that may be performed. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. A fixed-function circuit may execute software instructions (e.g., to receive or output parameters), but the types of operations that the fixed-function circuit performs are generally invariant. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.
[0090] Video encoder 200 may include an arithmetic logic unit (ALU), an elementary function unit (EFU), digital circuitry, analog circuitry, and / or a programmable core formed from programmable circuitry. In examples in which the operations of video encoder 200 are performed using software executed by programmable circuitry, memory 106 (FIG. 1) may store instructions (e.g., object code) of the software that video encoder 200 receives and executes, or another memory (not shown) within video encoder 200 may store such instructions.
[0091] The video data memory 230 is configured to store received video data. The video encoder 200 may retrieve pictures of the video data from the video data memory 230 and provide the video data to the residual generation unit 204 and the mode selection unit 202. The video data in the video data memory 230 may be raw video data to be encoded.
[0092] The mode select unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode select unit 202 may include additional functional units for performing video prediction according to other prediction modes. By way of example, the mode select unit 202 may include a palette unit, an intra block copy unit (which may be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, etc.
[0093] The mode selection unit 202 typically coordinates multiple encoding passes to test combinations of encoding parameters and the resulting rate-distortion values for such combinations. The encoding parameters may include partitioning of the CTUs into CUs, prediction modes for the CUs, transform types for residual data of the CUs, quantization parameters for residual data of the CUs, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that results in a better rate-distortion value than the other combinations tested.
[0094] Video encoder 200 may partition a picture retrieved from video data memory 230 into a series of CTUs and may encapsulate one or more CTUs within a slice. Mode select unit 202 may partition the CTUs of a picture according to a tree structure, such as the HEVC QTBT structure or quadtree structure described above. As described above, video encoder 200 may form one or more CUs from partitioning the CTUs according to the tree structure. Such CUs may also be generally referred to as "video blocks" or "blocks."
[0095] Generally, the mode select unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra prediction unit 226) to generate a predictive block for a current block (e.g., the current CU, or in HEVC, the overlapping portion of the PU and TU). In the case of inter prediction of the current block, the motion estimation unit 222 may perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously coded pictures stored in the DPB 218). In particular, the motion estimation unit 222 may calculate a value representing how similar a potential reference block is to the current block according to, for example, the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), etc. The motion estimation unit 222 may generally perform these calculations using the sample-by-sample difference between the current block and the reference block under consideration. Motion estimation unit 222 may identify the reference block having the smallest value resulting from these calculations, indicating the reference block that most closely matches the current block.
[0096] The motion estimation unit 222 may form one or more motion vectors (MVs) that specify the position of a reference block in a reference picture relative to the position of a current block in the current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, in the case of unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, while in the case of bidirectional inter prediction, the motion estimation unit 222 may provide two motion vectors. The motion compensation unit 224 may then generate a predictive block using the motion vectors. For example, the motion compensation unit 224 may use the motion vectors to retrieve data of the reference block. As another example, if the motion vectors have fractional sample precision, the motion compensation unit 224 may interpolate values for the predictive block according to one or more interpolation filters. Moreover, in the case of bidirectional inter prediction, the motion compensation unit 224 may retrieve data for the two reference blocks identified by the respective motion vectors and combine the retrieved data, for example, through sample-wise averaging or weighted averaging.
[0097] As another example, in the case of intra prediction or intra predictive coding, the intra prediction unit 226 may generate a predictive block from samples neighboring the current block. For example, in the case of a directional mode, the intra prediction unit 226 may generally mathematically combine the values of the neighboring samples and distribute these calculated values in a defined direction across the current block to generate a predictive block. As another example, in the case of a DC mode, the intra prediction unit 226 may calculate the average of the neighboring samples for the current block and generate a predictive block to include this resulting average for each sample of the predictive block.
[0098] The mode select unit 202 provides the prediction block to the residual generation unit 204. The residual generation unit 204 receives a raw, uncoded version of the current block from the video data memory 230 and the prediction block from the mode select unit 202. The residual generation unit 204 calculates sample-by-sample differences between the current block and the prediction block. The resulting sample-by-sample differences define a residual block for the current block. In some examples, the residual generation unit 204 may also determine differences between sample values in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, the residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.
[0099] In examples in which mode select unit 202 partitions CUs into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. Video encoder 200 and video decoder 300 may support PUs with various sizes. As indicated above, the size of a CU may refer to the size of the luma coding block of the CU, and the size of a PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2N×2N, video encoder 200 may support a PU size of 2N×2N or N×N for intra prediction, and a symmetric PU size of 2N×2N, 2N×N, N×2N, N×N, or similar for inter prediction. Video encoder 200 and video decoder 300 may also support asymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.
[0100] In examples where the mode select unit 202 does not further partition CUs into PUs, each CU may be associated with a luma coding block and a corresponding chroma coding block. As described above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder 200 and the video decoder 300 may support CU sizes of 2N×2N, 2N×N, or N×2N.
[0101] For other video coding techniques, such as intra-block copy mode coding, affine mode coding, and linear model (LM) mode coding, as some examples, mode select unit 202 generates a predictive block for the current block being coded via a respective unit associated with the coding technique. In some examples, such as palette mode coding, mode select unit 202 may not generate a predictive block, but instead may generate syntax elements that indicate a scheme for reconstructing the block based on a selected palette. In such modes, mode select unit 202 may provide these syntax elements to entropy coding unit 220 to be coded.
[0102] As described above, the residual generation unit 204 receives video data for a current block and a corresponding predictive block. The residual generation unit 204 then generates a residual block for the current block. To generate the residual block, the residual generation unit 204 calculates sample-by-sample differences between the predictive block and the current block.
[0103] Transform processing unit 206 applies one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). Transform processing unit 206 may apply various transforms to the residual block to form the transform coefficient block. For example, transform processing unit 206 may apply a discrete cosine transform (DCT), a directional transform, a Karhunen-Loeve transform (KLT), or a conceptually similar transform to the residual block. In some examples, transform processing unit 206 may perform multiple transforms, e.g., a linear transform and a quadratic transform such as a rotation transform, on the residual block. In some examples, transform processing unit 206 does not apply a transform to the residual block.
[0104] The quantization unit 208 may quantize the transform coefficients within the transform coefficient block to generate a quantized transform coefficient block. The quantization unit 208 may quantize the transform coefficients of the transform coefficient block according to a quantization parameter (QP) value associated with the current block. The video encoder 200 (e.g., via the mode select unit 202) may adjust the degree of quantization applied to the transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may result in loss of information, and therefore, the quantized transform coefficients may have lower precision than the original transform coefficients generated by the transform processing unit 206.
[0105] Inverse quantization unit 210 and inverse transform processing unit 212 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficient block to reconstruct a residual block from the transform coefficient block. Reconstruction unit 214 may generate a reconstructed block corresponding to the current block (potentially with some degree of distortion) based on the reconstructed residual block and the predictive block generated by mode select unit 202. For example, reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples from the predictive block generated by mode select unit 202 to generate the reconstructed block.
[0106] The filter unit 216 may perform one or more filter operations on the reconstructed block. For example, the filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of the CU. In some examples, the operations of the filter unit 216 may be skipped.
[0107] Video encoder 200 stores reconstructed blocks in DPB 218. For example, in examples where the operations of filter unit 216 are not performed, reconstruction unit 214 may store reconstructed blocks in DPB 218. In examples where the operations of filter unit 216 are performed, filter unit 216 may store filtered reconstructed blocks in DPB 218. Motion estimation unit 222 and motion compensation unit 224 may retrieve reference pictures formed from reconstructed (and potentially filtered) blocks from DPB 218 to inter-predict blocks of a later-encoded picture. Additionally, intra-prediction unit 226 may use reconstructed blocks in DPB 218 of a current picture to intra-predict other blocks in the current picture.
[0108] Generally, entropy encoding unit 220 may entropy encode syntax elements received from other functional components of video encoder 200. For example, entropy encoding unit 220 may entropy encode quantized transform coefficient blocks from quantization unit 208. As another example, entropy encoding unit 220 may entropy encode predictive syntax elements (e.g., motion information for inter-prediction or intra-mode information for intra-prediction) from mode select unit 202. Entropy encoding unit 220 may perform one or more entropy encoding operations on syntax elements, which are another example of video data, to generate entropy-encoded data. For example, entropy encoding unit 220 may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable-to-variable (V2V) length coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a probability interval partitioned entropy (PIPE) coding operation, an exponential-Golomb coding operation, or another type of entropy coding operation on the data. In some examples, entropy encoding unit 220 may operate in a bypass mode in which syntax elements are not entropy coded.
[0109] Video encoder 200 may output a bitstream that includes entropy coding syntax elements needed to reconstruct blocks of a slice or picture. In particular, entropy coding unit 220 may output the bitstream.
[0110] The operations described above are described with respect to blocks. Such descriptions should be understood as operations for luma coding blocks and / or chroma coding blocks. As described above, in some examples, the luma coding blocks and chroma coding blocks are luma and chroma components of a CU. In some examples, the luma coding blocks and chroma coding blocks are luma and chroma components of a PU.
[0111] In some examples, operations performed with respect to luma coding blocks need not be repeated for chroma coding blocks. As one example, operations for identifying motion vectors (MVs) and reference pictures for luma coding blocks need not be repeated to identify MVs and reference pictures for chroma blocks. Rather, MVs for luma coding blocks may be scaled to determine MVs for chroma blocks, and the reference pictures may be the same. As another example, the intra prediction process may be the same for luma coding blocks and chroma coding blocks.
[0112] The video encoder 200 represents an example of a device configured to encode video data, including a memory configured to store video data and one or more processing units implemented in a circuit configuration, the one or more processing units being configured to: divide an input block into a plurality of sub-blocks, where the size of the input block is smaller than or equal to the size of a coding unit; determine that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks based on a condition being met; divide the sub-block into a plurality of sub-sub-blocks; determine an improved motion vector for one or more of the sub-sub-blocks, where the improved motion vector for a sub-sub-block of the one or more sub-sub-blocks is the same for a plurality of samples in the sub-sub-block; and perform BDOF on the sub-block based on the improved motion vector for the one or more sub-sub-blocks.
[0113] As another example, one or more processing units implemented in the circuit configuration may be configured to: divide an input block into a plurality of sub-blocks; determine, based on a condition being met, that the size of the input block is smaller than or equal to the size of a coding unit and that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks; divide the sub-block into a plurality of sub-sub-blocks; determine an improved motion vector for each of one or more samples in the sub-block; and perform BDOF on the sub-block based on the improved motion vector for each of the one or more samples in the sub-block.
[0114] As yet another example, the processing circuitry of the video encoder 200 may be configured to determine that bidirectional optical flow (BDOF) is enabled for a block of video data, divide the block into a plurality of sub-blocks based on the determination that BDOF is enabled for the block, determine a respective distortion value for each sub-block of one or more of the plurality of sub-blocks, determine one of whether pixel-wise BDOF is performed or BDOF is bypassed for each sub-block of the one or more sub-blocks based on the respective distortion value, determine a predictive sample for each sub-block of the one or more sub-blocks based on the determination that pixel-wise BDOF is performed or BDOF is bypassed, determine a residual value indicating a difference between the predictive sample and the block, and signal information indicating the residual value.
[0115] 4 is a block diagram illustrating an example video decoder 300 that may perform the techniques of this disclosure. FIG. 4 is provided for purposes of explanation and not as a limitation of the techniques as broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes a video decoder 300 in accordance with VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be performed by video coding devices configured for other video coding standards.
[0116] In the example of Figure 4, the video decoder 300 includes a coded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a decoded picture buffer (DPB) 314. Any or all of the CPB memory 320, the entropy decoding unit 302, the prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, the filter unit 312, and the DPB 314 may be implemented in one or more processors or processing circuitry. For example, the units of the video decoder 300 may be implemented as one or more circuits or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Moreover, the video decoder 300 may include additional or alternative processors or processing circuitry for performing these and other functions.
[0117] Prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. Prediction processing unit 304 may include additional units for performing prediction according to other prediction modes. By way of example, prediction processing unit 304 may include a palette unit, an intra block copy unit (which may form part of motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, video decoder 300 may include more, fewer, or different functional components.
[0118] CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by components of video decoder 300. The video data stored in CPB memory 320 may be retrieved, for example, from computer-readable medium 110 (FIG. 1). CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from the encoded video bitstream. CPB memory 320 may also store video data other than syntax elements of coded pictures, such as temporary data representing output from various units of video decoder 300. DPB 314 generally stores decoded pictures that video decoder 300 may output and / or use as reference video data when decoding subsequent data or pictures of the encoded video bitstream. CPB memory 320 and DPB 314 may be formed by any of a variety of memory devices, such as DRAM, including SDRAM, MRAM, RRAM, or other types of memory devices. CPB memory 320 and DPB 314 may be provided by the same memory device or separate memory devices. In various examples, the CPB memory 320 may be on-chip with other components of the video decoder 300, or may be off-chip relative to those components.
[0119] Additionally or alternatively, in some examples, video decoder 300 may retrieve coded video data from memory 120 (FIG. 1). That is, memory 120 may store data as described above using CPB memory 320. Similarly, memory 120 may store instructions to be executed by video decoder 300 when some or all of the functionality of video decoder 300 is implemented in software to be executed by processing circuitry of video decoder 300.
[0120] The various units shown in FIG. 4 are presented to aid in understanding the operations performed by video decoder 300. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. As with FIG. 3, fixed-function circuits refer to circuits that provide specific functionality and are preconfigured for the operations that may be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations that may be performed. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. While a fixed-function circuit may execute software instructions (e.g., to receive parameters or output parameters), the types of operations that the fixed-function circuit performs are generally invariant. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.
[0121] The video decoder 300 may include a programmable core formed from an ALU, an EFU, digital circuits, analog circuits, and / or programmable circuits. In examples in which the operations of the video decoder 300 are performed by software executing on programmable circuits, on-chip or off-chip memory may store instructions (e.g., object code) of the software that the video decoder 300 receives and executes.
[0122] The entropy decoding unit 302 may receive the encoded video data from the CPB and entropy decode the video data to recover the syntax elements. The prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, and the filter unit 312 may generate decoded video data based on the syntax elements extracted from the bitstream.
[0123] In general, video decoder 300 reconstructs a picture on a block-by-block basis. Video decoder 300 may perform a reconstruction operation on each block individually (wherein the block currently being reconstructed, i.e., decoded, may be referred to as the “current block”).
[0124] The entropy decoding unit 302 may entropy decode syntax elements that specify the quantized transform coefficients of a quantized transform coefficient block, as well as transform information such as a quantization parameter (QP) and / or a transform mode indication. The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine the degree of quantization, and similarly the degree of inverse quantization to apply. The inverse quantization unit 306 may, for example, perform a bitwise left-shift operation to inverse quantize the quantized transform coefficients. The inverse quantization unit 306 may thereby form a transform coefficient block including the transform coefficients.
[0125] After the inverse quantization unit 306 forms the transform coefficient blocks, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient blocks to generate residual blocks associated with the current block. For example, the inverse transform processing unit 308 may apply an inverse DCT, an inverse integer transform, an inverse Karhunen-Loeve transform (KLT), an inverse rotational transform, an inverse transform, or another inverse transform to the transform coefficient blocks.
[0126] Further, prediction processing unit 304 generates a predictive block according to the prediction information syntax element entropy decoded by entropy decoding unit 302. For example, if the prediction information syntax element indicates that the current block is inter-predicted, motion compensation unit 316 may generate the predictive block. In this case, the prediction information syntax element may indicate a reference picture in DPB 314 from which to retrieve a reference block, as well as a motion vector that identifies the location of the reference block in the reference picture relative to the location of the current block in the current picture. Motion compensation unit 316 may generally perform the inter-prediction process in a manner substantially similar to that described with respect to motion compensation unit 224 (FIG. 3).
[0127] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra prediction unit 318 may generate the predictive block according to the intra-prediction mode indicated by the prediction information syntax element. Again, the intra prediction unit 318 may generally perform the intra-prediction process in a manner substantially similar to that described with respect to the intra prediction unit 226 (FIG. 3). The intra prediction unit 318 may retrieve data of neighboring samples to the current block from the DPB 314.
[0128] The reconstruction unit 310 may reconstruct the current block using the predictive block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the predictive block to reconstruct the current block.
[0129] The filter unit 312 may perform one or more filter operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce blockiness artifacts along the edges of the reconstructed block. The operations of the filter unit 312 may not be performed in all instances.
[0130] The video decoder 300 may store the reconstructed blocks in the DPB 314. For example, in examples where the operations of the filter unit 312 are not performed, the reconstruction unit 310 may store the reconstructed blocks in the DPB 314. In examples where the operations of the filter unit 312 are performed, the filter unit 312 may store the filtered reconstructed blocks in the DPB 314. As described above, the DPB 314 may provide reference information to the prediction processing unit 304, such as samples of the current picture for intra prediction and previously decoded pictures for subsequent motion compensation. Moreover, the video decoder 300 may output decoded pictures (e.g., decoded video) from the DPB 314 for later presentation on a display device, such as the display device 118 of FIG. 1.
[0131] In this manner, the video decoder 300 represents an example of a video decoding device that includes a memory configured to store video data and one or more processing units implemented in a circuit configuration, the one or more processing units being configured to: divide an input block into a plurality of sub-blocks, where the size of the input block is smaller than or equal to the size of a coding unit; determine that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks based on a condition being met; divide the sub-block into a plurality of sub-sub-blocks; determine an improved motion vector for one or more of the sub-sub-blocks, where the improved motion vector for a sub-sub-block of the one or more sub-sub-blocks is the same for a plurality of samples within the sub-sub-block; and perform BDOF on the sub-block based on the improved motion vector for the one or more sub-sub-blocks.
[0132] As another example, one or more processing units implemented in the circuit configuration may be configured to: divide an input block into a plurality of sub-blocks; determine, based on a condition being met, that the size of the input block is smaller than or equal to the size of a coding unit and that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks; divide the sub-block into a plurality of sub-sub-blocks; determine an improved motion vector for each of one or more samples in the sub-block; and perform BDOF on the sub-block based on the improved motion vector for each of the one or more samples in the sub-block.
[0133] As another example, processing circuitry (e.g., motion compensation unit 316) of video decoder 300 may be configured to: determine that bidirectional optical flow (BDOF) is enabled for a block of video data; divide the block into a plurality of sub-blocks based on the determination that BDOF is enabled for the block; determine a respective distortion value for each sub-block of one or more of the plurality of sub-blocks; determine one of whether per-pixel BDOF is performed or BDOF is bypassed for each sub-block of the one or more sub-blocks based on the respective distortion value; determine a predictive sample for each sub-block of the one or more sub-blocks based on the determination that per-pixel BDOF is performed or BDOF is bypassed; and reconstruct the block based on the predictive sample. For example, the processing circuitry may receive residual values indicating differences between the predictive samples and samples of the block and may add the residual values to the predictive samples to reconstruct the block.
[0134] The following describes CU structure and motion vector prediction in HEVC: The following may provide additional context to the above description of CUs and motion vector prediction, and may include repetition of some of the above description to aid in understanding.
[0135] In HEVC, the largest coding unit in a slice is called a coding tree block (CTB) or coding tree unit (CTU). The CTB contains a quadtree, and the nodes of the quadtree are coding units. The size of the CTB can range from 16x16 to 64x64 in the HEVC Main Profile (although an 8x8 CTB size may technically be supported). Coding units (CUs) can range from the same size of the CTB to as small as 8x8. Each coding unit is coded using one mode: inter mode or intra mode. When inter-coded, a CU may be further partitioned into two or four prediction units (PUs), or may be just one PU when no further partitioning applies. When there are two PUs in a CU, they may be half the size of a rectangle, or two rectangles with 1 / 4 or 3 / 4 the size of the CU. When a CU is inter-coded, each PU has one set of motion information derived using a specific inter prediction mode.
[0136] The following describes motion vector prediction: In the HEVC standard, there are two inter-prediction modes, named merge mode (skip mode is considered as a special case of merge mode) and advanced motion vector prediction (AMVP) mode, for each prediction unit (PU).
[0137] In either AMVP mode or merge mode, a motion vector (MV) candidate list is maintained for multiple motion vector predictors. The motion vector of the current PU, as well as the reference index in merge mode, is generated by taking one candidate from the MV candidate list.
[0138] The MV candidate list includes up to five candidates for merge mode and only two candidates for AMVP mode. A merge candidate may include a set of motion information, e.g., a motion vector corresponding to both the reference picture list (List 0 and List 1) and a reference index. When a merge candidate is identified by a merge index, the reference picture and associated motion vector used for prediction of the current block are determined. On the other hand, under AMVP mode, since the AMVP candidate includes only a motion vector for each possible prediction direction from either List 0 or List 1, the reference index is explicitly signaled along with the MV predictor (MVP) index to the MV candidate list. In AMVP mode, the predicted motion vector can be further refined. Candidates for both modes are derived similarly from the same spatial and temporal neighboring blocks.
[0139] The following describes spatially adjacent candidates: For example, Figures 5A and 5B are conceptual diagrams illustrating examples of spatially adjacent motion vector candidates for merge mode and advanced motion vector predictor (AMVP) mode, respectively.
[0140] 5A and 5B for a particular PU (PU0) 500, spatial MV candidates are derived from the neighboring blocks shown in Figures 5A and 5B, but the method for generating candidates from the blocks differs for merge mode and AMVP mode. In merge mode, up to four spatial MV candidates can be derived with the order shown in Figure 5A using numbers as follows: left (0,A1), top (1,B1), top right (2,B0), bottom left (3,A0), and top left (4,B2), as shown in Figure 5A.
[0141] In AVMP mode, neighboring blocks are divided into two groups, as shown in PU0 502 in Figure 5B: a left group consisting of blocks 0 and 1, and an upper group consisting of blocks 2, 3, and 4. For each group, the possible candidate among the neighboring blocks that references the same reference picture as indicated by the signaled reference index has the highest priority to be selected to form the final candidate of the group. It may be that all neighboring blocks do not contain motion vectors pointing to the same reference picture. Therefore, if such a candidate cannot be found, the first available candidate may be scaled to form the final candidate, and thus the temporal distance difference may be compensated.
[0142] The following describes temporal motion vector prediction in HEVC. Temporal motion vector predictor (TMVP) candidates, if enabled and available, are added to the MV candidate list after spatial motion vector candidates. The process of motion vector derivation for TMVP candidates is the same for both merge mode and AMVP mode, except that the target reference index for TMVP candidates in merge mode is always set to 0.
[0143] The primary block location for TMVP candidate derivation is the outer, bottom-right block of the co-located PU, as shown in Figure 6A, as block "T," shown as block 602, to compensate for the bias toward the blocks above and to the left used to generate spatial neighboring candidates. However, if the block is located outside the current CTB row or motion information is not available, the block is replaced with the center block of the PU, shown as block 604.
[0144] The motion vectors for TMVP candidates are derived from the co-located PUs of the co-located pictures, which are shown in the slice level. The motion vectors for the co-located PUs are called co-located MVs. Similar to the temporal direct mode in AVC, to derive the TMVP candidate motion vectors, the co-located MVs will be scaled to compensate for the temporal distance difference, as shown in Figure 6B.
[0145] The following describes additional aspects of motion prediction in HEVC. Some aspects of merge mode and AMVP mode are worth mentioning: Motion vector scaling: It is assumed that the value of a motion vector is proportional to the distance of the pictures in presentation time. A motion vector relates two pictures: a reference picture and the picture containing the motion vector (i.e., the stored picture). When that motion vector is used to predict another motion vector, the distance between the stored picture and the reference picture is calculated based on the Picture Order Count (POC) value.
[0146] For a motion vector to be predicted, both its associated stored picture and reference picture may be different. Therefore, a new distance (based on POC) is calculated. The motion vector is then scaled based on these two POC distances. For spatially adjacent candidates, the stored pictures for the two motion vectors are the same, but the reference pictures are different. In HEVC, motion vector scaling is applied to both TMVP and AMVP for spatially and temporally adjacent candidates.
[0147] Artificial motion vector candidate generation: If the motion vector candidate list is not complete, artificial motion vector candidates are generated and inserted at the end of the list until the list has all the candidates.
[0148] In merge mode, there are two types of artificial MV candidates: composite candidates, which are derived only for B slices, and zero candidates, which are used only for AMVP if the first type does not provide enough artificial candidates. For each pair of candidates already in the candidate list and with the necessary motion information, a bidirectional composite motion vector candidate is derived by combining the motion vector of the first candidate, which references a picture in list 0, with the motion vector of the second candidate, which references a picture in list 1.
[0149] Pruning process for candidate insertion: Candidates from different blocks may happen to be the same, which reduces the efficiency of the merge / AMVP candidate list. To solve this problem, a pruning process is applied. The pruning process compares one candidate against others in the current candidate list to some extent to avoid inserting identical candidates. To reduce complexity, rather than comparing each possible candidate with all other existing candidates, the pruning process is applied only a limited number of times.
[0150] The following describes template matching prediction. Template matching (TM) prediction is a special merge mode based on the frame rate up-conversion (FRUC) technique. With this mode, block motion information is not signaled but is derived at the decoder side (e.g., by video decoder 300). TM prediction is applied to both AMVP mode and normal merge mode. In AMVP mode, MVP candidate selection is determined based on template matching to pick the candidate that achieves the minimum difference between the current block template and the reference block template. In normal merge mode, a TM mode flag is signaled to indicate the use of TM, and then TM is applied to the merge candidate indicated by the merge index for MV improvement.
[0151] As shown in Figure 7, template matching is used to derive the motion information of the current CU by finding the closest match between a template in the current frame 700 (the neighboring block above and / or to the left of the current CU) and a block (of the same size as the template) in the reference frame 702. Using an AMVP candidate selected based on the initial match error, the MVP of the AMVP candidate is improved by template matching. Using the merge candidate indicated by the signaled merge index, the merged MVs of the merge candidates corresponding to L0 and L1 are independently improved by template matching, and then the less accurate MVs are improved again using the better MVs as priority.
[0152] For the cost function, when the motion vector points to a fractional sample position, motion-compensated interpolation may be utilized. To reduce complexity, bilinear interpolation is used instead of the usual 8-tap DCT-IF interpolation for both template matching to generate templates on the reference picture. The matching cost C of template matching is calculated as follows:
[0153]
number
[0154] In the above equation, w is a weighting factor empirically set to 4, and MV and MV s and denote the currently tested MV and the initial MV (i.e., the MVP candidate in AMVP mode, or the merged motion in merge mode), respectively. SAD (sum of absolute differences) is used as the matching cost for template matching.
[0155] When TM is used, motion is improved by using only luma samples. The derived motion can be used for both luma and chroma for MC (motion compensated) inter prediction. After the MV is determined, the final MC is performed using an 8-tap interpolation filter for luma and a 4-tap interpolation filter for chroma.
[0156] For the search method, MV refinement is a pattern-based MV search using the template matching cost criterion. Two search patterns are supported for MV refinement: diamond search and cross search. MV is directly searched with 1 / 4 luma sample MVD accuracy using the diamond pattern, followed by 1 / 4 luma sample MVD accuracy using the cross pattern, and then followed by 1 / 8 luma sample MVD refinement using the cross pattern. The search range of MV refinement is set equal to (-8, +8) luma samples around the initial MV.
[0157] The following describes bidirectional matching prediction. Bidirectional matching (also called bidirectional merge) (BM) prediction is another merge mode based on the frame rate up-conversion (FRUC) technique. Once it is determined that a block should apply the BM mode, two initial motion vectors MV0 and MV1 are derived by using the signaled merge candidate index to select a merge candidate in the constructed merge list. The bidirectional matching search may be around MV0 and MV1. Based on the minimum bidirectional matching cost, the final MV0′ and MV1′ are derived.
[0158] The motion vector differentials MVD0 800 (denoted by MV0' - MV0) and MVD1 802 (denoted by MV1' - MV1) pointing to two reference blocks may be proportional to the temporal distance (TD) between the current picture and the two reference pictures, e.g., TD0 and TD1. Figure 8 shows an example of MVD0 and MVD1, where TD1 is four times larger than TD0.
[0159] However, there is an optional design where MVD0 and MVD1 are specularly reflective regardless of the time distances TD0 and TD1. Figure 9 shows an example of specularly reflective MVD0 900 and MVD1 902, where TD1 is four times larger than TD0.
[0160] The bidirectional matching performs a local search around the initial MV0 and MV1 to derive the final MV0' and MV1'. The local search applies a 3x3 square search pattern to loop through the search range [-8, 8]. In each search iteration, the bidirectional matching costs of the eight surrounding MVs in the search pattern are calculated and compared with the bidirectional matching cost of the central MV. The MV with the smallest bidirectional matching cost becomes the new central MV in the next search iteration. The local search ends when the current central MV has the smallest cost within the 3x3 square search pattern or when the local search reaches a predetermined maximum search iteration. FIG. 10 shows an example of a 3x3 square search pattern 1000 in the search range [-8, 8].
[0161] The following describes decoder-side motion vector refinement. To improve the accuracy of merge mode MVs, decoder-side motion vector refinement (DMVR) is applied in VVC. In bi-predictive operation, the refined MV is searched around the initial MV in reference picture list L0 and reference picture list L1. The DMVR method calculates the distortion between two candidate blocks in reference picture list L0 and list L1. As shown in Figure 11, the SAD between blocks 1102 and 1100 is calculated based on each MV candidate around the initial MV. The MV candidate with the smallest SAD becomes the refined MV and is used to generate a bi-predicted signal.
[0162] The improved MVs derived by the DMVR process are used to generate inter-predicted samples, which are also used in temporal motion vector prediction for future picture coding. The original MVs are used in the deblocking process, but are also used in spatial motion vector prediction for future CU coding.
[0163] DMVR is a sub-block-based merge mode with a default maximum processing unit of 16x16 luma samples. When the width and / or height of a CU is greater than 16 luma samples, the CU may be further divided into sub-blocks with width and / or height equal to 16 luma samples.
[0164] The following describes the search method. In the DVMR, the search points surrounding the initial MV and the MV offset may comply with the MV difference mirroring rule. For example, any point checked by the DMVR, indicated by a candidate MV pair (MV0, MV1), may comply with the following two formulas: MV0' = MV0 + MV_offset MV1' = MV1 - MV_offset
[0165] In the above equation, MV_offset represents the refinement offset between the initial MV in one of the reference pictures and the refined MV. The refinement search range is two integer luma samples from the initial MV. The search includes an integer sample offset search stage and a fractional sample refinement stage.
[0166] A 25-point full search is applied for integer sample offset search. The SAD of the initial MV pair is calculated first. If the SAD of the initial MV pair is smaller than a threshold, the integer sample stage of DMVR is terminated. Otherwise, the SAD of the remaining 24 points is calculated and checked in raster scan order. The point with the smallest SAD is selected as the output of the integer sample offset search stage. To reduce the uncertainty penalty of DMVR improvement, the original MV may be preferred during the DMVR process. The SAD between the reference blocks referenced by the initial MV candidates is reduced by ¼ of the SAD value.
[0167] The integer sample search is followed by fractional sample refinement. To save computational complexity, the fractional sample refinement is derived by using a parametric error surface equation rather than an additional search with SAD comparison. The fractional sample refinement is conditionally invoked based on the output of the integer sample search stage. If the integer sample search stage terminates with the center having the smallest SAD in either the first or second iteration, the fractional sample refinement is further applied.
[0168] In parametric error surface based sub-pixel offset estimation, the central position cost and the costs at four adjacent positions from the center are used to fit a 2D parabolic error surface equation of the form: E(x,y) = A(x - x min ) 2 + B(y - y min ) 2 + C
[0169] In the above formula, (x min ,y min ) corresponds to the fractional position with the lowest cost, and C corresponds to the minimum cost value. By solving the above equation using the cost values of the five search points, we can obtain (x min ,y min )but, x min= (E(-1,0) - E(1,0)) / (2(E(-1,0) + E(1,0) - 2E(0,0))) y min = (E(0,-1) - E(0,1)) / (2((E(0,-1) + E(0,1) - 2E(0,0))) It is calculated as:
[0170] Since all cost values are positive and the minimum value is E(0,0), x min and y min The value of is automatically constrained to be between -8 and 8. This corresponds to a 1 / 2 pel offset with 1 / 16 pel MV accuracy in VVC. The calculated fraction (x min ,y min ) is added to the integer distance refinement MV to get the sub-pixel accuracy refinement delta MV.
[0171] The following describes bilinear interpolation and sample padding. In VVC, the resolution of the MV is 1 / 16 luma sample. Samples at fractional positions are interpolated using an 8-tap interpolation filter. In DMVR, the search points surround the initial fractional pel MV with integer sample offsets, and therefore, samples at those fractional positions may be interpolated for the DMVR search process. To reduce computational complexity, a bilinear interpolation filter is used to generate fractional samples for the search process in DMVR. In some examples, by using a bilinear filter with a search range of 2 samples, DVMR does not access more reference samples than a normal motion compensation process. After the improved MV is achieved using the DMVR search process, a normal 8-tap interpolation filter is applied to generate the final prediction. To avoid accessing more reference samples than a normal MC process, samples that are not needed for the interpolation process based on the original MV but are needed for the interpolation process based on the improved MV are padded from the available samples.
[0172] The following describes exemplary enabling conditions for a DMVR: A DMVR is enabled if all of the following conditions are met: a. CU level merge mode with bi-predictive MV. b. There is one reference picture in the past and another reference picture in the future for the current picture. c. The distance (eg, POC difference) from both reference pictures to the current picture is the same. d. The CU has more than 64 luma samples. e. Both CU height and CU width are greater than or equal to 8 luma samples. f. BCW (Bi-prediction using CU-level weights) Weight index indicates equal weights. g. WP (weighted prediction) is not enabled for the current block. h. CIIP (combined inter and intra prediction) mode is not used for the current block.
[0173] The following describes bidirectional optical flow. Bidirectional optical flow (BDOF) is used to refine the bi-predictive signal of luma samples in a CU at the 4x4 sub-block level. As the name suggests, BDOF mode is based on the optical flow concept, which assumes smooth object motion. For each 4x4 sub-block, motion refinement (v x ,v y ) is calculated. The motion refinement is then used to adjust the bi-predicted sample values within the 4x4 sub-blocks.
[0174] For example, in the case of BDOF, the video encoder 200 and the video decoder 300 may determine that BDOF is enabled for a block and may divide the block into multiple sub-blocks when BDOF is enabled for the block. In some examples, the video encoder 200 and the video decoder 300 may determine a first reference block from a first motion vector for the block and a second reference block from a second motion vector for the block. The video encoder 200 and the video decoder 300 may blend (e.g., weighted average) samples in the first reference block and samples in the second reference block to generate a predictive block. The video encoder 200 and the video decoder 300 may determine a motion improvement and adjust samples in the predictive block to generate predictive samples used to encode or decode samples of the sub-block. In some examples, the video encoder 200 and the video decoder 300 may determine a motion improvement that is the same for each sample in the sub-block (i.e., a sub-block-level motion improvement, referred to as sub-block BDOF). In some examples, the video encoder 200 and the video decoder 300 may determine the motion improvement at the sub-block or each sample (ie, sample-level motion improvement, referred to as pixel-wise BDOF).
[0175] In the BDOF process, which may be applicable to sub-block BDOF, the following steps are applied: The steps for pixel-wise BDOF are explained in further more detail below.
[0176] First, the horizontal and vertical gradients of the two prediction signals
[0177]
number
[0178] and
[0179]
number
[0180] However, it is possible to directly calculate the difference between two adjacent samples, i.e.,
[0181]
number
[0182] It is calculated as follows.
[0183] In the above example, I (k) (i,j) is the sample value at coordinate (i,j) of the prediction signal in list k (k=0,1), and shift1 is calculated based on the luma bit depth bitDepth such that shift1 is set equal to 6. That is, I (0) refers to the sample in the first reference block, and I (1) refers to a sample of the second reference block, where the first reference block and the second reference block were used to generate the predicted block whose samples are being adjusted according to the BDOF technique.
[0184] Then the autocorrelations and cross-correlations of the gradients S1, S2, S3, S5, and S6 are S1= Σ (i,j)∈Ω |ψ x (i,j)|, S3= Σ (i,j)∈Ω θ(i,j)·(-sign(ψ x (i,j) S2= Σ (i,j)∈Ω ψ x (i,j)·sign(ψ y (i,j) S5=Σ (i,j)∈Ω |ψ y (i,j)|, S6= Σ (i,j)∈Ω θ(i,j)·(-sign(ψ y (i,j)) (1-6-2) is calculated as, where:
[0185]
number
[0186] where Ω is a 6×6 window around the 4×4 sub-block, the value of shift2 is set equal to 4, and the value of shift3 is set equal to 1.
[0187] Movement improvement (v x ,v y ) is then derived using the cross-correlation and auto-correlation terms using: In this example, the motion improvement is sub-block wise. The pixel-wise motion improvement calculation is described in more detail below.
[0188]
number
[0189] However, th' BIO = 1 << 4.
[0190]
number
[0191] is the floor function.
[0192] Based on the motion refinement and gradients, the following adjustments are calculated for each sample in the 4x4 sub-block:
[0193]
number
[0194] Finally, the BDOF samples of the CU are calculated by adjusting the bi-predictive samples as follows: pred BDOF (x,y) = (I (0) (x,y) + I (1)(x,y) + b(x,y) + ο offset ) >> shift5 (1-6-6) However, shift5 is set equal to Max(3,15 - BitDepth), and the variable ο offset is set equal to (1 << (shift5 - 1)).
[0195] In the above example, I (0) refers to the first reference block, and I (1) refers to the second reference block, and b(x,y) is the motion improvement (v x ,v y ) is an adjustment value determined based on I (0) (x,y) + I (1) (x,y) may be considered as a predicted block, and therefore b(x,y) may be considered as adjusting the predicted block. As shown in equation (1-6-6), the predicted sample (pred BDOF To generate (x,y), offset There may be additions of , and right shift operations of shift5 only.
[0196] The above is a motion improvement (v x ,v y ) is the same. The adjustment value b(x,y) may be different for each sample in the sub-block due to gradients, but the motion improvement may be the same.
[0197] As will be described in further detail below, in pixel-wise BDOF, the video encoder 200 and the video decoder 300 use pixel-wise motion enhancement (v x ',v yThat is, rather than having one motion improvement for the sub-block as in sub-block BDOF, there may be a different motion improvement for each sample (e.g., pixel) in per-pixel BDOF. Video encoder 200 and video decoder 300 may determine an adjustment value b′(x,y) for each sample based on the corresponding per-pixel motion improvement for that sample, rather than using a motion improvement that is the same for the sub-block.
[0198] In some examples, the values from Equation 1-6-6 are selected so that the multipliers in the BDOF process do not exceed 15 bits and the maximum bit width of the intermediate parameters in the BDOF process is kept within 32 bits.
[0199] To derive the gradient value, we select some predicted samples I in list k (k=0,1) outside the current CU boundary. (k) (i,j) are generated by the video encoder 200 and the video decoder 300. As shown in FIG. 12, BDOF uses one extended row / column around the boundary of the CU 1200. To control the amount of computation required to generate prediction samples outside the boundary, the video encoder 200 and the video decoder 300 may generate prediction samples within the extended area (white positions) by taking reference samples at nearby integer positions directly (using a floor() operation on the coordinates) without interpolation, and a regular 8-tap motion compensation interpolation filter is used to generate prediction samples within the CU (gray positions). These extended sample values may be used only in gradient calculations. If any sample and gradient values outside the CU boundary are needed for the remaining steps in the BDOF process, the sample and gradient values are padded (i.e., repeated) from their nearest neighbors.
[0200] BDOF is used to improve the bi-predictive signal (e.g., the sum of the first reference block and the second reference block) of a CU at the 4x4 sub-block level. BDOF is applied to a CU if all of the following conditions are met: a. The CU is coded using "true" bi-prediction mode, i.e., one of the two reference pictures is before the current picture in display order, and the other is after the current picture in display order. b. The CU is not coded using affine mode or ATMVP merge mode. c. The CU has more than 64 luma samples. d. Both CU height and CU width are greater than or equal to 8 luma samples. e.BCW weight index indicates equal weights. f. WP is not currently enabled for the CU. g. CIIP mode is not currently used for the CU.
[0201] There can be some problems with BDOF. As explained above, in the current version of VVC, the BDOF method is used to improve the bi-predictive signal of luma samples in a coding block at the 4x4 sub-block level. x ,v y ) is derived by minimizing the difference between the L0 and L1 predicted samples within a 6x6 luma sample region. The L0 predicted samples refer to samples of the first reference block, and the L1 predicted samples refer to samples of the second reference block. x ,v y ) is then used to adjust each prediction sample of the 4x4 sub-block.
[0202] However, luma samples within a 4x4 sub-block may have different motion improvement characteristics compared to other luma samples within the 4x4 sub-block. x ,v' y) can improve the accuracy of motion refinement for each pixel and therefore improve sub-block or block prediction quality.
[0203] However, BDOF is a decoder-side process, and the complexity of BDOF is also an important aspect to be considered when designing a video coding method. x ,v' y When ∑ ∑ ∑ b ...
[0204] In VVC Draft 10, when BDOF precedes decoder-side motion vector refinement (DMVR), the BDOF process can be bypassed based on the minimum SAD in the DMVR search process. The DMVR process is at the 16x16 sub-block level. This BDOF bypass method can reduce complexity.
[0205] However, the prediction signal of a sub-area within a 16x16 sub-block may need to be improved by BDOF. The BDOF bypass in the VVC Draft 10 scheme cannot apply BDOF in a sub-area within a 16x16 sub-block, while bypassing BDOF in other sub-areas. In VVC Draft 10, there is no bypass BDOF scheme when BDOF is applied to a bi-predicted coding block (not DMVR predicted).
[0206] The following describes exemplary techniques that may address the above problems. However, the techniques should not be considered limited to or required to address the above problems. The following techniques may be used effectively separately or in any combination. For simplicity, the following techniques are described as various aspects, but such aspects should not be considered required to be separate, and various aspects may be combined. Unless otherwise specified, the exemplary aspects may be performed by video encoder 200 and / or video decoder 300.
[0207] A first aspect relates to bypassing sub-block BDOF. In this first aspect, when it is determined that a W×H coding block should apply bidirectional optical flow (BDOF), the video encoder 200 and / or the video decoder 300 may bypass the BDOF process for a sub-area of the coding block. The BDOF process for the first aspect may be as follows: a. The BDOF process starts with an input block (designated S1), with dimensions W_1 × H_1, and the dimensions of S1 are equal to or smaller than the dimensions of the coding block. If the preceding process is block-based, the dimensions of S1 are equal to the coding block. If the preceding process is sub-block-based (due to hardware constraints or sub-block partitioning from a previous processing stage), the dimensions of S1 are smaller than the coding block. b. The input block S1 is divided into N sub-blocks (designated S2), where S2 has dimensions W_2×H_2, and the dimensions of S2 are equal to or smaller than the dimensions of S1. For each S2 determined by condition T, it is determined whether S2 should apply BDOF. In some examples, condition T is to check whether the SAD between two prediction signals in reference picture 0 and reference picture 1 is smaller than a threshold. The sub-blocks in this step define a basic unit for determining whether BDOF should be applied to all samples in the unit. c. Once it is determined that BDOF should be applied to S2, S2 is divided into M sub-blocks (designated as S3), where S3 has dimensions W_3×H_3, and the dimensions of S3 are equal to or smaller than the dimensions of S2. For each S3, the BDOF process is applied to obtain an improved motion vector (v' x ,v' y ) and derive a prediction signal for S3 using the derived motion vector (either through motion compensation or by adding an offset to the initial prediction signal). The sub-blocks in this step define a unit for the granularity of the refined motion vector, and all samples within a unit share the same refined motion.
[0208] In the BDOF process of embodiment 1, blocks S1, S2, and S3 are defined. The dimensions of S3 may be equal to or smaller than S2, and the dimensions of S2 may be equal to or smaller than S1. In other words, W_3 is equal to or smaller than W_2, H_3 is equal to or smaller than H_2, W_2 is equal to or smaller than W_1, and H_2 is equal to or smaller than H_1. The sizes may be fixed, adapted to the picture resolution, or signaled in the bitstream.
[0209] One case is when W_3 is equal to 1 and H_3 is equal to 1, where S3 is pixel-based. This case may be a pixel-wise BDOF process.
[0210] In some examples, S1 is a coding block, regardless of whether a previous sub-block-based process is applied to the coding block.
[0211] The second aspect relates to pixel-wise BDOF using a sub-block BDOF bypass scheme. As in the first aspect, when it is determined that a W×H coding block (S1) should apply bidirectional optical flow (BDOF), the coding block is divided into N sub-blocks (S2). For each sub-block, it is further determined whether BDOF should be applied to the sub-block by checking whether the SAD between two prediction signals in reference picture 0 and reference picture 1 is smaller than a threshold. If it is determined that BDOF should be applied to the sub-block, an improved motion vector (v' x ,v' y ) is calculated for each pixel (S3) in the sub-block (S2). x ,v' y ) is used to adjust the prediction signal for that pixel (S3) in the sub-block (S2). An example of pixel-wise BDOF with sub-block bypass process is shown in FIG.
[0212] 13, the video encoder 200 and the video decoder 300 may determine that BDOF is enabled for a block of video data, and may divide the block into multiple sub-blocks based on the determination that BDOF is enabled for the block. As shown in FIG. 13, the number of sub-blocks and N sub-block indices <i = 0>Deriving (1300) refers to the video encoder 200 and video decoder 300 dividing the block into N sub-blocks, where each sub-block is identified by a respective index, with the first index being 0. Thus, the indices range from 0 to N-1.
[0213] Video encoder 200 and video decoder 300 may determine whether predictive samples for all sub-blocks in the block have been determined (1302), as represented by i < N. If predictive samples for all sub-blocks have been determined (NO at 1302), video encoder 200 and video decoder 300 may end the process of determining predictive samples for sub-blocks. However, if predictive samples for all sub-blocks have not been determined (YES at 1302), video encoder 200 and video decoder 300 may continue the process of determining predictive samples for a current sub-block among multiple sub-blocks into which the block has been divided.
[0214] For the current sub-block, video encoder 200 and video decoder 300 may determine a distortion value (1304). Because the determination for the distortion value may be made for each sub-block, video encoder 200 and video decoder 300 may be considered to determine a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks (e.g., a first distortion value for the first sub-block, a second distortion value for the second sub-block, and so on).
[0215] One exemplary method for determining the distortion value for the current sub-block is by determining the sum of absolute differences (SAD) between the first reference block (ref0) and the second reference block (ref1). However, there may be other methods for determining the distortion value. For example, as described in further more detail below, in some examples, the video encoder 200 and the video decoder 300 may determine the distortion value in a manner such that the obtained value can be reused later, such as when the video encoder 200 and the video decoder 300 are to perform BDOF.
[0216] As shown in FIG. 13 , the video encoder 200 and the video decoder 300 may compare the distortion value with a threshold value (1306). Based on the comparison, the video encoder 200 and the video decoder 300 may have two options. The first option may be to perform per-pixel BDOF, and the second option may be to bypass BDOF. The video encoder 200 and the video decoder 300 may not have other options, such as sub-block BDOF. Thus, the video encoder 200 and the video decoder 300 may be considered to determine whether per-pixel BDOF or BDOF is bypassed for each sub-block of one or more sub-blocks of the plurality of sub-blocks based on the respective distortion values (e.g., based on a comparison of the respective distortion values with a fixed threshold value or a respective threshold value).
[0217] For example, if the distortion value for the current sub-block is greater than a threshold (NO at 1306), the video encoder 200 and the video decoder 300 may perform pixel-wise BDOF (1308). If the distortion value for the current sub-block is less than a threshold (YES at 1306), the video encoder 200 and the video decoder 300 may derive a prediction signal within the sub-block (e.g., by bypassing BDOF for the sub-block) (1310).
[0218] In one or more examples, the video encoder 200 and the video decoder 300 may determine a predictive sample for each sub-block of one or more sub-blocks based on a determination of whether per-pixel BDOF is to be performed or BDOF is to be bypassed. For example, if the video encoder 200 and the video decoder 300 are to perform BDOF on the current sub-block, the video encoder 200 and the video decoder 300 may determine a predictive sample using a per-pixel BDOF technique, whereas if the video encoder 200 and the video decoder 300 are to bypass BDOF on the current sub-block, the video encoder 200 and the video decoder 300 may determine a predictive sample without using a BDOF technique.
[0219] 13 described how a decision is made whether to perform pixel-wise BDOF or bypass BDOF for a current sub-block. Video encoder 200 and video decoder 300 may perform the above example techniques on a sub-block-by-sub-block basis.
[0220] For example, to determine a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks, for a first sub-block of the one or more sub-blocks, the video encoder 200 and the video decoder 300 may determine a first distortion value of the respective distortion value, and for a second sub-block of the one or more sub-blocks, the video encoder 200 and the video decoder 300 may determine a second distortion value of the respective distortion value.
[0221] To determine whether per-pixel BDOF is performed or BDOF is bypassed for each sub-block of one or more sub-blocks of the plurality of sub-blocks based on the respective distortion values, for a first sub-block of the plurality of sub-blocks, video encoder 200 and video decoder 300 may determine that BDOF is enabled for the first sub-block based on the first distortion value (e.g., based on the first distortion value being greater than a threshold). In this example, based on the determination that BDOF is enabled for the first sub-block, video encoder 200 and video decoder 300 may determine per-pixel motion improvement to improve a first set of prediction samples for the first sub-block (e.g., may perform per-pixel BDOF). For example, for a first sample of the first sub-block, video encoder 200 and video decoder 300 may derive a first motion improvement to improve the first prediction sample, and for a second sample of the first sub-block, may derive a second motion improvement to improve the second prediction sample, and so on.
[0222] However, for a second sub-block of the plurality of sub-blocks, video encoder 200 and video decoder 300 may determine that BDOF is bypassed based on the second distortion value (e.g., based on the second distortion value being less than a threshold). In this example, based on the determination that BDOF is bypassed for the second block, video encoder 200 and video decoder 300 may bypass determining per-pixel motion improvement to improve a second set of prediction samples for the second sub-block (e.g., may bypass BDOF). For example, video encoder 200 and video decoder 300 may bypass derivation of a first motion improvement to improve the first prediction sample for a first sample of the first sub-block, and may bypass derivation of a second motion improvement to improve the second prediction sample for a second sample of the first sub-block, and so on.
[0223] To determine predictive samples for each sub-block of one or more sub-blocks based on a determination that per-pixel BDOF is performed or BDOF is bypassed, video encoder 200 and video decoder 300 may, for a first sub-block, determine an improved first set of predictive samples for the first sub-block based on the per-pixel motion refinement for the first sub-block. For a second sub-block, video encoder 200 and video decoder 300 may determine a second set of predictive samples without improving the second set of predictive samples based on the per-pixel motion refinement to refine the second set of predictive samples.
[0224] Within the second aspect, the following describes bypassing sub-block BDOF: Given a coding block of W×H to which it is determined that bidirectional optical flow (BDOF) should be applied, the number of sub-blocks N is determined as follows: a. numSbX = (W > thW) ? (W / thW) : 1 b. numSbY = (H > thH) ? (H / thH) : 1 c. N = numSbX * numSbY
[0225] In the above, thW represents the maximum sub-block width and thH represents the maximum sub-block height, and the values of thW and thH are predetermined integer values (e.g., thW=thH=8).
[0226] For each sub-block, video encoder 200 and / or video decoder 300 may derive prediction signals predSig0 and predSig1 from reference picture 0 and reference picture 1, respectively. The width (sbWidth) and height (sbHeight) of predSig0 and predSig1 are determined as follows: a. sbWidth = (W > thW) ? thW : W b. sbHeight = (H > thH) ? thH : H
[0227] Whether or not to bypass BDOF in a sub-block is determined by checking the SAD between predSig0 and predSig1. The SAD is derived as follows:
[0228]
number
[0229] In the above equation, Ω'' is a sub-block of size sbWidth × sbHeight, and I (k) (i,j) is the sample value at coordinates (i,j) of the predicted signal in reference picture k (k=0,1).
[0230] If sbSAD is less than the threshold sbDistTh, the video encoder 200 and / or the video decoder 300 may determine to bypass BDOF in the sub-block; otherwise (if sbSAD is equal to or greater than sbDistTh), the video encoder 200 and / or the video decoder 300 may determine to apply BDOF to the sub-block. The threshold sbDistTh is derived as follows: sbDistTh = (sbWidth·sbHeight·s) << n (3-1-1-2)
[0231] In the above equation, n and s are predetermined values. For example, n can be derived as n = InternalBitDepth - bitDepth + 1. In the above equation, s represents a scale factor, for example, s = 1. In the current version of VVC, InternalBitDepth is equal to 14 at bitDepth 10, so n is equal to 5. The scale s may be 1, 2, 3, or other predefined values, or may be signaled in the bitstream.
[0232] It should be understood that the above describes one example method of determining a threshold value and one example method of determining a distortion value. However, the example techniques are not so limited. As described in more detail below, in some examples, video encoder 200 and video decoder 300 may determine the distortion value in a manner such that, if a determination is made that per-pixel BDOF will be performed, the calculations used to determine the distortion value can be reused to perform per-pixel BDOF.
[0233] Within the second aspect, the following describes pixel-wise BDOF: If video encoder 200 and / or video decoder 300 determines that BDOF should be applied to a sub-block of sbWidth x sbHeight, the sub-block is expanded to an area of (sbWidth + 4) x (sbHeight + 4). For each pixel within the sub-block, video encoder 200 and / or video decoder 300 calculates a motion refinement (v'), also called an improved motion vector, based on the gradient of a 5 x 5 surrounding area. x ,v' y ) may be derived. Figure 14 shows an example of per-pixel BDOF for 8x8 sub-blocks. Thus, in per-pixel BDOF, video encoder 200 and video decoder 300 may determine per-pixel motion improvement. In sub-block BDOF, the motion improvement is for the sub-block and is not determined on a sample-by-sample basis (e.g., pixel-by-pixel basis).
[0234] Above, given a sub-block of sbWidth x sbHeight, the following steps are applied in the pixel-wise BDOF process: - Horizontal and vertical gradients of the two predicted signals
[0235]
number
[0236] and
[0237]
number
[0238] is calculated by directly computing the difference between two adjacent samples as in the bidirectional optical flow described above, and (i,j) is a coordinated position within the (sbWidth + 4) × (sbHeight + 4) region of the prediction signal in reference picture 0 and reference picture 1. For each pixel in the sub-block, the following steps are applied: The gradient auto- and cross-correlations S1, S2, S3, S5, and S6 are calculated as in the bidirectional optical flow described above, where Ω' is a 5x5 window around the pixel. Movement improvement (v' x ,v' y ) is then derived using the cross-correlation and auto-correlation terms. Based on the motion refinement and gradient, the following adjustments are calculated to derive the prediction signal for the pixel:
[0239]
number
[0240] In the above example, I (0) refers to the first reference block, and I (1) refers to the second reference block. The adjustment value b'(x,y) is the pixel-wise motion improvement (v' x ,v' y ) is an adjustment value determined based on I (0) (x,y) + I (1) (x,y) may be considered as a predicted block, and therefore b'(x,y) may be considered as adjusting the predicted block. As shown in equation (3-1-2-1), the predicted sample (pred BDOF To generate (x,y), offset There may be additions of , and right shift operations of shift5 only.
[0241] A third aspect relates to an alternative sub-block SAD derivation. This exemplary technique for deriving SAD may be such that the values determined for SAD derivation can be reused to perform per-pixel BDOF. That is, the video encoder 200 and the video decoder 300 may first determine a distortion value (e.g., a SAD value) for a sub-block to determine whether to perform per-pixel BDOF. If the video encoder 200 and the video decoder 300 determine that per-pixel BDOF will be performed, the calculations that the video encoder 200 and the video decoder 300 performed to determine whether to perform per-pixel BDOF may be reused to perform per-pixel BDOF.
[0242] For example, one method for determining a distortion value for a sub-block is to determine a first reference block (e.g., identified by a first motion vector) and a second reference block (e.g., identified by a second motion vector), and determine a difference value between samples of the first reference block and samples of the second reference block to determine the distortion value. As an example, as described above, one method for determining a distortion value is
[0243]
number
[0244] The purpose is to determine:
[0245] In the above equation, I (1) (i,j) refers to the sample in the first reference block, and I (0) (i,j) refers to a sample of the second reference block. As explained further above, pixel-wise motion refinement (e.g., v' x , v' y To determine the motion refinement, including θ = (I ), the video encoder 200 and the video decoder 300 may determine the gradient autocorrelations and cross-correlations S1, S2, S3, S5, and S6. As described in Equation 1-6-3, part of determining the gradient autocorrelations and cross-correlations is determining an intermediate value for θ, where θ = (I (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2).
[0246] Therefore, if pixel-wise BDOF is to be performed on the sub-blocks, the video encoder 200 and the video decoder 300 may use the following formula: (I (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2). In one or more examples, as part of determining the distortion value for the sub-block, the video encoder 200 and the video decoder 300 may need to determine (I (1) (i,j)) - (I (0) Instead of (or in addition to) determining the strain value based on (I (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2) as a value for sbSAD. That is, to determine a distortion value for a sub-block, such as to determine whether pixel-wise BDOF is to be performed, video encoder 200 and video decoder 300 may use (I (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2). In this way, if pixel-wise BDOF is to be performed, the video encoder 200 and the video decoder 300 may determine (I (0) (i,j) >> shift2) - (I (1) We have already determined the values for (i,j) >> shift2), and these values are the values of θ that we will use to determine the motion improvement.
[0247] Thus, in one or more examples, to determine a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks, video encoder 200 and video decoder 300 may be configured to determine a first reference block and a second reference block for each sub-block of the one or more sub-blocks of the plurality of sub-blocks. (0) (i,j) may be the first reference block, and I (1) (i,j) may be the second reference block.
[0248] The video encoder 200 and the video decoder 300 may scale the samples of the first reference block and the samples of the second reference block. For example, the video encoder 200 and the video decoder 300 may scale the samples of the first reference block and the samples of the second reference block. (0) (i,j) >> shift2. In this example, the value of shift2 is I to generate the scaled samples of the first reference block. (0) Similarly, the video encoder 200 and the video decoder 300 may specify how much the value of I(i,j) should be scaled. (1) (i,j) >> shift2. In this example, the value of shift2 is I to generate the scaled samples of the second reference block. (1) It can be specified how much the (i,j) value should be scaled.
[0249] To determine the respective distortion values, the video encoder 200 and the video decoder 300 may determine a difference value between the scaled samples of the first reference block and the scaled samples of the second reference block. For example, the video encoder 200 and the video decoder 300 may determine a difference value between the scaled samples of the first reference block and the scaled samples of the second reference block. (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2). The video encoder 200 and the video decoder 300 may determine (I (0) (i,j) >> shift2) - (I (1) A distortion value (eg, sbSAD) may be determined for the sub-block based on the result of (i,j) >> shift2).
[0250] As explained above, in some examples, there may be a computational gain for the video encoder 200 and the video decoder 300, (I (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2) may be reused for pixel-wise BDOF. For example, assume that video encoder 200 and video decoder 300 determine that pixel-wise BDOF is to be performed on a first sub-block of one or more sub-blocks into which a block being encoded or decoded has been divided.
[0251] In this example, video encoder 200 and video decoder 300 may determine a respective motion improvement for each sample in the first sub-block. That is, video encoder 200 and video decoder 300 may determine one motion improvement (v x ,v y ) for each sample of the first sub-block, x ,v' y ) may be determined.
[0252] Video encoder 200 and video decoder 300 may be configured to determine a respective improved sample value for each sample in the first sub-block from the samples in the predictive block for the first sub-block based on the respective motion improvement. For example, as described above, the formula for determining the predicted sample for pixel-wise BDOF is BDOF (x,y) = (I (0) (x,y) + I (1) (x,y) + b'(x,y) + ο offset ) >> Shift5 is fine.
[0253] pred BDOF To determine , the video encoder 200 and the video decoder 300 use their respective per-pixel motion improvements (i.e., (v' x ,v' y In some examples, the prediction block may be a sum of the first reference block and the second reference block (i.e., I (0) (i,j) + I (1) (i,j)). BDOF As shown in the equation for determining I (0) (i,j) + I (1) (i,j) can be added to b'(x,y). Therefore, pred BDOF As part of determining v', the video encoder 200 and the video decoder 300 may use v' to determine the respective motion refinement (e.g., b'(x,y)). x ,v' y ) for the first sub-block (e.g., if the predicted block is I (0) (i,j) + I (1) (i,j)) from the samples in the predicted block, the improved sample value (e.g., pred BDOF ) may be determined.
[0254] In other words, video encoder 200 and video decoder 300 may determine a first set of sample values in a first reference block for a first sub-block of the one or more sub-blocks (e.g., I (0) (i,j)). The video encoder 200 and the video decoder 300 may scale the first set of sample values with the scale factor to generate a first set of scaled sample values. That is, I (0) To perform (i,j) >> shift2, video encoder 200 and video decoder 300 may be thought of as scaling the first set of samples by the scale factor specified by the values of '>>' and 'shift2'.
[0255] Video encoder 200 and video decoder 300 may determine a second set of sample values in a second reference block for a first sub-block of the one or more sub-blocks (e.g., I (1) (i,j)). The video encoder 200 and the video decoder 300 may scale the second set of sample values with the scale factor to generate a second set of scaled sample values. That is, I (1) To perform (i,j) >> shift2, video encoder 200 and video decoder 300 may be thought of as scaling the second set of samples by the scale factor specified by the values of '>>' and 'shift2'.
[0256] The video encoder 200 and the video decoder 300 may generate a scaled sample value (e.g., I (0) (i,j) >> shift2 and I (1) (i,j) >> shift2) for the first sub-block. For example, the video encoder 200 and the video decoder 300 may determine a distortion value for the first sub-block based on (I (0) (i,j) >> shift2) - (I (1) A distortion value may be determined for the first sub-block based on (i,j) >> shift2).
[0257] In one or more examples, assume that per-pixel BDOF is performed on the first sub-block, as described above. In this example, video encoder 200 and video decoder 300 may reuse the first set of scaled sample values and the second set of scaled sample values to determine per-pixel motion improvement for per-pixel BDOF. For example, video encoder 200 and video decoder 300 may reuse the first set of scaled sample values and the second set of scaled sample values to determine the autocorrelation and cross-correlation of gradients (I (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2) is calculated by pixel-wise motion refinement (e.g., (v' x ,v' y As explained above, the video encoder 200 and the video decoder 300 may reuse the pred BDOF Per-pixel motion refinement may be used to determine an adjustment value b'(x,y) used to determine the predicted sample (i.e., the predicted sample for encoding or decoding the first sub-block of the block).
[0258] The above describes an example in which video encoder 200 and video decoder 300 may reuse a first set of scaled sample values and a second set of scaled sample values to determine per-pixel motion improvement for per-pixel BDOF. However, the technique is not so limited. In some examples, video encoder 200 and video decoder 300 may reuse a first set of scaled sample values and a second set of scaled sample values to determine motion improvement for BDOF. That is, the example technique may not be limited to reusing a first set of scaled sample values and a second set of scaled sample values for per-pixel motion improvement for per-pixel BDOF, but may be used more generally for motion improvement for BDOF (e.g., not limited to per-pixel motion improvement for per-pixel BDOF). There may be complexity reduction not only for per-pixel BDOF, but also for sub-block-based BDOF, such as in examples in which BDOF includes motion improvement for entire sub-blocks rather than per pixel.
[0259] Therefore, as in the second aspect, the following describes an alternative method for deriving a sub-block SAD used to determine whether or not to bypass a sub-block (i.e., whether or not BDOF is bypassed). As explained above, the exemplary method calculates the difference diff(i,j) between two reference signals in the same way as calculating θ(i,j) as in the bidirectional optical flow described above using Equations 1-6.
[0260] If it is determined that a sub-block should apply BDOF, diff(i,j) can be reused in the steps for calculating gradient autocorrelation and cross-correlation S3 and S6 as in the bidirectional optical flow described above.
[0261] The formula (3-1-1-1) in the second embodiment is modified as follows:
[0262]
number
[0263] In the above equation, I (k) (i,j) is the sample value at coordinate (i,j) in the region of (sbWidth + 4) × (sbHeight + 4) of the prediction signal in reference picture k (k = 0,1). shift2 is a predetermined value, for example, shift2 is equal to 4. Ω'' is the sub-block region of sbWidth × sbHeight.
[0264] θ(i,j) = (I (0) (i,j) >> shift2) - (I (1) Note that the alternative techniques for determining distortion values for sub-blocks (e.g., for determining sbSAD) based on (i,j) >> shift2) should not be considered limited to examples in which pixel-wise BDOF is performed. The alternative techniques for determining distortion values for sub-blocks may be applicable even to examples in which sub-block BDOF or some other BDOF technique is applied. For example, even for sub-block BDOF, video encoder 200 and video decoder 300 may utilize the alternative techniques for determining distortion values to determine whether BDOF is performed for the sub-block. If BDOF is to be performed, video encoder 200 and video decoder 300 may reuse the calculations for which the alternative techniques determine distortion values to determine motion improvement as part of the sub-block BDOF (e.g., there may be reuse of the calculations for which the alternative techniques determine distortion values).
[0265] As explained above, the threshold against which the distortion value is compared to determine whether per-pixel BDOF is performed or whether BDOF is bypassed is sbDistTh, which is calculated as (sbWidth*sbHeight*s) << n, as shown in equation 3-1-1-2 above. However, in an alternative technique for determining the distortion value, video encoder 200 and video decoder 300 may use >> shift2 to shift I, as explained above. (0) You can scale (i,j) and >> shift2 to I (1) Therefore, in some examples, the manner in which video encoder 200 and video decoder 300 determine sbDistTh may be modified to take into account the >> shift2 scaling.
[0266] The formula (3-1-1-2) in the second embodiment for calculating sbDistTh is modified as follows: sbDistTh = (sbWidth·sbHeight·s) << (n - shift2) (3-2-2)
[0267] In the above equation, n and s are predetermined values. For example, n can be derived as n = InternalBitDepth - bitDepth + 1. In the above equation, s represents a scale factor, for example, s = 1. In the current version of VVC, InternalBitDepth is equal to 14 at bitDepth 10, so n is equal to 5. The scale s may be 1, 2, 3, or other predefined values, or may be signaled in the bitstream.
[0268] Thus, to determine the threshold, video encoder 200 and video decoder 300 may be configured to multiply the width of a first sub-block of the one or more sub-blocks (i.e., sbWidth in Equation 3-2-2), the height of the first sub-block of the one or more sub-blocks (i.e., sbHeight in Equation 3-2-2), and a first scale factor (i.e., “s” in Equation 3-2-2) to generate an intermediate value. Video encoder 200 and video decoder 300 may be configured to perform a left-shift operation on the intermediate value based on the second scale factor to generate the threshold. For example, the second scale factor may be (n − shift2) in Equation 3-2-2, where the left-shift operation is indicated as “<<” in Equation 3-2-2.
[0269] In one or more examples, video encoder 200 and video decoder 300 may compare a distortion value for the first sub-block (e.g., a distortion value calculated using an alternative technique for determining a distortion value) with a threshold value (e.g., sbDistTh as determined in Equation 3-2-2). Video encoder 200 and video decoder 300 may determine one of performing per-pixel BDOF or bypassing BDOF for the first sub-block based on the comparison. For example, if the distortion value is less than the threshold value (e.g., YES at 1306 in FIG. 13 ), video encoder 200 and video decoder 300 may bypass BDOF. If the distortion value is greater than the threshold value (e.g., NO at 1306 in FIG. 13 ), video encoder 200 and video decoder 300 may perform per-pixel BDOF.
[0270] A fourth aspect relates to determining the values of thW and thH. As in the above aspect, the exemplary technique may be applied to bi-predicted coding blocks. The total number of sub-blocks is derived from the width and height of the current block and the maximum sub-block width (thW) and height (thH) of the sub-blocks.
[0271] When the current coding block applies a sub-block based method, e.g., DMVR, the values of thW and thH should be equal to or smaller than the maximum sub-block width and height of the previous method (e.g., DMVR).
[0272] The values of thW and thH may be fixed, predetermined values, for example, thW equals 8 and thH equals 8. The values of thW and thH may be adaptive, and the values are determined by decoded information from the bitstream. The following describes how the values of thW and thH can be adaptive. a. Determined by a previous coding method. If the current coding block applies a sub-block-based method, thW and thH may be set to the same sub-block dimensions as the previous method. For example, when DMVR is applied to the current coding block, thW is set to be equal to the DMVR maximum sub-block width, e.g., 16, and thH is set to be equal to the DMVR maximum sub-block height, e.g., 16. Otherwise (if the current coding block does not apply any sub-block-based method), thW and thH may be set to predetermined values, e.g., 8. b. Determined by the current coding block dimension. In this example, coding blocks with a total number of luma samples greater than a threshold T (e.g., T=128) are set to the larger of thW and thH. Given a coding block of W×H, if W*H is greater than T, set the values of thW and thH equal to 16. Otherwise (if W*H is equal to or less than T), set the values of thW and thH equal to 8.
[0273] A fifth aspect relates to an exemplary decoder process for applying pixel-wise BDOF with sub-block bypass. The above aspects may be applied in an encoder (e.g., video encoder 200) and / or a decoder (e.g., video decoder 300). The decoder (e.g., video decoder 300) may perform the method described herein by all or a subset of the following steps to decode an inter-predicted block in a picture from a bitstream. 1. Derive the position component (cbX, cbY) as the top-left luma position of the current block by decoding the syntax element in the bitstream. 2. Derive the size of the current block as a width value W and a height value H by decoding syntax elements in the bitstream. 3. Determine from decoding elements in the bitstream that the current block is an inter-predicted block. 4. Derive the motion vector components (mvL0 and mvL1) and reference indices (refPicL0 and refPicL1) of the current block from decoding elements in the bitstream. 5. Infer a flag from decoding elements in the bitstream, where the flag indicates whether decoder-side motion vector derivation (e.g., DMVR, bidirectional merging, template matching) is applied to the current block. The flag inference scheme may be the same as, but not limited to, the example described above regarding the enabling condition for when DMVR is enabled. In another example, this flag may be explicitly signaled in the bitstream to avoid complex condition checks in the decoder. 6. If it is determined that DMVR should be applied to the current block, derive an improved motion vector. 7. Derive two (W + 6) × (H + 6) luma prediction sample arrays predSampleL0 and predSampleL1 from the decoded refPicL0, refPicL1, and the motion vectors. If it is determined that DMVR should be applied, the motion vectors are improved motion vectors; otherwise, the motion vectors are mvL0, mvL1. 8. Infer a flag from decoding elements in the bitstream, where the flag indicates whether bidirectional optical flow is applied to the current block. The flag estimation scheme can be, but is not limited to, the same as for bidirectional optical flow. In another example, the flag may be explicitly signaled in the bitstream to avoid complex condition checks at the decoder. 9. According to the above flag value, if the decision is to apply BDOF to the current block, derive the number of sub-blocks in the horizontal direction numSbX and the number of sub-blocks in the vertical direction numSbY, the sub-block width sbWidth and the sub-block height sbHeight as follows: ·numSbX = (W > thW) ? (W / thW) : 1 ·numSbY = (H > thH) ? (H / thH) : 1 ·sbWidth = (W > thW) ? thW : W ·sbHeight = (H > thH) ? thH : H where thW and thH are predetermined integer values (eg, thW = thH = 8). 10. Derive the variable sbDistTh as follows: sbDistTh = sbWidth * sbHeight * s << (n - shift2) however, shift2 is a predetermined value, for example, shift2 is equal to 4. n is a predetermined value, for example, n = InternalBitDepth - bitDepth + 1 = 5. s is a scale factor, e.g., s=1. 11. Set the position components (sbX, sbY) = (0, 0) as the top-left luma position of the first sub-block of the current block. 12. For each sub-block in (sbX, sbY), when sbX is less than W and sbY is less than H, the following steps are applied. 12.1. For x = sbX - 2...sbX + sbWidth + 1, y = sbY - 2...sbY + sbHeight + 1, the variables diff[x][y] are derived as follows: ·diff[x][y] = (predSamplesL0[x][y] >> shift2) - (predSamplesL1[x][y] >> shift2) However, shift2 is a predetermined value, for example, shift2 is equal to 4. 12.2. Derive the variable sbDist as follows: sbDist = Σ i Σ j Abs(diff[sbX + i][sbY + j]) where i = 0...sbWidth - 1, j = 0...sbHeight - 1 12.3. (Bypassing Sub-Block BDOF) If sbDist is smaller than sbDistTh, derive the prediction signal of the sub-block as follows: 12.3.1. For x = sbX...sbX + sbWidth - 1, y = sbY...sbY + sbHeight - 1, ·predSamples[x + cbX][y + cbY] = Clip3(0,(2 BitDepth ) - 1,(predSamplesL0[x][y] + predSamplesL1[x][y] + offset5) >> shift5) however, shift5 is set equal to Max(3,15 - BitDepth), offset5 is set equal to (1 << (shift5 - 1)). 12.4. Otherwise (if sbDist is equal to or greater than sbDistTh), the following steps apply: 12.4.1. For x = sbX - 2...sbX + sbWidth + 1, y = sbY - 2...sbY + sbHeight + 1, the variables gradientHL0[x][y], gradientVL0[x][y], gradientHL1[x][y], and gradientVL1[x][y] are derived as follows: ·gradientHL0[x][y] = (predSamplesL0[x + 1][y] >> shift1) - (predSamplesL0[x - 1][y] >> shift1) ·gradientVL0[x][y] = (predSamplesL0[x][y + 1] >> shift1) - (predSamplesL0[x][y - 1] >> shift1) ·gradientHL1[x][y] = (predSamplesL1[x + 1][y] >> shift1) - (predSamplesL1[x - 1][y] >> shift1) ·gradientVL1[x][y] = (predSamplesL1[x][y + 1] >> shift1) - (predSamplesL1[x][y - 1] >> shift1) where shift1 is a predetermined value, for example, shift1 is set equal to 6. 12.4.2. For x = sbX - 2...sbX + sbWidth + 1, y = sbY - 2...sbY + sbHeight + 1, the variables tempH[x][y] and tempV[x][y] are derived as follows: ·tempH[x][y] = (gradientHL0[x][y] + gradientHL1[x][y]) >> shift3 ·tempV[x][y] = (gradientVL0[x][y] + gradientVL1[x][y]) >> shift3 where shift3 is a predetermined value, for example, shift3 is set equal to 1. 12.4.3. For each pixel in (piX,piY), piX = sbX...sbX + sbWidth - 1, piY = sbY...sbY + sbHeight - 1, and the following steps are applied: 12.4.3.1. The variables sGx2, sGy2, sGxGy, sGxdI, and sGydI are derived as follows: sGx2 = Σ i Σ j Abs(tempH[piX + i][piY + j]) sGy2 = Σ i Σ j Abs(tempV[piX + i][piY + j]) sGxGy = Σ i Σ j (Sign(tempV[piX + i][piY + j]) * tempH[piX + i][piY + j]) sGxdI = Σ i Σ j (-Sign(tempH[piX + i][piY + j]) * diff[piX + i][piY + j]) sGydI = Σ i Σ j (-Sign(tempV[piX + i][piY + j]) * diff[piX + i][piY + j]) where i = -2...2 and j = -2...2. 12.4.3.2. The horizontal and vertical motion offsets of the current pixel are derived as follows: ·v x = sGx2 > 0 ? Clip3(-mvRefineThres + 1, mvRefineThres - 1, (sGxdI << 2) >> Floor(Log2(sGx2))) : 0 ·v y = sGy2 > 0 ? Clip3(-mvRefineThres + 1, mvRefineThres - 1, ((sGydI << 2) - ((v x * sGxGy) >> 1)) >> Floor(Log2(sGy2))) : 0 where mvRefineThres is a predetermined value, for example, mvRefineThres is set equal to (1 << 4). 12.4.3.3. The prediction signal for the current pixel is derived as follows: bdofOffset = v x * (gradientHL0[piX][piY] - gradientHL1[piX][piY]) + v y * (gradientVL0[piX][piY] - gradientVL1[piX][piY]) ·predSamples[piX + cbW][piY + cbY] = Clip3(0,(2 BitDepth ) - 1,(predSamplesL0[xPix][yPix] + predSamplesL1[xPix][yPix] + bdofOffset + offset5) >> shift5) however, shift5 is set equal to Max(3,15 - BitDepth), offset5 is set equal to (1 << (shift5 - 1)). 12.5. Update the sub-block as top-left luma position as follows: ·sbX = (sbX + sbWidth) < W ? sbX + sbWidth : 0 ·sbY = (sbX + sbWidth) < W ? sbY : sbY + sbHeight 13. Using the derived prediction signal for each sub-block, derive a predicted block, and use the derived and predicted block for video decoding.
[0274] FIG. 15 is a flowchart illustrating an example method for decoding video data in accordance with techniques of this disclosure. The current block may comprise a current CU. Although described with respect to video decoder 300 (FIGS. 1 and 4), it should be understood that other devices may be configured to perform methods similar to that of FIG. 15. For example, prediction processing unit 304 and / or motion compensation unit 316 may be configured to perform the example technique of FIG. 15. Prediction processing unit 304 and / or motion compensation unit 316 may be coupled to a memory, such as DPB 314 or other memory of video decoder 300. In some examples, video decoder 300 may be coupled to memory 120, which stores information used by video decoder 300 to perform the example technique of FIG. 15.
[0275] The video decoder 300 may determine that bidirectional optical flow (BDOF) is enabled for a block of video data (1500). For example, the video decoder 300 may receive signaling indicating that BDOF is enabled for the block. In some examples, the video decoder 300 may infer (e.g., determine without receiving signaling) that BDOF is enabled for the block, such as based on some criteria being met.
[0276] The video decoder 300 may divide the block into multiple sub-blocks based on a determination that BDOF is enabled for the block (1502). For example, the video decoder 300 may divide the block into N sub-blocks. It is possible for the sub-blocks to have the same size, although in some cases, two or more of the sub-blocks may be of different sizes. The video decoder 300 may determine how to divide the block based on signaled information or by estimation.
[0277] The video decoder 300 may determine a respective distortion value for each of the one or more sub-blocks of the plurality of sub-blocks (1504). There may be various ways in which the video decoder 300 may determine the respective distortion values. As an example, the video decoder 300 may determine a distortion value for a first reference block (e.g., I (0) (i,j)) may be determined, and a second reference block (e.g., I (1) (i,j)). The video decoder 300 may determine I (0) (i,j) and I (1) The sum of absolute differences (SAD) between (i,j) may be calculated.
[0278] However, example techniques are not so limited. In some examples, video decoder 300 may perform alternative techniques for determining distortion values, as described above. For example, video decoder 300 may determine a first set of sample values in a first reference block for a first sub-block of one or more sub-blocks (e.g., I (0) The video decoder 300 may determine I(i,j) to generate the first set of scaled sample values. (0) (i,j) << shift2). The video decoder 300 may determine a second set of sample values in a second reference block for a first sub-block of the one or more sub-blocks (e.g., I (1) (i,j)). The video decoder 300 may scale the second set of sample values with the scale factor to generate a second set of scaled sample values (e.g., determine I (i,j) to generate the second set of scaled sample values). (1) (i,j) << shift2). In one or more examples, to determine a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks, video decoder 300 may be configured to, for a first sub-block, determine the distortion value of the respective distortion value based on the first set of scaled sample values and the second set of scaled sample values (e.g., determine the SAD based on the first set of scaled sample values and the second set of scaled sample values).
[0279] The video decoder 300 may determine, for each sub-block of one or more sub-blocks of the plurality of sub-blocks, whether to perform pixel-wise BDOF or bypass BDOF based on the respective distortion values (1506). For example, as described with respect to FIG. 13, there may be two options for the video decoder 300: either perform pixel-wise BDOF for the sub-block or bypass BDOF. In some examples, there may be no other options for the video decoder 300 when evaluating the sub-blocks.
[0280] In some examples, to determine whether to perform pixel-wise BDOF or to bypass BDOF, video encoder 200 and video decoder 300 may determine a threshold value. One exemplary method for determining the threshold value is sbDistTh = (sbWidth·sbHeight·s) << n. However, in examples in which an alternative technique for determining distortion values is utilized, video decoder 300 may determine the threshold value as sbDistTh = (sbWidth·sbHeight·s) << (n - shift2).
[0281] That is, video decoder 300 may multiply the width (e.g., sbWidth) of a first sub-block of the one or more sub-blocks, the height (e.g., sbHeight) of the first sub-block of the one or more sub-blocks, and a first scale factor (e.g., “s”) to generate an intermediate value. Video decoder 300 may perform a left-shift operation on the intermediate value based on the second scale factor (e.g., << (n − shift2), where (n − shift2) is the second scale factor) to generate the threshold value.
[0282] The video decoder 300 may compare the distortion value of each distortion value for the first sub-block to a threshold value. As shown in decision block 1306 of FIG. 13 , to determine, for each sub-block of one or more sub-blocks of the plurality of sub-blocks based on the respective distortion values, whether to perform pixel-by-pixel BDOF or bypass BDOF, the video decoder 300 may determine, for the first sub-block, whether to perform pixel-by-pixel BDOF or bypass BDOF based on the comparison.
[0283] The video decoder 300 may be configured to determine a prediction sample for each sub-block of the one or more sub-blocks based on a determination that per-pixel BDOF is performed or BDOF is bypassed (1508). As an example, to determine the prediction sample, the video decoder 300 may determine that per-pixel BDOF is performed for a first sub-block of the one or more sub-blocks. In this example, the video decoder 300 may determine a respective motion improvement for each sample in the first sub-block and, for each sample in the first sub-block, may determine a respective improved sample value from samples in the predictive block for the first sub-block based on the respective motion improvement.
[0284] For example, the video decoder 300 may BDOF (x,y) = (I (0) (x,y) + I (1) (x,y) + b'(x,y) + ο offset ) >> You can execute the shift5 operation. pred BDOF may represent the refined sample value. In this example, I (0) (x,y) + I (1) (x,y) may be considered as a prediction block. The values for b'(x,y) are the respective motion improvements (v' x ,v' y ) may be determined by the refined values of each sample (e.g., pred BDOF ) is based on the predicted block and the respective motion refinement.
[0285] Movement improvement (v' x ,v' y There may be various ways to determine θ(i,j) = (I (0) (i,j) >> shift2) - (I (1) In one or more examples, such as when an alternative technique for determining distortion values is used, the video decoder 300 may determine autocorrelations and cross-correlations, including (I (i,j) >> shift2), to determine the distortion value for the first sub-block. (0) (i,j) >> shift2) - (I (1) (i,j) >> shift2). In such an example, the video decoder 300 may have already determined the first set of scaled sample values (e.g., I (0) (i,j) >> shift2) and a second set of scaled sample values (e.g., I (1) (i,j) >> shift2) may be reused (e.g., the value for θ(i,j) is I (0) (i,j) >> shift2 and I (1) (i,j) >> shift2 can be determined without recalculating it.
[0286] The video decoder 300 may reconstruct the block based on the prediction samples (1510). For example, reconstructing the block based on the prediction samples may include the video decoder 300 receiving residual values indicating differences between the prediction samples and samples of the block, and adding the residual values to the prediction samples to reconstruct the block.
[0287] The above provides an example for each sub-block of a block. Below is an example where there are two sub-blocks and pixel-wise BDOF is performed for one sub-block and BDOF is bypassed for the other sub-block.
[0288] For example, for a first sub-block of the one or more sub-blocks, the video decoder 300 may determine a first one of the respective distortion values, and for a second sub-block of the one or more sub-blocks, the video decoder 300 may determine a second one of the respective distortion values.
[0289] For a first sub-block of the plurality of sub-blocks, video decoder 300 may determine that BDOF is enabled for the first sub-block based on the first distortion value (e.g., based on a comparison of the first distortion value with a threshold value). Based on the determination that BDOF is enabled for the first sub-block, video decoder 300 may determine per-pixel motion improvement to improve a first set of prediction samples for the first sub-block. For example, video decoder 300 may derive a first motion improvement to improve the first prediction sample for a first sample of the first sub-block, a second motion improvement to improve the second prediction sample for a second sample of the first sub-block, and so on.
[0290] For a second sub-block of the plurality of sub-blocks, video decoder 300 may determine that BDOF is bypassed based on the second distortion value (e.g., based on a comparison of the second distortion value with a threshold value). Based on the determination that BDOF is bypassed for the second block, video decoder 300 may bypass determining per-pixel motion improvement to improve a second set of prediction samples for the second sub-block. For example, video decoder 300 may bypass derivation of a first motion improvement to improve the first prediction sample for a first sample of the first sub-block, and may bypass derivation of a second motion improvement to improve the second prediction sample for a second sample of the first sub-block, and so on.
[0291] For the first sub-block, the video decoder 300 may determine an improved first set of prediction samples for the first sub-block based on the per-pixel motion improvement for the first sub-block (e.g., using example techniques described in this disclosure to determine the pred BDOF For the second sub-block, video decoder 300 may determine the second set of predictive samples without improving the second set of predictive samples based on per-pixel motion refinement to improve the second set of predictive samples. That is, for the second sub-block, BDOF is bypassed. Video decoder 300 may determine the predictive samples for the second sub-block based on various techniques, such as determining the predictive block based on a weighted average of reference blocks.
[0292] FIG. 16 is a flowchart illustrating an example method for encoding video data in accordance with techniques of this disclosure. The current block may comprise a current CU. Although described with respect to video encoder 200 (FIGS. 1 and 3), it should be understood that other devices may be configured to perform methods similar to that of FIG. 16. For example, motion selection unit 202 and / or motion compensation unit 224 may be configured to perform the example technique of FIG. 16. Motion selection unit 202 and / or motion compensation unit 224 may be coupled to a memory, such as DPB 218 or other memory of video encoder 200. In some examples, video encoder 200 may be coupled to memory 106, which stores information used by video encoder 200 to perform the example technique of FIG. 16. In general, video encoder 200 may perform the same operations as video decoder 300 to generate predictive samples.
[0293] Video encoder 200 may determine that bidirectional optical flow (BDOF) is enabled for a block of video data (1600). For example, video encoder 200 may determine rate-distortion costs associated with different coding modes and may determine that BDOF is enabled for the block based on the rate-distortion costs.
[0294] When BDOF is enabled for a block, video encoder 200 may divide the block into multiple sub-blocks (1602). Video encoder 200 may determine a respective distortion value for each sub-block of one or more of the multiple sub-blocks (1604). Video encoder 200 may perform the same techniques as described by video decoder 300 for determining the respective distortion values.
[0295] Video encoder 200 may determine, for each sub-block of one or more sub-blocks of the plurality of sub-blocks, whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion values (1606). For example, because video encoder 200 may not signal information indicating whether per-pixel BDOF is performed or BDOF is bypassed, video encoder 200 may perform the same operation as video decoder 300 to determine, for each sub-block, whether per-pixel BDOF is performed or BDOF is bypassed.
[0296] Video encoder 200 may determine a predictive sample for each sub-block of the one or more sub-blocks based on a determination that per-pixel BDOF is performed or BDOF is bypassed (1608). Video encoder 200 may signal a residual value between the predictive sample and a sample of the block (e.g., each sub-block) (1610).
[0297] The following describes some exemplary techniques that can be applied together or separately.
[0298] Clause 1. A method for decoding video data, the method comprising: determining that bidirectional optical flow (BDOF) is enabled for a block of the video data; dividing the block into a plurality of sub-blocks based on a determination that BDOF is enabled for the block; determining a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks; determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, one of performing pixel-wise BDOF or bypassing BDOF based on the respective distortion value; determining a predicted sample for each sub-block of the one or more sub-blocks based on a determination that pixel-wise BDOF is performed or bypassing BDOF; and reconstructing the block based on the predicted sample.
[0299] Clause 2. The method of clause 1, wherein determining a respective distortion value for each subblock of one or more subblocks of the plurality of subblocks comprises determining a first one of the respective distortion values for a first subblock of the one or more subblocks and determining a second one of the respective distortion values for a second subblock of the one or more subblocks; and determining, for each subblock of the one or more subblocks of the plurality of subblocks, one of performing pixel-by-pixel BDOF or bypassing BDOF based on the respective distortion value, comprising: determining, for a first subblock of the plurality of subblocks, that BDOF is enabled for the first subblock based on the first distortion value; and performing pixel-by-pixel BDOF to refine a first set of prediction samples for the first subblock based on a determination that BDOF is enabled for the first subblock. determining a per-pixel motion improvement for a second sub-block of the plurality of sub-blocks based on the second distortion value; determining, for a second sub-block of the plurality of sub-blocks, that BDOF is bypassed based on the second distortion value; and bypassing determining per-pixel motion improvement to improve a second set of prediction samples for the second sub-block based on a determination that BDOF is bypassed for the second sub-block, wherein determining prediction samples for each sub-block of the one or more sub-blocks based on a determination that per-pixel BDOF is performed or BDOF is bypassed comprises, for a first sub-block, determining an improved first set of prediction samples for the first sub-block based on the per-pixel motion improvement for the first sub-block; and, for a second sub-block, determining a second set of prediction samples without improving the second set of prediction samples based on the per-pixel motion improvement to improve the second set of prediction samples.
[0300] Clause 3. Any of the methods of clauses 1 and 2, wherein determining, for each subblock of one or more subblocks of the plurality of subblocks, one of performing per-pixel BDOF or bypassing BDOF based on the respective distortion values comprises determining to perform per-pixel BDOF for a first subblock of the one or more subblocks, the method further comprising determining a respective motion improvement for each sample in the first subblock, and determining a predicted sample for each subblock of the one or more subblocks based on the determination to perform per-pixel BDOF or bypass BDOF comprises determining, for each sample in the first subblock, a respective improved sample value from a sample in a predicted block for the first subblock based on the respective motion improvement.
[0301] Clause 4. The method of any of clauses 1 to 3, further comprising: multiplying a width of a first sub-block of the one or more sub-blocks, a height of the first sub-block of the one or more sub-blocks, and a first scale factor to generate an intermediate value; performing a left-shift operation on the intermediate value based on the second scale factor to generate a threshold value; and comparing the distortion value of each distortion value for the first sub-block to the threshold value; and determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks based on the respective distortion values, whether to perform per-pixel BDOF or bypass BDOF comprises determining, for the first sub-block based on the comparison, whether to perform per-pixel BDOF or bypass BDOF.
[0302] Clause 5. The method of any of clauses 1-4, further comprising: determining a first set of sample values in a first reference block for a first sub-block of the one or more sub-blocks; scaling the first set of sample values with a scale factor to generate the first set of scaled sample values; determining a second set of sample values in a second reference block for the first sub-block of the one or more sub-blocks; and scaling the second set of sample values with the scale factor to generate the second set of scaled sample values; and determining a respective distortion value for each sub-block of the one or more sub-blocks of the plurality of sub-blocks comprises determining, for the first sub-block, a distortion value for the respective distortion value based on the first set of scaled sample values and the second set of scaled sample values.
[0303] Clause 6. The method of clause 5, wherein determining, for each subblock of one or more subblocks of the plurality of subblocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion values, comprises determining that per-pixel BDOF is performed for a first subblock, and the method further comprises reusing the first set of scaled sample values and the second set of scaled sample values to determine a per-pixel motion improvement for the per-pixel BDOF.
[0304] Clause 7. The method of clause 5, wherein determining, for each subblock of one or more subblocks of the plurality of subblocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion values, comprises determining that per-pixel BDOF is performed for a first subblock, and the method further comprises reusing the first set of scaled sample values and the second set of scaled sample values to determine a motion improvement for the BDOF.
[0305] Clause 8. The method of any of clauses 1 to 7, wherein reconstructing the block comprises receiving residual values indicative of differences between the predicted samples and samples of the block, and adding the residual values to the predicted samples to reconstruct the block.
[0306] Clause 9. A device for decoding video data, the device comprising: a memory configured to store the video data; and processing circuitry coupled to the memory; the processing circuitry configured to: determine that bidirectional optical flow (BDOF) is enabled for a block of the video data; divide the block into a plurality of sub-blocks based on a determination that BDOF is enabled for the block; determine a respective distortion value for each sub-block of one or more of the plurality of sub-blocks; determine one of whether pixel-wise BDOF is performed or BDOF is bypassed for each sub-block of the one or more sub-blocks based on the respective distortion value; determine a predicted sample for each sub-block of the one or more sub-blocks based on the determination that pixel-wise BDOF is performed or BDOF is bypassed; and reconstruct the block based on the predicted sample.
[0307] Clause 10. The device of Clause 9, wherein, to determine a respective distortion value for each subblock of one or more subblocks of the plurality of subblocks, the processing circuitry is configured to determine, for a first subblock of the one or more subblocks, a first one of the respective distortion values and to determine, for a second subblock of the one or more subblocks, one of performing pixel-by-pixel BDOF or bypassing BDOF based on the respective distortion value for each subblock of the one or more subblocks of the plurality of subblocks, the processing circuitry determines, for a first subblock of the plurality of subblocks, based on the first distortion value that BDOF is enabled for the first subblock, and refines a first set of predicted samples for the first subblock based on a determination that BDOF is enabled for the first subblock. the processing circuitry is configured to: determine a per-pixel motion improvement for improving a second set of prediction samples for a second sub-block of the plurality of sub-blocks based on the second distortion value; determine, for a second sub-block of the plurality of sub-blocks, that BDOF is bypassed based on the second distortion value; and, based on a determination that BDOF is bypassed for the second sub-block, bypass determining the per-pixel motion improvement for improving the second set of prediction samples for the second sub-block; and to determine prediction samples for each sub-block of the one or more sub-blocks based on a determination that per-pixel BDOF is performed or BDOF is bypassed, the processing circuitry is configured to: determine, for a first sub-block, an improved first set of prediction samples for the first sub-block based on the per-pixel motion improvement for the first sub-block; and determine, for a second sub-block, the second set of prediction samples without improving the second set of prediction samples based on the per-pixel motion improvement for improving the second set of prediction samples.
[0308] Clause 11. The device of any of clauses 9 and 10, wherein, for determining, for each subblock of one or more subblocks of the plurality of subblocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on a respective distortion value, the processing circuitry is configured to determine for a first subblock of the one or more subblocks that per-pixel BDOF is performed, the processing circuitry is further configured to determine a respective motion improvement for each sample in the first subblock, and, for determining a predicted sample for each subblock of the one or more subblocks based on the determination that per-pixel BDOF is performed or BDOF is bypassed, the processing circuitry is configured to determine, for each sample in the first subblock, a respective improved sample value from a sample in a predicted block for the first subblock based on the respective motion improvement.
[0309] Clause 12. The device of any of clauses 9 to 11, wherein the processing circuitry is configured to multiply a width of a first sub-block of the one or more sub-blocks, a height of the first sub-block of the one or more sub-blocks, and a first scale factor to generate an intermediate value; perform a left-shift operation on the intermediate value based on the second scale factor to generate a threshold value; compare the distortion value of each distortion value for the first sub-block to the threshold value; and determine, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion value, wherein the processing circuitry is configured to determine, for the first sub-block, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the comparison.
[0310] Clause 13. The device of any of clauses 9-12, wherein the processing circuitry is configured to: determine a first set of sample values in a first reference block for a first sub-block of the one or more sub-blocks and scale the first set of sample values with a scale factor to generate the first set of scaled sample values; determine a second set of sample values in a second reference block for the first sub-block of the one or more sub-blocks and scale the second set of sample values with the scale factor to generate the second set of scaled sample values; and to determine a respective distortion value for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, the processing circuitry is configured to determine, for the first sub-block, a distortion value for the respective distortion value based on the first set of scaled sample values and the second set of scaled sample values.
[0311] Clause 14. The device of clause 13, wherein to determine, for each subblock of one or more subblocks of the plurality of subblocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion values, the processing circuitry is configured to determine that per-pixel BDOF is performed for a first subblock, and the processing circuitry is configured to reuse the first set of scaled sample values and the second set of scaled sample values to determine a per-pixel motion improvement for the per-pixel BDOF.
[0312] Clause 15. The device of clause 13, wherein to determine, for each sub-block of one or more sub-blocks of the plurality of sub-blocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion values, the processing circuitry is configured to determine that per-pixel BDOF is performed for a first sub-block, and the processing circuitry is configured to reuse the first set of scaled sample values and the second set of scaled sample values to determine a motion improvement for the BDOF.
[0313] Clause 16. The device of any of clauses 9 to 15, wherein, to reconstruct the block, the processing circuitry is configured to receive residual values indicative of differences between the predicted samples and the samples of the block, and to add the residual values to the predicted samples to reconstruct the block.
[0314] Clause 17. The device of any of clauses 9 to 16, further comprising a display configured to display the decoded video data.
[0315] Clause 18. The device of clauses 9-17, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0316] Clause 19. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to determine that bidirectional optical flow (BDOF) is enabled for a block of video data, divide the block into a plurality of sub-blocks based on a determination that BDOF is enabled for the block, determine a respective distortion value for each sub-block of one or more of the plurality of sub-blocks, determine one of whether per-pixel BDOF is performed or BDOF is bypassed for each sub-block of the one or more sub-blocks based on the respective distortion value, determine a predicted sample for each sub-block of the one or more sub-blocks based on the determination that per-pixel BDOF is performed or BDOF is bypassed, and reconstruct the block based on the predicted sample.
[0317] Clause 20. The computer-readable storage medium of Clause 19, comprising instructions for causing one or more processors to determine a respective distortion value for each subblock of one or more subblocks of the plurality of subblocks, the instructions causing the one or more processors to determine, for a first subblock of the one or more subblocks, a first one of the respective distortion values and for a second subblock of the one or more subblocks, a second one of the respective distortion values; and for each subblock of the one or more subblocks of the plurality of subblocks, determining one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion value, the instructions causing the one or more processors to determine, for a first subblock of the plurality of subblocks, based on the first distortion value that BDOF is enabled for the first subblock, and determining, for the first subblock, based on the determination that BDOF is enabled for the first subblock. The method comprises instructions to: determine a per-pixel motion improvement to improve a first set of prediction samples; determine, for a second sub-block of the plurality of sub-blocks, that BDOF is bypassed based on a second distortion value; and, based on a determination that BDOF is bypassed for the second sub-block, bypass determining per-pixel motion improvement to improve the second set of prediction samples for the second sub-block; and cause the one or more processors to determine prediction samples for each sub-block of the one or more sub-blocks based on a determination that per-pixel BDOF is performed or BDOF is bypassed; the instructions comprise instructions to cause the one or more processors to, for a first sub-block, determine an improved first set of prediction samples for the first sub-block based on the per-pixel motion improvement for the first sub-block; and, for a second sub-block, determine a second set of prediction samples without improving the second set of prediction samples based on the per-pixel motion improvement to improve the second set of prediction samples.
[0318] Clause 21. The computer-readable storage medium of any of Clauses 19 and 20, comprising instructions for causing one or more processors to determine, for each subblock of one or more subblocks of a plurality of subblocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on a respective distortion value, the instructions comprising: instructions for causing the one or more processors to determine that per-pixel BDOF is performed for a first subblock of the one or more subblocks, the instructions further comprising: instructions for causing the one or more processors to determine a respective motion improvement for each sample in the first subblock, the instructions for causing the one or more processors to determine a predicted sample for each subblock of the one or more subblocks based on the determination that per-pixel BDOF is performed or BDOF is bypassed, the instructions comprising: instructions for causing the one or more processors to determine, for each sample in the first subblock, a respective improved sample value from a sample in a predicted block for the first subblock based on the respective motion improvement.
[0319] Clause 22. The computer-readable storage medium of Clauses 19-21, further comprising instructions to cause one or more processors to multiply a width of a first subblock of the one or more subblocks, a height of the first subblock of the one or more subblocks, and a first scale factor to generate an intermediate value, perform a left-shift operation on the intermediate value based on a second scale factor to generate a threshold value, and compare the distortion value of each distortion value for the first subblock to the threshold value; and determine, for each subblock of the one or more subblocks of the plurality of subblocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion values; the instructions also include instructions that cause the one or more processors to determine, for the first subblock, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the comparison.
[0320] Clause 23. The computer-readable storage medium of any of Clauses 19 to 22, further comprising instructions to cause one or more processors to determine a first set of sample values in a first reference block for a first sub-block of the one or more sub-blocks, scale the first set of sample values using a scale factor to generate a first set of scaled sample values, determine a second set of sample values in a second reference block for the first sub-block of the one or more sub-blocks, and scale the second set of sample values using the scale factor to generate a second set of scaled sample values; and determine a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks, the instructions causing the one or more processors to determine, for the first sub-block, a distortion value for each distortion value based on the first set of scaled sample values and the second set of scaled sample values.
[0321] Clause 24. A device for decoding video data, the device comprising: means for determining that bidirectional optical flow (BDOF) is enabled for a block of the video data; means for dividing the block into a plurality of sub-blocks based on a determination that BDOF is enabled for the block; means for determining a respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks; means for determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, one of whether per-pixel BDOF is performed or BDOF is bypassed based on the respective distortion value; means for determining a predicted sample for each sub-block of the one or more sub-blocks based on the determination that per-pixel BDOF is performed or BDOF is bypassed; and means for reconstructing the block based on the predicted sample.
[0322] Clause 25. A method for coding video data, the method comprising: dividing an input block into a plurality of sub-blocks, wherein a size of the input block is smaller than or equal to a size of a coding unit; determining, based on satisfied conditions, that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks; dividing the sub-block into a plurality of sub-sub-blocks; determining an improved motion vector for one or more of the sub-sub-blocks, wherein the improved motion vector for a sub-sub-block of the one or more sub-sub-blocks is the same for a plurality of samples in the sub-sub-block; and performing BDOF on the sub-block based on the improved motion vector for the one or more sub-sub-blocks.
[0323] Clause 26. A method for coding video data, the method comprising: dividing an input block into a plurality of sub-blocks, determining based on satisfied conditions that a size of the input block is less than or equal to a size of a coding unit and that bidirectional optical flow (BDOF) will be applied to a sub-block of the plurality of sub-blocks; dividing the sub-block into a plurality of sub-sub-blocks; determining an improved motion vector for each of one or more samples in the sub-block; and performing BDOF on the sub-block based on the improved motion vector for each of the one or more samples in the sub-block.
[0324] Clause 27. The method of any of clauses 25 and 26, further comprising bypassing BDOF for other sub-blocks of the plurality of sub-blocks.
[0325] Clause 28. The method of any of clauses 25 to 27, wherein the condition being satisfied includes determining whether a sum of absolute differences (SAD) between two prediction signals in reference picture 0 and reference picture 1 is less than a threshold.
[0326] Clause 29. The method of any of clauses 25 to 28, wherein the input block size is thW × thH, and thW and thH are based on one or more of fixed, predetermined values, values decoded from the bitstream, or the block size used before BDOF when encoding or decoding the coding unit.
[0327] Clause 30. A method for coding video data, the method comprising any one of clauses 25 to 29 or a combination thereof.
[0328] Clause 31. The method of any of clauses 25-30, wherein performing BDOF comprises performing BDOF as part of decoding the video data.
[0329] Clause 32. The method of any of clauses 25 to 31, wherein performing BDOF comprises performing BDOF as part of encoding the video data, including within a reconstruction loop of the encoding.
[0330] Clause 33. A device for coding video data, the device comprising: a memory for storing the video data; and processing circuitry coupled to the memory, the processing circuitry configured to perform any one or a combination of clauses 25 to 32.
[0331] Clause 34. A device for coding video data, the device comprising one or more means for performing the methods of any of clauses 25 to 32.
[0332] Clause 35. The device of any of clauses 33 and 34, further comprising a display configured to display the decoded video data.
[0333] Clause 36. The device of any of clauses 33 to 35, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0334] Clause 37. The device of any of clauses 33 to 36, wherein the processing circuitry or means for performing comprises a video decoder.
[0335] Clause 38. The device of any of clauses 33 to 37, wherein the processing circuitry or means for performing comprises a video encoder.
[0336] Clause 39. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to perform the method of any of clauses 25 to 32.
[0337] It should be appreciated that, depending on the example, some acts or events of any of the techniques described herein may be performed in a different sequence, may be added, combined, or may be omitted entirely (e.g., not all described acts or events may be necessary to practice the techniques). Moreover, in some examples, acts or events may be performed in parallel rather than sequentially, for example, through multithreaded processing, interrupt processing, or multiple processors.
[0338] In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or code and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which correspond to tangible media such as data storage media, or communication media, including any medium that facilitates transfer of a computer program from one place to another, for example, according to a communication protocol. In this manner, computer-readable media may generally correspond to (1) tangible computer-readable storage media that are non-transitory, or (2) communication media such as a signal or carrier wave. Data storage media may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures for implementing the techniques described in this disclosure. A computer program product may include computer-readable media.
[0339] By way of example, and not limitation, such computer-readable storage media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included within the definition of medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but instead cover non-transitory tangible storage media. As used herein, disk and disc include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically and discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0340] The instructions may be executed by one or more processors, such as one or more DSPs, general-purpose microprocessors, ASICs, FPGAs, or other equivalent integrated or discrete logic circuitry. Accordingly, the terms "processor" and "processing circuitry," as used herein, may refer to any of the above structures or any other structure suitable for implementing the techniques described herein. Additionally, in some aspects, the functionality described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or may be incorporated into a combined codec. Also, the techniques may be implemented entirely within one or more circuits or logic elements.
[0341] The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this disclosure to highlight functional aspects of devices configured to perform the disclosed techniques, but they do not necessarily require realization by different hardware units. Rather, as described above, the various units may be combined in a codec hardware unit or may be provided by a collection of interoperable hardware units, including one or more processors as described above, in conjunction with suitable software and / or firmware.
[0342] Various examples are described. These and other examples are within the scope of the following claims. [Explanation of symbols]
[0343] 100 Video Encoding and Decoding System 102 Source Devices 104 Video Sources 106 memory 108 Output Interface 110 Computer-Readable Medium 112 Storage Devices 114 File Server 116 Destination Device 118 Display Devices 120 memory 122 input interface 130 Quadruple-Triple-Binary Tree (QTBT) Structure 132 Coding Tree Unit (CTU) 200 Video Encoder 202 Mode Selection Unit 204 Residual Generation Unit 206 Conversion Processing Unit 208 quantization units 210 Inverse Quantization Unit 212 Inverse Transformation Processing Unit 214 Reconstruction Unit 216 Filter Unit 218 Decoded Picture Buffer (DPB) 220 Entropy Coding Unit 222 Motion Estimation Unit 224 Motion Compensation Unit 226 intra prediction units 230 video data memory 300 Video Decoder 302 Entropy Decoding Unit 304 Prediction Processing Unit 306 Inverse Quantization Unit 308 Inverse Transformation Processing Unit 310 Reconstruction Unit 312 Filter Unit 314 Decoded Picture Buffer (DPB) 316 Motion Compensation Unit 318 Intra Prediction Units 320 Coded Picture Buffer (CPB) memory Blocks 602 and 604 700 current frames 702 Reference Frame 1000 Square Search Pattern Blocks 1100 and 1102
Claims
1. 1. A method for decoding video data, comprising: determining that block-level bidirectional optical flow (BDOF) is enabled for the block of video data; dividing the block into a plurality of sub-blocks based on the determination that block-level BDOF is enabled for the block; determining a respective distortion value for each sub-block of one or more of the plurality of sub-blocks; determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, between applying per-pixel BDOF and bypassing BDOF based on the respective distortion value, wherein the process of applying per-pixel BDOF based on the determination to apply per-pixel BDOF to a sub-block of the one or more sub-blocks includes applying a first motion improvement vector to a first pixel in the sub-block and applying a second motion improvement vector to a second pixel in the sub-block, wherein the first motion improvement vector and the second motion improvement vector are different; determining a prediction sample for each sub-block of the one or more sub-blocks based on the decision between applying per-pixel BDOF and bypassing BDOF; reconstructing the block based on the predicted samples; A method for providing the above.
2. 1. A device for decoding video data, comprising: a memory configured to store the video data; processing circuitry coupled to said memory; wherein the processing circuitry comprises: determining that block-level bidirectional optical flow (BDOF) is enabled for the block of video data; Dividing the block into a plurality of sub-blocks based on the determination that block-level BDOF is enabled for the block; determining a respective distortion value for each sub-block of one or more of the plurality of sub-blocks; determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, between applying a per-pixel BDOF and bypassing BDOF based on the respective distortion value, wherein the process of applying a per-pixel BDOF to a sub-block of the one or more sub-blocks based on the determination includes applying a first motion improvement vector to a first pixel in the sub-block and applying a second motion improvement vector to a second pixel in the sub-block, wherein the first motion improvement vector and the second motion improvement vector are different; determining a prediction sample for each sub-block of the one or more sub-blocks based on the decision between applying per-pixel BDOF and bypassing BDOF; reconstructing the block based on the predicted samples; A device configured to:
3. determining a respective distortion value for each sub-block of one or more of the plurality of sub-blocks; determining a first one of the respective distortion values for a first sub-block of the one or more sub-blocks; determining a second one of the respective distortion values for a second one of the one or more sub-blocks; Equipped with for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, deciding between applying per-pixel BDOF and bypassing BDOF based on the respective distortion value; determining, for the first sub-block of the plurality of sub-blocks, based on the first distortion value, that a pixel-wise BDOF be applied to the first sub-block; determining a per-pixel motion improvement to improve a first set of prediction samples for the first sub-block based on the determination that per-pixel BDOF is applied to the first sub-block; determining, based on the second distortion value, that BDOF is bypassed for the second sub-block of the plurality of sub-blocks; based on the determination that BDOF is bypassed for the second sub-block, bypassing determining a per-pixel motion improvement for improving a second set of prediction samples for the second sub-block; Equipped with determining the predicted sample for each sub-block of the one or more sub-blocks based on the decision between applying per-pixel BDOF and bypassing BDOF, for the first sub-block, determining the improved first set of prediction samples for the first sub-block based on the per-pixel motion improvement for the first sub-block; determining, for the second sub-block, a second set of prediction samples without improving the second set of prediction samples based on the per-pixel motion improvement to improve the second set of prediction samples; The method of claim 1 , comprising:
4. The method of claim 3, wherein determining a respective distortion value for each of one or more of the plurality of sub-blocks comprises: determining a first one of the respective distortion values for a first sub-block of the one or more sub-blocks; determining a second one of the respective distortion values for a second one of the one or more sub-blocks; and Equipped with determining, for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, between applying a pixel-by-pixel BDOF and bypassing BDOF based on the respective distortion value; determining, for a first sub-block of the plurality of sub-blocks, based on the first distortion value, that a pixel-wise BDOF be applied to the first sub-block; determining a per-pixel motion improvement to improve a first set of prediction samples for the first sub-block based on the determination that per-pixel BDOF is applied to the first sub-block; and determining, based on the second distortion value, that a BDOF is bypassed for the second sub-block of the plurality of sub-blocks; bypassing determining a per-pixel motion improvement for improving a second set of prediction samples for the second sub-block based on the determination that BDOF is bypassed for the second sub-block; and Equipped with determining the predicted sample for each sub-block of the one or more sub-blocks based on the decision between applying per-pixel BDOF and bypassing BDOF; for the first sub-block, determining the improved first set of prediction samples for the first sub-block based on the per-pixel motion improvement for the first sub-block; determining, for the second sub-block, a second set of prediction samples without improving the second set of prediction samples based on the per-pixel motion improvement to improve the second set of prediction samples; The device of claim 2, comprising:
5. The method of claim 1, further comprising: multiplying a width of a first sub-block of the one or more sub-blocks, a height of the first sub-block of the one or more sub-blocks, and a first scale factor to generate an intermediate value; performing a left shift operation on the intermediate value based on a second scale factor to generate a threshold value; comparing a distortion value of the respective distortion values for the first sub-block with the threshold value; Furthermore, 2. The method of claim 1, wherein for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, deciding between applying a per-pixel BDOF and bypassing BDOF based on the respective distortion value comprises deciding between applying a per-pixel BDOF and bypassing BDOF for the first sub-block based on the comparison.
6. determining a first set of sample values in a first reference block for a first sub-block of the one or more sub-blocks; scaling the first set of sample values with a scale factor to generate a first set of scaled sample values; determining a second set of sample values in a second reference block for the first sub-block of the one or more sub-blocks; scaling the second set of sample values with the scale factor to generate a second set of scaled sample values; Furthermore, 2. The method of claim 1 , wherein determining the respective distortion value for each sub-block of one or more sub-blocks of the plurality of sub-blocks comprises: for the first sub-block, determining a distortion value of the respective distortion values based on the first set of scaled sample values and the second set of scaled sample values.
7. The method of claim 6, wherein for each sub-block of the one or more sub-blocks of the plurality of sub-blocks, determining between applying per-pixel BDOF and bypassing BDOF based on the respective distortion values comprises determining that per-pixel BDOF is to be applied to the first sub-block; 7. The method of claim 6, further comprising reusing the first set of scaled sample values and the second set of scaled sample values to determine a per-pixel motion refinement for a per-pixel BDOF.
8. the step of reconstructing the blocks comprises: receiving residual values indicative of differences between the predicted samples and samples of the block; adding the residual values to the prediction samples to reconstruct the block; The method of claim 1 , comprising:
9. The method of claim 8, wherein reconstructing the blocks comprises: receiving residual values indicative of differences between the predicted samples and samples of the block; adding the residual values to the prediction samples to reconstruct the block; The device of claim 2, comprising:
10. The device of claim 2 , further comprising a display configured to display the decoded video data.
11. The device of claim 2 comprising one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
12. 10. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors of a device for decoding video data to perform the method of claim 1 or claim 3 or any one of claims 5 to 8.
Citation Information
Patent Citations
Predictive image generation unit, moving image decoding device, and moving image encoding device
JP2020202454A
Motion-compensation prediction based on BI-directional optical flow
WO2019010156A1