Method and apparatus for processing a video signal - Patents.com

By determining and applying non-separated transform matrices based on block dimensions, the method enhances video coding efficiency and reduces complexity, addressing the challenges of processing high-resolution and high-frame-rate video content.

JP7654043B2Active Publication Date: 2025-03-31LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023180024
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-09-02
Filing Date
2023-10-19
Publication Date
2025-03-31
Estimated Expiration
2039-09-02

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in efficiently processing next-generation video content with high spatial resolution, high frame rate, and high scene representation dimensionality, leading to increased memory storage, memory access rate, and processing power requirements.

Method used

The method involves determining the input and output lengths of a non-separated transform based on the height and width of the current block, and applying a non-separated transform matrix to the block, specifically for blocks with dimensions of 4x4, where the input length is 8 and the output length is 16.

Benefits of technology

This approach provides a video coding method with high coding efficiency and low complexity, effectively handling the demands of next-generation video content by optimizing transform operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007654043000026
    Figure 0007654043000026
  • Figure 0007654043000027
    Figure 0007654043000027
  • Figure 0007654043000028
    Figure 0007654043000028
Patent Text Reader

Abstract

To realize a video signal processing method and device which apply transformation having high coding efficiency and low complexity.SOLUTION: There are provided video signal processing method and device according to an embodiment of the present invention. A decoding method of an image signal according to an embodiment of the present invention includes the steps of: determining an input length and an output length of non-separable transformation on the basis of height and width of a current block; determining a non-separable transformation matrix corresponding to the input length and the output length of the non-separable transformation, and applying the non-separable transformation matrix to the current block; and when each of the height and width of the current block is 4, the input length of the non-separable transformation is determined to be 8, and the output length is determined to be 16.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a method and apparatus for processing a video signal, in particular for encoding or decoding a video signal by performing a transformation. [Background technology]

[0002] Compression coding (encoding) refers to a series of signal processing techniques for transferring digitized information over communication lines or storing it in a form suitable for storage media. Media such as video, images, and audio can be subject to compression coding, and the technology that performs compression coding on video in particular is called video compression.

[0003] Next-generation video content will be characterized by high spatial resolution, high frame rate, and high dimensionality of scene representation. Processing such content will bring about a huge increase in memory storage, memory access rate, and processing power.

[0004] Therefore, it is necessary to design coding tools to process next-generation video content more efficiently. In particular, video codec standards following the High Efficiency Video Coding (HEVC) standard require prediction techniques with higher accuracy as well as efficient conversion techniques for converting spatial domain video signals to frequency domain. Summary of the Invention [Problem to be solved by the invention]

[0005] SUMMARY OF THE PRESENT EMBODIMENTS The present invention seeks to provide an image signal processing method and apparatus for applying a transform having high coding efficiency and low complexity.

[0006] The technical problems to be solved by the present invention are not limited to those mentioned above, and other technical problems not mentioned will be clearly understood by those having ordinary skill in the art to which the present invention pertains from the description below. [Means for solving the problem]

[0007] A method for decoding an image signal according to an embodiment of the present invention includes the steps of determining an input length and an output length of a non-separable transform based on the height and width of a current block, determining a non-separable transform matrix corresponding to the input length and output length of the non-separable transform, and applying the non-separable transform matrix to the current block. In this case, if the height and width of the current block are 4, respectively, the input length of the non-separable transform is determined to be 8 and the output length of the non-separable transform is determined to be 16.

[0008] Also, if the height and width of the current block are not 4, respectively, the input length and output length of the non-separable transform are determined to be 16, respectively.

[0009] In addition, the step of applying the non-separable transformation matrix to the current block includes a step of applying the non-separable transformation matrix to a 4x4 region in the upper left corner of the current block if the height and width are not each 4 and the product of the width and height is less than a threshold (critical) value.

[0010] In addition, the step of applying the non-separable transformation matrix to the current block includes the step of applying the non-separable transformation matrix to a 4×4 region in the upper left corner of the current block and a 4×4 region to the right of the upper left 4×4 region if the height and width are not each 4 and the width is greater than or equal to the height.

[0011] In addition, the step of applying the non-separable transformation matrix to the current block includes the step of applying the non-separable transformation matrix to a 4x4 area in the upper left corner of the current block and a 4x4 area located below the upper left 4x4 area if the height and width are not each 4 and the product of the width and height is greater than or equal to a threshold and the width is less than the height.

[0012] In addition, the step of determining a non-separable transform matrix includes a step of determining a non-separable transform set index based on the intra prediction mode of the current block, a step of determining a non-separable transform kernel corresponding to the non-separable transform index within a non-separable transform set contained in the non-separable transform set index, and a step of determining a non-separable transform matrix from the non-separable transform kernel based on an input length and an output length.

[0013] An image signal decoding device according to another embodiment of the present invention includes a memory for storing an image signal and a processor coupled to the memory, wherein the processor is configured to determine an input length and an output length of a non-separable transform based on a height and a width of a current block, determine a non-separable transform matrix corresponding to the input length and the output length of the non-separable transform, and apply the non-separable transform matrix to the current block, whereby when the height and width of the current block are 4 respectively, the length of the non-separable transform is determined to be 8, and the output is 16. Effect of the Invention

[0014] According to an embodiment of the present invention, a video coding method and apparatus having high coding efficiency and low complexity can be provided by applying a transformation based on the size of a current block.

[0015] The effects obtained by the present invention are not limited to those mentioned above, and other effects not mentioned should be clearly understood by those having ordinary skill in the art to which the present invention pertains from the following description. [Brief description of the drawings]

[0016] [Figure 1]1 is a schematic block diagram of an encoding device according to an embodiment of the present invention, in which a video / image signal is encoded. [Diagram 2] 1 is a schematic block diagram of a decoding device that decodes an image signal, according to an embodiment of the present invention; [Figure 3A] FIG. 1 is a diagram illustrating a block division structure based on a QuadTree (QT) as an embodiment to which the present invention can be applied. [Figure 3B] 1 is a diagram illustrating a block division structure based on a Binary Tree (BT), which is an embodiment to which the present invention can be applied. FIG. [Figure 3C] 1 is a diagram illustrating a block division structure based on a Ternary Tree (TT), which is an embodiment to which the present invention can be applied. FIG. [Figure 3D] 1 is a diagram illustrating a block division structure using an Asymmetric Tree (AT), which is an embodiment to which the present invention can be applied. FIG. [Figure 4] 2 is a schematic block diagram of a transform and quantization unit and an inverse quantization and inverse transform unit in the encoding device of FIG. 1, which is an embodiment to which the present invention is applied. [Diagram 5] 1 is a schematic block diagram of an inverse quantization and inverse transform unit in a decoding device according to an embodiment to which the present invention is applied. [Figure 6] 4 is a flowchart illustrating an embodiment of the present invention, in which a video signal is encoded through a primary transformation and a secondary transformation. [Figure 7] 4 is a flowchart showing an embodiment to which the present invention is applied, in which a video signal is decoded through secondary inverse transform and primary inverse transform. [Figure 8] FIG. 2 is a diagram illustrating an example of a transform configuration group to which AMT (Adaptive Multiple Transform) is applied according to an embodiment of the present invention. [Figure 9]FIG. 13 illustrates an example of a flowchart of encoding to which AMT is applied according to an embodiment of the present invention. [Figure 10] FIG. 13 illustrates an example of a flowchart of AMT-applied decoding according to an embodiment of the present invention. [Figure 11] FIG. 2 illustrates an example of a flowchart for encoding an AMT flag and an AMT index according to an embodiment of the present invention. [Figure 12] FIG. 13 is a diagram showing an example of a decoding flowchart for performing conversion based on an AMT flag and an AMT index. [Figure 13] FIG. 2 is a diagram illustrating a Givens rotation according to an embodiment of the present invention. [Figure 14] FIG. 13 is a diagram showing an embodiment to which the present invention is applied, illustrating the configuration of one round in 4×4 NSST composed of a Givens rotation layer and permutation. [Figure 15] 1 is a diagram illustrating an example of a configuration of a non-separable transform set for each intra prediction mode according to an embodiment of the present invention; FIG. [Figure 16] 1 shows three forward scan orders for transform coefficients or transform coefficient blocks: (a) diagonal scan, (b) horizontal scan, and (c) vertical scan. [Figure 17] FIG. 13 is a diagram showing positions of transform coefficients when a forward diagonal scan is applied when a 4×4 RST is applied to a 4×8 block, according to an embodiment to which the present invention is applied. [Figure 18] FIG. 2 is a diagram showing an embodiment to which the present invention is applied, illustrating an example in which valid transform coefficients of two 4×4 blocks are merged into one block. [Figure 19] FIG. 13 is a diagram illustrating an example of a method for constructing an NSST set mixed for each intra prediction mode, according to an embodiment to which the present invention is applied. [Figure 20]FIG. 11 is a diagram showing an example of a method for selecting an NSST set (or kernel) taking into account an intra prediction mode and a transform block size, according to an embodiment to which the present invention is applied. [Figure 21A] FIG. 2 is a diagram showing a forward and inverse reduced transform according to an embodiment of the present invention; [Figure 21B] FIG. 2 is a diagram showing a forward and inverse reduced transform according to an embodiment of the present invention; [Figure 22] FIG. 13 illustrates an example flowchart for decoding using a reduced transform according to an embodiment of the present invention. [Figure 23] FIG. 1 illustrates an example of a flowchart for applying a conditionally contracted transformation in accordance with an embodiment of the present invention. [Figure 24] FIG. 13 illustrates an example of a decoding flowchart for a secondary inverse transform to which a conditionally reduced transform is applied, according to an embodiment of the present invention. [Figure 25A] FIG. 2 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 25B] FIG. 2 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 26A] FIG. 2 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 26B] FIG. 2 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 27] 4A-4C illustrate examples of regions to which a reduced quadratic transform is applied according to an embodiment of the present invention; [Figure 28] FIG. 13 illustrates a downsized transformation according to a downsizing factor according to an embodiment of the present invention. [Figure 29] FIG. 13 shows an example of a flowchart of a decoding process in which a transform is applied according to an embodiment of the present invention. [Diagram 30] FIG. 1 is a block diagram showing an example of an apparatus for processing a video signal according to an embodiment of the present invention; [Diagram 31]FIG. 1 is a diagram showing an example of an image coding system according to an embodiment to which the present invention is applied. [Diagram 32] 1 is a structural diagram of a content streaming system according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0017] The accompanying drawings, which are included as part of the detailed description to aid in understanding the present invention, provide embodiments for the present invention and, together with the detailed description, explain the technical features of the present invention.

[0018] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. The detailed description disclosed below together with the accompanying drawings is intended to describe exemplary embodiments of the present invention, and is not intended to show the only embodiments in which the present invention can be implemented. The following detailed description includes specific details to provide a complete understanding of the present invention. However, those skilled in the art will appreciate that the present invention can be implemented without such specific details.

[0019] In some cases, in order to avoid obscuring the concept of the present invention, well-known structures and devices may be omitted or shown in the form of a block diagram focusing on the core functions of each structure and device.

[0020] In some cases, in order to avoid obscuring the concept of the present invention, well-known structures and devices may be omitted or shown in the form of a block diagram focusing on the core functions of each structure and device.

[0021] Specific terms used in the following description are provided to aid in understanding the present invention, and the use of such specific terms may be changed to other forms without departing from the technical spirit of the present invention. For example, in the case of a signal, data, sample, picture, frame, block, etc., they may be appropriately substituted and interpreted in each coding process.

[0022] Hereinafter, in this specification, the term "processing unit" refers to a unit in which encoding / decoding processes such as prediction, transformation, and / or quantization are performed. In addition, the processing unit may be interpreted as including a unit of a luma component and a unit of a chroma component. For example, the processing unit may correspond to a block, a coding unit (CU), a prediction unit (PU), or a transform unit (TU).

[0023] Also, the processing unit may be interpreted as a unit of a luminance component or a unit of a chrominance component. For example, the processing unit may correspond to a CTB, CB, PU, ​​or TB of the luminance component. Alternatively, the processing unit may correspond to a CTB, CB, PU, ​​or TB of the chrominance component. Also, without being limited thereto, the processing unit may be interpreted to include a unit of a luminance component and a unit of a chrominance component.

[0024] Furthermore, the processing units are not necessarily limited to square blocks, but may be configured in the shape of polygons having three or more vertices.

[0025] In the following description, pixels, picture elements, or coefficients (transformation coefficients or transformation coefficients that have undergone linear transformation) are collectively referred to as samples. Using a sample means using pixel values, picture element values, or coefficients (transformation coefficients or transformation coefficients that have undergone linear transformation).

[0026] Hereinafter, a method for designing and applying a reduced secondary transform (RST) in consideration of worst-case computational complexity for encoding / decoding still or moving images will be described.

[0027] The present invention provides an image and video compression method and apparatus. The compressed data has a form of a bitstream, and the bitstream can be stored in various forms of storage or can be streamed over a network and transmitted to a terminal having a decoder. When a display device is attached to the terminal, the decoded image can be displayed on the display device, or the bitstream data can simply be stored. The method and apparatus proposed in the embodiments of the present invention can be applied to both an encoder and a decoder, and can be applied to both a device that generates a bitstream or a device that receives a bitstream, regardless of whether the terminal outputs the data through a display device or not.

