Method and medium for decoding / encoding video signals and transmitting data

By determining and applying transform sets suitable for the current block in the video signal processing, the problem of low efficiency in handling high-complexity video signals in the prior art is solved, and more efficient transformation and compression performance is achieved.

CN115514974BActive Publication Date: 2025-04-01LG ELECTRONICS INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210949305.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-09-13
Filing Date
2019-09-05
Publication Date
2025-04-01
Estimated Expiration
2039-09-05

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently process video signals presented in high spatial resolution, high frame rate and high dimensional scenes in next-generation video content, especially in the video codec standards, which lack efficient transformation technology and higher precision prediction technology.

Method used

The video signal is encoded or decoded by determining the set of quadratic transformations suitable for the current block in the video signal processing and using the specified quadratic transformation matrix and the primary transformation matrix. The specific steps include determining the applicable quadratic transformation set in the predefined quadratic transformation set within the frame, obtaining the quadratic transformation matrix applied to the current block, and performing the quadratic inverse transformation and the first inverse transformation to derive the residual block.

Benefits of technology

Improves transformation efficiency, improves computational complexity, and improves compression performance, significantly improving computational complexity and compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115514974B_ABST
    Figure CN115514974B_ABST
Patent Text Reader

Abstract

A method and medium for decoding / encoding a video signal and sending data. Specifically, a method for decoding a video signal according to an embodiment of the present invention comprises the following steps: obtaining a first syntax element that specifies which secondary transform matrix is ​​applied to a current block in a secondary transform set; performing a secondary inverse transform on the current block based on the secondary transform matrix specified by the first syntax element to generate a secondary inverse transformed block; and performing a primary inverse transform on the secondary inverse transformed block based on the primary transform matrix of the current block to generate a residual block of the current block, wherein, based on the width and height of the current block being 4, the input length of the secondary inverse transform is determined to be 8, and based on the width and height of the current block being 8, the input length of the secondary inverse transform is determined to be 8.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the original application number 201980014404.7 (International application number: PCT / KR2019 / 011514, application date: September 5, 2019, invention name: Method and device for encoding / decoding video signals). Technical Field

[0002] The present disclosure relates to a method and apparatus for processing an image signal, and in particular, to a method and apparatus for encoding or decoding an image signal by performing a transform. Background Art

[0003] Compression coding refers to a signal processing technique used to send digitized information through a communication line or store it in a storage medium in an appropriate form. Media such as video, images, and audio can be the subject of compression coding, and specifically, the technique of performing compression coding on images is called video image compression.

[0004] The next generation of video content will feature high spatial resolution, high frame rate, and high-dimensional scene presentation. To process such content, memory storage, memory access rate, and processing power will increase significantly.

[0005] Therefore, coding tools must be designed to more efficiently process next generation video content. In particular, video codec standards following the High Efficiency Video Coding (HEVC) standard require efficient transform techniques that transform spatial domain video signals into frequency domain signals together with prediction techniques with higher accuracy. Summary of the invention

[0006] Technical issues

[0007] Embodiments of the present disclosure provide an image signal processing method and apparatus for applying an appropriate transform to a current block.

[0008] The technical problems solved by the present disclosure are not limited to the above technical problems, and other technical problems not described herein will become apparent to those skilled in the art from the following description.

[0009] Technical Solution

[0010] In one aspect of the present disclosure, a method for decoding a video signal may include the following steps: determining a secondary transform set applied to the current block from a predefined secondary transform set based on an intra-frame prediction mode of the current block; obtaining a first syntax element indicating a secondary transform matrix applied to the current block in the determined secondary transform set; deriving a secondary inverse transformed block by performing a secondary inverse transform on an upper left area of ​​the current block using the secondary transform matrix specified by the first syntax element; and deriving a residual block of the current block by performing a primary inverse transform on the secondary inverse transformed block using the primary transform matrix of the current block.

[0011] Preferably, each of the predefined secondary transform sets may include two secondary transform matrices.

[0012] The step of deriving the second inverse transformed block may include the following steps: including determining an input length and an output length of the second inverse transform based on the width and height of the current block.

[0013] Preferably, if the width and height of the current block are equal to 4, the input length of the inseparable transform may be equal to 8 and the output length may be equal to 16.

[0014] Preferably, the method may further include the following steps: parsing a second syntax element indicating a primary transform matrix applied to the current block; and determining whether a secondary transform can be applied to the current block based on the second syntax element.

[0015] Preferably, if the second syntax element indicates a predefined specific transform type, determining whether the secondary transform can be applied may be performed by determining that the secondary transform can be applied to the current block.

[0016] Preferably, the predefined specific transform type may be defined as DCT2.

[0017] In another aspect of the present disclosure, a device for decoding a video signal includes: a memory for storing the video signal; and a processor, which is connected to the memory and can be configured to: determine a secondary transform set applied to the current block from a predefined secondary transform set based on an intra-frame prediction mode of the current block; obtain a first syntax element indicating a secondary transform matrix applied to the current block in the determined secondary transform set; derive a secondary inverse transformed block by performing a secondary inverse transform on an upper left area of ​​the current block using the secondary transform matrix specified by the first syntax element; and derive a residual block of the current block by performing a primary inverse transform on the secondary inverse transformed block using the primary transform matrix of the current block.

[0018] Beneficial Effects

[0019] According to an embodiment of the present disclosure, it is possible to improve transformation efficiency by determining and applying a transformation suitable for a current block.

[0020] In addition, according to an embodiment of the present disclosure, by efficiently designing transforms for primary transform and secondary transform, computational complexity can be improved and compression performance can be enhanced.

[0021] Furthermore, according to an embodiment of the present disclosure, by limiting the transform kernel of a primary transform to which a secondary transform is applied, computational complexity can be significantly improved.

[0022] The effects of the present disclosure are not limited to the above-described effects, and other effects not described herein will become apparent to those skilled in the art from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are included herein as a part of the specification in order to help understand the present disclosure, provide embodiments of the present disclosure, and technical features of the present disclosure are described through the following description.

[0024] Figure 1 An example of a video encoding system as an embodiment to which the present disclosure is applied is shown.

[0025] Figure 2 is a schematic block diagram of an encoding device for encoding a video / image signal as an embodiment to which the present disclosure is applied.

[0026] Figure 3 1 is a schematic block diagram of a decoding device for decoding an image signal as an embodiment to which the present disclosure is applied.

[0027] Figure 4 1 is a configuration diagram of a content streaming system as an embodiment to which the present disclosure is applied.

[0028] Figure 5a is a diagram for describing a block partition structure according to QT (quad tree), Figure 5b is a diagram for describing a block partition structure according to BT (binary tree), Figure 5c is a diagram for describing a block partition structure according to a TT (ternary tree), and Figure 5d An example of AT segmentation is shown.

[0029] Figure 6 and Figure 7 An embodiment of applying the present disclosure is shown. Figure 6 is a schematic block diagram of a transform and quantization unit and an inverse quantization and inverse transform unit in an encoding device, and Figure 7is a schematic block diagram of an inverse quantization and inverse transform unit in a decoding device.

[0030] Figure 8 is a flow chart illustrating a process of performing adaptive multiple transform (AMT).

[0031] Fig. 9 is a flow chart showing a decoding process for performing AMT.

[0032] Fig.10 is a flowchart illustrating an MTS-based inverse transformation process according to an embodiment of the present disclosure.

[0033] Fig.11 is a block diagram of a device for performing decoding based on MTS according to an embodiment of the present disclosure.

[0034] Fig.12 and Fig.13 : is a flowchart showing encoding / decoding to which secondary transform is applied as an embodiment to which the present disclosure is applied.

[0035] Fig.14 and Fig.15 An embodiment of applying the present disclosure is shown. Fig.14 is a diagram for describing Givens rotation, and Fig.15 The configuration of one round of a 4×4 non-separable quadratic transform (NSST) consisting of a Givens rotation layer and a permutation is shown.

[0036] Fig.16 The operation of a simplified secondary transform (RST) as an embodiment to which the present disclosure is applied is shown.

[0037] Fig.17 : is a diagram showing a process of performing reverse scanning from a sixty-fourth coefficient to a seventeenth coefficient in reverse scanning order as an embodiment to which the present disclosure is applied.

[0038] Fig.18 An exemplary flowchart of encoding using a single transform indicator (STI) as an embodiment to which the present disclosure is applied is illustrated.

[0039] Fig.19 An exemplary flowchart of encoding using a joint transform indicator (UTI) as an embodiment to which the present disclosure is applied is illustrated.

[0040] Fig.20a and Fig.20b Two exemplary flowcharts of encoding using UTI as an embodiment to which the present disclosure is applied are illustrated.

[0041] Fig.21is an exemplary flowchart showing encoding for performing transformation as an embodiment to which the present disclosure is applied.

[0042] Fig. 22 is an exemplary flowchart showing decoding for performing transformation as an embodiment to which the present disclosure is applied.

[0043] Fig.23 is a detailed block diagram illustrating an example of the transform unit 120 in the encoding apparatus 100 as an embodiment to which the present disclosure is applied.

[0044] Fig.24 is a detailed block diagram showing an example of the inverse transform unit 230 in the decoding device 200 as an embodiment to which the present disclosure is applied.

[0045] Fig.25 The flowchart of processing a video signal is an embodiment to which the present disclosure is applied.

[0046] Fig.26 is an exemplary block diagram of an apparatus for processing a video signal as an embodiment of the present disclosure.

[0047] Fig. 27 is a flowchart showing a method of transforming a video signal according to an embodiment to which the present disclosure is applied.

[0048] Fig.28 is an exemplary block diagram of an apparatus for processing a video signal as an embodiment of the present disclosure. DETAILED DESCRIPTION

[0049] Some embodiments of the present disclosure are described in more detail with reference to the accompanying drawings. Figure 1 The detailed description disclosed above is intended to describe some exemplary embodiments of the present disclosure, and is not intended to describe the only embodiment of the present disclosure. The following detailed description includes more details to provide a complete understanding of the present disclosure. However, it should be understood by those skilled in the art that the present disclosure can be implemented without these details.

[0050] In some cases, in order to avoid obscuring the concepts of the present disclosure, known structures and devices are omitted, or may be shown in block diagram form based on core functions of each structure and device.

[0051] Although most of the terms used in the present disclosure have been selected from common terms widely used in the art, some terms have been arbitrarily selected by the applicant, and their meanings will be explained in detail as needed in the following description. Therefore, the present disclosure should be understood based on the original meaning of the terms rather than their simple names or meanings.

[0052] The specific terms used in the following description are provided to help understand the present disclosure, and the use of these specific terms can be changed into various forms without departing from the scope of the technical spirit of the present disclosure. For example, signals, data, samples, pictures, frames, blocks, etc. can be appropriately replaced and interpreted in each encoding process.

[0053] In this specification, a "processing unit" refers to a unit in which an encoding / decoding process such as prediction, transformation, and / or quantization is performed. In addition, a processing unit may be interpreted as including a unit for a luminance component and a unit for a chrominance component. For example, a processing unit may correspond to a block, a coding unit (CU), a prediction unit (PU), or a transform unit (TU).

[0054] In addition, the processing unit may be interpreted as including a unit for a luma component or a unit for a chroma component. For example, the processing unit may correspond to a coding tree block (CTB), coding block (CB), PU, ​​or transform block (TB) for a luma component. In addition, the processing unit may correspond to a CTB, CB, PU, ​​or TB for a chroma component. In addition, the processing unit is not limited thereto, and may be interpreted as including a unit for a luma component and a unit for a chroma component.

[0055] In addition, the processing unit is not necessarily limited to a square block and may be configured in a polygonal shape having three or more vertices.

[0056] In addition, in this specification, a pixel is referred to as a sample. In addition, using a sample may mean using a pixel value or the like.

[0057] Figure 1 An example of a video encoding system as an embodiment to which the present disclosure is applied is shown.

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

[0059] 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, a decoding device 22, and a renderer 23. The encoding device 12 may be referred to as a video / image encoding device, and the decoding device 22 may be referred to as a video / image 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, and the display may be configured as a separate device or an external component.

[0060] The video source can obtain the video / image through a video / image capture, combination or generation process. The video source may include a video / image capture device and / or a video / image generation device. The video / image capture device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generation device may include, for example, a computer, a tablet computer, and a smart phone, etc., and (electronically) generates the video / image. For example, a virtual video / image may be generated by a computer, etc., and in this case, the video / image capture process may be replaced by a related data generation process.

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

[0062] The transmitter 13 can send the encoded video / image information or data output in the form of a bit stream to the receiver of the receiving device in the form of a file or stream transmission through a digital storage medium or a network. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blueray, HDD and SSD. The transmitter 13 can include an element for generating a media file in a predetermined file format and an element for sending through a broadcast / communication network. The receiver 21 can extract the bit stream and send the bit stream to a decoding device 22.

[0063] The decoding device 22 may decode a video / image by performing a series of processes such as inverse quantization, inverse transformation, and prediction corresponding to the operation of the encoding device 12 .

[0064] The renderer 23 can render the decoded video / image. The rendered video / image can be displayed on a display.

[0065] Figure 2 1 is a schematic block diagram of an encoding device for encoding a video / image signal as an embodiment of the present disclosure. The encoding device 100 can be used with Figure 1 The encoding device 12 corresponds to.

[0066] The image segmentation unit 110 may segment the input image (or picture or frame) input to the encoding device 100 into one or more processing units. For example, the processing unit may be referred to as a coding unit (CU). In this case, the coding unit may be recursively segmented from a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree (QTBT) structure. For example, a single coding unit may be segmented into multiple coding units with a deeper depth based on a quadtree structure and / or a binary tree structure. In this case, the quadtree structure may be applied first, and then the binary tree structure may be applied. Alternatively, the binary tree structure may be applied first. The encoding process according to the present disclosure may be performed based on a final coding unit that is no longer segmented. In this case, the maximum coding unit may be directly used as the final coding unit, or the coding unit may be recursively segmented into coding units with a deeper depth, and a coding unit with an optimal size may be used as the final coding unit when necessary based on coding efficiency according to image characteristics. Here, the encoding process may include processes such as prediction, transformation, and reconstruction that will be described later. Alternatively, the processing unit may also include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be split or divided from the above-mentioned final coding unit. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit of deriving a transform coefficient and / or a unit of deriving a residual signal according to the transform coefficient.

