Method and apparatus for adaptive transform selection for intra prediction

Adaptive transform selection based on histogram of prediction directions and lookup tables addresses inefficiencies in intra prediction, enhancing video coding efficiency and performance.

WO2026008028A1PCT designated stage Publication Date: 2026-01-08GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/106904
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-05
Filing Date
2025-07-03
Publication Date
2026-01-08

AI Technical Summary

Technical Problem

Existing video coding technologies face inefficiencies in selecting optimal transform sets for intra prediction, particularly in modified and angular modes, leading to suboptimal compression and decoding performance.

Method used

The method and apparatus adaptively select transform sets based on the histogram of prediction directions and lookup tables for intra prediction modes, enabling efficient determination of LFNST/NSPT transform sets and candidate transform sets for improved decoding and encoding processes.

Benefits of technology

This approach enhances the efficiency of video coding by optimizing transform selection, leading to improved compression and decoding performance, particularly in modified and angular modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025106904_08012026_PF_FP_ABST
    Figure CN2025106904_08012026_PF_FP_ABST
Patent Text Reader

Abstract

According to one aspect of the present disclosure, a method of decoding is provided. The method may include, in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determining one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode. The method may include determining a plurality of low frequency non-separable secondary transform (LFNST) / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM. The method may include, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decoding, by the processor, a current block based on the first LFNST / NSPT transform set.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD AND APPARATUS FOR ADAPTIVE TRANSFORM SELECTION FOR INTRA PREDICTIONCROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application claims the benefit of priority to U.S. Provisional Application No. 63 / 668,098, entitled “ADAPTIVE TRANSFORM SELECTION FOR INTRA PREDICTION IN VIDEO CODING” and filed on July 5, 2024, which is incorporated by reference herein in its entirety.BACKGROUND

[0002] Embodiments of the present disclosure relate to video coding.

[0003] Digital video has become mainstream and is being used in a wide range of applications including digital television, video telephony, and teleconferencing. These digital video applications are feasible because of the advances in computing and communication technologies as well as efficient video coding techniques. Various video coding techniques may be used to compress video data, such that coding on the video data can be performed using one or more video coding standards. Exemplary video coding standards may include, but are not limited to, versatile video coding (H. 266 / VVC) , high-efficiency video coding (H. 265 / HEVC) , advanced video coding (H. 264 / AVC) , moving picture expert group (MPEG) coding, enhanced video coding model (ECM) , to name a few.SUMMARY

[0004] According to one aspect of the present disclosure, a method of decoding is provided. The method may include, in response to a modified MIP mode or an angular MIP mode being enabled, determining, by a processor, one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The method may include determining, by the processor, a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The method may include, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decoding, by the processor, a current block based on the first LFNST / NSPT transform set.

[0005] According to another aspect of the present disclosure, a method of decoding is provided. The method may include, in response to an OBIC being enabled, an MIP mode, or an angular MIP mode being enabled, determining, by a processor, a first candidate transform set based on a lookup table. The method may include determining, by the processor, a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The method may include, in response to a flag indicating the second candidate transform set is selected, decoding, by the processor, a current block based on the second candidate transform set.

[0006] According to a further aspect of the present disclosure, a decoder is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.

[0007] According to a further aspect of the present disclosure, a decoder is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.

[0008] According to a further aspect of the present disclosure, an apparatus for decoding is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.

[0009] According to a further aspect of the present disclosure, an apparatus for decoding is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.

[0010] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for a decoder is provided. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.

[0011] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for a decoder is provided. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.

[0012] According to one aspect of the present disclosure, a method of encoding is provided. The method may include, in response to a modified MIP mode or an angular MIP mode being enabled, determining, by a processor, one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The method may include determining, by the processor, a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The method may include, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encoding, by the processor, a current block based on the first LFNST / NSPT transform set.

[0013] According to another aspect of the present disclosure, a method of encoding is provided. The method may include, in response to an OBIC being enabled, an MIP mode, or an angular MIP mode being enabled, determining, by a processor, a first candidate transform set based on a lookup table. The method may include determining, by the processor, a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The method may include, in response to a flag indicating the second candidate transform set is selected, encoding, by the processor, a current block based on the second candidate transform set.

[0014] According to a further aspect of the present disclosure, an encoder is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.

[0015] According to a further aspect of the present disclosure, an encoder is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.

[0016] According to a further aspect of the present disclosure, an apparatus for encoding is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.

[0017] According to a further aspect of the present disclosure, an apparatus for encoding is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.

[0018] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for an encoder is provided. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.

[0019] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for an encoder is provided. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.

[0020] According to still a further aspect of the present disclosure, a non-transitory computer-readable medium storing a bitstream is provided. The bitstream may be generated according to one or more of the operations disclosed herein.

[0021] According to yet another aspect of the present disclosure, a method of transmitting a bitstream is provided. The method may include generating, by a processor, a bitstream based on one or more of the operations described herein. The method may include transmitting, by the processor, the bitstream.

[0022] These illustrative embodiments are mentioned not to limit or define the present disclosure, but to provide examples to aid understanding thereof. Additional embodiments are described in the Detailed Description, and further description is provided there.BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments of the present disclosure and, together with the description, further serve to explain the principles of the present disclosure and to enable a person skilled in the pertinent art to make and use the present disclosure.

[0024] FIG. 1 illustrates a block diagram of an exemplary encoding system, according to some embodiments of the present disclosure.

[0025] FIG. 2 illustrates a block diagram of an exemplary decoding system, according to some embodiments of the present disclosure.

[0026] FIG. 3 illustrates a detailed block diagram of an exemplary encoder in the encoding system in FIG. 1, according to some embodiments of the present disclosure.

[0027] FIG. 4 illustrates a detailed block diagram of an exemplary decoder in the decoding system in FIG. 2, according to some embodiments of the present disclosure.

[0028] FIG. 5 illustrates an exemplary picture divided into coding tree units (CTUs) , according to some embodiments of the present disclosure.

[0029] FIG. 6 illustrates an exemplary CTU divided into coding units (CUs) , according to some embodiments of the present disclosure.

[0030] FIG. 7 illustrates a schematic visualization of a current CU block and spatially adjacent and non-adjacent reconstructed samples to the current block, according to some embodiments of the present disclosure.

[0031] FIG. 8 illustrates a schematic visualization of the angular modes of VVC, according to some embodiments of the present disclosure.

[0032] FIG. 9 illustrates an example visualization of an inter prediction mode, according to some aspects of the present disclosure.

[0033] FIG. 10A illustrates an LFNST kernel with zero-out regions for 4xN, Nx4, and 8x8 block sizes, according to some embodiments of the present disclosure.

[0034] FIG. 10B illustrates an LFNST kernel with zero-out regions for 8xN and Nx8 block sizes, according to some embodiments of the present disclosure.

[0035] FIG. 11A illustrates an LFNST kernel for 4xN and Nx4 block sizes in ECM, according to some embodiments of the present disclosure.

[0036] FIG. 11B illustrates an LFNST kernel for 8xN and Nx8 block sizes in ECM, according to some embodiments of the present disclosure.

[0037] FIG. 11C illustrates an LFNST kernel 16x16 block size in ECM, according to some embodiments of the present disclosure.

[0038] FIG. 12 illustrates an example transform coefficient scanning order, according to some embodiments of the present disclosure.

[0039] FIG. 13 illustrates a decoder-side intra mode derivation (DIMD) mode for ECM, according to some embodiments of the present disclosure.

[0040] FIG. 14 illustrates a template-based intra mode derivation (TIMD) mode for ECM, according to some embodiments of the present disclosure.

[0041] FIG. 15A illustrates a representation of spatial geometric partitioning mode (SGPM) signaling, according to some embodiments of the present disclosure.

[0042] FIG. 15B illustrates an example template used to generate a candidate list, according to some embodiments of the present disclosure.

[0043] FIG. 16 illustrates a schematic visualization of the inter angular mode parallel to the GPM partitioning boundary (Parallel mode) (see (a) ) , the inter angular mode perpendicular to the GPM partitioning boundary (Perpendicular mode) (see (b) ) , and the inter prediction Planar mode (see (c) ) , and SGPM with intra and inter prediction (see (d) ) , according to some embodiments of the present disclosure.

[0044] FIG. 17 illustrates an adaptive SGPM blending scheme, according to some embodiments of the present disclosure.

[0045] FIG. 18 illustrates an example visualization of intra block copy (IBC) prediction, according to some embodiments of the present disclosure.

[0046] FIG. 19 illustrates an example visualization of intra template matching prediction (intraTMP) , according to some embodiments of the present disclosure.

[0047] FIG. 20 illustrates a diagram of non-adjacent spatial neighboring candidates for occurrence-based intra coding (OBIC) mode, according to some embodiments of the present disclosure.

[0048] FIG. 21 illustrates an example of the histogram-of-occurrences (HoC) of intra prediction mode, according to some embodiments of the present disclosure.

[0049] FIG. 22 illustrates an example visualization of matrix-based intra-picture prediction (MIP) in VVC, according to some embodiments of the present disclosure.

[0050] FIG. 23 illustrates an example L-shaped neighborhood for a corresponding predicted block, according to some embodiments of the present disclosure.

[0051] FIG. 24 illustrates a flowchart of a first exemplary method of decoding, according to some embodiments of the present disclosure.

[0052] FIG. 25 illustrates a flowchart of a second exemplary method of decoding, according to some embodiments of the present disclosure.

[0053] FIG. 26 illustrates a flowchart of a first exemplary method of encoding, according to some embodiments of the present disclosure.

[0054] FIG. 27 illustrates a flowchart of a second exemplary method of encoding, according to some embodiments of the present disclosure.

[0055] Embodiments of the present disclosure will be described with reference to the accompanying drawings.DETAILED DESCRIPTION

[0056] Although some configurations and arrangements are discussed, it should be understood that this is done for illustrative purposes only. A person skilled in the pertinent art will recognize that other configurations and arrangements can be used without departing from the spirit and scope of the present disclosure. It will be apparent to a person skilled in the pertinent art that the present disclosure can also be employed in a variety of other applications.

[0057] It is noted that references in the specification to “one embodiment, ” “an embodiment, ” “an example embodiment, ” “some embodiments, ” “certain embodiments, ” etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases do not necessarily refer to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it would be within the knowledge of a person skilled in the pertinent art to effect such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.

[0058] In general, terminology may be understood at least in part from usage in context. For example, the term “one or more” as used herein, depending at least in part upon context, may be used to describe any feature, structure, or characteristic in a singular sense or may be used to describe combinations of features, structures or characteristics in a plural sense. Similarly, terms, such as “a, ” “an, ” or “the, ” again, may be understood to convey a singular usage or to convey a plural usage, depending at least in part upon context. In addition, the term “based on” may be understood as not necessarily intended to convey an exclusive set of factors and may, instead, allow for the existence of additional factors not necessarily expressly described, again, depending at least in part on context.

[0059] Various aspects of video coding systems will now be described with reference to various apparatus and methods. These apparatus and methods will be described in the following detailed description and illustrated in the accompanying drawings by various modules, components, circuits, steps, operations, processes, algorithms, etc. (collectively referred to as “elements” ) . These elements may be implemented using electronic hardware, firmware, computer software, or any combination thereof. Whether such elements are implemented as hardware, firmware, or software depends upon the particular application and design constraints imposed on the overall system.

[0060] The techniques described herein may be used for various video coding applications. As described herein, video coding includes both encoding and decoding a video. Encoding and decoding of a video can be performed by the unit of block. For example, an encoding / decoding process such as transform, quantization, prediction, in-loop filtering, reconstruction, or the like may be performed on a coding block, a transform block, or a prediction block. As described herein, a block to be encoded / decoded will be referred to as a “current block. ” For example, the current block may represent a coding block, a transform block, or a prediction block according to a current encoding / decoding process. In addition, it is understood that the term “unit” used in the present disclosure indicates a basic unit for performing a specific encoding / decoding process, and the term “block” indicates a sample array of a predetermined size. Unless otherwise stated, the “block” and “unit” may be used interchangeably.

[0061] FIG. 1 illustrates a block diagram of an exemplary encoding system 100, according to some embodiments of the present disclosure. FIG. 2 illustrates a block diagram of an exemplary decoding system 200, according to some embodiments of the present disclosure. Each system 100 or 200 may be applied or integrated into various systems and apparatus capable of data processing, such as computers and wireless communication devices. For example, system 100 or 200 may be the entirety or part of a mobile phone, a desktop computer, a laptop computer, a tablet, a vehicle computer, a gaming console, a printer, a positioning device, a wearable electronic device, a smart sensor, a virtual reality (VR) device, an argument reality (AR) device, or any other suitable electronic devices having data processing capability. As shown in FIGs. 1 and 2, system 100 or 200 may include a processor 102, a memory 104, and an interface 106. These components are shown as connected to one another by a bus, but other connection types are also permitted. It is understood that system 100 or 200 may include any other suitable components for performing functions described here.

[0062] Processor 102 may include microprocessors, such as a graphic processing unit (GPU) , image signal processor (ISP) , central processing unit (CPU) , digital signal processor (DSP) , tensor processing unit (TPU) , vision processing unit (VPU) , neural processing unit (NPU) , synergistic processing unit (SPU) , or physics processing unit (PPU) , microcontroller units (MCUs) , application-specific integrated circuits (ASICs) , field-programmable gate arrays (FPGAs) , programmable logic devices (PLDs) , state machines, gated logic, discrete hardware circuits, and other suitable hardware configured to perform the various functions described throughout the present disclosure. Although only one processor is shown in FIGs. 1 and 2, it is understood that multiple processors can be included. Processor 102 may be a hardware device having one or more processing cores. Processor 102 may execute software. Software shall be construed broadly to mean instructions, instruction sets, code, code segments, program code, programs, subprograms, software modules, applications, software applications, software packages, routines, subroutines, objects, executables, threads of execution, procedures, functions, etc., whether referred to as software, firmware, middleware, microcode, hardware description language, or otherwise. Software can include computer instructions written in an interpreted language, a compiled language, or machine code. Other techniques for instructing hardware are also permitted under the broad category of software.