[0028] The image compression device is composed of a prediction unit, a transformation and quantization unit, and an entropy coding unit, and schematic block diagrams of the encoding device and the decoding device are shown in Figures 1 and 2. In the transformation and quantization unit, a prediction signal is subtracted from an original signal, and the residual signal is transformed into a frequency domain signal by a transformation such as DCT (Discrete Cosine Transform)-2, and then quantization is applied to significantly reduce the number of non-zero signals, enabling image compression.

[0029] FIG. 1 is a schematic block diagram of an encoding device according to an embodiment of the present invention, in which a video / image signal is encoded.

[0030] The image division unit 110 divides an input image (or picture, frame) input to the encoding device 100 into one or more processing units. As an example, the processing units may be called coding units (CUs). In this case, the coding units are recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree (QTBT) structure. For example, one coding unit is divided into a plurality of deeper coding units based on a quad-tree structure and / or a binary tree structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present invention is performed based on the final coding unit that is not further divided. In this case, the largest coding unit may be used as the final coding unit immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure includes procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit are each divided or partitioned from the final coding unit described above. The prediction unit is a unit of sample prediction, and the transform unit may be a unit for deriving (inducing) transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.

[0031] The unit may be mixed with terms such as block or area in some cases. In the general case, an M×N block refers to a set of samples or transform coefficients consisting of M columns and N rows. A sample generally refers to a pixel or pixel value, and may refer to only the value of a pixel / pixel of a luma component, or may refer to only the value of a pixel / pixel of a chroma component. A sample can be used as a term corresponding to a pixel or pel of one picture (or image).

[0032] The encoding device 100 subtracts a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 180 or the intra prediction unit 185 from an input image signal (original block, original sample array) to generate a residual signal (residual signal, residual block, residual sample array), and the generated residual signal is transmitted to the conversion unit 120. In this case, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoder 100 as shown in the figure may be called a subtraction unit 115. The prediction unit performs prediction on a block to be processed (hereinafter, referred to as a current block) and generates a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit generates various information related to prediction, such as prediction mode information, as will be described later in the description of each prediction mode, and transmits the information to the entropy encoding unit 190. The prediction information is encoded in the entropy encoding unit 190 and output in the form of a bitstream.

[0033] The intra prediction unit 185 predicts the current block by referring to samples in the current picture. The referenced samples are located in the neighborhood of the current block or away from it depending on the prediction mode. In the intra prediction, the prediction mode includes a plurality of non-directional modes and a plurality of directional modes. The non-directional modes include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of fineness of the prediction direction. However, this is an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 185 may also determine the prediction mode to be applied to the current block using the prediction modes applied to the neighboring blocks.

[0034] The inter prediction unit 180 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information includes a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 180 may construct a motion information candidate list based on neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of skip mode and merge mode, the inter prediction unit 180 may use the motion information of the neighboring blocks as the motion information of the current block. In the case of skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of the Motion Vector Prediction (MVP) mode, the motion vector of the surrounding blocks can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.

[0035] The prediction signal generated by the inter prediction unit 180 or the intra prediction unit 185 is used to generate a reconstructed signal or is used to generate a residual signal.

[0036] The transform unit 120 applies a transform technique to the residual signal to generate transform coefficients. For example, the transform technique includes at least one of DCT, DST (Discrete Sine Transform), KLT (Karhunen-Loeve Transform), GBT (Graph-Based Transform), and CNT (Conditionally Non-linear Transform). Here, GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on a predicted signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or may be applied to blocks of variable sizes that are not square.

[0037] The quantization unit 130 quantizes the transform coefficients and transmits them to the entropy encoding unit 190, which encodes the quantized signal (information on the quantized transform coefficients) and outputs it to a bitstream. The information on the quantized transform coefficients may be called residual information. The quantization unit 130 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit 190 may perform various encoding methods, such as exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC). The entropy encoding unit 190 may encode information required for video / image restoration (e.g., values ​​of syntax elements) together with or separately from the quantized transform coefficients. The encoded information (e.g., video / image information) is transmitted or stored in the form of a bitstream in Network Abstraction Layer (NAL) units. The bitstream is transmitted over a network or stored in a digital storage medium. Here, the network includes a broadcast network and / or a communication network, and the digital storage medium includes various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) that transmits the signal output from the entropy encoding unit 190 and / or a storage unit (not shown) that stores the signal may be configured as an internal / external element of the encoding device 100, or the transmitting unit may be a component of the entropy encoding unit 190.

[0038] The quantized transform coefficients output from the quantizer 130 may be used to generate a prediction signal. For example, the quantized transform coefficients may be subjected to inverse quantization and inverse transformation by the inverse quantizer 140 and the inverse transformer 150 in the loop to restore a residual signal. The adder 155 generates a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit 180 or the intra prediction unit 185. When there is no residual for the processing target block, such as when the skip mode is applied, the predicted block may be used as the reconstructed block. The adder 155 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next processing target block in the current picture, or may be used for inter prediction of the next picture after filtering as described below.

[0039] The filtering unit 160 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 160 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture and transmit the modified reconstructed picture to the decoded picture buffer 170. The various filtering methods may include, for example, deblock filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filtering unit 160 generates various information related to filtering, as will be described later in the description of each filtering method, and transmits the information to the entropy encoding unit 190. The information related to filtering is encoded in the entropy encoding unit 190 and output in the form of a bitstream.

[0040] The modified decoded picture transmitted to the decoded picture buffer 170 is used as a reference picture in the inter prediction unit 180. This allows the encoding device 100 to avoid prediction mismatch between the encoding device 100 and the decoding device when inter prediction is applied, and also improves coding efficiency.

[0041] The decoded picture buffer 170 may store the modified reconstructed picture for use as a reference picture in the inter predictor 180 .

[0042] FIG. 2 is a schematic block diagram of a decoding device that decodes an image signal, according to an embodiment of the present invention.

[0043] As shown in FIG. 2, the decoding device 200 includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an adder 235, a filtering unit 240, a decoded picture buffer (DPB) 250, an inter prediction unit 260, and an intra prediction unit 265. The inter prediction unit 260 and the intra prediction unit 265 may be collectively referred to as a prediction unit. That is, the prediction unit includes an inter prediction unit 180 and an intra prediction unit 185. The inverse quantization unit 220 and the inverse transform unit 230 may be collectively referred to as a residual processing unit. That is, the residual processing unit includes an inverse quantization unit 220 and an inverse transform unit 230. The entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the adder 235, the filtering unit 240, the inter prediction unit 260, and the intra prediction unit 265 may be configured by one hardware component (e.g., a decoder or a processor) according to an embodiment. Also, the decoded picture buffer 250 may be implemented as a single hardware component (eg, a memory or a digital storage medium) depending on the embodiment.

[0044] When a bitstream including video / image information is input, the decoding apparatus 200 can restore an image corresponding to the process in which the video / image information is processed in the encoding apparatus 100 of Fig. 2. For example, the decoding apparatus 200 performs decoding using a processing unit applied in the encoding apparatus 100. Thus, the processing unit for decoding is, for example, a coding unit, and the coding unit is divided from a coding tree unit or a maximal coding unit according to a quadtree structure and / or a binary tree structure. Then, the restored image signal decoded and output by the decoding apparatus 200 is reproduced by a reproduction device.

[0045] The decoding device 200 receives a signal output from the encoding device 100 of Fig. 2 in the form of a bitstream, and the received signal is decoded via an entropy decoding unit 210. For example, the entropy decoding unit 210 parses the bitstream to derive information (e.g., video / image information) required for image restoration (or picture restoration). For example, the entropy decoding unit 210 may decode information in the bitstream based on a coding method such as Exponential Golomb Coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in a bitstream, determines a context model using information on the syntax element to be decoded and decoding information on neighboring and to-be-decoded blocks or information on symbols / bins decoded in a previous stage, predicts the occurrence probability of a bin according to the determined context model, and performs arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element. Here, after determining the context model, the CABAC entropy decoding method may update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin. Prediction information among the information decoded in the entropy decoding unit 210 is provided to a prediction unit (inter prediction unit 260 and intra prediction unit 265), and residual values ​​entropy-decoded in the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, are input to the inverse quantization unit 220. In addition, information regarding filtering among the information decoded in the entropy decoding unit 210 is provided to the filtering unit 240. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device 100 may be further configured as an internal / external element of the decoding device 200, or the receiving unit may be a component of the entropy decoding unit 210.

[0046] The inverse quantization unit 220 inverse quantizes the quantized transform coefficients and outputs transform coefficients. The inverse quantization unit 220 rearranges the quantized transform coefficients in a two-dimensional block format. In this case, the rearrangement may be performed based on the coefficient scan order performed in the encoding apparatus 100. The inverse quantization unit 220 performs inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.

[0047] The inverse transform unit 230 obtains a residual signal (residual block, residual sample array) by inverse transforming the transform coefficients.

[0048] The prediction unit performs prediction on the current block and generates a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on the prediction information output from the entropy decoding unit 210, and may determine a specific intra / inter prediction mode.

[0049] The intra prediction unit 265 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located far away depending on the prediction mode. In intra prediction, the prediction modes include all of a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 265 may also determine the prediction mode to be applied to the current block using the prediction modes applied to the neighboring blocks.

[0050] The inter prediction unit 260 derives a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information is predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 260 configures a motion information candidate list based on information on the prediction of the neighboring blocks, and derives a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter prediction is performed based on various prediction modes, and the information on the prediction includes information indicating the mode of inter prediction for the current block.

[0051] The adder 235 generates a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from the inter prediction unit 260 or the intra prediction unit 265. When there is no residual for the current block, such as when the skip mode is applied, the predicted block can be used as the reconstructed block.

[0052] The adder 235 may be referred to as a reconstruction unit or a reconstruction block generator. The reconstruction signal generated may be used for intra prediction of the next block to be processed in the current picture, or may be used for inter prediction of the next picture after filtering as described below.

[0053] The filtering unit 240 can improve the subjective / objective picture quality by applying filtering to the reconstructed signal. For example, the filtering unit 240 applies various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and transmits the modified reconstructed picture to the decoded picture buffer 250. The various filtering methods include, for example, deblock filtering, Sample Adaptive Offset (SAO), Adaptive Loop Filter (ALF), and bilateral filter.

[0054] The modified decoded picture sent to the decoded picture buffer 250 can be used as a reference picture by the inter predictor 260.

[0055] In this document, the embodiments described for the filtering unit 160, the inter prediction unit 180, and the intra prediction unit 185 of the encoding device 100 are equally or correspondingly applicable to the filtering unit 240, the inter prediction unit 260, and the intra prediction unit 265 of the decoding device 200, respectively.

[0056] FIG. 3 shows an embodiment to which the present invention can be applied, in which FIG. 3A illustrates a block division structure using QT (QuadTree: QT), FIG. 3B illustrates a block division structure using BT (Binary Tree: BT), FIG. 3C illustrates a block division structure using TT (Ternary Tree: TT), and FIG. 3D illustrates a block division structure using AT (Asymmetric Tree: AT).

[0057] In video coding, a block may be divided on a QT basis. A subblock divided by QT may be further divided recursively using QT. A leaf block that is not further divided by QT is divided by at least one of BT, TT, or AT. BT may have two types of division, horizontal BT (2N×N, 2N×N) and vertical BT (N×2N, N×2N). TT may have two types of division, horizontal TT (2N×1 / 2N, 2N×N, 2N×1 / 2N) and vertical TT (1 / 2N×2N, N×2N, 1 / 2N×2N). The AT can have four forms of partitioning: horizontal-up AT (2N×1 / 2N, 2N×3 / 2N), horizontal-down AT (2N×3 / 2N, 2N×1 / 2N), vertical-left AT (1 / 2N×2N, 3 / 2N×2N), and vertical-right AT (3 / 2N×2N, 1 / 2N×2N). Each BT, TT, and AT may be further partitioned recursively using BT, TT, and AT.

[0058] Figure 3A shows an example of QT division. Block A is divided into four sub-blocks (A0, A1, A2, A3) by QT. Sub-block A1 is again divided into four sub-blocks (B0, B1, B2, B3) by QT.

[0059] FIG. 3B shows an example of BT division. Block B3, which is not further divided by QT, is divided into vertical BT(C0, C1) or horizontal BT(D0, D1). Like block C0, each sub-block is further divided recursively, such as in the form of horizontal BT(E0, E1) or vertical BT(F0, F1).

[0060] FIG. 3C shows an example of TT division. Block B3, which is not further divided by QT, is divided into vertical TTs (C0, C1, C2) or horizontal TTs (D0, D1, D2). Like block C1, each sub-block is further divided recursively, such as in the form of horizontal TTs (E0, E1, E2) or vertical TTs (F0, F1, F2).

[0061] FIG. 3D shows an example of AT division. Block B3, which is not further divided by QT, is divided into vertical AT(C0, C1) or horizontal AT(D0, D1). Like block C1, each sub-block can be further divided recursively, such as in the form of horizontal AT(E0, E1) or vertical TT(F0, F1).

[0062] Meanwhile, BT, TT, and AT division may be used together. For example, a subblock divided by BT can be divided by TT or AT. Also, a subblock divided by TT can be divided by BT or AT. A subblock divided by AT can be divided by BT or TT. For example, after horizontal BT division, each subblock can be divided into vertical BT, or after vertical BT division, each subblock can be divided into horizontal BT. In this case, the division order is different, but the final divided shape is the same.

[0063] Also, when a block is divided, the order of searching the block can be defined in various ways. In general, the search is performed from left to right and from top to bottom, and searching the block means the order of determining whether each divided sub-block can be further divided into blocks, the order of coding each sub-block if the block is not further divided, or the order of searching when referring to information of other adjacent blocks in a sub-block.