[0067] A unit may be used interchangeably with the term "block" or "region". Typically, an M×N block represents a set of samples or transform coefficients in M ​​columns and N rows. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component. A sample may be used as a term corresponding to a picture (image), a pixel, or a picture element.

[0068] The encoding device 100 can generate a residual signal (residual block or residual sample array) by subtracting the prediction signal (prediction block or prediction sample array) output from the inter prediction unit 180 or the intra prediction unit 185 from the input video signal (original block or original sample array), and the generated residual signal is sent to the transform unit 120. In this case, as shown, the unit in the encoder 100 that subtracts the prediction signal (prediction block or prediction sample array) from the input video signal (original block or original sample array) can be called a subtractor 115. The predictor can perform prediction on the processing target block (hereinafter, referred to as the current block) and generate a prediction block including prediction samples relative to the current block. The predictor can determine whether to apply intra prediction or inter prediction to the current block or the unit of the CU. The predictor can generate various types of information about prediction such as prediction mode information, and send the information to the entropy encoding unit 190, as described later in the description of each prediction mode. The information about the prediction can be encoded in the entropy encoding unit 190 and output in the form of a bit stream.

[0069] The intra prediction unit 185 may predict the current block with reference to samples in the current picture. The referenced samples may be adjacent to the current block or may be separated from it according to the prediction mode. In intra prediction, the prediction mode may include a variety of non-directional modes and a variety of directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the level of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is exemplary, and depending on the setting, a variety of directional prediction modes equal to or greater than 65 or equal to or less than 33 may be used. The intra prediction unit 185 may use the prediction mode applied to the neighboring block to determine the prediction mode to be applied to the current block.

[0070] The inter prediction unit 180 may derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information sent in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring 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 may be the same as or different from the reference picture including the temporal neighboring block. The temporal neighboring block may be referred to as a collocated reference block or collocated CU (colCU), and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter prediction unit 180 may form a motion information candidate list based on the neighboring blocks, and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and in the case of skip mode and merge mode, the inter prediction unit 180 may use the motion information of the neighboring block as the motion information of the current block. In the case of skip mode, a residual signal may be transmitted differently from the merge mode. In the case of motion vector prediction (MVP) mode, the motion vector of the current block may be indicated by using the motion vector of the neighboring block as a motion vector predictor and signaling the motion vector difference.

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

[0072] 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 DCT (discrete cosine transform), DST (discrete sine transform), KLT (Karhunen-Loeve transform), GBT (graph-based transform), and CNT (conditional nonlinear transform). Herein, GBT refers to a transform obtained from a graph representing information about the relationship between pixels. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to square pixel blocks of the same size or to non-square blocks of variable size.

[0073] The quantization unit 130 may quantize the transform coefficients and send the quantized transform coefficients to the entropy coding unit 190, and the entropy coding unit 190 may encode the quantized signal (information about the quantized transform coefficients) and output the encoded signal as a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantization unit 130 may rearrange the quantized transform coefficients in the form of a block into a one-dimensional vector based on the coefficient scanning order, and generate information about the quantized transform coefficients based on the quantized transform coefficients in the form of a one-dimensional vector. For example, the entropy coding unit 190 may perform various encoding methods such as exponential Golomb, CAVLC (context adaptive variable length coding) and CABAC (context adaptive binary arithmetic coding). The entropy coding unit 190 may encode information required for video / image reconstruction (e.g., the value of a syntax element, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., video / image information) may be transmitted or stored in the form of a bitstream in units of a network abstraction layer (NAL). The bitstream may be transmitted over a network or stored in a digital storage medium. Here, the network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blueray, HDD, and SSD. A transmitter (not shown) that transmits a signal output from the entropy coding unit 190 and / or a memory (not shown) that stores the signal may be configured as an internal / external element of the encoding device 100, and the transmitter may be a component of the entropy coding unit 190.

[0074] The quantized transform coefficients output from the quantization unit 130 can be used to generate a prediction signal. For example, the residual signal can be reconstructed by applying inverse quantization and inverse transformation to the quantized transform coefficients through the inverse quantization unit 140 and the inverse transformation unit 150 in the loop. The adder 155 can add the reconstructed residual signal to the prediction signal output from the inter-frame prediction unit 180 or the intra-frame prediction unit 185, so that a reconstructed signal (reconstructed picture, reconstructed block or reconstructed sample array) can be generated. When there is no residual relative to the processing target block as in the case of applying the skip mode, the prediction block can be used as a reconstructed block. The adder 155 can also be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next processing target block in the current picture, or for inter-frame prediction of the next picture through filtering to be described later.

[0075] The filtering unit 160 can improve the subjective / objective picture quality by applying filtering to the reconstructed signal. For example, the filtering unit 160 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and send the modified reconstructed picture to the decoded picture buffer 170. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, and bilateral filtering. The filtering unit 160 can generate various types of information about filtering and send the information to the entropy coding unit 190, as described later in the description of each filtering method. The information about filtering can be encoded in the entropy coding unit 190 and output in the form of a bitstream.

[0076] The modified reconstructed picture transmitted to the decoded picture buffer 170 may be used as a reference picture in the inter prediction unit 180. Therefore, when inter prediction is applied, the encoding apparatus may avoid mismatching between the encoding apparatus 100 and the decoding apparatus and improve encoding efficiency.

[0077] The decoded picture buffer 170 may store the modified reconstructed picture so that the modified reconstructed picture is used as a reference picture in the inter prediction unit 180 .

[0078] Figure 3 is a schematic block diagram of a decoding device that performs decoding on a video signal as an embodiment to which the present disclosure is applied. Figure 3 The decoding device 200 and Figure 1 The decoding device 22 corresponds to.

[0079] Reference Figure 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-frame prediction unit 260, and an intra-frame prediction unit 265. The inter-frame prediction unit 260 and the intra-frame prediction unit 265 may be collectively referred to as a predictor. That is, the predictor may include the inter-frame prediction unit 180 and the intra-frame prediction unit 185. The inverse quantization unit 220 and the inverse transform unit 230 may be collectively referred to as a residual processor. That is, the residual processor may include the inverse quantization unit 220 and the inverse transform unit 230. According to an embodiment, the above-mentioned entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the adder 235, the filtering unit 240, the inter-frame prediction unit 260, and the intra-frame prediction unit 265 may be configured as a single hardware component (e.g., a decoder or a processor). In addition, according to an embodiment, the decoded picture buffer 250 may be configured as a single hardware component (eg, a memory or a digital storage medium).

[0080] When a bit stream including video / image information is input, the decoding device 200 can Figure 2 The image is reconstructed by a process corresponding to the process of processing video / image information in the encoding device 100. For example, the decoding device 200 may perform decoding using a processing unit applied in the encoding device 100. Therefore, the processing unit of decoding may be, for example, a coding unit, and the coding unit may be divided from the coding tree unit or the maximum coding unit according to the quadtree structure and / or the binary tree structure. In addition, the reconstructed video signal decoded and output by the decoding device 200 may be reproduced by a reproducing device.

[0081] The decoding device 200 may receive the Figure 2 The signal output by the encoding device 100 of the encoding device 100 can be decoded by the entropy decoding unit 210. For example, the entropy decoding unit 210 can parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). For example, the entropy decoding unit 210 can decode the information in the bitstream based on a coding method such as exponential Golomb, CAVLC, or CABAC, and output the syntax element value required for image reconstruction and the quantized value of the transform coefficient relative to the residual. More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in the bitstream, uses the decoding target syntax element information and the decoding information of the neighboring and decoding target blocks or the information about the symbol / bin decoded in the previous stage to determine the context model, predicts the bin generation probability according to the determined context model, and performs arithmetic decoding on the bin to generate a symbol corresponding to each syntax element value. Here, the CABAC entropy decoding method can update the context model using information about the symbol / bin decoded for the next symbol / bin context model after determining the context model. Information about prediction among the information decoded in the entropy decoding unit 210 may be provided to the predictor (the inter-prediction unit 260 and the intra-prediction unit 265), and the residual value (ie, the quantized transform coefficient) and related parameter information that have been entropy-decoded in the entropy decoding unit 210 may be input to the inverse quantization unit 220. In addition, information about filtering among the information decoded in the entropy decoding unit 210 may be provided to the filtering unit 240. In addition, a receiver (not shown) that receives a signal output from the encoding device 100 may be additionally configured as an internal / external element of the decoding device 200, or the receiver may be a component of the entropy decoding unit 210.

[0082] The inverse quantization unit 220 may inverse quantize the quantized transform coefficient to output the transform coefficient. The inverse quantization unit 220 may rearrange the quantized transform coefficient into a two-dimensional block form. In this case, the rearrangement may be performed based on the coefficient scanning order in the encoding device 100. The inverse quantization unit 220 may perform inverse quantization on the quantized transform coefficient using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficient.

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

[0084] The predictor may perform prediction on the current block and generate a prediction block including prediction samples relative to the current block. The predictor may determine whether to apply intra prediction or inter prediction to the current block based on information on prediction output from the entropy decoding unit 210 and determine a specific intra / inter prediction mode.

[0085] The intra prediction unit 265 may predict the current block with reference to samples in the current picture. The referenced samples may be adjacent to the current block or may be separated from the current block according to the prediction mode. In intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 265 may determine the prediction mode applied to the current block using the prediction mode applied to the neighboring blocks.

[0086] The inter prediction unit 260 may derive a prediction block relative to the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information sent in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring 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 form a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or 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 information about the prediction may include information indicating an inter prediction mode for the current block.

[0087] The adder 235 can generate a reconstructed signal (reconstructed picture, reconstructed block, or reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block or prediction sample array) output from the inter prediction unit 260 or the intra prediction unit 265. When there is no residual with respect to the processing target block as in the case of applying the skip mode, the prediction block can be used as the reconstructed block.

[0088] The adder 235 may also be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next processing target block in the current picture, or for inter prediction of the next picture through filtering to be described later.

[0089] 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 generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and send the modified reconstructed picture to the decoded picture buffer 250. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset (SAO), adaptive loop filtering (ALF), and bilateral filtering.

[0090] The modified reconstructed picture sent to the decoded picture buffer 250 may be used as a reference picture by the inter prediction unit 260 .

[0091] In the present specification, the implementations described in the filtering unit 160, the inter-frame prediction unit 180, and the intra-frame prediction unit 185 of the encoding device 100 may be applied equally or in a corresponding manner to the filtering unit 240, the inter-frame prediction unit 260, and the intra-frame prediction unit 265 of the decoding device.

[0092] Figure 4 1 is a configuration diagram of a content streaming system as an embodiment to which the present disclosure is applied.

[0093] The content streaming system to which the present disclosure is applied may include an encoding server 410 , a streaming server 420 , a network server 430 , a media storage device 440 , a user device 450 , and a multimedia input device 460 .

[0094] The encoding server 410 is used to compress content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data to generate a bitstream, and transmit the bitstream to the streaming server 420. As another example, when the multimedia input devices 460 such as smartphones, cameras, and camcorders directly generate a bitstream, the encoding server 410 may be omitted.

[0095] A bitstream may be generated by applying the encoding method or the bitstream generating method of the present disclosure, and the streaming server 420 may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0096] The streaming server 420 transmits multimedia data to the user device 450 through the network server 430 based on a user request, and the network server 430 serves as a medium for informing the user of the service. When the user sends a request for a desired service to the network server 430, the network server 430 transmits the request to the streaming server 420, and the streaming server 420 transmits the multimedia data to the user. Here, the content streaming system may include an additional control server, and in this case, the control server is used to control commands / responses between devices in the content streaming system.

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

[0098] Examples of user equipment 450 may include cellular phones, smart phones, laptop computers, digital broadcast terminals, PDAs (personal digital assistants), PMPs (portable multimedia players), navigation devices, touch screen PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, and HMDs (head-mounted displays)), digital TVs, desktop computers, digital signage, and the like.

[0099] Each server in the content streaming system may operate as a distributed server, and in this case, data received by each server may be processed in a distributed manner.

[0100] Figure 5a is a diagram for describing a block partition structure according to QT (quad tree), Figure 5b is a diagram for describing a block partition structure according to BT (binary tree), Figure 5c is a diagram for describing a block partition structure according to a TT (ternary tree), and Figure 5d An example of AT segmentation is shown.

[0101] In video encoding, a single block can be segmented based on QT. In addition, a single sub-block segmented according to QT can be further recursively segmented using QT. At least one of BT, TT and AT can be used to segment leaf blocks that are no longer segmented according to QT. BT can have two types of segmentation: horizontal BT (2N×N, 2N×N); and vertical BT (N×2N, N×2N). TT can have two types of segmentation: horizontal TT (2N×1 / 2N, 2N×N, 2N×1 / 2N); and vertical TT (1 / 2N×2N, N×2N, 1 / 2N×2N). AT can have four types of segmentation: horizontal upper AT (2N×1 / 2N, 2N×3 / 2N); horizontal lower AT (2N×3 / 2N, 2N×1 / 2N); vertical left AT (1 / 2N×2N, 3 / 2N×2N) and vertical right AT (3 / 2N×2N, 1 / 2N×2N). BT, TT and AT may be used to further recursively segment each type of BT, TT and AT.

[0102] Figure 5a An example of QT segmentation is shown. Block A can be segmented into four sub-blocks A0, A1, A2, and A3 according to QT. Sub-block A1 can be further segmented into four sub-blocks B0, B1, B2, and B3 according to QT.

[0103] Figure 5b An example of BT partitioning is shown. Block B3, which is no longer partitioned according to QT, can be partitioned into vertical BT (C0 and C1) or horizontal BT (D0 and D1). Each sub-block such as block C0 can be further recursively partitioned into horizontal BT (E0 and E1) or vertical BT (F0 and F1).

