Template selection for intra prediction in video coding

By introducing a threshold comparison mechanism and mode index into the video decoder, selecting an appropriate template and applying the CCCM mode, the problem of inefficient video decoding in the prior art is solved, and a more efficient decoding process and smaller Bitstream size.

CN119487833APending Publication Date: 2025-02-18QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380049673.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-06-21
Filing Date
2023-06-22
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing video decoding technology has inefficient problems in template selection, resulting in low decoding efficiency and large bitstream size.

Method used

By introducing a threshold comparison mechanism in the video decoder, it is determined whether the template is allowed based on the number of reference samples in the selected template. The pattern index is used to indicate the template selected from multiple templates and to apply a convolutional cross-component model (CCCM) mode to predict the chromaticity sample based on the reconstructed luminance sample of the current CU and the reference sample in the selected template.

Benefits of technology

Improve the efficiency of video decoding, reduce the bitstream size, and optimize the decoding process through innovative methods of template selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119487833A_ABST
    Figure CN119487833A_ABST
Patent Text Reader

Abstract

A method of coding video data includes determining whether to allow a selected template based on a comparison of a threshold value and a number of reference samples in the selected template, where a mode index indicates which template from among a plurality of templates is the selected template, where the number of reference samples is greater than the number of reference samples in the selected template. Each of the templates includes a different set of reconstructed samples adjacent to a current coding unit (CU) of a current picture of the video data; based on determining that the selected template is allowed and a convolutional cross component model (CCCM) mode is to be used, applying the CCCM mode to predict chroma samples of the current CU based on reconstructed luma samples of the current CU and reference samples in the selected template; and encoding or decoding the current CU based on the predicted chroma samples of the current CU.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This patent application claims priority to U.S. Patent Application No. 18 / 338,756 filed on June 21, 2023, U.S. Provisional Patent Application No. 63 / 377,666 filed on September 29, 2022, and U.S. Provisional Patent Application No. 63 / 367,709 filed on July 5, 2022, the entire contents of each of which are incorporated herein by reference. U.S. Patent Application No. 18 / 338,756 filed on June 21, 2023 claims priority to U.S. Provisional Patent Application No. 63 / 377,666 filed on September 29, 2022, and U.S. Provisional Patent Application No. 63 / 367,709 filed on July 5, 2022. Technical Field

[0002] The present disclosure relates to video encoding and video decoding. Background Art

[0003] Digital video capabilities may be incorporated into a variety 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 game devices, video game consoles, cellular or satellite radio telephones, so-called "smart phones", video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video coding techniques, such as those described in the 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 of 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 send, 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 eliminate redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) may be divided into video blocks, which may also be referred to as coding tree units (CTUs), coding units (CUs), and / or coding nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction relative to reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial prediction relative to reference samples in neighboring blocks in the same picture, or temporal prediction relative to reference samples in other reference pictures. Pictures may be referred to as frames, and reference pictures may be referred to as reference frames. Summary of the invention

[0005] In general, the present disclosure describes techniques for template selection in video coding. A video coder (e.g., a video encoder or a video decoder) may determine whether a selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template. A pattern index may indicate which template from a plurality of templates is the selected template. Each of the templates includes a different set of reconstructed samples adjacent to a current coding unit (CU) of a current picture of video data. Based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, a CCCM model is applied to predict chrominance samples of the current CU based on reconstructed luminance samples of the current CU and reference samples in the selected template. As opposed to having only one possible template, selecting a template from among a plurality of templates may improve coding efficiency, thereby potentially producing a smaller bitstream.

[0006] In one example, the present disclosure describes a method for decoding video data, the method comprising: determining whether a selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current decoding unit (CU) of a current picture of the video data; based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, applying the CCCM mode to predict chroma samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template; and encoding or decoding the current CU based on the predicted chroma samples of the current CU.

[0007] In another example, the present disclosure describes a device for encoding or decoding video data, the device comprising: a memory configured to store the video data; one or more processors implemented in a circuit, the one or more processors configured to: determine whether the selected template is allowed based on a comparison of a threshold and the number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current decoding unit (CU) of a current picture of the video data; based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, apply the CCCM mode to predict chroma samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template; and encode or decode the current CU based on the predicted chroma samples of the current CU.

[0008] In another example, the present disclosure describes a non-temporary computer-readable storage medium having instructions stored thereon, which, when executed, cause one or more processors to: determine whether the selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current decoding unit (CU) of a current picture of video data; based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, apply the CCCM mode to predict chroma samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template; and encode or decode the current CU based on the predicted chroma samples of the current CU.

[0009] In another example, the present disclosure describes a device for encoding or decoding video data, the device comprising: a unit for determining whether a selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current decoding unit (CU) of a current picture of the video data; a unit for applying a convolutional cross-component model (CCCM) mode to predict chroma samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template based on determining that the selected template is allowed and the CCCM mode is to be used; and a unit for encoding or decoding the current CU based on the predicted chroma samples of the current CU.

[0010] One or more example details are set forth in the accompanying drawings and the following description. Other features, objects, and advantages will be apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 is a block diagram illustrating an example video encoding and decoding system that may perform the techniques of this disclosure.

[0012] Figure 2 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure.

[0013] Figure 3 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure.

[0014] Figure 4 is a conceptual diagram illustrating example luma and chroma samples used to derive a linear model.

[0015] Figure 5 is a conceptual diagram showing an example of classifying adjacent samples into two groups.

[0016] Figure 6 is a conceptual diagram showing neighboring reconstructed samples for chroma decoder-side intra mode derivation.

[0017] Fig. 7A is a conceptual diagram showing a model created with a cross-component linear model.

[0018] Figure 7B is a conceptual diagram illustrating the effect of a slope adjustment parameter.

[0019] Figure 8 is a conceptual diagram showing the spatial part of a convolution filter.

[0020] Fig. 9 is a conceptual diagram illustrating a full template used by a current coding unit (CU) according to techniques of this disclosure.

[0021] Fig. 10A is a conceptual diagram illustrating a top template including a top-left sample used by a current CU according to techniques of this disclosure.

[0022] Fig. 10B is a conceptual diagram illustrating a top template used by a current CU excluding the top-left sample according to the techniques of this disclosure.

[0023] Fig.11A is a conceptual diagram illustrating a left template including a top-left sample used by a current CU according to the techniques of this disclosure.

[0024] Fig. 11B is a conceptual diagram illustrating a left template used by a current CU excluding the top-left sample according to the techniques of this disclosure.

[0025] Fig. 12A and 12B is a conceptual diagram illustrating a template divided from a full template according to the technology of the present disclosure.

[0026] Fig.13A and 13B is a conceptual diagram showing templates on the same side according to the technology of the present disclosure.

[0027] Fig.14 is a flowchart illustrating an example method for encoding a current block according to techniques of this disclosure.

[0028] Fig.15 is a flow chart illustrating an example method for decoding a current block according to techniques of this disclosure.

[0029] Fig.16 is a flowchart illustrating an example method for encoding or decoding video data in accordance with techniques of this disclosure. DETAILED DESCRIPTION

[0030] The video coder may use specific coding tools in video coding, such as a convolutional cross-component model (CCCM) for intra-frame prediction, a cross-component linear model with slope adjustment, or chroma fusion for intra-frame prediction. These coding tools use a reconstructed neighboring sample set for the current coding unit (CU). However, the reconstructed neighboring sample set used in these coding tools is fixed. That is, these coding tools always use the same reconstructed neighboring sample set, regardless of the position of the current CU within the picture, or whether other reconstructed neighboring sample sets will result in better coding efficiency.

[0031] In general, the present disclosure describes techniques for template selection in video coding. A video coder (e.g., a video encoder or a video decoder) may determine whether to allow a selected template based on a comparison of a threshold with the number of reference samples in the selected template, wherein a mode index may indicate which template from a plurality of templates is the selected template. The mode index may be signaled in a bitstream. The video encoder may select the mode index to optimize coding efficiency. Each of the templates includes a different set of reconstructed samples adjacent to a current coding unit (CU) of a current picture of video data. Based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, the video coder may apply the CCCM mode to predict chrominance samples of the current CU based on reconstructed luminance samples of the current CU and reference samples in the selected template. In other examples, the video coder may use coding tools other than CCCM, such as a cross-component linear model with slope adjustment or chrominance fusion. The ability to select a template from among a plurality of templates may improve coding efficiency because different templates may produce different linear models that may have different degrees of accuracy.

[0032] Figure 1 1 is a block diagram illustrating an example video encoding and decoding system 100 that can perform the techniques of the present disclosure. The techniques of the present disclosure are generally directed to decoding (encoding and / or decoding) video data. Generally, video data includes any data used to process video. Therefore, video data can include original unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.

[0033] like Figure 1 As shown, 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. In particular, source device 102 provides video data to destination device 116 via computer-readable medium 110. Source device 102 and destination device 116 may include any of a variety of devices, including desktop computers, notebook (i.e., laptop) computers, mobile devices, tablets, set-top boxes, telephone handsets (e.g., smart phones), televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, broadcast receiver devices, etc. In some cases, source device 102 and destination device 116 may be equipped for wireless communication and may therefore be referred to as wireless communication devices.

[0034] exist Figure 1In the example of , 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 the present disclosure, the video encoder 200 of source device 102 and the video decoder 300 of destination device 116 can be configured to apply techniques for intra-frame prediction in video decoding. Therefore, source device 102 represents an example of a video encoding device, and destination device 116 represents an example of a video decoding device. In other examples, source device and destination device may include other components or arrangements. For example, source device 102 may receive video data from an external video source such as an external camera. Similarly, destination device 116 may be connected to an external display device with an interface, rather than including an integrated display device.

[0035] like Figure 1 The system 100 shown is only an example. In general, any digital video encoding and / or decoding device can perform techniques for intra-frame prediction in video decoding. The source device 102 and the destination device 116 are only examples of such decoding devices, wherein the source device 102 generates decoded video data for transmission to the destination device 116. The present disclosure refers to a "decoding" device as a device that performs decoding (encoding and / or decoding) of data. Therefore, the video encoder 200 and the video decoder 300 represent examples of decoding devices, specifically video encoders and video decoders, respectively. In some examples, the source device 102 and the destination device 116 can operate in a substantially symmetrical manner, so that each device in the source device 102 and the destination device 116 includes a video encoding and decoding component. Therefore, the system 100 can support one-way or two-way video transmission between the source device 102 and the destination device 116, for example, for video streaming, video playback, video broadcasting, or video telephony.

[0036] Typically, the video source 104 represents a source of video data (i.e., original, uncoded video data), and provides a sequence of pictures (also referred to as "frames") of the video data to the video encoder 200, which encodes the data of the pictures. The video source 104 of the source device 102 may include a video capture device, such as a camera, a video archive containing previously captured original video, and / or a video feed interface for receiving video from a video content provider. As another alternative, the video source 104 may generate computer graphics-based data as the source video, or a combination of real-time video, archived video, and computer-generated video. In each case, the video encoder 200 encodes the captured, pre-captured, or computer-generated video data. The video encoder 200 may rearrange the pictures from the receiving order (sometimes referred to as the "display order") to the decoding order for decoding. The video encoder 200 may generate a bitstream including the encoded video data. Source device 102 may then output the encoded video data onto computer-readable medium 110 via output interface 108 for receipt and / or retrieval by, for example, input interface 122 of destination device 116 .

[0037] The memory 106 of the source device 102 and the memory 120 of the destination device 116 represent general purpose memory. In some examples, the memories 106, 120 can store original video data, for example, original video from the video source 104 and original decoded video data from the video decoder 300. In addition or alternatively, the memories 106, 120 can store software instructions that can be executed by, for example, the video encoder 200 and the video decoder 300, respectively. Although the memory 106 and the memory 120 are shown separately from the video encoder 200 and the video decoder 300 in this example, it should be understood that the video encoder 200 and the video decoder 300 can also include internal memory to achieve functionally similar or equivalent purposes. In addition, the memories 106, 120 can store, for example, encoded video data output from the video encoder 200 and input to the video decoder 300. In some examples, portions of the memories 106, 120 can be allocated as one or more video buffers, for example, to store original video data, decoded video data, and / or encoded video data.

