Method and apparatus for video coding based on secondary transform

The video coding method employs reduced secondary transforms and transform sets to enhance compression efficiency for high-resolution and immersive media, addressing data volume challenges in high-resolution and immersive media.

JP2026026330APending Publication Date: 2026-02-16LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025230596
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2018-12-06
Filing Date
2025-12-04
Publication Date
2026-02-16

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and immersive media such as 4K, 8K, VR, and AR content necessitates a highly efficient image/video compression technology to manage the increased data volume and transmission/storage costs effectively.

Method used

A video coding method and apparatus utilizing reduced secondary transforms (RST) and transform sets to improve coding efficiency, including inverse RST based on a transform index and intra prediction mode, with decoding and encoding processes to derive modified transform coefficients and residual samples.

Benefits of technology

Enhances the efficiency of image/video compression by optimizing secondary transforms through coding of transform indexes, improving overall video coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026026330000001_ABST
    Figure 2026026330000001_ABST
Patent Text Reader

Abstract

To provide a video decoding method.SOLUTION: A video decoding method includes deriving a transform coefficient through dequantization based on a quantized transform coefficient for a target block, deriving a modified transform coefficient based on inverse RST for the transform coefficient, and generating a reconstructed picture based on a residual sample for the target block based on inverse primary transform for the modified transform coefficient. The inverse RST may be performed based on the transform set determined based on the mapping relationship according to the intra prediction mode applied to the target block and the transform kernel matrix selected among the two transform kernel matrices included in each transform set, and may be performed based on whether the inverse RST is applied and the transform index indicating any one of the transform kernel matrices included in the transform set.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 transmitted increases relatively compared to conventional image / video data, which increases the transmission and storage costs when transmitting image data using conventional media such as wired or wireless broadband lines or storing image / video data using existing storage media.

[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 technology 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 improving 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 method and apparatus for improving the efficiency of secondary transforms through coding of transform indexes.

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

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

[0010] According to an embodiment of this document, there is provided a video decoding method performed by a decoding device, the method including the steps of: deriving quantized transform coefficients for a current block from a bitstream, deriving transform coefficients through inverse quantization based on the quantized transform coefficients for the current block, deriving modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients, deriving residual samples for the current block based on an inverse linear transform for the modified transform coefficients, and generating a reconstructed picture based on the residual samples for the current block, wherein the inverse RST is performed based on a transform set determined based on a mapping relationship according to an intra prediction mode applied to the current block and a selected transform kernel matrix from two transform kernel matrices included in each transform set, and the inverse RST may be performed based on a transform index indicating whether the inverse RST is applied and one of the transform kernel matrices included in the transform set.

[0011] According to another embodiment of the present document, there is provided a decoding device for decoding video, the decoding device including: an entropy decoding unit that derives quantized transform coefficients and information on prediction for a current block from a bitstream; a prediction unit that generates predicted samples for the current block based on the information on the prediction; 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 derives modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients; 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 is performed based on a transform set determined based on a mapping relationship according to an intra prediction mode applied to the current block and a selected transform kernel matrix from two transform kernel matrices included in each transform set, and the inverse RST is performed based on a transform index that indicates whether the inverse RST is applied and one of the transform kernel matrices included in the transform set.

[0012] According to an embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including the steps of: 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) for the transform coefficients, the inverse RST being performed based on transform sets determined based on a mapping relationship according to an intra prediction mode applied to the current block and selected from two transform kernel matrices included in each transform set; deriving quantized transform coefficients by quantizing the modified transform coefficients; and generating a transform index indicating whether the RST is applied and one of the transform kernel matrices included in the transform set.

[0013] According to another embodiment of the present document, a digital storage medium may be provided on which video data including encoded video information generated by a video encoding method performed by an encoding device is stored.

[0014] According to another embodiment of the present document, a digital storage medium may be provided that stores video data including encoded video information that causes a decoding device to perform the video decoding method. [Effects of the Invention]

[0015] This document will improve the efficiency of image / video compression in general.

[0016] According to this document, the efficiency of the secondary transform can be increased through coding of the transform index.

[0017] According to this document, video coding can be performed based on a transform set to improve the efficiency of video coding. [Brief explanation of the drawings]

[0018] [Figure 1] 1 illustrates, in simplified form, an example of a video / image coding system to which this document may be applied. [Figure 2] 1 is a diagram illustrating the configuration of a video / image encoding device to which this 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] 65 intra-directional modes of prediction directions are shown exemplarily. [Figure 6] FIG. 1 is a diagram for explaining RST according to one embodiment of this document. [Figure 7] FIG. 1 illustrates a scanning order of transform coefficients according to one embodiment of the present document. [Figure 8] 1 is a flowchart illustrating a reverse RST process according to one embodiment of the present document. [Figure 9] 1 is a flowchart 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 flowchart illustrating the operation of a video encoding device according to an embodiment of the present document. [Figure 12] 1 is a control flowchart 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

[0019] Because this document may be modified in various ways and may have various embodiments, specific embodiments will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to the specific embodiments. Common terms used in this document are used only to describe specific embodiments and are not intended to limit the technical ideas of this document. The singular expressions include the plural expressions unless the context clearly dictates otherwise. In this specification, the terms "comprise" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations 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.

[0020] 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. Implementations in which each component is integrated and / or separated are also within the scope of this document as long as they do not deviate from the essence of this document.

[0021] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, 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.

[0022] This document relates to video / image coding. For example, methods / embodiments disclosed in this document may relate 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.).

[0023] This document presents various embodiments relating to video / image coding, which may be used in combination with one another unless otherwise specified.

[0024] 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 consist of one or more slices / tiles. One picture can consist of one or more tile groups. One tile group can contain one or more tiles.

[0025] A pixel or a pel can refer to the smallest unit constituting one picture (or image). A "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 can refer to 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.

[0026] 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, depending on the situation. In general, an MxN block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.

