Video signal encoding / decoding method and device therefor

By applying reduced transforms to specific regions within video blocks, the method addresses the inefficiencies in processing high-resolution video, reducing complexity and enhancing processing efficiency.

JP7538277B2Active Publication Date: 2024-08-21LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023037765
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-09-23
Filing Date
2023-03-10
Publication Date
2024-08-21
Estimated Expiration
2039-09-23

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies face challenges in efficiently processing next-generation video content with high spatial resolution, frame rate, and scene representation, leading to increased memory storage and processing demands.

Method used

A method and apparatus for video signal processing that applies reduced transforms by determining specific regions within a block for transformation, using transform kernels horizontally and vertically, and setting coefficients of other regions to zero, with predefined sizes and combinations such as DST7 and DCT8, to reduce complexity.

Benefits of technology

Significantly reduces computational complexity by performing transformations only on predefined regions, enhancing efficiency in processing high-resolution video content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007538277000044
    Figure 0007538277000044
  • Figure 0007538277000052
    Figure 0007538277000052
  • Figure 0007538277000053
    Figure 0007538277000053
Patent Text Reader

Abstract

To provide a method and an apparatus for processing video signals.SOLUTION: A method and an apparatus for processing video signals are provided. Specifically, a method for decoding a video signal based on reduced transform comprises the steps of: obtaining, from the video signal, a conversion index (a transform index) instructing a transform kernels applied to a horizontal and a vertical directions of a current block; determining a region in which the transform is applied to the current block on the basis of the transform kernels indicated by the transform index and the size of the current block; deriving, as zero, coefficients of remaining region other than a region to which the transform is applied in the current block; and performing an inverse transform on the region to which the transform is applied using the transform kernels indicated by the transform index.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The embodiments of the present specification relate to a method and apparatus for processing a video signal, and further to a method and apparatus for encoding / decoding a video signal by performing a transformation based on a specifically reduced transformation. [Background technology]

[0002] Compression coding refers to a series of signal processing techniques for transmitting digitalized 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 have characteristics such as 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 more accurate prediction techniques 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] The purpose of the embodiments of this document is to propose a method for performing a primary transform on a predefined region according to certain conditions.

[0006] The technical problems to be solved in the embodiments of the present specification are not limited to the technical problems 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] One aspect of an embodiment of the present specification may include a method for decoding a video signal based on a reduced transform, comprising the steps of: obtaining from the video signal a transform index indicating transform kernels to be applied in the horizontal and vertical directions of a current block; determining an area to which the transform is applied to the current block based on the transform kernel indicated by the transform index and a size of the current block; treating coefficients of remaining areas within the current block other than the area to which the transform is applied as 0; and performing an inverse transform on the area to which the transform is applied using the transform kernel indicated by the transform index.

[0008] Preferably, the step of determining the area to which the transformation is applied may be performed by determining, when the transformation kernel indicated by the transformation index is a predefined transformation and the width and / or height of the current block is greater than a predefined size, an area having a width and / or height of the predefined size as the area to which the transformation is applied.

[0009] Preferably, the predefined transform may be any one of a combination of transforms consisting of a combination of DST7 and / or DCT8.

[0010] Preferably, the predefined size may be sixteen.

[0011] Preferably, the step of determining the area to which the transformation is applied can be performed by, if the transformation kernel indicated by the transformation index belongs to a first transformation group, determining the smaller of the width of the current block or 32 as the width of the area to which the transformation is applied, and determining the smaller of the height of the current block or 32 as the height of the area to which the transformation is applied, and, if the transformation kernel indicated by the transformation index belongs to a second transformation group, determining the smaller of the width of the current block or 16 as the width of the area to which the transformation is applied, and determining the smaller of the height of the current block or 16 as the height of the area to which the transformation is applied.

[0012] Preferably, the method further includes a step of obtaining a syntax element indicating the position of a last significant coefficient in a scan order within the current block, and the coefficient to which the inverse transform is applied can be obtained from the video signal based on the position of the last significant coefficient.

[0013] Preferably, the syntax elements are binarized in a truncated unary manner, and the maximum value of the syntax elements may be determined based on the region considered to be zero.

[0014] One aspect of an embodiment of the present specification is an apparatus for decoding a video signal based on a reduced transform, the apparatus including a memory for storing the video signal, and a processor coupled to the memory, the processor obtaining from the video signal a transform index indicating transform kernels to be applied to the horizontal and vertical directions of a current block, determining an area to which the transform is applied to the current block based on the transform kernel indicated by the transform index and a size of the current block, treating coefficients of remaining areas within the current block other than the area to which the transform is applied as 0, and performing an inverse transform on the area to which the transform is applied using the transform kernel indicated by the transform index. Effect of the Invention

[0015] According to embodiments of the present invention, the complexity can be significantly reduced by performing the transformation only on predefined regions depending on certain conditions.

[0016] The effects obtained in the examples of the present specification are not limited to those mentioned above, and other effects not mentioned will 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]

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

[0018] [Figure 1] As an embodiment to which the present invention is applied, an example of a video coding system will be described. [Diagram 2] 1 shows a schematic block diagram of an encoding device for encoding a video / image signal as an embodiment to which the present invention is applied. [Diagram 3] 1 shows a schematic block diagram of a decoding device for decoding a video signal as an embodiment to which the present invention is applied. [Figure 4] FIG. 1 is a structural diagram of a content streaming system as an embodiment to which the present invention is applied. [Diagram 5] As embodiments to which the present invention can be applied, FIG. 5a is a diagram for explaining a block division structure using QT (QuadTree, hereinafter referred to as "QT"), FIG. 5b is a diagram for explaining a block division structure using BT (Binary Tree, hereinafter referred to as "BT"), FIG. 5c is a diagram for explaining a block division structure using TT (Ternary Tree, hereinafter referred to as "TT"), and FIG. 5d is a diagram for explaining a block division structure using AT (Asymmetric Tree, hereinafter referred to as "AT"). [Figure 6] As an embodiment to which the present invention is applied, a schematic block diagram of a transform and quantization unit and an inverse quantization and inverse transform unit in an encoding device is shown. [Figure 7] As an embodiment to which the present invention is applied, FIG. 7 shows a schematic block diagram of an inverse quantization and inverse transform unit in a decoding device. [Figure 8] 1 is a flowchart showing a process in which AMT (adaptive multiple transform) is performed. [Figure 9] 13 is a flowchart showing a decoding process in which AMT is performed. [Figure 10] 10 is a flowchart illustrating an MTS-based inverse transformation process according to an embodiment of the present invention. [Figure 11] FIG. 2 is a block diagram of an apparatus for performing MTS-based decoding according to an embodiment of the present invention. [Figure 12] 1 is an encoding / decoding flowchart in which a secondary transformation is applied as an embodiment to which the present invention is applied; [Figure 13] 1 is an encoding / decoding flowchart in which a secondary transformation is applied as an embodiment to which the present invention is applied; [Figure 14] As an embodiment to which the present invention is applied, FIG. 14 shows a diagram for explaining Givens rotation. [Figure 15] As an embodiment to which the present invention is applied, a configuration of one round in a 4x4 NSST (non-separable secondary transform) composed of a Givens rotation layer and permutation is shown. [Figure 16] As an embodiment to which the present invention is applied, the operation of a reduced secondary transform (RST) will be shown. [Figure 17] 13 is a diagram illustrating a process of performing a reverse scan from the 64th to the 17th blocks based on a reverse scan order, according to an embodiment of the present invention. [Figure 18] As an embodiment to which the present invention is applied, an example of an encoding flowchart using a single transform indicator (STI) is shown. [Figure 19] As an embodiment to which the present invention is applied, an example of an encoding flowchart using a unified transform indicator (UTI) will be shown. [Figure 20a] Another example of an encoding flowchart using UTI will be shown as an embodiment to which the present invention is applied. [Figure 20b] Another example of an encoding flowchart using UTI will be shown as an embodiment to which the present invention is applied. [Figure 21] As an embodiment to which the present invention is applied, an example of an encoding flowchart for performing conversion will be shown. [Figure 22] As an embodiment to which the present invention is applied, an example of a decoding flowchart for performing conversion is shown. [Figure 23] As an embodiment to which the present invention is applied, an example of a detailed block diagram of the conversion unit 120 in the encoding device 100 is shown. [Figure 24] As an embodiment to which the present invention is applied, an example of a detailed block diagram of the inverse transform unit 230 in the decoding device 200 is shown. [Diagram 25]1 shows a flow chart for processing a video signal in an embodiment to which the present invention is applied. [Figure 26] 2 is a flowchart illustrating a method for converting a video signal according to an embodiment of the present invention; [Figure 27] FIG. 2 is a diagram illustrating a method for encoding a video signal using a reduced transform as an embodiment to which the present invention is applied. [Figure 28] FIG. 2 illustrates a method for decoding a video signal using a reduced transform as an embodiment to which the present invention is applied. [Figure 29] 4 is a flowchart illustrating a method for decoding a video signal based on a reduced transform according to an embodiment of the present disclosure. [Diagram 30] 1 shows an example of a block diagram of an apparatus for processing a video signal as an embodiment to which the present invention is applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0019] 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.

[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] Furthermore, the terms used in the present invention are currently common terms that are widely used whenever possible, but in certain cases, the applicant may use terms arbitrarily selected by the applicant to explain the invention. In such cases, the meanings of the terms will be clearly described in the detailed description of the relevant part, so it is made clear that the terms should not be interpreted simply based on the names of the terms used in the description of the present invention, but should be interpreted while also understanding the meanings of the terms.

[0022] 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.

[0023] 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 to include 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).

[0024] 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 coding tree block (CTB), a coding block (CB), a PU, or a transform block (TB) of a luminance component. Or, the processing unit may correspond to a CTB, CB, PU, ​​or TB of a 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.

[0025] 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.

[0026] In the following description, pixels or picture elements are generally referred to as samples. Using a sample can mean using a pixel value or picture element value.

[0027] FIG. 1 shows an example of a video coding system as an embodiment to which the present invention is applied.

[0028] The video coding system may include a source device 10 and a receiving device 20. The source device 10 may transfer encoded video / image information or data to the receiving device 20 in a file or streaming form via a digital storage medium or a network.

[0029] The source device 10 may include a video source 11, an encoding device 12, and a transmitter 13. The receiving device 20 may include a receiver 21, a decoding device 22, and a renderer 23. The encoding device 10 may be referred to as a video / video encoding device, and the decoding device 20 may be referred to as a video / video decoding device. The transmitter 13 may be included in the encoding device 12. The receiver 21 may be included in the decoding device 22. The renderer 23 may include a display unit or may be configured as a separate device or an external component of the display unit.

[0030] A video source may acquire video / video through a video / video capture, synthesis, or generation process. A video source may include a video / video capture device and / or a video / video generation device. A video / video capture device may include, for example, one or more cameras, a video / video archive containing previously captured video / video, etc. A video / video generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / video. For example, a virtual video / video may be generated through a computer, etc., in which case the video / video capture process may be substituted for the process in which the associated data is generated.

[0031] The encoding device 12 can encode the input video / image. The encoding device 12 can perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0032] The transmitting unit 13 can transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit 13 can include elements for generating a media file through a predetermined file format and can include elements for transmission via a broadcasting / communication network. The receiver 21 can extract the bitstream and transmit it to the decoding device 22.

[0033] The decoding device 22 can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, prediction, etc., corresponding to the operations of the encoding device 12.

[0034] A renderer 23 can render the decoded video / image. The rendered video / image can be displayed via a display unit.

[0035] 2 is a schematic block diagram of an encoding device for encoding a video / image signal as an embodiment to which the present invention is applied. The encoding device 100 in FIG. 2 may correspond to the encoding device 12 in FIG.

[0036] The image division unit 110 may divide 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 may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) based on a quad-tree binary-tree (QTBT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth 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 may be performed based on a final coding unit that is not further divided. In this case, the maximum 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 may include 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 may be divided or partitioned from the final coding unit described above. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.

[0037] Unit is sometimes used interchangeably with terms such as block or area. In the general case, an MxN block can refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally refer to a pixel or pixel value, or to a pixel / pixel value of the luma component only, or to a pixel / pixel value of the chroma component only. A sample is used as a term that corresponds to a pixel or pel of a picture (or image).

[0038] The encoding device 100 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 180 or the intra prediction unit 185 from an input video signal (original block, original sample array), and the generated residual signal is transferred to the conversion unit 120. In this case, as shown in the figure, a unit in the encoder 100 that subtracts a prediction signal (predicted block, prediction sample array) from an input video signal (original block, original sample array) may be called a subtraction unit 115. The prediction unit may predict a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample of 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 may generate various information related to prediction, such as prediction mode information, as described later in the description of each prediction mode, and transfer it to the entropy encoding unit 190. The prediction information can be encoded by the entropy encoding unit 190 and output in the form of a bitstream.

[0039] The intra prediction unit 185 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 away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may 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 fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. 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.

[0040] The inter prediction unit 180 may derive a predicted block of the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, 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 motion information between surrounding blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include information on an inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the surrounding blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks 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 generate information indicating which candidate is used to derive a motion vector and / or a reference picture index of the current block by forming a motion information candidate list based on neighboring blocks. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 180 may use motion information of neighboring blocks as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of motion vector prediction (MVP) mode, the motion vector of the current block can be indicated by signaling the motion vector difference using the motion vector of the neighboring block as a motion vector predictor.

[0041] The prediction signal generated via 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.

[0042] The transform unit 120 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is represented by a graph. The 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 non-square variable size blocks.

[0043] The quantizer 130 quantizes the transform coefficients and transmits them to the entropy encoding unit 190, which may encode the quantized signal (information on the quantized transform coefficients) and output it as a bitstream. The information on the quantized transform coefficients may be called residual information. The quantizer 130 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in a 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) may be transferred or stored in the form of a bitstream in network abstraction layer (NAL) units. The bitstream may be transferred via a network or stored in a digital storage medium. Here, the network may include a broadcast network and / or a network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting the signal output from the entropy encoding unit 190 and / or a storing unit (not shown) for storing the signal may be configured as an element inside / outside the encoding device 100, or the transmitting unit may be a component of the entropy encoding unit 190.