[0104] Figure 5c An example of TT partitioning is shown. Block B3, which is no longer partitioned according to QT, can be partitioned into vertical TTs (C0, C1, and C2) or horizontal TTs (D0, D1, and D2). Each sub-block such as block C1 can be further recursively partitioned into horizontal TTs (E0, E1, and E2) or vertical TTs (F0, F1, and F2).

[0105] Figure 5d An example of AT segmentation is shown. Block B3, which is no longer segmented according to QT, can be segmented into vertical AT (C0 and C1) or horizontal AT (D0 and D1). Each sub-block such as block C1 can be further recursively segmented into horizontal AT (E0 and E1) or vertical TT (F0 and F1).

[0106] In addition, BT, TT and AT segmentation can be used in combination. For example, the sub-blocks segmented according to BT can be segmented according to TT or AT. For example, the sub-blocks segmented according to TT can be segmented according to BT or AT. The sub-blocks segmented according to AT can be segmented according to BT or TT. For example, each sub-block can be segmented into vertical BT after horizontal BT segmentation, or each sub-block can be segmented into horizontal BT after vertical BT segmentation. In this case, although the segmentation order is different, the final segmented shape is the same.

[0107] In addition, when a block is divided, the block search order can be defined in various ways. Generally, the search is performed from left to right and from top to bottom, and the block search can mean the order of determining whether each divided sub-block will be additionally divided, the encoding order of the sub-block when the sub-block is no longer divided, or the search order when the sub-block refers to the information of other adjacent blocks.

[0108] According to Figure 5a to Figure 5d The processing unit (or transform block) divided by the partition structure shown in the figure performs transformation, and specifically, the partitioning can be performed in the row direction and the column direction and the transformation matrix can be applied. According to an embodiment of the present disclosure, different transformation types can be used according to the length of the processing unit (or transform block) in the row direction or the column direction.

[0109] A transform is applied to the residual block so as to de-correlate the residual block as much as possible, concentrate the coefficients on low frequencies, and generate a zero tail at the end of the block. The transform part in the JEM software includes two main functions (core transform and secondary transform). The core transform consists of a discrete cosine transform (DCT) and discrete sine transform (DST) transform family applied to all rows and columns of the residual block. Thereafter, a secondary transform can be additionally applied to the upper left corner of the output of the core transform. Similarly, an inverse transform can be applied in the order of an inverse secondary transform and an inverse core transform. First, an inverse secondary transform can be applied to the upper left corner of the coefficient block. Then, an inverse core transform is applied to the rows and columns of the output of the inverse secondary transform. A core transform or inverse transform may be referred to as a primary transform or an inverse transform.

[0110] Figure 6 and Figure 7 An embodiment of applying the present disclosure is shown. Figure 6 is a schematic block diagram of a transform and quantization unit 120 / 130 and an inverse quantization and inverse transform unit 140 / 150 in the encoding device 100, and Figure 7 is a schematic block diagram of the inverse quantization and inverse transform unit 220 / 230 in the decoding device 200 .

[0111] Reference Figure 6The 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.

[0112] Reference Figure 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 .

[0113] In the present disclosure, the transformation may be performed in multiple stages. For example, Figure 6 The two stages of applying a primary transform and a secondary transform are shown in , or more than two transform stages may be used depending on the algorithm. Here, the primary transform may be referred to as a core transform.

[0114] The primary transform unit 121 may apply a primary transform to the residual signal. Here, the primary transform may be predefined as a table in the encoder and / or decoder.

[0115] The secondary transform unit 122 may apply secondary transform to the primary transformed signal. Here, the secondary transform may be predefined as a table in the encoder and / or decoder.

[0116] In an embodiment, a non-separable secondary transform (NSST) may be conditionally applied as a secondary transform. For example, NSST is applied only to intra-predicted blocks and may have a transform set suitable for each prediction mode group.

[0117] Here, the prediction mode group can be set based on the symmetry with respect to the prediction direction. For example, the prediction mode 52 and the prediction mode 16 are symmetric based on the prediction mode 34 (diagonal direction), so a group can be generated and the same transform set can be applied thereto. Here, when the transform for the prediction mode 52 is applied, because the transform set of the prediction mode 52 is the same as the transform set of the prediction mode 16, the input data is transposed and then the transform is applied.

[0118] In the case of planar mode and DC mode, there is no symmetry with respect to each direction, so they have corresponding transformation sets, and the corresponding transformation sets can be composed of two transformations. Each transformation set can be composed of three transformations for the remaining directional modes.

[0119] The quantization unit 130 may perform quantization on the secondarily transformed signal.

[0120] The inverse quantization and inverse transform unit 140 / 150 performs an inverse process of the above-mentioned process, and a redundant description is omitted.

[0121] Figure 7is a schematic block diagram of the inverse quantization and inverse transform unit 220 / 230 in the decoding device 200 .

[0122] Reference Figure 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 .

[0123] The inverse quantization unit 220 obtains a transform coefficient from the entropy-decoded signal using the quantization step size information.

[0124] The inverse secondary transform unit 231 performs an inverse secondary transform on the transform coefficients. Figure 6 The inverse of the quadratic transform described in .

[0125] The inverse primary transform unit 232 performs an inverse primary transform on the signal (or block) after the inverse secondary transform, and obtains a residual signal. Figure 6 The inverse of a transformation described in .

[0126] In addition to DCT-2 and 4×4DST-4 applied to HEVC, adaptive multiple transform or explicit multiple transform (AMT or EMT) is also used to encode the residual of inter-frame coded blocks and intra-frame coded blocks. In addition to the transforms in HEVC, multiple transforms selected from the DCT / DST family are also used. The newly introduced transform matrices in JEM are DST-7, DCT-8, DST-1, and DCT-5. Table 1 below shows the basic functions of the selected DST / DCT.

[0127] [Table 1]

[0128]

[0129] EMT can be applied to CUs with width and height equal to or less than 64, and whether EMT is applied can be controlled by the CU level flag. When the CU level flag is 0, DCT-2 is applied to the CU to encode the residual. Two additional flags are signaled to identify the horizontal transform and vertical transform that will be used for the luma coding block in the CU to which EMT is applied. As in HEVC, the residual of the block can be encoded in transform skip mode in JEM. For intra-residual coding, a mode-dependent transform candidate selection process is used due to other residual statistics for 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.

[0130] [Table 2]

[0131]

[0132] Together with the subset concept, a transform subset is initially confirmed based on Table 2 by using the intra prediction mode of the CU with CU-level EMT_CU_flag being 1. Thereafter, for each of the horizontal (EMT_TU_horizontal_flag) and vertical (EMT_TU_vertical_flag) transforms, one of the two transform candidates in the confirmed transform subset is selected based on explicit signaling using the flag according to Table 3.

[0133] [Table 3]

[0134]

[0135] [Table 4]

[0136]

[0137]

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

[0139] Referring to Table 4, the transform configuration group is determined based on the prediction mode, and the number of groups may be 6 (G0 to G5). In addition, G0 to G4 correspond to the case where intra prediction is applied, and G5 represents a transform combination (or transform set or transform combination set) applied to a residual block generated according to inter prediction.

[0140] A transform combination may consist of a horizontal transform (or row transform) applied to the rows of the corresponding 2D block and a vertical transform (or column transform) applied to its columns.

[0141] Here, each of the transform configuration groups may have four transform combination candidates. The four transform combination candidates may be selected or determined using transform combination indexes 0 to 3, and the transform combination indexes may be encoded and transmitted from the encoder to the decoder.

[0142] In an embodiment, the residual data (or residual signal) obtained by intra prediction may have different statistical characteristics according to the intra prediction mode. Therefore, a transform other than a normal cosine transform may be applied for the corresponding intra prediction as shown in Table 4. In this specification, the transform type may be represented as, for example, DCT type 2, DCT-II, or DCT-2.

[0143] Referring to Table 4, a case where 35 intra prediction modes are used and a case where 67 intra prediction modes are used are shown. Multiple transform combinations can be applied for each transform configuration group classified in each intra prediction mode column. For example, multiple transform combinations can be composed of four combinations (of transforms in the row direction and transforms in the column direction). As a specific example, DST-7 and DCT-5 can be applied to group 0 in both the row (horizontal) direction and the column (vertical) direction, so a total of four groups can be applied.

[0144] 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 per transform unit. In the present specification, the transform combination index may be referred to as an AMT index and may be represented by AMT_idx.

[0145] In addition, in addition to the transform kernel shown in Table 4, due to the characteristics of the residual signal, it is possible to produce a situation where DCT-2 is optimal for both the row direction and the column direction. Therefore, the transform can be adaptively applied by defining the AMT flag for each coding unit. Here, when the AMT flag is 0, DCT-2 can be applied to both the row direction and the column direction, and when the AMT flag is 1, one of the four combinations can be selected or determined by the AMT index.

[0146] In an embodiment, if the number of transform coefficients is less than 3 for one transform unit when the AMT flag is 0, the transform kernel of Table 4 is not applied and DST-7 may be applied to both the row direction and the column direction.

[0147] In an embodiment, if the transform coefficient value is pre-parsed and thus the number of transform coefficients is less than 3, the AMT index is not parsed and DST-7 is applied, and thus the amount of transmission of additional information can be reduced.

[0148] In an embodiment, AMT may be applied only when both the width and height of a transform unit are equal to or less than 32.

[0149] In an implementation manner, Table 4 may be preset through offline training.

[0150] In an embodiment, the AMT index may be defined as one index that may indicate a combination of horizontal transform and vertical transform. Alternatively, the AMT index may be defined as a separate horizontal transform index and vertical transform index.

[0151] Figure 8 is a flow chart illustrating a process of performing adaptive multiple transform (AMT).

[0152] Although the embodiments are basically described with respect to separable transforms applied in the horizontal direction and the vertical direction, respectively, in the present specification, the transform combination may be composed of inseparable transforms.

[0153] Alternatively, the transform combination can be configured as a mixture of separable transforms and non-separable transforms. In this case, when a separable transform is used, the transform selection in row / column mode or the selection in the horizontal / vertical direction is not necessary, and only when a separable transform is selected, the transform combination of Table 4 can be used.

[0154] In addition, the methods proposed in this specification may be applied regardless of the primary transform and the secondary transform. That is, these methods may be applied to both transforms. Here, the primary transform may refer to a transform used to initially transform the residual block, and the secondary transform may refer to a transform used to apply a transform to a block generated as a result of the primary transform.

[0155] First, the encoding apparatus 100 may determine a transform group corresponding to the current block (S805). Here, the transform group may refer to the transform group in Table 4, but the present disclosure is not limited thereto, and the transform group may be composed of other transform combinations.

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

[0157] Fig. 9 is a flow chart showing a decoding process for performing AMT.

[0158] First, the decoding device 200 may determine a transform group of the current block (S905). The decoding device 200 may parse a transform combination index, and the transform combination index may correspond to one of a plurality of transform combinations in the transform group (S910). The decoding device 200 may derive a transform combination corresponding to the transform combination index (S915). Here, although the transform combination may refer to the transform combination shown in Table 4, the present disclosure is not limited thereto. That is, the transform combination may be configured as other transform combinations.

[0159] The decoding device 200 may perform an inverse transform on the current block based on the transform combination (S920). When the transform combination consists of a row transform and a column transform, the row transform may be applied, and then the column transform may be applied. However, the present disclosure is not limited thereto, and the row transform may be applied after the column transform is applied, and when the transform combination consists of an inseparable transform, the inseparable transform may be applied immediately.

[0160] In another embodiment, the process of determining the transform group and the process of parsing the transform combination index may be performed simultaneously.

[0161] In an embodiment of the present disclosure, the term “AMT” mentioned above may be redefined as “Multiple Transform Sets or Multiple Transform Selections (MTS)”. The following MTS-related syntax and semantics are outlined in Versatile Video Coding (VVC) JVET-K1001-v4.

[0162] In an embodiment of the present disclosure, two MTS candidates may be used for a directional mode and four MTS candidates may be used for a non-directional mode as follows.

[0163] A) Non-directional modes (DC and planar)

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

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

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

[0167] When the MTS index is 3, DST-8 is used for horizontal conversion and vertical conversion.

[0168] B) Patterns belonging to the horizontal group pattern

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

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

[0171] C) Patterns belonging to the vertical group pattern

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

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

[0174] Here (in VTM 2.0 using 67 modes), the horizontal group modes include intra prediction modes 2 to 34 and the vertical modes include intra prediction modes 35 to 66.

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

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

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

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

[0179] In another embodiment of the present disclosure, two MTS candidates are used for the directional prediction mode and three MTS candidates are used for the non-directional mode.

[0180] A) Non-directional modes (DC and planar)

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

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

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

[0184] B) Prediction mode corresponding to the level group mode

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

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

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

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

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

[0190] In another embodiment of the present disclosure, one MTS candidate (e.g., DST-7) can be used for all intra-frame modes. In this case, the encoding time can be reduced by 40% with a small amount of encoding loss. In addition, between DCT-2 and DST-7, a flag can be used to indicate.

[0191] Fig.10 is a flowchart illustrating an MTS-based inverse transformation process according to an embodiment of the present disclosure.

[0192] The decoding device 200 to which the present disclosure is applied can obtain 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. In addition, 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, cu_MTS_flag does not exist in the residual coding syntax of the inter-frame coding unit, and if sps_MTS_inter_enabled_flag=1, cu_MTS_flag exists in the residual coding syntax of the inter-frame coding unit.

[0193] The decoding device 200 may obtain 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 obtain cu_MTS_flag. Here, cu_MTS_flag indicates whether MTS is applied to the residual samples of the luma transform block. For example, if cu_MTS_flag=0, MTS is not applied to the residual samples of the luma transform block, and if cu_MTS_flag=1, MTS is applied to the residual samples of the luma transform block.

[0194] The decoding device 200 may obtain MTS_idx based on cu_MTS_flag (S1015). For example, when cu_MTS_flag=1, the decoding device 200 may obtain MTS_idx. Here, MTS_idx indicates which transform kernel is applied to the luma residual samples of the current transform block in the horizontal direction and / or the vertical direction.