[0063] Memory 104 can broadly include both memory (a. k. a, primary / system memory) and storage (a. k. a. secondary memory) . For example, memory 104 may include random-access memory (RAM) , read-only memory (ROM) , static RAM (SRAM) , dynamic RAM (DRAM) , ferro-electric RAM (FRAM) , electrically erasable programmable ROM (EEPROM) , compact disc read-only memory (CD-ROM) or other optical disk storage, hard disk drive (HDD) , such as magnetic disk storage or other magnetic storage devices, Flash drive, solid-state drive (SSD) , or any other medium that can be used to carry or store desired program code in the form of instructions that can be accessed and executed by processor 102. Broadly, memory 104 may be embodied by any computer-readable medium, such as a non-transitory computer-readable medium. Although only one memory is shown in FIGs. 1 and 2, it is understood that multiple memories can be included.

[0064] Interface 106 can broadly include a data interface and a communication interface that is configured to receive and transmit a signal in the process of receiving and transmitting information with other external network elements. For example, interface 106 may include input / output (I / O) devices and wired or wireless transceivers. Although only one memory is shown in FIGs. 1 and 2, it is understood that multiple interfaces can be included.

[0065] Processor 102, memory 104, and interface 106 may be implemented in various forms in system 100 or 200 for performing video coding functions. In some embodiments, processor 102, memory 104, and interface 106 of system 100 or 200 are implemented (e.g., integrated) on one or more system-on-chips (SoCs) . In one example, processor 102, memory 104, and interface 106 may be integrated into an application processor (AP) SoC that handles application processing in an operating system (OS) environment, including running video encoding and decoding applications. In another example, processor 102, memory 104, and interface 106 may be integrated into a specialized processor chip for video coding, such as a GPU or ISP chip dedicated to image and video processing in a real-time operating system (RTOS) .

[0066] As shown in FIG. 1, in encoding system 100, processor 102 may include one or more modules, such as an encoder 101. Although FIG. 1 shows that encoder 101 is within one processor 102, it is understood that encoder 101 may include one or more sub-modules that can be implemented on different processors located closely or remotely with each other. Encoder 101 (and any corresponding sub-modules or sub-units) can be hardware units (e.g., portions of an integrated circuit) of processor 102 designed for use with other components or software units implemented by processor 102 through executing at least part of a program, e.g., instructions. The instructions of the program may be stored on a computer-readable medium, such as memory 104, and when executed by processor 102, it may perform a process having one or more functions related to video encoding, such as picture partitioning, inter prediction, intra prediction, transformation, quantization, filtering, entropy encoding, etc., as described below in detail.

[0067] Similarly, as shown in FIG. 2, in decoding system 200, processor 102 may include one or more modules, such as a decoder 201. Although FIG. 2 shows that decoder 201 is within one processor 102, it is understood that decoder 201 may include one or more sub-modules that can be implemented on different processors located closely or remotely with each other. Decoder 201 (and any corresponding sub-modules or sub-units) can be hardware units (e.g., portions of an integrated circuit) of processor 102 designed for use with other components or software units implemented by processor 102 through executing at least part of a program, e.g., instructions. The instructions of the program may be stored on a computer-readable medium, such as memory 104, and when executed by processor 102, it may perform a process having one or more functions related to video decoding, such as entropy decoding, inverse quantization, inverse transformation, inter prediction, intra prediction, filtering, as described below in detail.

[0068] FIG. 3 illustrates a detailed block diagram of exemplary encoder 101 in encoding system 100 in FIG. 1, according to some embodiments of the present disclosure. As shown in FIG. 3, encoder 101 may include a partitioning module 302, an inter prediction module 304, an intra prediction module 306, a transform module 308, a quantization module 310, a dequantization module 312, an inverse transform module 314, a filter module 316, a buffer module 318, and an encoding module 320. It is understood that each of the elements shown in FIG. 3 is independently shown to represent characteristic functions different from each other in a video encoder, and it does not mean that each component is formed by the configuration unit of separate hardware or single software. That is, each element is included to be listed as an element for convenience of explanation, and at least two of the elements may be combined to form a single element, or one element may be divided into a plurality of elements to perform a function. It is also understood that some of the elements are not necessary elements that perform functions described in the present disclosure but instead may be optional elements for improving performance. It is further understood that these elements may be implemented using electronic hardware, firmware, computer software, or any combination thereof. Whether such elements are implemented as hardware, firmware, or software depends upon the particular application and design constraints imposed on encoder 101.

[0069] Partitioning module 302 may be configured to partition an input picture of a video into at least one processing unit. A picture can be a frame of the video or a field of the video. In some embodiments, a picture includes an array of luma samples in monochrome format, or an array of luma samples and two corresponding arrays of chroma samples. At this point, the processing unit may be a prediction unit (PU) , a transform unit (TU) , or a coding unit (CU) . Partitioning module 302 may partition a picture into a combination of a plurality of coding units, prediction units, and transform units, and encode a picture by selecting a combination of a coding unit, a prediction unit, and a transform unit based on a predetermined criterion (e.g., a cost function) .

[0070] Similar to H. 265 / HEVC, H. 266 / VVC is a block-based hybrid spatial and temporal predictive coding scheme. As shown in FIG. 5, during encoding, an input picture 500 is first divided into square blocks -CTUs 502, by partitioning module 302. For example, CTUs 502 can be blocks of 128×128 pixels. As shown in FIG. 6, each CTU 502 in input picture 500 can be partitioned by partitioning module 302 into one or more CUs 602, which can be used for prediction and transformation. Unlike H. 265 / HEVC, in H. 266 / VVC, CUs 602 can be rectangular or square, and can be coded without further partitioning into prediction units or transform units. For example, as shown in FIG. 6, the partition of CTU 502 into CUs 602 may include quadtree splitting (indicated in solid lines) , binary tree splitting (indicated in dashed lines) , and ternary splitting (indicated in dash-dotted lines) . Each CU 602 can be as large as its root CTU 502 or be subdivisions of root CTU 502 as small as 4×4 blocks, according to some embodiments.

[0071] Referring to FIG. 3, inter prediction module 304 may be configured to perform inter prediction on a prediction unit, and intra prediction module 306 may be configured to perform intra prediction on a prediction unit. It may be determined whether to use inter prediction or to perform intra prediction for the prediction unit, and determine specific information (e.g., intra prediction mode, motion vector, reference picture, etc. ) according to each prediction method. At this point, a processing unit for performing prediction may be different from a processing unit for determining a prediction method and specific content. For example, a prediction method and a prediction mode may be determined in a prediction unit, and transform may be performed in a transform unit. Residual coefficients in a residual block between the generated prediction block and the original block may be input into transform module 308. In addition, prediction mode information, motion vector information, and the like used for prediction may be encoded by encoding module 320 together with the residual coefficients or quantization levels into the bitstream. It is understood that in certain encoding modes, an original block may be encoded as it is without generating a prediction block through prediction module 304 or 306. It is also understood that in certain encoding modes, prediction, transform, and / or quantization may be skipped as well.

[0072] In some embodiments, inter prediction module 304 may predict a prediction unit based on information on at least one picture among pictures before or after the current picture, and in some cases, it may predict a prediction unit based on information on a partial area that has been encoded in the current picture. Inter prediction module 304 may include sub-modules, such as a reference picture interpolation module, a motion prediction module, and a motion compensation module (not shown) . For example, the reference picture interpolation module may receive reference picture information from buffer module 318 and generate pixel information of an integer number of pixels from the reference picture. In the case of a luminance pixel, a discrete cosine transform (DCT) -based 8-tap interpolation filter with a varying filter coefficient may be used to generate pixel information of an integer number of pixels by the unit of 1 / 4 pixels. In the case of a color difference signal, a DCT-based 4-tap interpolation filter with a varying filter coefficient may be used to generate pixel information of an integer number of pixels by the unit of 1 / 8 pixels. The motion prediction module may perform motion prediction based on the reference picture interpolated by the reference picture interpolation part. Various methods, such as a full search-based block matching algorithm (FBMA) , a three-step search (TSS) , and a new three-step search algorithm (NTS) may be used as a method of calculating a motion vector. The motion vector may have a motion vector value of a unit of 1 / 2, 1 / 4, or 1 / 16 pixels or integer pel based on interpolated pixels. The motion prediction module may predict a current prediction unit by varying the motion prediction method. Various methods, such as a skip method, a merge method, an advanced motion vector prediction (AMVP) method, an intra-block copy method, and the like, may be used as the motion prediction method.

[0073] Still referring to FIG. 3, in some embodiments, intra prediction module 306 may generate a prediction unit based on the information on reference pixels around the current block, which is pixel information in the current picture. The reference pixels may be located in reference lines non-adjacent to the current block. When a block in the neighborhood of the current prediction unit is a block on which inter prediction has been performed and thus, the reference pixel is a pixel on which inter prediction has been performed, the reference pixel included in the block on which inter prediction has been performed may be used in place of reference pixel information of a block in the neighborhood on which intra prediction has been performed. That is, when a reference pixel is unavailable, at least one reference pixel among available reference pixels may be used in place of unavailable reference pixel information. In the intra prediction, the prediction mode may have an angular prediction mode that uses reference pixel information according to a prediction direction, and a non-angular prediction mode that does not use directional information when performing prediction. A mode for predicting luminance information may be different from a mode for predicting color difference information, and intra prediction mode information used to predict luminance information or predicted luminance signal information may be used to predict the color difference information. If the size of the prediction unit is the same as the size of the transform unit when intra prediction is performed, the intra prediction may be performed for the prediction unit based on pixels on the left side, pixels on the top-left side, and pixels on the top of the prediction unit. However, if the size of the prediction unit is different from the size of the transform unit when the intra prediction is performed, the intra prediction may be performed using a reference pixel based on the transform unit.

[0074] The intra prediction method may generate a prediction block after applying an adaptive intra smoothing (AIS) filter to the reference pixel according to a prediction mode. The type of the AIS filter applied to the reference pixel may vary. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit may be predicted from the intra prediction mode of the prediction unit existing in the neighborhood of the current prediction unit. When a prediction mode of the current prediction unit is predicted using the mode information predicted from the neighboring prediction unit, if the intra prediction modes of the current prediction unit are the same as the prediction unit in the neighborhood, information indicating that the prediction modes of the current prediction unit are the same as the prediction unit in the neighborhood may be transmitted using predetermined flag information, and if the prediction modes of the current prediction unit and the prediction unit in the neighborhood are different from each other, prediction mode information of the current block may be encoded by extra flags information.

[0075] As shown in FIG. 3, a residual module including a prediction module that has performed prediction based on the prediction module generated by prediction module 304 or 306 and residual coefficient information (also referred to herein as the “residual” ) , which is a difference value of the prediction unit with the original block, may be generated. The generated residual block may be input into transform module 308. Additional details of residuals and transforms for video coding will now be provided.

[0076] In hybrid video coding systems, redundancy in the video signal is first exploited by applying inter or intra prediction tools for each CU. The difference between the original samples of a CU and the prediction block for that CU is commonly referred to as the residual. Even after prediction, the residual may still be highly spatially correlated. Although conditional entropy coding can capture some spatial dependency between adjacent samples, it is computationally impractical to form entropy coding statistical models that can fully exploit spatial correlation in the residual. In contrast, transform coding is a practical and effective method for spatially decorrelating the residual.

[0077] For example, transform module 308 may transform the residual using an integerized version of the two-dimensional discrete cosine transform (DCT) , which may be applied separably in the horizontal and vertical directions. For an MxN block of residual samples (where M is the width of the block and N is the height of the block) , transform module 308 may obtain transform coefficients by applying an MxM DCT to each row, resulting in intermediate transform coefficients, and then applying an NxN DCT to each column of intermediate transform coefficients.

[0078] For intra-coded CUs (also referred to herein as “intra CUs” ) , spatial neighboring reconstructed samples are used to predict the current block, and the intra prediction mode is signaled once for the entire CU. Each CU consists of one or more collocated coding blocks (CBs) corresponding to the color components of the video sequence. For example, consumer video typically takes the 4: 2: 0 chroma format, in which case each CU consists of a luma CB and two chroma CBs with one-quarter the samples of the luma CB. Intra prediction and transform coding are performed at the prediction block (PB) and transform block (TB) level, respectively. Each CB consists of a single TB, except in the cases of Intra Subpartition (ISP) mode and implicit splitting. For luma CBs, the maximum side length of a TB is 64, and the minimum side length is 4. In addition, luma TBs are further specified as W × H rectangular blocks of width W and height H, where W, H ∈ {4, 8, 16, 32, 64} . For chroma CBs, the maximum TB side length is 32, and chroma TBs are rectangular W × H blocks of width W and height H. Here, W, H ∈ {2, 4, 8, 16, 32} , but blocks of shapes 2 × H and 4 × 2 are excluded in order to address memory architecture and throughput requirements.

[0079] FIG. 7 illustrates a schematic visualization 700 of a current CU block 702 and spatially adjacent and non-adjacent reconstructed samples to the current block, according to some aspects of the present disclosure. In FIG. 7, the number 0, 1, 2, . . . indicates the pixel-line index in relation to current CU block 702.

[0080] In VVC, the intra prediction samples for the current block are generated using reference samples that are obtained from reconstructed samples of neighboring blocks. For a W ×H block, the reference samples are spatially adjacent to the current block, consisting of the vertical line of 2·H reconstructed samples to the left of the block and extending downwards, the top left reconstructed sample, and the horizontal line of 2·W reconstructed samples above the current block and extending to the right. This “L” shaped set of samples may be referred to in this disclosure as a “reference line” . The reference line directly adjacent to current CU block 702 is shown as the line with index 0 in FIG. 7.

[0081] Similar to AVC and HEVC, VVC also supports angular intra prediction modes. Angular intra prediction is a directional intra prediction method. In comparison to HEVC, the angular intra prediction of VVC was modified by increasing the prediction accuracy and by an adaptation to the new partitioning framework. The former was realized by enlarging the number of angular prediction directions and by more accurate interpolation filters, while the latter was achieved by introducing wide-angular intra prediction modes. In VVC, the number of directional modes available for a given block is increased to 65 directions from the 33 HEVC directions. The angular modes 800 of VVC are depicted in FIG. 8.

