Image encoding / decoding method and apparatus, and recording medium storing bit stream

By employing the methods of non-separable master transform and dimensionally reduced non-separable master transform kernels, a virtual intra-frame prediction mode and a geometrically segmented partition index are derived, solving the efficiency problem in high-resolution and high-quality image compression, improving coding efficiency, and making it applicable to various video coding standards.

CN121970323APending Publication Date: 2026-05-01LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LG ELECTRONICS INC
Filing Date
2024-10-07
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing image compression techniques are inefficient in high-resolution and high-quality image processing, especially in inter-frame prediction and intra-frame prediction techniques where performance bottlenecks exist. Improved transformation methods are needed to enhance coding efficiency.

Method used

The method employs an inseparable master transform and a dimensionally reduced inseparable master transform kernel. The transform set and transform kernel are determined by deriving a virtual intra-frame prediction mode and a partition index based on geometric segmentation, and effective signal notification is provided during the encoding process.

Benefits of technology

It improves the performance and coding efficiency of transformations, enhances the compression efficiency of high-resolution and high-quality images, and is suitable for various video coding standards such as VVC, EVC, AV1, AVS2, and next-generation video/image coding standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121970323A_ABST
    Figure CN121970323A_ABST
Patent Text Reader

Abstract

A method and apparatus according to the present disclosure may divide a current block into a plurality of partitions, generate a prediction block of the current block by performing prediction on each of the partitions, derive a residual block of the current block based on an inverse transform of the current block, and reconstruct the current block based on the prediction block and the residual block of the current block. Here, the step of deriving the residual block of the current block may comprise the steps of: deriving a virtual intra prediction mode for the current block; and determining a transform set for the inverse transform based on the virtual intra prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Image encoding / decoding methods and devices, and recording media for storing bitstreams Technical Field

[0001] This disclosure relates to an image encoding / decoding method and apparatus, as well as a recording medium for storing bit streams. Background Technology

[0002] Recently, the demand for high-resolution and high-quality images, such as HD (high-definition) and UHD (ultra-high-definition) images, has been increasing in various application areas, and therefore, efficient image compression technologies are being discussed.

[0003] Various techniques exist, such as inter-frame prediction techniques that use video compression technology to predict pixel values ​​included in the current frame from frames before or after the current frame, intra-frame prediction techniques that use pixel information in the current frame to predict pixel values ​​included in the current frame, and entropy coding techniques that assign short symbols to values ​​that occur frequently and long symbols to values ​​that occur infrequently. These image compression techniques can be used to effectively compress image data and send or store it. Summary of the Invention

[0004] Technical issues

[0005] This disclosure provides a method and apparatus for performing a transformation using an indivisible master transform.

[0006] This disclosure provides a method and apparatus for performing a transformation using a dimension-reduced, non-separable master transform kernel.

[0007] This disclosure aims to provide a method and apparatus for determining a transform set and / or a transform kernel and signaling such determination.

[0008] Technical solution

[0009] The image decoding method and apparatus of this disclosure can: divide a current block into multiple partitions, perform prediction for each partition to generate a prediction block for the current block, derive a residual block for the current block based on the inverse transform of the current block, and reconstruct the current block based on the prediction block and the residual block. In this document, the step of deriving the residual block for the current block may include: deriving a virtual intra-frame prediction mode for the current block, and determining the transform set of the inverse transform based on the virtual intra-frame prediction mode.

[0010] In the image decoding method and apparatus according to this disclosure, the virtual intra-frame prediction mode can be derived as a predefined fixed mode.

[0011] In the image decoding method and apparatus according to the present disclosure, a virtual intra-frame prediction mode can be derived based on the segmentation direction according to the geometric segmentation of the current block.

[0012] In the image decoding method and apparatus according to the present disclosure, the virtual intra-frame prediction mode can be derived as the intra-frame prediction mode that matches or is closest to the segmentation direction based on the geometric segmentation of the current block.

[0013] In the image decoding method and apparatus according to the present disclosure, the virtual intra-frame prediction mode can be derived as an intra-frame prediction mode that matches or is closest to the direction perpendicular to the segmentation direction based on the geometric segmentation of the current block.

[0014] In the image decoding method and apparatus according to the present disclosure, a virtual intra-frame prediction mode can be derived based on at least one of the segmentation type of the current block or the partition index corresponding to the segmentation type.

[0015] In the image decoding method and apparatus according to this disclosure, the virtual intra-frame prediction mode can be derived as a DIMD (decoder-side intra-frame mode derivation) mode. In this paper, the DIMD mode can be derived based on reconstructed samples belonging to neighboring regions of the current block.

[0016] In the image decoding method and apparatus according to this disclosure, the virtual intra-frame prediction mode can be derived as a DIMD (decoder-side intra-frame mode derivation) mode. In this document, the DIMD mode can be derived based on prediction samples belonging to the prediction block of the current block.

[0017] In the image decoding method and apparatus according to the present disclosure, a virtual intra-prediction mode can be derived based on one or more TIMD (template-based intra-mode derivation) modes for the current block.

[0018] In the image decoding method and apparatus according to the present disclosure, a virtual intra-prediction mode can be derived based on whether the intra-prediction mode corresponding to the segmentation direction of the geometric segmentation of the current block is the same as at least one of the intra-prediction modes applied to a plurality of segments or at least one of the distances between the segmentation line of the geometric segmentation of the current block and the center of the current block.

[0019] The image coding method and apparatus of this disclosure can divide a current block into multiple partitions, perform prediction for each partition to generate a prediction block for the current block, derive a residual block for the current block based on the prediction block, derive transform coefficients for the current block based on the transform of the residual block, and encode the transform coefficients of the current block. In this document, the step of deriving the transform coefficients of the current block may include deriving a virtual intra-frame prediction mode for the current block, and determining a transform set for the transform based on the virtual intra-frame prediction mode.

[0020] A computer-readable digital storage medium is provided for storing encoded video / image information, which enables a decoding device according to the present disclosure to perform an image decoding method.

[0021] A computer-readable digital storage medium is provided for storing video / image information generated based on the image encoding method of this disclosure.

[0022] A method and apparatus are provided for transmitting video / image information generated according to the image encoding method of this disclosure.

[0023] Beneficial effects

[0024] According to this disclosure, the performance of the transform can be improved by using an inseparable master transform as the master transform.

[0025] According to this disclosure, the performance of the transformation can be improved by using a dimension-reduced, non-separable master transform kernel to perform the transformation.

[0026] According to this disclosure, coding efficiency can be improved by effectively determining and / or signaling the transform set and / or transform kernel. Attached Figure Description

[0027] Figure 1 illustrates a video / image coding system according to this disclosure.

[0028] Figure 2 shows a schematic block diagram of an encoding apparatus to which the embodiments of the present disclosure are applicable and which performs the encoding of video / image signals.

[0029] Figure 3 shows a schematic block diagram of a decoding apparatus to which the embodiments of the present disclosure are applicable and which performs the decoding of video / image signals.

[0030] Figure 4 illustrates an image decoding method performed by a decoding device (300) according to an embodiment of the present disclosure.

[0031] Figure 5 illustrates, exemplarily, an intra-frame prediction mode and its prediction direction according to the present disclosure.

[0032] Figure 6 shows an example of geometric partitioning according to this disclosure.

[0033] Figure 7 shows a flowchart of the method for deriving DIMD modes according to this disclosure.

[0034] Figure 8 shows a filter for deriving DIMD modes according to this disclosure.

[0035] Figure 9 shows a schematic configuration of a decoding device (300) performing an image decoding method according to the present disclosure.

[0036] Figure 10 illustrates an image encoding method performed by an encoding device (200) according to an embodiment of the present disclosure.

[0037] Figure 11 shows a schematic configuration of an encoding device (200) performing an image encoding method according to the present disclosure.

[0038] Figure 12 illustrates an example of a content streaming system to which embodiments of the present disclosure can be applied. Detailed Implementation

[0039] Because this disclosure can be modified in various ways and has multiple embodiments, specific embodiments will be shown in the accompanying drawings and described in detail in the specific embodiments. However, this disclosure is not intended to be limited to the specific embodiments, but should be understood to include all changes, equivalents, and substitutions included within the spirit and scope of this disclosure. Similar reference numerals are used for similar components in the description of the various figures.

[0040] Terms such as "first," "second," etc., may be used to describe various components, but components should not be limited by these terms. Terms are used only to distinguish one component from others. For example, without departing from the scope of this disclosure, a first component may be referred to as a second component, and similarly, a second component may be referred to as a first component. Terms include any combination of one or more of the associated terms.

[0041] When a component is described as "connected" or "linked" to another component, it should be understood that it can be directly connected or linked to the other component, but the other component can exist in between. On the other hand, when a component is described as "directly connected" or "directly linked" to another component, it should be understood that there is no other component in between.

[0042] The terminology used in this application is for describing particular embodiments only and is not intended to limit this disclosure. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, it should be understood that terms such as “comprising” or “having” are intended to specify the presence of the features, quantities, steps, operations, components, portions, or combinations thereof described in this specification, but do not preclude the possibility of the presence or addition of one or more other features, quantities, steps, operations, components, portions, or combinations thereof.

[0043] This disclosure relates to video / image coding. For example, the methods / implementations disclosed herein can be applied to methods disclosed in the Multifunctional Video Coding (VVC) standard. Additionally, the methods / implementations disclosed herein can be applied to methods disclosed in the Basic Video Coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the Audio Video Coding 2 (AVS2) standard, or next-generation video / image coding standards (e.g., H.267 or H.268).

[0044] This specification sets forth various implementations of video / image coding, and unless otherwise specified, these implementations may be combined with each other.

[0045] In this article, video can refer to a collection of images over time. A frame typically refers to a unit representing an image within a specific time period, and a slice / tile is a unit that forms part of a frame during encoding. A slice / tile can include at least one Code Tree Unit (CTU). A frame can consist of at least one slice / tile. A tile is a rectangular area composed of multiple CTUs within a specific tile column and a specific tile row of a frame. A tile column is a rectangular area of ​​CTUs with a height equal to the height of the frame and a width specified by the syntax requirements of the frame parameter set. A tile row is a rectangular area of ​​CTUs with a height specified by the frame parameter set and a width equal to the width of the frame. CTUs within a tile can be arranged continuously according to CTU raster scans, and tiles within a frame can be arranged continuously according to tile raster scans. A slice can include an integer number of complete tiles of a frame that can be exclusively included in a single NAL unit, or an integer number of consecutive complete CTU rows within a tile. Furthermore, a frame can be divided into at least two sub-frames. A sub-frame can be a rectangular area of ​​at least one slice within a frame.

[0046] A pixel, or pelin, can represent the smallest unit that makes up a frame (or image). Additionally, "sample" can be used as the term corresponding to a pixel. A sample can typically represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luminance component or only the pixel / pixel value of the chrominance component.

[0047] A unit can represent the basic unit of image processing. A unit may include a specific region of the image and at least one of the information associated with that region. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. In some cases, the term "unit" may be used interchangeably with terms such as "block" or "region". In general, an M×N block may include a set (or array) of transform coefficients or samples (or sample arrays) consisting of M columns and N rows.

[0048] In this document, “A or B” can mean “A only”, “B only”, or “both A and B”. In other words, “A or B” can be interpreted as “A and / or B”. For example, “A, B or C” can mean “A only”, “B only”, “C only”, or “any combination of A, B and C”.

[0049] The forward slash ( / ) or comma used in this article can indicate "and / or". For example, "A / B" can mean "A and / or B". Therefore, "A / B" can mean "A only", "B only", or "both A and B". For example, "A, B, C" can mean "A, B, or C".

[0050] In this document, "at least one of A and B" can mean "only A", "only B" or "both A and B". Furthermore, in this document, expressions such as "at least one of A or B" or "at least one of A and / or B" can be interpreted in the same way as "at least one of A and B".

[0051] Additionally, in this document, "at least one of A, B, and C" can mean "A only", "B only", "C only" or "any combination of A, B, and C". Furthermore, "at least one of A, B, or C" or "at least one of A, B, and / or C" can mean "at least one of A, B, and C".

[0052] Additionally, the parentheses used in this document can indicate "for example". Specifically, when the indication is "prediction (intra-frame prediction)", "intra-frame prediction" can be cited as an example of "prediction". In other words, "prediction" in this document is not limited to "intra-frame prediction", and "intra-frame prediction" can be cited as an example of "prediction". Furthermore, even when the indication is "prediction (i.e., intra-frame prediction)", "intra-frame prediction" can be cited as an example of "prediction".

[0053] In this article, the technical features described individually in a single diagram can be implemented individually or simultaneously.

[0054] Figure 1 illustrates a video / image coding system according to this disclosure.

[0055] Referring to Figure 1, a video / image encoding system may include a first device (source device) and a second device (receiving device).

[0056] A source device can transmit encoded video / image information or data to a receiving device in the form of a file or stream via a digital storage medium or network. The source device may include a video source, an encoding device, and a transmitting unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, and the display unit may consist of a separate device or external components.

[0057] A video source can acquire video / images through processes that capture, synthesize, or generate video / images. A video source may include means for capturing video / images and means for generating video / images. Means for capturing video / images may include at least one camera, a video / image archive containing previously captured video / images, etc. Means for generating video / images may include a computer, tablet computer, smartphone, etc., and can generate video / images (electronically). For example, virtual video / images can be generated by a computer, etc., and in this case, the process of capturing video / images can be replaced by a process of generating related data.

[0058] Encoding devices can encode input video / images. They can perform a series of processes such as prediction, transformation, and quantization for compression and encoding efficiency. The encoded data (encoded video / image information) can be output as a bitstream.

[0059] The transmitting unit can send encoded video / image information or data, output in bitstream form, to the receiving unit of the receiving device in the form of a file or stream via a digital storage medium or network. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit can include elements for generating media files according to a predetermined file format, and may include elements for transmission via a broadcast / communication network. The receiving unit can receive / extract the bitstream and send it to a decoding device.

[0060] Decoding devices can decode video / images by performing a series of processes, such as dequantization, inverse transform, and prediction, that correspond to the operations of encoding devices.

[0061] The renderer can render decoded video / images. The rendered video / images can be displayed through a display unit.

[0062] Figure 2 shows a rough block diagram of an encoding device that can be implemented using the embodiments of this disclosure and perform encoding of video / image signals.

[0063] Referring to Figure 2, the encoding device 200 may consist of an image segmenter 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter-frame predictor 221 and an intra-frame predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may also include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstruction block generator. According to embodiments, the image segmenter 210, predictor 220, residual processor 230, entropy encoder 240, adder 250, and filter 260 may be configured by at least one hardware component (e.g., an encoder chipset or processor). Additionally, the memory 270 may include a decoded frame buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include the memory 270 as an internal / external component.

[0064] Image segmenter 210 can segment an input image (or picture or frame) input to encoding device 200 into at least one processing unit. As an example, a processing unit can be referred to as a coding unit (CU). In this case, the coding unit can be recursively segmented from coding tree unit (CTU) or maximum coding unit (LCU) according to a quadtree-binary-tritree (QTBTTT) structure.

[0065] For example, a coding unit can be segmented into multiple deeper coding units based on a quadtree, binary tree, and / or ternary tree structure. In this case, for example, a quadtree structure can be applied first, followed by a binary tree and / or ternary tree structure. Alternatively, a binary tree structure can be applied before the quadtree structure. The coding process according to this specification can be performed based on the final coding unit that is no longer segmented. In this case, based on image characteristics, coding efficiency, etc., the largest coding unit can be directly used as the final coding unit, or, if necessary, the coding unit can be recursively segmented into deeper coding units, and the coding unit with the optimal size can be used as the final coding unit. Here, the coding process can include processes such as prediction, transformation, and reconstruction, as described later.

[0066] As another example, the processing unit may also include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit can be divided or segmented from the aforementioned final encoding unit, respectively. The prediction unit may be a unit for predicting samples, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving residual signals from transform coefficients.

[0067] In some cases, a unit can be used interchangeably with terms such as block or region. Generally, an M×N block can represent a set of transform coefficients or samples consisting of M columns and N rows. Samples can typically represent pixels or pixel values, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chrominance component. Samples can be used as a term to form a frame (or image) corresponding to a pixel or cell.

[0068] Encoding device 200 can subtract the prediction signal (prediction block, prediction sample array) output from inter-frame predictor 221 or intra-frame predictor 222 from the input image signal (original block, original sample array) to generate a residual signal (residual signal, residual sample array), and the generated residual signal is sent to converter 232. In this case, the unit in encoding device 200 that subtracts the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) can be called subtractor 231.

[0069] Predictor 220 can perform prediction on the block to be processed (hereinafter referred to as the current block) and generate a prediction block that includes prediction samples of the current block. Predictor 220 can determine whether to apply intra-frame prediction or inter-frame prediction on a per-block or per-unit basis. Predictor 220 can generate various information about the prediction (e.g., prediction mode information) and send it to entropy encoder 240, as described later in the description of the various prediction modes. The information about the prediction can be encoded in entropy encoder 240 and output as a bitstream.

[0070] Intra-predictor 222 can predict the current block by referencing samples within the current frame. Depending on the prediction mode, the referenced samples can be located near the current block or positioned at a specific distance away from the current block. In intra-prediction, the prediction mode can include at least one non-directional mode and multiple directional modes. The non-directional mode can include at least one of a DC mode or a planar mode. Depending on the level of detail of the prediction direction, the directional modes can include 33 or 65 directional modes. However, this is just an example; more or fewer directional modes can be used depending on the configuration. Intra-predictor 222 can determine the prediction mode applied to the current block by using prediction modes applied to neighboring blocks.

[0071] Inter-frame predictor 221 can deduce the predicted block of the current block based on a reference block (reference sample array) specified by motion vectors on a reference frame. In this case, to reduce the amount of motion information transmitted in inter-frame prediction mode, motion information can be predicted on a block, sub-block, or sample basis based on the correlation between motion information between neighboring blocks and the current block. Motion information may include motion vectors and reference frame indices. Motion information may also include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, neighboring blocks may include spatially neighboring blocks existing in the current frame and temporally neighboring blocks existing in the reference frame. The reference frame including the reference block and the reference frame including the temporally neighboring block may be the same or different. The temporally neighboring block may be referred to as a co-located reference block, a co-located CU (colCU), etc., and the reference frame including the temporally neighboring block may be referred to as a co-located frame (colPic). For example, inter-frame predictor 221 can configure a motion information candidate list based on neighboring blocks and generate information indicating which candidate to use to deduce the motion vector and / or reference frame index of the current block. Inter-frame prediction can be performed based on various prediction modes. For example, in skip mode and merge mode, the inter-frame predictor 221 can use the motion information of neighboring blocks as the motion information of the current block. In skip mode, unlike merge mode, residual signals may not be sent. In motion vector prediction (MVP) mode, the motion vectors of neighboring blocks are used as motion vector predictors, and the motion vector difference is signaled to indicate the motion vector of the current block.

[0072] Predictor 220 can generate a prediction signal based on various prediction methods described later. For example, the predictor can not only apply intra-frame prediction or inter-frame prediction to predict a block, but can also apply both intra-frame prediction and inter-frame prediction simultaneously. This can be referred to as the Inter-intra-frame Combined Prediction (CIIP) mode. Alternatively, the predictor can predict blocks based on the Intra-Block Copy (IBC) prediction mode, or it can predict blocks based on a palette mode. The IBC prediction mode or palette mode can be used for content image / video coding such as Screen Content Coding (SCC) in games, etc. IBC essentially performs prediction within the current frame, but it can be performed similarly to inter-frame prediction because it derives a reference block within the current frame. In other words, IBC can use at least one of the inter-frame prediction techniques described herein. The palette mode can be considered as an example of intra-frame coding or intra-frame prediction. When applying a palette mode, sample values ​​within the frame can be signaled based on information about the palette table and palette index. The prediction signal generated by predictor 220 can be used to generate a reconstructed signal or a residual signal.

[0073] Transformer 232 can generate transform coefficients by applying transform techniques to the residual signal. For example, the transform techniques may include at least one of Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), Karhunen–Loève Transform (KLT), Graph-Based Transform (GBT), or Conditional Nonlinear Transform (CNT). Here, GBT represents the transform obtained from a graph when the relationship information between pixels is represented as a graph. CNT represents the transform obtained based on generating a prediction signal using all previously reconstructed pixels. Furthermore, the transform processing can be applied to square pixel blocks of the same size, or it can be applied to non-square blocks of variable size.

[0074] Quantizer 233 can quantize the transform coefficients and send them to entropy encoder 240, which can encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. This information about the quantized transform coefficients can be called residual information. Quantizer 233 can rearrange the block-form quantized transform coefficients into a 1D vector form based on the coefficient scan order, and can generate information about the quantized transform coefficients based on this 1D vector form.