[0195] For example, at least one of the embodiments described in this specification may be applied to MTS_idx.

[0196] 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 as a horizontal transform and a vertical transform, respectively.

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

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

[0199] The decoding device 200 may perform inverse transform based on the transform kernel ( S1025 ).

[0200] Furthermore, in the specification, MTS may be represented as AMT or EMT, and MTS_idx may be represented as AMT_idx, EMT_idx, AMT_TU_idx, EMT_TU_idx, etc., but the present disclosure is not limited thereto.

[0201] The present disclosure is described in a manner that is divided into a case where MTS is applied and a case where MTS is not applied based on an MTS flag, but is not limited to this expression. For example, whether MTS is applied may mean whether to use other transform types (or transform kernels) other than a predefined specific transform type (which may be referred to as a basic transform type, a default transform type, etc.). If MTS is applied, other transform types other than the basic transform type (for example, any one of a plurality of transform types or a combined transform type of two or more transform types) may be used for transformation. In addition, if MTS is not applied, the basic transform type may be used for transformation. In an embodiment, the basic transform type may be configured (or defined) as DCT2.

[0202] As an example, when the MTS flag syntax indicating whether the MTS is applied to the current transform block and the MTS are applied, the MTS index syntax indicating the transform type applied to the current transform block may also be independently transmitted from the encoder to the decoder. As another example, when the MTS flag syntax indicating whether the MTS is applied to the current transform block and the MTS are applied, the syntax (e.g., MTS index) including all transform types applied to the current transform block may also be transmitted from the encoder to the decoder. That is, in the latter example, the syntax (or syntax element) indicating the transform type applied to the current transform block (or unit) may be transmitted from the encoder to the decoder within all transform type groups (or transform type sets) including the above-mentioned basic transform types.

[0203] Therefore, despite this expression, the syntax (MTS index) indicating the transform type applied to the current transform block may include information on whether MTS is applied. In other words, in the latter example, only the MTS index may be signaled without signaling the MTS flag, and in this case, it may be understood that DCT2 is included in MTS. However, in the present disclosure, the application of DCT2 may be described as meaning that MTS is not applied. However, the technical scope with respect to MTS is not limited to the corresponding definition.

[0204] Fig.11 is a block diagram of a device for performing decoding based on MTS according to an embodiment of the present disclosure.

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

[0206] 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 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. Fig.10 The description may be applied to a specific example.

[0207] 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. Fig.10 The description may be applied to a specific example.

[0208] The MTS index acquisition unit 1115 may acquire MTS_idx based on cu_MTS_flag. For example, when cu_MTS_flag=1, the MTS index acquisition unit 1115 may acquire MTS_idx. Here, MTS_idx indicates which transform kernel is applied to the luma residual sample of the current transform block in the horizontal direction and / or the vertical direction. Fig.10 The description may be applied to a specific example.

[0209] The transform kernel derivation unit 1120 may derive a transform kernel corresponding to MTS_idx. Then, the decoding device 200 may perform inverse transform based on the derived transform kernel.

[0210] A mode-dependent non-separable secondary transform (MDNSST) is introduced. In order to keep the complexity low, MDNSST is only applied to low-frequency coefficients after one transform. In addition, the non-separable transform mainly applied to low-frequency coefficients can be called LFNST (low-frequency non-separable transform). If both the width (W) and the height (H) of the transform coefficient block are equal to or greater than 8, an 8×8 non-separable secondary transform is applied to the 8×8 upper left area of ​​the transform coefficient block. If the width or height is less than 8, a 4×4 non-separable secondary transform is applied, and a 4×4 non-separable secondary transform can be performed on the upper left min(8,W)×min(8,H) of the transform coefficient block. Here, min(A,B) is a function of the smaller value between the outputs A and B. In addition, W×H is the block size, W represents the width and H represents the height.

[0211] For block sizes 4×4 and 8×8, there may be a total of 35×3 indivisible secondary transforms. Here, 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 set may be defined in Table 5 below.

[0212] [Table 5]

[0213]

[0214] To indicate a transform kernel among the transform sets, a NSST index (NSST idx) may be encoded. When NSST is not applied, a NSST index equal to 0 is signaled.

[0215] Fig.12 and Fig.13 : is a flowchart showing encoding / decoding to which secondary transform is applied as an embodiment to which the present disclosure is applied.

[0216] In JEM, the secondary transform (MDNSST) is not applied to blocks coded in transform skip mode. When the MDNSST index is signaled for a CU and the MDNSST index is not equal to zero, the MDNSST is not used for blocks of components coded in transform skip mode in the CU. Fig.12 and Fig.13 The overall coding structure including coefficient coding and NSST index coding is shown in FIG. The CBF flag is encoded to determine whether coefficient coding and NSST coding are performed. Fig.12 and Fig.13 In the CBF flag, the CBF flag can represent the luminance block cbg flag (cbf_luma flag) or the chrominance block cbf flag (cbf_cb flag or cbf_cr flag). When the CBF flag is 1, the transform coefficient is encoded.

[0217] Reference Fig.12 , the encoding device 100 checks whether CBF is 1 (S1205). If CBF is 0, the encoding device 100 does not perform transform coefficient encoding and NSST index encoding. If CBF is 1, the encoding device 100 performs encoding on the transform coefficient (S1210). Thereafter, the encoding device 100 determines whether to perform NSST index encoding (S1215) and performs NSST index encoding (S1220). When NSST index encoding is not applied, the encoding device 100 can end the transform process without applying NSST and perform subsequent steps (e.g., quantization).

[0218] Reference Fig.13 , the decoding device 200 checks whether CBF is 1 (S1305). If CBF is 0, the decoding device 200 does not perform transform coefficient decoding and NSST index decoding. If CBF is 1, the decoding device 200 performs decoding on the transform coefficient (S1310). Thereafter, the decoding device 200 determines whether to perform NSST index encoding (S1315) and parses the NSST index (S1320).

[0219] NSST can be applied to the 8×8 or 4×4 upper left area instead of to the entire block (TU in the case of HEVC) to which a transform has been applied. For example, when the block size is 8×8 or larger, 8×8 NSST can be applied, and when the block size is less than 8×8, 4×4 NSST can be applied. In addition, when 8×8 NSST is applied, 4×4 NSST can be applied to each 4×4 block. Both 8×8 NSST and 4×4 NSST can be determined according to the above-mentioned transform set configuration, and 8×8 NSST can have 64 input data and 64 output data, and 4×4 NSST can have 16 inputs and 16 outputs because they are inseparable transforms.

[0220] Fig.14 and Fig.15 An embodiment of applying the present disclosure is shown. Fig.14 is a diagram used to describe Givens rotation, and Fig.15 Shown is the configuration of one round in a 4×4 NSST consisting of a Givens rotation layer and permutation.

[0221] Both 8×8 NSST and 4×4 NSST can be configured as a hierarchical combination of Givens rotations. The matrix corresponding to one Givens rotation is expressed as Equation 1, and the matrix product is expressed as Fig.14 .

[0222] [Formula 1]

[0223]

[0224] exist Fig.14 In the formula (2), the output t of Givens rotation can be calculated as m and t n .

[0225] [Formula 2]

[0226] t m =x m cosθ-x n sinθ

[0227] t n =x m sinθ+x n cosθ

[0228] Because Fig.14 The Givens rotation shown in rotates two data, so 32 or 8 Givens rotations are needed to process 64 (in the case of 8×8 NSST) or 16 (in the case of 4×4 NSST) data. Therefore, a group of 32 or 8 Givens rotations can form a Givens rotation layer. Fig.15As shown, through permutation (shuffling), the output data of a Givens rotation layer is sent as the input data of the next Givens rotation layer. As Fig.15 shown, the pattern of the permutation is defined by rules, and in the case of 4×3 NSST, four Givens rotation layers and the corresponding permutations form one round. 4×4 NSST is executed for two rounds, while 8×8 NSST is executed for four rounds. Although the same permutation pattern is used for different rounds, the Givens rotation angles applied are different. Therefore, it is necessary to store the angle data of all Givens rotations that make up each permutation.

[0229] As the last step, the data output through the Givens rotation layer is permuted one more time at the end, and information about the corresponding permutation is stored separately for each permutation. The corresponding permutation is executed at the end of the forward NSST, and the corresponding inverse permutation is initially applied in the inverse NSST.

[0230] The inverse NSST executes the Givens rotation layer and the permutation applied to the forward NSST in reverse, and performs the rotation by taking the negative value of each Givens rotation angle.

[0231] RST (Simplified Secondary Transform)

[0232] Fig.16 shows the operation of the RST as an embodiment applying the present disclosure.

[0233] When the orthogonal matrix representing the transformation is N×N, the reduced transformation (RT) only leaves R (R < N) of the N transformation basis vectors. The matrix for the forward RT for generating transformation coefficients can be defined by Equation 3.

[0234] [Equation 3]

[0235]

[0236] Since the matrix for the inverse RT is the transpose matrix of the forward RT matrix, as shown in (a) of Fig.16 and (b) of Fig.16 shown, the application of the forward RT and the inverse RT is illustrated.

[0237] The RT applied to the 8×8 upper left block of the transform coefficient block to which a transform has been applied can be referred to as 8×8 RST. When R is set to 16 in Mathematical Expression 3, the forward 8×8 RST has the form of a 16×64 matrix and the inverse 8×8 RST has the form of a 64×16 matrix. In addition, the transform set configuration shown in Table 5 can be applied to the 8×8 RST. That is, the 8×8 RST can be determined based on the transform set according to the intra-frame prediction mode as shown in Table 5. Since a transform set consists of two or three transforms according to the intra-frame prediction mode, a transform with the maximum value among the four transforms including the case where a secondary transform is not applied can be selected (one transform can correspond to an anisotropic matrix). When indexes 0, 1, 2, and 3 are assigned to these four transforms, the transform to be applied can be specified by signaling the syntax element corresponding to the NSST index of each transform coefficient block. For example, index 9 can be assigned to an anisotropic matrix, that is, the case where a secondary transform is not applied. Therefore, through NSST indexing, for the 8×8 top left block, 8×8 NSST can be specified according to JEM NSST and 8×8 RST can be specified according to RST configuration.

[0238] Fig.17 : is a diagram showing a process of performing reverse scanning from a sixty-fourth coefficient to a seventeenth coefficient in reverse scanning order as an embodiment to which the present disclosure is applied.

[0239] When 8×8 RST represented by Mathematical Expression 3 is applied, 16 effective transform coefficients are generated, so 64 input data constituting the 8×8 area are reduced to 16 output data, and only one quarter of the area is filled with effective transform coefficients according to the angle of the two-dimensional area. Therefore, the 16 output data obtained by applying the forward 8×8 RST fills Fig.17 The upper left area.

[0240] exist Fig.17 In the example, the 4×4 upper left area becomes the region of interest (ROI) filled with valid transform coefficients, while the rest of the area is empty. The empty area can be filled with 0 as a default value. Fig.17 If non-zero significant transform coefficients are found in regions outside the ROI, the 8×8 RST has not been explicitly applied, so the corresponding encoding can be omitted for the corresponding NSST index. Fig.17 If no non-zero significant transform coefficients are found in the area outside the ROI (8×8 RST is applied or the area outside the ROI is filled with 0), the NSST index can be encoded because 8×8 RST can be applied. This conditional NSST index encoding requires checking the presence or absence of non-zero transform coefficients and can therefore be performed after the residual coding process.

[0241] Fig.18 An exemplary flowchart of encoding using a single transform indicator as an embodiment to which the present disclosure is applied is illustrated.

[0242] In an embodiment of the present disclosure, a single transform indicator (STI) is introduced. When STI is enabled (STI coding == 1), a single transform can be applied instead of using two transforms (primary transform and secondary transform) in sequence. Here, the single transform can be any type of transform. For example, the single transform can be a separable transform or an inseparable transform. The single transform can be a transform approximated from an inseparable transform. When STI has been enabled, a single transform index ( Fig.18 Here, a single transform index may indicate a transform to be applied among the available transform candidates.

[0243] Reference Fig.18 , the encoding device 100 determines whether the CBF is 1 (S1805). When the CBF is 1, the encoding device 100 determines whether to apply STI encoding (S1810). When STI encoding is applied, the encoding device 100 encodes the STI index STI_idx (S1845) and performs encoding on the transform coefficient (S1850). When STI encoding is not applied, the encoding device 100 encodes the flag EMT_CU_Flag indicating whether EMT (or MTS) is applied at the CU level (S1815). Thereafter, the encoding device 100 performs encoding on the transform coefficient (S1820). Then, the encoding device 100 determines whether to apply EMT to the transform unit (TU) (S1825). When EMT is applied to the UT, the encoding device 100 encodes the primary transform index EMT_TU Idx applied to the TU (S1830). Subsequently, the encoding device 100 determines whether to apply NSST (S1835). When NSST is applied, the encoding apparatus 100 encodes an index NSST_Idx indicating the NSST to be applied ( S1840 ).

[0244] In an example, if a single transform coding condition is met / enabled (e.g., STI_coding == 1), a single transform index ST_Idx may be implicitly derived rather than signaled. ST_idx may be implicitly determined based on block size and intra prediction mode. Here, ST_Idx may indicate the transform (or transform kernel) applied to the current transform block.

[0245] If one or more of the following conditions are met (STI_coding == 1), STI may be enabled.

[0246] 1) The block size corresponds to a predetermined value such as 4 or 8.

[0247] 2) Block width == block height (square block)

[0248] 3) The intra prediction mode is one of predetermined modes such as the DC mode and the planar mode.

[0249] In another example, an 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, when the CBF is 1 and STI coding is enabled, the STI coding flag may be signaled. In addition, the STI coding flag may be conditionally signaled considering block size, block shape (square block or non-square block), or intra prediction mode.

