Quadratic transform based video coding method and device

The video coding method employs a reduced secondary transform with a transform kernel matrix tailored to intra prediction modes, addressing the need for efficient compression of high-resolution and immersive media by enhancing transformation efficiency.

JP7727035B2Active Publication Date: 2025-08-20LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024038124
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-12-19
Filing Date
2024-03-12
Publication Date
2025-08-20
Estimated Expiration
2039-12-19

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and immersive media has led to a need for more efficient video coding methods to reduce transmission and storage costs, particularly in compressing and transmitting high-quality image/video data with varying characteristics.

Method used

A video coding method utilizing a reduced secondary transform (RST) with a transform kernel matrix that varies the arrangement of transform coefficients based on the intra prediction mode, optimizing the transformation kernel matrix for improved efficiency.

Benefits of technology

This approach enhances overall image/video compression efficiency by improving the efficiency of secondary transformation and coding, specifically through optimized transform coefficient arrangements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007727035000056
    Figure 0007727035000056
  • Figure 0007727035000057
    Figure 0007727035000057
  • Figure 0007727035000058
    Figure 0007727035000058
Patent Text Reader

Abstract

To relate to a video coding method.SOLUTION: A video coding method comprises: a step for deriving transform coefficients through inverse quantization on the basis of quantized transform coefficients for a target block; a step for deriving modified transform coefficients on the basis of an inverse reduced secondary transform (RST) of the transform coefficients; and a step for generating a reconstructed picture on the basis of residual samples for the target block on the basis of an inverse primary transform of the modified transform coefficients. The inverse RST using a transform kernel matrix is performed on transform coefficients of the upper-left 4×4 region of an 8×8 region of the target block, and the modified transform coefficients of the upper-left 4×4 region, upper-right 4×4 region, and lower-left 4×4 region of the 8×8 region are derived through the inverse RST.SELECTED DRAWING: Figure 10
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This document relates to video coding technology, and more particularly to a transform-based video coding method and apparatus in a video coding system. [Background technology]

[0002] Recently, the demand for high-resolution, high-quality images / videos such as 4K or 8K or higher UHD (Ultra High Definition) images / videos is increasing in various fields. As the resolution and quality of image / video data increases, the amount of information or bits to be transmitted increases relatively compared to existing image / video data. Therefore, when transmitting image data using existing media such as wired or wireless broadband lines or storing image / video data using existing storage media, the transmission and storage costs increase.

[0003] In addition, interest and demand for immersive media such as VR (Virtual Reality), AR (Artificial Reality) content and holograms has been increasing recently, and the broadcast of images / videos with different visual characteristics from real images, such as game images, is increasing.

[0004] Therefore, a highly efficient image / video compression technique is required to effectively compress, transmit, store, and play back high-resolution, high-quality image / video information having the above-mentioned various characteristics. Summary of the Invention [Problem to be solved by the invention]

[0005] The technical problem of this document is to provide a method and apparatus for increasing video coding efficiency.

[0006] Another technical problem of this document is to provide a method and apparatus for increasing conversion efficiency.

[0007] Another technical problem of this document is to provide a video coding method and apparatus based on RST (reduced secondary transform).

[0008] Another technical problem of this document is to provide a method and apparatus for improving the efficiency of secondary transformation by varying the arrangement of transform coefficients depending on the intra prediction mode.

[0009] Another technical problem of this document is to provide a method and apparatus for optimizing a transformation kernel matrix applied to a quadratic transformation to improve the efficiency of the quadratic transformation.

[0010] Another technical problem of this document is to provide a video coding method and apparatus based on a transform set that can increase coding efficiency. [Means for solving the problem]

[0011] According to one embodiment of this document, there is provided a video decoding method executed by a decoding device, the method including the steps of: deriving transform coefficients through inverse quantization based on quantized transform coefficients of a current block; deriving modified transform coefficients based on an inverse reduced secondary transform (RST) using a preset transform kernel matrix for the transform coefficients; deriving residual samples for the current block based on an inverse linear transform of the modified transform coefficients; and generating a reconstructed picture based on the residual samples for the current block, wherein the step of deriving modified transform coefficients includes applying the transform kernel matrix to transform coefficients of an upper-left 4x4 region of an 8x8 region of the current block to derive modified transform coefficients for an upper-left 4x4 region, an upper-right 4x4 region, and a lower-left 4x4 region of the 8x8 region.

[0012] When performing matrix operations on the transform coefficients of the upper left 4x4 area of the 8x8 area and the transform kernel matrix, the transform coefficients of the upper left 4x4 area of the 8x8 area are arranged one-dimensionally in a forward diagonal scanning order.

[0013] After matrix operation with the transformation kernel matrix, the transformation coefficients of the one-dimensional array are arranged two-dimensionally in the upper left 4x4 area, the upper right 4x4 area, and the lower left 4x4 area of the 8x8 area in either a row-major direction or a column-major direction depending on the intra prediction mode applied to the target block.

[0014] According to another embodiment of the present document, there is provided a decoding device for performing video decoding, the decoding device including: an entropy decoding unit that derives quantized transform coefficients and prediction information for a current block from a bitstream; a prediction unit that generates prediction samples for the current block based on the prediction information; an inverse quantization unit that derives transform coefficients through inverse quantization based on the quantized transform coefficients for the current block; an inverse transform unit that includes an inverse RST (reduced secondary transform) unit that derives modified transform coefficients based on an inverse RST for the transform coefficients and an inverse linear transform unit that derives residual samples for the current block based on an inverse linear transform of the modified transform coefficients; and an adder that generates reconstructed samples based on the residual samples and the predicted samples, wherein the inverse RST unit applies the transform kernel matrix to transform coefficients of an upper left 4x4 region of an 8x8 region of the current block to derive modified transform coefficients for an upper left 4x4 region, an upper right 4x4 region, and a lower left 4x4 region of the 8x8 region.

[0015] According to an embodiment of this document, there is provided a video encoding method executed by an encoding apparatus, the method including: deriving prediction samples based on an intra prediction mode applied to a current block, deriving residual samples for the current block based on the prediction samples, deriving transform coefficients for the current block based on a primary transform of the residual samples, deriving modified transform coefficients based on a reduced secondary transform (RST) of the transform coefficients, and performing quantization on the modified transform coefficients to derive quantized transform coefficients, wherein the deriving the modified transform coefficients includes applying the transformation kernel matrix to transform coefficients of an upper left 4x4 region, an upper right 4x4 region, and a lower left 4x4 region of an 8x8 region of the current block to derive modified transform coefficients corresponding to the upper left 4x4 region of the 8x8 region.

[0016] According to another embodiment of the present document, a digital storage medium is provided that stores video data including encoded video information and a bitstream generated by a video encoding method performed by an encoding device.

[0017] According to another embodiment of the present document, there is provided a digital storage medium storing video data including encoded video information and a bitstream that enables a decoding device to perform the video decoding method. [Effects of the Invention]

[0018] According to the document, it can improve overall image / video compression efficiency.

[0019] According to this document, the efficiency of secondary transformation can be improved by varying the arrangement of transform coefficients depending on the intra prediction mode.

[0020] According to this document, video coding can be performed based on a set of transforms to improve video coding efficiency.

[0021] According to this document, the efficiency of the quadratic transformation can be improved by optimizing the transformation kernel matrix applied to the quadratic transformation. [Brief explanation of the drawings]

[0022] [Figure 1] 1 illustrates schematically an example of a video / image coding system to which this document can be applied. [Figure 2] 1 is a diagram illustrating the configuration of a video / image encoding device to which the present document can be applied. [Figure 3] 1 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied. [Figure 4] 1 illustrates a schematic diagram of a multiple conversion technique according to one embodiment of the present document; [Figure 5] An intra-directional mode with 65 prediction directions is shown as an example. [Figure 6] FIG. 1 is a diagram for explaining an RST according to one embodiment of this document. [Figure 7] 1 illustrates a scanning order of transform coefficients according to one embodiment of the present document. [Figure 8] 1 is a flow diagram illustrating a reverse RST process according to one embodiment of the present document. [Figure 9] 1 is a flow chart illustrating the operation of a video decoding device according to one embodiment of the present document. [Figure 10] 1 is a control flow diagram illustrating a reverse RST according to one embodiment of the present document. [Figure 11] 1 is a flow chart illustrating the operation of a video encoding device according to one embodiment of the present document. [Figure 12] 1 is a control flow diagram illustrating RST according to one embodiment of the present document. [Figure 13] 1 illustrates an exemplary structural diagram of a content streaming system to which this document applies. DETAILED DESCRIPTION OF THE INVENTION

[0023] This document may be modified in various ways and may have various embodiments. A specific embodiment will be illustrated in the drawings and described in detail. However, this does not limit this document to the specific embodiment. Common terms used in this document are used merely to describe specific embodiments and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly dictates otherwise. In this specification, the terms "comprise" or "have" specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0024] Meanwhile, each component in the drawings described in this document is shown independently for the convenience of explaining the different characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also included within the scope of this document as long as they do not deviate from the essence of this document.

[0025] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. In the following, the same reference numerals will be used to refer to the same components in the drawings, and redundant descriptions of the same components will be omitted.

[0026] This document relates to video / image coding. For example, methods / embodiments disclosed in this document may be related to the Versatile Video Coding (VVC) standard (ITU-T Rec. H.266), next-generation video / image coding standards beyond VVC, or other video coding-related standards (e.g., the High Efficiency Video Coding (HEVC) standard (ITU-T Rec. H.265), the essential video coding (EVC) standard, the AVS2 standard, etc.).

[0027] This document presents various embodiments relating to video / image coding, and unless otherwise stated, the embodiments may be implemented in combination with each other.

[0028] In this document, video can refer to a collection of a series of images over time. A picture generally refers to a unit that shows one image at a specific time, and a slice / tile is a unit that constitutes part of a picture in coding. A slice / tile can contain one or more coding tree units (CTUs). One picture can be composed of one or more slices / tiles. One picture can be composed of one or more tile groups. One tile group can contain one or more tiles.

[0029] A pixel or pel can refer to the smallest unit that makes up a picture (or image). The term 'sample' can also be used as a term corresponding to a pixel. A sample can generally refer to a pixel or a pixel value, and can refer to only a pixel / pixel value of a luma component, or only a pixel / pixel value of a chroma component. Alternatively, a sample can refer to a pixel value in the spatial domain, or, when such a pixel value is transformed into the frequency domain, can refer to a transform coefficient in the frequency domain.

[0030] A unit may refer to a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. The term unit may be used interchangeably with terms such as block or area. In general, an M×N block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.

[0031] In this document, the terms " / " and "," should be interpreted to mean "and / or." For example, "A / B" means "A and / or B," and "A, B" means "A and / or B." Additionally, "A / B / C" means "at least one of A, B, and / or C." Also, "A, B, C" means "at least one of A, B, and / or C." (In this document, the terms " / " and "," should be interpreted to indicate "and / or." For instance, the expression "A / B" may mean "A and / or B." Further, "A,B" may mean "A and / or B." Further, "A / B / C" may mean "at least one of A, B, and / or C." Also, "A / B / C" may mean "at least one of A, B, and / or C.")

[0032] Additionally, in this document, "or" should be interpreted as "and / or." For example, "A or B" can mean 1) only "A," or 2) only "B," or 3) "A and B." In other words, the term "or" in this document can mean "additionally or alternatively." (Further, in the document, the term "or" should be interpreted to indicate "and / or." For instance, the expression "A or B" may comprise 1) only A, 2) only B, and / or 3) both A and B. In other words, the term "or" in this document should be interpreted to indicate "additionally or alternatively.")

[0033] FIG. 1 illustrates schematically an example of a video / image coding system to which this document can be applied.

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

[0035] The source device may include a video source, an encoding device, and a transmitting unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / video encoding device, and the decoding device may be referred to as a video / video decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, which may be a separate device or an external component.

[0036] A video source can acquire video / images through a video / image capture, synthesis, or generation process. A video source can include a video / image capture device and / or a video / image generation device. A video / image capture device can include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device can include, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate video / images. For example, a virtual video / image can be generated via a computer, etc., in which case the video / image capture process can replace the process of generating related data.

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

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

[0039] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transform, and prediction, which correspond to the operations of the encoding device.

[0040] The renderer can render the decoded video / image, and the rendered video / image can be displayed via a display unit.

[0041] 2 is a diagram for explaining the configuration of a video / image encoding device to which this document can be applied. Hereinafter, the term "video encoding device" may include a video encoding device.