[0075] The entropy encoder 240 can perform various encoding methods such as Golomb, context-adaptive variable-length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 240 can encode information required for video / image reconstruction other than quantization transform coefficients (e.g., values ​​of syntax elements, etc.) together or separately.

[0076] Encoded information (e.g., encoded video / image information) can be transmitted or stored in bitstream form at the Network Abstraction Layer (NAL) unit level. The video / image information may also include information about various parameter sets such as Adaptive Parameter Set (APS), Picture Parameter Set (PPS), Sequence Parameter Set (SPS), or Video Parameter Set (VPS). Additionally, the video / image information may include general constraint information. Information and / or syntax elements transmitted / signaled from the encoding device to the decoding device may be included in the video / image information. The video / image information can be encoded and included in the bitstream through the encoding process described above. The bitstream can be transmitted over a network or stored in a digital storage medium. Here, the network may include broadcast networks and / or communication networks, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting the signal output from the entropy encoder 240 and / or a storage unit (not shown) for storing the signal may be configured as internal / external components of the encoding device 200, or the transmitting unit may also be included in the entropy encoder 240.

[0077] The quantized transform coefficients output from quantizer 233 can be used to generate a prediction signal. For example, the residual signal (residual block or residual sample) can be reconstructed by applying dequantization and inverse transform to the quantized transform coefficients via dequantizer 234 and inverse transformer 235. Adder 250 can add the reconstructed residual signal to the prediction signal output from inter-frame predictor 221 or intra-frame predictor 222 to generate a reconstructed signal (reconstructed frame, reconstructed block, reconstructed sample array). When there is no residual for the block to be processed (similar to when a skip mode is applied), the prediction block can be used as a reconstructed block. Adder 250 can be referred to as a reconstructor or reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current frame, and can also be used for inter-frame prediction of the next frame by filtering, as described later. Furthermore, luminance mapping and chroma scaling (LMCS) can be applied in frame encoding and / or reconstruction processing.

[0078] Filter 260 can improve subjective / objective image quality by applying filtering to the reconstructed signal. For example, filter 260 can generate a modified reconstructed image by applying various filtering methods to the reconstructed image, and the modified reconstructed image can be stored in memory 270 (specifically, the DPB of memory 270). Various filtering methods can include deblocking filtering, sample adaptive offsetting, adaptive loop filtering, bilateral filtering, etc. Filter 260 can generate various information about the filtering and send it to entropy encoder 240. The information about the filtering can be encoded in entropy encoder 240 and output as a bitstream.

[0079] The modified reconstructed frame sent to memory 270 can be used as a reference frame in inter-frame predictor 221. When inter-frame prediction is applied through it, the encoding device can avoid prediction mismatch between the encoding device 200 and the decoding device, and can also improve encoding efficiency.

[0080] The DPB of memory 270 can store modified reconstructed frames for use as reference frames in inter-frame predictor 221. Memory 270 can store motion information of blocks in the current frame from which motion information is derived (or encoded) and / or of blocks in previously reconstructed frames. The stored motion information can be sent to inter-frame predictor 221 as motion information for spatially or temporally neighboring blocks. Memory 270 can store reconstructed samples of reconstructed blocks in the current frame and send them to intra-frame predictor 222.

[0081] Figure 3 shows a rough block diagram of a decoding device that can be implemented using the embodiments of this disclosure and perform decoding of video / image signals.

[0082] Referring to Figure 3, the decoding device 300 can be configured to include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter-frame predictor 332 and an intra-frame predictor 331. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322.

[0083] According to the implementation, the entropy decoder 310, residual processor 320, predictor 330, adder 340, and filter 350 described above can be configured by a single hardware component (e.g., a decoder chipset or processor). Additionally, the memory 360 may include a decoded screen buffer (DPB) and can be configured by a digital storage medium. The hardware component may also include the memory 360 as an internal / external component.

[0084] When the input includes a bitstream containing video / image information, the decoding device 300 can reconstruct the image in response to the processing of the video / image information in the encoding device of FIG2. For example, the decoding device 300 can deduce units / blocks based on block segmentation information obtained from the bitstream. The decoding device 300 can perform decoding using processing units applied in the encoding device. Therefore, the decoding processing unit can be an encoding unit, and the encoding unit can be segmented from the encoding tree unit or a larger encoding unit according to a quadtree structure, binary tree structure, and / or ternary tree structure. At least one transform unit can be derived from the encoding unit. Furthermore, the reconstructed image signal decoded and output by the decoding device 300 can be played back by a playback device.

[0085] Decoding device 300 can receive signals output from encoding device of FIG2 in the form of bitstream, and can decode the received signals by entropy decoder 310. For example, entropy decoder 310 can parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). Video / image information may also include information about various parameter sets such as Adaptive Parameter Set (APS), Picture Parameter Set (PPS), Sequence Parameter Set (SPS), or Video Parameter Set (VPS). In addition, video / image information may also include general constraint information. Decoding device can also decode picture based on information about parameter sets and / or general constraint information. Signal notification / received information and / or syntax elements described later herein can be decoded and obtained from bitstream through the decoding process. For example, entropy decoder 310 can decode information in bitstream based on encoding methods such as exponential Golomb coding, CAVLC, CABAC, etc., and output the values ​​of syntax elements required for image reconstruction and quantized values ​​of transform coefficients with respect to the residuals. More specifically, the CABAC entropy decoding method can receive bins corresponding to each syntax element from the bitstream, determine a context model using information about the syntax element to be decoded, decoding information of neighboring blocks and the block to be decoded, or information about symbols / bins decoded in previous steps, perform arithmetic decoding of bins by predicting the occurrence probability of bins based on the determined context model, and generate symbols corresponding to the values ​​of each syntax element. In this case, after determining the context model, the CABAC entropy decoding method can update the context model by using information about the decoded symbols / bins for the context model of the next symbol / bin. Among the information decoded in the entropy decoder 310, prediction information is provided to the predictors (inter-frame predictor 332 and intra-frame predictor 331), and the residual values ​​(i.e., quantization transform coefficients and related parameter information) from which entropy decoding has been performed in the entropy decoder 310 can be input to the residual processor 320. The residual processor 320 can derive residual signals (residual blocks, residual samples, residual sample arrays). In addition, filtering information among the information decoded in the entropy decoder 310 can be provided to the filter 350. Furthermore, the receiving unit (not shown) that receives the signal output from the encoding device can be further configured as an internal / external component of the decoding device 300, or the receiving unit can be a component of the entropy decoder 310.

[0086] Furthermore, the decoding device according to this specification may be referred to as a video / image / screen decoding device, and the decoding device may be divided into an information decoder (video / image / screen information decoder) and a sample decoder (video / image / screen sample decoder). The information decoder may include an entropy decoder 310, and the sample decoder may include at least one of a dequantizer 321, an inverse transformer 322, an adder 340, a filter 350, a memory 360, an inter-frame predictor 332, and an intra-frame predictor 331.

[0087] Dequantizer 321 can dequantize the quantized transform coefficients and output the transform coefficients. Dequantizer 321 can rearrange the quantized transform coefficients into two-dimensional blocks. In this case, the rearrangement can be performed based on the coefficient scan order performed in the encoding device. Dequantizer 321 can perform dequantization on the quantized transform coefficients using quantization parameters (e.g., quantization step size information) and obtain the transform coefficients.

[0088] The inverse transformer 322 performs an inverse transformation on the transformation coefficients to obtain the residual signal (residual block, residual sample array).

[0089] Predictor 320 can perform prediction on the current block and generate a prediction block that includes prediction samples of the current block. Predictor 320 can determine whether to apply intra-frame prediction or inter-frame prediction to the current block based on the prediction information output from entropy decoder 310, and determine the specific intra-frame / inter-frame prediction mode.

[0090] Predictor 320 can generate prediction signals based on various prediction methods described later. For example, predictor 320 can not only apply intra-frame prediction or inter-frame prediction to predict a block, but can also apply intra-frame prediction and inter-frame prediction simultaneously. This can be referred to as the Inter-Frame Intra-Frame Combined Prediction (CIIP) mode. Alternatively, the predictor can predict blocks based on the Intra-Frame Block Copy (IBC) prediction mode, or it can predict blocks based on a palette mode. The IBC prediction mode or palette mode can be used for content image / video coding such as Screen Content Coding (SCC) in games, etc. IBC essentially performs prediction within the current frame, but it can be performed similarly to inter-frame prediction because it derives a reference block within the current frame. In other words, IBC can use at least one of the inter-frame prediction techniques described herein. The palette mode can be considered an example of intra-frame coding or intra-frame prediction. When a palette mode is applied, information about the palette table and palette index can be included in the video / image information and signaled concurrently.

[0091] Intra-predictor 331 can predict the current block by referencing samples within the current frame. Depending on the prediction mode, the referenced samples can be located near the current block or at a specific distance away. In intra-prediction, the prediction mode can include at least one non-directional mode and multiple directional modes. Intra-predictor 331 can determine the prediction mode applied to the current block by using prediction modes applied to neighboring blocks.

[0092] Inter-frame predictor 332 can deduce the predicted block of the current block based on a reference block (reference sample array) specified by motion vectors on a reference frame. In this case, to reduce the amount of motion information transmitted in inter-frame prediction mode, motion information can be predicted on a block, sub-block, or sample basis based on the correlation of motion information between neighboring blocks and the current block. Motion information may include motion vectors and reference frame indices. Motion information may also include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, neighboring blocks may include spatially neighboring blocks existing in the current frame and temporally neighboring blocks existing in the reference frame. For example, inter-frame predictor 332 can configure a motion information candidate list based on neighboring blocks and deduce the motion vector and / or reference frame index of the current block based on the received candidate selection information. Inter-frame prediction can be performed based on various prediction modes, and the information about the prediction may include information indicating the inter-frame prediction mode of the current block.

[0093] Adder 340 can add the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor (including inter-frame predictor 332 and / or intra-frame predictor 331) to generate a reconstruction signal (reconstructed frame, reconstruction block, reconstruction sample array). When there is no residual for the block to be processed (similar to when a skip mode is applied), the prediction block can be used as a reconstruction block.

[0094] Adder 340 can be referred to as a reconstructor or reconstruction block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current frame, can be output through filtering as described later, or can be used for inter-frame prediction of the next frame. In addition, luminance mapping and chroma scaling (LMCS) can be applied in the frame decoding process.

[0095] Filter 350 can improve subjective / objective image quality by applying filtering to the reconstructed signal. For example, filter 350 can generate a modified reconstructed image by applying various filtering methods to the reconstructed image and send the modified reconstructed image to memory 360 (specifically, the DPB of memory 360). Various filtering methods may include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.

[0096] The (modified) reconstructed frame stored in the DPB of memory 360 can be used as a reference frame in inter-frame predictor 332. Memory 360 can store motion information of blocks in the current frame from which motion information is derived (or decoded) and / or motion information of blocks in previously reconstructed frames. The stored motion information can be sent to inter-frame predictor 332 as motion information of spatially or temporally neighboring blocks. Memory 360 can store reconstructed samples of reconstructed blocks in the current frame and send them to intra-frame predictor 331.

[0097] The embodiments described in this document in the filter 260, inter-frame predictor 221 and intra-frame predictor 222 of the encoding device 200 can also be applied equivalently or correspondingly to the filter 350, inter-frame predictor 332 and intra-frame predictor 331 of the decoding device 300, respectively.

[0098] Figure 4 illustrates an image decoding method performed by a decoding device (300) according to an embodiment of the present disclosure.

[0099] Referring to Figure 4, the current block can be divided into multiple partitions (S400).

[0100] The current block can be divided into multiple partitions based on one or more dividing lines. Dividing lines can include at least one of vertical or horizontal lines. Alternatively, when geometric segmentation is applied to the current block, it can be divided into two partitions using predetermined dividing lines. Dividing lines for geometric segmentation can be defined based on a predetermined segmentation direction (or segmentation angle) and distance from the center of the current block. The current block can be a coded block that is no longer segmented by tree-based block segmentation.

[0101] Referring to Figure 4, a prediction block for the current block can be generated based on the prediction for each partition (S410).

[0102] Suppose the current block is divided into two partitions (i.e., the first partition and the second partition). In this case, the predicted block for the current block can be generated as a weighted sum of a first predicted block for the first partition and a second predicted block for the second partition. In this paper, the first and second predicted blocks can be generated based on intra-frame prediction. Alternatively, the first and second predicted blocks can be generated based on inter-frame prediction. Alternatively, one of the first or second predicted blocks can be generated based on intra-frame prediction, and the other can be generated based on inter-frame prediction.

[0103] As an example, when the current block is divided into two partitions based on geometric segmentation, prediction blocks for each partition can be generated based on inter-frame prediction, and prediction blocks for the current block can be generated based on the weighted sum of the generated prediction blocks.

[0104] Alternatively, when the current block is divided into two partitions based on geometric segmentation, prediction blocks for each partition can be generated based on intra-frame prediction, and a prediction block for the current block can be generated based on a weighted sum of the generated prediction blocks. In the following text, this is referred to as Spatial Geometric Segmentation Mode (SGPM).

[0105] When SGPM is applied to the current block, the segmentation type of the current block can be determined based on a segmentation type index that specifies the segmentation direction and the position of the segmentation line. The segmentation type index can indicate one of a predefined segmentation type candidate. The intra-prediction mode for each partition within the current block can be derived based on a mode index that indicates one of multiple intra-prediction mode candidates. A mode index can be defined for each partition within the current block.

[0106] The partition type index and mode index for each partition can be signaled via a bitstream. In this case, the partition type index can be represented as `partition_mode_idx`, and the mode index for each partition can be represented as `intra_pred_mode0_idx` and `intra_pred_mode1_idx`, respectively. Alternatively, the partition type index and mode index for the first partition can be signaled via a bitstream, and the mode index for the second partition can be derived based on the mode index for the first partition. At least one of the above partition type index or mode index can be signaled based on a flag (`cu_sgpm_flag`) indicating whether SGPM is applied to the current block. As an example, when `cu_sgpm_flag` is 1, the partition type index and mode index can be signaled, and when `cu_sgpm_flag` is 0, no signaling is required.

[0107] Alternatively, a candidate list for SGPM can be constructed. The candidate list can include multiple candidates, and each candidate can include a segmentation type index and two mode indices. As an example, the multiple candidates included in the candidate list can be derived as a combination of predefined segmentation type candidates (e.g., 26 segmentation type candidates) and predetermined intra-prediction mode candidates (e.g., 3 intra-prediction mode candidates). The maximum number of candidates that can be included in the candidate list can be 16. Based on one of the multiple candidates, the segmentation type index for the current block and the mode index for each partition can be derived. The candidate index indicating one of the multiple candidates can be notified via bitstream signaling.

[0108] The candidate list can be reordered based on a predetermined template region. For example, the sum of absolute differences (SAD) between predicted and reconstructed samples of the template region can be calculated. The SAD can be calculated for each of the multiple candidates included in the candidate list. The multiple candidates in the candidate list can be reordered in ascending order of SAD. The template region can include at least one of the top neighbor region or the left neighbor region adjacent to the current block. The height of the top neighbor region and the width of the left neighbor region can be fixed to a predetermined length (e.g., 1).

[0109] Intra-prediction mode candidates can be included in the IPM list. An IPM list can be constructed for each partition within the current block. At least one of the intra-prediction mode candidates included in the IPM list of the first partition can be different from the intra-prediction mode candidate included in the IPM list of the second partition. Alternatively, an IPM list can be constructed for the current block, and partitions within the current block can share a single IPM list. The IPM list can include three or more intra-prediction mode candidates.

[0110] SGPM can be applied when the size of the current block meets predetermined conditions. These conditions may include at least one of conditions 1 through 5 below. In this document, width and height may represent the width and height of the current block, respectively.

[0111] (Condition 1) 4 ≤ width ≤ 64

[0112] (Condition 2) 4 ≤ height ≤ 64

[0113] (Condition 3) Width < Height × 8

[0114] (Condition 4) Height < Width × 8

[0115] (Condition 5) Width × Height ≥ 32

[0116] A flag can be defined to indicate whether mixing is allowed between the predicted blocks of the first partition and the predicted blocks of the second partition for the current block.

[0117] Adaptive blending can be used in SGPM when a flag indicates that blending between predicted blocks is allowed (e.g., when the flag is false). The blending depth for adaptive blending can be derived based on the size of the current block. As an example, when the minimum width and height of the current block is 4, the blending depth can be derived as 1 / 2τ. When the minimum width and height of the current block is 8, the blending depth can be derived as τ. When the minimum width and height of the current block is 16, the blending depth can be derived as 2τ. When the minimum width and height of the current block is 32, the blending depth can be derived as 4τ. When the minimum width and height of the current block is greater than 32, the blending depth can be derived as 8τ. In this paper, τ can be any integer greater than 0.

[0118] On the other hand, when the flag indicates that blending between predicted blocks is not allowed (e.g., when the flag is true), the blending depth can be derived to a default value (e.g., 1 / 4τ). This means that blending is not used when the dividing line of the geometric segment corresponds to a vertical or horizontal line, and the width of the region where blending is applied becomes relatively narrow when the dividing line of the geometric segment does not correspond to a vertical or horizontal line (i.e., when the dividing line has another dividing direction).

[0119] Referring to Figure 4, the residual block of the current block can be derived based on the transformation coefficients of the current block (S420).

[0120] The residual information of the current block can be obtained from the bitstream, and the transform coefficients of the current block can be derived by decoding the residual information. A residual block containing residual samples can be derived by performing at least one of dequantization or inverse transform on the transform coefficients of the current block.

[0121] When Adaptive Multiple Transform Selection (MTS) is applied to the current block, the inverse transform can be performed based on at least one of DCT-2, DST-7, or DCT-8. Here, DCT-2, DST-7, DCT-8, etc., can be referred to as transform type, transform kernel, or transform core.

[0122] In this disclosure, the inverse transform can refer to a separable transform. However, it is not limited to this; the inverse transform can refer to an inseparable transform, or it can be a concept that includes both separable and inseparable transforms. Furthermore, the inverse transform in this disclosure refers to the principal transform, but is not limited to this; it can be applied to a second transform by modifying it to the same / similar form.

[0123] For example, as an inverse transform method, DCT-2 and the non-separable transform can be used alone, or the non-separable transform can be used in addition to at least one of DCT-2, DST-7 or DCT-8, or the non-separable transform can replace one or more of the transform kernels of DCT-2, DST-7 or DCT-8.

[0124] As a more specific implementation, when (DCT-2, DCT-2), (DST-7, DST-7), (DCT-8, DST-7), (DST-7, DCT-8), and (DCT-8, DCT-8) are present as transform kernel candidates for separable transforms, a non-separable transform can replace or add to one or more of these five transform kernel candidates. Here, the notation (transformer 1, transformer 2) indicates that transform 1 is applied in the horizontal direction and transform 2 is applied in the vertical direction. When a non-separable transform replaces some transform kernel candidates, the remaining transform kernel candidates other than (DCT-2, DCT-2) and (DST-7, DST-7) can be replaced with a non-separable transform. However, the above transform kernel candidates are merely examples and may include other types of DCTs and / or DSTs, and may include transform skipping as a transform kernel candidate.

[0125] An inseparable transformation can refer to a transformation or inverse transformation based on an inseparable transformation matrix. That is, unlike a separable transformation, which performs horizontal and vertical transformations independently by separating the vertical and horizontal transformations, an inseparable transformation can perform both horizontal and vertical transformations simultaneously.

[0126] For example, when performing an inseparable transformation on a 4×4 block, the input data X of the inseparable transformation is shown in Equation 1 below.

[0127] [Formula 1]

[0128] When the input data X is represented in vector form, the vector X' can be represented as follows.

[0129] [Equation 2]

[0130] In this case, the inseparable transformation can be performed as shown in Equation 3 below.

[0131] [Formula 3]

[0132] In Equation 3, F represents the transformation coefficient vector, and T represents the 16×16 inseparable transformation matrix. Represents matrix and vector multiplication.

[0133] The 16×1 transformation coefficient vector F can be derived using Equation 3. F can be reconfigured into 4×4 blocks according to a predetermined scanning order. The scanning order can be horizontal scanning, vertical scanning, diagonal scanning, z-scanning, raster scanning, or a predefined scanning.

[0134] The set of inseparable transforms and / or the transform kernel of inseparable transforms can be configured differently based on the prediction mode (e.g., intra-frame mode, inter-frame mode, etc.), the width, height or number of pixels of the current block, the position of the sub-blocks within the current block, the syntax element that explicitly signals the notification, the statistical characteristics of the neighboring samples, and whether a quadratic transform or quantization parameter (QP) is used.