[0082] The directions having even indices between 2 and 66 are equivalent to the directions of the angular modes supported in HEVC. For blocks of square shape, an equal number of angular modes is assigned to the top and left side of a block. On the other hand, intra blocks of rectangular shape, which are not present in HEVC, are a central part of VVC’s partitioning scheme with additional intra prediction directions assigned to the longer side of a block. The additional modes allocated along a longer side are called Wide-Angle Intra Prediction (WAIP) modes, since they correspond to prediction directions with angles greater than 45° relative to the horizontal or vertical mode. A WAIP mode for a given mode index is defined by mapping the original directional mode to a mode that has the opposite direction with an index offset equal to one, as shown in FIG. 8. For a given rectangular block, the aspect ratio, i.e., the ratio of width to height, is used to determine which angular modes are to be replaced by the corresponding wide-angular modes.

[0083] For square-shaped blocks in VVC, each pair of predicted samples that are horizontally or vertically adjacent is predicted from a pair of adjacent reference samples. To the contrary, WAIP extends the angular range of directional prediction beyond 45°, and therefore, for a coding block predicted with a WAIP mode, adjacent predicted samples may be predicted from non-adjacent reference samples.

[0084] In addition to the directly adjacent line of neighboring samples, one of the two non-adjacent reference lines (line 1 and line 2) that are depicted in FIG. 7 may include the input samples for intra prediction in VVC. For ECM, more non-adjacent reference lines may be used. The use of adjacent and non-adjacent reference samples is referred to as multiple reference line (MRL) prediction.

[0085] The intra modes that can be used for MRL are the DC mode and the angular prediction modes. However, for a given block, not all of these modes can be combined with MRL. The MRL mode is always coupled with a mode in the Most Probable Mode (MPM) list in VVC. This coupling means that if non-adjacent reference lines are used, the intra prediction mode is one of the MPMs. Such a design of an MPM-based MRL prediction mode is motivated by the observation that non-adjacent reference lines are mainly beneficial for texture patterns with sharp and strongly directed edges. In these cases, MPMs are much more frequently selected since there is typically a strong correlation between the texture patterns of the neighboring and the current blocks. On the other hand, choosing a non-MPM for intra prediction is an indication that edges are not consistently distributed in neighboring blocks, and thus, the MRL prediction mode is expected to be less useful in this case. In addition, it has been observed that MRL does not provide additional coding gain when the intra prediction mode is the Planar mode, since this mode is typically used for smooth areas. Consequently, MRL excludes the Planar mode, which is always one of the MPMs. The angular or DC prediction process in MRL is very similar to the case of a directly adjacent reference line. However, for angular modes with a non-integer slope, a DCT-based interpolation filter (DCTIF) is always used. This design choice is both evidenced by experimental results and aligned with the empirical observation that MRL is mostly beneficial for sharp and strongly directed edges where the DCTIF is more appropriate since it retains more high frequencies than some other filters.

[0086] From a hardware design perspective, applying multiple reference lines as proposed in the initial methods requires extra cost of line buffers that are used for holding the additional reference lines. In typical hardware designs, line buffers are part of the on-chip memory architecture for image and video coding, and it is of great importance to minimize their on-chip area. To address this issue, MRL is disabled and not signaled for the coding units that are attached to the top boundary of the CTU. In this way, the extra buffers for holding non-adjacent reference lines are bounded by 128, which is the width of the largest unit size.

[0087] In some known approaches, an intra prediction fusion method was proposed to improve the accuracy of intra prediction. More specifically, if the current block is a luma block, and it is coded with a non-integer slope angular mode and not in the ISP mode, and the block size (width *height) is greater than 16, two prediction blocks generated from two different reference lines will be “fused, ” where the prediction fusion is calculated as a weighted summation of the two prediction blocks. More specifically, a first reference line at index i (linei) is specified with the current methods of signaling in the bitstream, and the prediction block generated from this reference line using the selected intra prediction mode is denoted as p (linei) , where p (·) represents the operation of generating a prediction block from a reference line with a given intra prediction mode. In the known approach, the reference line linei+1 is implicitly selected as the second reference line. That is, the second reference line is one index position further away from the current block relative to the first reference line. Similarly, the prediction block generated from the second reference line is denoted as p (linei+1) . The weighted sum of the two prediction blocks is obtained as follows and serves as the predictor for the current block according to equation (1) . pfusion=w0*p (linei) +w1*p (linei+1)            (1) , where pfusion represents the fused prediction, w0 and w1 are two weighting factors, and they are  set as 3 / 4 and 1 / 4 in the experiment, respectively.

[0088] FIG. 9 illustrates an example visualization of an inter prediction mode 900, according to some aspects of the present disclosure.

[0089] For inter-coded CUs (also referred to as “inter CUs” in this disclosure) , reconstructed samples in temporal reference frames are used to predict the current block and the inter prediction mode is signaled once for the entire CU. Inter prediction exploits the temporal correlation between pictures to derive a motion-compensated prediction (MCP) for a block of image samples.

[0090] A simple concept of motion-compensated prediction is described here assuming a translational motion model. Although the actual motion within a video sequence may be complex, a translational motion model is surprisingly effective because the flexible hierarchical partitioning of CTUs into CUs can permit adaptation to complex motion by choosing small CUs, while still coding simple motion efficiently with large CUs.

[0091] In a simple “uni-predicted” mode of inter prediction, a current CU is predicted by a single block of corresponding size from a previously decoded picture as illustrated in FIG. 9. Assuming a translational motion model, the position of the block relative to the current CU is indicated by a motion vector (Δx, Δy) , where Δx and Δy specify the horizontal and vertical displacements relative to the position of the current block along the horizontal and vertical directions, respectively. The displacements may be of fractional sample precision, in which case interpolation may be used to derive the prediction samples. The previously decoded picture used by the inter CU is called a reference picture. Previously decoded pictures are stored and maintained in a reference picture list. The reference picture used by the current CU is identified by a reference index Δt in the reference picture list. These inter prediction parameters, e.g., motion vectors and reference indices, may be referred to as motion data, or more generally as side information.

[0092] Due to occlusion effects, an inter CU may not always be well predicted by reference pictures that occur temporally prior in the video sequence. However, the order in which pictures are coded (the decoding picture order) is not required to be the same as the order the pictures occur in the video sequence (the displayed picture order) . The displayed picture order is determined by labelling each picture with a Picture Order Count (POC) , while the decoding picture order is decided by the encoder to best trade off desired latency and coding efficiency. For example, a typical strategy is to use a hierarchical Group-Of-Pictures (GOP) structure of 8, 16, or 32 consecutive frames. This allows an inter CU more flexibility to be predicted from pictures before or after the current picture in displayed picture order.

[0093] Video sequence effects such as cross fading can also be accounted for by allowing “bi-prediction” , in which the inter CU is predicted from two reference blocks identified from two sets of motion data (Δx0, Δy0, Δt0) and (Δx1, Δy1, Δt1) . The reference pictures that can be used in bi-prediction are stored in two separate lists, namely list 0 and list 1. The final prediction is determined by a weighted averaging between the two reference blocks.

[0094] VVC employs many coding tools that improve upon the basic inter prediction scheme described above. For example, the cost of encoding the motion vectors to the bitstream may be significantly reduced by signaling them as motion vector differences (MVDs) relative to motion vector predictors. Alternatively, a merge flag may signal that the motion vectors are inherited from a previously decoded inter CU. Some tools assume more complex motion models. For example, in translational motion compensation it is assumed that the same relative motion applies to each sample of the inter CU. In the affine mode, each sample of the inter CU has a relative motion determined from an affine projected plane through three motion vectors at the corners of the CU.

[0095] Regardless of the intra or inter prediction method, the resulting difference between the samples of the CU and the prediction block is called the residual. The residual may be further transformed before finally coding the samples to the bitstream.

[0096] Transforms are desirable to use when they achieve energy compaction, e.g., when a large proportion of the residual’s energy can be captured with fewer transform coefficients than the original samples. If energy compaction is achieved, then the transform can produce coding gain. Other desirable properties of transforms are that they be reversible and orthogonal. Reversibility implies that the residual can be losslessly recovered by the inverse transform at the decoder if no quantization was performed at the encoder. Orthogonality means that transform vectors form a basis, and that the basis vectors of the transform are orthogonal to each other and of unit length. The practical benefit of orthogonality is that quantization in the transformed domain can be performed independently across the coefficients. Orthogonality also means the transform vectors span the space of the input samples. This means any input vector (e.g., any combination of values of the input samples) can be represented by a weighted sum of the transform vectors. For a transform to be spanning, a necessary condition is that there must at least be as many transform vectors as the dimensionality of the input space, or in other words, the number of transform coefficients output is at least equal to the number of input samples. In the case of a basis, the number of transform coefficients is equal to the number of input samples. Then, if the number of input samples is N, an orthogonal transform can be represented by multiplication with an NxN matrix.

[0097] The discrete cosine transform (DCT) has all the above properties and is used extensively in video coding. The DCT is performed to video coding by applying a one-dimensional transform to the residual in the horizontal and vertical directions separately. That is, for an MxN residual block of samples, the DCT may be performed by applying an MxM DCT to each column of M residual samples, producing an intermediate block of transformed coefficients, then applying an NxN DCT to each row of N intermediate transformed coefficients, finally producing the two-dimensional DCT coefficients.

[0098] While a separable transform applies one-dimensional transforms in the horizontal and vertical directions separately, a two-dimensional non-separable transform is applied directly to a block of input samples. Then, for a spanning non-separable transform, if the block of input samples is an MxN residual, the transform will also output an MxN block of transform coefficients, which may be represented by a matrix implementation of (MxN) x (MxN) multiplications.

[0099] To derive a non-separable transform which produces coding gain for a particular directional feature, the transform may be learned. For example, a representative set of residual blocks corresponding to the directional feature of interest may be grouped, and then the Karhunen-Loeve Transform (KLT) may be calculated from the covariance matrix of the set of residual blocks. The process may be repeated over K different sets of residual blocks. Then, in this example, an overall transform kernel is derived with dimensionality (MxN) x (MxN) xK.

[0100] There are two problems with spanning non-separable transforms as described above. Firstly, the computation complexity is high. Because non-separable transforms are typically learned, they cannot generally be factorized. The matrix implementation of the spanning non-separable transform in the example above results in a complexity of (MxN) multiplications per sample. The second problem is that the transform kernel (s) occupy a large amount of storage in the encoder and decoder. In the above example, a single kernel adaptable to K different directional features has (MxN) x (MxN) xK weights. This kernel can only be applied to residual blocks with size MxN. To allow the application of non-separable transform to multiple block sizes, a transform kernel must be learned for each discrete block size.

[0101] Referring again to FIG. 3, transform module 308 can transform the video signals in the residual block from the pixel domain to a transform domain (e.g., a frequency domain depending on the transform method) . It is understood that in some examples, transform module 308 may be skipped, and the video signals may not be transformed to the transform domain.

[0102] Quantization module 310 may be configured to quantize the coefficient of each position in the coding block to generate quantization levels of the positions. The current block may be the residual block. That is, quantization module 310 can perform a quantization process on each residual block. The residual block may include N×M positions (samples) , each associated with a transformed or non-transformed video signal / data, such as luma and / or chroma information, where N and M are positive integers. In the present disclosure, before quantization, the transformed or non-transformed video signal at a specific position is referred to herein as a “coefficient. ” After quantization, the quantized value of the coefficient is referred to herein as a “quantization level” or “level. ”

[0103] Quantization can be used to reduce the dynamic range of transformed or non-transformed video signals so that fewer bits will be used to represent video signals. Quantization typically involves division by a quantization step size and subsequent rounding, while dequantization (a. k. a. inverse quantization) involves multiplication by the quantization step size. The quantization step size can be indicated by a quantization parameter (QP) . Such a quantization process is referred to as scalar quantization. The quantization of all coefficients within a coding block can be done independently, and this kind of quantization method is used in some existing video compression standards, such as H. 264 / AVC and H. 265 / HEVC. The QP in quantization can affect the bit rate used for encoding / decoding the pictures of the video. For example, a higher QP can result in a lower bit rate, and a lower QP can result in a higher bit rate.

[0104] For an N×M coding block, a specific coding scan order may be used to convert the two-dimensional (2D) coefficients of a block into a one-dimensional (1D) order for coefficient quantization and coding. Typically, the coding scan starts from the left-top corner and stops at the right-bottom corner of a coding block or the last non-zero coefficient / level in a right-bottom direction. It is understood that the coding scan order may include any suitable order, such as a zig-zag scan order, a vertical (column) scan order, a horizontal (row) scan order, a diagonal scan order, or any combinations thereof. Quantization of a coefficient within a coding block may make use of the coding scan order information. For example, it may depend on the status of the previous quantization level along the coding scan order. In order to further improve the coding efficiency, more than one quantizer, e.g., two scalar quantizers, can be used by quantization module 310. Which quantizer will be used for quantizing the current coefficient may depend on the information preceding the current coefficient in coding scan order. Such a quantization process is referred to as dependent quantization.

[0105] Referring to FIG. 3, encoding module 320 may be configured to encode the quantization level of each position in the coding block into the bitstream. In some embodiments, encoding module 320 may perform entropy encoding on the coding block. Entropy encoding may use various binarization methods, such as Golomb-Rice binarization, to convert each quantization level into a respective binary representation, such as binary bins. Then, the binary representation can be further compressed using entropy encoding algorithms. The compressed data may be added to the bitstream. Besides the quantization levels, encoding module 320 may encode various other information, such as block type information of a coding unit, prediction mode information, partitioning unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information input from, for example, prediction modules 304 and 306. In some embodiments, encoding module 320 may perform residual coding on a coding block to convert the quantization level into the bitstream. For example, after quantization, there may be N×M quantization levels for an N×M block. These N×M levels may be zero or non-zero values. The non-zero levels may be further binarized to binary bins if the levels are not binary, for example, using combined Truncated Rice (TR) and limited EGk binarization.

[0106] Non-binary syntax elements may be mapped to binary codewords. The bijective mapping between symbols and codewords, for which typically simple structured codes are used, is called binarization. The binary symbols, also called bins, of both binary syntax elements and codewords for non-binary data may be coded using binary arithmetic coding. The core coding engine of context-adaptive binary arithmetic coding (CABAC) can support two operating modes: a context coding mode, in which the bins are coded with adaptive probability models, and a less complex bypass mode that uses fixed probabilities of 1 / 2. The adaptive probability models are also called contexts, and the assignment of probability models to individual bins is referred to as context modeling.