[0038] The computer-readable medium 110 may represent any type of medium or device capable of transmitting the 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 for enabling the source device 102 to send the encoded video data directly to the destination device 116 in real time (e.g., via a radio frequency network or a computer-based network). According to a communication standard such as a wireless communication protocol, the output interface 108 may modulate a transmission signal including the encoded video data, and the input interface 122 may demodulate the received transmission signal. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form a portion 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 a router, a switch, a base station, or any other device that can be used to facilitate communication from the source device 102 to the destination device 116.

[0039] In some examples, source device 102 may output the encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access the 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 for storing encoded video data.

[0040] In some examples, source device 102 may output the encoded video data to file server 114 or another intermediate storage device, which may store the encoded video data generated by source device 102. Destination device 116 may access the stored video data from file server 114 via streaming or downloading.

[0041] The file server 114 may be any type of server device capable of storing encoded video data and sending the encoded video data to the destination device 116. The file server 114 may represent a website server (e.g., for a website), a server configured to provide file transfer protocol services (such as the File Transfer Protocol (FTP) or the 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, and the like.

[0042] 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 the 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 discussed above for retrieving or receiving media data from file server 114, or other such protocols for retrieving media data.

[0043] Output interface 108 and input interface 122 may represent wireless transmitters / receivers, modems, wired networking components (e.g., Ethernet cards), wireless communication components that operate according to any of the various IEEE 802.11 standards, or other physical components. In examples where output interface 108 and input interface 122 include wireless components, output interface 108 and input interface 122 may be configured to forward data such as encoded video data according to cellular communication standards such as 4G, 4G-LTE (Long Term Evolution), LTE Advanced, 5G, etc. In some examples where output interface 108 includes a wireless transmitter, output interface 108 and input interface 122 may be configured to forward data such as encoded video data according to other wireless standards such as IEEE 802.11 specifications, IEEE 802.15 specifications (e.g., ZigBee 5G, etc.). TM ),Bluetooth TMStandards, etc.) to forward data such as encoded video data. 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 to perform functions belonging to video encoder 200 and / or output interface 108, and destination device 116 may include an SoC device to perform functions belonging to video decoder 300 and / or input interface 122.

[0044] The techniques of the present disclosure may be applied to video decoding to support any of a variety of multimedia applications, such as over-the-air television broadcasts, cable television transmissions, satellite television transmissions, Internet streaming video transmissions (e.g., Dynamic Adaptive Streaming over HTTP (DASH)), digital video encoded onto a data storage medium, decoding of digital video stored on a data storage medium, or other applications.

[0045] The input interface 122 of the destination device 116 receives an encoded video bitstream from the computer-readable medium 110 (e.g., a communication medium, a storage device 112, a file server 114, etc.). The encoded video bitstream may include signaling information defined by the video encoder 200, which is also used by the video decoder 300, such as syntax elements with values ​​describing characteristics and / or processing of video blocks or other decoding 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.

[0046] Although not in Figure 1 , but 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 process a multiplexed stream including both audio and video in a common data stream.

[0047] The video encoder 200 and the video decoder 300 can each be implemented as any of a variety of suitable encoder and / or decoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic circuits, software, hardware, firmware, or any combination thereof. When the technology is partially implemented in software, the device may store instructions for the software in a suitable non-transitory computer-readable medium and use one or more processors to execute the instructions in hardware to perform the technology of the present disclosure. Each of the video encoder 200 and the video decoder 300 can be included in one or more encoders or decoders, any of which can be integrated as part of a combined encoder / decoder (CODEC) in a corresponding device. The device including the video encoder 200 and / or the video decoder 300 may include an integrated circuit, a microprocessor, and / or a wireless communication device, such as a cellular phone.

[0048] 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 an extension thereof, such as multi-view 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 Versatile Video Coding (VVC). In some examples, the video encoder 200 and the video decoder 300 may operate according to an Essential Video Coding (EVC) codec. In other examples, the video encoder 200 and the video decoder 300 may operate according to a proprietary video codec / format such as AOMedia Video 1 (AV1), an extension of AV1, and / or a subsequent version of AV1 (e.g., AV2). In other examples, the video encoder 200 and the video decoder 300 may operate according to other proprietary formats or industry standards. However, the techniques of the present 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 prediction in video coding.

[0049] Typically, the video encoder 200 and the video decoder 300 can perform block-based decoding of the picture. The term "block" generally refers to a structure that includes data to be processed (e.g., encoded, decoded, or otherwise used in the encoding and / or decoding process). For example, a block may include a two-dimensional matrix of samples of luminance and / or chrominance data. Typically, the video encoder 200 and the video decoder 300 can decode video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, instead of decoding the red, green, and blue (RGB) data of the samples of the picture, the video encoder 200 and the video decoder 300 can decode the luminance component and the chrominance component, wherein the chrominance component may include both a red-tone component and a blue-tone chrominance component. In some examples, the video encoder 200 converts the received RGB format data into a YUV representation before encoding, and the video decoder 300 converts the YUV representation into an RGB format. Alternatively, a pre-processing unit and a post-processing unit (not shown) can perform these conversions.

[0050] The present disclosure may generally relate to the decoding (e.g., encoding and decoding) of a picture to include the process of encoding or decoding the data of the picture. Similarly, the present disclosure may relate to the decoding of a block of a picture to include the process of encoding or decoding the data of the block, for example, prediction and / or residual decoding. The encoded video bitstream typically includes a series of values ​​for syntax elements that represent decoding decisions (e.g., decoding modes) and the partitioning of the picture into blocks. Therefore, references to decoding a picture or a block should generally be understood as decoding the values ​​of the syntax elements used to form the picture or the block.

[0051] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video decoder (e.g., video encoder 200) divides a coding tree unit (CTU) into CUs according to a quadtree structure. That is, the video decoder divides the CTU and CU into four equal non-overlapping squares, and each node of the quadtree has zero or four child nodes. A node without child nodes may be referred to as a "leaf node", and the CU of such a leaf node may include one or more PUs and / or one or more TUs. The video decoder may further divide the PU and TU. For example, in HEVC, a residual quadtree (RQT) represents the division of a TU. In HEVC, a PU represents inter-frame prediction data, and a TU represents residual data. An intra-predicted CU includes intra-frame prediction information, such as an intra-frame mode indication.

[0052] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to VVC. According to VVC, a video decoder (such as the video encoder 200) divides a picture into a plurality of coding tree units (CTUs). The video encoder 200 may divide the CTU 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 CU, PU, ​​and TU of HEVC. The QTBT structure includes two levels: a first level divided according to quadtree partitioning, and a second level divided according to binary tree partitioning. The root node of the QTBT structure corresponds to the CTU. The leaf nodes of the binary tree correspond to the coding units (CUs).

[0053] In the MTT partition structure, blocks can be partitioned using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of ternary tree (TT) (also known as ternary tree (TT)) partitioning. A ternary tree or ternary tree partition is a partition that divides a block into three sub-blocks. In some examples, the ternary tree or ternary tree partition divides the block into three sub-blocks without dividing the original block via the center. The partition types in MTT (e.g., QT, BT, and TT) can be symmetric or asymmetric.

[0054] When operating according to the AV1 codec, the video encoder 200 and the video decoder 300 may be configured to decode the video data in the block. In AV1, the largest decoding block that can be processed is called a super block. In AV1, a super block may be 128×128 luma samples or 64×64 luma samples. However, in subsequent video coding formats (e.g., AV2), super blocks may be defined by different (e.g., larger) luma sample sizes. In some examples, the super block is the top level of the block quadtree. The video encoder 200 may further divide the super block into smaller decoding blocks. The video encoder 200 may divide the super block and other decoding blocks into smaller blocks using square or non-square partitioning. Non-square blocks may include N / 2×N, N×N / 2, N / 4×N, and N×N / 4 blocks. The video encoder 200 and the video decoder 300 may perform separate prediction and transform processing on each decoding block.

[0055] AV1 also defines tiles of video data. A tile is a rectangular array of super blocks that can be decoded independently of other tiles. That is, the video encoder 200 and the video decoder 300 can encode and decode coded blocks within a tile, respectively, without using video data from other tiles. However, the video encoder 200 and the video decoder 300 can perform filtering across tile boundaries. The size of the tiles can be uniform or non-uniform. Tile-based decoding can enable parallel processing and / or multi-threading for encoder and decoder implementations.

[0056] 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 luma components and the chroma components, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT or MTT structures, such as one QTBT / MTT structure for the luma component and another QTBT / MTT structure for the two chroma components (or two QTBT / MTT structures for the corresponding chroma components).

[0057] The video encoder 200 and the video decoder 300 may be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, super block partitioning, or other partitioning structures.

[0058] In some examples, a CTU includes: a coding tree block (CTB) of luma samples of a picture having three sample arrays, two corresponding CTBs of chroma samples, or a CTB of samples of a monochrome picture or a picture coded using three separate color planes; and a syntax structure for coding the samples. A CTB can be an N×N block of samples for some value of N, so that the division of components into CTBs is a "partition". A component is an array or a single sample from one of the three arrays (luminance and two chroma) that make up a picture of 4:2:0, 4:2:2, or 4:4:4 color format, or an array or a single sample of an array that makes up a picture of monochrome format. In some examples, a coding block is an M×N block of samples for certain values ​​of M and N, so that the division of a CTB into coding blocks is a "partition".

[0059] Blocks (e.g., CTUs or CUs) can be grouped in various ways in a picture. As an example, a brick may refer to a rectangular area of ​​a CTU row within a particular tile in a picture. A tile may be a rectangular area of ​​a CTU within a particular tile column and a particular tile row in a picture. A tile column refers to a rectangular area of ​​a CTU having a height equal to the picture height and a width specified by a syntax element (e.g., such as in a picture parameter set). A tile row refers to a rectangular area of ​​a CTU having a height specified by a syntax element (e.g., such as in a picture parameter set) and a width equal to the picture width.

[0060] In some examples, a tile may be divided into a plurality of blocks, each of which may include one or more CTU rows within the tile. A tile that is not divided into a plurality of blocks may also be referred to as a block. However, a block that is a true subset of a tile may not be referred to as a tile. Blocks in a picture may also be arranged in slices. A slice may be an integer number of blocks in a picture that may be exclusively contained in a single network abstraction layer (NAL) unit. In some examples, a slice includes several complete tiles or a continuous sequence of complete blocks that include only one tile.

[0061] This disclosure may use "N×N" and "N by N" interchangeably to refer to the sample size of a block (e.g., a CU or other video block) in terms of vertical and horizontal dimensions, such as 16×16 samples or 16 by 16 samples. Typically, a 16×16 CU has 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an N×N CU typically has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. The samples in a CU may be arranged in rows and columns. In addition, a CU does not necessarily have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may include N×M samples, where M is not necessarily equal to N.

[0062] The video encoder 200 encodes the video data representing prediction information and / or residual information and other information of the CU. The prediction information indicates how the CU will be predicted in order to form a prediction block for the CU. The residual information generally represents the sample-by-sample difference between the samples of the CU before encoding and the prediction block.