[0064] Transformation may be performed for each processing unit (or transformation block) divided according to the division structure as shown in Figures 3A to 3D, and in particular, transformation matrices may be applied by dividing into row and column directions. According to an embodiment of the present invention, different transformation types may be used depending on the length of the processing unit (or transformation block) in the row direction or column direction.

[0065] 4 and 5 are embodiments to which the present invention is applied. FIG. 4 shows a schematic block diagram of the transform and quantization unit 120 / 130 and the inverse quantization and inverse transform unit 140 / 150 in the encoding device 100 of FIG. 1, and FIG. 5 shows a schematic block diagram of the inverse quantization and inverse transform unit 220 / 230 in the decoding device 200.

[0066] 4, the transform and quantization unit 120 / 130 includes a primary transform unit 121, a secondary transform unit 122, and a quantization unit 130. The inverse quantization and inverse transform unit 140 / 150 includes an inverse quantization unit 140, an inverse secondary transform unit 151, and an inverse primary transform unit 152.

[0067] As shown in FIG. 5, the inverse quantization and inverse transform unit 220 / 230 includes an inverse quantization unit 220 , an inverse secondary transform unit 231 and an inverse primary transform unit 232 .

[0068] In the present invention, when a transformation is performed, the transformation is performed through multiple stages. For example, as shown in Figure 4, two stages of a primary transform and a secondary transform can be applied, and more transformation stages can be used depending on the algorithm. Here, the primary transform may be called a core transform.

[0069] The primary transform unit 121 applies a primary transform to the residual signal, where the primary transform may already be defined (pre-defined) as a table in the encoder and / or decoder.

[0070] The secondary transform unit 122 applies a secondary transform to the primary transformed signal, where the secondary transform may already be defined as a table in the encoder and / or decoder.

[0071] In one embodiment, a non-separable secondary transform (NSST) may be conditionally applied as the secondary transform. For example, the NSST may be applied only for intra-frame prediction blocks, and may have a set of applicable transforms for each prediction mode group.

[0072] Here, the prediction mode group is set based on symmetry with respect to the prediction direction. For example, since the prediction mode 52 and the prediction mode 16 are symmetric with respect to the prediction mode 34 (diagonal direction), one group can be formed and the same transform set can be applied. Here, when applying a transform to the prediction mode 52, the input data is transposed before being applied, because the transform set is the same as that of the prediction mode 16.

[0073] On the other hand, Planar and DC modes have their own transformation sets, each consisting of two transformations, since there is no symmetry with respect to direction. For the remaining directional modes, each transformation set consists of three transformations.

[0074] The quantization unit 130 quantizes the secondary transformed signal.

[0075] The inverse quantization and inverse transformation unit 140 / 150 performs the above-described process in reverse, and a duplicated description will be omitted.

[0076] FIG. 5 shows a schematic block diagram of the inverse quantization and inverse transform unit 220 / 230 in the decoding device 200.

[0077] As shown in FIG. 5, the inverse quantization and inverse transform unit 220 / 230 includes an inverse quantization unit 220 , an inverse secondary transform unit 231 and an inverse primary transform unit 232 .

[0078] The inverse quantization unit 220 obtains transform coefficients from the entropy decoded signal using the quantization step size information.

[0079] Inverse secondary transform unit 231 performs an inverse secondary transform on the transform coefficients. Here, the inverse secondary transform refers to the inverse transform of the secondary transform described with reference to FIG.

[0080] The inverse primary transform unit 232 performs an inverse primary transform on the inverse secondary transformed signal (or block) to obtain a residual signal. Here, the inverse primary transform refers to an inverse transform of the primary transform described in FIG. 4.

[0081] FIG. 6 shows a flowchart for encoding a video signal by primary conversion and secondary conversion, which is an embodiment to which the present invention is applied. Each operation shown in FIG. 6 is performed by the conversion unit 120 of the encoding device 100.

[0082] The encoding device 100 determines (or selects) a forward secondary conversion based on at least one of the prediction mode, block shape, and / or block size of the current block (S610).

[0083] The encoding device 100 can determine an optimal forward secondary conversion by rate-distortion optimization. The optimal forward secondary conversion corresponds to one of a plurality of conversion combinations, and the plurality of conversion combinations are defined by conversion indexes. For example, for rate-distortion optimization, the encoding device 100 can compare the results of performing all of forward secondary conversion, quantization, residual coding, etc. for each candidate.

[0084] The encoding device 100 signals a secondary conversion index corresponding to the optimal forward secondary conversion (S620). Here, other embodiments described in this specification can be applied to the secondary conversion index.

[0085] On the other hand, the encoding device 100 performs a forward primary conversion on the current block (residual block) (S630).

[0086] The encoding device 100 performs a forward secondary conversion on the current block using the optimal forward secondary conversion (S640). On the other hand, the forward secondary conversion can be the RST described below. The RST means a conversion in which N pieces of residual data (N×1 residual vector) are input and R pieces of conversion coefficient data (R×1 conversion coefficient vector) are output (R < N).

[0087] In one embodiment, the RST can be applied to a specific region of the current block. For example, when the current block is N×N, the specific region may mean the N / 2×N / 2 region on the upper left side. However, the present invention is not limited thereto, and is set differently depending on at least one of the prediction mode, the block shape, or the block size. For example, when the current block is N×N, the specific region may mean the M×M region (M≦N) on the upper left side.

[0088] Meanwhile, encoding device 100 generates a transform coefficient block by performing quantization on the current block (S650).

[0089] The encoding device 100 can perform entropy encoding on the transform coefficient blocks to generate a bitstream.

[0090] 7 is a flowchart showing an embodiment of the present invention, in which a video signal is decoded by secondary inverse transform and primary inverse transform. Each operation shown in FIG.

[0091] The decoding device 200 obtains a secondary transform index from the bitstream (S710).

[0092] The decoding device 200 derives a secondary transform corresponding to the secondary transform index (S720).

[0093] However, steps S710 and S720 are only an embodiment, and the present invention is not limited thereto.For example, the decoding device 200 can derive the secondary transformation based on at least one of the prediction mode, block shape and / or block size of the current block without obtaining the secondary transformation index.

[0094] Meanwhile, the decoder 200 entropy decodes the bitstream to obtain a transform coefficient block, and performs inverse quantization on the transform coefficient block (S730).

[0095] The decoder 200 performs an inverse secondary transform on the dequantized transform coefficient block (S740). For example, the inverse secondary transform may be an inverse RST. The inverse RST is a transpose matrix of the RST described in FIG. 6, and refers to a transform in which R transform coefficient data (Rx1 transform coefficient vector) is input and N residual data (Nx1 residual vector) is output.

[0096] In one embodiment, the reduced secondary transform may be applied to a specific region of the current block. For example, when the current block is N×N, the specific region may refer to the N / 2×N / 2 region on the upper left side. However, the present invention is not limited thereto, and may be set differently depending on at least one of the prediction mode, the block shape, or the block size. For example, when the current block is N×N, the specific region may refer to the M×M region (M≦N) or M×L (M≦N, L≦N) on the upper left side.

[0097] Then, the decoder 200 performs an inverse primary transform on the result of the inverse secondary transform (S750).

[0098] The decoder 200 generates a residual block in step S750, and generates a reconstructed block by adding the residual block and the prediction block.

[0099] FIG. 8 illustrates an example of a transform configuration group to which AMT (Adaptive Multiple Transform) is applied according to an embodiment of the present invention.

[0100] 8, the transform setting group is determined based on the prediction mode, and the number of groups may be six in total (G0 to G5). G0 to G4 correspond to cases where intra prediction is applied, and G5 indicates a transform combination (or a transform set, or a transform combination set) applied to a residual block generated by inter prediction.

[0101] A transformation combination consists of a horizontal transform (or row transform) applied to the rows of a given two-dimensional block, and a vertical transform (or column transform) applied to the columns.

[0102] Here, each of all transform setting groups includes four transform combination candidates. The four transform combination candidates are selected or determined by transform combination indexes of 0 to 3, and the transform combination indexes are transmitted from the encoding device 100 to the decoding device 200 by an encoding procedure.

[0103] In one embodiment, residual data (or residual signals) obtained by intra prediction have different statistical characteristics depending on the intra prediction mode. Therefore, a transform other than a general cosine transform may be applied depending on the intra prediction mode as shown in Fig. 8. In this document, the transform type may be expressed as, for example, DCT-Type 2, DCT-II, or DCT-2.

[0104] As shown in FIG. 8, transform set configurations are illustrated for a case where 35 intra prediction modes are used and a case where 67 intra prediction modes are used. A plurality of transform combinations may be applied for each transform setting group divided in the intra prediction mode column. For example, a plurality of transform combinations (row-direction transform, column-direction transform) are configured with four combinations. More specifically, since DST-7 and DCT-5 may be applied to all of the row (horizontal) and column (vertical) directions in group 0, four combinations are possible.

[0105] Since a total of four transform kernel combinations can be applied to each intra prediction mode, a transform combination index for selecting one of them is transmitted for each transform unit. In this document, the transform combination index is referred to as an AMT index and may be expressed as amt_idx.

[0106] In addition to the transform kernels shown in Fig. 8, there are cases where DCT-2 is optimal for both the row and column directions due to the characteristics of the residual signal. Therefore, by defining an AMT flag for each coding unit, transform can be performed adaptively. Here, when the AMT flag is 0, DCT-2 is applied to both the row and column directions, and when the AMT flag is 1, one of the four combinations can be selected or determined by the AMT index.

[0107] In one embodiment, when the AMT flag is 0, if the number of transform coefficients for one transform unit is less than 3, the transform kernel in FIG. 8 is not applied, and DST-7 is applied to all rows and columns.

[0108] In one embodiment, the transform coefficient values ​​are parsed first, and if the number of transform coefficients is less than 3, the amount of transmission of additional information can be reduced by applying DST-7 without parsing the AMT index.

[0109] In one embodiment, AMT can be applied only if the width and height of the transformation unit are all less than or equal to 32.

[0110] In one embodiment, FIG. 8 may be pre-configured by off-line training.

[0111] In one embodiment, the AMT index may be defined by one index that can simultaneously indicate a combination of a horizontal transform and a vertical transform, or the AMT index may be defined separately by a horizontal transform index and a vertical transform index.

[0112] A technique for applying a selected transform from multiple transform kernels (e.g., DCT-2, DST-7, DCT-8) such as the aforementioned AMT may be referred to as MTS (Multiple Transform Selection) or EMT (Enhanced Multiple Transform), and an AMT index may be referred to as an MT index.

[0113] 9 shows an example of a flowchart of encoding using AMT according to an embodiment of the present invention. The operations shown in FIG.

[0114] Although this document describes an embodiment that essentially applies transforms separately for the horizontal and vertical directions, the transform combination can also be composed of non-separable transforms.

[0115] It can also be configured as a mixture of separable and non-separable transformations. In this case, if a non-separable transformation is used, there is no need to select a transformation by row / column or by horizontal / vertical direction, and the transformation combination in Figure 8 is used only when a separable transformation (a transformation that can be separated) is selected.

[0116] In addition, the method proposed in this specification can be applied regardless of whether it is a primary transform or a secondary transform. That is, there is no restriction that it must be applied to only one of the two, and it can be applied to both. Here, the primary transform may refer to a transform for first transforming a residual block, and the secondary transform may refer to a transform for applying a transform to a block generated as a result of the primary transform.

[0117] First, the encoding apparatus 100 determines a transform setting group corresponding to a current block (S910). Here, the transform setting group may be configured as shown in FIG.

[0118] The encoding device 100 performs a transform on a combination of candidate transforms available in the transform setting group (S920).

[0119] As a result of the transformation execution, encoding apparatus 100 determines or selects the transformation combination with the smallest RD (Rate Distortion) cost (S930).

[0120] The encoding device 100 encodes a transform combination index corresponding to the selected transform combination (S940).

[0121] 10 shows an example of a flowchart of decoding to which AMT is applied according to an embodiment of the present invention. The operation shown in FIG.

[0122] First, the decoding device 200 determines a transform setting group for a current block (S1010). The decoding device 200 parses (or obtains) a transform combination index from a video signal, where the transform combination index corresponds to any one of a plurality of transform combinations in the transform setting group (S1020). For example, the transform setting group includes DCT-2, DST-7, or DCT-8.

[0123] The decoding device 200 derives a transform combination corresponding to the transform combination index (S1030). Here, the transform combination is composed of a horizontal transform and a vertical transform, and includes at least one of DCT-2, DCT-7, or DCT-8. In addition, the transform combination may use the transform combination described in FIG. 8.

[0124] The decoding device 200 performs an inverse transform on the current block based on the derived transform combination (S1040). If the transform combination is composed of a row (horizontal) transform and a column (vertical) transform, the row (horizontal) transform may be applied first, and then the column (vertical) transform may be applied. However, the present invention is not limited thereto, and if the transform combination is composed of an inversely applied or non-separable transform, the non-separable transform may be applied immediately.

[0125] In one embodiment, if the vertical or horizontal transform is a DST-7 or DCT-8, the inverse DST-7 or inverse DCT-8 transform is applied column by column and then row by row, and a different vertical or horizontal transform is applied to each row and / or each column.