[0027] In this document, the terms " / " and "," should be interpreted to indicate "and / or." For example, "A / B" means "A and / or B," and "A, B" means "A and / or B." Furthermore, "A / B / C" means "at least one of A, B, and / or C." Similarly, "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.")

[0028] Further, in this document, "or" should be interpreted to mean "and / or." For example, "A or B" can mean 1) only "A," 2) only "B," or 3) "A and B." In other words, "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.")

[0029] FIG. 1 shows a schematic diagram of an example video / image coding system to which this document may be applied.

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

[0031] 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 configured as a separate device or an external component.

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

[0033] An encoding device can encode input video / image. 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.

[0034] The transmitter may 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 may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter may include elements for generating a media file in a predetermined file format and elements for transmission via a broadcasting / communication network. The receiver may receive / extract the bitstream and transmit it to a decoding device.

[0035] The decoding device can decode the video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operations of the encoding device.

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

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

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

[0039] The image division unit 210 may divide an input image (or picture or 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 later. Alternatively, the binary tree structure may be applied first. The coding procedure according to this document is performed based on the final coding unit that is not further divided. In this case, based on coding efficiency according to image characteristics, the largest coding unit may be immediately used as the final coding unit, or, if necessary, the coding unit may be recursively divided into coding units of lower depth, and the coding unit of the 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 may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.

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

[0041] 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 may be 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.

[0042] The intra prediction unit 222 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located far away, depending on the prediction mode. Prediction modes in intra prediction 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 degree of precision of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction modes applied to neighboring blocks.

[0043] 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. In this case, 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 an inter prediction direction (such as L0 prediction, L1 prediction, or Bi prediction). In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter predictor 221 may construct a candidate list of motion information based on neighboring blocks and generate information indicating which candidate is used to derive a motion vector and / or a reference picture index for the current block. Inter prediction is performed based on various prediction modes. 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 current block can be indicated by using the motion vector of a neighboring block as a motion vector predictor and signaling the motion vector difference.

[0044] The prediction unit 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for predicting a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The prediction unit may also perform intra block copy (IBC) for predicting a block. The intra block copy may be used, for example, for coding content images / videos such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but is similar 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.

[0045] 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 relationship information between pixels. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size or non-square blocks of variable sizes.

[0046] The quantization unit 233 quantizes the transform coefficients and transmits the quantized signal 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 the 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 reconstruction (e.g., values ​​of syntax elements) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) units. The video / image 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 / image information may also include general constraint information. Signaling / transmitting information and / or syntax elements, described later in this document, may be encoded through the above-described encoding procedures and included in the bitstream.The bitstream may be transmitted via a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may 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 may be configured as an internal / external element of the encoding apparatus 200, or the transmitter may be included in the entropy encoding unit 240.

[0047] 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 predictor 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 current block in the current picture, or may be used for inter prediction of the next picture after filtering, as described below.

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

[0049] 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 290, as will be described later in connection with each filtering method. The filtering information may be encoded by the entropy encoding unit 290 and output in the form of a bitstream.

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

[0051] The DPB of the memory 270 may store the 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.

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

[0053] 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 331 and an intra predictor 332. The residual processor 320 may include a dequantizer 321 and an inverse transformer 321. 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 configured 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 configured as a digital storage medium. The hardware components may further include memory 360 in the internal / external components.

[0054] When a bitstream including video / image information is input, the decoding apparatus 300 can reconstruct an image corresponding to the process by 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 information about block division obtained from the bitstream. The decoding apparatus 300 can perform decoding using the processing units applied by the encoding apparatus. Accordingly, the processing unit for decoding may be, for example, a coding unit, and the coding unit may be divided into coding tree units or the largest coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. Furthermore, the reconstructed image signal decoded and output by the decoding apparatus 300 can be reproduced by a playback device.

[0055] The decoding apparatus 300 may receive a signal output from the encoding apparatus of FIG. 2 in the form of a bitstream, and may decode the received signal 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 video 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 further decode pictures based on the information on the parameter sets and / or the general constraint information. Signaling / received information and / or syntax elements, which will be described later in this document, may be decoded via 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 may receive bins corresponding to each syntax element in the bitstream, determine a context model using information on the syntax element to be decoded and decoding information on neighboring and target blocks, or information on symbols / bins decoded in a previous step, predict the occurrence probability of the bins according to the determined context model, and perform 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 entropy-decoded 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 device according to this document may be called a video / image / picture decoding device, and the decoding device 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.

[0056] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in the form of two-dimensional blocks. 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 inverse quantize the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.

[0057] The inverse transform unit 322 performs an inverse transform on the transform coefficients to obtain a residual signal (residual block, residual sample array).

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

[0059] 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 predicting 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 predicting a block. The intra block copy may be used, for example, for coding content images / videos such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but is similar 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.

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

[0061] The inter prediction unit 331 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 an 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 present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 331 may construct a candidate list of motion information based on 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 is performed based on various prediction modes, and the prediction information may include information indicating the inter prediction mode for the current block.

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

[0063] 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, or may be output after filtering, as described below, or may be used for inter prediction of a next picture.

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

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

[0066] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter predictor 331. The memory 360 may 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 may be transmitted to the inter predictor 331 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 360 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 332.

[0067] 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 also be applied identically 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.

[0068] As described above, prediction is performed to improve compression efficiency during video coding. Through this, 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 on the residual between the original block and the predicted block (residual information) to the decoding device, rather than the original sample values ​​of the original block, 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.

[0069] The residual information can be generated through a transform and quantization procedure. For example, an encoding device can 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, perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and signal the related residual information to a decoding device (via a bitstream). Here, the residual information can include information such as value information, position information, transform technique, transform kernel, and quantization parameter of the quantized transform coefficients. The decoding device can derive residual samples (or residual blocks) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding device can generate a reconstructed picture based on the predicted block and the residual block. The encoding device can also derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a subsequent picture, and generate a reconstructed picture based on the residual block.

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

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