[0250] In order to use the information obtained during coefficient encoding, ST_idx can be determined after coefficient encoding. In the example, ST_idx can be implicitly determined based on block size, intra-frame prediction mode, and the number of non-zero coefficients. In another example, ST_idx can be conditionally encoded / decoded based on block size, block shape, intra-frame 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 position of non-zero coefficients). Specifically, when non-zero coefficients are found in an area other than the upper left area of ​​4×4, ST_idx signaling can be omitted.

[0251] Fig.19 An exemplary flowchart of encoding using a joint transform indicator (UTI) as an embodiment to which the present disclosure is applied is illustrated.

[0252] In the embodiments of the present disclosure, a joint transform indicator is introduced. The UTI includes a primary transform indicator and a secondary transform indicator.

[0253] Reference Fig.19, the encoding device 100 determines whether the CBF is 1 (S1905). When the CBF is 1, the encoding device 100 determines whether to apply UTI encoding (S1910). When UTI encoding is applied, the encoding device 100 encodes the UTI index UTI_idx (S1945) and performs encoding on the transform coefficient (S1950). When UTI encoding is not applied, the encoding device 100 encodes a flag EMT_CU_Flag indicating whether EMT (or MTS) is applied at the CU level (S1915). Thereafter, the encoding device 100 performs encoding on the transform coefficient (S1920). Then, the encoding device 100 determines whether to apply EMT to a transform unit (TU) (S1925). When EMT is applied to a UT, the encoding device 100 encodes a primary transform index EMT_TU Idx applied to the TU (S1930). Subsequently, the encoding device 100 determines whether to apply NSST (S1935). When NSST is applied, the encoding apparatus 100 encodes an index NSST_Idx indicating the NSST to be applied ( S1940 ).

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

[0255] The UTI encoding mode may depend on the following conditions.

[0256] 1) Block size

[0257] 2) Block shape

[0258] 3) Intra-frame prediction mode

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

[0260] A syntax structure for UTI may optionally be used. UTI may depend on the CU (TU) size. For example, a smaller CU (TU) may have a UTI index in a narrower range. In an example, if a predefined condition is met (e.g., the block size is less than a predefined threshold), the UTI may only indicate the core transform index.

[0261] [Table 6]

[0262] UTI-Index Binarization (FLC) Core Transformation Idx Secondary transformation Idx 0 00000 0 0 1 00001 0 1 2 00010 0 2 3 00011 0 3 4 00100 1 0 5 00101 1 1 6 00110 1 2 7 00111 1 3 ... ... ... ... 31 11111 5 3

[0263] In another example, when the use of secondary transform is not indicated (e.g., secondary transform index == 0 or secondary transform is already predetermined), the UTI index may be considered as a core transform index. In the same manner, when the core transform index is considered known, the UTI index may be considered as a secondary transform index. Specifically, considering the intra prediction mode and block size, a predetermined core transform may be used.

[0264] Fig.20a and Fig.20b Two exemplary flowcharts of encoding using UTI as an embodiment to which the present disclosure is applied are illustrated.

[0265] In another example, the transform coding structure may use UTI index encoding, such as Fig.20a and Fig.20b Here, the UTI index can be encoded earlier than the coefficient encoding or later than the coefficient encoding.

[0266] Reference Fig.20a , the encoding device 100 checks whether the CBF is 1 (S2005). When the CBF is 1, the encoding device 100 encodes the UTI index UTI_idx (S2010) and performs encoding on the transform coefficient (S2015).

[0267] Reference Fig.20b , the encoding device 100 checks whether the CBF is 1 (S2055). When the CBF is 1, the encoding device 100 performs encoding on the transform coefficient (S2060) and encodes the UTI index UTI_idx (S2065).

[0268] In another embodiment of the present disclosure, a data hiding and implicit coding method for a transform indicator is introduced. Here, the transform indicator may include ST_idx, UTI_idx, EMT_CU_Flag, EMT_TU_Flag, NSST_Idx, and any kind of transform-related index that may be used to indicate a transform kernel. The above-mentioned transform indicator may not be signaled, but the corresponding information may be inserted in the coefficient encoding process (which may be extracted in the coefficient encoding process). The coefficient encoding process may include the following parts.

[0269] -Last_position_x,Last_position_y

[0270] -Group flag

[0271] -Significance map

[0272] -Greater_than_1flag

[0273] -Greater_than_2flag

[0274] -Remaining level coding

[0275] -Sign coding

[0276] For example, the transform indicator information may be inserted in one or more of the above-mentioned coefficient encoding processes. In order to insert the transform indicator information, the following may be considered together.

[0277] sing encoding mode

[0278] The absolute values ​​of the remaining levels

[0279] Greather_than_1 number of signs

[0280] The value of Last_position_X and the value of Last_position_Y

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

[0282] In another example, NSST_idx and EMT_idx may be dependent. For example, when EMT_CU_Flag is equal to 0 (or 1), NSST_idx may be non-zero. In this case, NSST_idx-1 may be signaled instead of NSST_idx.

[0283] In another embodiment of the present disclosure, an NSST transform set mapping based on an intra prediction mode is introduced, as shown in Table 7 below. Although NSST is described below as an example of an inseparable transform, another known term (e.g., LFNST) may be used for an inseparable transform. For example, the NSST set and the NSST index may be replaced by the LFNST set and the LFNST index, respectively. In addition, the RST described in this specification may also be replaced by an LFNST as an example of an inseparable transform (e.g., LFNST) using a non-square transform matrix with reduced input length and / or reduced output length in a square inseparable transform matrix applied to at least one region of the transform block (a 4×4 or 8×8 upper left region or a region other than the 4×4 lower right region in an 8×8 block).

[0284] [Table 7]

[0285]

[0286] As shown in Table 8, the numbers of NSST sets may be rearranged from 0 to 3.

[0287] [Table 8]

[0288]

[0289] In the NSST transform set, only four transform sets are used (instead of 35), thus reducing the required storage space.

[0290] Additionally, various numbers of transform kernels per transform set may be used as follows.

[0291] Case A: Two available transform cores are used for each transform set, so that the NSST index ranges from 0 to 2. For example, when the NSST index is 0, the secondary transform (decoder-based inverse secondary transform) may not be applied. When the NSST index is 1 or 2, the secondary transform may be applied. The transform set may include two transform cores to which the index 1 or 2 may be mapped.

[0292] [Table 9]

[0293]

[0294] Referring to Table 9, two transform kernels are used for each of the inseparable transform (NSST or LFNST) sets 0 to 3.

[0295] Case B: Two available transform kernels are used for transform set 0, and one available transform kernel is used for other transform sets. The available NSST indexes for transform set 0 (DC and planar) are 0 to 2. However, the NSST indexes for other modes (transform sets 1, 2, and 3) are 0 to 1.

[0296] [Table 10]

[0297]

[0298] Referring to Table 10, two inseparable transform cores are set for the inseparable transform (NSST) set corresponding to index 0, and one inseparable transform core is set for each of the inseparable transform (NSST) sets corresponding to indexes 1, 2, and 3.

[0299] Case C: Each transform set uses one transform kernel, and the NSST index ranges from 0 to 1.

[0300] [Table 11]

[0301]

[0302] Fig.21 is an exemplary flowchart showing encoding for performing transformation as an embodiment to which the present disclosure is applied.

[0303] The encoding device 100 performs a transform on the residual block (S2105). A transform may be referred to as a core transform. As an embodiment, the encoding device 100 may perform a transform by using the MTS mentioned above. In addition, the encoding device 100 may send an MTS index indicating a specific MTS among the MTS candidates to the decoding device 200. Here, the MTS candidates may be configured based on the intra prediction mode of the current block.

[0304] The encoding device 100 determines whether to apply a secondary transform (S2110). For example, the encoding device 100 may determine whether to apply a secondary transform based on a transform coefficient of a residual block after the primary transform. For example, the secondary transform may be NSST or RST.

[0305] The encoding apparatus 100 determines a secondary transform (S2115). Here, the encoding apparatus 100 may determine a secondary transform based on an NSST (or RST) transform set according to an intra prediction mode.

[0306] For example, before step S2115, the encoding apparatus 100 may determine a region to which a secondary transform is to be applied based on the size of the current block.

[0307] The encoding apparatus 100 performs the secondary transform determined in step S2115 ( S2120 ).

[0308] Fig. 22 is an exemplary flowchart showing decoding for performing transformation as an embodiment to which the present disclosure is applied.

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

[0310] The decoding apparatus 200 determines an inverse secondary transform (S2210). Here, the decoding apparatus 200 may determine an inverse secondary transform applied to the current block based on an NSST (or RST) transform set specified according to the above-mentioned intra prediction mode.

[0311] In addition, for example, before step S2210, the decoding device 200 may determine a region to which an inverse secondary transform is to be applied based on the size of the current block.

[0312] The decoding apparatus 200 performs an inverse secondary transform on the inverse quantized residual block using the inverse secondary transform determined in step S2210 ( S2215 ).

[0313] The decoding device performs an inverse primary transform on the residual block after the inverse secondary transform (S2220). The inverse primary transform may be referred to as an inverse core transform. In an embodiment, the decoding device 200 may perform the inverse primary transform using the MTS mentioned above. In addition, as an example, before step S2220, the decoding device 200 may determine whether to apply the MTS to the current block. In this case, Fig. 22 The decoding flowchart may further include a step of determining whether to apply MTS.

[0314] For example, when MTS is applied to the current block (ie, cu_MTS_flag=1), the decoding device 200 may configure MTS candidates based on the intra prediction mode of the current block. In this case, Fig. 22 The decoding flowchart may further include a step of configuring MTS candidates. In addition, the decoding device 200 may determine an inverse primary transform applied to the current block using mtx_idx indicating a specific MTS among the configured MTS candidates.

[0315] Fig.23 Detailed block diagram of the transform unit 120 in the encoding apparatus 100 as an embodiment to which the present disclosure is applied.

[0316] The encoding apparatus 100 to which the embodiment of the present disclosure is applied may include a primary transform unit 2310 , a secondary transform application determination unit 2320 , a secondary transform determination unit 2330 , and a secondary transform unit 2340 .

[0317] 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 implementation, the primary transform unit 2310 may perform a primary transform using the MTS mentioned above. In addition, the primary transform unit 2310 may send an MTS index indicating a specific MTS among the MTS candidates to the decoding device 200. Here, the MTS candidates may be configured based on the intra prediction mode of the current block.

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

[0319] The secondary transform determination unit 2330 determines the secondary transform. Here, the secondary transform determination unit 2330 may determine the secondary transform based on the NSST (or RST) transform set specified according to the intra prediction mode as described above.

[0320] For example, the secondary transform determination unit 2330 may determine a region to which the secondary transform is to be applied based on the size of the current block.

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

[0322] Fig.24 Detailed block diagram of the inverse transform unit 230 in the decoding device 200 as an embodiment to which the present disclosure is applied.

[0323] The decoding apparatus 200 to which the present disclosure is applied includes an inverse secondary transform application determination unit 2410 , an inverse secondary transform determination unit 2420 , an inverse secondary transform unit 2430 , and an inverse primary transform unit 2440 .

[0324] The inverse secondary transform application determination unit 2410 may determine whether to apply the inverse secondary transform. For example, the inverse secondary transform may be NSST or RST. For example, the inverse secondary transform application determination unit 2410 may determine whether to apply the inverse secondary transform based on a secondary transform flag received from the encoding device 100.

[0325] The inverse secondary transform determination unit 2420 may determine the inverse secondary transform. Here, the inverse secondary transform determination unit 2420 may determine the inverse secondary transform applied to the current block based on an NSST (or RST) transform set specified according to the intra prediction mode.

[0326] In addition, for example, the inverse secondary transform determination unit 2420 may determine a region to which the inverse secondary transform is to be applied based on the size of the current block.

[0327] The inverse secondary transform unit 2430 may perform an inverse secondary transform on the inverse quantized residual block using the determined inverse secondary transform.

[0328] The inverse transform unit 2440 may perform an inverse transform on the residual block after the inverse secondary transform. In an embodiment, the inverse transform unit 2440 may perform an inverse transform using the MTS mentioned above. In addition, as an example, the inverse transform unit 2440 may determine whether to apply the MTS to the current block.

[0329] For example, when MTS is applied to the current block (ie, cu_MTS_flag=1), the inverse transform unit 2440 may configure MTS candidates based on the intra prediction mode of the current block. In addition, the inverse transform unit 2440 may determine the inverse transform applied to the current block using mtx_idx indicating a specific MTS among the configured MTS candidates.

[0330] Fig.25 The flowchart of processing a video signal is an embodiment to which the present disclosure is applied. Fig.25 The process of the flowchart may be performed by the decoding device 200 or the inverse transform unit 230.

[0331] First, the decoding device 200 may determine whether to apply an inverse inseparable transform to the current block based on the inseparable transform index and the width and height of the current block. For example, if the inseparable transform index is not 0 and the width and height of the current block are equal to or greater than 4, the decoding device 200 may determine that an inseparable transform is applied. If the inseparable transform index is 0 or the width or height of the current block is less than 4, the decoding device 200 may omit the inverse inseparable transform and perform an inverse primary transform.

[0332] In step S2505, the decoding device 200 determines an inseparable transform set index indicating an inseparable transform set for inseparable transform of the current block among inseparable transform sets predefined based on the intra prediction mode of the current block. The inseparable transform set index may be set so that it is allocated to each of the four transform sets configured according to the range of the intra prediction mode, as shown in Table 7 or Table 8. That is, the inseparable transform set index may be determined as a first index value when the intra prediction mode is 0 and 1, as a second index value when the intra prediction mode is 2 to 12 or 56 to 66, as a third index value when the intra prediction mode is 13 to 23 or 45 to 55, and as a fourth index value when the intra prediction mode is 24 to 44, as shown in Table 7 or Table 8.

[0333] Here, each of the predefined inseparable transform sets may include two transform cores, as shown in Table 9. In addition, each of the predefined inseparable transform sets may include one or two transform cores, as shown in Table 10 or Table 11.