[0042] Referring to FIG. 2, the encoding apparatus 200 may include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image dividing unit 210, the predicting unit 220, the residual processing unit 230, the entropy encoding unit 240, the adding unit 250, and the filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chipset or a processor) depending on the embodiment. Also, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.

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

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

[0045] The subtraction unit 231 may subtract a prediction signal (predicted block, prediction sample, or prediction sample array) output from the prediction unit 220 from an input video signal (original block, original sample, or original sample array) to generate a residual signal (residual block, residual sample, or residual sample array), and the generated residual signal is transmitted to the conversion unit 232. The prediction unit 220 may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including prediction samples for the current block. The prediction unit 220 may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 240, as will be described later in the description of each prediction mode. The prediction information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0046] The intra prediction unit 222 may predict the current block by referring to samples in the current picture. The referenced samples may be located adjacent to or distant from the current block depending on the prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, DC mode and planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the granularity of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction modes applied to neighboring blocks.

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

[0048] The predictor 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may apply intra prediction or inter prediction for prediction of a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for content image / moving image coding, such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described herein.

[0049] The prediction signal generated by the inter prediction unit 221 and / or the intra prediction unit 222 may be used to generate a reconstructed signal or a residual signal. The transform unit 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include a discrete cosine transform (DCT), a discrete sine transform (DST), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, GBT refers to a transform obtained from a graph representing inter-pixel relationship information. 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 pixel blocks having the same square size or non-square blocks of variable sizes.

[0050] The quantization unit 233 quantizes the transform coefficients and transmits them to the entropy encoding unit 240. The entropy encoding unit 240 encodes the quantized signal (information about the quantized transform coefficients) and outputs it as a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantization unit 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit 240 may encode information required for video / image restoration (e.g., values of syntax elements) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / picture information) may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) unit units. The video / picture information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / picture information may also include general constraint information. Signaling / transmitted information and / or syntax elements, which will be described later in this document, may be encoded through the encoding procedure described above and included in the bitstream.The bitstream can be transmitted via a network or stored in a digital storage medium. Here, the network can include a broadcasting network and / or a communication network, and the digital storage medium can include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) for storing the signal can be configured as an internal / external element of the encoding apparatus 200, or the transmitter can be included in the entropy encoding unit 240.

[0051] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. The adder 250 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample, or reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the prediction unit 220. When there is no residual for the current block, such as when skip mode is applied, the predicted block may be used as the reconstructed block. The generated reconstructed signal may be used for intra prediction of the next block to be processed in the current picture, or may be used for inter prediction of the next picture after filtering, as described below.

[0052] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during picture encoding and / or reconstruction.

[0053] The filtering unit 260 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 260 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture and store the modified reconstructed picture in the memory 270, specifically, in the DPB of the memory 270. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset (SAO), an adaptive loop filter, a bilateral filter, etc. The filtering unit 260 may generate various information related to filtering and transmit it to the entropy encoding unit 240, as will be described later in the description of each filtering method. The filtering information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0054] The modified reconstructed picture transmitted to the memory 270 can be used as a reference picture in the inter prediction unit 221. When inter prediction is applied through this, the encoding apparatus can avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus, and can also improve coding efficiency.

[0055] The DPB of the memory 270 may store a modified reconstructed picture to be used as a reference picture in the inter predictor 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter predictor 221 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 222.

[0056] FIG. 3 is a diagram illustrating the configuration of a video / image decoding device to which this document can be applied.

[0057] Referring to FIG. 3, the decoding device 300 may include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter predictor 332 and an intra predictor 331. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. Depending on the embodiment, the entropy decoding unit 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be implemented as a single hardware component (e.g., a decoder chipset or processor). In addition, the memory 360 may include a decoded picture buffer (DPB) and may be implemented as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.

[0058] When a bitstream including video / image information is input, the decoding apparatus 300 can reconstruct an image corresponding to the process in which the video / image information was processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive units / blocks based on block division-related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied by the encoding apparatus. Therefore, the processing unit for decoding is, for example, a coding unit, and the coding unit can be divided into a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the coding unit. The reconstructed image signal decoded and output by the decoding apparatus 300 can be played back via a playback device.

[0059] The decoding apparatus 300 may receive a signal output from the encoding apparatus of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may parse the bitstream to derive information (e.g., video / video information) necessary for image restoration (or picture restoration). The video / video information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / video information may also include general constraint information. The decoding apparatus may decode pictures based on the information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements, which will be described later in this document, may be decoded through the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 310 may decode information in a bitstream based on a coding method such as Exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in the bitstream, determines a context model using information on the syntax element to be decoded, decoding information on neighboring and current blocks, or information on symbols / bins decoded in previous steps, predicts the probability of bin occurrence based on the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element.In this case, after determining a context model, the CABAC entropy decoding method can update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin. Prediction-related information from the information decoded by the entropy decoding unit 310 is provided to the prediction unit 330, and information on the residual on which entropy decoding is performed by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, can be input to the inverse quantization unit 321. In addition, filtering-related information from the information decoded by the entropy decoding unit 310 can be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) that receives a signal output from the encoding apparatus can be further configured as an internal / external element of the decoding apparatus 300, or the receiving unit can be a component of the entropy decoding unit 310. Meanwhile, the decoding apparatus according to this document may be called a video / image / picture decoding apparatus, and the decoding apparatus may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the prediction unit 330, the addition unit 340, the filtering unit 350, and the memory 360.

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

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

[0062] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on information about the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.

[0063] The predictor may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may apply intra prediction or inter prediction for prediction of a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) for prediction of a block. The intra block copy may be used for content image / moving image coding, such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described herein.

[0064] The intra prediction unit 331 may predict a current block by referring to samples in a current picture. The referenced samples may be located adjacent to or distant from the current block depending on the prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.