[0072] 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 referred to as a core transform. Here, the primary transform may be based on Multiple Transform Selection (MTS), and when multiple transforms are applied as the primary transform, it may be referred to as a multiple core transform.

[0073] The multi-kernel transform may refer to a transform method further using a Discrete Cosine Transform (DCT) Type 2 and a Discrete Sine Transform (DST) Type 7, DCT Type 8, and / or DST Type 1. That is, the multi-kernel transform may refer to a transform method for transforming 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 tentative transform coefficients from the perspective of a transform unit.

[0074] In other words, when a conventional transform method is applied, a spatial-domain to frequency-domain transform is applied to a residual signal (or residual block) based on DCT type 2, thereby generating transform coefficients. In contrast, when the multi-kernel transform is applied, a spatial-domain to frequency-domain transform is applied to a residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1, thereby generating transform coefficients (or primary transform coefficients). 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.

[0075] For reference, the DCT / DST transform type can be defined based on the basis functions, and the basis functions can be shown as in the following table.

[0076] [Table 1]

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

[0078] Also, 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 or not. For example, if the horizontal transform kernel is represented by trTypeHor and the vertical transform kernel is represented by trTypeVer, a value of 0 for trTypeHor or trTypeVer can be set to DCT2, a value of 1 for trTypeHor or trTypeVer can be set to DCT7, and a value of 2 for trTypeHor or trTypeVer can be set to DCT8.

[0079] In this case, MTS index information may be encoded and signaled to a decoding device to indicate one of a number of transform kernel sets. For example, an MTS index of 0 may indicate that the values ​​of trTypeHor and trTypeVer are all 0, an MTS index of 1 may indicate that the values ​​of trTypeHor and trTypeVer are all 1, an MTS index of 2 may indicate that the value of trTypeHor is 2 and the value of trTypeVer is 1, an MTS index of 3 may indicate that the value of trTypeHor is 1 and the value of trTypeVer is 2, and an MTS index of 4 may indicate that the values ​​of trTypeHor and trTypeVer are all 2.

[0080] 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 refers to converting to a more compressed representation using correlations that exist 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, based on the non-separable transform matrix, the vertical transform and the horizontal transform are not separately applied to the (first-order) transform coefficients (or the horizontal-vertical transform is not independently applied), but the transform can be applied at once. In other words, the non-separable second-order transform may refer to a transform method in which the vertical and horizontal components of the (first-order) transform coefficients are not separated, and for example, a two-dimensional signal (transform coefficient) is rearranged into a one-dimensional signal in a specific predetermined direction (e.g., row-first direction or column-first direction), and then a modified transform coefficient (or second-order transform coefficient) is generated based on the non-separable transform matrix. For example, the row-major order is a row-order in which the first row, the second row, ..., the Nth row of an MxN block are arranged in a row, and the column-major order is a column-order in which the first column, the second column, ..., the Mth column of an MxN block are arranged in a row. The non-separable quadratic transform can be applied to the top-left region of a block made up 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 8 or greater, an 8x8 non-separable quadratic transform can be applied to the 8x8 region in the upper left corner of the transform coefficient block. Also, if the width (W) and height (H) of the transform coefficient block are both 4 or greater and the width (W) or height (H) of the transform coefficient block is less than 8, a 4x4 non-separable quadratic transform can be applied to the min(8,W) x min(8,H) region in the upper left corner of the transform coefficient block. However, embodiments are not limited thereto. For example, even if the width (W) or height (H) of the transform coefficient block only satisfies the condition that both are 4 or greater, a 4x4 non-separable quadratic transform can be applied to the min(8,W) x min(8,H) region in the upper left corner of the transform coefficient block.

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

[0082] The 4x4 input block X can be represented as follows:

[0083]

number

[0084] When X is expressed in the form of a vector, the vector JPEG2026026330000004.jpg84 can be represented as follows:

[0085]

number

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

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

[0088]

number

[0089] where: JPEG2026026330000008.jpg75 denotes a vector of transform coefficients, and T denotes a 16x16 (non-separable) transform matrix.

[0090] Through Equation 3, a 16×1 vector of transform coefficients JPEG2026026330000009.jpg75 can be derived, and JPEG2026026330000010.jpg75 can be re-organized into 4x4 blocks through the scan order (horizontal, vertical, diagonal, etc.). However, the above calculation is an example, and in order to reduce the calculation complexity of the non-separable quadratic transform, HyGT (Hypercube-Givens Transform) or the like may be used for the calculation of the non-separable quadratic transform.

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

[0092] As described above, the non-separable quadratic transform may 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 the corresponding transform coefficient block when W and H are both equal to or greater than 8, and the corresponding 8x8 region may be 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 the corresponding transform coefficient block when W and H are both equal to or greater than 4, and the corresponding 4x4 region may be the upper-left 4x4 region within the corresponding transform coefficient block. For example, an 8x8 transform kernel matrix may be a 64x64 / 16x64 matrix, and a 4x4 transform kernel matrix may be a 16x16 / 8x16 matrix.

[0093] In this case, due to mode-based transformation kernel selection, three non-separable quadratic transformation kernels can be configured per transform set for non-separable quadratic transformations for both 8x8 transforms and 4x4 transforms, resulting in a total of 35 transform sets. That is, 35 transform sets can be configured for 8x8 transforms and 35 transform sets can be configured for 4x4 transforms. In this case, each of the 35 transform sets for the 8x8 transforms may include three 8x8 transformation kernels, and each of the 35 transform sets for the 4x4 transforms may include three 4x4 transformation kernels. However, the transform sizes, the number of sets, and the number of transformation 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 transformation kernels.

[0094] 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. The selection of a particular one of the transform sets may be based on, for example, the intra prediction mode of the current block (CU or sub-block).