[0334] In step S2510, the decoding device 200 determines the transform core indicated by the inseparable transform index for the current block among the transform cores included in the inseparable transform set indicated by the inseparable transform set index as the inseparable transform matrix. For example, two inseparable transform cores may be configured for each inseparable transform set index value, and the decoding device 200 may determine the inseparable transform matrix based on the transform core indicated by the inseparable transform index among the two transform matrix cores corresponding to the inseparable transform set index.

[0335] In step S2515, the decoding device 200 applies the non-separable transformation matrix to the upper left region of the current block determined based on 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, the non-separable transformation may be applied to the 8×8 upper left region of the current block, and if the width or height of the current block is less than 8, the non-separable transformation may be applied to the 4×4 region of the current block. In response to the region to which the non-separable transformation is to be applied, the size of the non-separable transformation may also be set to 8×8 or 4×4.

[0336] In addition, the decoding apparatus 200 may apply horizontal transform and vertical transform to the current block to which the inseparable transform has been applied. Here, the horizontal transform and the vertical transform may be determined based on the MTS index in order to select a prediction mode and a transform matrix applied to the current block.

[0337] Hereinafter, a method of combining and applying a primary transform and a secondary transform is described. That is, an embodiment of the present disclosure proposes a method of efficiently designing a transform used in a primary transform and a secondary transform. In this case, it is possible to apply Figures 1 to 25 The method illustrated in the figure is described below and redundant description is omitted.

[0338] As described above, a primary transform represents a transform first applied to the residual block based on the encoder. If a secondary transform is applied, the encoder can perform a secondary transform on the residual block after the primary transform. If a secondary transform is applied, a secondary inverse transform can be performed before the primary inverse transform based on the decoder. The decoder can perform an inverse transform on the transform coefficient block after the secondary inverse transform to derive the residual block.

[0339] In addition, as described above, the non-separable transform can be used as a secondary transform, and in order to maintain low complexity, the secondary transform can be applied only to the coefficients of the low frequency of the upper left specific area. The secondary transform applied to these coefficients of low frequency can be called a non-separable secondary transform (NSST), a low-frequency non-separable transform (LFNST) or a simplified secondary transform (RST). A primary transform can be called a core transform.

[0340] In an embodiment of the present disclosure, a primary transform candidate used in a primary transform and a secondary transform core used in a secondary transform may be predefined as various combinations. In the present disclosure, a primary transform candidate used in a primary transform may be referred to as an MTS candidate, but is not limited to the name. For example, a primary transform candidate may be a combination of transform cores (or transform types) applied to the horizontal direction and the vertical direction, respectively, and the transform core may be one of DCT2, DST7, and / or DCT8. In other words, a primary transform candidate may be at least one combination of DCT2, DST7, and / or DCT8. The following description is given with a detailed example.

[0341] -Combination A

[0342] In combination A, as illustrated in Table 12 below, primary transform candidates and secondary transform kernels may be defined according to intra prediction modes.

[0343] [Table 12]

[0344]

[0345] Referring to Table 12 above, as an example (case 1), if the intra prediction mode has directionality, two primary transform candidates can be used, and if the intra prediction mode has no directionality (e.g., DC mode, planar mode), four primary transform candidates can be used. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate may include two transform cores. That is, as described above, a plurality of secondary transform core sets may be predefined according to the intra prediction mode, and each of the plurality of predefined secondary transform core sets may include two transform cores.

[0346] In addition, as an example (case 2), if the intra prediction mode has directionality, two primary transform candidates may be used, and if the intra prediction mode has no directionality, four primary transform candidates may be used. In this case, if the intra prediction mode has directionality, the secondary transform candidate may include one transform core, and if the intra prediction mode has no directionality, the secondary transform candidate may include two transform cores.

[0347] In addition, as an example (case 3), if the intra prediction mode has directionality, two primary transform candidates can be used, and if the intra prediction mode has no directionality, four primary transform candidates can be used. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate can include one transform kernel.

[0348] -Combination B

[0349] In combination B, as illustrated in Table 13 below, primary transform candidates and secondary transform kernels may be defined according to intra prediction modes.

[0350] [Table 13]

[0351]

[0352] Referring to Table 13 above, as an example (case 1), three primary transform candidates may be used regardless of the directionality of the intra prediction mode. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate may include two transform cores. That is, as described above, a plurality of secondary transform core sets may be predefined according to the intra prediction mode, and each of the plurality of predefined secondary transform core sets may include two transform cores.

[0353] In addition, as an example (case 2), three primary transform candidates may be used regardless of the directionality of the intra prediction mode. In this case, if the intra prediction mode has directionality, the secondary transform candidate may include one transform core, and if the intra prediction mode has no directionality, the secondary transform candidate may include two transform cores.

[0354] In addition, as an example (Case 3), three primary transform candidates may be used regardless of the directionality of the intra prediction mode. In this case, the secondary transform candidate may include one transform kernel regardless of the directionality of the intra prediction mode.

[0355] -Combination C

[0356] In combination C, as illustrated in Table 14 below, primary transform candidates and secondary transform kernels may be defined according to intra prediction modes.

[0357] [Table 14]

[0358]

[0359] Referring to Table 14 above, as an example (case 1), if the intra prediction mode has directionality, two primary transform candidates can be used, and if the intra prediction mode has no directionality (e.g., DC mode, planar mode), three primary transform candidates can be used. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate may include two transform cores. That is, as described above, a plurality of secondary transform core sets may be predefined according to the intra prediction mode, and each of the plurality of predefined secondary transform core sets may include two transform cores.

[0360] In addition, as an example (case 2), if the intra prediction mode has directionality, two primary transform candidates may be used, and if the intra prediction mode has no directionality, three primary transform candidates may be used. In this case, if the intra prediction mode has directionality, the secondary transform candidate may include one transform core, and if the intra prediction mode has no directionality, the secondary transform candidate may include two transform cores.

[0361] In addition, as an example (case 3), if the intra prediction mode has directionality, two primary transform candidates can be used, and if the intra prediction mode has no directionality, three primary transform candidates can be used. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate can include one transform kernel.

[0362] The above description is given focusing on the case where multiple primary transform candidates are used. For example, the following describes a combination of a primary transform and a secondary transform in the case where fixed primary transform candidates are used.

[0363] -Combination D

[0364] In combination D, as illustrated in Table 15 below, primary transform candidates and secondary transform kernels may be defined according to intra prediction modes.

[0365] [Table 15]

[0366]

[0367] Referring to Table 15 above, as an implementation, one primary transform candidate may be 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.

[0368] As an example (case 1), one primary transform candidate may be fixedly used regardless of the intra prediction mode. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate may include two transform cores. That is, as described above, a plurality of secondary transform core sets may be predefined according to the intra prediction mode, and each of the plurality of predefined secondary transform core sets may include two transform cores.

[0369] In addition, as an example (case 2), one primary transform candidate may be used fixedly regardless of the intra prediction mode. In this case, if the intra prediction mode has directionality, the secondary transform candidate may include one transform core, and if the intra prediction mode has no directionality, the secondary transform candidate may include two transform cores.

[0370] In addition, as an example (Case 3), one primary transform candidate may be fixedly used regardless of the intra prediction mode. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate may include one transform kernel.

[0371] -Combination E

[0372] In combination E, as illustrated in Table 16 below, primary transform candidates and secondary transform kernels may be defined according to intra prediction modes.

[0373] [Table 16]

[0374]

[0375]

[0376] Referring to Table 16 above, as long as DCT2 is applied as the primary transform, the secondary transform can be defined. In other words, if MTS is not applied (i.e., if DCT2 is applied as the primary transform), the secondary transform can be applied. Fig.10As illustrated in the example, the present disclosure is described in a manner divided into a case where MTS is applied and a case where MTS is not applied, but is not limited to this expression. For example, whether MTS is applied may mean whether to use other transform types (or transform kernels) other than a predefined specific transform type (which may be referred to as a basic transform type, a default transform type, etc.). If MTS is applied, other transform types other than the basic transform type (for example, any one transform type among a plurality of transform types or a combined transform type of two or more transform types) may be used for transformation. In addition, if MTS is not applied, the basic transform type may be used for transformation. In an embodiment, the basic transform type may be configured (or defined) as DCT2.

[0377] As an example (case 1), when DCT2 is applied to a primary transform, a secondary transform may be applied. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate may include two transform cores. That is, as described above, a plurality of secondary transform core sets may be predefined according to the intra prediction mode, and each of the plurality of predefined secondary transform core sets may include two transform cores.

[0378] In addition, as an example (case 2), when DCT2 is applied to a primary transform, a secondary transform may be applied. In this case, if the intra prediction mode has directionality, the secondary transform candidate may include one transform core, and if the intra prediction mode has no directionality, the secondary transform candidate may include two transform cores.

[0379] In addition, as an example (Case 3), when DCT2 is applied to the primary transform, the secondary transform may be applied. In this case, regardless of the directionality of the intra prediction mode, the secondary transform candidate may include one transform kernel.

[0380] Fig.26 is a flowchart illustrating a method of transforming a video signal according to an embodiment to which the present disclosure is applied.

[0381] Reference Fig.26 For convenience of explanation, the present disclosure is described based on a decoder, but the present disclosure is not limited thereto. The transform method for a video signal according to an embodiment of the present disclosure may be substantially equally applied even to an encoder. Fig.26 The flowchart illustrated in can be executed by the decoding device 200 or the inverse transform unit 230.

[0382] In S2601 , the decoding device 200 parses a first syntax element indicating a primary transform kernel applied to a current block.

[0383] In S2602, the decoding device 200 determines whether a secondary transform can be applied to the current block based on the first syntax element.

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

[0385] In S2604 , the decoding device 200 derives a secondary inverse transformed block by performing a secondary inverse transform on an upper left specific area of ​​the current block using the secondary transform kernel indicated by the second syntax element.

[0386] In S2605 , the decoding device 200 derives a residual block of the current block by performing a primary inverse transform on the secondary inverse transformed block using the primary transform kernel indicated by the first syntax element.

[0387] As described above, if the first syntax element indicates a predefined first transform kernel, step S2602 may be performed by determining that a secondary transform can be applied to the current block. In this case, the first transform kernel may be defined as DCT2.

[0388] In addition, as described above, the decoding device 200 may determine a secondary transform core set for secondary transform of the current block from among the predefined secondary transform core sets based on the intra prediction mode of the current block. The second syntax element may indicate a secondary transform core from among the determined secondary transform core sets applied to the secondary transform of the current block.

[0389] Additionally, as described above, each of the predefined secondary transform core sets may include two transform cores.

[0390] In an embodiment of the present disclosure, an example of a syntax structure in which a multiple transform set (MTS) is used will be described.

[0391] For example, the following Table 17 shows an example of the syntax structure of a sequence parameter set.

[0392] [Table 17]

[0393]

[0394] Reference Fig.17, whether the MTS according to the embodiment of the present disclosure can be used can be signaled through the sequence parameter set syntax. Here, sps_MTS_intra_enabled_flag indicates whether an MTS flag or an MTS index exists in a lower-level syntax (e.g., residual coding syntax or transform unit syntax) with respect to an intra coding unit. In addition, sps_MTS_inter_enabled_flag indicates whether an MTS flag or an MTS index exists in a lower-level syntax with respect to an inter coding unit.

[0395] As another example, the following Table 18 shows an example of a transform unit syntax structure.

[0396] [Table 18]

[0397]

[0398] Referring to Table 18, cu_MTS_flag indicates whether MTS is applied to residual samples of the luma transform block. For example, if cu_MTS_flag=0, MTS is not applied to residual samples of the luma transform block, and if cu_MTS_flag=1, MTS is applied to residual samples of the luma transform block.

[0399] As described above, in the present disclosure, the case where MTS is applied and the case where MTS is not applied are described separately based on the MTS flag, but the present disclosure is not limited thereto. For example, whether MTS is applied may have the same meaning as whether a transform type (or transform kernel) other than a predefined specific transform type (which may be referred to as a basic transform type, a default transform type, etc.) is used. If MTS is applied, a transform type other than the default transform type (e.g., any one of a plurality of transform types or a combination of two or more thereof) may be used for the transform, and if MTS is not applied, the default transform type may be used for the transform. In an embodiment, the default transform type may be set (or defined) to DCT2.

[0400] As an example, an MTS flag syntax indicating whether MTS is applied to the current transform block and an MTS index syntax indicating a transform type applied to the current block when MTS is applied may be independently transmitted from the encoder to the decoder. As another example, a syntax (e.g., an MTS index) including both whether MTS is applied to the current transform block and a transform type applied to the current block when MTS is applied may be transmitted from the encoder to the decoder. That is, in the latter example, a syntax (or syntax element) indicating a transform type applied to the current transform block (or unit) in a transform type group (or transform type set) including the above-mentioned default transform type may be transmitted from the encoder to the decoder.

[0401] Therefore, the syntax (MTS index) indicating the transform type applied to the current transform block may include information about whether MTS is applied regardless of its representation. In other words, although in the latter example, because only the MTS index can be signaled without signaling the MTS flag, MTS can be regarded as including DCT2, the case where DCT2 is applied can be described in the present disclosure as a case where MTS is not applied, and the technical scope with respect to MTS is not limited to the limitation.

[0402] In addition, as another example, the following Table 19 shows an example of a residual unit syntax structure.

[0403] [Table 19]

[0404]

[0405]

[0406]

[0407]

[0408] Referring to Table 19, transform_skip_flag and / or MTS_idx syntax (or syntax element) may be signaled through residual syntax. However, this is merely an example, and the present disclosure is not limited thereto. For example, transform_skip_flag and / or MTS_idx syntax may be signaled through transform unit syntax.

[0409] A specific embodiment of the above-mentioned secondary transform matrix that can be used for secondary transform will be described below. As mentioned above, the secondary transform may be referred to as a non-separable secondary transform (NSST), a low frequency non-separable transform (LFNST), or a simplified secondary transform (RST).

[0410] As described above, in an embodiment of the present disclosure, four transform sets (or secondary transform sets) may be used to improve storage efficiency when applying secondary transforms. As an embodiment, the encoder / decoder may assign indexes 0, 1, 2, and 3 to the four transform sets.