[0065] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include information on the inter prediction direction (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks in the current picture and temporal neighboring blocks in the reference picture. For example, the inter prediction unit 332 may construct a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index for the current block based on received candidate selection information. Inter prediction may be performed based on various prediction modes, and the prediction information may include information indicating the inter prediction mode for the current block.

[0066] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to the predicted signal (predicted block, predicted sample array) output from the prediction unit 330. When there is no residual for the current block, such as when a skip mode is applied, the predicted block may be used as the reconstructed block.

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

[0068] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during picture decoding.

[0069] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transmit the modified reconstructed picture to the memory 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.

[0070] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter predictor 332. The memory 360 can store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information can be transmitted to the inter predictor 332 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 360 can store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 331.

[0071] In this specification, the embodiments described for the prediction unit 330, inverse quantization unit 321, inverse transform unit 322, and filtering unit 350 of the decoding device 300 can be applied equally or correspondingly to the prediction unit 220, inverse quantization unit 234, inverse transform unit 235, and filtering unit 260 of the encoding device 200, respectively.

[0072] As described above, prediction is performed to improve compression efficiency when performing video coding. Accordingly, a predicted block including predicted samples for a current block, which is a block to be coded, can be generated. Here, the predicted block includes predicted samples in the spatial domain (or pixel domain). The predicted block is derived in the same way by an encoding device and a decoding device. The encoding device signals information (residual information) regarding the residual between the original block and the predicted block, rather than the original sample values of the original block, to the decoding device, thereby improving video coding efficiency. The decoding device derives a residual block including residual samples based on the residual information, combines the residual block with the predicted block to generate a reconstructed block including reconstructed samples, and generates a reconstructed picture including the reconstructed block.

[0073] The residual information may be generated through a transform and quantization procedure. For example, an encoding device may derive a residual block between the original block and the predicted block, perform a transform procedure on residual samples (residual sample array) included in the residual block to derive transform coefficients, and perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and then signal the related residual information (via a bitstream) to a decoding device. Here, the residual information may include information such as value information, position information, transform technique, transform kernel, and quantization parameter of the quantized transform coefficients. The decoding device may perform an inverse quantization / inverse transform procedure based on the residual information to derive residual samples (or residual blocks). The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device may also derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a future picture, and generate a reconstructed picture based on the residual block.

[0074] FIG. 4 shows a schematic diagram of the multiple conversion technique according to this document.

[0075] Referring to Figure 4, the transform unit may correspond to the transform unit in the encoding device of Figure 2 described above, and the inverse transform unit may correspond to the inverse transform unit in the encoding device of Figure 2 described above or the inverse transform unit in the decoding device of Figure 3.

[0076] The transform unit may perform a primary transform based on the residual samples (residual sample array) in the residual block to derive (primary) transform coefficients (S410). Such a primary transform may be called a core transform. Here, the primary transform may be based on Multiple Transform Selection (MTS), and when multiple transforms are applied in the primary transform, it may be called a multiple core transform.

[0077] The multi-kernel transform may refer to a transform method that additionally uses a DCT (Discrete Cosine Transform) Type 2 and a DST (Discrete Sine Transform) Type 7, DCT Type 8, and / or DST Type 1. That is, the multi-kernel transform may refer to a transform method that transforms a spatial domain residual signal (or a residual block) into frequency domain transform coefficients (or primary transform coefficients) based on a plurality of transform kernels selected from the DCT Type 2, the DST Type 7, the DCT Type 8, and the DST Type 1. Here, the primary transform coefficients may be referred to as temporary transform coefficients from the perspective of a transform unit.

[0078] That is, when an existing transform method is applied, a transform coefficient is generated by applying a spatial domain to a frequency domain to a residual signal (or a residual block) based on DCT type 2. In contrast, when the multi-kernel transform is applied, a transform coefficient (or a primary transform coefficient) is generated by applying a spatial domain to a frequency domain to a residual signal (or a residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1, etc. Here, DCT type 2, DST type 7, DCT type 8, DST type 1, etc. may be referred to as transform types, transform kernels, or transform cores.

[0079] For reference, the DCT / DST transform type can be defined based on the basis functions, which are shown in the table below.

[0080] [Table 1]

[0081] When the multi-kernel transform is performed, a vertical transform kernel and a horizontal transform kernel for a current block may be selected from the transform kernels, and a vertical transform for the current block may be performed based on the vertical transform kernel, and a horizontal transform for the current block may be performed based on the horizontal transform kernel. Here, the horizontal transform may indicate a transform for a horizontal component of the current block, and the vertical transform may indicate a transform for a vertical component of the current block. The vertical transform kernel / horizontal transform kernel may be adaptively determined based on a prediction mode and / or a transform index of a current block (CU or sub-block) including a residual block.

[0082] According to one example, when a linear transform is performed by applying MTS, a specific basis function is set to a predetermined value, and when a vertical transform or horizontal transform is performed, a mapping relationship for the transform kernel can be set by combining which basis function is applied. For example, if a horizontal transform kernel is represented by trTypeHor and a vertical transform kernel is represented by trTypeVer, a trTypeHor or trTypeVer value of 0 can be set to DCT2, a trTypeHor or trTypeVer value of 1 can be set to DCT7, and a trTypeHor or trTypeVer value of 2 can be set to DCT8.

[0083] In this case, MTS index information may be encoded and signaled to a decoding device to indicate one of a plurality of transform kernel sets. For example, if the MTS index is 0, it may indicate that the trTypeHor and trTypeVer values are both 0; if the MTS index is 1, it may indicate that the trTypeHor and trTypeVer values are both 1; if the MTS index is 2, it may indicate that the trTypeHor value is 2 and the trTypeVer value is 1; if the MTS index is 3, it may indicate that the trTypeHor value is 1 and the trTypeVer value is 2; and if the MTS index is 4, it may indicate that the trTypeHor and trTypeVer values are both 2.

[0084] The transform unit may perform a secondary transform based on the (primary) transform coefficients to derive modified (secondary) transform coefficients (S420). The primary transform is a transform from the spatial domain to the frequency domain, and the secondary transform is a transform to a more compressed representation using correlations between the (primary) transform coefficients. The secondary transform may include a non-separable transform. In this case, the secondary transform may be referred to as a non-separable secondary transform (NSST) or a mode-dependent non-separable secondary transform (MDNSST). The non-separable secondary transform may refer to a transform that generates modified transform coefficients (or secondary transform coefficients) for a residual signal by performing a secondary transform on the (primary) transform coefficients derived through the primary transform based on a non-separable transform matrix. Here, a transform may be applied to the (primary) transform coefficients simultaneously without separately applying a vertical transform and a horizontal transform (or independently applying a horizontal-vertical transform) based on the non-separable transform matrix. That is, the non-separable quadratic transform may refer to a transform method in which, for example, a two-dimensional signal (transform coefficient) is rearranged into a one-dimensional signal in a specific direction (e.g., row-first or column-first) without separating the vertical and horizontal components of the (first-order) transform coefficients, and then modified transform coefficients (or second-order transform coefficients) are generated based on the non-separable transform matrix. For example, the row-major order arranges the first row, the second row, ..., the Nth row for an MxN block, and the column-major order arranges the first column, the second column, ..., the Mth column for an MxN block. The non-separable quadratic transform may be applied to the top-left region of a block composed of (first-order) transform coefficients (hereinafter referred to as a transform coefficient block).For example, if the width (W) and height (H) of the transform coefficient block are both equal to or greater than 8, an 8x8 non-separable quadratic transform may be applied to the upper left 8x8 region of the transform coefficient block. Also, if the width (W) and height (H) of the transform coefficient block are both equal to or greater than 4 and the width (W) or height (H) of the transform coefficient block is less than 8, a 4x4 non-separable quadratic transform may be applied to the upper left min(8,W) x min(8,H) region of the transform coefficient block. However, embodiments are not limited thereto. For example, even if the only condition that the width (W) or height (H) of the transform coefficient block is both equal to or greater than 4 is satisfied, a 4x4 non-separable quadratic transform may also be applied to the upper left min(8,W) x min(8,H) region of the transform coefficient block.

[0085] Specifically, for example, if a 4x4 input block is used, a non-separable quadratic transform can be performed as follows:

[0086] The 4x4 input block X is given as follows:

[0087]

number

[0088] When X is expressed in vector form, the vector JPEG0007727035000003.jpg84 is shown as follows:

[0089]

number

[0090] As shown in Equation 2, the vector JPEG0007727035000005.jpg84 rearranges the two-dimensional block of X in Equation 1 into a one-dimensional vector in row-first order.

[0091] In this case, the second-order non-separable transform can be calculated as follows:

[0092]

number

[0093] where: JPEG0007727035000007.jpg75 denotes the transform coefficient vector, and T denotes the 16x16 (non-separable) transform matrix.

[0094] 16×1 transform coefficient vector through Equation 3 JPEG0007727035000008.jpg75 can be derived, JPEG0007727035000009.jpg75 can be re-organized into 4x4 blocks via scan order (horizontal, vertical, diagonal, etc.). However, the above calculation is merely an example, and in order to reduce the computational complexity of non-separable quadratic transforms, a Hypercube-Givens Transform (HyGT) or the like can also be used to calculate the non-separable quadratic transform.

[0095] Meanwhile, the non-separable quadratic transform may have a mode-dependent transform kernel (or transform core, transform type), where the mode may include an intra-prediction mode and / or an inter-prediction mode.

[0096] As described above, the non-separable quadratic transform can be performed based on an 8x8 transform or a 4x4 transform determined based on the width (W) and height (H) of the transform coefficient block. The 8x8 transform refers to a transform that can be applied to an 8x8 region contained within a corresponding transform coefficient block when W and H are both equal to or greater than 8, and the corresponding 8x8 region is the upper left 8x8 region within the corresponding transform coefficient block. Similarly, the 4x4 transform refers to a transform that can be applied to a 4x4 region contained within a corresponding transform coefficient block when W and H are both equal to or greater than 4, and the corresponding 4x4 region is the upper left 4x4 region within the corresponding transform coefficient block. For example, an 8x8 transform kernel matrix can be a 64x64 / 16x64 matrix, and a 4x4 transform kernel matrix can be a 16x16 / 8x16 matrix.

[0097] In this case, due to the mode-based transform kernel selection, three non-separable quadratic transform kernels may be configured per transform set for the non-separable quadratic transform for both the 8x8 transform and the 4x4 transform, resulting in 35 transform sets. That is, 35 transform sets may be configured for the 8x8 transform, and 35 transform sets may be configured for the 4x4 transform. In this case, each of the 35 transform sets for the 8x8 transform may include three 8x8 transform kernels, and each of the 35 transform sets for the 4x4 transform may include three 4x4 transform kernels. However, the transform sizes, the number of sets, and the number of transform kernels in each set are merely examples, and sizes other than 8x8 or 4x4 may be used. Alternatively, n sets may be configured, each containing k transform kernels.

[0098] The transform set may be referred to as an NSST set, and the transform kernels in the NSST set may be referred to as NSST kernels. Selection of a particular set from the transform set may be performed based on, for example, the intra prediction mode of the current block (CU or sub-block).

[0099] For reference, for example, the intra prediction modes may include two non-directional (or non-angular) intra prediction modes and 65 directional (or angular) intra prediction modes. The non-directional intra prediction modes may include a planar intra prediction mode numbered 0 and a DC intra prediction mode numbered 1, and the directional intra prediction modes may include 65 intra prediction modes numbered 2 to 66. However, this is merely an example, and this document may also be applied to cases where the number of intra prediction modes is different. Meanwhile, in some cases, a 67th intra prediction mode may also be used, and the 67th intra prediction mode may indicate a linear model (LM) mode.

[0100] FIG. 5 exemplarily shows the intra-directional modes of 65 prediction directions.

[0101] Referring to FIG. 5, intra prediction modes having horizontal directionality and intra prediction modes having vertical directionality can be distinguished with respect to the 34th intra prediction mode, which has a left-up diagonal prediction direction. H and V in FIG. 5 represent horizontal and vertical directionality, respectively, and the numbers -32 to 32 indicate displacements in 1 / 32 units on the sample grid position. This may indicate an offset to the mode index value. Intra prediction modes 2 to 33 have horizontal directionality, and intra prediction modes 34 to 66 have vertical directionality. Meanwhile, the 34th intra prediction mode can be considered to have neither horizontal nor vertical directionality, strictly speaking, but can be classified as belonging to the horizontal direction in terms of determining the transform set for the secondary transform. This is because input data is transposed for vertical modes symmetrical with respect to the 34th intra prediction mode, and the 34th intra prediction mode uses the input data alignment method for horizontal modes. Transposing the input data means that rows of MxN 2D block data become columns and columns become rows to form NxM data. The 18th and 50th intra prediction modes indicate a horizontal intra prediction mode and a vertical intra prediction mode, respectively. The 2nd intra prediction mode predicts in an upper-right direction using a left reference pixel and can be called an upper-right diagonal intra prediction mode. Similarly, the 34th intra prediction mode can be called a lower-right diagonal intra prediction mode, and the 66th intra prediction mode can be called a lower-left diagonal intra prediction mode.

[0102] In this case, the mapping between the 35 transform sets and the intra prediction modes is shown in the following table, for example: For reference, when the LM mode is applied to the current block, no secondary transform is applied to the current block.

[0103] [Table 2]

[0104] On the other hand, if it is determined that a specific set is to be used, one of k transform kernels in the specific set can be selected through a non-separable secondary transform index. The encoding device can derive a non-separable secondary transform index that indicates a specific transform kernel based on a rate-distortion (RD) check and signal the non-separable secondary transform index to a decoding device. The decoding device can select one of k transform kernels in the specific set based on the non-separable secondary transform index. For example, an NSST index value of 0 can indicate the first non-separable secondary transform kernel, an NSST index value of 1 can indicate the second non-separable secondary transform kernel, and an NSST index value of 2 can indicate the third non-separable secondary transform kernel. Alternatively, an NSST index value of 0 can indicate that the first non-separable secondary transform is not applied to the current block, and NSST index values of 1 to 3 can indicate the three transform kernels.

[0105] 4, the transform unit may perform the non-separable quadratic transform based on the selected transform kernel to obtain modified (quadratic) transform coefficients. The modified transform coefficients may be derived as quantized transform coefficients via the quantizer, as described above, and may be encoded and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit in the encoding device.

[0106] On the other hand, when the secondary transform is omitted as described above, the (primary) transform coefficients, which are the output of the primary (separate) transform, can be derived as quantized transform coefficients through a quantization unit as described above, encoded, signaled to a decoding device, and transmitted to an inverse quantization / inverse transform unit within the encoding device.

[0107] The inverse transform unit may perform a series of steps in the reverse order of the steps performed by the transform unit described above. The inverse transform unit may receive (dequantized) transform coefficients, perform a secondary (inverse) transform to derive (primary) transform coefficients (S450), and perform a primary (inverse) transform on the (primary) transform coefficients to obtain residual blocks (residual samples) (S460). Here, the primary transform coefficients may be referred to as modified transform coefficients from the inverse transform unit's perspective. As described above, the encoding and decoding devices may generate reconstructed blocks based on the residual blocks and predicted blocks, and generate reconstructed pictures based on the reconstructed blocks.

[0108] Meanwhile, the decoding apparatus may further include a secondary inverse transform application determining unit (or an element determining whether to apply the secondary inverse transform) and a secondary inverse transform determining unit (or an element determining the secondary inverse transform). The secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform. For example, the secondary inverse transform is NSST or RST, and the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on a secondary transform flag parsed from the bitstream. As another example, the secondary inverse transform application determining unit may determine whether to apply the secondary inverse transform based on transform coefficients of the residual block.

[0109] The secondary inverse transform decision unit may determine a secondary inverse transform. In this case, the secondary inverse transform decision unit may determine a secondary inverse transform to be applied to a current block based on an NSST (or RST) transform set designated by an intra prediction mode. In addition, as an embodiment, the secondary transform decision method may be determined depending on the primary transform decision method. Various combinations of primary transform and secondary transform may be determined depending on the intra prediction mode. In addition, as an example, the secondary inverse transform decision unit may determine an area to which the secondary inverse transform is applied based on the size of the current block.

[0110] On the other hand, as described above, if the second-order (inverse) transform is omitted (dequantized), a residual block (residual sample) can be obtained by receiving transform coefficients and performing the first-order (separate) inverse transform. As described above, the encoding device and the decoding device can generate a reconstructed block based on the residual block and a predicted block, and generate a reconstructed picture based on the reconstructed block.

[0111] On the other hand, in this paper, in order to reduce the computational complexity and memory requirements due to non-separable secondary transforms, the RST (reduced secondary transform) can be applied, in which the size of the transformation matrix (kernel) is reduced using the concept of NSST.

[0112] Meanwhile, the coefficients constituting the transform kernel, transform matrix, and transform kernel matrix described herein, i.e., kernel coefficients or matrix coefficients, can be expressed in 8 bits. This is one condition for implementation in a decoding device and an encoding device, and it can reduce the memory requirements for storing the transform kernel with a reasonably acceptable performance degradation compared to the existing 9-bit or 10-bit. In addition, by expressing the kernel matrix in 8 bits, a small multiplier can be used and it is more compatible with SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.

[0113] In this specification, RST may refer to a transformation performed on residual samples of a target block based on a transform matrix whose size is reduced by a simplification factor. When a simplified transformation is performed, the amount of calculation required during the transformation can be reduced due to the reduction in the size of the transform matrix. That is, RST can be used to solve the computational complexity problem that occurs during the transformation of a large block or a non-separable transformation.

[0114] The RST may be called by various terms such as a reduced transform, a reduced transform, a reduced secondary transform, a reduction transform, a simplified transform, a simple transform, etc., and the names used to refer to the RST are not limited to the examples listed. Alternatively, the RST is also called an LFNST (Low-Frequency Non-Separable Transform) because it is mainly performed in the low-frequency domain including non-zero coefficients in the transform block.

[0115] On the other hand, when the second-order inverse transform is performed based on an RST, the inverse transform unit 235 of the encoding apparatus 200 and the inverse transform unit 322 of the decoding apparatus 300 may include an inverse RST unit that derives modified transform coefficients based on the inverse RST for the transform coefficients, and an inverse linear transform unit that derives residual samples for the current block based on an inverse linear transform for the modified transform coefficients. The inverse linear transform refers to the inverse transform of the linear transform applied to the residual. In this document, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying the corresponding transform.

[0116] FIG. 6 is a diagram illustrating an RST according to an embodiment of the present document.

[0117] In this specification, the term "current block" may refer to a current block or a residual block on which coding is performed.

[0118] In an RST according to one embodiment, an N-dimensional vector may be mapped to an R-dimensional vector located in another space to determine a reduced transformation matrix, where R is smaller than N. N may represent the square of the length of one side of a block to which a transformation is applied or the total number of transformation coefficients corresponding to the block to which a transformation is applied, and the simplification factor may represent an R / N value. The simplification factor may also be referred to by various terms such as a reduced factor, reduction factor, simplified factor, or simple factor. Meanwhile, R may be referred to as a reduced coefficient, but in some cases, the simplification factor may also represent R. In other cases, the simplification factor may also represent an N / R value.

[0119] In one embodiment, the simplification factors or simplification coefficients may be signaled via a bitstream, but the embodiment is not limited thereto. For example, predefined values for the simplification factors or simplification coefficients may be stored in each encoding device 200 and decoding device 300, in which case the simplification factors or simplification coefficients may not be separately signaled.

[0120] The size of the simplified transformation matrix according to an embodiment is R×N, which is smaller than the size N×N of the normal transformation matrix, and can be defined as Equation 4 below.

[0121]

number

[0122] The matrix T in the Reduced Transform block shown in (a) of Figure 6 is the matrix T in Equation 4. R×N As shown in FIG. 6(a), the simplified transformation matrix T R×N are multiplied, the transform coefficients for the current block can be derived.

[0123] In one embodiment, when the size of the block to which the transform is applied is 8x8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to (a) of Figure 6 can be expressed by the matrix operation shown in Equation 5 below. In this case, the memory and multiplication operations can be reduced to approximately 1 / 4 due to the simplification factor.

[0124] A matrix operation in this document can be understood as an operation in which a matrix is placed to the left of a column vector and multiplied by the column vector to obtain the column vector.

[0125]

number

[0126] In Equation 5, r1 to r 64 can represent a residual sample for the target block, and more specifically, is a transform coefficient generated by applying a linear transform. As a result of the calculation of Equation 5, the transform coefficient c for the target block is i can be derived, and c i The derivation process is as shown in Equation 6.

[0127]

number

[0128] The calculation result of Equation 6 is the transform coefficients c1 to c2 for the target block. R That is, when R=16, the transform coefficients c1 to c2 for the current block can be derived. 16 can be derived. If a regular transform, rather than RST, is applied and a transform matrix of size 64×64 (N×N) is multiplied by residual samples of size 64×1 (N×1), 64 (N) transform coefficients for the current block are derived. However, because RST is applied, only 16 (R) transform coefficients for the current block are derived. Since the total number of transform coefficients for the current block is reduced from N to R, the amount of data transmitted from the encoding apparatus 200 to the decoding apparatus 300 is reduced, thereby improving transmission efficiency between the encoding apparatus 200 and the decoding apparatus 300.

[0129] Considering the size of the transformation matrix, the size of the normal transformation matrix is 64x64 (NxN), while the size of the simplified transformation matrix is reduced to 16x64 (RxN). Therefore, compared to performing normal transformation, memory usage can be reduced by R / N when performing RST. Also, compared to the number of multiplication operations (NxN) when using the normal transformation matrix, the number of multiplication operations can be reduced by R / N when using the simplified transformation matrix (RxN).

[0130] In one embodiment, the transform unit 232 of the encoding apparatus 200 may derive transform coefficients for the current block by performing a primary transform and an RST-based secondary transform on residual samples for the current block. These transform coefficients may be transmitted to an inverse transform unit 322 of the decoding apparatus 300, and the inverse transform unit 322 of the decoding apparatus 300 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) on the transform coefficients and derive residual samples for the current block based on an inverse primary transform on the modified transform coefficients.

[0131] Inverse RST matrix T according to one embodiment N×R The size of the simplified transformation matrix T R×N It is in a transpose relationship with

[0132] The matrix T in the Reduced Inverse Transform block shown in Figure 6(b) t is the inverse RST matrix T R×N T (The superscript T means transpose.) As shown in FIG. 6(b), the inverse RST matrix T R×N T When the inverse RST matrix T is multiplied, modified transform coefficients for the current block or residual samples for the current block can be derived. R×N T (T R×N ) T N×R It can also be expressed as

[0133] More specifically, when the inverse RST is applied to the secondary inverse transform, the inverse RST matrix T R×N TWhen the transform coefficients for the current block are multiplied by the inverse RST matrix TR×NT, modified transform coefficients for the current block can be derived. Alternatively, an inverse RST can be applied to an inverse linear transform, in which case residual samples for the current block can be derived when the transform coefficients for the current block are multiplied by the inverse RST matrix TR×NT.

[0134] In one embodiment, when the size of the block to which the inverse transform is applied is 8x8 and R=16 (i.e., R / N=16 / 64=1 / 4), the RST according to (b) of FIG. 6 can be expressed by a matrix operation as shown in Equation 7 below.

[0135]

number

[0136] In Equation 7, c1 to c 16 The result of the calculation of Equation 7 is r, which indicates the modified transform coefficients for the current block or the residual samples for the current block. j can be derived, and r j The derivation process is as shown in Equation 8.

[0137]

number

[0138] The calculation result of Equation 8 is r1 to r2, which indicate the modified transform coefficients for the target block or the residual samples for the target block. Ncan be derived. Considering the size of the inverse transformation matrix, the size of a normal inverse transformation matrix is 64 x 64 (N x N), whereas the size of the simplified inverse transformation matrix is reduced to 64 x 16 (N x R). Therefore, compared to performing a normal inverse transformation, memory usage when performing inverse RST can be reduced by a ratio of R / N. Also, compared to the number of multiplication operations (N x N) when using a normal inverse transformation matrix, the number of multiplication operations can be reduced by a ratio of R / N (N x R) when using a simplified inverse transformation matrix.

[0139] Meanwhile, the transform set configuration shown in Table 2 can also be applied to an 8x8 RST. That is, the corresponding 8x8 RST can be applied according to the transform set in Table 2. Since one transform set is composed of two or three transforms (kernels) depending on the intra-frame prediction mode, it can be configured to select one of up to four transforms, including the case where a secondary transform is not applied. When a secondary transform is not applied, the transform can be considered to have been applied with an identity matrix. If the four transforms are assigned indices 0, 1, 2, and 3 (for example, index 0 can be assigned to the identity matrix, i.e., when a secondary transform is not applied), a syntax element called an NSST index can be signaled for each transform coefficient block to specify the transform to be applied. That is, an 8x8 NSST can be specified for an 8x8 upper left block via the NSST index, and an 8x8 RST can be specified in the RST configuration. 8x8 NSST and 8x8 RST refer to transformations that can be applied to an 8x8 region contained within a transform coefficient block when W and H of the target block to be transformed are both equal to or greater than 8, and the corresponding 8x8 region is the upper left 8x8 region within the target block. Similarly, 4x4 NSST and 4x4 RST refer to transformations that can be applied to a 4x4 region contained within a transform coefficient block when W and H of the target block are both equal to or greater than 4, and the corresponding 4x4 region is the upper left 4x4 region within the target block.

[0140] Meanwhile, when the (forward) 8x8 RST as shown in Equation 4 is applied, 16 valid transform coefficients are generated, so that 64 input data constituting an 8x8 region can be seen as being reduced to 16 output data. In terms of a two-dimensional region, only about 1 / 4 of the region is filled with valid transform coefficients. Therefore, the 16 output data obtained by applying the forward 8x8 RST are, for example, the upper left region of the block in FIG. 7 (the 1st to 16th transform coefficients, i.e., c1, c2, ..., c obtained through Equation 6). 16 ) can be filled by diagonal scanning order from 1 to 16.