[0095] For reference, for example, the intra prediction modes may include two non-directional (non-angular) intra prediction modes and 65 directional (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, an intra prediction mode numbered 67 may also be used depending on the case, and the 67th intra prediction mode may indicate a linear model (LM) mode.

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

[0097] Referring to FIG. 5, intra prediction modes can be classified into those with horizontal directionality and those with vertical directionality, centered on the 34th intra prediction mode, which has a diagonal prediction direction pointing left up. In FIG. 5, H and V 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. The 2nd to 33rd intra prediction modes have horizontal directionality, while the 34th to 66th intra prediction modes have vertical directionality. Meanwhile, the 34th intra prediction mode can be considered neither horizontal nor vertical in the strict sense, but can be classified as belonging to the horizontal direction from the perspective 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 the horizontal mode. Transposing the input data means that rows become columns and columns become rows for an MxN two-dimensional block of data, resulting in NxM data. Intra prediction modes 18 and 50 indicate horizontal and vertical intra prediction modes, respectively. Intra prediction mode 2 has a reference pixel on the left and predicts in a direction upward and to the right, so it may be called a diagonal-upper-right intra prediction mode. In the same vein, intra prediction mode 34 may be called a diagonal-downper-right intra prediction mode, and intra prediction mode 66 may be called a diagonal-downper-left intra prediction mode.

[0098] In this case, the mapping between the 35 transform sets and the intra prediction modes may be shown, for example, as in the following table. For reference, when the LM mode is applied to a current block, a secondary transform may not be applied to the current block.

[0099] [Table 2]

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

[0101] 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, encoded, and signaled to a decoding device and transmitted to an inverse quantization / inverse transform unit in the encoding device.

[0102] 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 the quantization unit as described above, encoded, signaled to the decoding device, and transmitted to the inverse quantization / inverse transform unit within the encoding device.

[0103] The inverse transform unit may perform a series of procedures in the reverse order of the procedures performed by the transform unit described above. The inverse transform unit may receive (dequantized) transform coefficients, perform a secondary (inverse) transform on them 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 perspective of the inverse transform unit. 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.

[0104] 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 may be 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 a residual block.

[0105] 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 specified by an intra prediction mode. In addition, as an embodiment, a secondary transform decision method may be determined depending on a primary transform decision method. Various combinations of primary transform and secondary transform may be determined depending on an intra prediction mode. In addition, as an example, the secondary inverse transform decision unit may determine an area to which a secondary inverse transform is applied based on the size of the current block.

[0106] On the other hand, as described above, if the second-order (inverse) transform is omitted, the residual block (residual sample) can be obtained by receiving (dequantized) 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.

[0107] On the other hand, in this paper, in order to reduce the computational complexity and memory requirements associated with 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.

[0108] 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 may be one condition for implementation in a decoding device and an encoding device, and compared to the existing 9-bit or 10-bit representation, it can reduce the memory requirements for storing the transform kernel with a reasonably accommodating performance degradation. In addition, by expressing the kernel matrix in 8 bits, a small multiplier can be used, which may be more suitable for SIMD (Single Instruction Multiple Data) instructions used for optimal software implementation.

[0109] 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 resolve the issue of computational complexity that occurs during the transformation of a large block or a non-separable transformation.

[0110] The RST may be referred to 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 by which the RST may be referred to are not limited to the listed examples. Alternatively, since the RST is mainly performed in the low-frequency domain including non-zero coefficients in the transform block, it may also be referred to as an LFNST (Low-Frequency Non-Separable Transform).

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

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

[0113] In this specification, the term "current block" may refer to a current block or a residual block to be coded.

[0114] In an RST according to one embodiment, an N-dimensional vector is mapped to an R-dimensional vector located in a different space, and a reduced transformation matrix can be determined, where R is smaller than N. N may represent the square of the length of one side of the block to which the transformation is applied, or the total number of transformation coefficients corresponding to the block to which the transformation is applied, and the simplification factor may represent an R / N value. The simplification factor may 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 simplification coefficient, but depending on the situation, the simplification factor may also represent R. Depending on the situation, the simplification factor may also represent an N / R value.

[0115] In one embodiment, the simplification factors or simplification coefficients may be signaled via the 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 need to be separately signaled.

[0116] The size of the simplified transformation matrix according to one embodiment is RxN, which is smaller than the size NxN of the normal transformation matrix, and can be defined as Equation 4 below.

[0117]

number

[0118] The matrix T in the reduced transform block shown in FIG. 6(a) is the matrix T in Equation 4. RxN As shown in FIG. 6(a), the simplified transformation matrix T RxN When multiplied by , the transform coefficients for the current block can be derived.

[0119] 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 by approximately 1 / 4 due to the simplification factor.

[0120]

number

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

[0122]

number

[0123] 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 target block are 16 can be derived. If a regular transform, rather than RST, is applied and a transform matrix of size 64x64 (NxN) is multiplied by residual samples of size 64x1 (Nx1), 64 (N) transform coefficients for the current block should be 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 device 200 to the decoding device 300 is reduced, thereby improving transmission efficiency between the encoding device 200 and the decoding device 300.

[0124] Considering the size of the transformation matrix, the size of a normal transformation matrix is ​​64x64 (NxN), but the size of a simplified transformation matrix is ​​reduced to 16x64 (RxN), so compared to performing normal transformation, memory usage during RST can be reduced by a ratio of R / N. Also, compared to the number of multiplication operations (NxN) when using a normal transformation matrix, the number of multiplication operations can be reduced by a ratio of R / N (RxN) when using a simplified transformation matrix.

[0125] 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) of the transform coefficients and derive residual samples for the current block based on an inverse primary transform of the modified transform coefficients.

[0126] Inverse RST matrix T according to one embodiment NxR The size of the simplified transformation matrix T shown in Equation 4 is NxR, which is smaller than the size of the normal inverse transformation matrix NxN. RxN and are in a transpose relationship.

[0127] The matrix T in the Reduced Inv. Transform block shown in FIG. 6(b) t is the inverse RST matrix T RxN T (The superscript T means transpose.) As shown in FIG. 6(b), the inverse RST matrix T RxN T When the inverse RST matrix T is multiplied by the inverse RST matrix T, the modified transform coefficients for the current block or the residual samples for the current block can be derived. RxN T is (T RxN ) T NxR It may also be expressed as