[0044] The quantized transform coefficients output from the quantizer 130 can be used to generate a prediction signal. For example, the quantized transform coefficients can be inverse quantized and inverse transformed through the inverse quantizer 140 and the inverse transformer 150 in the loop to restore a residual signal. The adder 155 can generate 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 of the block to be processed, as in the case where the skip mode is applied, the predicted block is used as the reconstructed block. The adder 155 can be called a reconstruction unit or a reconstructed block generator. The generated reconstructed signal is used for intra prediction of the next block to be processed in the current picture, and may be used for inter prediction of the next picture after filtering as described below.

[0045] 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 transfer the modified reconstructed picture to the decoded picture buffer 170. Various filtering methods may include, for example, diblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc. The filtering unit 160 may generate various information related to filtering as described below in the description of each filtering method and transfer it to the entropy encoding unit 190. The information related to filtering may be encoded by the entropy encoding unit 190 and output in the form of a bitstream.

[0046] The modified reconstructed picture transferred to the decoded picture buffer 170 is used as a reference picture by the inter prediction unit 180. This allows the encoding apparatus to avoid prediction mismatch between the encoding apparatus 100 and the decoding apparatus when inter prediction is applied, and also improves encoding efficiency.

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

[0048] 3 is a schematic block diagram of a decoding device for decoding a video signal as an embodiment to which the present invention is applied. A decoding device 200 in FIG. 3 may correspond to the decoding device 22 in FIG.

[0049] Referring to FIG. 3, the decoding device 200 may include 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 may include 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 may include 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. Additionally, the decoded picture buffer 250 may be implemented by a single hardware component (eg, a memory or digital storage medium) depending on the embodiment.

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

[0051] The decoding device 200 may receive a signal output from the encoding device 100 of Fig. 2 in the form of a bitstream, and the received signal may be decoded through the entropy decoding unit 210. For example, the entropy decoding unit 210 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by farsing (analyzing) the bitstream. 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. In more detail, the CABAC entropy decoding method receives bins corresponding to each syntax element from the bitstream, determines a context model using information of the syntax element to be decoded and decode information of the neighboring and blocks to be decoded, or information of symbols / bins decoded in a previous step, predicts the occurrence probability of the bin based on the determined context model, and performs arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element. In this case, after determining the context model, the CABAC entropy decoding method may update the context model using information of the decoded symbol / bin for the context model of the next symbol / bin. Among the information decoded by the entropy decoding unit 210, information related to prediction is provided to a prediction unit (inter prediction unit 260 and intra prediction unit 265), and residual values ​​entropy decoded from the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, may be input to the inverse quantization unit 220. In addition, information regarding filtering among the information decoded by the entropy decoding unit 210 may be 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.

[0052] The inverse quantization unit 220 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 220 may rearrange the quantized transform coefficients into a two-dimensional block shape. 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 may perform inverse quantization of the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.

[0053] The inverse transform unit 230 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0054] The prediction unit may perform prediction of the current block and generate a predicted block including a prediction sample of 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.

[0055] 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 from the current block depending on the prediction mode. Prediction modes in intra prediction may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 265 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.

[0056] The inter prediction unit 260 may derive a predicted block of the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, 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 motion information between surrounding blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include information on an inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the surrounding blocks may 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 may configure a motion information candidate list based on the surrounding blocks and derive a motion vector and / or a reference picture index of the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information on the prediction may include information indicating the mode of inter prediction of the current block.

[0057] The adder 235 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstruction, 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. As in the case where the skip mode is applied, if there is no residual for the block to be processed, the predicted block is used as the reconstructed block.

[0058] 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, and may be used for inter prediction of the next picture after filtering as described below.

[0059] The filtering unit 240 may improve the subjective / objective picture quality by applying filtering to the reconstructed signal. For example, the filtering unit 240 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transfer the modified reconstructed picture to the decoded picture buffer 250. Various filtering methods may include, for example, deblocking filtering, sample adaptive offset (SAO), an adaptive loop filter (ALF), a bilateral filter, etc.

[0060] The modified reconstructed picture transferred to the decoded picture buffer 250 is used as a reference picture by the inter predictor 260 .

[0061] In this specification, the embodiments described for the filtering unit 160, inter prediction unit 180 and intra prediction unit 185 of the encoding device 100 can also be applied in an identical or corresponding manner to the filtering unit 240, inter prediction unit 260 and intra prediction unit 265 of each decoding device.

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

[0063] The content streaming system to which the present invention is applied can broadly include an encoding server 410 , a streaming server 420 , a Web server 430 , a media storage 440 , a user device 450 and a multimedia input device 460 .

[0064] The encoding server 410 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 420. As another example, if a multimedia input device 460 such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server 410 can be omitted.

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

[0066] The streaming server 420 transfers multimedia data to the user device 450 based on a user request via the web server 430, and the web server 430 acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server 430, the web server 430 transfers it to the streaming server 420, and the streaming server 420 transfers the multimedia data to the user. At this time, the content streaming system may include a separate control server, and in this case, the control server plays a role of controlling commands / responses between each device in the content streaming system.

[0067] The streaming server 420 may receive content from the media storage 440 and / or the encoding server 410. For example, when content is received from the encoding server 410, the content may be received in real time. In this case, in order to provide a smooth streaming service, the streaming server 420 may store the bitstream for a certain period of time.

[0068] Examples of user devices 450 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 glass, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, and the like.

[0069] 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.

[0070] FIG. 5 is a diagram for explaining block division structures according to an embodiment to which the present invention can be applied, in which FIG. 5a is a QT (QuadTree, QT), FIG. 5b is a BT (Binary Tree, BT), FIG. 5c is a TT (Ternary Tree, TT), and FIG. 5d is an AT (Asymmetric Tree, AT).

[0071] In video coding, a block may be divided based on QT. Also, a subblock divided by QT may be further divided recursively using QT. A leaf block that is no longer divided by QT may be divided by at least one of BT, TT, or AT. BT may have two types of division, horizontal BT (2NxN, 2NxN) and vertical BT (Nx2N, Nx2N). TT may have two types of division, horizontal TT (2Nx1 / 2N, 2NxN, 2Nx1 / 2N) and vertical TT (1 / 2Nx2N, Nx2N, 1 / 2Nx2N). AT can have four types of partitions: horizontal-up AT (2Nx1 / 2N, 2Nx3 / 2N), horizontal-down AT (2Nx3 / 2N, 2Nx1 / 2N), vertical-left AT (1 / 2Nx2N, 3 / 2Nx2N), vertical-right AT (3 / 2Nx2N, 1 / 2Nx2N). Each BT, TT, and AT can be further partitioned recursively using BT, TT, and AT.

[0072] Figure 5a shows an example of QT partitioning. Block A can be partitioned by QT into four sub-blocks (A0, A1, A2, A3). Sub-block A1 can be partitioned again by QT into four sub-blocks (B0, B1, B2, B3).

[0073] Figure 5b shows an example of BT partitioning. Block B3, which is no longer divided by QT, can be partitioned into vertical BT (C0, C1) or horizontal BT (D0, D1). Like block C0, each subblock can be further partitioned recursively, such as in the form of horizontal BT (E0, E1) or vertical BT (F0, F1).

[0074] Figure 5c shows an example of a TT partition. Block B3, which is no longer partitioned by QT, can be partitioned into vertical TTs (C0, C1, C2) or horizontal TTs (D0, D1, D2). Like block C1, each subblock can be further partitioned recursively, such as in the form of horizontal TTs (E0, E1, E2) or vertical TTs (F0, F1, F2).

[0075] Figure 5d shows an example of an AT partition. Block B3, which is no longer partitioned by QT, can be partitioned into vertical AT(C0,C1) or horizontal AT(D0,D1). Like block C1, each subblock can be further partitioned recursively, such as in the form of horizontal AT(E0,E1) or vertical TT(F0,F1).

[0076] Meanwhile, BT, TT, and AT divisions can be used together for division. 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 division form is the same.

[0077] In addition, when a block is divided, the order of searching the block can be defined in various ways. In general, searching a block from left to right and from top to bottom can mean the order of determining whether to divide an additional block of each divided sub-block, or the coding order of each sub-block if the block is no longer divided, or the search order when a sub-block refers to information of other adjacent blocks.

[0078] A transform may be performed for each processing unit (or transform block) divided according to the division structure shown in Figures 5a to 5d, and in particular, a transform matrix may be applied to each divided row and column. According to an embodiment of the present invention, different transform types are used depending on the length of the processing unit (or transform block) in the row or column direction.

[0079] The transform is applied to the residual block in order to decorrelate it as much as possible, concentrate the coefficients in low frequencies, and create a zero tail at the beginning of the block. In the JEM software, the transform part includes two main functions: core transform and secondary transform. The core transform consists of the DCT (discrete cosine transform) and DST (discrete sine transform) transform families that are applied to every row and column of the residual block. The secondary transform can then be additionally applied to the top left corner of the output of the core transform. Similarly, the secondary inverse transform and the inverse transform of the core inverse transform order can be applied. First, the secondary inverse transform can be applied to the top left corner of the coefficient block. The core inverse transform is then applied to the rows and columns of the output of the secondary inverse transform. The core transform or inverse transform can be referred to as the primary transform or inverse transform.

[0080] 6 and 7 show an embodiment to which the present invention is applied. FIG. 6 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. 2, and FIG. 7 shows a schematic block diagram of the inverse quantization and inverse transform unit (220 / 230) in the decoding device 200.

[0081] 6, the transform and quantization unit (120 / 130) may include a primary transform unit 121, a secondary transform unit 122, and a quantization unit 130. The inverse quantization and inverse transform unit (140 / 150) may include an inverse quantization unit 140, an inverse secondary transform unit 151, and an inverse primary transform unit 152.

[0082] Looking carefully at FIG. 7, the inverse quantization and inverse transform unit (220 / 230) may include an inverse quantization unit 220, an inverse secondary transform unit 231, and an inverse primary transform unit 232.

[0083] In the present invention, when performing a transformation, the transformation can be performed through multiple stages. For example, as shown in Figure 6, two stages of a primary transform and a secondary transform can be applied, or more transformation stages can be used based on the algorithm. Here, the primary transform can be referred to as a core transform.

[0084] The linear transform unit 121 may apply a linear transform to the residual signal, where the linear transform may be predefined in a table from the encoder and / or decoder.

[0085] The secondary transform unit 122 may apply a secondary transform to the linearly transformed signal, where the secondary transform may be predefined in a table from the encoder and / or decoder.

[0086] 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-predicted blocks, and may have a set of applicable transforms for each prediction mode group.

[0087] Here, the prediction mode group may be set based on the symmetry of the prediction direction. For example, since the prediction mode 52 and the prediction mode 16 are symmetric based on the prediction mode 34 (diagonal direction), they form one group and the same transform set may be applied. In this case, when applying the transform of 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.

[0088] On the other hand, Planar mode and DC mode have their own transformation sets, each consisting of two transformations, since there is no directional symmetry, while the remaining directional modes have three transformations per transformation set.

[0089] The quantization unit 130 may perform quantization on the quadrature-transformed signal.

[0090] The inverse quantization and inverse transformation unit (140 / 150) performs the above-described process inversely, and a duplicated description will be omitted.

[0091] FIG. 7 shows a schematic block diagram of the inverse quantization and inverse transform unit (220 / 230) in the decoding device 200.

[0092] Referring to FIG. 7, the inverse quantization and inverse transform unit (220 / 230) may include an inverse quantization unit 220, an inverse secondary transform unit 231, and an inverse primary transform unit 232.

[0093] The inverse quantization unit 220 uses the quantization step size information to obtain transform coefficients from the entropy decoded signal.

[0094] The inverse quadratic transform unit 231 executes an inverse quadratic transform on the transform coefficients. Here, the inverse quadratic transform refers to the inverse transform of the quadratic transform described in FIG.

[0095] 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. 6.

[0096] In addition to the DCT-2 and 4x4 DST-4 applied in HEVC, the adaptive (or explicit) multiple transform (AMT or EMT) technique is used for residual coding of inter- and intra-encoded blocks. In addition to the HEVC transforms, a number of selected transforms from other DCT / DST families are used. The newly introduced transform matrices from JEM are DST-7, DCT-8, DST-1, and DCT-5. Table 1 below shows the selected DST / DCT basis functions.

[0097] [Table 1]