[0141] 7 shows a scanning order of transform coefficients according to one embodiment of the present disclosure. As described above, if the forward scan order starts from 1, the backward scan can be performed from 64th to 17th in the forward scan order in the direction and order indicated by the arrows in FIG. 7.

[0142] 7, the 4x4 region in the upper left is a ROI (Region of Interest) region filled with valid transform coefficients, and the remaining regions are empty, which can be filled with 0 values by default.

[0143] That is, when an 8x8 RST having a forward transform matrix of 16x64 is applied to an 8x8 region, the output transform coefficients are arranged in the upper left 4x4 region, and the regions where no output transform coefficients exist can be filled with 0s (from the 64th to the 17th) following the scan order in Figure 7.

[0144] If a valid non-zero transform coefficient is found outside the ROI region of Figure 7, it is certain that the 8x8 RST will not be applied, and therefore the corresponding NSST index coding can be omitted. On the other hand, if a non-zero transform coefficient is not found outside the ROI region of Figure 7 (e.g., when the 8x8 RST is applied, the transform coefficients for the region outside the ROI are set to 0), it is possible that the 8x8 RST has been applied, and therefore the NSST index can be coded. Such conditional NSST index coding can be performed after the residual coding process, since it is necessary to check for the presence or absence of a non-zero transform coefficient.

[0145] This document deals with the design of RSTs and related optimization methods that can be applied to 4x4 blocks from the RST structure described in this embodiment. Of course, some concepts can be applied not only to 4x4 RSTs, but also to 8x8 RSTs or other types of transformations.

[0146] FIG. 8 is a flow diagram illustrating a reverse RST process according to one embodiment of the present document.

[0147] Each step disclosed in Fig. 8 may be performed by the decoding apparatus 300 disclosed in Fig. 3. More specifically, S800 may be performed by the inverse quantization unit 321 disclosed in Fig. 3, and S810 and S820 may be performed by the inverse transform unit 322 disclosed in Fig. 3. Therefore, detailed description that overlaps with the description above in Fig. 3 will be omitted or simplified. Meanwhile, in this document, RST may refer to a transform applied in the forward direction, and inverse RST may refer to a transform applied in the inverse direction.

[0148] In one embodiment, the detailed operations of the inverse RST are substantially similar to those of the inverse RST, except that the order of the detailed operations is the opposite. Therefore, a person skilled in the art can easily understand that the description of S800 to S820 for the inverse RST described below can be applied to the RST in the same or similar manner.

[0149] The decoding apparatus 300 according to an embodiment may derive transform coefficients by performing inverse quantization on quantized transform coefficients for a current block (S800).

[0150] Meanwhile, the decoding apparatus 300 may determine whether to apply the inverse secondary transform after the inverse primary transform and before the inverse secondary transform. For example, the inverse secondary transform may be NSST or RST. As one example, the decoding apparatus may determine whether to apply the inverse secondary transform based on a secondary transform flag parsed from the bitstream. As another example, the decoding apparatus may determine whether to apply the inverse secondary transform based on the transform coefficients of the residual block.

[0151] The decoding apparatus 300 may also determine an inverse secondary transform. In this case, the decoding apparatus 300 may determine an inverse secondary transform to be applied to the current block based on an NSST (or RST) transform set specified by the intra prediction mode. In one embodiment, a secondary transform determination method may be determined depending on a primary transform determination method. For example, it may be determined that RST or LFNST is applied only when DCT-2 is applied as a transform kernel in the primary transform. Alternatively, various combinations of primary and secondary transforms may be determined depending on the intra prediction mode.

[0152] For example, before determining the inverse quadratic transform, the decoding apparatus 300 may determine the area to which the inverse quadratic transform is applied based on the size of the current block.

[0153] A decoding apparatus 300 according to an embodiment may select a transform kernel (S810). More specifically, the decoding apparatus 300 may select the transform kernel based on at least one of a transform index, a width and height of a region to which the transform is applied, an intra prediction mode used in video decoding, and information on a color component of a current block. However, the embodiment is not limited thereto. For example, the transform kernel may be predefined, and separate information for selecting the transform kernel may not be signaled.

[0154] In one example, information on the hue component of a target block may be indicated via CIdx. If the target block is a luma block, CIdx may indicate 0. If the target block is a chroma block, e.g., a Cb block or a Cr block, CIdx may indicate a non-zero value (e.g., 1).

[0155] The decoding apparatus 300 according to an embodiment may apply an inverse RST to the transform coefficients based on the selected transform kernel and reduced factor (S820).

[0156] Hereinafter, an embodiment of this document will propose a method for determining a secondary NSST set, i.e., a secondary transform set or transform set, taking into account an intra prediction mode and a block size.

[0157] As an example, by configuring a set for a current transform block based on the intra prediction mode described above, it is possible to apply a transform set configured with transform kernels of various sizes to the transform block. The transform sets in Table 3 are represented by numbers 0 to 3, as shown in Table 4.

[0158] [Table 3]

[0159] [Table 4]

[0160] The indexes 0, 2, 18, and 34 shown in Table 3 correspond to 0, 1, 2, and 3, respectively, in Table 4. In Tables 3 and 4, only four transform sets are used instead of 35 transform sets, which can significantly reduce memory space.

[0161] Also, the number of various transformation kernel matrices that can be included in each transformation set can be set as shown in the following table.

[0162] [Table 5]

[0163] [Table 6]

[0164] [Table 7]

[0165] Table 5 shows that for each transform set, two available transform kernels are used, resulting in transform indices ranging from 0 to 2.

[0166] According to Table 6, two available transform kernels are used for transform set 0, i.e., the transform set for DC mode and planar mode among intra prediction modes, and one transform kernel is used for each of the remaining transform sets. In this case, the available transform indexes for transform set 1 are 0 to 2, and the transform indexes for the remaining transform sets 1 to 3 are 0 to 1.

[0167] In Table 7, one available transform kernel is used for each transform set, so that the transform index ranges from 0 to 1.