[0135] Specifically, for intra-frame modes, predefined intra-frame prediction modes can be grouped into n inseparable transform sets, each of which can include k transform kernel candidates. Here, n and k can be arbitrary constants, according to the same rules (conditions) defined for both the encoding and decoding devices.

[0136] The number of inseparable transform sets and / or the number of transform kernel candidates included in each inseparable transform set can be configured differently based on the width and / or height of the current block. For example, for a 4×4 block, n1 inseparable transform sets and k1 transform kernel candidates can be configured. For a 4×8 block, n2 inseparable transform sets and k2 transform kernel candidates can be configured. Furthermore, the number of inseparable transform sets and the number of transform kernel candidates included in each inseparable transform set can be configured differently based on the product of the width and height of the current block. For example, when the product of the width and height of the current block is equal to or greater than 256, n3 inseparable transform sets and k3 transform kernel candidates can be configured; otherwise, n4 inseparable transform sets and k4 transform kernel candidates can be configured. That is, since the degree of variation in the statistical characteristics of the residual signal varies with the block size, the number of inseparable transform sets and transform kernel candidates can be configured differently to reflect this.

[0137] When the current block is divided into multiple sub-blocks, the statistical characteristics of the residual signal can differ for each sub-block. Therefore, the number of inseparable transform sets and transform kernel candidates can be configured differently. For example, when a 4×8 or 8×4 block is divided into two 4×4 sub-blocks and an inseparable transform is applied to each sub-block, n5 inseparable transform sets and k5 transform kernel candidates can be configured for the top-left 4×4 sub-block, and n6 inseparable transform sets and k6 transform kernel candidates can be configured for the other 4×4 sub-blocks.

[0138] Based on the explicitly signaled syntax elements, the number of inseparable transform sets and transform kernel candidates can be configured differently. As syntax elements, information indicating one of multiple inseparable transform configurations can be used. For example, when three inseparable transform configurations are supported (i.e., n7 inseparable transform sets and k7 transform kernel candidates, n8 inseparable transform sets and k8 transform kernel candidates, and n9 inseparable transform sets and k9 transform kernel candidates), the syntax element can have values ​​of 0, 1, and 2, and the inseparable transform configuration applied to the current block can be determined based on the value of the signaled syntax element.

[0139] The number of inseparable transform sets and transform kernel candidates can be configured differently depending on whether a quadratic transform is applied and / or which quadratic transform is applied. For example, when no quadratic transform is applied, a set including n... 10 A set of inseparable transformations and k 10 An inseparable transformation configuration of n transformation kernel candidates. When applying a quadratic transformation, it is possible to apply n... 11 A set of inseparable transformations and k 11 Inseparable transformation configuration of a transform kernel candidate.

[0140] Based on the quantization parameter (QP) and / or the range to which the QP value belongs, different configurations of the inseparable transformation can be applied. For example, when the QP value is small, configurations including n can be applied. 12 A set of inseparable transformations and k 12 An inseparable transformation configuration of n transformation kernel candidates. On the other hand, when the QP value is large, an application including n... 13 A set of inseparable transformations and k 13 The non-separable transform configuration of each transform kernel candidate. When the QP value is less than or equal to a threshold (e.g., 32), the case is classified as having a smaller QP value; otherwise, the case is classified as having a larger QP value. Alternatively, the range of QP values ​​can be divided into three or more, and different non-separable transform configurations can be applied to each range.

[0141] For relatively large blocks, instead of using an inseparable transformation corresponding to the block's width and height, the block can be divided into multiple sub-blocks, and an inseparable transformation corresponding to the width and height of each sub-block can be used. For example, when performing an inseparable transformation on a 4×8 block, the 4×8 block can be divided into two 4×4 sub-blocks, and an inseparable transformation based on the 4×4 block can be used for each 4×4 sub-block. Alternatively, an 8×16 block can be divided into two 8×8 sub-blocks, and an inseparable transformation based on the 8×8 block can be used.

[0142] The set of non-separable transforms can be determined based on the intra-prediction modes and mapping table of the current block. The mapping table defines the mapping relationship between predefined intra-prediction modes and the set of non-separable transforms. The predefined intra-prediction modes can include two non-directional modes and 65 directional modes. Typically, non-separable transforms have a larger transform kernel size than separable transforms. This means that the computational complexity required for transform processing is higher, and the memory required to store the transform kernel is larger. Furthermore, while separable transforms may only consider statistical properties existing in the horizontal and / or vertical directions, non-separable transforms can consider statistical properties in a two-dimensional space including both the horizontal and vertical directions, thus providing better compression efficiency. Since the statistical properties and residual diversity vary depending on the directionality of the intra-prediction mode, there may be cases where non-separable transforms are absolutely necessary, and there may be intra-prediction modes whose residual properties can be identified solely by separable transforms. Therefore, by predefining which transform to use in the encoding and decoding devices based on the intra-prediction modes, transform processing can be designed with optimized complexity and memory requirements. Non-directional modes can include the planar mode numbered 0 and the DC mode numbered 1, while directional modes can include intra-prediction modes numbered 2 to 66. However, this is just an example, and this disclosure can also be applied to situations where the number of predefined intra-prediction modes varies.

[0143] Due to the application of Wide Angle Intra Prediction (WAIP), the predefined intra prediction modes can also include intra prediction modes from -14 to -1 and intra prediction modes from 67 to 80.

[0144] Figure 5 exemplarily illustrates intra-frame prediction modes and their prediction directions according to the present disclosure. Referring to Figure 5, modes -14 to -1 and 2 to 33 and modes 35 to 80 are symmetrical about mode 34 in terms of prediction direction. For example, modes 10 and 58 are symmetrical about the direction corresponding to mode 34, and mode -1 is symmetrical about mode 67. Therefore, for vertical directional modes that are symmetrical about mode 34 with the horizontal directional modes, the input data can be transposed and used. Transposing the input data means that the rows and columns in the M×N input data of the two-dimensional block are transformed into columns and rows, respectively, to form N×M data.

[0145] For example, when using 4×4 blocks, the 16 data points forming the 4×4 blocks can be appropriately arranged to form a 16×1 one-dimensional vector for the inseparable transformation. In this case, the one-dimensional vector can be formed in row-major or column-major order. The residual samples obtained from the inseparable transformation can be arranged in the above order to form a two-dimensional block.

[0146] For modes -14 to -1 and 2 to 33, the data arrangement order for forming a 16×1 input vector is row-major. For modes 35 to 80, the input vector can be formed according to column-major.

[0147] Pattern 34 cannot be considered either a horizontal or vertical orientation pattern, but in this disclosure, it is classified as a horizontal orientation pattern. That is, for patterns -14 to -1 and 2 to 33, the input data arrangement method for horizontal orientation patterns (i.e., row priority order) is used, and for vertical orientation patterns symmetrical about pattern 34, the input data can be transposed and used.

[0148] For non-square blocks, the symmetry in square blocks cannot be utilized (i.e., the symmetry between mode P and mode (68-P) in an N×N block (2<=P<=33) or the symmetry between mode Q and mode (66-Q) (-14<=Q<=-1)). Therefore, in addition to relying solely on the symmetry of intra-frame prediction modes, the symmetry between block shapes that are transposes of each other can also be utilized, i.e., the symmetry between K×L blocks and L×K blocks. Specifically, there is a symmetry relationship between a K×L block predicted by mode P and an L×K block predicted by mode (68-P). Alternatively, there is a symmetry relationship between a K×L block predicted by mode Q and an L×K block predicted by mode (66-Q).

[0149] Since a K×L block with mode 2 and an L×K block with mode 66 can be considered symmetrical to each other, the same transform kernel can be applied to both K×L and L×K blocks. If the set of non-separable transforms for the intra-prediction modes of a K×L block is mapped, then in order to apply the non-separable transform to an L×K block, the set of non-separable transforms can be derived through a mapping table corresponding to a K×L block based on mode (68-P) (rather than mode P applied to the L×K block). Alternatively, the set of non-separable transforms can be derived through a mapping table corresponding to a K×L block based on mode (66-Q) (rather than mode Q applied to the L×K block).

[0150] For example, to apply an inseparable transformation to an L×K block, the set of inseparable transformations can be selected based on mode 2 instead of mode 66. Furthermore, for a K×L block, the input data can be read in a predetermined order (e.g., row-major or column-major order) to form a 1D vector, and then the corresponding inseparable transformation can be applied. For an L×K block, the input data can be read in transposed order to form a 1D vector, and then the corresponding inseparable transformation can be applied. That is, when a K×L block is read in row-major order, an L×K block can be read in column-major order. Conversely, when a K×L block is read in column-major order, an L×K block can be read in row-major order.

[0151] Furthermore, when applying mode 34 to a K×L block, the set of inseparable transformations can be determined based on mode 34, and the input data can be read in a predetermined order to form a 1D vector and perform the corresponding inseparable transformation. When applying mode 34 to an L×K block, the set of inseparable transformations can be determined based on mode 34, but the input data can be read in transposed order to form a 1D vector and perform the corresponding inseparable transformation.

[0152] In this disclosure, a method for determining the set of inseparable transformations and a method for forming input data are described based on K×L blocks. However, the aforementioned symmetry of K×L blocks can be utilized to perform inseparable transformations based on L×K blocks. Alternatively, blocks with a width greater than their height can be restricted to being used as reference blocks. Alternatively, the symmetry can be restricted to not being used in the case of non-square blocks. In this case, non-square blocks can use a set of inseparable transformations and / or transformation kernel candidates with different numbers than those of square blocks, and a different mapping table can be used to select the set of inseparable transformations.

[0153] An example of a mapping table used to select sets of inseparable transforms is shown below: [Table 1]

[0154] Table 1 shows an example of assigning non-separable transform sets to each intra-prediction mode when five non-separable transform sets are available. The value of `predModeIntra` indicates the value of the intra-prediction mode considering WAIP, and `TrSetIdx` is the index indicating a specific non-separable transform set. In Table 1, it can be confirmed that the same non-separable transform set is applied to modes located in symmetrical directions according to the intra-prediction mode. Table 1 is merely an example of using five non-separable transform sets and does not limit the total number of non-separable transform sets used for non-separable transforms.

[0155] Alternatively, as shown in Table 2, for compression performance, non-separable transformations may not be applied to WAIP.

[0156] [Table 2]

[0157] Alternatively, as shown in Table 3, instead of configuring a separate indivisible transform set for WAIP, the indivisible transform set corresponding to the prediction modes in adjacent frames can be shared.

[0158] [Table 3]

[0159] The set of inseparable transforms can include multiple transform kernel candidates, and one of these candidates can be used selectively. For this purpose, an index signaled via a bitstream can be used. Alternatively, one of the multiple transform kernel candidates can be implicitly determined based on the context information of the current block. Here, the context information may refer to the size of the current block or whether an inseparable transform is applied to neighboring blocks. The size of the current block can be defined as width, height, the maximum / minimum value of width and height, the sum of width and height, or the product of width and height.

[0160] The method for determining the transform kernel for the inverse transform of the current block will be described in detail below.

[0161] Implementation Method 1

[0162] As described above, inverse transforms can be divided into separable transforms and non-separable transforms. A separable transform means performing a transform on a two-dimensional block in the horizontal and vertical directions, respectively, while a non-separable transform means performing a single transform on a sample that constitutes the entire or part of the two-dimensional block. When representing a separable transform, it can be represented as a pair of horizontal and vertical transforms, which in this disclosure will be represented as (horizontal transform, vertical transform).

[0163] Multiple transformation sets can be defined for the inverse transform of the current block. Each transformation set can include one or more transform kernel candidates.

[0164] For example, one of (DST-7, DST-7), (DCT-8, DST-7), (DST-7, DCT-8), or (DCT-8, DCT-8) can be applied as a separable transform, and the above four transform kernel candidates can be considered as a transform set. Additionally, (DCT-2, DCT-2) can be considered as a transform set. A transform skip without applying a transform can also be considered as a transform set; (DCT-2, DCT-2) and the transform skip can be considered as a transform set. In this disclosure, a transform kernel can refer to a single transform (e.g., DCT-2, DST-7) or two transform pairs (e.g., (DCT-2, DCT-2)).

[0165] As another example of a transform set, the aforementioned inseparable transform set may exist. In this disclosure, the inseparable transform applied as the master transform can be represented as the Inseparable Master Transform (NSPT). In the NSPT, multiple inseparable transform sets can be configured, and each inseparable transform set may include one or more transform kernels as transform kernel candidates. In the case of the NSPT, one of multiple inseparable transform sets is selected based on the intra-frame prediction mode, and the multiple inseparable transform sets used for the NSPT can be represented as a list of NSPT sets. This is as described above, and its detailed description will be omitted here.

[0166] A group of one or more transform sets that can be used for the current block can be configured from multiple predefined transform sets. The group of one or more transform sets can be configured by a predetermined regional unit to which the current block belongs, hereinafter referred to as a set. Here, the predetermined regional unit can be at least one of a picture, a slice, a coding tree unit row (CTU row), or a coding tree unit (CTU).

[0167] For example, the transform set consisting of (DCT-2, DCT-2) is called S1, and the transform set consisting of (DST-7, DST-7), (DCT-8, DST-7), (DST-7, DCT-8), and (DCT-8, DCT-8) is called S2. Furthermore, the above list of NSPT sets can include N inseparable transform sets, which are respectively called S... 3,1 S 3,2 ... S 3,N Here, N can be 35, but is not limited to this.

[0168] When the intra-prediction mode based on the current block is selected as S 3,13 When used as an inseparable transform set for NSPT, the transform kernel applicable to the current block can belong to S1, S2, or S... 3,13 One of them. In this case, the set available for the current block can be represented as {S1, S2, S...} 3,13}

[0169] As described above, since the set according to this disclosure is a group of one or more transform sets available for the current block, the set can be configured differently based on the context of the current block. Here, the context can include at least one of shape, size, or intra-prediction mode. If a total of K contexts are defined, K sets can be generated, and each set can be represented as C. i (i=1, 2, ..., N). For example, when the block size to which NSPT is applicable is 4×4, 8×8, 16×16 and 32×32 and one of a total of 35 inseparable transform sets is selected based on the intra-prediction mode, a total of 4×35=140 contexts can be defined if different transform kernels are applied for each block size.

[0170] The set can be configured based on the context of the current block, and in this case, the processes of selecting one of multiple transform sets belonging to the set and selecting one of multiple transform kernel candidates belonging to the selected transform set can be performed. Here, the selection of transform sets and transform kernel candidates can be performed implicitly based on the context of the current block, or it can be performed based on an explicitly signaled index. Alternatively, the processes of selecting one of multiple transform sets belonging to the set and selecting one of multiple transform kernel candidates belonging to the selected transform set can be performed separately. For example, an index for selecting a transform set can be signaled first, and one of multiple transform sets belonging to the set can be selected based on that index. Then, an index indicating one of the multiple transform kernel candidates belonging to the transform set can be signaled, and one of the transform kernel candidates can be selected from the transform set based on the signaled index. The transform kernel of the current block can be determined based on the selected transform kernel candidate. Alternatively, selecting a transform set from the set can be performed implicitly based on the context of the current block, and selecting a transform kernel candidate from the selected transform set can be performed based on the signaled index. Alternatively, selecting a transform set from the set can be performed based on the signaled index, and selecting a transform kernel candidate from the selected transform set can be implicitly performed based on the context of the current block. Alternatively, selecting a transform set from the set can be implicitly performed based on the context of the current block, and selecting a transform kernel candidate from the selected transform set can also be implicitly performed based on the context of the current block. Of course, when the number of transform sets belonging to the set is 1, the signaled index for selecting the transform set may not be required. Similarly, when the number of transform kernel candidates belonging to the selected transform set is 1, the signaled index for indicating the transform kernel candidate may not be required. Alternatively, the signaled index indicating one of all transform kernel candidates belonging to the current set can be used. In this case, the process of selecting a transform set from the set can be omitted. In this case, priority can be considered when shuffling all transform sets belonging to the set. For example, when assigning a smaller-length binary code (e.g., truncated unary code) to a smaller-valued index, assigning a smaller-valued index to a transform kernel candidate that is more conducive to improving coding performance may be advantageous. When shuffling all transformation kernel candidates belonging to a set according to priority, different shuffling can be applied to each set. Alternatively, instead of shuffling all transformation kernel candidates belonging to a set, it is possible to selectively shuffle only some of them.

[0171] Implementation Method 2

[0172] The transform kernel for the inverse transform of the current block can be determined based on MTS (Multiple Transform Selection).

[0173] The MTS according to this disclosure can use at least one of DST-7, DCT-8, DCT-5, DST-4, DST-1 or IDT (identity transformation) as the transformation kernel. Additionally, the MTS according to this disclosure may also include a DCT-2 transformation kernel.

[0174] In this disclosure, multiple MTS sets can be defined for MTS. One of the multiple MTS sets can be determined based on the current block size and / or intra-prediction mode. For example, when determining an MTS set, 16 transform block sizes can be considered, and for directional modes, the shape of the transform blocks and the symmetry between the intra-prediction modes can be considered. For WAIP (Wide Angle Intra-Prediction) modes (i.e., -1 to -14 (or -15), 67 to 80 (or 81)), the MTS set corresponding to mode 2 can be applied for modes -1 to -14 (or -15), and the MTS set corresponding to mode 66 can be applied for modes 67 to 80 (or 81). A separate MTS set can be assigned to MIP (Matrix-Based Intra-Prediction) modes.

[0175] For example, as shown in Table 4 below, an MTS set can be assigned / defined based on the transform block size and intra-prediction mode.

[0176] [Table 4]

[0177] Table 4 shows the assignment of MTS sets based on 16 transform block sizes and intra-prediction modes. The predefined number of MTS sets is 80, and the index indicating one of the 80 MTS sets can have values ​​from 0 to 79, as shown in Table 4.

[0178] [Table 5]

[0179] Table 5 shows the transform kernel candidates included in the various MTS sets described in Table 4. Each MTS set can consist of six transform kernel candidates. The transform kernel candidate index has a value of one of 0 to 5 and can indicate one of the six transform kernel candidates. Here, each transform kernel candidate can be a combination of horizontal and vertical transform kernels for separable transforms, and 25 transform kernel candidates with indices of 0 to 24 can be defined.

[0180] [Table 6]

[0181] Table 6 provides examples of the 25 transform kernel candidates described in Table 5. Specifically, the horizontal and vertical transforms of the transform kernel candidates are represented as (horizontal transform, vertical transform). For each transform kernel candidate index, the horizontal / vertical transform when the intra-prediction mode is less than 35 can be the opposite of the horizontal / vertical transform when the intra-prediction mode is greater than or equal to 35. When the value of the intra-prediction mode is greater than or equal to 35, a mode symmetric about mode 34 can be derived, and the MTS set can be selected from Table 4 based on this mode. Additionally, the symmetry of the block shape can be considered. When the original transform block has a size of W×H, by symmetry, the original transform block can be considered to have a size of H×W, and the MTS set can be selected from Table 4. Here, the value of the intra-prediction mode can be a modified value of the intra-prediction mode. That is, as the mode value of WAIP, for values ​​from -14 (or -15) to -1, it is modified to mode 2; for values ​​from 67 to 80 (or 81), it is modified to mode 66; and for the remaining modes, the value of the original intra-prediction mode can be set to the value of the modified intra-prediction mode. In this case, since the extended mode of WAIP is also symmetrically configured with respect to mode 34, the symmetry with respect to mode 34 can be applied to all orientation modes except for planar mode and DC mode.

[0182] For example, when predicting a 16×32 block based on pattern 54, pattern 14 (=68-54) can be derived as a pattern symmetric to pattern 54, and the block size can be considered as 32×16. In this case, an MTS set with index 72 can be selected, as defined in Table 4.

[0183] When applying MIP mode, the MTS set assigned to the MIP mode can be selected based on the current block size, regardless of the block shape symmetry. Alternatively, when applying MIP mode, the block shape symmetry can be considered when selecting the MTS set assigned to the MIP mode based on the size of the symmetrical block. For example, when applying MIP mode to an 8×16 block, the 8×16 block can be considered as a symmetrical 16×8 block, and the MTS set with index 49 can be selected as defined in Table 4. Alternatively, when applying MIP mode, the intra-prediction mode can be considered as a planar mode. In this case, the MTS set assigned to the MIP mode can be selected based on the current block size, regardless of the block shape symmetry. Alternatively, the block shape symmetry can be considered when selecting the MTS set assigned to the MIP mode based on the size of the symmetrical block.