[0128] More specifically, when the inverse RST is applied as the secondary inverse transform, the inverse RST matrix T RxN TAlternatively, an inverse RST can be applied as an inverse linear transform, in which case the inverse RST matrix T RxN T When multiplied by , the residual sample for the target block can be derived.

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

[0130]

number

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

[0132]

number

[0133] 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. In terms of the size of the inverse transformation matrix, the size of a normal inverse transformation matrix is ​​64x64 (NxN), but the size of the simplified inverse transformation matrix is ​​reduced to 64x16 (NxR). Therefore, compared to performing a normal inverse transformation, the memory usage when performing inverse RST can be reduced by a ratio of R / N. Also, compared to the number of multiplication operations when using a normal inverse transformation matrix (NxN), when using a simplified inverse transformation matrix, the number of multiplication operations can be reduced by a ratio of R / N (NxR).

[0134] 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 cases 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), the transform to be applied can be specified by signaling a syntax element called an NSST index for each transform coefficient block. That is, an 8x8 NSST can be specified for the 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 transforms that can be applied to an 8x8 region contained within a corresponding transform coefficient block when W and H of the target block are both equal to or greater than 8, and the corresponding 8x8 region may be the upper left 8x8 region within the corresponding transform coefficient block. Similarly, 4x4 NSST and 4x4 RST refer to transforms that can be applied to a 4x4 region contained within a corresponding transform coefficient block when W and H of the target block are both equal to or greater than 4, and the corresponding 4x4 region may be the upper left 4x4 region within the corresponding transform coefficient block.

[0135] On the other hand, when applying the (forward) 8x8 RST as in Equation 4, 16 valid transform coefficients are generated, so the 64 input data constituting the 8x8 area can be seen as being reduced to 16 output data, and from the perspective of a two-dimensional area, valid transform coefficients are filled in only 1 / 4 of the area. Therefore, the 16 output data obtained by applying the forward 8x8 RST can be filled in the upper left area of ​​the block (transform coefficients 1 to 16) as shown in Figure 7.

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

[0137] In Figure 7, the 4x4 area in the upper left corner is a ROI (Region of Interest) area filled with valid transform coefficients, and the remaining area is left blank, which can be filled with zero values ​​as default.

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

[0139] If a valid non-zero transform coefficient is found outside the ROI region of Figure 7, it is certain that the 8x8 RST is not applied, and therefore index coding of the corresponding NSST can be omitted. Conversely, if a non-zero transform coefficient is not found outside the ROI region of Figure 7 (e.g., when the 8x8 RST is applied and the transform coefficients for the region outside the ROI are set to 0), it is possible that the 8x8 RST is 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 of non-zero transform coefficients.

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

[0141] FIG. 8 is a flowchart illustrating a reverse RST process according to one embodiment of the present document.

[0142] 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 described 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.

[0143] In one embodiment, the detailed operations of the inverse RST are merely the reverse of the detailed operations of the RST, and the detailed operations of the RST and the detailed operations of the inverse RST may be substantially similar. 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.

[0144] The decoding apparatus 300 according to an embodiment may perform inverse quantization on the quantized transform coefficients of the current block to derive transform coefficients (S800).

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

[0146] 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. Furthermore, as an example, 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.

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

[0148] According to an embodiment, a decoding apparatus 300 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.

[0149] In one example, information about a color 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).

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

[0151] In the following, an embodiment of this document proposes 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.

[0152] As an example, a set for the current transform block is configured based on the intra prediction mode, so that a transform set configured with transform kernels of various sizes can be applied to the transform block. The transform sets in Table 3 are represented by numbers 0 to 3 as shown in Table 4.

[0153] [Table 3]

[0154] [Table 4]

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

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

[0157] [Table 5]

[0158] [Table 6]

[0159] [Table 7]

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

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

[0162] In Table 7, one available transform kernel is used for each transform set, which results in the transform index having a range from 0 to 1.

[0163] Meanwhile, in the transform set mapping of Table 3, a total of four transform sets can be used, 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 transform kernel matrices that can be applied to 8x8 blocks, and Table 9 shows transform kernel matrices that can be applied to 4x4 blocks. 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.

[0164] [Table 8-1]

[0165] [Table 8-2]

[0166] [Table 8-3]

[0167] [Table 8-4]

[0168] [Table 8-5]

[0169] [Table 8-6]

[0170] Table 8-7

[0171] Table 8-8

[0172] Table 9-1

[0173] Table 9-2

[0174] Table 9-3

[0175] Table 9-4

[0176] Table 9-5

[0177] Table 9-6

[0178] Table 9-7

[0179] Table 9-8

[0180] The examples of transformation kernel matrices presented 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).

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

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

[0183] The examples of transformation kernel matrices shown 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 that appears 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.

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

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

[0186] Basically, the transformation kernel matrix applicable to the 4x4 region presented in Table 9 can be applied to 4x4 TUs, 4xM TUs, and Mx4 TUs (for M>4, 4xM TUs, and Mx4 TUs, the specified transformation kernel matrix can be applied to each 4x4 region separately, or it can be applied only to the largest 4x8 or 8x4 region in the upper left corner), 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 applicable to the 8x8 region presented in Table 8 may not be necessary.

[0187] Meanwhile, to reduce the amount of calculations for the worst case, the following embodiment can be proposed. Hereinafter, a matrix consisting of M rows and N columns is represented as an MxN matrix, which means a forward transform, i.e., a transform matrix applied when performing a transform (RST) in an encoding device. Therefore, an NxM matrix obtained by transposing the MxN matrix can be used in an inverse transform (inverse RST) performed in a decoding device.

[0188] 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 8x8 region is applied to the 8x8 region in the upper left corner of the block. If W=8 and H=8, only the 8x64 portion of the 16x64 matrix can be applied. That is, eight transform coefficients can be generated.

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