[0168] Meanwhile, in the transform set mapping of Table 3, four transform sets can be used in total, and the four transform sets can be rearranged as shown in Table 4 so as to be divided into indexes of 0, 1, 2, and 3. Tables 8 and 9 below exemplarily show four transform sets that can be used for secondary transform, where Table 8 shows a transform kernel matrix that can be applied to an 8x8 block, and Table 9 shows a transform kernel matrix that can be applied to a 4x4 block. Tables 8 and 9 are configured with two transform kernel matrices per transform set, and two transform kernel matrices can be applied to all intra prediction modes as shown in Table 5.

[0169] [Table 8-1]

[0170] [Table 8-2]

[0171] [Table 8-3]

[0172] [Table 8-4]

[0173] [Table 8-5]

[0174] [Table 8-6]

[0175]

Table 8-7

[0176]

Table 8-8

[0177]

Table 9-1

[0178]

Table 9-2

[0179]

Table 9-3

[0180]

Table 9-4

[0181]

Table 9-5

[0182]

Table 9-6

[0183]

Table 9-7

[0184]

Table 9-8

[0185] The transformation kernel matrix examples shown in Table 8 are all transformation kernel matrices multiplied by a scaling value of 128. In the g_aiNsst8x8[N1][N2]

[16]

[64] array appearing in the matrix array of Table 8, N1 indicates the number of transformation sets (N1 is 4 or 35, divided into indexes 0, 1, ..., N1-1), N2 indicates the number of transformation kernel matrices that make up each transformation set (1 or 2), and

[16]

[64] indicates a 16x64 Reduced Secondary Transform (RST).

[0186] When any transformation set is composed of one transformation kernel matrix as in Tables 3 and 4, either the first or second transformation kernel matrix can be used for the corresponding transformation set in Table 8.

[0187] When the corresponding RST is applied, 16 transform coefficients are output, but if only an mx64 portion of the 16x64 matrix is applied, only m transform coefficients are output. For example, by setting m=8 and multiplying only the top 8x64 matrix to output only 8 transform coefficients, the amount of calculation can be reduced by half. To reduce the worst-case calculation amount, an 8x64 matrix can be applied to an 8x8 transform unit (TU).

[0188] In this way, an m×64 transformation matrix (m≦16, for example, the transformation kernel matrix in Table 8) that can be applied to an 8×8 region receives 64 input data and generates m coefficients. That is, when 64 data constitute a 64×1 vector as shown in Equation 5, the m×1 vector is generated by sequentially multiplying the m×64 matrix and the 64×1 vector. In this case, the 64 data constituting the 8×8 region can be properly arranged to form a 64×1 vector. For example, the data can be arranged in the order of the indexes shown at each position of the 8×8 region as shown in Table 10 below.

[0189] [Table 10]

[0190] As shown in Table 10, the data arrangement in an 8x8 region for a secondary transform is in row-major order. This refers to the order in which two-dimensional data is arranged in one dimension for a secondary transform, specifically, for RST or LFNST, and this can be applied to a forward secondary transform performed in an encoding device. Therefore, in an inverse secondary transform performed in an inverse transform unit of an encoding device or an inverse transform unit of a decoding device, the transform coefficients generated as a result of the transform, i.e., the first-order transform coefficients, can be arranged in two dimensions as shown in Table 10.

[0191] Meanwhile, when the prediction modes in a screen are configured with 67 modes as shown in FIG. 5, all directional modes (2 to 66) are configured symmetrically around mode 34. That is, mode (2+n) is symmetrical with mode (66-n) around mode 34 in terms of prediction direction (0≦n≦31). Therefore, when the data arrangement order for configuring a 64×1 input vector for mode (2+n), i.e., modes 2 to 33, is row-major as shown in Table 10, a 64×1 input vector can be configured for mode (66-n) in the order shown in Table 11.

[0192] [Table 11]

[0193] As shown in Table 11, the data arrangement in an 8x8 region for a secondary transform is in column-major order. This refers to the order in which two-dimensional data is arranged in one dimension for a secondary transform, specifically, for RST or LFNST, and this can be applied to a forward secondary transform performed in an encoding device. Therefore, in an inverse secondary transform performed in an inverse transform unit of an encoding device or an inverse transform unit of a decoding device, the transform coefficients generated as a result of the transform, i.e., the first-order transform coefficients, can be arranged in two dimensions as shown in Table 11.

[0194] Table 11 shows that for the (66-n)th mode, that is, the 35th to 66th modes, a 64x1 input vector can be configured in a column-major direction order.

[0195] To summarize, the input data is symmetrically arranged in a row-major order for the (2+n)th mode, and in a column-major order for the (66-n)th mode (0≦n≦31), and the same transform kernel matrix as shown in Table 8 can be applied. Tables 5 to 7 show examples of how the transform kernel matrix is applied for each mode. In this case, either the planar mode (intra prediction mode 0), the DC mode (intra prediction mode 1), or the intra prediction mode 34 can be arranged in a row-major order as shown in Table 10. For example, the input data can be arranged in a row-major order for the intra prediction mode 34 as shown in Table 10.

[0196] As another example, the transformation kernel matrix examples presented in Table 9 that can be applied to a 4x4 region are all transformation kernel matrices multiplied by a scaling value of 128. In the g_aiNsst4x4[N1][N2]

[16]

[64] array appearing in the matrix array of Table 9, N1 indicates the number of transform sets (N1 is 4 or 35, divided into indexes 0, 1, ..., N1-1), N2 indicates the number of transformation kernel matrices that make up each transform set (1 or 2), and

[16]

[16] indicates a 16x16 transformation.

[0197] When any transformation set is composed of one transformation kernel matrix as in Tables 3 and 4, either the first or second transformation kernel matrix can be used for the corresponding transformation set in Table 9.

[0198] As with the 8x8 RST, if only an mx16 portion of the 16x16 matrix is used, only m transform coefficients can be output. For example, instead of multiplying only the top 8x16 matrix by m=8 and outputting only 8 transform coefficients, the computational effort can be reduced by half. To reduce the worst-case computational effort, an 8x16 matrix can be applied to a 4x4 transform unit (TU).

[0199] Basically, the transformation kernel matrix that can be applied to the 4x4 region shown in Table 9 is applied to 4x4 TUs, 4xM TUs, and Mx4 TUs (in the case of M>4, 4xM TUs, and Mx4 TUs, the specified transformation kernel matrix is applied to each 4x4 region, or it can be applied only to the upper left 4x8 or 8x4 region), or it can be applied only to the upper left 4x4 region. If the secondary transformation is configured to be applied only to the upper left 4x4 region, the transformation kernel matrix that can be applied to the 8x8 region shown in Table 8 becomes unnecessary.

[0200] In this way, an m×64 transformation matrix (m≦16, for example, the transformation kernel matrix in Table 9) that can be applied to a 4×4 region receives 16 input data and generates m coefficients. That is, when 16 data constitute a 16×1 vector, the m×16 matrix and the 16×1 vector are multiplied in order to generate the m×1 vector. In this case, the 16 data constituting the 4×4 region can be properly arranged to form a 16×1 vector. For example, the data can be arranged in the order of the indexes shown at each position of the 4×4 region, as shown in Table 12 below.

[0201] [Table 12]

[0202] As shown in Table 12, the data arrangement in a 4x4 region for a secondary transform is in row-major order. This refers to the order in which two-dimensional data is arranged in one dimension for a secondary transform, specifically, for RST or LFNST, and this can be applied to a forward secondary transform performed in an encoding device. Therefore, in an inverse secondary transform performed in an inverse transform unit of an encoding device or an inverse transform unit of a decoding device, transform coefficients generated as a result of the transform, i.e., first-order transform coefficients, can be arranged in two dimensions as shown in Table 12.

[0203] Meanwhile, when the number of prediction modes in a screen is 67 as shown in Fig. 5, all directional modes (2 to 66) are configured symmetrically around the 34th mode. That is, the (2+n)th mode is symmetrical with the (66-n)th mode around the 34th mode in the prediction direction aspect (0≦n≦31). Therefore, when the data arrangement order for configuring a 16×1 input vector for the (2+n)th mode, i.e., modes 2 to 33, is row-major as shown in Table 12, a 16×1 input vector can be configured in order for the (66-n)th mode as shown in Table 13.

[0204] [Table 13]

[0205] As shown in Table 13, the data arrangement in a 4x4 region for a secondary transform is in column-major order. This refers to the order in which two-dimensional data is arranged in one dimension for a secondary transform, specifically, for RST or LFNST, and this can be applied to a forward secondary transform performed in an encoding device. Therefore, in an inverse secondary transform performed in an inverse transform unit of an encoding device or an inverse transform unit of a decoding device, transform coefficients generated as a result of the transform, i.e., first-order transform coefficients, can be arranged in two dimensions as shown in Table 13.

[0206] Table 13 shows that for the intra-frame prediction mode (66-n) mode, that is, modes 35 to 66, a 16x1 input vector can be configured in a column-major direction order.

[0207] To summarize, the input data is symmetrically arranged in a row-major order for the (2+n)th mode, and in a column-major order for the (66-n)th mode (0≦n≦31), and the same transform kernel matrix as shown in Table 9 can be applied. Tables 5 to 7 show examples of how the transform kernel matrix is applied for each mode. In this case, either the planar mode (intra prediction mode 0), the DC mode (intra prediction mode 1), or the intra prediction mode 34 can be arranged in a row-major order as shown in Table 12. For example, the input data can be arranged in a row-major order for the intra prediction mode 34 as shown in Table 12.

[0208] Meanwhile, according to another embodiment of the present document, it is possible to select only 48 pieces of data to apply a maximum 16×48 transformation kernel matrix to 64 pieces of data constituting an 8×8 region, instead of the maximum 16×64 transformation kernel matrix of Tables 8 and 9. Here, "maximum" means that the maximum value of m is 16 for an m×48 transformation kernel matrix that can generate m coefficients.

[0209] The 16×48 transformation kernel matrix according to this embodiment can be shown as in Table 14.

[0210] [Table 14-1]

[0211] [Table 14-2]

[0212] [Table 14-3]

[0213] [Table 14-4]

[0214] [Table 14-5]

[0215] [Table 14-6]

[0216] [Table 14-7]

[0217] [Table 14-8]

[0218] When RST is performed by applying an m×48 transformation kernel matrix (m≦16) to an 8×8 region, 48 data inputs can be used to generate m coefficients. Table 14 shows an example of a transformation kernel matrix when m is 16, which generates 16 coefficients when 48 data inputs are used. That is, if 48 data constitute a 48×1 vector, a 16×1 vector can be generated by sequentially multiplying a 16×48 matrix and the 48×1 vector. In this case, a 48×1 vector can be constructed by properly arranging the 48 data constituting the 8×8 region, and the input data can be arranged in the following order:

[0219] [Table 15]

[0220] During RST, when a matrix operation is performed by applying a maximum 16x48 transform kernel matrix as shown in Table 14, 16 modified transform coefficients are generated, and the 16 modified transform coefficients can be arranged in the upper left 4x4 area according to the scanning order, and the upper right 4x4 area and the lower left 4x4 area can be filled with 0. Table 16 shows an example of the arrangement order of 16 modified transform coefficients generated through the matrix operation.

[0221] [Table 16]

[0222] As shown in Table 16, the modified transform coefficients generated when applying a maximum 16x48 transform kernel matrix can be filled in the upper left 4x4 region according to the scanning order. In this case, the numbers at each position in the upper left 4x4 region indicate the scanning order. Typically, the coefficient generated by performing an inner product operation between the top row of the 16x48 transform kernel matrix and a 48x1 input column vector is the first in the scanning order. In this case, the direction of descending to the lower rows can coincide with the scanning order. For example, the coefficient generated by performing an inner product operation between a 48x1 input column vector and the nth row from the top is the nth in the scanning order.

[0223] In the case of a maximum 16x48 transformation kernel matrix, the 4x4 area in the lower right of Table 16 is an area to which the secondary transformation is not applied, so the original input data (first-order transformation coefficients) are preserved as is, and the 4x4 area in the upper right and the 4x4 area in the lower left are filled with 0s.

[0224] Also, according to other embodiments, other scanning orders may be applied in addition to the scanning orders presented in Table 16. For example, a row-major direction or a column-major direction may be applied as the scanning order.

[0225] In addition, even when a 16x64 transform kernel matrix such as that shown in Table 8 is applied, 16 transform coefficients are generated, and the 16 transform coefficients can be arranged in the scanning order shown in Table 16. When a 16x64 transform kernel matrix is applied, matrix operations are performed using all 64 input data, not 48, so all 4x4 areas except the upper left 4x4 area are filled with 0. In this case, the diagonal scanning order shown in Table 16 can be applied, or other scanning orders such as a row-major direction or a column-major direction can be applied.