[0063] In order to predict a CU, the video encoder 200 may generally form a prediction block for the CU by inter-frame prediction or intra-frame prediction. Inter-frame prediction generally refers to predicting a CU based on data of a previously decoded picture, while intra-frame prediction generally refers to predicting a CU based on previously decoded data of the same picture. In order to perform inter-frame prediction, the video encoder 200 may use one or more motion vectors to generate a prediction block. The video encoder 200 may generally perform motion search, for example, according to the difference between the CU and the reference block to identify a reference block that closely matches the CU. The video encoder 200 may calculate a difference metric using the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean square difference (MSD), or other such difference calculations to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 may use unidirectional prediction or bidirectional prediction to predict the current CU.

[0064] Some examples of VVC also provide an affine motion compensation mode, which can be considered an inter-frame prediction mode. In the affine motion compensation mode, the video encoder 200 can determine two or more motion vectors representing non-translational motion (e.g., zooming in or out, rotation, perspective motion, or other irregular motion types).

[0065] To perform intra prediction, the video encoder 200 may select an intra prediction mode to generate a prediction block. Some examples of VVC provide 67 intra prediction modes, including various directional modes, as well as a planar mode and a DC mode. Typically, the video encoder 200 selects an intra prediction mode that describes neighboring samples of a current block that are used to predict samples of a current block (e.g., a block of a CU). Assuming that the video encoder 200 decodes CTUs and CUs in a raster scan order (from left to right, from top to bottom), such samples may typically be above, above left, or to the left of the current block in the same picture as the current block.

[0066] The video encoder 200 encodes data representing the prediction mode of the current block. For example, for inter-frame prediction mode, the video encoder 200 can encode data indicating which of the various available inter-frame prediction modes is used and motion information of the corresponding mode. For unidirectional or bidirectional inter-frame prediction, for example, the video encoder 200 can encode the motion vector using advanced motion vector prediction (AMVP) or merge mode. The video encoder 200 can use a similar mode to encode the motion vector of the affine motion compensation mode.

[0067] AV1 includes two general techniques for encoding and decoding coded blocks of video data. The two general techniques are intra prediction (e.g., intra prediction or spatial prediction) and inter prediction (e.g., inter prediction or temporal prediction). In the context of AV1, when an intra prediction mode is used to predict a block of a current frame of video data, the video encoder 200 and the video decoder 300 do not use video data from other frames of the video data. For most intra prediction modes, the video encoder 200 encodes a block of the current frame based on the difference between the sample values ​​in the current block and the prediction values ​​generated from the reference samples in the same frame. The video encoder 200 determines the prediction values ​​generated from the reference samples based on the intra prediction mode.

[0068] After a 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 (e.g., a residual block) represents the sample-by-sample difference between the block and a prediction block of the block formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to generate transformed 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 after the first transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), and the like. The video encoder 200 generates transform coefficients after applying one or more transforms.

[0069] As described above, after any transforms used to produce transform coefficients, the video encoder 200 may perform quantization of the transform coefficients. Quantization generally refers to the process of quantizing transform coefficients to possibly reduce the amount of data used to represent the transform coefficients, thereby providing further compression. By performing the quantization process, the video encoder 200 may reduce the bit depth associated with some or all transform coefficients. For example, the video encoder 200 may round 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.

[0070] After quantization, the video encoder 200 may scan the transform coefficients to generate a one-dimensional vector from a two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place transform coefficients of higher energy (and therefore lower frequency) at the front of the vector and transform coefficients of lower energy (and therefore higher frequency) at the back of the vector. In some examples, the video encoder 200 may scan the quantized transform coefficients using a predefined scan order to generate a serialized vector, and then entropy encode the quantized transform coefficients of the vector. In other examples, the video encoder 200 may perform adaptive scanning. After scanning the quantized transform coefficients to form a one-dimensional vector, the video encoder 200 may entropy encode the one-dimensional vector, for example, according to context adaptive binary arithmetic coding (CABAC). The video encoder 200 may also entropy encode the values ​​of syntax elements that describe metadata associated with the encoded video data for use by the video decoder 300 when decoding the video data.

[0071] To perform CABAC, the video encoder 200 may assign context within a context model to a symbol to be transmitted. The context may relate to, for example, whether neighboring values ​​of the symbol are zero values. The probability determination may be based on the context assigned to the symbol.

[0072] The video encoder 200 may also generate syntax data, such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, for example in 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 the video decoder 300. The video decoder 300 may similarly decode such syntax data to determine how to decode the corresponding video data.

[0073] In this way, the video encoder 200 can generate a bitstream including encoded video data, such as: a syntax element describing the division of a picture into blocks (e.g., CUs) and prediction information and / or residual information of the blocks. Finally, the video decoder 300 can receive the bitstream and decode the encoded video data.

[0074] In general, the video decoder 300 performs a reciprocal process of the process performed by the video encoder 200 to decode the encoded video data of the bitstream. For example, the video decoder 300 may use CABAC to decode the values ​​of the syntax elements of the bitstream in a manner that is substantially similar to the CABAC encoding process of the video encoder 200, although reciprocal. The syntax elements may define partitioning information for partitioning a picture into CTUs, and partitioning each CTU according to a corresponding partitioning structure (e.g., a QTBT structure) to define CUs of the CTU. The syntax elements may further define prediction information and residual information for a block (e.g., a CU) of video data.

[0075] The residual information may be represented by, for example, quantized transform coefficients. The video decoder 300 may inverse quantize and inverse transform the quantized transform coefficients of the block to reproduce a residual block for the block. The video decoder 300 uses the signaled prediction mode (intra-frame prediction or inter-frame prediction) and related prediction information (e.g., motion information for inter-frame prediction) to form a prediction block for the block. The video decoder 300 may then combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process to reduce visual artifacts along the boundaries of the blocks.

[0076] The present disclosure may generally refer to "signaling" certain information, such as syntax elements. The term "signaling" may generally refer to the communication of values ​​of syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 may signal the values ​​of syntax elements in a bitstream. Typically, signaling refers to generating values ​​in a bitstream. As described above, source device 102 may transmit the bitstream to destination device 116 in substantially real time or in non-real time (such as may occur when storing syntax elements to storage device 112 for later retrieval by destination device 116).

[0077] According to the technology of the present disclosure, the video encoder 200 and the video decoder 300 can determine whether to allow the selected template based on a comparison of a threshold value with the number of reference samples in the selected template. The mode index can indicate which template from a plurality of templates is the selected template. Each of the templates includes a different set of reconstructed samples adjacent to the current CU of the current picture of the video data. If the selected template is allowed and the CCCM mode is to be used for the current CU, the video encoder 200 and the video decoder 300 can apply the CCCM mode to predict the chrominance samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template. If the selected template is not allowed or the CCCM mode is not used for the current CU, the video encoder 200 and the video decoder 300 can use another decoding tool, such as a linear mode. The CCCM model can predict the chrominance samples of the current CU based on applying a filter to the luminance samples of the current CU. The coefficients of the filter can be based on the samples in the selected template. The video encoder 200 and the video decoder 300 can encode or decode the current CU based on the predictor of the current CU.

[0078] Figure 2 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. Figure 2 For purposes of illustration, and should not be considered limiting of the techniques broadly illustrated and described in this disclosure. For purposes of illustration, this disclosure describes a video encoder 200 in accordance with techniques of VVC (ITU-T H.266, under development) and HEVC (ITU-T H.265). However, the techniques of this disclosure may be performed by a video encoding device configured for other video coding standards and video coding formats, such as AV1 and successors to the AV1 video coding format.

[0079] exist Figure 2In the example of , the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any one or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the filter unit 216, the DPB 218, and the entropy coding unit 220 may be implemented in one or more processors or in processing circuits. For example, the units of the video encoder 200 may be implemented as one or more circuits or logic elements as part of a hardware circuit or as part of a processor, ASIC, or FPGA. In addition, the video encoder 200 may include additional or alternative processors or processing circuits to perform these and other functions.

[0080] The video data memory 230 may store video data to be encoded by the components of the video encoder 200. The video encoder 200 may receive video data from, for example, the video source 104 ( Figure 1 ) receives video data stored in video data memory 230. DPB 218 can be used as a reference picture memory that stores reference video data for use by the video encoder 200 when predicting subsequent video data. Video data memory 230 and DPB 218 can be formed by any of a variety of storage devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM) or other types of storage devices. Video data memory 230 and DPB 218 can be provided by the same storage device or a separate storage device. In various examples, video data memory 230 can be on-chip with other components of video encoder 200 (as shown), or off-chip relative to those components.

[0081] In the present disclosure, references to the video data memory 230 should not be construed as limited to memory internal to the video encoder 200, unless specifically described as such, or memory external to the video encoder 200, unless specifically described as such. Rather, references to the video data memory 230 should be understood as a reference memory that stores video data received by the video encoder 200 for encoding (e.g., video data of a current block to be encoded). Figure 1 The memory 106 may also provide temporary storage for the outputs of the various units of the video encoder 200 .

[0082] Show Figure 2 The various units of the video encoder 200 are provided to help understand the operations performed by the video encoder 200. These units can be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide specific functions and are pre-set to executable operations. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functions in executable operations. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., to receive parameters or output parameters), but the type of operation performed by the fixed-function circuit is generally immutable. 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.

[0083] The video encoder 200 may include an arithmetic logic unit (ALU), an elementary function unit (EFU), a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example where the operation of the video encoder 200 is performed using software executed by a programmable circuit, the memory 106 ( Figure 1 ) may store instructions (eg, object code) for software received and executed by the video encoder 200, or another memory (not shown) within the video encoder 200 may store such instructions.

[0084] The video data memory 230 is configured to store received video data. The video encoder 200 may extract a picture of 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 original video data to be encoded.

[0085] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode selection unit 202 may include other functional units to perform video prediction according to other prediction modes. As an example, the mode selection 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, and the like.

[0086] The mode selection unit 202 typically coordinates multiple encoding passes to test combinations of encoding parameters and the resulting rate-distortion values ​​for such combinations. The encoding parameters may include: CTU to CU partitioning, prediction mode for CU, transform type for CU residual data, quantization parameter for CU residual data, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that has a better rate-distortion value than other tested combinations.

[0087] The video encoder 200 may divide the picture retrieved from the video data memory 230 into a series of CTUs and encapsulate one or more CTUs in a slice. The mode selection unit 202 may divide the CTUs of the picture according to a tree structure (e.g., the MTT structure, QTBT structure, super block structure, or quadtree structure described above). As described above, the video encoder 200 may form one or more CUs by dividing the CTUs according to the tree structure. Such CUs are also generally referred to as "video blocks" or "blocks".

[0088] Typically, the mode selection 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 the current block (e.g., the current CU, or in HEVC, the overlapping portion of the PU and TU). In order to inter-predict 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 decoded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 may calculate a value representing the degree of similarity of the potential reference block to the current block, for example, based on the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), etc. The motion estimation unit 222 may generally perform these calculations using the sample-by-sample difference between the current block and the reference block under consideration. The motion estimation unit 222 may identify the reference block having the lowest value resulting from these calculations, which indicates the reference block that most closely matches the current block.

[0089] 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 a current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, for unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, while for bidirectional inter prediction, the motion estimation unit 222 may provide two motion vectors. The motion compensation unit 224 may then use the motion vectors to generate a prediction block. For example, the motion compensation unit 224 may use the motion vectors to retrieve data for the reference block. As another example, if the motion vectors have fractional sample precision, the motion compensation unit 224 may interpolate the values ​​of the prediction block according to one or more interpolation filters. In addition, for bidirectional inter prediction, the motion compensation unit 224 may retrieve data for two reference blocks identified by the corresponding motion vectors and combine the retrieved data, such as by sample-by-sample averaging or weighted averaging.

[0090] 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 the 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 composite inter-intra prediction.

[0091] As another example, for intra prediction or intra prediction decoding, the intra prediction unit 226 can generate a prediction block based on samples adjacent to the current block. For example, for directional mode, the intra prediction unit 226 can generally mathematically combine the values ​​of adjacent samples and fill these calculated values ​​across the current block in a defined direction to produce a prediction block. As another example, for DC mode, the intra prediction unit 226 can calculate the average value of adjacent samples of the current block and generate a prediction block to include the resulting average value for each sample of the prediction block.