[0126] In one embodiment, the transform combination index may be obtained based on an AMT flag indicating whether AMT is performed. That is, the transform combination index may be obtained only when AMT is performed according to the AMT flag. In addition, the decoding device 200 checks whether the number of non-zero transform coefficients is greater than a threshold. Here, the transform combination index may be parsed only when the number of non-zero transform coefficients is greater than a threshold.

[0127] In one embodiment, the AMT flag or AMT index is defined at least at one level of a sequence, a picture, a slice, a block, a coding unit, a transform unit, or a prediction unit.

[0128] Meanwhile, in another embodiment, the process of determining the transform set group and the process of parsing the transform combination index may be performed simultaneously, or step S1010 may be omitted since it is already set in the encoding device 100 and / or the decoding device 200.

[0129] 11 shows an example of a flowchart for encoding an AMT flag and an AMT index according to an embodiment of the present invention. The operation of FIG.

[0130] Encoding apparatus 100 determines whether or not AMT is applied to the current block (S1110).

[0131] When AMT is applied, encoding device 100 performs encoding with AMT flag=1 (S1120).

[0132] Then, the encoding device 100 determines an AMT index based on at least one of the prediction mode, horizontal transform, and vertical transform of the current block (S1130). Here, the AMT index indicates an index indicating one of a plurality of transform combinations for each intra prediction mode, and the AMT index is transmitted for each transform unit.

[0133] When the AMT index is determined, encoding device 100 encodes the AMT index (S1140).

[0134] On the other hand, when AMT is not applied, encoding device 100 performs encoding with AMT flag=0 (S1150).

[0135] FIG. 12 shows an example of a decoding flowchart for performing conversion based on the AMT flag and the AMT index.

[0136] The decoding device 200 parses the AMT flag from the bitstream (S1210). Here, the AMT flag indicates whether or not AMT is applied to the current block.

[0137] The decoding device 200 determines whether or not AMT is applied to the current block based on the AMT flag (S1220). For example, it determines whether or not the AMT flag is 1.

[0138] If the AMT flag is 1, the decoding device 200 parses the AMT index (S1230). Here, the AMT index refers to an index indicating one of a plurality of transform combinations for each intra prediction mode, and the AMT index can be transmitted for each transform unit. Alternatively, the AMT index refers to an index indicating one of the transform combinations defined in a pre-set transform combination table, and here, the pre-set transform combination table may refer to FIG. 8, but the present invention is not limited thereto.

[0139] The decoding device 200 derives or determines the horizontal transform and the vertical transform based on at least one of the AMT index or the prediction mode (S1240).

[0140] Alternatively, the decoding device 200 derives a transform combination corresponding to the AMT index. For example, the decoding device 200 derives or determines a horizontal transform and a vertical transform corresponding to the AMT index.

[0141] On the other hand, if the AMT flag is 0, the decoding apparatus 200 applies the previously set inverse vertical transform to each column (S1250). For example, the inverse vertical transform may be an inverse transform of the DCT-2.

[0142] Then, the decoding device 200 applies the previously set horizontal inverse transform to each row (S1260). For example, the horizontal inverse transform may be an inverse transform of DCT-2. That is, when the AMT flag is 0, a transform kernel that has already been set in the encoding device 100 or the decoding device 200 is used. For example, a frequently used transform kernel may be used instead of being defined in a transform combination table such as that of FIG. 8.

[0143] NSST (Non-Separable Secondary Transform)

[0144] A secondary transform is a process in which a transform kernel is applied again to the result of a primary transform. Primary transforms include DCT-2 and DST-7 in HEVC, and the AMT mentioned above. A non-separable transform is a process in which an N×N 2D residual block is divided into N 2 × 1 vector, and then apply N 2 ×N 2 This refers to applying the transformation kernel only once.

[0145] That is, NSST refers to a non-separable square matrix applied to a vector composed of coefficients of a transform block. In addition, although the embodiments of this document are described mainly with NSST as an example of a non-separable transform applied to the upper left region (low frequency region) determined by the size of the block, the embodiments of the present invention are not limited to the term NSST, and any type of non-separable transform can be applied to the embodiments of the present invention. For example, a non-separable transform applied to the upper left region (low frequency region) determined by the size of the block is called LFNST (Low Frequency Non-Separable Transform). In this document, M×N transform (or transform matrix) means a matrix composed of M rows and N columns.

[0146] In NSST, the two-dimensional block data obtained by applying the linear transformation is divided into M × M blocks, and then M 2 ×M 2A non-separable transform is applied. The value of M can be 4 or 8. It is also possible to apply NSST only to a part of the region, rather than to all the regions of the two-dimensional block obtained by the primary transform. For example, NSST can be applied only to the top-left 8×8 block. Also, only when the width and height of the two-dimensional block obtained by the primary transform are both 8 or more, a 64×64 non-separable transform can be applied to the top-left 8×8 region, and the remaining cases can be divided into 4×4 blocks and the 16×16 non-separable transform can be applied to each of them.

[0147] M 2 ×M 2 Although the non-separable transformation can be applied in the form of a matrix multiplication, it can be approximated by a combination of a Givens rotation layer and a permutation layer to reduce the amount of calculation and memory required. Figure 13 shows one Givens rotation. As shown in Figure 13, it can be explained by one angle of one Givens rotation.

[0148] 13 and 14 are embodiments to which the present invention is applied. FIG. 13 shows a diagram for explaining Givens rotation, and FIG. 14 shows the configuration of one round in 4×4 NSST consisting of a Givens rotation layer and permutation.

[0149] Both the 8x8NSST and the 4x4NSST can be constructed by a hierarchical combination of Givens rotations. The matrix corresponding to one Givens rotation is shown in Equation 1, and the matrix multiplication can be represented diagrammatically as shown in Figure 13.

[0150] <Formula 1>

number

[0151] <Formula 2>

number

[0152] As the final step, a final permutation is applied to the data output through the Givens rotation layer, and information about the permutation is stored separately for each transformation. The permutation is applied at the end of the forward NSST, and the inverse permutation is applied first to the inverse NSST.

[0153] Inverse NSST rotates the images by reversing the Givens rotation layers and permutations applied in forward NSST, and also by taking negative (-) values ​​for the angles of each Givens rotation.

[0154] FIG. 15 illustrates an example of a configuration of a non-separable transform set for each intra prediction mode according to an embodiment of the present invention.

[0155] Intra prediction modes to which the same NSST or NSST set is applied may form a group. In FIG. 15, 67 intra prediction modes are classified into 35 groups, and for example, the 20th mode and the 48th mode both belong to the 20th group (hereinafter, the mode group).

[0156] For each mode group, multiple NSSTs, not just one NSST, may be configured as a set. Each set includes a case where NSST is not applied. For example, when three different NSSTs can be applied to one mode group, one of four cases including the case where NSST is not applied may be selected. Here, an index is transmitted in units of TU to distinguish one of the four cases. The number of NSSTs may be configured to be different for each mode group. For example, the 0th and 1st mode groups are signaled to select one of three cases including the case where NSST is not applied.

[0157] Embodiment 1: RST applicable to 4x4 blocks

[0158] A non-separable transform that can be applied to one 4×4 block is a 16×16 transform. That is, when the data elements constituting the 4×4 block are arranged in a row-first or column-first order, a 16×1 vector is obtained, and the non-separable transform can be applied to the 16×1 vector. A forward 16×16 transform is composed of 16 row-wise transform basis vectors, and a transform coefficient for the transform basis vector is obtained by taking an inner product between the 16×1 vector and each transform basis vector. The process of obtaining the transform coefficients for all 16 transform basis vectors is similar to multiplying a 16×16 non-separable transform matrix by an input 16×1 vector. The transform coefficients obtained by the matrix multiplication have the form of a 16×1 vector, but the statistical characteristics may differ depending on the transform coefficient. For example, if a 16×1 transform coefficient vector is composed of the 0th element to the 15th element, the variance of the 0th element may be greater than the variance of the 15th element. That is, the earlier an element is located, the greater its variance value and the greater its energy value.

[0159] Applying an inverse 16×16 non-separable transform to the 16×1 transform coefficients can restore the original 4×4 block signal (ignoring effects such as quantization and integerization). If the forward 16×16 non-separable transform is an orthonormal transform, the inverse 16×16 transform can be obtained by taking the matrix transpose of the forward 16×16 transform. In simple terms, multiplying the 16×1 transform coefficient vector by the inverse 16×16 non-separable transform matrix results in data in the form of a 16×1 vector, which can be arranged in the row-major or column-major order as originally applied to restore the 4×4 block signal.

[0160] As described above, the elements of the 16×1 transform coefficient vector may have different statistical characteristics. As in the above example, if the transform coefficients arranged forward (close to the 0th element) have a larger energy, a signal close to the original signal can be restored even if an inverse transform is applied to some transform coefficients that appear earlier without using all transform coefficients. For example, if an inverse 16×16 non-separable transform is composed of 16 column basis vectors, a 16×L matrix is ​​constructed by leaving only L column basis vectors, and after leaving only the more important L transform coefficients from among the transform coefficients (L×1 vector, which can appear earlier as in the above example), a 16×1 vector with a small error from the original input 16×1 vector data can be restored by multiplying the 16×L matrix and the L×1 vector. As a result, since only L coefficients are involved in data restoration, it is only necessary to obtain an L×1 transform coefficient vector, not a 16×1 transform coefficient vector, when obtaining transform coefficients. That is, in a forward 16×16 non-separable transform matrix, L relevant row-direction transform vectors are selected to construct an L×16 transform, and then multiplied with a 16×1 input vector to obtain L important transform coefficients.

[0161] Embodiment 2: Setting of application area of ​​4×4RST and arrangement of conversion coefficients

[0162] 4×4 RST can be applied as a secondary transform, and in this case, it can be applied secondarily to a block to which a primary transform such as DCT-type 2 has been applied. When the size of a block to which a primary transform has been applied is N×N, it is usually larger than 4×4. Therefore, when applying 4×4 RST to an N×N block, the following two methods are considered.

[0163] 1) Instead of applying 4x4 RST to the entire NxN region, it can be applied only to a part of the region. For example, it can be applied only to the top-left MxM region (M<=N).

[0164] 2) After dividing the region to which the secondary transformation is applied into 4x4 blocks, a 4x4 RST can be applied to each divided block.

[0165] The above methods 1) and 2) can be mixed and applied. For example, the upper left M×M region can be divided into 4×4 blocks and then 4×4 RST can be applied.

[0166] In a specific embodiment, the secondary transformation is applied only to the upper left 8x8 region, and if the NxN block is greater than or equal to 8x8, the 8x8 RST is applied. If the NxN block is smaller than 8x8 (4x4, 8x4, 4x8), it can be divided into 4x4 blocks as in 2) above, and then the 4x4 RST can be applied to each of them.

[0167] When L transform coefficients (1<=L<16) are generated after applying 4×4 RST, there is a degree of freedom in how to arrange the L transform coefficients. However, since there is a set order when the transform coefficients are read and processed in the residual coding part, the coding performance may change depending on how the L transform coefficients are arranged in a two-dimensional block. In the residual coding in the High Efficiency Video Coding (HEVC) standard, coding is started from the farthest position from the DC position, and this is to improve coding performance by utilizing the fact that the value of the quantized coefficient is 0 or close to 0 as it is farther away from the DC position. Therefore, it may be advantageous in terms of coding performance to arrange the L transform coefficients to have high energy and be coded later in the order of residual coding.

[0168] FIG. 16 shows three forward scan orders for transform coefficients or transform coefficient blocks applied in the HEVC standard: (a) diagonal scan, (b) horizontal scan, and (c) vertical scan.

[0169] FIG. 16 illustrates three forward scan orders for transform coefficients or transform coefficient blocks (4×4 blocks, Coefficient Groups (CGs)) applied in the HEVC standard, and residual coding is performed in the reverse order of the scan orders (a), (b), or (c) (i.e., coding is performed in the order from 16 to 1). The three scan orders shown in (a), (b), and (c) are selected according to an intra-prediction mode, so that the scan order for the L transform coefficients can also be configured to be determined according to the intra-prediction mode.

[0170] The L value has a range of 1<=L<16, and in general, L of the 16 transform basis vectors can be selected in any manner, but from the viewpoint of encoding and decoding, it may be advantageous in terms of coding efficiency to select transform basis vectors that are important in terms of signal energy, as in the example presented above.

[0171] Figures 17 and 18 are embodiments to which the present invention is applied, where Figure 17 shows the positions of transform coefficients when a forward diagonal scan is applied when applying a 4x4 RST to a 4x8 block, and Figure 18 shows an example of merging valid transform coefficients of two 4x4 blocks into one block.

[0172] When the upper left 4×8 block is divided into 4×4 blocks according to the diagonal scan order of (a) and 4×4 RST is applied, if the L value is 8 (i.e., only 8 transform coefficients out of 16 are left), the transform coefficients are located as in FIG. 17, but only half of each 4×4 block can have transform coefficients, and the positions where X is displayed are padded with 0 values ​​as a default. Thus, the residual coding (e.g., residual coding in HEVC) can be applied assuming that L transform coefficients are placed for each 4×4 block according to the scan order presented in (a) and the remaining (16-L) positions of each 4×4 block are padded with 0.

[0173] Also, as shown in FIG. 18, L transform coefficients arranged in two 4×4 blocks can be configured into one block. In particular, when the L value is 8, the transform coefficients of the two 4×4 blocks completely fill one 4×4 block, so that no transform coefficients remain in the other blocks. Therefore, since residual coding is not required for the 4×4 block that is emptied of transform coefficients, in the case of HEVC, a flag (coded_sub_block_flag) indicating whether residual coding of the block can be applied is coded to 0. There are various combination methods for the positions of the transform coefficients of the two 4×4 blocks. For example, the positions can be combined according to an arbitrary order, but the following methods may also be applied.