[0098] EMT can be applied to CUs with width and height less than or equal to 64, and whether EMT is applied can be controlled by a CU level flag. If the CU level flag is 0, DCT-2 is applied to the CU to encode the residual. For intra-CU luma coding blocks to which EMT is applied, two additional flags are signaled to identify the horizontal and vertical transforms to be used. Like HEVC, the residuals of blocks in JEM can be coded in transform skip mode. For intra residual coding, a mode-dependent transform candidate selection process is used, depending on the residual statistics of other intra prediction modes. Three transform subsets are defined as shown in Table 2 below, and the transform subset is selected based on the intra prediction mode as shown in Table 3.

[0099] [Table 2]

[0100] With the subset concept, a subset of transforms is first identified based on Table 2 by using intra prediction modes of CUs with CU-level EMT_CU_flag set to 1. Then, for each horizontal (EMT_TU_horizontal_flag) and vertical (EMT_TU_vertical_flag) transform, one of two transform candidates in the identified subset of transforms is selected based on explicit signaling using flags based on Table 3.

[0101] [Table 3]

[0102] [Table 4]

[0103] Table 4 shows a transform configuration group to which AMT (adaptive multiple transform) is applied as an embodiment to which the present invention is applied.

[0104] Looking carefully at Table 4, a transform configuration group is determined based on a prediction mode, and there can be a total of six groups (G0 to G5). G0 to G4 correspond to cases where intra prediction is applied, and G5 indicates a combination (or transform set, transform combination set) of transforms applied to a residual block generated by inter prediction.

[0105] A combination of transformations can be done by a horizontal transform (or row transform) applied to the rows of the 2D block and a vertical transform (or column transform) applied to the columns.

[0106] Here, each group of transform settings may have four transform combination candidates. The four transform combination candidates may be selected or determined via transform combination indexes of 0 to 3, and the transform combination indexes may be encoded and transmitted from the encoder to the decoder.

[0107] In one embodiment, residual data (or residual signals) acquired through intra prediction may have different statistical characteristics depending on the intra prediction mode. Therefore, a different transform may be applied to each intra prediction mode instead of a general cosine transform as shown in Table 4. In this specification, the transform type may be expressed as, for example, DCT-Type 2, DCT-II, DCT-2, etc.

[0108] Looking carefully at Table 4, there are cases where 35 intra prediction modes are used and cases where 67 intra prediction modes are used. For each transform setting group divided by the column of each intra prediction mode, multiple transform combinations can be applied. For example, multiple transform combinations can be composed of four (row-direction transform, column-direction transform) combinations. As a specific example, in group 0, DST-7 and DCT-5 can be applied in both the row (horizontal) and column (vertical) directions, and a total of four combinations are possible.

[0109] 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 can be transmitted for each transform unit. In this specification, the transform combination index can be referred to as an AMT index and can be represented by amt_idx.

[0110] In addition to the transform kernels presented in Table 4, there may be cases where DCT-2 is optimal for all row and column directions due to the characteristics of the residual signal. Therefore, by defining an AMT flag for each coding unit, transforms can be applied adaptively. Here, when the AMT flag is 0, DCT-2 is applied to all row and column directions, and when the AMT flag is 1, one of the four combinations can be selected or determined using the AMT index.

[0111] In one embodiment, when the AMT flag is 0, if the number of transform coefficients in one transform unit is less than 3, the transform kernel in Table 4 is not applied, and DST-7 can be applied in all row and column directions.

[0112] In one embodiment, the values ​​of the transform coefficients are parsed first, and if the number of transform coefficients is less than 3, the AMT index is not parsed and DST-7 is applied, thereby reducing the amount of additional information transmitted.

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

[0114] In one embodiment, Table 4 can be populated via off-line training.

[0115] In one embodiment, the AMT index can be defined as one index that can simultaneously refer to a combination of horizontal and vertical transforms, or the AMT index can be defined as separate horizontal and vertical transform indexes.

[0116] FIG. 8 is a flowchart showing a process in which AMT (adaptive multiple transform) is performed.

[0117] Although this specification primarily describes an embodiment of a separable transform in which the transformation is applied separately to the horizontal and vertical directions, the combination of transforms can also be configured to be non-separable transforms.

[0118] Alternatively, a combination of transforms can be constructed by mixing separable and non-separable transforms. In this case, when a non-separable transform is used, row / column or horizontal / vertical transform selection is not necessary, and the transform combinations in Table 4 can be used only when a separable transform is selected.

[0119] In addition, the method proposed in this specification can be applied regardless of whether it is a linear 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 linear transform can refer to a transform for initially transforming a residual block, and the secondary transform can refer to a transform for applying a transform to a block generated as a result of the linear transform.

[0120] First, the encoding device 100 may determine a transform group corresponding to a current block (S805). Here, the transform group may refer to the transform group in Table 4, but the present invention is not limited thereto and may be configured with other transform combinations.

[0121] The encoding device 100 may perform a transform on a combination of candidate transforms to be used in the transform group (S810). As a result of the transform execution, the encoding device 100 may determine or select a combination of transforms with a minimum rate distortion (RD) cost (S815). The encoding device 100 may encode an index of the transform combination corresponding to the selected transform combination (S820).

[0122] FIG. 9 is a flow chart showing the decoding process in which AMT is performed.

[0123] First, the decoding apparatus 200 may determine a transform group for a current block (S905). The decoding apparatus 200 may analyze an index of a transform combination, where the index of the transform combination may correspond to any one of a plurality of transform combinations in the transform group (S910). The decoding apparatus 200 may derive a transform combination corresponding to the index of the transform combination (S915). Here, the transform combination may refer to the transform combination described in Table 4, but the present invention is not limited thereto. That is, configurations using other transform combinations are also possible.

[0124] The decoding apparatus 200 may perform an inverse transform on the current block based on the transform combination (S920). If the transform combination is composed of a row transform and a column transform, the row transform may be applied first, and then the column transform may be applied. However, the present invention is not limited thereto, and if the transform combination is composed of a non-separable transform, the non-separable transform may be applied directly.

[0125] Meanwhile, in another embodiment, the process of determining the transformation group and the process of analyzing the transformation combination index may be performed simultaneously.

[0126] According to an embodiment of the present invention, the above-mentioned term "AMT" can be redefined as "MTS (multiple transform set or multiple transform selection)". The MTS-related syntax and semantics described below are defined in the versatile video coding (VVC) standard document JVET-K1001-v4.

[0127] In an embodiment of the present invention, two MTS candidates are used for directional modes and four MTS candidates for non-directional modes as follows:

[0128] A) Non-directional mode (DC, Planner)

[0129] When the MTS index is 0, DST-7 is used for horizontal and vertical transformation.

[0130] When the MTS index is 1, DCT-7 is used for the vertical transform and DCT-8 is used for the horizontal transform.

[0131] When the MTS index is 2, a DCT-8 is used for the vertical transform and a DST-7 is used for the horizontal transform.

[0132] When the MTS index is 3, the DCT-8 is used for the horizontal and vertical transforms.

[0133] B) Modes that belong to the horizontal group mode

[0134] When the MTS index is 0, DST-7 is used for horizontal and vertical transformation.

[0135] When the MTS index is 1, a DCT-8 is used for the vertical transform and a DST-7 is used for the horizontal transform.

[0136] C) Modes belonging to the vertical group mode

[0137] When the MTS index is 0, DST-7 is used for horizontal and vertical transformation.

[0138] When the MTS index is 1, DCT-7 is used for the vertical transform and DCT-8 is used for the horizontal transform.

[0139] Here (in VTM 2.0 where 67 modes are used), the horizontal group modes include intra prediction modes 2 through 34, and the vertical modes include intra prediction modes 35 through 66.

[0140] In another embodiment of the present invention, three MTS candidates are used for all intra prediction modes.

[0141] When the MTS index is 0, DST-7 is used for horizontal and vertical transformation.

[0142] When the MTS index is 1, DCT-7 is used for the vertical transform and DCT-8 is used for the horizontal transform.

[0143] When the MTS index is 2, a DCT-8 is used for the vertical transform and a DST-7 is used for the horizontal transform.

[0144] In another embodiment of the present invention, two MTS candidates are used for directional prediction modes and three MTS candidates for non-directional prediction modes.

[0145] A) Non-directional mode (DC, Planner)

[0146] When the MTS index is 0, DST-7 is used for horizontal and vertical transformation.

[0147] When the MTS index is 1, DCT-7 is used for the vertical transform and DCT-8 is used for the horizontal transform.

[0148] When the MTS index is 2, a DCT-8 is used for the vertical transform and a DST-7 is used for the horizontal transform.

[0149] B) Prediction mode corresponding to horizontal group mode

[0150] When the MTS index is 0, DST-7 is used for horizontal and vertical transformation.

[0151] When the MTS index is 1, a DCT-8 is used for the vertical transform and a DST-7 is used for the horizontal transform.

[0152] C) Prediction mode corresponding to vertical group mode

[0153] When the MTS index is 0, DST-7 is used for horizontal and vertical transformation.

[0154] When the MTS index is 1, DCT-7 is used for the vertical transform and DCT-8 is used for the horizontal transform.

[0155] In another embodiment of the present invention, one MTS candidate (e.g., DST-7) is used for all intra modes. In this case, the encoding time can be reduced by up to 40% with minor coding loss. Furthermore, one flag is used to indicate between DCT-2 and DST-7.

[0156] FIG. 10 is a flow chart illustrating an MTS-based inverse transformation process according to an embodiment of the present invention.

[0157] The decoding device 200 to which the present invention is applied may acquire sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag (S1005). Here, sps_mts_intra_enabled_flag indicates whether cu_mts_flag exists in the residual coding syntax of the intra coding unit. For example, if sps_mts_intra_enabled_flag=0, cu_mts_flag does not exist in the residual coding syntax of the intra coding unit, and if sps_mts_intra_enabled_flag=1, cu_mts_flag exists in the residual coding syntax of the intra coding unit. And sps_mts_inter_enabled_flag indicates whether cu_mts_flag exists in the residual coding syntax of the inter coding unit. For example, if sps_mts_inter_enabled_flag=0, then cu_mts_flag is not present in the residual coding syntax of the inter coding unit, and if sps_mts_inter_enabled_flag=1, then cu_mts_flag is present in the residual coding syntax of the inter coding unit.

[0158] The decoding device 200 may acquire cu_mts_flag based on sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag (S1010). For example, when sps_mts_intra_enabled_flag=1 or sps_mts_inter_enabled_flag=1, the decoding device 200 may acquire cu_mts_flag. Here, cu_mts_flag indicates whether MTS is applied to the residual sample of the luma transform block. For example, when cu_mts_flag=0, MTS is not applied to the residual sample of the luma transform block, and when cu_mts_flag=1, MTS is applied to the residual sample of the luma transform block.

[0159] The decoding apparatus 200 may acquire mts_idx based on cu_mts_flag (S1015). For example, when cu_mts_flag=1, the decoding apparatus 200 may acquire mts_idx, where mts_idx indicates which transform kernel is applied to luma residual samples along the horizontal and / or vertical directions of the current transform block.

[0160] For example, for mts_idx, at least one of the embodiments described in this specification can be applied.

[0161] The decoding apparatus 200 may derive a transform kernel corresponding to mts_idx (S1020). For example, the transform kernel corresponding to mts_idx may be defined by being divided into a horizontal transform and a vertical transform.

[0162] For example, when MTS is applied to the current block (i.e., cu_mts_flag=1), the decoding apparatus 200 may configure an MTS candidate based on the intra prediction mode of the current block. In this case, the decoding flowchart of Fig. 10 may further include a step of configuring an MTS candidate. Then, the decoding apparatus 200 may determine an MTS candidate to be applied to the current block from among the configured MTS candidates using mts_idx.

[0163] As another example, different transform kernels may be applied to the horizontal transform and the vertical transform, although the present invention is not limited thereto, and the same transform kernel may be applied to the horizontal transform and the vertical transform.

[0164] Then, the decoding device 200 can perform an inverse transform based on the transform kernel (S1025).

[0165] In addition, in this document, MTS can also be expressed as AMT or EMT, and similarly, mts_idx, AMT_idx, EMT_idx, AMT_TU_idx, EMT_TU_idx, etc., and the present invention is not limited to such expressions.

[0166] In addition, in the present invention, a case where MTS is applied and a case where MTS is not applied are described based on the MTS flag, but the present invention is not limited to such an expression. For example, whether or not MTS is applied may mean whether or not to use another transform type (or transform kernel) other than a predefined specific transform type (which may be called a base transform type, a default transform type, etc.). If MTS is applied, another transform type (e.g., any one of a plurality of transform types or a combination of two or more transform types) other than the base transform type is used for the transform, and if MTS is not applied, the base transform type may be used for the transform. In one embodiment, the base transform type may be set (or defined) to DCT2.

[0167] As one example, an MTS flag syntax indicating whether MTS is applied to the current transform block and an MTS index syntax indicating the transform type applied to the current block if MTS is applied may be transmitted separately from the encoder to the decoder, and as another example, a syntax (e.g., an MTS index) including both whether MTS is applied to the current transform block and the transform type applied to the current block if MTS is applied may be transmitted from the encoder to the decoder. That is, in the latter embodiment, a syntax (or syntax element) indicating the transform type applied to the current transform block (or unit) within the entire transform type group (or transform type set) including the above-mentioned basic transform type may be transmitted from the encoder to the decoder.

