Filtering applied to prediction in video coding
Template-based filtering of predicted blocks before reconstruction addresses blockiness artifacts and inefficiencies in video coding, improving video quality and efficiency by reducing residual data and signaling overhead.
Patent Information
- Application Number
- JP2025535365
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-04
- Filing Date
- 2024-01-05
- Publication Date
- 2026-01-16
AI Technical Summary
Existing video coding techniques suffer from visible blockiness artifacts and inefficiencies in bit usage due to lossy compression, which are not adequately addressed by post-reconstruction filtering methods like deblocking, SAO, and ALF.
Applying template-based filtering to predicted blocks before reconstruction, which reduces the need for signaling filter coefficients and improves the accuracy of predictions, thereby optimizing the rate-distortion trade-off.
This approach enhances video quality by reducing the amount of residual data required for transmission and minimizing signaling overhead, resulting in more efficient video encoding and decoding processes.
Smart Images

Figure 2026501536000001_ABST
Abstract
Description
[Technical Field]
[0001] This application claims priority to U.S. Patent Application No. 18 / 404,658, filed January 4, 2024, U.S. Provisional Patent Application No. 63 / 478,657, filed January 5, 2023, U.S. Provisional Patent Application No. 63 / 496,278, filed April 14, 2023, U.S. Provisional Patent Application No. 63 / 509,207, filed June 20, 2023, and U.S. Provisional Patent Application No. 63 / 511,134, filed June 29, 2023, the entire contents of each of which are incorporated herein by reference. U.S. Patent Application No. 18 / 404,658, filed January 4, 2024, claims the benefit of U.S. Provisional Patent Application No. 63 / 478,657, filed January 5, 2023, U.S. Provisional Patent Application No. 63 / 496,278, filed April 14, 2023, U.S. Provisional Patent Application No. 63 / 509,207, filed June 20, 2023, and U.S. Provisional Patent Application No. 63 / 511,134, filed June 29, 2023.
[0002] TECHNICAL FIELD This disclosure relates to video encoding and decoding. [Background technology]
[0003] Digital video capabilities can 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 wireless telephones, so-called "smartphones," video teleconferencing devices, video streaming devices, and the like. 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), ITU-T H.266 / Versatile Video Coding (VVC), and extensions to such standards, as well as proprietary video codecs / formats such as AOMedia Video 1 (AV1) developed by the Alliance for Open Media. 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. In block-based video coding, video slices (e.g., video pictures or portions of video pictures) may be partitioned into video blocks, which may also be referred to as coding tree units (CTUs), coding units (CUs), and / or coding nodes. Video blocks in intra-coded (I) slices of a picture are encoded using spatial prediction with respect to reference samples in neighboring blocks in the same picture. Video blocks in inter-coded (P or B) slices 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. Summary of the Invention
[0005] The techniques of this disclosure relate to prediction, including inter-prediction, intra-prediction, and intra-block copy (IBC) modes, and more particularly to techniques for using filtering to improve the quality of a predicted block. Unlike deblocking filtering, sample adaptive offset filtering, and adaptive loop filtering, which occur after reconstruction, the filtering techniques of this disclosure may be applied to a predicted block before reconstruction. By comparing a template of a reference block with a template of a current block, filtering a predicted block based on comparing the template of the reference block with the template of the current block, and determining a filtered predicted block, the techniques of this disclosure may produce more accurate predictions that may result in an improved rate-distortion trade-off. For example, by using the filtering techniques of this disclosure to produce a predicted block that more accurately matches the original block, the amount of bits required to transmit residual data may be reduced. Furthermore, because the filtering is template-based, there is no need to include filter coefficients in the bitstream, which can require significant bit overhead to signal.
[0006] This disclosure also describes techniques for configuring a video decoder to determine whether to apply filtering to a predictive block based on a coding scenario and signaling overhead. These signaling techniques may minimize signaling overhead by, for example, conditioning filtering on block size, slice type, or other such characteristics of the block.
[0007] According to one example of the present disclosure, a method of decoding video data includes determining a reference block for a current block of a current picture of the video data, the reference block being within the current picture; determining a predictive block based on the reference block; determining whether to apply filtering to the predictive block; comparing a template of the reference block with a template of the current block based on determining that filtering will be applied to the predictive block; filtering the predictive block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predictive block; decoding the current block based on the filtered predictive block to determine a decoded version of the current block; and outputting a decoded picture of the video data including the decoded version of the current block.
[0008] According to one example of the present disclosure, a device for decoding video data includes a memory configured to store the video data and one or more processors implemented in a circuit configuration, wherein the one or more processors are configured to: determine a reference block for a current block of a current picture of the video data, where the reference block is within the current picture; determine a predictive block based on the reference block; determine whether to apply filtering to the predictive block; based on determining that filtering will be applied to the predictive block, compare a template of the reference block with a template of the current block; filter the predictive block based on comparing the template of the reference block with the template of the current block to determine a filtered predictive block; decode the current block based on the filtered predictive block to determine a decoded version of the current block; and output a decoded picture of the video data including the decoded version of the current block.
[0009] A computer-readable storage medium stores instructions that, when executed by one or more processors, cause the one or more processors to determine a reference block for a current block of a current picture of the video data, where the reference block is within the current picture; determine a predictive block based on the reference block; determine whether to apply filtering to the predictive block; compare a template of the reference block with a template of the current block based on determining that filtering will be applied to the predictive block; filter the predictive block based on comparing the template of the reference block with the template of the current block to determine a filtered predictive block; decode the current block based on the filtered predictive block to determine a decoded version of the current block; and output a decoded picture of the video data including the decoded version of the current block.
[0010] 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]
[0011] [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] Indicates the reference area for intra-block copy (IBC) mode. [Figure 2B] Indicates the reference area for intra-block copy (IBC) mode. [Figure 2C] Indicates the reference area for intra-block copy (IBC) mode. [Figure 2D] Indicates the reference area for intra-block copy (IBC) mode. [Figure 3] 1 shows an example of a reference area for coding a coding tree unit. [Figure 4A]Examples of BV adjustment for left-right and up-down inversion are shown below. [Figure 4B] Examples of BV adjustment for left-right and up-down inversion are shown below. [Figure 5A] 10 illustrates an example of a template that may be used in conjunction with the techniques of this disclosure. [Figure 5B] 10 illustrates an example of a template that may be used in conjunction with the techniques of this disclosure. [Figure 6] FIG. 10 is a conceptual diagram showing the spatial portion of a filter. [Figure 7] FIG. 1 is a conceptual diagram illustrating intra-template matching prediction (TMP) filtering. [Figure 8] FIG. 1 is a conceptual diagram illustrating a reference template and a current template for an IBC-coded block, in accordance with techniques of this disclosure. [Figure 9] FIG. 1 is a conceptual diagram illustrating a reference template, a current template, and an evaluation template for an IBC-coded block in accordance with the techniques of this disclosure. [Figure 10] FIG. 2 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure. [Figure 11] FIG. 2 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure. [Figure 12] 10 is a flowchart illustrating an example process for encoding a current block, in accordance with techniques of this disclosure. [Figure 13] 10 is a flowchart illustrating an example process for decoding a current block in accordance with techniques of this disclosure. [Figure 14] 10 is a flowchart illustrating an example process for decoding a current block in accordance with techniques of this disclosure. DETAILED DESCRIPTION OF THE INVENTION
[0012] Video coding (e.g., video encoding and / or video decoding) typically involves predicting blocks of video data from already coded blocks of video data either within the same picture (e.g., intra prediction or intra block copy (IBC)) or from already coded blocks of video data in a different picture (e.g., inter prediction). In some instances, a video encoder also calculates residual data by comparing the predicted block to the original block. The residual data thus represents the difference between the predicted block and the original block. To reduce the number of bits required to signal the residual data, the video encoder transforms and quantizes the residual data and signals the transformed and quantized residual data in an encoded bitstream. The compression achieved by the transform and quantization process may be lossy, meaning that the transform and quantization process may introduce distortion into the decoded video data.
[0013] A video decoder decodes the residual data and adds it to the predictive block to create a reconstructed video block that more closely matches the original video block than the predictive block alone. Due to losses introduced by transforming and quantizing the residual data, the initial reconstructed block may have distortions or artifacts. One common type of artifact or distortion is called blockiness, where the boundaries of the blocks used to code the video data are visible.
[0014] To further improve the quality of the decoded video, the video decoder may perform one or more filtering operations on the reconstructed video blocks. Examples of these filtering operations include deblocking filtering, sample adaptive offset (SAO) filtering, and adaptive loop filtering (ALF). Parameters for these filtering operations may either be determined by the video encoder and explicitly signaled in the coded video bitstream, or may be implicitly determined by the video decoder without the parameters having to be explicitly signaled in the coded video bitstream.
[0015] The techniques of this disclosure relate to prediction, including inter-prediction, intra-prediction, and intra-block copy (IBC) modes, and more particularly to techniques for using filtering to improve the quality of a predicted block. Unlike the above-mentioned deblocking filtering, SAO filtering, and ALF filtering, which are performed after reconstruction, this filtering may be applied to a predicted block before reconstruction. By comparing a template of a reference block with a template of a current block, filtering a predicted block based on comparing the template of the reference block with the template of the current block, and determining the filtered predicted block, the techniques of this disclosure may produce more accurate predictions that may result in an improved rate-distortion tradeoff. For example, by using the filtering of this disclosure to produce a predicted block that more accurately matches the original block, the amount of bits required to send residual data may be reduced. Furthermore, because the filtering is template-based, there is no need to include filter coefficients in the bitstream, which can require significant bit overhead to signal.
[0016] This disclosure also describes techniques for configuring a video decoder to determine whether to apply filtering to a predictive block based on a coding scenario and signaling overhead. These signaling techniques may minimize signaling overhead by, for example, conditioning filtering on block size, slice type, or other such characteristics of the block.
[0017] 1 is a block diagram illustrating an example video encoding and decoding system 100 that may perform 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.
[0018] 1 , in this example, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, source device 102 provides the video data to destination device 116 via a computer-readable medium 110. Source device 102 and destination device 116 may be or include any of a wide range of devices, such as a desktop computer, a notebook (i.e., laptop) computer, a mobile device, a tablet computer, a set-top box, a telephone handset such as a smartphone, a television, a camera, a display device, a digital media player, a video gaming console, a video streaming device, a broadcast receiver device, etc. In some cases, source device 102 and destination device 116 may be capable of wireless communication and thus may be referred to as wireless communication devices.
[0019] In the example of FIG. 1 , source device 102 includes video source 104, memory 106, video encoder 200, and output interface 108. Destination device 116 includes input interface 122, video decoder 300, memory 120, and 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 intra block copy described herein. Thus, source device 102 represents an example of a video encoding device, while 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.
[0020] System 100 as shown in FIG. 1 is merely an example. In general, any digital video encoding and / or decoding device may perform the techniques for intra block copy described herein. Source device 102 and destination device 116 are merely examples of coding devices, such that source device 102 generates the coded video data that destination device 116 transmits to source device 102. This disclosure refers to devices that perform coding (encoding and / or decoding) of data as “coding” devices. 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 in a substantially symmetrical manner, such that source device 102 and destination device 116 each include video encoding and decoding components. Thus, system 100 may support unidirectional or bidirectional video transmission between source device 102 and destination device 116, e.g., for video streaming, video playback, video broadcasting, or video telephony.
[0021] 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 picture data. 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 that receives 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, pre-captured, 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”) into a coding order for coding. Video encoder 200 may generate a bitstream containing the encoded video data. Source device 102 may then output the encoded video data via output interface 108 to computer-readable medium 110, for receipt and / or retrieval by input interface 122 of destination device 116, for example.
[0022] 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, e.g., video encoder 200 and video decoder 300, respectively. 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, e.g., encoded video data output from video encoder 200 and input to video decoder 300. In some examples, a portion of the memory 106, 120 may be allocated as one or more video buffers, for example, to store raw decoded video data and / or encoded video data.
[0023] The computer-readable medium 110 may represent any type of medium or device capable of transferring 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 include any wireless or wired communication medium, such as the 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.
[0024] 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, Blu-ray Disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium that stores encoded video data.
[0025] In some examples, source device 102 may output encoded video data to file server 114 or another intermediate storage device that 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.
[0026] 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 (such as 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. The 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.
[0027] 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 to retrieve or receive media data from file server 114, or other such protocols to retrieve media data.
[0028] Output interface 108 and input interface 122 may represent a wireless transmitter / receiver, a modem, a wired network component (e.g., an Ethernet card), a wireless communication component 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 include wireless components, output interface 108 and input interface 122 may be configured to transfer data, such as encoded video data, according to a cellular communication standard, such as 4G, 4G-LTE (Long Term Evolution), LTE-Advanced, 5G, etc. In some examples in which output interface 108 includes 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 standard, the IEEE 802.15 standard (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, source device 102 may include an SoC device that performs functionality attributed to video encoder 200 and / or output interface 108, and destination device 116 may include an SoC device that performs functionality attributed to video decoder 300 and / or input interface 122.
[0029] 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 encoded on a data storage medium, decoding of digital video stored on a data storage medium, or other applications.
[0030] The input interface 122 of the destination device 116 receives an encoded video bitstream from a computer-readable medium 110 (e.g., a communications medium, a storage device 112, a file server 114, etc.). The encoded video bitstream may include signaling information defined by the video encoder 200 that is also used by the video decoder 300, such as syntax elements having values that describe 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.
[0031] Although not shown in FIG. 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 appropriate MUX-DEMUX units or other hardware and / or software to handle multiplexed streams containing both audio and video in a common data stream.
[0032] The video encoder 200 and the video decoder 300 may each be implemented as any of a variety of suitable encoder and / or decoder circuitry, 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, a device may store instructions for the software in 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. Each of the video encoder 200 and the video decoder 300 may be included in one or more encoders or decoders, any of which may be integrated as part of a combined encoder / decoder (CODEC) in the respective device. Devices including the video encoder 200 and / or the video decoder 300 may implement the video encoder 200 and / or the video decoder 300 in processing circuitry, such as an integrated circuit and / or a microprocessor. Such a device may be a wireless communication device, such as a cellular telephone, or any other type of device described herein.
[0033] The video encoder 200 and the 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 its extensions, such as multiview and / or scalable video coding extensions. Alternatively, the video encoder 200 and the video decoder 300 may operate according to other proprietary or industry standards, such as ITU-T H.266, also known as Generic Video Coding (VVC). In other examples, the video encoder 200 and the video decoder 300 may operate according to proprietary video codecs / formats, such as AOMedia Video 1 (AV1), extensions of AV1, and / or successors of AV1 (e.g., AV2). JVET has begun exploring techniques to further improve the coding performance of VVC. Test model reference software is also under development, and is described in J. Chen, Y. Ye, and S. Kim, "Algorithm description of Enhanced Compression Model 7 (ECM 7)," 28 th JVET Meeting, Mainz, DE, JVET-AB2025, October 2022. In other examples, video encoder 200 and video decoder 300 may operate according to other proprietary formats or industry standards. However, the techniques of this disclosure are not limited to any particular coding standard or format. In general, video encoder 200 and video decoder 300 may be configured to perform the techniques of this disclosure in conjunction with any video coding technique that uses intra block copying.
[0034] 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 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 picture samples, the video encoder 200 and the video decoder 300 may code luminance and chrominance components, which may include both red and blue chrominance components. In some examples, the video encoder 200 converts received RGB-format data to a YUV representation before encoding, and the video decoder 300 converts the YUV representation to RGB format. Alternatively, pre-processing and post-processing units (not shown) may perform these transformations.
[0035] This disclosure may generally refer to coding (e.g., encoding and decoding) a picture as including the process of encoding or decoding data for a picture. Similarly, this disclosure may refer to coding a block of a picture as including the process of encoding or decoding data for the block, e.g., predictive and / or residual coding. A coded video bitstream generally includes a series of values of 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 of the syntax elements that form the picture or block.
[0036] 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 of 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 the partitioning 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.
[0037] 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 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 CUs.
[0038] 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 down the middle. The partition types in MTT (e.g., QT, BT, and TT) may be symmetric or asymmetric.
[0039] When operating according to the AV1 codec, the video encoder 200 and the video decoder 300 may be configured to code video data in blocks. In AV1, the largest coding block that can be processed is called a superblock. In AV1, a superblock may be either 128x128 luma samples or 64x64 luma samples. However, in successor video coding formats (e.g., AV2), a superblock may be defined by a different (e.g., larger) luma sample size. In some examples, a superblock is the top level of a block quadtree. The video encoder 200 may further partition the superblock into smaller coding blocks. The video encoder 200 may partition the superblock and other coding blocks into smaller blocks using square or non-square partitioning. Non-square blocks may include N / 2xN, NxN / 2, N / 4xN, and NxN / 4 blocks. The video encoder 200 and the video decoder 300 may perform separate prediction and transform processes for each of the coding blocks.
[0040] AV1 also defines tiles of video data. A tile is a rectangular array of superblocks that can be coded independently of other tiles. That is, video encoder 200 and video decoder 300 may encode and decode coding blocks within a tile, respectively, without using video data from other tiles. However, video encoder 200 and video decoder 300 may perform filtering across tile boundaries. Tiles may be uniform or non-uniform in size. Tile-based coding may enable parallel processing and / or multithreading for encoder and decoder implementations.
[0041] 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, and 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).
[0042] Video encoder 200 and video decoder 300 may be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, superblock partitioning, or other partitioning structures.
[0043] In some examples, a CTU includes a coding tree block (CTB) of luma samples, two corresponding CTBs of chroma samples for a picture with three sample arrays, or a CTB of samples for a picture coded using three separate color planes and syntax structures used to code a monochrome picture or samples. A CTB can be an N×N block of samples for some value of N, partitioned to divide the components into CTBs. A component is a single sample from one array or 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 a single sample from an array or array that makes up a picture in monochrome format. In some examples, a coding block is an M×N block of samples for some values of M and N, partitioned to divide the CTB into coding blocks.
[0044] 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.
[0045] 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. Bricks within a picture may also be configured as 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 continuous sequence of complete bricks of one tile.
[0046] This disclosure may use "N x N" and "N by N" interchangeably to refer to the sample dimensions of a block (such as a CU or other video block) in the vertical and horizontal dimensions, e.g., 16 x 16 samples or 16 by 16 samples. 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 organized in rows and columns. Furthermore, 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 include N x M samples, where M is not necessarily equal to N.
[0047] Video encoder 200 encodes video data for a CU that represents prediction and / or residual information and 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 predictive block.
[0048] 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 a motion search to identify a reference block that closely matches the CU, for example, with respect to the difference between the CU and the reference block. Video encoder 200 may calculate a difference metric using a sum of absolute difference (SAD), a sum of squared differences (SSD), a mean absolute difference (MAD), a 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.
[0049] Some examples of VVC also provide an affine motion compensation mode, which may be considered an inter-prediction mode. In affine motion compensation mode, video encoder 200 may determine two or more motion vectors that represent non-translational motion, such as zooming in or out, rotation, perspective movement, or other irregular motion types.
[0050] To perform intra prediction, video encoder 200 may select an intra prediction mode to generate a predicted 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 for a current block (e.g., a block of a CU) and predicts samples of the current block therefrom. Assuming that video encoder 200 codes CTUs and CUs in raster scan order (left to right, top to bottom), 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.
[0051] Video encoder 200 encodes data representing a prediction mode for the current block. For example, in the case of an inter-prediction mode, 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, video encoder 200 may encode motion vectors using an advanced motion vector prediction (AMVP) mode or a merge mode. Video encoder 200 may use a similar mode to encode motion vectors for an affine motion compensation mode.
[0052] AV1 includes two general techniques for encoding and decoding coding blocks of video data. The two general techniques are intra-prediction (e.g., intra-frame prediction or spatial prediction) and inter-prediction (e.g., inter-frame prediction or temporal prediction). In the context of AV1, when predicting a block of a current frame of video data using an intra-prediction mode, the video encoder 200 and the video decoder 300 do not use video data from other frames of the video data. In most intra-prediction modes, the video encoder 200 encodes the block of the current frame based on the difference between sample values in the current block and predicted values generated from reference samples in the same frame. The video encoder 200 determines the predicted values generated from the reference samples based on the intra-prediction mode.
[0053] Following prediction, such as intra-prediction 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 prediction 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 produce transform data in a transform domain rather than a 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. In addition, 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 produces transform coefficients following application of the one or more transforms.
[0054] As described above, following any transformations that produce 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, 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.
[0055] Following quantization, the video encoder 200 may scan the transform coefficients, creating a one-dimensional vector from a two-dimensional matrix containing 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 predefined scan order to scan the quantized transform coefficients to create a serialized vector and then entropy code the quantized transform coefficients of the vector. In other examples, the video encoder 200 may perform adaptive scanning. After scanning the quantized transform coefficients to form the one-dimensional vector, the video encoder 200 may entropy code the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). The video encoder 200 may also entropy code values for syntax elements describing metadata associated with the encoded video data for use by the video decoder 300 in decoding the video data.
[0056] 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 the symbol's neighboring values are zeroed out. A probability determination may be based on the context assigned to the symbol.
[0057] Video encoder 200 may further generate syntax data, such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, for example, within a picture header, a block header, a slice header, or other syntax data, such as 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.
[0058] In this manner, video encoder 200 may generate a bitstream including syntax elements that describe coded video data, e.g., 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 decode the coded video data.
[0059] 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 substantially similar to, but reciprocal to, the CABAC encoding process of video encoder 200. The syntax elements may define 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 define the CUs of the CTU. The syntax elements may further define prediction information and residual information for blocks of video data (e.g., CUs).
[0060] The residual information may be represented, for example, by quantized transform coefficients. The video decoder 300 may dequantize and inverse transform the quantized transform coefficients of the block to reconstruct a residual block for the block. The video decoder 300 uses the signaled prediction mode (intra-prediction or inter-prediction) and associated prediction information (e.g., motion information for inter-prediction) to form a predictive block for the block. The video decoder 300 may then combine (sample by sample) the predictive block and the residual block 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.
[0061] This disclosure may generally refer to "signaling" some information, such as a syntax element. The term "signaling" may generally refer to the communication of a value for a syntax element and / or other data used to decode the encoded video data. That is, video encoder 200 may signal a value for a syntax element within a bitstream. Generally, signaling refers to generating a value within a bitstream. As mentioned above, source device 102 may forward the bitstream to destination device 116 in substantially real time or non-real time, which may occur, for example, when storing syntax elements in storage device 112 for later retrieval by destination device 116.
[0062] VVC includes an intra block copy (IBC) mode, which significantly improves the coding efficiency of screen content material. It is implemented as a block-level coding mode; therefore, block matching (BM) is performed in the encoder to find the optimal block vector (or motion vector) for each CU. Here, the block vector is used to indicate the displacement from the current block to a reference block already reconstructed inside the current picture. The luma block vectors of an IBC-coded CU are integer-precision. Chroma block vectors are also integer-precision. When combined with adaptive motion vector resolution (AMVR), IBC mode can switch the motion vector precision between 1 pixel and 4 pixels. IBC-coded CUs are treated as a third prediction mode, separate from intra or inter prediction modes. In VVC, IBC mode is used for CUs whose width and height are both 64 luma samples or less. Multi-transform selection (MTS) and low-frequency, non-separable transform (LFNST) are disabled for IBC coded blocks.
[0063] At the CU level, IBC mode is signaled using a flag and can be signaled as IBC AMVP mode or IBC skip / merge mode. In IBC skip / merge mode, a merge candidate index is used to indicate which block vector in a list of neighboring candidate IBC-coded blocks is used to predict the current block. The merge list includes spatial history-based motion vector prediction (HMVP) and pairwise candidates. In IBC AMVP mode, block vector differentials are coded in the same way as motion vector differentials. The block vector prediction process uses two candidates as predictors: one from the left neighbor and one from the upper neighbor (if IBC coded). When either neighbor is unavailable, a default block vector can be used as the predictor. A flag is signaled to indicate the block vector predictor index.
[0064] To reduce memory consumption and decoder complexity, the IBC mode in VVC only allows the reconstructed part of a predefined area that includes the area of the current CTU and some area of the left CTU.
[0065] 2A-2D show examples of reference regions in IBC mode, where each block represents a 64x64 luma sample unit. In the examples of FIGS. 2A-2D, current block 130 represents the block currently being coded. Block 132 represents an already coded block that is available for predicting block 130 using IBC. Block 134 represents an already coded block that is not available for predicting block 130. Block 136 represents an uncoded block that is not available for predicting block 130.
[0066] Depending on the location of the currently coded CU within the current CTU, different blocks may be available for IBC. As in Figure 2A, if the current block falls within the top-left 64x64 block of the current CTU, in addition to the already reconstructed samples within the current CTU, the current CTU may also be predicted using reference samples within the bottom-right 64x64 block of the left CTU using current picture referencing (CPR) mode. The current block may also be predicted using reference samples within the bottom-left 64x64 block of the left CTU and reference samples within the top-right 64x64 block of the left CTU using CPR mode.
[0067] 2B, if the current block falls in the top right 64x64 block of the current CTU, in addition to the already reconstructed samples in the current CTU, if the luma location (0,64) for the current CTU has not yet been reconstructed, the current block may also be predicted using reference samples in the bottom left 64x64 block and bottom right 64x64 block of the left CTU using CPR mode. Otherwise, the current block may be predicted using reference samples in the bottom right 64x64 block of the left CTU.
[0068] As in Figure 2C, if the current block falls within the bottom-left 64x64 block of the current CTU, and if the luma location (64,0) for the current CTU has not yet been reconstructed in addition to the already reconstructed samples within the current CTU, the current block may be predicted using the reference samples within the top-right 64x64 block and the bottom-right 64x64 block of the left CTU using CPR mode. Otherwise, the current block may be predicted using the reference samples within the bottom-right 64x64 block of the left CTU using CPR mode. As in Figure 2D, if the current block falls within the bottom-right 64x64 block of the current CTU, the current block may be predicted using only the already reconstructed samples within the current CTU using CPR mode.
[0069] There are several improvements to the IBC tools in the current ECM relative to VVC, primarily targeting improvements to screen content. For example, ECM includes IBC with template matching (TM-IBC). Template matching is used in IBC for both IBC merge mode and IBC AMVP mode.
[0070] The IBC-TM merge list is modified compared to that used by the regular IBC merge mode so that candidates are selected according to a pruning process using the motion distance between candidates as in the regular TM merge mode. The ending zero motion fill is replaced by motion vectors to the left (-W, 0), up (0, -H), and up-left (-W, -H), where W is the width of the current CU and H is the height of the current CU.
[0071] In IBC-TM merge mode, the selected candidate is refined in a template matching process before the rate-distortion optimization (RDO) or decoding process.
[0072] The IBC-TM merge mode conflicts with the regular IBC merge mode, and the TM merge flag is signaled.
[0073] In IBC-TM AMVP mode, up to three candidates are selected from the IBC-TM merge list. Each of these three selected candidates is refined using a template matching process and sorted according to the resulting template matching cost. In some instances, only the first two candidates after sorting are considered in the motion estimation process as usual.
[0074] In template matching refinement for both IBC-TM merge mode and AMVP mode, IBC motion vectors are constrained to (i) be integers and (ii) be within the reference region as shown in Figures 2A-2D. Thus, in IBC-TM merge mode, some or all refinement may be performed with integer precision, while in IBC-TM AMVP mode, refinement may be performed with either integer precision or 4-pixel precision depending on the AMVR value. Such refinement accesses only samples without interpolation. In either case, the motion vectors refined and the templates used at each refinement step must respect the reference region constraints.
[0075] The IBC in ECM includes an increased reference area compared to VVC. The reference area for the IBC is expanded to two CTU rows above. Figure 3 shows the reference area for coding CTU 140 located at (m,n). Specifically, when CTU 140 is coded, the reference area includes CTU 142 and has indices (m-2,n-2)...(W,n-2), (0,n-1)...(W,n-1), (0,n)...(m,n), where W indicates the maximum horizontal index within the current tile, slice, or picture. When the CTU size is 256, the reference area is limited to one CTU row above. This setting ensures that the IBC does not require extra memory in current ECM platforms when the CTU size is 128B or 256. The range of the block vector search (or local search) for each sample is limited to [-(C<<1),C>>2] horizontally and [-C,C>>2] vertically to accommodate the reference area expansion, where C represents the CTU size.
[0076] ECM also includes reconstruction reordered IBC (RR-IBC). RR-IBC mode is allowed for IBC coded blocks. When RR-IBC is applied, samples in the reconstructed block are inverted according to the inversion type of the current block. At the encoder side, the original block is inverted before motion search and residual calculation, and the predicted block is derived without inversion. At the decoder side, the reconstructed block is inverted back to restore the original block.
[0077] Two inversion processes, horizontal and vertical, are supported for RR-IBC coded blocks. For IBC AMVP coded blocks, a syntax flag indicating whether the reconstruction is inverted is signaled first, and if so, another flag specifying the inversion type is further signaled. In the case of IBC merging, the inversion type is inherited from the neighboring block without syntax signaling. Considering horizontal or vertical symmetry, the current block and the reference block are usually aligned horizontally or vertically. Therefore, when horizontal inversion is applied, the vertical component of BV is not signaled and is inferred to be equal to 0. Similarly, when vertical inversion is applied, the horizontal component of BV is not signaled and is inferred to be equal to 0.
[0078] To better exploit the symmetry, a flip-aware BV adjustment technique is applied to refine the block vector candidates. Figure 4A shows an example of horizontal flipping, and Figure 4B shows an example of vertical flipping. In the examples of Figures 4A and 4B, (x nbr ,y nbr ) represents the coordinates of the center sample 150 of the neighboring block 152, and (x cur ,y cur ) represents the coordinates of the center sample 154 of the current block 156. nbr BV158 of neighboring block 152 is cur respectively indicate the BV 160 of the current block 156. Instead of directly inheriting the BV 158 from the neighboring block 152,cur The horizontal component of BV is nbr The horizontal component of (BV nbr h ) plus a motion shift, i.e., BV cur h =2(x nbr -x cur )+BV nbr h Similarly, BV cur The vertical component of BV is nbr The vertical component (BV nbr v ) plus a motion shift, i.e., BV cur v =2(y nbr -y cur )+BV nbr v is.
[0079] Note that in one example of an ECM, when the IBC is enabled, there is no way to selectively deactivate the RR-IBC or template matching IBC; i.e., when the IBC is enabled from the SPS, these tools are automatically enabled.
[0080] Video encoder 200 and video decoder 300 may be configured to perform local illumination compensation (LIC). In ECM-7.0, LIC is an inter-prediction technique for modeling local illumination variation between a current block and its prediction block as a function of illumination variation between a current block template and a reference block template. The linear function that LIC applies to a reference block may be written as follows: predVal=α * RefSample+β where "predVal" is the output result of the LIC operation, and α and β are two parameters that the encoder and decoder derive from the templates of the current block and the inter-reference block.
[0081] LIC has also been proposed for IBC, which is an extension of LIC used in regular inter prediction. LIC uses a scale factor and an offset to correct for local illumination differences. The scale factor and offset are estimated from a template around the current block and a template around the reference block, so no additional signaling may be required for these parameters.
[0082] The video encoder 200 and the video decoder 300 may be configured to perform intra template matching (IntraTMP). IntraTMP is a special intra prediction mode that copies the best predicted block from the reconstructed part of the current frame. A block vector (BV) from the current block to the reference block is derived by performing template matching in a predefined search range. The block whose template is most similar to the template of the current block is selected. The same template matching search operation is performed on both the encoder side and the decoder side so that the block vector (BV) does not need to be signaled.
[0083] There has also been some research into the use of fractional pixel interpolation for IBC, which has been reported to improve IBC performance. Half-pixel and quarter-pixel sub-pixel accuracy is added to implement fractional pixel block vectors. A 12-tap or 8-tap interpolation filter can be used for the interpolation. If the interpolation process requires pixels outside the IBC reference area, the reference area can be padded using only the pixels available inside the reference area.
[0084] Because IBC uses a reconstructed portion of the current picture to find a block predictor for the current block, the similarity between the current block and the predicted block may be lower than in inter-prediction. Filtering the predicted block may improve the quality of the predictor.
[0085] On the other hand, template matching based techniques may utilize the similarity between the current block and the template(s) within the reconstructed area to determine the optimal configuration for filtering.
[0086] This disclosure describes techniques for applying filtering to predictor blocks in IBC mode, inter prediction, or intra prediction. Examples of inter prediction modes include merge mode, AMVP mode, and affine mode.
[0087] As an example, video encoder 200 and video decoder 300 may be configured to derive the filtering process from templates associated with the current block and the reference block, which may be located in the same picture or other reference pictures.
[0088] 5A shows an example of templates 170 and 172 that have an L-shape and are adjacent to a current block 174 and a reference block 176, respectively. Templates 170 and 172 are located within the "decoded area" so that the values of samples in the templates are available when current block 174 is decoded. As shown in FIG. 5A, for IBC, reference block 176 is located in the same picture as current block 174.
[0089] 5B shows an example of templates 180 and 182 that have an L-shape and are adjacent to a current block 184 and a reference block 186, respectively. Template 180 is located within the "decoded area" of current picture 188 so that the values of the samples of template 180 are available when current block 184 is decoded. As shown in FIG. 5B, in the case of inter prediction, reference block 186 is located in reference picture 190 rather than in current picture 188.
[0090] In the case of intra-coding, there are only reconstructed neighboring samples, so there are no reference samples. The derived samples may be used as reference block samples in the description. In one example, the derived samples may be samples derived by applying intra-prediction to the neighboring samples. A filter model may then be derived by comparing how close the reconstructed neighboring samples are to the derived samples. In one example, the model derivation may be to minimize the difference between the reconstructed samples and the derived samples.
[0091] In some examples, the filtering process (e.g., the number of parameters N, the set of samples / values used as input for each target sample) may be predefined or may be derived from syntax element(s) signaled in the bitstream. The number of parameters or filter length may depend on one or more block characteristics, including the diversity (e.g., variance) of samples within a block, the block size, the magnitude of the block or motion vectors, etc.
[0092] In some examples, a 6-tap filter with 5 samples as input and a constant bias may be applied to the predictor. predVal=c0C+c1N+c2S+c3W+c4E+c5b, where predVal is the output result of the filtering process for the sample, and C corresponds to the input sample co-located with the target output sample (called the "co-located sample"). N, S, W, and E represent the north (above), south (below), west (left), and east (right) neighbors of the co-located sample. "b" is a constant, which in some examples may be a sample value located in the middle of the range of sample values (e.g., 512 for a 10-bit range [0 to 1023]).
[0093] In some examples, to make predVal a 7-tap filter, a quadratic term may be added as follows: PredVal=c -1 C 2 +c0C+c1N+c2S+c3W+c4E+c5b
[0094] In some examples, the parameters used in the filtering process are determined by minimizing the difference between the template of the current block and the result of applying the filtering process to the template area of the reference block. In one example, the minimization criterion may be the mean square error (MSE).
[0095] In some examples, certain constraints may be placed on the function of predVal to reduce the solution space. In some examples, the coefficients of predVal may be optimized subject to c1=c2=c3=c4=0. In some examples, the coefficients may be optimized subject to c1=c2=0. In some examples, the coefficients may be optimized subject to c3=c4=0.
[0096] In some examples, an "L-shaped" template of the current block located in a reconstruction area having M rows and N columns of samples (e.g., M=N=4) is used to derive the filtering parameters. The parameters of the filtering process are derived by minimizing the MSE between the L-shaped template of the current block and the filtered L-shaped template of the IBC predictor block.
[0097] An example of a template shape could be using only the left template, or only the top template, or another template defined for the neighboring area.
[0098] In some examples, the on / off of the proposed filtering process for prediction may be controlled by a block-level flag. As another example, the on / off of the proposed filtering process for prediction may be derived based on information related to the current block, such as block size, block shape, and the error between the template of the current block and the template of the reference block before and / or after the filtering process. In some examples, the block-level flag does not need to be signaled, but may be determined based on the TM cost of the filtered template (the error between the template of the current block and the template of the reference block / candidate reference block) and the TM cost of the unfiltered template. The flag value is set equal to 1 only if the former achieves a lower TM cost; otherwise, the flag value is set equal to 0. In yet another example, the flag value is set equal to 1 only if the TM cost of the former plus a positive delta term is still lower than the TM cost of the unfiltered template; otherwise, the flag value is set equal to 0. The delta term may be, for example, 2 times the number of samples on the template of the current block. ビット深度-2 For example, if the number of samples is N, the bit depth of the template samples is BD, and the delta term is N * 2 BD-2 is set equal to
[0099] As an example of prediction filtering, LIC may be applied to a prediction block, for example, for prediction of a block coded in intra-TMP mode. All examples in this document deriving filter parameters may be used to derive LIC parameters. The application of LIC on an intra-TMP prediction block may be controlled by a block-level flag. In some examples, the application of LIC on an intra-TMP prediction block may also be implicitly determined (without explicit signaling) depending on prediction block characteristics and / or template characteristics or block size or shape.
[0100] In another example, different filtering modes may be introduced that are applied to the prediction, e.g., derived using different numbers of parameters or different processes, e.g., LIC, and the mode selection may be signaled or implicitly derived; in one example, implicit derivation may be done by selecting the mode that produces the smallest difference with respect to the template.
[0101] This paper describes linear model filtering for intra-template matching (TMP) prediction blocks. Intra-TMP is an intra-coding tool employed in ECM7, which performs a template-based search in an already decodable (causal) area to determine the best template that minimizes the difference between a reference template and a current template (a template neighboring the current block) to determine a displacement vector (or block vector). This block vector is then used to fetch the corresponding reference block used to predict the current block.
[0102] The video encoder 200 and the video decoder 300 may be configured to apply a linear filtering model on the prediction block to further improve prediction accuracy. The model may be derived using a reference template and a current template, so that no further signaling of the model parameters is required. The 6-tap filter may include 5 taps plus a signed shape space component and a bias term.
[0103] Figure 6 is a conceptual diagram illustrating the spatial portion of filter 131. The input to the spatial 5-tap component of filter 131 includes the center (C) sample in the reference block at a location corresponding to the sample in the current block to be predicted, as well as the above / north (N), below / south (S), left / west (W), and right / east (E) neighbors as shown in Figure 6. The bias term B represents a scalar offset between the input and output and is set to the median luma value (512 for 10-bit content). The output result of the filter may be calculated as follows: predLumaVal=c0C+c1N+c2S+c3E+c4W+c5B
[0104] Figure 7 is a conceptual diagram illustrating intra-TMP filtering. Video encoder 200 and video decoder 300 may be configured to calculate filter coefficients ci by minimizing the mean squared error (MSE) between reference template 135 and current template 137, as shown in Figure 7. The extension to the area shown in the solid gray shaded area is necessary to support the "side samples" of the plus-shaped spatial filter, which may be padded if located in an unavailable area.
[0105] Video encoder 200 and video decoder 300 may perform MSE minimization by calculating an autocorrelation matrix of the reference template input and the current template output. The autocorrelation matrix may be LDL decomposed, and the final filter coefficients may be calculated using backsubstitution.
[0106] Thus, video encoder 200B and video decoder 300 may determine the filter coefficients (ci) such that when a filter based on the filter coefficients is applied to each sample of the reference template, the MSE between the filtered reference template and the current template is minimized. Video encoder 200B or video decoder 300 may then apply the filter to the samples of the reference block.
[0107] The use of intra-template matching prediction using filtered linear models (intra-TMP-FLM) mode may be signaled using a CU-level flag. Intra-TMP-FLM may be considered a sub-mode of intra-TMP. That is, in some examples, the intra-TMP-FLM flag may be signaled only if the intra-TMP flag is true, i.e., intra-TMP is enabled.
[0108] Similar types of filtering for IBCs may also be beneficial, which currently do not exist in ECMs. The examples of this disclosure relating to filtering for IBCs may be applied independently or in combination.
[0109] In some examples, the filtering mode for IBC may be used as an additional mode. In some examples, the filtering mode for IBC may not be applied together with IBC-LIC and / or IBC-CIIP (combined intra-inter prediction mode for IBC), that is, when the filtering mode for IBC is enabled, LIC and / or CIIP are disabled. The signaling structure may be as follows:
[0110] [Table 1]
[0111] In some examples, the filtering mode for IBC may also replace the IBC-LIC mode.
[0112] In some examples, the filtering mode for IBC may only be applied to a specific block size. For example, the video encoder 200 and the video decoder 300 may be configured not to apply the filtering mode for IBC to block sizes (areas) smaller than a threshold. For example, the filtering mode for IBC may not be applied to blocks with a width * height < 32.
[0113] In some examples, the video encoder 200 and the video decoder 300 may be configured not to apply the filtering mode for IBC when neither the left template nor the top template is fully available for the current block. For example, when the position of the CU is (0,0), signaling may be avoided. When the template size is T, for the CU position (x,y), if x < T or y < T, signaling of the filtering mode for IBC may be avoided. Alternatively, some predetermined fixed filter model may be applied to those blocks.
[0114] In some examples, the reference block and the reference template may be included in the IBC reference region. FIG. 8 is a conceptual diagram showing a reference template 135, which is a combination of 135A and 135B, and a current template 137, which is a combination of 137A and 137B, for an IBC-coded block according to the techniques of the present disclosure. When the reference template points outside the reference region, only a part of the template (inside the reference region) may be used to derive the model parameters. For example, in a particular case, when the left template (e.g., template 135B) is outside the reference region but the top template (e.g., template 135A) is inside the reference region, only the top template 135A may be used for model generation. Instead of this, when the reference template points outside the reference region, the reference template outside the reference region may be generated using padding from the nearest sample inside the reference region.
[0115] In some examples, the video encoder 200 and the video decoder 300 may be configured to generate reference templates using only the integer portion of the block vectors to generate filter models for fractional block vectors without associated interpolation (reference blocks are still generated using fractional-pel motion compensation with interpolation).
[0116] In some instances, this process may only be applied when the block vectors are in integer pixels (and not in the case of fractional pixel block vectors).
[0117] In some examples, the video encoder 200 and the video decoder 300 may be configured to apply different filter models (including different filter shapes) for filtering. The different models may be applied as multiple candidates with additional signaling. Alternatively, an appropriate filter (among the multiple filters) may be implicitly selected depending on the block size or spatial characteristics.
[0118] In some examples, the video encoder 200 and the video decoder 300 may be configured to sort through different filter models and / or multiple candidates based on calculating the difference between the filtered prediction on the evaluation template and the actual reconstruction. The evaluation template may be selected to include already decoded samples, so that a reconstruction is available. The filtered prediction is generated by first performing IBC prediction using the current block vector in the absence of an evaluation template, and then applying the corresponding filter model. Alternatively, only the filter model with the smallest difference may be used for the current block without extra signaling. Figure 9 is a conceptual diagram illustrating a reference template 141, a current template 143, and an evaluation template 145 for an IBC-coded block in accordance with the techniques of this disclosure.
[0119] In some examples, video encoder 200 and video decoder 300 may be configured to signal the filtering mode for IBC only for non-merge modes. In merge modes, the filtering mode for IBC may be inherited; for example, if the corresponding merge candidate has the filtering mode for IBC enabled, the enabling / disabling of the filtering mode for IBC is inherited, so the filtering mode for IBC may also be enabled for the current block. In another example, for certain IBC merge modes (IBC-CIIP, IBC-GPM), inheritance may be disabled.
[0120] In some examples, video encoder 200 and video decoder 300 may be configured to inherit the IBC filter mode for the current block only if the merge candidate is a composite candidate (composed of two or more single merge candidates) and if all merge candidates have an enabled filtering mode (or, in some examples, at least one).
[0121] In some examples, video encoder 200 and video decoder 300 may be configured to signal only the filtering mode for IBC for I slices.
[0122] In some examples, the video encoder 200 and the video decoder 300 may be configured to generate filter models using different templates (left only, top only, or L-shaped), which may be treated as multiple candidates and then selected based on signaling (with / without reordering) or implicitly (based on differences based on size, spatial characteristics, or evaluation template).
[0123] In some examples, the video encoder 200 and the video decoder 300 may be configured to apply an additional filter to both the current template and the reference template (to remove high frequency artifacts / noise) before deriving the model generation.
[0124] In some examples, the additional constraint that the filter be symmetric may also be used for filter model generation.
[0125] In some examples, the video encoder 200 and the video decoder 300 may be configured to apply a set of offline trained fixed model filters in addition to the template-generated filter models.
[0126] In some examples, in the case of a single tree scenario (e.g., when luma and chroma blocks are coded together in a CU), this filtering portion may be restricted to only the luma component, or in some examples, the chroma portion may also have independent model generation and filtering.
[0127] In some examples, when a block vector is in a fractional pixel and the extended reference area (i.e., the reference block area, the associated template with or without padding, and the additional extended area to account for the application of an interpolation filter) is partially outside the available IBC reference region, the outside area may be padded from neighboring available areas.
[0128] In some examples, the video encoder 200 and the video decoder 300 may be configured to order different sub-pel positions based on the template distortion for a sub-pel block vector position, i.e., the difference between the current template and the reference template is calculated, and instead, an index specifying the position of the sub-pel candidate in that ordered list is signaled. Furthermore, not all sub-pel positions may be signaled. Instead, the first few sub-pel candidates (a subset) are signaled by index.
[0129] In some examples, video encoder 200 and video decoder 300 may be configured to select a filtering mode context based on the coding mode of the neighboring block. Some additional examples may include whether the neighboring block uses IBC filtering, whether the neighboring block uses IBC-LIC or IBC filtering, or whether the neighboring block uses IBC-LIC or IBC filtering or intra-TMP filtering.
[0130] In some examples, when the reference template (and / or the current template) is completely or partially unavailable, the video encoder 200 and the video decoder 300 may be configured to use fixed filtering (e.g., fixed parameter model filtering) instead of deriving a model based on a template. Furthermore, this fixed parameter model filtering may be based on the dominant direction of the IBC block vector prediction block or on the current template gradient direction. The filtering may also depend on the gradient magnitude (smoothness) of either the current template or the block vector prediction block. Alternatively or additionally, fixed parameter filtering may be applied when the reference template and the current template are very different from each other.
[0131] In some examples, a high-level flag may enable / disable this coding tool. For example, video encoder 200B or video decoder 300 may encode or decode syntax elements that indicate whether the coding tools that determine IBC reference blocks, calculate coefficients, and apply filters are enabled or disabled.
[0132] In some examples, the video encoder 200 and the video decoder 300 may be configured to signal an SPS-level flag to indicate whether this tool is enabled / disabled at the sequence level. This flag may be conditionally signaled based on the IBC flag, i.e., this flag is signaled only when IBC is enabled. Furthermore, this flag may also be conditionally signaled based on the intra-TMP flag. As an example, this flag may be signaled when the intra-TMP flag is disabled. If this flag is not signaled, the value of the flag may be inferred to be 0.
[0133] In some examples, video encoder 200 and video decoder 300 may be configured to enable / disable this tool at the slice level. The signaling may also depend on whether IBC is enabled for that particular slice, i.e., the signaling may depend on a slice-level IBC enabled flag.
[0134] 10 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. Figure 10 is provided for purposes of explanation and should not be considered limiting of the techniques broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes video encoder 200 in accordance with VVC and HEVC techniques. However, the techniques of this disclosure may be performed by video encoding devices configured for other video coding standards and video coding formats, such as AV1 and successors to the AV1 video coding format.
[0135] 10 , 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 that perform these and other functions.
[0136] 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 function as a reference picture memory that stores 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 dynamic random access memory (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.
[0137] 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 so, or to memory external to video encoder 200, unless specifically stated so. 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.
[0138] The various units in FIG. 10 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 has predefined operations it can perform. A programmable circuit refers to a circuit that can be programmed to perform various tasks and provides flexible functionality in the operations it can perform. 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., receive parameters or output parameters), the types of operations it 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.
[0139] Video encoder 200 may include arithmetic logic units (ALUs), elementary function units (EFUs), digital circuits, analog circuits, and / or a programmable core formed from programmable circuits. In examples in which the operations of video encoder 200 are performed using software executed by programmable circuits, memory 106 (FIG. 1) may store software instructions (e.g., object code) that video encoder 200 receives and executes, or a separate memory (not shown) within video encoder 200 may store such instructions.
[0140] 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.
[0141] 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 that perform 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.
[0142] The mode selection unit 202 generally coordinates multiple coding passes to test combinations of coding parameters and the resulting rate-distortion values for such combinations. The coding parameters may include partitioning of CTUs into CUs, prediction modes for CUs, transform types for residual data of CUs, quantization parameters for residual data of CUs, etc. The mode selection unit 202 may ultimately select a combination of coding parameters that has a better rate-distortion value than the other tested combinations.
[0143] Video encoder 200 may partition a picture retrieved from video data memory 230 into a series of CTUs and encapsulate one or more CTUs within a slice. Mode select unit 202 may partition the CTUs of the picture according to a tree structure, such as the MTT structure, QTBT structure, superblock 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."
[0144] 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 prediction 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). Specifically, 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 deviation (MAD), the mean squared deviation (MSD), etc. The motion estimation unit 222 may generally perform these calculations using the sample-by-sample differences between the current block and the reference block under consideration. Motion estimation unit 222 may identify the reference block with the lowest value resulting from these calculations, indicating the reference block that most closely matches the current block.
[0145] The motion estimation unit 222 may form one or more motion vectors (MVs) that define 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 for the reference blocks. 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.
[0146] When operating according to the AV1 video coding format, the motion estimation unit 222 and the motion compensation unit 224 may be configured to encode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using translational motion compensation, affine motion compensation, overlapped block motion compensation (OBMC), and / or synthetic inter-intra prediction.
[0147] 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 populate these calculated values in a defined direction across the current block to create the 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 the predictive block to include this resulting average for each sample of the predictive block.
[0148] When operating according to the AV1 video coding format, intra prediction unit 226 may be configured to encode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using directional intra prediction, non-directional intra prediction, recursive filter intra prediction, chroma-from-luma (CFL) prediction, intra block copy (IBC), and / or color palette mode. Mode select unit 202 may include additional functional units that perform video prediction according to other prediction modes.
[0149] 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 within 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.
[0150] 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 having various sizes. As mentioned 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 of PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.
[0151] In examples where 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. Video encoder 200 and video decoder 300 may support CU sizes of 2N×2N, 2N×N, or N×2N.
[0152] For other video coding techniques, such as intra block copy mode coding, affine mode coding, and 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 how to reconstruct 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.
[0153] The mode select unit 202 also includes a prediction filter (PF) unit 203, which may perform the prediction filtering techniques of this disclosure. As part of generating the predictive block, the PF unit 203 may determine whether to apply filtering to the predictive block, compare a template of the reference block to a template of the current block based on determining that filtering is to be applied to the predictive block, and filter the predictive block based on comparing the template of the reference block to the template of the current block to determine a filtered predictive block. The PF unit 203 may, for example, determine a filter that minimizes the difference between sample values of the template of the reference block and the template of the current block, and filter the predictive block using the determined filter. Applying the filter may modify the sample values of the template of the current block to reduce the mean square error between the sample values of the template of the current block and the template of the reference block. Thus, when the PF unit 203 applies a filter to the predictive block, the filter may also reduce the mean square error between the predictive block and the corresponding original block of video data.
[0154] 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.
[0155] 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 on the residual block, e.g., a linear transform and a secondary transform such as a rotational transform. In some examples, transform processing unit 206 does not apply a transform to the residual block.
[0156] When operating according to AV1, transform processing unit 206 may apply 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 combination of horizontal / vertical transforms, which may include a discrete cosine transform (DCT), an asymmetric discrete sine transform (ADST), an inverse ADST (e.g., ADST in reverse order), and an identity transform (IDTX). When using an identity transform, the transform is skipped in one of the vertical or horizontal directions. In some examples, the transform process may be skipped.
[0157] The quantization unit 208 may quantize the transform coefficients in the transform coefficient block to produce 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 be less accurate than the original transform coefficients produced by the transform processing unit 206.
[0158] 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 produce a reconstructed block that corresponds to the current block (possibly with some 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 produce the reconstructed block.
[0159] Filter unit 216 may perform one or more filter operations on the reconstructed blocks. For example, filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of the CU. The operations of filter unit 216 may be skipped in some examples.
[0160] When operating according to AV1, filter unit 216 may perform one or more filter operations on the reconstructed blocks. For example, filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of a CU. In other examples, filter unit 216 may apply a constrained directional enhancement filter (CDEF), which may be applied after deblocking and may include application of a non-separable, nonlinear, low-pass directional filter based on estimated edge directions. Filter unit 216 may also include a loop restoration filter, which may be applied after the CDEF and may include a separable symmetric normalized Wiener filter or a dual self-guided filter.
[0161] Video encoder 200 stores the reconstructed blocks in DPB 218. For example, in examples where the operations of filter unit 216 are not performed, reconstruction unit 214 may store the reconstructed blocks in DPB 218. In examples where the operations of filter unit 216 are performed, filter unit 216 may store the filtered reconstructed blocks in DPB 218. Motion estimation unit 222 and motion compensation unit 224 may retrieve reference pictures formed from the reconstructed (and possibly filtered) blocks from DPB 218 to inter-predict blocks of a later-encoded picture. Additionally, intra-prediction unit 226 may use reconstructed blocks of the current picture in DPB 218 to intra-predict other blocks in the current picture.
[0162] 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 other examples 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) coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a Probability Interval Partitioning 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.
[0163] Video encoder 200 may output a bitstream that includes entropy-encoded syntax elements needed to reconstruct blocks of a slice or picture. Specifically, entropy encoding unit 220 may output the bitstream.
[0164] The entropy coding unit 220 may be configured as a symbol-to-symbol adaptive multi-symbol arithmetic coder according to AV1. A syntax element in AV1 includes an alphabet of N elements, and a context (e.g., a probability model) includes a set of N probabilities. The entropy coding unit 220 may store the probabilities as n-bit (e.g., 15-bit) cumulative distribution functions (CDFs). The entropy coding unit 220 may perform recursive scaling to update the context, using an update factor based on the alphabet size.
[0165] The operations described above are described with respect to blocks. Such descriptions should be understood as operations on 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.
[0166] In some examples, operations performed with respect to luma coding blocks do not need to be repeated for chroma coding blocks. As one example, the operations of identifying motion vectors (MVs) and reference pictures for luma coding blocks do not need to be repeated to identify MVs and reference pictures for chroma blocks. Rather, the MVs for luma coding blocks may be scaled to determine the 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.
[0167] 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 configured to: determine a predictive block for a current block of a current picture of the video data; compare a template of the predictive block with a template of the current block; filter the predictive block based on the comparison of the template of the predictive block with the template of the current block to determine a filtered predictive block; and encode the current block based on the filtered predictive block.
[0168] 11 is a block diagram illustrating an example video decoder 300 that may perform the techniques of this disclosure. Figure 11 is provided for purposes of explanation and does not limit the techniques broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes a video decoder 300 in accordance with VVC and HEVC techniques. However, the techniques of this disclosure may be performed by video coding devices configured for other video coding standards.
[0169] In the example of Figure 11, 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 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 that perform these and other functions.
[0170] Prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. Prediction processing unit 304 may include additional units that perform 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, an LM unit, etc. In other examples, video decoder 300 may include more, fewer, or different functional components.
[0171] When operating in accordance with AV1, the motion compensation unit 316 may be configured to decode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using translational motion compensation, affine motion compensation, OBMC, and / or synthetic inter-intra prediction, as described above. The intra prediction unit 318 may be configured to decode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using directional intra prediction, non-directional intra prediction, recursive filter intra prediction, CFL, IBC, and / or color palette mode, as described above.
[0172] 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, CPB memory 320 may be on-chip with other components of video decoder 300 or may be off-chip relative to those components.
[0173] 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 for 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 that is executed by processing circuitry of video decoder 300.
[0174] The various units shown in FIG. 11 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. 10, fixed-function circuits refer to circuits that provide specific functionality and have predefined operations that they can perform. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations they can perform. 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., receive parameters or output parameters), the types of operations 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.
[0175] Video decoder 300 may include a programmable core formed from ALUs, EFUs, digital circuits, analog circuits, and / or programmable circuits. In examples in which the operations of video decoder 300 are performed by software executing on programmable circuits, on-chip or off-chip memory may store software instructions (e.g., object code) that video decoder 300 receives and executes.
[0176] 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.
[0177] Generally, video decoder 300 reconstructs a picture on a block-by-block basis. Video decoder 300 may perform a reconstruction operation on each block individually (the block currently being reconstructed, i.e., decoded, may be referred to as the “current block”).
[0178] The entropy decoding unit 302 may entropy decode syntax elements that define the quantized transform coefficients of the quantized transform coefficient block as well as transform information, such as a quantization parameter (QP) and / or a transform mode indication(s). 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 that the inverse quantization unit 306 applies. 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.
[0179] 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.
[0180] 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 a predictive block. In this case, the prediction information syntax element may indicate a reference picture within DPB 314 from which to retrieve the reference block, as well as a motion vector that identifies the location of the reference block within 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. 10).
[0181] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, intra prediction unit 318 may generate a predictive block according to the intra-prediction mode indicated by the prediction information syntax element. Again, intra prediction unit 318 may generally perform the intra-prediction process in a manner substantially similar to that described with respect to intra prediction unit 226 (FIG. 10). Intra prediction unit 318 may retrieve data of neighboring samples for the current block from DPB 314.
[0182] The prediction processing unit 304 also includes a PF unit 305, which may perform the prediction filtering techniques of this disclosure. As part of generating the predictive block, the PF unit 305 may determine whether to apply filtering to the predictive block, compare a template of the reference block to a template of the current block based on determining that filtering is to be applied to the predictive block, and filter the predictive block based on comparing the template of the reference block to the template of the current block to determine a filtered predictive block. The PF unit 305 may, for example, determine a filter that minimizes the difference between sample values of the template of the reference block and the template of the current block, and filter the predictive block using the determined filter. Applying the filter may modify the template sample values of the current block to reduce the mean squared error between the template sample values of the current block and the template sample values of the reference block. Thus, when the PF unit 305 applies a filter to the predictive block, the filter may also reduce the mean squared error between the predictive block and the corresponding original block of video data.
[0183] 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.
[0184] Filter unit 312 may perform one or more filter operations on the reconstructed blocks. For example, filter unit 312 may perform a deblocking operation to reduce blockiness artifacts along the edges of the reconstructed blocks. The operations of filter unit 312 may not be performed in all instances.
[0185] The video decoder 300 may store the reconstructed blocks in the DPB 314. For example, in examples in which 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 in which 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. Furthermore, the video decoder 300 may output the decoded pictures (e.g., decoded video) from the DPB 314 for later display on a display device, such as the display device 118 of FIG. 1 .
[0186] Thus, 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 configured to: determine a predictive block for a current block of a current picture of the video data; compare a template of the predictive block with a template of the current block; filter the predictive block based on a comparison of the template of the predictive block with the template of the current block to determine a filtered predictive block; and decode the current block based on the filtered predictive block.
[0187] 12 is a flowchart illustrating an example process for encoding a current block in accordance with the techniques of this disclosure. The current block may be or include a current CU. Although described with respect to video encoder 200 (FIGS. 1 and 10), it should be understood that other devices may be configured to perform a process similar to that of FIG. 12.
[0188] In this example, video encoder 200 first predicts the current block (350). This prediction may include filtering techniques described herein. Video encoder 200 may then calculate a residual block for the current block (352). To calculate the residual block, video encoder 200 may calculate the difference between the original uncoded block and a predictive block for the current block. Video encoder 200 may then transform the residual block and quantize the transform coefficients of the residual block (354). Video encoder 200 may then scan the quantized transform coefficients of the residual block (356). During or following the scan, video encoder 200 may entropy code the transform coefficients (358). For example, video encoder 200 may code the transform coefficients using CAVLC or CABAC. Video encoder 200 may then output entropy-coded data for the block (360).
[0189] 13 is a flowchart illustrating an example process for decoding a current block of video data in accordance with the techniques of this disclosure. The current block may be or include a current CU. Although described with respect to video decoder 300 (FIGS. 1 and 11), it should be understood that other devices may be configured to perform a process similar to that of FIG. 13.
[0190] The video decoder 300 may receive entropy-coded data for the current block, such as entropy-coded prediction information and entropy-coded data for the transform coefficients of a residual block corresponding to the current block (370). The video decoder 300 may entropy decode the entropy-coded data to determine prediction information for the current block and reconstruct the transform coefficients of the residual block (372). The video decoder 300 may predict the current block using, for example, an IBC, intra, or inter prediction mode indicated by the prediction information for the current block (374) to calculate a predictive block for the current block. This prediction may include filtering techniques described herein. The video decoder 300 may then inverse-scan the reconstructed transform coefficients to create a block of quantized transform coefficients (376). The video decoder 300 may then dequantize the transform coefficients and apply an inverse transform to the transform coefficients to produce the residual block (378). Video decoder 300 may finally decode the current block by combining the predictive block and the residual block (380).
[0191] 14 is a flowchart illustrating an example process for decoding a current block of video data in accordance with the techniques of this disclosure. The current block may be or include a current CU. Although described with respect to video decoder 300 (FIGS. 1 and 11), it should be understood that other devices may be configured to perform a process similar to that of FIG. 14.
[0192] For example, in the example of Figure 14, video decoder 300 determines a predictive block for a current block of a current picture of video data based on a reference block in the current picture (382). The predictive block may, for example, be a copy of the reference block in the current picture. Video decoder 300 may determine the predictive block for the current block of the current picture by, for example, locating a reference block in the same picture as the current block using a block vector.
[0193] The video decoder 300 determines whether to apply filtering to the predictive block (384). Based on determining that filtering will be applied to the predictive block (384, yes), the video decoder 300 compares a template of the reference block to a template of the current block (386) and filters the predictive block based on the comparison of the template of the reference block and the template of the current block to determine a filtered predictive block (388). Based on determining that filtering will not be applied to the predictive block (384, no), the video decoder 300 decodes the current block without filtering the predictive block.
[0194] The template for the reference block may be an L-shaped group of samples including samples to the left of and above the reference block used to determine the predictive block, and the template for the current block may be an L-shaped group of samples including samples to the left of and above the current block. In some examples, the template for the reference block may include padded samples.
[0195] To filter the predictive block based on comparing the template of the reference block with the template of the current block to determine the filtered predictive block, the video decoder 300 may be configured to determine a filter that minimizes a difference between sample values of the template of the reference block and the template of the current block, and filter the predictive block using the determined filter. To determine a filter that minimizes a difference between sample values of the template of the reference block and the template of the current block, the video decoder 300 may determine a filter that modifies the sample values of the template of the current block to reduce the mean squared error between the sample values of the template of the current block and the template of the reference block. In some examples, the video decoder 300 may determine not to filter the predictive block based on comparing the template of the reference block with the template of the current block, such that the filtered predictive block is equal to the predictive block.
[0196] To determine whether to apply filtering to the predictive block, the video decoder 300 may, for example, receive a flag, where a first value of the flag indicates that the intra block copy with filtering mode is enabled and a second value of the flag indicates that the intra block copy with filtering mode is disabled. To determine whether to apply filtering to the predictive block, the video decoder 300 may additionally or alternatively determine a size for the current block and determine that filtering will be applied to the predictive block by determining that the size is greater than a threshold size. To determine whether to apply filtering to the predictive block, the video decoder 300 may determine whether to apply filtering to the predictive block based on the slice type of the current block being an intra slice. For example, receiving the flag may be conditional on the size being greater than a threshold size and / or the slice of the current block being an I slice. To determine a predictive block for a current block of a current picture of video data, video decoder 300 may determine a block vector for the current block based on a candidate selected from the merge list, and to determine whether to apply filtering to the predictive block, video decoder 300 may determine whether the predictive block corresponding to the candidate was determined using filtering.
[0197] Video decoder 300 decodes the current block based on the filtered predictive block to determine a decoded version of the current block (390). To decode the current block, video decoder 300 may, for example, add residual data to the filtered predictive block to determine a reconstructed block and apply one or more filtering operations to the reconstructed block.
[0198] Video decoder 300 outputs a decoded picture of the video data, including a decoded version of the current block (392). To output the decoded picture, video decoder 300 may, for example, display the decoded picture, store or transmit a copy of the decoded picture for later display, or store a copy of the decoded picture for use in encoding or decoding other pictures of the video data.
[0199] The following numbered clauses illustrate one or more aspects of the devices and techniques described in this disclosure.
[0200] Clause 1A: A method for decoding video data, the method including: determining a predictive block for a current block of a current picture of the video data; comparing a template of the predictive block with a template of the current block; filtering the predictive block based on the comparison of the template of the predictive block with the template of the current block to determine a filtered predictive block; and decoding the current block based on the filtered predictive block.
[0201] Clause 2A: The method described in Clause 1A, wherein filtering the predictive block based on a comparison between a template of the predictive block and a template of the current block to determine a filtered predictive block includes determining a filter that minimizes a difference between the template of the predictive block and the template of the current block, and filtering the predictive block using the determined filter.
[0202] Clause 3A: The method described in Clause 1A, wherein filtering the predictive block based on a comparison between a template of the predictive block and a template of the current block to determine a filtered predictive block includes determining not to filter the predictive block based on a comparison between a template of the predictive block and a template of the current block so that the filtered predictive block is equal to the predictive block.
[0203] Clause 4A: The method of clause 1A, further comprising receiving a flag and filtering the prediction block based on a value of the flag.
[0204] Clause 5A: A device for decoding video data, the device comprising one or more means for performing the method according to any of clauses 1A to 4A.
[0205] Clause 6A: The device of clause 5A, wherein the one or more means comprise one or more processors implemented in circuitry.
[0206] Clause 7A: The device of any of clauses 5A and 6A, further comprising a memory for storing video data.Clause 8A: The device of any of clauses 5A to 7A, further comprising a display configured to display the decoded video data.
[0207] Clause 9A: The device of any of clauses 5A to 8A, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0208] Clause 10A: The device of any of clauses 5A to 9A, wherein the device comprises a video decoder.
[0209] Clause 11A: The device of any of clauses 5A to 10A, wherein the device comprises a video encoder.
[0210] Clause 12A: 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 1A to 4A.
[0211] Clause 1B: A method for decoding video data, the method including: determining a predictive block for a current block of a current picture of the video data; comparing a template of the predictive block with a template of the current block; filtering the predictive block based on a comparison of the template of the predictive block with the template of the current block to determine a filtered predictive block; decoding the current block based on the filtered predictive block to determine a decoded version of the current block; and outputting a decoded picture of the video data including the decoded version of the current block.
[0212] Clause 2B: The method described in Clause 1B, wherein filtering the predictive block based on a comparison of a template of the predictive block with a template of the current block to determine a filtered predictive block includes determining a filter that minimizes a difference between sample values of the template of the predictive block and sample values of the template of the current block, and filtering the predictive block using the determined filter.
[0213] Clause 3B: The method described in clause 2B, wherein determining a filter that minimizes the difference between the template sample values of the predicted block and the template sample values of the current block includes determining a filter that modifies the template sample values of the current block so as to reduce the mean square error between the template sample values of the current block and the template sample values of the predicted block.
[0214] Clause 4B: The method described in Clause 1B, wherein filtering the predictive block based on a comparison between a template of the predictive block and a template of the current block to determine a filtered predictive block includes determining not to filter the predictive block based on a comparison between a template of the predictive block and a template of the current block so that the filtered predictive block is equal to the predictive block.
[0215] Clause 5B: The method described in Clause 1B, wherein the template of the predicted block includes an L-shaped group of samples including samples to the left of the reference block used to determine the predicted block and samples above the reference block, and the template of the current block includes an L-shaped group of samples including samples to the left of the current block and samples above the current block.
[0216] Clause 6B: The method of clause 1B, wherein determining a predictive block for a current block of a current picture of the video data includes locating a reference block in the same picture as the current block using a block vector.
[0217] Clause 7B: The method of clause 1B, wherein determining a predictive block for a current block of a current picture of the video data includes locating a reference block in a reference picture using a motion vector.
[0218] Clause 8B: The method described in Clause 1B, wherein decoding the current block based on the filtered predictive block includes adding residual data to the filtered predictive block to determine a reconstructed block, and applying one or more filter operations to the reconstructed block.
[0219] Clause 9B: The method of clause 1B, wherein the decoding method is performed as part of a process for encoding a current block of video data.
[0220] Clause 10B: A device for decoding video data, the device comprising: a memory configured to store the video data; and one or more processors implemented in a circuit configuration, the one or more processors configured to: determine a predictive block for a current block of a current picture of the video data; compare a template of the predictive block with a template of the current block; filter the predictive block based on a comparison of the template of the predictive block with the template of the current block to determine a filtered predictive block; decode the current block based on the filtered predictive block to determine a decoded version of the current block; and output a decoded picture of the video data including the decoded version of the current block.
[0221] Clause 11B: The device described in Clause 10B, further configured to: determine a filter that minimizes a difference between sample values of the template of the predictive block and sample values of the template of the current block to filter the predictive block based on a comparison of the template of the predictive block and a template of the current block to determine a filtered predictive block; and filter the predictive block using the determined filter.
[0222] Clause 12B: The device described in Clause 11B, wherein to determine a filter that minimizes the difference between the template sample values of the predicted block and the template sample values of the current block, the one or more processors are further configured to determine a filter that modifies the template sample values of the current block to reduce the mean square error between the template sample values of the current block and the template sample values of the predicted block.
[0223] Clause 13B: The device described in Clause 11B, wherein the one or more processors are further configured to determine not to filter the predictive block based on a comparison between a template of the predictive block and a template of the current block to determine a filtered predictive block, such that the filtered predictive block is equal to the predictive block, based on a comparison between a template of the predictive block and a template of the current block.
[0224] Clause 14B: A device as described in Clause 11B, wherein the template of the predicted block includes an L-shaped group of samples including samples to the left of the reference block used to determine the predicted block and samples above the reference block, and the template of the current block includes an L-shaped group of samples including samples to the left of the current block and samples above the current block.
[0225] Clause 15B: The device described in Clause 11B, wherein one or more processors are further configured to use the block vector to locate a reference block within the same picture as the current block to determine a predictive block for a current block of a current picture of the video data.
[0226] Clause 16B: The device described in Clause 11B, wherein one or more processors are further configured to use a motion vector to locate a reference block within a reference picture to determine a predictive block for a current block of a current picture of the video data.
[0227] Clause 17B: The device described in Clause 11B, wherein to decode a current block based on the filtered predictive block, one or more processors are further configured to add residual data to the filtered predictive block to determine a reconstructed block and apply one or more filter operations to the reconstructed block.
[0228] Clause 18B: The device of clause 10B, further comprising a display configured to output decoded pictures of the video data.
[0229] Clause 19B: The device of Clause 10B, further comprising a camera configured to capture unencoded video data, and wherein the one or more processors are further configured to encode the unencoded video data.
[0230] Clause 20B: A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to determine a predictive block for a current block of a current picture of video data, compare a template of the predictive block with a template of the current block, filter the predictive block based on a comparison of the template of the predictive block with the template of the current block to determine a filtered predictive block, decode the current block based on the filtered predictive block to determine a decoded version of the current block, and output a decoded picture of the video data including the decoded version of the current block.
[0231] Clause 1C: A method for encoding or decoding video data, the method including: determining an Intra Block Copy (IBC) reference block in a current picture for a current block in the current picture, the current block having a block vector indicating a displacement from the current block to an IBC reference block; calculating coefficients for a filter based on a reference template for the IBC reference block and a current template for the current block based on a filtering mode being enabled for the current block; applying the filter to the IBC reference block; and encoding or decoding the current block using the IBC reference block after applying the filter to the IBC reference block.
[0232] Clause 2C: The method described in Clause 1C, wherein applying a filter to the IBC reference block includes disabling an IBC local illumination compensation (LIC) mode for the current block and an IBC joint intra-inter prediction mode for the current block based on the filtering mode being enabled for the current block.
[0233] Clause 3C: The method of any of clauses 1C to 2C, further comprising determining whether to apply a filter to the IBC reference block based on the size of the current block.
[0234] Clause 4C: The method of any of clauses 1C to 3C, further comprising determining whether to apply a filter to the IBC reference block based on whether the left template or the top template is fully available.
[0235] Clause 5C: A method as described in any of clauses 1C to 4C, wherein calculating the coefficients includes using only a portion of the reference template within the IBC reference area for the current block or only a portion of the current template within the IBC reference area for the current block to calculate the coefficients for the filter based on only a portion of the reference template being within the IBC reference area for the current block or only a portion of the current template being within the IBC reference area for the current block.
[0236] Clause 6C: A method described in any of clauses 1C to 4C, wherein calculating the coefficients includes using padded samples and samples of the reference template or the current template within the IBC reference area to calculate the coefficients based on the fact that a portion of the reference template is not within the IBC reference area for the current block or that a portion of the current template is not within the IBC reference area.
[0237] Clause 7C: The method according to any one of clauses 1C to 6C, wherein the reference template is generated using only the integer part of the block vector based on the fact that the block vector is a decimal number.
[0238] Clause 8C: The method of any of clauses 1C to 6C, further comprising determining that the filtering mode is enabled for the current block only if the block vector is at the integer pixel level.
[0239] Clause 9C: The method of any of clauses 1C to 8C, further comprising determining a filter model from among a plurality of available filter models having different filter shapes, wherein the filter to be applied to the IBC reference block is the determined filter model.
[0240] Clause 10C: The method of clause 9C, further comprising sorting the list of available filter models based on a difference between the filtered prediction and a reconstruction of the evaluation template.
[0241] Clause 11C: A method according to any of clauses 1C to 10C, wherein one or more syntax elements indicating that a filter for an IBC reference block has been applied to the IBC reference block are signaled only when a non-merge mode is used to signal block vectors.
[0242] Clause 12C: A method according to any of Clauses 1C to 11C, wherein the method further includes generating a merge candidate list including intra block copy (IBC) candidates, each of the IBC candidates indicating a respective block vector, and determining the IBC reference block includes determining a block vector for the current block from among the block vectors indicated by the IBC candidates in the merge candidate list, and a merge candidate index indicating the position of the block vector for the current block in the merge candidate list is signaled in the bitstream.
[0243] Clause 13C: The method described in Clause 12C, wherein the selected IBC candidate indicates a block vector for the current block, and the method further includes determining that a filtering mode is enabled for the current block based on whether the filtering mode is enabled for the composite candidate based on the selected IBC candidate being a composite candidate.
[0244] Clause 14C: The method of any one of clauses 1C to 13C, wherein the filtering mode is enabled only for blocks in an I slice.
[0245] Clause 15C: A method according to any one of clauses 1C to 14C, further comprising generating a plurality of filter models using a plurality of different sets of current templates and reference templates, and determining from among the filter models a filter model that defines a filter.
[0246] Clause 16C: The method of any of clauses 1C to 15C, further comprising applying an additional filter to the current template and the reference template before calculating the coefficients.
[0247] Clause 17C: The method of any of clauses 1C to 16C, wherein the constraint requires that the filter be symmetric.
[0248] Clause 18C: The method of any of clauses 1C to 17C, further comprising applying a set of offline trained fixed model filters to the IBC reference block.
[0249] Clause 19C: The method of any of clauses 1C to 18C, wherein the luma samples and chroma samples of the current block are jointly coded and the filter is applied only to the luma samples of the IBC reference block.
[0250] Clause 20C: The method of clause 19C, further comprising: calculating coefficients of a second filter based on chroma samples of the reference template and chroma samples of the current template; and applying the second filter to the chroma samples of the IBC reference block.
[0251] Clause 21C: A method as described in any of Clauses 1C to 11B or Clauses 14C to 20C, wherein the method further includes generating an AMVP candidate list including advanced motion vector prediction (AMVP) candidates, each of the AMVP candidates indicating a respective block vector, the block vector for the current block being defined by the block vector and motion vector differential (MVD) of a selected AMVP candidate in the AMVP candidate list, and the AMVP candidate index and MVD being signaled in the bitstream.
[0252] Clause 22C: A method according to any of clauses 1C to 21C, further comprising padding the area of the extended reference area from the neighboring area of the available IBC reference area based, in part, on a block vector for the current block with fractional pixel precision and an extended reference area that is outside the available IBC reference area.
[0253] Clause 23C: A method according to any of clauses 1C to 22C, wherein the reference template is a selected reference template, and the method further includes generating an ordered list of sub-pixel candidates based on a block vector having sub-pixel precision, each sub-pixel candidate corresponding to a respective reference template, the sub-pixel candidates in the ordered list being ordered based on the difference between the current template and the corresponding reference template, and an index signaled in the bitstream indicating the position of the selected sub-pixel candidate in the ordered list.
[0254] Clause 24C: The method of any one of clauses 1C to 23C, further comprising selecting a context for the filtering mode based on a coding mode of the neighboring block.
[0255] Clause 25C: The method of any of Clauses 1C to 24C, wherein the current block is a first block, the IBC reference block is a first IBC reference block, and the method further includes: determining a second IBC reference block for a second block in the current picture, the block vector for the second block indicating a displacement between the second block and the second IBC reference block; applying a fixed filter to the second IBC reference block based on at least one of availability of a reference template for the second IBC reference block or a similarity between the reference template for the second IBC reference block and the current template for the second block, the fixed filter being based on fixed parameters; and encoding or decoding the second block using the second IBC reference block after applying the fixed filter to the second IBC reference block.
[0256] Clause 26C: The method of clause 25C, further comprising determining a fixation parameter based on a dominant direction of the block vector for the second block.
[0257] Clause 27C: The method of clause 25C or 26C, further comprising determining the fixation parameter based on a gradient magnitude of the second IBC reference block or a reference template for the second IBC reference block.
[0258] Clause 28C: A method according to any of clauses 1C to 27C, further comprising encoding or decoding a syntax element indicating whether a coding tool that determines IBC reference blocks, calculates coefficients, and applies filters is enabled or disabled.
[0259] Clause 29C: The method of clause 28C, wherein the syntax element is conditionally signaled based on an intra-block copy (IBC) flag.
[0260] Clause 30C: The method of any one of clauses 28C to 29C, wherein the syntax element is a sequence parameter set (SPS) level syntax element.
[0261] Clause 31C: The method of any one of clauses 28C to 29C, wherein the syntax element is a slice-level syntax element.
[0262] Clause 32C: A device for coding video data, the device comprising one or more means for performing the method according to any of clauses 1C to 31C.
[0263] Clause 33C: The device of clause 32C, wherein the one or more means comprise one or more processors implemented in circuitry.
[0264] Clause 34C: The device of any of clauses 32C and 33C, further comprising a memory for storing video data.
[0265] Clause 35C: The device of any of clauses 32C to 34C, further comprising a display configured to display the decoded video data.
[0266] Clause 36C: The device of any of clauses 32C to 35C, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0267] Clause 37C: A device according to any one of clauses 32C to 36C, wherein the device comprises a video decoder.
[0268] Clause 38C: The device of any of clauses 32C to 37C, wherein the device comprises a video encoder.
[0269] Clause 39C: 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 1C to 31C.
[0270] Clause 1D: A method for decoding video data, the method including: determining a reference block for a current block of a current picture of the video data, the reference block being within the current picture; determining a predictive block based on the reference block; determining whether to apply filtering to the predictive block; comparing a template of the reference block with a template of the current block based on determining that filtering will be applied to the predictive block; filtering the predictive block based on comparing the template of the reference block with the template of the current block to determine a filtered predictive block; decoding the current block based on the filtered predictive block to determine a decoded version of the current block; and outputting a decoded picture of the video data including the decoded version of the current block.
[0271] Clause 2D: The method described in Clause 1D, wherein determining whether to apply filtering to the predicted block includes receiving a flag, a first value of the flag indicating that intra block copy with filtering mode is enabled, and a second value of the flag indicating that intra block copy with filtering mode is disabled.
[0272] Clause 3D: The method described in clause 1C or 2D, wherein determining whether to apply filtering to the predicted block includes determining a size for the current block, and determining that filtering is to be applied to the predicted block includes determining that the size is greater than a threshold size.
[0273] Clause 4D: The method of any one of clauses 1D to 3D, wherein the template of the reference block includes padded samples.
[0274] Clause 5D: A method described in any of clauses 1D to 4D, wherein determining a predictive block for a current block of a current picture of the video data includes determining a block vector for the current block based on a candidate selected from the merge list, and determining whether to apply filtering to the predictive block includes determining whether the predictive block corresponding to the candidate has been determined using filtering.
[0275] Clause 6D: A method described in any of clauses 1D to 6D, wherein determining whether to apply filtering to the predicted block includes determining whether to apply filtering to the predicted block based on the slice type of the current block being intra slice.
[0276] Clause 7D: A method according to any one of clauses 1D to 6D, wherein filtering the predicted block based on comparing a template of the reference block with a template of the current block to determine a filtered predicted block includes determining a filter that minimizes a difference between sample values of the template of the reference block and sample values of the template of the current block, and filtering the predicted block using the determined filter.
[0277] Clause 8D: The method of clause 7D, wherein determining a filter that minimizes the difference between the template sample values of the reference block and the template sample values of the current block includes determining a filter that modifies the template sample values of the current block to reduce the mean square error between the template sample values of the current block and the template sample values of the reference block.
[0278] Clause 9D: A method described in any of clauses 1D to 8D, wherein filtering the predictive block based on comparing a template of the reference block with a template of the current block to determine a filtered predictive block includes determining not to filter the predictive block based on comparing a template of the reference block with a template of the current block so that the filtered predictive block is equal to the predictive block.
[0279] Clause 10D: A method described in any of clauses 1D to 9D, wherein the template of the reference block includes an L-shaped group of samples including samples to the left of the reference block and samples above the reference block used to determine the predicted block, and the template of the current block includes an L-shaped group of samples including samples to the left of the current block and samples above the current block.
[0280] Clause 11D: A method according to any of clauses 1D to 10D, wherein determining a predictive block for a current block of a current picture of the video data includes locating a reference block in the same picture as the current block using a block vector.
[0281] Clause 12D: A method according to any of clauses 1D to 11D, wherein decoding the current block based on the filtered predictive block includes adding residual data to the filtered predictive block to determine a reconstructed block, and applying one or more filter operations to the reconstructed block.
[0282] Clause 13D: The method of any of clauses 1D or 3D to 12D, wherein the decoding method is performed as part of a process for encoding a current block of video data.
[0283] Clause 14D: A device for decoding video data, the device comprising: a memory configured to store video data; and one or more processors implemented in a circuit configuration, the one or more processors configured to: determine a reference block for a current block of a current picture of the video data, where the reference block is within the current picture; determine a predictive block based on the reference block; determine whether to apply filtering to the predictive block; based on determining that filtering will be applied to the predictive block, compare a template of the reference block with a template of the current block; filter the predictive block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predictive block; decode the current block based on the filtered predictive block to determine a decoded version of the current block; and output a decoded picture of the video data including the decoded version of the current block.
[0284] Clause 15D: The device described in Clause 14D, wherein one or more processors are further configured to receive a flag to determine whether to apply filtering to the predicted block, a first value of the flag indicating that intra block copy with filtering mode is enabled, and a second value of the flag indicating that intra block copy with filtering mode is disabled.
[0285] Clause 16D: A device described in Clause 14D or 15D, wherein, to determine whether to apply filtering to the predicted block, the one or more processors are further configured to determine a size for the current block, and, to determine that filtering will be applied to the predicted block, the one or more processors are further configured to determine that the size is greater than a threshold size.
[0286] Clause 17D: A device according to any one of clauses 14D to 16D, wherein the template of the reference block comprises padded samples.
[0287] Clause 18D: A device described in any of Clauses 14D to 17D, wherein, to determine a predictive block for a current block of a current picture of the video data, one or more processors are further configured to determine a block vector for the current block based on a candidate selected from the merge list, and, to determine whether to apply filtering to the predictive block, one or more processors are further configured to determine whether the predictive block corresponding to the candidate has been determined using filtering.
[0288] Clause 19D: A device described in any of Clauses 14D to 18D, wherein, to determine whether to apply filtering to the predicted block, one or more processors are further configured to determine whether to apply filtering to the predicted block based on the slice type of the current block being intra slice.
[0289] Clause 20D: A device described in any of Clauses 14D to 19D, further configured to: determine a filter that minimizes the difference between the sample values of the template of the reference block and the sample values of the template of the current block to filter the predicted block based on comparing the template of the reference block with the template of the current block to determine a filtered predicted block, and filter the predicted block using the determined filter.
[0290] Clause 21D: The device described in Clause 20D, wherein the one or more processors are further configured to determine a filter that modifies the template sample values of the current block to reduce the mean square error between the template sample values of the current block and the template sample values of the reference block, in order to determine a filter that minimizes the difference between the template sample values of the reference block and the template sample values of the current block.
[0291] Clause 22D: A device described in any of Clauses 14D to 21D, wherein the one or more processors are further configured to determine not to filter the predictive block based on comparing a template of the reference block with a template of the current block to determine a filtered predictive block, so that the filtered predictive block is equal to the predictive block, based on comparing a template of the reference block with a template of the current block.
[0292] Clause 23D: A device described in any of clauses 14D to 22D, wherein the template of the reference block includes an L-shaped group of samples including a sample to the left of the reference block and a sample above the reference block used to determine the predicted block, and the template of the current block includes an L-shaped group of samples including a sample to the left of the current block and a sample above the current block.
[0293] Clause 24D: A device described in any of clauses 14D to 23D, wherein one or more processors are further configured to use the block vector to locate a reference block within the same picture as the current block to determine a predictive block for a current block of a current picture of the video data.
[0294] Clause 25D: A device described in any of Clauses 14D to 24D, wherein, to decode a current block based on the filtered predictive block, one or more processors are further configured to add residual data to the filtered predictive block to determine a reconstructed block and apply one or more filter operations to the reconstructed block.
[0295] Clause 26D: The device of any of clauses 14D to 25D, further comprising a display configured to output decoded pictures of the video data.
[0296] Clause 27D: A device described in any of clauses 14D to 26D, further comprising a camera configured to capture unencoded video data, and wherein one or more processors are further configured to encode the unencoded video data.
[0297] Clause 28D: A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to determine a reference block for a current block of a current picture of video data, the reference block being within the current picture; determine a predictive block based on the reference block; determine whether to apply filtering to the predictive block; compare a template of the reference block with a template of the current block based on determining that filtering will be applied to the predictive block; filter the predictive block based on comparing the template of the reference block with the template of the current block to determine a filtered predictive block; decode the current block based on the filtered predictive block to determine a decoded version of the current block; and output a decoded picture of the video data including the decoded version of the current block.
[0298] Clause 29D: A method for encoding video data, the method comprising: determining a reference block for a current block of a current picture of the video data, the reference block being within the current picture; determining a predictive block based on the reference block; determining whether to apply filtering to the predictive block; comparing a template of the reference block with a template of the current block based on determining that filtering will be applied to the predictive block; filtering the predictive block based on comparing the template of the reference block with the template of the current block to determine a filtered predictive block; decoding the current block based on the filtered predictive block to determine a decoded version of the current block; storing a decoded picture of the video data including the decoded version of the current block; and encoding a subsequent block of the video data based on the stored decoded picture.
[0299] It should be appreciated that in some examples, some acts or events of any of the techniques described herein may be performed in a different sequence, added, merged, or omitted entirely (e.g., not all described acts or events may be required to practice the techniques). Moreover, in some examples, acts or events may be performed in parallel rather than sequentially, for example, through multithreading, interrupt processing, or multiple processors.
[0300] 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. As such, computer-readable media may generally correspond to (1) tangible computer-readable storage media that is 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 to implement the techniques described in this disclosure. A computer program product may include a computer-readable medium.
[0301] By way of example, and not limitation, such computer-readable storage media may include one or more of 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 disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically, while discs reproduce data optically using a laser. Combinations of the above should also be included within the scope of computer-readable media.
[0302] 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 in one or more circuits or logic elements.
[0303] 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 have been 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.
[0304] Various examples have been described. These and other examples are within the scope of the following claims.
Claims
1. 1. A method for decoding video data, said method comprising: determining a reference block for a current block of a current picture of the video data, the reference block being within the current picture; determining a prediction block based on the reference block; determining whether to apply filtering to the predicted block; based on determining that the filtering process is to be applied to the predicted block, comparing a template of the reference block with a template of the current block; filtering the predicted block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predicted block; decoding the current block based on the filtered prediction block to determine a decoded version of the current block; and outputting a decoded picture of the video data including the decoded version of the current block.
2. 2. The method of claim 1, wherein determining whether to apply the filtering to the prediction block comprises receiving a flag, a first value of the flag indicating that an intra block copy with filtering mode is enabled, and a second value of the flag indicating that the intra block copy with filtering mode is disabled.
3. 2. The method of claim 1 , wherein determining whether to apply the filtering to the predictive block includes determining a size for the current block, and determining that the filtering will be applied to the predictive block includes determining that the size is greater than a threshold size.
4. The method of claim 1 , wherein the template of the reference block includes padded samples.
5. determining a prediction block for the current block of the current picture of video data includes determining a block vector for the current block based on a candidate selected from a merge list; The method of claim 1 , wherein determining whether to apply the filtering to the predicted block comprises determining whether the predicted block corresponding to the candidate has been determined using the filtering.
6. The method of claim 1 , wherein determining whether to apply the filtering to the prediction block includes determining whether to apply the filtering to the prediction block based on a slice type of the current block being an intra slice.
7. filtering the predicted block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predicted block; determining a filter that minimizes a difference between sample values of the template of the reference block and sample values of the template of the current block; filtering the predicted block with the determined filter. The method of claim 1.
8. 8. The method of claim 7, wherein determining the filter that minimizes the difference between sample values of the template of the reference block and the sample values of the template of the current block comprises determining a filter that modifies the sample values of the template of the current block to reduce a mean square error between the sample values of the template of the current block and the sample values of the template of the reference block.
9. filtering the predicted block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predicted block; 2. The method of claim 1, comprising determining not to filter the predictive block based on the comparison of the template of the reference block with the template of the current block such that the filtered predictive block is equal to the predictive block.
10. the template of the reference block includes an L-shaped group of samples including samples to the left of the reference block and samples above the reference block used to determine the prediction block; The method of claim 1 , wherein the template for the current block comprises an L-shaped group of samples including the samples to the left of the current block and samples above the current block.
11. 2. The method of claim 1, wherein determining the predictive block for the current block of the current picture of video data comprises using a block vector to locate a reference block in the same picture as the current block.
12. decoding the current block based on the filtered prediction block; adding residual data to the filtered prediction block to determine a reconstructed block; and applying one or more filter operations to the reconstructed blocks.
13. 10. The method of claim 1, wherein the method of decoding is performed as part of a process of encoding the current block of video data.
14. 1. A device for decoding video data, said device comprising: a memory configured to store video data; and one or more processors implemented in a circuit configuration, the one or more processors comprising: determining a reference block for a current block of a current picture of the video data, the reference block being within the current picture; determining a prediction block based on the reference block; determining whether to apply filtering to the predicted block; based on determining that the filtering process is to be applied to the predicted block, comparing a template of the reference block with a template of the current block; filtering the predicted block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predicted block; decoding the current block based on the filtered prediction block to determine a decoded version of the current block; outputting a decoded picture of the video data including the decoded version of the current block.
15. 15. The device of claim 14, wherein to determine whether to apply the filtering to the predictive block, the one or more processors are further configured to receive a flag, a first value of the flag indicating that intra block copy with filtering mode is enabled, and a second value of the flag indicating that intra block copy with filtering mode is disabled.
16. To determine whether to apply the filtering to the prediction block, the one or more processors are further configured to determine a size for the current block; 15. The device of claim 14, wherein the one or more processors are further configured to determine that the size is greater than a threshold size to determine that the filtering is to be applied to the prediction block.
17. The device of claim 14 , wherein the template of the reference block includes padded samples.
18. to determine the predictive block for the current block of the current picture of video data, the one or more processors are further configured to determine a block vector for the current block based on a candidate selected from a merge list; 15. The device of claim 14, wherein, to determine whether to apply the filtering to the predicted block, the one or more processors are further configured to determine whether the predicted block corresponding to the candidate has been determined using the filtering.
19. 15. The device of claim 14, wherein, to determine whether to apply the filtering to the prediction block, the one or more processors are further configured to determine whether to apply the filtering to the prediction block based on a slice type of the current block being an intra slice.
20. the one or more processors to filter the predictive block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predictive block; determining a filter that minimizes a difference between the template sample values of the reference block and the template sample values of the current block; The device of claim 14 , further configured to filter the predicted block with the determined filter.
21. 21. The device of claim 20, wherein to determine the filter that minimizes the difference between sample values of the template of the reference block and the sample values of the template of the current block, the one or more processors are further configured to determine a filter that modifies the sample values of the template of the current block to reduce a mean square error between the sample values of the template of the current block and the sample values of the template of the reference block.
22. the one or more processors to filter the predictive block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predictive block; 15. The device of claim 14, further configured to determine not to filter the predictive block based on the comparison of the template of the reference block with the template of the current block such that the filtered predictive block is equal to the predictive block.
23. the template of the reference block includes an L-shaped group of samples including samples to the left of the reference block and samples above the reference block used to determine the prediction block; The device of claim 14 , wherein the template for the current block includes an L-shaped group of samples including the samples to the left of the current block and samples above the current block.
24. 15. The device of claim 14, wherein the one or more processors are further configured to: locate a reference block in the same picture as the current block using a block vector to determine the predictive block for the current block of the current picture of video data.
25. to decode the current block based on the filtered prediction block, the one or more processors: adding residual data to the filtered prediction block to determine a reconstructed block; The device of claim 14 , further configured to apply one or more filter operations to the reconstructed blocks.
26. The device of claim 14 , further comprising a display configured to output the decoded pictures of the video data.
27. a camera configured to capture unencoded video data; The device of claim 14 , wherein the one or more processors are further configured to encode the unencoded video data.
28. 1. A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to: determining a reference block for a current block of a current picture of the video data, the reference block being within the current picture; determining a prediction block based on the reference block; determining whether to apply filtering to the predicted block; based on determining that the filtering process is to be applied to the predicted block, comparing a template of the reference block with a template of the current block; filtering the predicted block based on the comparison of the template of the reference block with the template of the current block to determine a filtered predicted block; decoding the current block based on the filtered predicted block to determine a decoded version of the current block; outputting a decoded picture of the video data including the decoded version of the current block. A computer-readable storage medium.