[0174] 1) The transform coefficients of two 4×4 blocks are alternately combined in the scan order. That is, in FIG. 8A, FIG. 8B, and FIG. 8C, the transform coefficients for the upper block are TIFF0007654043000003.tif556, and the transformation coefficients of the lower block are When the file name is TIFF0007654043000004.tif552, You can combine them one by one like TIFF0007654043000005.tif568. Also, TIFF0007654043000006.tif55 and You can change the order of TIFF0007654043000007.tif55 TIFF0007654043000008.tif1286.

[0175] 2) The transform coefficients for the first 4×4 block can be arranged first, and then the transform coefficients for the second 4×4 block. That is, You can link them together and place them like this: TIFF0007654043000009.tif667. You can also change the order, for example, TIFF0007654043000010.tif669.

[0176] Embodiment 3: A method for coding a Non-Separable Secondary Transform (NSST) index for a 4×4 RST

[0177] When the 4×4 RST is applied as shown in FIG. 17, the L+1th to 16th positions are filled with 0 values ​​according to the transform coefficient scan order for each 4×4 block. Therefore, if a non-zero value exists in the L+1th to 16th positions of even one of the two 4×4 blocks, it is derived that the 4×4 RST is not applied. When the 4×4 RST has a structure that applies a selected transform from a prepared transform set such as the Joint Experiment Model (JEM) NSST, an index (hereinafter referred to as an NSST index) for which transform to apply is signaled.

[0178] In some decoders, the NSST index is known by bit stream parsing, which can be performed after residual coding. In this case, if residual decoding reveals a non-zero transform coefficient between the L+1th position and the 16th position, the decoder does not parse the NSST index because it is certain that the 4×4 RST is not applied. Thus, by selectively parsing the NSST index only when necessary, the signaling cost is reduced.

[0179] As shown in Fig. 17, when 4x4 RST is applied to a plurality of 4x4 blocks in a specific region (in this case, the same 4x4 RST may be applied to all of them, or different 4x4 RSTs may be applied to each of them), one NSST index specifies the 4x4 RST (same or different) to be applied to all of the 4x4 blocks. Since one NSST index determines whether the 4x4 RST and 4x4 RST can be applied to all of the 4x4 blocks, if a non-zero transform coefficient is present at an impermissible position (from the L+1th position to the 16th position) in the 4x4 block as a result of checking whether a non-zero transform coefficient is present at the L+1th position to the 16th position in the residual decoding process, the encoding device 100 may be configured not to code the NSST index.

[0180] The encoding apparatus 100 may signal an NSST index for each luminance block and a chrominance block separately, and in the case of a chrominance block, may signal an NSST index for each of the Cb and Cr components separately, or may use one common NSST index. When one NSST index is used, the signaling of the NSST index is performed only once. When one NSST index is shared for the Cb and Cr components, a 4×4 RST indicated by the same NSST index is applied, and in this case, the 4×4 RST for the Cb and Cr components may be the same, or the NSST index may be the same, but separate 4×4 RSTs may be set for the Cb and Cr components. When a shared NSST index is used for the Cb and Cr components, for the above-mentioned conditional signaling, it is checked whether a non-zero transform coefficient exists from the L+1th position to the 16th position for all 4x4 blocks for the Cb and Cr components, and if a non-zero transform coefficient is found from the L+1th position to the 16th position, the signaling for the NSST index may be omitted.

[0181] As shown in FIG. 18, even when transform coefficients for two 4×4 blocks are merged into one 4×4 block, the encoding apparatus 100 may check whether a non-zero transform coefficient appears at a position where no valid transform coefficient exists when the 4×4 RST is applied, and then determine whether the NSST index can be signaled. In particular, since the L value is 8 as shown in FIG. 18, when a valid transform coefficient does not exist in one 4×4 block when the 4×4 RST is applied (a block indicated by X in FIG. 18(b)), a flag (coded_sub_block_flag) regarding whether residual coding of the block is possible or not may be checked, and if it is 1, the NSST index may be set not to be signaled. As described above, in the following description, the NSST will be mainly described as an example of a non-separable transform, but other known terms (e.g., LFNST) may be used for the non-separable transform. For example, an NSST set and an NSST index may be substituted for an LFNST set and an LFNST index. In addition, the RST described in this document is an example of a non-separable transform (e.g., LFNST) that uses a non-square (regular) transform matrix having a reduced input length and / or a reduced output length in a square non-separable transform matrix applied to at least a portion of a transform block (the upper left 4x4, 8x8 area, or the remaining area excluding the lower right 4x4 area in an 8x8 block), and RST can also be used in place of LFNST.

[0182] Fourth embodiment: Optimization method for 4×4 index coding before residual coding

[0183] When coding for the NSST index is performed before residual coding, whether or not the 4×4 RST can be applied is determined in advance, so that residual coding for positions where transform coefficients are filled with 0 may be omitted. Here, whether or not the 4×4 RST can be applied may be configured to be determined by the NSST index value (e.g., if the NSST index is 0, 4×4 RST is not applied), or whether or not the 4×4 RST can be applied may be signaled by a separate syntax element (e.g., an NSST flag). For example, if the separate syntax element is an NSST flag, the decoding apparatus 200 may omit residual coding (decoding) for positions where no valid transform coefficients exist, as described above, when the NSST flag value is 1 after determining whether or not the 4×4 RST can be applied by first parsing the NSST flag.

[0184] In the case of HEVC, when residual coding is performed, coding is performed first at the position of the last non-zero coefficient in the TU. Coding for the NSST index is performed after coding for the position of the last non-zero coefficient, and assuming application of 4×4 RST, if the position of the last non-zero coefficient is a position where a non-zero coefficient cannot exist, the decoding device 200 may be set not to code the NSST index and not to apply 4×4 RST. For example, in the case of a position indicated as X in FIG. 17, when 4×4 RST is applied, a valid transform coefficient is not located (a value of 0 may be filled), so if the last non-zero coefficient is located in the area indicated as X, the decoding device 200 may omit coding for the NSST index. If the last non-zero coefficient is not located in the area indicated as X, the decoding device 200 may perform coding for the NSST index.

[0185] If it is determined whether or not 4x4RST is applicable by conditionally coding the NSST index after coding the positions of the non-zero coefficients, the remaining residual coding portion can be processed in the following two manners.

[0186] 1) If 4x4 RST is not applied, general residual coding is performed, i.e., coding is performed under the assumption that there can be a non-zero transform coefficient anywhere from the last non-zero coefficient position to DC.

[0187] 2) When 4x4 RST is applied, since a transform coefficient does not exist (filled with 0 as default) at a specific position or a specific 4x4 block (e.g., X position in FIG. 17), residual coding may be omitted for the position or block. For example, when a position indicated as X is reached while scanning according to the scan order in FIG. 17, coding for a flag (sig_coeff_flag) indicating whether a non-zero coefficient exists at the position in the HEVC standard may be omitted, and when transform coefficients of two blocks are merged into one block as in FIG. 18, coding for a flag (e.g., code_sub_block_flag in the HEVC standard) indicating whether residual coding of a 4x4 block filled with 0 is possible may be omitted, and the corresponding value may be derived as 0, and the corresponding 4x4 block may be filled (charged) with all 0 values ​​without separate coding.

[0188] When coding the NSST index after coding the position of the last non-zero coefficient, if the x position (Px) and y position (Py) of the last non-zero coefficient are smaller than Tx and Ty, respectively, the coding of the NSST index may be omitted and the 4×4RST may not be applied. For example, if Tx=1, Ty=1 and the last non-zero coefficient is at the position of DC, the NSST index coding may be omitted. The method of determining whether the NSST index coding is possible for the comparison with the threshold may be applied differently to the luminance component and the chrominance component, for example, different Tx and Ty may be applied to the luminance component and the chrominance component, and a threshold may be applied to the luminance component and a threshold may not be applied to the chrominance component. Conversely, a threshold may be applied to the chrominance component and a threshold may not be applied to the luminance component.

[0189] The above two methods (NSST index coding is omitted if the last non-zero coefficient is located in an area where no valid transform coefficient exists, and NSST index coding is omitted if the X coordinate and Y coordinate of the last non-zero coefficient are each smaller than a threshold) may be applied simultaneously. For example, the threshold value for the position coordinate of the last non-zero coefficient may be checked first, and then it may be checked whether the last non-zero coefficient is located in an area where no valid transform coefficient exists, and the order of the two methods may be changed.

[0190] The method presented in embodiment 4) can also be applied to an 8x8 RST. That is, if the last non-zero coefficient is located in a non-upper left 4x4 region within the upper left 8x8 region, coding for the NSST index can be omitted, otherwise coding for the NSST index can be performed. Also, if the values ​​of the X and Y coordinates for the position of the last non-zero coefficient are all less than a certain threshold, coding for the NSST index can be omitted. The two methods can also be applied simultaneously.

[0191] 5th embodiment: When RST is applied, different NSST index coding and residual coding methods are applied to the luminance component and the chrominance component, respectively.

[0192] The schemes described in the third and fourth embodiments may be applied differently to the luminance component and the chrominance component. That is, the NSST index coding and the residual coding scheme may be applied differently to the luminance component and the chrominance component. For example, the scheme described in the fourth embodiment may be applied to the luminance component, and the scheme described in the third embodiment may be applied to the chrominance component. In addition, the conditional NSST index coding proposed in the third or fourth embodiment may be applied to the luminance component, and the conditional NSST index coding may not be applied to the luminance component, or vice versa (applying the conditional NSST index coding to the chrominance component and not to the luminance component).

[0193] EMBODIMENT 6

[0194] In one embodiment of the present invention, a mixed NSST transform set (MNTS) for applying various NSST conditions in the process of applying NSST and a method for constructing the corresponding MNTS are provided.

[0195] According to JEM, a 4×4 NSST set contains only 4×4 kernels, and an 8×8 NSST set contains only 8×8 kernels, depending on the size of the preselected subblock. The embodiment of the present invention additionally proposes a method for constructing a mixed NSST set as follows.

[0196] -The size of the NSST kernels available in an NSST set is not fixed, and one or more NSST kernels having variable sizes may be included in the NSST set (e.g., one NSST set includes both a 4x4 NSST kernel and an 8x8 NSST kernel).

[0197] The number of NSST kernels available in an NSST set may not be fixed but may be variable (e.g., the first set may contain 3 kernels, the second set may contain 4 kernels).

[0198] - The order of NSST kernels may not be fixed but may be defined differently depending on the NSST set (e.g., in the first set, NSST kernels 1, 2, 3 are mapped to NSST indices 1, 2, 3 respectively, but in the second set, NSST kernels 3, 2, 1 are mapped to NSST indices 1, 2, 3 respectively).

[0199] More specifically, an example of a mixed NSST transformation set construction method is as follows.

[0200] The priority of the NSST kernels available in the -NSST transformation set may be determined by the size of the NSST kernel (e.g., 4x4 NSST and 8x8 NSST).

[0201] For example, if a block is large, an 8x8 NSST kernel may be more important than a 4x4 NSST kernel, so we assign the 8x8 NSST kernel an NSST index with a lower value.

[0202] The priority of the NSST kernels available in the -NSST transformation set may be determined by the order of the NSST kernels.

[0203] For example, a given 4x4 NSST first kernel may take precedence over a 4x4 NSST second kernel.

[0204] Since the NSST index is transmitted encoded, the NSST index can be signaled with fewer bits by assigning higher priority (smaller index) to frequently occurring NSST kernels.

[0205] Tables 1 and 2 below show examples of mixed NSST sets proposed in this embodiment.

[0206] [Table 1]

[0207] [Table 2]

[0208] EMBODIMENT 7

[0209] In one embodiment of the present invention, in the process of determining a secondary transform set, a method for determining an NSST set is proposed that takes into account an intra prediction mode and a block size.

[0210] The method proposed in this embodiment, in cooperation with embodiment 6, configures a set of transformations adapted to the intra prediction mode, so that kernels of various sizes can be configured and applied to blocks.

[0211] FIG. 19 illustrates an example of a method for constructing an NSST set mixed for each intra prediction mode, which is an embodiment to which the present invention is applied.

[0212] Fig. 19 is an example of a table in accordance with a method of applying the method proposed in the second embodiment in cooperation with the sixth embodiment. That is, as shown in Fig. 19, an index ("Mixed Type") is defined for each intra prediction mode, indicating whether to follow an existing NSST set construction method or a different NSST set construction method.

[0213] 19, an NSST set is constructed using an NSST set construction method defined in the system, regardless of the NSST set construction method of JEM. Here, the NSST set construction method defined in the system means the mixed NSST set proposed in the sixth embodiment.

[0214] As yet another embodiment, the table of Figure 19 describes two types of transform set construction methods (JEM-based NSST set construction and a mixed type NSST set construction method proposed in an embodiment of the present invention) based on mixed type information (flag) associated with an intra prediction mode, but the mixed type NSST construction method may be one or more, and here the mixed type information may be expressed as N (N>2) types of various values.

[0215] In yet another embodiment, it may be determined whether to configure a transform set suitable for the current block as a mixed type by considering both the intra prediction mode and the size of the transform block. For example, if the mode type corresponding to the intra prediction mode is 0, the NSST set setting of JEM is followed, otherwise (Mode Type=1), various mixed type NSST sets may be determined according to the size of the transform block.