[0168] Therefore, despite this expression, the syntax (MTS index) indicating the transform type applied to the current transform block can include information on whether or not to apply MTS. In other words, since only the MTS index is signaled without the MTS flag in the latter embodiment, in this case, it can be interpreted that the MTS includes DCT2, but in the present invention, the case where DCT2 is applied may be described as the case where MTS is not applied, and the technical scope of MTS is not limited to the definition.

[0169] FIG. 11 is a block diagram of an apparatus for performing MTS-based decoding according to an embodiment of the present invention.

[0170] The decoding device 200 to which the present invention is applied may include a sequence parameter acquisition unit 1105 , an MTS flag acquisition unit 1110 , an MTS index acquisition unit 1115 , and a transformation kernel derivation unit 1120 .

[0171] The sequence parameter acquisition unit 1105 may acquire sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag. Here, sps_mts_intra_enabled_flag indicates whether cu_mts_flag exists in the residual coding syntax of an intra coding unit, and sps_mts_inter_enabled_flag indicates whether cu_mts_flag exists in the residual coding syntax of an inter coding unit. For a specific example, the description related to FIG. 10 may be applied.

[0172] The MTS flag acquisition unit 1110 may acquire cu_mts_flag based on sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag. For example, when sps_mts_intra_enabled_flag=1 or sps_mts_inter_enabled_flag=1, the MTS flag acquisition unit 1110 may acquire cu_mts_flag. Here, cu_mts_flag indicates whether MTS is applied to the residual sample of the luma transform block. For a specific example, the description related to FIG. 10 may be applied.

[0173] The MTS index acquirer 1115 may acquire mts_idx based on cu_mts_flag. For example, when cu_mts_flag=1, the MTS index acquirer 1115 may acquire mts_idx. Here, mts_idx indicates which transform kernel is applied to luma residual samples along the horizontal and / or vertical directions of the current transform block. For a specific example, the description of FIG. 10 may be applied.

[0174] The transform kernel deriving unit 1120 can derive a transform kernel corresponding to mts_idx, and the decoding device 200 can perform an inverse transform based on the induced transform kernel.

[0175] A mode-dependent non-separable secondary transform (MDNSST) is introduced. To keep the complexity low, MDNSST is applied only to the low frequency coefficients after the primary transform. A non-separable transform that is applied mainly to the low frequency coefficients can be called a low frequency non-separable transform (LFNST). If the width (W) and height (H) of the transform coefficient block are both equal to or greater than 8, then an 8x8 non-separable secondary transform is applied to the upper left 8x8 region of the transform coefficient block. Otherwise, if the width or height is less than 8, then a 4x4 non-separable secondary transform is applied, which can be performed on the upper left min(8,W)xmin(8,H) region of the transform coefficient block. Here, min(A,B) is a function that outputs the smaller of A and B. Also, WxH is the size of the block, W is the width, and H is the height.

[0176] In one embodiment, there may be a total of 35x3 non-separable quadratic transforms for 4x4 and 8x8 block sizes, where 35 is the number of transform sets specified by the intra prediction mode and 3 is the number of NSST candidates for each prediction mode. The mapping from intra prediction mode to transform sets may be defined as shown in Table 5 below.

[0177] [Table 5]

[0178] Also, according to an embodiment of the present invention, an NSST index (NSST idx) may be coded to indicate a transform kernel among the four non-separable transform sets depending on the intra prediction mode. If NSST is not applied, an NSST index having a value of 0 may be signaled.

[0179] 12 and 13 are encoding / decoding flowcharts in which a secondary transformation is applied as an embodiment to which the present invention is applied.

[0180] In JEM, secondary transform (MDNSST) is not applied to blocks coded in transform skip mode. If the MDNSST index is signaled to a CU and is non-zero, MDNSST is not used for blocks of components coded in transform skip mode within the CU. The overall coding structure including coefficient encoding and NSST index coding is shown in Figures 12 and 13. A coded block flag (CBF) is encoded to determine whether to perform coefficient encoding and NSST coding. In Figures 12 and 13, the CBF flag may indicate a luma block cbf flag (cbf_luma flag) or a chroma block cbf flag (cbf_cb flag or cbf_cr flag). The transform coefficients when the CBF flag is 1 are coded.

[0181] Referring to FIG. 12, the encoding apparatus 100 checks whether the CBF is 1 (S1205). If the CBF is 0, the encoding apparatus 100 does not perform encoding of the transform coefficients and encoding of the NSST index. If the CBF is 1, the encoding apparatus 100 performs encoding of the transform coefficients (S1210). Thereafter, the encoding apparatus 100 determines whether to perform NSST index coding (S1215) and performs NSST index coding (S1220). If NSST index coding is not applied, the encoding apparatus 100 may end the transform procedure in a state where NSST is not applied, and perform a subsequent step (e.g., quantization).

[0182] Referring to FIG. 13, the decoding apparatus 200 checks whether the CBF is 1 (S1305). If the CBF is 0, the decoding apparatus 200 does not perform the decoding of the transform coefficients and the NSST index decoding. If the CBF is 1, the decoding apparatus 200 performs the decoding of the transform coefficients (S1310). Thereafter, the decoding apparatus 200 determines whether to perform NSST index coding (S1315) and analyzes the NSST index (S1320).

[0183] NSST is not applied to the entire block (TU in the case of HEVC) to which the primary transform is applied, but may be applied to the upper left 8x8 region or 4x4 region. For example, if the size of the block is 8x8 or more, 8x8 NSST may be applied, and if it is less than 8x8, 4x4 NSST may be applied. In addition, when 8x8 NSST is applied, 4x4 NSST may be applied for each 4x4 block. Both 8x8 NSST and 4x4 NSST may be determined according to the configuration of the transform set described above, and as they are non-separable transforms, 8x8 NSST may have 64 input data and 64 output data, and 4x4 NSST may have 16 inputs and 16 outputs.

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

[0185] Both the 8x8 NSST and the 4x4 NSST can be constructed as a hierarchical combination of Givens rotations. The matrix corresponding to one Givens rotation is the same as Equation 1, and the matrix multiplication is shown in Figure 14.

[0186]

number

[0187] In FIG. 14, tm and tn output by the Givens rotation can be calculated as shown in Equation 2.

[0188]

number

[0189] As shown in FIG. 14, one Givens rotation rotates two data, so 32 or 8 Givens rotations are required to process 64 data (in the case of 8x8 NSST) or 16 data (in the case of 4x4 NSST), respectively. Therefore, a bundle of 32 or 8 Givens rotations can form a Givens rotation layer. As shown in FIG. 15, the output data of one Givens rotation layer is transferred to the input data of the next Givens rotation layer through permutation (shuffle). As shown in FIG. 15, the permutation pattern is regularly defined, and in the case of 4x4 NSST, four Givens rotation layers and corresponding permutations form one round. 4x4 NSST is performed in two rounds, and 8x8 NSST is performed in four rounds. Different rounds use the same permutation pattern, but the applied Givens rotation angles are different. Therefore, it is necessary to store the angle data of all Givens rotations that make up each transformation.

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

[0191] Reverse NSST rotates the Givens rotation layers and permutations applied in the forward NSST in the reverse order, and also takes negative (-) values ​​for the angles of each Givens rotation.

[0192] RST (Reduced secondary transform)

[0193] FIG. 16 shows the operation of RST as an embodiment to which the present invention is applied.

[0194] When an orthogonal matrix representing a single transform has an NxN form, RT (reduced transform) leaves only R out of N transform basis vectors (R < N). The matrix of the forward RT that generates the transform coefficients can be defined as in Equation (3).

[0195]

Equation

[0196] Since the matrix of the inverse RT is the transpose matrix of the forward RT matrix, if the application of the forward RT and the inverse RT is illustrated, it can be the same as FIGS. 16a and 16b.

[0197] The RT applied to the upper left 8x8 block of the block of transform coefficients to which the first transform is applied may be called an 8x8 RST. In Equation 3, when the value of R is set to 16, the forward 8x8 RST has a 16x64 matrix form, and the backward 8x8 RST has a 64x16 form. In addition, the configuration of the transform set as shown in Table 5 may be applied to the 8x8 RST. That is, the 8x8 RST may be determined based on the transform set according to the intra prediction mode as shown in Table 5. Since one transform set is composed of two or three transforms according to the intra prediction mode, one of up to four transforms may be selected, including the case where the second transform is not applied (one transform may correspond to an identity matrix). When the four transforms are assigned indexes of 0, 1, 2, and 3, respectively, a syntax element corresponding to the NSST index may be signaled for each block of transform coefficients, thereby specifying the transform to be applied. For example, the 0th index can be assigned to the identity matrix, i.e., when no quadratic transformation is applied. In conclusion, for an 8x8 top-left block via an NSST index, an 8x8 NSST can be specified according to the JEM NSST, and an 8x8 RST can be specified according to the RST configuration.

[0198] FIG. 17 is a diagram illustrating a process of performing a reverse scan from the 64th to the 17th blocks based on a reverse scan order, as an embodiment to which the present invention is applied.

[0199] When the forward 8x8 RST as shown in Equation 3 is applied, 16 valid transform coefficients are generated, so that 64 input data constituting an 8x8 area is reduced to 16 output data, and from the perspective of a two-dimensional area, only about 1 / 4 of the area is filled with valid transform coefficients. Therefore, by applying the forward 8x8 RST, the 16 output data obtained are filled in the upper left area of ​​FIG. 17.

[0200] In FIG. 17, the 4x4 region at the top left corner is a ROI (region of interest) region filled with valid transform coefficients, and the remaining regions are empty. The empty regions may be filled with a value of 0 by default. If a valid non-zero transform coefficient is found outside the ROI region of FIG. 17, it is certain that the 8x8 RST is not applied, and therefore the coding of the NSST index may be omitted. Conversely, if a non-zero transform coefficient is not found outside the ROI region of FIG. 17 (when the 8x8 RST is applied and the region outside the ROI is filled with 0), the NSST index may be coded since the 8x8 RST may have been applied. Such conditional NSST index coding may be performed after the residual coding process since it is necessary to check whether or not a non-zero transform coefficient exists.

[0201] FIG. 18 shows an example of an encoding flowchart using a single transform indicator as an embodiment to which the present invention is applied.

[0202] In an embodiment of the present invention, a single transform indicator (STI) is introduced. Instead of using two transforms (primary and secondary) sequentially, a single transform can be applied when the single transform indicator is activated (STI coding == 1). Here, the single transform can be any kind of transform. For example, the single transform can be a separable transform or a non-separable transform. The single transform can be a transform approximated from a non-separable transform. A single transform index (ST_idx in FIG. 18) can be signaled when the single transform indicator is activated. Here, the single transform index can indicate a transform corresponding to the transform to be applied from among available transform candidates.

[0203] Referring to FIG. 18, the encoding apparatus 100 determines whether the CBF is 1 (S1805). If the CBF is 1, the encoding apparatus 100 determines whether STI coding is applied (S1810). If the STI coding is applied, the encoding apparatus 100 encodes an STI index (STI_Idx) (S1845) and performs coding of transform coefficients (S1850). If the STI coding is not applied, the encoding apparatus 100 encodes a flag (EMT_CU_Flag) indicating whether EMT (or MTS) is applied at the CU level (S1815). Thereafter, the encoding apparatus 100 performs coding of transform coefficients (S1820). Thereafter, the encoding apparatus 100 determines whether EMT is applied to a transform unit (TU) (S1825). If EMT is applied to the TU, the encoding apparatus 100 encodes an index (EMT_TU Idx) of a primary transform applied to the TU (S1830). Thereafter, encoding apparatus 100 determines whether an NSST is applied (S1835). If an NSST is applied, encoding apparatus 100 encodes an index (NSST_Idx) indicating the NSST to be applied (S1840).

[0204] In one example, when a condition for single transform coding is satisfied / activated (e.g., STI_coding == 1), a single transform index (ST_Idx) is not signaled and may be derived implicitly. ST_idx may be implicitly determined based on the block size and intra prediction mode. Here, ST_idx may indicate the transform (or transform kernel) to be applied to the current transform block.

[0205] A single transformation indicator can be activated (STI_coding == 1) if one or more of the following conditions are met:

[0206] This corresponds to a predefined value, such as block size 4 or 8.

[0207] Block width == Block height (square block)

[0208] The intra prediction mode is one of the pre-determined modes such as DC or Planar.

[0209] In another example, the STI coding flag may be signaled to indicate whether a single transform is applied. The STI coding flag may be signaled based on the STI coding value and the CBF. For example, the STI coding flag may be signaled when the CBF is 1 and STI coding is activated. Furthermore, the STI coding flag may be conditionally signaled taking into account the block size, the block shape (square block or non-square block), or the intra prediction mode.

[0210] Since the acquired information is used in the coefficient coding, ST_idx can be determined after the coefficient coding. In one example, ST_idx can be implicitly determined based on the block size, intra prediction mode, and the number of non-zero coefficients. In another example, ST_idx can be conditionally encoded / decoded based on the block size and / or the block shape and / or the intra prediction mode, and / or the number of non-zero coefficients. In another example, ST_idx signaling can be omitted depending on the distribution of non-zero coefficients (i.e., the location of the non-zero coefficients). In particular, if a non-zero coefficient is found in an area other than the upper left 4x4 area, the signaling of ST_idx can be omitted.

[0211] FIG. 19 shows an example of an encoding flowchart using a unified transform indicator (UTI) as an embodiment to which the present invention is applied.