[0184] For MIP mode, a flag can be used to indicate whether MIP mode is applied in transposed mode. When MIP mode is applied to an M×N current block and the flag indicates that transposed mode is applied, the intra-prediction mode can be treated as a planar mode, and the M×N current block can be treated as an N×M block. That is, from Table 4, the MTS set corresponding to an N×M block size and a planar mode can be selected. As described in Table 6, when the value of the intra-prediction mode is greater than or equal to 35, the horizontal and vertical transforms are swapped, but since the intra-prediction mode of the current block is treated as a planar mode, the horizontal and vertical transforms of the transform kernel candidates may not be swapped. Alternatively, when MIP mode is applied to an M×N current block and the flag indicates that transposed mode is applied, the intra-prediction mode may not be treated as a planar mode, and the M×N current block can be treated as an N×M block. That is, from Table 4, the MTS set corresponding to an N×M block size and MIP mode can be selected.

[0185] In Table 5, the transform kernel candidate selected by the transform kernel candidate index can be set as the transform kernel of the current block. Alternatively, based on the size of the current block, at least one of the horizontal or vertical transforms of the selected transform kernel candidate can be changed to another transform kernel. For example, when the transform kernel candidate index is 3 and both the width and height of the current block are less than or equal to 16, at least one of the horizontal or vertical transforms of the transform kernel candidate corresponding to transform kernel candidate index 3 can be changed to another transform kernel. In this case, the horizontal and vertical transforms can be changed independently of each other. When the difference (or the absolute value of the difference) between the value of the intra-prediction mode and the value of the horizontal mode of the current block is less than or equal to a predetermined threshold, the vertical transform of the selected transform kernel candidate can be changed to IDT (identity transform). When the difference (or the absolute value of the difference) between the value of the intra-prediction mode and the value of the vertical mode of the current block is less than or equal to a predetermined threshold, the horizontal transform of the selected transform kernel candidate can be changed to IDT (identity transform). Here, the threshold can be determined based on the width and height of the current block, as shown in Table 7 below.

[0186] [Table 7]

[0187] Table 7 is used to change the horizontal and / or vertical transforms of transform kernel candidates selected by the transform kernel candidate index to another transform kernel, and the threshold is defined according to the size of the transform block.

[0188] The six transform kernel candidates that make up an MTS set can be distinguished by transform kernel candidate indices from 0 to 5, as defined in Table 5. The transform kernel candidate indices can be signaled via a bitstream. A flag indicating whether the MTS set is available / applied (MTS enable flag or MTS flag) can be signaled, and when this flag indicates that the MTS set is available / applied, the transform kernel candidate indices can be signaled. The MTS flag can consist of a bin, and one or more contexts (hereinafter referred to as CABAC contexts) can be assigned to this bin for CABAC-based entropy coding. For example, different CABAC contexts can be assigned to non-MIP mode and MIP mode respectively.

[0189] Based on the context of the current block, the number of transform kernel candidates available for the current block can be set differently. For example, as the context of the current block, the sum of the absolute values ​​of all or some transform coefficients in the current block can be considered. The sum of the absolute values ​​of the transform coefficients is called AbsSum. When AbsSum is less than or equal to T1, only one transform kernel candidate corresponding to transform kernel candidate index 0 may be available. When AbsSum is greater than T1 and less than or equal to T2, four transform kernel candidates corresponding to transform kernel candidate indices 0 to 3 may be available. When AbsSum is greater than T2, six transform kernel candidates corresponding to transform kernel candidate indices 0 to 5 may be available. Here, T1 can be 6 and T2 can be 32, but this is only an example.

[0190] When AbsSum is less than or equal to T1, since the number of transform kernel candidates available for the current block is 1, the transform kernel candidate corresponding to transform kernel candidate index 0 can be set as the transform kernel for the current block without signaling the transform kernel candidate index. When AbsSum is greater than T1 and less than or equal to T2, since four transform kernel candidates are available, one of the four transform kernel candidates can be selected based on the transform kernel candidate index with two bins. That is, transform kernel candidate indices 0 to 3 can be signaled as 00, 01, 10, and 11 respectively. For these two bins, the MSB (most significant bit) can be signaled first, and the LSB (least significant bit) can be signaled later. Different CABAC contexts can be assigned to each bin. For example, a CABAC context other than the CABAC context assigned for the MTS flag can be assigned to each bin of the two bins. Alternatively, bypass coding can be applied without assigning CABAC contexts to the two bins. When AbsSum is greater than T2, the transform kernel candidate index has values ​​from 0 to 5, making it impossible to represent the transform kernel candidate index with only two bins. In this case, the transform kernel candidate index can be represented by assigning two or more bins, for example, by truncating binary encoding. For each bin assigned by the truncated binary encoding method, a CABAC context can be assigned, or bypass encoding can be applied without assigning a CABAC context. Alternatively, a CABAC context can be assigned to some of the multiple bins (e.g., the first bin, or the first and second bins), and bypass encoding can be applied to the remaining bins.

[0191] Implementation Method 3

[0192] The transform kernel of the current block can be determined based on a transform set that includes one or more transform kernel candidates. The transform kernel of the current block can be derived as one of the one or more transform kernel candidates belonging to the transform set.

[0193] The process of determining the transform kernel of the current block may include at least one of 1) determining the transform set of the current block or 2) selecting a transform kernel candidate from the transform set of the current block. The process of determining the transform set may be the process of selecting one of a plurality of identical predefined transform sets in the encoding and decoding devices. Alternatively, the process of determining the transform set may be the process of configuring one or more transform sets available for the current block from a plurality of identical predefined transform sets in the encoding and decoding devices, and selecting one of the configured transform sets. Alternatively, the process of determining the transform set may be the process of configuring a transform set based on transform kernel candidates available for the current block from a plurality of identical predefined transform kernel candidates in the encoding and decoding devices.

[0194] When the transform set of the current block includes multiple transform kernel candidates, the process of selecting one of the multiple transform kernel candidates for the current block can be performed. However, when the transform set of the current block includes only one transform kernel candidate (i.e., when the number of transform kernel candidates available for the current block is 1), the transform kernel of the current block can be set as the corresponding transform kernel candidate.

[0195] The transform set according to this disclosure may refer to the (inseparable) transform set in Embodiment 1 above, or it may refer to the MTS set in Embodiment 2. Alternatively, the transform set may be defined separately from the (inseparable) transform set in Embodiment 1 or the MTS set in Embodiment 2. In this case, the transform set may include one or more specific transform kernels as transform kernel candidates. A specific transform kernel may be defined as a pair of transform kernels for horizontal transformation and a transform kernel for vertical transformation, or it may be defined as a single transform kernel applied equally to both horizontal and vertical transformations.

[0196] In embodiments of this disclosure, the process of applying NSPT (an inseparable transform applied as the master transform) is described in detail. NSPT can be applied to the entire or a portion of a transform block. Based on forward NSPT, residual samples existing in the region where NSPT is applied can be used as 1D vector inputs to NSPT. In other words, residual samples existing in the entirety or a portion of a single transform block (referred to in this disclosure as the region of interest (ROI)) can be collected as 1D vectors and configured as inputs. Then, when forward NSPT is applied, the master transform coefficients can be obtained. Conversely, when backward NSPT is applied to the master transform coefficients, a 1D vector output can be obtained. The residual samples of the ROI can be obtained by arranging the element values ​​of the corresponding output vector at defined positions within the 2D transform block.

[0197] For a non-separable transform kernel used in NSPT, the matrix dimension can be determined based on the size of the Region of Interest (ROI). In this disclosure, the transform kernel can be referred to as a transform type or a transform matrix, and a non-separable transform kernel used in NSPT can be referred to as an NSPT kernel. For example, when the current block is an M×N transform block, the ROI is the entire region of the M×N transform block, and a square NSPT is applied, the dimension of the corresponding transform matrix can be MN×MN. For example, when the ROI is the entire region of an 8×8 transform block, the dimension of the NSPT kernel can be 64×64.

[0198] According to embodiments of this disclosure, when applying NSPT to residuals generated by intra-frame prediction, the NSPT kernel can be adaptively determined based on the intra-frame prediction mode. Since the statistical characteristics of the residual block can vary according to the intra-frame prediction mode, compression efficiency can be improved by adaptively determining the NSPT kernel based on the intra-frame prediction mode.

[0199] A shared NSPT kernel can be configured to be applied to at least one intra-prediction mode. As described above, the set of inseparable transforms can be determined based on the intra-prediction mode and mapping table of the current block. The mapping table can define the mapping relationship between predefined intra-prediction modes and the set of inseparable transforms. The predefined intra-prediction modes can include two non-directional modes and 65 directional modes.

[0200] As an implementation method, intra-prediction modes can be grouped into intra-prediction mode groups. One NSPT kernel can be assigned to an intra-prediction mode group, or multiple NSPT kernels can be assigned. In other words, an inseparable transform set (NSPT set) including at least one NSPT kernel can be assigned to an intra-prediction mode group. The inseparable transform set can be mapped to an intra-prediction mode, and one of the N NSPT kernels included in the inseparable transform set can be selected.

[0201] As an example, intra-prediction groups can include adjacent prediction modes (e.g., modes 17, 18, and 19). Additionally, intra-prediction groups can include modes with symmetry. For example, in Figure 5 above, a directional mode can be symmetrical about a diagonal mode (i.e., intra-prediction mode 34). In this case, two symmetrical modes can be configured as a group (or a pair). For example, modes 18 and 50 can be included in the same group because they are symmetrical about mode 34. However, for symmetrical modes, a process of transposing the 2D input block and then configuring the one-dimensional input vector can be added before applying the feedforward NSPT kernel. For example, when the intra-prediction mode is less than or equal to 34, the one-dimensional input vector can be derived from the corresponding input block in row-major order without transposing the 2D input block. When the intra-prediction mode is greater than 34, the one-dimensional input vector can be configured either by first transposing the 2D input block and then reading the corresponding input block in row-major order, or by keeping the 2D input block as is and reading the corresponding input block in column-major order.

[0202] Table 8 below shows the mapping table for assigning NSPT sets according to intra-prediction modes. Referring to Table 8, a total of 35 NSPT sets from 0 to 34 can be defined. The NSPT set assigned to the most recent general orientation mode can be assigned to the extended WAIP modes (i.e., modes -14 to -1 and modes 67 to 80 in Figure 5). In other words, NSPT set 2 can be assigned to the extended WAIP mode.

[0203] [Table 8]

[0204] The NSPT set may include at least one NSPT core (or core candidate). In other words, the NSPT set may include N NSPT core candidates. As an example, N may be set to a value equal to or greater than 1, such as 1, 2, 3, 4, etc. The core applicable to the current block among the at least one NSPT core included in the NSPT set can be signaled using an index. In this disclosure, the corresponding index may be referred to as the NSPT index. As an example, the NSPT index may have values ​​of 0, 1, 2, ..., N-1.

[0205] Furthermore, as an implementation, when the number of NSPT core candidates is 1, the NSPT index value can be fixed at 0. In this case, the NSPT index can be inferred without a separate signal notification. Additionally, the flag indicating whether to apply NSPT can be signaled separately from the NSPT index. In this disclosure, the corresponding flag can be referred to as the NSPT flag.

[0206] NSPT can be applied when the NSPT flag value is 1. NSPT can be omitted when the NSPT flag value is 0. The NSPT flag value can be inferred to be 0 when no signaling is given. As an example, the NSPT index can be applied when the NSPT flag value is 1. One of the N kernel candidates included in the NSPT set selected by the intra-prediction mode can be specified based on the signaled NSPT index.

[0207] In implementation, the entropy encoding method for the NSPT index can be defined in various ways by taking into account the number (N) of NSPT kernels included in the NSPT set. For example, as a method of mapping values ​​from 0 to N-1 to bin strings (i.e., binarization method), truncated unary binarization, truncated binarization, and fixed-length binarization methods can be used.

[0208] For example, when the number N of kernel candidates in the configured NSPT set is 2, one bin can be used to specify one of the two candidates. For example, 0 can indicate the first candidate, and 1 can indicate the second candidate. Alternatively, when N is 3 and truncated unary binarization is applied, two bins can be used to specify the candidates. For example, the first, second, and third candidates can be binarized as 0, 10, and 11 respectively and signaled concurrently. As an implementation, the binarization bins can be encoded using context encoding or bypass encoding.

[0209] This disclosure describes a Reduced Principal Transform (RPT) method using a dimensionality reduction transform kernel as the principal transform. As described above, when applying forward NSPT, samples belonging to a 2D residual block can be arranged (or rearranged) into 1D vectors according to row-major order (or column-major order). The transformation matrix used for NSPT can then be multiplied by the arranged vectors. When the corresponding 2D residual block is an M×N block (M is the horizontal length, N is the vertical length), the length of the rearranged 1D vector can be M. N. In other words, the corresponding 2D residual block can also be represented as M. An N×1 dimensional column vector. In this disclosure, for convenience, M... N can be represented as MN. In this case, the dimension of the corresponding transformation matrix can be MN×MN. In summary, the forward NSPT can be performed by multiplying the left side of the MN×1 vector by the corresponding MN×MN transformation matrix to obtain the MN×1 transformation coefficient vector.

[0210] When applying RPT, the r transformation coefficients can be obtained by multiplying by an r×MN matrix instead of an MN×MN matrix as the aforementioned forward NSPT transformation matrix. Here, r represents the number of rows in the transformation matrix, and MN represents the number of columns in the transformation matrix. According to the embodiments of this disclosure, the value of r can be set to be less than or equal to MN. In other words, the existing forward NSPT transformation matrix includes MN rows, and each row consists of 1×MN row vectors and the corresponding transformation basis vectors of the NSPT transformation matrix. The corresponding transformation coefficients can be obtained by multiplying each transformation basis vector by MN×1 sample column vectors.

[0211] Since the existing forward NSPT transformation matrix consists of MN row vectors, MN transformation coefficients (i.e., MN×1 transformation coefficient column vectors) can be obtained by applying forward NSPT. Furthermore, for forward RPT, the transformation matrix can consist of r transformation basis vectors instead of MN transformation basis vectors. Therefore, when applying forward RPT, r transformation coefficients (r×1 transformation coefficient column vectors) can be obtained instead of MN.

[0212] The RPT kernel can be configured by selecting r transform basis vectors as partial transform basis vectors for configuring the MN×MN forward NSPT kernel. In this disclosure, the transform kernel can be referred to as a transform type or transform matrix, and the inseparable transform kernel used for NSPT can be referred to as the RPT kernel. In other words, when selecting r 1×MN row vectors from the MN×MN forward NSPT kernel, it may be advantageous from a coding performance perspective to select the most important transform basis vectors. Specifically, in terms of energy concentration through the transform, by multiplying by the forward NSPT transform matrix, more energy can be concentrated on the first-appearing transform coefficients. In other words, the transform basis vectors located at the top of the forward NSPT transform matrix can generate transform coefficients with greater energy. With this in mind, the r×MN forward RPT kernel can be configured (or derived) by taking r from the top of the forward NSPT kernel.

[0213] According to this disclosure, the RPT only takes a portion (i.e., r) of the transform coefficients obtained by applying the existing NSPT; therefore, the energy of the original signal may be partially lost. In other words, distortion between the original signal and the natural signal may occur through correspondence processing. However, since only r transform coefficients are generated by applying the RPT instead of MN, the number of bits required to encode the corresponding transform coefficients can be reduced. Therefore, for signals with a large amount of energy concentrated on a small number of transform coefficients (e.g., image residual signals), the gain obtained by reducing signaling bits can be significantly large, thereby improving coding performance.

[0214] The backward NSPT is a transformation matrix, and can be the transpose of the aforementioned forward NSPT kernel. In this case, the input data can be the transform coefficient signal, rather than a sample signal such as a residual signal. Specifically, when the forward NSPT transformation matrix is ​​G and the sample signal rearranged into a 1D vector is x, the transform coefficient vector obtained by multiplying the corresponding transformation matrix by the left side can be represented as shown in Equation 4 below.

[0215] [Formula 4]

[0216] y=Gx

[0217] Referring to Equation 4, x and y can be MN×1 column vectors. G can be in the form of an MN×MN matrix. The backward NSPT processing can be represented using the same variables as in Equation 5 below.

[0218] [Formula 5]

[0219] x=G T y

[0220] In Equation 5, G TThis refers to the transpose of G. The forward RPT and backward RPT operations according to this disclosure can also be represented by these two equations. However, when RPT is applied, y is an r×1 column vector instead of an MN×1 column vector, and G is an r×MN matrix instead of an MM×MN matrix. In other words, even when RPT is applied instead of NSPT, the dimension of the sample signal (e.g., the image residual signal) does not change, which may mean that the original number of sample signals (i.e., the MN sample signal) can be reconstructed using only r transform coefficients via backward RPT. In other words, the original MN sample signal can be reconstructed by encoding only r transform coefficients less than MN, which improves coding performance.

[0221] In embodiments of this disclosure, an RPT structure is proposed that defines the value of r by considering the statistical properties of the residual block and derives a residual block of the existing transform block size from a residual block of reduced size determined according to the defined value of r. If another additional transformation (i.e., a quadratic transformation) is applied to predict the statistical distribution of the master transform coefficients, quantization is applied to the master transform coefficients, so that the quantized non-zero coefficients can be concentrated in a relatively low-frequency domain. Therefore, the reduced quadratic transformation of the statistical distribution of the master transform coefficients can define the statistical properties of the master transform coefficients relatively simply by setting the value of r for a given low-frequency domain. However, the RPT according to this disclosure differs fundamentally from the reduced quadratic transformation, which defines the value of r by considering the statistical properties of samples within the residual block whose properties are very different from the distribution of the master transform coefficients. Hereinafter, various embodiments for determining the RPT kernel as the dimension reduction transform matrix are described. In other words, methods for determining or defining the value of r in the RPT are described below.

[0222] In embodiments of this disclosure, the value of r in the RPT can be determined by considering the worst-case complexity allowed by the transformation system. As an implementation, the worst-case complexity can be calculated based on the number of multiplications per sample. MN is required. The RPT is applied in both the forward and backward directions based on an M×N block using r multiplications. Since the 2D block consists of a total of MN samples, the number of multiplications per sample can be calculated as (MN... r) / MN = r. Therefore, the value of r can be configured to remain less than or equal to the maximum number of multiplications allowed per sample. For example, when the maximum possible number of multiplications per sample is set to 16 for a 16×16 block, the value of r can be determined to be less than or equal to 16. In other words, the forward RPT kernel can be set to 16×256.

[0223] In another implementation, memory usage can be considered a measure of worst-case complexity. As an example, the allowed memory size per core can be set. For instance, when each core coefficient requires p bytes (in this disclosure, the individual elements configuring the transform core are referred to as core coefficients) and memory usage is set to be less than or equal to q bytes per core, the value of r can be set to be less than or equal to q / (MN). p). For example, when for a 16×16 block forward RPT core, p is 1 byte, and memory usage is set to less than or equal to 8KB per core (q = 8 KB = 2). 13 When the value of r is less than or equal to 32 bytes, the value of r can be set to less than or equal to 32 bytes.

[0224] Additionally, as another example, memory usage and / or the number of multiplications per sample can be considered as a measure of worst-case complexity. For instance, when the maximum possible number of multiplications per sample is set to 16 for a 16×16 block, and memory usage is set to less than or equal to 8KB per core (the core coefficient is represented as 1 byte), the value of r can be set to less than or equal to 16.

[0225] Furthermore, in the implementation, the value of 'r' for configuring the RPT core can be determined by specific information. In other words, the value of 'r' for configuring the RPT core can be determined based on predefined coding parameters. For example, the value of 'r' can be determined based on the block size. In other words, the RPT core can be variably determined based on the block size. Here, the block can be at least one of a coding block, a transform block, and a prediction block. Additionally, for example, the value of 'r' can be determined based on prediction information. Here, prediction information can include information about inter-frame / intra-frame prediction, intra-frame prediction mode information, etc. Additionally, for example, the value of 'r' can be determined based on signaling notification information (the value of the syntax element). For example, the value of 'r' can be variably determined based on the quantization parameter value. Furthermore, regarding complexity improvement, a fixed value predefined as the value of 'r' can be used, and this predefined fixed value can be determined based on the signaling notification information.

[0226] When the sample signal is multiplied by the RPT kernel r×MN, r transform coefficients are obtained. These r transform coefficients can be arranged according to a predefined scan order (e.g., forward / backward zigzag scan order, forward / backward horizontal scan order, forward / backward vertical scan order, forward / backward diagonal scan order, scan order specified based on the intra-frame prediction mode, etc.). When the transform coefficients obtained by applying the forward RPT are arranged according to this scan order (e.g., a scan order in units of coefficient groups (CGs) can also be applied), if the value of r is less than MN, the interior of the M×N block may not be completely filled by the r transform coefficients, thus potentially resulting in blank spaces. As an embodiment of this disclosure, the characteristics of the residual signal can be considered to predict the aforementioned blank spaces in the following manner.