[0226] Meanwhile, when the inverse RST or LFNST is performed as an inverse transform process in the decoding device, the input coefficient data to which the inverse RST is applied is composed of a one-dimensional vector according to the arrangement order of Table 16, and the modified coefficient vector obtained by multiplying the one-dimensional vector by the corresponding inverse RST matrix on the left side can be arranged in a two-dimensional block according to the arrangement order of Table 15.

[0227] To derive the transform coefficients, the decoding device may arrange information about previously received transform coefficients in a backward scanning order, i.e., a diagonal scanning order starting from number 64 in FIG.

[0228] Thereafter, the inverse transform unit 322 of the decoding device may apply a transform kernel matrix to the transform coefficients arranged one-dimensionally according to the scanning order of Table 16. That is, 48 modified transform coefficients may be derived through a matrix operation between the one-dimensional transform coefficients arranged according to the scanning order of Table 16 and a transform kernel matrix based on the transform kernel matrix of Table 14. That is, the one-dimensional transform coefficients may be derived as 48 modified transform coefficients through a matrix operation with a matrix transposed to the transform kernel matrix of Table 14.

[0229] The 48 modified transform coefficients thus derived can be arranged two-dimensionally as shown in Table 15 for the inverse linear transform.

[0230] In summary, when RST or LFNST is applied to an 8x8 region during the transform process, a matrix operation is performed between 48 transform coefficients in the upper left, upper right, and lower left regions of the 8x8 region (excluding the lower right region) and a 16x48 transform kernel matrix. For the matrix operation, the 48 transform coefficients are input in a one-dimensional array in the order shown in Table 15. When this matrix operation is performed, 16 modified transform coefficients are derived, and the modified transform coefficients can be arranged in the upper left region of the 8x8 region in the form shown in Table 16.

[0231] Conversely, when inverse RST or LFNST is applied to an 8x8 region during the inverse transform process, 16 transform coefficients corresponding to the upper left section of the 8x8 region among the transform coefficients of the 8x8 region are input in a one-dimensional array form according to the scanning order shown in Table 16 and can be subjected to a matrix operation with a 48x16 transform kernel matrix. That is, the matrix operation in this case can be expressed as (48x16 matrix) * (16x1 transform coefficient vector) = (48x1 modified transform coefficient vector). Here, an nx1 vector can be interpreted as the same as an nx1 matrix, and therefore can also be expressed as an nx1 column vector. Also, * indicates a matrix multiplication operation. When this matrix operation is performed, 48 modified transform coefficients can be derived, and the 48 modified transform coefficients can be arranged in the upper left, upper right, and lower left sections of the 8x8 region, excluding the lower right section, as shown in Table 15.

[0232] Meanwhile, according to one embodiment, the data arrangement in an 8x8 region for secondary transformation is in a row-major directional order as shown in Table 15. Meanwhile, when 67 prediction modes in a screen are configured as shown in FIG. 5, all directional modes (2 to 66) are configured symmetrically around the 34th mode. That is, the (2+n)th mode is symmetrical with the (66-n)th mode around the 34th mode in terms of prediction direction (0≦n≦31). Therefore, when the data arrangement order for configuring a 48×1 input vector for the (2+n)th mode, i.e., modes 2 to 33, is in a row-major directional order as shown in Table 15, a 48×1 input vector can be configured in the order shown in Table 17 for the (66-n)th mode.

[0233] [Table 17]

[0234] As shown in Table 17, the data arrangement in the 8x8 region for the secondary transform is in column-major order. Table 17 shows that for the (66-n)th mode of the intra-frame prediction mode, i.e., modes 35 to 66, the 64x1 input vector can be configured in column-major order.

[0235] In summary, the input data is symmetrically arranged in row-major order for the (2+n)th mode, and in column-major order for the (66-n)th mode (0≦n≦31), and the same transformation kernel matrix can be applied as shown in Table 14. Tables 5 to 7 show examples of how the transformation kernel matrix is applied for each mode.

[0236] In this case, either the arrangement order shown in Table 15 or the arrangement order shown in Table 17 may be applied to the planar mode, which is intra prediction mode 0, the DC mode, which is intra prediction mode 1, and the intra prediction mode 34. For example, the row-major directional order shown in Table 15 may be applied to the planar mode, which is intra prediction mode 0, the DC mode, which is intra prediction mode 1, and the intra prediction mode 34, and the arrangement order shown in Table 16 may be applied to the derived transform coefficients. Alternatively, the column-major directional order shown in Table 17 may be applied to the planar mode, which is intra prediction mode 0, the DC mode, which is intra prediction mode 1, and the intra prediction mode 34, and the arrangement order shown in Table 16 may be applied to the derived transform coefficients.

[0237] As mentioned above, when the 16x48 transformation kernel matrix of Table 14 is applied to the secondary transformation, the upper right 4x4 region and the lower left 4x4 region of the 8x8 region are filled with 0 as shown in Table 16. If an mx48 transformation kernel matrix (m≦16) is applied to the secondary transformation, not only the upper right 4x4 region and the lower left 4x4 region but also the (m+1)th to 16th regions in the scanning order shown in Table 16 can be filled with 0.

[0238] Therefore, if there is even one non-zero transform coefficient from the (m+1)th position to the 16th position in the scanning order or in the top-right 4x4 region or the bottom-left 4x4 region, it may be the case that the mx48 secondary transform (m≦16) is not applied. In this case, the index for the secondary transform is not signaled. The decoding device first parses the transform coefficients and checks whether the condition is met (i.e., whether a non-zero transform coefficient exists in a region where the transform coefficient should be zero in the secondary transform). If the condition is met, the index for the secondary transform can be set to 0 without parsing. For example, when m=16, it can determine whether the secondary transform is applied and whether the index for the secondary transform can be parsed by checking whether there is a non-zero coefficient in the top-right 4x4 region or the bottom-left 4x4 region.

[0239] Meanwhile, Table 18 shows another example of a transformation kernel matrix that can be applied to a 4x4 region.

[0240] [Table 18-1]

[0241] [Table 18-2]

[0242] [Table 18-3]

[0243] [Table 18-4]

[0244] Meanwhile, to reduce the amount of calculations in the worst case, the following embodiment may be proposed. In this document, a matrix consisting of M rows and N columns is represented as an M×N matrix, which refers to a forward transform, i.e., a transformation matrix applied when performing a transform (RST) in an encoding device. Therefore, an N×M matrix obtained by transposing an M×N matrix can be used in an inverse transform (inverse RST) performed in a decoding device. Also, although the following description describes a case where an m×64 transformation kernel matrix (m≦16) is applied as a transformation matrix for an 8×8 region, the same can be applied when the input vector is 48×1 and an m×48 transformation kernel matrix (m≦16) is applied. That is, 16×64 (or m×64) can be replaced with 16×48 (or m×48).

[0245] 1) For a block (e.g., a transform unit) with width W and height H, if W≧8 and H≧8, a transform kernel matrix that can be applied to an 8×8 region is applied to the upper left 8×8 region of the block. If W=8 and H=8, only the 8×64 portion of the 16×64 matrix can be applied, i.e., 8 transform coefficients can be generated. Alternatively, only the 8×48 portion of the 16×48 matrix can be applied, i.e., 8 transform coefficients can be generated.

[0246] 2) For a block (e.g., a transform unit) with width W and height H, if one of W and H is less than 8, i.e., if one of W and H is 4, a transform kernel matrix that can be applied to a 4x4 region is applied to the upper left of the block. If W=4 and H=4, only the 8x16 portion of the 16x16 matrix can be applied, generating 8 transform coefficients.

[0247] If (W,H)=(4,8) or (8,4), quadratic transformation is applied only to the upper left 4x4 region. If W or H is greater than 8, i.e., if W or H is greater than or equal to 16 and the other is 4, quadratic transformation is applied only to up to two 4x4 blocks in the upper left. That is, the specified transformation kernel matrix can be applied only to up to the upper left 4x8 or 8x4 region, divided into two 4x4 blocks.

[0248] 3) For blocks (eg, transform units) with width W and height H, do not apply a quadratic transform if both W and H are 4.

[0249] 4) For a block (e.g., a transform unit) having a width of W and a height of H, the number of coefficients generated by applying a quadratic transform can be configured to be maintained at or below 1 / 4 of the area of the transform unit (i.e., the total number of pixels constituting the transform unit = W × H). For example, if both W and H are 4, the most significant 4 × 16 matrix of a 16 × 16 matrix can be applied to generate four transform coefficients.

[0250] When a second-order transform is applied only to the 8x8 region in the upper left corner of a total transform unit (TU), a 4x8 transform unit or an 8x4 transform unit must generate eight or fewer coefficients, so the most significant 8x16 matrix of a 16x16 matrix can be applied to the 4x4 region in the upper left corner. An 8x8 transform unit can apply up to a 16x64 matrix (or a 16x48 matrix) (up to 16 coefficients can be generated). A 4xN or Nx4 (N ≥ 16) transform unit can apply a 16x16 matrix to the 4x4 block in the upper left corner, or the most significant 8x16 matrix of a 16x16 matrix to the two 4x4 blocks in the upper left corner. Similarly, a 4x8 transform unit or an 8x4 transform unit can generate a total of eight transform coefficients by applying the most significant 4x16 matrix of a 16x16 matrix to each of the two 4x4 blocks in the upper left corner.

[0251] 5) The maximum size of the quadratic transformation applied to a 4x4 region can be limited to 8x16. In this case, the amount of memory required to store the transformation kernel matrix applied to a 4x4 region can be reduced by half compared to a 16x16 matrix.

[0252] For example, for all transformation kernel matrices shown in Table 9 or Table 18, only the most significant 8x16 matrix can be extracted from each 16x16 matrix to limit the maximum size to 8x16, and an actual video coding system can be implemented by storing only the corresponding 8x16 matrix of the transformation kernel matrix.

[0253] If the maximum applicable transform size is 8x16 and the maximum number of multiplications required to generate one coefficient is limited to 8, then for a 4x4 block, a maximum of an 8x16 matrix can be applied, and for a 4xN block or an Nx4 block (N≧8, N=2n, n≧3), a maximum of an 8x16 matrix can be applied to each of the two 4x4 blocks in the upper left corner that make up the block. For example, for a 4xN block or an Nx4 block (N≧8, N=2n, n≧3), an 8x16 matrix can be applied to one 4x4 block in the upper left corner.

[0254] According to one embodiment, when coding an index specifying a quadratic transform to be applied to a luma component, more specifically, if one transform set is composed of two transform kernel matrices, it is necessary to specify whether to apply a quadratic transform and, if so, which transform kernel matrix to apply. For example, if a quadratic transform is not applied, the transform index can be coded as 0, and if it is applied, the transform indexes for the two transform sets can be coded as 1 and 2, respectively.

[0255] In this case, truncated unary coding can be used when coding the transform indexes. For example, the transform indexes 0, 1, and 2 can be coded by assigning binary codes of 0, 10, and 11, respectively.

[0256] In addition, when coding in the truncated unary mode, a different CABAC context can be assigned to each bin, and according to the above example, when coding transform indexes 0, 10, and 11, two CABAC contexts can be used.

[0257] Meanwhile, when coding a transform index specifying a secondary transform to be applied to a chrominance component, more specifically, when one transform set is composed of two transform kernel matrices, whether to apply a secondary transform and, if so, which transform kernel matrix to apply, must be specified, similar to when coding a transform index for a secondary transform of a luma component. For example, if a secondary transform is not applied, the transform index can be coded as 0, and if it is applied, the transform indexes for the two transform sets can be coded as 1 and 2, respectively.

[0258] In this case, truncated unary coding can be used when coding the transform indexes. For example, the transform indexes 0, 1, and 2 can be coded by assigning binary codes of 0, 10, and 11, respectively.

[0259] In addition, when coding in the truncated unary mode, a different CABAC context can be assigned to each bin, and according to the above example, when coding transform indexes 0, 10, and 11, two CABAC contexts can be used.

[0260] In addition, according to one embodiment, different CABAC context sets may be assigned depending on the chrominance intra-prediction mode. For example, when a non-directional mode such as a planar mode or a DC mode is distinguished from other directional modes (i.e., when the modes are distinguished into two groups), a corresponding CABAC context set (consisting of two contexts) may be assigned to each group when coding 0, 10, and 11, as in the above example.