[0411] In addition, as described above, each transform set may include a predetermined number of transform kernels. As an embodiment, four transform sets for secondary transform may be predefined in the encoder and decoder, and each transform set may include one or two transform matrices (or transform types or transform kernels).

[0412] Table 20 below shows an example of transformation applicable to an 8×8 area.

[0413] [Table 20]

[0414]

[0415]

[0416]

[0417]

[0418]

[0419]

[0420]

[0421] Table 20 shows the case where the transformation matrix coefficients are multiplied by the scaling value 128. In Table 20, the first input [4] in the array g_aiNSST8×8[4][2]

[16]

[64] represents the number of transformation sets (here, the transformation sets can be identified by indexes 0, 1, 2, and 3), the second input [2] represents the number of transformation matrices constituting each transformation set, and the third input

[16] and the fourth input

[64] represent the rows and columns of 16×64 RST (Simplified Secondary Transform).

[0422] Although Table 20 assumes the case where the transform set includes two transform matrices, if the transform set includes one transform matrix, it may be configured to use the transform matrices in a specific order for each transform set in Table 20. For example, when the transform set includes one transform matrix, the encoder / decoder may use a predetermined (i.e., first or second) transform matrix in each transform set in Table 20.

[0423] When the RST of Table 20 is applied, the encoder / decoder may be configured (defined or set) to output 16 transform coefficients, or may be configured to output only m transform coefficients by applying only the m×64 portion of the 16×64 matrix. For example, the encoder / decoder may be configured to output only 8 transform coefficients using an 8×64 matrix with m=8 set from the top only. By applying a simplified secondary transform in this way, the amount of computation can be reduced by half. As an embodiment, the encoder / decoder may apply an 8×64 matrix to an 8×8 transform unit (TU) to reduce the amount of computation.

[0424] Table 21 below shows an example of transformation applicable to a 4×4 area.

[0425] [Table 21]

[0426]

[0427]

[0428]

[0429] Table 21 shows the case where the transformation matrix coefficients are multiplied by the scaling value 128. In Table 21, the first input [4] in the array g_aiNSST4×4[4][2]

[16]

[16] represents the number of transformation sets (here, the transformation sets can be identified by indexes 0, 1, 2, and 3), the second input [2] represents the number of transformation matrices constituting each transformation set, and the third input

[16] and the fourth input

[16] represent the rows and columns of 16×64 RST (Simplified Secondary Transform).

[0430] Although Table 21 assumes the case where the transform set includes two transform matrices, if the transform set includes one transform matrix, it may be configured to use the transform matrices in a specific order for each transform set in Table 21. For example, when the transform set includes one transform matrix, the encoder / decoder may use a predetermined (i.e., first or second) transform matrix in each transform set in Table 21.

[0431] When the RST of Table 21 is applied, the encoder / decoder may be configured (defined or set) to output 16 transform coefficients, or may be configured to output only m transform coefficients by applying only the m×16 portion of the 16×64 matrix. For example, the encoder / decoder may be configured to output only 8 transform coefficients using an 8×16 matrix with m=8 set from the top. By applying a simplified secondary transform in this way, the amount of computation can be reduced by half. As an embodiment, the encoder / decoder may apply an 8×64 matrix to an 8×8 transform unit (TU) to reduce the amount of computation in the worst case.

[0432] In an embodiment, the transform matrices shown in Tables 20 and 21 may be applied to 4×4, 4×8, and 8×4 upper left regions (ie, TUs) or only to 4×4 upper left regions according to predefined conditions. In the case of 4×8TU and 8×4TU, the encoder / decoder may divide it into two 4×4 regions and apply the specified transform to each divided region. If the secondary transform is limited to being applied only to a 4×4 region, only the transform defined in Table 210 may be applied (or used).

[0433] In addition, although the transformation matrix coefficients are defined in Tables 20 and 21 assuming that the scaling ratio is 128, the present disclosure is not limited thereto. For example, the transformation matrix coefficients may be defined by setting the scaling value in Tables 20 and 21 to 256, as shown in Tables 22 and 23.

[0434] [Table 22]

[0435]

[0436]

[0437]

[0438]

[0439]

[0440]

[0441]

[0442]

[0443]

[0444] [Table 23]

[0445]

[0446]

[0447]

[0448] As described above, in an embodiment of the present disclosure, four transform sets (or secondary transform sets) may be used to improve storage efficiency when applying secondary transforms. As an embodiment, the encoder / decoder may assign indexes 0, 1, 2, and 3 to the four transform sets.

[0449] In addition, as described above, each transform set may include a predetermined number of transform kernels. As an embodiment, four transform sets for secondary transform may be predefined in the encoder and decoder, and each transform set may include one or two transform matrices (or transform types or transform kernels).

[0450] Various secondary transform sets and transform matrices (or transform types or transform kernels) applicable to secondary transforms will be described below by various examples. Although various transform matrices different from Tables 20 to 23 may be defined in detail, for the convenience of description, in this embodiment, non-directional modes (e.g., DC mode and planar mode) and methods for configuring generalized secondary transform sets will be mainly described using examples.

[0451] First, an example of secondary transformation applicable to a 4×4 area will be described in detail. Among the following examples with respect to secondary transformation sets that can be used for secondary transformation, the transformation matrices in the first and fourth examples can be applied to an embodiment in which each transformation set includes two transformation matrices. The transformation matrices in the second and third examples can be applied to an embodiment in which each transformation set includes one transformation matrix.

[0452] Specifically, the first example can be applied to the above-mentioned combination D and case 1 of the embodiments described in Table 15, and can also be applied to the combination A and case 1 of the embodiments described in Table 12, the combination B and case 1 of the embodiments described in Table 13, the combination C and case 1 of the embodiments described in Table 14, or the combination E and case 1 of the embodiments described in Table 16.

[0453] Specifically, the transformation array (i.e., transformation set) of the second example can be applied to the above-mentioned combination D and case 3 of the implementation described in Table 15, and can also be applied to the combination A and case 3 of the implementation described in Table 12, the combination B and case 3 of the implementation described in Table 13, the combination C and case 3 of the implementation described in Table 14, or the combination E and case 3 of the implementation described in Table 16.

[0454] Although the above-mentioned combinations A, B, C, D, and E only handle the case where the number of MTS candidates is three or less, all four MTS candidates can be applied for all intra prediction modes in one transformation. Even when all four MTS candidates are applied, the following first to fourth examples can be used, and in particular, the transformation array of the fourth example may be more suitable for the case where four MTS candidates are applied.

[0455] The transform arrays of the subsequent fifth to seventh examples correspond to the case where 35 transform sets are applied. They can be applied when the transform sets are mapped to the intra prediction modes, as shown in Table 24.

[0456] [Table 24]

[0457]

[0458] In Table 24, the NSST set index represents the transform set index. Even when the mapping method of Table 24 is applied, the above-mentioned combinations A to E can be applied. That is, each combination can be applied to the fifth example to the eighth example as in the above method.

[0459] The transformation arrays of the fifth and eighth examples may be applied to an embodiment in which each transformation set consists of two transformation matrices, and the transformation arrays of the sixth and seventh examples may be applied to an embodiment in which each transformation set consists of one transformation matrix.

[0460] Specifically, the fifth example can be applied to the above-mentioned combination D and case 1 of the embodiments described in Table 15, and can also be applied to the combination A and case 1 of the embodiments described in Table 12, the combination B and case 1 of the embodiments described in Table 13, the combination C and case 1 of the embodiments described in Table 14, or the combination E and case 1 of the embodiments described in Table 16.

[0461] Specifically, the transformation arrays (i.e., transformation sets) of the sixth example and the seventh example can be applied to the above-mentioned combination D and case 3 of the implementation described in Table 15, and can also be applied to the combination A and case 3 of the implementation described in Table 12, the combination B and case 3 of the implementation described in Table 13, the combination C and case 3 of the implementation described in Table 14, or the combination E and case 3 of the implementation described in Table 16.

[0462] Although the above-mentioned combinations A, B, C, D, and E only handle the case where the number of MTS candidates is three or less, all four MTS candidates can be applied for all intra prediction modes in one transformation. Even when all four MTS candidates are applied, the following fifth to eighth examples can be used, and in particular, the transformation array of the eighth example may be more suitable for the case where four MTS candidates are applied.

[0463] The transform examples applicable to 4×4 areas among the transform arrays of the first to eighth examples below correspond to transform matrices multiplied by a scaling value of 128. The transform arrays of the following examples can generally be represented as a g_aiNSST4x4[N1][N2]

[16]

[16] array. Here, N1 represents the number of transform sets. Here, N1 is 4 or 35 and can be identified by indexes 0, 1,…, N1-1. N2 represents the number (1 or 2) of transform matrices constituting each transform set, and

[16]

[16] represents a 16×16 transform matrix.

[0464] In the following example, when a transform set consists of one transform, a specific order of transform matrices may be used for each transform set. For example, when a transform set includes one transform matrix, the encoder / decoder may use a predefined (ie, first or second) transform matrix in each transform set.

[0465] In order to reduce the amount of calculation in the worst case, the encoder / decoder can apply an 8×16 matrix to a 4×4TU. In the following example, the transform applicable to the 4×4 region can be applied to a 4×4TU, a 4×MTU, and an M×4TU (M>4), and when it is applied to a 4×MTU and an M×4TU, the TU can be divided into 4×4 regions, and each specified transform can be applied thereto, or the transform can be applied only to the 4×8 or 8×4 upper left region. In addition, the transform can be applied only to the 4×4 upper left region.

[0466] In an implementation, in order to reduce the amount of calculation in the worst case, the following may be applied.

[0467] For example, with respect to a block of width W and height H, when W>=8 and H>=8, the encoder / decoder may apply a transform array (or transform matrix or transform kernel) applicable to an 8×8 region to an 8×8 upper left region (e.g., a 16×64 matrix) of the block. If W=8 and H=8, the encoder / decoder may only apply the 8×64 portion of the 16×64 matrix. In this case, the input to the secondary transform may be generated as 8 transform coefficients, and the remaining coefficients of the corresponding region may be considered to be 0.

[0468] In addition, for example, if one of W and H is less than 8 (i.e., it is 4) with respect to a block having a width W and a height H, the encoder / decoder may apply a transform array applicable to a 4×4 region. If W=4 and H=4, the encoder / decoder may only apply an 8×16 portion of a 16×16 matrix. In this case, the input to the secondary transform may be generated as 8 transform coefficients, and the remaining coefficients of the corresponding region may be considered as 0.

[0469] In an embodiment, if (W, H) = (4, 8) or (8, 4), the encoder / decoder may apply the secondary transform only to the 4×4 upper left region. When W or H is greater than 8, the encoder / decoder applies the secondary transform only to the two 4×4 upper left blocks. That is, the encoder / decoder may divide the upper left region of at most 4×8 or 8×4 into two 4×4 blocks and apply the specified transform matrix thereto.

[0470] First example

[0471] The first example may be defined as the following Table 25. Four transformation sets may be defined, and each transformation set may consist of two transformation matrices.

[0472] [Table 25]

[0473]

[0474]

[0475] Second example

[0476] The second example may be defined as the following Table 26. Four transform sets may be defined, and each transform set may consist of one transform matrix.

[0477] [Table 26]

[0478]

[0479] Third Example

[0480] The third example may be defined as the following Table 27. Four transform sets may be defined, and each transform set may consist of one transform matrix.

[0481] [Table 27]

[0482]

[0483] Fourth Example

[0484] The fourth example may be defined as the following Table 28. Four transform sets may be defined, and each transform set may be composed of two transform matrices.

[0485] [Table 28]

[0486]

[0487]

[0488] Fifth example

[0489] The fifth example may be defined as the following Table 29. 35 transformation sets may be defined, and each transformation set may be composed of two transformation matrices.

[0490] [Table 29]

[0491]

[0492] Sixth Example

[0493] The sixth example may be defined as the following Table 30. 35 transformation sets may be defined, and each transformation set may consist of one transformation matrix.

[0494] [Table 30]

[0495]

[0496] Example 7

[0497] The seventh example may be defined as the following Table 31. 35 transformation sets may be defined, and each transformation set may consist of one transformation matrix.

[0498] [Table 31]

[0499]

[0500] Example 8

[0501] The eighth example may be defined as the following Table 32. 35 transformation sets may be defined, and each transformation set may be composed of two transformation matrices.

[0502] [Table 32]

[0503]

[0504]

[0505] Hereinafter, an example of a secondary transform applicable to an 8×8 area will be described. Among the following examples of secondary transform sets that can be used for secondary transform, the transform matrices in the ninth and tenth examples can be applied to an implementation in which each transform set consists of two transform matrices. The transform matrices in the tenth and eleventh examples can be applied to an implementation in which each transform set consists of one transform matrix.

[0506] Specifically, the ninth example can be applied to the above-mentioned combination D and case 1 of the embodiments described in Table 15, and can also be applied to the combination A and case 1 of the embodiments described in Table 12, the combination B and case 1 of the embodiments described in Table 13, the combination C and case 1 of the embodiments described in Table 14, or the combination E and case 1 of the embodiments described in Table 16.

[0507] Specifically, the transformation array (i.e., transformation set) of the tenth example can be applied to the above-mentioned combination D and case 3 of the implementation described in Table 15, and can also be applied to the combination A and case 3 of the implementation described in Table 12, the combination B and case 3 of the implementation described in Table 13, the combination C and case 3 of the implementation described in Table 14, or the combination E and case 3 of the implementation described in Table 16.

[0508] Although the above-mentioned combinations A, B, C, D, and E only handle the case where the number of MTS candidates is three or less, all four MTS candidates can be applied for all intra prediction modes in one transformation. Even when all four MTS candidates are applied, the following ninth to twelfth examples can be used, and in particular, the transformation array of the twelfth example may be more suitable for the case where four MTS candidates are applied.