[0107] As shown in FIG. 3, dequantization module 312 may be configured to dequantize the quantization levels by dequantization module 312, and inverse transform module 314 may be configured to inversely transform the coefficients transformed by transform module 308. The reconstructed residual block generated by dequantization module 312 and inverse transform module 314 may be combined with the prediction units predicted through prediction module 304 or 306 to generate a reconstructed block.

[0108] Filter module 316 may include at least one among a deblocking filter, a sample adaptive offset (SAO) , and an adaptive loop filter (ALF) . The deblocking filter may remove block distortion generated by the boundary between blocks in the reconstructed picture. The SAO module may correct an offset to the original video by the unit of pixel for a video on which the deblocking has been performed. ALF may be performed based on a value obtained by comparing the reconstructed and filtered video and the original video. Buffer module 318 may be configured to store the reconstructed block or picture calculated through filter module 316, and the reconstructed and stored block or picture may be provided to inter prediction module 304 when inter prediction is performed.

[0109] FIG. 4 illustrates a detailed block diagram of exemplary decoder 201 in decoding system 200 in FIG. 2, according to some embodiments of the present disclosure. As shown in FIG. 4, decoder 201 may include a decoding module 402, a dequantization module 404, an inverse transform module 406, an inter prediction module 408, an intra prediction module 410, a filter module 412, and a buffer module 414. It is understood that each of the elements shown in FIG. 4 is independently shown to represent characteristic functions different from each other in a video decoder, and it does not mean that each component is formed by the configuration unit of separate hardware or single software. That is, each element is included to be listed as an element for convenience of explanation, and at least two of the elements may be combined to form a single element, or one element may be divided into a plurality of elements to perform a function. It is also understood that some of the elements are not necessary elements that perform functions described in the present disclosure but instead may be optional elements for improving performance. It is further understood that these elements may be implemented using electronic hardware, firmware, computer software, or any combination thereof. Whether such elements are implemented as hardware, firmware, or software depends upon the particular application and design constraints imposed on decoder 201.

[0110] When a video bitstream is input from a video encoder (e.g., encoder 101) , the input bitstream may be decoded by decoder 201 in a procedure opposite to that of the video encoder. Thus, some details of decoding that are described above with respect to encoding may be skipped for ease of description. Decoding module 402 may be configured to decode the bitstream to obtain various information encoded into the bitstream, such as the quantization level of each position in the coding block. In some embodiments, decoding module 402 may perform entropy decoding (decompressing) corresponding to the entropy encoding (compressing) performed by the encoder, such as, for example, variable-length coding (VLC) , context-adaptive variable-length coding (CAVLC) , CABAC, syntax-based binary arithmetic coding (SBAC) , PIPE coding, and the like to obtain the binary representation (e.g., binary bins) . Decoding module 402 may further convert the binary representations to quantization levels using Golomb-Rice binarization, including, for example, EGk binarization and combined TR and limited EGk binarization. Besides the quantization levels of the positions in the transform units, decoding module 402 may decode various other information, such as the parameters used for Golomb-Rice binarization (e.g., the Rice parameter) , block type information of a coding unit, prediction mode information, partitioning unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information. During the decoding process, decoding module 402 may perform rearrangement on the bitstream to reconstruct and rearrange the data from a 1D order into a 2D rearranged block through a method of inverse-scanning based on the coding scan order used by the encoder.

[0111] Dequantization module 404 may be configured to dequantize the quantization level of each position of the coding block (e.g., the 2D reconstructed block) to obtain the coefficient of each position. In some embodiments, dequantization module 404 may perform dependent dequantization based on quantization parameters provided by the encoder as well, including the information related to the quantizers used in dependent quantization, for example, the quantization step size used by each quantizer.

[0112] Inverse transform module 406 may be configured to perform inverse transformation, for example, inverse DCT, inverse discrete sine transform (DST) , and inverse KLT, for DCT, DST, and KLT, LFNST, and / or NSPT performed by the encoder, respectively, to transform the data from the transform domain (e.g., coefficients) back to the pixel domain (e.g., luma and / or chroma information) . In some embodiments, inverse transform module 406 may selectively perform a transform operation (e.g., DCT, DST, KLT, LFNST, NSPT) according to a plurality of pieces of information such as a prediction method, a size of the current block, a prediction direction, and the like.

[0113] FIG. 10A illustrates an LFNST kernel 1000 with zeroed-out regions for 4xN, Nx4, and 8x8 block sizes, according to some embodiments of the present disclosure. FIG. 10B illustrates an LFNST kernel 1001 with zeroed-out regions for 8xN and Nx8 block sizes, according to some embodiments of the present disclosure. FIGs. 10A and 10B will be described together.

[0114] In VVC a low frequency non-separable secondary transform (LFNST) tool was introduced with several modifications to address the problems described above for spanning non-separable transforms.

