Method and apparatus for processing video signal
Non-separable transforms and adaptive multiple transforms improve coding efficiency and reduce complexity in processing high-resolution video content, addressing the challenges of increased memory and processing demands.
Patent Information
- Application Number
- JP2024098614
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2018-09-05
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2039-09-05
AI Technical Summary
Existing video encoding technologies face challenges in efficiently processing next-generation video content with high spatial resolution, frame rate, and scene representation, leading to increased memory storage and processing demands.
The implementation of non-separable transforms, such as non-separable secondary transforms (NSST) and adaptive multiple transforms (AMT), tailored to the size and intra prediction mode of video blocks, to enhance coding efficiency and reduce complexity.
This approach enables high coding efficiency and reduced computational complexity in processing video signals, effectively managing the demands of next-generation video content.
Smart Images

Figure 2024120019000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a method and device for processing a video signal, in particular for encoding or decoding a video signal by performing a transformation. [Background technology]
[0002] Compression coding refers to a series of signal processing techniques for transmitting digitalized information over communication lines or storing it in a form suitable for storage media. Media such as video, images, and audio can be subject to compression coding, and the technology that performs compression coding on video in particular is called video compression.
[0003] Next-generation video content will have characteristics such as high spatial resolution, high frame rate, and high dimensionality of scene representation. Processing such content will bring about a huge increase in memory storage, memory access rate, and processing power.
[0004] Therefore, it is necessary to design coding tools to process next-generation video content more efficiently. In particular, video codec standards following the high efficiency video coding (HEVC) standard require more accurate prediction techniques as well as efficient conversion techniques for converting spatial domain video signals to frequency domain. Summary of the Invention [Problem to be solved by the invention]
[0005] SUMMARY OF THE PRESENT EMBODIMENTS The present invention seeks to provide an image signal processing method and apparatus for applying a transform having high coding efficiency and low complexity.
[0006] The technical problems to be solved by the present invention are not limited to those mentioned above, and other technical problems not mentioned should be clearly understood by a person having ordinary skill in the art to which the present invention pertains from the description below. [Means for solving the problem]
[0007] A method for decoding an image signal according to an embodiment of the present invention includes the steps of determining an input length and an output length of a non-separable transform based on a height and a width of a current block, determining a non-separable transform matrix corresponding to the input length and the output length of the non-separable transform, and applying the non-separable transform matrix to a number of coefficients in the current block corresponding to the input length, wherein the height and width of the block are greater than or equal to 8, and if the height and width of the current block are each 8, the input length of the non-separable transform is determined to be 8.
[0008] Also, if the height and width of the current block are not 8, the input length of the non-separable transform is determined to be 16.
[0009] In addition, the output length is determined to be 48 or 64.
[0010] In addition, the step of applying the non-separable transformation matrix to the current block includes the step of applying the non-separable transformation matrix to a 4×4 region in the upper left corner of the current block if the height and width are not each 8 and the product of the width and height is less than a critical value.
[0011] In addition, the step of determining the non-separable transform matrix includes the steps of determining a non-separable transform set index based on an intra-prediction mode of the current block, determining a non-separable transform kernel corresponding to the non-separable transform index within a non-separable transform set included in the non-separable transform set index, and determining the non-separable transform matrix from the non-separable transform kernel based on the input length and the output length.
[0012] According to another embodiment of the present invention, an image signal processing device includes a memory for storing the image signal, and a processor coupled to the memory, wherein the processor is configured to determine an input length and an output length of a non-separable transform based on a height and a width of a current block, determine a non-separable transform matrix corresponding to the input length and the output length of the non-separable transform, and apply the non-separable transform matrix to a number of coefficients in the current block corresponding to the input length, wherein if the height and width of the current block are greater than or equal to 8, and the height and width of the current block are each 8, then the input length of the non-separable transform is determined to be 8, and the output length is determined to be greater than the input length and less than or equal to 64. Effect of the Invention
[0013] According to an embodiment of the present invention, a video coding method and apparatus having high coding efficiency and low complexity can be provided by applying a transformation based on the size of a current block.
[0014] The effects obtained by the present invention are not limited to those mentioned above, and other effects not mentioned will be clearly understood by those having ordinary skill in the art to which the present invention pertains from the following description. [Brief description of the drawings]
[0015] The accompanying drawings, which are included as part of the detailed description to aid in understanding the present invention, provide embodiments of the present invention and, together with the detailed description, explain the technical features of the present invention.
[0016] [Figure 1] 1 shows a schematic block diagram of an encoding device according to an embodiment of the present invention, in which a video / image signal is encoded. [Diagram 2] 1 is a schematic block diagram of a decoding device according to an embodiment of the present invention, in which an image signal is decoded; [Diagram 3] These are embodiments to which the present invention can be applied, and FIG. 3A is a diagram for explaining a block division structure using QT (quadtree: QT), FIG. 3B is a block division structure using BT (binary tree: BT), FIG. 3C is a block division structure using TT (ternary tree: TT), and FIG. 3D is a block division structure using AT (asymmetric tree: AT). [Figure 4] FIG. 2 shows a schematic block diagram of a transform and quantization unit and an inverse quantization and inverse transform unit in the encoding device of FIG. 1, which is an embodiment to which the present invention is applied. [Diagram 5] 1 is a schematic block diagram of an inverse quantization and inverse transform unit in a decoding device according to an embodiment of the present invention; [Figure 6] 2 shows a flowchart of an embodiment of the present invention for encoding a video signal through primary and secondary transformation; [Figure 7] 1 shows a flowchart of an embodiment to which the present invention is applied, in which a video signal is decoded by secondary inverse transform and primary inverse transform. [Figure 8] 1 illustrates an example of a transform configuration group to which adaptive multiple transform (AMT) is applied according to an embodiment of the present invention. [Figure 9] 1 shows an example of an encoding flowchart in which AMT is applied according to an embodiment of the present invention. [Figure 10] 1 shows an example of a decoding flowchart in which AMT is applied according to an embodiment of the present invention. [Figure 11] 1 illustrates an example of a flowchart for encoding an AMT flag and an AMT index according to an embodiment of the present invention. [Figure 12]13 shows an example of a decoding flowchart for performing conversion based on an AMT flag and an AMT index. [Figure 13] 1 shows a diagram for explaining Givens rotation, which is an embodiment to which the present invention is applied. [Figure 14] This is an embodiment to which the present invention is applied, and shows the configuration of one round in 4×4 NSST composed of a Givens rotation layer and permutation. [Figure 15] 1 illustrates an example of a configuration of a non-separable transform set for each intra-prediction mode according to an embodiment of the present invention. [Figure 16] 1 shows three forward scan orders for transform coefficients or transform coefficient blocks applied in the high efficiency video coding (HEVC) standard, where (a) shows a diagonal scan, (b) shows a horizontal scan, and (c) shows a vertical scan. [Figure 17] 13 shows positions of transform coefficients when a forward diagonal scan is applied to a 4×8 block in an embodiment to which the present invention is applied. [Figure 18] An example of an embodiment to which the present invention is applied is shown, in which valid transform coefficients of two 4×4 blocks are merged into one block. [Figure 19] 10 shows an example of a method for constructing an NSST set mixed for each intra prediction mode, which is an embodiment to which the present invention is applied. [Figure 20] An example of a method for selecting an NSST set (or kernel) taking into consideration an intra prediction mode and a transform block size will be described below as an embodiment to which the present invention is applied. [Figure 21A] 1 shows an embodiment to which the present invention is applied, in which forward and inverse contracted transforms are shown. [Figure 21B] 1 shows an embodiment to which the present invention is applied, in which forward and inverse contracted transforms are shown. [Figure 22]4 illustrates an example of a decoding flowchart using a reduced transform according to an embodiment of the present invention. [Diagram 23] 1 illustrates an example of a flowchart for application of a conditional contracted transformation in accordance with an embodiment of the present invention. [Figure 24] 1 illustrates an example of a decoding flowchart for a secondary inverse transform to which a conditional contracted transform is applied in accordance with an embodiment of the present invention. [Figure 25A] 4 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 25B] 4 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 26A] 4 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 26B] 4 illustrates an example of a reduced transform and a reduced inverse transform according to an embodiment of the present invention. [Figure 27] 4 illustrates an example of a domain to which a reduced quadratic transform is applied according to an embodiment of the present invention. [Figure 28] 4 illustrates a downsized transformation according to a downsizing factor according to an embodiment of the present invention. [Figure 29] 10 shows an example of an encoding flowchart for performing conversion according to an embodiment to which the present invention is applied. [Diagram 30] 10 shows an example of a decoding flowchart for performing conversion according to an embodiment to which the present invention is applied. [Diagram 31] 1 is a detailed block diagram of a conversion unit in an encoding device according to an embodiment of the present invention; [Diagram 32] 1 is a detailed block diagram of an example of an inverse transform unit in a decoding device according to an embodiment of the present invention; [Diagram 33] 4 shows an example of a decoding flowchart in which a transformation according to an embodiment of the present invention is applied; [Diagram 34] 1 shows an example of a block diagram of an apparatus for processing a video signal according to an embodiment of the present invention; [Diagram 35]1 shows an example of an image coding system as an embodiment to which the present invention is applied. [Diagram 36] 1 is a structural diagram of a content streaming system according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. The detailed description disclosed below together with the accompanying drawings is intended to describe exemplary embodiments of the present invention, and is not intended to show the only embodiments in which the present invention can be implemented. The following detailed description includes specific details to provide a complete understanding of the present invention. However, those skilled in the art will appreciate that the present invention can be implemented without such specific details.
[0018] In some cases, in order to avoid obscuring the concept of the present invention, well-known structures and devices may be omitted or shown in the form of a block diagram focusing on the core functions of each structure and device.
[0019] In some cases, in order to avoid obscuring the concept of the present invention, well-known structures and devices may be omitted or shown in the form of a block diagram focusing on the core functions of each structure and device.
[0020] Specific terms used in the following description are provided to aid in understanding the present invention, and the use of such specific terms may be changed to other forms without departing from the technical spirit of the present invention. For example, in the case of a signal, data, sample, picture, frame, block, etc., they may be appropriately substituted and interpreted in each coding process.
[0021] Hereinafter, in this specification, the term "processing unit" refers to a unit in which encoding / decoding processes such as prediction, transformation, and / or quantization are performed. In addition, the processing unit may be interpreted to include a unit of a luma component and a unit of a chroma component. For example, the processing unit may correspond to a block, a coding unit (CU), a prediction unit (PU), or a transform unit (TU).
[0022] Also, the processing unit may be interpreted as a unit of a luminance component or a unit of a chrominance component. For example, the processing unit may correspond to a CTB, CB, PU, or TB of a luminance component. Or, the processing unit may correspond to a CTB, CB, PU, or TB of a chrominance component. Also, without being limited thereto, the processing unit may be interpreted to include a unit of a luminance component and a unit of a chrominance component.
[0023] Furthermore, the processing units are not necessarily limited to square blocks, but may be configured in the shape of polygons having three or more vertices.
[0024] In the following description, pixels, picture elements, or coefficients (transformation coefficients or transformation coefficients that have undergone linear transformation) are collectively referred to as samples. Using a sample means using a pixel value, picture element value, or coefficient (transformation coefficients or transformation coefficients that have undergone linear transformation).
[0025] Hereinafter, a method for designing and applying a reduced secondary transform (RST) that takes into account the worst case computational complexity for encoding / decoding still or moving images will be described.
[0026] The present invention provides an image and video compression method and apparatus. Compressed data is in the form of a bitstream, and the bitstream can be stored in various types of storage or can be streamed over a network and transmitted to a terminal having a decoder. When a display device is installed in the terminal, the decoded image can be displayed on the display device, or the bitstream data can simply be stored. The method and apparatus proposed in the embodiments of the present invention can be applied to both an encoder and a decoder, and can be applied to both a device that generates a bitstream or a device that receives a bitstream, regardless of whether the terminal outputs the data through a display device or not.
[0027] The image compression device is composed of a prediction unit, a transformation and quantization unit, and an entropy coding unit, and schematic block diagrams of the encoding device and the decoding device are shown in Figures 1 and 2. Among them, the transformation and quantization unit subtracts a prediction signal from an original signal, converts the residual signal into a frequency domain signal by a transformation such as DCT (discrete cosine transform)-2, and then applies quantization to significantly reduce the number of non-zero signals, enabling image compression.
[0028] FIG. 1 is a schematic block diagram of an encoding device according to an embodiment of the present invention, in which a video / image signal is encoded.
[0029] The image division unit 110 divides an input image (or picture, frame) input to the encoding device 100 into one or more processing units. For example, the processing units may be called coding units (CUs). In this case, the coding units are recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree (QTBT) structure. For example, one coding unit is divided into a plurality of coding units of a deeper depth based on a quad-tree structure and / or a binary tree structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present invention is performed based on the final coding unit that is not further divided. In this case, the largest coding unit may be used as the final coding unit immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure includes procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit are each divided or partitioned from the final coding unit described above. The prediction unit is a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0030] The unit may be mixed with terms such as block or area in some cases. In the general case, an M×N block indicates a set of samples or transform coefficients consisting of M columns and N rows. A sample generally indicates a pixel or pixel value, and may indicate only the value of a pixel / pixel of a luma component, or may indicate only the value of a pixel / pixel of a chroma component. A sample can be used as a term that corresponds to a pixel or pel of one picture (or image).
[0031] The encoding device 100 subtracts a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 180 or the intra prediction unit 185 from an input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array), and the generated residual signal is transmitted to the conversion unit 120. In this case, as shown in the figure, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoder 100 may be called a subtraction unit 115. The prediction unit performs prediction on a block to be processed (hereinafter, referred to as a current block) and generates a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit generates various information related to prediction, such as prediction mode information, as described later in the description of each prediction mode, and transmits the information to the entropy encoding unit 190. The prediction information is encoded in the entropy encoding unit 190 and output in the form of a bitstream.
[0032] The intra prediction unit 185 predicts the current block by referring to samples in the current picture. The referenced samples are located in the neighborhood of the current block or away from the current block depending on the prediction mode. In the intra prediction, the prediction modes include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 185 may also determine the prediction mode to be applied to the current block using the prediction modes applied to the neighboring blocks.
[0033] The inter prediction unit 180 may derive a predicted block for a current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information includes a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 180 may generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block by forming a motion information candidate list based on the neighboring blocks. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 180 may use the motion information of the neighboring blocks as the motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal may not be transmitted. In the case of a motion vector prediction (MVP) mode, the motion vector of the current block may be indicated by using the motion vector of the neighboring blocks as a motion vector predictor and signaling a motion vector difference.
[0034] The prediction signal generated by the inter prediction unit 180 or the intra prediction unit 185 is used to generate a reconstructed signal or is used to generate a residual signal.
[0035] The transform unit 120 applies a transform technique to the residual signal to generate transform coefficients. For example, the transform technique includes at least one of DCT, DST (Discrete Sine Transform), KLT (Karhunen-Loeve Transform), GBT (Graph-Based Transform), or CNT (Conditionally Non-linear Transform). Here, GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on a predicted signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or may be applied to blocks of variable sizes that are not square.
[0036] The quantizer 130 quantizes the transform coefficients and transmits them to the entropy encoder 190, which encodes the quantized signal (information on the quantized transform coefficients) and outputs it to a bitstream. The information on the quantized transform coefficients may be called residual information. The quantizer 130 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 190 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 190 may encode information required for video / image restoration (e.g., values of syntax elements) together with or separately from the quantized transform coefficients. The encoded information (e.g., video / image information) is transmitted or stored in the form of a bitstream in network abstraction layer (NAL) units. The bitstream is transmitted over a network or stored in a digital storage medium. Here, the network includes a broadcast network and / or a communication network, and the digital storage medium includes various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting and / or a storage unit (not shown) for storing the signal output from the entropy encoding unit 190 may be configured as an internal / external element of the encoding device 100, or the transmitter may be a component of the entropy encoding unit 190.
[0037] The quantized transform coefficients output from the quantizer 130 may be used to generate a prediction signal. For example, the quantized transform coefficients may be subjected to inverse quantization and inverse transformation by the inverse quantizer 140 and the inverse transformer 150 in the loop to restore a residual signal. The adder 155 adds the restored residual signal to the prediction signal output from the inter predictor 180 or the intra predictor 185 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). When there is no residual for the current block, such as when the skip mode is applied, the predicted block may be used as a reconstructed block. The adder 155 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, or may be used for inter prediction of the next picture after filtering as described below.
[0038] The filtering unit 160 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 160 applies various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and transmits the modified reconstructed picture to the decoded picture buffer 170. The various filtering methods include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, and the like. The filtering unit 160 generates various information related to filtering, as will be described later in the description of each filtering method, and transmits the information to the entropy encoding unit 190. The information related to filtering is encoded in the entropy encoding unit 190 and output in the form of a bitstream.
[0039] The modified decoded picture transmitted to the decoded picture buffer 170 is used as a reference picture in the inter prediction unit 180. In this way, when inter prediction is applied, the encoding device 100 can avoid a prediction mismatch between the encoding device 100 and a decoding device, and can also improve coding efficiency.
[0040] The decoded picture buffer 170 may store the modified reconstructed picture for use as a reference picture in the inter predictor 180 .
[0041] FIG. 2 is a schematic block diagram of a decoding device that decodes an image signal, according to an embodiment of the present invention.
[0042] As shown in FIG. 2, the decoding device 200 includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an adder 235, a filtering unit 240, a decoded picture buffer (DPB) 250, an inter prediction unit 260, and an intra prediction unit 265. The inter prediction unit 260 and the intra prediction unit 265 may be collectively referred to as a prediction unit. That is, the prediction unit includes an inter prediction unit 180 and an intra prediction unit 185. The inverse quantization unit 220 and the inverse transform unit 230 may be collectively referred to as a residual processing unit. That is, the residual processing unit includes an inverse quantization unit 220 and an inverse transform unit 230. The entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the adder 235, the filtering unit 240, the inter prediction unit 260, and the intra prediction unit 265 may be configured as one hardware component (e.g., a decoder or a processor) according to an embodiment. Also, the decoded picture buffer 250 may be implemented as a single hardware component (eg, a memory or a digital storage medium) depending on the embodiment.
[0043] When a bitstream including video / image information is input, the decoding apparatus 200 can restore an image corresponding to the process in which the video / image information is processed in the encoding apparatus 100 of Fig. 2. For example, the decoding apparatus 200 performs decoding using a processing unit applied in the encoding apparatus 100. Thus, the processing unit for decoding is, for example, a coding unit, and the coding unit is divided from a coding tree unit or a maximum coding unit according to a quad tree structure and / or a binary tree structure. Then, the restored image signal decoded and output by the decoding apparatus 200 is reproduced by a reproduction device.
[0044] The decoding device 200 receives a signal output from the encoding device 100 of Fig. 2 in the form of a bitstream, and the received signal is decoded through the entropy decoding unit 210. For example, the entropy decoding unit 210 parses the bitstream to derive information (e.g., video / image information) required for image restoration (or picture restoration). For example, the entropy decoding unit 210 may decode information in the bitstream based on a coding method such as Exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients related to the residual. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in the bitstream, determines a context model using information on the syntax element to be decoded and decoding information on the neighboring and blocks to be decoded or information on symbols / bins decoded in a previous step, predicts the occurrence probability of the bin according to the determined context model, and performs arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element. Here, the CABAC entropy decoding method may update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Prediction information among the information decoded in the entropy decoding unit 210 is provided to a prediction unit (inter prediction unit 260 and intra prediction unit 265), and residual values entropy decoded in the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, are input to the inverse quantization unit 220. In addition, information regarding filtering among the information decoded by the entropy decoding unit 210 is provided to the filtering unit 240. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device 100 may be further configured as an internal / external element of the decoding device 200, or the receiving unit may be a component of the entropy decoding unit 210.
[0045] The inverse quantization unit 220 inverse quantizes the quantized transform coefficients and outputs transform coefficients. The inverse quantization unit 220 rearranges the quantized transform coefficients in a two-dimensional block format. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding apparatus 100. The inverse quantization unit 220 performs inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0046] The inverse transform unit 230 obtains a residual signal (residual block, residual sample array) by inverse transforming the transform coefficients.
[0047] The prediction unit performs prediction on the current block and generates a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on the prediction information output from the entropy decoding unit 210, and may determine a specific intra / inter prediction mode.
[0048] The intra prediction unit 265 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. Prediction modes in intra prediction include all of a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 265 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.
[0049] The inter prediction unit 260 derives a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information is 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 inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 260 configures a motion information candidate list based on information on prediction of the neighboring blocks, and derives a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter prediction is performed based on various prediction modes, and the prediction information includes information indicating the mode of inter prediction for the current block.
[0050] The adder 235 generates a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from the inter prediction unit 260 or the intra prediction unit 265. When there is no residual for the current block, such as when the skip mode is applied, the predicted block can be used as the reconstructed block.
[0051] The adder 235 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 a current picture, or may be used for inter prediction of a next picture after filtering as described below.
[0052] The filtering unit 240 can improve the subjective / objective picture quality by applying filtering to the reconstructed signal. For example, the filtering unit 240 applies various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and transmits the modified reconstructed picture to the decoded picture buffer 250. The various filtering methods include, for example, deblocking filtering, sample adaptive offset (SAO), adaptive loop filter (ALF), and bilateral filter.
[0053] The modified decoded picture sent to the decoded picture buffer 250 can be used as a reference picture by the inter predictor 260.
[0054] In this document, the embodiments described for the filtering unit 160, the inter prediction unit 180, and the intra prediction unit 185 of the encoding device 100 are equally or correspondingly applicable to the filtering unit 240, the inter prediction unit 260, and the intra prediction unit 265 of the decoding device 200, respectively.
[0055] FIG. 3 shows an embodiment to which the present invention can be applied, in which FIG. 3A is a diagram for explaining a block division structure using QT (quadtree: QT), FIG. 3B is a block division structure using BT (binary tree: BT), FIG. 3C is a block division structure using TT (ternary tree: TT), and FIG. 3D is a block division structure using AT (asymmetric tree: AT).
[0056] In video coding, a block may be divided on a QT basis. A subblock divided by QT may be further divided recursively using QT. A leaf block that is not further divided by QT is divided by at least one of BT, TT, and AT. BT may have two types of division, horizontal BT (2N×N, 2N×N) and vertical BT (N×2N, N×2N). TT may have two types of division, horizontal TT (2N×1 / 2N, 2N×N, 2N×1 / 2N) and vertical TT (1 / 2N×2N, N×2N, 1 / 2N×2N). The AT can have four forms of partitioning: horizontal-up AT (2N x 1 / 2N, 2N x 3 / 2N), horizontal-down AT (2N x 3 / 2N, 2N x 1 / 2N), vertical-left AT (1 / 2N x 2N, 3 / 2N x 2N), and vertical-right AT (3 / 2N x 2N, 1 / 2N x 2N). Each BT, TT, and AT may be further partitioned recursively using BT, TT, and AT.
[0057] Figure 3A shows an example of QT partitioning. Block A is partitioned into four sub-blocks (A0, A1, A2, A3) by QT. Sub-block A1 is again partitioned into four sub-blocks (B0, B1, B2, B3) by QT.
[0058] FIG. 3B shows an example of BT division. Block B3, which is not further divided by QT, is divided into vertical BT(C0, C1) or horizontal BT(D0, D1). Like block C0, each sub-block is further divided recursively, such as in the form of horizontal BT(E0, E1) or vertical BT(F0, F1).
[0059] 3C shows an example of TT division. Block B3, which is not further divided by QT, is divided into vertical TTs (C0, C1, C2) or horizontal TTs (D0, D1, D2). Like block C1, each sub-block is further divided recursively, such as in the form of horizontal TTs (E0, E1, E2) or vertical TTs (F0, F1, F2).
[0060] 3D shows an example of AT division. Block B3, which is not further divided by QT, is divided into vertical AT(C0, C1) or horizontal AT(D0, D1). Like block C1, each sub-block can be further divided recursively, such as in the form of horizontal AT(E0, E1) or vertical TT(F0, F1).
[0061] Meanwhile, BT, TT, and AT division may be used together. For example, a subblock divided by BT can be divided by TT or AT. Also, a subblock divided by TT can be divided by BT or AT. A subblock divided by AT can be divided by BT or TT. For example, after horizontal BT division, each subblock can be divided into vertical BT, or after vertical BT division, each subblock can be divided into horizontal BT. In this case, the division order is different, but the final divided shape is the same.
[0062] Also, when a block is divided, the order of searching the block can be defined in various ways. In general, the search is performed from left to right and from top to bottom, and searching the block means the order of determining whether each divided sub-block can be further divided into blocks, the order of coding each sub-block if the block is not further divided, or the order of searching when referring to information of other adjacent blocks in a sub-block.
[0063] Transformation may be performed for each processing unit (or transformation block) divided according to the division structure as shown in Figures 3A to 3D, and in particular, transformation matrices may be applied by dividing into row and column directions. According to an embodiment of the present invention, different transformation types may be used depending on the length of the processing unit (or transformation block) in the row or column direction.
[0064] 4 and 5 are embodiments to which the present invention is applied. FIG. 4 shows a schematic block diagram of the transform and quantization unit 120 / 130 and the inverse quantization and inverse transform unit 140 / 150 in the encoding device 100 of FIG. 1, and FIG. 5 shows a schematic block diagram of the inverse quantization and inverse transform unit 220 / 230 in the decoding device 200.
[0065] 4, the transform and quantization unit 120 / 130 includes a primary transform unit 121, a secondary transform unit 122, and a quantization unit 130. The inverse quantization and inverse transform unit 140 / 150 includes an inverse quantization unit 140, an inverse secondary transform unit 151, and an inverse primary transform unit 152.
[0066] As shown in FIG. 5, the inverse quantization and inverse transform unit 220 / 230 includes an inverse quantization unit 220 , an inverse secondary transform unit 231 and an inverse primary transform unit 232 .
[0067] In the present invention, the transformation is performed through multiple stages. For example, as shown in Figure 4, two stages of a primary transform and a secondary transform can be applied, and more transformation stages can be used depending on the algorithm. Here, the primary transform may be called a core transform.
[0068] The linear transform unit 121 applies a linear transform to the residual signal, where the linear transform may already be defined as a table in the encoder and / or decoder.
[0069] The secondary transform unit 122 applies a secondary transform to the primary transformed signal, where the secondary transform may already be defined as a table in the encoder and / or decoder.
[0070] In one embodiment, a non-separable secondary transform (NSST) may be conditionally applied as the secondary transform. For example, the NSST may be applied only for intra-frame prediction blocks, and may have a set of applicable transforms for each prediction mode group.
[0071] Here, the prediction mode group is set based on symmetry with respect to the prediction direction. For example, since the prediction mode 52 and the prediction mode 16 are symmetric with respect to the prediction mode 34 (diagonal direction), they form one group and can be applied with the same transform set. Here, when applying a transform to the prediction mode 52, the input data is transposed before being applied, because the transform set is the same as that of the prediction mode 16.
[0072] On the other hand, in the case of planar mode and DC mode, since there is no symmetry with respect to the direction, each mode has its own transformation set, which can be composed of two transformations, while for the remaining directional modes, each transformation set can be composed of three transformations.
[0073] The quantization unit 130 quantizes the secondary transformed signal.
[0074] The inverse quantization and inverse transformation unit 140 / 150 performs the above-described process in reverse, and a duplicated description will be omitted.
[0075] FIG. 5 shows a schematic block diagram of the inverse quantization and inverse transform unit 220 / 230 in the decoding device 200.
[0076] As shown in FIG. 5, the inverse quantization and inverse transform unit 220 / 230 includes an inverse quantization unit 220 , an inverse secondary transform unit 231 and an inverse primary transform unit 232 .
[0077] The inverse quantization unit 220 obtains transform coefficients from the entropy decoded signal using the quantization step size information.
[0078] Inverse secondary transform unit 231 performs an inverse secondary transform on the transform coefficients. Here, the inverse secondary transform refers to the inverse transform of the secondary transform described with reference to FIG.
[0079] The inverse primary transform unit 232 performs an inverse primary transform on the inverse secondary transformed signal (or block) to obtain a residual signal. Here, the inverse primary transform refers to an inverse transform of the primary transform described in FIG. 4.
[0080] 6 is a flowchart showing an embodiment of the present invention, in which a video signal is encoded by primary and secondary transformation. Each operation shown in FIG.
[0081] The encoding device 100 determines (or selects) a forward secondary transform based on at least one of a prediction mode, a block shape, and / or a block size of a current block (S610).
[0082] The encoding device 100 can determine an optimal forward secondary transformation by rate-distortion optimization. The optimal forward secondary transformation corresponds to one of a plurality of transformation combinations, and the plurality of transformation combinations are defined by transformation indices. For example, for rate-distortion optimization, the encoding device 100 can compare the results of performing all of forward secondary transformation, quantization, residual coding, etc. for each candidate.
[0083] The encoding device 100 signals (S620) a secondary transformation index corresponding to the optimal forward secondary transformation. Here, the secondary transformation index can be applied to other embodiments described in this specification.
[0084] On the other hand, the encoding device 100 performs a forward primary transformation on the current block (residual block) (S630).
[0085] The encoding device 100 performs a forward secondary transformation on the current block using the optimal forward secondary transformation (S640). On the other hand, the forward secondary transformation can be the RST described below. RST means a transformation in which N pieces of residual data (N×1 residual vector) are input and R pieces of transform coefficient data (R×1 transform coefficient vector) are output (R < N).
[0086] As one embodiment, RST can be applied to a specific region of the current block. For example, when the current block is N×N, the specific region can mean the upper left N / 2×N / 2 region. However, the present invention is not limited to this, and is set to vary depending on at least one of the prediction mode, block shape, or block size. For example, when the current block is N×N, the specific region can mean the upper left M×M region (M≦N).
[0087] On the other hand, the encoding device 100 generates a transform coefficient block by performing quantization on the current block (S650).
[0088] The encoding device 100 may perform entropy encoding on the transform coefficient blocks to generate a bitstream.
[0089] 7 is a flowchart showing an embodiment of the present invention, in which a video signal is decoded by secondary inverse transform and primary inverse transform. Each operation shown in FIG.
[0090] The decoding device 200 obtains a secondary transform index from the bitstream (S710).
[0091] The decoding device 200 derives a secondary transform corresponding to the secondary transform index (S720).
[0092] However, steps S710 and S720 are merely exemplary embodiments, and the present invention is not limited thereto. For example, the decoding device 200 may derive the secondary transform based on at least one of the prediction mode, the block shape, and / or the block size of the current block without obtaining the secondary transform index.
[0093] Meanwhile, the decoder 200 entropy decodes the bitstream to obtain a transform coefficient block, and performs inverse quantization on the transform coefficient block (S730).
[0094] The decoder 200 performs an inverse secondary transform on the dequantized transform coefficient block (S740). For example, the inverse secondary transform may be an inverse RST. The inverse RST is a transpose matrix of the RST described in FIG. 6, and refers to a transform in which R transform coefficient data (Rx1 transform coefficient vector) is input and N residual data (Nx1 residual vector) is output.
[0095] In one embodiment, the reduced secondary transform may be applied to a specific region of the current block. For example, when the current block is N×N, the specific region may refer to the N / 2×N / 2 region on the upper left side. However, the present invention is not limited thereto, and may be set differently depending on at least one of the prediction mode, the block shape, or the block size. For example, when the current block is N×N, the specific region may refer to the M×M region (M≦N) or M×L (M≦N, L≦N) on the upper left side.
[0096] Then, the decoder 200 performs an inverse primary transform on the result of the inverse secondary transform (S750).
[0097] The decoder 200 generates a residual block in step S750, and generates a reconstructed block by adding the residual block and the prediction block.
[0098] FIG. 8 illustrates an example of a transform configuration group to which adaptive multiple transform (AMT) is applied according to an embodiment of the present invention.
[0099] 8, the transform setting group is determined based on the prediction mode, and there may be six groups (G0 to G5) in total. G0 to G4 correspond to cases where intra prediction is applied, and G5 indicates a transform combination (or a transform set, or a transform combination set) applied to a residual block generated by inter prediction.
[0100] A transformation combination consists of a horizontal transform (or row transform) applied to the rows of a given 2D block and a vertical transform (or column transform) applied to the columns.
[0101] Here, each of all transform setting groups includes four transform combination candidates. The four transform combination candidates are selected or determined by transform combination indexes of 0 to 3, and the transform combination indexes are transmitted from the encoding device 100 to the decoding device 200 by an encoding procedure.
[0102] In one embodiment, residual data (or residual signals) obtained by intra prediction have different statistical characteristics depending on the intra prediction mode. Therefore, a transform other than a general cosine transform may be applied depending on the intra prediction mode as shown in Fig. 8. In this document, the transform type may be expressed as, for example, DCT-Type 2, DCT-II, or DCT-2.
[0103] As shown in Figure 8, transform set configurations are illustrated for the cases where 35 intra prediction modes are used and where 67 intra prediction modes are used. A plurality of transform combinations can be applied to each transform setting group divided in the intra prediction mode column. For example, a plurality of transform combinations (row direction transform, column direction transform) are configured with four combinations. More specifically, in group 0, DST-7 and DCT-5 can be applied to both the row (horizontal) direction and the column (vertical) direction, so four combinations are possible.
[0104] Since a total of four transform kernel combinations can be applied to each intra prediction mode, a transform combination index for selecting one of them is transmitted for each transform unit. In this document, the transform combination index is referred to as an AMT index and may be expressed as amt_idx.
[0105] In addition to the transform kernels shown in Fig. 8, there are cases where DCT-2 is optimal for both the row and column directions due to the characteristics of the residual signal. Therefore, by defining an AMT flag for each coding unit, transform can be performed adaptively. Here, when the AMT flag is 0, DCT-2 is applied to both the row and column directions, and when the AMT flag is 1, one of the four combinations can be selected or determined by the AMT index.
[0106] In one embodiment, when the AMT flag is 0, if the number of transform coefficients for one transform unit is less than 3, the transform kernel of FIG. 8 is not applied, and DST-7 is applied to all rows and columns.
[0107] In one embodiment, the transform coefficient values are parsed first, and if the number of transform coefficients is less than 3, the AMT index is not parsed and DST-7 is applied, thereby reducing the amount of side information to be transmitted.
[0108] In one embodiment, AMT is applicable only if the width and height of the transformation units are all less than or equal to 32.
[0109] In one embodiment, FIG. 8 may be pre-configured by off-line training.
[0110] In one embodiment, the AMT index may be defined by one index that can simultaneously indicate a combination of a horizontal transform and a vertical transform, or the AMT index may be defined separately by a horizontal transform index and a vertical transform index.
[0111] A technique for applying a selected transform from multiple transform kernels (e.g., DCT-2, DCT-7, DCT-8) such as the above-mentioned AMT may be referred to as multiple transform selection (MTS) or enhanced multiple transform (EMT), and an AMT index may be referred to as an MT index.
[0112] 9 shows an example of an encoding flowchart in which AMT is applied according to an embodiment of the present invention. The operations shown in FIG.
[0113] Although this document describes an embodiment that primarily applies transforms separately for the horizontal and vertical directions, the transform combination can also be composed of non-separable transforms.
[0114] It can also be configured with a mixture of separable and non-separable transforms. In this case, if a non-separable transform is used, there is no need to select a transform by row / column or by horizontal / vertical direction, and the transform combinations in Figure 8 are used only when a separable transform is selected.
[0115] In addition, the method proposed in this specification can be applied regardless of whether it is a primary transform or a secondary transform. That is, there is no restriction that it must be applied to only one of the two, and it can be applied to both. Here, the primary transform may refer to a transform for first transforming a residual block, and the secondary transform may refer to a transform for applying a transform to a block generated as a result of the primary transform.
[0116] First, the encoding device 100 determines a transform setting group corresponding to a current block (S910). Here, the transform setting group may be configured as shown in FIG.
[0117] The encoding device 100 performs a transform on a combination of candidate transforms available in the transform setting group (S920).
[0118] As a result of the transformation execution, the encoding device 100 determines or selects the transformation combination with the smallest RD (rate distortion) cost (S930).
[0119] The encoding device 100 encodes a transform combination index corresponding to the selected transform combination (S940).
[0120] 10 shows an example of a decoding flowchart in which AMT is applied according to an embodiment of the present invention. The operation shown in FIG.
[0121] First, the decoding device 200 determines a transform setting group for a current block (S1010). The decoding device 200 parses (or obtains) a transform combination index from a video signal, where the transform combination index corresponds to any one of a plurality of transform combinations in the transform setting group (S1020). For example, the transform setting group includes DCT-2, DCT-7, or DCT-8.
[0122] The decoding apparatus 200 derives a transform combination corresponding to the transform combination index (S1030). Here, the transform combination is composed of a horizontal transform and a vertical transform, and includes at least one of DCT-2, DCT-7, and DCT-8. The transform combination may use the transform combination described in FIG. 8.
[0123] The decoding apparatus 200 performs an inverse transform on the current block based on the induced transform combination (S1040). If the transform combination is composed of a row (horizontal) transform and a column (vertical) transform, the row (horizontal) transform may be applied first, and then the column (vertical) transform may be applied. However, the present invention is not limited thereto, and if the transform combination is composed of an inversely applied or non-separable transform, the non-separable transform may be applied immediately.
[0124] In one embodiment, when the vertical or horizontal transform is a DST-7 or DCT-8, the inverse DST-7 or inverse DCT-8 transform is applied column by column and then row by row, and a different vertical or horizontal transform is applied to each row and / or each column.
[0125] In one embodiment, the transform combination index may be obtained based on an AMT flag indicating whether AMT is performed. That is, the transform combination index may be obtained only when AMT is performed according to the AMT flag. In addition, the decoding apparatus 200 checks whether the number of non-zero transform coefficients is greater than a threshold value. Here, the transform combination index may be parsed only when the number of non-zero transform coefficients is greater than a threshold value.
[0126] In one embodiment, the AMT flag or AMT index is defined at least at one level of a sequence, a picture, a slice, a block, a coding unit, a transform unit, or a prediction unit.
[0127] Meanwhile, in another embodiment, the process of determining the transform set group and the process of parsing the transform combination index may be performed simultaneously, or step S1010 may be omitted since they are already set in the encoding device 100 and / or the decoding device 200.
[0128] 11 shows an example of a flowchart for encoding an AMT flag and an AMT index according to an embodiment of the present invention. The operation of FIG.
[0129] Encoding apparatus 100 determines whether AMT is applied to the current block (S1110).
[0130] If AMT is applied, encoding device 100 encodes with AMT flag=1 (S1120).
[0131] Then, the encoding device 100 determines an AMT index based on at least one of the prediction mode, horizontal transform, and vertical transform of the current block (S1130). Here, the AMT index indicates an index indicating one of a plurality of transform combinations for each intra prediction mode, and the AMT index is transmitted for each transform unit.
[0132] When the AMT index is determined, encoding device 100 encodes the AMT index (S1140).
[0133] On the other hand, if AMT is not applied, encoding device 100 performs encoding with AMT flag=0 (S1150).
[0134] FIG. 12 shows an example of a decoding flowchart for performing conversion based on the AMT flag and the AMT index.
[0135] The decoding device 200 parses the AMT flag from the bitstream (S1210), where the AMT flag indicates whether or not AMT is applied to the current block.
[0136] The decoding device 200 determines whether or not AMT is applied to the current block based on the AMT flag (S1220). For example, it determines whether or not the AMT flag is 1.
[0137] If the AMT flag is 1, the decoding apparatus 200 parses the AMT index (S1230). Here, the AMT index refers to an index indicating one of a plurality of transform combinations for each intra prediction mode, and the AMT index can be transmitted for each transform unit. Alternatively, the AMT index refers to an index indicating one of the transform combinations defined in a pre-established transform combination table, and here, the pre-established transform combination table may refer to FIG. 8, but the present invention is not limited thereto.
[0138] The decoding device 200 derives or determines the horizontal transform and the vertical transform based on at least one of the AMT index or the prediction mode (S1240).
[0139] Alternatively, the decoding apparatus 200 derives a transform combination corresponding to the AMT index. For example, the decoding apparatus 200 derives or determines a horizontal transform and a vertical transform corresponding to the AMT index.
[0140] On the other hand, if the AMT flag is 0, the decoding apparatus 200 applies the previously set vertical inverse transform to each column (S1250). For example, the vertical inverse transform may be an inverse transform of DCT-2.
[0141] Then, the decoding device 200 applies the previously set horizontal inverse transform to each row (S1260). For example, the horizontal inverse transform may be an inverse transform of DCT-2. That is, when the AMT flag is 0, a transform kernel that has already been set in the encoding device 100 or the decoding device 200 is used. For example, a commonly used transform kernel may be used instead of being defined in a transform combination table such as that in FIG. 8.
[0142] NSST (non-separable secondary transform)
[0143] A secondary transform is a process in which the result of a primary transform is used as input and a transform kernel is applied again. Primary transforms include DCT-2 and DST-7 in HEVC, and the aforementioned AMT. A non-separable transform is a process in which an NxN 2D residual block is divided into N 2 × 1 vector, and then apply N 2 ×N 2 This refers to applying the transformation kernel only once.
[0144] That is, NSST refers to a non-separable square matrix applied to a vector composed of coefficients of a transform block. In addition, although the embodiments of this document will be described focusing on NSST as an example of a non-separable transform applied to the upper left region (low frequency region) determined by the size of the block, the embodiments of the present invention are not limited to the term NSST, and any type of non-separable transform can be applied to the embodiments of the present invention. For example, a non-separable transform applied to the upper left region (low frequency region) determined by the size of the block is called a low frequency non-separable transform (LFNST). In this document, M×N transform (or transform matrix) means a matrix composed of M rows and N columns.
[0145] In NSST, the two-dimensional block data obtained by applying the linear transformation is divided into M × M blocks, and then M 2 ×M 2A non-separable transform is applied. The value of M can be 4 or 8. It is also possible to apply NSST only to a part of the region, rather than to all the regions of the 2D block obtained by the primary transform. For example, NSST can be applied only to the top-left 8×8 block. Also, only when the width and height of the 2D block obtained by the primary transform are both 8 or more, a 64×64 non-separable transform can be applied to the top-left 8×8 region, and the remaining cases can be divided into 4×4 blocks and the corresponding 16×16 non-separable transform can be applied to each of them.
[0146] M 2 ×M 2 A non-separable transformation can be applied in the form of a matrix multiplication, but to reduce the amount of calculation and memory required, it can be approximated by a combination of a Givens rotation layer and a permutation layer. Figure 13 shows one Givens rotation. As shown in Figure 13, it can be explained by one angle of one Givens rotation.
[0147] 13 and 14 are embodiments to which the present invention is applied. FIG. 13 shows a diagram for explaining Givens rotation, and FIG. 14 shows the configuration of one round in 4×4 NSST consisting of a Givens rotation layer and permutation.
[0148] Both 8x8NSST and 4x4NSST can be constructed by a hierarchical combination of Givens rotations. The matrix corresponding to one Givens rotation is shown in Equation 1, and the matrix multiplication can be represented diagrammatically as shown in Figure 13.
[0149]
number
[0150] In Figure 13, the output of the Givens rotation is t m and ncan be calculated as in Equation 2.
[0151]
number
[0152] As shown in FIG. 13, one Givens rotation rotates two data, so 32 or 8 Givens rotations are required to process 64 data (in the case of 8×8 NSST) or 16 data (in the case of 4×4 NSST), respectively. Therefore, a bundle of 32 or 8 Givens rotations can form a Givens rotation layer. As shown in FIG. 15, output data for one Givens rotation layer is transferred to input data for the next Givens rotation layer by permutation (shuffling). As shown in FIG. 15, the permutation pattern is regularly defined, and in the case of 4×4 NSST, four Givens rotation layers and corresponding permutations form one round. 4×4 NSST is performed in two rounds, and 8×8 NSST is performed in four rounds. Different rounds use the same permutation pattern, but the applied Givens rotation angles are different. Therefore, it is necessary to store angle data for all Givens rotations that make up each transformation.
[0153] As the final step, one final permutation is applied to the data output from the Givens rotation layer, and the information about the permutation is stored separately for each transformation. The permutation is applied at the end of the forward NSST, and the inverse permutation is applied first to the inverse NSST.
[0154] Inverse NSST, the Givens rotation layers and replacements applied in forward NSST are applied in the reverse order, and the angles of each Givens rotation are also rotated by taking negative (-) values.
[0155] FIG. 15 illustrates an example of a configuration of a non-separable transform set for each intra prediction mode according to an embodiment of the present invention.
[0156] Intra prediction modes to which the same NSST or NSST set is applied may form a group. In FIG. 15, 67 intra prediction modes are classified into 35 groups, and for example, modes 20 and 48 both belong to group 20 (hereinafter, mode group).
[0157] For each mode group, multiple NSSTs, not just one NSST, can be configured as a set. Each set includes a case where NSST is not applied. For example, when three different NSSTs can be applied to one mode group, it can be configured to select one of four cases, including the case where NSST is not applied. Here, an index is transmitted in TU units to distinguish one of the four cases. The number of NSSTs can be configured to be different for each mode group. For example, mode groups 0 and 1 are signaled to select one of three cases, including the case where NSST is not applied.
[0158] Embodiment 1: RST applicable to 4x4 blocks
[0159] A non-separable transform that can be applied to one 4×4 block is a 16×16 transform. That is, when the data elements constituting the 4×4 block are arranged in a row-first or column-first order, a 16×1 vector is obtained, and the non-separable transform can be applied to the 16×1 vector. A forward 16×16 transform is composed of 16 row-wise transform basis vectors, and by taking an inner product between the 16×1 vector and each transform basis vector, a transform coefficient for the transform basis vector is obtained. The process of obtaining the transform coefficients for all 16 transform basis vectors is to multiply a 16×16 non-separable transform matrix by an input 16×1 vector. The transform coefficients obtained by the matrix multiplication have the form of a 16×1 vector, but the statistical characteristics may differ depending on the transform coefficient. For example, if a 16×1 transform coefficient vector is composed of the 0th element to the 15th element, the variance of the 0th element may be greater than the variance of the 15th element. That is, the earlier an element is located, the greater its variance value is, and the greater its energy value is.
[0160] Applying an inverse 16×16 non-separable transform from the 16×1 transform coefficients can restore the original 4×4 block signal (ignoring effects such as quantization and integerization calculations). If the forward 16×16 non-separable transform is an orthonormal transform, the inverse 16×16 transform can be obtained by taking the matrix transpose for the forward 16×16 transform. Simply put, multiplying the inverse 16×16 non-separable transform matrix by the 16×1 transform coefficient vector results in data in the form of a 16×1 vector, which can be arranged in the row-major or column-major order as originally applied to restore the 4×4 block signal.
[0161] As described above, the elements of the 16×1 transform coefficient vector may have different statistical characteristics. As in the above example, if the transform coefficients arranged in the front (close to the 0th element) have a larger energy, a signal close to the original signal can be restored even if the inverse transform is applied to some transform coefficients that appear earlier without using all transform coefficients. For example, if the inverse 16×16 non-separable transform is composed of 16 column basis vectors, a 16×L matrix is formed by leaving only L column basis vectors, and after leaving only the more important L transform coefficients from among the transform coefficients (L×1 vector, which can appear earlier as in the above example), the 16×L matrix and the L×1 vector are multiplied to restore the original input 16×1 vector data and a 16×1 vector with a small error. As a result, since only L coefficients are involved in data restoration, it is only necessary to obtain an L×1 transform coefficient vector, not a 16×1 transform coefficient vector, when obtaining the transform coefficients. That is, in a forward 16×16 non-separable transform matrix, L relevant row-direction transform vectors are selected to construct an L×16 transform, and then multiplied with a 16×1 input vector to obtain L important transform coefficients.
[0162] Embodiment 2: Setting the application area of 4x4RST and arranging the conversion coefficients
[0163] 4x4RST can be applied as a secondary transform, and in this case, it can be applied secondarily to a block to which a primary transform such as DCT-type2 has been applied. When the size of a block to which a primary transform has been applied is NxN, it is usually larger than 4x4. Therefore, when applying 4x4RST to an NxN block, the following two methods are possible.
[0164] 1) Instead of applying 4x4 RST to the entire NxN region, it can be applied only to a part of the region. For example, it can be applied only to the top-left MxM region (M<=N).
[0165] 2) After dividing the region to which the secondary transformation is applied into 4x4 blocks, a 4x4 RST can be applied to each divided block.
[0166] The above methods 1) and 2) can be mixed and applied. For example, the upper left M×M region can be divided into 4×4 blocks and then 4×4 RST can be applied.
[0167] In a specific embodiment, the secondary transformation is applied only to the upper left 8x8 region, and if the NxN block is greater than or equal to 8x8, an 8x8 RST is applied. If the NxN block is smaller than 8x8 (4x4, 8x4, 4x8), it is divided into 4x4 blocks as in 2) above, and then a 4x4 RST is applied to each of them.
[0168] When L transform coefficients (1<=L<16) are generated after applying 4×4 RST, there is a degree of freedom in how to arrange the L transform coefficients. However, since there is a set order when the transform coefficients are read and processed in the residual coding part, the coding performance may change depending on how the L transform coefficients are arranged in a two-dimensional block. In the residual coding of the high efficiency video coding (HEVC) standard, coding is started from the farthest position from the DC position, and this is to improve coding performance by utilizing the fact that the value of the quantized coefficient is 0 or close to 0 as it is farther away from the DC position. Therefore, it may be advantageous in terms of coding performance to arrange the L transform coefficients to have high energy and be coded later in the order of residual coding.
[0169] FIG. 16 shows three forward scan orders for transform coefficients or transform coefficient blocks applied in the HEVC standard: (a) diagonal scan, (b) horizontal scan, and (c) vertical scan.
[0170] 16 illustrates three forward scan orders for transform coefficients or transform coefficient blocks (4×4 blocks, Coefficient Groups (CGs)) applied in the HEVC standard, and residual coding is performed in the reverse order of the scan orders (a), (b), or (c) (i.e., coding is performed in the order from 16 to 1). The three scan orders shown in (a), (b), and (c) are selected according to an intra-prediction mode, so that the scan order for the L transform coefficients can also be configured to be determined according to the intra-prediction mode.
[0171] The value of L has a range of 1<=L<16, and generally, L of the 16 transformation basis vectors can be selected in any manner. However, from the viewpoint of encoding and decoding, it may be advantageous in terms of encoding efficiency to select transformation basis vectors that are important in terms of signal energy, as in the example presented above.
[0172] Figures 17 and 18 are embodiments to which the present invention is applied, where Figure 17 shows the positions of transform coefficients when a forward diagonal scan is applied when applying a 4x4 RST to a 4x8 block, and Figure 18 shows an example of merging valid transform coefficients of two 4x4 blocks into one block.
[0173] When the upper left 4×8 block is divided into 4×4 blocks according to the diagonal scan order of (a) and 4×4 RST is applied, if the L value is 8 (i.e., only 8 transform coefficients out of 16 are left), the transform coefficients are located as shown in FIG. 17, but only half of each 4×4 block can have transform coefficients, and the positions where X is displayed are filled with a value of 0 as a default. Therefore, the residual coding (e.g., residual coding in HEVC) can be applied by assuming that L transform coefficients are placed for each 4×4 block according to the scan order presented in (a) and the remaining (16-L) positions of each 4×4 block are filled with 0.
[0174] Also, as shown in FIG. 18, L transform coefficients arranged in two 4×4 blocks can be configured into one block. In particular, when the L value is 8, the transform coefficients of the two 4×4 blocks completely fill one 4×4 block, and no transform coefficients remain in the other blocks. Therefore, since residual coding is not required for the 4×4 block that is emptied of transform coefficients, in the case of HEVC, a flag (coded_sub_block_flag) indicating whether residual coding is applicable to the block is coded to 0. There are various combination methods for the positions of the transform coefficients of the two 4×4 blocks. For example, the positions can be combined in any order, but the following methods may also be applied.
[0175] 1) The transform coefficients of two 4×4 blocks are alternately combined in the scan order. That is, in FIG. 8A, FIG. 8B, and FIG. 8C, the transform coefficients for the upper block are JPEG2024120019000004.jpg556, and the transformation coefficients of the lower block are When the image is JPEG2024120019000005.jpg552, They can be combined one by one, like JPEG2024120019000006.jpg568. Also, JPEG2024120019000007.jpg55 and You can change the order of JPEG2024120019000008.jpg55 JPEG2024120019000009.jpg1190.
[0176] 2) The transform coefficients for the first 4×4 block can be arranged first, and then the transform coefficients for the second 4×4 block. That is, It is possible to link and place them like this: JPEG2024120019000010.jpg667. You can also change the order, for example JPEG2024120019000011.jpg669.
[0177] Embodiment 3: A method for coding a non-separable secondary transform (NSST) index for a 4×4 RST
[0178] When 4×4 RST is applied as shown in FIG 17, 0 values are filled from the L+1th position to the 16th position according to the transform coefficient scan order for each 4×4 block. Therefore, if there is a non-zero value from the L+1th position to the 16th position in at least one of the two 4×4 blocks, it is derived that this is the case where 4×4 RST is not applied. If 4×4 RST has a structure that applies a transform selected from a prepared transform set such as JEM (joint experiment model) NSST, an index (hereinafter referred to as NSST index) for which transform to apply is signaled.
[0179] In some decoders, the NSST index is known by bitstream parsing, which can be performed after residual coding. In this case, if a non-zero transform coefficient exists between the L+1th position and the 16th position due to residual decoding, the decoder does not parse the NSST index because it is certain that the 4×4 RST is not applied. Therefore, by selectively parsing the NSST index only when necessary, the signaling cost is reduced.
[0180] As shown in Fig. 17, when 4x4 RST is applied to a plurality of 4x4 blocks in a specific region (in this case, the same 4x4 RST may be applied to all of them, or different 4x4 RSTs may be applied to each of them), one NSST index specifies the 4x4 RST (same or different) to be applied to all of the 4x4 blocks. Since one NSST index determines whether or not 4x4 RST and 4x4 RST are applied to all of the 4x4 blocks, if a non-zero transform coefficient is present at an impermissible position (L+1th position to 16th position) in the 4x4 block as a result of checking whether a non-zero transform coefficient is present at the L+1th position to 16th position in the residual decoding process for all of the 4x4 blocks, the encoding device 100 may be configured not to code the NSST index.
[0181] The encoding apparatus 100 may signal an NSST index for each luminance block and a chrominance block separately, and in the case of a chrominance block, may signal an NSST index for each of the Cb and Cr components separately, or may use one common NSST index. When one NSST index is used, the signaling of the NSST index is performed only once. When one NSST index is shared for the Cb and Cr components, a 4×4 RST indicated by the same NSST index is applied, and in this case, the 4×4 RST for the Cb and Cr components may be the same, or the NSST index may be the same but separate 4×4 RSTs may be set for the Cb and Cr components. When a shared NSST index is used for the Cb and Cr components, for the above-mentioned conditional signaling, it is checked whether there are non-zero transform coefficients from the L+1th position to the 16th position for all 4x4 blocks for the Cb and Cr components, and if a non-zero transform coefficient is found in the L+1th position to the 16th position, the signaling for the NSST index may be omitted.
[0182] As shown in FIG. 18, even when transform coefficients for two 4×4 blocks are merged into one 4×4 block, the encoding apparatus 100 may check whether a non-zero transform coefficient appears at a position where no valid transform coefficient exists when the 4×4 RST is applied, and then may determine whether to signal the NSST index. In particular, since the L value is 8 as shown in FIG. 18, when a valid transform coefficient does not exist in one 4×4 block when the 4×4 RST is applied (a block indicated by X in FIG. 18(b)), a flag (coded_sub_block_flag) for whether the corresponding block is subjected to residual coding may be checked, and if it is 1, the NSST index may be set not to be signaled. As described above, in the following description, the NSST will be mainly described as an example of a non-separable transform, but other known terms (e.g., LFNST) may be used for the non-separable transform. For example, an NSST set and an NSST index may be substituted for an LFNST set and an LFNST index. In addition, the RST described in this document is an example of a non-separable transform (e.g., LFNST) that uses a non-rectangular transform matrix having a reduced input length and / or a reduced output length in a square non-separable transform matrix applied to at least a portion of a transform block (the upper left 4x4, 8x8 region, or the remaining region excluding the lower right 4x4 region in an 8x8 block), and RST can also be used in place of LFNST.
[0183] Embodiment 4: Optimization method for 4×4 index coding before residual coding
[0184] When coding for the NSST index is performed before the residual coding, whether or not to apply the 4×4 RST is determined in advance, so that the residual coding for the position where the transform coefficient is filled with 0 may be omitted. Here, whether or not to apply the 4×4 RST may be configured to be determined according to the NSST index value (e.g., if the NSST index is 0, the 4×4 RST is not applied), or whether or not to apply the 4×4 RST may be signaled by a separate syntax element (e.g., an NSST flag). For example, if the separate syntax element is an NSST flag, the decoding device 200 may determine whether or not to apply the 4×4 RST by first parsing the NSST flag, and then, if the NSST flag value is 1, may omit the residual coding (decoding) for the position where no valid transform coefficient exists, as described above.
[0185] In the case of HEVC, when performing residual coding, coding is performed first at the position of the last non-zero coefficient in the TU. If coding for the NSST index is performed after coding for the position of the last non-zero coefficient, and assuming application of 4×4 RST, if the position of the last non-zero coefficient is a position where a non-zero coefficient cannot exist, the decoding device 200 may be set not to code the NSST index and not to apply 4×4 RST. For example, in the case of a position indicated as X in FIG. 17, when 4×4 RST is applied, a valid transform coefficient is not located (a value of 0 may be filled), so if the last non-zero coefficient is located in the area indicated as X, the decoding device 200 may omit coding for the NSST index. If the last non-zero coefficient is not located in the area indicated as X, the decoding device 200 may perform coding for the NSST index.
[0186] If it is determined whether or not 4x4RST can be applied by conditionally coding the NSST index after coding the positions of the non-zero coefficients, the remaining residual coding portions can be processed in the following two ways.
[0187] 1) If 4x4 RST is not applied, general residual coding is performed, that is, coding is performed under the assumption that there can be a non-zero transform coefficient at any position from the position of the last non-zero coefficient to the DC.
[0188] 2) When 4x4 RST is applied, since a transform coefficient does not exist (filled with 0 as default) at a specific position or a specific 4x4 block (e.g., X position in FIG. 17), residual coding may be omitted for the position or block. For example, when a position indicated as X is reached while scanning according to the scan order in FIG. 17, coding of a flag (sig_coeff_flag) indicating whether a non-zero coefficient exists at the position in the HEVC standard may be omitted, and when transform coefficients of two blocks are merged into one block as in FIG. 18, coding of a flag (e.g., code_sub_block_flag in the HEVC standard) indicating whether residual coding of a 4x4 block filled with 0 is performed may be omitted, and the corresponding value may be induced to 0, and the corresponding 4x4 block may be filled with all 0 values without separate coding.
[0189] When coding the NSST index after coding the position of the last non-zero coefficient, if the x position (Px) and y position (Py) of the last non-zero coefficient are smaller than Tx and Ty, respectively, the coding of the NSST index is omitted and the 4×4RST can be set not to be applied. For example, if Tx=1, Ty=1 and the last non-zero coefficient is at the position of DC, the coding of the NSST index is omitted. The method of determining whether to code the NSST index for comparison with such a critical value can be applied differently to the luminance component and the chrominance component, for example, different Tx and Ty may be applied to the luminance component and the chrominance component, and the critical value may be applied to the luminance component and the chrominance component and the critical value may not be applied to the chrominance component. Conversely, the critical value may be applied to the chrominance component and the critical value may not be applied to the luminance component.
[0190] The above two methods (NSST index coding is omitted if the last non-zero coefficient is located in an area where no valid transform coefficient exists, and NSST index coding is omitted if the X and Y coordinates of the last non-zero coefficient are smaller than the threshold values, respectively) may be applied simultaneously. For example, the threshold value for the position coordinates of the last non-zero coefficient may be checked first, and then it may be checked whether the last non-zero coefficient is located in an area where no valid transform coefficient exists, and the order of the two methods may be changed.
[0191] The method presented in embodiment 4) can also be applied to an 8x8 RST. That is, if the last non-zero coefficient is located in a non-top-left 4x4 region within the top-left 8x8 region, coding for the NSST index can be omitted, otherwise coding for the NSST index can be performed. Also, if the values of the X and Y coordinates for the position of the last non-zero coefficient are all less than a certain critical value, coding for the NSST index can be omitted. The two methods can also be applied simultaneously.
[0192] 5th embodiment: When RST is applied, different NSST index coding and residual coding methods are applied to the luminance and chrominance components, respectively.
[0193] The schemes described in the third and fourth embodiments may be applied differently to the luminance component and the chrominance component. That is, the NSST index coding and residual coding schemes may be applied differently to the luminance component and the chrominance component. For example, the scheme described in the fourth embodiment may be applied to the luminance component, and the scheme described in the third embodiment may be applied to the chrominance component. In addition, the conditional NSST index coding proposed in the third or fourth embodiment may be applied to the luminance component, and the conditional NSST index coding may not be applied to the luminance component, or vice versa (conditional NSST index coding may be applied to the chrominance component, but not to the luminance component).
[0194] EMBODIMENT 6
[0195] In one embodiment of the present invention, a mixed NSST transform set (MNTS) for applying various NSST conditions in the process of applying NSST and a method for constructing the corresponding MNTS are provided.
[0196] According to JEM, a 4×4 NSST set includes only 4×4 kernels and an 8×8 NSST set includes only 8×8 kernels according to the preselected size of the subblock. The embodiment of the present invention additionally proposes a method for constructing a mixed NSST set as follows.
[0197] -The size of the NSST kernels available in an NSST set is not fixed, and one or more NSST kernels having variable sizes can be included in the NSST set (e.g., one NSST set includes both a 4x4 NSST kernel and an 8x8 NSST kernel).
[0198] The number of NSST kernels available in an NSST set is not fixed but may be variable (e.g., a first set may contain 3 kernels, a second set may contain 4 kernels).
[0199] - The order of NSST kernels may not be fixed but may be defined differently depending on the NSST set (e.g., in the first set, NSST kernels 1, 2, 3 are mapped to NSST indices 1, 2, 3 respectively, but in the second set, NSST kernels 3, 2, 1 are mapped to NSST indices 1, 2, 3 respectively).
[0200] More specifically, an example of a mixed NSST transformation set construction method is as follows.
[0201] The priority of the NSST kernels available in the -NSST transformation set may be determined by the size of the NSST kernel (e.g., 4x4 NSST and 8x8 NSST).
[0202] For example, if a block is large, an 8x8 NSST kernel may be more important than a 4x4 NSST kernel, so we assign the 8x8 NSST kernel an NSST index with a lower value.
[0203] The priority of the NSST kernels available in the -NSST transformation set may be determined by the order of the NSST kernels.
[0204] For example, a given 4x4 NSST first kernel may take precedence over a 4x4 NSST second kernel.
[0205] Since the NSST index is transmitted encoded, the NSST index can be signaled with fewer bits by assigning higher priority (smaller index) to frequently occurring NSST kernels.
[0206] Tables 1 and 2 below show examples of mixed NSST sets proposed in this embodiment.
[0207] [Table 1]
[0208] [Table 2]
[0209] EMBODIMENT 7
[0210] In one embodiment of the present invention, a method for determining an NSST set is proposed, taking into account an intra prediction mode and a block size in the process of determining a secondary transform set.
[0211] The method proposed in this embodiment, in cooperation with embodiment 6, configures a set of transformations adapted to the intra prediction mode, so that kernels of various sizes can be configured and applied to blocks.
[0212] FIG. 19 illustrates an example of a method for constructing an NSST set mixed for each intra prediction mode, which is an embodiment to which the present invention is applied.
[0213] Fig. 19 is an example of a table in accordance with a method in which the method proposed in the second embodiment is applied in cooperation with the sixth embodiment. That is, as shown in Fig. 19, an index ("Mixed Type") is defined for each intra prediction mode, indicating whether to follow an existing NSST set construction method or a different NSST set construction method.
[0214] 19, an NSST set is constructed using an NSST set construction method defined in the system, regardless of the NSST set construction method of JEM. Here, the NSST set construction method defined in the system means the mixed NSST set proposed in embodiment 6.
[0215] In another embodiment, the table of Figure 19 describes two types of transform set construction methods (JEM-based NSST set construction and a mixed type NSST set construction method proposed in an embodiment of the present invention) based on mixed type information (flag) associated with intra prediction mode, but there may be more than one mixed type NSST construction method, and here the mixed type information can be expressed as N (N>2) types of various values.
[0216] In another embodiment, it may be determined whether to configure a transform set suitable for a current block as a mixed type by considering both the intra prediction mode and the size of the transform block. For example, if the mode type corresponding to the intra prediction mode is 0, the NSST set setting of JEM is followed, otherwise (Mode Type=1), various mixed type NSST sets may be determined according to the size of the transform block.
[0217] FIG. 20 illustrates an embodiment to which the present invention is applied, showing an example of a method for selecting an NSST set (or kernel) taking into consideration an intra prediction mode and a transform block size.
[0218] Once the transform set is determined, the decoding device 200 can determine the NSST kernel used by using the NSST index information.
[0219] EMBODIMENT 8
[0220] In one embodiment of the present invention, when constructing a transform set considering the intra prediction mode and the block size during the application of the secondary transform, a method for efficiently encoding the NSST index by considering the change in the statistical distribution of the NSST index values transmitted after encoding is provided. Embodiments of the present invention provide a method for selecting a kernel applied using a syntax indicating the kernel size.
[0221] Also, in embodiments of the present invention, since the number of available NSST kernels differs for each transform set, a truncated unary binary evolution method as shown in Table 3 below is provided according to the maximum NSST index value available for each set for an efficient binary evolution method.
[0222]
Table 3
[0223] Table 3 shows the binary evolution method of the NSST index value. Since the number of available NSST kernels differs for each transform set, the NSST index can be binary evolved by the maximum NSST index value.
[0224] Embodiment 9: Reduced Transform
[0225] Due to complexity issues in the transform (e.g., large block transform or non-separable transform), a reduced transform applicable to the core transform (e.g., DCT, DST, etc.) and the secondary transform (e.g., NSST) is provided.
[0226] The main idea of the reduced transform is to map an N-dimensional vector to an R-dimensional vector from another space, where R / N (R < N) is the reduction factor. The reduced transform is an R×N matrix as shown in Equation 3 below.
[0227]
Number
[0228] In Equation 1, the R rows of the transformation are the R bases of the new N-dimensional space. Therefore, the reason it is called a reduced transformation is that the number of elements of the vector output by the transformation is smaller than the number of elements of the input vector (R < N). The inverse transform matrix for the reduced transformation is the transpose of the forward transformation. The forward and inverse reduced transformations will be described with reference to FIGS. 13A and 13B.
[0229] FIGS. 21A and 21B are embodiments to which the present invention is applied and show forward and inverse reduced transformations.
[0230] The number of elements of the reduced transformation is RxN, which is smaller than the size of the complete matrix (N×N) by R / N, which means that the required memory is R / N of the complete matrix.
[0231] Also, the number of required multiplications is R×N, which is less than the original N×N by R / N.
[0232] If X is an N-level vector, then R coefficients are obtained after applying the reduced transformation, which means that only R values need to be transmitted instead of the original N coefficients.
[0233] FIG. 22 shows an example of a decode flowchart using the reduced transformation according to an embodiment of the present invention.
[0234] The proposed downscaled transform (inverse transform at the decoder) can be applied to the coefficients (dequantized coefficients) as shown in Figure 21. A predetermined downscaling factor (R or R / N) and a transform kernel for performing the transform may be required. Here, the transform kernel can be determined based on available information such as block size (width, height), intra prediction mode, and Cidx. If the current coding block is a luma block, CIdx is 0. Otherwise (Cb or Cr block), CIdx is a non-zero value such as 1.
[0235] The operators used in the rest of this document are defined as shown in Tables 4 and 5 below.
[0236] [Table 4]
[0237] [Table 5]
[0238] 23 shows an example of a flow chart for applying a conditional contracted transform according to an embodiment of the present invention. The operations of FIG. 23 are performed by the inverse quantization unit 140 and the inverse transform unit 150 of the decoding device 200.
[0239] In one embodiment, a reduced transform can be used if certain conditions are met. For example, a reduced transform can be applied to blocks larger than a certain size as follows:
[0240] - Width > TH && Height > HT, where TH is a predefined value (e.g. 4)
[0241] or
[0242] - Width * Height > K && MIN(width, height) > TH (K and TH are predefined values)
[0243] That is, as in the above condition, if the width of the current block is greater than the predefined value (TH) and the height of the current block is greater than the predefined value (TH), the reduced conversion can be applied, or if the product of the width and height of the current block is greater than the predefined value (K) and the smaller of the width and height of the current block is greater than the predefined value (TH), the reduced conversion can be applied.
[0244] A reduced transformation can be applied to a predetermined group of blocks as follows:
[0245] - Width == TH && Height == TH
[0246] or
[0247] - Width == Height
[0248] That is, if the width and height of the current block are equal to a predetermined value (TH), or if the width and height of the current block are equal (if the current block is a square block), then the scaled transformation can be applied.
[0249] If the conditions for using the reduced transform are not met, a regular transform is applied. The regular transform may be a transform that is predefined and available in the video coding system. Examples of regular transforms are as follows:
[0250] -DCT-2, DCT-4, DCT-5, DCT-7, DCT-8
[0251] or
[0252] -DST-1, DST-4, DST-7
[0253] or
[0254] -Non-separable transformation
[0255] or
[0256] -JEM-NSST (HyGT)
[0257] As shown in Figure 23, the reduced transform condition depends on an index (Transform_idx) that indicates which transform (e.g., DCT-4, DST-1) is used or which kernel is applied (when multiple kernels are available). In particular, Transform_idx can be sent twice: one index indicating a horizontal transform (Transform_idx_h) and another index indicating a vertical transform (Transform_idx_v).
[0258] 23, the decoding device 200 performs inverse quantization on the input bitstream (S2305). After that, the decoding device 200 determines whether to apply a transform (S2310). The decoding device 200 determines whether to apply a transform based on a flag indicating whether to skip a transform.
[0259] If a transform is applied, the decoding device 200 parses a transform index (Transform_idx) indicating the transform to be applied (S2315). The decoding device 200 also selects a transform kernel (S2330). For example, the decoding device 200 selects a transform kernel corresponding to the transform index (Transform_idx). The decoding device 200 also selects the transform kernel taking into account the block size (width, height), intra prediction mode, and CIdx (luma, chroma).
[0260] The decoding device 200 determines whether the conditions for application of the reduced transform are satisfied (S2320). The conditions for application of the reduced transform include the conditions described above. If the reduced transform is not applied, the decoding device 200 applies a normal inverse transform (S2325). For example, the decoding device 200 determines an inverse transform matrix from the transform kernel selected in step S2330, and applies the determined inverse transform matrix to the current block including the transform coefficients.
[0261] If a scaled transform is applied, the decoding device 200 applies a scaled inverse transform (S2335). For example, the decoding device 200 determines a scaled inverse transform matrix by taking into account a scale-down factor from the transform kernel selected in step S2330, and applies the scaled inverse transform matrix to the current block including the transform coefficients.
[0262] 24 shows an example of a decoding flowchart for a secondary inverse transform to which a conditional contracted transform is applied according to an embodiment of the present invention. The operation of FIG.
[0263] In one embodiment, the reduced transform can be applied to the secondary transform as in Figure 24. Once the NSST index is parsed, the reduced inverse transform can be applied.
[0264] 24, the decoding apparatus 200 performs inverse quantization (S2405). The decoding apparatus 200 determines whether to apply NSST to the transform coefficients generated by the inverse quantization (S2410). That is, the decoding apparatus 200 determines whether parsing of the NSST index (NSST_idx) is necessary depending on whether NSST is applied.
[0265] If NSST is applied, the decoding device 200 parses the NSST index (S2415) and determines whether the NSST index is greater than 0 (S2420). The NSST index is restored by the entropy decoding unit 210 using a technique such as CABAC. If the NSST index is 0, the decoding device 200 omits the secondary inverse transform and applies the core inverse transform or the primary inverse transform (S2445).
[0266] Also, when NSST is applied, the decoding device 200 selects a transform kernel for secondary inverse transform (S2435). For example, the decoding device 200 selects a transform kernel corresponding to an NSST index (NSST_idx). Also, the decoding device 200 selects the transform kernel taking into account the block size (width, height), intra prediction mode, and CIdx (luma, chroma).
[0267] If the NSST index is greater than 0, the decoding device 200 determines whether the conditions for application of the reduced transform are satisfied (S2425). The conditions for application of the reduced transform include the conditions described above. If the reduced transform is not applied, the decoding device 200 applies a normal secondary inverse transform (S2430). For example, the decoding device 200 determines a secondary inverse transform matrix from the transform kernel selected in step S2435, and applies the determined secondary inverse transform matrix to the current block including the transform coefficients.
[0268] If a reduced transform is applied, the decoding device 200 applies a reduced secondary inverse transform (S2440). For example, the decoding device 200 may determine a reduced inverse transform matrix by considering a reduction factor from the transform kernel selected in step S2335, and apply the reduced inverse transform matrix to the current block including the transform coefficients. Thereafter, the decoding device 200 applies a core inverse transform or a linear inverse transform (S2445).
[0269] Embodiment 10: Reduced Transform as a Secondary Transform with Different Block Size
[0270] 25A, 25B, 26A, and 26B show examples of reduced transforms and reduced inverse transforms according to embodiments of the present invention.
[0271] In one embodiment of the present invention, the secondary transform and the secondary inverse transform can be used as the reduced transform in the video codec for different block sizes such as 4×4, 8×8, 16×16, etc. As an example for an 8×8 block size and a reduction factor R=16, the secondary transform and the secondary inverse transform can be set as shown in Figures 25A and 25B.
[0272] The pseudocode for the reduced transform and the reduced inverse transform is set out in FIG.
[0273] Embodiment 11: Reduced Transform as a Secondary Transform with Non-Rectangular Shape
[0274] FIG. 27 shows an example of a region to which a reduced quadratic transform is applied according to an embodiment of the present invention.
[0275] As mentioned before, due to the complexity issues in quadratic transformations, quadratic transformations can be applied to 4x4 and 8x8 corners. Reduced transformations can also be applied to non-regular rectangles.
[0276] As mentioned before, due to the complexity issues in quadratic transformations, quadratic transformations can be applied to 4x4 and 8x8 corners. Reduced transformations can also be applied to non-regular rectangles.
[0277] In another example, when a RST is applied to an 8x8 block, a non-separable transform (RST) can be applied only to the remaining three 4x4 blocks (a total of 48 transform coefficients) in the top-left, top-right, and bottom-left, excluding the bottom-right 4x4 block.
[0278] Embodiment 12: Reduction Factor
[0279] FIG. 28 illustrates a reduced transformation with a reduction factor according to an embodiment of the present invention.
[0280] Changing the reduction factor can change the memory and multiplication complexity. As mentioned before, changing the reduction factor reduces the memory and multiplication complexity by a factor R / N. For example, for an 8x8 NSST, if R=16, the memory and multiplication complexity are reduced by 1 / 4.
[0281] Embodiment 13: High Level Syntax
[0282] The following syntax elements, such as those in Table 6, may be used to process the RST in video coding. Semantics related to the reduced transform may be present in the sequence parameter set (SPS) or slice header.
[0283] Reduced_transform_enabled_flag equal to 1 indicates that reduced transform is enabled and applied. Reduced_transform_enabled_flag equal to 0 indicates that reduced transform is not enabled. When Reduced_transform_enabled_flag is not present, it is inferred to be equal to 0. (Reduced_transform_enabled_flag equals to 1 specifies that reduced transform is enabled and applied. Reduced_transform_enabled_flag equal to 0 specifies that reduced transform is not enabled. When Reduced_transform_enabled_flag is not present, it is inferred to be equal to 0).
[0284] Reduced_transform_factor specifies that the number of reduced dimensions to keep for reduced transform. When Reduced_transform_factor is not present, it is inferred to be equal to R.
[0285] min_reduced_transform_size specifies that the minimum transform size to apply reduced transform. When min_reduced_transform_size is not present, it is inferred to be equal to 0.
[0286] max_reduced_transform_size indicates the maximum transform size to apply the reduced transform to. If max_reduced_transform_size is not present, it is inferred to be 0.
[0287] reduced_transform_size specifies that the number of reduced dimensions to keep for reduced transform. When Reduced_transform_factor is not present, it is inferred to be equal to 0.
[0288] [Table 6]
[0289] Embodiment 14: Conditional application of 4×4RST for worst case handling
[0290] The non-separable secondary transform (4x4 NSST) that can be applied to a 4x4 block is a 16x16 transform. The 4x4 NSST is secondarily applied to a block that has been applied with a primary transform such as DCT-2, DST-7, or DCT-8. If the size of the block to which the primary transform has been applied is NxM, the following methods can be considered when applying the 4x4 NSST to an NxM block.
[0291] 1) The conditions for applying 4x4 NSST to an NxM domain are as follows: a) and b).
[0292] a) N >= 4
[0293] b) M >= 4
[0294] 2) 4x4 NSST is not applied to the entire NxM region, but only to some of the regions. For example, 4x4 NSST can be applied only to the KxJ region in the upper left. The conditions for this are as follows: a) and b).
[0295] a) K >= 4
[0296] b) J >= 4
[0297] 3) After dividing the region to which the secondary transformation is applied into 4x4 blocks, a 4x4 NSST can be applied to each divided block.
[0298] The computational complexity of 4x4 NSST is a very important consideration for the encoder and decoder, so we will analyze it in detail. In particular, we will analyze the computational complexity of 4x4 NSST based on the number of multiplications. In the case of forward NSST, the 16x16 secondary transform is composed of 16 row-wise transform basis vectors, and the transform coefficients for the transform basis vector are obtained by taking the inner product of the 16x1 vector and each transform basis vector. The process of obtaining all the transform coefficients for the 16 transform basis vectors is similar to multiplying the 16x16 non-separable transform matrix by the input 16x1 vector. Therefore, the total number of multiplications required for 4x4 forward NSST is 256.
[0299] In the decoder, when an inverse 16x16 non-separable transform is applied to the 16x1 transform coefficients (ignoring the effects of quantization, integerization, etc.), the coefficients of the original 4x4 linear transform block can be restored. In other words, when the inverse 16x16 non-separable transform matrix is multiplied with the 16x1 transform coefficient vector, data in the form of a 16x1 vector is obtained, and when the data is arranged according to the row-major or column-major order that was originally applied, the 4x4 block signal (linear transform coefficients) can be restored. Thus, the total number of multiplications required for a 4x4 inverse NSST is 256.
[0300] As mentioned above, when 4x4 NSST is applied, the number of multiplications required per sample is 16. This is the number obtained by dividing the total number of multiplications, 256, obtained in the process of performing 4x4 NSST, which is the inner product process of the 16x1 vector and each transformation basis vector by the total number of samples, 16. The number of multiplications required is the same for both forward 4x4 NSST and reverse 4x4 NSST, all being 16.
[0301] If we have an 8x8 block, the number of multiplications required per sample when applying 4x4 NSST is determined by the region to which 4x4 NSST is applied as follows:
[0302] 1. 4x4 NSST applied only to the top left 4x4 region: 256 (number of multiplications required in the 4x4 NSST process) / 64 (total number of samples in the 8x8 block) = 4 multiplications / sample
[0303] 2. 4x4 NSST applied to the top left 4x4 region and the top right 4x4 region: 512 (number of multiplications required for the two 4x4 NSST processes) / 64 (total number of samples in the 8x8 block) = 8 multiplications / sample
[0304] 3. 4x4 NSST applied to all 4x4 regions of an 8x8 block: 1024 (number of multiplications required for four 4x4 NSST processes) / 64 (total number of samples in an 8x8 block) = 16 multiplications / sample
[0305] As mentioned above, when the size of the block is large, the extent to which the 4×4 NSST is applied can be reduced to reduce the number of worst-case multiplications required for each sample.
[0306] Therefore, when using 4x4 NSST, the worst case occurs when the size of the TU is 4x4. In this case, the method to reduce the worst case complexity is as follows:
[0307] Method 1. Do not apply 4 × 4 NSST to small TUs (i.e., 4 × 4 TUs).
[0308] Method 2. For 4x4 blocks (4x4TU), apply 4x4RST instead of 4x4NSST.
[0309] In the case of Method 1, it was experimentally observed that not applying 4x4 NSST caused a significant drop in coding performance. In the case of Method 2, it was found that by applying inverse transform to some of the front transform coefficients without using all of the transform coefficients due to the statistical characteristics of the elements that make up the 16x1 transform coefficient vector, a signal that is quite close to the original signal can be restored, and most of the coding performance can be maintained.
[0310] Specifically, in the case of 4×4 RST, if the inverse (or forward) 16×16 non-separable transform is composed of 16 column basis vectors, only L column basis vectors are left to form a 16×L matrix. By leaving only the most important L transform coefficients among the transform coefficients, the 16×L matrix is multiplied by an L×1 vector, and a 16×1 vector with a small error compared to the original 16×1 vector data can be restored.
[0311] As a result, since only L coefficients are involved in data recovery, an L×1 transform coefficient vector is required to obtain transform coefficients, instead of a 16×1 transform coefficient vector. That is, an L×16 transform matrix is constructed by selecting L row-direction transform vectors in a forward 16×16 non-separable transform matrix, and L transform coefficients are obtained by multiplying the L×16 transform matrix by a 16×1 input vector.
[0312] The L value has a range of 1<=L<16, and generally, L can be selected from 16 transformation basis vectors in any way, but as described above, it may be advantageous in terms of coding efficiency to select a transformation basis vector with high signal energy importance from the viewpoint of encoding and decoding. The worst-case multiplication number per sample in a 4×4 block due to transformation of the L value is as shown in Table 7 below.
[0313] [Table 7]
[0314] As mentioned above, in order to reduce worst-case multiplication complexity, 4x4 NSST and 4x4 RST can be used in combination as shown in Table 8 below (however, the following example describes the conditions for applying 4x4 NSST and 4x4 RST under the conditions for applying 4x4 NSST (i.e., when the width and height of the current block are all greater than or equal to 4)).
[0315] As mentioned above, 4x4NSST for a 4x4 block is a square (16x16) transform matrix that inputs 16 pieces of data and outputs 16 pieces of data, and 4x4RST refers to a non-square (8x16) transform matrix that inputs 16 pieces of data from the encoder side and outputs R pieces of data less than 16 (e.g., 8 pieces). 4x4RST refers to a non-square (16x8) transform matrix that inputs R pieces of data less than 16 (e.g., 8 pieces of data) and outputs 16 pieces of data from the decoder side.
[0316] [Table 8]
[0317] Referring to Table 8, if the width and height of the current block are each 4, then a 4×4 RST based on an 8×16 matrix is applied to the current block, otherwise (if either the width or height of the current block is not 4), a 4×4 NSST is applied to the 4×4 region in the upper left corner of the current block. More specifically, if the size of the current block is 4×4, then a non-separable transform with an input length of 16 and an output length of 8 can be applied. In the case of an inverse non-separable transform, conversely, a non-separable transform with an input length of 8 and an output length of 16 can be applied.
[0318] As mentioned above, in order to reduce worst-case multiplication complexity, 4x4 NSST and 4x4 RST can be used in combination as shown in Table 9 below (however, the following example describes the conditions for applying 4x4 NSST and 4x4 RST under the conditions for applying 4x4 NSST (i.e., when the width and height of the current block are all greater than or equal to 4)).
[0319] [Table 9]
[0320] Referring to Table 9, if the width and height of the current block are each 4, a 4×4 RST based on an 8×16 matrix is applied; if the product of the width and height of the current block is less than a critical value (TH), a 4×4 NSST is applied to the 4×4 region in the upper left corner of the current block; if the width of the current block is greater than or equal to the height, a 4×4 NSST is applied to the 4×4 region in the upper left corner of the current block and the 4×4 region located to the right of the upper left 4×4 region; and in the remaining cases (if less than the height of the current block), a 4×4 NSST is applied to the 4×4 region in the upper left corner of the current block and the 4×4 region located below the upper left 4×4 region.
[0321] In conclusion, for the reduction of the worst-case computational complexity of multiplication, a 4×4 RST (e.g., 8×16 matrix) can be applied instead of a 4×4 NSST for a 4×4 block.
[0322] Embodiment 15: Conditional application of 8x8RST for worst case handling
[0323] The non-separable secondary transform (8x8NSST) that can be applied to an 8x8 block is a 64x64 transform. The 8x8NSST is secondarily applied to a block to which a primary transform such as DCT-2, DST-7, or DCT-8 has been applied. If the size of the block to which the primary transform has been applied is NxM, the following methods are considered when applying the 8x8NSST to an NxM block.
[0324] 1) The conditions for applying 8x8 NSST to an NxM region are as follows: c) and d).
[0325] c) N >= 8
[0326] d) M >= 8
[0327] 2) The 8x8 NSST is not applied to the entire NxM region, but may be applied only to some of the regions. For example, the 8x8 NSST is applied only to the KxJ region in the upper left. The conditions for this are as follows: c) and d).
[0328] c) K >= 8
[0329] d) J >= 8
[0330] 3) After dividing the region to which the secondary transformation is applied into 8x8 blocks, 8x8 NSST can be applied to each divided block.
[0331] The computational complexity of 8x8 NSST is a very important consideration for the encoder and decoder, so we will analyze it in detail. In particular, we will analyze the computational complexity of 8x8 NSST based on the number of multiplications. In the case of forward NSST, the 64x64 non-separable quadratic transform is composed of 64 row-wise transform basis vectors, and the transform coefficients for the transform basis vector are obtained by taking the inner product of the 64x1 vector and each transform basis vector. The process of obtaining all the transform coefficients for the 64 transform basis vectors is to multiply the 64x64 non-separable transform matrix by the input 64x1 vector. Therefore, the total number of multiplications required for 8x8 forward NSST is 4096.
[0332] In the decoder, when an inverse 64x64 non-separable transform is applied to the 64x1 transform coefficients (ignoring the effects of quantization, integerization, etc.), the original 8x8 linear transform block coefficients can be restored. In other words, when the inverse 64x64 non-separable transform matrix is multiplied with the 64x1 transform coefficient vector, a 64x1 vector form of data is obtained, and when the data is arranged according to the row-major or column-major order that was originally applied, the 8x8 block signal (linear transform coefficients) can be restored. Thus, the total number of multiplications required for an 8x8 inverse NSST is 4096.
[0333] As mentioned above, when 8x8 NSST is applied, the number of multiplications required per sample is 64. This is the number obtained by dividing the total number of multiplications, 4096, obtained in the process of performing 8x8 NSST, which is the inner product process of the 64x1 vector and each transformation basis vector by the total number of samples, 64. The number of multiplications required is the same for both forward 8x8 NSST and reverse 8x8 NSST.
[0334] If we have a 16x16 block, the number of multiplications required per sample when applying 8x8 NSST is determined by the region to which 8x8 NSST is applied as follows:
[0335] 1. 8x8NSST applied only to the top left 8x8 region: 4096 (number of multiplications required in the 8x8NSST process) / 256 (total number of samples in the 16x16 block) = 16 multiplications / sample
[0336] 2. 8x8 NSST applied to the top left 8x8 region and the top right 8x8 region: 8192 (multiplications required for the two 8x8 NSST processes) / 256 (total number of samples in the 16x16 block) = 32 multiplications / sample
[0337] 3. 8x8 NSST applied to all 8x8 regions of a 16x16 block: 16384 (number of multiplications required for four 8x8 NSST processes) / 256 (total number of samples in a 16x16 block) = 64 multiplications / sample
[0338] As mentioned above, when the size of the blocks is large, the extent to which the 8x8 NSST is applied can be reduced in order to reduce the number of worst-case multiplications required per sample.
[0339] When 8×8 NSST is applied, the worst case occurs when the size of the TU is 8×8 in terms of the number of multiplications required per sample, since an 8×8 block is the smallest TU to which 8×8 NSST can be applied. In this case, a method for reducing the worst case complexity is as follows.
[0340] Method 1. Do not apply 8 × 8 NSST to small TUs (i.e., 8 × 8 TUs).
[0341] Method 2. For 8×8 blocks (8×8TU), apply 8×8RST instead of 8×8NSST.
[0342] In the case of Method 1, it was experimentally observed that not applying 8x8 NSST caused a significant drop in coding performance. In the case of Method 2, it was found that by applying inverse transform to some of the front transform coefficients without using all of the transform coefficients due to the statistical characteristics of the elements that make up the 64x1 transform coefficient vector, a signal that is quite close to the original signal can be restored, and most of the coding performance can be maintained.
[0343] Specifically, in the case of 8×8 RST, if the inverse (or forward) 64×64 non-separable transform is composed of 16 column basis vectors, only L column basis vectors are left to form a 64×L matrix. By leaving only the most important L transform coefficients among the transform coefficients, the 64×L matrix is multiplied by an L×1 vector, and a 64×1 vector with a small error compared to the original 64×1 vector data can be restored.
[0344] Also, as described in embodiment 11, RST may not be applied to all 64 transform coefficients contained in an 8x8 block, but may be applied to only a portion of the block (e.g., the remaining area of the 8x8 block excluding the 4x4 area in the lower right).
[0345] As a result, since only L coefficients are involved in data recovery, an L×1 transform coefficient vector is required to obtain transform coefficients, instead of a 64×1 transform coefficient vector. That is, an L×64 transform matrix is constructed by selecting L row-direction transform vectors in a forward 64×64 non-separable transform matrix, and L transform coefficients are obtained by multiplying the L×64 transform matrix by a 64×1 input vector.
[0346] The L value has a range of 1<=L<64, and generally, L of the 64 transformation basis vectors can be selected in any way, but as mentioned above, it may be advantageous in terms of coding efficiency to select a transformation basis vector with high signal energy importance from the perspective of encoding and decoding. The worst-case multiplication number per sample in an 8x8 block according to the change in the L value is as shown in Table 10 below.
[0347] [Table 10]
[0348] As mentioned above, in order to reduce worst-case multiplication complexity, 8×8 RSTs with different L values can be used in combination as shown in Table 11 below (however, the following example describes the conditions for applying 8×8 RST under the conditions for applying 8×8 NSST (i.e., when the width and height of the current block are all greater than or equal to 8)).
[0349] [Table 11]
[0350] Referring to Table 11, if the width and height of the current block are each 8, an 8×8 RST based on an 8×64 matrix is applied to the current block, otherwise (if either the width or height of the current block is not 8), an 8×8 RST based on a 16×64 matrix is applied to the current block. More specifically, if the size of the current block is 8×8, a non-separable transform having an input length of 64 and an output length of 8 is applied, otherwise a non-separable transform having an input length of 64 and an output length of 16 is applied. For the inverse non-separable transform, if the current block is 8×8, a non-separable transform having an input length of 8 and an output length of 64 is applied, otherwise a non-separable transform having an input length of 16 and an output length of 64 is applied.
[0351] Also, as described in embodiment 11, RST can be applied only to a part of an 8×8 block, not to the entire block, so that, for example, when RST is applied to the remaining area except for the 4×4 area at the lower right of the 8×8 block, an 8×8 RST based on an 8×48 or 16×18 matrix can be applied. That is, when the width and height of the current block are each 8, an 8×8 RST based on an 8×48 matrix is applied, and otherwise (when the width or height of the current block is not 8), an 8×8 RST based on a 16×48 matrix is applied.
[0352] For forward non-separable transforms, if the current block is 8x8, then a non-separable transform with input length 48 and output length 8 is applied, otherwise a non-separable transform with input length 48 and output length 16 is applied.
[0353] For the inverse non-separable transform, if the current block is 8x8, then a non-separable transform with input length 8 and output length 48 is applied, otherwise a non-separable transform with input length 16 and output length 48 is applied.
[0354] In conclusion, when RST is applied to a block larger than 8x8, based on the encoder side, if the block height and width are 8, a non-separable transform matrix (8x48 or 8x64 matrix) with input length less than or equal to 64 (e.g., 48 or 64) and output length less than 64 (e.g., 8) is applied, and if the block height or width is not 8, a non-separable transform matrix (16x48 or 16x64 matrix) with input length less than or equal to 64 (e.g., 48 or 64) and output length less than 64 (e.g., 16) is applied.
[0355] In addition, when RST is applied to a block larger than 8x8 based on the decoder side, if the height and width of the block are each 8, a non-separable transform matrix (48x8 or 64x8 matrix) having an input length less than 64 (e.g., 8) and an output length less than or equal to 64 (e.g., 48 or 64) is applied; if the height or width of the block is not 8, a non-separable transform matrix (48x16 or 64x16 matrix) having an input length less than 64 (e.g., 16) and an output length less than or equal to 64 (e.g., 48 or 64) is applied.
[0356] Table 12 is an example of the application of various 8x8 RST under the condition for applying 8x8 NSST (ie, when the width and height of the current block are greater than or equal to 8).
[0357] [Table 12]
[0358] Referring to Table 12, if the width and height of the current block are each 8, an 8×8 RST based on an 8×64 matrix (or an 8×48 matrix) is applied; if the product of the width and height of the current block is less than the critical value (TH), an 8×8 RST based on a 16×64 matrix (or a 16×48 matrix) is applied to the upper left 8×8 area of the current block; and in the remaining cases (if the width or height of the current block is not 8 and the product of the width and height of the current block is greater than or equal to the critical value), an 8×8 RST based on a 32×64 matrix (or a 32×48 matrix) is applied to the upper left 8×8 area of the current block.
[0359] FIG. 29 shows an example of an encoding flowchart for performing conversion according to an embodiment to which the present invention is applied.
[0360] The encoding apparatus 100 performs a primary transform on the residual block (S2910). The primary transform may be referred to as a core transform. In an embodiment, the encoding apparatus 100 performs the primary transform using the above-mentioned MTS. The encoding apparatus 100 also transmits an MTS index indicating a specific MTS among the MTS candidates to the decoding apparatus 200. Here, the MTS candidate is configured based on the intra prediction mode of the current block.
[0361] The encoding device 100 determines whether to apply a secondary transform (S2920). As an example, the encoding device 100 determines whether to apply a secondary transform based on the primary transformed residual transform coefficients. For example, the secondary transform may be NSST or RST.
[0362] The encoding device 100 determines the secondary transform (S2930). At this time, the encoding device 100 determines the secondary transform based on the NSST (or RST) transform set specified by the intra prediction mode.
[0363] Also, as an example, the encoding apparatus 100 determines the area to which the secondary transformation is applied based on the size of the current block prior to step S2930.
[0364] Encoding apparatus 100 performs secondary transformation using the secondary transformation determined in step S2930 (S2940).
[0365] FIG. 30 shows an example of a decoding flowchart for performing conversion according to an embodiment to which the present invention is applied.
[0366] The decoding device 200 determines whether to apply a secondary inverse transform (S3010). For example, the secondary inverse transform may be NSST or RST. As an example, the decoding device 200 determines whether to apply a secondary inverse transform based on a secondary transform flag received from the encoding device 100.
[0367] The decoding apparatus 200 determines a secondary inverse transform (S3020). Here, the decoding apparatus 200 may determine a secondary inverse transform to be applied to the current block based on an NSST (or RST) transform set specified by the above-described intra prediction mode.
[0368] Also, as an example, the decoding apparatus 200 determines an area to which the secondary inverse transform is applied based on the size of the current block prior to step S3020.
[0369] The decoding device 200 performs a secondary inverse transform on the inversely quantized residual block using the secondary inverse transform determined in step S3020 (S3030).
[0370] The decoding apparatus 200 performs a primary inverse transform on the secondary inverse transformed residual block (S3040). The primary inverse transform may be referred to as a core inverse transform. In an embodiment, the decoding apparatus 200 performs the primary inverse transform using the above-mentioned MTS. Also, as an example, the decoding apparatus 200 may determine whether MTS is applied to the current block prior to step S3040. In this case, the decoding flowchart of FIG. 30 may further include a step of determining whether MTS is applied.
[0371] For example, when MTS is applied to the current block (i.e., cu_mts_flag=1), the decoding apparatus 200 configures MTS candidates based on the intra prediction mode of the current block. In this case, the decoding flowchart of Fig. 30 may further include a step of configuring MTS candidates. The decoding apparatus 200 may then determine a linear inverse transform to be applied to the current block using mts_idx indicating a specific MTS among the configured MTS candidates.
[0372] FIG. 31 is an example of a detailed block diagram of the conversion unit 120 in the encoding device 100, which is an embodiment to which the present invention is applied.
[0373] The encoding device 100 to which the embodiment of the present invention is applied includes a primary conversion unit 3110 , a secondary conversion application decision unit 3120 , a secondary conversion decision unit 3130 , and a secondary conversion unit 3140 .
[0374] The primary transform unit 3110 may perform a primary transform on the residual block. The primary transform may be referred to as a core transform. In an embodiment, the primary transform unit 3110 performs the primary transform using the above-mentioned MTS. In addition, the primary transform unit 3110 transmits an MTS index indicating a specific MTS among the MTS candidates to the decoding apparatus 200. Here, the MTS candidate is configured based on the intra prediction mode of the current block.
[0375] The secondary transformation application determining unit 3120 may determine whether to apply a secondary transformation. For example, the secondary transformation application determining unit 3120 may determine whether to apply a secondary transformation based on a transformation coefficient of the primary transformed residual block. For example, the secondary transformation may be NSST or RST.
[0376] The secondary transform determination unit 3130 determines the secondary transform. At this time, the secondary transform determination unit 3130 determines the secondary transform based on the NSST (or RST) transform set specified by the intra prediction mode as described above.
[0377] Also, for example, the secondary transformation determination unit 3130 may determine the area to which the secondary transformation is applied based on the size of the current block.
[0378] The secondary transformation unit 3140 can perform the secondary transformation using the determined secondary transformation.
[0379] FIG. 32 shows an example of a detailed block diagram of the inverse transform unit 230 in the decoding device 200, which is an embodiment to which the present invention is applied.
[0380] The decoding device 200 to which the present invention is applied includes a secondary inverse transformation application determining unit 3210 , a secondary inverse transformation determining unit 3220 , a secondary inverse transformation unit 3230 , and a primary inverse transformation unit 3240 .
[0381] The secondary inverse transform application determining unit 3210 determines whether to apply the secondary inverse transform. For example, the secondary inverse transform may be NSST or RST. As an example, the secondary inverse transform application determining unit 3210 determines whether to apply the secondary inverse transform based on a secondary transform flag received from the encoding apparatus 100. As another example, the secondary inverse transform application determining unit 3210 may determine whether to apply the secondary inverse transform based on a transform coefficient of a residual block.
[0382] The secondary inverse transform decision unit 3220 decides a secondary inverse transform to be applied to the current block based on an NSST (or RST) transform set designated by the intra prediction mode.
[0383] Also, for example, the secondary inverse transform determination unit 3220 may determine an area to which the secondary inverse transform is applied based on the size of the current block.
[0384] Also, as an example, the secondary inverse transform unit 3230 may perform a secondary inverse transform on the inverse quantized residual block using the determined secondary inverse transform.
[0385] The primary inverse transform unit 3240 performs a primary inverse transform on the secondary inverse transformed residual block. As an embodiment, the primary inverse transform unit 3240 performs a primary transform using the above-mentioned MTS. As an example, the primary inverse transform unit 3240 may determine whether the MTS is applied to the current block.
[0386] For example, when MTS is applied to the current block (i.e., cu_mts_flag=1), the primary inverse transform unit 3240 configures MTS candidates based on the intra prediction mode of the current block, and determines the primary transform to be applied to the current block using mts_idx indicating a specific MTS among the configured MTS candidates.
[0387] 33 shows an example of a decoding flowchart in which a transform according to an embodiment of the present invention is applied. The operation of FIG.
[0388] In step S3305, the decoding apparatus 200 determines the input length and output length of the non-separable transform based on the height and width of the current block. Here, if the height and width of the current block are each 8, the input length of the non-separable transform is determined to be 8, and the output length is determined to be a value greater than the input length and less than or equal to 64 (e.g., 48 or 64). For example, when the non-separable transform is applied to all transform coefficients of an 8×8 block on the encoder side, the output length is determined to be 64, and when the non-separable transform is applied to a part of the transform coefficients of the 8×8 block (e.g., a part of the 8×8 block excluding the 4×4 area at the bottom right), the output length is determined to be 48.
[0389] In step S3310, the decoding device 200 determines a non-separable transform matrix corresponding to the input length and output length of the non-separable transform. For example, if the input length of the non-separable transform is 8 and the output length is 48 or 64 (if the size of the current block is 4×4), a 48×8 or 64×8 matrix derived from the transform kernel is determined as the non-separable transform, and if the input length of the non-separable transform is 16 and the output length is 48 or 64 (for example, if the current block is smaller than 8×8 and not 4×4), a 48×16 or 64×16 transform kernel can be determined as the non-separable transform.
[0390] According to an embodiment of the present invention, the decoding device 200 determines a non-separable transform set index (e.g., an NSST index) based on the intra prediction mode of the current block, determines a non-separable transform kernel corresponding to the non-separable transform index within the non-separable transform set included in the non-separable transform set index, and can determine a non-separable transform matrix from the non-separable transform kernel based on the input length and output length determined in step S3305.
[0391] In step S3315, the decoding device 200 applies the non-separable transform matrix determined for the current block to the coefficients of the input length (8 or 16) determined for the current block. For example, if the input length of the non-separable transform is 8 and the output length is 48 or 64, a 48×8 or 64×8 matrix derived from the transform kernel is applied to the 8 coefficients included in the current block, and if the input length of the non-separable transform is 16 and the output length is 48 or 64, a 48×16 or 64×16 matrix derived from the transform kernel can be applied to the 16 coefficients in the 4×4 region at the upper left of the current block. Here, the coefficients to which the non-separable transform is applied are the coefficients from the DC position of the current block to a position corresponding to the input length (e.g., 8 or 16) according to a determined scan order (e.g., (a), (b), or (c) of FIG. 16).
[0392] In addition, in the case where the height and width of the current block are not 8, if the product of the width and height of the current block is less than a critical value, the decoding device 200 applies a non-separable transform matrix (48×16 or 64×16 matrix) that inputs 16 coefficients in the upper left 4×4 area of the current block and outputs transformed coefficients for the output length (e.g., 48 or 64), and if the product of the width and height of the current block is greater than or equal to the critical value, the decoding device 200 applies a non-separable transform matrix (48×32 or 64×32 matrix) that inputs 32 coefficients of the current block and outputs transformed coefficients for the output length (e.g., 48 or 64).
[0393] When the output length is 64, 64 transformed data (transformed coefficients) to which non-separable transformation has been applied by applying a non-separable transformation matrix are placed in an 8x8 block, and when the output length is 48, 48 transformed data (transformed coefficients) to which non-separable transformation has been applied by applying a non-separable transformation matrix are placed in the remaining area of the 8x8 block excluding the 4x4 area at the bottom right.
[0394] 34 is an example of a block diagram of an apparatus for processing a video signal according to an embodiment of the present invention. An image processing apparatus 3400 in FIG. 34 may correspond to the encoding apparatus 100 in FIG. 1 or the decoding apparatus 200 in FIG.
[0395] An image processing device 3400 for processing image signals includes a memory 3420 for storing image signals, and a processor 3410 coupled to the memory for processing the image signals.
[0396] The processor 3410 according to an embodiment of the present invention includes at least one processing circuit for processing an image signal, and can process the image signal by executing an instruction for encoding or decoding the image signal. That is, the processor 3410 can encode original image data or decode an encoded image signal by executing the encoding or decoding method described above.
[0397] FIG. 35 shows an example of an image coding system to which the present invention is applied.
[0398] An image coding system includes a source device and a receiving device. The source device transmits encoded video / image information or data to the receiving device in the form of a file or streaming over a digital storage medium or a network.
[0399] The source device includes a video source, an encoding device, and a transmitter. The receiving device includes a receiver, a decoding device, and a renderer. The encoding device may be called a video / image encoding device, and the decoding device may be called a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, which may be a separate device or an external component.
[0400] A video source acquires video / images, such as by a video / image capture, synthesis or generation process. A video source includes a video / image capture device and / or a video / image generation device. A video / image capture device includes, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device includes, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate video / images. For example, a virtual video / image can be generated, such as by a computer, in which case the process of video / image capture can be replaced by the process of generating the associated data.
[0401] An encoding device encodes the input video / image. The encoding device may perform a series of steps such as prediction, transformation, and quantization for compression and coding efficiency. The encoded data (encoded video / image information) is output in the form of a bitstream.
[0402] The transmitter transmits the encoded video / image information or data output in the form of a bitstream to a receiver of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium includes various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter includes elements for generating a media file according to a predetermined file format and elements for transmission via a broadcast / communication network. The receiver extracts the bitstream and transmits it to a decoding device.
[0403] The decoding device decodes the video / image by carrying out a series of steps such as inverse quantization, inverse transformation, prediction, etc., which correspond to the operations of the encoding device.
[0404] The renderer renders the decoded video / images, which are then displayed via a display unit.
[0405] FIG. 36 is a structural diagram of a content streaming system according to an embodiment of the present invention.
[0406] The content streaming system to which the present invention is applied includes an encoding server, a streaming server, a web server, a media repository, a user device and a multimedia input device.
[0407] 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.
[0408] The bitstream is generated by an encoding method or a bitstream generating method to which the present invention is applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0409] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server serves as a medium for informing the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits multimedia data to the user. Here, the content streaming system may include a separate control server, and in this case, the control server serves to control commands / responses between each device in the content streaming system.
[0410] The streaming server receives the content from a media repository and / or an encoding server. For example, when receiving the content from an encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.
[0411] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glass, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, and the like.
[0412] Each server in the content streaming system can be operated as a distributed server, in which case data received by each server can be processed in a distributed manner.
[0413] In addition, the processing method to which the present invention is applied can be produced in the form of a program executed by a computer and can be stored in a computer-readable storage medium. Multimedia data having a data structure according to the present invention can also be stored in a computer-readable storage medium. The computer-readable storage medium includes any kind of storage device and distributed storage device in which computer-readable data is stored. The computer-readable storage medium can include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable storage medium also includes a medium realized in the form of a carrier wave (e.g., transmission through the Internet). Also, a bit stream generated by the encoding method can be stored in a computer-readable storage medium or transferred via a wired / wireless communication network.
[0414] Furthermore, the embodiments of the present invention may be realized as a computer program product by program code, which may be executed on a computer according to the embodiments of the present invention. The program code may be stored on a carrier readable by the computer.
[0415] As described above, the embodiments described in the present invention may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units shown in each figure may be implemented and executed on a computer, processor, microprocessor, controller, or chip.
[0416] In addition, the decoder and encoder to which the present invention is applied may be included in real-time communication devices such as multimedia broadcasting transmitting / receiving devices, mobile communication terminals, home cinema video devices, digital cinema video devices, surveillance cameras, video interactive devices, video communications, etc., mobile streaming devices, storage media, camcorders, video on demand (VoD) service providing devices, OTT video (Over the top video) devices, Internet streaming service providing devices, three-dimensional (3D) video devices, video phones, video devices, and medical video devices, and are used to process video signals or data signals. For example, OTT video (Over the top video) devices may include game consoles, Blu-ray players, Internet-connected TVs, home theater systems, smartphones, tablet PCs, DVRs (Digital Video Recorders), etc.
[0417] In addition, the processing method to which the present invention is applied can be produced in the form of a program executed by a computer and can be stored in a computer-readable storage medium. Multimedia data having a data structure according to the present invention can also be stored in a computer-readable storage medium. The computer-readable storage medium includes any kind of storage device and distributed storage device in which computer-readable data is stored. The computer-readable storage medium can include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable storage medium also includes a medium realized in the form of a carrier wave (e.g., transmission through the Internet). Also, a bit stream generated by the encoding method can be stored in a computer-readable storage medium or transferred via a wired / wireless communication network.
[0418] Furthermore, the embodiments of the present invention may be realized as a computer program product by program code, which may be executed on a computer according to the embodiments of the present invention. The program code may be stored on a carrier readable by the computer.
[0419] The above-described embodiments are combinations of the components and features of the present invention in a predetermined form. Each component or feature should be considered as optional unless otherwise explicitly stated. Each component or feature may be implemented in a form not combined with other components or features. It is also possible to combine some components and / or features to configure an embodiment of the present invention. The order of operations described in the embodiments of the present invention may be changed. Some configurations or features of any embodiment may be included in other embodiments, or may be replaced with corresponding configurations or features of other embodiments. It is obvious that claims that do not have an explicit reference relationship in the claims may be combined to configure an embodiment, or may be included as a new claim by amendment after filing.
[0420] Embodiments of the present invention may be implemented in various ways, such as hardware, firmware, software, or a combination thereof. In a hardware implementation, an embodiment of the present invention may be implemented using one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.
[0421] In the case of implementation by firmware or software, an embodiment of the present invention may be implemented in the form of a module, procedure, function, etc. that performs the functions or operations described above. The software code may be stored in a memory and driven by a processor. The memory may be located inside or outside the processor and may transmit and receive data to and from the processor by various means known in the art.
[0422] It is obvious to those skilled in the art that the present invention can be embodied in other specific forms without departing from the essential features of the present invention. Therefore, the above detailed description should not be interpreted as limiting in all respects, but should be regarded as illustrative. The scope of the present invention should be determined by a reasonable interpretation of the appended claims, and all modifications within the equivalent scope of the present invention are included in the scope of the present invention. [Industrial Applicability]
[0423] The above-described preferred embodiments of the present invention have been disclosed for illustrative purposes, and those skilled in the art may improve, modify, substitute or add various other embodiments within the technical idea and technical scope of the present invention disclosed in the appended claims below.
Claims
1. 1. A method for decoding an image signal, comprising: determining the input and output lengths of a non-separable transform based on the height and width of the current block; determining a non-separable transformation matrix associated with the input length and the output length of the non-separable transformation; applying the non-separable transform matrix to coefficients of the current block, the number of coefficients being related to the input length of the non-separable transform; the input length and the output length of the non-separable transform are determined separately; Based on the height and the width of the current block, a size of the non-separable transformation matrix is determined as one of four predefined sizes; based on both the height and the width of the current block being greater than 8, the input length of the non-separable transform is determined to be 16, and the output length of the non-separable transform is greater than the input length of the non-separable transform; The method of claim 1, wherein the input length of the non-separable transform is determined to be eight based on both the height and the width of the current block being equal to eight, and the output length of the non-separable transform is greater than the input length of the non-separable transform.
2. 1. A method for encoding an image signal, comprising: determining the input and output lengths of a non-separable transform based on the height and width of the current block; determining a non-separable transform matrix for the current block associated with the input length and the output length of the non-separable transform; applying the non-separable transform matrix to coefficients of the current block, the number of coefficients being related to the input length of the non-separable transform; and encoding non-separable transform index information for the non-separable transform matrix for the current block; the input length and the output length of the non-separable transform are determined separately; Based on the height and the width of the current block, a size of the non-separable transformation matrix is determined as one of four predefined sizes; the output length of the non-separable transform is determined to be 16 based on both the height and the width of the current block being greater than 8, and the input length of the non-separable transform is greater than the output length of the non-separable transform; The method of claim 1, wherein the output length of the non-separable transform is determined to be 8 based on both the height and the width of the current block being equal to 8, and the input length of the non-separable transform is greater than the output length of the non-separable transform.
3. 1. A method for transmitting a bitstream generated by a method for encoding an image signal, the method comprising: determining the input and output lengths of a non-separable transform based on the height and width of the current block; determining a non-separable transform matrix for the current block associated with the input length and the output length of the non-separable transform; applying the non-separable transform matrix to coefficients of the current block, the number of coefficients being related to the input length of the non-separable transform; and encoding non-separable transform index information for the non-separable transform matrix for the current block; the input length and the output length of the non-separable transform are determined separately; Based on the height and the width of the current block, a size of the non-separable transformation matrix is determined as one of four predefined sizes; the output length of the non-separable transform is determined to be 16 based on both the height and the width of the current block being greater than 8, and the input length of the non-separable transform is greater than the output length of the non-separable transform; The method of claim 1, wherein the output length of the non-separable transform is determined to be 8 based on both the height and the width of the current block being equal to 8, and the input length of the non-separable transform is greater than the output length of the non-separable transform.
Citation Information
Patent Citations
Reduced size inverse transform for decoding and encoding
US20170034530A1
Method and apparatus for video coding
US20200304782A1
Non-separable secondary transform for video coding
WO2017058614A1