[0227] - You can fill the blank space with the values ​​of available neighboring pixels.

[0228] - The value of the blank space can be filled based on the values ​​of available neighboring pixels and the intra-prediction mode. For example, the value of the blank space can be predicted by performing intra-prediction based on the values ​​of available neighboring pixels and the intra-prediction mode.

[0229] - You can fill empty spaces with predefined fixed values ​​(e.g., 0).

[0230] - Values ​​can be used to fill the blank space from available neighboring pixels by using a predetermined intra-frame prediction mode (e.g., planar mode).

[0231] In this disclosure, filling the blank space with 0 in the above example can be referred to as zeroing. When filling the blank space with 0, the following implementation can be applied. When a non-zero transform coefficient is detected (or resolved) in the corresponding blank space portion during the resolution of transform coefficients on the decoding device side, it can be considered (or inferred) that RPT is not applied. In other words, when a non-zero transform coefficient exists in a predefined region representing the corresponding blank space, it can be considered that RPT is not applied. In this case, signaling (or resolution) indicating whether RPT is applied and / or specifying an index of one of a plurality of RPT core candidates may not be executed. As an example, when a non-zero transform coefficient exists in a predefined region representing the corresponding blank space, the predefined variable value can be updated, and it can be inferred that RPT is not applied based on the updated variable value.

[0232] In embodiments of this disclosure, the application of RPT can be determined based on the size and / or form of the block. Furthermore, the RPT kernel can be determined differently depending on the size and / or form of the block. Since the value of r can vary depending on the size and / or form of the block (i.e., for individual M×N blocks), the blank space can also vary depending on the size and / or form of the block. Therefore, regions for checking whether non-zero transform coefficients are detected can be defined differently for blocks of different sizes and / or forms. In other words, zeroing regions can be determined differently.

[0233] As an example, when a 16×64 matrix is ​​applied as the forward RPT matrix for an 8×8 block, the value of r can be 16. In this case, when CG is a 4×4 sub-block, only the top-left 4×4 block can be filled with non-zero RPT transform coefficients, while the remaining three 4×4 sub-blocks (i.e., the top-right, bottom-left, and bottom-right sub-blocks) can be filled with values ​​of 0. In this case, when non-zero transform coefficients are detected in the corresponding remaining three 4×4 sub-block regions during decoding, it can be considered that RPT is not applied. Furthermore, as mentioned above, a flag indicating whether RPT is applied or an index of one of multiple RPT core candidates can be specified without signaling.

[0234] Additionally, as an example, when a 32×128 matrix is ​​applied as the forward RPT matrix for a 16×8 block (i.e., the value of r is 32) and the CG is a 4×4 sub-block, only the two CGs in the scan order can be filled with non-zero RPT transform coefficients. For example, the top-left 4×4 sub-block and the 4×4 sub-block adjacent to the bottom of the top-left sub-block can be filled with the corresponding RPT transform coefficients. The area filled with 0 as blank space can be determined as the remaining area besides the corresponding two 4×4 sub-blocks. The RPT kernel can be determined differently depending on the size and / or form of the block, and as described, the blank space can be determined differently for 8×8 blocks and 16×8 blocks.

[0235] As an implementation method, when the value of r is a multiple of the CG size and the transform coefficients are scanned in units of CGs, if a non-zero transform coefficient is detected in a CG belonging to a blank space, the flags and / or indices related to RPT do not need to be signaled. In other words, the transform coefficients within each CG can be scanned in a specified order, and the scanning order can be followed by moving to the next CG in units of CG and scanning the transform coefficients within the CG in the same way. In existing image compression techniques, since a flag indicating the presence of non-zero transform coefficients in the corresponding CG is first signaled for each CG, it is possible to determine whether to apply RPT using only the corresponding information, which reduces signaling overhead and related implementation complexity.

[0236] As described above, when applying RPT, if a non-zero transform coefficient is detected in a zero-filled blank space region, RPT may not be applied. In this case, signaling related to RPT information can be omitted. However, since it cannot be determined whether to apply RPT when no non-zero transform coefficient is detected in the corresponding blank space region, the flag indicating whether RPT is applied can be parsed after parsing (or signaling) the relevant transform coefficients to finally determine whether RPT is applied.

[0237] As an implementation method, a forward quadratic transform can be applied to the transform coefficients generated by applying the RPT. Alternatively, a forward quadratic transform can be applied to the region containing the generated transform coefficients in the M×N block. In this disclosure, from the perspective of the forward quadratic transform, the corresponding region or a portion of the corresponding region can be referred to as a Region of Interest (ROI). For the backward direction, a backward quadratic transform can be applied first, followed by a backward RPT. Specifically, a region containing r transform coefficients generated by applying the forward RPT, or a portion of the corresponding region, can be designated as an ROI to apply the forward quadratic transform. In this case, when a 16×64 forward RPT transform matrix is ​​applied to an 8×8 region, the 16 generated transform coefficients can be located in the upper left 4×4 sub-block, and the corresponding sub-block region can be designated as an ROI to apply the forward quadratic transform to the corresponding ROI.

[0238] Furthermore, the RPT kernel can adjust coefficient values ​​by incorporating operations such as integer or fixed-point arithmetic. In other words, the RPT kernel can be configured to perform transformations in a practical encoding / decoding system via integer (or fixed-point) arithmetic by appropriately scaling the kernel coefficients belonging to the corresponding kernel (rather than theoretically orthogonal or non-orthogonal transformations (where orthogonal and non-orthogonal transformations refer to transformations where the norm of each transform basis vector is 1)). Even when applying RPT, it can be reflected as equivalently as multiplying by a scaling factor when applying separable transformations in existing image compression techniques. In this case, separable or non-separable transformations (including RPT) can be performed while maintaining other processing besides the transformation (e.g., quantization and dequantization).

[0239] The integer coefficients of the RPT kernel can be obtained by multiplying the transform basis vector by the scaling value described above. As an implementation, multiplying by the scaling value may include applying operations such as rounding, flooring, and flooring to each kernel coefficient. In other words, an integer RPT kernel obtained by the above method can be defined and used for transform / inverse transform processing. As mentioned above, when the scaled integer kernel coefficients are obtained through operations such as rounding, flooring, and flooring, the maximum and minimum values ​​can be obtained for all kernel coefficients, thus providing a sufficient number of bits to represent all kernel coefficients. For example, when the maximum value is less than or equal to 127 and the minimum value is greater than or equal to -128, all integer kernel coefficients can be represented in 8 bits (especially through a complement expression of 2, etc.).

[0240] Typically, when the maximum value is less than or equal to (2) (N-1) -1) and the minimum value is greater than or equal to -2. (N-1) When all integer kernel coefficients can be represented by N bits, when the maximum value is greater than (2^N, ... (N-1) -1) or the minimum value is less than -2 (N-1) At this point, it may be impossible to represent all integer kernel coefficients with N bits. In this case, 1) all kernel coefficients can be multiplied by a scaling value to adjust them to fall within the N-bit range, or 2) the number of bits required to represent the kernel coefficients can be increased (i.e., N+1 bits or more). When all kernel coefficients need to be multiplied by 2... -p (p>=1) When representing them with N bits, it can be done by multiplying by 2 afterwards. -p To compensate for them, so that they can be integrated into the existing encoding / decoding process. As an implementation, multiply by 2. p This can be achieved by performing an additional left shift operation of p bits or by reducing the right shift amount applied in the quantization or dequantization process by p.

[0241] The above method can be used to represent all kernel coefficients in 8 bits, 9 bits, 10 bits, etc. Of course, the scaling value of the kernel coefficients can be set for different block sizes or kernels, and the number of bits used to represent the kernel coefficients can be set differently.

[0242] The above-described NSPT can be applied based on at least one of the current block size, tree type, or component type. As an example, it can be determined whether to apply NSPT based on at least one of the current block size, tree type, or component type. The NSPT index can be signaled based on at least one of the current block size, tree type, or component type. The NSPT set or NSPT kernel can be derived based on at least one of the current block size, tree type, or component type.

[0243] The predefined allowed transform block sizes in the decoding device can be broadly divided into two groups. Either group (hereinafter referred to as the first group) can refer to the set of block sizes to which NSPT applies. The first group can consist of any one allowed transform block size, or it can consist of two or more allowed block sizes. The block size to which NSPT applies can be defined as a block size where at least one of the width and height is less than or equal to a predetermined threshold. Alternatively, the block size to which NSPT applies can be defined as a block size where the product of the width and height is less than or equal to a predetermined threshold. Alternatively, the block size to which NSPT applies can be defined as a block size where the maximum value of the width and height is less than or equal to a predetermined threshold. The threshold can be an integer of 4, 8, 16, 32, 64, 128, or greater.

[0244] The other group (hereinafter referred to as the second group) may refer to the set of block sizes for which NSPT is not applied. The aforementioned separable principal transformation can be applied to the block sizes belonging to the second group. Alternatively, the non-separable quadratic transformation can be applied to all or some of the block sizes belonging to the second group.

[0245] For example, when the current block size belongs to the first group, a backward NSPT can be applied to the (dequantized) transform coefficients of the current block. When the current block size belongs to the second group, a backward separable principal transform can be applied to the (dequantized) transform coefficients of the current block. Alternatively, when the current block size belongs to the second group, a backward non-separable quadratic transform (e.g., the low-frequency non-separable transform LFNST) can be applied to the (dequantized) transform coefficients of the current block first, and a backward separable principal transform (e.g., DCT-2) can be applied to the transform coefficients obtained therefrom.

[0246] For example, as a set of block sizes to which NSPT applies, the first group can be defined as a set of 4×4, 4×8, 8×4, and 8×8. Alternatively, the first group can be defined as a set of 4×8, 8×4, and 8×8. Alternatively, the first group can be defined as a set of 4×8 and 8×4. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 8×4, 8×8, and 16×4. Alternatively, the first group can be defined as a set of 4×8, 4×16, 8×4, 8×8, and 16×4. Alternatively, the first group can be defined as a set of 4×8, 4×16, 8×4, and 16×4. Alternatively, the first group can be defined as a set of 4×4, 4×8, 8×4, 8×8, 8×16, 16×8, and 16×16. Alternatively, the first group can be defined as a set of 4×4, 4×8, 8×4, 8×8, 8×16, and 16×8. Alternatively, the first group can be defined as a set of 4×8, 8×4, 8×8, 8×16, and 16×8. Alternatively, the first group can be defined as a set of 4×8, 8×4, 8×16, 16×8, 16×16, 16×32, 32×16, and 32×32. Alternatively, the first group can be defined as a set of 4×4, 4×8, 8×4, 8×8, 8×16, 16×8, 16×16, 16×32, and 32×16. Alternatively, the first group can be defined as a set of 4×8, 8×4, 8×8, 8×16, 16×8, 16×16, 16×32, and 32×16. Alternatively, the first group can be defined as a set of 4×8, 8×4, 8×16, 16×8, 16×16, 16×32, and 32×16. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 8×4, and 16×4. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 8×4, 8×8, 8×16, 16×4, and 16×8. Alternatively, the first group can be defined as a set of 4×8, 4×16, 8×4, 8×8, 8×16, 16×4, and 16×8. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 8×4, 8×16, 16×4, and 16×8. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 8×4, 8×8, 8×16, 16×4, 16×8, and 16×16. Alternatively, the first group can be defined as a set of 4×8, 4×16, 8×4, 8×8, 8×16, 16×4, 16×8, and 16×16.Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 8×4, 8×16, 16×4, 16×8, and 16×16. Alternatively, the first group can be defined as a set of 4×8, 4×16, 8×4, 8×16, 16×4, 16×8, and 16×16. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 4×32, 8×4, 8×16, 8×32, 16×4, 16×8, 32×4, and 32×8. Alternatively, the first group can be defined as a set of 4×8, 4×16, 4×32, 8×4, 8×16, 8×32, 16×4, 16×8, 32×4, and 32×8. The first group can be defined as a set of 4×4, 4×8, 4×16, 4×32, 8×4, 8×8, 8×16, 8×32, 16×4, 16×8, 16×16, 32×4, and 32×8. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 4×32, 8×4, 8×8, 8×16, 8×32, 16×4, 16×8, 16×32, 32×4, 32×8, and 32×16. Alternatively, the first group can be defined as a set of 4×4, 4×8, 4×16, 4×32, 8×4, 8×8, 8×16, 8×32, 16×4, 16×8, 16×16, 16×32, 32×4, 32×8, and 32×16. Alternatively, the first group can be defined as the set of 4×8, 4×16, 4×32, 8×4, 8×16, 8×32, 16×4, 16×8, 16×32, 32×4, 32×8, and 32×16. Alternatively, the first group can be defined as the set of 4×4, 4×8, 4×16, 4×32, 8×4, 8×8, 8×16, 8×32, 16×4, 16×8, 16×16, 16×32, 32×4, 32×8, 32×16, and 32×32.

[0247] An NSPT matrix (or NSPT kernel) with a predetermined dimension can be applied to the block size belonging to the first group. Here, the NSPT matrix can be represented as a P×Q dimensional matrix as the backward transformation matrix, where the P×Q matrix represents a matrix with P rows and Q columns, respectively.

[0248] As examples, a 16×16 NSPT matrix can be applied to a 4×4 block. A 32×20 NSPT matrix can be applied to at least one of a 4×8 block or an 8×4 block. A 64×24 NSPT matrix can be applied to at least one of a 4×16 block or a 16×4 block. A 64×32 NSPT matrix can be applied to an 8×8 block. A 128×40 NSPT matrix can be applied to at least one of an 8×16 block or a 16×8 block. A 256×44 NSPT matrix can be applied to a 16×16 block. A 128×36, 128×38, or 128×40 NSPT matrix can be applied to a 4×32 block or a 32×4 block. A 256×48 NSPT matrix can be applied to an 8×32 block or a 32×8 block. A 512×52 or 512×54 NSPT matrix can be applied to a 16×32 block or a 32×16 block.

[0249] Since the P×Q matrix is ​​a backward NSPT matrix, the P×1 output vector can be obtained by applying the P×Q matrix to the Q×1 input vector (i.e., (P×Q matrix) × (Q×1 input vector)). Here, the Q×1 input vector can correspond to the (dequantized) transform coefficients for which NSPT is applied within the current block. In this case, the value of Q can refer to the number of transform coefficients for which NSPT is applied, and can be less than or equal to the product of the width and height of the current block. The value of Q can be variably determined based on the size of the current block within the first group of block sizes mentioned above. Alternatively, the value of Q can be set to be equal to the block sizes within the first group. The P×1 output vector can correspond to the residual signal (or decoded residual sample). The value of P can be equal to the product of the width and height of the current block.

[0250] Conversely, the forward NSPT matrix can be represented as a Q×P matrix, which is the transpose of the P×Q matrix. A Q×1 output vector can be obtained by applying the Q×P matrix to the P×1 input vector (i.e., (Q×P matrix)×(P×1 input vector)). Here, the P×1 input vector can correspond to the residual samples in the current block to which NSPT is applied. The value of P can be equal to the product of the width and height of the current block. The Q×1 output vector can correspond to the transform coefficients derived by NSPT in the current block. In this case, the value of Q can refer to the number of transform coefficients output by NSPT and can be less than or equal to the product of the width and height of the current block. Similarly, the value of Q can be variably determined based on the size of the current block belonging to the first group of block sizes described above. Alternatively, the value of Q can be set for blocks of equal size belonging to the first group.

[0251] As in the example, NSPT can be applied to M×N blocks and N×M blocks that are non-square blocks. For example, NSPT can be applied to 4×8 blocks and 8×4 blocks. Alternatively, NSPT can be applied to 4×16 blocks and 16×4 blocks, or NSPT can be applied to 8×16 blocks and 16×8 blocks, or NSPT can be applied to 16×32 blocks and 32×16 blocks.

[0252] By applying NSPT to a specific block size belonging to the first group, the transformation can be performed in a more complex manner, and coding performance can be improved. When applying forward LFNST, the transform coefficients of the principal transform in the remaining region except the region where LFNST is applied (i.e., the region of interest, ROI) can be zeroed. Furthermore, LFNST can consist of a small number of transform basis vectors. In this case, performance degradation may occur when separable principal transforms such as DCT-2 and non-separable quadratic transforms such as LFNST are applied to the corresponding block size instead of NSPT. When applying NSPT instead of LFNST for the corresponding case, the zeroing process is omitted, and coding performance is improved compared to the case of applying LFNST. Additionally, performance improvement can be expected with the application of NSPT. NSPT or LFNST can be applied using the following symmetry. Here, for LFNST, the symmetry is used only for the ROI region to perform the transpose operation on the corresponding input block. On the other hand, for NSPT, the symmetry is used to perform the transpose operation on the entire block. Therefore, for NSPT, a more complex symmetry can be used to train and apply the corresponding NSPT kernel, thus performance improvement can be expected.

[0253] Furthermore, when applying LFNST instead of NSPT to an 8×8 block, a 32×64 transform matrix can be used instead of a 16×64 transform matrix from the perspective of forward transform. This can be achieved by configuring the 16×64 transform matrix using the top 16 rows of samples. When LFNST based on a 16×64 transform matrix is ​​applied to an 8×8 block, 16 multiplications are required per sample to apply LFNST, but when using a 32×64 transform matrix, 32 multiplications are required per sample. However, when using a 32×64 transform matrix in this way, an improvement in coding performance can be expected.

[0254] When the current block's tree type is single-tree, NSPT can be applied to the luma component of the current block, but not to the chroma component. When the current block's tree type is dual-tree, NSPT can be applied to both the luma and chroma components of the current block.

[0255] Alternatively, regardless of whether the current block's tree type is single-tree, NSPT can be applied to the luma component of the current block, but not to the chroma component. Alternatively, regardless of whether the current block's tree type is single-tree, NSPT can be applied to both the luma and chroma components of the current block.

[0256] As an example, when the current block's tree type is single-tree, NSPT is allowed for both the luma and chroma components, and the current block size belongs to the first group, an NSPT index can be signaled, and the luma and chroma components of the current block can share the corresponding NSPT index. Here, the NSPT index can be an index used to select any transform kernel candidate for NSPT. When the luma and chroma block sizes of the current block belong to the first group, the transform kernel candidate selected by the same NSPT index can be applied to both the luma and chroma components. When the current block's tree type is single-tree and NSPT is applied only to the luma component, LFNST can be omitted from the application of NSPT to the chroma component of the current block, and a separate transform can be applied. Alternatively, when the current block's tree type is single-tree and NSPT is applied only to the luma component, LFNST can be applied to the chroma component of the current block.

[0257] In a single-tree configuration, there may be a high correlation between the luma and chroma components. In this case, unnecessary signaling can be reduced and compression efficiency can be improved by applying NSPT only to the luma component or by applying transform kernel candidates selected by a single NSPT index to both the luma and chroma components. On the other hand, for non-single-tree configurations, the luma and chroma components have independent partitioning and coding structures. In this case, by signaling the NSPT index of each component, the characteristics of each component can be reflected and compression efficiency can be improved.

[0258] The NSPT kernel for NSPT can be derived based on at least one of symmetry between intra-prediction modes or symmetry between block shapes. As an example, the NSPT kernel can be derived as an NSPT kernel corresponding to at least one of a mode symmetric to the intra-prediction mode of the current block or a block shape symmetric to the block shape of the current block. Alternatively, the NSPT kernel can be derived based on an NSPT set including one or more NSPT kernel candidates, wherein the NSPT set can be derived as an NSPT set corresponding to at least one of a mode symmetric to the intra-prediction mode of the current block or a block shape symmetric to the block shape of the current block. Any one of the one or more NSPT kernel candidates belonging to the NSPT set can be set as the NSPT kernel for the current block. For this purpose, an NSPT index specifying any one of the one or more NSPT kernel candidates belonging to the NSPT set can be used. The NSPT index can be notified by bitstream signaling or can be derived based on the aforementioned symmetries.

[0259] Symmetry may exist between at least two intra-prediction modes among the predefined intra-prediction modes in the decoding device. For ease of description, the symmetry about the top-left diagonal mode (i.e., mode 34) will be described below. Referring to Figure 5, symmetry exists between directional modes. All modes except the planar mode (number 0) and the DC mode (number 1) have a prediction direction. Modes 2 through 66 may be referred to as normal directional modes (represented as [2, 66]), modes -14 through -1 (represented as [-14, -1]), and modes 67 through 80 (represented as [67, 80]) may be referred to as wide directional modes. Wide directional modes may include at least one of a mode with a value less than -14 or a mode with a value greater than 80. Referring to Figure 5, all modes except mode 0 and mode 1 are symmetrical about mode 34. Specifically, for pattern [2, 66], pattern x is symmetric to pattern (68-x), and between patterns [-14, -1] and [67, 80], pattern x is symmetric to pattern (66-x). The same symmetry relation can be established between patterns [N, -1] and [67, 66-N]. Here, N can be an integer less than or equal to -14.