[0115] Firstly, while the LFNST tool applies to a wide range of block sizes, only two LFNST kernels are defined. For blocks with size 4xN, Nx4 (for N≥4) , or 8x8, a smaller LFNST kernel is applied. For all larger block sizes (e.g., larger than 8x8) a larger LFNST kernel is applied. FIGs. 10A and 10B show the sample positions on which the LFNST acts. For example, from encoder perspective and for 4xN, Nx4, or 8x8 block sizes, the top left 4x4 sample positions (indicated by the shaded regions in FIG. 10A are transformed by the small LFNST. The remaining sample positions (indicated by the white regions in FIG. 10A) are ignored, or “zeroed out. ” From the decoder perspective, the inverse LFNST is applied to produce the top-left 4x4 samples, while the remaining samples are filled in as zeros. A similar policy is applied for larger block sizes, where the LFNST acts on the 3 top-left 4x4 blocks of sample positions (indicated by the shaded regions in FIG. 10B) . The remaining sample positions are zeroed out.

[0116] Because of the “zeroed-out” policy, the size of the LFNST is substantially reduced in as compared to a full-size transform applying to all sample positions. However, it is inherently lossy and cannot restore the values at sample positions, which are ignored by the LFNST. Such loss would be too large for the LFNST tool to be useful if it were applied directly to the residual samples. However, the LFNST is called a secondary transform because it is applied after the separable primary transform, e.g., DCT is performed at the encoder. In other words, the DCT is a primary transform, producing primary transform coefficients, and the LFNST is then a secondary transform acting on these primary transform coefficients to produce secondary transform coefficients. In this disclosure the left-most sample positions in a block of primary transform coefficients correspond to the horizontal low frequencies of the DCT, while the top-most sample positions correspond to the vertical low frequencies of the DCT. By preferentially transforming, and reconstructing at the decoder, the top-left sample positions, the LFNST can reconstruct the low-frequency information from the original residual. As described previously, transforms produce coding gain due to their energy compaction properties, and it has been shown empirically that the variance (energy) of camera captured image and video signals is predominantly concentrated in the low frequency DCT coefficients. Therefore, while “zeroed-out” policy prevents the LFNST from reconstructing an arbitrary residual block losslessly, in practice the loss can be minimal for most classes of image and video signals.

[0117] A second modification is that for both the small and large LFNST kernels, the transform applied is not a spanning transform. From the encoder perspective, the number of output (secondary transform) coefficients is less than the number of input (primary transform) coefficients. For example, the smaller LFNST kernel takes as input 4x4=16 primary transform coefficients, but produces only 8 output secondary transform coefficients. The larger LFNST kernel takes 3x4x4=48 input primary transform coefficients and outputs 8 secondary transform coefficients. The use of a non-spanning transform introduces further reconstruction loss. However, this loss can be traded off in a controlled manner against the complexity reduction achieved. A spanning non-separable transform may first be designed by the KLT method described above. By following this method, the basis vectors of the transform correspond to eigenvectors of the covariance matrix calculated from a representative set of residual blocks. These eigenvectors may be ranked in importance by their corresponding eigenvalues, with the most important eigenvectors selected to construct a non-spanning non-separable transform. For example, the 8 eigenvectors with the largest eigenvalues may be selected to form a non-spanning transform for the smaller LFNST kernel.

[0118] In summary the two modifications described above significantly reduce the complexity of the LFNST kernel compared to the spanning non-separable transform. For smaller blocks, the use of the smaller LFNST kernel reduces the potential complexity from (4xN) x (4xN) multiplications per transform block (for N≥4) , down to 16x8 multiplications. For larger blocks, the use of the larger LFNST kernel reduces the potential complexity from (8xN) x (8xN) multiplications per transform block (for N≥8) , down to 48x8 multiplications.

[0119] The LFNST kernels do not consist of only one transform matrix. To achieve better coding gain over a variety of image and video signals, multiple transform matrices are learned. The number of different transform matrices is the product of the 3rd and 4th dimensions of the LFNST kernel: the smaller LFNST kernel has dimensionality 16x8x2x4, and the larger LFNST kernel has dimensionality 48x8x2x4. The LFNST kernel is expressed with two additional dimensions because the particular transform matrix for a transform block is selected by a mixture of explicit signaling and implicit selection.

[0120] Explicit signaling is performed by an LFNST index signaled in the bitstream that may take the value 0, 1, or 2, where 0 indicates that the LFNST is not used for the transform block, while values 1 or 2 indicate selection in the 3rd dimension of the LFNST kernel. The drawbacks of potential reconstruction loss due to the zero out and non-spanning simplifications are ameliorated by the explicit signaling mechanism. While the use of LFNST would result in excessive reconstruction loss for a transform block, the LFNST tool can be disabled by signaling an LFNST index of 0.

[0121] Implicit selection is enabled by restricting the LFNST only to coding units which use intra prediction. Intra prediction produces a prediction block for the coding unit from adjacent neighboring reference samples to the top and left of the current block. The particular method of constructing the prediction block is signaled in the bitstream by an intra prediction mode. Simple methods of intra prediction include taking the average of the reference samples ( “DC” mode) , or constructing an interpolation between some reference samples ( “planar” mode) . However, the majority of the intra prediction modes are reserved for signaling intra angular directions, where the prediction block is constructed by assuming the reference sample values are replicated along a particular direction. When an intra angular direction is used, it may be a strong hint for the directional characteristics of the residual block. Implicit selection of an LFNST transform is performed by mapping the intra prediction mode to one of 4 possible values of a “transform set index, ” which is used to index into the 4th dimension of the LFNST kernel. The mapping used in VVC is shown in Table 1. Table 1: Mapping from intra prediction mode to LFNST transform set index

[0122] Intra prediction modes 0 and 1 correspond to intra prediction planar mode and intra DC prediction mode, respectively. These modes are handled as a special case by mapping to the transform set index 0. Otherwise, the remaining intra prediction modes correspond to intra angular directions which are shown in FIG. 8. Intra prediction mode 2 corresponds to a diagonal intra angular prediction from the bottom-left. Increasing intra prediction mode numbering corresponds to clockwise rotation of the intra prediction direction, with intra prediction mode 34 corresponding to diagonal intra angular prediction from the top-left, and intra prediction mode 66 corresponding to diagonal intra angular prediction from the top-right.

[0123] For intra prediction modes greater than 34, which correspond to intra angular prediction directions clockwise of diagonal from the top-left, the selected LFNST transform matrix is applied in a transpose manner for the primary transform coefficients. In one implementation, this may be performed by scanning the primary transform coefficients in a transpose direction before applying the LFNST transform. For example, from encoder perspective if a current block is predicted by intra prediction mode 2, then the primary transform coefficients may be rearranged from their two-dimensional pattern in the block to a one-dimensional vector by a row-major scan, before applying a selected LFNST transform matrix T. Then, for this example, if the current block is instead predicted by intra prediction mode 66 and the same signaled LFNST index is used, the primary transform coefficients would instead be rearranged to a one-dimensional vector by column-major scan before applying the same LFNST transform matrix T. In another implementation, the same current block with intra prediction mode 66 can be equivalently transformed by still performing a row-major scan over the primary transform coefficients, but instead rearranging the rows of the transform matrix T.

[0124] More generally, the application of the LFNST transform matrix may be described as follows. Let the primary transform coefficient located at row y, column x be denoted as px, y, and let the LFNST transform matrix T have dimensions A×B, where A is the number of secondary transform coefficients, and B is the number of primary transform coefficients that are not zeroed out. Then, for intra prediction modes <= 34, an arbitrary scan order through the primary transform coefficients to construct a one-dimensional vector P may be defined by equation (2) .

[0125] For intra prediction modes greater than 34, P is instead constructed by the transposed scan order shown in equation (3) .

[0126] The forward LFNST transform may be understood as the matrix multiplication S=TP, where S is a one-dimensional vector of secondary transform coefficients. In practice, the transform is implemented as S=n (TP) since all multiplications are implemented in integer arithmetic, and n (·) represents normalization operations necessary for the integerized LFNST to approximate the ideal transform expressed in floating point. Secondary transform coefficients are written back to the transform block in a forward diagonal scan order. Following the same notation as introduced above, and the convention that the (0, 0) location corresponds to “low frequency” or “DC” in the conventional DCT, the scan order is may be determined according to equation (4) . S={s0, 0, s0, 1, s1, 0, s0, 2, s1, 1, s2, 0, s0, 3, s1, 2, s2, 1, s3, 0, …}      (4) .

[0127] From decoder perspective, the inverse LFNST transform may be expressed as the matrix multiplication P=n (TTS) , or in other words the inverse transform is performed by the transpose of the matrix T.

[0128] Transposition of the primary transform coefficients for intra prediction modes greater than 34 allows the same LFNST transform matrix to be shared for intra angular prediction directions that are symmetric.

[0129] FIG. 11A illustrates an LFNST kernel 1100 for 4xN and Nx4 block sizes in ECM, according to some embodiments of the present disclosure. FIG. 11B illustrates an LFNST kernel 1101 for 8xN and Nx8 block sizes in ECM, according to some embodiments of the present disclosure. FIG. 11C illustrates an LFNST kernel 1103 16x16 block size in ECM, according to some embodiments of the present disclosure. FIGs. 11A-11C will be described together.

[0130] The LFNST tool has been further extended in ECM. The LFNST tool in ECM relaxes some of the complexity reductions imposed on the original LFNST tool adopted in VVC to achieve enhanced coding gain.

[0131] ECM has three LFNST kernels. Like the LFNST tool in VVC, in most cases a significant portion of the transform block is zeroed out. In FIGs. 11A-11C, the shaded regions indicate the primary transform coefficient positions on which the LFNST in ECM acts, while the white regions indicate which transform coefficient positions are zeroed out. For blocks with size 4xN or Nx4 (where N≥4) , a small LFNST kernel is used on the top left 4x4 primary transform coefficients. For blocks with size 8xN or Nx8 (where N≥8) , a medium LFNST kernel is used on the 4 top-left 4x4 blocks of primary transform coefficients. For 16x16 or larger blocks, a large LFNST kernel is used on the 6 top-left 4x4 blocks of primary transform coefficients.

[0132] The size of the LFNST kernels in ECM are: 16x16x3x35 for the small LFNST kernel, 64x32x3x35 for the medium LFNST kernel, and 96x32x3x35 for the large LFNST kernel. Compared to the LFNST tool in VVC, the range of signaled LFNST indices is increased from 2 to 3, and the number of LFNST transform sets is increased from 4 to 35. The mapping from intra prediction mode to LFNST transform set index is shown in Table 2. Like the LFNST tool in VVC, when the intra prediction mode is greater than 34 then the primary transform coefficients are transposed. Table 2: Mapping from intra prediction mode to LFNST transform set index in ECM

[0133] As seen above, the use of non-separable secondary transform allows significant complexity reductions due to the use of zero-out on selected primary transform coefficient regions. However, further coding gain was found possible when applying a non-separable transform directly to the residual. This approach is adopted into ECM as the non-separable primary transform (NSPT) . In ECM, the NSPT is only applied to a distinct set of pre-defined block sizes. For these block sizes, the NSPT reuses the signaling mechanism of the LFNST tool and is used instead of the combination of the DCT (primary transform) and LFNST that would otherwise be applied. As with the LFNST, the NSPT kernels are trained, with a selection of an appropriate matrix for a particular block guided by both a signalled index and implicit selection through the intra prediction mode.

[0134] The NSPT was initially proposed for 4 block sizes. For 4x4 blocks, an NSPT kernel with dimensions 16x16x3x35 is used. For 4x8 and 8x4 blocks, NSPT kernels with dimension 32x20x3x35 are used. For 8x8 blocks, an NSPT kernel with dimensions 64x32x3x35 is used. The NSPT was later extended to block sizes 4x16, 16x4, 8x16, 16x8, 4x32, 32x4, 8x32, and 32x8. For block sizes 4x16 and 16x4, NPST kernels with dimension 64x24x3x35 are used. For block sizes 8x16 and 16x8, NPST kernels with dimension 128x40x3x35 are used. For block sizes 4x32 and 32x4, NPST kernels with dimension 128x20x3x35 are used. For block sizes 8x32 and 32x8, NPST kernels with dimension 256x24x3x35 are used.

[0135] In this disclosure, zeroed-out is defined as a reduction in the input dimension of the transform kernel, which in the notation of the transform kernel dimensions of this disclosure corresponds to the first dimension. A reduction in the input dimension of the forward transform is equivalent to a reduction of the support for the transform. For example, with the LFNST zero-out corresponds to a reduction of the number of DCT primary transform coefficients that the forward LFNST acts on to produce secondary transform coefficients. In ECM, the NSPT acts directly on the residual coefficients, and the size of each NSPT kernel’s first dimension is always equal to the number of samples in the block. In the ECM description of the NSPT tool, zero-out is instead defined as a reduction in the output dimension of the transform kernel, which in the notation of transform kernel dimensions in this disclosure is the second dimension. Such definition gives an example of the term “zero-out” being used more generally. However, for consistency and clarity within this disclosure the use of the term “zero-out” is confined to describing a reduction in the input dimension of a transform kernel, while referring to a reduction of the output dimension as a non-spanning, or lossy transform.

[0136] As with the LFNST, an NSPT index is signaled in the bitstream that may take the value 0, 1, 2, or 3, where 0 indicates that the NSPT is not used for the transform block, while values 1-3 indicate selection within the corresponding NSPT kernel along the 3rd dimension. As with the LFNST, the NSPT is only allowed for intra CUs. Selection along the 4th dimension of the NSPT kernel is determined by mapping from the intra prediction mode as shown in Table 3, in the same manner as for the extended LFNST in ECM. As with the LFNST, when the intra prediction mode is greater than 34 (which means the intra angular direction is clockwise of the diagonal top-left direction) , the input to the transform is transposed. However, for the NSPT the input is composed of residual coefficients, not primary transform coefficients. Table 3: Mapping from intra prediction mode to NSPT transform set index in ECM

[0137] For an MxN shape residual block, and when the intra prediction mode is less than or equal to 34, let the residual sample located at row y, column x be denoted rx, y, and let a LFNST transform matrix T selected from the NSPT kernel for MxN shaped blocks have dimensions A×B, where A is the number of primary transform coefficients, and B=M×N is the number of residual samples in the block. Then, an arbitrary scan order through the residual samples to construct a one-dimensional vector R may be defined by equation (5) .

[0138] For intra prediction modes greater than 34, R is instead constructed by the transposed scan order defined by equation (6) .

[0139] Additionally, when the intra prediction mode is greater than 34, the LFNST transform matrix T is selected instead from the NSPT kernel for NxM shaped blocks. For square block shapes, this is the same kernel, so T is the same transform matrix. However, in the case of 4x8 or 8x4 block sizes, the transform matrix is selected from a different NSPT kernel.

[0140] The forward NSPT transform may be implemented as P=n (TR) , where P is a one-dimensional vector of NSPT transform coefficients, and n () denotes normalization operations necessary for the integerized NSPT to approximate the ideal transform expressed in floating point. Transform coefficients are written back to the transform block in a forward diagonal scan order. Following the same notation as introduced above, and the convention that the (0, 0) location corresponds to “low frequency” or “DC” in the conventional DCT, the scan order is defined according to equation (7) . P={p00, 0, p0, 1, p1, 0, p0, 2, p1, 1, p2, 0, p0, 3, p1, 2, p2, 1, p3, 0, …}            (7) .

[0141] From decoder perspective, the inverse NSPT transform may be expressed as the matrix multiplication R=n (TTP) , or in other words the inverse transform is performed by the transpose of the matrix T.

[0142] FIG. 12 illustrates an example transform coefficient scanning order 1200, according to some embodiments of the present disclosure.

[0143] Usually, only one of the LFNST or NSPT tools can be enabled for a particular block at a time, with the tool allowed being dependent on the block size. The same signaling mechanism is used for the LFNST and NSPT index syntax elements. As used herein, this shared syntax element is referred to as nst_idx. The semantics of whether this index corresponds to the LFNST or the NSPT may be determined by the block size.

[0144] In ECM-10.0, the nst_idx is signaled based on the position of the last significant transform coefficient. The relation between the last significant position and the number of transform coefficients is illustrated by an example for an 8x8 transform unit (TU) shown in FIG. 12. The last significant position is signaled by zero-indexed x and y coordinates, while the scan order through the coefficients is a hierarchical diagonal scan indicated by the enumerated boxes. The first level of the hierarchical diagonal scan is over 4x4 sub-blocks, while the second level is over coefficient positions within the sub-block. For example, if the last significant position is at x=3 and y=2, then the last significant coefficient corresponds to position 14 in the hierarchical diagonal scan order. This indicates that there are at most 15 non-zero coefficients corresponding to positions 0 through 14 inclusive in the hierarchical diagonal scan order. Let the number of potentially non-zero coefficients be N, e.g., N=15 in this example.

[0145] As shown in Table 4, the block size of the TU indicates not only whether the LFNST or NSPT tool is used, but also the dimensions of the kernel that is used. Therefore, when the last significant position is decoded, if N is greater than the number of non-separable transform coefficients that would be produced for the current TU as identified from Table 4, it is not possible for the transform coefficients to have been produced by one of the non-separable transform tools. Then, nst_idx is not signaled and implicitly inferred as 0. If N is less than or equal to the number of non-separable transform coefficients, nst_idx may be signaled depending on other conditions. Table 4: Block size mapping to non-separable transform kernel

[0146] FIG. 13 illustrates a diagram 1300 of a decoder-side intra mode derivation (DIMD) mode for ECM, according to some embodiments of the present disclosure.

[0147] Referring to FIG. 13, in DIMD, an intra prediction mode (or multiple intra prediction modes) is derived implicitly from an L-shaped template 1304 (referred to hereinafter as “template 1304” ) of reconstructed samples neighbouring the current CU 1302. The template 1304 has a size of a 3-sample width. Decoder 201 moves a 3x3 gradient analyzing window 1306 over the template 1304. At each position, a local gradient is calculated by applying Sobel filters. Assuming the 3x3 set of samples at one position in the template 1304 is Tk, the Sobel filter can be described according to equation (8) .

[0148] Then, the horizontal gradient Gk, x and the vertical gradient Gk, y are estimated by taking the dot products shown below in equations (9) and (10) , respectively. Gk, x=Tk·Mx         (9) ; and Gk, y=Tk·My        (10) .

[0149] The local gradient’s magnitude Gk and the local gradient’s angle θk may be estimated according to equations (11) and (12) , respectively. Gk=|Gk, x|+|Gk, y| (11) ; and

[0150] The local gradient’s angle θk can be associated with an intra angular prediction direction IPMk. For example, an angle of 0 degrees corresponds with the horizontal intra prediction mode 18. In practice, IPMk may be estimated directly by decoder 201 from Gk, x and Gk,y with a fast implementation such as a look-up table. At the beginning of the DIMD method, an empty histogram H (populated with zeroes in each entry) is initialized with a size equal to the number of intra prediction modes. As the DIMD method performs gradient analysis over each local window, the histogram H is updated according to equation (13) . H [IPMk] +=Gk   (13) .

[0151] Thus, each local gradient analysis “votes” for an intra prediction mode. At the conclusion of the DIMD method, the intra prediction mode with the highest count in H may be selected as the single representative intra prediction mode for the current CU. Alternatively, multiple intra prediction modes may also be obtained from H in order of the highest counts.

[0152] After the HoG has been built, up to five angular modes with the highest occurrences in the HoG, along with the planar mode or block vector based prediction (same as in DIMD) are selected. The prediction corresponding to each of the selected modes are blended to produce the final prediction of the HoG prediction mode. The blending weights are calculated by using gradient values from the template.

[0153] FIG. 14 illustrates a diagram 1400 of a template-based intra mode derivation (TIMD) mode for ECM, according to some embodiments of the present disclosure. Referring to FIG. 14, in TIMD, an intra prediction mode (or multiple intra prediction modes) is derived implicitly from above and left templates 1404 of reconstructed samples neighbouring the current CU 1402.

[0154] A set of candidate intra prediction modes is searched from a most probable modes (MPM) list, which is constructed from intra prediction modes used by neighbouring CUs. Then, for each candidate intra prediction mode, a prediction for template 1404 is produced from the template reference samples 1406 by the intra angular prediction method. The candidate intra prediction mode, which produces a template predictor that best matches template 1404 is selected as the TIMD intra prediction mode. The best match may be determined by finding the predictor that minimizes the sum of absolute differences (SAD) , or the sum of absolute transformed differences (SATD) , or by comparing hashes between the predictor and the template. Alternatively, multiple intra prediction modes may also be obtained in order of increasing SAD / SATD.

[0155] FIG. 15A illustrates a representation of spatial geometric partitioning mode (SGPM) signaling 1500, according to some embodiments of the present disclosure.

[0156] In some known approaches, a spatial geometric partitioning mode (SGPM) was proposed, which allows the partitioning of a CU into two parts that may use different intra prediction modes. The new mode is similar in concept to the geometric partitioning mode (GPM) , which applies to inter prediction in VVC. However, SGPM uses a different signalling mechanism due to the large number of combinations of partitions and intra prediction modes that are possible. To express the necessary partition and prediction information more efficiently in the bit-stream, a candidate list is employed and only the candidate index is signaled in the bit-stream. Each candidate in the list can derive a combination of one partition mode and two intra prediction modes, as shown in the representation of SGPM signaling 1500 in FIG. 15A.

[0157] FIG. 15B illustrates an example template 1501 used to generate a candidate list, according to some embodiments of the present disclosure.

[0158] A template is used to generate this candidate list. One example of the template 1501 is shown in FIG. 15B, where the width of the template is set to 4. In the current version of SGPM adopted to ECM, the template width is set to 1. For each possible combination of one partition mode and two intra prediction modes, a prediction is generated for the template with the partitioning weight extended to the template. These combinations are ranked in ascending order of their sum of absolute transformed difference (SATD) costs between the prediction and reconstruction of the template. The length of the candidate list is set equal to 16, and these candidates are regarded as the most probable SGPM combinations of the current block. Both the encoder and decoder construct the same candidate list using the template. To reduce the complexity of building the candidate list, both the number of possible partition modes and the number of possible intra prediction modes (IPM) are limited. For example, the number of possible partition modes in the current version of SGPM adopted for ECM is restricted to a pre-defined set of 26 partitions, which cover a variety of partition directions and locations.

[0159] Two IPM candidate lists corresponding to the two SGPM partitions are each constructed by adding available IPM candidates and then pruning, if needed, down to a pre-defined limit of three candidates. Some IPM candidates are inherited from an intra-inter GPM mode already adopted into ECM. FIG. 16 is a schematic visualization 1600 of the inter angular mode parallel to the GPM partitioning boundary (Parallel mode) (see (a) ) , the inter angular mode perpendicular to the GPM partitioning boundary (Perpendicular mode) (see (b) ) , and the inter prediction Planar mode (see (c) ) , and SGPM with intra and intra prediction (see (d) ) , according to some embodiments of the present disclosure. These modes may be added as available IPM candidates for SGPM.

[0160] In addition, template-based intra mode derivation (TIMD) may be used to derive intra prediction modes that are available IPM candidates for SGPM. For example, only neighbors of horizontal and vertical orientations (using the top or left templates) are used to derive TIMD intra prediction modes for forming the IPM of SGPM.

[0161] SGPM may be implicitly disabled for some CU block sizes. The range of block sizes for which SGPM may be used (e.g., a CU level flag may be signalled to indicate if SGPM is used or not) was originally inherited from the intra-inter GPM mode. In the current version of SGPM adopted to ECM, the range of block sizes is further extended to smaller blocks of 4x8, 8x4, 4x16, and 16x4 dimensions. In summary, the block sizes for which SGPM may be used may be described by the rule 4<=width<=64, 4<=height<=64, width<height*8, height<width*8, width*height>=32.

[0162] In order to have a better prediction for those pixels that sit in the boundary between two prediction parts, an adaptive SGPM blending scheme 1700 may be used, as shown in FIG. 17, where a weighted average of the two prediction parts is used in a transition region around the SGPM partition. The width of the transition region is referred to as the blending width, and this blending width is adaptively determined depending on the block size. No signalling is needed for adaptive blending.

[0163] Referring to FIG. 17, let the blending width as specified for the GPM tool in VVC and ECM be τ. Then, the adaptive SGPM blending width may be determined depending on the CU block width and height as follows: · If min (width, height) ==4, 1 / 2 τ is selected; · else if min (width, height) ==8, τ is selected; · else if min (width, height) ==16, 2 τ is selected; · else if min (width, height) ==32, 4 τ is selected; and · else, 8 τ is selected.

[0164] FIG. 18 illustrates an example visualization of IBC prediction 1800, according to some embodiments of the present disclosure. When a CU is predicted by intra block copy mode, a block vector (BV) is signalled to indicate which block within the same picture will be copied to serve as a predictor for the current block. Signalling of this block vector may be performed by signalling a block vector difference (BVD) in the bitstream, such that the block vector can be determined by adding the BVD to a block vector predictor. Alternatively, if a block vector from a previous CU is an exact match for the current block vector, it may be signalled by a merge flag. Regardless of the signalling mechanism, the block vector points at a location within the same picture to indicate a block of samples equal in size to the current CU that is used as a predictor block for the current CU. Some restrictions may apply to the block vector, as it must point at a location in the current picture that has been decoded before the current CU. The illustration in FIG. 18 summarizes the IBC concept in HEVC and VVC, with each tiled square shape in the figure representing a coding tree unit (CTU) . The gray-shaded area denotes the already-coded region, whereas the white-shaded area denotes the upcoming coding region. IBC in HEVC generally allows a BV to point at any block contained in the gray-shaded region usage. This freedom is partially restricted when a sps_entropy_coding_sync_enabled_flag is signaled in the bitstream, whose purpose is to support the wavefront parallel processing (WPP) feature. In such case, IBC block vectors cannot point at any region within CTUs 2 or more to the right of the current CTU in the CTU row directly above, as shown by the crossed-out CTUs in FIG. 18. IBC in VVC is significantly more restricted, only allowing block vectors to use the CTU to the left of the current CTU as the reference area, denoted by the dotted frame. The current IBC tool in ECM extends the search range relative to VVC.

[0165] FIG. 19 illustrates a diagram of intraTMP 1900, according to some embodiments of the present disclosure.

[0166] Referring to FIG. 19, intraTMP is an intra prediction mode similar to IBC in that the current CU 1922 is also predicted by a block of samples from the current picture. intraTMP may only be selected as a prediction mode for CUs with size 64x64 or smaller. Unlike IBC, however, a block vector 1924 is not signalled in the bitstream in intraTMP. Instead, decoder 201 compares a pre-defined L-shaped or other shaped templates of reconstructed samples neighbouring the current CU 1922 against the same shaped templates of candidate predictors within a pre-determined search region. For the case where the template is L-shaped, both neighbouring samples to the left and above of the current CU 1922 or intraTMP predictor 1926 are used. Let the width of the template area to the left be TmpW, and let the width of the template area above be TmpH. Other template shapes include a left template, which only includes the template area to the left, and an above template, which only consists of the template area above.

[0167] The intraTMP predictor block is determined by finding the best candidate template that matches the current CU template. The best match may be determined by finding the template that minimizes the sum of absolute differences (SAD) , or the sum of absolute transformed differences (SATD) , or by comparing hashes between templates. The search algorithm through the search region may be exhaustive (for example, by scanning the template over the search region with sample-resolution shifts) , or fast (for example, by performing a coarse search first, then performing a local refinement search around the best match from the coarse search) . Regardless, the search algorithm is performed identically by both the encoder and decoder so that the intraTMP predictor is implicitly known by both encoder 101 and decoder 201 without requiring signalling in the bitstream. An example of intraTMP is shown in FIG. 19 with the current CU template and the best matching template indicated by hatched shading.

[0168] Still referring to FIG. 19, for an intraTMP predictor 1926 to be selected, the block of samples corresponding to intraTMP predictor 1926 must be fully contained within the search region. The search region is shown in FIG. 19 by dashed shading. Within the current CTU 1920, the search region is restricted to a rectangular block of samples, bounded at one corner by the top-left corner of the current CTU 1920, and bounded at the other corner by the top-left corner of the current CU 1922.

[0169] Outside of the current CTU 1920, the search region is limited by imposing maximum lengths on the intraTMP block vector of (searchRangeWidth 1928, searchRangeHeight 1930) , where searchRangeWidth 1928 and searchRangeHeight 1930 are set proportional to the dimensions of the current CU 1922. That is, the searchRangeWidth = a *BlkW and searchRangeHeight = a *BlkH, where ‘a’ is a constant that controls the gain / complexity trade-off, and BlkW and BlkH are the width and height of the current CU 1922, respectively. Here, ‘a’ is set to 5 in the ECM-7.0 test software. searchRangeHeight 1930 only limits the length of the block vectors in the negative vertical direction (that is, in the direction to the top of the picture) . For block vectors with a positive vertical component, the search region is limited by the bottom boundary of the current CTU row. For example, in FIG. 19, the search region extends to the bottom boundary of the left CTU 1932, regardless of the value of searchRangeHeight 1930. In addition, these limits to the search range do not apply to the current CTU 1920. For example, for small CUs where searchRangeWidth 1928 and searchRangeHeight 1930 may be small compared to the dimensions of current CTU 1920, the search region still extends as far as the top-left corner of the current CTU 1920.

[0170] Beyond the restriction imposed by the search region, the intraTMP predictor 1926 and its template must consist of samples that are available for intra prediction. For example, the boundaries of the search region are still overridden by picture, slice, or tile boundaries. Let the coordinates of the top-left corner of the currentCU relative to the current picture be (currCuX, currCuY) . Then, the left boundary of the intraTMP search region is initially intraTmpLeftBound = currCuX -searchRangeWidth. To account for the picture boundary, the left boundary is clipped to allow TmpW sample width for the predictor’s template. intraTmpLeftBound=max(intraTmpLeftBound, TmpW)

[0171] To speed up the template matching process, the search region is initially traversed horizontally or vertically in increments of 2 pixels at a time. This is also referred to as a search sub-sampling factor of 2. This leads to a 4-fold reduction in the template matching search complexity. After finding the best match from the initial search, a refinement process is performed. The refinement is done via a second template matching search around the best match with a reduced range. In ECM-7.0, the reduced range is set to BlkH / 2.

[0172] FIG. 20 illustrates a diagram of non-adjacent spatial neighboring candidates for occurrence-based intra coding (OBIC) mode 2000, according to some embodiments of the present disclosure. FIG. 21 illustrates an example of the histogram-of-occurrences (HoC) of intra prediction mode 2100, according to some embodiments of the present disclosure. FIGs. 20 and 21 will be described together.

[0173] Similar to DIMD, the occurrence-based intra coding (OBIC) derives the intra prediction modes of the current block based on the sample-wise occurrence of the intra modes in the spatial neighborhood of the block. For this, adjacent and non-adjacent spatial neighboring blocks are checked and the intra prediction modes of the blocks are collected into an occurrence histogram. Instead of Histogram of Gradients (HoG) as in DIMD, the OBIC method builds a Histogram of oCcurrences (HoC) , which consists of the intra modes and their sample-wise occurrences. The occurrence values are calculated based on the number of samples that are coded in a certain intra prediction mode in that neighborhood. For example, for a block i with dimensions uiWidthi×uiHeighti which is coded with an intra prediction mode IPMi, the histogram is updated by equation (14) . HoC [IPMi] +=uiWidthi*uiHeighti       (14) .

[0174] The blocks i which are used to build the histogram are taken from both spatially adjacent and non-adjacent blocks. All of the adjacent spatial neighborhood blocks are used to accumulate the histogram of occurrences. Additionally, FIG. 20 shows which non-adjacent spatial neighboring blocks are used in OBIC’s HoC generation.

[0175] Some prediction methods listed below use more than one intra prediction mode for prediction. When a block uses one of these prediction methods, then all the applicable intra prediction modes are indexed and incremented when updating the OBIC histogram. For instance, DIMD may use up to 5 angular modes, TIMD may use up to 2 modes, SGPM may use 2 modes, and OBIC may use up to 5 angular modes.

[0176] Moreover, the virtual intra prediction modes (VIPMs) of a MIP block, an IntraTMP block, an IBC block, and an extrapolation filter-based intra prediction (EIP) block are considered only in inter slices when updating the histogram of OBIC mode.

[0177] After the HoC has been built, up to five angular modes with the highest occurrences in the HoC, along with the planar mode or block vector based prediction (same as in DIMD) are selected. The prediction corresponding to each of the selected modes are blended to produce the final prediction of the HoC prediction mode. The blending weights are calculated similar to the DIMD mode, but instead of using gradient values from the template, the occurrence values are used for OBIC. Moreover, the planar mode’s weight is also decided similar to DIMD mode.

[0178] The OBIC mode is applied to only luma blocks. Moreover, the mode is disabled for blocks that have less than 64 samples.

[0179] FIG. 22 illustrates an example visualization of matrix-based intra-picture prediction (MIP) 2200 in VVC, according to some embodiments of the present disclosure.

[0180] MIP is an intra prediction mode supported in VVC. For predicting the W x H samples of a rectangular block, MIP performs the following three steps, as shown in FIG. 22. First, averaging is applied to one left column of H reconstructed neighboring boundary samples and one top line of W reconstructed neighboring boundary samples to get the reduced (down-sampled) boundary samples bdryred. Second, a subsequent matrix-vector multiplication with a matrix Ai and an offset vector bi generates the intermediate prediction signal predred. Third, linear interpolation generates the prediction signal pred by up-sampling predred. The matrix coefficients for each MIP mode i are pretrained with 8-bit precision. Overall, 16x16x4 matrices, eight 16x8 matrices, and six 64x7 matrices are specified for MIP.

[0181] FIG. 23 illustrates an example L-shaped neighborhood 2300 for a corresponding predicted block, according to some embodiments of the present disclosure.

[0182] The MIP adopted in VVC employed down-sampling and up-sampling steps to keep the matrix multiplication low in dimension and therefore limited in complexity. These down-sampling and up-sampling steps are removed in a more recent proposal of a modified MIP, which uses alternative matrices with increased input / output sizes for a sub-set of the block sizes enabled for MIP.

[0183] For block shapes up to a maximum size of 32x32, a matrix multiplication is directly applied to boundary samples to produce a prediction. The boundary samples are taken from an L-shaped neighborhood of reference lines above and left of the current block. As shown in FIG. 23, the L-shaped neighborhood may consist of T1xW samples above the current block, T2xH samples to the left of the current block, and T1xT2 samples in the corner to the above-left of the current block. In one example, T1 and T2 are both set to 2. Each sample P (x, y) of the MIP prediction can be calculated according to equation (15) . P (x, y) =∑kF (x, y, k) *r (k)  (15) , where r (k) is the kth sample in the L-shaped neighborhood, and F is the matrix of weights selected  for the current block.

[0184] In angular MIP, a matrix of weights F is selected based on both the block shape and the intra prediction mode. As with the modified MIP described above, a matrix multiplication is directly applied with these weights to boundary samples in an L-shaped neighborhood as shown in FIG. 23. Unlike the modified MIP, as angular prediction is being performed, the neighbourhood includes more samples to the above-right and bottom-left of the current block. The L-shaped neighbourhood may consist of T1x2W samples above and to the right of the current block, T2x2H samples to the left and below of the current block, and T1xT2 samples in the corner to the above-left of the current block. In one example, T1 and T2 are both set to 4. Each sample P (x, y) of the angular MIP prediction can be calculated according to equation (16) . P (x, y) =∑kF (x, y, k) *r (k)  (16) , where k denotes the index of the reference sample in the template.

[0185] Angular MIP is only enabled for block sizes of width<=16 and height<=16, and is signalled by the intra prediction modes 0, 1, and (2+4*k) where k = {0, 1, 2, …., 16} , (e.g., every 4th mode) . When enabled, angular MIP replaces the conventional angular prediction method previously signaled by these intra prediction modes.

[0186] The LFNST / NSPT transform set is implicitly decided by an intra prediction mode (IPM) in the current ECM. For regular intra prediction modes, as well as the DIMD and TIMD, a numbered intra prediction mode (predModeIntra) is available for selecting a transform set from the LFNST or NSPT kernel. For other intra prediction tools, the non-separable transforms are enabled by deriving an intra prediction mode. Methods of deriving the intra prediction mode for each of these tools are described below in the current ECM.

[0187] For a block coded with PLANAR, DC or directional modes, the IPM is set as the intra prediction mode itself. For a DIMD coded block, the IPM is set as the best mode derived by the DIMD process with neighboring reconstructed pixels. For a TIMD coded block, the IPM is set as the best mode derived by the TIMD process.

[0188] For the SGPM tool, the angle of the SGPM partition is mapped to an intra prediction mode.

[0189] For intraTMP, DIMD is used to derive an intra prediction mode. That is, while the prediction block is derived by the intraTMP algorithm, when the residual is transformed by a non-separable transform, the transform matrix is indexed by an intra prediction mode derived by the DIMD algorithm.

[0190] For the matrix intra prediction (MIP) tool, DIMD is also used to derive an intra prediction mode.

[0191] For IBC, non-separable transforms are currently disabled so there is no need to derive an intra prediction mode.

[0192] The prediction strategies of DIMD, TIMD, SGPM, MIP and ITMP may be different from normal intra prediction modes like PLANAR, DC and directional modes. DIMD, TIMD, SGPM and ITMP allow multiple predictions combination. MIP makes the prediction using matrix calculation. ITMP references the reconstructed region in the current picture. The prediction residual may illustrate different feature from the derived IPM. In some techniques CUs are coded with DIMD, TIMD, MIP, SGPM and ITMP to select one LFNST / NSPT transform set out of 2 candidate sets.

[0193] If the current block is coded with DIMD, TIMD, MIP, SGPM, intra template-based prediction (ITMP) , and LFNST / NSPT is used, one more bin is employed to indicate whether the first or the second candidate transform set is selected.

[0194] For instance, the first candidate transform set remains the same as the current ECM.

[0195] To derive the second candidate the following may be considered. For TIMD, if fusion is applied, the second TIMD IPM is first considered. For SGPM, the 2 IPMs that SGPM uses are first considered. For MIP and EIP, PLANAR is first considered.

[0196] The first and second candidate should be different transform sets. If the second candidate is not yet decided by the above process, it may be derived by the HoG of neighboring reconstructed pixels. To reduce the encoding time, CU size restriction may be used for MTSS. The CU size is measured with number of pixels within the CU. MTSS can be applied to CUs with size equal or larger than the threshold.

[0197] In addition, MTSS is also allowed for a newly adopted intra coding tool, extrapolation filter-based intra prediction (EIP) .

[0198] Multiple transform selection (MTS) has been introduced in VVC, where discrete sine transform (DST) DST7 and DCT8 transform pairs were tested in addition to the DCT2 primary transform. For intra directional mode, residual samples have larger absolute values if they are far away from the reference samples. Thus, the usage of a transform with an increasing basis function along the intra prediction direction might better catch the residual statistics. To exploit this intra mode dependency in the ECM, it has been proposed to assign a transform set to each intra mode using a lookup table. Planar, DC, and MIP intra modes have their own transform set in the lookup table. Each transform set contains a total of six pairs of separable horizontal and vertical transforms. The number of candidates in each transform set is determined between 1, 4, or 6 by the absolute sum of coefficients in the block.

[0199] Some non-directional modes use a virtual intra prediction mode (VIPM) to obtain a transform set in this lookup table. This VIPM is typically computed from the Histogram of Gradients (HoG) , as in the directional intra mode derivation (DIMD) mode. However, some of these modes (e.g., intraTMP, EIP) may not have a clear residual directionality compared to angular intra modes.

[0200] Recently, Multiple Transform Set Selection (MTSS) was been proposed in JVET. MTSS offers the possibility to select an alternative transform set based on the HoG of the neighboring pixels of the current block.

[0201] Similar to MTSS for LFNST / NSPT, MTSS is proposed to use a second transform set in explicit intra MTS for DIMD, TIMD, intraTMP and EIP modes. For these modes, the first transform set remains unchanged, and the second transform set corresponds to the planar transform set in the lookup table. More specifically, the number of candidates in the second transform set depends on the number of candidates in the first transform set.

[0202] For instance, in one example, if 1 candidate is used in the first transform set, 1 candidate is used the second transform set.

[0203] In another example, if 4 candidates are used in the first transform set, 2 candidates are used the second transform set.

[0204] In still another example, if 6 candidates are used in the first transform set, 3 candidates are used the second transform set.

[0205] The usage of the second transform set is signaled by a CU-level flag to the decoder. If the second transform set is selected by the encoder, the flag is set to 1.

[0206] Similar to MIP, SGPM, EIP, IntraTMP, DIMD / TIMD fusion modes, etc., the new modified MIP, angular MIP, and OBIC may not have clear directional prediction features. Therefore, the current implicit MTS and LFNST / NSPT may not work well for these new intra modes.

[0207] To overcome these and other challenges, the present disclosure first proposes that MTSS for LFNST / NSPT is allowed for both modified MIP and angular MIP modes. More specifically, the first IPM is set to be the best mode derived by the HoG of the prediction directions and the second IPM is set to be the planar mode. As another example, the second IPM is set to be the second best mode derived by the HoG of the prediction directions. The first and second IPMs are used to identify the corresponding LFNST / NSPT transform sets. An index coded in the bitstream to indicate which LFNST / NSPT transform set is used to code the current block.

[0208] The present disclosure proposes that MTSS for intraMTS is allowed for OBIC. More specifically, the first candidate transform set remains the same as the current ECM, and the second candidate transform set corresponds to the planar transform set in the lookup table. The number of candidates in the second transform sets depends on the number of candidates in the first transform set.

[0209] For instance, in some implementations, if 1 candidate is used in the first transform set, 1 candidate is used the second transform set.

[0210] In some implementations, if 4 candidates are used in the first transform set, 2 candidates are used the second transform set.

[0211] In some implementations, if 6 candidates are used in the first transform set, 3 candidates are used the second transform set.

[0212] The usage of the second transform set is signaled by a CU-level flag to the decoder. If the second transform set is selected by the encoder, the flag is set to 1.

[0213] This disclosure further proposes that MTSS for intraMTS is allowed for both modified MIP and angular MIP modes. More specifically, the first candidate transform set remains the same as the current ECM, and the second candidate transform set corresponds to the planar transform set in the lookup table. The number of candidates in the second transform set depends on the number of candidates in the first transform set.

[0214] For instance, in some implementations, if 1 candidate is used in the first transform set, 1 candidate is used the second transform set.

[0215] In some implementations, if 4 candidates are used in the first transform set, 2 candidates are used the second transform set.

[0216] In some implementations, if 6 candidates are used in the first transform set, 3 candidates are used the second transform set.

[0217] The usage of the second transform set is signaled by a CU-level flag to the decoder. If the second transform set is selected by the encoder, the flag is set to 1.

[0218] FIG. 24 illustrates a flowchart of a first exemplary method 2400 of decoding, according to some embodiments of the present disclosure. Method 2400 may be performed by a system, e.g., such as decoding system 200, decoder 201, inter prediction module 408, or intra prediction module 410, just to name a few. Method 2400 may include operations 2402-2408, as described below. It is to be appreciated that some of the steps may be optional (as indicated with dashed lines) , and some of the steps may be performed simultaneously, or in a different order than shown in FIG. 24.

[0219] Referring to FIG. 24, at 2402, the system may, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0220] At 2404, the system may determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM.