[0216] FIG. 20 shows an example of a method for selecting an NSST set (or kernel) taking into consideration an intra prediction mode and a size of a transform block, in accordance with an embodiment to which the present invention is applied.

[0217] Once the transform set is determined, the decoding device 200 can determine the NSST kernel used by using the NSST index information.

[0218] EMBODIMENT 8

[0219] In one embodiment of the present invention, when constructing a transform set considering the intra prediction mode and the block size in the process of applying the secondary transform, a method for efficiently encoding the NSST index is provided by considering the change in the statistical distribution of the NSST index values transmitted after encoding. Embodiments of the present invention provide a method for selecting a kernel to be applied using a syntax indicating the kernel size.

[0220] Also, in an embodiment of the present invention, since the number of available NSST kernels is different for each transform set, for an efficient binary evolution method, a truncated unary binary evolution method as shown in Table 3 below is provided according to the maximum NSST index value available for each set.

[0221]

Table 3

[0222] Table 3 shows the binary evolution method of the NSST index value. Since the number of available NSST kernels is different for each transform set, the NSST index can be binary-evolved by the maximum NSST index value.

[0223] Embodiment 9: Reduced Transform

[0224] Due to complexity issues in the transform (e.g., large block transform or non-separable transform), a reduced transform applicable to the core transform (e.g., DCT, DST, etc.) and the secondary transform (e.g., NSST) is provided.

[0225] The main idea of the reduced transform is to map an N-dimensional vector to an R-dimensional vector from another space, where R / N (R < N) is the reduction factor. The reduced transform is an R×N matrix as shown in Equation 3 below.

[0226] <Equation 3>

Number

[0227] In Equation 1, the R rows of the transformation are the R bases of the new N-dimensional space. Therefore, the reason it is called a reduced transformation is that the number of elements of the vector output by the transformation is smaller than the number of elements of the input vector (R < N). The inverse transform matrix for the reduced transformation is the transpose of the forward transform. The reduced transformations in the forward and reverse directions will be described with reference to FIGS. 13A and 13B.

[0228] FIGS. 21A and 21B are embodiments to which the present invention is applied and show reduced transformations in the forward and reverse directions.

[0229] The number of elements of the reduced transformation is RxN, which is smaller than the size of the complete matrix (N×N) by R / N, which means that the required memory is R / N of the complete matrix.

[0230] Also, the number of required multiplications is also R×N, which is less than the original N×N by R / N.

[0231] When X is a vector of N levels, R coefficients are obtained after applying the reduced transformation, which means that only R values need to be transmitted instead of the original N coefficients.

[0232] FIG. 22 shows an example of a flowchart of decoding using the reduced transformation according to an embodiment of the present invention.

[0233] The proposed downscaled transform (inverse transform at the decoder) can be applied to the coefficients (dequantized coefficients) as shown in FIG. 21. A predetermined downscaling factor (R, or R / N) and a transform kernel for performing the transform may be required. Here, the transform kernel can be determined based on available information such as block size (width, height), intra prediction mode, and Cidx. If the current coding block is a luma block, CIdx is 0. Otherwise (Cb or Cr block), CIdx is a non-zero value, such as 1.

[0234] The operators used in the rest of this document are defined as shown in Tables 4 and 5 below.

[0235] [Table 4]

[0236] [Table 5]

[0237] 23 shows an example of a flow chart of applying a conditionally reduced transform according to an embodiment of the present invention. The operations of FIG. 23 are performed by the inverse quantization unit 140 and the inverse transform unit 150 of the decoding device 200.

[0238] In one embodiment, the reduced transform may be used if certain conditions are met. For example, the reduced transform may be applied to blocks larger than a certain size, as follows:

[0239] - Width > TH && Height > HT, where TH is a predefined value (e.g. 4)

[0240] or

[0241] - Width * Height > K && MIN(Width, Height) > TH (K and TH are predefined values)

[0242] That is, as in the above condition, if the width (width) of the current block is greater than a predefined value (TH) and the height (height) of the current block is greater than a predefined value (TH), the scaled transformation may be applied. Alternatively, if the product of the width and height of the current block is greater than a predefined value (K) and the smaller of the width and height of the current block is greater than the predefined value (TH), the scaled transformation may be applied.

[0243] The reduced transform may be applied to a predetermined group of blocks as follows.

[0244] - Width == TH && Height == TH

[0245] or

[0246] - Width == Height

[0247] That is, if the width and height of the current block are equal to a predetermined value (TH), respectively, or if the width and height of the current block are equal (if the current block is a square block), a scaled transformation can be applied.

[0248] If the conditions for the use of the reduced transform are not met, a regular transform is applied. The regular transform may be a transform that is predefined and available in the video coding system. Examples of regular transforms are as follows:

[0249] -DCT-2, DCT-4, DCT-5, DCT-7, DCT-8

[0250] or

[0251] -DST-1, DST-4, DST-7

[0252] or

[0253] -Non-separable transformation

[0254] or

[0255] -JEM-NSST (HyGT)

[0256] As shown in Figure 23, the reduced transform condition depends on an index (Transform_idx) that indicates which transform (e.g., DCT-4, DST-1) is used or which kernel is applied (when multiple kernels are available). In particular, Transform_idx can be sent twice: one index indicating a horizontal transform (Transform_idx_h) and another index indicating a vertical transform (Transform_idx_v).

[0257] 23, the decoding device 200 performs inverse quantization on the input bitstream (S2305). After that, the decoding device 200 determines whether to apply a transform (S2310). The decoding device 200 determines whether to apply a transform based on a flag indicating whether to skip a transform.

[0258] If a transform is applied, the decoding device 200 parses a transform index (Transform_idx) indicating the transform to be applied (S2315). The decoding device 200 also selects a transform kernel (S2330). For example, the decoding device 200 selects a transform kernel corresponding to the transform index (Transform_idx). The decoding device 200 also selects the transform kernel taking into account the block size (width, height), the intra prediction mode, and CIdx (luma, chroma).

[0259] The decoding device 200 determines whether the conditions for applying the reduced transform are met (S2320). The conditions for applying the reduced transform include the conditions described above. If the reduced transform is not applied, the decoding device 200 applies a normal inverse transform (S2325). For example, the decoding device 200 determines an inverse transform matrix from the transform kernel selected in step S2330, and applies the determined inverse transform matrix to the current block including the transform coefficients.

[0260] If a reduced transform is applied, the decoding device 200 applies a reduced inverse transform (S2335). For example, the decoding device 200 determines a reduced inverse transform matrix taking into account a reduction factor from the transform kernel selected in step S2330, and applies the reduced inverse transform matrix to the current block including the transform coefficients.

[0261] 24 shows an example of a flowchart of a decoding process for a secondary inverse transform in which a conditionally reduced transform is applied according to an embodiment of the present invention. The operation of FIG.

[0262] In one embodiment, the reduced transform can be applied to the secondary transform as in Figure 24. Once the NSST index is parsed, the reduced inverse transform can be applied.

[0263] 24, the decoding device 200 performs inverse quantization (S2405). The decoding device 200 determines whether or not to apply NSST to the transform coefficients generated by the inverse quantization (S2410). That is, the decoding device 200 determines whether or not parsing of the NSST index (NSST_idx) is necessary depending on whether or not to apply NSST.

[0264] If NSST is applied, the decoding device 200 parses the NSST index (S2415) and determines whether the NSST index is greater than 0 (S2420). The NSST index is restored by the entropy decoding unit 210 using a technique such as CABAC. If the NSST index is 0, the decoding device 200 omits the secondary inverse transform and applies the core inverse transform or the primary inverse transform (S2445).

[0265] Also, when NSST is applied, the decoding device 200 selects a transform kernel for secondary inverse transform (S2435). For example, the decoding device 200 selects a transform kernel corresponding to an NSST index (NSST_idx). Also, the decoding device 200 selects the transform kernel taking into account the block size (width, height), intra prediction mode, and CIdx (luma, chroma).

[0266] If the NSST index is greater than 0, the decoding device 200 determines whether the conditions for application of the reduced transform are satisfied (S2425). The conditions for application of the reduced transform include the conditions described above. If the reduced transform is not applied, the decoding device 200 applies a normal secondary inverse transform (S2430). For example, the decoding device 200 determines a secondary inverse transform matrix from the transform kernel selected in step S2435, and applies the determined secondary inverse transform matrix to the current block including the transform coefficients.

[0267] If a scaled transform is applied, the decoding device 200 applies a scaled secondary inverse transform (S2440). For example, the decoding device 200 may determine a scaled inverse transform matrix taking into account a scale-down factor from the transform kernel selected in step S2335, and apply the scaled inverse transform matrix to the current block including the transform coefficients. Thereafter, the decoding device 200 applies a core inverse transform or a linear inverse transform (S2445).

[0268] Embodiment 10: Reduced Transform as a Secondary Transform with Different Block Size

[0269] 25A, 25B, 26A, and 26B show examples of reduced transforms and reduced inverse transforms according to embodiments of the present invention.

[0270] In one embodiment of the present invention, the reduced transform can be used as the secondary transform and the secondary inverse transform in a video codec for different block sizes such as 4×4, 8×8, 16×16, etc. As an example for an 8×8 block size and a reduction factor R=16, the secondary transform and the secondary inverse transform can be set as shown in Figures 25A and 25B.

[0271] The pseudocode for the reduced transform and the reduced inverse transform is set out in FIG.

[0272] [Table 6]

[0273] [Table 7]

[0274] Embodiment 11: Reduced Transform as a Secondary Transform with Non-Rectangular Shape

[0275] FIG. 27 shows an example of a region to which a reduced quadratic transform is applied according to an embodiment of the present invention.

[0276] As mentioned above, due to complexity issues in the quadratic transform, the quadratic transform can be applied to 4x4 and 8x8 corners. The reduced transform can also be applied to non-squares.

[0277] As shown in Figure 27, RST can be applied to only a part of a block (diagonal region). In Figure 27, each square represents a 4x4 region, and RST is applied to ten 4x4 pixels (i.e., 160 pixels). When the reduction factor R=16, the entire RST matrix is ​​a 16x16 matrix, which may be an acceptable computational effort.

[0278] Embodiment 12: Reduction Factor

[0279] FIG. 28 illustrates a reduced transformation with a reduction factor according to an embodiment of the present invention.

[0280] Changing the reduction factor can change the memory and multiplication complexity. As mentioned above, changing the reduction factor reduces the memory and multiplication complexity by a factor R / N. For example, for an 8x8 NSST, if R=16, the memory and multiplication complexity is reduced by 1 / 4.

[0281] Embodiment 13: High Level Syntax

[0282] The following syntax elements are used to process RST in video coding: Semantics related to reduced transforms are present in the Sequence Parameter Set (SPS) or slice header.

[0283] Reduced_transform_enabled_flag equal to 1 indicates that reduced transform is enabled and applied. Reduced_transform_enabled_flag equal to 0 indicates that reduced transform is not enabled. When Reduced_transform_enabled_flag is not present, it is inferred to be equal to 0. (Reduced_transform_enabled_flag equals to 1 specifies that reduced transform is enabled and applied. Reduced_transform_enabled_flag equal to 0 specifies that reduced transform is not enabled. When Reduced_transform_enabled_flag is not present, it is inferred to be equal to 0).

[0284] Reduced_transform_factor specifies that the number of reduced dimensions to keep for reduced transform. When Reduced_transform_factor is not present, it is inferred to be equal to R.

[0285] min_reduced_transform_size specifies that the minimum transform size to apply reduced transform. When min_reduced_transform_size is not present, it is inferred to be equal to 0.

[0286] max_reduced_transform_size indicates the maximum transform size to apply the reduced transform to. If max_reduced_transform_size is not present, it is inferred to be 0.

[0287] reduced_transform_size specifies that the number of reduced dimensions to keep for reduced transform. When Reduced_transform_factor is not present, it is inferred to be equal to 0.

[0288] [Table 8]

[0289] Embodiment 14: Conditional application of 4×4RST for worst case handling

[0290] The non-separable secondary transform (4x4NSST) that can be applied to a 4x4 block is a 16x16 transform. The 4x4NSST is applied secondarily to a block that has been applied with a primary transform such as DCT-2, DST-7, or DCT-8. If the size of the block to which the primary transform has been applied is NxM, the following methods can be considered when applying the 4x4NSST to an NxM block.

[0291] 1) The conditions for applying 4x4 NSST to an NxM region are as follows: a) and b).

[0292] a) N >= 4

[0293] b) M >= 4

[0294] 2) 4x4 NSST is not applied to the entire NxM region, but only to some of the regions. For example, 4x4 NSST can be applied only to the KxJ region in the upper left. The conditions for this are a) and b) below.

[0295] a) K >= 4

[0296] b) J >= 4

[0297] 3) After dividing the region to which the secondary transformation is applied into 4x4 blocks, a 4x4 NSST can be applied to each divided block.

[0298] The computational complexity of 4×4 NSST is a very important factor to consider in the encoder and decoder, so we will analyze it in detail. In particular, we will analyze the computational complexity of 4×4 NSST based on the number of multiplications. In the case of forward NSST, the 16×16 secondary transform is composed of 16 row-wise transform basis vectors, and the transform coefficients for the transform basis vector are obtained by taking the inner product of the 16×1 vector and each transform basis vector. The process of obtaining all the transform coefficients for the 16 transform basis vectors is like multiplying the 16×16 non-separable transform matrix by the input 16×1 vector. Therefore, the total number of multiplications required for 4×4 forward NSST is 256.