[0212] In the embodiment of the present invention, a unified conversion indicator is introduced. The UTI includes a primary conversion indicator and a secondary conversion indicator.

[0213] Referring to FIG. 19, the encoding apparatus 100 determines whether the CBF is 1 (S1905). If the CBF is 1, the encoding apparatus 100 determines whether UTI coding is applied (S1910). If UTI coding is applied, the encoding apparatus 100 encodes a UTI index (UTI_Idx) (S1945) and performs coding of transform coefficients (S1950). If UTI coding is not applied, the encoding apparatus 100 encodes a flag (EMT_CU_Flag) indicating whether EMT (or MTS) is applied at the CU level (S1915). Thereafter, the encoding apparatus 100 performs encoding of transform coefficients (S1920). Thereafter, the encoding apparatus 100 determines whether EMT is applied to a transform unit (TU) (S1925). If EMT is applied to the TU, encoding apparatus 100 encodes an index (EMT_TU Idx) of a primary transform applied to the TU (S1930). Then, encoding apparatus 100 determines whether NSST is applied (S1935). If NSST is applied, encoding apparatus 100 encodes an index (NSST_Idx) indicating the NSST to be applied (S1940).

[0214] The UTI can be encoded for each predetermined unit (CTU or CU).

[0215] The UTI coding mode may depend on the following conditions:

[0216] Block size

[0217] Block Form

[0218] Intra Prediction Mode

[0219] How to derive / extract the core transform index from the UTI is predefined. How to derive / extract the secondary transform index from the UTI is predefined.

[0220] The syntax structure of the UTI is selectively used. The UTI may depend on the CU (or TU) size. For example, smaller CUs (TUs) may have a relatively narrow range of UTI indices. In one example, if a predefined condition is met (e.g., the block size is smaller than a predefined threshold), the UTI may only point to the core transform index.

[0221] [Table 6]

[0222] In another example, if no secondary transform is indicated to be used (e.g., secondary transform index == 0 or secondary transform has already been determined), the UTI index can be treated as a core transform index. Similarly, if the core transform index is known, the UTI index can be treated as a secondary transform index. In particular, a pre-determined core transform can be used, taking into account the intra prediction mode and block size.

[0223] 20a and 20b show another example of an encoding flowchart using UTI as an embodiment to which the present invention is applied.

[0224] In another example, the transform coding structure uses UTI index coding as shown in Figures 20a and 20b, where the UTI index can be coded before or after coefficient coding.

[0225] Referring to FIG. 20a, the encoding apparatus 100 checks whether the CBF is 1 (S2005). If the CBF is 1, the encoding apparatus 100 codes a UTI index (UTI_Idx) (S2010) and codes transform coefficients (S2015).

[0226] Referring to FIG. 20b, the encoding apparatus 100 checks whether the CBF is 1 (S2055). If the CBF is 1, the encoding apparatus 100 performs coding of the transform coefficients (S2060) and codes the UTI index (UTI_Idx) (S2065).

[0227] In another embodiment of the present invention, data hiding and implicit coding methods of transform indicator are introduced. Here, the transform indicator includes ST_idx, UTI_idx, EMT_CU_Flag, EMT_TU_Flag, NSST_idx, and a transform related index used to indicate the transform kernel. The above-mentioned transform indicator is not signaled, and the information can be inserted into the coefficient encoding process (can be extracted during the coefficient coding process). The coefficient encoding process can include the following parts:

[0228] - Last x position (Last_position_x), Last y position (Last_position_y)

[0229] - Group flag

[0230] - Significance map

[0231] - Flag indicating whether it is greater than 1 (Greater_than_1_flag)

[0232] - Flag indicating whether it is greater than 2 (Greater_than_2_flag)

[0233] - Remaining level coding

[0234] - Sign coding

[0235] For example, the transformation indicator information can be inserted into one or more of the coefficient coding processes described above. The following can be considered together for inserting the transformation indicator information:

[0236] - Pattern of Sign coding

[0237] - The absolute value of remaining level

[0238] The number of Greater_than_1_flag indicating whether it is greater than -1

[0239] - The value of Last_position_X and Last_position_Y

[0240] The above mentioned data hiding methods can be considered conditional. For example, the data hiding method can depend on the number of non-zero coefficients.

[0241] In yet another example, NSST_idx and EMT_idx can be dependent, for example, when EMT_CU_flag is 0 (or 1), NSST_idx may not be 0. In this case, NSST_idx-1 can be signaled instead of NSST_idx.

[0242] In another embodiment of the present invention, the mapping of NSST transform sets based on intra prediction modes is presented as shown in Table 7 below. As mentioned above, in the following description, NSST will be mainly described as an example of a non-separable transform, but other known terms for non-separable transforms (e.g., LFNST) may be used. For example, NSST set and NSST index are used in place of LFNST set and LFNST index. In addition, RST described in this document is used in place of RST or LFNST as an example of a non-separable transform (e.g., LFNST) using a non-square transform matrix having a reduced input length and / or a reduced output length with a square non-separable transform matrix applied to at least a part of a transform block (a 4x4 or 8x8 region on the upper left side or a remaining region excluding a 4x4 region on the lower right side in an 8x8 block).

[0243] [Table 7]

[0244] The NSST set numbers can be rearranged between 0 and 3 as shown in Table 8.

[0245] [Table 8]

[0246] In the NSST transform set, four transform sets are used (instead of 35) to reduce the memory space required.

[0247] Furthermore, for each transformation set, a different number of transformation kernels are used as follows:

[0248] Case A: Two available transform kernels are used for each transform set, and the NSST index ranges from 0 to 2. For example, if the NSST index is 0, then a secondary transform (secondary inverse transform based on the decoder) may not be applied. If the NSST index is 1 or 2, then a secondary transform may be applied. A transform set may include two transform kernels, and an index of 1 or 2 may be mapped to the two transform kernels.

[0249] [Table 9]

[0250] Referring to Table 9, two transform kernels are used for each of the 0th to 3rd non-separable transform (NSST or LFNST) sets.

[0251] Case B: Use two available transform kernels for transform set 0, and one each for the remaining transform sets. The available NSST indices for transform set 0 (DC, Planner) are 0 to 2. However, the NSST indices for other modes (transform sets 1, 2, 3) are 0 to 1.

[0252] [Table 10]

[0253] Referring to Table 10, two non-separable transform kernels are set for the non-separable transform (NSST) set corresponding to the 0th index, and one non-separable transform kernel is set for each of the non-separable transform (NSST) sets corresponding to the 1st, 2nd, and 3rd indexes.

[0254] Case C: Use one transform kernel for each transform set, and the NSST index range is 0 to 1.

[0255] [Table 11]

[0256] FIG. 21 shows an example of an encoding flowchart for performing conversion as an embodiment to which the present invention is applied.

[0257] The encoding apparatus 100 performs a primary transform on the residual block (S2105). The primary transform may be referred to as a core transform. In an embodiment, the encoding apparatus 100 may perform the primary transform using the above-mentioned MTS. The encoding apparatus 100 may also transmit an MTS index indicating a specific MTS from among MTS candidates to the decoding apparatus 200. In this case, the MTS candidates may be configured based on an intra prediction mode of the current block.

[0258] The encoding device 100 determines whether to apply a secondary transform (S2110). As an example, the encoding device 100 may determine whether to apply a secondary transform based on the linearly transformed residual transform coefficients. For example, the secondary transform may be NSST or RST.

[0259] The encoding device 100 determines the secondary transform (S2115). At this time, the encoding device 100 can determine the secondary transform based on the NSST (or RST) transform set specified according to the intra prediction mode.

[0260] Also, for example, prior to operation S2115, the encoding apparatus 100 may determine an area to which the secondary transformation is applied based on the size of the current block.

[0261] The encoding apparatus 100 performs the secondary transformation using the secondary transformation determined in operation S2115 (S2120).

[0262] FIG. 22 shows an example of a decoding flowchart for performing conversion as an embodiment to which the present invention is applied.

[0263] The decoding device 200 determines whether to apply the secondary inverse transform (S2205). For example, the secondary inverse transform may be NSST or RST. As an example, the decoding device 200 may determine whether to apply the secondary inverse transform based on the secondary transform flag received from the encoding device 100.

[0264] The decoding apparatus 200 determines a secondary inverse transform (S2210). At this time, the decoding apparatus 200 may determine a secondary inverse transform to be applied to the current block based on the NSST (or RST) transform set designated according to the above-described intra prediction mode.

[0265] Also, for example, the decoding apparatus 200 may determine an area to which the secondary inverse transform is applied based on the size of the current block prior to operation S2210.

[0266] The decoding apparatus 200 performs a secondary inverse transform on the dequantized residual block using the secondary inverse transform determined in step S2210 (S2215).

[0267] The decoding apparatus 200 performs a primary inverse transform on the secondary inverse transformed residual block (S2220). The primary inverse transform may be referred to as a core inverse transform. As an embodiment, the decoding apparatus 200 may perform the primary inverse transform using the above-mentioned MTS. As an example, the decoding apparatus 200 may determine whether MTS is applied to the current block prior to step S2220. In this case, the decoding flowchart of FIG. 22 may further include a step of determining whether MTS is applied.

[0268] As an example, when MTS is applied to the current block (i.e., cu_mts_flag=1), the decoding apparatus 200 may configure an MTS candidate based on the intra prediction mode of the current block. In this case, the decoding flowchart of Fig. 22 may further include a step of configuring an MTS candidate. Then, the decoding apparatus 200 may determine a first inverse transform to be applied to the current block using mts_idx indicating a specific MTS among the configured MTS candidates.

[0269] FIG. 23 shows an example of a detailed block diagram of the conversion unit 120 in the encoding device 100 as an embodiment to which the present invention is applied.

[0270] The encoding device 100 to which the embodiment of the present invention is applied may include a primary transform unit 2310, a secondary transform application determining unit 2320, a secondary transform determining unit 2330, and a secondary transform unit 2340.

[0271] The primary transform unit 2310 may perform a primary transform on the residual block. The primary transform may be referred to as a core transform. As an embodiment, the primary transform unit 2310 may perform the primary transform using the above-mentioned MTS. Also, the primary transform unit 2310 may transmit an MTS index indicating a specific MTS from among MTS candidates to the decoding apparatus 200. In this case, the MTS candidates may be configured based on an intra prediction mode of the current block.

[0272] The secondary transform application determining unit 2320 may determine whether to apply a secondary transform. For example, the secondary transform application determining unit 2320 may determine whether to apply a secondary transform based on a transform coefficient of the primary transformed residual block. For example, the secondary transform may be NSST or RST.

[0273] The secondary transform determination unit 2330 determines the secondary transform. At this time, the secondary transform determination unit 2330 may determine the secondary transform based on the NSST (or RST) transform set designated according to the intra prediction mode, as described above.

[0274] Also, for example, the secondary transformation determination unit 2330 may determine an area to which the secondary transformation is applied based on the size of the current block.

[0275] The secondary transform unit 2340 may perform the secondary transform using the determined secondary transform.

[0276] FIG. 24 shows an example of a detailed block diagram of the inverse transform unit 230 in the decoding device 200 as an embodiment to which the present invention is applied.

[0277] The decoding device 200 to which the present invention is applied includes a secondary inverse transform application determining unit 2410, a secondary inverse transform determining unit 2420, a secondary inverse transform unit 2430, and a primary inverse transform unit 2440.

[0278] The secondary inverse transform application determining unit 2410 may determine whether to apply the secondary inverse transform. For example, the secondary inverse transform may be NSST or RST. As an example, the secondary inverse transform application determining unit 2410 may determine whether to apply the secondary inverse transform based on a secondary transform flag received from the encoding apparatus 100. As another example, the secondary inverse transform application determining unit 2410 may determine whether to apply the secondary inverse transform based on a transform coefficient of a residual block.

[0279] The secondary inverse transform determination unit 2420 may determine a secondary inverse transform. In this case, the secondary inverse transform determination unit 2420 may determine a secondary inverse transform to be applied to a current block based on an NSST (or RST) transform set designated according to an intra prediction mode.

[0280] Also, for example, the secondary inverse transform determination unit 2420 may determine an area to which the secondary inverse transform is applied based on the size of the current block.

[0281] Also, as an example, the secondary inverse transform unit 2430 may perform a secondary inverse transform on the dequantized residual block using the determined secondary inverse transform.

[0282] The first inverse transform unit 2440 may perform a first inverse transform on the second inverse transformed residual block. As an embodiment, the first inverse transform unit 2440 may perform a first transform using the above-mentioned MTS. As an example, the first inverse transform unit 2440 may determine whether MTS is applied to the current block.

[0283] For example, when MTS is applied to the current block (i.e., cu_mts_flag=1), the primary inverse transform unit 2440 may configure MTS candidates based on the intra prediction mode of the current block, and may determine a primary transform to be applied to the current block using mts_idx indicating a specific MTS from among the configured MTS candidates.

[0284] 25 shows a flowchart for processing a video signal as an embodiment to which the present invention is applied. The flowchart in FIG. 25 can be executed by the decoding device 200 or the inverse transform unit 230.