[0190] If (W,H)=(4,8) or (8,4), the 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, the quadratic transformation is applied only to the top left two 4x4 blocks. In other words, the specified transformation kernel matrix can be applied only to the top left 4x8 or 8x4 region, divided into two 4x4 blocks.

[0191] 3) For blocks (eg, transform units) with width W and height H, if W and H are both 4, then the quadratic transform may not be applied.

[0192] 4) For a block (e.g., a transform unit) with a width of W and a height of H, the number of coefficients generated by applying a quadratic transform can be configured to be kept to 1 / 4 or less of the area of ​​the transform unit (i.e., the number of total pixels constituting the transform unit = WxH). For example, if both W and H are 4, the most significant 4x16 matrix of a 16x16 matrix can be applied to generate four transform coefficients.

[0193] When a quadratic transform is applied only to the largest 8x8 region in the upper left corner of the entire 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 16x16 matrices can be applied to the 4x4 region in the upper left corner. For an 8x8 transform unit, up to a maximum of 16x64 matrices can be applied (up to 16 coefficients can be generated). For a 4xN or Nx4 (N≧16) transform unit, a 16x16 matrix can be applied to the 4x4 block in the upper left corner, or the most significant 8x16 matrix of 16x16 matrices can be applied to the two 4x4 blocks in the upper left corner. Similarly, for a 4x8 transform unit or an 8x4 transform unit, the most significant 4x16 matrix of 16x16 matrices can be applied to the two 4x4 blocks in the upper left corner, respectively, to generate a total of eight transform coefficients.

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

[0195] For example, for all the transformation kernel matrices listed in Table 9, only the top 8x16 matrix can be extracted from each 16x16 matrix, limiting the maximum size to 8x16, so that an actual video coding system can store only the corresponding 8x16 matrix of the transformation kernel matrix.

[0196] 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 8x16 matrices can be applied, and for a 4xN block or an Nx4 block, (N≧8, N=2 n , n≧3) A maximum of 8x16 matrices can be applied to the two largest 4x4 blocks in the upper left corner of the image. For example, for a 4xN block or an Nx4 block, (N≧8, N=2 n, n≧3), an 8x16 matrix can be stored for one 4x4 block in the upper left corner.

[0197] According to an 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 may be coded as 0, and if a quadratic transform is applied, the transform indexes for the two transform sets may be coded as 1 and 2, respectively.

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

[0199] In addition, when coding in the truncated unary manner, 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.

[0200] 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 or not to apply a secondary transform and, if so, which transform kernel matrix to apply must be specified, just as when coding a transform index for a secondary transform for 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.

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

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

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

[0204] When dividing chrominance intraprediction modes into several groups and allocating corresponding CABAC context sets, a chrominance intraprediction mode value should be found before transform index coding for the secondary transform. However, in the case of a chrominance direct mode (DM), the luma intraprediction mode value is used as is, so an intraprediction mode value for the luma component should also be found. Therefore, when coding information for a chrominance component, data dependency on luma component information may occur. Therefore, in the case of a chrominance DM mode, when transform index coding for a secondary transform is performed without information on the intraprediction mode, the chrominance intraprediction mode may be mapped to a specific group to eliminate the data dependency. For example, when the chrominance intraprediction mode is a chrominance DM mode, the chrominance intraprediction mode may be treated as a planar mode or a DC mode, and the corresponding CABAC context set may be used to code the corresponding transform index, or the chrominance intraprediction mode may be treated as another directional mode, and the corresponding CABAC context set may be applied.

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

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

[0207] According to an embodiment, a decoding apparatus 300 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 the 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 the transform kernel matrices included in the transform set.

[0208] 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).

[0209] 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).

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

[0211] In one embodiment, 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. In this case, the size of the simplified inverse transform matrix may be determined based on the simplification factor.

[0212] 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).

[0213] 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 separable transform.

[0214] 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).

[0215] 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 of the current block. Considering the size of the inverse transform matrix, the size of a typical inverse transform matrix is ​​NxN, but the size of the inverse RST matrix is ​​reduced to NxR. Therefore, compared to performing a conventional transform, memory usage during inverse RST can be reduced by a ratio of R / N. Furthermore, compared to the number of multiplication operations (NxN) required when using a typical inverse transform matrix, the number of multiplication operations can be reduced by a ratio of R / N (NxR) when using the inverse RST matrix. Furthermore, since only R transform coefficients need to be decoded when applying the inverse RST, compared to the number of transform coefficients that need to be decoded when applying a conventional inverse transform (N), 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.

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

[0217] The decoding apparatus 300 receives information on a transform index and an intra-prediction mode from a bitstream (S1000).

[0218] Such information is received as syntax information, which is received as a binary coded bin string containing 0's and 1's.

[0219] Meanwhile, the entropy decoding unit 310 can derive binarization information for the syntax element of the transform index.

[0220] This generates a candidate set for the binary-coded values ​​that the syntax element of the received transform index may have, and in accordance with this embodiment, the syntax element of the transform index may be binarized using a truncated unary code method.

[0221] The transform index syntax element in this embodiment can indicate whether an inverse RST is applied and one of the transform kernel matrices included in the transform set, and if the transform set includes two transform kernel matrices, the value of the transform index syntax element can be three.

[0222] That is, according to one embodiment, the syntax element value for the transform index may include 0 indicating that the inverse RST is not applied to the target 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.

[0223] In this case, the syntax element values ​​for the three transform indexes can be coded as 0, 10, and 11 using the truncated unary code method. That is, the value 0 for the syntax element can be binarized as '0', the value 1 for the syntax element can be binarized as '10', and the value 2 for the syntax element can be binarized as '11'.

[0224] The entropy decoding unit 310 derives context information, i.e., a context model, for the bin string of the transform index (S1010), and can decode the bins of the bin string of the syntax element based on the context information (S1020).

[0225] In summary, the entropy decoding unit 310 receives the bin string binarized in the truncated unary code manner, and decodes the syntax elements of the transform index through a candidate set for the corresponding binarized value.