[0299] In the decoder, when an inverse 16×16 non-separable transform is applied to the 16×1 transform coefficients (ignoring effects such as quantization and integerization), the coefficients of the original 4×4 linear transform block can be restored. In other words, when the inverse 16×16 non-separable transform matrix is ​​multiplied to the 16×1 transform coefficient vector, data in the form of a 16×1 vector is obtained, and when the data is arranged according to the row-major or column-major order that was originally applied, the 4×4 block signal (linear transform coefficients) can be restored. Thus, the total number of multiplications required for a 4×4 inverse NSST is 256.

[0300] As described above, when 4×4 NSST is applied, the number of multiplications required per sample is 16. This is the number obtained by dividing the total number of multiplications, 256, obtained in the process of performing 4×4 NSST, which is the inner product process between the 16×1 vector and each transformation basis vector, by the total number of samples, 16. The number of multiplications required is the same for both forward 4×4 NSST and backward 4×4 NSST, which is 16.

[0301] In the case of an 8×8 block, the number of multiplications required per sample when applying 4×4 NSST is determined by the region to which 4×4 NSST is applied as follows:

[0302] 1. 4x4 NSST applied only to the top left 4x4 region: 256 (number of multiplications required in the 4x4 NSST process) / 64 (total number of samples in the 8x8 block) = 4 multiplications / sample

[0303] 2. 4x4 NSST applied to the top left 4x4 region and the top right 4x4 region: 512 (number of multiplications required for the two 4x4 NSST processes) / 64 (total number of samples in the 8x8 block) = 8 multiplications / sample

[0304] 3. 4x4 NSST applied to all 4x4 regions of an 8x8 block: 1024 (number of multiplications required for four 4x4 NSST processes) / 64 (total number of samples in an 8x8 block) = 16 multiplications / sample

[0305] As mentioned above, when the size of the block is large, the extent to which the 4×4 NSST is applied can be reduced to reduce the number of worst-case multiplications required for each sample.

[0306] Therefore, when using 4x4 NSST, the worst case occurs when the size of the TU is 4x4. In this case, the method to reduce the worst case complexity is as follows:

[0307] Method 1. Do not apply 4 × 4 NSST to small TUs (i.e., 4 × 4 TUs).

[0308] Method 2. For 4x4 blocks (4x4TU), apply 4x4RST instead of 4x4NSST.

[0309] In the case of Method 1, it was experimentally observed that not applying 4x4 NSST caused a significant degradation in coding performance. In the case of Method 2, it was found that due to the statistical characteristics of the elements that make up the 16x1 transform coefficient vector, a signal that is quite close to the original signal can be restored by applying an inverse transform to some of the transform coefficients located at the front, even if not all transform coefficients are used, and most of the coding performance can be maintained.

[0310] Specifically, in the case of 4×4RST, if the inverse (or forward) 16×16 non-separable transform is composed of 16 column basis vectors, only L column basis vectors are left to form a 16×L matrix. By leaving only the L most important transform coefficients among the transform coefficients, multiplying the 16×L matrix by an L×1 vector can restore a 16×1 vector with a small error from the original 16×1 vector data.

[0311] As a result, since only L coefficients are involved in data recovery, an L×1 transform coefficient vector is required to obtain transform coefficients, instead of a 16×1 transform coefficient vector. That is, an L×16 transform matrix is ​​constructed by selecting L row-direction transform vectors in a forward 16×16 non-separable transform matrix, and L transform coefficients are obtained by multiplying the L×16 transform matrix and a 16×1 input vector.

[0312] The L value has a range of 1<=L<16, and generally, L of the 16 transformation basis vectors can be selected in any way, but as mentioned above, it may be advantageous in terms of coding efficiency to select a transformation basis vector with high signal energy importance from the aspect of encoding and decoding. The worst-case multiplication number per sample in a 4×4 block by transformation of the L value is as shown in Table 9 below.

[0313] [Table 9]

[0314] As mentioned above, in order to reduce worst-case multiplication complexity, 4x4 NSST and 4x4 RST can be used in combination as shown in Table 10 below (however, the following example describes the conditions for applying 4x4 NSST and 4x4 RST under the conditions for applying 4x4 NSST (i.e., when the width and height of the current block are all greater than or equal to 4)).

[0315] As described above, the 4x4 NSST for a 4x4 block is a square (16x16) transform matrix that receives 16 pieces of data and outputs 16 pieces of data, and the 4x4 RST is a non-square (8x16) transform matrix that receives 16 pieces of data from the encoder and outputs R pieces of data (e.g., 8 pieces) that are less than 16. The 4x4 RST is a non-square (16x8) transform matrix that receives R pieces of data (e.g., 8 pieces) that are less than 16 and outputs 16 pieces of data (e.g., 16x8 pieces) from the decoder.

[0316] [Table 10]

[0317] Referring to Table 10, if the width and height of the current block are each 4, a 4×4 RST based on an 8×16 matrix is ​​applied to the current block, otherwise (if either the width or height of the current block is not 4), a 4×4 NSST may be applied to the upper left 4×4 region of the current block. More specifically, if the size of the current block is 4×4, a non-separable transform having an input length of 16 and an output length of 8 may be applied. In the case of an inverse non-separable transform, a non-separable transform having an input length of 8 and an output length of 16 may be applied inversely.

[0318] As mentioned above, to reduce worst-case multiplication complexity, 4×4 NSST and 4×4 RST can be used in combination as shown in Table 11 below (however, the following example describes the conditions for applying 4×4 NSST and 4×4 RST under the conditions for applying 4×4 NSST (i.e., when the width and height of the current block are all greater than or equal to 4)).

[0319] [Table 11]

[0320] Referring to Table 11, if the width and height of the current block are each 4, then a 4×4 RST based on an 8×16 matrix is ​​applied; if the product of the width and height of the current block is less than a threshold (TH), then a 4×4 NSST is applied to the upper left 4×4 region of the current block; if the width of the current block is greater than or equal to its height, then a 4×4 NSST is applied to the upper left 4×4 region of the current block and the 4×4 region located to the right of the upper left 4×4 region; in the remaining cases (less than the height of the current block), a 4×4 NSST is applied to the upper left 4×4 region of the current block and the 4×4 region located below the upper left 4×4 region.

[0321] In conclusion, for the reduction of the computational complexity of the worst-case multiplication, a 4×4 RST (eg, an 8×16 matrix) can be applied instead of a 4×4 NSST for a 4×4 block.

[0322] Embodiment 15: Conditional application of 8x8RST for worst case handling

[0323] The non-separable secondary transform (8x8NSST) that can be applied to 8x8 blocks is a 64x64 transform. The 8x8NSST is applied secondarily to blocks that have been applied with a primary transform such as DCT-2, DST-7, or DCT-8. If the size of the block to which the primary transform has been applied is NxM, the following methods are considered when applying the 8x8NSST to an NxM block.

[0324] 1) The conditions for applying 8x8 NSST to an NxM region are as follows: c) and d) below.

[0325] c) N >= 8

[0326] d) M >= 8

[0327] 2) The 8x8 NSST is not applied to the entire NxM region, but may be applied only to some of the regions. For example, the 8x8 NSST is applied only to the KxJ region in the upper left. The conditions for this are as follows: c) and d) below.

[0328] c) K >= 8

[0329] d) J >= 8

[0330] 3) After dividing the region to which the secondary transformation is applied into 8x8 blocks, the 8x8 NSST can be applied to each divided block.

[0331] The computational complexity of 8x8 NSST is a very important factor to consider for the encoder and decoder, so we will analyze it in detail. In particular, we will analyze the computational complexity of 8x8 NSST based on the number of multiplications. In the case of forward NSST, the 64x64 non-separable secondary transform is composed of 64 row-wise transform basis vectors, and the transform coefficients for the transform basis vector are obtained by taking the inner product of the 64x1 vector and each transform basis vector. The process of obtaining all the transform coefficients for the 64 transform basis vectors is like multiplying the 64x64 non-separable transform matrix by the input 64x1 vector. Therefore, the total number of multiplications required for the 8x8 forward NSST is 4096.

[0332] In the decoder, when an inverse 64x64 non-separable transform is applied to the 64x1 transform coefficients (ignoring the effects of quantization, integerization, etc.), the coefficients of the original 8x8 primary transform block can be restored. In other words, when the inverse 64x64 non-separable transform matrix is ​​multiplied to the 64x1 transform coefficient vector, data in the form of a 64x1 vector is obtained, and when the data is arranged according to the row-major or column-major order that was originally applied, the 8x8 block signal (primary transform coefficients) can be restored. Thus, the total number of multiplications required for the 8x8 inverse NSST is 4096.

[0333] As described above, when 8×8 NSST is applied, the number of multiplications required per sample is 64. This number is obtained by dividing the total number of multiplications (4096) obtained in the process of performing 8×8 NSST, which is the inner product process between a 64×1 vector and each transformation basis vector, by the total number of samples (64). The number of multiplications required is the same for both forward 8×8 NSST and reverse 8×8 NSST, which is 64.

[0334] In the case of a 16x16 block, the number of multiplications required per sample when applying 8x8 NSST is determined by the region to which 8x8 NSST is applied as follows:

[0335] 1. 8x8 NSST applied only to the top left 8x8 region: 4096 (multiplications required for 8x8 NSST process) / 256 (total number of samples in 16x16 block) = 16 multiplications / sample

[0336] 2. 8x8 NSST applied to the top left 8x8 region and the top right 8x8 region: 8192 (multiplications required for the two 8x8 NSST processes) / 256 (total number of samples in the 16x16 block) = 32 multiplications / sample.

[0337] 3. 8x8NSST applied to all 8x8 regions of a 16x16 block: 16384 (number of multiplications required for four 8x8NSST processes) / 256 (total number of samples in a 16x16 block) = 64 multiplications / sample

[0338] As mentioned above, when the size of the blocks is large, the extent to which the 8x8 NSST is applied can be reduced in order to reduce the number of worst-case multiplications required per sample.

[0339] When 8×8 NSST is applied, the worst case is when the size of the TU is 8×8 in terms of the number of multiplications required per sample, since an 8×8 block is the smallest TU to which 8×8 NSST can be applied. In this case, a method for reducing the worst case complexity is as follows.

[0340] Method 1. Do not apply 8 × 8 NSST to small TUs (i.e., 8 × 8 TUs).

[0341] Method 2. For 8×8 blocks (8×8TU), apply 8×8RST instead of 8×8NSST.

[0342] In the case of Method 1, it was experimentally observed that not applying 8x8 NSST caused a significant degradation in coding performance. In the case of Method 2, it was found that due to the statistical characteristics of the elements that make up the 64x1 transform coefficient vector, a signal that is quite close to the original can be restored by applying an inverse transform to some of the transform coefficients located at the front, even if not all transform coefficients are used, and most of the coding performance can be maintained.

[0343] Specifically, in the case of 8×8RST, if the inverse (or forward) 64×64 non-separable transform is composed of 16 column basis vectors, only L column basis vectors are left to form a 64×L matrix. By leaving only the L most important transform coefficients among the transform coefficients, the 64×L matrix is ​​multiplied by an L×1 vector to restore a 64×1 vector with a small error from the original 64×1 vector data.

[0344] As a result, only L coefficients are involved in data recovery, so that an L×1 transform coefficient vector is required to obtain transform coefficients, instead of a 64×1 transform coefficient vector. That is, an L×64 transform matrix is ​​constructed by selecting L row-direction transform vectors in a forward 64×64 non-separable transform matrix, and L transform coefficients are obtained by multiplying the L×64 transform matrix and a 64×1 input vector.

[0345] The L value has a range of 1<=L<64, and generally, L of the 64 transformation basis vectors are selected in an arbitrary manner, but as described above, it may be advantageous in terms of coding efficiency to select a transformation basis vector with high signal energy importance from the perspective of encoding and decoding. The worst-case number of multiplications per sample in an 8×8 block due to transformation of the L value is as shown in Table 12 below.

[0346] [Table 12]

[0347] As mentioned above, in order to reduce worst-case multiplication complexity, 8×8 RSTs with different L values ​​can be used in combination as shown in Table 13 below (however, the following example describes the conditions for applying 8×8 RST under the conditions for applying 8×8 NSST (i.e., when the width and height of the current block are all greater than or equal to 8)).

[0348] [Table 13]

[0349] Referring to Table 13, if the width and height of the current block are each 8, an 8×8 RST based on an 8×64 matrix may be applied to the current block, otherwise (if either the width or height of the current block is not 8), an 8×8 RST based on a 16×64 matrix may be applied to the current block. More specifically, if the size of the current block is 8×8, a non-separable transform having an input length of 64 and an output length of 8 is applied, otherwise a non-separable transform having an input length of 64 and an output length of 16 is applied. For the inverse non-separable transform, if the current block is 8×8, a non-separable transform having an input length of 8 and an output length of 64 is applied, otherwise a non-separable transform having an input length of 16 and an output length of 64 is applied.

[0350] Table 14 is an example of the application of various 8x8 RST under the condition for applying 8x8 NSST (ie, when the width and height of the current block are greater than 8).

[0351] [Table 14]