[0092] When operating according to the AV1 video coding format, the 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, luma to chroma (CFL) prediction, intra block copy (IBC), and / or palette mode. The mode selection unit 202 may include additional functional units to perform video prediction according to other prediction modes. Figure 2 In the example of FIG. 4 , intra prediction unit 226 includes CCCM unit 228, which generates predictors using CCCM mode according to the techniques of this disclosure.

[0093] The mode selection unit 202 provides the prediction block to the residual generation unit 204. The residual generation unit 204 receives the original uncoded version of the current block from the video data memory 230 and the prediction block from the mode selection unit 202. The residual generation unit 204 calculates the sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines a residual block for the current block. In some examples, the residual generation unit 204 may also determine the difference between the sample values ​​in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, the residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.

[0094] In the example where the mode selection unit 202 divides the CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs of various sizes. As described above, the size of the CU may refer to the size of the luma coding block of the CU, and the size of the 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, the video encoder 200 may support PU sizes of 2N×2N or N×N for intra-frame prediction, and symmetrical PU sizes of 2N×2N, 2N×N, N×2N, N×N or the like for inter-frame prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning of PU sizes of 2N×nU, 2N×nD, nL×2N and nR×2N for inter-frame prediction.

[0095] In an example where mode selection unit 202 does not further divide a CU 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.

[0096] For other video coding techniques (such as intra-block copy mode coding, affine mode coding, and linear model (LM) mode coding, as some examples), the mode selection unit 202 generates a prediction block for the current block being encoded through a corresponding unit associated with the coding technique. In some examples, such as palette mode coding, the mode selection unit 202 may not generate a prediction block, but instead generate syntax elements indicating how to reconstruct the block based on the selected palette. In such a mode, the mode selection unit 202 may provide these syntax elements to the entropy coding unit 220 for encoding.

[0097] As described above, the residual generation unit 204 receives video data of a current block and a corresponding prediction 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 the sample-by-sample difference between the prediction block and the current block.

[0098] 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 a 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, such as a primary transform and a secondary transform, such as a rotation transform. In some examples, transform processing unit 206 does not apply a transform to the residual block.

[0099] When operating in accordance with AV1, the 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"). The transform processing unit 206 may apply various transforms to the residual block to form a transform coefficient block. For example, the transform processing unit 206 may apply a horizontal / vertical transform combination that may include a discrete cosine transform (DCT), an asymmetric discrete sine transform (ADST), a flipped ADST (e.g., an ADST in reverse order), and an identity transform (IDTX). When the identity transform is used, the transform is skipped in one of the vertical direction or the horizontal direction. In some examples, the transform process may be skipped.

[0100] 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 selection 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 introduce information loss, and therefore, the quantized transform coefficients may have lower precision than the original transform coefficients produced by the transform processing unit 206.

[0101] The inverse quantization unit 210 and the 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. The reconstruction unit 214 may generate a reconstructed block corresponding to the current block (although possibly with some degree of distortion) based on the reconstructed residual block and the prediction block generated by the mode selection unit 202. For example, the reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples of the prediction block generated by the mode selection unit 202 to generate a reconstructed block.

[0102] Filter unit 216 may perform one or more filter operations on the reconstructed block. For example, filter unit 216 may perform a deblocking operation to reduce blocking artifacts along the edges of the CU. In some examples, the operations of filter unit 216 may be skipped.

[0103] When operating according to AV1, filter unit 216 may perform one or more filter operations on the reconstructed block. For example, filter unit 216 may perform a deblocking operation to reduce blocking artifacts along the edges of the CU. In other examples, filter unit 216 may apply a constrained directional enhancement filter (CDEF), which may be applied after deblocking and may include applying a non-separable nonlinear low-pass directional filter based on the estimated edge direction. Filter unit 216 may also include a loop recovery filter applied after CDEF, and may include a separable symmetric normalized Wiener filter or a dual self-guided filter.

[0104] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in an example where the operation of the filter unit 216 is not performed, the reconstruction unit 214 can store the reconstructed blocks to the DPB 218. In an example where the operation of the filter unit 216 is performed, the filter unit 216 can store the filtered reconstructed blocks to the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 can retrieve a reference picture from the DPB 218, which is formed by the reconstructed (and possibly filtered) blocks, to perform inter-frame prediction on blocks of subsequently encoded pictures. In addition, the intra-frame prediction unit 226 can use the reconstructed blocks in the DPB 218 of the current picture to perform intra-frame prediction on other blocks in the current picture.

[0105] In general, the entropy coding unit 220 may entropy encode syntax elements received from other functional components of the video encoder 200. For example, the entropy coding unit 220 may entropy encode a quantized transform coefficient block from the quantization unit 208. As another example, the entropy coding unit 220 may entropy encode a prediction syntax element (e.g., motion information for inter prediction or intra mode information for intra prediction) from the mode selection unit 202. The entropy coding unit 220 may perform one or more entropy coding operations on the syntax elements (which is another example of video data) to generate entropy-encoded data. For example, the entropy coding unit 220 may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable-to-variable (V2V) length coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a probability interval partitioning entropy (PIPE) coding operation, an exponential Golomb coding operation, or another 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 encoded.

[0106] The video encoder 200 may output a bitstream including entropy-encoded syntax elements required for reconstructing a block of a slice or picture. In particular, the entropy encoding unit 220 may output a bitstream.

[0107] According to AV1, the entropy coding unit 220 may be configured as a symbol-to-symbol adaptive multi-symbol arithmetic decoder. The syntax elements in AV1 include an alphabet of N elements, and the context (e.g., a probability model) includes a set of N probabilities. The entropy coding unit 220 may store the probabilities as an n-bit (e.g., 15-bit) cumulative distribution function (CDF). The entropy coding unit 220 may perform recursive scaling using an update factor based on the alphabet size to update the context.

[0108] The above operations are described for blocks. Such description should be understood as operations for luma coding blocks and / or chroma coding blocks. As described above, in some examples, the luma coding blocks and chroma coding blocks are the luma components and chroma components of a CU. In some examples, the luma coding blocks and chroma coding blocks are the luma components and chroma components of a PU.

[0109] In some examples, operations performed for luma coding blocks need not be repeated for chroma coding blocks. As an example, operations for identifying motion vectors (MVs) and reference pictures for luma coding blocks need not be repeated in order to identify MVs and reference pictures for chroma blocks. Instead, 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.

[0110] As mentioned above, the intra prediction unit 226 may include a CCCM unit 228. The CCCM unit 228 may determine whether the selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template. The video encoder 200 may signal a pattern index indicating which template from a plurality of templates is the selected template. Each of the templates includes a different set of reconstructed samples adjacent to a current CU of a current picture of the video data. Based on determining that the selected template is allowed and the CCCM mode will be used to encode the current CU, the CCCM unit 228 may apply the CCCM mode to predict the chrominance samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template. Other units of the video encoder 200 may use the predicted chrominance samples as described above.

[0111] In this way, the video encoder 200 represents an example of a video encoding device, which includes: a memory configured to store video data; and one or more processing units implemented in a circuit and configured to: determine whether to allow the selected template based on a comparison of a threshold value with the number of reference samples in the selected template. Based on determining that the selected template is allowed and the convolution cross-component model (CCCM) mode is to be used, the one or more processors may apply the CCCM mode to predict the chroma samples of the current CU based on the reconstructed luma samples of the current CU and the reference samples in the selected template. In addition, the one or more processors may encode the current CU based on the predicted chroma samples of the current CU.

[0112] Figure 3 is a block diagram illustrating an example video decoder 300 that can perform the techniques of this disclosure. Figure 3 This is for illustrative purposes only and is not intended to limit the techniques extensively illustrated and described in this disclosure. For illustrative purposes, this disclosure describes a video decoder 300 in accordance with techniques of VVC (ITU-T H.266, under development) and HEVC (ITU-T H.265). However, the techniques of this disclosure may be performed by a video coding device configured for use with other video coding standards.

[0113] exist Figure 3In the example of , the video decoder 300 includes a coded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a decoded picture buffer (DPB) 314. Any or all of the CPB memory 320, the entropy decoding unit 302, the prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, the filter unit 312, and the DPB 314 may be implemented in one or more processors or in processing circuits. For example, the units of the video decoder 300 may be implemented as one or more circuits or logic elements as part of a hardware circuit or as part of a processor, ASIC, or FPGA. In addition, the video decoder 300 may include additional or alternative processors or processing circuits to perform these functions and other functions.