[0226] According to this embodiment, different context information, i.e., probability models, can be applied to two bins of a transform index, respectively. That is, both of the two bins of the transform index can be decoded in a context manner rather than a bypass manner, and the first bin of the bins of the syntax elements for the transform index can be decoded based on first context information, and the second bin of the bins of the syntax elements for the transform index can be decoded based on second context information.

[0227] Through this context information based decoding, the value of the syntax element for the transform index applied to the current block can be derived from among the binary coded values ​​that the syntax element of the transform index may have (S1030).

[0228] That is, one of transform indexes 0, 1, and 2 can be applied to or derived from the current target block.

[0229] The inverse transform unit 332 of the decoding device 300 determines a transform set based on a mapping relationship according to the intra prediction mode applied to the current block (S1040), and can perform inverse RST based on the values ​​of syntax elements for the transform set and the transform index (S1050).

[0230] As mentioned above, multiple transform sets can be determined depending on the intra prediction mode of the transform block to be transformed, and the inverse RST can be performed based on one of the transform kernel matrices included in the transform set indicated by the transform index.

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

[0232] Each step 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 contents described above with reference to Figs. 4 to 8. Therefore, detailed descriptions that overlap with those described above with reference to Figs. 2 and 4 to 8 will be omitted or simplified.

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

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

[0235] 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 a plurality of transform kernels, and in this case, the transform kernels may be selected based on the intra prediction mode.

[0236] 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 not based on the RST. When the NSST is performed based on the RST, it may correspond to the operation of S1140.

[0237] 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, and the simplified transform matrix may be a non-square matrix in which the number of rows is smaller than the number of columns.

[0238] In one embodiment, 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. In this case, the size of the simplified transform kernel matrix may be determined based on the simplification factor.

[0239] According to an embodiment, the encoding apparatus 200 may perform quantization based on the modified transform coefficients for the current block, derive quantized transform coefficients, and encode information about the quantized transform coefficients (S1160).

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

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

[0242] Referring to S1140, it can be seen that transform coefficients for a current block are derived based on the RST of the residual samples. Considering the size of the transform kernel matrix, the size of a normal transform kernel matrix is ​​NxN, while the size of the simplified transform matrix is ​​reduced to RxN. Therefore, compared to performing a normal transform, memory usage during RST can be reduced by a ratio of R / N. Furthermore, compared to the number of multiplication operations (NxN) required when using a normal transform kernel matrix, the number of multiplication operations can be reduced by a ratio of R / N (RxN) 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 the number of transform coefficients derived when applying a normal transform (N). This reduces 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 improved through the RST.

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

[0244] 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).

[0245] Thereafter, the transform unit 232 can derive transform coefficients by performing RST based on one of the transform kernel matrices included in the transform set (S1210).

[0246] In this embodiment, the transform coefficients are modified transform coefficients that are subjected to a primary transform followed by a secondary transform, and each transform set may include two transform kernel matrices.

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

[0248] First, the entropy encoding unit 240 may derive a syntax element value for a transform index indicating one of the transform kernel matrices included in the transform set (S1220).

[0249] The transform index syntax element in this embodiment can indicate whether (inverse) RST is applied and which one 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 can be three.

[0250] In one embodiment, the syntax element value for the transform index can be derived as 0, which indicates that no (inverse) RST is applied to the target block, 1, which indicates the first transform kernel matrix among the transform kernel matrices, or 2, which indicates the second transform kernel matrix among the transform kernel matrices.

[0251] Thereafter, the entropy encoding unit 240 may binarize the syntax element values ​​for the derived transform indexes (S1230).

[0252] The entropy encoding unit 240 can binarize the syntax element values ​​for the three transform indexes using a truncated unary code method to 0, 10, and 11. That is, the value 0 for the syntax element can be binarized as "0," the value 1 for the syntax element can be binarized as "10," and the value 2 for the syntax element can be binarized as "11." The entropy encoding unit 240 can binarize the syntax elements for the derived transform indexes to any one of "0," "10," and "11."

[0253] The entropy encoding unit 240 may derive context information, i.e., a context model, for the bin string of the transformation index (S1240), and encode the bins of the bin string of the syntax element based on the context information (S1250).

[0254] According to this embodiment, different context information can be applied to two bins of the transform index, i.e., the two bins of the transform index can be encoded using a context method other than the bypass method, and the first bin of the bins of the syntax elements for the transform index can be encoded based on first context information, and the second bin of the bins of the syntax elements for the transform index can be encoded based on second context information.

[0255] The bin string of the encoded syntax elements can be output to the decoding device 300 or to the outside in the form of a bitstream.

[0256] In the above-described embodiments, the method is described based on a flowchart as 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 above. Furthermore, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, and other steps may be included, or one or more steps in the flowcharts may be deleted without affecting the scope of this document.

[0257] The method according to the present document described above may be implemented in the form of software, and the encoding device and / or decoding device according to the present document may 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.

[0258] When the embodiments herein are implemented in software, the methods 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, memory cards, storage media, and / or other storage devices. That is, the embodiments described herein may be implemented and performed on a processor, microprocessor, controller, or chip. For example, the functional units shown in the figures may be implemented and performed on a computer, processor, microprocessor, controller, or chip.

[0259] In addition, the decoding device and encoding device to which this document is applied may be included in, and may be used to process video signals or data signals, 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 customized video (VoD) service providing device, an over-the-top (OTT) video device, an internet streaming service providing device, a three-dimensional (3D) video device, a video telephone video device, a medical video device, etc. 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.

[0260] Furthermore, the processing method to which this document is applied may be produced in the form of a computer-executable program and stored in a computer-readable recording medium. Multimedia data having a data structure according to the present invention may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable recording medium may also include media implemented in the form of a carrier wave (e.g., transmission via the Internet). The bitstream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network. The embodiments of this document may be implemented as a computer program product using program code, which can be executed by a computer according to the embodiments of this document. The program code may be stored on a computer-readable carrier.