[0352] Referring to Table 14, if the width and height of the current block are each 8, then the 8×8 RST based on the 8×64 matrix is ​​applied; if the product of the width and height of the current block is less than the threshold (TH), then the 8×8 RST based on the 16×64 matrix is ​​applied to the 8×8 region in the upper left corner of the current block; if the width of the current block is greater than or equal to the height, then the 8×8 RST based on the 32×64 matrix is ​​applied to the 4×4 region located in the 8×8 region in the upper left corner of the current block; and in the remaining cases (if the product of the width and height of the current block is greater than or equal to the threshold and the width of the current block is less than the height), then the 8×8 RST based on the 32×64 matrix is ​​applied to the 8×8 region in the upper left corner of the current block.

[0353] 29 shows an example of a flowchart of decoding in which a transform according to an embodiment of the present invention is applied. The operation of FIG.

[0354] In step S2905, decoding device 200 determines the input length and output length of the non-separable transform based on the height and width of the current block. Here, if the height and width of the current block are each 4, the input length of the non-separable transform is determined to be 8, and the output length is determined to be 16. That is, an inverse transform of 4×4 RST based on an 8×16 matrix (inverse 4×4 RST based on a 16×8 matrix) is applied. If the height and width of the current block are not each 4, the input length and output length of the non-separable transform are determined to be 16, respectively.

[0355] In step S2910, the decoding device 200 determines a non-separable transform matrix corresponding to the input length and output length of the non-separable transform. For example, if the input length of the non-separable transform is 8 and the output length is 16 (if the size of the current block is 4×4), a 16×8 matrix derived from the transform kernel is determined as the non-separable transform block; if the input length of the non-separable transform is 16 and the output length is 16 (for example, if the current block is smaller than 8×8 and not 4×4), a 16×16 transform kernel can be determined as the non-separable transform.

[0356] According to an embodiment of the present invention, the decoding device 200 can determine a non-separable transform set index (e.g., an NSST index) based on the intra prediction mode of the current block, determine a non-separable transform kernel corresponding to the non-separable transform index within a non-separable transform set included in the non-separable transform set index, and determine a non-separable transform matrix from the non-separable transform kernel based on the input length and output length determined in step S2905.

[0357] In step S2915, decoding device 200 applies the non-separable transform matrix determined for the current block to the current block. For example, if the input length of the non-separable transform is 8 and the output length is 16, an 8×16 matrix derived from the transform kernel can be applied to the current block, and if the input length of the non-separable transform is 16 and the output length is 16, a 16×16 matrix derived from the transform kernel can be applied to the coefficients of the upper left 4×4 region of the current block.

[0358] In addition, for cases where the height and width of the current block are not 4, decoding device 200 applies the non-separable transformation matrix to the upper left 4×4 area of ​​the current block if the product of the width and height of the current block is smaller than a threshold, applies the non-separable transformation matrix to the upper left 4×4 area of ​​the current block and to the 4×4 area located to the right of the upper left 4×4 area if the width of the current block is greater than or equal to the height, and applies the non-separable transformation matrix to the upper left 4×4 area of ​​the current block and to the 4×4 area located below the upper left 4×4 area if the product of the width and height of the current block is greater than or equal to the threshold and the width of the current block is less than the height.

[0359] 30 is a block diagram of an example of an apparatus for processing a video signal according to an embodiment of the present invention. An image processing apparatus 3000 in FIG. 30 may correspond to the encoding apparatus 100 in FIG. 1 or the decoding apparatus 200 in FIG.

[0360] An image processing device 3000 for processing an image signal includes a memory 3020 for storing an image signal, and a processor 3010 for processing the image signal while being coupled to the memory.

[0361] The processor 3010 according to an embodiment of the present invention includes at least one processing circuit for processing an image signal, and can process the image signal by executing instructions for encoding or decoding the image signal. That is, the processor 3010 encodes original image data or decodes an encoded image signal by executing the encoding or decoding method described above.

[0362] FIG. 31 shows an example of an image coding system to which the present invention is applied.

[0363] An image coding system includes a source device and a receiving device. The source device transmits encoded video / image information or data to the receiving device in the form of a file or streaming over a digital storage medium or a network.

[0364] The source device includes a video source, an encoding device, and a sender. The receiving device includes a receiver, a decoding device, and a renderer. The encoding device may be called a video / image encoding device, and the decoding device may be called a video / image decoding device. The sender may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, which may be a separate device or an external component.

[0365] A video source acquires video / images, such as by a video / image capture, synthesis or generation process. A video source includes a video / image capture device and / or a video / image generation device. A video / image capture device includes, for example, one or more cameras, a video / image archive containing previously captured videos / images, etc. A video / image generation device includes, for example, computers, tablets, smartphones, etc., and can (electronically) generate video / images. For example, a virtual video / image can be generated, such as by a computer, in which case a process of generating associated data can replace the process of video / image capture.

[0366] An encoder encodes the input video / image. The encoder may perform a series of steps such as prediction, transformation, and quantization for compression and coding efficiency. The encoded data (encoded video / image information) is output in the form of a bitstream.

[0367] The transmitter transmits the encoded video / image information or data output in the form of a bitstream to a receiver of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium includes various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter includes elements for generating a media file according to a predetermined file format and elements for transmission via a broadcast / communication network. The receiver extracts the bitstream and transmits it to a decoding device.

[0368] The decoding device decodes the video / image by carrying out a series of steps such as inverse quantization, inverse transformation, prediction, etc., which correspond to the operations of the encoding device.

[0369] The renderer renders the decoded video / images, which are then displayed via a display unit.

[0370] FIG. 32 is a structural diagram of a content streaming system according to an embodiment of the present invention.

[0371] The content streaming system to which the present invention is applied includes an encoding server, a streaming server, a web server, a media storage device (repository), a user device and a multimedia input device.

[0372] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.

[0373] The bitstream is generated by an encoding method or a bitstream generating method to which the present invention is applied, and the streaming server can temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0374] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as a medium to inform the user of available services. 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 transmits the multimedia data to the user. Here, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.

[0375] The streaming server receives the content from the media storage device and / or the encoding server. For example, when the content is received from the encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.

[0376] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, and the like.

[0377] Each server in the content streaming system can be operated as a distributed server, in which case data received by each server can be processed in a distributed manner.

[0378] In addition, the processing method to which the present invention is applied can be produced in the form of a program executed by a computer and can be stored in a computer-readable storage medium. Multimedia data having a data structure according to the present invention can also be stored in a computer-readable storage medium. The computer-readable storage medium includes any kind of storage device and distributed storage device in which computer-readable data is stored. The computer-readable storage medium can include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable storage medium also includes a medium realized in the form of a carrier wave (e.g., transmission through the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable storage medium or transferred via a wired or wireless communication network.

[0379] Furthermore, the embodiments of the present invention may be realized as a computer program product by a program code, which may be executed on a computer according to the embodiments of the present invention. The program code may be stored on a carrier readable by the computer.

[0380] As described above, the embodiments described in the present invention may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units shown in each figure may be implemented and executed on a computer, processor, microprocessor, controller, or chip.

[0381] In addition, the decoder and encoder to which the present invention is applied can be included in a multimedia broadcasting transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a video on demand (VoD) service providing device, an OTT video (Over The Top video) device, an Internet streaming service providing device, a three-dimensional (3D) video device, a videophone, a video device, and a medical video device, and are used to process a video signal or a data signal. For example, an OTT video (Over The Top video) device can include a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a DVR (Digital Video Recorder), and the like.

[0382] In addition, the processing method to which the present invention is applied can be produced in the form of a program executed by a computer and can be stored in a computer-readable storage medium. Multimedia data having a data structure according to the present invention can also be stored in a computer-readable storage medium. The computer-readable (readable) recording medium includes any kind of storage device and distributed storage device in which computer-readable data is stored. The computer-readable recording medium can include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable recording medium also includes a medium realized in the form of a carrier wave (e.g., transmission through the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable recording medium or transferred via a wired or wireless communication network.

[0383] Furthermore, the embodiments of the present invention may be realized as a computer program product by a program code, which may be executed on a computer according to the embodiments of the present invention. The program code may be stored on a carrier readable by the computer.

[0384] The above-described embodiments are combinations of the components and features of the present invention in a predetermined form. Each component or feature should be considered as optional unless otherwise explicitly stated. Each component or feature may be implemented in a form not combined with other components or features. It is also possible to combine some components and / or features to configure an embodiment of the present invention. The order of operations described in the embodiments of the present invention may be changed. Some configurations or features of any embodiment may be included in other embodiments, or may be replaced with corresponding configurations or features of other embodiments. It is obvious that claims that do not have an explicit citation relationship in the claims may be combined to configure an embodiment, or may be included as a new claim by amendment after filing.

[0385] Embodiments of the present invention may be implemented by various means, such as hardware, firmware, software, or a combination thereof. In a hardware implementation, an embodiment of the present invention may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.

[0386] In the case of implementation by firmware or software, an embodiment of the present invention may be implemented in the form of a module, procedure, function, etc. that performs the functions or operations described above. The software code may be stored in a memory and driven by a processor. The memory may be located inside or outside the processor and may transmit and receive data to and from the processor by various means already known in the art.

[0387] It is obvious to those skilled in the art that the present invention can be embodied in other specific forms without departing from the essential features of the present invention. Therefore, the above detailed description should not be interpreted as limiting in all respects, but should be regarded as illustrative. The scope of the present invention should be determined by a reasonable interpretation of the appended claims, and all modifications within the equivalent scope of the present invention are included in the scope of the present invention. [Industrial Applicability]

[0388] The above-described preferred embodiments of the present invention have been disclosed for illustrative purposes, and those skilled in the art may improve, modify, substitute or add various other embodiments within the technical spirit and scope of the present invention disclosed in the appended claims below.

Claims

1. 1. A method for decoding an image signal, comprising the steps of: performing a secondary inverse transform on secondary transform coefficients of a current block to generate primary transform coefficients for the current block; performing a linear inverse transform on the linear transform coefficients of the current block to generate residual samples of the current block; performing intra prediction on the current block to generate predicted samples of the current block; generating reconstructed samples of the current block based on the predicted samples and the residual samples of the current block; The step of performing a secondary inverse transform comprises: determining a non-separable transformation matrix based on an intra-prediction mode of the current block; applying the non-separable transform matrix to the secondary transform coefficients of the current block; A method, wherein based on the size of the current block being 4x4, the input length and output length of the secondary inverse transform are determined as 8 and 16, respectively.

2. The step of applying the non-separable transformation matrix comprises: The method of claim 1 , comprising applying the non-separable transform matrix to a number of the secondary transform coefficients of the current block that correspond to the input length.

3. The method described in claim 1, wherein the input length and output length of the secondary inverse transform are determined as 16 and 16, respectively, based on the size of the current block being 4x8 or 8x4.

4. The step of applying the non-separable transformation matrix comprises:

4. The method of claim 3, comprising applying the non-separable transformation matrix to a top-left 4x4 region of the current block based on each of the height and width of the current block not being equal to 4 and the product of the width and height being less than a threshold.

5. The step of performing a secondary inverse transform comprises: determining a non-separable transform set index based on the intra-prediction mode; determining a non-separable transform kernel associated with a non-separable transform index within the non-separable transform set indicated by the non-separable transform set index; The method of claim 1 , further comprising: determining the non-separable transformation matrix from the non-separable transformation kernel based on the input length and the output length.

6. 1. A method for encoding an image signal, comprising the steps of: performing intra prediction on a current block to generate a predicted sample of the current block; generating residual samples for the current block based on the prediction samples; performing a linear transform on the residual samples of the current block to generate linear transform coefficients of the current block; performing a secondary transform on the primary transform coefficients of the current block; The step of performing the secondary transformation comprises: determining a non-separable transformation matrix based on an intra-prediction mode of the current block; applying the non-separable transform matrix to the linear transform coefficients of the current block; A method, wherein based on the size of the current block being 4x4, the input length and output length of the secondary transform are determined as 16 and 8, respectively.

7. The step of applying the non-separable transformation matrix comprises: The method of claim 6 , comprising applying the non-separable transform matrix to a number of the primary transform coefficients of the current block that correspond to the input length.

8. The method of claim 6, wherein the input length and output length of the secondary transform are determined as 16 and 16, respectively, based on the size of the current block being 4x8 or 8x4.

9. The step of applying the non-separable transformation matrix comprises:

9. The method of claim 8, comprising applying the non-separable transformation matrix to a top-left 4x4 region of the current block based on each of the height and width of the current block not being equal to 4 and the product of the width and height being less than a threshold.

10. The step of performing the secondary transformation comprises: determining a non-separable transform set index based on the intra-prediction mode; determining a non-separable transform kernel associated with a non-separable transform index within the non-separable transform set indicated by the non-separable transform set index; The method of claim 6 , further comprising: determining the non-separable transformation matrix from the non-separable transformation kernel based on the input length and the output length.

11. A method of transmitting data including a bitstream relating to an image, comprising: Obtaining the bitstream for the image, the bitstream comprising: performing intra prediction on a current block to generate a predicted sample of the current block; generating residual samples for the current block based on the prediction samples; performing a linear transform on the residual samples of the current block to generate linear transform coefficients of the current block; performing a secondary transform on the primary transform coefficients of the current block to generate secondary transform coefficients of the current block; performing quantization on the secondary transform coefficients of the current block; transmitting the data including the bitstream relating to the image; The step of performing the secondary transformation comprises: determining a non-separable transformation matrix based on an intra-prediction mode of the current block; applying the non-separable transform matrix to the linear transform coefficients of the current block; A method of transmitting, wherein based on the size of the current block being 4x4, the input length and output length of the secondary transform are determined as 16 and 8, respectively.