[0261] When dividing chrominance intraprediction modes into several groups and allocating corresponding CABAC context sets, the chrominance intraprediction mode value must be known before transform index coding for the secondary transform. However, in the case of chrominance direct mode (DM), the luma intraprediction mode value is used as is, so the intraprediction mode value for the luma component must also be known. Therefore, when coding information for the chrominance component, data dependency on luma component information can occur. Therefore, in the case of chrominance DM mode, when transform index coding for the secondary transform is performed without information on the intraprediction mode, the data dependency can be eliminated by mapping to a specific group. For example, when the chrominance intraprediction mode is chrominance DM mode, the corresponding transform index coding can be performed using the corresponding CABAC context set as if it were a planar mode or DC mode, or the corresponding CABAC context set can be applied as if it were another directional mode.

[0262] FIG. 9 is a flow chart illustrating the operation of a video decoding device according to one embodiment of this document.

[0263] Each step disclosed in Fig. 9 may be performed by the decoding apparatus 300 disclosed in Fig. 3. More specifically, S910 may be performed by the entropy decoding unit 310 disclosed in Fig. 3, S920 may be performed by the inverse quantization unit 321 disclosed in Fig. 3, S930 and S940 may be performed by the inverse transform unit 322 disclosed in Fig. 3, and S950 may be performed by the addition unit 340 disclosed in Fig. 3. In addition, the operations of S910 to S950 are based on some of the contents described above with reference to Figs. 4 to 8. Therefore, detailed descriptions that overlap with the contents described above with reference to Figs. 3 to 8 will be omitted or simplified.

[0264] A decoding apparatus 300 according to an embodiment may derive quantized transform coefficients for a target block from a bitstream (S910). More specifically, the decoding apparatus 300 may decode information on the quantized transform coefficients for the target block from the bitstream and derive quantized transform coefficients for the target block based on the information on the quantized transform coefficients for the target block. The information on the quantized transform coefficients for the target block may be included in a Sequence Parameter Set (SPS) or a slice header, and may include at least one of information on whether a simplified transform (RST) is applied, information on a simplification factor, information on a minimum transform size for applying the simplified transform, information on a maximum transform size for applying the simplified transform, a simplified inverse transform size, and information on a transform index indicating any one of transform kernel matrices included in the transform set.

[0265] The decoding apparatus 300 according to an embodiment may derive transform coefficients by performing inverse quantization on the quantized transform coefficients for the current block (S920).

[0266] The derived transform coefficients may be arranged in a reverse diagonal scan order in units of 4x4 blocks, and the transform coefficients within the 4x4 blocks may also be arranged in a reverse diagonal scan order, i.e., the transform coefficients on which inverse quantization has been performed may be arranged in a reverse scan order applied in video codecs such as VVC and HEVC.

[0267] The decoding apparatus 300 according to an embodiment may derive modified transform coefficients based on an inverse reduced secondary transform (RST) of the transform coefficients (S930).

[0268] In one example, the inverse RST can be performed based on an inverse RST matrix, which is a non-square matrix with fewer columns than rows.

[0269] In one embodiment, step S930 may include the steps of decoding a transform index, determining whether a condition for applying an inverse RST is met based on the transform index, selecting a transform kernel matrix, and, if the condition for applying the inverse RST is met, applying the inverse RST to the transform coefficients based on the selected transform kernel matrix and / or a simplification factor, where the size of the simplified inverse transform matrix may be determined based on the simplification factor.

[0270] The decoding apparatus 300 according to an embodiment may derive residual samples for the current block based on the inverse transform of the modified transform coefficients (S940).

[0271] The decoding device 300 may perform an inverse linear transform on the modified transform coefficients for the current block, in which case the inverse linear transform may be a simplified inverse transform or a conventional separate transform may be used.

[0272] The decoding apparatus 300 according to an embodiment may generate reconstructed samples based on residual samples for a current block and predicted samples for the current block (S950).

[0273] Referring to S930, it can be seen that residual samples for a current block are derived based on the inverse RST of the transform coefficients for the current block. Considering the size of the inverse transform matrix, the size of a typical inverse transform matrix is N×N, whereas the size of the inverse RST matrix is reduced to N×R. Therefore, compared to performing a conventional transform, memory usage can be reduced by a ratio of R / N when performing the inverse RST. Furthermore, compared to the number of multiplication operations (N×N) required when using a typical inverse transform matrix, the number of multiplication operations can be reduced by a ratio of R / N (N×R) when using the inverse RST matrix. Furthermore, since only R transform coefficients need to be decoded when the inverse RST is applied, the total number of transform coefficients for the current block is reduced from N to R, thereby improving decoding efficiency. In summary, S930 improves the (inverse) transform efficiency and decoding efficiency of the decoding device 300 through the inverse RST.

[0274] FIG. 10 is a control flow diagram illustrating a reverse RST according to one embodiment of the present document.

[0275] The decoding apparatus 300 receives information on quantized transform coefficients, intra-prediction modes, and transform indexes from a bitstream (S1000).

[0276] The quantized transform coefficients received from the bitstream are derived as transform coefficients through inverse quantization as in S920 of FIG.

[0277] To apply the inverse RST to the dequantized transform coefficients, a transform set and a transform kernel matrix to be applied to the current block are derived (S1010).

[0278] For example, the transform set may be derived based on a mapping relationship according to the intra-prediction mode of the current block, and multiple intra-prediction modes may be mapped to one transform set. Each transform set may include multiple transform kernel matrices. The transform index may indicate one of the multiple transform kernel matrices. For example, if one transform set includes two transform kernel matrices, the transform index may indicate one of the two transform kernel matrices.

[0279] In one embodiment, the transform index syntax element can indicate whether inverse RST is applied and which of the transform kernel matrices is included in the transform set. If the transform set includes two transform kernel matrices, the value of the transform index syntax element has three types.

[0280] That is, according to one embodiment, the value of the syntax element for the transform index may include 0 indicating that the inverse RST is not applied to the current block, 1 indicating the first transform kernel matrix among the transform kernel matrices, or 2 indicating the second transform kernel matrix among the transform kernel matrices. Such information is received as syntax information, which is received as a binarized bin string including 0s and 1s.

[0281] In one example, the transform kernel matrix can be applied to a specific area in the upper left corner of the target block, for example, an 8x8 area or a 4x4 area, depending on the reduction or simplification size of the secondary transform, and the size of the modified transform coefficients output by applying the transform kernel matrix, i.e., the number of transform coefficients, can be derived based on the transform index, intra prediction mode, and the size of the target block to which the secondary transform is applied.

[0282] For example, when an inverse quadratic transform is applied to transform coefficients of a region of a target block, i.e., an 8×8 region or a 4×4 region, the inverse quadratic transform may be applied to only a portion of the transform coefficients included in the 8×8 region or the 4×4 region. If only 48 transform coefficients of the 8×8 region are input for the inverse quadratic transform, the 64×m transform kernel matrix applied to the 8×8 region may be further reduced to a 48×m transform kernel matrix.

[0283] In one example, m is 16, and the 48×16 transformation kernel matrix is a transformation kernel matrix based on Table 14, i.e., a matrix obtained by transposing the matrix in Table 14. When there are four transformation sets and each transformation set includes two transformation kernel matrices, a transformation index indicating whether an inverse quadratic transformation is applied and which one of the transformation kernel matrices included in the transformation set can have a value of 0, 1, or 2. When the transformation index is 0, it indicates that an inverse quadratic transformation is not applied, so when there are four transformation sets, all eight transformation kernel matrices can be used for the inverse quadratic transformation.

[0284] As shown in Equation 7, the one-dimensional array of transform coefficients derived through inverse quantization can be derived as modified transform coefficients having a two-dimensional array through a matrix operation with a transform kernel matrix.

[0285] The inverse transform unit 322 according to this embodiment can derive modified transform coefficients for the upper left 4x4 area, the upper right 4x4 area, and the lower left 4x4 area of the 8x8 area by applying a transform kernel matrix to the transform coefficients of the upper left 4x4 area of the 8x8 area of the target block (S1020).

[0286] For example, when performing a matrix operation on the transform coefficients of the upper left 4x4 region of an 8x8 region and a transform kernel matrix, the transform coefficients of the upper left 4x4 region of the 8x8 region are linearly arranged in a forward diagonal scanning order as shown in Table 16. After performing a matrix operation with the transform kernel matrix, the linearly arranged transform coefficients are arranged two-dimensionally in the upper left 4x4 region, the upper right 4x4 region, and the lower left 4x4 region of the 8x8 region in either a row-major or column-major order according to the intra prediction mode applied to the target block, as shown in Table 15 or Table 17. That is, an inverse quadratic transform may be applied to the 16 transform coefficients of the upper left 4x4 region in the 8x8 region, and 48 modified transform coefficients of the upper left 4x4 region, the upper right 4x4 region, and the lower left 4x4 region of the 8x8 region may be derived through an operation with the transform kernel matrix.

[0287] If the intra prediction mode that can be applied to the current block is one of 65 directional modes, the intra prediction modes are symmetrical around the intra prediction mode No. 34 in the diagonal direction in the upper left corner, and the intra prediction mode that can be applied to the current block is the 2nd to 34th modes in the left direction based on the intra prediction mode No. 34, the modified transform coefficients can be arranged two-dimensionally in a row-major directional order.

[0288] If the intra prediction mode applied to the current block is one of the 35th to 66th intra prediction modes to the right of the 34th intra prediction mode, the modified transform coefficients can be arranged two-dimensionally in a column-major order.

[0289] Also, if the intra prediction mode applied to the current block is the planar mode or the DC mode, the modified transform coefficients may be two-dimensionally arranged in a row-major directional order.

[0290] The inverse transform unit 322 can apply the inverse RST to generate modified transform coefficients of an 8x8 region or a 4x4 region in a two-dimensional block, and then apply an inverse linear transform to the modified transform coefficients of the two-dimensional block thus generated.

[0291] FIG. 11 is a flow diagram illustrating the operation of a video encoding device according to one embodiment of this document.

[0292] The steps disclosed in Fig. 11 may be performed by the encoding apparatus 200 disclosed in Fig. 2. More specifically, S1110 may be performed by the prediction unit 220 disclosed in Fig. 2, S1120 may be performed by the subtraction unit 231 disclosed in Fig. 2, S1130 and S1140 may be performed by the transformation unit 232 disclosed in Fig. 2, and S1150 may be performed by the quantization unit 233 and entropy encoding unit 240 disclosed in Fig. 2. In addition, the operations of S1110 to S1150 are based on some of the content described above with reference to Figs. 4 to 8. Therefore, detailed description of the content overlapping with the content described above with reference to Figs. 2 and 4 to 8 will be omitted or simplified.

[0293] The encoding apparatus 200 according to an embodiment may derive prediction samples based on an intra prediction mode applied to a current block (S1110).

[0294] The encoding apparatus 200 according to an embodiment may derive residual samples for the current block (S1120).

[0295] The encoding apparatus 200 according to an embodiment may derive transform coefficients for the current block based on a linear transform of residual samples (S1130). The linear transform may be performed using multiple transform kernels, and in this case, the transform kernels may be selected based on an intra prediction mode.

[0296] The decoding apparatus 300 may perform a secondary transform, specifically, an NSST, on transform coefficients for a current block, where the NSST may be performed based on a simplified transform (RST) or may be performed without the RST. When the NSST is performed based on the RST, it may correspond to the operation of S1140.

[0297] The encoding apparatus 200 according to an embodiment may derive modified transform coefficients for the current block based on the RST for the transform coefficients (S1140). In one example, the RST may be performed based on a simplified transform matrix or a transform kernel matrix, where the simplified transform matrix is a non-square matrix with the number of rows being less than the number of columns.

[0298] In one embodiment, step S1140 may include determining whether a condition for applying RST is met, generating and encoding a transform index based on the determination, selecting a transform kernel matrix, and, if the condition for applying RST is met, applying RST to the residual samples based on the selected transform kernel matrix and / or a simplification factor, where the size of the simplified transform kernel matrix may be determined based on the simplification factor.

[0299] The encoding device 200 according to one embodiment may perform quantization based on the modified transform coefficients for the current block to derive quantized transform coefficients, and encode information about the quantized transform coefficients (S1150).

[0300] More specifically, the encoding apparatus 200 may generate information about the quantized transform coefficients and encode the generated information about the quantized transform coefficients.

[0301] In one example, the information about the quantized transform coefficients may include at least one of information on whether RST is applied, information on a simplification factor, information on the minimum transform size to apply RST, and information on the maximum transform size to apply RST.