[0260] Furthermore, regarding the symmetry between block shapes, M×N blocks and N×M blocks can be defined as blocks that are symmetrical to each other. Here, M and N can be the same or different from each other. Alternatively, M1×N1 blocks and M2×N2 blocks can be defined as blocks that are symmetrical to each other when the width-to-height ratio (M1 / N1) of M1×N1 block is the same as the height-to-width ratio (N2 / M2) of M2×N2 block. Alternatively, M1×N1 blocks and M2×N2 blocks can be defined as blocks that are symmetrical to each other when the width-to-height ratio (M1 / N1) of M1×N1 block is the same as the height-to-width ratio (M2 / N2) of M2×N2 block.

[0261] Within a square block, mutually symmetrical patterns can share at least one of the NSPT set, NSPT index, or NSPT kernel. In other words, at least one of the NSPT set, NSPT index, or NSPT kernel of any symmetrical pattern can be equally applied to another symmetrical pattern.

[0262] As an example, mutually symmetrical patterns can share a single NSPT kernel. However, for one symmetrical pattern, the corresponding NSPT kernel can be applied to the input data, while for another symmetrical pattern, the corresponding NSPT kernel can be applied after applying a transpose operation to the input data. Specifically, when pattern x belongs to pattern [2, 33], a 1D vector can be configured for the M×M block of input data in column-major order for pattern x, and the NSPT kernel can be applied to the corresponding 1D vector. Here, configuring the 1D vector in column-major order involves reading the input data column by column from the M×M block of input data to obtain M columns, and arranging them sequentially to configure the 1D vector. On the other hand, a 1D vector can be configured in row-major order for the pattern (68-x) that is symmetrical to pattern x, and the same corresponding NSPT kernel can be applied to the corresponding 1D vector. Here, configuring the 1D vector in row-major order involves reading the input data row by row from the M×M block of input data to obtain M rows, and arranging them sequentially to configure the 1D vector. When mode x belongs to mode [N, -1] (N≤-14), 1D vectors can be configured in row priority order for the mode (66-x) that is symmetrical to mode x, and the same NSPT kernel as mode x can be applied to the corresponding 1D vector. Column priority or row priority order can be applied to modes 0 and 1, and can also be applied to mode 34. Additionally, row priority order can be applied to intra-prediction modes belonging to mode [2, 33], and column priority order can be applied to modes symmetrical to the corresponding intra-prediction modes. Row priority order can be applied to intra-prediction modes belonging to mode [N, -1], and column priority order can be applied to modes symmetrical to them.

[0263] For non-square blocks, in addition to the symmetry between intra-prediction modes, the symmetry between block shapes can also be considered. A non-square block with width and height of M and N can be considered to have a symmetric relationship with other non-square blocks with width and height of N and M. As an example, in mode [2, 66], symmetry can exist between mode x of an M×N block and mode (68-x) of an N×M block. Similarly, when mode x of an M×N block belongs to mode [N, -1] (N≤-14), symmetry can exist between mode x of an M×N block and mode (66-x) of an N×M block.

[0264] The method for configuring a 1D vector from the input data block is as described above. In other words, when column priority is applied to pattern x, row priority can be applied to the pattern that is symmetrical to it. Alternatively, when row priority is applied to pattern x, column priority can be applied to the pattern that is symmetrical to it. Specifically, when column priority is applied to pattern x, M columns can be obtained by reading input data from the M×N block as input data in column units, and these columns can be arranged sequentially to configure a 1D vector. Here, each column can have a length N. For the pattern symmetrical to pattern x, N rows can be obtained by reading input data from the M×N block as input data in row units, and these rows can be arranged sequentially to configure a 1D vector. Here, each row can have a length M. Alternatively, when row priority is applied to pattern x, N rows can be obtained by reading input data from the M×N block as input data in row units, and these rows can be arranged sequentially to configure a 1D vector. Here, each row can have a length M. For a pattern symmetric to pattern x, M columns can be obtained by reading input data column by column from an M×N block of input data, and these columns can be arranged sequentially to configure a 1D vector. Here, each column can have a length N.

[0265] When the current block is an M×N block with mode x and the aforementioned symmetry is applied to the current block, the NSPT set and / or NSPT kernel of the current block can be determined based on at least one of an intra-prediction mode symmetric to mode x or an N×M block size symmetric to the M×N block size. Here, the NSPT kernel can be set to the NSPT kernel of an N×M block, rather than the NSPT kernel of an M×N block. In other words, when the symmetry is applied to the current block, the NSPT set and / or NSPT kernel of blocks symmetric to the current block can be used in the same manner. As described above, 1D vectors can be configured from the input data block according to a predetermined priority that corresponds to the input of the NSPT kernel.

[0266] Additionally, there may be a restriction that symmetry is only used when the value of the intra-prediction mode of the current block is greater than 34. In other words, when the value of the intra-prediction mode of the current block is greater than 34, a transpose operation can be applied when configuring 1D vectors from the input data block, and an NSPT set or NSPT kernel corresponding to the block shape and / or mode with symmetry to the current block can be used. Specifically, when the intra-prediction mode of the current block belongs to mode [N, -1] and mode [2, 34], symmetry may not be used for the current block. On the other hand, when the intra-prediction mode of the current block belongs to mode [35, 66] and mode [67, 66-N], symmetry may be used for the current block. Here, N can be an integer less than or equal to -14.

[0267] The symmetry-based derivation of the NSPT set or NSPT kernel can be performed adaptively based on the size of the current block. As an example, for 4×4 blocks and 8×8 blocks, the symmetry-based derivation of the NSPT set or NSPT kernel is possible, but for 4×8 blocks and 8×4 blocks, it may not be possible to derive the NSPT set or NSPT kernel based on the symmetry.

[0268] The number of available NSPT sets can vary depending on whether symmetry is used. For example, when symmetry is used, the number of available NSPT sets can be 35, while when symmetry is not used, the number of available NSPT sets can be 67.

[0269] Table 9 below provides examples of using symmetry to determine the NSPT set and shows the mapping between the NSPT set and the intra-prediction mode when the number of available NSPT sets is 35.

[0270] [Table 9]

[0271] Referring to Table 9, when the value (X) of the intra-prediction mode of the current block is less than 0, the NSPT set of the current block can be determined as the NSPT set with NSPT set index 2 out of 35 NSPT sets. When the value (X) of the intra-prediction mode of the current block is greater than or equal to 0 and less than or equal to 34, the NSPT set of the current block can be determined as the NSPT set with NSPT set index X out of 35 NSPT sets. When the value (X) of the intra-prediction mode of the current block is greater than or equal to 35 and less than or equal to 66, the NSPT set of the current block can be determined as the NSPT set with NSPT set index (68-X) out of 35 NSPT sets. When the value (X) of the intra-prediction mode of the current block is greater than or equal to 35 and less than or equal to 66, the NSPT set of the current block can be the same as the NSPT set with value (68-X) corresponding to the mode symmetrical to the intra-prediction mode of the current block. Similarly, when the value (X) of the intra-prediction mode of the current block is greater than 66, the NSPT set of the current block can be determined as the NSPT set with NSPT set index 2 among the 35 NSPT sets. When the value (X) of the intra-prediction mode of the current block is greater than 66, the NSPT set of the current block can be the same as the NSPT set corresponding to the mode symmetrical to the intra-prediction mode of the current block.

[0272] Table 10 below provides an example of determining the NSPT set without using symmetry, and shows the mapping between the NSPT set and the intra-prediction mode when the number of available NSPT sets is 67.

[0273] [Table 10]

[0274] Referring to Table 10, when the value (X) of the intra-prediction mode of the current block is less than 0, the NSPT set of the current block can be determined as the NSPT set with NSPT set index 2 out of 67 NSPT sets. When the value (X) of the intra-prediction mode of the current block is greater than or equal to 0 and less than or equal to 66, the NSPT set of the current block can be determined as the NSPT set with NSPT set index X out of 67 NSPT sets. Similarly, when the value (X) of the intra-prediction mode of the current block is greater than 66, the NSPT set of the current block can be determined as the NSPT set with NSPT set index 66 out of 67 NSPT sets.

[0275] Symmetry can be used to save memory size required to store transform kernels while maintaining performance depending on the application of the transform. For example, when using 35 NSPT sets instead of 67 NSPT sets, the memory size required to store NSPT kernels can be significantly reduced.

[0276] The number of available NSPT sets and / or the number of NSPT kernel candidates belonging to an NSPT set can vary depending on the block size. For example, the number of available NSPT sets for a 4×4 block can be 35, for 4×8 and 8×4 blocks it can be 19, and for an 8×8 block it can be 10. A 4×4 block NSPT set can consist of three NSPT kernel candidates, a 4×8 and 8×4 block NSPT set can consist of three or two NSPT kernel candidates, and an 8×8 block NSPT set can consist of one NSPT kernel candidate.

[0277] As the block size increases, the transform kernel size can also increase. Therefore, the number of available NSPT sets and / or the number of NSPT kernel candidates belonging to those sets can be reduced, saving memory space required to store the transform kernels. Furthermore, as the block size increases, the characteristics of the residual signal within the corresponding block tend to become more generalized. Therefore, reducing the number of available NSPT sets and / or the number of NSPT kernel candidates belonging to those sets can help maintain compression efficiency while reducing implementation complexity by reflecting these statistical characteristics.

[0278] Implementation Method 4

[0279] When geometric segmentation is applied to the current block, the current block can be divided into two or more partitions. Here, the current block can be a coding block, coding unit, transform block, or transform unit. Different prediction methods can be applied to the individual partitions. As an example, an inter-frame mode can be applied to the first partition of the current block, and an intra-frame mode can be applied to the second partition of the current block. Alternatively, an inter-frame mode can be applied to both the first and second partitions of the current block, but a merge mode can be applied to the first partition, and an inter-frame prediction mode other than the merge mode (e.g., AMVP mode) can be applied to the second partition. Alternatively, the same inter-frame prediction mode (e.g., merge mode) can be applied to both the first and second partitions of the current block, but different motion information can be applied to the individual partitions. Alternatively, an intra-frame mode can be applied to both the first and second partitions of the current block, but different intra-frame prediction modes can be applied to the individual partitions.

[0280] As described above, when different prediction methods are applied to individual partitions belonging to a block but an inverse transform is applied to the entire block, a method is proposed for determining the transform set and / or transform kernel for the inverse transform.

[0281] A set of separable transforms can be introduced that can be applied to the current block to which geometric partitions have been applied. In this paper, the transform set can consist of multiple transform kernel candidates, and an inverse transform based on the separable transform can be performed based on one of these candidates. For this purpose, the index of one of the transform kernel candidates can be individually signaled.

[0282] Additionally, a separate set of separable transforms (MTS) can be introduced for the current block to which geometric partitioning has been applied. The MTS set can consist of multiple transform kernel candidates, and an inverse transform based on a separable transform can be performed based on one of these candidates. For this purpose, an index indicating one of the transform kernel candidates included in the MTS set can be individually signaled. Each transform kernel candidate can be defined as a pair of horizontal and vertical transform kernels. As an example, this pair of horizontal and vertical transform kernels can be represented as a tuple such as (DST-7, DCT-2).

[0283] As described in the above embodiments, the transform set for the inseparable transforms of the current block can be determined based on the intra-prediction mode of the current block. Specifically, intra-prediction modes, which are predefined commonly by the encoding and decoding devices, can be classified into multiple groups. Each group may include one or more intra-prediction modes. A transform set to be applied to the corresponding group can be assigned to each group. Based on the intra-prediction modes of the current block, the group to which the intra-prediction mode belongs can be determined, and then the transform set applied to the corresponding group can be determined. When geometric segmentation is applied to the current block, it can be assumed that a particular intra-prediction mode is applied to the entire current block, and the transform set for the inseparable transforms can be determined based on the particular intra-prediction mode.

[0284] Similarly, the MTS set for separable transforms can be determined based on the intra-prediction mode of the current block. Alternatively, the MTS set can be determined based on both the intra-prediction mode of the current block and the size of the current block. When geometric segmentation is applied to the current block, it can be considered that a specific intra-prediction mode is applied to the entire current block, and the MTS set can be determined based on that specific intra-prediction mode.

[0285] The intra-prediction mode (hereinafter referred to as the virtual intra-prediction mode) considered to apply to the entire current block can be a preset non-directional mode. For example, the preset non-directional mode can be a planar mode or a DC mode. When the virtual intra-prediction mode is a planar mode, a transform set for inseparable transforms corresponding to the planar mode can be selected, or an MTS set corresponding to the planar mode can be selected.

[0286] Alternatively, the virtual intra-frame prediction mode can be adaptively determined based on the segmentation direction of the geometric segmentation. The method for deriving the virtual intra-frame prediction mode will be described in detail below.

[0287] Method 1

[0288] The intra-prediction mode that matches or is closest to the segmentation direction of the current block can be selected as the virtual intra-prediction mode.

[0289] Multiple segmentation types for geometric segmentation can be predefined in the decoding device. A table (hereinafter referred to as the first mapping table) can be defined in the decoding device to map the orientation index and distance index corresponding to each segmentation type. The orientation index can refer to an index (angleIdx) indicating the segmentation direction for each segmentation type, and the distance index can refer to an index (distanceIdx) indicating the distance between the segmentation line of the corresponding segmentation type and the center of the current block. For example, the first mapping table can be defined as shown in Table 11 below.

[0290] [Table 11]

[0291] In Table 11, when angleIdx is 0, it indicates that the line perpendicular to the dividing line forms a 0-degree angle with the horizontal axis pointing to the right, and the dividing line is vertical. As the value of angleIdx increases, the dividing line rotates counterclockwise. That is, as angleIdx increases, the angle between the line perpendicular to the dividing line and the horizontal axis pointing to the right increases. When angleIdx is 8, 16, or 24, it indicates an angle that increases counterclockwise from the horizontal axis pointing to the right by 90 degrees, 180 degrees, or 270 degrees, respectively. When angleIdx is 32, it indicates an angle that rotates 360 degrees counterclockwise from the horizontal axis pointing to the right, which can be the same as when angleIdx is 0. In Table 11, distanceIdx represents the distance between the dividing line and the center of the current block, and can have any value of 0, 1, 2, or 3. As the value of distanceIdx increases, the dividing line can be farther away from the center of the current block. For example, in Table 11, when `merge_gpm_partition_idx` is 10, 11, 12, or 13, `distanceIdx` can be 0, 1, 2, or 3 respectively, and the distance from the center can be 1, 3, 6, or 10 respectively. That is, as the value of `distanceIdx` increases, the distance from the center can increase uniformly or non-uniformly. In Table 11, when `distanceIdx` is 0, this can indicate that the distance from the center of the current block is 0 or very close. In Table 11, `merge_gpm_partition_idx` can have values ​​from 0 to 63, defining a total of 64 partition types, and for each of the 64 partition types, the partition direction can be defined.

[0292] Based on the first mapping table, the direction index corresponding to the segmentation type of the current block can be determined. An intra-prediction mode with a prediction direction that matches or is closest to the segmentation direction corresponding to the determined direction index can be determined. The determined intra-prediction mode can be set as the virtual intra-prediction mode for the current block.

[0293] A table (hereinafter referred to as the second mapping table) can be defined in the decoding device to map the segmentation direction (i.e., angleIdx) to the intra prediction mode. Here, the intra prediction mode mapped to a specific segmentation direction can be the intra prediction mode whose prediction direction matches or is closest to the specific segmentation direction. For example, the second mapping table can be defined as shown in Table 12.

[0294] [Table 12]

[0295] Table 12 defines the intra-prediction modes corresponding to each of the 32 segmentation directions. In Table 12, the numbers in parentheses indicate the values ​​of the intra-prediction modes. For example, when angleIdx is 0, the value 50 corresponding to g_geoAngle2IntraAng[0] can be selected, and an intra-prediction mode with the value 50 can be derived. Alternatively, when angleIdx is 8, the value 18 corresponding to g_geoAngle2IntraAng[8] can be selected, and an intra-prediction mode with the value 18 can be derived. Alternatively, when angleIdx is 31, the value 0 corresponding to g_geoAngle2IntraAng

[31] can be selected, and an intra-prediction mode with the value 0 can be derived. The prediction directions corresponding to the values ​​of the intra-prediction modes are shown in Figure 5.

[0296] When geometric segmentation is applied to the current block, the angleIdx corresponding to the segmentation type of the current block can be determined based on the first mapping table. Based on the second mapping table, the intra prediction mode corresponding to the angleIdx can be derived. The derived intra prediction mode can be set as a virtual intra prediction mode for the current block. For example, in Table 11, when merge_gpm_partition_idx is 11, the corresponding angleIdx is 4, and through the mapping table in Table 12, the value 34 corresponding to g_geoAngle2IntraAng[4] can be selected. The intra prediction mode with the value 34 can be set as a virtual intra prediction mode for the current block.

[0297] Method 2

[0298] The intra-prediction mode that matches or is closest to the direction perpendicular to the segmentation direction of the current block can be selected as the virtual intra-prediction mode. Alternatively, based on the second mapping table described above, an intra-prediction mode corresponding to the direction perpendicular to the segmentation direction of the current block can be derived, and the derived intra-prediction mode can be set as the virtual intra-prediction mode for the current block.

[0299] When a single block is divided into two partitions, one partition can be adjacent to a reference sample for intra-prediction, but the accuracy of intra-prediction based on those reference samples tends to decrease. Therefore, when setting partition boundaries in a direction perpendicular to the prediction direction of the intra-prediction mode, a different intra-prediction mode can be applied to the other partition starting from a point where it becomes slightly further away from the prediction direction of the intra-prediction mode. Thus, selecting the intra-prediction mode that matches or is closest to the direction perpendicular to the partitioning direction can be one of the methods where the most suitable intra-prediction mode can be applied to each partition.

[0300] Method 3

[0301] The virtual intra-prediction mode for the current block can be determined based on the segmentation type of the current block. The partition index corresponding to the segmentation type of the current block can be derived. For this purpose, a separate mapping table (hereinafter referred to as the third mapping table) can be used, which defines the partition index corresponding to each of the predefined segmentation types. The partition index can specify either of two partitions. The partition index can specify the position of the larger of the two partitions within the current block. The virtual intra-prediction mode for the current block can be derived based on the intra-prediction mode of the partition specified by the partition index.

[0302] A third mapping table can be defined for each block shape. Here, block shapes can be categorized as square blocks and non-square blocks. In this case, the third mapping table can include a mapping table for square blocks and a mapping table for non-square blocks. When the current block is a square block such as 4×4 or 8×8, the mapping table for square blocks can be used for the current block. On the other hand, when the current block is a non-square block such as 4×8 or 8×4, the mapping table for non-square blocks can be used for the current block.

[0303] Alternatively, based on the block's width (w) and height (h), the block shape can be classified as a square block, a wide block (where w is greater than h), and a narrow block (where w is less than h). In this case, the third mapping table can include a mapping table for square blocks, a mapping table for wide blocks, and a mapping table for narrow blocks. When the current block is a square block such as 4×4 or 8×8, the mapping table for square blocks can be used for the current block. When the current block is a wide block such as 8×4 or 16×4, the mapping table for wide blocks can be used for the current block. When the current block is a narrow block such as 4×8 or 4×16, the mapping table for narrow blocks can be used for the current block.

[0304] As an example, mapping tables for square blocks, wide blocks, and narrow blocks can be defined as shown in Table 13 below.

[0305] [Table 13]

[0306] Table 13 is a table showing the partition indices for each of the square blocks, wide blocks, and narrow blocks, corresponding to the 64 partition types presented in Table 11. Since Table 13 follows C / C++ syntax, it is described as a C / C++ array, and the indices used to access the array start from 0.

[0307] In Table 13, GEO_NUM_PARTITION_MODE can be the total number of partition types for a geometric partition (e.g., 64). g_geoMajorPartSquare, g_geoMajorPartThin, and g_geoMajorPartFat can be tables indicating which partition is the larger partition for each of the 64 partition types for square, wide, and narrow blocks. For example, when the current block is an 8×16 block, the g_geoMajorPartThin array can be used because the current block corresponds to a narrow block. In this case, when merge_gpm_partition_idx, which indicates the partition type of the current block, is 41, 0 can be output corresponding to g_geoMajorPartThin

[41] . This can indicate that the partition corresponding to index 0 is the larger partition.