[0285] First, the decoding apparatus 200 may determine whether to apply an inverse non-separable transform of the current block based on the non-separable transform index and the width and height of the current block. For example, the decoding apparatus 200 may determine to apply the non-separable transform when the non-separable transform index is not 0 and the width and height of the current block are each equal to or greater than 4. If the non-separable transform index is 0 or the width or height of the current block is less than 4, the decoding apparatus 200 may omit the inverse non-separable transform and perform an inverse linear transform.

[0286] In operation S2505, the decoding apparatus 200 determines a non-separable transform set index indicating a non-separable transform set used for non-separable transform of the current block from among predefined non-separable transform sets based on the intra prediction mode of the current block. The non-separable transform set index may be set to be assigned to each of four transform sets set according to the range of the intra prediction mode as shown in Table 7 or Table 8. That is, as shown in Table 7 or Table 8, if the intra prediction mode is 0 to 1, the non-separable transform set index may be determined to a first index value, if the intra prediction mode is 2 to 12 or 56 to 66, the non-separable transform set index may be determined to a second index value, if the intra prediction mode is 13 to 23 or 45 to 55, the non-separable transform set index may be determined to a third index value, and if the intra prediction mode is 24 to 44, the non-separable transform set index may be determined to a fourth index value.

[0287] Here, each of the predefined non-separable transformation sets may include two transformation kernels, as shown in Table 9. Also, each of the predefined non-separable transformation sets may include one or two transformation kernels, as shown in Table 10 or Table 11.

[0288] In operation S2510, the decoding apparatus 200 determines a transform kernel indicated by a non-separable transform index of a current block among transform kernels included in a non-separable transform set indicated by a non-separable transform set index, using a non-separable transform matrix. For example, two non-separable transform kernels may be set for each index value of the non-separable transform set index, and the decoding apparatus 200 may determine a non-separable transform matrix based on a transform kernel indicated by a non-separable transform index among two transform matrix kernels corresponding to the non-separable transform set index.

[0289] In operation S2515, the decoding apparatus 200 applies a non-separable transform matrix to an upper left region of the current block, the non-separable transform matrix being determined according to the width and height of the current block. For example, if both the width and height of the current block are equal to or greater than 8, a non-separable transform may be applied to an 8x8 region at the upper left of the current block, and if the width or height of the current block is less than 8, a non-separable transform may be applied to a 4x4 region at the upper left of the current block. The size of the non-separable transform may also be set to a size (e.g., 48x16, 16x16) corresponding to 8x8 or 4x4 depending on the region to which the non-separable transform is applied.

[0290] In addition, the decoding apparatus 200 may apply a horizontal transform and a vertical transform to the current block to which the non-separable transform has been applied, where the horizontal transform and the vertical transform may be determined based on a prediction mode applied to the current block and an MTS index for selecting a transform matrix.

[0291] Hereinafter, a method of combining and applying a primary transform and a secondary transform will be described. That is, in an embodiment of the present invention, a method of efficiently designing transforms used in the primary transform and the secondary transform is proposed. Here, the methods proposed in FIG. 1 to FIG. 25 may be applied, and the overlapping description will be omitted.

[0292] As described above, the primary transform refers to a transform that is first applied to a residual block with reference to an encoder. When a secondary transform is applied, the encoder performs a secondary transform on the primary transformed residual block. On the other hand, when a secondary transform is applied, a secondary inverse transform is performed prior to the primary inverse transform with reference to a decoder. The decoder can derive a residual block by performing a primary inverse transform on a secondary inverse transformed transform coefficient block.

[0293] Also, as described above, a non-separable transform may be used as the secondary transform, and may be applied only to low-frequency coefficients in a specific region on the upper left side to maintain low complexity. Such a secondary transform applied to low-frequency coefficients may be referred to as a non-separable secondary transform (NSST), low frequency non-separable transform (LFNST), or reduced secondary transform (RST). Also, the primary transform may be referred to as a core transform.

[0294] In one embodiment of the present invention, the primary transform candidates used in the primary transform and the secondary transform kernels used in the secondary transform may be predefined in various combinations. In this specification, the primary transform candidates used in the primary transform may be called MTS candidates, but are not limited to this name. As an example, the primary transform candidates may be a combination of transform kernels (or transform types) applied to the horizontal and vertical directions, respectively, and the transform kernels may be any one of DCT2, DST7, and / or DCT8. In other words, the primary transform candidates may be at least one combination of DCT2, DST7, and / or DCT8. A specific example will be described below.

[0295] -Combination A

[0296] In combination A, the primary transform candidates and the secondary transform kernels are defined according to the intra prediction mode, as shown in Table 12 below.

[0297] [Table 12]

[0298] Referring to Table 12, as an example (Case 1), when the intra prediction mode has directionality, two primary transform candidates are used, and when it does not have directionality (e.g., DC, planar mode), four primary transform candidates are used. Here, the secondary transform candidates may include two transform kernels regardless of the directionality of the intra prediction mode. That is, as described above, a plurality of secondary transform kernel sets are predefined according to the intra prediction mode, and each of the predefined plurality of secondary transform kernel sets includes two transform kernels.

[0299] Also, as an example (Case 2), when the intra prediction mode has directionality, two primary transform candidates are used, and when it does not have directionality, four primary transform candidates are used. Here, the secondary transform candidates may include one transform kernel when the intra prediction mode has directionality, and may include two transform kernels when it does not have directionality.

[0300] Also, as an example (Case 3), if the intra prediction mode has directionality, two primary transform candidates are used, and if it does not have directionality, four primary transform candidates are used, where the secondary transform candidates may include one transform kernel regardless of the directionality of the intra prediction mode.

[0301] -Combination B

[0302] In combination B, the primary transform candidates and the secondary transform kernels are defined according to the intra prediction mode, as shown in Table 13 below.

[0303] [Table 13]

[0304] Referring to Table 13, as an example (Case 1), three primary transform candidates are used regardless of the direction of the intra prediction mode. Here, the secondary transform candidates may include two transform kernels regardless of the direction of the intra prediction mode. That is, as described above, a plurality of secondary transform kernel sets are predefined according to the intra prediction mode, and each of the predefined plurality of secondary transform kernel sets may include two transform kernels.

[0305] Also, as an example (Case 2), three primary transform candidates are used regardless of the directionality of the intra prediction mode, where the secondary transform candidates include one transform kernel if the intra prediction mode has directionality, and two transform kernels if the intra prediction mode does not have directionality.

[0306] Also, as an example (Case 3), three primary transform candidates are used regardless of the directionality of the intra prediction mode, and the secondary transform candidates may include one transform kernel regardless of the directionality of the intra prediction mode.

[0307] -Combination C

[0308] In combination C, the primary transform candidates and the secondary transform kernels are defined according to the intra prediction mode, as shown in Table 14 below.

[0309] [Table 14]

[0310] Referring to Table 14, as an example (Case 1), when the intra prediction mode has directionality, two primary transform candidates are used, and when it does not have directionality (e.g., DC, planar mode), three primary transform candidates are used. Here, the secondary transform candidates may include two transform kernels regardless of the directionality of the intra prediction mode. That is, as described above, a plurality of secondary transform kernel sets are predefined according to the intra prediction mode, and each of the predefined plurality of secondary transform kernel sets may include two transform kernels.

[0311] Also, as an example (Case 2), when the intra prediction mode has directionality, two primary transform candidates are used, and when it does not have directionality, three primary transform candidates are used. Here, the secondary transform candidates may include one transform kernel when the intra prediction mode has directionality, and may include two transform kernels when it does not have directionality.

[0312] Also, as an example (Case 3), if the intra prediction mode has directionality, two primary transform candidates are used, and if it does not have directionality, three primary transform candidates are used, where the secondary transform candidates may include one transform kernel regardless of the directionality of the intra prediction mode.

[0313] The above description has focused on the case where a plurality of primary conversion candidates are used. Below, a description will be given of an example of a combination of primary conversion and secondary conversion when a fixed primary conversion candidate is used.

[0314] -Combination D

[0315] In combination D, the primary transform candidates and secondary transform kernels are defined according to the intra prediction mode, as shown in Table 15 below.

[0316] [Table 15]

[0317] Referring to Table 15, in an embodiment, one primary transform candidate is fixedly used regardless of the intra prediction mode. For example, the fixed primary transform candidate may be at least one combination of DCT2, DST7, and / or DCT8.

[0318] As an example (Case 1), one primary transform candidate is fixedly used regardless of the intra prediction mode, and the secondary transform candidate may include two transform kernels regardless of the direction of the intra prediction mode. That is, as described above, a plurality of secondary transform kernel sets are predefined according to the intra prediction mode, and each of the predefined plurality of secondary transform kernel sets may include two transform kernels.

[0319] As another example (Case 2), one primary transform candidate is fixedly used regardless of the intra prediction mode, where the secondary transform candidate may include one transform kernel if the intra prediction mode is directional and may include two transform kernels if the intra prediction mode is not directional.

[0320] Also, as an example (Case 3), one primary transform candidate may be fixedly used regardless of the intra prediction mode, where the secondary transform candidate may include one transform kernel regardless of the directionality of the intra prediction mode.

[0321] -Combination E

[0322] In combination E, the primary transform candidates and secondary transform kernels are defined according to the intra prediction mode, as shown in Table 16 below.

[0323] [Table 16]

[0324] Referring to Table 16, the secondary transform is defined only when DCT2 is applied as the primary transform. In other words, the secondary transform can be applied when MTS is not applied (i.e., when DCT2 is applied as the primary transform). As described in FIG. 10, in this specification, the case where MTS is applied and the case where it is not applied are described separately, but the present invention is not limited to such an expression. For example, whether or not MTS is applied may mean whether or not to use another transform type (or transform kernel) other than a predefined specific transform type (which may be called a base transform type, a default transform type, etc.). If MTS is applied, another transform type (e.g., any one or a combination of two or more transform types) other than the base transform type may be used for the transform, and if MTS is not applied, the base transform type may be used for the transform. In one embodiment, the base transform type may be set (or defined) to DCT2.

[0325] As an example (Case 1), when DCT2 is applied to the primary transform, the secondary transform may be applicable, and in this case, the secondary transform candidates include two transform kernels regardless of the direction of the intra prediction mode. That is, as described above, a plurality of secondary transform kernel sets are predefined according to the intra prediction mode, and each of the predefined plurality of secondary transform kernel sets may include two transform kernels.

[0326] Also, as an example (Case 2), when DCT2 is applied to the primary transform, a secondary transform can be applied, where the secondary transform candidates may include one transform kernel if the intra prediction mode has directionality, and two transform kernels if it does not have directionality.

[0327] Also, as an example (Case 3), when DCT2 is applied to the primary transform, a secondary transform can be applied, where the secondary transform candidates can include one transform kernel regardless of the directionality of the intra prediction mode.

[0328] FIG. 26 is a flowchart illustrating a method for converting a video signal according to an embodiment of the present invention.

[0329] 26, for convenience of explanation, a decoder will be mainly described, but the present invention is not limited thereto, and the conversion method for a video signal according to the present embodiment can be substantially equally applied to an encoder. The flowchart of FIG. 26 is performed by the decoding device 200 or the inverse conversion unit 230.

[0330] The decoding apparatus 200 parses a first syntax element indicating a primary transform kernel to be applied to a primary transform of a current block (S2601).

[0331] The decoding apparatus 200 determines whether a secondary transform can be applied to the current block based on the first syntax element (S2602).

[0332] If a secondary transform can be applied to the current block, the decoding apparatus 200 parses a second syntax element indicating a secondary transform kernel to be applied to the secondary transform of the current block (S2603).

[0333] The decoding apparatus 200 derives a secondary inverse transformed block by performing a secondary inverse transform on a specific region at the upper left side of the current block using a secondary transform kernel indicated by the second syntax element (S2604).

[0334] The decoding apparatus 200 derives a residual block of the current block by performing a primary inverse transform on the secondary inverse transformed block using a primary transform kernel indicated by the first syntax element (S2605).

[0335] As described above, step S2602 is performed by determining that a secondary transform is applicable to the current block if the first syntax element indicates a predefined first transform kernel, where the first transform kernel is defined as DCT2.

[0336] Also, as described above, the decoding apparatus 200 may determine a secondary transform kernel set to be used for secondary transform of the current block from among predefined secondary transform kernel sets based on an intra prediction mode of the current block, and the second syntax element may indicate a secondary transform kernel to be applied to secondary transform of the current block from the determined secondary transform kernel set.

[0337] Also, as mentioned above, each of the predefined secondary transformation kernel sets may include two transformation kernels.

[0338] In one embodiment of the present invention, an example of a syntax structure in which MTS (Multiple Transform Set) is used will be described.

[0339] As an example, Table 17 below shows an example of a syntax structure for a sequence parameter set.

[0340] [Table 17]

[0341] Referring to Table 17, whether or not MTS is enabled according to an embodiment of the present invention can be signaled through the sequence parameter set syntax. Here, sps_mts_intra_enabled_flag indicates whether an MTS flag or MTS index is present in a sub-level syntax of an intra-coding unit (e.g., residual coding syntax, transform unit syntax), and sps_mts_inter_enabled_flag indicates whether an MTS flag or MTS index is present in a sub-level syntax of an inter-coding unit.

[0342] As another example, Table 18 below shows an example of a conversion unit syntax structure.

[0343] [Table 18]

[0344] 18, cu_mts_flag indicates whether MTS is applied to the residual samples of the luma transform block. For example, when cu_mts_flag=0, MTS is not applied to the residual samples of the luma transform block, and when cu_mts_flag=1, MTS is applied to the residual samples of the luma transform block.