[0221] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the second IPM as a planar mode.

[0222] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0223] At 2406, the system may, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.

[0224] At 2408, the system may, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode the current block based on the second LFNST / NSPT transform set.

[0225] FIG. 25 illustrates a flowchart of a second exemplary method 2500 of decoding, according to some embodiments of the present disclosure. Method 2500 may be performed by a system, e.g., such as decoding system 200, decoder 201, inter prediction module 408, or intra prediction module 410, just to name a few. Method 2500 may include operations 2502-2508, as described below. It is to be appreciated that some of the steps may be optional (as shown with dashed lines) , and some of the steps may be performed simultaneously, or in a different order than shown in FIG. 25.

[0226] Referring to FIG. 25, at 2502, the system may, in response to an OBIC being enabled, a modified MIP mode or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table.

[0227] At 2504, the system may determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set.

[0228] In some implementations, the second candidate transform set may be a planar transform set.

[0229] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the system may, in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.

[0230] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the system may, in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.

[0231] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the system may, in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.

[0232] At 2506, the system may, in response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.

[0233] At 2508, the system may, in response to the flag indicating the first candidate transform set is selected, decode the current block based on the first candidate transform set.

[0234] FIG. 26 illustrates a flowchart of a first exemplary method 2600 of encoding, according to some embodiments of the present disclosure. Method 2600 may be performed by a system, e.g., such as encoding system 100, encoder 101, inter prediction module 304, or intra prediction module 306, just to name a few. Method 2600 may include operations 2602-2608, as described below. It is to be appreciated that some of the steps may be optional (as indicated with dashed lines) , and some of the steps may be performed simultaneously, or in a different order than shown in FIG. 26.