[0308] Using the above method, it is possible to determine which of the two partitions in the current block is the larger partition, and the virtual intra-prediction mode for the current block can be derived based on the intra-prediction mode of the larger partition.

[0309] However, when the partitions within the current block are of the same size, an intra-prediction mode applied to any of the partitions can be selected as the virtual intra-prediction mode. Alternatively, when the partitions within the current block are of the same size, a partition with a larger number of adjacent reference samples can be selected, and the intra-prediction mode of the selected partition can be selected as the virtual intra-prediction mode. Here, the reference samples can belong to at least one of the left-hand region, the top region, or the upper-left region of the current block.

[0310] Figure 6 illustrates an example of geometric segmentation according to this disclosure. Two partitions within the current block can be classified as index 0 and index 1. Referring to Figure 6, partition P0 and partition P1 can correspond to index 0 and index 1, respectively. The geometric segmentation shown in Figure 6(b) can correspond to a value of angleIdx of 13 or greater and 27 or less, and the geometric segmentation shown in Figure 6(a) can correspond to the remaining value of angleIdx. Specifically, in the case of Figure 6(a), the partition corresponding to index 0 can be located in the direction indicated by angleIdx (or the direction corresponding to the angle indicated by angleIdx in the direction perpendicular to the segmentation line), and the remaining partition can correspond to index 1. In the case of Figure 6(b), the partition corresponding to index 1 can be located in the direction indicated by angleIdx (or the direction corresponding to the angle indicated by angleIdx in the direction perpendicular to the segmentation line), and the remaining partition can correspond to index 0.

[0311] Method 4

[0312] The virtual intra-prediction mode for the current block can be derived as an intra-prediction mode derived based on the decoder-side intra-prediction mode derivation (DIMD) method. The method for deriving the intra-prediction mode based on DIMD will be described in detail below with reference to FIG7.

[0313] Referring to Figure 7, an initial sample position can be set, and the cumulative intensity value for all intra-prediction modes can be initialized (S700). An intensity value for the current sample position can be calculated (S710). An intra-prediction mode for accumulating the calculated intensity value can be selected (S720). The intensity value calculated in S710 can be added to the cumulative intensity value of the selected intra-prediction mode (S730). The above process of S710 to S730 can be performed on each of all or some sample positions belonging to the current block until no next sample position exists. When no next sample position exists, the intra-prediction mode with the largest cumulative intensity value can be selected (S740).

[0314] The process of applying DIMD to the neighboring region of the current block is described in detail below. For ease of description, assume that the neighboring region is a block with a width of W and a height of H.

[0315] A filter of size P×Q can be applied to the interior of a W×H block. The P×Q filter can be a 2D filter or a 1D filter. However, for samples adjacent to the block boundary, the filter may deviate from the block boundary. The filter can then be applied only to the interior region of the W×H block, excluding samples adjacent to the block boundary. Specifically, the filter can be applied only to sample locations belonging to the (WP + 1) × (H - Q + 1) region, which is the interior region of the W×H block. For example, when the filter size is 3×3, a 3×3 2D filter can be applied only to sample locations belonging to the (W-2) × (H-2) block, excluding edges of length 1 within the W×H block. In this case, the 2D filter can be applied to a 3×3 region that has a sample (hereinafter referred to as the target sample) serving as the central sample at the sample location.

[0316] The target sample and at least one neighboring sample adjacent to the target sample can be input into a 2D filter. Here, the neighboring sample can include a sample that is adjacent to at least one of the top, left, bottom, right, upper left, upper right, lower left, or lower right of the target sample.

[0317] The intensity value for a specific intra-prediction mode can be derived by applying a filter to each sample location belonging to the interior region. The derived intensity value can be added to a previously derived intensity value for the specific intra-prediction mode, and the cumulative intensity value for the specific intra-prediction mode can be derived through this process. When the filter is applied to all sample locations belonging to the interior region, the cumulative intensity value can be derived for all intra-prediction modes (or directional modes other than directional modes). The intra-prediction mode with the largest cumulative intensity value can be selected and set as the intra-prediction mode based on DIMD derivation (hereinafter referred to as the DIMD mode).

[0318] The two types of 3×3 filters shown in Figure 8 can be used as filters for deriving DIMD modes, and these filters will be referred to as filterY and filterX, respectively. When the location where filterY and filterX are applied (i.e., the location of the target sample) is E, the locations of the samples associated with the application of the two filters can be represented as A, B, C, D, E, F, G, H, and I. When the values ​​obtained by applying filterY and filterX are represented as iDy and iDx, respectively, iDy and iDx can be calculated as follows.

[0319] [Formula 6]

[0320] When iDy and iDx are 0, the subsequent process (i.e., after obtaining the intensity value, selecting a specific intra-prediction mode and adding the intensity value to the cumulative intensity value for the specific intra-prediction mode) can be omitted, and the process can proceed to the next sample position where the filter will be applied.

[0321] The function abs can be a function that obtains and returns the absolute value of the input value. The value of iAmp can be calculated as follows. This corresponds to step S710 in Figure 7.

[0322] [Formula 7]

[0323] iAmp =abs(iDx)+abs(iDy)

[0324] When at least one of iDx or iDy is 0, iAngUneven, which is the value of the selected specific intra-prediction mode, can be determined as shown in Equation 8 below. For the case where at least one of iDx or iDy is 0, this can correspond to step S720 of FIG7.

[0325] [Formula 8]

[0326] iAngUneven=(iDx==0)? VER_IDX : HOR_IDX

[0327] In Equation 8, VER_IDX and HOR_IDX can represent the vertical and horizontal modes, respectively. For example, VER_IDX and HOR_IDX can correspond to mode 50 and mode 18 in Figure 5, respectively. A value of 0 for iDx can mean that the change in the vertical direction is zero or almost non-existent. In other words, since the samples are considered to have the same sample value in the vertical direction, this can mean that the prediction is performed well in the vertical direction. Conversely, a value of 0 for iDy (i.e., the case where the value of iDx is not 0) can mean that the change in the horizontal direction is zero or almost non-existent. In other words, since the samples are considered to have the same sample value in the horizontal direction, this can mean that the prediction is performed well in the horizontal direction.

[0328] When neither iDx nor iDy is 0, iAngUneven, which is the value of the selected intra-prediction mode, can be determined as follows. For the case where neither iDx nor iDy is 0, this corresponds to step S720 in Figure 7.

[0329] First, the values ​​of the intra-prediction mode (specifically, the values ​​of the directional mode) can be classified into the following four groups.

[0330] The first group (region 0) can consist of a specific number of patterns with horizontal orientation. As an example, the first group can consist of patterns with values ​​less than or equal to the horizontal pattern. In Figure 5, the patterns with horizontal orientation are patterns 2 to 34 (however, pattern 34 may not be included in the patterns with horizontal orientation), and the value of the horizontal pattern is 18 (i.e., the horizontal pattern is pattern 18). When the specific number is called N, the first group can consist of patterns {18, 18-1, 18-2, ..., 18-(n-1)}. When N is 17, the first group can consist of patterns {18, 17, 16, ..., 2}.

[0331] The second group (region 1) can consist of a specific number of patterns with a horizontal directionality. As an example, the second group can consist of patterns with values ​​greater than or equal to the horizontal pattern. When the specific number is called N, the second group can consist of the pattern {18, 18+1, 18+2, ..., 18+(n-1)}. When N is 17, the second group can consist of the pattern {18, 19, 20, ..., 34}.

[0332] The third group (region 2) can consist of a specific number of patterns with vertical orientation. As an example, the third group can consist of patterns with values ​​less than or equal to the vertical pattern. In Figure 5, the patterns with vertical orientation are patterns 34 to 66 (however, pattern 34 may not be included in the patterns with vertical orientation), and the value of the vertical pattern is 50 (i.e., the vertical pattern is pattern 50). When the specific number is called N, the third group can consist of patterns {50, 50-1, 50-2, ..., 50-(n-1)}. When N is 17, the third group can consist of patterns {50, 49, 48, ..., 34}.

[0333] The fourth group (region 3) can consist of a specific number of patterns with vertical orientation. As an example, the fourth group can consist of patterns with values ​​greater than or equal to the vertical pattern. When the specific number is called N, the fourth group can consist of the pattern {50, 50+1, 50+2, ..., 50+(n-1)}. When N is 17, the fourth group can consist of the pattern {50, 51, 52, ..., 66}.

[0334] When groups for intra-prediction modes are defined as described above, identifiers indicating specific groups can be calculated as shown in Table 14 below. The identifiers corresponding to groups one through four are 0, 1, 2, and 3, respectively.

[0335] [Table 14]

[0336] In Table 14, gtY indicates whether the change in the vertical direction is greater than the change in the horizontal direction. That is, when absx is greater than absy, gtY can be deduced as 1; otherwise, gtY can be deduced as 0. Here, when gtY is 1, it indicates that the change in the vertical direction is greater than the change in the horizontal direction, and when gtY is 0, it indicates that the change in the vertical direction is less than or equal to the change in the horizontal direction. When the change in the vertical direction is large, it can mean that the probability of performing the prediction well in the vertical direction is low. In this case, region 0 or region 1 can be selected. That is, mapXgrY1[signy][signx] can be selected as the identifier for the region. When the change in the horizontal direction is large, it can mean that the probability of performing the prediction well in the horizontal direction is low. In this case, region 2 or region 3 can be selected. That is, mapXgrY0[signy][signx] can be selected as the identifier for the region.

[0337] Furthermore, relative to the horizontal direction, a positive change indicates the right side, and a negative change indicates the left side. Relative to the vertical direction, a positive change indicates the bottom, and a negative change indicates the top. When the sign for iDx and the sign for iDy are the same, region 1 or region 2 can be selected; and when the signs for iDx and iDy are different, region 0 or region 3 can be selected.

[0338] Next, the ratio (scale) that is scaled to an integer value can be obtained as shown in Table 15 below.

[0339] [Table 15]

[0340] In Table 15, (1<<16) means shifting 1 to the left by 16, which is represented as 2. 16The function `intFunc` can be used to convert `fRatioScaled`, represented as a decimal value, to an integer value. To convert to an integer value, operations such as rounding, ceiling, and floor can be applied. Casting functions such as `int`, provided by the C / C++ library, can also be used to convert it to an integer value. In Table 15, a division operation (` / `) might be needed to obtain the ratio of `absy` and `absx`. However, when implementing a codec (especially in hardware), the problem is that implementing division operations is expensive or difficult. Therefore, in terms of implementation, it is often advantageous to approximate the division operation using a combination of several integer operations. Therefore, the formula used to obtain this ratio can be approximated by the formula in Table 16 below.

[0341] [Table 16]

[0342] The integer ratio can be determined using the process shown in Table 16. The position in the angTable closest to the ratio can be determined as shown in Table 17 below.

[0343] [Table 17]

[0344] According to Table 17, an angTable can consist of 17 entries. When each of the above groups consists of 17 modes, each of the intra-prediction modes constituting each group can correspond to one entry. In Table 17, find the angTable entry that is closest to the ratio (proportion), and the value of idx can be derived based on the index of the angTable corresponding to that entry.

[0345] [Table 18]

[0346] Table 18 describes the process using C / C++ syntax. The value of the intra-prediction mode used to accumulate the intensity value for the current sample position within the current block where the filter has been applied can be assigned to iAngUneven. The regions derived above can be identifiers indicating any of the four groups. offsets[region] can indicate the starting value of the intra-prediction mode for the group indicated by the region, and dirs[region] can indicate the directionality of the increase or decrease of the corresponding intra-prediction mode. Idx can indicate the position within angleTable. Therefore, the value of iAngUneven can be determined using the formula shown in Table 18.

[0347] The process of increasing the cumulative intensity value for a selected intra-prediction mode can be performed as follows.

[0348] [Formula 9]

[0349] piHistogram[iAngUneven] += iAmp

[0350] In Equation 9, the piHistogram array is an array storing the cumulative intensity values ​​for all intra-prediction modes. After being initialized to 0, intensity values ​​can be calculated while looping through sample positions of the internal regions within the current block where the filter is applied. In this case, the intensity value calculated for the current sample position is added to the cumulative intensity value of the selected specific intra-prediction mode. As described above, the value of the intra-prediction mode selected for the current sample position where the filter is applied can be stored in iAngUneven, and the intensity value calculated for the corresponding sample position can be stored in iAmp. The cumulative intensity value for the intra-prediction mode indicated by iAngUneven can be stored in piHistogram[iAngUneven]. Equation 9 corresponds to step S730 in FIG7.

[0351] When the loop of sample locations within the internal region of the block to which the filter has been applied is complete, the cumulative intensity values ​​for all intra-predictive modes are stored in the piHistogram array. One, two, or more modes with the highest cumulative intensity values ​​can be selected. The selected modes can be referred to as DIMD modes. This corresponds to step S740 in Figure 7.

[0352] [Table 19]

[0353] Table 19 is described using C / C++ syntax. NUM_LUMA_MODE can indicate the total number of intra-prediction modes available as DIMD modes. For example, NUM_LUMA_MODE can be 67. According to Table 19, the value of the intra-prediction mode with the largest cumulative intensity value can be assigned to the first mode variable. Therefore, the intra-prediction mode corresponding to the final determined value of the first mode variable can be set as the DIMD mode of the W×H block.

[0354] Method 5

[0355] Intra-prediction modes can be derived by applying the DIMD of method 4 described above to the prediction block of the current block, and the derived intra-prediction mode can be set as a virtual intra-prediction mode for the current block. The difference between the DIMD of method 4 and the DIMD of method 5 is that the DIMD of method 4 is applied to reconstructed samples belonging to the neighboring region of the current block, while the DIMD of method 5 is applied to the prediction block belonging to the current block instead of the prediction samples of the neighboring region of the current block; however, the other application methods are the same. Specifically, method 4 describes a method for deriving the DIMD mode by applying a P×Q filter (e.g., a 3×3 filter) to a W×H block, and here, the intra-prediction mode can be derived by applying DIMD while setting the W×H block as the prediction block for the current block. As described in S410, the prediction block of the current block can be generated based on at least one of intra-prediction or inter-prediction.

[0356] Method 6

[0357] A virtual intra-prediction mode for the current block can be derived based on Template-Based Intra-Mode Derivation (TIMD). TIMD can be a method in the decoding device to derive an intra-prediction mode based on template regions adjacent to the current block. The intra-prediction mode derived based on TIMD (hereinafter referred to as the TIMD mode) can be set as the virtual intra-prediction mode for the current block. The method for deriving the TIMD mode will be described in detail below.

[0358] It can calculate the cost for each of the predetermined candidate patterns.

[0359] Predefined candidate modes can refer to multiple intra-prediction modes that are equally predefined in both the encoding and decoding devices. Alternatively, for template region-based derivation, a candidate list consisting of candidate modes can be generated, and costs can be calculated for candidate modes belonging to the candidate list. Alternatively, costs can be calculated only for the first N candidate modes in the generated candidate list. Here, N can be a value that is also predefined in both the encoding and decoding devices. As an example, N can be an integer such as 2, 3, 4, 5, or larger.

[0360] The cost can be calculated as the sum of the absolute differences (SAD) between the predicted and reconstructed samples within the template region. Alternatively, the cost can be calculated as the sum of the absolute transform differences (SATD) between the predicted and reconstructed samples within the template region. Here, SATD can refer to the SAD transformed to the frequency domain. As an example of a transform, the Hadamard transform can be used, but it is not limited to this. Predicted samples for the template region can be generated based on the candidate patterns described above.

[0361] The template region for cost calculation can be a pre-reconstructed region adjacent to the current block. As an example, the template region can include at least one of the top adjacent region, left adjacent region, upper left adjacent region, lower left adjacent region, or upper right adjacent region of the current block.

[0362] You can select the candidate pattern with the lowest cost among the calculated costs for each candidate pattern. As an example, you can calculate the cost for each of the five candidate patterns in the candidate list. The five candidate patterns can be reordered in ascending order of their calculated costs. From the reordered five candidate patterns, you can select the first one. The selected candidate pattern can be set as the TIMD pattern.

[0363] Alternatively, at least two candidate modes with the lowest cost among those calculated for the candidate modes can be selected. As an example, the cost for each of the five candidate modes in the candidate list can be calculated separately. The five candidate modes in the candidate list can be reordered in ascending order of the calculated costs. From the reordered five candidate modes, the top two candidate modes can be selected. When at least two candidate modes are selected through the aforementioned process, the intra-prediction mode can be derived based on comparisons between the selected candidate modes and / or comparisons between at least one of the selected candidate modes and a threshold. The TIMD mode can be derived based on the derived intra-prediction mode.

[0364] As an example, the intra-prediction mode can be derived based on whether the selected candidate mode meets the following conditions.

[0365] [Condition] costMode2 < (K × costMode1)

[0366] In this context, `costMode1` can refer to the cost calculated based on any of the selected candidate modes, and `costMode2` can refer to the cost calculated based on the other selected candidate mode. As an example, `costMode1` can refer to the cost calculated based on the candidate mode with the lower cost among the selected candidate modes, and `costMode2` can refer to the cost calculated based on the candidate mode with the higher cost among the selected candidate modes. In this case, `K` represents a predetermined comparison factor, which can be a predefined value in both the encoding and decoding devices. As an example, `K` can be an integer such as 1, 2, or larger, or it can refer to a real number such as 1 / 2 or 1 / 4.

[0367] When the conditions are met, the intra-prediction mode can be derived based on the selected candidate mode. On the other hand, when the conditions are not met, the candidate mode with a cost of cost_mode1 can be derived as the intra-prediction mode, and the candidate mode with a cost of cost_mode2 may not be used as the intra-prediction mode.

[0368] Method 7

[0369] When either of the two intra-prediction modes pre-derived via TIMD is used as the intra-prediction mode for any partition within the current block, the corresponding intra-prediction mode can be set as a virtual intra-prediction mode for the current block. Alternatively, when the intra-prediction modes of the two partitions are the same as the two intra-prediction modes pre-derived via TIMD, either of the two partitions can be selected, and the intra-prediction mode applied to the selected partition can be set as a virtual intra-prediction mode. The method described in Method 3 can be used as a method for selecting either of the two partitions.

[0370] The two intra-frame prediction modes derived through TIMD pre-derivation can be referred to as the horizontal TIMD mode and the vertical TIMD mode. Here, the horizontal TIMD mode can be a TIMD mode derived by using the left neighboring region as the template region. The vertical TIMD mode can be a TIMD mode derived by using the top neighboring region as the template region.

[0371] The intra prediction mode for the current block can be derived based on the aforementioned DIMD or TIMD, and in this case, the information for the intra prediction modes of the two partitions within the current block (i.e., intra_pred_mode0_idx and intra_pred_mode1_idx) can be notified without signaling.

[0372] The virtual intra-prediction mode used to determine the transform set for non-separable transforms or the MTS set for separable transforms can be derived by sequentially checking one or more conditions. When a predetermined condition is true, the virtual intra-prediction mode can be derived based on a predefined method. On the other hand, when a predetermined condition is false, the virtual intra-prediction mode may not be derived, or it may be derived based on another predefined method. Here, one or more conditions may include at least one of conditions 1 to 6, which will be described later, and the predefined method may be any one of methods 1 to 7 mentioned above.

[0373] [Condition 1] The intra prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra prediction modes applied to the two partitions within the current block. Here, the intra prediction mode corresponding to the segmentation direction of the current block can be determined based on the aforementioned method 1.

[0374] [Condition 2] The distance between the current block's dividing line and the center of the current block is greater than or equal to a predetermined distance (d). Here, the predetermined distance (d) can refer to the actual distance, or it can refer to the current block's segmentation type or its corresponding distance index. As the dividing line becomes farther from the center of the current block, any partition becomes larger than another partition. In this case, the intra-prediction mode for the larger partition can be considered a better representation of the intra-prediction mode for the entire current block. When the value of the predetermined distance (d) is defined as the value of the aforementioned distance index (distanceIdx), the value of d can be 0, 1, 2, or 3. A dividing line of the current block being d or greater from the center of the current block can mean that the value of distanceIdx is d or greater.

[0375] [Condition 3] The intra-prediction mode corresponding to the segmentation direction of the current block is the same as the intra-prediction mode applied to the larger of the two partitions within the current block. Here, the intra-prediction mode corresponding to the segmentation direction of the current block can be determined based on the aforementioned method 1.

[0376] [Condition 4] The distance between the segmentation line of the current block and the center of the current block is greater than or equal to a predetermined distance (d), and the intra-prediction mode corresponding to the segmentation direction of the current block is the same as the intra-prediction mode applied to the larger of the two segments within the current block. The predetermined distance (d) is as described in Condition 2. Here, the intra-prediction mode corresponding to the segmentation direction of the current block can be determined based on the aforementioned Method 1.