[0345] As described above, in the present invention, the case where MTS is applied and the case where MTS is not applied are described based on the MTS flag, but the present invention is not limited to such an expression. For example, the application of MTS may mean the same as the use of a transform type (or transform kernel) other than a predefined specific transform type (which may be called a basic transform type, a default transform type, etc.). If MTS is applied, a transform type other than the basic transform type (e.g., any one of a plurality of transform types or a combination of a plurality of transform types) is used for the transform, and if MTS is not applied, the basic transform type is used for the transform. In one embodiment, the basic transform type may be set (or defined) to DCT2.

[0346] As an example, an MTS flag syntax indicating whether MTS is applied to the current transform block and an MTS index syntax indicating the transform type applied to the current block if MTS is applied may be transmitted separately from the encoder to the decoder, and as another example, a syntax (e.g., an MTS index) including whether MTS is applied to the current transform block and, if MTS is applied, all of the transform types applied to the current block may be transmitted from the encoder to the decoder. That is, in the latter embodiment, a syntax (or syntax element) indicating the type of transform applied to the current transform block (or unit) within a group (or transform type set) of complete transform types including the above-mentioned basic transform types may be transmitted from the encoder to the decoder.

[0347] Therefore, despite that expression, the syntax (MTS index) indicating the type of transformation applied to the current transformation block may include information on whether MTS is applied. That is, in the latter embodiment, only the MTS index without the MTS flag may be signaled, and in this case, it can be interpreted that the MTS includes DCT2, but in the present invention, the case where DCT2 is applied can be described as the case where MTS is not applied, and nevertheless, the descriptive scope of MTS is not limited to its definition content.

[0348] As another example, Table 19 below shows an example of the syntactic structure of a residual unit.

[0349] [Table 19-1]

[0350] [Table 19-2]

[0351] [Table 19-3]

[0352] [Table 19-4]

[0353] [Table 19-5]

[0354] Referring to Table 19, the transform_skip_flag and / or mts_idx syntax (or syntax element) can be signaled through the residual syntax. However, this is an example and the present invention is not limited thereto. For example, the transform_skip_flag and / or mts_idx syntax (syntax) can be signaled through the transform unit syntax.

[0355] In the following, we propose a method to improve the complexity by applying a primary transform only to a predefined region. When a combination of various transforms (or transform kernels) such as MTS (e.g., DCT2, DST7, DCT8, DST1, DCT5, etc.) is selectively applied to the primary transform, the complexity may increase. In particular, as the size of the coding block (or transform block) increases, the complexity may increase significantly since multiple and diverse transforms must be considered.

[0356] Therefore, in the embodiments of the present specification, in order to reduce complexity, a method is proposed in which the transformation is performed only on predefined regions depending on specific conditions, rather than performing (or applying) the transformation on all regions.

[0357] As an example, based on the reduced transform (RT) method described above in Figs. 16 to 24, instead of applying a forward primary transform to a luma block of size MxM to obtain a transform block of size MxM, the encoder can obtain a transform block of size RxR. As an example, the RxR region can be the top-left RxR region in a current block (coding block, transform block). The decoder can obtain a transform block of size MxM by performing an inverse primary transform only on a region of size RxR (M>=R).

[0358] As a result, there may be valid coefficients (non-zero coefficients) only in the RxR domain. As an example, in this case, the decoder may assume that coefficients in areas other than the RxR domain have a value of 0 (zero-out) without performing any calculations. The encoder may perform a forward transform so that only the RxR domain remains (so that valid coefficients can only exist in the RxR domain).

[0359] Also, the decoder can apply the primary transform (i.e., inverse transform) only to a predefined region determined according to the size of the coding block (or transform block) and / or the type of transform (or transform kernel). Table 20 below illustrates a Reduced Adaptive Multiple Transform (RAMT) using a predefined value of R (which may be referred to as a Reduced factor, Reduced transform factor, etc.) according to the size of the transform (or the size of the transform block). In the present invention, the Reduced Adaptive Multiple Transform (RAMT) indicating a reduced transform adaptively determined according to the block size may be referred to as a Reduced Multiple Transform Selection (MTS), a Reduced explicit multiple transform, a Reduced primary transform, etc.

[0360] [Table 20]

[0361] Referring to Table 20, at least one or more reduced transforms may be defined depending on the size of the transform (or the size of the transform block). In one embodiment, which of the reduced transforms illustrated in Table 20 is used may be determined based on the transform (or transform kernel) applied to the current block (coding block or transform block). Although it is assumed in Table 20 that three reduced transforms are used, the present invention is not limited thereto, and one or more various numbers of reduced transforms may be predefined depending on the size of the transform.

[0362] In addition, in the embodiment of the present invention, in applying the above-mentioned reduced adaptive multiple transform, the reduced transform factor (R) can be determined depending on the primary transform. For example, when the primary transform is DCT2, the amount of calculation is relatively simple compared to other primary transforms (e.g., a combination of DCT7 and / or DCT8), so that the reduced transform cannot be used for a block having a small size, or a relatively large R value can be used to minimize the decrease in coding performance. Table 21 below illustrates an example of a Reduced Adaptive Multiple Transform (RAMT) using a predefined R value based on the size of the transform (or the size of the transform block) and the transform kernel.

[0363] [Table 21]

[0364] Referring to Table 21, when the transform applied to the primary transform is DCT2 and when it is another transform (eg, a combination of DCT7 and / or DCT8), different reduced transform factors are used.

[0365] FIG. 27 is a diagram illustrating a method for encoding a video signal using a reduced transform as an embodiment to which the present invention is applied.

[0366] Referring to FIG. 27, first, the encoder determines whether to apply a transform to a current block (S2701). The encoder may encode a transform skip flag based on the determined result. In this case, the step of encoding the transform skip flag may be included in step S2701.

[0367] The encoder determines a transform kernel to be applied to the primary transform of the current block if a transform is applied to the current block (S2702). The encoder may encode a transform index indicating the determined transform kernel, in which case a step of encoding the transform index may be included in step S2702.

[0368] The encoder determines the region in the current block where significant coefficients reside based on the transform kernel to be applied to the linear transform of the current block and the size of the current block (S2703).

[0369] Also, as one embodiment, the encoder may determine that if the transform kernel indicated by the transform index is a predefined transform and the width and / or height of the current block is larger than the predefined size, a region having a width and / or height of the predefined size is the region in which the significant coefficient exists.

[0370] For example, the predefined transform may be any one of a combination of a plurality of transforms including a combination of DCT7 and / or DCT8, and the predefined size may be 16. Or, the predefined transform may be a remaining transform excluding DCT2. As another example, when the transform kernel indicated by the transform index is DCT2 and the width and / or height of the current block is greater than 32, the encoder may determine a region having a width and / or height of 32 as a region to which the primary transform is applied.

[0371] Also, as an embodiment, when the transform kernel indicated by the transform index belongs to a first transform group, the encoder may determine the smaller of the width of the current block and the first threshold value as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the first threshold value as the height of the region in which the significant coefficient exists. As an example, the first threshold value may be 32, but the present invention is not limited thereto, and may be 4, 8, or 16 as shown in Table 20 or Table 21.

[0372] If the transform kernel indicated by the transform index belongs to the second transform group, the encoder may determine the smaller of the width of the current block and the second threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the second threshold as the height of the region in which the significant coefficients exist. As an example, the second threshold may be 16, but the present invention is not limited thereto, and may be 4, 6, 8, 12, or 32 as shown in Table 20 or Table 21.

[0373] As an example, the first transform group may include a DCT2, and the second transform group may include a combination of transforms including a combination of DCT7 and / or DCT8.

[0374] The encoder performs a forward primary transform using a transform kernel applied to the primary transform of the current block (S2704). By performing the forward primary transform, the encoder can obtain primary transformed transform coefficients in a region where significant coefficients exist. As an example, the encoder can apply a secondary transform to the primary transformed transform coefficients, and in this case, the method described above with reference to FIGS. 6 to 26 can be applied.

[0375] FIG. 28 is a diagram illustrating a method for decoding a video signal using a reduced transform as an embodiment to which the present invention is applied.

[0376] The decoder checks whether a transform skip is applied to the current block (S2801).

[0377] If transform skip is not applied to the current block, the decoder obtains a transform index indicating a transform kernel to be applied to the current block from the video signal (S2802).

[0378] The decoder uses the transform kernel indicated by the transform index and the Based on the size (ie, width and / or height), a region to which a primary transform (ie, a primary inverse transform) is applied to the current block is determined (S2803).

[0379] As one example, the decoder may consider the coefficients in the remaining regions of the current block other than the region to which the linear transform is applied as zero.

[0380] Also, as one embodiment, if the transform kernel indicated by the transform index is a predefined transform and the width and / or height of the current block is larger than the predefined size, the decoder may determine that a region having a width and / or height of the predefined size is the region to which the primary transform is applied.

[0381] For example, the predefined transform may be any one of a combination of a plurality of transforms including a combination of DCT7 and / or DCT8, and the predefined size may be 16. Or, the predefined transform may be a remaining transform excluding DCT2. As another example, when the transform kernel indicated by the transform index is DCT2 and the width and / or height of the current block is greater than 32, the decoder may determine a region having a width and / or height of 32 as a region to which the primary transform is applied.

[0382] Also, as an embodiment, when the transform kernel indicated by the transform index belongs to the first transform group, the decoder may determine the smaller of the width of the current block and the first threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the first threshold as the height of the region to which the primary transform is applied. As an example, the first threshold may be 32, but the present invention is not limited thereto, and may be 4, 8, or 16 as shown in Table 20 or Table 21.

[0383] If the transform kernel indicated by the transform index belongs to the second transform group, the decoder may determine the smaller of the width of the current block and the second threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the second threshold as the height of the region to which the primary transform is applied. As an example, the second threshold may be 16, but the present invention is not limited thereto, and may be 4, 6, 8, 12, or 32 as shown in Table 20 or Table 21.

[0384] As an example, the first transform group may include a DCT2, and the second transform group may include a combination of transforms including a combination of DCT7 and / or DCT8.

[0385] The decoder performs an inverse primary transform on the region to which the primary transform is applied, using a transform kernel indicated by the transform index (S2804). The decoder can obtain the primary inverse transformed transform coefficients by performing the inverse primary transform. As an example, the decoder can apply a secondary transform to the inverse quantized transform coefficients before performing the primary transform, and in this case, the method described above in FIG. 6 to FIG. 26 can be applied.

[0386] According to embodiments of the present invention, the worst case complexity can be significantly reduced by performing the transformation only on predefined regions depending on certain conditions.

[0387] Also, in one embodiment of this specification, when the MTS, (EMT or AMT) flag is 0 (i.e., when DCT-2 transform is applied to all horizontal and vertical directions), the encoder / decoder may leave only 32 coefficients from the left and top in the horizontal and vertical directions, respectively, and perform zero-out (i.e., regard or set to 0) on high frequency components. This embodiment is referred to as a first embodiment for convenience of explanation in the embodiments described later, but the embodiments of this specification are not limited thereto.

[0388] For example, in the case of a 64x64 TU (or CU), the encoder / decoder may leave transform coefficients only in the top-left 32x32 region and perform zero-out on coefficients in the remaining region. In addition, in the case of a 64x16 TU, the encoder / decoder may leave transform coefficients only in the top-left 32x16 region and perform zero-out on coefficients in the remaining region. In addition, in the case of an 8x64 TU, the encoder / decoder may leave transform coefficients only in the top-left 8x32 region and perform zero-out on coefficients in the remaining region. That is, it is possible to set transform coefficients to exist up to a maximum length of 32 in both the horizontal and vertical directions, thereby improving transform efficiency.

[0389] As one embodiment, such a zero-out method may be applied only to a residual signal to which intra prediction has been applied, or only to a residual signal to which inter prediction has been applied, or may be applied to both a residual signal to which intra prediction has been applied and a residual signal to which inter prediction has been applied.

[0390] Also, in the embodiment of the present specification, when the MTS flag is 1 (i.e., when a transform other than the horizontal and vertical DCT-2 transform (e.g., DCT-7 or DCT-8) can be applied), the encoder / decoder may leave the coefficients in a specific region at the top left corner and perform zero-out (i.e., treat or set to 0) on the remaining high frequency components. This embodiment is referred to as a second embodiment for convenience of explanation in the embodiment described later, but the embodiment of the present specification is not limited thereto.

[0391] As an example, the encoder / decoder may be configured to leave only the transform coefficient area of ​​a portion of the upper left corner area as in the following example. That is, the encoder / decoder may preset the length (or number) of the horizontal and / or vertical transform coefficients to which the linear transform is applied according to the width and / or height. As an example, coefficients beyond the length to which the linear transform is applied may be zeroed out.

[0392] - If the width (w) is equal to or greater than 2n, the transform coefficients are left only for a length of w / 2p from the left, and the transform coefficients in the remaining area can be fixed (or set, or considered) to a value of 0 (zero-out).

[0393] - If the height (h) is 2m, the conversion coefficients are left only for the h / 2q length from the top, and the remaining conversion coefficients can be fixed to a value of 0.

[0394] For example, the values ​​of m, n, p, and q may be predefined to various values. For example, the values ​​of m, n, p, and q may be set to integer values ​​equal to or greater than 0. Alternatively, the values ​​may be specifically set as shown in the following examples.