[0261] FIG. 13 shows an exemplary structure of a content streaming system to which this document applies.

[0262] Furthermore, the content streaming system to which this document applies can broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

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

[0264] 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 that informs 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.

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

[0266] 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 such as 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, deriving quantized transform coefficients for a current block from the bitstream; deriving transform coefficients via inverse quantization based on the quantized transform coefficients for the current block; deriving modified transform coefficients based on an inverse quadratic transform on the transform coefficients; deriving residual samples for the current block based on an inverse linear transform of the modified transform coefficients; generating a reconstructed picture based on the residual samples for the current block; The step of deriving the modified transform coefficients comprises: deriving a transformation kernel matrix; performing a matrix operation between the transform coefficients and the transform kernel matrix; the transformation kernel matrix is ​​derived based on a transformation index and a transformation set; the conversion index indicates at least one of first index information, second index information, and third index information; the first index information indicates that the inverse secondary transform is not applied to the current block; the second index information indicates a first transformation kernel matrix as the transformation kernel matrix for the inverse quadratic transformation; the third index information indicates a second transformation kernel matrix as the transformation kernel matrix for the inverse quadratic transformation; The transform set is determined based on an intra-prediction mode of the current block; The intra prediction mode of the current block is mapped to one of four transform sets; The transform set is determined as a first transform set index value based on whether the intra prediction mode is equal to 0 or 1; The transform set is determined as a second transform set index value based on the intra prediction mode being greater than or equal to 2 and less than or equal to 12; The transform set is determined as a third transform set index value based on the intra prediction mode being equal to or greater than 13 and equal to or less than 23; The transform set is determined as a fourth transform set index value based on the intra prediction mode being equal to or greater than 24 and equal to or less than 44; The transform set is determined as the third transform set index value based on the intra prediction mode being equal to or greater than 45 and equal to or less than 55; The transform set is determined as the second transform set index value based on the intra prediction mode being 56 or greater; A method in which a first bin for a bin string of a syntax element for the transform index is decoded based on first context information, and a second bin for the bin string of the syntax element for the transform index is decoded based on second context information.

2. A video encoding method performed by a video encoding device, deriving prediction samples based on an intra prediction mode applied to a current block; deriving residual samples for the current block based on the predicted samples; deriving transform coefficients for the current block based on a linear transform of the residual samples; deriving modified transform coefficients based on a quadratic transformation of the transform coefficients; deriving quantized transform coefficients by performing quantization based on the modified transform coefficients; encoding a transformation index associated with the transformation kernel matrix; The step of deriving the modified transform coefficients comprises: determining a transformation set and the transformation kernel matrix; performing a matrix operation between the transform coefficients and the transform kernel matrix; the conversion index indicates at least one of first index information, second index information, and third index information; the first index information indicates that the secondary transform is not applied to the current block; the second index information indicates a first transformation kernel matrix as the transformation kernel matrix for the secondary transformation; the third index information indicates a second transformation kernel matrix as the transformation kernel matrix for the secondary transformation; The transform set is determined based on the intra prediction mode of the current block; The intra prediction mode of the current block is mapped to one of four transform sets; The transform set is determined as a first transform set index value based on an intra prediction mode being equal to 0 or 1; The transform set is determined as a second transform set index value based on the intra prediction mode being greater than or equal to 2 and less than or equal to 12; The transform set is determined as a third transform set index value based on the intra prediction mode being equal to or greater than 13 and equal to or less than 23; The transform set is determined as a fourth transform set index value based on the intra prediction mode being equal to or greater than 24 and equal to or less than 44; The transform set is determined as the third transform set index value based on the intra prediction mode being equal to or greater than 45 and equal to or less than 55; The transform set is determined as the second transform set index value based on the intra prediction mode being 56 or greater; A method, wherein a first bin for a bin string of a syntax element for the transform index is encoded based on first context information, and a second bin for the bin string of the syntax element for the transform index is encoded based on second context information.

3. A method for transmitting data relating to video, comprising: obtaining a bitstream relating to the video, the bitstream comprising: deriving prediction samples based on an intra prediction mode applied to a current block; deriving residual samples for the current block based on the predicted samples; deriving transform coefficients for the current block based on a linear transform of the residual samples; deriving modified transform coefficients based on a quadratic transformation of the transform coefficients; deriving quantized transform coefficients by performing quantization based on the modified transform coefficients; generating the bitstream by encoding video information including residual information associated with the quantized transform coefficients and transform indices associated with a transform kernel matrix; transmitting the data including the bitstream; The step of deriving the modified transform coefficients comprises: determining a transformation set and the transformation kernel matrix; performing a matrix operation between the transform coefficients and the transform kernel matrix; the conversion index indicates at least one of first index information, second index information, and third index information; the first index information indicates that the secondary transform is not applied to the current block; the second index information indicates a first transformation kernel matrix as the transformation kernel matrix for the secondary transformation; the third index information indicates a second transformation kernel matrix as the transformation kernel matrix for the secondary transformation; The transform set is determined based on the intra prediction mode of the current block; The intra prediction mode of the current block is mapped to one of four transform sets; The transform set is determined as a first transform set index value based on an intra prediction mode being equal to 0 or 1; The transform set is determined as a second transform set index value based on the intra prediction mode being greater than or equal to 2 and less than or equal to 12; The transform set is determined as a third transform set index value based on the intra prediction mode being equal to or greater than 13 and equal to or less than 23; The transform set is determined as a fourth transform set index value based on the intra prediction mode being equal to or greater than 24 and equal to or less than 44; The transform set is determined as the third transform set index value based on the intra prediction mode being equal to or greater than 45 and equal to or less than 55; The transform set is determined as the second transform set index value based on the intra prediction mode being 56 or greater; A method, wherein a first bin for a bin string of a syntax element for the transform index is encoded based on first context information, and a second bin for the bin string of the syntax element for the transform index is encoded based on second context information.