[0302] Referring to S1140, it can be seen that transform coefficients for a current block are derived based on the RST for the residual samples. Considering the size of the transform kernel matrix, the size of a normal transform kernel matrix is N×N, whereas the size of the simplified transform matrix is reduced to R×N. Therefore, when performing the RST, memory usage can be reduced by a ratio of R / N compared to when performing a normal transform. Furthermore, compared to the number of multiplication operations (N×N) when using a normal transform kernel matrix, the number of multiplication operations can be reduced by a ratio of R / N (R×N) when using a simplified transform kernel matrix. Furthermore, since only R transform coefficients are derived when the RST is applied, the total number of transform coefficients for the current block is reduced from N to R compared to when N transform coefficients are derived when a normal transform is applied, thereby reducing the amount of data transmitted from the encoding apparatus 200 to the decoding apparatus 300. In summary, according to S1140, the transform efficiency and coding efficiency of the encoding apparatus 200 can be increased through the RST.

[0303] FIG. 12 is a control flow diagram illustrating a RST according to one embodiment of the present document.

[0304] First, the encoding apparatus 200 may determine a transformation set based on a mapping relationship according to an intra-prediction mode applied to a current block (S1200).

[0305] Thereafter, the transform unit 232 can select one of the plurality of transform kernel matrices included in the transform set (S1210).

[0306] For example, the transform set may be derived based on a mapping relationship according to the intra-prediction mode of the current block, and multiple intra-prediction modes may be mapped to one transform set. Each transform set may include multiple transform kernel matrices. When one transform set includes two transform kernel matrices, a transform index indicating one of the two transform kernel matrices may be encoded and signaled to a decoding device.

[0307] When two transformation processes are applied to residual samples, if the residual samples are first transformed, they are called transform coefficients, and if a second transformation such as RST is performed after the first transformation, they can be called modified transform coefficients.

[0308] For example, when a quadratic transform is applied to transform coefficients of a region of a current block, i.e., an 8×8 region or a 4×4 region, the quadratic transform may be applied to only a portion of the transform coefficients included in the 8×8 region or the 4×4 region. For example, when a quadratic transform is applied to only 48 transform coefficients of the 8×8 region, the m×64 transform kernel matrix applied to the 8×8 region may be reduced to an m×48 transform kernel matrix.

[0309] In one example, m is 16, and the 16x48 transformation kernel matrix is shown in Table 14. When there are four transformation sets and each transformation set includes two transformation kernel matrices, the transformation index indicating whether an inverse quadratic transformation is applied and which one of the transformation kernel matrices included in the transformation set can have a value of 0, 1, or 2. When the transformation index is 0, it indicates that no quadratic transformation is applied, so when there are four transformation sets, all eight transformation kernel matrices can be used for the quadratic transformation.

[0310] When performing RST on the transform coefficients using a transform kernel matrix, the transform unit 232 may arrange the transform coefficients of the two-dimensional array that have undergone the primary transform in one dimension in either a row-major order or a column-major order depending on the intra prediction mode applied to the current block. Specifically, according to one example, the transform unit 232 may derive modified transform coefficients corresponding to the top-left 4x4 region of the 8x8 region by applying the transform kernel matrix to transform coefficients of the top-left 4x4 region, the top-right 4x4 region, and the bottom-left 4x4 region of the current block (S1220).

[0311] The transformation kernel matrix can be applied to a specific area in the upper left corner of the target block, for example, an 8x8 area or a 4x4 area, or a partial area of the 8x8 area, depending on the reduction or simplification size of the secondary transformation, and the size of the modified transformation coefficients output by applying the transformation kernel matrix, i.e., the number of modified transformation coefficients, can be derived based on the size of the transformation kernel matrix, the intra prediction mode, and the size of the target block to which the secondary transformation is applied.

[0312] As shown in Equation 5, two-dimensional transform coefficients must be arranged one-dimensionally for matrix operation with the transform kernel matrix, and modified transform coefficients whose number is less than the number of transform coefficients can be derived through an operation such as Equation 6.

[0313] That is, the two-dimensional array of transform coefficients in a specific region is read into one dimension in a certain directional order, and then the modified transform coefficients are derived through a matrix operation with the transform kernel matrix.

[0314] For example, when performing a matrix operation on the transform coefficients of the upper left 4x4 region of an 8x8 region and the transform kernel matrix, the 48 transform coefficients of the upper left 4x4 region, the upper right 4x4 region, and the lower left 4x4 region of the 8x8 region can be arranged one-dimensionally in either a row-major direction or a column-major direction as shown in Table 15 or Table 17, depending on the intra prediction mode applied to the target block, and the derived 16 modified transform coefficients can be arranged in a diagonal scanning direction in the upper left 4x4 region of the 8x8 region as shown in Table 16.

[0315] If the intra prediction mode that can be applied to the current block is one of 65 directional modes, the intra prediction modes are symmetrical around the intra prediction mode No. 34 in the upper left diagonal direction, and the intra prediction mode that can be applied to the current block is the 2nd to 34th modes in the left direction based on the intra prediction mode No. 34, the transform coefficients of the upper left 4x4 region, the upper right 4x4 region, and the lower left 4x4 region of the 8x8 region can be arranged one-dimensionally in row-major directional order as shown in Table 15.

[0316] If the intra prediction mode applied to the current block is one of the 35th to 66th modes in the right direction based on the 34th intra prediction mode, the transform coefficients of the upper left 4x4 region, the upper right 4x4 region, and the lower left 4x4 region of the 8x8 region can be arranged one-dimensionally in column-major order as shown in Table 17.

[0317] In addition, if the intra prediction mode applied to the current block is planar mode or DC mode, the transform coefficients of the upper left 4x4 area, the upper right 4x4 area, and the lower left 4x4 area of the 8x8 area can be arranged one-dimensionally in row-major order.

[0318] When the RST is performed in this manner, information about the RST can be encoded in the entropy encoding unit 240 .

[0319] First, the entropy encoding unit 240 derives the value of a syntax element for a transformation index that indicates one of the transformation kernel matrices included in the transformation set, binarizes the value of the syntax element for the derived transformation index, and then encodes the bins of the syntax element bin string based on context information for the bin string of the transformation index, i.e., a context model.

[0320] The encoded syntax element bin string can be output to the decoding apparatus 300 or to the outside in the form of a bitstream.

[0321] In the above-described embodiments, the method is described based on a flow chart with a series of steps or blocks, but this document is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described. Furthermore, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, and other steps may be included, or one or more steps in the flow chart may be deleted without affecting the scope of this document.

[0322] The method according to the present document described above can be implemented in software form, and the encoding device and / or decoding device according to the present document can be included in a device that performs video processing, such as a TV, a computer, a smartphone, a set-top box, or a display device.

[0323] In this document, when an embodiment is implemented in software, the method described above may be implemented with modules (processes, functions, etc.) that perform the functions described above. The modules may be stored in memory and executed by a processor. The memory may be internal or external to the processor and may be coupled to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, a memory card, a storage medium, and / or other storage devices. That is, the embodiments described herein may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in the figures may be implemented and executed on a computer, processor, microprocessor, controller, or chip.

[0324] In addition, the decoding device and encoding device to which this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interaction device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a video on demand (VoD) service providing device, an over-the-top (OTT) video device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, a medical video device, etc., and may be used to process a video signal or a data signal. For example, over-the-top (OTT) video devices may include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.

[0325] In addition, a processing method to which this document is applied may be produced in the form of a computer-executable program and stored on a computer-readable recording medium. Multimedia data having a data structure according to this document may also be stored on 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. Examples of the computer-readable recording medium include Blu-ray Discs (BDs), Universal Serial Buses (USBs), ROMs, PROMs, EPROMs, EEPROMs, RAMs, CD-ROMs, magnetic tapes, floppy disks, and optical data storage devices. The computer-readable recording medium also includes media embodied in the form of carrier waves (e.g., transmission via the Internet). A bitstream generated by an encoding method may be stored on a computer-readable recording medium or transmitted via a wired or wireless communication network. Furthermore, embodiments of this document may be embodied in a computer program product using program code, which can be executed by a computer according to embodiments of this document. The program code may be stored on a computer-readable carrier.

[0326] FIG. 13 exemplarily shows a structural diagram of a content streaming system to which this document applies.

[0327] Furthermore, the content streaming system to which this document is applied can be broadly divided into an encoding server, a streaming server, a web server, a media repository, a user device, and a multimedia input device.

[0328] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server can be omitted. The bitstream can be generated by an encoding method or a bitstream generation method to which this document applies, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.

[0329] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, which then transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, which controls commands and responses between devices in the content streaming system.

[0330] The streaming server can receive content from a media repository and / or an encoding server. For example, if content is received from the encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.

[0331] Examples of the user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head mounted displays (HMDs), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system can be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.

Claims

1. A video decoding method performed by a decoding device, comprising: receiving a bitstream; deriving prediction samples based on an intra prediction mode applied to a current block of the picture; obtaining a two-dimensional array of transform coefficients based on the received bitstream; deriving a plurality of first transform coefficients from a top left 4x4 region of the two-dimensional array of transform coefficients; deriving a plurality of second transform coefficients based on an inverse quadratic transform of the plurality of first transform coefficients; deriving a two-dimensional array of values based on the plurality of second transform coefficients, wherein the plurality of second transform coefficients are mapped to the top left 8x8 region of the two-dimensional array of values, excluding a bottom right 4x4 region within a top left 8x8 region; deriving an array of residual samples based on an inverse linear transform of said two-dimensional array of values; generating a reconstructed picture based on the sequence of residual samples and the prediction samples; the step of deriving the plurality of second transform coefficients based on the inverse quadratic transform of the plurality of first transform coefficients includes a step of performing a matrix operation between a transform kernel matrix and the plurality of first transform coefficients, wherein the plurality of first transform coefficients are arranged according to a forward diagonal scanning order of the top-left 4×4 region of the two-dimensional array of transform coefficients; the transformation kernel matrix is a 48x16 matrix; The method of claim 1, wherein the matrix operation between the transform kernel matrix and the first transform coefficients of the top-left 4x4 region is a (48x16 matrix) * (16x1 transform coefficient vector).

2. A video encoding method performed by a video encoding device, comprising: deriving prediction samples based on an intra prediction mode applied to a current block of the picture; deriving an array of residual samples based on the predicted samples; deriving a two-dimensional array of values based on a linear transformation of said array of residual samples; deriving a plurality of second transform coefficients from the two-dimensional array of values, the plurality of second transform coefficients being derived from the top left 8x8 region of the two-dimensional array of values excluding a bottom right 4x4 region within a top left 8x8 region; deriving a plurality of first transform coefficients based on a quadratic transformation of the plurality of second transform coefficients; deriving a two-dimensional array of transform coefficients based on the plurality of first transform coefficients, wherein the plurality of first transform coefficients are mapped to a top left 4x4 region of the two-dimensional array of transform coefficients; generating a bitstream including information derived based on the two-dimensional array of transform coefficients; the step of deriving the plurality of first transform coefficients based on the quadratic transformation of the plurality of second transform coefficients includes performing a matrix operation between a transform kernel matrix and the plurality of second transform coefficients, wherein the plurality of second transform coefficients are arranged for the matrix operation; the transformation kernel matrix is a 16x48 matrix; a matrix operation between the transform kernel matrix and the plurality of second transform coefficients of the upper left 4x4 region, the upper right 4x4 region, and the lower left 4x4 region of the upper left 8x8 region is (16x48 matrix) * (48x1 transform coefficient vector).

3. In a method for transmitting video data, obtaining a bitstream relating to the video, the bitstream comprising: deriving prediction samples based on an intra prediction mode applied to a current block of the picture; deriving an array of residual samples based on the predicted samples; deriving a two-dimensional array of values based on a linear transformation of said array of residual samples; deriving a plurality of second transform coefficients from the two-dimensional array of values, the plurality of second transform coefficients being derived from the top left 8x8 region of the two-dimensional array of values excluding a bottom right 4x4 region within a top left 8x8 region; deriving a plurality of first transform coefficients based on a quadratic transformation of the plurality of second transform coefficients; deriving a two-dimensional array of transform coefficients based on the plurality of first transform coefficients, wherein the plurality of first transform coefficients are mapped to a top left 4x4 region of the two-dimensional array of transform coefficients; generating the bitstream including information derived based on the two-dimensional array of transform coefficients; transmitting the data including the bitstream; the step of deriving the plurality of first transform coefficients based on the quadratic transformation of the plurality of second transform coefficients comprises: performing a matrix operation between a transform kernel matrix and the plurality of second transform coefficients, wherein the plurality of second transform coefficients are arranged for the matrix operation; the transformation kernel matrix is a 16x48 matrix; a matrix operation between the transform kernel matrix and the plurality of second transform coefficients of the upper left 4x4 region, the upper right 4x4 region, and the lower left 4x4 region of the upper left 8x8 region is (16x48 matrix) * (48x1 transform coefficient vector).