[0395] 1)(m, n, p, q)=(5, 5, 1, 1)

[0396] 2)(m, n, p, q)=(4, 4, 1, 1)

[0397] For example, when predefined in configuration 1), a 32x16 TU may have transform coefficients remaining only in the top left 16x16 area, and an 8x32 TU may have transform coefficients remaining only in the top left 8x16 area.

[0398] As one embodiment, such a zero-out method may be applied only to a residual signal to which intra prediction is applied, or may be applied only to a residual signal to which inter prediction is applied, or may be applied to both a residual signal to which intra prediction is applied and a residual signal to which inter prediction is applied.

[0399] In another embodiment of the present specification, when the MTS flag is 1 (i.e., when a transform other than the horizontal and vertical DCT-2 transform (e.g., DST-7 or DCT-8) can be applied), the encoder / decoder may leave the coefficients of a specific region at the top left corner and perform zero-out (i.e., regard or set to 0) on the remaining high frequency components. Or, more specifically, the encoder may leave the coefficients of a specific region at the top left corner predefined and perform zero-out on the remaining high frequency components, and the decoder may recognize the zeroed-out region in advance and perform coding using the coefficients of the non-zeroed region. However, the embodiment of the present specification is not limited thereto, and the zero-out process on the decoder side may be understood as a process of regarding (recognizing or setting) the zeroed-out region as 0. This embodiment is referred to as a third embodiment for convenience of explanation in the following embodiment, but the embodiment of the present specification is not limited thereto.

[0400] As an example, the encoder / decoder may be configured to leave only the transform coefficient area of ​​the upper left corner area as in the following example. That is, the encoder / decoder may preset the length (or number) of the horizontal and / or vertical transform coefficients to which the linear transform is applied according to the width and / or height. As an example, the coefficients beyond the length to which the linear transform is applied may be zeroed out.

[0401] - If the height (h) is equal to or greater than the width (w) and the height is equal to or greater than 2n, only the upper left wx(h / 2p) area will have transform coefficients, and the transform coefficients of the remaining areas can be fixed (or set, or considered) to a value of 0 (zero-out).

[0402] - If the width (w) is greater than the height (h) and the width is 2m, only the upper left corner (w / 2q)xh area will have conversion coefficients, and the remaining conversion coefficients can be fixed to a value of 0.

[0403] In the above example, when the height (h) and width (w) are the same, the vertical dimension is reduced (h / 2p), but it can also be set to reduce the horizontal dimension (w / 2q).

[0404] For example, the values ​​of m, n, p, and q may be predefined to various values. For example, the values ​​of m, n, p, and q may be set to integer values ​​equal to or greater than 0. Alternatively, the values ​​may be specifically set as shown in the following examples.

[0405] (m, n, p, q) = (4, 4, 1, 1)

[0406] 2)(m, n, p, q) = (5, 5, 1, 1)

[0407] For example, in the case of predefined configuration 1), in a 32x16 TU, transform coefficients may remain only in the top left 16x16 area, and in an 8x16 TU, transform coefficients may remain only in the top left 8x8 area.

[0408] As one embodiment, such a zero-out method may be applied only to a residual signal to which intra prediction is applied, or may be applied only to a residual signal to which inter prediction is applied, or may be applied to both a residual signal to which intra prediction is applied and a residual signal to which inter prediction is applied.

[0409] As described above, the first embodiment relating to a method for limiting the range of transformation coefficients when the MTS and flag are 0, and the second and third embodiments relating to a method for limiting the range of transformation coefficients when the MTS and flag are 1 can be applied individually or in combination.

[0410] As an example, the following combination of configurations may be applied.

[0411] First Example + Second Example

[0412] First Example + Third Example

[0413] As described above in the second and third embodiments, in the embodiment, such a zero-out method may be applied only to a residual signal to which intra prediction is applied, may be applied only to a residual signal to which inter prediction is applied, or may be applied to both a residual signal to which intra prediction is applied and a residual signal to which inter prediction is applied. Therefore, when the MTS flag is 1, the following combination configuration may be applied. In this case, when the MTS flag is 0, the above-mentioned first embodiment may be applied.

[0414] [Table 22]

[0415] In one embodiment of the present specification, the encoder / decoder may not perform residual coding on a region in which transform coefficients are considered to have a value of 0 due to the zero-out in the above-mentioned embodiment. That is, the encoder / decoder may be defined to perform residual coding only on a region excluding the zero-out region.

[0416] In the first, second and third embodiments described above, the regions (or coefficients) that can only have a value of 0 in the TU are clearly determined. That is, except for the upper left corner region where transform coefficients are allowed to exist, the rest are zeroed out to a value of 0. Therefore, in the entropy coding (or residual coding) process, the encoder / decoder can be configured to bypass the regions that are guaranteed to have a value of 0 without performing residual coding.

[0417] In one embodiment, the encoder / decoder may code a flag (referred to as subblock_flag) (or syntax element) indicating whether a non-zero transform coefficient exists in a coefficient group (CG), where the CG may be set as a 4x4 or 2x2 block as a sub-block of a TU depending on the shape of the TU block and / or whether it is a chrominance / luminance component.

[0418] In this case, the encoder / decoder can scan the inside of the CG and code the coefficient value (or the level value of the coefficient) only if the subblock_flag is 1. Therefore, for a CG that belongs to an area that is zeroed out to a value of 0, the encoder / decoder can be configured to have a value of 0 as a default without coding the subblock_flag.

[0419] In addition, in one embodiment, the encoder may code the position of the last coefficient (or a syntax element or syntax element indicating the position of the last significant coefficient) in the forward scan order first. For example, the encoder may code last_coefficient_position_x, which is a horizontal position, and last_coefficient_position_y, which is a vertical position.

[0420] last_coefficient_position_x and last_coefficient_position_y can have The maximum values ​​that can be had may be determined by the (width - 1) and (height - 1) values ​​of the TU, respectively, but if the area in which non-zero coefficients can exist is limited by zeroing out, the maximum values ​​that last_coefficient_position_x and last_coefficient_position_y can have may also be limited together.

[0421] Therefore, the encoder / decoder can code after limiting the maximum value that last_coefficient_position_x and last_coefficient_position_y can have by considering zero-out. For example, if the binarization method applied to last_coefficient_position_x and last_coefficient_position_y is a truncated unary (or truncated Rice (TR), truncated binary (TB)) binarization method, the encoder / decoder can adjust (reduce) the maximum length of the truncated unary code to correspond to the adjusted maximum value (i.e., that last_coefficient_position_x and last_coefficient_position_y can have).

[0422] Although some of the embodiments of the present invention described above have been described separately for the sake of convenience, the present invention is not limited thereto. In other words, the embodiments described above may be implemented independently, or one or more of the various embodiments may be combined and implemented.

[0423] FIG. 29 is a flowchart illustrating a method for decoding a video signal based on a reduced transform according to an embodiment of the present disclosure.

[0424] 29, for convenience of explanation, a decoder will be mainly described, but the present invention is not limited thereto, and the video signal conversion method according to the present embodiment can be applied substantially in the same manner to an encoder. The flowchart of FIG. 29 can be executed by the decoding device 200 or the inverse conversion unit 230.

[0425] The decoder obtains, from the video signal, transform indices indicating transform kernels to be applied to the horizontal and vertical directions of a current block (S2901).

[0426] The decoder determines the region over which a transform (ie, an inverse transform) is applied to the current block based on the transform kernel indicated by the transform index and the size of the current block (S2902).

[0427] The decoder considers the coefficients of the remaining areas in the current block other than the area to which the transform is applied as 0 (S2903).

[0428] The decoder performs an inverse transform on the region to which the transform is applied, using a transform kernel indicated by the transform index (S2904).

[0429] As described above, the step of determining the area to which the transformation is applied can be performed by determining an area having a width and / or height of the predefined size as the area to which the transformation is applied when the transformation kernel indicated by the transformation index is a predefined transformation and the width and / or height of the current block is larger than a predefined size.

[0430] As mentioned above, the predefined transform can be any one of a combination of transforms consisting of a combination of DST7 and / or DCT8.

[0431] As mentioned above, the predefined size can be sixteen.

[0432] As described above, the step of determining the region to which the transform is applied may be performed by determining the smaller of the width of the current block and 32 as the width of the region to which the transform is applied, and determining the smaller of the height of the current block and 32 as the height of the region to which the transform is applied, if the transform kernel indicated by the transform index belongs to a first transform group, and determining the smaller of the width of the current block and 16 as the width of the region to which the transform is applied, and determining the smaller of the height of the current block and 16 as the height of the region to which the transform is applied, if the transform kernel indicated by the transform index belongs to a second transform group. As an example, the first transform group may include DCT2, and the second transform group may include a combination of a plurality of transforms formed by a combination of DST7 and / or DCT8.

[0433] As mentioned above, the method may further include a step of obtaining a syntax element indicating the position of the last significant coefficient in the scanning order within the current block, and the coefficient to which the inverse transform is applied may be obtained from the video signal based on the position of the last significant coefficient.

[0434] As described above, the syntax elements are binarized in a truncated unary manner, and the maximum value of the syntax elements may be determined based on the region considered to be zero.

[0435] 30 shows an example of a block diagram of an apparatus for processing a video signal as an embodiment to which the present invention is applied. The video signal processing apparatus of FIG. 30 may correspond to the encoding apparatus of FIG. 1 or the decoding apparatus of FIG. 2.

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

[0437] The processor 3010 according to the embodiment of the present invention may be configured with at least one processing circuit for processing a video signal, and may process the video signal by executing a command for encoding or decoding the video signal. That is, the processor 3010 may encode original video data or decode the encoded video signal by executing the encoding or decoding method described above.

[0438] 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). Also, a 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.

[0439] Furthermore, the embodiments of the present invention may be realized as a computer program product by 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.

[0440] 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.

[0441] In addition, the decoder and encoder to which the present invention is applied may be included in real-time communication devices such as multimedia broadcasting transmitting / receiving devices, mobile communication terminals, home cinema video devices, digital cinema video devices, surveillance cameras, video interactive devices, video communications, etc., mobile streaming devices, storage media, camcorders, video on demand (VoD) service providing devices, OTT video (Over the top video) devices, Internet streaming service providing devices, three-dimensional (3D) video devices, video phones, video devices, and medical video devices, and are used to process video signals or data signals. For example, OTT video (Over the top video) devices may include game consoles, Blu-ray players, Internet-connected TVs, home theater systems, smartphones, tablet PCs, DVRs (Digital Video Recorders), etc.

[0442] 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 recording medium includes all kinds of storage devices and distributed storage devices 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). Also, a 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.

[0443] Furthermore, the embodiments of the present invention may be realized as a computer program product by 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.

[0444] 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 reference relationship in the claims may be combined to configure an embodiment, or may be included as a new claim by amendment after filing.

[0445] Embodiments of the present invention may be implemented in various ways, such as hardware, firmware, software, or a combination thereof. In a hardware implementation, an embodiment of the present invention may be implemented using 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.

[0446] 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 known in the art.

[0447] 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]

[0448] 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 idea and technical scope of the present invention disclosed in the appended claims below.

Claims

1. 1. A method for decoding a video signal, comprising the steps of: deriving transformation kernels to be applied to a current block, the transformation kernels including a horizontal transformation kernel and a vertical transformation kernel; determining a non-zero region within the current block to which an inverse transform is applied based on the transform kernel and a width and / or height of the current block; performing the inverse transform on the non-zero region based on the transform kernel; a width of the non-zero region is determined as a smaller value between a width of the current block and a predetermined width, the predetermined width being determined based on whether the horizontal transform kernel corresponds to a predetermined transform kernel; a height of the non-zero region is determined as a smaller value between a height of the current block and a predetermined height, the predetermined height being determined based on whether the horizontal transform kernel corresponds to the predetermined transform kernel.

2. 1. A method for encoding a video signal, comprising the steps of: deriving transformation kernels to be applied to a current block, the transformation kernels including a horizontal transformation kernel and a vertical transformation kernel; determining a non-zero region for a transformation based on the transformation kernel and a width and / or height of the current block; performing the transformation on the current block based on the transformation kernel; a width of the non-zero region is determined as a smaller value between a width of the current block and a predetermined width, the predetermined width being determined based on whether the horizontal transform kernel corresponds to a predetermined transform kernel; 11. A method for encoding a video signal, comprising: determining a height of the non-zero region as a smaller value between a height of the current block and a predetermined height, the predetermined height being determined based on whether the horizontal transform kernel corresponds to the predetermined transform kernel.

3. 1. A method for transmitting data for a video signal, comprising the steps of: generating a bitstream for the video signal, deriving a transform kernel to be applied to the current block of the bitstream, the transform kernel including a horizontal transform kernel and a vertical transform kernel; determining a non-zero region for a transformation based on the transformation kernel and a width and / or height of the current block; performing a transformation on the current block based on the transformation kernel and encoding information related to the transformation kernel; transmitting the data including the bitstream; a width of the non-zero region is determined as a smaller value between a width of the current block and a predetermined width, the predetermined width being determined based on whether the horizontal transform kernel corresponds to a predetermined transform kernel; a height of the non-zero region is determined as a smaller value between a height of the current block and a predetermined height, the predetermined height being determined based on whether the horizontal transformation kernel corresponds to the predetermined transformation kernel.