[0235] Referring to FIG. 26, at 2602, the system may, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0236] At 2604, the system may determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM.

[0237] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the second IPM as a planar mode.

[0238] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the system may determine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0239] At 2606, the system may, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.

[0240] At 2608, the system may, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode the current block based on the second LFNST / NSPT transform set.

[0241] FIG. 27 illustrates a flowchart of a second exemplary method 2700 of encoding, according to some embodiments of the present disclosure. Method 2700 may be performed by a system, e.g., such as encoding system 100, encoder 101, inter prediction module 304, or intra prediction module 306, just to name a few. Method 2700 may include operations 2702-2708, as described below. It is to be appreciated that some of the steps may be optional (as shown with dashed lines) , and some of the steps may be performed simultaneously, or in a different order than shown in FIG. 27.

[0242] Referring to FIG. 27, at 2702, the system may, in response to an OBIC being enabled, a modified MIP mode or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table.

[0243] At 2704, the system may determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set.

[0244] In some implementations, the second candidate transform set may be a planar transform set.

[0245] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the system may, in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.

[0246] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the system may, in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.

[0247] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the system may, in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.

[0248] At 2706, the system may, in response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.

[0249] At 2708, the system may, in response to the flag indicating the first candidate transform set is selected, encode the current block based on the first candidate transform set.

[0250] In various aspects of the present disclosure, the functions described herein may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored as instructions on a non-transitory computer-readable medium. Computer-readable media includes computer storage media. Storage media may be any available media that can be accessed by a processor, such as processor 102 in FIGs. 1 and 2. By way of example, and not limitation, such computer-readable media can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, HDD, such as magnetic disk storage or other magnetic storage devices, Flash drive, SSD, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a processing system, such as a mobile device or a computer. Disk and disc, as used herein, include CD, laser disc, optical disc, digital video disc (DVD) , and floppy disk where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0251] According to one aspect of the present disclosure, a method of decoding is provided. The method may include, in response to a modified MIP mode or an angular MIP mode being enabled, determining, by a processor, one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The method may include determining, by the processor, a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The method may include, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decoding, by the processor, a current block based on the first LFNST / NSPT transform set.

[0252] In some implementations, the method may include, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decoding, by the processor, the current block based on the second LFNST / NSPT transform set.

[0253] In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the second IPM as a planar mode.

[0254] In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0255] According to another aspect of the present disclosure, a method of decoding is provided. The method may include, in response to an OBIC being enabled, an MIP mode, or an angular MIP mode being enabled, determining, by a processor, a first candidate transform set based on a lookup table. The method may include determining, by the processor, a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The method may include, in response to a flag indicating the second candidate transform set is selected, decoding, by the processor, a current block based on the second candidate transform set.

[0256] In some implementations, the method may include, in response to the flag indicating the first candidate transform set is selected, decoding, by the processor, the current block based on the first candidate transform set.

[0257] In some implementations, the second candidate transform set may be a planar transform set.

[0258] In some implementations, the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set may include, in response to one candidate forming the first candidate transform set, determining, by the processor, one candidate forms the second candidate transform set.

[0259] In some implementations, the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set may include, in response to four candidates forming the first candidate transform set, determining, by the processor, two candidates form the second candidate transform set.

[0260] In some implementations, the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set may include, in response to six candidates forming the first candidate transform set, determining, by the processor, three candidates form the second candidate transform set.

[0261] According to a further aspect of the present disclosure, a decoder is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.

[0262] In some implementations, the memory storing instructions, which when executed by the processor, may further cause the processor to, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode the current block based on the second LFNST / NSPT transform set.

[0263] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the second IPM as a planar mode.

[0264] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0265] According to a further aspect of the present disclosure, a decoder is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.

[0266] In some implementations, the memory storing instructions, which when executed by the processor, may further cause the processor to, in response to the flag indicating the first candidate transform set is selected, decode the current block based on the first candidate transform set.

[0267] In some implementations, the second candidate transform set may be a planar transform set.

[0268] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, may cause the processor to, in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.

[0269] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, may cause the processor to, in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.

[0270] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, may cause the processor to, in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.

[0271] According to a further aspect of the present disclosure, an apparatus for decoding is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.

[0272] According to a further aspect of the present disclosure, an apparatus for decoding is provided. The decoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.

[0273] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for a decoder is provided. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.

[0274] In some implementations, the instructions, which when executed by the processor of the decoder, may further cause the processor of the decoder to, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode the current block based on the second LFNST / NSPT transform set.

[0275] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine the second IPM as a planar mode.

[0276] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0277] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for a decoder is provided. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.

[0278] In some implementations, the instructions, which when executed by the processor of the decoder, may further cause the processor of the decoder to, in response to the flag indicating the first candidate transform set is selected, decode the current block based on the first candidate transform set.

[0279] In some implementations, the second candidate transform set may be a planar transform set.

[0280] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.

[0281] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.

[0282] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the decoder, may cause the processor of the decoder to, in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.

[0283] According to one aspect of the present disclosure, a method of encoding is provided. The method may include, in response to a modified MIP mode or an angular MIP mode being enabled, determining, by a processor, one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The method may include determining, by the processor, a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The method may include, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encoding, by the processor, a current block based on the first LFNST / NSPT transform set.

[0284] In some implementations, the method may include, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encoding, by the processor, the current block based on the second LFNST / NSPT transform set.

[0285] In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the second IPM as a planar mode.

[0286] In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode may include determining, by the processor, the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0287] According to another aspect of the present disclosure, a method of encoding is provided. The method may include, in response to an OBIC being enabled, an MIP mode, or an angular MIP mode being enabled, determining, by a processor, a first candidate transform set based on a lookup table. The method may include determining, by the processor, a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The method may include, in response to a flag indicating the second candidate transform set is selected, encoding, by the processor, a current block based on the second candidate transform set.

[0288] In some implementations, the method may include, in response to the flag indicating the first candidate transform set is selected, encoding, by the processor, the current block based on the first candidate transform set.

[0289] In some implementations, the second candidate transform set may be a planar transform set.

[0290] In some implementations, the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set may include, in response to one candidate forming the first candidate transform set, determining, by the processor, one candidate forms the second candidate transform set.

[0291] In some implementations, the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set may include, in response to four candidates forming the first candidate transform set, determining, by the processor, two candidates form the second candidate transform set.

[0292] In some implementations, the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set may include, in response to six candidates forming the first candidate transform set, determining, by the processor, three candidates form the second candidate transform set.