[0377] [Condition 5] The distance between the current block's dividing line and the center of the current block is 0 (or, the value of distanceIdx is 0), and the intra-prediction mode corresponding to the current block's dividing direction is the same as at least one of the intra-prediction modes applied to the two partitions within the current block. When the distance between the current block's dividing line and the center of the current block is 0, this may mean that the two partitions are the same size. Here, the intra-prediction mode corresponding to the current block's dividing direction can be determined based on the aforementioned method 1.

[0378] [Condition 6] The distance between the segmentation line of the current block and the center of the current block is greater than 0 (or the value of distanceIdx is greater than 0), and the intra-prediction mode corresponding to the segmentation direction of the current block is the same as the intra-prediction mode applied to the larger of the two partitions within the current block. Here, the intra-prediction mode corresponding to the segmentation direction of the current block can be determined based on the aforementioned method 1.

[0379] As an example, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), the virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), the virtual intra-prediction mode for the current block can be derived based on method 3.

[0380] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0381] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 3 (when condition 2, where d is 3, is true), the virtual intra-frame prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 3, is false), the virtual intra-frame prediction mode for the current block can be derived based on method 1.

[0382] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 2 (when condition 2, where d is 2, is true), the virtual intra-frame prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 2, is false), the virtual intra-frame prediction mode for the current block can be derived based on method 1.

[0383] Alternatively, when the distance between the dividing line of the current block and the center of the current block is greater than or equal to 1 (when condition 2, where d is 1, is true), the virtual intra-frame prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 1, is false), the virtual intra-frame prediction mode for the current block can be derived based on method 1.

[0384] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 3 (when condition 2, where d is 3, is true), the virtual intra-frame prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 3, is false), the virtual intra-frame prediction mode for the current block can be derived based on method 5.

[0385] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 2 (when condition 2, where d is 2, is true), the virtual intra-frame prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 2, is false), the virtual intra-frame prediction mode for the current block can be derived based on method 5.

[0386] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 1 (when condition 2, where d is 1, is true), the virtual intra-frame prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 1, is false), the virtual intra-frame prediction mode for the current block can be derived based on method 5.

[0387] Alternatively, when the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 3 (when condition 2, where d is 3, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 3, is false), it can be checked whether the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block. When the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0388] Alternatively, when the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 2 (when condition 2, where d is 2, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 2, is false), it can be checked whether the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block. When the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0389] Alternatively, when the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 1 (when condition 2, where d is 1, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 1, is false), it can be checked whether the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block. When the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0390] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 3 (when condition 2, where d is 3, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 3, is false), it can be checked whether the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block. When the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 3 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 3 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0391] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 2 (when condition 2, where d is 2, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 2, is false), it can be checked whether the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block. When the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 3 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 3 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0392] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 1 (when condition 2, where d is 1, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 1, is false), it can be checked whether the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block. When the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 3 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 3 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0393] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), it can be checked whether the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 3. When the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 3 (when condition 2, where d is 3, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 3, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0394] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), it can be checked whether the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 2. When the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 2 (when condition 2, where d is 2, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 2, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0395] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 1 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 1 is false), it can be checked whether the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 1. When the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 1 (when condition 2, where d is 1, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 1, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0396] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 3 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 3 is false), it can be checked whether the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 3. When the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 3 (when condition 2, where d is 3, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 3, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0397] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 3 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 3 is false), it can be checked whether the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 2. When the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 2 (when condition 2, where d is 2, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 2, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0398] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 3 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 3 is false), it can be checked whether the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 1. When the distance between the segmentation line of the current block and the center of the current block is greater than or equal to 1 (when condition 2, where d is 1, is true), a virtual intra-prediction mode for the current block can be derived based on method 3. Otherwise (when condition 2, where d is 1, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0399] Alternatively, when the intra-prediction mode corresponding to the segmentation direction of the current block is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 3 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 3 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0400] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 3, and the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 4, where d is 3, is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 4, where d is 3, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0401] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 2, and the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 4, where d is 2, is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 4, where d is 2, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0402] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than or equal to 1, and the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 4, where d is 1, is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 4, where d is 1, is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0403] Alternatively, when the distance between the segmentation line of the current block and the center of the current block is 0, and the intra-prediction mode corresponding to the segmentation direction of the current block is the same as at least one of the intra-prediction modes applied to the two partitions within the current block (when condition 5 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 5 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0404] Alternatively, when the distance between the current block's dividing line and the center of the current block is greater than 0, and the intra-prediction mode corresponding to the current block's dividing direction is the same as the intra-prediction mode applied to the larger of the two partitions within the current block (when condition 6 is true), a virtual intra-prediction mode for the current block can be derived based on method 1. Otherwise (when condition 6 is false), a virtual intra-prediction mode for the current block can be derived based on method 5.

[0405] Some existing codecs employ MTS (Multiple Transform Selection) technology. Adaptive MTS can also be considered a type of MTS. When applying geometric segmentation, an alternative approach to MTS can be used. As an example, when applying geometric segmentation, implicit MTS can be used instead of explicit MTS. Implicit MTS refers to a method that implicitly determines the transform kernels for the horizontal and vertical directions based on the size of the current block. In this case, the signaling used to specify the index of any of the transform kernel candidates can be omitted. Specifically, when the width of the current block is greater than or equal to 4 and less than or equal to 16, DST-7 can be applied as the horizontal transform; otherwise, DCT-2 can be applied as the horizontal transform. When the height of the current block is greater than or equal to 4 and less than or equal to 16, DST-7 can be applied as the vertical transform; otherwise, DCT-2 can be applied as the vertical transform.

[0406] Alternatively, when applying geometric segmentation, an explicit MTS can be used instead of an adaptive MTS. Here, explicit MTS refers to a method that selectively applies either the DCT-2 pair (i.e., (DCT-2, DCT-2)) or the combination of DST-7 and DCT-8 (i.e., (DST-7, DST-7), (DCT-8, DST-7), (DST-7, DCT-8), (DCT-8, DCT-8)). For this purpose, the index used to specify any of the transform kernel candidates can be signaled.

[0407] Referring to Figure 4, the current block can be reconstructed based on the predicted block and the residual block of the current block (S430).

[0408] Figure 9 shows a schematic configuration of a decoding device (300) for performing an image decoding method according to the present disclosure.

[0409] Referring to FIG9, the decoding device (300) according to the present disclosure may include a block splitter (900), a prediction block generator (910), a residual block deducer (920), and a reconstruction block generator (930). The block splitter (900) and the prediction block generator (910) may be configured in the predictor (330) of FIG3, the residual block deducer (920) may be configured in the residual processor (320) of FIG3, and the reconstruction block generator (930) may be configured in the adder (340) of FIG3.

[0410] The block splitter (900) can divide the current block into multiple partitions. The current block can be split based on one or more dividing lines, or geometric division can be applied to the current block.

[0411] The prediction block generator (910) can generate a prediction block for the current block by performing intra-frame prediction or inter-frame prediction for each partition within the current block. The method for generating prediction blocks is as described with reference to FIG4, and redundant descriptions will be omitted here.

[0412] The residual block derivator (920) can derive the residual block of the current block based on the transform coefficients of the current block. The entropy decoder (310) can derive the transform coefficients of the current block based on the residual information notified by the bitstream signal. The residual block derivator (920) can derive the residual block by performing at least one of dequantization or inverse transform on the transform coefficients of the current block.

[0413] Furthermore, the residual block derivator (920) can determine the transformation kernel for the inverse transformation of the current block using a predetermined transformation kernel determination method, and can derive the residual block of the current block based on the determined transformation kernel. This is the same as described with reference to FIG4, and redundant descriptions will be omitted here.

[0414] The reconstructed block generator (930) can reconstruct the current block based on the predicted block and the residual block of the current block.

[0415] Figure 10 illustrates an image encoding method performed by an encoding device (200) as an embodiment of the present disclosure.

[0416] Referring to Figure 10, the current block can be divided into multiple partitions (S1000). This is the same as described with reference to Figure 4.

[0417] Referring to Figure 10, a prediction block for the current block can be generated based on the prediction for each partition (S1010).

[0418] As described with reference to FIG4, when the current block is divided into two partitions (i.e., the first partition and the second partition), the predicted block of the current block can be generated as a weighted sum of the first predicted block for the first partition and the second predicted block for the second partition. Here, each of the first and second predicted blocks can be generated based on intra-frame prediction or inter-frame prediction.

[0419] When the SGPM described above is applied to the current block, the segmentation type of the current block and the intra-prediction mode for each segment can be determined. The segmentation type index, indicating the determined segmentation type, can be encoded into the bitstream. The mode index, indicating the determined intra-prediction mode among multiple intra-prediction mode candidates, can be encoded into the bitstream. The mode index can be encoded for each segment. The mode index for the second segment can be encoded based on the mode index for the first segment. At least one of the segmentation type index or mode index can be encoded based on a flag (cu_sgpm_flag) indicating whether the SGPM is applied to the current block.

[0420] As described with reference to FIG4, a candidate list for SGPM can be constructed for the current block. Each candidate in the candidate list may include a partition type index and two pattern indices. Based on any one of the candidates in the candidate list, the partition type index for the current block and the pattern index for each partition can be derived. The candidate index used to indicate any one of the candidates can be encoded into a bitstream. In addition, the candidate list can be rearranged based on a predetermined template region.

[0421] As described with reference to FIG4, intra-prediction mode candidates can be configured in the IPM (Intra-Prediction Mode) list. SGPM can be applied when the size of the current block meets predetermined conditions.

[0422] It can be determined whether mixing the predicted blocks for the first partition and the predicted blocks for the second partition of the current block is allowed. When it is determined that mixing between predicted blocks is allowed, adaptive mixing can be used in SGPM, and the mixing depth for adaptive mixing can be derived based on the size of the current block. On the other hand, when it is determined that mixing between predicted blocks is not allowed, the mixing depth can be derived to a default value (e.g., 1 / 4τ). Based on this determination, a flag indicating whether mixing between the predicted blocks for the first and second partitions is allowed can be encoded into the bitstream.

[0423] Referring to Figure 10, the residual block of the current block can be derived based on the prediction block of the current block (S1020). The residual block of the current block can be derived by distinguishing the prediction block from the original block of the current block.

[0424] Referring to Figure 10, the transform coefficients of the current block can be derived from the residual block of the current block (S1030). The transform coefficients can be derived by performing at least one of transformation or quantization on the residual block of the current block.

[0425] The transformation according to this disclosure can be understood as the inverse process of the inverse transformation described with reference to FIG4. FIG4 describes a method for determining the transformation kernel for the transformation, and a detailed description thereof will be omitted here.

[0426] Referring to Figure 10, a bitstream can be generated by encoding the transform coefficients of the current block (S1040). Based on the transform coefficients of the current block, residual information related to the transform coefficients can be generated, and a bitstream can be generated by encoding the residual information.

[0427] Figure 11 shows a schematic configuration of an encoding device (200) for performing an image encoding method according to the present disclosure.

[0428] Referring to FIG11, the encoding device (200) according to the present disclosure may include a block segmenter (1100), a prediction block generator (1110), a residual block derivative (1120), a transform coefficient derivative (1130), and a transform coefficient encoder (1140). The block segmenter (1100) and the prediction block generator (1110) may be configured in the predictor (220) of FIG2, the residual block derivative (1120) and the transform coefficient derivative (1130) may be configured in the residual processor (230) of FIG2, and the transform coefficient encoder (1140) may be configured in the entropy encoder (240) of FIG2.

[0429] The block splitter (1100) can divide the current block into multiple partitions. That is, the current block can be split based on one or more dividing lines, or geometric division can be applied to the current block.

[0430] The prediction block generator (1110) can generate a prediction block for the current block by performing intra-frame prediction or inter-frame prediction for each partition within the current block. The method for generating prediction blocks is as described with reference to FIG4, and redundant descriptions will be omitted here.

[0431] The residual block derivator (1120) can derive the residual block of the current block based on the predicted block of the current block.

[0432] The transform coefficient derivator (1130) can derive the transform coefficients of the current block from the residual block of the current block. That is, the transform coefficients can be derived by performing at least one of a transform or quantization on the residual block of the current block. Here, the transform can be understood as the inverse process of the inverse transform described with reference to FIG4. The method for determining the transform kernel is described with reference to FIG4, and a detailed description thereof will be omitted here.

[0433] The transform coefficient encoder (1140) can encode the transform coefficients of the current block to generate a bitstream. Based on the transform coefficients of the current block, residual information related to the transform coefficients can be generated, and a bitstream can be generated by encoding the residual information.

[0434] In the above embodiments, the method is described based on a flowchart as a series of steps or blocks. However, the corresponding embodiments are not limited to this order of steps. Some steps may occur simultaneously with other steps or in a different order, as described above. In addition, those skilled in the art will understand that the steps shown in the flowchart are not exclusive. Other steps may be included, or one or more steps in the flowchart may be deleted, without affecting the scope of the embodiments of this disclosure.

[0435] The methods described above according to embodiments of the present disclosure can be implemented in software, and the encoding and / or decoding devices according to the present disclosure can be included in an apparatus for performing image processing, such as a TV, computer, smartphone, set-top box, display device, etc.

[0436] In this disclosure, when the implementation is implemented as software, the above-described method can be implemented as a module (process, function, etc.) performing the above-described functions. The module can be stored in memory and can be executed by a processor. The memory can be internal or external to the processor and can be connected to the processor by various well-known means. The processor may include an application-specific integrated circuit (ASIC), another chipset, logic circuitry, and / or data processing devices. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices. In other words, the implementations described herein can be executed by implementation on a processor, microprocessor, controller, or chip. For example, the functional units shown in the various figures can be executed by implementation on a computer, processor, microprocessor, controller, or chip. In this case, information for implementation (e.g., information about instructions) or algorithms can be stored in a digital storage medium.

[0437] Furthermore, decoding and encoding devices employing embodiments of this disclosure can be included in multimedia broadcasting transmitting and receiving devices, mobile communication terminals, home theater video devices, digital cinema video devices, surveillance cameras, video conferencing devices, real-time communication devices similar to video communication, mobile streaming devices, storage media, cameras, devices for providing video-on-demand (VOD) services, OTT (over-the-top) video devices, devices for providing internet streaming services, three-dimensional (3D) video devices, virtual reality (VR) devices, augmented reality (AR) devices, video telephony devices, transportation terminals (e.g., vehicle (including autonomous vehicle) terminals, aircraft terminals, ship terminals, etc.), and medical video devices, and can be used to process video signals or data signals. For example, OTT (over-the-top) video devices can include game consoles, Blu-ray players, internet-connected televisions, home theater systems, smartphones, tablet PCs, digital video recorders (DVRs), etc.

[0438] Furthermore, the processing methods applying the embodiments of this disclosure can be generated in the form of a computer-executable program and can be stored in a computer-readable recording medium. Multimedia data with data structures according to the embodiments of this disclosure can also be stored in a computer-readable recording medium. Computer-readable recording media include all types of storage devices and distributed storage devices that store computer-readable data. Computer-readable recording media can include, for example, Blu-ray discs (BD), Universal Serial Bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, magnetic tape, floppy disks, and optical media storage devices. Additionally, computer-readable recording media include media implemented in the form of carrier waves (e.g., transmission via the Internet). Furthermore, bitstreams generated by encoding methods can be stored in computer-readable recording media or transmitted via wired / wireless communication networks.

[0439] Furthermore, the embodiments of this disclosure can be implemented by a computer program product using program code, and the program code can be executed on a computer using the embodiments of this disclosure. The program code can be stored on a computer-readable medium.

[0440] Figure 12 illustrates an example of a content streaming system to which embodiments of the present disclosure can be applied.

[0441] Referring to FIG12, a content streaming system applying embodiments of the present disclosure may generally include an encoding server, a streaming server, a network server, a media storage device, a user device, and a multimedia input device.

[0442] An encoding server generates a bitstream by compressing content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data and then sends it to a streaming server. As another example, when multimedia input devices such as smartphones, cameras, and camcorders directly generate bitstreams, the encoding server can be omitted.

[0443] A bitstream can be generated by an encoding method or bitstream generation method that applies the embodiments of this disclosure, and the stream server can temporarily store the bitstream during the sending or receiving of the bitstream.

[0444] A streaming server sends multimedia data to a user device via a web server based on a user request, and the web server acts as a medium to inform the user what services are available. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server sends the multimedia data to the user. In this scenario, the content streaming system may include a separate control server, which controls the commands / responses between the various devices in the content streaming system.

[0445] A streaming server can receive content from media storage and / or encoding servers. For example, when receiving content from an encoding server, content can be received in real time. In this case, to provide a smooth streaming service, the streaming server can store the bitstream for a specific time period.

[0446] Examples of user devices may include mobile phones, smartphones, laptops, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigators, touchscreen PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head-mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc.

[0447] In a content streaming system, each server can operate as a distributed server, and in this case, the data received from each server can be distributed and processed.

[0448] The claims set forth herein can be combined in various ways. For example, the technical features of the method claims of this disclosure can be combined and implemented as an apparatus, and the technical features of the apparatus claims of this disclosure can be combined and implemented as a method. Furthermore, the technical features of the method claims and the apparatus claims of this disclosure can be combined and implemented as an apparatus, and the technical features of the method claims and the apparatus claims of this disclosure can be combined and implemented as a method.

Claims

1. A method comprising the following steps: Divide the current block into multiple partitions; perform a prediction for each of the partitions to generate a prediction block for the current block; The residual block of the current block is derived based on the inverse transformation of the current block; The process involves reconstructing the current block based on the prediction block and the residual block of the current block, wherein the step of deriving the residual block of the current block includes: deriving a virtual intra-frame prediction mode for the current block; and determining a transform set for the inverse transform based on the virtual intra-frame prediction mode.

2. The method according to claim 1, wherein, The virtual intra-frame prediction mode is derived as a predefined fixed mode.

3. The method according to claim 1, wherein, The virtual intra-frame prediction mode is derived based on the segmentation direction of the geometric segmentation of the current block.

4. The method according to claim 3, wherein, The virtual intra-frame prediction mode is derived as an intra-frame prediction mode that matches or is closest to the segmentation direction based on the geometric segmentation of the current block.

5. The method according to claim 3, wherein, The virtual intra-frame prediction mode is derived as an intra-frame prediction mode that matches or is closest to the direction perpendicular to the segmentation direction of the geometric segmentation of the current block.

6. The method according to claim 1, wherein, The virtual intra-frame prediction mode is derived based on at least one of the segmentation type of the current block or the partition index corresponding to the segmentation type.

7. The method according to claim 1, wherein, The virtual intra-frame prediction mode is derived as a decoder-side intra-frame mode derivation DIMD mode, wherein the DIMD mode is derived based on reconstructed samples belonging to the neighboring regions of the current block.

8. The method according to claim 1, wherein, The virtual intra-frame prediction mode is derived as a decoder-side intra-frame prediction DIMD mode, wherein the DIMD mode is derived based on prediction samples of the prediction block belonging to the current block.

9. The method according to claim 1, wherein, The virtual intra-frame prediction mode is derived based on one or more template-based intra-frame mode derivation (TIMD) modes for the current block.

10. The method according to claim 1, wherein, The virtual intra-prediction mode is derived based on at least one of the following: whether the intra-prediction mode corresponding to the segmentation direction of the geometric segmentation of the current block is the same as at least one of the intra-prediction modes applied to the plurality of partitions, or the distance between the segmentation line of the geometric segmentation of the current block and the center of the current block.

11. A method comprising the following steps: Divide the current block into multiple partitions; perform a prediction for each of the partitions to generate a prediction block for the current block; The residual block of the current block is derived based on the prediction block of the current block; the transformation coefficients of the current block are derived based on the transformation of the residual block of the current block; The transform coefficients of the current block are encoded, wherein the step of deriving the transform coefficients of the current block includes: deriving a virtual intra-prediction mode for the current block; and determining a transform set for the transform based on the virtual intra-prediction mode.

12. A computer-readable storage medium storing a bit stream generated by the method according to claim 11.

13. A method comprising the following steps: Obtain a bitstream of image information, wherein the bitstream is generated based on the following steps: dividing a current block into multiple partitions, performing a prediction for each of the partitions to generate a prediction block for the current block, deriving a residual block for the current block based on the prediction block, deriving transform coefficients for the current block based on a transform of the residual block, and encoding the transform coefficients for the current block; and transmitting data including the bitstream, wherein the step of deriving the transform coefficients for the current block includes: deriving a virtual intra-frame prediction mode for the current block; and determining a transform set for the transform based on the virtual intra-frame prediction mode.