[0114] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include additional units to perform predictions according to other prediction modes. As an example, the prediction processing unit 304 may include a palette unit, an intra-block copy unit (which may form part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, the video decoder 300 may include more, fewer, or different functional components.

[0115] As described above, when operating according to 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 composite 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, intra block copy (IBC), and / or palette mode.

[0116] CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by components of video decoder 300. For example, video data stored in CPB memory 320 may be obtained from computer-readable medium 110 ( Figure 1). The CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. Moreover, the CPB memory 320 may store video data other than syntax elements of decoded pictures, such as temporary data representing outputs from various units of the video decoder 300. The DPB 314 typically stores decoded pictures, and the video decoder 300 may output decoded pictures and / or use decoded pictures as reference video data when decoding subsequent data or pictures of the encoded video bitstream. The CPB memory 320 and the DPB 314 may be formed by any of a variety of storage devices, such as DRAM, including SDRAM, MRAM, RRAM, or other types of storage devices. The CPB memory 320 and the DPB 314 may be provided by the same storage device or a separate storage device. In various examples, the CPB memory 320 may be on-chip with other components of the video decoder 300, or off-chip relative to those components.

[0117] Additionally or alternatively, in some examples, video decoder 300 may retrieve the video from memory 120 ( Figure 1 ) retrieves the decoded video data. That is, memory 120 may store data together with CPB memory 320 as described above. Similarly, when some or all of the functions of video decoder 300 are implemented in software to be performed by the processing circuitry of video decoder 300, memory 120 may store instructions to be executed by video decoder 300.

[0118] Show Figure 8 The various units shown in FIG. 1 and FIG. 2 are provided to help understand the operations performed by the video decoder 300. These units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Figure 2 , a fixed-function circuit refers to a circuit that provides a specific function and is pre-set to perform executable operations. A programmable circuit refers to a circuit that can be programmed to perform various tasks and provide flexible functions in the executable operations. For example, a programmable circuit can execute software or firmware, which causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. A fixed-function circuit can execute software instructions (for example, to receive parameters or output parameters), but the type of operation performed by the fixed-function circuit is generally immutable. 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.

[0119] The video decoder 300 may include an ALU, an EFU, a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example where the operation of the video decoder 300 is performed by software executed in a programmable circuit, an on-chip or off-chip memory may store instructions (e.g., object code) of the software received and executed by the video decoder 300.

[0120] Entropy decoding unit 302 may receive encoded video data from the CPB and entropy decode the video data to reproduce syntax elements. Prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, and filter unit 312 may generate decoded video data based on syntax elements extracted from the bitstream.

[0121] Typically, the video decoder 300 reconstructs a picture on a block-by-block basis. The video decoder 300 may perform a reconstruction operation on each block individually (where the block currently being reconstructed (ie, decoded) may be referred to as a "current block").

[0122] The entropy decoding unit 302 may entropy decode the following: syntax elements defining the quantized transform coefficients in the quantized transform coefficient block, and transform information such as a quantization parameter (QP) and / or a transform mode indication. The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine a quantization degree, and likewise, determine the inverse quantization degree applied by the inverse quantization unit 306. 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.

[0123] After the inverse quantization unit 306 forms the transform coefficient block, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block 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 directional transform, or another inverse transform to the transform coefficient block.

[0124] In addition, prediction processing unit 304 generates a prediction block based on the prediction information syntax elements entropy decoded by entropy decoding unit 302. For example, if the prediction information syntax elements indicate that the current block is inter-predicted, motion compensation unit 316 can generate the prediction block. In this case, the prediction information syntax elements can indicate a reference picture in DPB 314 from which the reference block is retrieved, and a motion vector that identifies the position of the reference block in the reference picture relative to the position of the current block in the current picture. Motion compensation unit 316 can generally generate a prediction block in the same manner as for motion compensation unit 224 ( Figure 2) is performed in a manner substantially similar to that described herein.

[0125] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra-prediction unit 318 can generate a prediction block according to the intra-prediction mode indicated by the prediction information syntax element. Similarly, the intra-prediction unit 318 can generally generate a prediction block in the same manner as for the intra-prediction unit 226 ( Figure 2 ) is performed in a manner substantially similar to that described in the previous section. The intra prediction unit 318 may retrieve data of neighboring samples of the current block from the DPB 314. Figure 3 In the example of FIG. 4 , intra prediction unit 318 includes CCCM unit 322. CCCM unit 322 may implement CCCM mode according to the techniques of this disclosure.

[0126] The reconstruction unit 310 may reconstruct the current block using the prediction block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the current block.

[0127] The filter unit 312 may perform one or more filter operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operations of the filter unit 312 may not necessarily be performed in all examples.

[0128] The video decoder 300 may store the reconstructed block in the DPB 314. For example, in an example where the operation of the filter unit 312 is not performed, the reconstruction unit 310 may store the reconstructed block to the DPB 314. In an example where the operation of the filter unit 312 is performed, the filter unit 312 may store the filtered reconstructed block to 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-frame prediction and previously decoded pictures for subsequent motion compensation. In addition, the video decoder 300 may output a decoded picture (e.g., a decoded video) from the DPB 314 for subsequent display on a display device (e.g., Figure 1 The image is presented on a display device 118).

[0129] As mentioned above, the intra prediction unit 318 may include a CCCM unit 332. The CCCM unit 228 may determine whether the selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template. The video decoder 300 may obtain a mode index indicating which template from a plurality of templates is the selected template from the bitstream. Each of the templates includes a different set of reconstructed samples adjacent to a current CU of a current picture of the video data. Based on determining that the selected template is allowed and the CCCM mode will be used to encode the current CU, the CCCM unit 322 may apply the CCCM mode to predict the chroma samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template. Other units of the video decoder 300 may use the predicted chroma samples as described above.

[0130] In this way, the video decoder 300 represents an example of a video decoding device, including: a memory configured to store video data; and one or more processing units implemented in a circuit and configured to: determine whether to allow the selected template based on a comparison of a threshold value with the number of reference samples in the selected template. Based on determining that the selected template is allowed and a convolution cross-component model (CCCM) mode is to be used, one or more processors may apply the CCCM mode to predict the chroma samples of the current CU based on the reconstructed luma samples of the current CU and the reference samples in the selected template. In addition, the one or more processors may decode the current CU based on the predicted chroma samples of the current CU.

[0131] The Joint Video Experts Group (JVET) of ITU-T and ISO / IEC has developed a new video coding standard: Versatile Video Coding (VVC) to achieve substantial compression capabilities beyond HEVC for a wider range of applications. The VVC specification was completed in July 2020 and jointly published by ITU-T and ISO / IEC. The VVC specification specifies the standardized bitstream and picture formats, high-level syntax (HLS) and decoding unit-level syntax, as well as parsing and decoding processes. VVC also specifies profile / tier / level (PTL) restrictions, byte stream formats, hypothetical reference decoders, and supplementary enhancement information (SEI) in the appendix.

[0132] Since April 2021, JVET has been developing the Enhanced Compression Model (ECM) software to enhance compression capabilities beyond VVC. The decoding toolset in the ECM software includes all functional blocks in the hybrid video decoding framework, including intra-frame prediction, inter-frame prediction, transform and coefficient decoding, in-loop filtering, and entropy decoding. The technology of the present disclosure can be applied to ECM and prior art video codecs such as VVC, AV1, etc.

[0133] In ECM-5.0, there are 12 intra modes for chroma intra mode decoding, which are classified into 2 chroma mode lists: a cross-component linear model (CCLM) mode list and a non-CCLM mode list. The CCLM mode list includes six cross-component linear model modes, namely, LM and LM_L, LM_T, MMLM, MMLM_L and MMLM_T. The non-CCLM mode list includes a chroma DIMD (decoder-side intra mode derivation) mode (Li et al., "EE2-1.2: On chroma intraprediction", Joint Video Experts Group (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC 29, 26th Meeting, Teleconference, April 20-29, 2022, document JVET-Z0051-v2 (hereinafter, "JVET-Z0051")) and five traditional intra modes, namely, direct mode (DM) and default mode.

[0134] The linear model (LM) mode derives a linear model between the luminance component and the chrominance component, that is, Pred C =a×Rec L +b, where Pred C is the chrominance predictor and Rec L is a luma-concatenated reconstructed sample. The LM mode uses pairs of adjacent reconstructed luma pixels and adjacent reconstructed chroma pixels to exploit Figure 4 The linear regression method shown in derives the parameters of the linear model (ie, a and b). Figure 4 is a conceptual diagram showing example luma and chroma samples used to derive a linear model. Specifically, Figure 4 A chroma block 400 containing chroma samples and a corresponding luma block 402 containing luma samples are shown. A set of reference samples 404 is located above the chroma block 400, and a set of reference samples 406 is located to the left of the chroma block 400. A set of reference samples 408 is located above the luma block 402, and a set of reference samples 410 is located above the luma block 402. Luma block 402 has twice as many samples (2N) as chroma block 400 in both the horizontal and vertical directions. For this reason, each chroma sample of chroma block 400 (and each of reference samples 404 and 406) corresponds to a position halfway between two of the luma samples. Therefore, as part of determining a linear model, a video coder (e.g., video encoder 200 or video decoder 300) can interpolate values ​​between a particular luma reference sample 408 and a luma reference sample 410. The interpolated values ​​are in Figure 4 Therefore, the video coder may use the chrominance value and the luma value corresponding to the position indicated by the gray-filled circle to determine the linear model.

[0135] Figure 5 is a conceptual diagram showing an example of classifying adjacent samples into two groups. The multi-model LM (MMLM) mode involves deriving two linear models between luma adjacent reconstructed samples and chroma adjacent reconstructed samples by classifying sample pairs into two groups using a threshold value such as Figure 5 The average value of adjacent reconstructed samples of the brightness shown in . Figure 5 In the example of , a first linear model (represented by line 500) models a linear relationship between a first set of chroma samples 502 and their collocated luminance values. The first linear model is defined by a slope value α1=2 and an intercept value β1=1. A second linear model (represented by line 504) models a linear relationship between a second set of chroma samples 506 and their collocated luminance values. The second linear model is defined by a slope value α1=1 / 2 and an intercept value β1=-1.

[0136] LM and MMLM use both left and top samples to derive linear models. LM_L and MMLM_L use only left samples (without top samples) to derive linear models. In contrast, LM_T and MMLM_T use only top samples (without left samples) to derive linear models.

[0137] Figure 6 is a conceptual diagram showing neighboring reconstructed samples for chroma decoder side intra mode derivation (DIMD). Figure 6 As shown, the chroma DIMD mode derives the intra mode from the adjacent reconstructed luma samples of the collocated reconstructed luma block and the adjacent reconstructed chroma samples of the current chroma CU (CU in the Cb component and the Cr component) based on the gradient histogram (HoG) calculation. If one of the default modes (i.e., planar mode, horizontal mode, vertical mode, and DC mode) is the same as the DM mode, the default mode is replaced by the diagonal mode. Figure 6 In the example of , block 600A contains luma samples of the current block, block 600B contains Cb samples of the current block, and block 600C contains Cr samples of the current block. Samples outside squares 600a, 600b, and 600c are adjacent reconstructed samples.

[0138] The signaling of CCLM mode is 10 (LM), 110 (MMLM), 1110 (LM_1), 11110 (LM_A), 111110 (MMLM_L), 111111 (MMLM_A), and the signaling of non-CCLM mode is 00 for DM, 010 for chroma DIMD, and 01100, 01101, 01110, and 01111 for the default mode. That is, the CCLM flag is first signaled to indicate whether the current CU uses one of the CCLM modes. If it is CCLM mode, the LM flag is first signaled to indicate whether it is LM mode. If the LM flag is false, the MMLM flag is further signaled to indicate whether it is MMLM mode, and so on. If the CCLM flag indicates that the current CU uses non-CCLM mode, the DM flag is signaled in the case of DM mode. If the DM flag is not true, the chroma DIMD flag is signaled to indicate whether the mode is chroma DIMD mode. If chroma DIMD mode is not true, then the 2-bit fixed length code is parsed to indicate which default mode to use.

[0139] ECM-5.0 adopts the slope adjustment technique for LM mode and MMLM mode proposed by Lainema et al. in “EE2-1.1: Slope Adjustment for CCLM”, Joint Video Experts Group (JVET) of ITU-T SG16WP 3 and ISO / IEC JTC 1 / SC 29, 26th Meeting, Teleconference, April 20-29, 2022, document JVET-Z0049 (hereinafter, “JVET-Z0049”) to adjust the slope of the derived linear mode as follows: chromaVal = a'*lumaVal+b', where a' = a+u, b' = bu*y r ,y r is the average value of the reference luma samples, u is the delta value of the slope a, and where chromaVal is the value of the chroma sample, and lumaVal is the value of the corresponding luma sample. Although JVET-Z0049 is described for ECM, the techniques of JVET-Z0049 and the techniques of the present disclosure may be applicable for other video codecs.

[0140] Fig. 7A is a conceptual diagram showing a model created using a cross-component linear model. Fig. 7AIn the example of , the vertical axis corresponds to chrominance values ​​(e.g., Cb or Cr), and the horizontal axis corresponds to luma values. Line 700 shows a linear relationship between luma values ​​and their juxtaposed chrominance values. Point "b" indicates the intercept between the vertical axis and line 700. Line 702 indicates a vertical change value "a" in line 700 at a given position along the horizontal axis. Therefore, the vertical change value "a" can be used to determine the slope of line 700.

[0141] Figure 7B is a conceptual diagram showing the effect of the slope adjustment parameters of a model created using the model proposed in JVET-Z0049. Figure 7B In the example, line 700 and Fig. 7A The same as line 700 in , and shows a linear relationship between a luma value and its juxtaposed chroma value. The delta value u is an integer between -4 and 4 (inclusive) and is signaled in the bitstream. If one of the LM mode and the MMLM mode is used, a slope adjustment flag is signaled to indicate whether the delta value is applied to the slope. Figure 7B In the example of FIG. 7 , the incremental value u (indicated by line 704) changes the slope of line 700 to obtain line 706, which is Figure 7B At the same distance along the horizontal axis as a, line 706 has a vertical rise of a' = a + u.

[0142] In ECM-5.0, if non-CCLM mode is selected, a chroma fusion flag as proposed in JVET-Z0051 is signaled to indicate whether the predictor of the non-CCLM mode is fused with the predictor of the MMLM mode. The phrase "fusion of predictors" may be applied to: generating a predictor (e.g., a prediction block) based on predictors generated using two or more intra prediction modes (e.g., non-LM mode, MMLM mode, etc.).

[0143] A convolutional cross-component model (CCCM) mode has been previously proposed to use a 7-tap filter to predict chroma samples from reconstructed luma samples in a similar manner to what the current CCLM mode does. As with CCLM, when chroma subsampling is used, the reconstructed luma samples are downsampled to match the lower resolution chroma grid. Also, similar to CCLM, there is the option of using a single model or multiple model variants of CCCM. Figure 8 is a conceptual diagram showing the spatial portion of a convolution filter 800. The input to a 7-tap filter is listed as follows: The center (C) luma sample concatenated with the chroma sample to be predicted The above / north (N), below / south (S), left / west (W), and right / east (E) neighbors of the center brightness sample, such as Figure 8The nonlinear term P is expressed as a power of 2 of the center luma sample C and is scaled to the sample value range of the content, i.e., P = (C*C + midVal) >> bitDepth. That is, for 10-bit content, it is calculated as: P = (C*C + 512) >> 10. The bias term B represents a scalar offset between input and output (similar to the offset term in CCLM) and is set to the intermediate chrominance value (512 for 10-bit content).

[0144] The output of the filter is calculated as the filter coefficient c i Convolution with the input value and clipped to the range of valid chroma samples: predChromaVal=c0C+c1N+c2S+c3E+c4W+c5P+c6B

[0145] The CCCM unit (e.g., CCCM unit 228 of video encoder 200 or CCCM unit 322 of video decoder 300) may determine the coefficients (c0, c1, c2, c3, c4, c5, and c6) using regression based on minimizing the mean square error (MSE) of reference samples of the current block (e.g., current CU or current PU). In some examples, the CCCM unit may perform MSE minimization by calculating an autocorrelation matrix of the luma input and a cross-correlation vector between the luma input and the chroma output. The CCCM unit may perform LDL decomposition on the autocorrelation matrix and may use inverse substitution to calculate the final filter coefficients.

[0146] When the LM flag is true, the CCCM flag may be further signaled to indicate whether it is a single model CCCM mode or a regular LM mode. When the MMLM flag is true, the CCCM flag may be further signaled to indicate whether it is a multi-model CCCM mode or an MMLM mode. When the CCCM flag is true, the slope adjustment flag is not signaled and is inferred as false (disabled) at the decoder side.

[0147] As described above, the CCCM unit can determine the coefficients to be used in the 7-tap filter based on the reference samples. Traditionally, only one reference sample set is available for determining the coefficients. However, the ability to select among different modes (i.e., templates) of reference samples can produce better results for predicting chroma samples. For example, if the current CU has a chroma gradient from left to right, if the coefficients are determined based on samples on the left side of the current CU rather than samples above the current CU, then the filter can produce a better prediction of the chroma samples of the current CU. Similarly, if the current CU has a chroma gradient from top to bottom, if the coefficients are determined based on samples above the current CU rather than samples on the left side of the current CU, then the filter can produce a better prediction of the chroma samples of the current CU. In other examples, if the coefficients are determined based on at least some reference samples above the current CU and at least some reference samples on the left side of the current CU, the filter can produce a better prediction of the chroma samples of the current CU. However, not all reference sample sets are available.

[0148] The present disclosure proposes a scheme in which a template to be used by a coding tool in a current CU, such as a CCCM mode, can be selected from among multiple templates. The template may be (but is not limited to) one of the templates described below.

[0149] Full template: Fig. 9 The adjacent samples from the lower left to the upper right are shown. That is, Fig. 9 is a conceptual diagram illustrating a full template 900 used by a current CU 902 in accordance with techniques of this disclosure.

[0150] The top template is limited to the top adjacent samples, such as Fig. 10A and Fig. 10B Specifically, Fig. 10A is a conceptual diagram illustrating a top template 1000A including a top-left sample used by a current CU 1002 in accordance with techniques of this disclosure. Fig. 10B is a conceptual diagram illustrating a top template 1000B used by the current CU 1002 excluding the top-left sample, in accordance with techniques of this disclosure.

[0151] The left template is limited to the left adjacent sample, such as Fig.11A and Fig. 11B shown. Fig.11A is a conceptual diagram illustrating a left template 1100A including an upper-left sample used by a current CU 1102 , in accordance with techniques of this disclosure. Fig. 11B is a conceptual diagram illustrating a left template 1100B used by the current CU 1102 excluding the top-left sample, in accordance with techniques of this disclosure.

[0152] In another example of the present disclosure, a template is derived from a full template by geometrically dividing the full template into N equal templates. In one example, N is 2, and the full template can be divided into Fig. 12A The two templates 1202A, 1204A and 1206 for CU 1200 are shown. Fig. 12B Templates 1202B, 1204B for CU 1200 in FIG. Fig. 12A and 12B is a conceptual diagram showing a template divided from a full template according to the technology of the present disclosure. Fig. 12A and 12B In the example, the first template (e.g., template 1202A or 1204B) and the second template (e.g., template 1204A or 1202B) do not overlap. The first template includes samples above and to the left of the current CU. The second template includes samples above the current CU or to the left of the current CU.

[0153] At the image boundary, the full template can be equal to the top template or the left template. In this case, the divided templates are all on the same side. Fig.13A and Fig. 13B This is shown when N is 2. Fig.13A and 13B is a conceptual diagram showing templates on the same side according to the technology of the present disclosure. Specifically, Fig.13A Two or more templates ( 1302A, 1304A) limited to adjacent reconstructed samples to the left of the current CU 1300 are shown. Fig. 13B Two or more templates ( 1302B, 1304B) limited to adjacent reconstructed samples above the current CU 1300 are shown.

[0154] In another example, the template export can be applied to Fig. 10A and 10B The top template (1000A, 1000B) and Fig.11A and 11B The left template (1100A, 1100B) in.

[0155] The number of reference samples in the full template, template 1, and template 2 are denoted as nSample_F, nSample_1, and nSample_2, respectively, where template 1 and template 2 can be derived templates divided from the full template, and in another example, template 1 is the top template and template 2 is the left template. The following constraints are proposed to infer which template to use: If nSample_F < threshold 1, the full template is not allowed to be used in the current CU. If nSample_1<threshold 2, template 1 is not allowed to be used in the current CU. · If nSample_2 < threshold 2, template 2 is not allowed to be used in the current CU.

[0156] Note that threshold 1 and threshold 2 are pre - allocated positive integers. In one example, threshold 1 = threshold 2. In another example, threshold 1 < threshold 2. In another example, threshold 1 and threshold 2 depend on the mode index. For example, if the mode index indicates that it is a single - model linear model mode, threshold 1 and threshold 2 are set to threshold1_s and threshold2_s. On the contrary, if the mode index indicates that it is a multi - model linear model mode, threshold 1 and threshold 2 are set to threshold1_m and threshold2_m. In one example, threshold1_s and threshold1_m are the same. In another example, threshold1_s and threshold1_m are different and threshold1_s < threshold1_m. The same comparison relationship can be applied to threshold2_s and threshold2_m.

[0157] In this way, a video decoder (e.g., the CCCM unit 228 of the video encoder 200 or the CCCM unit 322 of the video decoder 300) can disallow the selection of one or more templates from the multiple templates based on the comparison of the number of samples in the templates with the thresholds for the multiple templates. For example, the video decoder can disallow the first template (e.g., the full template including the neighboring reconstructed samples above and to the left of the current CU) based on the number of samples (nSample_F) in the first template being less than the first threshold (threshold 1). The video decoder can disallow the second template (e.g., template 1, which is limited to the neighboring reconstructed samples above the current CU) based on the number of samples (nSample_1) in the second template being less than the second threshold (threshold 2). The video decoder can disallow the third template (e.g., template 2, which is limited to the neighboring reconstructed samples to the left of the current CU) based on the number of samples (nSample_2) in the third template being less than the second threshold (threshold 2).

[0158] The video decoder can encode or decode a mode index indicating the selected template. In some examples, the video decoder can encode or decode a mode index indicating which template from the multiple templates is used for the current CU and how many linear models are used for the current CU. For example, if the template selection scheme is applied to CCCM, the following signaling can be applied: · First, signal the mode index to indicate which template to use and how many linear models to use (example: index 0 is a single model with a full template, index 1 is multiple models with a full template, index 2 is a single model with template 1, index 3 is a single model with template 2, index 4 is multiple models with template 1, and index 5 is multiple models with template 2). Signal the CCCM flag to indicate whether to use a regular linear model (CCCM flag is 0) or CCCM (CCCM flag is 1). If the mode index indicates using multiple models with template 1 and nSample_1 < threshold2_m, then infer the CCCM flag as 0. If the mode index indicates using multiple models with template 2 and nSample_2 < threshold2_m, then infer the CCCM flag as 0. If the mode index indicates using a single model with template 1 and nSample_1 < threshold2_s, then infer the CCCM flag as 0. If the mode index indicates using a single model with template 2 and nSample_2 < threshold2_s, then infer the CCCM flag as 0.

[0159] Thus, the video decoder can determine whether to allow the selected template based on a comparison of thresholds (e.g., threshold1, threshold2, threshold2_s, threshold2_m) with the number of reference samples in the selected template. The mode index can indicate which template from multiple templates (e.g., full template, template 1, or template 2) is the selected template. As mentioned above, each of the templates includes a different set of reconstructed samples adjacent to the current CU. Based on determining that the selected template is allowed and the CCCM mode is to be used, the video decoder can apply the CCCM mode to predict the chroma samples of the current CU based on the reconstructed luma samples of the current CU and the reference samples in the selected template. If the selected template is not allowed (e.g., because nSample_F < threshold1, nSample_1 < threshold2 or nSample_2 < threshold2, nSample_1 < threshold2_m, nSample_2 < threshold2_m, or nSample_2 < threshold2_s), then infer the CCCM flag as 0, and thus do not use the CCCM mode.

[0160] The chrominance fusion scheme is now described. The present disclosure proposes to replace the fusion of the predictor in the non-CCLM mode and the predictor in the MMLM mode with the fusion of the predictor in the non-CCLM mode and the predictor in the multi-model CCCM mode. If nSample_F < threshold1_m, the signaling of the chrominance fusion flag is bypassed and is inferred as 0 at the decoder side. In another example, based on the condition nSample_F ≥ threshold1_m, the predictor in the non-CCLM mode is fused with one of the linear model modes. One example is that if nSample_F < threshold1_m, the predictor in the non-CCLM mode is fused with the predictor in the single-model CCCM mode, and if nSample_F ≥ threshold1_m, the predictor in the non-CCLM mode is fused with the predictor in the multi-model CCCM mode.

[0161] It is further proposed that if the length of the upper and left CU boundaries (denoted as length_b, where length_b = CU_width + CU_height, CU_width is the width of the CU, and CU_height is the height of the CU) is less than or equal to a threshold (denoted as threshold_f), i.e., length_b ≤ threshold_f, the signaling of the chrominance fusion flag is bypassed. The condition of length_b ≤ threshold_f can be combined with one or at least two of the above conditions. One example is that if length_b ≤ threshold_f and nSample_F < threshold1_m, the signaling of the chrominance fusion flag is bypassed.

[0162] Fig.14 is a flowchart showing an example method for encoding a current block according to the technology of the present disclosure. The current block may include a current CU. Although described with respect to video encoder 200 ( Figure 1 and 2 ), it should be understood that other devices may be configured to perform methods similar to Fig.14 's method.

[0163] In this example, video encoder 200 initially predicts a current block (1450). For example, video encoder 200 may form a prediction block for the current block. According to the techniques of the present disclosure, as part of forming the prediction block, video encoder 200 may determine whether the selected template is allowed based on a comparison of a threshold value to a number of reference samples in the selected template, wherein a mode index indicates which template from a plurality of templates is the selected template. Based on determining that the selected template is allowed and the CCCM mode is to be used, video decoder 300 may apply the CCCM mode to predict chrominance samples of the current block based on reconstructed luma samples of the current block and reference samples in the selected template.

[0164] The video encoder 200 may then calculate a residual block for the current block (1452). To calculate the residual block, the video encoder 200 may calculate the difference between the original uncoded block and the predicted block for the current block. The video encoder 200 may then transform the residual block and quantize the transform coefficients of the residual block (1454). Next, the video encoder 200 may scan the quantized transform coefficients of the residual block (1456). During or after the scan, the video encoder 200 may entropy encode the transform coefficients (1458). For example, the video encoder 200 may encode the transform coefficients using CAVLC or CABAC. The video encoder 200 may then output the entropy encoded data of the block (1460).

[0165] Fig.15 1 is a flowchart illustrating an example method for decoding a current block according to the techniques of the present disclosure. The current block may include a current CU. Although for the video decoder 300 ( Figure 1 and 3 ), but it should be understood that other devices may be configured to perform the same Fig.15 A similar approach to the one used in this paper.

[0166] The video decoder 300 may receive entropy coded data of a current block, such as entropy coded prediction information corresponding to the current block and entropy coded data of transform coefficients of a residual block (1570). The video decoder 300 may entropy decode the entropy coded data to determine the prediction information of the current block and reproduce the transform coefficients of the residual block (1572). The video decoder 300 may predict the current block (1574), for example, using an intra prediction mode or an inter prediction mode indicated by the prediction information of the current block to calculate a prediction block of the current block. According to the techniques of the present disclosure, as part of calculating the prediction block, the video decoder 300 may determine whether the selected template is allowed based on a comparison of a threshold value with a number of reference samples in the selected template, wherein a mode index indicates which template from a plurality of templates is the selected template. Based on determining that the selected template is allowed and the CCCM mode is to be used, the video decoder 300 may apply the CCCM mode to predict the chrominance samples of the current block based on the reconstructed luma samples of the current block and the reference samples in the selected template.

[0167] The video decoder 300 may then inverse scan the reproduced transform coefficients (1576) to create a block of quantized transform coefficients. The video decoder 300 may then inverse quantize the transform coefficients and apply an inverse transform to the transform coefficients to produce a residual block (1578). The video decoder 300 may ultimately decode the current block by combining the prediction block and the residual block (1580).

[0168] Fig.16 is a flow chart illustrating an example method for encoding or decoding video data according to the techniques of this disclosure. Fig.16 In an example of the present invention, a CCCM unit (e.g., CCCM unit 228 of video encoder 200 or CCCM unit 322 of video decoder 300) may determine whether to allow a selected template based on a comparison of a threshold value with the number of reference samples in the selected template (1600). A mode index may indicate which template from a plurality of templates is the selected template. Each of the templates includes a different set of reconstructed samples adjacent to a current CU of a current picture of video data.

[0169] For example, the multiple templates may include: a first template including adjacent reconstructed samples above and to the left of the current CU, a second template limited to adjacent reconstructed samples above the current CU, and a third template limited to adjacent reconstructed samples to the left of the current CU. The CCCM unit may not allow the first template based on the number of samples in the first template being less than a first threshold. The CCCM unit may not allow the second template based on the number of samples in the second template being less than a second threshold. The CCCM unit may not allow the third template based on the number of samples in the third template being less than a second threshold. In some examples, the first threshold is equal to the second threshold. In other examples, the first threshold is less than the second threshold. In some examples, at least one of the first threshold or the second threshold depends on a pattern index.

[0170] In some examples, the multiple templates include: two or more templates limited to adjacent reconstructed samples above the current CU (e.g., Fig. 13B ), or two or more templates limited to the neighboring reconstructed samples to the left of the current CU (e.g., as shown in the example of Fig.13A In some examples, such as Fig. 12A and Fig. 12B In an example of, the multiple templates include a non-overlapping first template and a second template, the first template includes samples above and to the left of the current CU, and the second template includes samples above the current CU or to the left of the current CU. In some examples, the video decoder may encode or decode a mode index indicating which template of the multiple templates is used for the current CU and how many linear models are used for the current CU, for example, as described above.

[0171] In addition, Fig.16 In an example of , the CCCM unit may apply a CCCM mode to predict chroma samples of the current CU based on the reconstructed luma samples of the current CU and the reference samples in the selected template (1602). For example, the CCCM unit may downsample the reconstructed luma samples of the current CU and apply a 7-tap filter to the luma samples of the downsampled luma block to predict the chroma samples of the current CU. The 7-tap filter uses the center, left, right, top, and bottom luma samples of the downsampled luma block, as well as a bias term and a nonlinear term represented as a power of 2 of the center luma sample C and scaled to the sample value range of the content. The CCCM unit may determine the coefficients of the 7-tap filter based on the reference samples in the selected template.

[0172] A video decoder (e.g., video encoder 200 or video decoder 300) including a CCCM unit may encode or decode a current CU based on the predicted chroma samples of the current CU (1604). For example, the residual generation unit 204 of the video encoder 200 may generate residual data based on the predicted chroma samples of the current CU and the original chroma samples of the current CU. In this example, the transform processing unit 206 of the video encoder 200 may apply a transform to the residual data to generate a transform block. The quantization unit 208 of the video encoder 200 may quantize the transform coefficients of the transform block. The entropy encoding unit 220 of the video encoder 200 may apply entropy encoding to the quantized transform coefficients. In an example where the video decoder is the video decoder 300, the reconstruction unit 310 may reconstruct the chroma samples of the current CU based on the predicted chroma samples of the current CU and the reconstructed residual data.

[0173] The following is a non-limiting list of terms of technology according to the present disclosure.

[0174] Item 1A: A method of decoding video data, comprising: selecting a template of neighboring reconstructed samples of a current decoding unit (CU) of a current picture of the video data; applying a decoding tool that uses the selected template to perform intra-frame prediction to generate a predictor for the current CU; and encoding or decoding the current CU based on the predictor for the current CU.

[0175] Clause 2A: A method according to clause 1A, wherein selecting the template includes selecting the template from a plurality of templates including two or more of the following: a first template including neighboring reconstructed samples above and to the left of a current CU, a second template limited to neighboring reconstructed samples above the current CU, and a third template limited to neighboring reconstructed samples to the left of the current CU.

[0176] Clause 3A: A method according to Clause 1A, wherein selecting a template includes: based on the current CU being at an edge of the current picture, selecting the template from a plurality of templates comprising one of: two or more templates limited to adjacent reconstructed samples above the current CU, or two or more templates limited to adjacent reconstructed samples to the left of the current CU.

[0177] Clause 4A: The method of any of clauses 1A-3A, wherein selecting the template comprises disallowing one or more templates from the plurality of templates based on a comparison of a number of samples in the template to a threshold for the plurality of templates.

[0178] Clause 5A: A method according to any one of clauses 1A-4A, wherein: the first template includes adjacent reconstructed samples above and to the left of the current CU, the second template is limited to adjacent reconstructed samples above the current CU, the third template is limited to adjacent reconstructed samples to the left of the current CU, and selecting a template includes: not allowing the first template based on the number of samples in the first template being less than a first threshold; not allowing the second template based on the number of samples in the second template being less than a second threshold; and not allowing the third template based on the number of samples in the third template being less than the second threshold.

[0179] Clause 6A: The method of clause 5A, wherein one of: the first threshold is equal to the second threshold, or the first threshold is less than the second threshold.

[0180] Clause 7A: The method of any of clauses 5A-6A, wherein at least one of the first threshold or the second threshold depends on a pattern index.

[0181] Clause 8A: The method of any of clauses 1A-6A, wherein the coding tool is one of: a convolutional cross-component model (CCCM) for intra prediction, a cross-component linear model with slope adjustment, or chroma fusion.

[0182] Clause 9A: A method according to any of clauses 1A-8A, wherein: the decoding tool is a CCCM for intra-frame prediction, and a mode index is encoded or decoded, wherein the mode index indicates which template of multiple templates is used for the current CU and how many linear models are used for the current CU.

[0183] Clause 10A: A method according to any one of clauses 1A-9A, wherein: the predictor is a first predictor, the decoding tool is a first decoding tool, the first decoding tool is a multi-model CCCM mode, the first template includes adjacent reconstructed samples above and to the left of the current CU, and the method further includes: based on the number of samples in the first template being not less than a threshold, determining to signal a chroma fusion flag in a bitstream including an encoded representation of video data; applying a second decoding tool to perform intra-frame prediction to generate a second predictor for the current CU, wherein the second decoding tool is a non-cross-component linear model mode, and encoding or decoding the current CU includes: encoding or decoding the current CU based on the first predictor and the second predictor of the current CU.

[0184] Clause 11A: A method according to any one of clauses 1A-9A, wherein the method further comprises: determining to bypass a chroma fusion flag in a bitstream of an encoded representation of video data based at least in part on the length of an upper boundary and a left boundary of a current CU being less than or equal to a threshold, wherein the chroma fusion flag indicates whether a predictor of a non-cross-component linear model (non-CCLM) model is fused with a predictor of a multi-model CCCM mode.

[0185] Clause 12A: An apparatus for decoding video data, the apparatus comprising one or more means for performing the method of any of clauses 1A-11A.

[0186] Clause 13A: The apparatus of clause 12A, wherein the one or more units comprise one or more processors implemented in circuitry.

[0187] Clause 14A: The apparatus of any of clauses 12A and 14A, further comprising: a memory to store video data.

[0188] Clause 15A: The apparatus of any of clauses 12A-14A, further comprising: a display configured to display the decoded video data.

[0189] Clause 16A: The device of any of clauses 12A-15A, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0190] Clause 17A: The apparatus of any of clauses 12A-16A, wherein the apparatus comprises a video decoder.

[0191] Clause 18A: The apparatus of any of clauses 12A-17A, wherein the apparatus comprises a video encoder.

[0192] Clause 19A: A computer-readable storage medium having stored thereon instructions which, when executed, cause one or more processors to perform the method of any of clauses 1A-11A.

[0193] Item 1B. A method for decoding video data, the method comprising: determining whether a selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current decoding unit (CU) of a current picture of the video data; based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, applying a CCCM mode to predict chroma samples of the current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template; and encoding or decoding the current CU based on the predicted chroma samples of the current CU.

[0194] Clause 2B. A method according to Clause 1B, wherein the multiple templates include two or more of the following: a first template including neighboring reconstructed samples above and to the left of a current CU, a second template limited to neighboring reconstructed samples above the current CU, and a third template limited to neighboring reconstructed samples to the left of the current CU.

[0195] Clause 3B. A method according to Clause 2B, wherein the threshold is one of a first threshold or a second threshold, and determining whether to allow the selected template includes: not allowing the first template based on the number of samples in the first template being less than the first threshold; not allowing the second template based on the number of samples in the second template being less than the second threshold; and not allowing the third template based on the number of samples in the third template being less than the second threshold.

[0196] Clause 4B. The method of clause 3B, wherein one of: the first threshold is equal to the second threshold, or the first threshold is less than the second threshold.

[0197] Clause 5B. The method of any of clauses 3B-4B, wherein at least one of the first threshold or the second threshold depends on a pattern index.

[0198] Clause 6B. A method according to any one of clauses 1B-5B, wherein, based on the current CU being at an edge of the current picture, the multiple templates include one of the following: two or more templates limited to adjacent reconstructed samples above the current CU, or two or more templates limited to adjacent reconstructed samples to the left of the current CU.

[0199] Clause 7B. A method according to any one of clauses 1B-5B, wherein: the multiple templates include a non-overlapping first template and a second template, the first template includes samples above and to the left of the current CU, and the second template includes samples above the current CU or to the left of the current CU.

[0200] Clause 8B. The method of any of clauses 1B to 7B, wherein the method further comprises encoding or decoding a mode index, and wherein the mode index further indicates how many linear models are used for the current CU.

[0201] Clause 9B. A method according to any one of clauses 1B-8B, wherein applying the CCCM mode includes: determining coefficients of a filter based on reference samples in a selected template; downsampling reconstructed luminance samples of a current CU to generate a downsampled luminance block; and applying a 7-tap filter to the luminance samples of the downsampled luminance block to predict chrominance samples of the current CU.

[0202] Item 10B. A device for encoding or decoding video data, the device comprising: a memory configured to store the video data; and one or more processors implemented in a circuit, the one or more processors configured to: determine whether a selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current decoding unit (CU) of a current picture of the video data; based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, apply a CCCM mode to predict chroma samples of a current CU based on the reconstructed luminance samples of the current CU and the reference samples in the selected template; and encode or decode the current CU based on the predicted chroma samples of the current CU.

[0203] Clause 11B. A device according to Clause 10B, wherein the multiple templates include two or more of the following: a first template including neighboring reconstructed samples above and to the left of the current CU, a second template limited to neighboring reconstructed samples above the current CU, and a third template limited to neighboring reconstructed samples to the left of the current CU.

[0204] Clause 12B. A device according to clause 11B, wherein the threshold is one of a first threshold or a second threshold, and as part of determining whether to allow the selected template, the one or more processors are configured to: not allow the first template based on the number of samples in the first template being less than the first threshold; not allow the second template based on the number of samples in the second template being less than the second threshold; and not allow the third template based on the number of samples in the third template being less than the second threshold.

[0205] Clause 13B. The apparatus of clause 12B, wherein one of: the first threshold is equal to the second threshold, or the first threshold is less than the second threshold.

[0206] Clause 14B. The apparatus of any of clauses 12B-13B, wherein at least one of the first threshold or the second threshold depends on a pattern index.

[0207] Clause 15B. A device according to any one of clauses 10B-14B, wherein, based on the current CU being at an edge of the current picture, the multiple templates include one of the following: two or more templates limited to adjacent reconstructed samples above the current CU, or two or more templates limited to adjacent reconstructed samples to the left of the current CU.

[0208] Clause 16B. An apparatus according to any of clauses 10B-14B, wherein: the multiple templates include a non-overlapping first template and a second template, the first template includes samples above and to the left of the current CU, and the second template includes samples above the current CU or to the left of the current CU.

[0209] Clause 17B. The apparatus of any of clauses 10B-16B, wherein the one or more processors are further configured to: encode or decode a mode index, and wherein the mode index further indicates how much of the linear model is used for the current CU.

[0210] Clause 18B. A device according to any of clauses 10B-17B, wherein, as part of applying the CCCM mode, the one or more processors are configured to: determine coefficients of a filter based on reference samples in a selected template; downsample the reconstructed luma samples of the current CU to generate a downsampled luma block; and apply a 7-tap filter to the luma samples of the downsampled luma block to predict the chroma samples of the current CU.

[0211] Clause 19B. The apparatus of any of clauses 10B-18B, further comprising: a display configured to display the decoded video data.

[0212] Clause 20B. The device of any of clauses 10B-19B, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0213] Clause 21B. The apparatus of any of clauses 10B-20B, wherein the apparatus comprises a video decoder.

[0214] Clause 22B. The apparatus of any of clauses 10B-21B, wherein the apparatus comprises a video encoder.

[0215] Item 23B. A non-temporary computer-readable storage medium having instructions stored thereon, which when executed cause one or more processors to: determine whether a selected template is allowed based on a comparison of a threshold value with a number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current coding unit (CU) of a current picture of video data; based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, apply a CCCM mode to predict chroma samples of the current CU based on the reconstructed luminance samples of the current CU and reference samples in the selected template; and encode or decode the current CU based on the predicted chroma samples of the current CU.

[0216] Item 24B. A device for encoding or decoding video data, the device comprising: a unit for determining whether a selected template is allowed based on a comparison of a threshold value with the number of reference samples in the selected template, wherein a pattern index indicates which template from a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current decoding unit (CU) of a current picture of the video data; a unit for applying a convolutional cross-component model (CCCM) mode to predict chroma samples of a current CU based on reconstructed luminance samples of the current CU and reference samples in the selected template based on determining that the selected template is allowed and a CCCM mode is to be used; and a unit for encoding or decoding a current CU based on the predicted chroma samples of the current CU.

[0217] It should be appreciated that, according to examples, certain operations or events of any of the techniques described herein may be performed in a different order, may be added, combined, or omitted entirely (e.g., not all described operations or events are required to implement the technique). In addition, in some examples, operations or events may be performed concurrently rather than sequentially, such as through multithreading, interrupt handling, or multiple processors.

[0218] In one or more examples, the described functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include: computer storage media, which corresponds to tangible media such as data storage media; or communication media, including, for example, any media that facilitates the transfer of a computer program from one place to another according to a communication protocol. In this manner, computer-readable media may generally correspond to: (1) a non-transitory tangible computer-readable storage medium, or (2) a communication medium such as a signal or carrier wave. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures to implement the techniques described in the present disclosure. A computer program product may include a computer-readable medium.

[0219] For example, but not limited to, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory or any other medium that can be used to store the required program code in the form of instructions or data structures and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the software is sent from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, wireless and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, wireless and microwaves are also included in the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are directed to non-temporary tangible storage media. The disks and optical disks used herein include compact disks (CDs), laser optical disks, optical optical disks, digital versatile disks (DVDs), floppy disks and blue-ray disks, wherein the disks usually reproduce data magnetically, and the optical disks usually reproduce data optically using lasers. The above combination is also included in the scope of computer-readable media.

[0220] 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 circuits. Accordingly, the terms "processor" and "processing circuitry" as used herein may refer to any of the foregoing structures or any other structure suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Similarly, the techniques may be fully implemented in one or more circuits or logic elements.

[0221] The techniques of the present disclosure may be implemented in a variety of devices or apparatuses including wireless handsets, integrated circuits (ICs), or a set of ICs (e.g., chipsets). Various components, modules, or units are described in the present disclosure to emphasize the functional aspects of devices configured to perform the disclosed techniques, but do not necessarily need to be implemented by different hardware units. Instead, as described above, the various units may be combined in a codec hardware unit, or provided by a collection of interoperable hardware units, including one or more processors as described above in combination with appropriate software and / or firmware.

Claims

1. A method for decoding video data, the method comprising: determining whether to allow the selected template based on a comparison of a threshold and a number of reference samples in the selected template, wherein a mode index indicates which template from among a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current coding unit (CU) of a current picture of the video data; Based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, applying the CCCM mode to predict chroma samples of the current CU based on reconstructed luma samples of the current CU and reference samples in the selected template; and The current CU is encoded or decoded based on the predicted chroma samples of the current CU.

2. The method according to claim 1, wherein: The plurality of templates include two or more of the following: a first template including neighboring reconstructed samples above and to the left of the current CU, a second template limited to neighboring reconstructed samples above the current CU, and A third template limited to neighboring reconstructed samples to the left of the current CU.

3. The method according to claim 2, wherein: The threshold is one of a first threshold or a second threshold, and determining whether to allow the selected template comprises: disallowing the first template based on a number of samples in the first template being less than the first threshold; not allowing the second template based on the number of samples in the second template being less than the second threshold; and The third template is not allowed based on the number of samples in the third template being less than the second threshold.

4. The method according to claim 3, wherein: One of the following: the first threshold is equal to the second threshold, or The first threshold is smaller than the second threshold.

5. The method according to claim 3, wherein: At least one of the first threshold or the second threshold depends on the mode index.

6. The method according to claim 1, wherein: Based on the current CU being at the edge of the current picture, the multiple templates include one of the following: two or more templates restricted to neighboring reconstructed samples above the current CU, or Two or more templates restricted to neighboring reconstructed samples to the left of the current CU.

7. The method according to claim 1, wherein: The plurality of templates include a first template and a second template that do not overlap, The first template includes samples above and to the left of the current CU, and The second template includes samples above the current CU or on the left side of the current CU.

8. The method according to claim 1, wherein: The method further comprises: encoding or decoding the mode index, and The mode index also indicates how many linear models are used for the current CU.

9. The method according to claim 1, wherein: Applying the CCCM mode includes: determining coefficients of a filter based on reference samples in the selected template; downsampling the reconstructed luma samples of the current CU to generate a downsampled luma block; and A 7-tap filter is applied to luma samples of the downsampled luma block to predict chroma samples of the current CU.

10. A device for encoding or decoding video data, the device comprising: a memory configured to store the video data; as well as One or more processors implemented in circuitry, the one or more processors being configured to: determining whether to allow the selected template based on a comparison of a threshold and a number of reference samples in the selected template, wherein a mode index indicates which template from among a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current coding unit (CU) of a current picture of the video data; Based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, applying a CCCM mode to predict chroma samples of the current CU based on reconstructed luma samples of the current CU and reference samples in the selected template; and The current CU is encoded or decoded based on the predicted chroma samples of the current CU.

11. The device according to claim 10, wherein: The plurality of templates include two or more of the following: a first template including neighboring reconstructed samples above and to the left of the current CU, a second template limited to neighboring reconstructed samples above the current CU, and A third template limited to neighboring reconstructed samples to the left of the current CU.

12. The device according to claim 11, wherein The threshold is one of a first threshold or a second threshold, and as part of determining whether to allow the selected template, the one or more processors are configured to: disallowing the first template based on a number of samples in the first template being less than the first threshold; disallowing the second template based on the number of samples in the second template being less than the second threshold; as well as The third template is not allowed based on the number of samples in the third template being less than the second threshold.

13. The device according to claim 12, wherein: One of the following: the first threshold is equal to the second threshold, or The first threshold is smaller than the second threshold.

14. The apparatus according to claim 12, wherein: At least one of the first threshold or the second threshold depends on the mode index.

15. The apparatus according to claim 10, wherein: Based on the current CU being at the edge of the current picture, the multiple templates include one of the following: two or more templates restricted to neighboring reconstructed samples above the current CU, or Two or more templates restricted to neighboring reconstructed samples to the left of the current CU.

16. The apparatus of claim 10, wherein: The plurality of templates include a first template and a second template that do not overlap, The first template includes samples above and to the left of the current CU, and The second template includes samples above the current CU or on the left side of the current CU.

17. The apparatus according to claim 10, wherein: The one or more processors are further configured to encode or decode the mode index, and the mode index further indicates how many linear models are used for the current CU.

18. The apparatus according to claim 10, wherein: As part of applying the CCCM mode, the one or more processors are configured to: determining coefficients of a filter based on reference samples in the selected template; Downsampling the reconstructed luma samples of the current CU to generate a downsampled luma block; as well as A 7-tap filter is applied to luma samples of the downsampled luma block to predict chroma samples of the current CU.

19. The apparatus of claim 10, further comprising: A display configured to display the decoded video data.

20. The apparatus according to claim 10, wherein: The device includes one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

21. The apparatus according to claim 10, wherein: The apparatus comprises a video decoder.

22. The apparatus of claim 10, wherein: The apparatus includes a video encoder.

23. A non-transitory computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to: Based on the comparison between the threshold and the number of reference samples in the selected template, it is determined whether to allow the selected template, wherein, a mode index indicating which template from among a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples adjacent to a current coding unit (CU) of a current picture of the video data; Based on determining that the selected template is allowed and a convolutional cross-component model (CCCM) mode is to be used, applying the CCCM mode to predict chroma samples of the current CU based on reconstructed luma samples of the current CU and reference samples in the selected template; and The current CU is encoded or decoded based on the predicted chroma samples of the current CU.

24. A device for encoding or decoding video data, the device comprising: means for determining whether to allow a selected template based on a comparison of a threshold and a number of reference samples in the selected template, wherein a mode index indicates which template from among a plurality of templates is the selected template, wherein each of the templates includes a different set of reconstructed samples neighboring a current coding unit (CU) of a current picture of the video data; means for applying a convolutional cross-component model (CCCM) mode to predict chroma samples of the current CU based on reconstructed luma samples of the current CU and reference samples in the selected template based on determining that the selected template is allowed and the CCCM mode is to be used; and Means for encoding or decoding a current CU based on predicted chroma samples of the current CU.