[0293] According to a further aspect of the present disclosure, an encoder is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.

[0294] In some implementations, the memory storing instructions, which when executed by the processor, may further cause the processor to, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode the current block based on the second LFNST / NSPT transform set.

[0295] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the second IPM as a planar mode.

[0296] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, may cause the processor to determine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0297] According to a further aspect of the present disclosure, an encoder is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.

[0298] In some implementations, the memory storing instructions, which when executed by the processor, may further cause the processor to, in response to the flag indicating the first candidate transform set is selected, encode the current block based on the first candidate transform set.

[0299] In some implementations, the second candidate transform set may be a planar transform set.

[0300] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, may cause the processor to, in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.

[0301] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, may cause the processor to, in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.

[0302] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, may cause the processor to, in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.

[0303] According to a further aspect of the present disclosure, an apparatus for encoding is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The memory storing instructions, which when executed by the processor, may cause the processor to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.

[0304] According to a further aspect of the present disclosure, an apparatus for encoding is provided. The encoder may include a processor and memory storing instructions. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The memory storing instructions, which when executed by the processor, may cause the processor to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The memory storing instructions, which when executed by the processor, may cause the processor to, in response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.

[0305] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for an encoder is provided. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to a modified MIP mode or an angular MIP mode being enabled, determine one or more of a first IPM or a second IPM mode based on an HoG of prediction directions of the modified MIP mode or the angular MIP mode. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine a plurality of LFNST / NSPT transform sets corresponding to the first IPM and the second IPM. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.

[0306] In some implementations, the instructions, which when executed by the processor of the encoder, may further cause the processor of the encoder to, in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode the current block based on the second LFNST / NSPT transform set.

[0307] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine the second IPM as a planar mode.

[0308] In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode. In some implementations, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.

[0309] According to a further aspect of the present disclosure, a non-transitory computer-readable medium storing instructions for an encoder is provided. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to an OBIC, a modified MIP mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set. The instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.

[0310] In some implementations, the instructions, which when executed by the processor of the encoder, may further cause the processor of the encoder to, in response to the flag indicating the first candidate transform set is selected, encode the current block based on the first candidate transform set.

[0311] In some implementations, the second candidate transform set may be a planar transform set.

[0312] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.

[0313] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.

[0314] In some implementations, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the encoder, may cause the processor of the encoder to, in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.

[0315] According to still a further aspect of the present disclosure, a non-transitory computer-readable medium storing a bitstream is provided. The bitstream may be generated according to one or more of the operations disclosed herein.

[0316] According to yet another aspect of the present disclosure, a method of transmitting a bitstream is provided. The method may include generating, by a processor, a bitstream based on one or more of the operations described herein. The method may include transmitting, by the processor, the bitstream.

[0317] The foregoing description of the embodiments will so reveal the general nature of the present disclosure that others can, by applying knowledge within the skill of the art, readily modify and / or adapt for various applications such embodiments, without undue experimentation, without departing from the general concept of the present disclosure. Therefore, such adaptations and modifications are intended to be within the meaning and range of equivalents of the disclosed embodiments, based on the teaching and guidance presented herein. It is to be understood that the phraseology or terminology herein is for the purpose of description and not of limitation, such that the terminology or phraseology of the present specification is to be interpreted by the skilled artisan in light of the teachings and guidance.

[0318] Embodiments of the present disclosure have been described above with the aid of functional building blocks illustrating the implementation of specified functions and relationships thereof. The boundaries of these functional building blocks have been arbitrarily defined herein for the convenience of the description. Alternate boundaries can be defined so long as the specified functions and relationships thereof are appropriately performed.

[0319] The Summary and Abstract sections may set forth one or more but not all exemplary embodiments of the present disclosure as contemplated by the inventor (s) , and thus, are not intended to limit the present disclosure and the appended claims in any way.

[0320] Various functional blocks, modules, and steps are disclosed above. The arrangements provided are illustrative and without limitation. Accordingly, the functional blocks, modules, and steps may be reordered or combined in different ways than in the examples provided above. Likewise, some embodiments include only a subset of the functional blocks, modules, and steps, and any such subset is permitted.

[0321] The breadth and scope of the present disclosure should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.

Claims

1.A method of decoding, comprising:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determining, by a processor, one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determining, by the processor, a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decoding, by the processor, a current block based on the first LFNST / NSPT transform set.2.The method of claim 1, further comprising:in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decoding, by the processor, the current block based on the second LFNST / NSPT transform set.3.The method of claim 1, wherein the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode comprises:determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermining, by the processor, the second IPM as a planar mode.4.The method of claim 1, wherein the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode comprises:determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermining, by the processor, the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.5.A method of decoding, comprising:in response to an occurrence-based intra coding (OBIC) being enabled, a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determining, by a processor, a first candidate transform set based on a lookup table;determining, by the processor, a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, decoding, by the processor, a current block based on the second candidate transform set.6.The method of claim 5, further comprising:in response to the flag indicating the first candidate transform set is selected, decoding, by the processor, the current block based on the first candidate transform set.7.The method of claim 5, wherein the second candidate transform set is a planar transform set.8.The method of claim 5, wherein the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set comprises:in response to one candidate forming the first candidate transform set, determining, by the processor, one candidate forms the second candidate transform set.9.The method of claim 5, wherein the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set comprises:in response to four candidates forming the first candidate transform set, determining, by the processor, two candidates form the second candidate transform set.10.The method of claim 5, wherein the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set comprises:in response to six candidates forming the first candidate transform set, determining, by the processor, three candidates form the second candidate transform set.11.A decoder, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determine one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determine a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.12.The decoder of claim 11, wherein the memory storing instructions, which when executed by the processor, further cause the processor to:in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode the current block based on the second LFNST / NSPT transform set.13.The decoder of claim 11, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, cause the processor to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a planar mode.14.The decoder of claim 11, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, cause the processor to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.15.A decoder, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to an occurrence-based intra coding (OBIC) , a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table;determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.16.The decoder of claim 15, wherein the memory storing instructions, which when executed by the processor, further cause the processor to:in response to the flag indicating the first candidate transform set is selected, decode the current block based on the first candidate transform set.17.The decoder of claim 15, wherein the second candidate transform set is a planar transform set.18.The decoder of claim 15, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, cause the processor to:in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.19.The decoder of claim 15, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, cause the processor to:in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.20.The decoder of claim 15, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, cause the processor to:in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.21.An apparatus for decoding, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determine one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determine a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.22.An apparatus for decoding, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to an occurrence-based intra coding (OBIC) , a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table;determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.23.A non-transitory computer-readable medium storing instructions, which when executed by a processor of a decoder, cause the processor of the decoder to:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determine one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determine a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode a current block based on the first LFNST / NSPT transform set.24.The non-transitory computer-readable medium of claim 23, wherein the instructions, which when executed by a processor of the decoder, further cause the processor of the decoder to:in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, decode the current block based on the second LFNST / NSPT transform set.25.The non-transitory computer-readable medium of claim 23, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the decoder, cause the processor of the decoder to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a planar mode.26.The non-transitory computer-readable medium of claim 23, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the decoder, cause the processor of the decoder to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.27.A non-transitory computer-readable medium storing instructions, which when executed by a processor of a decoder, cause the processor of the decoder to:in response to an occurrence-based intra coding (OBIC) , a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table;determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, decode a current block based on the second candidate transform set.28.The non-transitory computer-readable medium of claim 27, wherein the instructions, which when executed by the processor of the decoder, further cause the processor of the decoder to:in response to the flag indicating the first candidate transform set is selected, decode the current block based on the first candidate transform set.29.The non-transitory computer-readable medium of claim 27, wherein the second candidate transform set is a planar transform set.30.The non-transitory computer-readable medium of claim 27, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the decoder, cause the processor of the decoder to:in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.31.The non-transitory computer-readable medium of claim 27, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the decoder, cause the processor of the decoder to:in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.32.The non-transitory computer-readable medium of claim 27, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the decoder, cause the processor of the decoder to:in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.33.A method of encoding, comprising:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determining, by a processor, one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determining, by the processor, a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encoding, by the processor, a current block based on the first LFNST / NSPT transform set.34.The method of claim 33, further comprising:in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encoding, by the processor, the current block based on the second LFNST / NSPT transform set.35.The method of claim 33, wherein the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode comprises:determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermining, by the processor, the second IPM as a planar mode.36.The method of claim 33, wherein the determining, by the processor, one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode comprises:determining, by the processor, the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermining, by the processor, the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.37.A method of encoding, comprising:in response to an occurrence-based intra coding (OBIC) being enabled, a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determining, by a processor, a first candidate transform set based on a lookup table;determining, by the processor, a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, encoding, by the processor, a current block based on the second candidate transform set.38.The method of claim 37, further comprising:in response to the flag indicating the first candidate transform set is selected, encoding, by the processor, the current block based on the first candidate transform set.39.The method of claim 37, wherein the second candidate transform set is a planar transform set.40.The method of claim 37, wherein the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set comprises:in response to one candidate forming the first candidate transform set, determining, by the processor, one candidate forms the second candidate transform set.41.The method of claim 37, wherein the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set comprises:in response to four candidates forming the first candidate transform set, determining, by the processor, two candidates form the second candidate transform set.42.The method of claim 37, wherein the determining, by the processor, the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set comprises:in response to six candidates forming the first candidate transform set, determining, by the processor, three candidates form the second candidate transform set.43.An encoder, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determine one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determine a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.44.The encoder of claim 43, wherein the memory storing instructions, which when executed by the processor, further cause the processor to:in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode the current block based on the second LFNST / NSPT transform set.45.The encoder of claim 43, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, cause the processor to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a planar mode.46.The encoder of claim 43, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the memory storing instructions, which when executed by the processor, cause the processor to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.47.An encoder, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to an occurrence-based intra coding (OBIC) , a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table;determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.48.The encoder of claim 47, wherein the memory storing instructions, which when executed by the processor, further cause the processor to:in response to the flag indicating the first candidate transform set is selected, encode the current block based on the first candidate transform set.49.The encoder of claim 47, wherein the second candidate transform set is a planar transform set.50.The encoder of claim 47, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, cause the processor to:in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.51.The encoder of claim 47, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, cause the processor to:in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.52.The encoder of claim 47, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the memory storing instructions, which when executed by the processor, cause the processor to:in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.53.An apparatus for encoding, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determine one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determine a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.54.An apparatus for encoding, comprising:a processor; andmemory storing instructions, which when executed by the processor, cause the processor to:in response to an occurrence-based intra coding (OBIC) , a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table;determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.55.A non-transitory computer-readable medium storing instructions, which when executed by a processor of an encoder, cause the processor of the encoder to:in response to a modified matrix-based intra-picture prediction (MIP) mode or an angular MIP mode being enabled, determine one or more of a first intra prediction mode (IPM) or a second IPM mode based on a histogram of gradients (HoG) of prediction directions of the modified MIP mode or the angular MIP mode;determine a plurality of low frequency non-separable secondary transform (LFNST)  / non-separable primary transform (NSPT) transform sets corresponding to the first IPM and the second IPM; andin response to a flag indicating a first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode a current block based on the first LFNST / NSPT transform set.56.The non-transitory computer-readable medium of claim 55, wherein the instructions, which when executed by a processor of the encoder, further cause the processor of the encoder to:in response to the flag indicating a second LFNST / NSPT transform set different than the first LFNST / NSPT transform set from among the plurality of LFNST / NSPT transform sets is selected, encode the current block based on the second LFNST / NSPT transform set.57.The non-transitory computer-readable medium of claim 55, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the encoder, cause the processor of the encoder to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a planar mode.58.The non-transitory computer-readable medium of claim 55, wherein, to determine one or more of the first IPM or the second IPM mode based on the HoG of prediction directions of the modified MIP mode or the angular MIP mode, the instructions, which when executed by the processor of the encoder, cause the processor of the encoder to:determine the first IPM as a first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode; anddetermine the second IPM as a second mode different than the first mode derived by the HoG of prediction directions of the modified MIP mode or the angular MIP mode.59.A non-transitory computer-readable medium storing instructions, which when executed by a processor of an encoder, cause the processor of the encoder to:in response to an occurrence-based intra coding (OBIC) , a modified matrix-based intra-picture prediction (MIP) mode, or an angular MIP mode being enabled, determine a first candidate transform set based on a lookup table;determine a number of candidates that form a second candidate transform set based on a number of candidates in the first candidate transform set; andin response to a flag indicating the second candidate transform set is selected, encode a current block based on the second candidate transform set.60.The non-transitory computer-readable medium of claim 59, wherein the instructions, which when executed by the processor of the encoder, further cause the processor of the encoder to:in response to the flag indicating the first candidate transform set is selected, encode the current block based on the first candidate transform set.61.The non-transitory computer-readable medium of claim 59, wherein the second candidate transform set is a planar transform set.62.The non-transitory computer-readable medium of claim 59, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the encoder, cause the processor of the encoder to:in response to one candidate forming the first candidate transform set, determine one candidate forms the second candidate transform set.63.The non-transitory computer-readable medium of claim 59, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the encoder, cause the processor of the encoder to:in response to four candidates forming the first candidate transform set, determine two candidates form the second candidate transform set.64.The non-transitory computer-readable medium of claim 59, wherein, to determine the number of candidates that form the second candidate transform set based on the number of candidates in the first candidate transform set, the instructions, which when executed by the processor of the encoder, cause the processor of the encoder to:in response to six candidates forming the first candidate transform set, determine three candidates form the second candidate transform set.65.A non-transitory computer-readable medium storing a bitstream, the bitstream being generated based on one or more of claims 33-42.66.A method of transmitting a bitstream, comprising:generating, by a processor, a bitstream based on one or more of claims 33-42; andtransmitting, by the processor, the bitstream.

Citation Information

Patent Citations

  • In-mode correlation multiple transform selection for video coding

    CN117223283A

  • Video encoding and decoding method, encoder, decoder and storage medium

    WO2023197195A1

  • Method and apparatus of matrix weighted intra prediction in video coding system

    WO2024083238A1

  • Method and apparatus of intra prediction generation in video coding system

    WO2024131801A1