[0509] The transform arrays of the subsequent thirteenth to sixteenth examples correspond to the case where 35 transform sets are applied. They can be applied to the case where the transform sets are mapped to the corresponding intra prediction modes, as shown in Table 24 mentioned above.

[0510] In Table 24, the NSST set index represents the transform set index. Even when the mapping method of Table 24 is applied, the above-mentioned combinations A to E can be applied. That is, each combination can be applied to the thirteenth example to the sixteenth example as in the above method.

[0511] The transformation arrays of the thirteenth and sixteenth examples may be applied to an embodiment in which each transformation set consists of two transformation matrices, and the transformation arrays of the fourteenth and fifteenth examples may be applied to an embodiment in which each transformation set consists of one transformation matrix.

[0512] Specifically, the thirteenth example can be applied to the above-mentioned combination D and case 1 of the embodiments described in Table 15, and can also be applied to the combination A and case 1 of the embodiments described in Table 12, the combination B and case 1 of the embodiments described in Table 13, the combination C and case 1 of the embodiments described in Table 14, or the combination E and case 1 of the embodiments described in Table 16.

[0513] Specifically, the transformation arrays (i.e., transformation sets) of the fourteenth example and the fifteenth example can be applied to the above-mentioned combination D and case 3 of the implementation described in Table 15, and can also be applied to the combination A and case 3 of the implementation described in Table 12, the combination B and case 3 of the implementation described in Table 13, the combination C and case 3 of the implementation described in Table 14, or the combination E and case 3 of the implementation described in Table 16.

[0514] Although the above-mentioned combinations A, B, C, D, and E only handle the case where the number of MTS candidates is three or less, all four MTS candidates can be applied for all intra prediction modes in one transformation. Even when all four MTS candidates are applied, the following thirteenth to sixteenth examples can be used, and in particular, the transformation array of the eighth example may be more suitable for the case where four MTS candidates are applied.

[0515] The transform examples applicable to an 8×8 area among the transform arrays of the eighth to sixteenth examples below correspond to transform matrices multiplied by a scaling value of 128. The transform arrays of the following examples can generally be represented as a g_aiNSST8x8[N1][N2]

[16]

[64] array. Here, N1 represents the number of transform sets. Here, N1 is 4 or 35 and can be identified by indexes 0, 1,…, N1-1. N2 represents the number (1 or 2) of the transform matrices that constitute each transform set, and

[16]

[64] represents a 16×64 simplified secondary transform (RST).

[0516] In the following example, when a transform set consists of one transform, a specific order of transform matrices may be used for each transform set. For example, when a transform set includes one transform matrix, the encoder / decoder may use a predefined (ie, first or second) transform matrix in each transform set.

[0517] Although 16 transform coefficients are output when RST is applied, only m transform coefficients can be configured to be output when only the m×64 portion of the 16×64 matrix is ​​applied. For example, the amount of calculation can be reduced by half by setting m to 8, multiplying only the 8×64 matrix from the top to output only 8 transform coefficients.

[0518] Ninth Example

[0519] The ninth example may be defined as the following Table 33. Four transformation sets may be defined, and each transformation set may be composed of two transformation matrices.

[0520] [Table 33]

[0521]

[0522]

[0523]

[0524] Example 10

[0525] The tenth example may be defined as the following Table 34. Four transformation sets may be defined, and each transformation set may consist of one transformation matrix.

[0526] [Table 34]

[0527]

[0528]

[0529] Example 11

[0530] The eleventh example may be defined as the following Table 35. Four transformation sets may be defined, and each transformation set may be composed of one transformation matrix.

[0531] [Table 35]

[0532]

[0533]

[0534] Example 12

[0535] The twelfth example may be defined as the following Table 36. Four transformation sets may be defined, and each transformation set may be composed of two transformation matrices.

[0536] [Table 36]

[0537]

[0538]

[0539]

[0540] Example 13

[0541] The thirteenth example may be defined as the following Table 37. 35 transformation sets may be defined, and each transformation set may be composed of two transformation matrices.

[0542] [Table 37]

[0543]

[0544]

[0545]

[0546] Example 14

[0547] The fourteenth example may be defined as the following Table 38. 35 transformation sets may be defined, and each transformation set may be composed of one transformation matrix.

[0548] [Table 38]

[0549]

[0550] Example 15

[0551] The fifteenth example may be defined as the following Table 39. 35 transformation sets may be defined, and each transformation set may be composed of one transformation matrix.

[0552] [Table 39]

[0553]

[0554]

[0555] Example 16

[0556] The sixteenth example may be defined as the following Table 40. 35 transformation sets may be defined, and each transformation set may be composed of two transformation matrices.

[0557] [Table 40]

[0558]

[0559]

[0560]

[0561] Fig. 27 is a flowchart showing a method of transforming a video signal according to an embodiment to which the present disclosure is applied.

[0562] Reference Fig. 27 Although the description will focus on the decoder for convenience of description, the present disclosure is not limited thereto, and the method of transforming a video signal according to the present embodiment can be equally applied to an encoder. Fig. 27 The flowchart may be executed by the decoding device 200 or the inverse transform unit 230.

[0563] The decoding apparatus 200 determines a secondary transform set applied to the current block from among predefined secondary transform sets based on an intra prediction mode of the current block ( S2701 ).

[0564] The decoding apparatus 200 acquires a first syntax element indicating a secondary transform matrix applied to the current block in the determined secondary transform set ( S2702 ).

[0565] The decoding apparatus 200 derives a secondary inverse transformed block by performing secondary inverse transform on an upper left region of the current block using the secondary transform matrix specified by the first syntax element ( S2703 ).

[0566] 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 matrix of the current block ( S2704 ).

[0567] As described above, each of the predefined secondary transform sets may include two secondary transform matrices.

[0568] As described above, step S2704 may further include a step of determining an input length and an output length of a secondary inverse transform based on the width and height of the current block. As described above, when each of the height and width of the current block is 4, the input length of the indivisible transform may be determined to be 8 and its output length may be determined to be 16.

[0569] As described above, the decoding device 200 may parse the second syntax element indicating the primary transform matrix applied to the current block. In addition, the decoding device 200 may determine whether a secondary transform may be applied to the current block based on the second syntax element.

[0570] As described above, when the second syntax element indicates a predefined specific transform type, the step of determining whether the secondary transform can be applied may be performed by determining that the secondary transform can be applied to the current block.

[0571] As mentioned above, the predefined specific transform type may be DCT2.

[0572] Fig.28 is an exemplary block diagram of an apparatus for processing a video signal as an embodiment of the present disclosure. Fig.28 The video signal processing device shown in the figure may correspond to Figure 1 Encoding device or Figure 2 Decoding device.

[0573] The video processing apparatus 2800 for processing a video signal includes a memory 2820 storing the video signal and a processor 2810 combined with the memory and processing the video signal.

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

[0575] In addition, the processing method of the present disclosure can be manufactured in the form of a program executed by a computer and stored in a computer-readable recording medium. The multimedia data with a data structure according to the present disclosure can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blueray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier wave (for example, transmitted via the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable recording medium, or can be transmitted via a wired / wireless communication network.

[0576] In addition, the embodiments of the present disclosure may be implemented as a computer program product according to a program code, and the program code may be executed in a computer according to the embodiments of the present disclosure. The program code may be stored on a computer readable carrier.

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

[0578] In addition, the decoder and encoder to which the present disclosure is applied may be included in a multimedia broadcast transmission / reception device, a mobile communication terminal, a home theater video system, a digital theater video system, a surveillance camera, a video communication device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camera, a video on demand (VoD) service providing device, an over-the-top video (OTT) video system, an Internet streaming service providing device, a 3D video system, a video phone video system, a medical video system, etc., and may be used to process a video signal or a data signal. For example, an OTT video system may include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.

[0579] In addition, the processing method of the present disclosure can be manufactured in the form of a program executed by a computer and stored in a computer-readable recording medium. The multimedia data with a data structure according to the present disclosure can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blueray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier wave (for example, transmitted via the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable recording medium, or can be transmitted via a wired / wireless communication network.

[0580] In addition, the embodiments of the present disclosure may be implemented as a computer program product according to a program code, and the program code may be executed in a computer according to the embodiments of the present disclosure. The program code may be stored on a computer readable carrier.

[0581] The above-mentioned embodiments are combinations of elements and features of the present disclosure. Unless otherwise mentioned, these elements or features may be considered as optional. Each element or feature may be put into practice without being combined with other elements or features. In addition, the embodiments of the present disclosure may be constructed by combining the parts of elements and / or features. The order of operations described in the embodiments of the present disclosure may be rearranged. Some constructions of any one embodiment may be included in another embodiment and may be replaced by the corresponding construction of another embodiment. It is obvious to those skilled in the art that claims that are not clearly referenced to each other in the attached claims may exist as exemplary embodiments in combination, or may be included as new claims by subsequent amendments after submitting an application.

[0582] The implementation of the present disclosure can be implemented by various means (e.g., hardware, firmware, software, or a combination thereof). In a hardware configuration, the method according to the implementation of the present disclosure can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.

[0583] In firmware or software configuration, the implementation of the present disclosure may be implemented in the form of modules, programs, functions, etc. The software code may be stored in a storage unit and executed by a processor. The memory may be located inside or outside the processor and may send data to and receive data from the processor via various known means.

[0584] Those skilled in the art will appreciate that, without departing from the spirit and essential characteristics of the present disclosure, the present disclosure may be performed in other specific ways different from those set forth herein. Therefore, the above embodiments are therefore to be understood as being illustrative in all respects, rather than restrictive. The scope of the present disclosure should be limited by the appended claims and their legal equivalents rather than the above description, and all changes falling within the meaning and equivalent scope of the appended claims should be included herein.

[0585] Industrial Applicability

[0586] Although exemplary aspects of the present disclosure have been described for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, without departing from essential characteristics of the disclosure.

Claims

1. A method for decoding a video signal, the method comprising the following steps: Get a first syntax element specifying which secondary transform matrix in a secondary transform set is applied to the current block; Performing a secondary inverse transform on the current block based on the secondary transform matrix specified by the first syntax element to generate a secondary inverse transformed block; as well as Performing an inverse transformation on the block after the secondary inverse transformation based on the primary transformation matrix of the current block to generate a residual block of the current block, Among them, based on the width and height of the current block being 4, the input length of the secondary inverse transform is determined to be 8, and based on the width and height of the current block being 8, the input length of the secondary inverse transform is determined to be 8.

2. The method according to claim 1, wherein: The secondary transform set includes two secondary transform matrices.

3. The method according to claim 1, further comprising the steps of: parsing a second syntax element comprising information on a primary transform matrix to be applied in order to generate the residual block for the current block; as well as Whether the second inverse transform can be applied to the current block is determined based on the second syntax element.

4. The method according to claim 3, wherein: Based on the second syntax element including information for a predefined specific transform type, it is determined that the secondary inverse transform can be applied to the current block.

5. The method according to claim 4, wherein: The predefined specific transform type is defined as DCT2.

6. The method according to claim 1, wherein: The secondary transform set is determined from among predefined secondary transform sets based on an intra prediction mode of the current block.

7. A method for encoding a video signal, the method comprising the following steps: Get the predicted block of the current block; generating a residual block of the current block based on the prediction block; Performing a transformation on the residual block to obtain a transformed block; and performing a secondary transformation on the first transformed block, The step of performing the secondary transformation comprises the following steps: Determine which secondary transform matrix in the secondary transform set is applied to the block after the primary transform; Applying the determined secondary transform matrix to the first transformed block to obtain a second transformed block; and generating a first syntax element specifying the determined secondary transform matrix in the secondary transform set, Wherein, based on the width and height of the current block being 4, the output length of the secondary transform is determined to be 8, and based on the width and height of the current block being 8, the output length of the secondary transform is determined to be 8.

8. The method according to claim 7, wherein: The secondary transform set includes two secondary transform matrices.

9. The method according to claim 7, further comprising the steps of: generating a second syntax element indicating a primary transform matrix to be applied in order to obtain the primary transformed block; as well as Whether to apply the secondary transform to the first transformed block is determined based on the second syntax element.

10. The method according to claim 9, wherein: Based on the second syntax element including information on a predefined specific transform type, determining to apply the secondary transform to the block after the primary transform, and The predefined specific transform type is limited to DCT2.

11. The method according to claim 7, wherein: The secondary transform set is determined from among predefined secondary transform sets based on an intra prediction mode of the current block.

12. A computer-readable storage medium, wherein: When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor performs a method, the method comprising the following steps: Get the predicted block of the current block; generating a residual block of the current block based on the prediction block; Performing a transformation on the residual block to obtain a transformed block; and performing a secondary transformation on the first transformed block, The step of performing the secondary transformation comprises the following steps: Determine which secondary transform matrix in the secondary transform set is applied to the block after the primary transform; Applying the determined secondary transform matrix to the first transformed block to obtain a second transformed block; and generating a first syntax element specifying the determined secondary transform matrix in the secondary transform set, and Wherein, based on the width and height of the current block being 4, the output length of the secondary transform is determined to be 8, and based on the width and height of the current block being 8, the output length of the secondary transform is determined to be 8.

13. A method for transmitting data, the data comprising a bit stream for an image, the method comprising the following steps: obtaining the bitstream for the image; and sending said data comprising said bit stream, The bitstream is generated by performing the following steps: Get the predicted block of the current block; generating a residual block of the current block based on the prediction block; Performing a transformation on the residual block to obtain a transformed block; and performing a secondary transformation on the first transformed block, The step of performing the secondary transformation comprises the following steps: Determine which secondary transform matrix in the secondary transform set is applied to the block after the primary transform; Applying the determined secondary transform matrix to the first transformed block to obtain a second transformed block; and generating a first syntax element specifying the determined secondary transform matrix in the secondary transform set, and Wherein, based on the width and height of the current block being 4, the output length of the secondary transform is determined to be 8, and based on the width and height of the current block being 8, the output length of the secondary transform is determined to be 8.

Citation Information

Patent Citations

  • Method for encoding / decoding video signal, and apparatus therefor

    CN111742555A